index.js 1.3 MB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604206052060620607206082060920610206112061220613206142061520616206172061820619206202062120622206232062420625206262062720628206292063020631206322063320634206352063620637206382063920640206412064220643206442064520646206472064820649206502065120652206532065420655206562065720658206592066020661206622066320664206652066620667206682066920670206712067220673206742067520676206772067820679206802068120682206832068420685206862068720688206892069020691206922069320694206952069620697206982069920700207012070220703207042070520706207072070820709207102071120712207132071420715207162071720718207192072020721207222072320724207252072620727207282072920730207312073220733207342073520736207372073820739207402074120742207432074420745207462074720748207492075020751207522075320754207552075620757207582075920760207612076220763207642076520766207672076820769207702077120772207732077420775207762077720778207792078020781207822078320784207852078620787207882078920790207912079220793207942079520796207972079820799208002080120802208032080420805208062080720808208092081020811208122081320814208152081620817208182081920820208212082220823208242082520826208272082820829208302083120832208332083420835208362083720838208392084020841208422084320844208452084620847208482084920850208512085220853208542085520856208572085820859208602086120862208632086420865208662086720868208692087020871208722087320874208752087620877208782087920880208812088220883208842088520886208872088820889208902089120892208932089420895208962089720898208992090020901209022090320904209052090620907209082090920910209112091220913209142091520916209172091820919209202092120922209232092420925209262092720928209292093020931209322093320934209352093620937209382093920940209412094220943209442094520946209472094820949209502095120952209532095420955209562095720958209592096020961209622096320964209652096620967209682096920970209712097220973209742097520976209772097820979209802098120982209832098420985209862098720988209892099020991209922099320994209952099620997209982099921000210012100221003210042100521006210072100821009210102101121012210132101421015210162101721018210192102021021210222102321024210252102621027210282102921030210312103221033210342103521036210372103821039210402104121042210432104421045210462104721048210492105021051210522105321054210552105621057210582105921060210612106221063210642106521066210672106821069210702107121072210732107421075210762107721078210792108021081210822108321084210852108621087210882108921090210912109221093210942109521096210972109821099211002110121102211032110421105211062110721108211092111021111211122111321114211152111621117211182111921120211212112221123211242112521126211272112821129211302113121132211332113421135211362113721138211392114021141211422114321144211452114621147211482114921150211512115221153211542115521156211572115821159211602116121162211632116421165211662116721168211692117021171211722117321174211752117621177211782117921180211812118221183211842118521186211872118821189211902119121192211932119421195211962119721198211992120021201212022120321204212052120621207212082120921210212112121221213212142121521216212172121821219212202122121222212232122421225212262122721228212292123021231212322123321234212352123621237212382123921240212412124221243212442124521246212472124821249212502125121252212532125421255212562125721258212592126021261212622126321264212652126621267212682126921270212712127221273212742127521276212772127821279212802128121282212832128421285212862128721288212892129021291212922129321294212952129621297212982129921300213012130221303213042130521306213072130821309213102131121312213132131421315213162131721318213192132021321213222132321324213252132621327213282132921330213312133221333213342133521336213372133821339213402134121342213432134421345213462134721348213492135021351213522135321354213552135621357213582135921360213612136221363213642136521366213672136821369213702137121372213732137421375213762137721378213792138021381213822138321384213852138621387213882138921390213912139221393213942139521396213972139821399214002140121402214032140421405214062140721408214092141021411214122141321414214152141621417214182141921420214212142221423214242142521426214272142821429214302143121432214332143421435214362143721438214392144021441214422144321444214452144621447214482144921450214512145221453214542145521456214572145821459214602146121462214632146421465214662146721468214692147021471214722147321474214752147621477214782147921480214812148221483214842148521486214872148821489214902149121492214932149421495214962149721498214992150021501215022150321504215052150621507215082150921510215112151221513215142151521516215172151821519215202152121522215232152421525215262152721528215292153021531215322153321534215352153621537215382153921540215412154221543215442154521546215472154821549215502155121552215532155421555215562155721558215592156021561215622156321564215652156621567215682156921570215712157221573215742157521576215772157821579215802158121582215832158421585215862158721588215892159021591215922159321594215952159621597215982159921600216012160221603216042160521606216072160821609216102161121612216132161421615216162161721618216192162021621216222162321624216252162621627216282162921630216312163221633216342163521636216372163821639216402164121642216432164421645216462164721648216492165021651216522165321654216552165621657216582165921660216612166221663216642166521666216672166821669216702167121672216732167421675216762167721678216792168021681216822168321684216852168621687216882168921690216912169221693216942169521696216972169821699217002170121702217032170421705217062170721708217092171021711217122171321714217152171621717217182171921720217212172221723217242172521726217272172821729217302173121732217332173421735217362173721738217392174021741217422174321744217452174621747217482174921750217512175221753217542175521756217572175821759217602176121762217632176421765217662176721768217692177021771217722177321774217752177621777217782177921780217812178221783217842178521786217872178821789217902179121792217932179421795217962179721798217992180021801218022180321804218052180621807218082180921810218112181221813218142181521816218172181821819218202182121822218232182421825218262182721828218292183021831218322183321834218352183621837218382183921840218412184221843218442184521846218472184821849218502185121852218532185421855218562185721858218592186021861218622186321864218652186621867218682186921870218712187221873218742187521876218772187821879218802188121882218832188421885218862188721888218892189021891218922189321894218952189621897218982189921900219012190221903219042190521906219072190821909219102191121912219132191421915219162191721918219192192021921219222192321924219252192621927219282192921930219312193221933219342193521936219372193821939219402194121942219432194421945219462194721948219492195021951219522195321954219552195621957219582195921960219612196221963219642196521966219672196821969219702197121972219732197421975219762197721978219792198021981219822198321984219852198621987219882198921990219912199221993219942199521996219972199821999220002200122002220032200422005220062200722008220092201022011220122201322014220152201622017220182201922020220212202222023220242202522026220272202822029220302203122032220332203422035220362203722038220392204022041220422204322044220452204622047220482204922050220512205222053220542205522056220572205822059220602206122062220632206422065220662206722068220692207022071220722207322074220752207622077220782207922080220812208222083220842208522086220872208822089220902209122092220932209422095220962209722098220992210022101221022210322104221052210622107221082210922110221112211222113221142211522116221172211822119221202212122122221232212422125221262212722128221292213022131221322213322134221352213622137221382213922140221412214222143221442214522146221472214822149221502215122152221532215422155221562215722158221592216022161221622216322164221652216622167221682216922170221712217222173221742217522176221772217822179221802218122182221832218422185221862218722188221892219022191221922219322194221952219622197221982219922200222012220222203222042220522206222072220822209222102221122212222132221422215222162221722218222192222022221222222222322224222252222622227222282222922230222312223222233222342223522236222372223822239222402224122242222432224422245222462224722248222492225022251222522225322254222552225622257222582225922260222612226222263222642226522266222672226822269222702227122272222732227422275222762227722278222792228022281222822228322284222852228622287222882228922290222912229222293222942229522296222972229822299223002230122302223032230422305223062230722308223092231022311223122231322314223152231622317223182231922320223212232222323223242232522326223272232822329223302233122332223332233422335223362233722338223392234022341223422234322344223452234622347223482234922350223512235222353223542235522356223572235822359223602236122362223632236422365223662236722368223692237022371223722237322374223752237622377223782237922380223812238222383223842238522386223872238822389223902239122392223932239422395223962239722398223992240022401224022240322404224052240622407224082240922410224112241222413224142241522416224172241822419224202242122422224232242422425224262242722428224292243022431224322243322434224352243622437224382243922440224412244222443224442244522446224472244822449224502245122452224532245422455224562245722458224592246022461224622246322464224652246622467224682246922470224712247222473224742247522476224772247822479224802248122482224832248422485224862248722488224892249022491224922249322494224952249622497224982249922500225012250222503225042250522506225072250822509225102251122512225132251422515225162251722518225192252022521225222252322524225252252622527225282252922530225312253222533225342253522536225372253822539225402254122542225432254422545225462254722548225492255022551225522255322554225552255622557225582255922560225612256222563225642256522566225672256822569225702257122572225732257422575225762257722578225792258022581225822258322584225852258622587225882258922590225912259222593225942259522596225972259822599226002260122602226032260422605226062260722608226092261022611226122261322614226152261622617226182261922620226212262222623226242262522626226272262822629226302263122632226332263422635226362263722638226392264022641226422264322644226452264622647226482264922650226512265222653226542265522656226572265822659226602266122662226632266422665226662266722668226692267022671226722267322674226752267622677226782267922680226812268222683226842268522686226872268822689226902269122692226932269422695226962269722698226992270022701227022270322704227052270622707227082270922710227112271222713227142271522716227172271822719227202272122722227232272422725227262272722728227292273022731227322273322734227352273622737227382273922740227412274222743227442274522746227472274822749227502275122752227532275422755227562275722758227592276022761227622276322764227652276622767227682276922770227712277222773227742277522776227772277822779227802278122782227832278422785227862278722788227892279022791227922279322794227952279622797227982279922800228012280222803228042280522806228072280822809228102281122812228132281422815228162281722818228192282022821228222282322824228252282622827228282282922830228312283222833228342283522836228372283822839228402284122842228432284422845228462284722848228492285022851228522285322854228552285622857228582285922860228612286222863228642286522866228672286822869228702287122872228732287422875228762287722878228792288022881228822288322884228852288622887228882288922890228912289222893228942289522896228972289822899229002290122902229032290422905229062290722908229092291022911229122291322914229152291622917229182291922920229212292222923229242292522926229272292822929229302293122932229332293422935229362293722938229392294022941229422294322944229452294622947229482294922950229512295222953229542295522956229572295822959229602296122962229632296422965229662296722968229692297022971229722297322974229752297622977229782297922980229812298222983229842298522986229872298822989229902299122992229932299422995229962299722998229992300023001230022300323004230052300623007230082300923010230112301223013230142301523016230172301823019230202302123022230232302423025230262302723028230292303023031230322303323034230352303623037230382303923040230412304223043230442304523046230472304823049230502305123052230532305423055230562305723058230592306023061230622306323064230652306623067230682306923070230712307223073230742307523076230772307823079230802308123082230832308423085230862308723088230892309023091230922309323094230952309623097230982309923100231012310223103231042310523106231072310823109231102311123112231132311423115231162311723118231192312023121231222312323124231252312623127231282312923130231312313223133231342313523136231372313823139231402314123142231432314423145231462314723148231492315023151231522315323154231552315623157231582315923160231612316223163231642316523166231672316823169231702317123172231732317423175231762317723178231792318023181231822318323184231852318623187231882318923190231912319223193231942319523196231972319823199232002320123202232032320423205232062320723208232092321023211232122321323214232152321623217232182321923220232212322223223232242322523226232272322823229232302323123232232332323423235232362323723238232392324023241232422324323244232452324623247232482324923250232512325223253232542325523256232572325823259232602326123262232632326423265232662326723268232692327023271232722327323274232752327623277232782327923280232812328223283232842328523286232872328823289232902329123292232932329423295232962329723298232992330023301233022330323304233052330623307233082330923310233112331223313233142331523316233172331823319233202332123322233232332423325233262332723328233292333023331233322333323334233352333623337233382333923340233412334223343233442334523346233472334823349233502335123352233532335423355233562335723358233592336023361233622336323364233652336623367233682336923370233712337223373233742337523376233772337823379233802338123382233832338423385233862338723388233892339023391233922339323394233952339623397233982339923400234012340223403234042340523406234072340823409234102341123412234132341423415234162341723418234192342023421234222342323424234252342623427234282342923430234312343223433234342343523436234372343823439234402344123442234432344423445234462344723448234492345023451234522345323454234552345623457234582345923460234612346223463234642346523466234672346823469234702347123472234732347423475234762347723478234792348023481234822348323484234852348623487234882348923490234912349223493234942349523496234972349823499235002350123502235032350423505235062350723508235092351023511235122351323514235152351623517235182351923520235212352223523235242352523526235272352823529235302353123532235332353423535235362353723538235392354023541235422354323544235452354623547235482354923550235512355223553235542355523556235572355823559235602356123562235632356423565235662356723568235692357023571235722357323574235752357623577235782357923580235812358223583235842358523586235872358823589235902359123592235932359423595235962359723598235992360023601236022360323604236052360623607236082360923610236112361223613236142361523616236172361823619236202362123622236232362423625236262362723628236292363023631236322363323634236352363623637236382363923640236412364223643236442364523646236472364823649236502365123652236532365423655236562365723658236592366023661236622366323664236652366623667236682366923670236712367223673236742367523676236772367823679236802368123682236832368423685236862368723688236892369023691236922369323694236952369623697236982369923700237012370223703237042370523706237072370823709237102371123712237132371423715237162371723718237192372023721237222372323724237252372623727237282372923730237312373223733237342373523736237372373823739237402374123742237432374423745237462374723748237492375023751237522375323754237552375623757237582375923760237612376223763237642376523766237672376823769237702377123772237732377423775237762377723778237792378023781237822378323784237852378623787237882378923790237912379223793237942379523796237972379823799238002380123802238032380423805238062380723808238092381023811238122381323814238152381623817238182381923820238212382223823238242382523826238272382823829238302383123832238332383423835238362383723838238392384023841238422384323844238452384623847238482384923850238512385223853238542385523856238572385823859238602386123862238632386423865238662386723868238692387023871238722387323874238752387623877238782387923880238812388223883238842388523886238872388823889238902389123892238932389423895238962389723898238992390023901239022390323904239052390623907239082390923910239112391223913239142391523916239172391823919239202392123922239232392423925239262392723928239292393023931239322393323934239352393623937239382393923940239412394223943239442394523946239472394823949239502395123952239532395423955239562395723958239592396023961239622396323964239652396623967239682396923970239712397223973239742397523976239772397823979239802398123982239832398423985239862398723988239892399023991239922399323994239952399623997239982399924000240012400224003240042400524006240072400824009240102401124012240132401424015240162401724018240192402024021240222402324024240252402624027240282402924030240312403224033240342403524036240372403824039240402404124042240432404424045240462404724048240492405024051240522405324054240552405624057240582405924060240612406224063240642406524066240672406824069240702407124072240732407424075240762407724078240792408024081240822408324084240852408624087240882408924090240912409224093240942409524096240972409824099241002410124102241032410424105241062410724108241092411024111241122411324114241152411624117241182411924120241212412224123241242412524126241272412824129241302413124132241332413424135241362413724138241392414024141241422414324144241452414624147241482414924150241512415224153241542415524156241572415824159241602416124162241632416424165241662416724168241692417024171241722417324174241752417624177241782417924180241812418224183241842418524186241872418824189241902419124192241932419424195241962419724198241992420024201242022420324204242052420624207242082420924210242112421224213242142421524216242172421824219242202422124222242232422424225242262422724228242292423024231242322423324234242352423624237242382423924240242412424224243242442424524246242472424824249242502425124252242532425424255242562425724258242592426024261242622426324264242652426624267242682426924270242712427224273242742427524276242772427824279242802428124282242832428424285242862428724288242892429024291242922429324294242952429624297242982429924300243012430224303243042430524306243072430824309243102431124312243132431424315243162431724318243192432024321243222432324324243252432624327243282432924330243312433224333243342433524336243372433824339243402434124342243432434424345243462434724348243492435024351243522435324354243552435624357243582435924360243612436224363243642436524366243672436824369243702437124372243732437424375243762437724378243792438024381243822438324384243852438624387243882438924390243912439224393243942439524396243972439824399244002440124402244032440424405244062440724408244092441024411244122441324414244152441624417244182441924420244212442224423244242442524426244272442824429244302443124432244332443424435244362443724438244392444024441244422444324444244452444624447244482444924450244512445224453244542445524456244572445824459244602446124462244632446424465244662446724468244692447024471244722447324474244752447624477244782447924480244812448224483244842448524486244872448824489244902449124492244932449424495244962449724498244992450024501245022450324504245052450624507245082450924510245112451224513245142451524516245172451824519245202452124522245232452424525245262452724528245292453024531245322453324534245352453624537245382453924540245412454224543245442454524546245472454824549245502455124552245532455424555245562455724558245592456024561245622456324564245652456624567245682456924570245712457224573245742457524576245772457824579245802458124582245832458424585245862458724588245892459024591245922459324594245952459624597245982459924600246012460224603246042460524606246072460824609246102461124612246132461424615246162461724618246192462024621246222462324624246252462624627246282462924630246312463224633246342463524636246372463824639246402464124642246432464424645246462464724648246492465024651246522465324654246552465624657246582465924660246612466224663246642466524666246672466824669246702467124672246732467424675246762467724678246792468024681246822468324684246852468624687246882468924690246912469224693246942469524696246972469824699247002470124702247032470424705247062470724708247092471024711247122471324714247152471624717247182471924720247212472224723247242472524726247272472824729247302473124732247332473424735247362473724738247392474024741247422474324744247452474624747247482474924750247512475224753247542475524756247572475824759247602476124762247632476424765247662476724768247692477024771247722477324774247752477624777247782477924780247812478224783247842478524786247872478824789247902479124792247932479424795247962479724798247992480024801248022480324804248052480624807248082480924810248112481224813248142481524816248172481824819248202482124822248232482424825248262482724828248292483024831248322483324834248352483624837248382483924840248412484224843248442484524846248472484824849248502485124852248532485424855248562485724858248592486024861248622486324864248652486624867248682486924870248712487224873248742487524876248772487824879248802488124882248832488424885248862488724888248892489024891248922489324894248952489624897248982489924900249012490224903249042490524906249072490824909249102491124912249132491424915249162491724918249192492024921249222492324924249252492624927249282492924930249312493224933249342493524936249372493824939249402494124942249432494424945249462494724948249492495024951249522495324954249552495624957249582495924960249612496224963249642496524966249672496824969249702497124972249732497424975249762497724978249792498024981249822498324984249852498624987249882498924990249912499224993249942499524996249972499824999250002500125002250032500425005250062500725008250092501025011250122501325014250152501625017250182501925020250212502225023250242502525026250272502825029250302503125032250332503425035250362503725038250392504025041250422504325044250452504625047250482504925050250512505225053250542505525056250572505825059250602506125062250632506425065250662506725068250692507025071250722507325074250752507625077250782507925080250812508225083250842508525086250872508825089250902509125092250932509425095250962509725098250992510025101251022510325104251052510625107251082510925110251112511225113251142511525116251172511825119251202512125122251232512425125251262512725128251292513025131251322513325134251352513625137251382513925140251412514225143251442514525146251472514825149251502515125152251532515425155251562515725158251592516025161251622516325164251652516625167251682516925170251712517225173251742517525176251772517825179251802518125182251832518425185251862518725188251892519025191251922519325194251952519625197251982519925200252012520225203252042520525206252072520825209252102521125212252132521425215252162521725218252192522025221252222522325224252252522625227252282522925230252312523225233252342523525236252372523825239252402524125242252432524425245252462524725248252492525025251252522525325254252552525625257252582525925260252612526225263252642526525266252672526825269252702527125272252732527425275252762527725278252792528025281252822528325284252852528625287252882528925290252912529225293252942529525296252972529825299253002530125302253032530425305253062530725308253092531025311253122531325314253152531625317253182531925320253212532225323253242532525326253272532825329253302533125332253332533425335253362533725338253392534025341253422534325344253452534625347253482534925350253512535225353253542535525356253572535825359253602536125362253632536425365253662536725368253692537025371253722537325374253752537625377253782537925380253812538225383253842538525386253872538825389253902539125392253932539425395253962539725398253992540025401254022540325404254052540625407254082540925410254112541225413254142541525416254172541825419254202542125422254232542425425254262542725428254292543025431254322543325434254352543625437254382543925440254412544225443254442544525446254472544825449254502545125452254532545425455254562545725458254592546025461254622546325464254652546625467254682546925470254712547225473254742547525476254772547825479254802548125482254832548425485254862548725488254892549025491254922549325494254952549625497254982549925500255012550225503255042550525506255072550825509255102551125512255132551425515255162551725518255192552025521255222552325524255252552625527255282552925530255312553225533255342553525536255372553825539255402554125542255432554425545255462554725548255492555025551255522555325554255552555625557255582555925560255612556225563255642556525566255672556825569255702557125572255732557425575255762557725578255792558025581255822558325584255852558625587255882558925590255912559225593255942559525596255972559825599256002560125602256032560425605256062560725608256092561025611256122561325614256152561625617256182561925620256212562225623256242562525626256272562825629256302563125632256332563425635256362563725638256392564025641256422564325644256452564625647256482564925650256512565225653256542565525656256572565825659256602566125662256632566425665256662566725668256692567025671256722567325674256752567625677256782567925680256812568225683256842568525686256872568825689256902569125692256932569425695256962569725698256992570025701257022570325704257052570625707257082570925710257112571225713257142571525716257172571825719257202572125722257232572425725257262572725728257292573025731257322573325734257352573625737257382573925740257412574225743257442574525746257472574825749257502575125752257532575425755257562575725758257592576025761257622576325764257652576625767257682576925770257712577225773257742577525776257772577825779257802578125782257832578425785257862578725788257892579025791257922579325794257952579625797257982579925800258012580225803258042580525806258072580825809258102581125812258132581425815258162581725818258192582025821258222582325824258252582625827258282582925830258312583225833258342583525836258372583825839258402584125842258432584425845258462584725848258492585025851258522585325854258552585625857258582585925860258612586225863258642586525866258672586825869258702587125872258732587425875258762587725878258792588025881258822588325884258852588625887258882588925890258912589225893258942589525896258972589825899259002590125902259032590425905259062590725908259092591025911259122591325914259152591625917259182591925920259212592225923259242592525926259272592825929259302593125932259332593425935259362593725938259392594025941259422594325944259452594625947259482594925950259512595225953259542595525956259572595825959259602596125962259632596425965259662596725968259692597025971259722597325974259752597625977259782597925980259812598225983259842598525986259872598825989259902599125992259932599425995259962599725998259992600026001260022600326004260052600626007260082600926010260112601226013260142601526016260172601826019260202602126022260232602426025260262602726028260292603026031260322603326034260352603626037260382603926040260412604226043260442604526046260472604826049260502605126052260532605426055260562605726058260592606026061260622606326064260652606626067260682606926070260712607226073260742607526076260772607826079260802608126082260832608426085260862608726088260892609026091260922609326094260952609626097260982609926100261012610226103261042610526106261072610826109261102611126112261132611426115261162611726118261192612026121261222612326124261252612626127261282612926130261312613226133261342613526136261372613826139261402614126142261432614426145261462614726148261492615026151261522615326154261552615626157261582615926160261612616226163261642616526166261672616826169261702617126172261732617426175261762617726178261792618026181261822618326184261852618626187261882618926190261912619226193261942619526196261972619826199262002620126202262032620426205262062620726208262092621026211262122621326214262152621626217262182621926220262212622226223262242622526226262272622826229262302623126232262332623426235262362623726238262392624026241262422624326244262452624626247262482624926250262512625226253262542625526256262572625826259262602626126262262632626426265262662626726268262692627026271262722627326274262752627626277262782627926280262812628226283262842628526286262872628826289262902629126292262932629426295262962629726298262992630026301263022630326304263052630626307263082630926310263112631226313263142631526316263172631826319263202632126322263232632426325263262632726328263292633026331263322633326334263352633626337263382633926340263412634226343263442634526346263472634826349263502635126352263532635426355263562635726358263592636026361263622636326364263652636626367263682636926370263712637226373263742637526376263772637826379263802638126382263832638426385263862638726388263892639026391263922639326394263952639626397263982639926400264012640226403264042640526406264072640826409264102641126412264132641426415264162641726418264192642026421264222642326424264252642626427264282642926430264312643226433264342643526436264372643826439264402644126442264432644426445264462644726448264492645026451264522645326454264552645626457264582645926460264612646226463264642646526466264672646826469264702647126472264732647426475264762647726478264792648026481264822648326484264852648626487264882648926490264912649226493264942649526496264972649826499265002650126502265032650426505265062650726508265092651026511265122651326514265152651626517265182651926520265212652226523265242652526526265272652826529265302653126532265332653426535265362653726538265392654026541265422654326544265452654626547265482654926550265512655226553265542655526556265572655826559265602656126562265632656426565265662656726568265692657026571265722657326574265752657626577265782657926580265812658226583265842658526586265872658826589265902659126592265932659426595265962659726598265992660026601266022660326604266052660626607266082660926610266112661226613266142661526616266172661826619266202662126622266232662426625266262662726628266292663026631266322663326634266352663626637266382663926640266412664226643266442664526646266472664826649266502665126652266532665426655266562665726658266592666026661266622666326664266652666626667266682666926670266712667226673266742667526676266772667826679266802668126682266832668426685266862668726688266892669026691266922669326694266952669626697266982669926700267012670226703267042670526706267072670826709267102671126712267132671426715267162671726718267192672026721267222672326724267252672626727267282672926730267312673226733267342673526736267372673826739267402674126742267432674426745267462674726748267492675026751267522675326754267552675626757267582675926760267612676226763267642676526766267672676826769267702677126772267732677426775267762677726778267792678026781267822678326784267852678626787267882678926790267912679226793267942679526796267972679826799268002680126802268032680426805268062680726808268092681026811268122681326814268152681626817268182681926820268212682226823268242682526826268272682826829268302683126832268332683426835268362683726838268392684026841268422684326844268452684626847268482684926850268512685226853268542685526856268572685826859268602686126862268632686426865268662686726868268692687026871268722687326874268752687626877268782687926880268812688226883268842688526886268872688826889268902689126892268932689426895268962689726898268992690026901269022690326904269052690626907269082690926910269112691226913269142691526916269172691826919269202692126922269232692426925269262692726928269292693026931269322693326934269352693626937269382693926940269412694226943269442694526946269472694826949269502695126952269532695426955269562695726958269592696026961269622696326964269652696626967269682696926970269712697226973269742697526976269772697826979269802698126982269832698426985269862698726988269892699026991269922699326994269952699626997269982699927000270012700227003270042700527006270072700827009270102701127012270132701427015270162701727018270192702027021270222702327024270252702627027270282702927030270312703227033270342703527036270372703827039270402704127042270432704427045270462704727048270492705027051270522705327054270552705627057270582705927060270612706227063270642706527066270672706827069270702707127072270732707427075270762707727078270792708027081270822708327084270852708627087270882708927090270912709227093270942709527096270972709827099271002710127102271032710427105271062710727108271092711027111271122711327114271152711627117271182711927120271212712227123271242712527126271272712827129271302713127132271332713427135271362713727138271392714027141271422714327144271452714627147271482714927150271512715227153271542715527156271572715827159271602716127162271632716427165271662716727168271692717027171271722717327174271752717627177271782717927180271812718227183271842718527186271872718827189271902719127192271932719427195271962719727198271992720027201272022720327204272052720627207272082720927210272112721227213272142721527216272172721827219272202722127222272232722427225272262722727228272292723027231272322723327234272352723627237272382723927240272412724227243272442724527246272472724827249272502725127252272532725427255272562725727258272592726027261272622726327264272652726627267272682726927270272712727227273272742727527276272772727827279272802728127282272832728427285272862728727288272892729027291272922729327294272952729627297272982729927300273012730227303273042730527306273072730827309273102731127312273132731427315273162731727318273192732027321273222732327324273252732627327273282732927330273312733227333273342733527336273372733827339273402734127342273432734427345273462734727348273492735027351273522735327354273552735627357273582735927360273612736227363273642736527366273672736827369273702737127372273732737427375273762737727378273792738027381273822738327384273852738627387273882738927390273912739227393273942739527396273972739827399274002740127402274032740427405274062740727408274092741027411274122741327414274152741627417274182741927420274212742227423274242742527426274272742827429274302743127432274332743427435274362743727438274392744027441274422744327444274452744627447274482744927450274512745227453274542745527456274572745827459274602746127462274632746427465274662746727468274692747027471274722747327474274752747627477274782747927480274812748227483274842748527486274872748827489274902749127492274932749427495274962749727498274992750027501275022750327504275052750627507275082750927510275112751227513275142751527516275172751827519275202752127522275232752427525275262752727528275292753027531275322753327534275352753627537275382753927540275412754227543275442754527546275472754827549275502755127552275532755427555275562755727558275592756027561275622756327564275652756627567275682756927570275712757227573275742757527576275772757827579275802758127582275832758427585275862758727588275892759027591275922759327594275952759627597275982759927600276012760227603276042760527606276072760827609276102761127612276132761427615276162761727618276192762027621276222762327624276252762627627276282762927630276312763227633276342763527636276372763827639276402764127642276432764427645276462764727648276492765027651276522765327654276552765627657276582765927660276612766227663276642766527666276672766827669276702767127672276732767427675276762767727678276792768027681276822768327684276852768627687276882768927690276912769227693276942769527696276972769827699277002770127702277032770427705277062770727708277092771027711277122771327714277152771627717277182771927720277212772227723277242772527726277272772827729277302773127732277332773427735277362773727738277392774027741277422774327744277452774627747277482774927750277512775227753277542775527756277572775827759277602776127762277632776427765277662776727768277692777027771277722777327774277752777627777277782777927780277812778227783277842778527786277872778827789277902779127792277932779427795277962779727798277992780027801278022780327804278052780627807278082780927810278112781227813278142781527816278172781827819278202782127822278232782427825278262782727828278292783027831278322783327834278352783627837278382783927840278412784227843278442784527846278472784827849278502785127852278532785427855278562785727858278592786027861278622786327864278652786627867278682786927870278712787227873278742787527876278772787827879278802788127882278832788427885278862788727888278892789027891278922789327894278952789627897278982789927900279012790227903279042790527906279072790827909279102791127912279132791427915279162791727918279192792027921279222792327924279252792627927279282792927930279312793227933279342793527936279372793827939279402794127942279432794427945279462794727948279492795027951279522795327954279552795627957279582795927960279612796227963279642796527966279672796827969279702797127972279732797427975279762797727978279792798027981279822798327984279852798627987279882798927990279912799227993279942799527996279972799827999280002800128002280032800428005280062800728008280092801028011280122801328014280152801628017280182801928020280212802228023280242802528026280272802828029280302803128032280332803428035280362803728038280392804028041280422804328044280452804628047280482804928050280512805228053280542805528056280572805828059280602806128062280632806428065280662806728068280692807028071280722807328074280752807628077280782807928080280812808228083280842808528086280872808828089280902809128092280932809428095280962809728098280992810028101281022810328104281052810628107281082810928110281112811228113281142811528116281172811828119281202812128122281232812428125281262812728128281292813028131281322813328134281352813628137281382813928140281412814228143281442814528146281472814828149281502815128152281532815428155281562815728158281592816028161281622816328164281652816628167281682816928170281712817228173281742817528176281772817828179281802818128182281832818428185281862818728188281892819028191281922819328194281952819628197281982819928200282012820228203282042820528206282072820828209282102821128212282132821428215282162821728218282192822028221282222822328224282252822628227282282822928230282312823228233282342823528236282372823828239282402824128242282432824428245282462824728248282492825028251282522825328254282552825628257282582825928260282612826228263282642826528266282672826828269282702827128272282732827428275282762827728278282792828028281282822828328284282852828628287282882828928290282912829228293282942829528296282972829828299283002830128302283032830428305283062830728308283092831028311283122831328314283152831628317283182831928320283212832228323283242832528326283272832828329283302833128332283332833428335283362833728338283392834028341283422834328344283452834628347283482834928350283512835228353283542835528356283572835828359283602836128362283632836428365283662836728368283692837028371283722837328374283752837628377283782837928380283812838228383283842838528386283872838828389283902839128392283932839428395283962839728398283992840028401284022840328404284052840628407284082840928410284112841228413284142841528416284172841828419284202842128422284232842428425284262842728428284292843028431284322843328434284352843628437284382843928440284412844228443284442844528446284472844828449284502845128452284532845428455284562845728458284592846028461284622846328464284652846628467284682846928470284712847228473284742847528476284772847828479284802848128482284832848428485284862848728488284892849028491284922849328494284952849628497284982849928500285012850228503285042850528506285072850828509285102851128512285132851428515285162851728518285192852028521285222852328524285252852628527285282852928530285312853228533285342853528536285372853828539285402854128542285432854428545285462854728548285492855028551285522855328554285552855628557285582855928560285612856228563285642856528566285672856828569285702857128572285732857428575285762857728578285792858028581285822858328584285852858628587285882858928590285912859228593285942859528596285972859828599286002860128602286032860428605286062860728608286092861028611286122861328614286152861628617286182861928620286212862228623286242862528626286272862828629286302863128632286332863428635286362863728638286392864028641286422864328644286452864628647286482864928650286512865228653286542865528656286572865828659286602866128662286632866428665286662866728668286692867028671286722867328674286752867628677286782867928680286812868228683286842868528686286872868828689286902869128692286932869428695286962869728698286992870028701287022870328704287052870628707287082870928710287112871228713287142871528716287172871828719287202872128722287232872428725287262872728728287292873028731287322873328734287352873628737287382873928740287412874228743287442874528746287472874828749287502875128752287532875428755287562875728758287592876028761287622876328764287652876628767287682876928770287712877228773287742877528776287772877828779287802878128782287832878428785287862878728788287892879028791287922879328794287952879628797287982879928800288012880228803288042880528806288072880828809288102881128812288132881428815288162881728818288192882028821288222882328824288252882628827288282882928830288312883228833288342883528836288372883828839288402884128842288432884428845288462884728848288492885028851288522885328854288552885628857288582885928860288612886228863288642886528866288672886828869288702887128872288732887428875288762887728878288792888028881288822888328884288852888628887288882888928890288912889228893288942889528896288972889828899289002890128902289032890428905289062890728908289092891028911289122891328914289152891628917289182891928920289212892228923289242892528926289272892828929289302893128932289332893428935289362893728938289392894028941289422894328944289452894628947289482894928950289512895228953289542895528956289572895828959289602896128962289632896428965289662896728968289692897028971289722897328974289752897628977289782897928980289812898228983289842898528986289872898828989289902899128992289932899428995289962899728998289992900029001290022900329004290052900629007290082900929010290112901229013290142901529016290172901829019290202902129022290232902429025290262902729028290292903029031290322903329034290352903629037290382903929040290412904229043290442904529046290472904829049290502905129052290532905429055290562905729058290592906029061290622906329064290652906629067290682906929070290712907229073290742907529076290772907829079290802908129082290832908429085290862908729088290892909029091290922909329094290952909629097290982909929100291012910229103291042910529106291072910829109291102911129112291132911429115291162911729118291192912029121291222912329124291252912629127291282912929130291312913229133291342913529136291372913829139291402914129142291432914429145291462914729148291492915029151291522915329154291552915629157291582915929160291612916229163291642916529166291672916829169291702917129172291732917429175291762917729178291792918029181291822918329184291852918629187291882918929190291912919229193291942919529196291972919829199292002920129202292032920429205292062920729208292092921029211292122921329214292152921629217292182921929220292212922229223292242922529226292272922829229292302923129232292332923429235292362923729238292392924029241292422924329244292452924629247292482924929250292512925229253292542925529256292572925829259292602926129262292632926429265292662926729268292692927029271292722927329274292752927629277292782927929280292812928229283292842928529286292872928829289292902929129292292932929429295292962929729298292992930029301293022930329304293052930629307293082930929310293112931229313293142931529316293172931829319293202932129322293232932429325293262932729328293292933029331293322933329334293352933629337293382933929340293412934229343293442934529346293472934829349293502935129352293532935429355293562935729358293592936029361293622936329364293652936629367293682936929370293712937229373293742937529376293772937829379293802938129382293832938429385293862938729388293892939029391293922939329394293952939629397293982939929400294012940229403294042940529406294072940829409294102941129412294132941429415294162941729418294192942029421294222942329424294252942629427294282942929430294312943229433294342943529436294372943829439294402944129442294432944429445294462944729448294492945029451294522945329454294552945629457294582945929460294612946229463294642946529466294672946829469294702947129472294732947429475294762947729478294792948029481294822948329484294852948629487294882948929490294912949229493294942949529496294972949829499295002950129502295032950429505295062950729508295092951029511295122951329514295152951629517295182951929520295212952229523295242952529526295272952829529295302953129532295332953429535295362953729538295392954029541295422954329544295452954629547295482954929550295512955229553295542955529556295572955829559295602956129562295632956429565295662956729568295692957029571295722957329574295752957629577295782957929580295812958229583295842958529586295872958829589295902959129592295932959429595295962959729598295992960029601296022960329604296052960629607296082960929610296112961229613296142961529616296172961829619296202962129622296232962429625296262962729628296292963029631296322963329634296352963629637296382963929640296412964229643296442964529646296472964829649296502965129652296532965429655296562965729658296592966029661296622966329664296652966629667296682966929670296712967229673296742967529676296772967829679296802968129682296832968429685296862968729688296892969029691296922969329694296952969629697296982969929700297012970229703297042970529706297072970829709297102971129712297132971429715297162971729718297192972029721297222972329724297252972629727297282972929730297312973229733297342973529736297372973829739297402974129742297432974429745297462974729748297492975029751297522975329754297552975629757297582975929760297612976229763297642976529766297672976829769297702977129772297732977429775297762977729778297792978029781297822978329784297852978629787297882978929790297912979229793297942979529796297972979829799298002980129802298032980429805298062980729808298092981029811298122981329814298152981629817298182981929820298212982229823298242982529826298272982829829298302983129832298332983429835298362983729838298392984029841298422984329844298452984629847298482984929850298512985229853298542985529856298572985829859298602986129862298632986429865298662986729868298692987029871298722987329874298752987629877298782987929880298812988229883298842988529886298872988829889298902989129892298932989429895298962989729898298992990029901299022990329904299052990629907299082990929910299112991229913299142991529916299172991829919299202992129922299232992429925299262992729928299292993029931299322993329934299352993629937299382993929940299412994229943299442994529946299472994829949299502995129952299532995429955299562995729958299592996029961299622996329964299652996629967299682996929970299712997229973299742997529976299772997829979299802998129982299832998429985299862998729988299892999029991299922999329994299952999629997299982999930000300013000230003300043000530006300073000830009300103001130012300133001430015300163001730018300193002030021300223002330024300253002630027300283002930030300313003230033300343003530036300373003830039300403004130042300433004430045300463004730048300493005030051300523005330054300553005630057300583005930060300613006230063300643006530066300673006830069300703007130072300733007430075300763007730078300793008030081300823008330084300853008630087300883008930090300913009230093300943009530096300973009830099301003010130102301033010430105301063010730108301093011030111301123011330114301153011630117301183011930120301213012230123301243012530126301273012830129301303013130132301333013430135301363013730138301393014030141301423014330144301453014630147301483014930150301513015230153301543015530156301573015830159301603016130162301633016430165301663016730168301693017030171301723017330174301753017630177301783017930180301813018230183301843018530186301873018830189301903019130192301933019430195301963019730198301993020030201302023020330204302053020630207302083020930210302113021230213302143021530216302173021830219302203022130222302233022430225302263022730228302293023030231302323023330234302353023630237302383023930240302413024230243302443024530246302473024830249302503025130252302533025430255302563025730258302593026030261302623026330264302653026630267302683026930270302713027230273302743027530276302773027830279302803028130282302833028430285302863028730288302893029030291302923029330294302953029630297302983029930300303013030230303303043030530306303073030830309303103031130312303133031430315303163031730318303193032030321303223032330324303253032630327303283032930330303313033230333303343033530336303373033830339303403034130342303433034430345303463034730348303493035030351303523035330354303553035630357303583035930360303613036230363303643036530366303673036830369303703037130372303733037430375303763037730378303793038030381303823038330384303853038630387303883038930390303913039230393303943039530396303973039830399304003040130402304033040430405304063040730408304093041030411304123041330414304153041630417304183041930420304213042230423304243042530426304273042830429304303043130432304333043430435304363043730438304393044030441304423044330444304453044630447304483044930450304513045230453304543045530456304573045830459304603046130462304633046430465304663046730468304693047030471304723047330474304753047630477304783047930480304813048230483304843048530486304873048830489304903049130492304933049430495304963049730498304993050030501305023050330504305053050630507305083050930510305113051230513305143051530516305173051830519305203052130522305233052430525305263052730528305293053030531305323053330534305353053630537305383053930540305413054230543305443054530546305473054830549305503055130552305533055430555305563055730558305593056030561305623056330564305653056630567305683056930570305713057230573305743057530576305773057830579305803058130582305833058430585305863058730588305893059030591305923059330594305953059630597305983059930600306013060230603306043060530606306073060830609306103061130612306133061430615306163061730618306193062030621306223062330624306253062630627306283062930630306313063230633306343063530636306373063830639306403064130642306433064430645306463064730648306493065030651306523065330654306553065630657306583065930660306613066230663306643066530666306673066830669306703067130672306733067430675306763067730678306793068030681306823068330684306853068630687306883068930690306913069230693306943069530696306973069830699307003070130702307033070430705307063070730708307093071030711307123071330714307153071630717307183071930720307213072230723307243072530726307273072830729307303073130732307333073430735307363073730738307393074030741307423074330744307453074630747307483074930750307513075230753307543075530756307573075830759307603076130762307633076430765307663076730768307693077030771307723077330774307753077630777307783077930780307813078230783307843078530786307873078830789307903079130792307933079430795307963079730798307993080030801308023080330804308053080630807308083080930810308113081230813308143081530816308173081830819308203082130822308233082430825308263082730828308293083030831308323083330834308353083630837308383083930840308413084230843308443084530846308473084830849308503085130852308533085430855308563085730858308593086030861308623086330864308653086630867308683086930870308713087230873308743087530876308773087830879308803088130882308833088430885308863088730888308893089030891308923089330894308953089630897308983089930900309013090230903309043090530906309073090830909309103091130912309133091430915309163091730918309193092030921309223092330924309253092630927309283092930930309313093230933309343093530936309373093830939309403094130942309433094430945309463094730948309493095030951309523095330954309553095630957309583095930960309613096230963309643096530966309673096830969309703097130972309733097430975309763097730978309793098030981309823098330984309853098630987309883098930990309913099230993309943099530996309973099830999310003100131002310033100431005310063100731008310093101031011310123101331014310153101631017310183101931020310213102231023310243102531026310273102831029310303103131032310333103431035310363103731038310393104031041310423104331044310453104631047310483104931050310513105231053310543105531056310573105831059310603106131062310633106431065310663106731068310693107031071310723107331074310753107631077310783107931080310813108231083310843108531086310873108831089310903109131092310933109431095310963109731098310993110031101311023110331104311053110631107311083110931110311113111231113311143111531116311173111831119311203112131122311233112431125311263112731128311293113031131311323113331134311353113631137311383113931140311413114231143311443114531146311473114831149311503115131152311533115431155311563115731158311593116031161311623116331164311653116631167311683116931170311713117231173311743117531176311773117831179311803118131182311833118431185311863118731188311893119031191311923119331194311953119631197311983119931200312013120231203312043120531206312073120831209312103121131212312133121431215312163121731218312193122031221312223122331224312253122631227312283122931230312313123231233312343123531236312373123831239312403124131242312433124431245312463124731248312493125031251312523125331254312553125631257312583125931260312613126231263312643126531266312673126831269312703127131272312733127431275312763127731278312793128031281312823128331284312853128631287312883128931290312913129231293312943129531296312973129831299313003130131302313033130431305313063130731308313093131031311313123131331314313153131631317313183131931320313213132231323313243132531326313273132831329313303133131332313333133431335313363133731338313393134031341313423134331344313453134631347313483134931350313513135231353313543135531356313573135831359313603136131362313633136431365313663136731368313693137031371313723137331374313753137631377313783137931380313813138231383313843138531386313873138831389313903139131392313933139431395313963139731398313993140031401314023140331404314053140631407314083140931410314113141231413314143141531416314173141831419314203142131422314233142431425314263142731428314293143031431314323143331434314353143631437314383143931440314413144231443314443144531446314473144831449314503145131452314533145431455314563145731458314593146031461314623146331464314653146631467314683146931470314713147231473314743147531476314773147831479314803148131482314833148431485314863148731488314893149031491314923149331494314953149631497314983149931500315013150231503315043150531506315073150831509315103151131512315133151431515315163151731518315193152031521315223152331524315253152631527315283152931530315313153231533315343153531536315373153831539315403154131542315433154431545315463154731548315493155031551315523155331554315553155631557315583155931560315613156231563315643156531566315673156831569315703157131572315733157431575315763157731578315793158031581315823158331584315853158631587315883158931590315913159231593315943159531596315973159831599316003160131602316033160431605316063160731608316093161031611316123161331614316153161631617316183161931620316213162231623316243162531626316273162831629316303163131632316333163431635316363163731638316393164031641316423164331644316453164631647316483164931650316513165231653316543165531656316573165831659316603166131662316633166431665316663166731668316693167031671316723167331674316753167631677316783167931680316813168231683316843168531686316873168831689316903169131692316933169431695316963169731698316993170031701317023170331704317053170631707317083170931710317113171231713317143171531716317173171831719317203172131722317233172431725317263172731728317293173031731317323173331734317353173631737317383173931740317413174231743317443174531746317473174831749317503175131752317533175431755317563175731758317593176031761317623176331764317653176631767317683176931770317713177231773317743177531776317773177831779317803178131782317833178431785317863178731788317893179031791317923179331794317953179631797317983179931800318013180231803318043180531806318073180831809318103181131812318133181431815318163181731818318193182031821318223182331824318253182631827318283182931830318313183231833318343183531836318373183831839318403184131842318433184431845318463184731848318493185031851318523185331854318553185631857318583185931860318613186231863318643186531866318673186831869318703187131872318733187431875318763187731878318793188031881318823188331884318853188631887318883188931890318913189231893318943189531896318973189831899319003190131902319033190431905319063190731908319093191031911319123191331914319153191631917319183191931920319213192231923319243192531926319273192831929319303193131932319333193431935319363193731938319393194031941319423194331944319453194631947319483194931950319513195231953319543195531956319573195831959319603196131962319633196431965319663196731968319693197031971319723197331974319753197631977319783197931980319813198231983319843198531986319873198831989319903199131992319933199431995319963199731998319993200032001320023200332004320053200632007320083200932010320113201232013320143201532016320173201832019320203202132022320233202432025320263202732028320293203032031320323203332034320353203632037320383203932040320413204232043320443204532046320473204832049320503205132052320533205432055320563205732058320593206032061320623206332064320653206632067320683206932070320713207232073320743207532076320773207832079320803208132082320833208432085320863208732088320893209032091320923209332094320953209632097320983209932100321013210232103321043210532106321073210832109321103211132112321133211432115321163211732118321193212032121321223212332124321253212632127321283212932130321313213232133321343213532136321373213832139321403214132142321433214432145321463214732148321493215032151321523215332154321553215632157321583215932160321613216232163321643216532166321673216832169321703217132172321733217432175321763217732178321793218032181321823218332184321853218632187321883218932190321913219232193321943219532196321973219832199322003220132202322033220432205322063220732208322093221032211322123221332214322153221632217322183221932220322213222232223322243222532226322273222832229322303223132232322333223432235322363223732238322393224032241322423224332244322453224632247322483224932250322513225232253322543225532256322573225832259322603226132262322633226432265322663226732268322693227032271322723227332274322753227632277322783227932280322813228232283322843228532286322873228832289322903229132292322933229432295322963229732298322993230032301323023230332304323053230632307323083230932310323113231232313323143231532316323173231832319323203232132322323233232432325323263232732328323293233032331323323233332334323353233632337323383233932340323413234232343323443234532346323473234832349323503235132352323533235432355323563235732358323593236032361323623236332364323653236632367323683236932370323713237232373323743237532376323773237832379323803238132382323833238432385323863238732388323893239032391323923239332394323953239632397323983239932400324013240232403324043240532406324073240832409324103241132412324133241432415324163241732418324193242032421324223242332424324253242632427324283242932430324313243232433324343243532436324373243832439324403244132442324433244432445324463244732448324493245032451324523245332454324553245632457324583245932460324613246232463324643246532466324673246832469324703247132472324733247432475324763247732478324793248032481324823248332484324853248632487324883248932490324913249232493324943249532496324973249832499325003250132502325033250432505325063250732508325093251032511325123251332514325153251632517325183251932520325213252232523325243252532526325273252832529325303253132532325333253432535325363253732538325393254032541325423254332544325453254632547325483254932550325513255232553325543255532556325573255832559325603256132562325633256432565325663256732568325693257032571325723257332574325753257632577325783257932580325813258232583325843258532586325873258832589325903259132592325933259432595325963259732598325993260032601326023260332604326053260632607326083260932610326113261232613326143261532616326173261832619326203262132622326233262432625326263262732628326293263032631326323263332634326353263632637326383263932640326413264232643326443264532646326473264832649326503265132652326533265432655326563265732658326593266032661326623266332664326653266632667326683266932670326713267232673326743267532676326773267832679326803268132682326833268432685326863268732688326893269032691326923269332694326953269632697326983269932700327013270232703327043270532706327073270832709327103271132712327133271432715327163271732718327193272032721327223272332724327253272632727327283272932730327313273232733327343273532736327373273832739327403274132742327433274432745327463274732748327493275032751327523275332754327553275632757327583275932760327613276232763327643276532766327673276832769327703277132772327733277432775327763277732778327793278032781327823278332784327853278632787327883278932790327913279232793327943279532796327973279832799328003280132802328033280432805328063280732808328093281032811328123281332814328153281632817328183281932820328213282232823328243282532826328273282832829328303283132832328333283432835328363283732838328393284032841328423284332844328453284632847328483284932850328513285232853328543285532856328573285832859328603286132862328633286432865328663286732868328693287032871328723287332874328753287632877328783287932880328813288232883328843288532886328873288832889328903289132892328933289432895328963289732898328993290032901329023290332904329053290632907329083290932910329113291232913329143291532916329173291832919329203292132922329233292432925329263292732928329293293032931329323293332934329353293632937329383293932940329413294232943329443294532946329473294832949329503295132952329533295432955329563295732958329593296032961329623296332964329653296632967329683296932970329713297232973329743297532976329773297832979329803298132982329833298432985329863298732988329893299032991329923299332994329953299632997329983299933000330013300233003330043300533006330073300833009330103301133012330133301433015330163301733018330193302033021330223302333024330253302633027330283302933030330313303233033330343303533036330373303833039330403304133042330433304433045330463304733048330493305033051330523305333054330553305633057330583305933060330613306233063330643306533066330673306833069330703307133072330733307433075330763307733078330793308033081330823308333084330853308633087330883308933090330913309233093330943309533096330973309833099331003310133102331033310433105331063310733108331093311033111331123311333114331153311633117331183311933120331213312233123331243312533126331273312833129331303313133132331333313433135331363313733138331393314033141331423314333144331453314633147331483314933150331513315233153331543315533156331573315833159331603316133162331633316433165331663316733168331693317033171331723317333174331753317633177331783317933180331813318233183331843318533186331873318833189331903319133192331933319433195331963319733198331993320033201332023320333204332053320633207332083320933210332113321233213332143321533216332173321833219332203322133222332233322433225332263322733228332293323033231332323323333234332353323633237332383323933240332413324233243332443324533246332473324833249332503325133252332533325433255332563325733258332593326033261332623326333264332653326633267332683326933270332713327233273332743327533276332773327833279332803328133282332833328433285332863328733288332893329033291332923329333294332953329633297332983329933300333013330233303333043330533306333073330833309333103331133312333133331433315333163331733318333193332033321333223332333324333253332633327333283332933330333313333233333333343333533336333373333833339333403334133342333433334433345333463334733348333493335033351333523335333354333553335633357333583335933360333613336233363333643336533366333673336833369333703337133372333733337433375333763337733378333793338033381333823338333384333853338633387333883338933390333913339233393333943339533396333973339833399334003340133402334033340433405334063340733408334093341033411334123341333414334153341633417334183341933420334213342233423334243342533426334273342833429334303343133432334333343433435334363343733438334393344033441334423344333444334453344633447334483344933450334513345233453334543345533456334573345833459334603346133462334633346433465334663346733468334693347033471334723347333474334753347633477334783347933480334813348233483334843348533486334873348833489334903349133492334933349433495334963349733498334993350033501335023350333504335053350633507335083350933510335113351233513335143351533516335173351833519335203352133522335233352433525335263352733528335293353033531335323353333534335353353633537335383353933540335413354233543335443354533546335473354833549335503355133552335533355433555335563355733558335593356033561335623356333564335653356633567335683356933570335713357233573335743357533576335773357833579335803358133582335833358433585335863358733588335893359033591335923359333594335953359633597335983359933600336013360233603336043360533606336073360833609336103361133612336133361433615336163361733618336193362033621336223362333624336253362633627336283362933630336313363233633336343363533636336373363833639336403364133642336433364433645336463364733648336493365033651336523365333654336553365633657336583365933660336613366233663336643366533666336673366833669336703367133672336733367433675336763367733678336793368033681336823368333684336853368633687336883368933690336913369233693336943369533696336973369833699337003370133702337033370433705337063370733708337093371033711337123371333714337153371633717337183371933720337213372233723337243372533726337273372833729337303373133732337333373433735337363373733738337393374033741337423374333744337453374633747337483374933750337513375233753337543375533756337573375833759337603376133762337633376433765337663376733768337693377033771337723377333774337753377633777337783377933780337813378233783337843378533786337873378833789337903379133792337933379433795337963379733798337993380033801338023380333804338053380633807338083380933810338113381233813338143381533816338173381833819338203382133822338233382433825338263382733828338293383033831338323383333834338353383633837338383383933840338413384233843338443384533846338473384833849338503385133852338533385433855338563385733858338593386033861338623386333864338653386633867338683386933870338713387233873338743387533876338773387833879338803388133882338833388433885338863388733888338893389033891338923389333894338953389633897338983389933900339013390233903339043390533906339073390833909339103391133912339133391433915339163391733918339193392033921339223392333924339253392633927339283392933930339313393233933339343393533936339373393833939339403394133942339433394433945339463394733948339493395033951339523395333954339553395633957339583395933960339613396233963339643396533966339673396833969339703397133972339733397433975339763397733978339793398033981339823398333984339853398633987339883398933990339913399233993339943399533996339973399833999340003400134002340033400434005340063400734008340093401034011340123401334014340153401634017340183401934020340213402234023340243402534026340273402834029340303403134032340333403434035340363403734038340393404034041340423404334044340453404634047340483404934050340513405234053340543405534056340573405834059340603406134062340633406434065340663406734068340693407034071340723407334074340753407634077340783407934080340813408234083340843408534086340873408834089340903409134092340933409434095340963409734098340993410034101341023410334104341053410634107341083410934110341113411234113341143411534116341173411834119341203412134122341233412434125341263412734128341293413034131341323413334134341353413634137341383413934140341413414234143341443414534146341473414834149341503415134152341533415434155341563415734158341593416034161341623416334164341653416634167341683416934170341713417234173341743417534176341773417834179341803418134182341833418434185341863418734188341893419034191341923419334194341953419634197341983419934200342013420234203342043420534206342073420834209342103421134212342133421434215342163421734218342193422034221342223422334224342253422634227342283422934230342313423234233342343423534236342373423834239342403424134242342433424434245342463424734248342493425034251342523425334254342553425634257342583425934260342613426234263342643426534266342673426834269342703427134272342733427434275342763427734278342793428034281342823428334284342853428634287342883428934290342913429234293342943429534296342973429834299343003430134302343033430434305343063430734308343093431034311343123431334314343153431634317343183431934320343213432234323343243432534326343273432834329343303433134332343333433434335343363433734338343393434034341343423434334344343453434634347343483434934350343513435234353343543435534356343573435834359343603436134362343633436434365343663436734368343693437034371343723437334374343753437634377343783437934380343813438234383343843438534386343873438834389343903439134392343933439434395343963439734398343993440034401344023440334404344053440634407344083440934410344113441234413344143441534416344173441834419344203442134422344233442434425344263442734428344293443034431344323443334434344353443634437344383443934440344413444234443344443444534446344473444834449344503445134452344533445434455344563445734458344593446034461344623446334464344653446634467344683446934470344713447234473344743447534476344773447834479344803448134482344833448434485344863448734488344893449034491344923449334494344953449634497344983449934500345013450234503345043450534506345073450834509345103451134512345133451434515345163451734518345193452034521345223452334524345253452634527345283452934530345313453234533345343453534536345373453834539345403454134542345433454434545345463454734548345493455034551345523455334554345553455634557345583455934560345613456234563345643456534566345673456834569345703457134572345733457434575345763457734578345793458034581345823458334584345853458634587345883458934590345913459234593345943459534596345973459834599346003460134602346033460434605346063460734608346093461034611346123461334614346153461634617346183461934620346213462234623346243462534626346273462834629346303463134632346333463434635346363463734638346393464034641346423464334644346453464634647346483464934650346513465234653346543465534656346573465834659346603466134662346633466434665346663466734668346693467034671346723467334674346753467634677346783467934680346813468234683346843468534686346873468834689346903469134692346933469434695346963469734698346993470034701347023470334704347053470634707347083470934710347113471234713347143471534716347173471834719347203472134722347233472434725347263472734728347293473034731347323473334734347353473634737347383473934740347413474234743347443474534746347473474834749347503475134752347533475434755347563475734758347593476034761347623476334764347653476634767347683476934770347713477234773347743477534776347773477834779347803478134782347833478434785347863478734788347893479034791347923479334794347953479634797347983479934800348013480234803348043480534806348073480834809348103481134812348133481434815348163481734818348193482034821348223482334824348253482634827348283482934830348313483234833348343483534836348373483834839348403484134842348433484434845348463484734848348493485034851348523485334854348553485634857348583485934860348613486234863348643486534866348673486834869348703487134872348733487434875348763487734878348793488034881348823488334884348853488634887348883488934890348913489234893348943489534896348973489834899349003490134902349033490434905349063490734908349093491034911349123491334914349153491634917349183491934920349213492234923349243492534926349273492834929349303493134932349333493434935349363493734938349393494034941349423494334944349453494634947349483494934950349513495234953349543495534956349573495834959349603496134962349633496434965349663496734968349693497034971349723497334974349753497634977349783497934980349813498234983349843498534986349873498834989349903499134992349933499434995349963499734998349993500035001350023500335004350053500635007350083500935010350113501235013350143501535016350173501835019350203502135022350233502435025350263502735028350293503035031350323503335034350353503635037350383503935040350413504235043350443504535046350473504835049350503505135052350533505435055350563505735058350593506035061350623506335064350653506635067350683506935070350713507235073350743507535076350773507835079350803508135082350833508435085350863508735088350893509035091350923509335094350953509635097350983509935100351013510235103351043510535106351073510835109351103511135112351133511435115351163511735118351193512035121351223512335124351253512635127351283512935130351313513235133351343513535136351373513835139351403514135142351433514435145351463514735148351493515035151351523515335154351553515635157351583515935160351613516235163351643516535166351673516835169351703517135172351733517435175351763517735178351793518035181351823518335184351853518635187351883518935190351913519235193351943519535196351973519835199352003520135202352033520435205352063520735208352093521035211352123521335214352153521635217352183521935220352213522235223352243522535226352273522835229352303523135232352333523435235352363523735238352393524035241352423524335244352453524635247352483524935250352513525235253352543525535256352573525835259352603526135262352633526435265352663526735268352693527035271352723527335274352753527635277352783527935280352813528235283352843528535286352873528835289352903529135292352933529435295352963529735298352993530035301353023530335304353053530635307353083530935310353113531235313353143531535316353173531835319353203532135322353233532435325353263532735328353293533035331353323533335334353353533635337353383533935340353413534235343353443534535346353473534835349353503535135352353533535435355353563535735358353593536035361353623536335364353653536635367353683536935370353713537235373353743537535376353773537835379353803538135382353833538435385353863538735388353893539035391353923539335394353953539635397353983539935400354013540235403354043540535406354073540835409354103541135412354133541435415354163541735418354193542035421354223542335424354253542635427354283542935430354313543235433354343543535436354373543835439354403544135442354433544435445354463544735448354493545035451354523545335454354553545635457354583545935460354613546235463354643546535466354673546835469354703547135472354733547435475354763547735478354793548035481354823548335484354853548635487354883548935490354913549235493354943549535496354973549835499355003550135502355033550435505355063550735508355093551035511355123551335514355153551635517355183551935520355213552235523355243552535526355273552835529355303553135532355333553435535355363553735538355393554035541355423554335544355453554635547355483554935550355513555235553355543555535556355573555835559355603556135562355633556435565355663556735568355693557035571355723557335574355753557635577355783557935580355813558235583355843558535586355873558835589355903559135592355933559435595355963559735598355993560035601356023560335604356053560635607356083560935610356113561235613356143561535616356173561835619356203562135622356233562435625356263562735628356293563035631356323563335634356353563635637356383563935640356413564235643356443564535646356473564835649356503565135652356533565435655356563565735658356593566035661356623566335664356653566635667356683566935670356713567235673356743567535676356773567835679356803568135682356833568435685356863568735688356893569035691356923569335694356953569635697356983569935700357013570235703357043570535706357073570835709357103571135712357133571435715357163571735718357193572035721357223572335724357253572635727357283572935730357313573235733357343573535736357373573835739357403574135742357433574435745357463574735748357493575035751357523575335754357553575635757357583575935760357613576235763357643576535766357673576835769357703577135772357733577435775357763577735778357793578035781357823578335784357853578635787357883578935790357913579235793357943579535796357973579835799358003580135802358033580435805358063580735808358093581035811358123581335814358153581635817358183581935820358213582235823358243582535826358273582835829358303583135832358333583435835358363583735838358393584035841358423584335844358453584635847358483584935850358513585235853358543585535856358573585835859358603586135862358633586435865358663586735868358693587035871358723587335874358753587635877358783587935880358813588235883358843588535886358873588835889358903589135892358933589435895358963589735898358993590035901359023590335904359053590635907359083590935910359113591235913359143591535916359173591835919359203592135922359233592435925359263592735928359293593035931359323593335934359353593635937359383593935940359413594235943359443594535946359473594835949359503595135952359533595435955359563595735958359593596035961359623596335964359653596635967359683596935970359713597235973359743597535976359773597835979359803598135982359833598435985359863598735988359893599035991359923599335994359953599635997359983599936000360013600236003360043600536006360073600836009360103601136012360133601436015360163601736018360193602036021360223602336024360253602636027360283602936030360313603236033360343603536036360373603836039360403604136042360433604436045360463604736048360493605036051360523605336054360553605636057360583605936060360613606236063360643606536066360673606836069360703607136072360733607436075360763607736078360793608036081360823608336084360853608636087360883608936090360913609236093360943609536096360973609836099361003610136102361033610436105361063610736108361093611036111361123611336114361153611636117361183611936120361213612236123361243612536126361273612836129361303613136132361333613436135361363613736138361393614036141361423614336144361453614636147361483614936150361513615236153361543615536156361573615836159361603616136162361633616436165361663616736168361693617036171361723617336174361753617636177361783617936180361813618236183361843618536186361873618836189361903619136192361933619436195361963619736198361993620036201362023620336204362053620636207362083620936210362113621236213362143621536216362173621836219362203622136222362233622436225362263622736228362293623036231362323623336234362353623636237362383623936240362413624236243362443624536246362473624836249362503625136252362533625436255362563625736258362593626036261362623626336264362653626636267362683626936270362713627236273362743627536276362773627836279362803628136282362833628436285362863628736288362893629036291362923629336294362953629636297362983629936300363013630236303363043630536306363073630836309363103631136312363133631436315363163631736318363193632036321363223632336324363253632636327363283632936330363313633236333363343633536336363373633836339363403634136342363433634436345363463634736348363493635036351363523635336354363553635636357363583635936360363613636236363363643636536366363673636836369363703637136372363733637436375363763637736378363793638036381363823638336384363853638636387363883638936390363913639236393363943639536396363973639836399364003640136402364033640436405364063640736408364093641036411364123641336414364153641636417364183641936420364213642236423364243642536426364273642836429364303643136432364333643436435364363643736438364393644036441364423644336444364453644636447364483644936450364513645236453364543645536456364573645836459364603646136462364633646436465364663646736468364693647036471364723647336474364753647636477364783647936480364813648236483364843648536486364873648836489364903649136492364933649436495364963649736498364993650036501365023650336504365053650636507365083650936510365113651236513365143651536516365173651836519365203652136522365233652436525365263652736528365293653036531365323653336534365353653636537365383653936540365413654236543365443654536546365473654836549365503655136552365533655436555365563655736558365593656036561365623656336564365653656636567365683656936570365713657236573365743657536576365773657836579365803658136582365833658436585365863658736588365893659036591365923659336594365953659636597365983659936600366013660236603366043660536606366073660836609366103661136612366133661436615366163661736618366193662036621366223662336624366253662636627366283662936630366313663236633366343663536636366373663836639366403664136642366433664436645366463664736648366493665036651366523665336654366553665636657366583665936660366613666236663366643666536666366673666836669366703667136672366733667436675366763667736678366793668036681366823668336684366853668636687366883668936690366913669236693366943669536696366973669836699367003670136702367033670436705367063670736708367093671036711367123671336714367153671636717367183671936720367213672236723367243672536726367273672836729367303673136732367333673436735367363673736738367393674036741367423674336744367453674636747367483674936750367513675236753367543675536756367573675836759367603676136762367633676436765367663676736768367693677036771367723677336774367753677636777367783677936780367813678236783367843678536786367873678836789367903679136792367933679436795367963679736798367993680036801368023680336804368053680636807368083680936810368113681236813368143681536816368173681836819368203682136822368233682436825368263682736828368293683036831368323683336834368353683636837368383683936840368413684236843368443684536846368473684836849368503685136852368533685436855368563685736858368593686036861368623686336864368653686636867368683686936870368713687236873368743687536876368773687836879368803688136882368833688436885368863688736888368893689036891368923689336894368953689636897368983689936900369013690236903369043690536906369073690836909369103691136912369133691436915369163691736918369193692036921369223692336924369253692636927369283692936930369313693236933369343693536936369373693836939369403694136942369433694436945369463694736948369493695036951369523695336954369553695636957369583695936960369613696236963369643696536966369673696836969369703697136972369733697436975369763697736978369793698036981369823698336984369853698636987369883698936990369913699236993369943699536996369973699836999370003700137002370033700437005370063700737008370093701037011370123701337014370153701637017370183701937020370213702237023370243702537026370273702837029370303703137032370333703437035370363703737038370393704037041370423704337044370453704637047370483704937050370513705237053370543705537056370573705837059370603706137062370633706437065370663706737068370693707037071370723707337074370753707637077370783707937080370813708237083370843708537086370873708837089370903709137092370933709437095370963709737098370993710037101371023710337104371053710637107371083710937110371113711237113371143711537116371173711837119371203712137122371233712437125371263712737128371293713037131371323713337134371353713637137371383713937140371413714237143371443714537146371473714837149371503715137152371533715437155371563715737158371593716037161371623716337164371653716637167371683716937170371713717237173371743717537176371773717837179371803718137182371833718437185371863718737188371893719037191371923719337194371953719637197371983719937200372013720237203372043720537206372073720837209372103721137212372133721437215372163721737218372193722037221372223722337224372253722637227372283722937230372313723237233372343723537236372373723837239372403724137242372433724437245372463724737248372493725037251372523725337254372553725637257372583725937260372613726237263372643726537266372673726837269372703727137272372733727437275372763727737278372793728037281372823728337284372853728637287372883728937290372913729237293372943729537296372973729837299373003730137302373033730437305373063730737308373093731037311373123731337314373153731637317373183731937320373213732237323373243732537326373273732837329373303733137332373333733437335373363733737338373393734037341373423734337344373453734637347373483734937350373513735237353373543735537356373573735837359373603736137362373633736437365373663736737368373693737037371373723737337374373753737637377373783737937380373813738237383373843738537386373873738837389373903739137392373933739437395373963739737398373993740037401374023740337404374053740637407374083740937410374113741237413374143741537416374173741837419374203742137422374233742437425374263742737428374293743037431374323743337434374353743637437374383743937440374413744237443374443744537446374473744837449374503745137452374533745437455374563745737458374593746037461374623746337464374653746637467374683746937470374713747237473374743747537476374773747837479374803748137482374833748437485374863748737488374893749037491374923749337494374953749637497374983749937500375013750237503375043750537506375073750837509375103751137512375133751437515375163751737518375193752037521375223752337524375253752637527375283752937530375313753237533375343753537536375373753837539375403754137542375433754437545375463754737548375493755037551375523755337554375553755637557375583755937560375613756237563375643756537566375673756837569375703757137572375733757437575375763757737578375793758037581375823758337584375853758637587375883758937590375913759237593375943759537596375973759837599376003760137602376033760437605376063760737608376093761037611376123761337614376153761637617376183761937620376213762237623376243762537626376273762837629376303763137632376333763437635376363763737638376393764037641376423764337644376453764637647376483764937650376513765237653376543765537656376573765837659376603766137662376633766437665376663766737668376693767037671376723767337674376753767637677376783767937680376813768237683376843768537686376873768837689376903769137692376933769437695376963769737698376993770037701377023770337704377053770637707377083770937710377113771237713377143771537716377173771837719377203772137722377233772437725377263772737728377293773037731377323773337734377353773637737377383773937740377413774237743377443774537746377473774837749377503775137752377533775437755377563775737758377593776037761377623776337764377653776637767377683776937770377713777237773377743777537776377773777837779377803778137782377833778437785377863778737788377893779037791377923779337794377953779637797377983779937800378013780237803378043780537806378073780837809378103781137812378133781437815378163781737818378193782037821378223782337824378253782637827378283782937830378313783237833378343783537836378373783837839378403784137842378433784437845378463784737848378493785037851378523785337854378553785637857378583785937860378613786237863378643786537866378673786837869378703787137872378733787437875378763787737878378793788037881378823788337884378853788637887378883788937890378913789237893378943789537896378973789837899379003790137902379033790437905379063790737908379093791037911379123791337914379153791637917379183791937920379213792237923379243792537926379273792837929379303793137932379333793437935379363793737938379393794037941379423794337944379453794637947379483794937950379513795237953379543795537956379573795837959379603796137962379633796437965379663796737968379693797037971379723797337974379753797637977379783797937980379813798237983379843798537986379873798837989379903799137992379933799437995379963799737998379993800038001380023800338004380053800638007380083800938010380113801238013380143801538016380173801838019380203802138022380233802438025380263802738028380293803038031380323803338034380353803638037380383803938040380413804238043380443804538046380473804838049380503805138052380533805438055380563805738058380593806038061380623806338064380653806638067380683806938070380713807238073380743807538076380773807838079380803808138082380833808438085380863808738088380893809038091380923809338094380953809638097380983809938100381013810238103381043810538106381073810838109381103811138112381133811438115381163811738118381193812038121381223812338124381253812638127381283812938130381313813238133381343813538136381373813838139381403814138142381433814438145381463814738148381493815038151381523815338154381553815638157381583815938160381613816238163381643816538166381673816838169381703817138172381733817438175381763817738178381793818038181381823818338184381853818638187381883818938190381913819238193381943819538196381973819838199382003820138202382033820438205382063820738208382093821038211382123821338214382153821638217382183821938220382213822238223382243822538226382273822838229382303823138232382333823438235382363823738238382393824038241382423824338244382453824638247382483824938250382513825238253382543825538256382573825838259382603826138262382633826438265382663826738268382693827038271382723827338274382753827638277382783827938280382813828238283382843828538286382873828838289382903829138292382933829438295382963829738298382993830038301383023830338304383053830638307383083830938310383113831238313383143831538316383173831838319383203832138322383233832438325383263832738328383293833038331383323833338334383353833638337383383833938340383413834238343383443834538346383473834838349383503835138352383533835438355383563835738358383593836038361383623836338364383653836638367383683836938370383713837238373383743837538376383773837838379383803838138382383833838438385383863838738388383893839038391383923839338394383953839638397383983839938400384013840238403384043840538406384073840838409384103841138412384133841438415384163841738418384193842038421384223842338424384253842638427384283842938430384313843238433384343843538436384373843838439384403844138442384433844438445384463844738448384493845038451384523845338454384553845638457384583845938460384613846238463384643846538466384673846838469384703847138472384733847438475384763847738478384793848038481384823848338484384853848638487384883848938490384913849238493384943849538496384973849838499385003850138502
  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. const SSH_COMMAND_KEY = 'core.sshCommand';
  147. function createAuthHelper(git, settings) {
  148. return new GitAuthHelper(git, settings);
  149. }
  150. class GitAuthHelper {
  151. constructor(gitCommandManager, gitSourceSettings) {
  152. this.insteadOfValues = [];
  153. this.sshCommand = '';
  154. this.sshKeyPath = '';
  155. this.sshKnownHostsPath = '';
  156. this.temporaryHomePath = '';
  157. this.git = gitCommandManager;
  158. this.settings = gitSourceSettings || {};
  159. // Token auth header
  160. const serverUrl = urlHelper.getServerUrl(this.settings.githubServerUrl);
  161. this.tokenConfigKey = `http.${serverUrl.origin}/.extraheader`; // "origin" is SCHEME://HOSTNAME[:PORT]
  162. const basicCredential = Buffer.from(`x-access-token:${this.settings.authToken}`, 'utf8').toString('base64');
  163. core.setSecret(basicCredential);
  164. this.tokenPlaceholderConfigValue = `AUTHORIZATION: basic ***`;
  165. this.tokenConfigValue = `AUTHORIZATION: basic ${basicCredential}`;
  166. // Instead of SSH URL
  167. this.insteadOfKey = `url.${serverUrl.origin}/.insteadOf`; // "origin" is SCHEME://HOSTNAME[:PORT]
  168. this.insteadOfValues.push(`git@${serverUrl.hostname}:`);
  169. if (this.settings.workflowOrganizationId) {
  170. this.insteadOfValues.push(`org-${this.settings.workflowOrganizationId}@github.com:`);
  171. }
  172. }
  173. configureAuth() {
  174. return __awaiter(this, void 0, void 0, function* () {
  175. // Remove possible previous values
  176. yield this.removeAuth();
  177. // Configure new values
  178. yield this.configureSsh();
  179. yield this.configureToken();
  180. });
  181. }
  182. configureTempGlobalConfig() {
  183. return __awaiter(this, void 0, void 0, function* () {
  184. var _a;
  185. // Already setup global config
  186. if (((_a = this.temporaryHomePath) === null || _a === void 0 ? void 0 : _a.length) > 0) {
  187. return path.join(this.temporaryHomePath, '.gitconfig');
  188. }
  189. // Create a temp home directory
  190. const runnerTemp = process.env['RUNNER_TEMP'] || '';
  191. assert.ok(runnerTemp, 'RUNNER_TEMP is not defined');
  192. const uniqueId = (0, uuid_1.v4)();
  193. this.temporaryHomePath = path.join(runnerTemp, uniqueId);
  194. yield fs.promises.mkdir(this.temporaryHomePath, { recursive: true });
  195. // Copy the global git config
  196. const gitConfigPath = path.join(process.env['HOME'] || os.homedir(), '.gitconfig');
  197. const newGitConfigPath = path.join(this.temporaryHomePath, '.gitconfig');
  198. let configExists = false;
  199. try {
  200. yield fs.promises.stat(gitConfigPath);
  201. configExists = true;
  202. }
  203. catch (err) {
  204. if ((err === null || err === void 0 ? void 0 : err.code) !== 'ENOENT') {
  205. throw err;
  206. }
  207. }
  208. if (configExists) {
  209. core.info(`Copying '${gitConfigPath}' to '${newGitConfigPath}'`);
  210. yield io.cp(gitConfigPath, newGitConfigPath);
  211. }
  212. else {
  213. yield fs.promises.writeFile(newGitConfigPath, '');
  214. }
  215. // Override HOME
  216. core.info(`Temporarily overriding HOME='${this.temporaryHomePath}' before making global git config changes`);
  217. this.git.setEnvironmentVariable('HOME', this.temporaryHomePath);
  218. return newGitConfigPath;
  219. });
  220. }
  221. configureGlobalAuth() {
  222. return __awaiter(this, void 0, void 0, function* () {
  223. // 'configureTempGlobalConfig' noops if already set, just returns the path
  224. const newGitConfigPath = yield this.configureTempGlobalConfig();
  225. try {
  226. // Configure the token
  227. yield this.configureToken(newGitConfigPath, true);
  228. // Configure HTTPS instead of SSH
  229. yield this.git.tryConfigUnset(this.insteadOfKey, true);
  230. if (!this.settings.sshKey) {
  231. for (const insteadOfValue of this.insteadOfValues) {
  232. yield this.git.config(this.insteadOfKey, insteadOfValue, true, true);
  233. }
  234. }
  235. }
  236. catch (err) {
  237. // Unset in case somehow written to the real global config
  238. core.info('Encountered an error when attempting to configure token. Attempting unconfigure.');
  239. yield this.git.tryConfigUnset(this.tokenConfigKey, true);
  240. throw err;
  241. }
  242. });
  243. }
  244. configureSubmoduleAuth() {
  245. return __awaiter(this, void 0, void 0, function* () {
  246. // Remove possible previous HTTPS instead of SSH
  247. yield this.removeGitConfig(this.insteadOfKey, true);
  248. if (this.settings.persistCredentials) {
  249. // Configure a placeholder value. This approach avoids the credential being captured
  250. // by process creation audit events, which are commonly logged. For more information,
  251. // refer to https://docs.microsoft.com/en-us/windows-server/identity/ad-ds/manage/component-updates/command-line-process-auditing
  252. const output = yield this.git.submoduleForeach(
  253. // wrap the pipeline in quotes to make sure it's handled properly by submoduleForeach, rather than just the first part of the pipeline
  254. `sh -c "git config --local '${this.tokenConfigKey}' '${this.tokenPlaceholderConfigValue}' && git config --local --show-origin --name-only --get-regexp remote.origin.url"`, this.settings.nestedSubmodules);
  255. // Replace the placeholder
  256. const configPaths = output.match(/(?<=(^|\n)file:)[^\t]+(?=\tremote\.origin\.url)/g) || [];
  257. for (const configPath of configPaths) {
  258. core.debug(`Replacing token placeholder in '${configPath}'`);
  259. yield this.replaceTokenPlaceholder(configPath);
  260. }
  261. if (this.settings.sshKey) {
  262. // Configure core.sshCommand
  263. yield this.git.submoduleForeach(`git config --local '${SSH_COMMAND_KEY}' '${this.sshCommand}'`, this.settings.nestedSubmodules);
  264. }
  265. else {
  266. // Configure HTTPS instead of SSH
  267. for (const insteadOfValue of this.insteadOfValues) {
  268. yield this.git.submoduleForeach(`git config --local --add '${this.insteadOfKey}' '${insteadOfValue}'`, this.settings.nestedSubmodules);
  269. }
  270. }
  271. }
  272. });
  273. }
  274. removeAuth() {
  275. return __awaiter(this, void 0, void 0, function* () {
  276. yield this.removeSsh();
  277. yield this.removeToken();
  278. });
  279. }
  280. removeGlobalConfig() {
  281. return __awaiter(this, void 0, void 0, function* () {
  282. var _a;
  283. if (((_a = this.temporaryHomePath) === null || _a === void 0 ? void 0 : _a.length) > 0) {
  284. core.debug(`Unsetting HOME override`);
  285. this.git.removeEnvironmentVariable('HOME');
  286. yield io.rmRF(this.temporaryHomePath);
  287. }
  288. });
  289. }
  290. configureSsh() {
  291. return __awaiter(this, void 0, void 0, function* () {
  292. if (!this.settings.sshKey) {
  293. return;
  294. }
  295. // Write key
  296. const runnerTemp = process.env['RUNNER_TEMP'] || '';
  297. assert.ok(runnerTemp, 'RUNNER_TEMP is not defined');
  298. const uniqueId = (0, uuid_1.v4)();
  299. this.sshKeyPath = path.join(runnerTemp, uniqueId);
  300. stateHelper.setSshKeyPath(this.sshKeyPath);
  301. yield fs.promises.mkdir(runnerTemp, { recursive: true });
  302. yield fs.promises.writeFile(this.sshKeyPath, this.settings.sshKey.trim() + '\n', { mode: 0o600 });
  303. // Remove inherited permissions on Windows
  304. if (IS_WINDOWS) {
  305. const icacls = yield io.which('icacls.exe');
  306. yield exec.exec(`"${icacls}" "${this.sshKeyPath}" /grant:r "${process.env['USERDOMAIN']}\\${process.env['USERNAME']}:F"`);
  307. yield exec.exec(`"${icacls}" "${this.sshKeyPath}" /inheritance:r`);
  308. }
  309. // Write known hosts
  310. const userKnownHostsPath = path.join(os.homedir(), '.ssh', 'known_hosts');
  311. let userKnownHosts = '';
  312. try {
  313. userKnownHosts = (yield fs.promises.readFile(userKnownHostsPath)).toString();
  314. }
  315. catch (err) {
  316. if ((err === null || err === void 0 ? void 0 : err.code) !== 'ENOENT') {
  317. throw err;
  318. }
  319. }
  320. let knownHosts = '';
  321. if (userKnownHosts) {
  322. knownHosts += `# Begin from ${userKnownHostsPath}\n${userKnownHosts}\n# End from ${userKnownHostsPath}\n`;
  323. }
  324. if (this.settings.sshKnownHosts) {
  325. knownHosts += `# Begin from input known hosts\n${this.settings.sshKnownHosts}\n# end from input known hosts\n`;
  326. }
  327. 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`;
  328. this.sshKnownHostsPath = path.join(runnerTemp, `${uniqueId}_known_hosts`);
  329. stateHelper.setSshKnownHostsPath(this.sshKnownHostsPath);
  330. yield fs.promises.writeFile(this.sshKnownHostsPath, knownHosts);
  331. // Configure GIT_SSH_COMMAND
  332. const sshPath = yield io.which('ssh', true);
  333. this.sshCommand = `"${sshPath}" -i "$RUNNER_TEMP/${path.basename(this.sshKeyPath)}"`;
  334. if (this.settings.sshStrict) {
  335. this.sshCommand += ' -o StrictHostKeyChecking=yes -o CheckHostIP=no';
  336. }
  337. this.sshCommand += ` -o "UserKnownHostsFile=$RUNNER_TEMP/${path.basename(this.sshKnownHostsPath)}"`;
  338. core.info(`Temporarily overriding GIT_SSH_COMMAND=${this.sshCommand}`);
  339. this.git.setEnvironmentVariable('GIT_SSH_COMMAND', this.sshCommand);
  340. // Configure core.sshCommand
  341. if (this.settings.persistCredentials) {
  342. yield this.git.config(SSH_COMMAND_KEY, this.sshCommand);
  343. }
  344. });
  345. }
  346. configureToken(configPath, globalConfig) {
  347. return __awaiter(this, void 0, void 0, function* () {
  348. // Validate args
  349. assert.ok((configPath && globalConfig) || (!configPath && !globalConfig), 'Unexpected configureToken parameter combinations');
  350. // Default config path
  351. if (!configPath && !globalConfig) {
  352. configPath = path.join(this.git.getWorkingDirectory(), '.git', 'config');
  353. }
  354. // Configure a placeholder value. This approach avoids the credential being captured
  355. // by process creation audit events, which are commonly logged. For more information,
  356. // refer to https://docs.microsoft.com/en-us/windows-server/identity/ad-ds/manage/component-updates/command-line-process-auditing
  357. yield this.git.config(this.tokenConfigKey, this.tokenPlaceholderConfigValue, globalConfig);
  358. // Replace the placeholder
  359. yield this.replaceTokenPlaceholder(configPath || '');
  360. });
  361. }
  362. replaceTokenPlaceholder(configPath) {
  363. return __awaiter(this, void 0, void 0, function* () {
  364. assert.ok(configPath, 'configPath is not defined');
  365. let content = (yield fs.promises.readFile(configPath)).toString();
  366. const placeholderIndex = content.indexOf(this.tokenPlaceholderConfigValue);
  367. if (placeholderIndex < 0 ||
  368. placeholderIndex != content.lastIndexOf(this.tokenPlaceholderConfigValue)) {
  369. throw new Error(`Unable to replace auth placeholder in ${configPath}`);
  370. }
  371. assert.ok(this.tokenConfigValue, 'tokenConfigValue is not defined');
  372. content = content.replace(this.tokenPlaceholderConfigValue, this.tokenConfigValue);
  373. yield fs.promises.writeFile(configPath, content);
  374. });
  375. }
  376. removeSsh() {
  377. return __awaiter(this, void 0, void 0, function* () {
  378. var _a;
  379. // SSH key
  380. const keyPath = this.sshKeyPath || stateHelper.SshKeyPath;
  381. if (keyPath) {
  382. try {
  383. yield io.rmRF(keyPath);
  384. }
  385. catch (err) {
  386. core.debug(`${(_a = err === null || err === void 0 ? void 0 : err.message) !== null && _a !== void 0 ? _a : err}`);
  387. core.warning(`Failed to remove SSH key '${keyPath}'`);
  388. }
  389. }
  390. // SSH known hosts
  391. const knownHostsPath = this.sshKnownHostsPath || stateHelper.SshKnownHostsPath;
  392. if (knownHostsPath) {
  393. try {
  394. yield io.rmRF(knownHostsPath);
  395. }
  396. catch (_b) {
  397. // Intentionally empty
  398. }
  399. }
  400. // SSH command
  401. yield this.removeGitConfig(SSH_COMMAND_KEY);
  402. });
  403. }
  404. removeToken() {
  405. return __awaiter(this, void 0, void 0, function* () {
  406. // Remove HTTP extra header from local git config and submodule configs
  407. yield this.removeGitConfig(this.tokenConfigKey);
  408. //
  409. // Cleanup actions/checkout@v6 style credentials
  410. //
  411. const skipV6Cleanup = process.env['ACTIONS_CHECKOUT_SKIP_V6_CLEANUP'];
  412. if (skipV6Cleanup === '1' || (skipV6Cleanup === null || skipV6Cleanup === void 0 ? void 0 : skipV6Cleanup.toLowerCase()) === 'true') {
  413. core.debug('Skipping v6 style cleanup due to ACTIONS_CHECKOUT_SKIP_V6_CLEANUP');
  414. return;
  415. }
  416. try {
  417. // Collect credentials config paths that need to be removed
  418. const credentialsPaths = new Set();
  419. // Remove includeIf entries that point to git-credentials-*.config files
  420. const mainCredentialsPaths = yield this.removeIncludeIfCredentials();
  421. mainCredentialsPaths.forEach(path => credentialsPaths.add(path));
  422. // Remove submodule includeIf entries that point to git-credentials-*.config files
  423. try {
  424. const submoduleConfigPaths = yield this.git.getSubmoduleConfigPaths(true);
  425. for (const configPath of submoduleConfigPaths) {
  426. const submoduleCredentialsPaths = yield this.removeIncludeIfCredentials(configPath);
  427. submoduleCredentialsPaths.forEach(path => credentialsPaths.add(path));
  428. }
  429. }
  430. catch (err) {
  431. core.debug(`Unable to get submodule config paths: ${err}`);
  432. }
  433. // Remove credentials config files
  434. for (const credentialsPath of credentialsPaths) {
  435. // Only remove credentials config files if they are under RUNNER_TEMP
  436. const runnerTemp = process.env['RUNNER_TEMP'];
  437. if (runnerTemp && credentialsPath.startsWith(runnerTemp)) {
  438. try {
  439. yield io.rmRF(credentialsPath);
  440. }
  441. catch (err) {
  442. core.debug(`Failed to remove credentials config '${credentialsPath}': ${err}`);
  443. }
  444. }
  445. }
  446. }
  447. catch (err) {
  448. core.debug(`Failed to cleanup v6 style credentials: ${err}`);
  449. }
  450. });
  451. }
  452. removeGitConfig(configKey_1) {
  453. return __awaiter(this, arguments, void 0, function* (configKey, submoduleOnly = false) {
  454. if (!submoduleOnly) {
  455. if ((yield this.git.configExists(configKey)) &&
  456. !(yield this.git.tryConfigUnset(configKey))) {
  457. // Load the config contents
  458. core.warning(`Failed to remove '${configKey}' from the git config`);
  459. }
  460. }
  461. const pattern = regexpHelper.escape(configKey);
  462. yield this.git.submoduleForeach(
  463. // wrap the pipeline in quotes to make sure it's handled properly by submoduleForeach, rather than just the first part of the pipeline
  464. `sh -c "git config --local --name-only --get-regexp '${pattern}' && git config --local --unset-all '${configKey}' || :"`, true);
  465. });
  466. }
  467. /**
  468. * Removes includeIf entries that point to git-credentials-*.config files.
  469. * This handles cleanup of credentials configured by newer versions of the action.
  470. * @param configPath Optional path to a specific git config file to operate on
  471. * @returns Array of unique credentials config file paths that were found and removed
  472. */
  473. removeIncludeIfCredentials(configPath) {
  474. return __awaiter(this, void 0, void 0, function* () {
  475. const credentialsPaths = new Set();
  476. try {
  477. // Get all includeIf.gitdir keys
  478. const keys = yield this.git.tryGetConfigKeys('^includeIf\\.gitdir:', false, // globalConfig?
  479. configPath);
  480. for (const key of keys) {
  481. // Get all values for this key
  482. const values = yield this.git.tryGetConfigValues(key, false, // globalConfig?
  483. configPath);
  484. if (values.length > 0) {
  485. // Remove only values that match git-credentials-<uuid>.config pattern
  486. for (const value of values) {
  487. if (this.testCredentialsConfigPath(value)) {
  488. credentialsPaths.add(value);
  489. yield this.git.tryConfigUnsetValue(key, value, false, configPath);
  490. }
  491. }
  492. }
  493. }
  494. }
  495. catch (err) {
  496. // Ignore errors - this is cleanup code
  497. core.debug(`Error during includeIf cleanup${configPath ? ` for ${configPath}` : ''}: ${err}`);
  498. }
  499. return Array.from(credentialsPaths);
  500. });
  501. }
  502. /**
  503. * Tests if a path matches the git-credentials-*.config pattern used by newer versions.
  504. * @param path The path to test
  505. * @returns True if the path matches the credentials config pattern
  506. */
  507. testCredentialsConfigPath(path) {
  508. return /git-credentials-[0-9a-f-]+\.config$/i.test(path);
  509. }
  510. }
  511. /***/ }),
  512. /***/ 738:
  513. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  514. "use strict";
  515. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  516. if (k2 === undefined) k2 = k;
  517. var desc = Object.getOwnPropertyDescriptor(m, k);
  518. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  519. desc = { enumerable: true, get: function() { return m[k]; } };
  520. }
  521. Object.defineProperty(o, k2, desc);
  522. }) : (function(o, m, k, k2) {
  523. if (k2 === undefined) k2 = k;
  524. o[k2] = m[k];
  525. }));
  526. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  527. Object.defineProperty(o, "default", { enumerable: true, value: v });
  528. }) : function(o, v) {
  529. o["default"] = v;
  530. });
  531. var __importStar = (this && this.__importStar) || function (mod) {
  532. if (mod && mod.__esModule) return mod;
  533. var result = {};
  534. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  535. __setModuleDefault(result, mod);
  536. return result;
  537. };
  538. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  539. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  540. return new (P || (P = Promise))(function (resolve, reject) {
  541. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  542. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  543. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  544. step((generator = generator.apply(thisArg, _arguments || [])).next());
  545. });
  546. };
  547. Object.defineProperty(exports, "__esModule", ({ value: true }));
  548. exports.MinimumGitSparseCheckoutVersion = exports.MinimumGitVersion = void 0;
  549. exports.createCommandManager = createCommandManager;
  550. const core = __importStar(__nccwpck_require__(2186));
  551. const exec = __importStar(__nccwpck_require__(1514));
  552. const fs = __importStar(__nccwpck_require__(7147));
  553. const fshelper = __importStar(__nccwpck_require__(7219));
  554. const io = __importStar(__nccwpck_require__(7436));
  555. const path = __importStar(__nccwpck_require__(1017));
  556. const refHelper = __importStar(__nccwpck_require__(8601));
  557. const regexpHelper = __importStar(__nccwpck_require__(3120));
  558. const retryHelper = __importStar(__nccwpck_require__(2155));
  559. const git_version_1 = __nccwpck_require__(3142);
  560. // Auth header not supported before 2.9
  561. // Wire protocol v2 not supported before 2.18
  562. // sparse-checkout not [well-]supported before 2.28 (see https://github.com/actions/checkout/issues/1386)
  563. exports.MinimumGitVersion = new git_version_1.GitVersion('2.18');
  564. exports.MinimumGitSparseCheckoutVersion = new git_version_1.GitVersion('2.28');
  565. function createCommandManager(workingDirectory, lfs, doSparseCheckout) {
  566. return __awaiter(this, void 0, void 0, function* () {
  567. return yield GitCommandManager.createCommandManager(workingDirectory, lfs, doSparseCheckout);
  568. });
  569. }
  570. class GitCommandManager {
  571. // Private constructor; use createCommandManager()
  572. constructor() {
  573. this.gitEnv = {
  574. GIT_TERMINAL_PROMPT: '0', // Disable git prompt
  575. GCM_INTERACTIVE: 'Never' // Disable prompting for git credential manager
  576. };
  577. this.gitPath = '';
  578. this.lfs = false;
  579. this.doSparseCheckout = false;
  580. this.workingDirectory = '';
  581. this.gitVersion = new git_version_1.GitVersion();
  582. }
  583. branchDelete(remote, branch) {
  584. return __awaiter(this, void 0, void 0, function* () {
  585. const args = ['branch', '--delete', '--force'];
  586. if (remote) {
  587. args.push('--remote');
  588. }
  589. args.push(branch);
  590. yield this.execGit(args);
  591. });
  592. }
  593. branchExists(remote, pattern) {
  594. return __awaiter(this, void 0, void 0, function* () {
  595. const args = ['branch', '--list'];
  596. if (remote) {
  597. args.push('--remote');
  598. }
  599. args.push(pattern);
  600. const output = yield this.execGit(args);
  601. return !!output.stdout.trim();
  602. });
  603. }
  604. branchList(remote) {
  605. return __awaiter(this, void 0, void 0, function* () {
  606. const result = [];
  607. // Note, this implementation uses "rev-parse --symbolic-full-name" because the output from
  608. // "branch --list" is more difficult when in a detached HEAD state.
  609. // TODO(https://github.com/actions/checkout/issues/786): this implementation uses
  610. // "rev-parse --symbolic-full-name" because there is a bug
  611. // in Git 2.18 that causes "rev-parse --symbolic" to output symbolic full names. When
  612. // 2.18 is no longer supported, we can switch back to --symbolic.
  613. const args = ['rev-parse', '--symbolic-full-name'];
  614. if (remote) {
  615. args.push('--remotes=origin');
  616. }
  617. else {
  618. args.push('--branches');
  619. }
  620. const stderr = [];
  621. const errline = [];
  622. const stdout = [];
  623. const stdline = [];
  624. const listeners = {
  625. stderr: (data) => {
  626. stderr.push(data.toString());
  627. },
  628. errline: (data) => {
  629. errline.push(data.toString());
  630. },
  631. stdout: (data) => {
  632. stdout.push(data.toString());
  633. },
  634. stdline: (data) => {
  635. stdline.push(data.toString());
  636. }
  637. };
  638. // Suppress the output in order to avoid flooding annotations with innocuous errors.
  639. yield this.execGit(args, false, true, listeners);
  640. core.debug(`stderr callback is: ${stderr}`);
  641. core.debug(`errline callback is: ${errline}`);
  642. core.debug(`stdout callback is: ${stdout}`);
  643. core.debug(`stdline callback is: ${stdline}`);
  644. for (let branch of stdline) {
  645. branch = branch.trim();
  646. if (!branch) {
  647. continue;
  648. }
  649. if (branch.startsWith('refs/heads/')) {
  650. branch = branch.substring('refs/heads/'.length);
  651. }
  652. else if (branch.startsWith('refs/remotes/')) {
  653. branch = branch.substring('refs/remotes/'.length);
  654. }
  655. result.push(branch);
  656. }
  657. return result;
  658. });
  659. }
  660. disableSparseCheckout() {
  661. return __awaiter(this, void 0, void 0, function* () {
  662. yield this.execGit(['sparse-checkout', 'disable']);
  663. // Disabling 'sparse-checkout` leaves behind an undesirable side-effect in config (even in a pristine environment).
  664. yield this.tryConfigUnset('extensions.worktreeConfig', false);
  665. });
  666. }
  667. sparseCheckout(sparseCheckout) {
  668. return __awaiter(this, void 0, void 0, function* () {
  669. yield this.execGit(['sparse-checkout', 'set', ...sparseCheckout]);
  670. });
  671. }
  672. sparseCheckoutNonConeMode(sparseCheckout) {
  673. return __awaiter(this, void 0, void 0, function* () {
  674. yield this.execGit(['config', 'core.sparseCheckout', 'true']);
  675. const output = yield this.execGit([
  676. 'rev-parse',
  677. '--git-path',
  678. 'info/sparse-checkout'
  679. ]);
  680. const sparseCheckoutPath = path.join(this.workingDirectory, output.stdout.trimRight());
  681. yield fs.promises.appendFile(sparseCheckoutPath, `\n${sparseCheckout.join('\n')}\n`);
  682. });
  683. }
  684. checkout(ref, startPoint) {
  685. return __awaiter(this, void 0, void 0, function* () {
  686. const args = ['checkout', '--progress', '--force'];
  687. if (startPoint) {
  688. args.push('-B', ref, startPoint);
  689. }
  690. else {
  691. args.push(ref);
  692. }
  693. yield this.execGit(args);
  694. });
  695. }
  696. checkoutDetach() {
  697. return __awaiter(this, void 0, void 0, function* () {
  698. const args = ['checkout', '--detach'];
  699. yield this.execGit(args);
  700. });
  701. }
  702. config(configKey, configValue, globalConfig, add) {
  703. return __awaiter(this, void 0, void 0, function* () {
  704. const args = ['config', globalConfig ? '--global' : '--local'];
  705. if (add) {
  706. args.push('--add');
  707. }
  708. args.push(...[configKey, configValue]);
  709. yield this.execGit(args);
  710. });
  711. }
  712. configExists(configKey, globalConfig) {
  713. return __awaiter(this, void 0, void 0, function* () {
  714. const pattern = regexpHelper.escape(configKey);
  715. const output = yield this.execGit([
  716. 'config',
  717. globalConfig ? '--global' : '--local',
  718. '--name-only',
  719. '--get-regexp',
  720. pattern
  721. ], true);
  722. return output.exitCode === 0;
  723. });
  724. }
  725. fetch(refSpec, options) {
  726. return __awaiter(this, void 0, void 0, function* () {
  727. const args = ['-c', 'protocol.version=2', 'fetch'];
  728. if (!refSpec.some(x => x === refHelper.tagsRefSpec) && !options.fetchTags) {
  729. args.push('--no-tags');
  730. }
  731. args.push('--prune', '--no-recurse-submodules');
  732. if (options.showProgress) {
  733. args.push('--progress');
  734. }
  735. if (options.filter) {
  736. args.push(`--filter=${options.filter}`);
  737. }
  738. if (options.fetchDepth && options.fetchDepth > 0) {
  739. args.push(`--depth=${options.fetchDepth}`);
  740. }
  741. else if (fshelper.fileExistsSync(path.join(this.workingDirectory, '.git', 'shallow'))) {
  742. args.push('--unshallow');
  743. }
  744. args.push('origin');
  745. for (const arg of refSpec) {
  746. args.push(arg);
  747. }
  748. const that = this;
  749. yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  750. yield that.execGit(args);
  751. }));
  752. });
  753. }
  754. getDefaultBranch(repositoryUrl) {
  755. return __awaiter(this, void 0, void 0, function* () {
  756. let output;
  757. yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  758. output = yield this.execGit([
  759. 'ls-remote',
  760. '--quiet',
  761. '--exit-code',
  762. '--symref',
  763. repositoryUrl,
  764. 'HEAD'
  765. ]);
  766. }));
  767. if (output) {
  768. // Satisfy compiler, will always be set
  769. for (let line of output.stdout.trim().split('\n')) {
  770. line = line.trim();
  771. if (line.startsWith('ref:') || line.endsWith('HEAD')) {
  772. return line
  773. .substr('ref:'.length, line.length - 'ref:'.length - 'HEAD'.length)
  774. .trim();
  775. }
  776. }
  777. }
  778. throw new Error('Unexpected output when retrieving default branch');
  779. });
  780. }
  781. getSubmoduleConfigPaths(recursive) {
  782. return __awaiter(this, void 0, void 0, function* () {
  783. // Get submodule config file paths.
  784. // Use `--show-origin` to get the config file path for each submodule.
  785. const output = yield this.submoduleForeach(`git config --local --show-origin --name-only --get-regexp remote.origin.url`, recursive);
  786. // Extract config file paths from the output (lines starting with "file:").
  787. const configPaths = output.match(/(?<=(^|\n)file:)[^\t]+(?=\tremote\.origin\.url)/g) || [];
  788. return configPaths;
  789. });
  790. }
  791. getWorkingDirectory() {
  792. return this.workingDirectory;
  793. }
  794. init() {
  795. return __awaiter(this, void 0, void 0, function* () {
  796. yield this.execGit(['init', this.workingDirectory]);
  797. });
  798. }
  799. isDetached() {
  800. return __awaiter(this, void 0, void 0, function* () {
  801. // Note, "branch --show-current" would be simpler but isn't available until Git 2.22
  802. const output = yield this.execGit(['rev-parse', '--symbolic-full-name', '--verify', '--quiet', 'HEAD'], true);
  803. return !output.stdout.trim().startsWith('refs/heads/');
  804. });
  805. }
  806. lfsFetch(ref) {
  807. return __awaiter(this, void 0, void 0, function* () {
  808. const args = ['lfs', 'fetch', 'origin', ref];
  809. const that = this;
  810. yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  811. yield that.execGit(args);
  812. }));
  813. });
  814. }
  815. lfsInstall() {
  816. return __awaiter(this, void 0, void 0, function* () {
  817. yield this.execGit(['lfs', 'install', '--local']);
  818. });
  819. }
  820. log1(format) {
  821. return __awaiter(this, void 0, void 0, function* () {
  822. const args = format ? ['log', '-1', format] : ['log', '-1'];
  823. const silent = format ? false : true;
  824. const output = yield this.execGit(args, false, silent);
  825. return output.stdout;
  826. });
  827. }
  828. remoteAdd(remoteName, remoteUrl) {
  829. return __awaiter(this, void 0, void 0, function* () {
  830. yield this.execGit(['remote', 'add', remoteName, remoteUrl]);
  831. });
  832. }
  833. removeEnvironmentVariable(name) {
  834. delete this.gitEnv[name];
  835. }
  836. /**
  837. * Resolves a ref to a SHA. For a branch or lightweight tag, the commit SHA is returned.
  838. * For an annotated tag, the tag SHA is returned.
  839. * @param {string} ref For example: 'refs/heads/main' or '/refs/tags/v1'
  840. * @returns {Promise<string>}
  841. */
  842. revParse(ref) {
  843. return __awaiter(this, void 0, void 0, function* () {
  844. const output = yield this.execGit(['rev-parse', ref]);
  845. return output.stdout.trim();
  846. });
  847. }
  848. setEnvironmentVariable(name, value) {
  849. this.gitEnv[name] = value;
  850. }
  851. shaExists(sha) {
  852. return __awaiter(this, void 0, void 0, function* () {
  853. const args = ['rev-parse', '--verify', '--quiet', `${sha}^{object}`];
  854. const output = yield this.execGit(args, true);
  855. return output.exitCode === 0;
  856. });
  857. }
  858. submoduleForeach(command, recursive) {
  859. return __awaiter(this, void 0, void 0, function* () {
  860. const args = ['submodule', 'foreach'];
  861. if (recursive) {
  862. args.push('--recursive');
  863. }
  864. args.push(command);
  865. const output = yield this.execGit(args);
  866. return output.stdout;
  867. });
  868. }
  869. submoduleSync(recursive) {
  870. return __awaiter(this, void 0, void 0, function* () {
  871. const args = ['submodule', 'sync'];
  872. if (recursive) {
  873. args.push('--recursive');
  874. }
  875. yield this.execGit(args);
  876. });
  877. }
  878. submoduleUpdate(fetchDepth, recursive) {
  879. return __awaiter(this, void 0, void 0, function* () {
  880. const args = ['-c', 'protocol.version=2'];
  881. args.push('submodule', 'update', '--init', '--force');
  882. if (fetchDepth > 0) {
  883. args.push(`--depth=${fetchDepth}`);
  884. }
  885. if (recursive) {
  886. args.push('--recursive');
  887. }
  888. yield this.execGit(args);
  889. });
  890. }
  891. submoduleStatus() {
  892. return __awaiter(this, void 0, void 0, function* () {
  893. const output = yield this.execGit(['submodule', 'status'], true);
  894. core.debug(output.stdout);
  895. return output.exitCode === 0;
  896. });
  897. }
  898. tagExists(pattern) {
  899. return __awaiter(this, void 0, void 0, function* () {
  900. const output = yield this.execGit(['tag', '--list', pattern]);
  901. return !!output.stdout.trim();
  902. });
  903. }
  904. tryClean() {
  905. return __awaiter(this, void 0, void 0, function* () {
  906. const output = yield this.execGit(['clean', '-ffdx'], true);
  907. return output.exitCode === 0;
  908. });
  909. }
  910. tryConfigUnset(configKey, globalConfig) {
  911. return __awaiter(this, void 0, void 0, function* () {
  912. const output = yield this.execGit([
  913. 'config',
  914. globalConfig ? '--global' : '--local',
  915. '--unset-all',
  916. configKey
  917. ], true);
  918. return output.exitCode === 0;
  919. });
  920. }
  921. tryConfigUnsetValue(configKey, configValue, globalConfig, configFile) {
  922. return __awaiter(this, void 0, void 0, function* () {
  923. const args = ['config'];
  924. if (configFile) {
  925. args.push('--file', configFile);
  926. }
  927. else {
  928. args.push(globalConfig ? '--global' : '--local');
  929. }
  930. args.push('--unset', configKey, configValue);
  931. const output = yield this.execGit(args, true);
  932. return output.exitCode === 0;
  933. });
  934. }
  935. tryDisableAutomaticGarbageCollection() {
  936. return __awaiter(this, void 0, void 0, function* () {
  937. const output = yield this.execGit(['config', '--local', 'gc.auto', '0'], true);
  938. return output.exitCode === 0;
  939. });
  940. }
  941. tryGetFetchUrl() {
  942. return __awaiter(this, void 0, void 0, function* () {
  943. const output = yield this.execGit(['config', '--local', '--get', 'remote.origin.url'], true);
  944. if (output.exitCode !== 0) {
  945. return '';
  946. }
  947. const stdout = output.stdout.trim();
  948. if (stdout.includes('\n')) {
  949. return '';
  950. }
  951. return stdout;
  952. });
  953. }
  954. tryGetConfigValues(configKey, globalConfig, configFile) {
  955. return __awaiter(this, void 0, void 0, function* () {
  956. const args = ['config'];
  957. if (configFile) {
  958. args.push('--file', configFile);
  959. }
  960. else {
  961. args.push(globalConfig ? '--global' : '--local');
  962. }
  963. args.push('--get-all', configKey);
  964. const output = yield this.execGit(args, true);
  965. if (output.exitCode !== 0) {
  966. return [];
  967. }
  968. return output.stdout
  969. .trim()
  970. .split('\n')
  971. .filter(value => value.trim());
  972. });
  973. }
  974. tryGetConfigKeys(pattern, globalConfig, configFile) {
  975. return __awaiter(this, void 0, void 0, function* () {
  976. const args = ['config'];
  977. if (configFile) {
  978. args.push('--file', configFile);
  979. }
  980. else {
  981. args.push(globalConfig ? '--global' : '--local');
  982. }
  983. args.push('--name-only', '--get-regexp', pattern);
  984. const output = yield this.execGit(args, true);
  985. if (output.exitCode !== 0) {
  986. return [];
  987. }
  988. return output.stdout
  989. .trim()
  990. .split('\n')
  991. .filter(key => key.trim());
  992. });
  993. }
  994. tryReset() {
  995. return __awaiter(this, void 0, void 0, function* () {
  996. const output = yield this.execGit(['reset', '--hard', 'HEAD'], true);
  997. return output.exitCode === 0;
  998. });
  999. }
  1000. version() {
  1001. return __awaiter(this, void 0, void 0, function* () {
  1002. return this.gitVersion;
  1003. });
  1004. }
  1005. static createCommandManager(workingDirectory, lfs, doSparseCheckout) {
  1006. return __awaiter(this, void 0, void 0, function* () {
  1007. const result = new GitCommandManager();
  1008. yield result.initializeCommandManager(workingDirectory, lfs, doSparseCheckout);
  1009. return result;
  1010. });
  1011. }
  1012. execGit(args_1) {
  1013. return __awaiter(this, arguments, void 0, function* (args, allowAllExitCodes = false, silent = false, customListeners = {}) {
  1014. fshelper.directoryExistsSync(this.workingDirectory, true);
  1015. const result = new GitOutput();
  1016. const env = {};
  1017. for (const key of Object.keys(process.env)) {
  1018. env[key] = process.env[key];
  1019. }
  1020. for (const key of Object.keys(this.gitEnv)) {
  1021. env[key] = this.gitEnv[key];
  1022. }
  1023. const defaultListener = {
  1024. stdout: (data) => {
  1025. stdout.push(data.toString());
  1026. }
  1027. };
  1028. const mergedListeners = Object.assign(Object.assign({}, defaultListener), customListeners);
  1029. const stdout = [];
  1030. const options = {
  1031. cwd: this.workingDirectory,
  1032. env,
  1033. silent,
  1034. ignoreReturnCode: allowAllExitCodes,
  1035. listeners: mergedListeners
  1036. };
  1037. result.exitCode = yield exec.exec(`"${this.gitPath}"`, args, options);
  1038. result.stdout = stdout.join('');
  1039. core.debug(result.exitCode.toString());
  1040. core.debug(result.stdout);
  1041. return result;
  1042. });
  1043. }
  1044. initializeCommandManager(workingDirectory, lfs, doSparseCheckout) {
  1045. return __awaiter(this, void 0, void 0, function* () {
  1046. this.workingDirectory = workingDirectory;
  1047. // Git-lfs will try to pull down assets if any of the local/user/system setting exist.
  1048. // If the user didn't enable `LFS` in their pipeline definition, disable LFS fetch/checkout.
  1049. this.lfs = lfs;
  1050. if (!this.lfs) {
  1051. this.gitEnv['GIT_LFS_SKIP_SMUDGE'] = '1';
  1052. }
  1053. this.gitPath = yield io.which('git', true);
  1054. // Git version
  1055. core.debug('Getting git version');
  1056. this.gitVersion = new git_version_1.GitVersion();
  1057. let gitOutput = yield this.execGit(['version']);
  1058. let stdout = gitOutput.stdout.trim();
  1059. if (!stdout.includes('\n')) {
  1060. const match = stdout.match(/\d+\.\d+(\.\d+)?/);
  1061. if (match) {
  1062. this.gitVersion = new git_version_1.GitVersion(match[0]);
  1063. }
  1064. }
  1065. if (!this.gitVersion.isValid()) {
  1066. throw new Error('Unable to determine git version');
  1067. }
  1068. // Minimum git version
  1069. if (!this.gitVersion.checkMinimum(exports.MinimumGitVersion)) {
  1070. throw new Error(`Minimum required git version is ${exports.MinimumGitVersion}. Your git ('${this.gitPath}') is ${this.gitVersion}`);
  1071. }
  1072. if (this.lfs) {
  1073. // Git-lfs version
  1074. core.debug('Getting git-lfs version');
  1075. let gitLfsVersion = new git_version_1.GitVersion();
  1076. const gitLfsPath = yield io.which('git-lfs', true);
  1077. gitOutput = yield this.execGit(['lfs', 'version']);
  1078. stdout = gitOutput.stdout.trim();
  1079. if (!stdout.includes('\n')) {
  1080. const match = stdout.match(/\d+\.\d+(\.\d+)?/);
  1081. if (match) {
  1082. gitLfsVersion = new git_version_1.GitVersion(match[0]);
  1083. }
  1084. }
  1085. if (!gitLfsVersion.isValid()) {
  1086. throw new Error('Unable to determine git-lfs version');
  1087. }
  1088. // Minimum git-lfs version
  1089. // Note:
  1090. // - Auth header not supported before 2.1
  1091. const minimumGitLfsVersion = new git_version_1.GitVersion('2.1');
  1092. if (!gitLfsVersion.checkMinimum(minimumGitLfsVersion)) {
  1093. throw new Error(`Minimum required git-lfs version is ${minimumGitLfsVersion}. Your git-lfs ('${gitLfsPath}') is ${gitLfsVersion}`);
  1094. }
  1095. }
  1096. this.doSparseCheckout = doSparseCheckout;
  1097. if (this.doSparseCheckout) {
  1098. if (!this.gitVersion.checkMinimum(exports.MinimumGitSparseCheckoutVersion)) {
  1099. throw new Error(`Minimum Git version required for sparse checkout is ${exports.MinimumGitSparseCheckoutVersion}. Your git ('${this.gitPath}') is ${this.gitVersion}`);
  1100. }
  1101. }
  1102. // Set the user agent
  1103. const gitHttpUserAgent = `git/${this.gitVersion} (github-actions-checkout)`;
  1104. core.debug(`Set git useragent to: ${gitHttpUserAgent}`);
  1105. this.gitEnv['GIT_HTTP_USER_AGENT'] = gitHttpUserAgent;
  1106. });
  1107. }
  1108. }
  1109. class GitOutput {
  1110. constructor() {
  1111. this.stdout = '';
  1112. this.exitCode = 0;
  1113. }
  1114. }
  1115. /***/ }),
  1116. /***/ 8609:
  1117. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  1118. "use strict";
  1119. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  1120. if (k2 === undefined) k2 = k;
  1121. var desc = Object.getOwnPropertyDescriptor(m, k);
  1122. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  1123. desc = { enumerable: true, get: function() { return m[k]; } };
  1124. }
  1125. Object.defineProperty(o, k2, desc);
  1126. }) : (function(o, m, k, k2) {
  1127. if (k2 === undefined) k2 = k;
  1128. o[k2] = m[k];
  1129. }));
  1130. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  1131. Object.defineProperty(o, "default", { enumerable: true, value: v });
  1132. }) : function(o, v) {
  1133. o["default"] = v;
  1134. });
  1135. var __importStar = (this && this.__importStar) || function (mod) {
  1136. if (mod && mod.__esModule) return mod;
  1137. var result = {};
  1138. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  1139. __setModuleDefault(result, mod);
  1140. return result;
  1141. };
  1142. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  1143. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  1144. return new (P || (P = Promise))(function (resolve, reject) {
  1145. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  1146. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  1147. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  1148. step((generator = generator.apply(thisArg, _arguments || [])).next());
  1149. });
  1150. };
  1151. Object.defineProperty(exports, "__esModule", ({ value: true }));
  1152. exports.prepareExistingDirectory = prepareExistingDirectory;
  1153. const assert = __importStar(__nccwpck_require__(9491));
  1154. const core = __importStar(__nccwpck_require__(2186));
  1155. const fs = __importStar(__nccwpck_require__(7147));
  1156. const fsHelper = __importStar(__nccwpck_require__(7219));
  1157. const io = __importStar(__nccwpck_require__(7436));
  1158. const path = __importStar(__nccwpck_require__(1017));
  1159. function prepareExistingDirectory(git, repositoryPath, repositoryUrl, clean, ref) {
  1160. return __awaiter(this, void 0, void 0, function* () {
  1161. var _a;
  1162. assert.ok(repositoryPath, 'Expected repositoryPath to be defined');
  1163. assert.ok(repositoryUrl, 'Expected repositoryUrl to be defined');
  1164. // Indicates whether to delete the directory contents
  1165. let remove = false;
  1166. // Check whether using git or REST API
  1167. if (!git) {
  1168. remove = true;
  1169. }
  1170. // Fetch URL does not match
  1171. else if (!fsHelper.directoryExistsSync(path.join(repositoryPath, '.git')) ||
  1172. repositoryUrl !== (yield git.tryGetFetchUrl())) {
  1173. remove = true;
  1174. }
  1175. else {
  1176. // Delete any index.lock and shallow.lock left by a previously canceled run or crashed git process
  1177. const lockPaths = [
  1178. path.join(repositoryPath, '.git', 'index.lock'),
  1179. path.join(repositoryPath, '.git', 'shallow.lock')
  1180. ];
  1181. for (const lockPath of lockPaths) {
  1182. try {
  1183. yield io.rmRF(lockPath);
  1184. }
  1185. catch (error) {
  1186. core.debug(`Unable to delete '${lockPath}'. ${(_a = error === null || error === void 0 ? void 0 : error.message) !== null && _a !== void 0 ? _a : error}`);
  1187. }
  1188. }
  1189. try {
  1190. core.startGroup('Removing previously created refs, to avoid conflicts');
  1191. // Checkout detached HEAD
  1192. if (!(yield git.isDetached())) {
  1193. yield git.checkoutDetach();
  1194. }
  1195. // Remove all refs/heads/*
  1196. let branches = yield git.branchList(false);
  1197. for (const branch of branches) {
  1198. yield git.branchDelete(false, branch);
  1199. }
  1200. // Remove any conflicting refs/remotes/origin/*
  1201. // Example 1: Consider ref is refs/heads/foo and previously fetched refs/remotes/origin/foo/bar
  1202. // Example 2: Consider ref is refs/heads/foo/bar and previously fetched refs/remotes/origin/foo
  1203. if (ref) {
  1204. ref = ref.startsWith('refs/') ? ref : `refs/heads/${ref}`;
  1205. if (ref.startsWith('refs/heads/')) {
  1206. const upperName1 = ref.toUpperCase().substr('REFS/HEADS/'.length);
  1207. const upperName1Slash = `${upperName1}/`;
  1208. branches = yield git.branchList(true);
  1209. for (const branch of branches) {
  1210. const upperName2 = branch.substr('origin/'.length).toUpperCase();
  1211. const upperName2Slash = `${upperName2}/`;
  1212. if (upperName1.startsWith(upperName2Slash) ||
  1213. upperName2.startsWith(upperName1Slash)) {
  1214. yield git.branchDelete(true, branch);
  1215. }
  1216. }
  1217. }
  1218. }
  1219. core.endGroup();
  1220. // Check for submodules and delete any existing files if submodules are present
  1221. if (!(yield git.submoduleStatus())) {
  1222. remove = true;
  1223. core.info('Bad Submodules found, removing existing files');
  1224. }
  1225. // Clean
  1226. if (clean) {
  1227. core.startGroup('Cleaning the repository');
  1228. if (!(yield git.tryClean())) {
  1229. 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}'.`);
  1230. remove = true;
  1231. }
  1232. else if (!(yield git.tryReset())) {
  1233. remove = true;
  1234. }
  1235. core.endGroup();
  1236. if (remove) {
  1237. core.warning(`Unable to clean or reset the repository. The repository will be recreated instead.`);
  1238. }
  1239. }
  1240. }
  1241. catch (error) {
  1242. core.warning(`Unable to prepare the existing repository. The repository will be recreated instead.`);
  1243. remove = true;
  1244. }
  1245. }
  1246. if (remove) {
  1247. // Delete the contents of the directory. Don't delete the directory itself
  1248. // since it might be the current working directory.
  1249. core.info(`Deleting the contents of '${repositoryPath}'`);
  1250. for (const file of yield fs.promises.readdir(repositoryPath)) {
  1251. yield io.rmRF(path.join(repositoryPath, file));
  1252. }
  1253. }
  1254. });
  1255. }
  1256. /***/ }),
  1257. /***/ 9210:
  1258. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  1259. "use strict";
  1260. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  1261. if (k2 === undefined) k2 = k;
  1262. var desc = Object.getOwnPropertyDescriptor(m, k);
  1263. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  1264. desc = { enumerable: true, get: function() { return m[k]; } };
  1265. }
  1266. Object.defineProperty(o, k2, desc);
  1267. }) : (function(o, m, k, k2) {
  1268. if (k2 === undefined) k2 = k;
  1269. o[k2] = m[k];
  1270. }));
  1271. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  1272. Object.defineProperty(o, "default", { enumerable: true, value: v });
  1273. }) : function(o, v) {
  1274. o["default"] = v;
  1275. });
  1276. var __importStar = (this && this.__importStar) || function (mod) {
  1277. if (mod && mod.__esModule) return mod;
  1278. var result = {};
  1279. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  1280. __setModuleDefault(result, mod);
  1281. return result;
  1282. };
  1283. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  1284. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  1285. return new (P || (P = Promise))(function (resolve, reject) {
  1286. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  1287. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  1288. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  1289. step((generator = generator.apply(thisArg, _arguments || [])).next());
  1290. });
  1291. };
  1292. Object.defineProperty(exports, "__esModule", ({ value: true }));
  1293. exports.getSource = getSource;
  1294. exports.cleanup = cleanup;
  1295. const core = __importStar(__nccwpck_require__(2186));
  1296. const fsHelper = __importStar(__nccwpck_require__(7219));
  1297. const gitAuthHelper = __importStar(__nccwpck_require__(2565));
  1298. const gitCommandManager = __importStar(__nccwpck_require__(738));
  1299. const gitDirectoryHelper = __importStar(__nccwpck_require__(8609));
  1300. const githubApiHelper = __importStar(__nccwpck_require__(138));
  1301. const io = __importStar(__nccwpck_require__(7436));
  1302. const path = __importStar(__nccwpck_require__(1017));
  1303. const refHelper = __importStar(__nccwpck_require__(8601));
  1304. const stateHelper = __importStar(__nccwpck_require__(4866));
  1305. const urlHelper = __importStar(__nccwpck_require__(9437));
  1306. const git_command_manager_1 = __nccwpck_require__(738);
  1307. function getSource(settings) {
  1308. return __awaiter(this, void 0, void 0, function* () {
  1309. // Repository URL
  1310. core.info(`Syncing repository: ${settings.repositoryOwner}/${settings.repositoryName}`);
  1311. const repositoryUrl = urlHelper.getFetchUrl(settings);
  1312. // Remove conflicting file path
  1313. if (fsHelper.fileExistsSync(settings.repositoryPath)) {
  1314. yield io.rmRF(settings.repositoryPath);
  1315. }
  1316. // Create directory
  1317. let isExisting = true;
  1318. if (!fsHelper.directoryExistsSync(settings.repositoryPath)) {
  1319. isExisting = false;
  1320. yield io.mkdirP(settings.repositoryPath);
  1321. }
  1322. // Git command manager
  1323. core.startGroup('Getting Git version info');
  1324. const git = yield getGitCommandManager(settings);
  1325. core.endGroup();
  1326. let authHelper = null;
  1327. try {
  1328. if (git) {
  1329. authHelper = gitAuthHelper.createAuthHelper(git, settings);
  1330. if (settings.setSafeDirectory) {
  1331. // 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
  1332. // Otherwise all git commands we run in a container fail
  1333. yield authHelper.configureTempGlobalConfig();
  1334. core.info(`Adding repository directory to the temporary git global config as a safe directory`);
  1335. yield git
  1336. .config('safe.directory', settings.repositoryPath, true, true)
  1337. .catch(error => {
  1338. core.info(`Failed to initialize safe directory with error: ${error}`);
  1339. });
  1340. stateHelper.setSafeDirectory();
  1341. }
  1342. }
  1343. // Prepare existing directory, otherwise recreate
  1344. if (isExisting) {
  1345. yield gitDirectoryHelper.prepareExistingDirectory(git, settings.repositoryPath, repositoryUrl, settings.clean, settings.ref);
  1346. }
  1347. if (!git) {
  1348. // Downloading using REST API
  1349. core.info(`The repository will be downloaded using the GitHub REST API`);
  1350. core.info(`To create a local Git repository instead, add Git ${gitCommandManager.MinimumGitVersion} or higher to the PATH`);
  1351. if (settings.submodules) {
  1352. 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.`);
  1353. }
  1354. else if (settings.sshKey) {
  1355. 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.`);
  1356. }
  1357. yield githubApiHelper.downloadRepository(settings.authToken, settings.repositoryOwner, settings.repositoryName, settings.ref, settings.commit, settings.repositoryPath, settings.githubServerUrl);
  1358. return;
  1359. }
  1360. // Save state for POST action
  1361. stateHelper.setRepositoryPath(settings.repositoryPath);
  1362. // Initialize the repository
  1363. if (!fsHelper.directoryExistsSync(path.join(settings.repositoryPath, '.git'))) {
  1364. core.startGroup('Initializing the repository');
  1365. yield git.init();
  1366. yield git.remoteAdd('origin', repositoryUrl);
  1367. core.endGroup();
  1368. }
  1369. // Disable automatic garbage collection
  1370. core.startGroup('Disabling automatic garbage collection');
  1371. if (!(yield git.tryDisableAutomaticGarbageCollection())) {
  1372. core.warning(`Unable to turn off git automatic garbage collection. The git fetch operation may trigger garbage collection and cause a delay.`);
  1373. }
  1374. core.endGroup();
  1375. // If we didn't initialize it above, do it now
  1376. if (!authHelper) {
  1377. authHelper = gitAuthHelper.createAuthHelper(git, settings);
  1378. }
  1379. // Configure auth
  1380. core.startGroup('Setting up auth');
  1381. yield authHelper.configureAuth();
  1382. core.endGroup();
  1383. // Determine the default branch
  1384. if (!settings.ref && !settings.commit) {
  1385. core.startGroup('Determining the default branch');
  1386. if (settings.sshKey) {
  1387. settings.ref = yield git.getDefaultBranch(repositoryUrl);
  1388. }
  1389. else {
  1390. settings.ref = yield githubApiHelper.getDefaultBranch(settings.authToken, settings.repositoryOwner, settings.repositoryName, settings.githubServerUrl);
  1391. }
  1392. core.endGroup();
  1393. }
  1394. // LFS install
  1395. if (settings.lfs) {
  1396. yield git.lfsInstall();
  1397. }
  1398. // Fetch
  1399. core.startGroup('Fetching the repository');
  1400. const fetchOptions = {};
  1401. if (settings.filter) {
  1402. fetchOptions.filter = settings.filter;
  1403. }
  1404. else if (settings.sparseCheckout) {
  1405. fetchOptions.filter = 'blob:none';
  1406. }
  1407. if (settings.fetchDepth <= 0) {
  1408. // Fetch all branches and tags
  1409. let refSpec = refHelper.getRefSpecForAllHistory(settings.ref, settings.commit);
  1410. yield git.fetch(refSpec, fetchOptions);
  1411. // When all history is fetched, the ref we're interested in may have moved to a different
  1412. // commit (push or force push). If so, fetch again with a targeted refspec.
  1413. if (!(yield refHelper.testRef(git, settings.ref, settings.commit))) {
  1414. refSpec = refHelper.getRefSpec(settings.ref, settings.commit);
  1415. yield git.fetch(refSpec, fetchOptions);
  1416. }
  1417. }
  1418. else {
  1419. fetchOptions.fetchDepth = settings.fetchDepth;
  1420. fetchOptions.fetchTags = settings.fetchTags;
  1421. const refSpec = refHelper.getRefSpec(settings.ref, settings.commit);
  1422. yield git.fetch(refSpec, fetchOptions);
  1423. }
  1424. core.endGroup();
  1425. // Checkout info
  1426. core.startGroup('Determining the checkout info');
  1427. const checkoutInfo = yield refHelper.getCheckoutInfo(git, settings.ref, settings.commit);
  1428. core.endGroup();
  1429. // LFS fetch
  1430. // Explicit lfs-fetch to avoid slow checkout (fetches one lfs object at a time).
  1431. // Explicit lfs fetch will fetch lfs objects in parallel.
  1432. // For sparse checkouts, let `checkout` fetch the needed objects lazily.
  1433. if (settings.lfs && !settings.sparseCheckout) {
  1434. core.startGroup('Fetching LFS objects');
  1435. yield git.lfsFetch(checkoutInfo.startPoint || checkoutInfo.ref);
  1436. core.endGroup();
  1437. }
  1438. // Sparse checkout
  1439. if (!settings.sparseCheckout) {
  1440. let gitVersion = yield git.version();
  1441. // no need to disable sparse-checkout if the installed git runtime doesn't even support it.
  1442. if (gitVersion.checkMinimum(git_command_manager_1.MinimumGitSparseCheckoutVersion)) {
  1443. yield git.disableSparseCheckout();
  1444. }
  1445. }
  1446. else {
  1447. core.startGroup('Setting up sparse checkout');
  1448. if (settings.sparseCheckoutConeMode) {
  1449. yield git.sparseCheckout(settings.sparseCheckout);
  1450. }
  1451. else {
  1452. yield git.sparseCheckoutNonConeMode(settings.sparseCheckout);
  1453. }
  1454. core.endGroup();
  1455. }
  1456. // Checkout
  1457. core.startGroup('Checking out the ref');
  1458. yield git.checkout(checkoutInfo.ref, checkoutInfo.startPoint);
  1459. core.endGroup();
  1460. // Submodules
  1461. if (settings.submodules) {
  1462. // Temporarily override global config
  1463. core.startGroup('Setting up auth for fetching submodules');
  1464. yield authHelper.configureGlobalAuth();
  1465. core.endGroup();
  1466. // Checkout submodules
  1467. core.startGroup('Fetching submodules');
  1468. yield git.submoduleSync(settings.nestedSubmodules);
  1469. yield git.submoduleUpdate(settings.fetchDepth, settings.nestedSubmodules);
  1470. yield git.submoduleForeach('git config --local gc.auto 0', settings.nestedSubmodules);
  1471. core.endGroup();
  1472. // Persist credentials
  1473. if (settings.persistCredentials) {
  1474. core.startGroup('Persisting credentials for submodules');
  1475. yield authHelper.configureSubmoduleAuth();
  1476. core.endGroup();
  1477. }
  1478. }
  1479. // Get commit information
  1480. const commitInfo = yield git.log1();
  1481. // Log commit sha
  1482. const commitSHA = yield git.log1('--format=%H');
  1483. core.setOutput('commit', commitSHA.trim());
  1484. // Check for incorrect pull request merge commit
  1485. yield refHelper.checkCommitInfo(settings.authToken, commitInfo, settings.repositoryOwner, settings.repositoryName, settings.ref, settings.commit, settings.githubServerUrl);
  1486. }
  1487. finally {
  1488. // Remove auth
  1489. if (authHelper) {
  1490. if (!settings.persistCredentials) {
  1491. core.startGroup('Removing auth');
  1492. yield authHelper.removeAuth();
  1493. core.endGroup();
  1494. }
  1495. authHelper.removeGlobalConfig();
  1496. }
  1497. }
  1498. });
  1499. }
  1500. function cleanup(repositoryPath) {
  1501. return __awaiter(this, void 0, void 0, function* () {
  1502. // Repo exists?
  1503. if (!repositoryPath ||
  1504. !fsHelper.fileExistsSync(path.join(repositoryPath, '.git', 'config'))) {
  1505. return;
  1506. }
  1507. let git;
  1508. try {
  1509. git = yield gitCommandManager.createCommandManager(repositoryPath, false, false);
  1510. }
  1511. catch (_a) {
  1512. return;
  1513. }
  1514. // Remove auth
  1515. const authHelper = gitAuthHelper.createAuthHelper(git);
  1516. try {
  1517. if (stateHelper.PostSetSafeDirectory) {
  1518. // 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
  1519. // Otherwise all git commands we run in a container fail
  1520. yield authHelper.configureTempGlobalConfig();
  1521. core.info(`Adding repository directory to the temporary git global config as a safe directory`);
  1522. yield git
  1523. .config('safe.directory', repositoryPath, true, true)
  1524. .catch(error => {
  1525. core.info(`Failed to initialize safe directory with error: ${error}`);
  1526. });
  1527. }
  1528. yield authHelper.removeAuth();
  1529. }
  1530. finally {
  1531. yield authHelper.removeGlobalConfig();
  1532. }
  1533. });
  1534. }
  1535. function getGitCommandManager(settings) {
  1536. return __awaiter(this, void 0, void 0, function* () {
  1537. core.info(`Working directory is '${settings.repositoryPath}'`);
  1538. try {
  1539. return yield gitCommandManager.createCommandManager(settings.repositoryPath, settings.lfs, settings.sparseCheckout != null);
  1540. }
  1541. catch (err) {
  1542. // Git is required for LFS
  1543. if (settings.lfs) {
  1544. throw err;
  1545. }
  1546. // Otherwise fallback to REST API
  1547. return undefined;
  1548. }
  1549. });
  1550. }
  1551. /***/ }),
  1552. /***/ 3142:
  1553. /***/ ((__unused_webpack_module, exports) => {
  1554. "use strict";
  1555. Object.defineProperty(exports, "__esModule", ({ value: true }));
  1556. exports.GitVersion = void 0;
  1557. class GitVersion {
  1558. /**
  1559. * Used for comparing the version of git and git-lfs against the minimum required version
  1560. * @param version the version string, e.g. 1.2 or 1.2.3
  1561. */
  1562. constructor(version) {
  1563. this.major = NaN;
  1564. this.minor = NaN;
  1565. this.patch = NaN;
  1566. if (version) {
  1567. const match = version.match(/^(\d+)\.(\d+)(\.(\d+))?$/);
  1568. if (match) {
  1569. this.major = Number(match[1]);
  1570. this.minor = Number(match[2]);
  1571. if (match[4]) {
  1572. this.patch = Number(match[4]);
  1573. }
  1574. }
  1575. }
  1576. }
  1577. /**
  1578. * Compares the instance against a minimum required version
  1579. * @param minimum Minimum version
  1580. */
  1581. checkMinimum(minimum) {
  1582. if (!minimum.isValid()) {
  1583. throw new Error('Arg minimum is not a valid version');
  1584. }
  1585. // Major is insufficient
  1586. if (this.major < minimum.major) {
  1587. return false;
  1588. }
  1589. // Major is equal
  1590. if (this.major === minimum.major) {
  1591. // Minor is insufficient
  1592. if (this.minor < minimum.minor) {
  1593. return false;
  1594. }
  1595. // Minor is equal
  1596. if (this.minor === minimum.minor) {
  1597. // Patch is insufficient
  1598. if (this.patch && this.patch < (minimum.patch || 0)) {
  1599. return false;
  1600. }
  1601. }
  1602. }
  1603. return true;
  1604. }
  1605. /**
  1606. * Indicates whether the instance was constructed from a valid version string
  1607. */
  1608. isValid() {
  1609. return !isNaN(this.major);
  1610. }
  1611. /**
  1612. * Returns the version as a string, e.g. 1.2 or 1.2.3
  1613. */
  1614. toString() {
  1615. let result = '';
  1616. if (this.isValid()) {
  1617. result = `${this.major}.${this.minor}`;
  1618. if (!isNaN(this.patch)) {
  1619. result += `.${this.patch}`;
  1620. }
  1621. }
  1622. return result;
  1623. }
  1624. }
  1625. exports.GitVersion = GitVersion;
  1626. /***/ }),
  1627. /***/ 138:
  1628. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  1629. "use strict";
  1630. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  1631. if (k2 === undefined) k2 = k;
  1632. var desc = Object.getOwnPropertyDescriptor(m, k);
  1633. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  1634. desc = { enumerable: true, get: function() { return m[k]; } };
  1635. }
  1636. Object.defineProperty(o, k2, desc);
  1637. }) : (function(o, m, k, k2) {
  1638. if (k2 === undefined) k2 = k;
  1639. o[k2] = m[k];
  1640. }));
  1641. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  1642. Object.defineProperty(o, "default", { enumerable: true, value: v });
  1643. }) : function(o, v) {
  1644. o["default"] = v;
  1645. });
  1646. var __importStar = (this && this.__importStar) || function (mod) {
  1647. if (mod && mod.__esModule) return mod;
  1648. var result = {};
  1649. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  1650. __setModuleDefault(result, mod);
  1651. return result;
  1652. };
  1653. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  1654. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  1655. return new (P || (P = Promise))(function (resolve, reject) {
  1656. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  1657. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  1658. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  1659. step((generator = generator.apply(thisArg, _arguments || [])).next());
  1660. });
  1661. };
  1662. Object.defineProperty(exports, "__esModule", ({ value: true }));
  1663. exports.downloadRepository = downloadRepository;
  1664. exports.getDefaultBranch = getDefaultBranch;
  1665. const assert = __importStar(__nccwpck_require__(9491));
  1666. const core = __importStar(__nccwpck_require__(2186));
  1667. const fs = __importStar(__nccwpck_require__(7147));
  1668. const github = __importStar(__nccwpck_require__(5438));
  1669. const io = __importStar(__nccwpck_require__(7436));
  1670. const path = __importStar(__nccwpck_require__(1017));
  1671. const retryHelper = __importStar(__nccwpck_require__(2155));
  1672. const toolCache = __importStar(__nccwpck_require__(7784));
  1673. const uuid_1 = __nccwpck_require__(5840);
  1674. const url_helper_1 = __nccwpck_require__(9437);
  1675. const IS_WINDOWS = process.platform === 'win32';
  1676. function downloadRepository(authToken, owner, repo, ref, commit, repositoryPath, baseUrl) {
  1677. return __awaiter(this, void 0, void 0, function* () {
  1678. // Determine the default branch
  1679. if (!ref && !commit) {
  1680. core.info('Determining the default branch');
  1681. ref = yield getDefaultBranch(authToken, owner, repo, baseUrl);
  1682. }
  1683. // Download the archive
  1684. let archiveData = yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  1685. core.info('Downloading the archive');
  1686. return yield downloadArchive(authToken, owner, repo, ref, commit, baseUrl);
  1687. }));
  1688. // Write archive to disk
  1689. core.info('Writing archive to disk');
  1690. const uniqueId = (0, uuid_1.v4)();
  1691. const archivePath = IS_WINDOWS
  1692. ? path.join(repositoryPath, `${uniqueId}.zip`)
  1693. : path.join(repositoryPath, `${uniqueId}.tar.gz`);
  1694. yield fs.promises.writeFile(archivePath, archiveData);
  1695. archiveData = Buffer.from(''); // Free memory
  1696. // Extract archive
  1697. core.info('Extracting the archive');
  1698. const extractPath = path.join(repositoryPath, uniqueId);
  1699. yield io.mkdirP(extractPath);
  1700. if (IS_WINDOWS) {
  1701. yield toolCache.extractZip(archivePath, extractPath);
  1702. }
  1703. else {
  1704. yield toolCache.extractTar(archivePath, extractPath);
  1705. }
  1706. yield io.rmRF(archivePath);
  1707. // Determine the path of the repository content. The archive contains
  1708. // a top-level folder and the repository content is inside.
  1709. const archiveFileNames = yield fs.promises.readdir(extractPath);
  1710. assert.ok(archiveFileNames.length == 1, 'Expected exactly one directory inside archive');
  1711. const archiveVersion = archiveFileNames[0]; // The top-level folder name includes the short SHA
  1712. core.info(`Resolved version ${archiveVersion}`);
  1713. const tempRepositoryPath = path.join(extractPath, archiveVersion);
  1714. // Move the files
  1715. for (const fileName of yield fs.promises.readdir(tempRepositoryPath)) {
  1716. const sourcePath = path.join(tempRepositoryPath, fileName);
  1717. const targetPath = path.join(repositoryPath, fileName);
  1718. if (IS_WINDOWS) {
  1719. yield io.cp(sourcePath, targetPath, { recursive: true }); // Copy on Windows (Windows Defender may have a lock)
  1720. }
  1721. else {
  1722. yield io.mv(sourcePath, targetPath);
  1723. }
  1724. }
  1725. yield io.rmRF(extractPath);
  1726. });
  1727. }
  1728. /**
  1729. * Looks up the default branch name
  1730. */
  1731. function getDefaultBranch(authToken, owner, repo, baseUrl) {
  1732. return __awaiter(this, void 0, void 0, function* () {
  1733. return yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  1734. core.info('Retrieving the default branch name');
  1735. const octokit = github.getOctokit(authToken, {
  1736. baseUrl: (0, url_helper_1.getServerApiUrl)(baseUrl)
  1737. });
  1738. let result;
  1739. try {
  1740. // Get the default branch from the repo info
  1741. const response = yield octokit.rest.repos.get({ owner, repo });
  1742. result = response.data.default_branch;
  1743. assert.ok(result, 'default_branch cannot be empty');
  1744. }
  1745. catch (err) {
  1746. // Handle .wiki repo
  1747. if ((err === null || err === void 0 ? void 0 : err.status) === 404 &&
  1748. repo.toUpperCase().endsWith('.WIKI')) {
  1749. result = 'master';
  1750. }
  1751. // Otherwise error
  1752. else {
  1753. throw err;
  1754. }
  1755. }
  1756. // Print the default branch
  1757. core.info(`Default branch '${result}'`);
  1758. // Prefix with 'refs/heads'
  1759. if (!result.startsWith('refs/')) {
  1760. result = `refs/heads/${result}`;
  1761. }
  1762. return result;
  1763. }));
  1764. });
  1765. }
  1766. function downloadArchive(authToken, owner, repo, ref, commit, baseUrl) {
  1767. return __awaiter(this, void 0, void 0, function* () {
  1768. const octokit = github.getOctokit(authToken, {
  1769. baseUrl: (0, url_helper_1.getServerApiUrl)(baseUrl)
  1770. });
  1771. const download = IS_WINDOWS
  1772. ? octokit.rest.repos.downloadZipballArchive
  1773. : octokit.rest.repos.downloadTarballArchive;
  1774. const response = yield download({
  1775. owner: owner,
  1776. repo: repo,
  1777. ref: commit || ref
  1778. });
  1779. return Buffer.from(response.data); // response.data is ArrayBuffer
  1780. });
  1781. }
  1782. /***/ }),
  1783. /***/ 5480:
  1784. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  1785. "use strict";
  1786. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  1787. if (k2 === undefined) k2 = k;
  1788. var desc = Object.getOwnPropertyDescriptor(m, k);
  1789. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  1790. desc = { enumerable: true, get: function() { return m[k]; } };
  1791. }
  1792. Object.defineProperty(o, k2, desc);
  1793. }) : (function(o, m, k, k2) {
  1794. if (k2 === undefined) k2 = k;
  1795. o[k2] = m[k];
  1796. }));
  1797. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  1798. Object.defineProperty(o, "default", { enumerable: true, value: v });
  1799. }) : function(o, v) {
  1800. o["default"] = v;
  1801. });
  1802. var __importStar = (this && this.__importStar) || function (mod) {
  1803. if (mod && mod.__esModule) return mod;
  1804. var result = {};
  1805. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  1806. __setModuleDefault(result, mod);
  1807. return result;
  1808. };
  1809. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  1810. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  1811. return new (P || (P = Promise))(function (resolve, reject) {
  1812. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  1813. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  1814. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  1815. step((generator = generator.apply(thisArg, _arguments || [])).next());
  1816. });
  1817. };
  1818. Object.defineProperty(exports, "__esModule", ({ value: true }));
  1819. exports.getInputs = getInputs;
  1820. const core = __importStar(__nccwpck_require__(2186));
  1821. const fsHelper = __importStar(__nccwpck_require__(7219));
  1822. const github = __importStar(__nccwpck_require__(5438));
  1823. const path = __importStar(__nccwpck_require__(1017));
  1824. const unsafePrCheckoutHelper = __importStar(__nccwpck_require__(843));
  1825. const workflowContextHelper = __importStar(__nccwpck_require__(9568));
  1826. function getInputs() {
  1827. return __awaiter(this, void 0, void 0, function* () {
  1828. const result = {};
  1829. // GitHub workspace
  1830. let githubWorkspacePath = process.env['GITHUB_WORKSPACE'];
  1831. if (!githubWorkspacePath) {
  1832. throw new Error('GITHUB_WORKSPACE not defined');
  1833. }
  1834. githubWorkspacePath = path.resolve(githubWorkspacePath);
  1835. core.debug(`GITHUB_WORKSPACE = '${githubWorkspacePath}'`);
  1836. fsHelper.directoryExistsSync(githubWorkspacePath, true);
  1837. // Qualified repository
  1838. const qualifiedRepository = core.getInput('repository') ||
  1839. `${github.context.repo.owner}/${github.context.repo.repo}`;
  1840. core.debug(`qualified repository = '${qualifiedRepository}'`);
  1841. const splitRepository = qualifiedRepository.split('/');
  1842. if (splitRepository.length !== 2 ||
  1843. !splitRepository[0] ||
  1844. !splitRepository[1]) {
  1845. throw new Error(`Invalid repository '${qualifiedRepository}'. Expected format {owner}/{repo}.`);
  1846. }
  1847. result.repositoryOwner = splitRepository[0];
  1848. result.repositoryName = splitRepository[1];
  1849. // Repository path
  1850. result.repositoryPath = core.getInput('path') || '.';
  1851. result.repositoryPath = path.resolve(githubWorkspacePath, result.repositoryPath);
  1852. if (!(result.repositoryPath + path.sep).startsWith(githubWorkspacePath + path.sep)) {
  1853. throw new Error(`Repository path '${result.repositoryPath}' is not under '${githubWorkspacePath}'`);
  1854. }
  1855. // Workflow repository?
  1856. const isWorkflowRepository = qualifiedRepository.toUpperCase() ===
  1857. `${github.context.repo.owner}/${github.context.repo.repo}`.toUpperCase();
  1858. // Source branch, source version
  1859. result.ref = core.getInput('ref');
  1860. if (!result.ref) {
  1861. if (isWorkflowRepository) {
  1862. result.ref = github.context.ref;
  1863. result.commit = github.context.sha;
  1864. // Some events have an unqualifed ref. For example when a PR is merged (pull_request closed event),
  1865. // the ref is unqualifed like "main" instead of "refs/heads/main".
  1866. if (result.commit && result.ref && !result.ref.startsWith('refs/')) {
  1867. result.ref = `refs/heads/${result.ref}`;
  1868. }
  1869. }
  1870. }
  1871. // SHA?
  1872. else if (result.ref.match(/^[0-9a-fA-F]{40}$/)) {
  1873. result.commit = result.ref;
  1874. result.ref = '';
  1875. }
  1876. core.debug(`ref = '${result.ref}'`);
  1877. core.debug(`commit = '${result.commit}'`);
  1878. // Clean
  1879. result.clean = (core.getInput('clean') || 'true').toUpperCase() === 'TRUE';
  1880. core.debug(`clean = ${result.clean}`);
  1881. // Filter
  1882. const filter = core.getInput('filter');
  1883. if (filter) {
  1884. result.filter = filter;
  1885. }
  1886. core.debug(`filter = ${result.filter}`);
  1887. // Sparse checkout
  1888. const sparseCheckout = core.getMultilineInput('sparse-checkout');
  1889. if (sparseCheckout.length) {
  1890. result.sparseCheckout = sparseCheckout;
  1891. core.debug(`sparse checkout = ${result.sparseCheckout}`);
  1892. }
  1893. result.sparseCheckoutConeMode =
  1894. (core.getInput('sparse-checkout-cone-mode') || 'true').toUpperCase() ===
  1895. 'TRUE';
  1896. // Fetch depth
  1897. result.fetchDepth = Math.floor(Number(core.getInput('fetch-depth') || '1'));
  1898. if (isNaN(result.fetchDepth) || result.fetchDepth < 0) {
  1899. result.fetchDepth = 0;
  1900. }
  1901. core.debug(`fetch depth = ${result.fetchDepth}`);
  1902. // Fetch tags
  1903. result.fetchTags =
  1904. (core.getInput('fetch-tags') || 'false').toUpperCase() === 'TRUE';
  1905. core.debug(`fetch tags = ${result.fetchTags}`);
  1906. // Show fetch progress
  1907. result.showProgress =
  1908. (core.getInput('show-progress') || 'true').toUpperCase() === 'TRUE';
  1909. core.debug(`show progress = ${result.showProgress}`);
  1910. // LFS
  1911. result.lfs = (core.getInput('lfs') || 'false').toUpperCase() === 'TRUE';
  1912. core.debug(`lfs = ${result.lfs}`);
  1913. // Submodules
  1914. result.submodules = false;
  1915. result.nestedSubmodules = false;
  1916. const submodulesString = (core.getInput('submodules') || '').toUpperCase();
  1917. if (submodulesString == 'RECURSIVE') {
  1918. result.submodules = true;
  1919. result.nestedSubmodules = true;
  1920. }
  1921. else if (submodulesString == 'TRUE') {
  1922. result.submodules = true;
  1923. }
  1924. core.debug(`submodules = ${result.submodules}`);
  1925. core.debug(`recursive submodules = ${result.nestedSubmodules}`);
  1926. // Auth token
  1927. result.authToken = core.getInput('token', { required: true });
  1928. // SSH
  1929. result.sshKey = core.getInput('ssh-key');
  1930. result.sshKnownHosts = core.getInput('ssh-known-hosts');
  1931. result.sshStrict =
  1932. (core.getInput('ssh-strict') || 'true').toUpperCase() === 'TRUE';
  1933. result.sshUser = core.getInput('ssh-user');
  1934. // Persist credentials
  1935. result.persistCredentials =
  1936. (core.getInput('persist-credentials') || 'false').toUpperCase() === 'TRUE';
  1937. // Workflow organization ID
  1938. result.workflowOrganizationId =
  1939. yield workflowContextHelper.getOrganizationId();
  1940. // Set safe.directory in git global config.
  1941. result.setSafeDirectory =
  1942. (core.getInput('set-safe-directory') || 'true').toUpperCase() === 'TRUE';
  1943. // Determine the GitHub URL that the repository is being hosted from
  1944. result.githubServerUrl = core.getInput('github-server-url');
  1945. core.debug(`GitHub Host URL = ${result.githubServerUrl}`);
  1946. // Allow unsafe PR checkout (opt-in for pull_request_target / workflow_run fork PRs)
  1947. result.allowUnsafePrCheckout =
  1948. (core.getInput('allow-unsafe-pr-checkout') || 'false').toUpperCase() ===
  1949. 'TRUE';
  1950. core.debug(`allow unsafe PR checkout = ${result.allowUnsafePrCheckout}`);
  1951. // The default self-checkout (this repository with no explicit ref) always
  1952. // resolves to the trusted ref/commit GitHub set for the triggering event, so
  1953. // the fork-checkout guard only needs to run when the caller customized the
  1954. // repository or ref.
  1955. const isDefaultCheckout = isWorkflowRepository && !core.getInput('ref');
  1956. if (!isDefaultCheckout) {
  1957. unsafePrCheckoutHelper.assertSafePrCheckout({
  1958. qualifiedRepository,
  1959. ref: result.ref,
  1960. commit: result.commit,
  1961. allowUnsafePrCheckout: result.allowUnsafePrCheckout
  1962. });
  1963. }
  1964. return result;
  1965. });
  1966. }
  1967. /***/ }),
  1968. /***/ 3109:
  1969. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  1970. "use strict";
  1971. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  1972. if (k2 === undefined) k2 = k;
  1973. var desc = Object.getOwnPropertyDescriptor(m, k);
  1974. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  1975. desc = { enumerable: true, get: function() { return m[k]; } };
  1976. }
  1977. Object.defineProperty(o, k2, desc);
  1978. }) : (function(o, m, k, k2) {
  1979. if (k2 === undefined) k2 = k;
  1980. o[k2] = m[k];
  1981. }));
  1982. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  1983. Object.defineProperty(o, "default", { enumerable: true, value: v });
  1984. }) : function(o, v) {
  1985. o["default"] = v;
  1986. });
  1987. var __importStar = (this && this.__importStar) || function (mod) {
  1988. if (mod && mod.__esModule) return mod;
  1989. var result = {};
  1990. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  1991. __setModuleDefault(result, mod);
  1992. return result;
  1993. };
  1994. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  1995. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  1996. return new (P || (P = Promise))(function (resolve, reject) {
  1997. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  1998. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  1999. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  2000. step((generator = generator.apply(thisArg, _arguments || [])).next());
  2001. });
  2002. };
  2003. Object.defineProperty(exports, "__esModule", ({ value: true }));
  2004. const core = __importStar(__nccwpck_require__(2186));
  2005. const coreCommand = __importStar(__nccwpck_require__(7351));
  2006. const gitSourceProvider = __importStar(__nccwpck_require__(9210));
  2007. const inputHelper = __importStar(__nccwpck_require__(5480));
  2008. const path = __importStar(__nccwpck_require__(1017));
  2009. const stateHelper = __importStar(__nccwpck_require__(4866));
  2010. function run() {
  2011. return __awaiter(this, void 0, void 0, function* () {
  2012. var _a;
  2013. try {
  2014. const sourceSettings = yield inputHelper.getInputs();
  2015. try {
  2016. // Register problem matcher
  2017. coreCommand.issueCommand('add-matcher', {}, path.join(__dirname, 'problem-matcher.json'));
  2018. // Get sources
  2019. yield gitSourceProvider.getSource(sourceSettings);
  2020. core.setOutput('ref', sourceSettings.ref);
  2021. }
  2022. finally {
  2023. // Unregister problem matcher
  2024. coreCommand.issueCommand('remove-matcher', { owner: 'checkout-git' }, '');
  2025. }
  2026. }
  2027. catch (error) {
  2028. core.setFailed(`${(_a = error === null || error === void 0 ? void 0 : error.message) !== null && _a !== void 0 ? _a : error}`);
  2029. }
  2030. });
  2031. }
  2032. function cleanup() {
  2033. return __awaiter(this, void 0, void 0, function* () {
  2034. var _a;
  2035. try {
  2036. yield gitSourceProvider.cleanup(stateHelper.RepositoryPath);
  2037. }
  2038. catch (error) {
  2039. core.warning(`${(_a = error === null || error === void 0 ? void 0 : error.message) !== null && _a !== void 0 ? _a : error}`);
  2040. }
  2041. });
  2042. }
  2043. // Main
  2044. if (!stateHelper.IsPost) {
  2045. run();
  2046. }
  2047. // Post
  2048. else {
  2049. cleanup();
  2050. }
  2051. /***/ }),
  2052. /***/ 8601:
  2053. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  2054. "use strict";
  2055. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  2056. if (k2 === undefined) k2 = k;
  2057. var desc = Object.getOwnPropertyDescriptor(m, k);
  2058. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  2059. desc = { enumerable: true, get: function() { return m[k]; } };
  2060. }
  2061. Object.defineProperty(o, k2, desc);
  2062. }) : (function(o, m, k, k2) {
  2063. if (k2 === undefined) k2 = k;
  2064. o[k2] = m[k];
  2065. }));
  2066. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  2067. Object.defineProperty(o, "default", { enumerable: true, value: v });
  2068. }) : function(o, v) {
  2069. o["default"] = v;
  2070. });
  2071. var __importStar = (this && this.__importStar) || function (mod) {
  2072. if (mod && mod.__esModule) return mod;
  2073. var result = {};
  2074. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  2075. __setModuleDefault(result, mod);
  2076. return result;
  2077. };
  2078. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  2079. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  2080. return new (P || (P = Promise))(function (resolve, reject) {
  2081. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  2082. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  2083. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  2084. step((generator = generator.apply(thisArg, _arguments || [])).next());
  2085. });
  2086. };
  2087. Object.defineProperty(exports, "__esModule", ({ value: true }));
  2088. exports.tagsRefSpec = void 0;
  2089. exports.getCheckoutInfo = getCheckoutInfo;
  2090. exports.getRefSpecForAllHistory = getRefSpecForAllHistory;
  2091. exports.getRefSpec = getRefSpec;
  2092. exports.testRef = testRef;
  2093. exports.checkCommitInfo = checkCommitInfo;
  2094. exports.fromPayload = fromPayload;
  2095. const core = __importStar(__nccwpck_require__(2186));
  2096. const github = __importStar(__nccwpck_require__(5438));
  2097. const url_helper_1 = __nccwpck_require__(9437);
  2098. exports.tagsRefSpec = '+refs/tags/*:refs/tags/*';
  2099. function getCheckoutInfo(git, ref, commit) {
  2100. return __awaiter(this, void 0, void 0, function* () {
  2101. if (!git) {
  2102. throw new Error('Arg git cannot be empty');
  2103. }
  2104. if (!ref && !commit) {
  2105. throw new Error('Args ref and commit cannot both be empty');
  2106. }
  2107. const result = {};
  2108. const upperRef = (ref || '').toUpperCase();
  2109. // SHA only
  2110. if (!ref) {
  2111. result.ref = commit;
  2112. }
  2113. // refs/heads/
  2114. else if (upperRef.startsWith('REFS/HEADS/')) {
  2115. const branch = ref.substring('refs/heads/'.length);
  2116. result.ref = branch;
  2117. result.startPoint = `refs/remotes/origin/${branch}`;
  2118. }
  2119. // refs/pull/
  2120. else if (upperRef.startsWith('REFS/PULL/')) {
  2121. const branch = ref.substring('refs/pull/'.length);
  2122. result.ref = `refs/remotes/pull/${branch}`;
  2123. }
  2124. // refs/tags/
  2125. else if (upperRef.startsWith('REFS/TAGS/')) {
  2126. result.ref = ref;
  2127. }
  2128. // refs/
  2129. else if (upperRef.startsWith('REFS/')) {
  2130. result.ref = commit ? commit : ref;
  2131. }
  2132. // Unqualified ref, check for a matching branch or tag
  2133. else {
  2134. if (yield git.branchExists(true, `origin/${ref}`)) {
  2135. result.ref = ref;
  2136. result.startPoint = `refs/remotes/origin/${ref}`;
  2137. }
  2138. else if (yield git.tagExists(`${ref}`)) {
  2139. result.ref = `refs/tags/${ref}`;
  2140. }
  2141. else {
  2142. throw new Error(`A branch or tag with the name '${ref}' could not be found`);
  2143. }
  2144. }
  2145. return result;
  2146. });
  2147. }
  2148. function getRefSpecForAllHistory(ref, commit) {
  2149. const result = ['+refs/heads/*:refs/remotes/origin/*', exports.tagsRefSpec];
  2150. if (ref && ref.toUpperCase().startsWith('REFS/PULL/')) {
  2151. const branch = ref.substring('refs/pull/'.length);
  2152. result.push(`+${commit || ref}:refs/remotes/pull/${branch}`);
  2153. }
  2154. return result;
  2155. }
  2156. function getRefSpec(ref, commit) {
  2157. if (!ref && !commit) {
  2158. throw new Error('Args ref and commit cannot both be empty');
  2159. }
  2160. const upperRef = (ref || '').toUpperCase();
  2161. // SHA
  2162. if (commit) {
  2163. // refs/heads
  2164. if (upperRef.startsWith('REFS/HEADS/')) {
  2165. const branch = ref.substring('refs/heads/'.length);
  2166. return [`+${commit}:refs/remotes/origin/${branch}`];
  2167. }
  2168. // refs/pull/
  2169. else if (upperRef.startsWith('REFS/PULL/')) {
  2170. const branch = ref.substring('refs/pull/'.length);
  2171. return [`+${commit}:refs/remotes/pull/${branch}`];
  2172. }
  2173. // refs/tags/
  2174. else if (upperRef.startsWith('REFS/TAGS/')) {
  2175. return [`+${commit}:${ref}`];
  2176. }
  2177. // Otherwise no destination ref
  2178. else {
  2179. return [commit];
  2180. }
  2181. }
  2182. // Unqualified ref, check for a matching branch or tag
  2183. else if (!upperRef.startsWith('REFS/')) {
  2184. return [
  2185. `+refs/heads/${ref}*:refs/remotes/origin/${ref}*`,
  2186. `+refs/tags/${ref}*:refs/tags/${ref}*`
  2187. ];
  2188. }
  2189. // refs/heads/
  2190. else if (upperRef.startsWith('REFS/HEADS/')) {
  2191. const branch = ref.substring('refs/heads/'.length);
  2192. return [`+${ref}:refs/remotes/origin/${branch}`];
  2193. }
  2194. // refs/pull/
  2195. else if (upperRef.startsWith('REFS/PULL/')) {
  2196. const branch = ref.substring('refs/pull/'.length);
  2197. return [`+${ref}:refs/remotes/pull/${branch}`];
  2198. }
  2199. // refs/tags/
  2200. else {
  2201. return [`+${ref}:${ref}`];
  2202. }
  2203. }
  2204. /**
  2205. * Tests whether the initial fetch created the ref at the expected commit
  2206. */
  2207. function testRef(git, ref, commit) {
  2208. return __awaiter(this, void 0, void 0, function* () {
  2209. if (!git) {
  2210. throw new Error('Arg git cannot be empty');
  2211. }
  2212. if (!ref && !commit) {
  2213. throw new Error('Args ref and commit cannot both be empty');
  2214. }
  2215. // No SHA? Nothing to test
  2216. if (!commit) {
  2217. return true;
  2218. }
  2219. // SHA only?
  2220. else if (!ref) {
  2221. return yield git.shaExists(commit);
  2222. }
  2223. const upperRef = ref.toUpperCase();
  2224. // refs/heads/
  2225. if (upperRef.startsWith('REFS/HEADS/')) {
  2226. const branch = ref.substring('refs/heads/'.length);
  2227. return ((yield git.branchExists(true, `origin/${branch}`)) &&
  2228. commit === (yield git.revParse(`refs/remotes/origin/${branch}`)));
  2229. }
  2230. // refs/pull/
  2231. else if (upperRef.startsWith('REFS/PULL/')) {
  2232. // Assume matches because fetched using the commit
  2233. return true;
  2234. }
  2235. // refs/tags/
  2236. else if (upperRef.startsWith('REFS/TAGS/')) {
  2237. const tagName = ref.substring('refs/tags/'.length);
  2238. return ((yield git.tagExists(tagName)) && commit === (yield git.revParse(ref)));
  2239. }
  2240. // Unexpected
  2241. else {
  2242. core.debug(`Unexpected ref format '${ref}' when testing ref info`);
  2243. return true;
  2244. }
  2245. });
  2246. }
  2247. function checkCommitInfo(token, commitInfo, repositoryOwner, repositoryName, ref, commit, baseUrl) {
  2248. return __awaiter(this, void 0, void 0, function* () {
  2249. var _a;
  2250. try {
  2251. // GHES?
  2252. if ((0, url_helper_1.isGhes)(baseUrl)) {
  2253. return;
  2254. }
  2255. // Auth token?
  2256. if (!token) {
  2257. return;
  2258. }
  2259. // Public PR synchronize, for workflow repo?
  2260. if (fromPayload('repository.private') !== false ||
  2261. github.context.eventName !== 'pull_request' ||
  2262. fromPayload('action') !== 'synchronize' ||
  2263. repositoryOwner !== github.context.repo.owner ||
  2264. repositoryName !== github.context.repo.repo ||
  2265. ref !== github.context.ref ||
  2266. !ref.startsWith('refs/pull/') ||
  2267. commit !== github.context.sha) {
  2268. return;
  2269. }
  2270. // Head SHA
  2271. const expectedHeadSha = fromPayload('after');
  2272. if (!expectedHeadSha) {
  2273. core.debug('Unable to determine head sha');
  2274. return;
  2275. }
  2276. // Base SHA
  2277. const expectedBaseSha = fromPayload('pull_request.base.sha');
  2278. if (!expectedBaseSha) {
  2279. core.debug('Unable to determine base sha');
  2280. return;
  2281. }
  2282. // Expected message?
  2283. const expectedMessage = `Merge ${expectedHeadSha} into ${expectedBaseSha}`;
  2284. if (commitInfo.indexOf(expectedMessage) >= 0) {
  2285. return;
  2286. }
  2287. // Extract details from message
  2288. const match = commitInfo.match(/Merge ([0-9a-f]{40}) into ([0-9a-f]{40})/);
  2289. if (!match) {
  2290. core.debug('Unexpected message format');
  2291. return;
  2292. }
  2293. // Post telemetry
  2294. const actualHeadSha = match[1];
  2295. if (actualHeadSha !== expectedHeadSha) {
  2296. core.debug(`Expected head sha ${expectedHeadSha}; actual head sha ${actualHeadSha}`);
  2297. const octokit = github.getOctokit(token, {
  2298. baseUrl: (0, url_helper_1.getServerApiUrl)(baseUrl),
  2299. 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})`
  2300. });
  2301. yield octokit.rest.repos.get({
  2302. owner: repositoryOwner,
  2303. repo: repositoryName
  2304. });
  2305. }
  2306. }
  2307. catch (err) {
  2308. core.debug(`Error when validating commit info: ${(_a = err === null || err === void 0 ? void 0 : err.stack) !== null && _a !== void 0 ? _a : err}`);
  2309. }
  2310. });
  2311. }
  2312. function fromPayload(path) {
  2313. return select(github.context.payload, path);
  2314. }
  2315. function select(obj, path) {
  2316. if (!obj) {
  2317. return undefined;
  2318. }
  2319. const i = path.indexOf('.');
  2320. if (i < 0) {
  2321. return obj[path];
  2322. }
  2323. const key = path.substr(0, i);
  2324. return select(obj[key], path.substr(i + 1));
  2325. }
  2326. /***/ }),
  2327. /***/ 3120:
  2328. /***/ ((__unused_webpack_module, exports) => {
  2329. "use strict";
  2330. Object.defineProperty(exports, "__esModule", ({ value: true }));
  2331. exports.escape = escape;
  2332. function escape(value) {
  2333. return value.replace(/[^a-zA-Z0-9_]/g, x => {
  2334. return `\\${x}`;
  2335. });
  2336. }
  2337. /***/ }),
  2338. /***/ 2155:
  2339. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  2340. "use strict";
  2341. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  2342. if (k2 === undefined) k2 = k;
  2343. var desc = Object.getOwnPropertyDescriptor(m, k);
  2344. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  2345. desc = { enumerable: true, get: function() { return m[k]; } };
  2346. }
  2347. Object.defineProperty(o, k2, desc);
  2348. }) : (function(o, m, k, k2) {
  2349. if (k2 === undefined) k2 = k;
  2350. o[k2] = m[k];
  2351. }));
  2352. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  2353. Object.defineProperty(o, "default", { enumerable: true, value: v });
  2354. }) : function(o, v) {
  2355. o["default"] = v;
  2356. });
  2357. var __importStar = (this && this.__importStar) || function (mod) {
  2358. if (mod && mod.__esModule) return mod;
  2359. var result = {};
  2360. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  2361. __setModuleDefault(result, mod);
  2362. return result;
  2363. };
  2364. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  2365. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  2366. return new (P || (P = Promise))(function (resolve, reject) {
  2367. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  2368. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  2369. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  2370. step((generator = generator.apply(thisArg, _arguments || [])).next());
  2371. });
  2372. };
  2373. Object.defineProperty(exports, "__esModule", ({ value: true }));
  2374. exports.RetryHelper = void 0;
  2375. exports.execute = execute;
  2376. const core = __importStar(__nccwpck_require__(2186));
  2377. const defaultMaxAttempts = 3;
  2378. const defaultMinSeconds = 10;
  2379. const defaultMaxSeconds = 20;
  2380. class RetryHelper {
  2381. constructor(maxAttempts = defaultMaxAttempts, minSeconds = defaultMinSeconds, maxSeconds = defaultMaxSeconds) {
  2382. this.maxAttempts = maxAttempts;
  2383. this.minSeconds = Math.floor(minSeconds);
  2384. this.maxSeconds = Math.floor(maxSeconds);
  2385. if (this.minSeconds > this.maxSeconds) {
  2386. throw new Error('min seconds should be less than or equal to max seconds');
  2387. }
  2388. }
  2389. execute(action) {
  2390. return __awaiter(this, void 0, void 0, function* () {
  2391. let attempt = 1;
  2392. while (attempt < this.maxAttempts) {
  2393. // Try
  2394. try {
  2395. return yield action();
  2396. }
  2397. catch (err) {
  2398. core.info(err === null || err === void 0 ? void 0 : err.message);
  2399. }
  2400. // Sleep
  2401. const seconds = this.getSleepAmount();
  2402. core.info(`Waiting ${seconds} seconds before trying again`);
  2403. yield this.sleep(seconds);
  2404. attempt++;
  2405. }
  2406. // Last attempt
  2407. return yield action();
  2408. });
  2409. }
  2410. getSleepAmount() {
  2411. return (Math.floor(Math.random() * (this.maxSeconds - this.minSeconds + 1)) +
  2412. this.minSeconds);
  2413. }
  2414. sleep(seconds) {
  2415. return __awaiter(this, void 0, void 0, function* () {
  2416. return new Promise(resolve => setTimeout(resolve, seconds * 1000));
  2417. });
  2418. }
  2419. }
  2420. exports.RetryHelper = RetryHelper;
  2421. function execute(action) {
  2422. return __awaiter(this, void 0, void 0, function* () {
  2423. const retryHelper = new RetryHelper();
  2424. return yield retryHelper.execute(action);
  2425. });
  2426. }
  2427. /***/ }),
  2428. /***/ 4866:
  2429. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  2430. "use strict";
  2431. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  2432. if (k2 === undefined) k2 = k;
  2433. var desc = Object.getOwnPropertyDescriptor(m, k);
  2434. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  2435. desc = { enumerable: true, get: function() { return m[k]; } };
  2436. }
  2437. Object.defineProperty(o, k2, desc);
  2438. }) : (function(o, m, k, k2) {
  2439. if (k2 === undefined) k2 = k;
  2440. o[k2] = m[k];
  2441. }));
  2442. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  2443. Object.defineProperty(o, "default", { enumerable: true, value: v });
  2444. }) : function(o, v) {
  2445. o["default"] = v;
  2446. });
  2447. var __importStar = (this && this.__importStar) || function (mod) {
  2448. if (mod && mod.__esModule) return mod;
  2449. var result = {};
  2450. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  2451. __setModuleDefault(result, mod);
  2452. return result;
  2453. };
  2454. Object.defineProperty(exports, "__esModule", ({ value: true }));
  2455. exports.SshKnownHostsPath = exports.SshKeyPath = exports.PostSetSafeDirectory = exports.RepositoryPath = exports.IsPost = void 0;
  2456. exports.setRepositoryPath = setRepositoryPath;
  2457. exports.setSshKeyPath = setSshKeyPath;
  2458. exports.setSshKnownHostsPath = setSshKnownHostsPath;
  2459. exports.setSafeDirectory = setSafeDirectory;
  2460. const core = __importStar(__nccwpck_require__(2186));
  2461. /**
  2462. * Indicates whether the POST action is running
  2463. */
  2464. exports.IsPost = !!core.getState('isPost');
  2465. /**
  2466. * The repository path for the POST action. The value is empty during the MAIN action.
  2467. */
  2468. exports.RepositoryPath = core.getState('repositoryPath');
  2469. /**
  2470. * The set-safe-directory for the POST action. The value is set if input: 'safe-directory' is set during the MAIN action.
  2471. */
  2472. exports.PostSetSafeDirectory = core.getState('setSafeDirectory') === 'true';
  2473. /**
  2474. * The SSH key path for the POST action. The value is empty during the MAIN action.
  2475. */
  2476. exports.SshKeyPath = core.getState('sshKeyPath');
  2477. /**
  2478. * The SSH known hosts path for the POST action. The value is empty during the MAIN action.
  2479. */
  2480. exports.SshKnownHostsPath = core.getState('sshKnownHostsPath');
  2481. /**
  2482. * Save the repository path so the POST action can retrieve the value.
  2483. */
  2484. function setRepositoryPath(repositoryPath) {
  2485. core.saveState('repositoryPath', repositoryPath);
  2486. }
  2487. /**
  2488. * Save the SSH key path so the POST action can retrieve the value.
  2489. */
  2490. function setSshKeyPath(sshKeyPath) {
  2491. core.saveState('sshKeyPath', sshKeyPath);
  2492. }
  2493. /**
  2494. * Save the SSH known hosts path so the POST action can retrieve the value.
  2495. */
  2496. function setSshKnownHostsPath(sshKnownHostsPath) {
  2497. core.saveState('sshKnownHostsPath', sshKnownHostsPath);
  2498. }
  2499. /**
  2500. * Save the set-safe-directory input so the POST action can retrieve the value.
  2501. */
  2502. function setSafeDirectory() {
  2503. core.saveState('setSafeDirectory', 'true');
  2504. }
  2505. // Publish a variable so that when the POST action runs, it can determine it should run the cleanup logic.
  2506. // This is necessary since we don't have a separate entry point.
  2507. if (!exports.IsPost) {
  2508. core.saveState('isPost', 'true');
  2509. }
  2510. /***/ }),
  2511. /***/ 843:
  2512. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  2513. "use strict";
  2514. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  2515. if (k2 === undefined) k2 = k;
  2516. var desc = Object.getOwnPropertyDescriptor(m, k);
  2517. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  2518. desc = { enumerable: true, get: function() { return m[k]; } };
  2519. }
  2520. Object.defineProperty(o, k2, desc);
  2521. }) : (function(o, m, k, k2) {
  2522. if (k2 === undefined) k2 = k;
  2523. o[k2] = m[k];
  2524. }));
  2525. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  2526. Object.defineProperty(o, "default", { enumerable: true, value: v });
  2527. }) : function(o, v) {
  2528. o["default"] = v;
  2529. });
  2530. var __importStar = (this && this.__importStar) || function (mod) {
  2531. if (mod && mod.__esModule) return mod;
  2532. var result = {};
  2533. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  2534. __setModuleDefault(result, mod);
  2535. return result;
  2536. };
  2537. Object.defineProperty(exports, "__esModule", ({ value: true }));
  2538. exports.assertSafePrCheckout = assertSafePrCheckout;
  2539. const github = __importStar(__nccwpck_require__(5438));
  2540. const ref_helper_1 = __nccwpck_require__(8601);
  2541. const PR_REF_PATTERN = /^refs\/pull\/[0-9]+\/(?:head|merge)$/;
  2542. function assertSafePrCheckout(input) {
  2543. if (input.allowUnsafePrCheckout) {
  2544. return;
  2545. }
  2546. const eventName = github.context.eventName;
  2547. if (eventName !== 'pull_request_target' && eventName !== 'workflow_run') {
  2548. return;
  2549. }
  2550. const baseRepoId = (0, ref_helper_1.fromPayload)('repository.id');
  2551. if (typeof baseRepoId !== 'number') {
  2552. return;
  2553. }
  2554. let prHeadRepoId;
  2555. let prHeadRepoFullName;
  2556. const prShas = [];
  2557. if (eventName === 'pull_request_target') {
  2558. prHeadRepoId = (0, ref_helper_1.fromPayload)('pull_request.head.repo.id');
  2559. prHeadRepoFullName = (0, ref_helper_1.fromPayload)('pull_request.head.repo.full_name');
  2560. pushIfSha(prShas, (0, ref_helper_1.fromPayload)('pull_request.head.sha'));
  2561. pushIfSha(prShas, (0, ref_helper_1.fromPayload)('pull_request.merge_commit_sha'));
  2562. }
  2563. else {
  2564. const wrEvent = (0, ref_helper_1.fromPayload)('workflow_run.event');
  2565. if (typeof wrEvent !== 'string' || !wrEvent.startsWith('pull_request')) {
  2566. return;
  2567. }
  2568. prHeadRepoId = (0, ref_helper_1.fromPayload)('workflow_run.head_repository.id');
  2569. prHeadRepoFullName = (0, ref_helper_1.fromPayload)('workflow_run.head_repository.full_name');
  2570. pushIfSha(prShas, (0, ref_helper_1.fromPayload)('workflow_run.head_commit.id'));
  2571. // For `pull_request_target`-triggered workflow_run, `head_sha` is the base
  2572. // default branch SHA (not the PR head)
  2573. if (wrEvent !== 'pull_request_target') {
  2574. pushIfSha(prShas, (0, ref_helper_1.fromPayload)('workflow_run.head_sha'));
  2575. }
  2576. }
  2577. // (A) Fork PR?
  2578. if (typeof prHeadRepoId !== 'number' || prHeadRepoId === baseRepoId) {
  2579. return;
  2580. }
  2581. // (B) We cannot check for all fork PR refs so check to see
  2582. // if the resolved input points to the fork PR sha we have in the payload
  2583. const repositoryMatchesPrHead = typeof prHeadRepoFullName === 'string' &&
  2584. input.qualifiedRepository.toLowerCase() === prHeadRepoFullName.toLowerCase();
  2585. const refMatchesPullPattern = PR_REF_PATTERN.test(input.ref);
  2586. const commitMatchesPrHeadSha = !!input.commit && prShas.includes(input.commit.toLowerCase());
  2587. if (!repositoryMatchesPrHead &&
  2588. !refMatchesPullPattern &&
  2589. !commitMatchesPrHeadSha) {
  2590. return;
  2591. }
  2592. throw new Error(`Refusing to check out fork pull request code from a '${eventName}' workflow. ` +
  2593. `This workflow runs with the base repository's GITHUB_TOKEN, secrets, default-branch ` +
  2594. `cache scope, and runner access. Fetching and executing a fork's code in that trusted ` +
  2595. `context commonly leads to "pwn request" vulnerabilities. To opt in, review the risks ` +
  2596. `at https://gh.io/securely-using-pull_request_target and set 'allow-unsafe-pr-checkout: true' ` +
  2597. `on the actions/checkout step.`);
  2598. }
  2599. function pushIfSha(target, value) {
  2600. if (typeof value === 'string' && value.length > 0) {
  2601. target.push(value.toLowerCase());
  2602. }
  2603. }
  2604. /***/ }),
  2605. /***/ 9437:
  2606. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  2607. "use strict";
  2608. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  2609. if (k2 === undefined) k2 = k;
  2610. var desc = Object.getOwnPropertyDescriptor(m, k);
  2611. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  2612. desc = { enumerable: true, get: function() { return m[k]; } };
  2613. }
  2614. Object.defineProperty(o, k2, desc);
  2615. }) : (function(o, m, k, k2) {
  2616. if (k2 === undefined) k2 = k;
  2617. o[k2] = m[k];
  2618. }));
  2619. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  2620. Object.defineProperty(o, "default", { enumerable: true, value: v });
  2621. }) : function(o, v) {
  2622. o["default"] = v;
  2623. });
  2624. var __importStar = (this && this.__importStar) || function (mod) {
  2625. if (mod && mod.__esModule) return mod;
  2626. var result = {};
  2627. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  2628. __setModuleDefault(result, mod);
  2629. return result;
  2630. };
  2631. Object.defineProperty(exports, "__esModule", ({ value: true }));
  2632. exports.getFetchUrl = getFetchUrl;
  2633. exports.getServerUrl = getServerUrl;
  2634. exports.getServerApiUrl = getServerApiUrl;
  2635. exports.isGhes = isGhes;
  2636. const assert = __importStar(__nccwpck_require__(9491));
  2637. const url_1 = __nccwpck_require__(7310);
  2638. function getFetchUrl(settings) {
  2639. assert.ok(settings.repositoryOwner, 'settings.repositoryOwner must be defined');
  2640. assert.ok(settings.repositoryName, 'settings.repositoryName must be defined');
  2641. const serviceUrl = getServerUrl(settings.githubServerUrl);
  2642. const encodedOwner = encodeURIComponent(settings.repositoryOwner);
  2643. const encodedName = encodeURIComponent(settings.repositoryName);
  2644. if (settings.sshKey) {
  2645. const user = settings.sshUser.length > 0 ? settings.sshUser : 'git';
  2646. return `${user}@${serviceUrl.hostname}:${encodedOwner}/${encodedName}.git`;
  2647. }
  2648. // "origin" is SCHEME://HOSTNAME[:PORT]
  2649. return `${serviceUrl.origin}/${encodedOwner}/${encodedName}`;
  2650. }
  2651. function getServerUrl(url) {
  2652. let resolvedUrl = process.env['GITHUB_SERVER_URL'] || 'https://github.com';
  2653. if (hasContent(url, WhitespaceMode.Trim)) {
  2654. resolvedUrl = url;
  2655. }
  2656. return new url_1.URL(resolvedUrl);
  2657. }
  2658. function getServerApiUrl(url) {
  2659. if (hasContent(url, WhitespaceMode.Trim)) {
  2660. let serverUrl = getServerUrl(url);
  2661. if (isGhes(url)) {
  2662. serverUrl.pathname = 'api/v3';
  2663. }
  2664. else {
  2665. serverUrl.hostname = 'api.' + serverUrl.hostname;
  2666. }
  2667. return pruneSuffix(serverUrl.toString(), '/');
  2668. }
  2669. return process.env['GITHUB_API_URL'] || 'https://api.github.com';
  2670. }
  2671. function isGhes(url) {
  2672. const ghUrl = new url_1.URL(url || process.env['GITHUB_SERVER_URL'] || 'https://github.com');
  2673. const hostname = ghUrl.hostname.trimEnd().toUpperCase();
  2674. const isGitHubHost = hostname === 'GITHUB.COM';
  2675. const isGitHubEnterpriseCloudHost = hostname.endsWith('.GHE.COM');
  2676. const isLocalHost = hostname.endsWith('.LOCALHOST');
  2677. return !isGitHubHost && !isGitHubEnterpriseCloudHost && !isLocalHost;
  2678. }
  2679. function pruneSuffix(text, suffix) {
  2680. if (hasContent(suffix, WhitespaceMode.Preserve) && (text === null || text === void 0 ? void 0 : text.endsWith(suffix))) {
  2681. return text.substring(0, text.length - suffix.length);
  2682. }
  2683. return text;
  2684. }
  2685. var WhitespaceMode;
  2686. (function (WhitespaceMode) {
  2687. WhitespaceMode[WhitespaceMode["Trim"] = 0] = "Trim";
  2688. WhitespaceMode[WhitespaceMode["Preserve"] = 1] = "Preserve";
  2689. })(WhitespaceMode || (WhitespaceMode = {}));
  2690. function hasContent(text, whitespaceMode) {
  2691. let refinedText = text !== null && text !== void 0 ? text : '';
  2692. if (whitespaceMode == WhitespaceMode.Trim) {
  2693. refinedText = refinedText.trim();
  2694. }
  2695. return refinedText.length > 0;
  2696. }
  2697. /***/ }),
  2698. /***/ 9568:
  2699. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  2700. "use strict";
  2701. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  2702. if (k2 === undefined) k2 = k;
  2703. var desc = Object.getOwnPropertyDescriptor(m, k);
  2704. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  2705. desc = { enumerable: true, get: function() { return m[k]; } };
  2706. }
  2707. Object.defineProperty(o, k2, desc);
  2708. }) : (function(o, m, k, k2) {
  2709. if (k2 === undefined) k2 = k;
  2710. o[k2] = m[k];
  2711. }));
  2712. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  2713. Object.defineProperty(o, "default", { enumerable: true, value: v });
  2714. }) : function(o, v) {
  2715. o["default"] = v;
  2716. });
  2717. var __importStar = (this && this.__importStar) || function (mod) {
  2718. if (mod && mod.__esModule) return mod;
  2719. var result = {};
  2720. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  2721. __setModuleDefault(result, mod);
  2722. return result;
  2723. };
  2724. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  2725. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  2726. return new (P || (P = Promise))(function (resolve, reject) {
  2727. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  2728. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  2729. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  2730. step((generator = generator.apply(thisArg, _arguments || [])).next());
  2731. });
  2732. };
  2733. Object.defineProperty(exports, "__esModule", ({ value: true }));
  2734. exports.getOrganizationId = getOrganizationId;
  2735. const core = __importStar(__nccwpck_require__(2186));
  2736. const fs = __importStar(__nccwpck_require__(7147));
  2737. /**
  2738. * Gets the organization ID of the running workflow or undefined if the value cannot be loaded from the GITHUB_EVENT_PATH
  2739. */
  2740. function getOrganizationId() {
  2741. return __awaiter(this, void 0, void 0, function* () {
  2742. var _a, _b;
  2743. try {
  2744. const eventPath = process.env.GITHUB_EVENT_PATH;
  2745. if (!eventPath) {
  2746. core.debug(`GITHUB_EVENT_PATH is not defined`);
  2747. return;
  2748. }
  2749. const content = yield fs.promises.readFile(eventPath, { encoding: 'utf8' });
  2750. const event = JSON.parse(content);
  2751. 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;
  2752. if (typeof id !== 'number') {
  2753. core.debug('Repository owner ID not found within GITHUB event info');
  2754. return;
  2755. }
  2756. return id;
  2757. }
  2758. catch (err) {
  2759. core.debug(`Unable to load organization ID from GITHUB_EVENT_PATH: ${err.message || err}`);
  2760. }
  2761. });
  2762. }
  2763. /***/ }),
  2764. /***/ 7351:
  2765. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  2766. "use strict";
  2767. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  2768. if (k2 === undefined) k2 = k;
  2769. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  2770. }) : (function(o, m, k, k2) {
  2771. if (k2 === undefined) k2 = k;
  2772. o[k2] = m[k];
  2773. }));
  2774. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  2775. Object.defineProperty(o, "default", { enumerable: true, value: v });
  2776. }) : function(o, v) {
  2777. o["default"] = v;
  2778. });
  2779. var __importStar = (this && this.__importStar) || function (mod) {
  2780. if (mod && mod.__esModule) return mod;
  2781. var result = {};
  2782. if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  2783. __setModuleDefault(result, mod);
  2784. return result;
  2785. };
  2786. Object.defineProperty(exports, "__esModule", ({ value: true }));
  2787. exports.issue = exports.issueCommand = void 0;
  2788. const os = __importStar(__nccwpck_require__(2037));
  2789. const utils_1 = __nccwpck_require__(5278);
  2790. /**
  2791. * Commands
  2792. *
  2793. * Command Format:
  2794. * ::name key=value,key=value::message
  2795. *
  2796. * Examples:
  2797. * ::warning::This is the message
  2798. * ::set-env name=MY_VAR::some value
  2799. */
  2800. function issueCommand(command, properties, message) {
  2801. const cmd = new Command(command, properties, message);
  2802. process.stdout.write(cmd.toString() + os.EOL);
  2803. }
  2804. exports.issueCommand = issueCommand;
  2805. function issue(name, message = '') {
  2806. issueCommand(name, {}, message);
  2807. }
  2808. exports.issue = issue;
  2809. const CMD_STRING = '::';
  2810. class Command {
  2811. constructor(command, properties, message) {
  2812. if (!command) {
  2813. command = 'missing.command';
  2814. }
  2815. this.command = command;
  2816. this.properties = properties;
  2817. this.message = message;
  2818. }
  2819. toString() {
  2820. let cmdStr = CMD_STRING + this.command;
  2821. if (this.properties && Object.keys(this.properties).length > 0) {
  2822. cmdStr += ' ';
  2823. let first = true;
  2824. for (const key in this.properties) {
  2825. if (this.properties.hasOwnProperty(key)) {
  2826. const val = this.properties[key];
  2827. if (val) {
  2828. if (first) {
  2829. first = false;
  2830. }
  2831. else {
  2832. cmdStr += ',';
  2833. }
  2834. cmdStr += `${key}=${escapeProperty(val)}`;
  2835. }
  2836. }
  2837. }
  2838. }
  2839. cmdStr += `${CMD_STRING}${escapeData(this.message)}`;
  2840. return cmdStr;
  2841. }
  2842. }
  2843. function escapeData(s) {
  2844. return utils_1.toCommandValue(s)
  2845. .replace(/%/g, '%25')
  2846. .replace(/\r/g, '%0D')
  2847. .replace(/\n/g, '%0A');
  2848. }
  2849. function escapeProperty(s) {
  2850. return utils_1.toCommandValue(s)
  2851. .replace(/%/g, '%25')
  2852. .replace(/\r/g, '%0D')
  2853. .replace(/\n/g, '%0A')
  2854. .replace(/:/g, '%3A')
  2855. .replace(/,/g, '%2C');
  2856. }
  2857. //# sourceMappingURL=command.js.map
  2858. /***/ }),
  2859. /***/ 2186:
  2860. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  2861. "use strict";
  2862. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  2863. if (k2 === undefined) k2 = k;
  2864. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  2865. }) : (function(o, m, k, k2) {
  2866. if (k2 === undefined) k2 = k;
  2867. o[k2] = m[k];
  2868. }));
  2869. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  2870. Object.defineProperty(o, "default", { enumerable: true, value: v });
  2871. }) : function(o, v) {
  2872. o["default"] = v;
  2873. });
  2874. var __importStar = (this && this.__importStar) || function (mod) {
  2875. if (mod && mod.__esModule) return mod;
  2876. var result = {};
  2877. if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  2878. __setModuleDefault(result, mod);
  2879. return result;
  2880. };
  2881. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  2882. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  2883. return new (P || (P = Promise))(function (resolve, reject) {
  2884. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  2885. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  2886. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  2887. step((generator = generator.apply(thisArg, _arguments || [])).next());
  2888. });
  2889. };
  2890. Object.defineProperty(exports, "__esModule", ({ value: true }));
  2891. 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;
  2892. const command_1 = __nccwpck_require__(7351);
  2893. const file_command_1 = __nccwpck_require__(717);
  2894. const utils_1 = __nccwpck_require__(5278);
  2895. const os = __importStar(__nccwpck_require__(2037));
  2896. const path = __importStar(__nccwpck_require__(1017));
  2897. const oidc_utils_1 = __nccwpck_require__(8041);
  2898. /**
  2899. * The code to exit an action
  2900. */
  2901. var ExitCode;
  2902. (function (ExitCode) {
  2903. /**
  2904. * A code indicating that the action was successful
  2905. */
  2906. ExitCode[ExitCode["Success"] = 0] = "Success";
  2907. /**
  2908. * A code indicating that the action was a failure
  2909. */
  2910. ExitCode[ExitCode["Failure"] = 1] = "Failure";
  2911. })(ExitCode = exports.ExitCode || (exports.ExitCode = {}));
  2912. //-----------------------------------------------------------------------
  2913. // Variables
  2914. //-----------------------------------------------------------------------
  2915. /**
  2916. * Sets env variable for this action and future actions in the job
  2917. * @param name the name of the variable to set
  2918. * @param val the value of the variable. Non-string values will be converted to a string via JSON.stringify
  2919. */
  2920. // eslint-disable-next-line @typescript-eslint/no-explicit-any
  2921. function exportVariable(name, val) {
  2922. const convertedVal = utils_1.toCommandValue(val);
  2923. process.env[name] = convertedVal;
  2924. const filePath = process.env['GITHUB_ENV'] || '';
  2925. if (filePath) {
  2926. return file_command_1.issueFileCommand('ENV', file_command_1.prepareKeyValueMessage(name, val));
  2927. }
  2928. command_1.issueCommand('set-env', { name }, convertedVal);
  2929. }
  2930. exports.exportVariable = exportVariable;
  2931. /**
  2932. * Registers a secret which will get masked from logs
  2933. * @param secret value of the secret
  2934. */
  2935. function setSecret(secret) {
  2936. command_1.issueCommand('add-mask', {}, secret);
  2937. }
  2938. exports.setSecret = setSecret;
  2939. /**
  2940. * Prepends inputPath to the PATH (for this action and future actions)
  2941. * @param inputPath
  2942. */
  2943. function addPath(inputPath) {
  2944. const filePath = process.env['GITHUB_PATH'] || '';
  2945. if (filePath) {
  2946. file_command_1.issueFileCommand('PATH', inputPath);
  2947. }
  2948. else {
  2949. command_1.issueCommand('add-path', {}, inputPath);
  2950. }
  2951. process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`;
  2952. }
  2953. exports.addPath = addPath;
  2954. /**
  2955. * Gets the value of an input.
  2956. * Unless trimWhitespace is set to false in InputOptions, the value is also trimmed.
  2957. * Returns an empty string if the value is not defined.
  2958. *
  2959. * @param name name of the input to get
  2960. * @param options optional. See InputOptions.
  2961. * @returns string
  2962. */
  2963. function getInput(name, options) {
  2964. const val = process.env[`INPUT_${name.replace(/ /g, '_').toUpperCase()}`] || '';
  2965. if (options && options.required && !val) {
  2966. throw new Error(`Input required and not supplied: ${name}`);
  2967. }
  2968. if (options && options.trimWhitespace === false) {
  2969. return val;
  2970. }
  2971. return val.trim();
  2972. }
  2973. exports.getInput = getInput;
  2974. /**
  2975. * Gets the values of an multiline input. Each value is also trimmed.
  2976. *
  2977. * @param name name of the input to get
  2978. * @param options optional. See InputOptions.
  2979. * @returns string[]
  2980. *
  2981. */
  2982. function getMultilineInput(name, options) {
  2983. const inputs = getInput(name, options)
  2984. .split('\n')
  2985. .filter(x => x !== '');
  2986. if (options && options.trimWhitespace === false) {
  2987. return inputs;
  2988. }
  2989. return inputs.map(input => input.trim());
  2990. }
  2991. exports.getMultilineInput = getMultilineInput;
  2992. /**
  2993. * Gets the input value of the boolean type in the YAML 1.2 "core schema" specification.
  2994. * Support boolean input list: `true | True | TRUE | false | False | FALSE` .
  2995. * The return value is also in boolean type.
  2996. * ref: https://yaml.org/spec/1.2/spec.html#id2804923
  2997. *
  2998. * @param name name of the input to get
  2999. * @param options optional. See InputOptions.
  3000. * @returns boolean
  3001. */
  3002. function getBooleanInput(name, options) {
  3003. const trueValue = ['true', 'True', 'TRUE'];
  3004. const falseValue = ['false', 'False', 'FALSE'];
  3005. const val = getInput(name, options);
  3006. if (trueValue.includes(val))
  3007. return true;
  3008. if (falseValue.includes(val))
  3009. return false;
  3010. throw new TypeError(`Input does not meet YAML 1.2 "Core Schema" specification: ${name}\n` +
  3011. `Support boolean input list: \`true | True | TRUE | false | False | FALSE\``);
  3012. }
  3013. exports.getBooleanInput = getBooleanInput;
  3014. /**
  3015. * Sets the value of an output.
  3016. *
  3017. * @param name name of the output to set
  3018. * @param value value to store. Non-string values will be converted to a string via JSON.stringify
  3019. */
  3020. // eslint-disable-next-line @typescript-eslint/no-explicit-any
  3021. function setOutput(name, value) {
  3022. const filePath = process.env['GITHUB_OUTPUT'] || '';
  3023. if (filePath) {
  3024. return file_command_1.issueFileCommand('OUTPUT', file_command_1.prepareKeyValueMessage(name, value));
  3025. }
  3026. process.stdout.write(os.EOL);
  3027. command_1.issueCommand('set-output', { name }, utils_1.toCommandValue(value));
  3028. }
  3029. exports.setOutput = setOutput;
  3030. /**
  3031. * Enables or disables the echoing of commands into stdout for the rest of the step.
  3032. * Echoing is disabled by default if ACTIONS_STEP_DEBUG is not set.
  3033. *
  3034. */
  3035. function setCommandEcho(enabled) {
  3036. command_1.issue('echo', enabled ? 'on' : 'off');
  3037. }
  3038. exports.setCommandEcho = setCommandEcho;
  3039. //-----------------------------------------------------------------------
  3040. // Results
  3041. //-----------------------------------------------------------------------
  3042. /**
  3043. * Sets the action status to failed.
  3044. * When the action exits it will be with an exit code of 1
  3045. * @param message add error issue message
  3046. */
  3047. function setFailed(message) {
  3048. process.exitCode = ExitCode.Failure;
  3049. error(message);
  3050. }
  3051. exports.setFailed = setFailed;
  3052. //-----------------------------------------------------------------------
  3053. // Logging Commands
  3054. //-----------------------------------------------------------------------
  3055. /**
  3056. * Gets whether Actions Step Debug is on or not
  3057. */
  3058. function isDebug() {
  3059. return process.env['RUNNER_DEBUG'] === '1';
  3060. }
  3061. exports.isDebug = isDebug;
  3062. /**
  3063. * Writes debug message to user log
  3064. * @param message debug message
  3065. */
  3066. function debug(message) {
  3067. command_1.issueCommand('debug', {}, message);
  3068. }
  3069. exports.debug = debug;
  3070. /**
  3071. * Adds an error issue
  3072. * @param message error issue message. Errors will be converted to string via toString()
  3073. * @param properties optional properties to add to the annotation.
  3074. */
  3075. function error(message, properties = {}) {
  3076. command_1.issueCommand('error', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message);
  3077. }
  3078. exports.error = error;
  3079. /**
  3080. * Adds a warning issue
  3081. * @param message warning issue message. Errors will be converted to string via toString()
  3082. * @param properties optional properties to add to the annotation.
  3083. */
  3084. function warning(message, properties = {}) {
  3085. command_1.issueCommand('warning', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message);
  3086. }
  3087. exports.warning = warning;
  3088. /**
  3089. * Adds a notice issue
  3090. * @param message notice issue message. Errors will be converted to string via toString()
  3091. * @param properties optional properties to add to the annotation.
  3092. */
  3093. function notice(message, properties = {}) {
  3094. command_1.issueCommand('notice', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message);
  3095. }
  3096. exports.notice = notice;
  3097. /**
  3098. * Writes info to log with console.log.
  3099. * @param message info message
  3100. */
  3101. function info(message) {
  3102. process.stdout.write(message + os.EOL);
  3103. }
  3104. exports.info = info;
  3105. /**
  3106. * Begin an output group.
  3107. *
  3108. * Output until the next `groupEnd` will be foldable in this group
  3109. *
  3110. * @param name The name of the output group
  3111. */
  3112. function startGroup(name) {
  3113. command_1.issue('group', name);
  3114. }
  3115. exports.startGroup = startGroup;
  3116. /**
  3117. * End an output group.
  3118. */
  3119. function endGroup() {
  3120. command_1.issue('endgroup');
  3121. }
  3122. exports.endGroup = endGroup;
  3123. /**
  3124. * Wrap an asynchronous function call in a group.
  3125. *
  3126. * Returns the same type as the function itself.
  3127. *
  3128. * @param name The name of the group
  3129. * @param fn The function to wrap in the group
  3130. */
  3131. function group(name, fn) {
  3132. return __awaiter(this, void 0, void 0, function* () {
  3133. startGroup(name);
  3134. let result;
  3135. try {
  3136. result = yield fn();
  3137. }
  3138. finally {
  3139. endGroup();
  3140. }
  3141. return result;
  3142. });
  3143. }
  3144. exports.group = group;
  3145. //-----------------------------------------------------------------------
  3146. // Wrapper action state
  3147. //-----------------------------------------------------------------------
  3148. /**
  3149. * Saves state for current action, the state can only be retrieved by this action's post job execution.
  3150. *
  3151. * @param name name of the state to store
  3152. * @param value value to store. Non-string values will be converted to a string via JSON.stringify
  3153. */
  3154. // eslint-disable-next-line @typescript-eslint/no-explicit-any
  3155. function saveState(name, value) {
  3156. const filePath = process.env['GITHUB_STATE'] || '';
  3157. if (filePath) {
  3158. return file_command_1.issueFileCommand('STATE', file_command_1.prepareKeyValueMessage(name, value));
  3159. }
  3160. command_1.issueCommand('save-state', { name }, utils_1.toCommandValue(value));
  3161. }
  3162. exports.saveState = saveState;
  3163. /**
  3164. * Gets the value of an state set by this action's main execution.
  3165. *
  3166. * @param name name of the state to get
  3167. * @returns string
  3168. */
  3169. function getState(name) {
  3170. return process.env[`STATE_${name}`] || '';
  3171. }
  3172. exports.getState = getState;
  3173. function getIDToken(aud) {
  3174. return __awaiter(this, void 0, void 0, function* () {
  3175. return yield oidc_utils_1.OidcClient.getIDToken(aud);
  3176. });
  3177. }
  3178. exports.getIDToken = getIDToken;
  3179. /**
  3180. * Summary exports
  3181. */
  3182. var summary_1 = __nccwpck_require__(1327);
  3183. Object.defineProperty(exports, "summary", ({ enumerable: true, get: function () { return summary_1.summary; } }));
  3184. /**
  3185. * @deprecated use core.summary
  3186. */
  3187. var summary_2 = __nccwpck_require__(1327);
  3188. Object.defineProperty(exports, "markdownSummary", ({ enumerable: true, get: function () { return summary_2.markdownSummary; } }));
  3189. /**
  3190. * Path exports
  3191. */
  3192. var path_utils_1 = __nccwpck_require__(2981);
  3193. Object.defineProperty(exports, "toPosixPath", ({ enumerable: true, get: function () { return path_utils_1.toPosixPath; } }));
  3194. Object.defineProperty(exports, "toWin32Path", ({ enumerable: true, get: function () { return path_utils_1.toWin32Path; } }));
  3195. Object.defineProperty(exports, "toPlatformPath", ({ enumerable: true, get: function () { return path_utils_1.toPlatformPath; } }));
  3196. //# sourceMappingURL=core.js.map
  3197. /***/ }),
  3198. /***/ 717:
  3199. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  3200. "use strict";
  3201. // For internal use, subject to change.
  3202. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  3203. if (k2 === undefined) k2 = k;
  3204. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  3205. }) : (function(o, m, k, k2) {
  3206. if (k2 === undefined) k2 = k;
  3207. o[k2] = m[k];
  3208. }));
  3209. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  3210. Object.defineProperty(o, "default", { enumerable: true, value: v });
  3211. }) : function(o, v) {
  3212. o["default"] = v;
  3213. });
  3214. var __importStar = (this && this.__importStar) || function (mod) {
  3215. if (mod && mod.__esModule) return mod;
  3216. var result = {};
  3217. if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  3218. __setModuleDefault(result, mod);
  3219. return result;
  3220. };
  3221. Object.defineProperty(exports, "__esModule", ({ value: true }));
  3222. exports.prepareKeyValueMessage = exports.issueFileCommand = void 0;
  3223. // We use any as a valid input type
  3224. /* eslint-disable @typescript-eslint/no-explicit-any */
  3225. const fs = __importStar(__nccwpck_require__(7147));
  3226. const os = __importStar(__nccwpck_require__(2037));
  3227. const uuid_1 = __nccwpck_require__(8974);
  3228. const utils_1 = __nccwpck_require__(5278);
  3229. function issueFileCommand(command, message) {
  3230. const filePath = process.env[`GITHUB_${command}`];
  3231. if (!filePath) {
  3232. throw new Error(`Unable to find environment variable for file command ${command}`);
  3233. }
  3234. if (!fs.existsSync(filePath)) {
  3235. throw new Error(`Missing file at path: ${filePath}`);
  3236. }
  3237. fs.appendFileSync(filePath, `${utils_1.toCommandValue(message)}${os.EOL}`, {
  3238. encoding: 'utf8'
  3239. });
  3240. }
  3241. exports.issueFileCommand = issueFileCommand;
  3242. function prepareKeyValueMessage(key, value) {
  3243. const delimiter = `ghadelimiter_${uuid_1.v4()}`;
  3244. const convertedValue = utils_1.toCommandValue(value);
  3245. // These should realistically never happen, but just in case someone finds a
  3246. // way to exploit uuid generation let's not allow keys or values that contain
  3247. // the delimiter.
  3248. if (key.includes(delimiter)) {
  3249. throw new Error(`Unexpected input: name should not contain the delimiter "${delimiter}"`);
  3250. }
  3251. if (convertedValue.includes(delimiter)) {
  3252. throw new Error(`Unexpected input: value should not contain the delimiter "${delimiter}"`);
  3253. }
  3254. return `${key}<<${delimiter}${os.EOL}${convertedValue}${os.EOL}${delimiter}`;
  3255. }
  3256. exports.prepareKeyValueMessage = prepareKeyValueMessage;
  3257. //# sourceMappingURL=file-command.js.map
  3258. /***/ }),
  3259. /***/ 8041:
  3260. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  3261. "use strict";
  3262. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  3263. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  3264. return new (P || (P = Promise))(function (resolve, reject) {
  3265. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  3266. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  3267. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  3268. step((generator = generator.apply(thisArg, _arguments || [])).next());
  3269. });
  3270. };
  3271. Object.defineProperty(exports, "__esModule", ({ value: true }));
  3272. exports.OidcClient = void 0;
  3273. const http_client_1 = __nccwpck_require__(6255);
  3274. const auth_1 = __nccwpck_require__(5526);
  3275. const core_1 = __nccwpck_require__(2186);
  3276. class OidcClient {
  3277. static createHttpClient(allowRetry = true, maxRetry = 10) {
  3278. const requestOptions = {
  3279. allowRetries: allowRetry,
  3280. maxRetries: maxRetry
  3281. };
  3282. return new http_client_1.HttpClient('actions/oidc-client', [new auth_1.BearerCredentialHandler(OidcClient.getRequestToken())], requestOptions);
  3283. }
  3284. static getRequestToken() {
  3285. const token = process.env['ACTIONS_ID_TOKEN_REQUEST_TOKEN'];
  3286. if (!token) {
  3287. throw new Error('Unable to get ACTIONS_ID_TOKEN_REQUEST_TOKEN env variable');
  3288. }
  3289. return token;
  3290. }
  3291. static getIDTokenUrl() {
  3292. const runtimeUrl = process.env['ACTIONS_ID_TOKEN_REQUEST_URL'];
  3293. if (!runtimeUrl) {
  3294. throw new Error('Unable to get ACTIONS_ID_TOKEN_REQUEST_URL env variable');
  3295. }
  3296. return runtimeUrl;
  3297. }
  3298. static getCall(id_token_url) {
  3299. var _a;
  3300. return __awaiter(this, void 0, void 0, function* () {
  3301. const httpclient = OidcClient.createHttpClient();
  3302. const res = yield httpclient
  3303. .getJson(id_token_url)
  3304. .catch(error => {
  3305. throw new Error(`Failed to get ID Token. \n
  3306. Error Code : ${error.statusCode}\n
  3307. Error Message: ${error.message}`);
  3308. });
  3309. const id_token = (_a = res.result) === null || _a === void 0 ? void 0 : _a.value;
  3310. if (!id_token) {
  3311. throw new Error('Response json body do not have ID Token field');
  3312. }
  3313. return id_token;
  3314. });
  3315. }
  3316. static getIDToken(audience) {
  3317. return __awaiter(this, void 0, void 0, function* () {
  3318. try {
  3319. // New ID Token is requested from action service
  3320. let id_token_url = OidcClient.getIDTokenUrl();
  3321. if (audience) {
  3322. const encodedAudience = encodeURIComponent(audience);
  3323. id_token_url = `${id_token_url}&audience=${encodedAudience}`;
  3324. }
  3325. core_1.debug(`ID token url is ${id_token_url}`);
  3326. const id_token = yield OidcClient.getCall(id_token_url);
  3327. core_1.setSecret(id_token);
  3328. return id_token;
  3329. }
  3330. catch (error) {
  3331. throw new Error(`Error message: ${error.message}`);
  3332. }
  3333. });
  3334. }
  3335. }
  3336. exports.OidcClient = OidcClient;
  3337. //# sourceMappingURL=oidc-utils.js.map
  3338. /***/ }),
  3339. /***/ 2981:
  3340. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  3341. "use strict";
  3342. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  3343. if (k2 === undefined) k2 = k;
  3344. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  3345. }) : (function(o, m, k, k2) {
  3346. if (k2 === undefined) k2 = k;
  3347. o[k2] = m[k];
  3348. }));
  3349. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  3350. Object.defineProperty(o, "default", { enumerable: true, value: v });
  3351. }) : function(o, v) {
  3352. o["default"] = v;
  3353. });
  3354. var __importStar = (this && this.__importStar) || function (mod) {
  3355. if (mod && mod.__esModule) return mod;
  3356. var result = {};
  3357. if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  3358. __setModuleDefault(result, mod);
  3359. return result;
  3360. };
  3361. Object.defineProperty(exports, "__esModule", ({ value: true }));
  3362. exports.toPlatformPath = exports.toWin32Path = exports.toPosixPath = void 0;
  3363. const path = __importStar(__nccwpck_require__(1017));
  3364. /**
  3365. * toPosixPath converts the given path to the posix form. On Windows, \\ will be
  3366. * replaced with /.
  3367. *
  3368. * @param pth. Path to transform.
  3369. * @return string Posix path.
  3370. */
  3371. function toPosixPath(pth) {
  3372. return pth.replace(/[\\]/g, '/');
  3373. }
  3374. exports.toPosixPath = toPosixPath;
  3375. /**
  3376. * toWin32Path converts the given path to the win32 form. On Linux, / will be
  3377. * replaced with \\.
  3378. *
  3379. * @param pth. Path to transform.
  3380. * @return string Win32 path.
  3381. */
  3382. function toWin32Path(pth) {
  3383. return pth.replace(/[/]/g, '\\');
  3384. }
  3385. exports.toWin32Path = toWin32Path;
  3386. /**
  3387. * toPlatformPath converts the given path to a platform-specific path. It does
  3388. * this by replacing instances of / and \ with the platform-specific path
  3389. * separator.
  3390. *
  3391. * @param pth The path to platformize.
  3392. * @return string The platform-specific path.
  3393. */
  3394. function toPlatformPath(pth) {
  3395. return pth.replace(/[/\\]/g, path.sep);
  3396. }
  3397. exports.toPlatformPath = toPlatformPath;
  3398. //# sourceMappingURL=path-utils.js.map
  3399. /***/ }),
  3400. /***/ 1327:
  3401. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  3402. "use strict";
  3403. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  3404. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  3405. return new (P || (P = Promise))(function (resolve, reject) {
  3406. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  3407. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  3408. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  3409. step((generator = generator.apply(thisArg, _arguments || [])).next());
  3410. });
  3411. };
  3412. Object.defineProperty(exports, "__esModule", ({ value: true }));
  3413. exports.summary = exports.markdownSummary = exports.SUMMARY_DOCS_URL = exports.SUMMARY_ENV_VAR = void 0;
  3414. const os_1 = __nccwpck_require__(2037);
  3415. const fs_1 = __nccwpck_require__(7147);
  3416. const { access, appendFile, writeFile } = fs_1.promises;
  3417. exports.SUMMARY_ENV_VAR = 'GITHUB_STEP_SUMMARY';
  3418. exports.SUMMARY_DOCS_URL = 'https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#adding-a-job-summary';
  3419. class Summary {
  3420. constructor() {
  3421. this._buffer = '';
  3422. }
  3423. /**
  3424. * Finds the summary file path from the environment, rejects if env var is not found or file does not exist
  3425. * Also checks r/w permissions.
  3426. *
  3427. * @returns step summary file path
  3428. */
  3429. filePath() {
  3430. return __awaiter(this, void 0, void 0, function* () {
  3431. if (this._filePath) {
  3432. return this._filePath;
  3433. }
  3434. const pathFromEnv = process.env[exports.SUMMARY_ENV_VAR];
  3435. if (!pathFromEnv) {
  3436. throw new Error(`Unable to find environment variable for $${exports.SUMMARY_ENV_VAR}. Check if your runtime environment supports job summaries.`);
  3437. }
  3438. try {
  3439. yield access(pathFromEnv, fs_1.constants.R_OK | fs_1.constants.W_OK);
  3440. }
  3441. catch (_a) {
  3442. throw new Error(`Unable to access summary file: '${pathFromEnv}'. Check if the file has correct read/write permissions.`);
  3443. }
  3444. this._filePath = pathFromEnv;
  3445. return this._filePath;
  3446. });
  3447. }
  3448. /**
  3449. * Wraps content in an HTML tag, adding any HTML attributes
  3450. *
  3451. * @param {string} tag HTML tag to wrap
  3452. * @param {string | null} content content within the tag
  3453. * @param {[attribute: string]: string} attrs key-value list of HTML attributes to add
  3454. *
  3455. * @returns {string} content wrapped in HTML element
  3456. */
  3457. wrap(tag, content, attrs = {}) {
  3458. const htmlAttrs = Object.entries(attrs)
  3459. .map(([key, value]) => ` ${key}="${value}"`)
  3460. .join('');
  3461. if (!content) {
  3462. return `<${tag}${htmlAttrs}>`;
  3463. }
  3464. return `<${tag}${htmlAttrs}>${content}</${tag}>`;
  3465. }
  3466. /**
  3467. * Writes text in the buffer to the summary buffer file and empties buffer. Will append by default.
  3468. *
  3469. * @param {SummaryWriteOptions} [options] (optional) options for write operation
  3470. *
  3471. * @returns {Promise<Summary>} summary instance
  3472. */
  3473. write(options) {
  3474. return __awaiter(this, void 0, void 0, function* () {
  3475. const overwrite = !!(options === null || options === void 0 ? void 0 : options.overwrite);
  3476. const filePath = yield this.filePath();
  3477. const writeFunc = overwrite ? writeFile : appendFile;
  3478. yield writeFunc(filePath, this._buffer, { encoding: 'utf8' });
  3479. return this.emptyBuffer();
  3480. });
  3481. }
  3482. /**
  3483. * Clears the summary buffer and wipes the summary file
  3484. *
  3485. * @returns {Summary} summary instance
  3486. */
  3487. clear() {
  3488. return __awaiter(this, void 0, void 0, function* () {
  3489. return this.emptyBuffer().write({ overwrite: true });
  3490. });
  3491. }
  3492. /**
  3493. * Returns the current summary buffer as a string
  3494. *
  3495. * @returns {string} string of summary buffer
  3496. */
  3497. stringify() {
  3498. return this._buffer;
  3499. }
  3500. /**
  3501. * If the summary buffer is empty
  3502. *
  3503. * @returns {boolen} true if the buffer is empty
  3504. */
  3505. isEmptyBuffer() {
  3506. return this._buffer.length === 0;
  3507. }
  3508. /**
  3509. * Resets the summary buffer without writing to summary file
  3510. *
  3511. * @returns {Summary} summary instance
  3512. */
  3513. emptyBuffer() {
  3514. this._buffer = '';
  3515. return this;
  3516. }
  3517. /**
  3518. * Adds raw text to the summary buffer
  3519. *
  3520. * @param {string} text content to add
  3521. * @param {boolean} [addEOL=false] (optional) append an EOL to the raw text (default: false)
  3522. *
  3523. * @returns {Summary} summary instance
  3524. */
  3525. addRaw(text, addEOL = false) {
  3526. this._buffer += text;
  3527. return addEOL ? this.addEOL() : this;
  3528. }
  3529. /**
  3530. * Adds the operating system-specific end-of-line marker to the buffer
  3531. *
  3532. * @returns {Summary} summary instance
  3533. */
  3534. addEOL() {
  3535. return this.addRaw(os_1.EOL);
  3536. }
  3537. /**
  3538. * Adds an HTML codeblock to the summary buffer
  3539. *
  3540. * @param {string} code content to render within fenced code block
  3541. * @param {string} lang (optional) language to syntax highlight code
  3542. *
  3543. * @returns {Summary} summary instance
  3544. */
  3545. addCodeBlock(code, lang) {
  3546. const attrs = Object.assign({}, (lang && { lang }));
  3547. const element = this.wrap('pre', this.wrap('code', code), attrs);
  3548. return this.addRaw(element).addEOL();
  3549. }
  3550. /**
  3551. * Adds an HTML list to the summary buffer
  3552. *
  3553. * @param {string[]} items list of items to render
  3554. * @param {boolean} [ordered=false] (optional) if the rendered list should be ordered or not (default: false)
  3555. *
  3556. * @returns {Summary} summary instance
  3557. */
  3558. addList(items, ordered = false) {
  3559. const tag = ordered ? 'ol' : 'ul';
  3560. const listItems = items.map(item => this.wrap('li', item)).join('');
  3561. const element = this.wrap(tag, listItems);
  3562. return this.addRaw(element).addEOL();
  3563. }
  3564. /**
  3565. * Adds an HTML table to the summary buffer
  3566. *
  3567. * @param {SummaryTableCell[]} rows table rows
  3568. *
  3569. * @returns {Summary} summary instance
  3570. */
  3571. addTable(rows) {
  3572. const tableBody = rows
  3573. .map(row => {
  3574. const cells = row
  3575. .map(cell => {
  3576. if (typeof cell === 'string') {
  3577. return this.wrap('td', cell);
  3578. }
  3579. const { header, data, colspan, rowspan } = cell;
  3580. const tag = header ? 'th' : 'td';
  3581. const attrs = Object.assign(Object.assign({}, (colspan && { colspan })), (rowspan && { rowspan }));
  3582. return this.wrap(tag, data, attrs);
  3583. })
  3584. .join('');
  3585. return this.wrap('tr', cells);
  3586. })
  3587. .join('');
  3588. const element = this.wrap('table', tableBody);
  3589. return this.addRaw(element).addEOL();
  3590. }
  3591. /**
  3592. * Adds a collapsable HTML details element to the summary buffer
  3593. *
  3594. * @param {string} label text for the closed state
  3595. * @param {string} content collapsable content
  3596. *
  3597. * @returns {Summary} summary instance
  3598. */
  3599. addDetails(label, content) {
  3600. const element = this.wrap('details', this.wrap('summary', label) + content);
  3601. return this.addRaw(element).addEOL();
  3602. }
  3603. /**
  3604. * Adds an HTML image tag to the summary buffer
  3605. *
  3606. * @param {string} src path to the image you to embed
  3607. * @param {string} alt text description of the image
  3608. * @param {SummaryImageOptions} options (optional) addition image attributes
  3609. *
  3610. * @returns {Summary} summary instance
  3611. */
  3612. addImage(src, alt, options) {
  3613. const { width, height } = options || {};
  3614. const attrs = Object.assign(Object.assign({}, (width && { width })), (height && { height }));
  3615. const element = this.wrap('img', null, Object.assign({ src, alt }, attrs));
  3616. return this.addRaw(element).addEOL();
  3617. }
  3618. /**
  3619. * Adds an HTML section heading element
  3620. *
  3621. * @param {string} text heading text
  3622. * @param {number | string} [level=1] (optional) the heading level, default: 1
  3623. *
  3624. * @returns {Summary} summary instance
  3625. */
  3626. addHeading(text, level) {
  3627. const tag = `h${level}`;
  3628. const allowedTag = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'].includes(tag)
  3629. ? tag
  3630. : 'h1';
  3631. const element = this.wrap(allowedTag, text);
  3632. return this.addRaw(element).addEOL();
  3633. }
  3634. /**
  3635. * Adds an HTML thematic break (<hr>) to the summary buffer
  3636. *
  3637. * @returns {Summary} summary instance
  3638. */
  3639. addSeparator() {
  3640. const element = this.wrap('hr', null);
  3641. return this.addRaw(element).addEOL();
  3642. }
  3643. /**
  3644. * Adds an HTML line break (<br>) to the summary buffer
  3645. *
  3646. * @returns {Summary} summary instance
  3647. */
  3648. addBreak() {
  3649. const element = this.wrap('br', null);
  3650. return this.addRaw(element).addEOL();
  3651. }
  3652. /**
  3653. * Adds an HTML blockquote to the summary buffer
  3654. *
  3655. * @param {string} text quote text
  3656. * @param {string} cite (optional) citation url
  3657. *
  3658. * @returns {Summary} summary instance
  3659. */
  3660. addQuote(text, cite) {
  3661. const attrs = Object.assign({}, (cite && { cite }));
  3662. const element = this.wrap('blockquote', text, attrs);
  3663. return this.addRaw(element).addEOL();
  3664. }
  3665. /**
  3666. * Adds an HTML anchor tag to the summary buffer
  3667. *
  3668. * @param {string} text link text/content
  3669. * @param {string} href hyperlink
  3670. *
  3671. * @returns {Summary} summary instance
  3672. */
  3673. addLink(text, href) {
  3674. const element = this.wrap('a', text, { href });
  3675. return this.addRaw(element).addEOL();
  3676. }
  3677. }
  3678. const _summary = new Summary();
  3679. /**
  3680. * @deprecated use `core.summary`
  3681. */
  3682. exports.markdownSummary = _summary;
  3683. exports.summary = _summary;
  3684. //# sourceMappingURL=summary.js.map
  3685. /***/ }),
  3686. /***/ 5278:
  3687. /***/ ((__unused_webpack_module, exports) => {
  3688. "use strict";
  3689. // We use any as a valid input type
  3690. /* eslint-disable @typescript-eslint/no-explicit-any */
  3691. Object.defineProperty(exports, "__esModule", ({ value: true }));
  3692. exports.toCommandProperties = exports.toCommandValue = void 0;
  3693. /**
  3694. * Sanitizes an input into a string so it can be passed into issueCommand safely
  3695. * @param input input to sanitize into a string
  3696. */
  3697. function toCommandValue(input) {
  3698. if (input === null || input === undefined) {
  3699. return '';
  3700. }
  3701. else if (typeof input === 'string' || input instanceof String) {
  3702. return input;
  3703. }
  3704. return JSON.stringify(input);
  3705. }
  3706. exports.toCommandValue = toCommandValue;
  3707. /**
  3708. *
  3709. * @param annotationProperties
  3710. * @returns The command properties to send with the actual annotation command
  3711. * See IssueCommandProperties: https://github.com/actions/runner/blob/main/src/Runner.Worker/ActionCommandManager.cs#L646
  3712. */
  3713. function toCommandProperties(annotationProperties) {
  3714. if (!Object.keys(annotationProperties).length) {
  3715. return {};
  3716. }
  3717. return {
  3718. title: annotationProperties.title,
  3719. file: annotationProperties.file,
  3720. line: annotationProperties.startLine,
  3721. endLine: annotationProperties.endLine,
  3722. col: annotationProperties.startColumn,
  3723. endColumn: annotationProperties.endColumn
  3724. };
  3725. }
  3726. exports.toCommandProperties = toCommandProperties;
  3727. //# sourceMappingURL=utils.js.map
  3728. /***/ }),
  3729. /***/ 8974:
  3730. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  3731. "use strict";
  3732. Object.defineProperty(exports, "__esModule", ({
  3733. value: true
  3734. }));
  3735. Object.defineProperty(exports, "v1", ({
  3736. enumerable: true,
  3737. get: function () {
  3738. return _v.default;
  3739. }
  3740. }));
  3741. Object.defineProperty(exports, "v3", ({
  3742. enumerable: true,
  3743. get: function () {
  3744. return _v2.default;
  3745. }
  3746. }));
  3747. Object.defineProperty(exports, "v4", ({
  3748. enumerable: true,
  3749. get: function () {
  3750. return _v3.default;
  3751. }
  3752. }));
  3753. Object.defineProperty(exports, "v5", ({
  3754. enumerable: true,
  3755. get: function () {
  3756. return _v4.default;
  3757. }
  3758. }));
  3759. Object.defineProperty(exports, "NIL", ({
  3760. enumerable: true,
  3761. get: function () {
  3762. return _nil.default;
  3763. }
  3764. }));
  3765. Object.defineProperty(exports, "version", ({
  3766. enumerable: true,
  3767. get: function () {
  3768. return _version.default;
  3769. }
  3770. }));
  3771. Object.defineProperty(exports, "validate", ({
  3772. enumerable: true,
  3773. get: function () {
  3774. return _validate.default;
  3775. }
  3776. }));
  3777. Object.defineProperty(exports, "stringify", ({
  3778. enumerable: true,
  3779. get: function () {
  3780. return _stringify.default;
  3781. }
  3782. }));
  3783. Object.defineProperty(exports, "parse", ({
  3784. enumerable: true,
  3785. get: function () {
  3786. return _parse.default;
  3787. }
  3788. }));
  3789. var _v = _interopRequireDefault(__nccwpck_require__(1595));
  3790. var _v2 = _interopRequireDefault(__nccwpck_require__(6993));
  3791. var _v3 = _interopRequireDefault(__nccwpck_require__(1472));
  3792. var _v4 = _interopRequireDefault(__nccwpck_require__(6217));
  3793. var _nil = _interopRequireDefault(__nccwpck_require__(2381));
  3794. var _version = _interopRequireDefault(__nccwpck_require__(427));
  3795. var _validate = _interopRequireDefault(__nccwpck_require__(2609));
  3796. var _stringify = _interopRequireDefault(__nccwpck_require__(1458));
  3797. var _parse = _interopRequireDefault(__nccwpck_require__(6385));
  3798. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  3799. /***/ }),
  3800. /***/ 5842:
  3801. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  3802. "use strict";
  3803. Object.defineProperty(exports, "__esModule", ({
  3804. value: true
  3805. }));
  3806. exports["default"] = void 0;
  3807. var _crypto = _interopRequireDefault(__nccwpck_require__(6113));
  3808. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  3809. function md5(bytes) {
  3810. if (Array.isArray(bytes)) {
  3811. bytes = Buffer.from(bytes);
  3812. } else if (typeof bytes === 'string') {
  3813. bytes = Buffer.from(bytes, 'utf8');
  3814. }
  3815. return _crypto.default.createHash('md5').update(bytes).digest();
  3816. }
  3817. var _default = md5;
  3818. exports["default"] = _default;
  3819. /***/ }),
  3820. /***/ 2381:
  3821. /***/ ((__unused_webpack_module, exports) => {
  3822. "use strict";
  3823. Object.defineProperty(exports, "__esModule", ({
  3824. value: true
  3825. }));
  3826. exports["default"] = void 0;
  3827. var _default = '00000000-0000-0000-0000-000000000000';
  3828. exports["default"] = _default;
  3829. /***/ }),
  3830. /***/ 6385:
  3831. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  3832. "use strict";
  3833. Object.defineProperty(exports, "__esModule", ({
  3834. value: true
  3835. }));
  3836. exports["default"] = void 0;
  3837. var _validate = _interopRequireDefault(__nccwpck_require__(2609));
  3838. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  3839. function parse(uuid) {
  3840. if (!(0, _validate.default)(uuid)) {
  3841. throw TypeError('Invalid UUID');
  3842. }
  3843. let v;
  3844. const arr = new Uint8Array(16); // Parse ########-....-....-....-............
  3845. arr[0] = (v = parseInt(uuid.slice(0, 8), 16)) >>> 24;
  3846. arr[1] = v >>> 16 & 0xff;
  3847. arr[2] = v >>> 8 & 0xff;
  3848. arr[3] = v & 0xff; // Parse ........-####-....-....-............
  3849. arr[4] = (v = parseInt(uuid.slice(9, 13), 16)) >>> 8;
  3850. arr[5] = v & 0xff; // Parse ........-....-####-....-............
  3851. arr[6] = (v = parseInt(uuid.slice(14, 18), 16)) >>> 8;
  3852. arr[7] = v & 0xff; // Parse ........-....-....-####-............
  3853. arr[8] = (v = parseInt(uuid.slice(19, 23), 16)) >>> 8;
  3854. arr[9] = v & 0xff; // Parse ........-....-....-....-############
  3855. // (Use "/" to avoid 32-bit truncation when bit-shifting high-order bytes)
  3856. arr[10] = (v = parseInt(uuid.slice(24, 36), 16)) / 0x10000000000 & 0xff;
  3857. arr[11] = v / 0x100000000 & 0xff;
  3858. arr[12] = v >>> 24 & 0xff;
  3859. arr[13] = v >>> 16 & 0xff;
  3860. arr[14] = v >>> 8 & 0xff;
  3861. arr[15] = v & 0xff;
  3862. return arr;
  3863. }
  3864. var _default = parse;
  3865. exports["default"] = _default;
  3866. /***/ }),
  3867. /***/ 6230:
  3868. /***/ ((__unused_webpack_module, exports) => {
  3869. "use strict";
  3870. Object.defineProperty(exports, "__esModule", ({
  3871. value: true
  3872. }));
  3873. exports["default"] = void 0;
  3874. 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;
  3875. exports["default"] = _default;
  3876. /***/ }),
  3877. /***/ 9784:
  3878. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  3879. "use strict";
  3880. Object.defineProperty(exports, "__esModule", ({
  3881. value: true
  3882. }));
  3883. exports["default"] = rng;
  3884. var _crypto = _interopRequireDefault(__nccwpck_require__(6113));
  3885. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  3886. const rnds8Pool = new Uint8Array(256); // # of random values to pre-allocate
  3887. let poolPtr = rnds8Pool.length;
  3888. function rng() {
  3889. if (poolPtr > rnds8Pool.length - 16) {
  3890. _crypto.default.randomFillSync(rnds8Pool);
  3891. poolPtr = 0;
  3892. }
  3893. return rnds8Pool.slice(poolPtr, poolPtr += 16);
  3894. }
  3895. /***/ }),
  3896. /***/ 8844:
  3897. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  3898. "use strict";
  3899. Object.defineProperty(exports, "__esModule", ({
  3900. value: true
  3901. }));
  3902. exports["default"] = void 0;
  3903. var _crypto = _interopRequireDefault(__nccwpck_require__(6113));
  3904. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  3905. function sha1(bytes) {
  3906. if (Array.isArray(bytes)) {
  3907. bytes = Buffer.from(bytes);
  3908. } else if (typeof bytes === 'string') {
  3909. bytes = Buffer.from(bytes, 'utf8');
  3910. }
  3911. return _crypto.default.createHash('sha1').update(bytes).digest();
  3912. }
  3913. var _default = sha1;
  3914. exports["default"] = _default;
  3915. /***/ }),
  3916. /***/ 1458:
  3917. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  3918. "use strict";
  3919. Object.defineProperty(exports, "__esModule", ({
  3920. value: true
  3921. }));
  3922. exports["default"] = void 0;
  3923. var _validate = _interopRequireDefault(__nccwpck_require__(2609));
  3924. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  3925. /**
  3926. * Convert array of 16 byte values to UUID string format of the form:
  3927. * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
  3928. */
  3929. const byteToHex = [];
  3930. for (let i = 0; i < 256; ++i) {
  3931. byteToHex.push((i + 0x100).toString(16).substr(1));
  3932. }
  3933. function stringify(arr, offset = 0) {
  3934. // Note: Be careful editing this code! It's been tuned for performance
  3935. // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
  3936. 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
  3937. // of the following:
  3938. // - One or more input array values don't map to a hex octet (leading to
  3939. // "undefined" in the uuid)
  3940. // - Invalid input values for the RFC `version` or `variant` fields
  3941. if (!(0, _validate.default)(uuid)) {
  3942. throw TypeError('Stringified UUID is invalid');
  3943. }
  3944. return uuid;
  3945. }
  3946. var _default = stringify;
  3947. exports["default"] = _default;
  3948. /***/ }),
  3949. /***/ 1595:
  3950. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  3951. "use strict";
  3952. Object.defineProperty(exports, "__esModule", ({
  3953. value: true
  3954. }));
  3955. exports["default"] = void 0;
  3956. var _rng = _interopRequireDefault(__nccwpck_require__(9784));
  3957. var _stringify = _interopRequireDefault(__nccwpck_require__(1458));
  3958. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  3959. // **`v1()` - Generate time-based UUID**
  3960. //
  3961. // Inspired by https://github.com/LiosK/UUID.js
  3962. // and http://docs.python.org/library/uuid.html
  3963. let _nodeId;
  3964. let _clockseq; // Previous uuid creation time
  3965. let _lastMSecs = 0;
  3966. let _lastNSecs = 0; // See https://github.com/uuidjs/uuid for API details
  3967. function v1(options, buf, offset) {
  3968. let i = buf && offset || 0;
  3969. const b = buf || new Array(16);
  3970. options = options || {};
  3971. let node = options.node || _nodeId;
  3972. let clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq; // node and clockseq need to be initialized to random values if they're not
  3973. // specified. We do this lazily to minimize issues related to insufficient
  3974. // system entropy. See #189
  3975. if (node == null || clockseq == null) {
  3976. const seedBytes = options.random || (options.rng || _rng.default)();
  3977. if (node == null) {
  3978. // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1)
  3979. node = _nodeId = [seedBytes[0] | 0x01, seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]];
  3980. }
  3981. if (clockseq == null) {
  3982. // Per 4.2.2, randomize (14 bit) clockseq
  3983. clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff;
  3984. }
  3985. } // UUID timestamps are 100 nano-second units since the Gregorian epoch,
  3986. // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so
  3987. // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs'
  3988. // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00.
  3989. let msecs = options.msecs !== undefined ? options.msecs : Date.now(); // Per 4.2.1.2, use count of uuid's generated during the current clock
  3990. // cycle to simulate higher resolution clock
  3991. let nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1; // Time since last uuid creation (in msecs)
  3992. const dt = msecs - _lastMSecs + (nsecs - _lastNSecs) / 10000; // Per 4.2.1.2, Bump clockseq on clock regression
  3993. if (dt < 0 && options.clockseq === undefined) {
  3994. clockseq = clockseq + 1 & 0x3fff;
  3995. } // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new
  3996. // time interval
  3997. if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) {
  3998. nsecs = 0;
  3999. } // Per 4.2.1.2 Throw error if too many uuids are requested
  4000. if (nsecs >= 10000) {
  4001. throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");
  4002. }
  4003. _lastMSecs = msecs;
  4004. _lastNSecs = nsecs;
  4005. _clockseq = clockseq; // Per 4.1.4 - Convert from unix epoch to Gregorian epoch
  4006. msecs += 12219292800000; // `time_low`
  4007. const tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000;
  4008. b[i++] = tl >>> 24 & 0xff;
  4009. b[i++] = tl >>> 16 & 0xff;
  4010. b[i++] = tl >>> 8 & 0xff;
  4011. b[i++] = tl & 0xff; // `time_mid`
  4012. const tmh = msecs / 0x100000000 * 10000 & 0xfffffff;
  4013. b[i++] = tmh >>> 8 & 0xff;
  4014. b[i++] = tmh & 0xff; // `time_high_and_version`
  4015. b[i++] = tmh >>> 24 & 0xf | 0x10; // include version
  4016. b[i++] = tmh >>> 16 & 0xff; // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant)
  4017. b[i++] = clockseq >>> 8 | 0x80; // `clock_seq_low`
  4018. b[i++] = clockseq & 0xff; // `node`
  4019. for (let n = 0; n < 6; ++n) {
  4020. b[i + n] = node[n];
  4021. }
  4022. return buf || (0, _stringify.default)(b);
  4023. }
  4024. var _default = v1;
  4025. exports["default"] = _default;
  4026. /***/ }),
  4027. /***/ 6993:
  4028. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  4029. "use strict";
  4030. Object.defineProperty(exports, "__esModule", ({
  4031. value: true
  4032. }));
  4033. exports["default"] = void 0;
  4034. var _v = _interopRequireDefault(__nccwpck_require__(5920));
  4035. var _md = _interopRequireDefault(__nccwpck_require__(5842));
  4036. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  4037. const v3 = (0, _v.default)('v3', 0x30, _md.default);
  4038. var _default = v3;
  4039. exports["default"] = _default;
  4040. /***/ }),
  4041. /***/ 5920:
  4042. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  4043. "use strict";
  4044. Object.defineProperty(exports, "__esModule", ({
  4045. value: true
  4046. }));
  4047. exports["default"] = _default;
  4048. exports.URL = exports.DNS = void 0;
  4049. var _stringify = _interopRequireDefault(__nccwpck_require__(1458));
  4050. var _parse = _interopRequireDefault(__nccwpck_require__(6385));
  4051. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  4052. function stringToBytes(str) {
  4053. str = unescape(encodeURIComponent(str)); // UTF8 escape
  4054. const bytes = [];
  4055. for (let i = 0; i < str.length; ++i) {
  4056. bytes.push(str.charCodeAt(i));
  4057. }
  4058. return bytes;
  4059. }
  4060. const DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8';
  4061. exports.DNS = DNS;
  4062. const URL = '6ba7b811-9dad-11d1-80b4-00c04fd430c8';
  4063. exports.URL = URL;
  4064. function _default(name, version, hashfunc) {
  4065. function generateUUID(value, namespace, buf, offset) {
  4066. if (typeof value === 'string') {
  4067. value = stringToBytes(value);
  4068. }
  4069. if (typeof namespace === 'string') {
  4070. namespace = (0, _parse.default)(namespace);
  4071. }
  4072. if (namespace.length !== 16) {
  4073. throw TypeError('Namespace must be array-like (16 iterable integer values, 0-255)');
  4074. } // Compute hash of namespace and value, Per 4.3
  4075. // Future: Use spread syntax when supported on all platforms, e.g. `bytes =
  4076. // hashfunc([...namespace, ... value])`
  4077. let bytes = new Uint8Array(16 + value.length);
  4078. bytes.set(namespace);
  4079. bytes.set(value, namespace.length);
  4080. bytes = hashfunc(bytes);
  4081. bytes[6] = bytes[6] & 0x0f | version;
  4082. bytes[8] = bytes[8] & 0x3f | 0x80;
  4083. if (buf) {
  4084. offset = offset || 0;
  4085. for (let i = 0; i < 16; ++i) {
  4086. buf[offset + i] = bytes[i];
  4087. }
  4088. return buf;
  4089. }
  4090. return (0, _stringify.default)(bytes);
  4091. } // Function#name is not settable on some platforms (#270)
  4092. try {
  4093. generateUUID.name = name; // eslint-disable-next-line no-empty
  4094. } catch (err) {} // For CommonJS default export support
  4095. generateUUID.DNS = DNS;
  4096. generateUUID.URL = URL;
  4097. return generateUUID;
  4098. }
  4099. /***/ }),
  4100. /***/ 1472:
  4101. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  4102. "use strict";
  4103. Object.defineProperty(exports, "__esModule", ({
  4104. value: true
  4105. }));
  4106. exports["default"] = void 0;
  4107. var _rng = _interopRequireDefault(__nccwpck_require__(9784));
  4108. var _stringify = _interopRequireDefault(__nccwpck_require__(1458));
  4109. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  4110. function v4(options, buf, offset) {
  4111. options = options || {};
  4112. const rnds = options.random || (options.rng || _rng.default)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
  4113. rnds[6] = rnds[6] & 0x0f | 0x40;
  4114. rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided
  4115. if (buf) {
  4116. offset = offset || 0;
  4117. for (let i = 0; i < 16; ++i) {
  4118. buf[offset + i] = rnds[i];
  4119. }
  4120. return buf;
  4121. }
  4122. return (0, _stringify.default)(rnds);
  4123. }
  4124. var _default = v4;
  4125. exports["default"] = _default;
  4126. /***/ }),
  4127. /***/ 6217:
  4128. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  4129. "use strict";
  4130. Object.defineProperty(exports, "__esModule", ({
  4131. value: true
  4132. }));
  4133. exports["default"] = void 0;
  4134. var _v = _interopRequireDefault(__nccwpck_require__(5920));
  4135. var _sha = _interopRequireDefault(__nccwpck_require__(8844));
  4136. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  4137. const v5 = (0, _v.default)('v5', 0x50, _sha.default);
  4138. var _default = v5;
  4139. exports["default"] = _default;
  4140. /***/ }),
  4141. /***/ 2609:
  4142. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  4143. "use strict";
  4144. Object.defineProperty(exports, "__esModule", ({
  4145. value: true
  4146. }));
  4147. exports["default"] = void 0;
  4148. var _regex = _interopRequireDefault(__nccwpck_require__(6230));
  4149. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  4150. function validate(uuid) {
  4151. return typeof uuid === 'string' && _regex.default.test(uuid);
  4152. }
  4153. var _default = validate;
  4154. exports["default"] = _default;
  4155. /***/ }),
  4156. /***/ 427:
  4157. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  4158. "use strict";
  4159. Object.defineProperty(exports, "__esModule", ({
  4160. value: true
  4161. }));
  4162. exports["default"] = void 0;
  4163. var _validate = _interopRequireDefault(__nccwpck_require__(2609));
  4164. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  4165. function version(uuid) {
  4166. if (!(0, _validate.default)(uuid)) {
  4167. throw TypeError('Invalid UUID');
  4168. }
  4169. return parseInt(uuid.substr(14, 1), 16);
  4170. }
  4171. var _default = version;
  4172. exports["default"] = _default;
  4173. /***/ }),
  4174. /***/ 1514:
  4175. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  4176. "use strict";
  4177. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  4178. if (k2 === undefined) k2 = k;
  4179. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  4180. }) : (function(o, m, k, k2) {
  4181. if (k2 === undefined) k2 = k;
  4182. o[k2] = m[k];
  4183. }));
  4184. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  4185. Object.defineProperty(o, "default", { enumerable: true, value: v });
  4186. }) : function(o, v) {
  4187. o["default"] = v;
  4188. });
  4189. var __importStar = (this && this.__importStar) || function (mod) {
  4190. if (mod && mod.__esModule) return mod;
  4191. var result = {};
  4192. if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  4193. __setModuleDefault(result, mod);
  4194. return result;
  4195. };
  4196. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  4197. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  4198. return new (P || (P = Promise))(function (resolve, reject) {
  4199. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  4200. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  4201. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  4202. step((generator = generator.apply(thisArg, _arguments || [])).next());
  4203. });
  4204. };
  4205. Object.defineProperty(exports, "__esModule", ({ value: true }));
  4206. exports.getExecOutput = exports.exec = void 0;
  4207. const string_decoder_1 = __nccwpck_require__(1576);
  4208. const tr = __importStar(__nccwpck_require__(8159));
  4209. /**
  4210. * Exec a command.
  4211. * Output will be streamed to the live console.
  4212. * Returns promise with return code
  4213. *
  4214. * @param commandLine command to execute (can include additional args). Must be correctly escaped.
  4215. * @param args optional arguments for tool. Escaping is handled by the lib.
  4216. * @param options optional exec options. See ExecOptions
  4217. * @returns Promise<number> exit code
  4218. */
  4219. function exec(commandLine, args, options) {
  4220. return __awaiter(this, void 0, void 0, function* () {
  4221. const commandArgs = tr.argStringToArray(commandLine);
  4222. if (commandArgs.length === 0) {
  4223. throw new Error(`Parameter 'commandLine' cannot be null or empty.`);
  4224. }
  4225. // Path to tool to execute should be first arg
  4226. const toolPath = commandArgs[0];
  4227. args = commandArgs.slice(1).concat(args || []);
  4228. const runner = new tr.ToolRunner(toolPath, args, options);
  4229. return runner.exec();
  4230. });
  4231. }
  4232. exports.exec = exec;
  4233. /**
  4234. * Exec a command and get the output.
  4235. * Output will be streamed to the live console.
  4236. * Returns promise with the exit code and collected stdout and stderr
  4237. *
  4238. * @param commandLine command to execute (can include additional args). Must be correctly escaped.
  4239. * @param args optional arguments for tool. Escaping is handled by the lib.
  4240. * @param options optional exec options. See ExecOptions
  4241. * @returns Promise<ExecOutput> exit code, stdout, and stderr
  4242. */
  4243. function getExecOutput(commandLine, args, options) {
  4244. var _a, _b;
  4245. return __awaiter(this, void 0, void 0, function* () {
  4246. let stdout = '';
  4247. let stderr = '';
  4248. //Using string decoder covers the case where a mult-byte character is split
  4249. const stdoutDecoder = new string_decoder_1.StringDecoder('utf8');
  4250. const stderrDecoder = new string_decoder_1.StringDecoder('utf8');
  4251. const originalStdoutListener = (_a = options === null || options === void 0 ? void 0 : options.listeners) === null || _a === void 0 ? void 0 : _a.stdout;
  4252. const originalStdErrListener = (_b = options === null || options === void 0 ? void 0 : options.listeners) === null || _b === void 0 ? void 0 : _b.stderr;
  4253. const stdErrListener = (data) => {
  4254. stderr += stderrDecoder.write(data);
  4255. if (originalStdErrListener) {
  4256. originalStdErrListener(data);
  4257. }
  4258. };
  4259. const stdOutListener = (data) => {
  4260. stdout += stdoutDecoder.write(data);
  4261. if (originalStdoutListener) {
  4262. originalStdoutListener(data);
  4263. }
  4264. };
  4265. const listeners = Object.assign(Object.assign({}, options === null || options === void 0 ? void 0 : options.listeners), { stdout: stdOutListener, stderr: stdErrListener });
  4266. const exitCode = yield exec(commandLine, args, Object.assign(Object.assign({}, options), { listeners }));
  4267. //flush any remaining characters
  4268. stdout += stdoutDecoder.end();
  4269. stderr += stderrDecoder.end();
  4270. return {
  4271. exitCode,
  4272. stdout,
  4273. stderr
  4274. };
  4275. });
  4276. }
  4277. exports.getExecOutput = getExecOutput;
  4278. //# sourceMappingURL=exec.js.map
  4279. /***/ }),
  4280. /***/ 8159:
  4281. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  4282. "use strict";
  4283. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  4284. if (k2 === undefined) k2 = k;
  4285. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  4286. }) : (function(o, m, k, k2) {
  4287. if (k2 === undefined) k2 = k;
  4288. o[k2] = m[k];
  4289. }));
  4290. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  4291. Object.defineProperty(o, "default", { enumerable: true, value: v });
  4292. }) : function(o, v) {
  4293. o["default"] = v;
  4294. });
  4295. var __importStar = (this && this.__importStar) || function (mod) {
  4296. if (mod && mod.__esModule) return mod;
  4297. var result = {};
  4298. if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  4299. __setModuleDefault(result, mod);
  4300. return result;
  4301. };
  4302. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  4303. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  4304. return new (P || (P = Promise))(function (resolve, reject) {
  4305. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  4306. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  4307. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  4308. step((generator = generator.apply(thisArg, _arguments || [])).next());
  4309. });
  4310. };
  4311. Object.defineProperty(exports, "__esModule", ({ value: true }));
  4312. exports.argStringToArray = exports.ToolRunner = void 0;
  4313. const os = __importStar(__nccwpck_require__(2037));
  4314. const events = __importStar(__nccwpck_require__(2361));
  4315. const child = __importStar(__nccwpck_require__(2081));
  4316. const path = __importStar(__nccwpck_require__(1017));
  4317. const io = __importStar(__nccwpck_require__(7436));
  4318. const ioUtil = __importStar(__nccwpck_require__(1962));
  4319. const timers_1 = __nccwpck_require__(9512);
  4320. /* eslint-disable @typescript-eslint/unbound-method */
  4321. const IS_WINDOWS = process.platform === 'win32';
  4322. /*
  4323. * Class for running command line tools. Handles quoting and arg parsing in a platform agnostic way.
  4324. */
  4325. class ToolRunner extends events.EventEmitter {
  4326. constructor(toolPath, args, options) {
  4327. super();
  4328. if (!toolPath) {
  4329. throw new Error("Parameter 'toolPath' cannot be null or empty.");
  4330. }
  4331. this.toolPath = toolPath;
  4332. this.args = args || [];
  4333. this.options = options || {};
  4334. }
  4335. _debug(message) {
  4336. if (this.options.listeners && this.options.listeners.debug) {
  4337. this.options.listeners.debug(message);
  4338. }
  4339. }
  4340. _getCommandString(options, noPrefix) {
  4341. const toolPath = this._getSpawnFileName();
  4342. const args = this._getSpawnArgs(options);
  4343. let cmd = noPrefix ? '' : '[command]'; // omit prefix when piped to a second tool
  4344. if (IS_WINDOWS) {
  4345. // Windows + cmd file
  4346. if (this._isCmdFile()) {
  4347. cmd += toolPath;
  4348. for (const a of args) {
  4349. cmd += ` ${a}`;
  4350. }
  4351. }
  4352. // Windows + verbatim
  4353. else if (options.windowsVerbatimArguments) {
  4354. cmd += `"${toolPath}"`;
  4355. for (const a of args) {
  4356. cmd += ` ${a}`;
  4357. }
  4358. }
  4359. // Windows (regular)
  4360. else {
  4361. cmd += this._windowsQuoteCmdArg(toolPath);
  4362. for (const a of args) {
  4363. cmd += ` ${this._windowsQuoteCmdArg(a)}`;
  4364. }
  4365. }
  4366. }
  4367. else {
  4368. // OSX/Linux - this can likely be improved with some form of quoting.
  4369. // creating processes on Unix is fundamentally different than Windows.
  4370. // on Unix, execvp() takes an arg array.
  4371. cmd += toolPath;
  4372. for (const a of args) {
  4373. cmd += ` ${a}`;
  4374. }
  4375. }
  4376. return cmd;
  4377. }
  4378. _processLineBuffer(data, strBuffer, onLine) {
  4379. try {
  4380. let s = strBuffer + data.toString();
  4381. let n = s.indexOf(os.EOL);
  4382. while (n > -1) {
  4383. const line = s.substring(0, n);
  4384. onLine(line);
  4385. // the rest of the string ...
  4386. s = s.substring(n + os.EOL.length);
  4387. n = s.indexOf(os.EOL);
  4388. }
  4389. return s;
  4390. }
  4391. catch (err) {
  4392. // streaming lines to console is best effort. Don't fail a build.
  4393. this._debug(`error processing line. Failed with error ${err}`);
  4394. return '';
  4395. }
  4396. }
  4397. _getSpawnFileName() {
  4398. if (IS_WINDOWS) {
  4399. if (this._isCmdFile()) {
  4400. return process.env['COMSPEC'] || 'cmd.exe';
  4401. }
  4402. }
  4403. return this.toolPath;
  4404. }
  4405. _getSpawnArgs(options) {
  4406. if (IS_WINDOWS) {
  4407. if (this._isCmdFile()) {
  4408. let argline = `/D /S /C "${this._windowsQuoteCmdArg(this.toolPath)}`;
  4409. for (const a of this.args) {
  4410. argline += ' ';
  4411. argline += options.windowsVerbatimArguments
  4412. ? a
  4413. : this._windowsQuoteCmdArg(a);
  4414. }
  4415. argline += '"';
  4416. return [argline];
  4417. }
  4418. }
  4419. return this.args;
  4420. }
  4421. _endsWith(str, end) {
  4422. return str.endsWith(end);
  4423. }
  4424. _isCmdFile() {
  4425. const upperToolPath = this.toolPath.toUpperCase();
  4426. return (this._endsWith(upperToolPath, '.CMD') ||
  4427. this._endsWith(upperToolPath, '.BAT'));
  4428. }
  4429. _windowsQuoteCmdArg(arg) {
  4430. // for .exe, apply the normal quoting rules that libuv applies
  4431. if (!this._isCmdFile()) {
  4432. return this._uvQuoteCmdArg(arg);
  4433. }
  4434. // otherwise apply quoting rules specific to the cmd.exe command line parser.
  4435. // the libuv rules are generic and are not designed specifically for cmd.exe
  4436. // command line parser.
  4437. //
  4438. // for a detailed description of the cmd.exe command line parser, refer to
  4439. // http://stackoverflow.com/questions/4094699/how-does-the-windows-command-interpreter-cmd-exe-parse-scripts/7970912#7970912
  4440. // need quotes for empty arg
  4441. if (!arg) {
  4442. return '""';
  4443. }
  4444. // determine whether the arg needs to be quoted
  4445. const cmdSpecialChars = [
  4446. ' ',
  4447. '\t',
  4448. '&',
  4449. '(',
  4450. ')',
  4451. '[',
  4452. ']',
  4453. '{',
  4454. '}',
  4455. '^',
  4456. '=',
  4457. ';',
  4458. '!',
  4459. "'",
  4460. '+',
  4461. ',',
  4462. '`',
  4463. '~',
  4464. '|',
  4465. '<',
  4466. '>',
  4467. '"'
  4468. ];
  4469. let needsQuotes = false;
  4470. for (const char of arg) {
  4471. if (cmdSpecialChars.some(x => x === char)) {
  4472. needsQuotes = true;
  4473. break;
  4474. }
  4475. }
  4476. // short-circuit if quotes not needed
  4477. if (!needsQuotes) {
  4478. return arg;
  4479. }
  4480. // the following quoting rules are very similar to the rules that by libuv applies.
  4481. //
  4482. // 1) wrap the string in quotes
  4483. //
  4484. // 2) double-up quotes - i.e. " => ""
  4485. //
  4486. // this is different from the libuv quoting rules. libuv replaces " with \", which unfortunately
  4487. // doesn't work well with a cmd.exe command line.
  4488. //
  4489. // note, replacing " with "" also works well if the arg is passed to a downstream .NET console app.
  4490. // for example, the command line:
  4491. // foo.exe "myarg:""my val"""
  4492. // is parsed by a .NET console app into an arg array:
  4493. // [ "myarg:\"my val\"" ]
  4494. // which is the same end result when applying libuv quoting rules. although the actual
  4495. // command line from libuv quoting rules would look like:
  4496. // foo.exe "myarg:\"my val\""
  4497. //
  4498. // 3) double-up slashes that precede a quote,
  4499. // e.g. hello \world => "hello \world"
  4500. // hello\"world => "hello\\""world"
  4501. // hello\\"world => "hello\\\\""world"
  4502. // hello world\ => "hello world\\"
  4503. //
  4504. // technically this is not required for a cmd.exe command line, or the batch argument parser.
  4505. // the reasons for including this as a .cmd quoting rule are:
  4506. //
  4507. // a) this is optimized for the scenario where the argument is passed from the .cmd file to an
  4508. // external program. many programs (e.g. .NET console apps) rely on the slash-doubling rule.
  4509. //
  4510. // b) it's what we've been doing previously (by deferring to node default behavior) and we
  4511. // haven't heard any complaints about that aspect.
  4512. //
  4513. // note, a weakness of the quoting rules chosen here, is that % is not escaped. in fact, % cannot be
  4514. // escaped when used on the command line directly - even though within a .cmd file % can be escaped
  4515. // by using %%.
  4516. //
  4517. // the saving grace is, on the command line, %var% is left as-is if var is not defined. this contrasts
  4518. // the line parsing rules within a .cmd file, where if var is not defined it is replaced with nothing.
  4519. //
  4520. // one option that was explored was replacing % with ^% - i.e. %var% => ^%var^%. this hack would
  4521. // often work, since it is unlikely that var^ would exist, and the ^ character is removed when the
  4522. // variable is used. the problem, however, is that ^ is not removed when %* is used to pass the args
  4523. // to an external program.
  4524. //
  4525. // an unexplored potential solution for the % escaping problem, is to create a wrapper .cmd file.
  4526. // % can be escaped within a .cmd file.
  4527. let reverse = '"';
  4528. let quoteHit = true;
  4529. for (let i = arg.length; i > 0; i--) {
  4530. // walk the string in reverse
  4531. reverse += arg[i - 1];
  4532. if (quoteHit && arg[i - 1] === '\\') {
  4533. reverse += '\\'; // double the slash
  4534. }
  4535. else if (arg[i - 1] === '"') {
  4536. quoteHit = true;
  4537. reverse += '"'; // double the quote
  4538. }
  4539. else {
  4540. quoteHit = false;
  4541. }
  4542. }
  4543. reverse += '"';
  4544. return reverse
  4545. .split('')
  4546. .reverse()
  4547. .join('');
  4548. }
  4549. _uvQuoteCmdArg(arg) {
  4550. // Tool runner wraps child_process.spawn() and needs to apply the same quoting as
  4551. // Node in certain cases where the undocumented spawn option windowsVerbatimArguments
  4552. // is used.
  4553. //
  4554. // Since this function is a port of quote_cmd_arg from Node 4.x (technically, lib UV,
  4555. // see https://github.com/nodejs/node/blob/v4.x/deps/uv/src/win/process.c for details),
  4556. // pasting copyright notice from Node within this function:
  4557. //
  4558. // Copyright Joyent, Inc. and other Node contributors. All rights reserved.
  4559. //
  4560. // Permission is hereby granted, free of charge, to any person obtaining a copy
  4561. // of this software and associated documentation files (the "Software"), to
  4562. // deal in the Software without restriction, including without limitation the
  4563. // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
  4564. // sell copies of the Software, and to permit persons to whom the Software is
  4565. // furnished to do so, subject to the following conditions:
  4566. //
  4567. // The above copyright notice and this permission notice shall be included in
  4568. // all copies or substantial portions of the Software.
  4569. //
  4570. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  4571. // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  4572. // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  4573. // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  4574. // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  4575. // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
  4576. // IN THE SOFTWARE.
  4577. if (!arg) {
  4578. // Need double quotation for empty argument
  4579. return '""';
  4580. }
  4581. if (!arg.includes(' ') && !arg.includes('\t') && !arg.includes('"')) {
  4582. // No quotation needed
  4583. return arg;
  4584. }
  4585. if (!arg.includes('"') && !arg.includes('\\')) {
  4586. // No embedded double quotes or backslashes, so I can just wrap
  4587. // quote marks around the whole thing.
  4588. return `"${arg}"`;
  4589. }
  4590. // Expected input/output:
  4591. // input : hello"world
  4592. // output: "hello\"world"
  4593. // input : hello""world
  4594. // output: "hello\"\"world"
  4595. // input : hello\world
  4596. // output: hello\world
  4597. // input : hello\\world
  4598. // output: hello\\world
  4599. // input : hello\"world
  4600. // output: "hello\\\"world"
  4601. // input : hello\\"world
  4602. // output: "hello\\\\\"world"
  4603. // input : hello world\
  4604. // output: "hello world\\" - note the comment in libuv actually reads "hello world\"
  4605. // but it appears the comment is wrong, it should be "hello world\\"
  4606. let reverse = '"';
  4607. let quoteHit = true;
  4608. for (let i = arg.length; i > 0; i--) {
  4609. // walk the string in reverse
  4610. reverse += arg[i - 1];
  4611. if (quoteHit && arg[i - 1] === '\\') {
  4612. reverse += '\\';
  4613. }
  4614. else if (arg[i - 1] === '"') {
  4615. quoteHit = true;
  4616. reverse += '\\';
  4617. }
  4618. else {
  4619. quoteHit = false;
  4620. }
  4621. }
  4622. reverse += '"';
  4623. return reverse
  4624. .split('')
  4625. .reverse()
  4626. .join('');
  4627. }
  4628. _cloneExecOptions(options) {
  4629. options = options || {};
  4630. const result = {
  4631. cwd: options.cwd || process.cwd(),
  4632. env: options.env || process.env,
  4633. silent: options.silent || false,
  4634. windowsVerbatimArguments: options.windowsVerbatimArguments || false,
  4635. failOnStdErr: options.failOnStdErr || false,
  4636. ignoreReturnCode: options.ignoreReturnCode || false,
  4637. delay: options.delay || 10000
  4638. };
  4639. result.outStream = options.outStream || process.stdout;
  4640. result.errStream = options.errStream || process.stderr;
  4641. return result;
  4642. }
  4643. _getSpawnOptions(options, toolPath) {
  4644. options = options || {};
  4645. const result = {};
  4646. result.cwd = options.cwd;
  4647. result.env = options.env;
  4648. result['windowsVerbatimArguments'] =
  4649. options.windowsVerbatimArguments || this._isCmdFile();
  4650. if (options.windowsVerbatimArguments) {
  4651. result.argv0 = `"${toolPath}"`;
  4652. }
  4653. return result;
  4654. }
  4655. /**
  4656. * Exec a tool.
  4657. * Output will be streamed to the live console.
  4658. * Returns promise with return code
  4659. *
  4660. * @param tool path to tool to exec
  4661. * @param options optional exec options. See ExecOptions
  4662. * @returns number
  4663. */
  4664. exec() {
  4665. return __awaiter(this, void 0, void 0, function* () {
  4666. // root the tool path if it is unrooted and contains relative pathing
  4667. if (!ioUtil.isRooted(this.toolPath) &&
  4668. (this.toolPath.includes('/') ||
  4669. (IS_WINDOWS && this.toolPath.includes('\\')))) {
  4670. // prefer options.cwd if it is specified, however options.cwd may also need to be rooted
  4671. this.toolPath = path.resolve(process.cwd(), this.options.cwd || process.cwd(), this.toolPath);
  4672. }
  4673. // if the tool is only a file name, then resolve it from the PATH
  4674. // otherwise verify it exists (add extension on Windows if necessary)
  4675. this.toolPath = yield io.which(this.toolPath, true);
  4676. return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
  4677. this._debug(`exec tool: ${this.toolPath}`);
  4678. this._debug('arguments:');
  4679. for (const arg of this.args) {
  4680. this._debug(` ${arg}`);
  4681. }
  4682. const optionsNonNull = this._cloneExecOptions(this.options);
  4683. if (!optionsNonNull.silent && optionsNonNull.outStream) {
  4684. optionsNonNull.outStream.write(this._getCommandString(optionsNonNull) + os.EOL);
  4685. }
  4686. const state = new ExecState(optionsNonNull, this.toolPath);
  4687. state.on('debug', (message) => {
  4688. this._debug(message);
  4689. });
  4690. if (this.options.cwd && !(yield ioUtil.exists(this.options.cwd))) {
  4691. return reject(new Error(`The cwd: ${this.options.cwd} does not exist!`));
  4692. }
  4693. const fileName = this._getSpawnFileName();
  4694. const cp = child.spawn(fileName, this._getSpawnArgs(optionsNonNull), this._getSpawnOptions(this.options, fileName));
  4695. let stdbuffer = '';
  4696. if (cp.stdout) {
  4697. cp.stdout.on('data', (data) => {
  4698. if (this.options.listeners && this.options.listeners.stdout) {
  4699. this.options.listeners.stdout(data);
  4700. }
  4701. if (!optionsNonNull.silent && optionsNonNull.outStream) {
  4702. optionsNonNull.outStream.write(data);
  4703. }
  4704. stdbuffer = this._processLineBuffer(data, stdbuffer, (line) => {
  4705. if (this.options.listeners && this.options.listeners.stdline) {
  4706. this.options.listeners.stdline(line);
  4707. }
  4708. });
  4709. });
  4710. }
  4711. let errbuffer = '';
  4712. if (cp.stderr) {
  4713. cp.stderr.on('data', (data) => {
  4714. state.processStderr = true;
  4715. if (this.options.listeners && this.options.listeners.stderr) {
  4716. this.options.listeners.stderr(data);
  4717. }
  4718. if (!optionsNonNull.silent &&
  4719. optionsNonNull.errStream &&
  4720. optionsNonNull.outStream) {
  4721. const s = optionsNonNull.failOnStdErr
  4722. ? optionsNonNull.errStream
  4723. : optionsNonNull.outStream;
  4724. s.write(data);
  4725. }
  4726. errbuffer = this._processLineBuffer(data, errbuffer, (line) => {
  4727. if (this.options.listeners && this.options.listeners.errline) {
  4728. this.options.listeners.errline(line);
  4729. }
  4730. });
  4731. });
  4732. }
  4733. cp.on('error', (err) => {
  4734. state.processError = err.message;
  4735. state.processExited = true;
  4736. state.processClosed = true;
  4737. state.CheckComplete();
  4738. });
  4739. cp.on('exit', (code) => {
  4740. state.processExitCode = code;
  4741. state.processExited = true;
  4742. this._debug(`Exit code ${code} received from tool '${this.toolPath}'`);
  4743. state.CheckComplete();
  4744. });
  4745. cp.on('close', (code) => {
  4746. state.processExitCode = code;
  4747. state.processExited = true;
  4748. state.processClosed = true;
  4749. this._debug(`STDIO streams have closed for tool '${this.toolPath}'`);
  4750. state.CheckComplete();
  4751. });
  4752. state.on('done', (error, exitCode) => {
  4753. if (stdbuffer.length > 0) {
  4754. this.emit('stdline', stdbuffer);
  4755. }
  4756. if (errbuffer.length > 0) {
  4757. this.emit('errline', errbuffer);
  4758. }
  4759. cp.removeAllListeners();
  4760. if (error) {
  4761. reject(error);
  4762. }
  4763. else {
  4764. resolve(exitCode);
  4765. }
  4766. });
  4767. if (this.options.input) {
  4768. if (!cp.stdin) {
  4769. throw new Error('child process missing stdin');
  4770. }
  4771. cp.stdin.end(this.options.input);
  4772. }
  4773. }));
  4774. });
  4775. }
  4776. }
  4777. exports.ToolRunner = ToolRunner;
  4778. /**
  4779. * Convert an arg string to an array of args. Handles escaping
  4780. *
  4781. * @param argString string of arguments
  4782. * @returns string[] array of arguments
  4783. */
  4784. function argStringToArray(argString) {
  4785. const args = [];
  4786. let inQuotes = false;
  4787. let escaped = false;
  4788. let arg = '';
  4789. function append(c) {
  4790. // we only escape double quotes.
  4791. if (escaped && c !== '"') {
  4792. arg += '\\';
  4793. }
  4794. arg += c;
  4795. escaped = false;
  4796. }
  4797. for (let i = 0; i < argString.length; i++) {
  4798. const c = argString.charAt(i);
  4799. if (c === '"') {
  4800. if (!escaped) {
  4801. inQuotes = !inQuotes;
  4802. }
  4803. else {
  4804. append(c);
  4805. }
  4806. continue;
  4807. }
  4808. if (c === '\\' && escaped) {
  4809. append(c);
  4810. continue;
  4811. }
  4812. if (c === '\\' && inQuotes) {
  4813. escaped = true;
  4814. continue;
  4815. }
  4816. if (c === ' ' && !inQuotes) {
  4817. if (arg.length > 0) {
  4818. args.push(arg);
  4819. arg = '';
  4820. }
  4821. continue;
  4822. }
  4823. append(c);
  4824. }
  4825. if (arg.length > 0) {
  4826. args.push(arg.trim());
  4827. }
  4828. return args;
  4829. }
  4830. exports.argStringToArray = argStringToArray;
  4831. class ExecState extends events.EventEmitter {
  4832. constructor(options, toolPath) {
  4833. super();
  4834. this.processClosed = false; // tracks whether the process has exited and stdio is closed
  4835. this.processError = '';
  4836. this.processExitCode = 0;
  4837. this.processExited = false; // tracks whether the process has exited
  4838. this.processStderr = false; // tracks whether stderr was written to
  4839. this.delay = 10000; // 10 seconds
  4840. this.done = false;
  4841. this.timeout = null;
  4842. if (!toolPath) {
  4843. throw new Error('toolPath must not be empty');
  4844. }
  4845. this.options = options;
  4846. this.toolPath = toolPath;
  4847. if (options.delay) {
  4848. this.delay = options.delay;
  4849. }
  4850. }
  4851. CheckComplete() {
  4852. if (this.done) {
  4853. return;
  4854. }
  4855. if (this.processClosed) {
  4856. this._setResult();
  4857. }
  4858. else if (this.processExited) {
  4859. this.timeout = timers_1.setTimeout(ExecState.HandleTimeout, this.delay, this);
  4860. }
  4861. }
  4862. _debug(message) {
  4863. this.emit('debug', message);
  4864. }
  4865. _setResult() {
  4866. // determine whether there is an error
  4867. let error;
  4868. if (this.processExited) {
  4869. if (this.processError) {
  4870. 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}`);
  4871. }
  4872. else if (this.processExitCode !== 0 && !this.options.ignoreReturnCode) {
  4873. error = new Error(`The process '${this.toolPath}' failed with exit code ${this.processExitCode}`);
  4874. }
  4875. else if (this.processStderr && this.options.failOnStdErr) {
  4876. error = new Error(`The process '${this.toolPath}' failed because one or more lines were written to the STDERR stream`);
  4877. }
  4878. }
  4879. // clear the timeout
  4880. if (this.timeout) {
  4881. clearTimeout(this.timeout);
  4882. this.timeout = null;
  4883. }
  4884. this.done = true;
  4885. this.emit('done', error, this.processExitCode);
  4886. }
  4887. static HandleTimeout(state) {
  4888. if (state.done) {
  4889. return;
  4890. }
  4891. if (!state.processClosed && state.processExited) {
  4892. const message = `The STDIO streams did not close within ${state.delay /
  4893. 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.`;
  4894. state._debug(message);
  4895. }
  4896. state._setResult();
  4897. }
  4898. }
  4899. //# sourceMappingURL=toolrunner.js.map
  4900. /***/ }),
  4901. /***/ 4087:
  4902. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  4903. "use strict";
  4904. Object.defineProperty(exports, "__esModule", ({ value: true }));
  4905. exports.Context = void 0;
  4906. const fs_1 = __nccwpck_require__(7147);
  4907. const os_1 = __nccwpck_require__(2037);
  4908. class Context {
  4909. /**
  4910. * Hydrate the context from the environment
  4911. */
  4912. constructor() {
  4913. var _a, _b, _c;
  4914. this.payload = {};
  4915. if (process.env.GITHUB_EVENT_PATH) {
  4916. if ((0, fs_1.existsSync)(process.env.GITHUB_EVENT_PATH)) {
  4917. this.payload = JSON.parse((0, fs_1.readFileSync)(process.env.GITHUB_EVENT_PATH, { encoding: 'utf8' }));
  4918. }
  4919. else {
  4920. const path = process.env.GITHUB_EVENT_PATH;
  4921. process.stdout.write(`GITHUB_EVENT_PATH ${path} does not exist${os_1.EOL}`);
  4922. }
  4923. }
  4924. this.eventName = process.env.GITHUB_EVENT_NAME;
  4925. this.sha = process.env.GITHUB_SHA;
  4926. this.ref = process.env.GITHUB_REF;
  4927. this.workflow = process.env.GITHUB_WORKFLOW;
  4928. this.action = process.env.GITHUB_ACTION;
  4929. this.actor = process.env.GITHUB_ACTOR;
  4930. this.job = process.env.GITHUB_JOB;
  4931. this.runNumber = parseInt(process.env.GITHUB_RUN_NUMBER, 10);
  4932. this.runId = parseInt(process.env.GITHUB_RUN_ID, 10);
  4933. this.apiUrl = (_a = process.env.GITHUB_API_URL) !== null && _a !== void 0 ? _a : `https://api.github.com`;
  4934. this.serverUrl = (_b = process.env.GITHUB_SERVER_URL) !== null && _b !== void 0 ? _b : `https://github.com`;
  4935. this.graphqlUrl =
  4936. (_c = process.env.GITHUB_GRAPHQL_URL) !== null && _c !== void 0 ? _c : `https://api.github.com/graphql`;
  4937. }
  4938. get issue() {
  4939. const payload = this.payload;
  4940. return Object.assign(Object.assign({}, this.repo), { number: (payload.issue || payload.pull_request || payload).number });
  4941. }
  4942. get repo() {
  4943. if (process.env.GITHUB_REPOSITORY) {
  4944. const [owner, repo] = process.env.GITHUB_REPOSITORY.split('/');
  4945. return { owner, repo };
  4946. }
  4947. if (this.payload.repository) {
  4948. return {
  4949. owner: this.payload.repository.owner.login,
  4950. repo: this.payload.repository.name
  4951. };
  4952. }
  4953. throw new Error("context.repo requires a GITHUB_REPOSITORY environment variable like 'owner/repo'");
  4954. }
  4955. }
  4956. exports.Context = Context;
  4957. //# sourceMappingURL=context.js.map
  4958. /***/ }),
  4959. /***/ 5438:
  4960. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  4961. "use strict";
  4962. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  4963. if (k2 === undefined) k2 = k;
  4964. var desc = Object.getOwnPropertyDescriptor(m, k);
  4965. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  4966. desc = { enumerable: true, get: function() { return m[k]; } };
  4967. }
  4968. Object.defineProperty(o, k2, desc);
  4969. }) : (function(o, m, k, k2) {
  4970. if (k2 === undefined) k2 = k;
  4971. o[k2] = m[k];
  4972. }));
  4973. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  4974. Object.defineProperty(o, "default", { enumerable: true, value: v });
  4975. }) : function(o, v) {
  4976. o["default"] = v;
  4977. });
  4978. var __importStar = (this && this.__importStar) || function (mod) {
  4979. if (mod && mod.__esModule) return mod;
  4980. var result = {};
  4981. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  4982. __setModuleDefault(result, mod);
  4983. return result;
  4984. };
  4985. Object.defineProperty(exports, "__esModule", ({ value: true }));
  4986. exports.getOctokit = exports.context = void 0;
  4987. const Context = __importStar(__nccwpck_require__(4087));
  4988. const utils_1 = __nccwpck_require__(3030);
  4989. exports.context = new Context.Context();
  4990. /**
  4991. * Returns a hydrated octokit ready to use for GitHub Actions
  4992. *
  4993. * @param token the repo PAT or GITHUB_TOKEN
  4994. * @param options other options to set
  4995. */
  4996. function getOctokit(token, options, ...additionalPlugins) {
  4997. const GitHubWithPlugins = utils_1.GitHub.plugin(...additionalPlugins);
  4998. return new GitHubWithPlugins((0, utils_1.getOctokitOptions)(token, options));
  4999. }
  5000. exports.getOctokit = getOctokit;
  5001. //# sourceMappingURL=github.js.map
  5002. /***/ }),
  5003. /***/ 7914:
  5004. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  5005. "use strict";
  5006. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  5007. if (k2 === undefined) k2 = k;
  5008. var desc = Object.getOwnPropertyDescriptor(m, k);
  5009. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  5010. desc = { enumerable: true, get: function() { return m[k]; } };
  5011. }
  5012. Object.defineProperty(o, k2, desc);
  5013. }) : (function(o, m, k, k2) {
  5014. if (k2 === undefined) k2 = k;
  5015. o[k2] = m[k];
  5016. }));
  5017. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  5018. Object.defineProperty(o, "default", { enumerable: true, value: v });
  5019. }) : function(o, v) {
  5020. o["default"] = v;
  5021. });
  5022. var __importStar = (this && this.__importStar) || function (mod) {
  5023. if (mod && mod.__esModule) return mod;
  5024. var result = {};
  5025. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  5026. __setModuleDefault(result, mod);
  5027. return result;
  5028. };
  5029. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  5030. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  5031. return new (P || (P = Promise))(function (resolve, reject) {
  5032. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  5033. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  5034. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  5035. step((generator = generator.apply(thisArg, _arguments || [])).next());
  5036. });
  5037. };
  5038. Object.defineProperty(exports, "__esModule", ({ value: true }));
  5039. exports.getApiBaseUrl = exports.getProxyFetch = exports.getProxyAgentDispatcher = exports.getProxyAgent = exports.getAuthString = void 0;
  5040. const httpClient = __importStar(__nccwpck_require__(6255));
  5041. const undici_1 = __nccwpck_require__(1773);
  5042. function getAuthString(token, options) {
  5043. if (!token && !options.auth) {
  5044. throw new Error('Parameter token or opts.auth is required');
  5045. }
  5046. else if (token && options.auth) {
  5047. throw new Error('Parameters token and opts.auth may not both be specified');
  5048. }
  5049. return typeof options.auth === 'string' ? options.auth : `token ${token}`;
  5050. }
  5051. exports.getAuthString = getAuthString;
  5052. function getProxyAgent(destinationUrl) {
  5053. const hc = new httpClient.HttpClient();
  5054. return hc.getAgent(destinationUrl);
  5055. }
  5056. exports.getProxyAgent = getProxyAgent;
  5057. function getProxyAgentDispatcher(destinationUrl) {
  5058. const hc = new httpClient.HttpClient();
  5059. return hc.getAgentDispatcher(destinationUrl);
  5060. }
  5061. exports.getProxyAgentDispatcher = getProxyAgentDispatcher;
  5062. function getProxyFetch(destinationUrl) {
  5063. const httpDispatcher = getProxyAgentDispatcher(destinationUrl);
  5064. const proxyFetch = (url, opts) => __awaiter(this, void 0, void 0, function* () {
  5065. return (0, undici_1.fetch)(url, Object.assign(Object.assign({}, opts), { dispatcher: httpDispatcher }));
  5066. });
  5067. return proxyFetch;
  5068. }
  5069. exports.getProxyFetch = getProxyFetch;
  5070. function getApiBaseUrl() {
  5071. return process.env['GITHUB_API_URL'] || 'https://api.github.com';
  5072. }
  5073. exports.getApiBaseUrl = getApiBaseUrl;
  5074. //# sourceMappingURL=utils.js.map
  5075. /***/ }),
  5076. /***/ 3030:
  5077. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  5078. "use strict";
  5079. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  5080. if (k2 === undefined) k2 = k;
  5081. var desc = Object.getOwnPropertyDescriptor(m, k);
  5082. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  5083. desc = { enumerable: true, get: function() { return m[k]; } };
  5084. }
  5085. Object.defineProperty(o, k2, desc);
  5086. }) : (function(o, m, k, k2) {
  5087. if (k2 === undefined) k2 = k;
  5088. o[k2] = m[k];
  5089. }));
  5090. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  5091. Object.defineProperty(o, "default", { enumerable: true, value: v });
  5092. }) : function(o, v) {
  5093. o["default"] = v;
  5094. });
  5095. var __importStar = (this && this.__importStar) || function (mod) {
  5096. if (mod && mod.__esModule) return mod;
  5097. var result = {};
  5098. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  5099. __setModuleDefault(result, mod);
  5100. return result;
  5101. };
  5102. Object.defineProperty(exports, "__esModule", ({ value: true }));
  5103. exports.getOctokitOptions = exports.GitHub = exports.defaults = exports.context = void 0;
  5104. const Context = __importStar(__nccwpck_require__(4087));
  5105. const Utils = __importStar(__nccwpck_require__(7914));
  5106. // octokit + plugins
  5107. const core_1 = __nccwpck_require__(6762);
  5108. const plugin_rest_endpoint_methods_1 = __nccwpck_require__(3044);
  5109. const plugin_paginate_rest_1 = __nccwpck_require__(4193);
  5110. exports.context = new Context.Context();
  5111. const baseUrl = Utils.getApiBaseUrl();
  5112. exports.defaults = {
  5113. baseUrl,
  5114. request: {
  5115. agent: Utils.getProxyAgent(baseUrl),
  5116. fetch: Utils.getProxyFetch(baseUrl)
  5117. }
  5118. };
  5119. exports.GitHub = core_1.Octokit.plugin(plugin_rest_endpoint_methods_1.restEndpointMethods, plugin_paginate_rest_1.paginateRest).defaults(exports.defaults);
  5120. /**
  5121. * Convience function to correctly format Octokit Options to pass into the constructor.
  5122. *
  5123. * @param token the repo PAT or GITHUB_TOKEN
  5124. * @param options other options to set
  5125. */
  5126. function getOctokitOptions(token, options) {
  5127. const opts = Object.assign({}, options || {}); // Shallow clone - don't mutate the object provided by the caller
  5128. // Auth
  5129. const auth = Utils.getAuthString(token, opts);
  5130. if (auth) {
  5131. opts.auth = auth;
  5132. }
  5133. return opts;
  5134. }
  5135. exports.getOctokitOptions = getOctokitOptions;
  5136. //# sourceMappingURL=utils.js.map
  5137. /***/ }),
  5138. /***/ 5526:
  5139. /***/ (function(__unused_webpack_module, exports) {
  5140. "use strict";
  5141. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  5142. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  5143. return new (P || (P = Promise))(function (resolve, reject) {
  5144. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  5145. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  5146. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  5147. step((generator = generator.apply(thisArg, _arguments || [])).next());
  5148. });
  5149. };
  5150. Object.defineProperty(exports, "__esModule", ({ value: true }));
  5151. exports.PersonalAccessTokenCredentialHandler = exports.BearerCredentialHandler = exports.BasicCredentialHandler = void 0;
  5152. class BasicCredentialHandler {
  5153. constructor(username, password) {
  5154. this.username = username;
  5155. this.password = password;
  5156. }
  5157. prepareRequest(options) {
  5158. if (!options.headers) {
  5159. throw Error('The request has no headers');
  5160. }
  5161. options.headers['Authorization'] = `Basic ${Buffer.from(`${this.username}:${this.password}`).toString('base64')}`;
  5162. }
  5163. // This handler cannot handle 401
  5164. canHandleAuthentication() {
  5165. return false;
  5166. }
  5167. handleAuthentication() {
  5168. return __awaiter(this, void 0, void 0, function* () {
  5169. throw new Error('not implemented');
  5170. });
  5171. }
  5172. }
  5173. exports.BasicCredentialHandler = BasicCredentialHandler;
  5174. class BearerCredentialHandler {
  5175. constructor(token) {
  5176. this.token = token;
  5177. }
  5178. // currently implements pre-authorization
  5179. // TODO: support preAuth = false where it hooks on 401
  5180. prepareRequest(options) {
  5181. if (!options.headers) {
  5182. throw Error('The request has no headers');
  5183. }
  5184. options.headers['Authorization'] = `Bearer ${this.token}`;
  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.BearerCredentialHandler = BearerCredentialHandler;
  5197. class PersonalAccessTokenCredentialHandler {
  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'] = `Basic ${Buffer.from(`PAT:${this.token}`).toString('base64')}`;
  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.PersonalAccessTokenCredentialHandler = PersonalAccessTokenCredentialHandler;
  5220. //# sourceMappingURL=auth.js.map
  5221. /***/ }),
  5222. /***/ 6255:
  5223. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  5224. "use strict";
  5225. /* eslint-disable @typescript-eslint/no-explicit-any */
  5226. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  5227. if (k2 === undefined) k2 = k;
  5228. var desc = Object.getOwnPropertyDescriptor(m, k);
  5229. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  5230. desc = { enumerable: true, get: function() { return m[k]; } };
  5231. }
  5232. Object.defineProperty(o, k2, desc);
  5233. }) : (function(o, m, k, k2) {
  5234. if (k2 === undefined) k2 = k;
  5235. o[k2] = m[k];
  5236. }));
  5237. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  5238. Object.defineProperty(o, "default", { enumerable: true, value: v });
  5239. }) : function(o, v) {
  5240. o["default"] = v;
  5241. });
  5242. var __importStar = (this && this.__importStar) || function (mod) {
  5243. if (mod && mod.__esModule) return mod;
  5244. var result = {};
  5245. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  5246. __setModuleDefault(result, mod);
  5247. return result;
  5248. };
  5249. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  5250. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  5251. return new (P || (P = Promise))(function (resolve, reject) {
  5252. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  5253. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  5254. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  5255. step((generator = generator.apply(thisArg, _arguments || [])).next());
  5256. });
  5257. };
  5258. Object.defineProperty(exports, "__esModule", ({ value: true }));
  5259. exports.HttpClient = exports.isHttps = exports.HttpClientResponse = exports.HttpClientError = exports.getProxyUrl = exports.MediaTypes = exports.Headers = exports.HttpCodes = void 0;
  5260. const http = __importStar(__nccwpck_require__(3685));
  5261. const https = __importStar(__nccwpck_require__(5687));
  5262. const pm = __importStar(__nccwpck_require__(9835));
  5263. const tunnel = __importStar(__nccwpck_require__(4294));
  5264. const undici_1 = __nccwpck_require__(1773);
  5265. var HttpCodes;
  5266. (function (HttpCodes) {
  5267. HttpCodes[HttpCodes["OK"] = 200] = "OK";
  5268. HttpCodes[HttpCodes["MultipleChoices"] = 300] = "MultipleChoices";
  5269. HttpCodes[HttpCodes["MovedPermanently"] = 301] = "MovedPermanently";
  5270. HttpCodes[HttpCodes["ResourceMoved"] = 302] = "ResourceMoved";
  5271. HttpCodes[HttpCodes["SeeOther"] = 303] = "SeeOther";
  5272. HttpCodes[HttpCodes["NotModified"] = 304] = "NotModified";
  5273. HttpCodes[HttpCodes["UseProxy"] = 305] = "UseProxy";
  5274. HttpCodes[HttpCodes["SwitchProxy"] = 306] = "SwitchProxy";
  5275. HttpCodes[HttpCodes["TemporaryRedirect"] = 307] = "TemporaryRedirect";
  5276. HttpCodes[HttpCodes["PermanentRedirect"] = 308] = "PermanentRedirect";
  5277. HttpCodes[HttpCodes["BadRequest"] = 400] = "BadRequest";
  5278. HttpCodes[HttpCodes["Unauthorized"] = 401] = "Unauthorized";
  5279. HttpCodes[HttpCodes["PaymentRequired"] = 402] = "PaymentRequired";
  5280. HttpCodes[HttpCodes["Forbidden"] = 403] = "Forbidden";
  5281. HttpCodes[HttpCodes["NotFound"] = 404] = "NotFound";
  5282. HttpCodes[HttpCodes["MethodNotAllowed"] = 405] = "MethodNotAllowed";
  5283. HttpCodes[HttpCodes["NotAcceptable"] = 406] = "NotAcceptable";
  5284. HttpCodes[HttpCodes["ProxyAuthenticationRequired"] = 407] = "ProxyAuthenticationRequired";
  5285. HttpCodes[HttpCodes["RequestTimeout"] = 408] = "RequestTimeout";
  5286. HttpCodes[HttpCodes["Conflict"] = 409] = "Conflict";
  5287. HttpCodes[HttpCodes["Gone"] = 410] = "Gone";
  5288. HttpCodes[HttpCodes["TooManyRequests"] = 429] = "TooManyRequests";
  5289. HttpCodes[HttpCodes["InternalServerError"] = 500] = "InternalServerError";
  5290. HttpCodes[HttpCodes["NotImplemented"] = 501] = "NotImplemented";
  5291. HttpCodes[HttpCodes["BadGateway"] = 502] = "BadGateway";
  5292. HttpCodes[HttpCodes["ServiceUnavailable"] = 503] = "ServiceUnavailable";
  5293. HttpCodes[HttpCodes["GatewayTimeout"] = 504] = "GatewayTimeout";
  5294. })(HttpCodes || (exports.HttpCodes = HttpCodes = {}));
  5295. var Headers;
  5296. (function (Headers) {
  5297. Headers["Accept"] = "accept";
  5298. Headers["ContentType"] = "content-type";
  5299. })(Headers || (exports.Headers = Headers = {}));
  5300. var MediaTypes;
  5301. (function (MediaTypes) {
  5302. MediaTypes["ApplicationJson"] = "application/json";
  5303. })(MediaTypes || (exports.MediaTypes = MediaTypes = {}));
  5304. /**
  5305. * Returns the proxy URL, depending upon the supplied url and proxy environment variables.
  5306. * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com
  5307. */
  5308. function getProxyUrl(serverUrl) {
  5309. const proxyUrl = pm.getProxyUrl(new URL(serverUrl));
  5310. return proxyUrl ? proxyUrl.href : '';
  5311. }
  5312. exports.getProxyUrl = getProxyUrl;
  5313. const HttpRedirectCodes = [
  5314. HttpCodes.MovedPermanently,
  5315. HttpCodes.ResourceMoved,
  5316. HttpCodes.SeeOther,
  5317. HttpCodes.TemporaryRedirect,
  5318. HttpCodes.PermanentRedirect
  5319. ];
  5320. const HttpResponseRetryCodes = [
  5321. HttpCodes.BadGateway,
  5322. HttpCodes.ServiceUnavailable,
  5323. HttpCodes.GatewayTimeout
  5324. ];
  5325. const RetryableHttpVerbs = ['OPTIONS', 'GET', 'DELETE', 'HEAD'];
  5326. const ExponentialBackoffCeiling = 10;
  5327. const ExponentialBackoffTimeSlice = 5;
  5328. class HttpClientError extends Error {
  5329. constructor(message, statusCode) {
  5330. super(message);
  5331. this.name = 'HttpClientError';
  5332. this.statusCode = statusCode;
  5333. Object.setPrototypeOf(this, HttpClientError.prototype);
  5334. }
  5335. }
  5336. exports.HttpClientError = HttpClientError;
  5337. class HttpClientResponse {
  5338. constructor(message) {
  5339. this.message = message;
  5340. }
  5341. readBody() {
  5342. return __awaiter(this, void 0, void 0, function* () {
  5343. return new Promise((resolve) => __awaiter(this, void 0, void 0, function* () {
  5344. let output = Buffer.alloc(0);
  5345. this.message.on('data', (chunk) => {
  5346. output = Buffer.concat([output, chunk]);
  5347. });
  5348. this.message.on('end', () => {
  5349. resolve(output.toString());
  5350. });
  5351. }));
  5352. });
  5353. }
  5354. readBodyBuffer() {
  5355. return __awaiter(this, void 0, void 0, function* () {
  5356. return new Promise((resolve) => __awaiter(this, void 0, void 0, function* () {
  5357. const chunks = [];
  5358. this.message.on('data', (chunk) => {
  5359. chunks.push(chunk);
  5360. });
  5361. this.message.on('end', () => {
  5362. resolve(Buffer.concat(chunks));
  5363. });
  5364. }));
  5365. });
  5366. }
  5367. }
  5368. exports.HttpClientResponse = HttpClientResponse;
  5369. function isHttps(requestUrl) {
  5370. const parsedUrl = new URL(requestUrl);
  5371. return parsedUrl.protocol === 'https:';
  5372. }
  5373. exports.isHttps = isHttps;
  5374. class HttpClient {
  5375. constructor(userAgent, handlers, requestOptions) {
  5376. this._ignoreSslError = false;
  5377. this._allowRedirects = true;
  5378. this._allowRedirectDowngrade = false;
  5379. this._maxRedirects = 50;
  5380. this._allowRetries = false;
  5381. this._maxRetries = 1;
  5382. this._keepAlive = false;
  5383. this._disposed = false;
  5384. this.userAgent = userAgent;
  5385. this.handlers = handlers || [];
  5386. this.requestOptions = requestOptions;
  5387. if (requestOptions) {
  5388. if (requestOptions.ignoreSslError != null) {
  5389. this._ignoreSslError = requestOptions.ignoreSslError;
  5390. }
  5391. this._socketTimeout = requestOptions.socketTimeout;
  5392. if (requestOptions.allowRedirects != null) {
  5393. this._allowRedirects = requestOptions.allowRedirects;
  5394. }
  5395. if (requestOptions.allowRedirectDowngrade != null) {
  5396. this._allowRedirectDowngrade = requestOptions.allowRedirectDowngrade;
  5397. }
  5398. if (requestOptions.maxRedirects != null) {
  5399. this._maxRedirects = Math.max(requestOptions.maxRedirects, 0);
  5400. }
  5401. if (requestOptions.keepAlive != null) {
  5402. this._keepAlive = requestOptions.keepAlive;
  5403. }
  5404. if (requestOptions.allowRetries != null) {
  5405. this._allowRetries = requestOptions.allowRetries;
  5406. }
  5407. if (requestOptions.maxRetries != null) {
  5408. this._maxRetries = requestOptions.maxRetries;
  5409. }
  5410. }
  5411. }
  5412. options(requestUrl, additionalHeaders) {
  5413. return __awaiter(this, void 0, void 0, function* () {
  5414. return this.request('OPTIONS', requestUrl, null, additionalHeaders || {});
  5415. });
  5416. }
  5417. get(requestUrl, additionalHeaders) {
  5418. return __awaiter(this, void 0, void 0, function* () {
  5419. return this.request('GET', requestUrl, null, additionalHeaders || {});
  5420. });
  5421. }
  5422. del(requestUrl, additionalHeaders) {
  5423. return __awaiter(this, void 0, void 0, function* () {
  5424. return this.request('DELETE', requestUrl, null, additionalHeaders || {});
  5425. });
  5426. }
  5427. post(requestUrl, data, additionalHeaders) {
  5428. return __awaiter(this, void 0, void 0, function* () {
  5429. return this.request('POST', requestUrl, data, additionalHeaders || {});
  5430. });
  5431. }
  5432. patch(requestUrl, data, additionalHeaders) {
  5433. return __awaiter(this, void 0, void 0, function* () {
  5434. return this.request('PATCH', requestUrl, data, additionalHeaders || {});
  5435. });
  5436. }
  5437. put(requestUrl, data, additionalHeaders) {
  5438. return __awaiter(this, void 0, void 0, function* () {
  5439. return this.request('PUT', requestUrl, data, additionalHeaders || {});
  5440. });
  5441. }
  5442. head(requestUrl, additionalHeaders) {
  5443. return __awaiter(this, void 0, void 0, function* () {
  5444. return this.request('HEAD', requestUrl, null, additionalHeaders || {});
  5445. });
  5446. }
  5447. sendStream(verb, requestUrl, stream, additionalHeaders) {
  5448. return __awaiter(this, void 0, void 0, function* () {
  5449. return this.request(verb, requestUrl, stream, additionalHeaders);
  5450. });
  5451. }
  5452. /**
  5453. * Gets a typed object from an endpoint
  5454. * Be aware that not found returns a null. Other errors (4xx, 5xx) reject the promise
  5455. */
  5456. getJson(requestUrl, additionalHeaders = {}) {
  5457. return __awaiter(this, void 0, void 0, function* () {
  5458. additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
  5459. const res = yield this.get(requestUrl, additionalHeaders);
  5460. return this._processResponse(res, this.requestOptions);
  5461. });
  5462. }
  5463. postJson(requestUrl, obj, additionalHeaders = {}) {
  5464. return __awaiter(this, void 0, void 0, function* () {
  5465. const data = JSON.stringify(obj, null, 2);
  5466. additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
  5467. additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);
  5468. const res = yield this.post(requestUrl, data, additionalHeaders);
  5469. return this._processResponse(res, this.requestOptions);
  5470. });
  5471. }
  5472. putJson(requestUrl, obj, additionalHeaders = {}) {
  5473. return __awaiter(this, void 0, void 0, function* () {
  5474. const data = JSON.stringify(obj, null, 2);
  5475. additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
  5476. additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);
  5477. const res = yield this.put(requestUrl, data, additionalHeaders);
  5478. return this._processResponse(res, this.requestOptions);
  5479. });
  5480. }
  5481. patchJson(requestUrl, obj, additionalHeaders = {}) {
  5482. return __awaiter(this, void 0, void 0, function* () {
  5483. const data = JSON.stringify(obj, null, 2);
  5484. additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
  5485. additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);
  5486. const res = yield this.patch(requestUrl, data, additionalHeaders);
  5487. return this._processResponse(res, this.requestOptions);
  5488. });
  5489. }
  5490. /**
  5491. * Makes a raw http request.
  5492. * All other methods such as get, post, patch, and request ultimately call this.
  5493. * Prefer get, del, post and patch
  5494. */
  5495. request(verb, requestUrl, data, headers) {
  5496. return __awaiter(this, void 0, void 0, function* () {
  5497. if (this._disposed) {
  5498. throw new Error('Client has already been disposed.');
  5499. }
  5500. const parsedUrl = new URL(requestUrl);
  5501. let info = this._prepareRequest(verb, parsedUrl, headers);
  5502. // Only perform retries on reads since writes may not be idempotent.
  5503. const maxTries = this._allowRetries && RetryableHttpVerbs.includes(verb)
  5504. ? this._maxRetries + 1
  5505. : 1;
  5506. let numTries = 0;
  5507. let response;
  5508. do {
  5509. response = yield this.requestRaw(info, data);
  5510. // Check if it's an authentication challenge
  5511. if (response &&
  5512. response.message &&
  5513. response.message.statusCode === HttpCodes.Unauthorized) {
  5514. let authenticationHandler;
  5515. for (const handler of this.handlers) {
  5516. if (handler.canHandleAuthentication(response)) {
  5517. authenticationHandler = handler;
  5518. break;
  5519. }
  5520. }
  5521. if (authenticationHandler) {
  5522. return authenticationHandler.handleAuthentication(this, info, data);
  5523. }
  5524. else {
  5525. // We have received an unauthorized response but have no handlers to handle it.
  5526. // Let the response return to the caller.
  5527. return response;
  5528. }
  5529. }
  5530. let redirectsRemaining = this._maxRedirects;
  5531. while (response.message.statusCode &&
  5532. HttpRedirectCodes.includes(response.message.statusCode) &&
  5533. this._allowRedirects &&
  5534. redirectsRemaining > 0) {
  5535. const redirectUrl = response.message.headers['location'];
  5536. if (!redirectUrl) {
  5537. // if there's no location to redirect to, we won't
  5538. break;
  5539. }
  5540. const parsedRedirectUrl = new URL(redirectUrl);
  5541. if (parsedUrl.protocol === 'https:' &&
  5542. parsedUrl.protocol !== parsedRedirectUrl.protocol &&
  5543. !this._allowRedirectDowngrade) {
  5544. 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.');
  5545. }
  5546. // we need to finish reading the response before reassigning response
  5547. // which will leak the open socket.
  5548. yield response.readBody();
  5549. // strip authorization header if redirected to a different hostname
  5550. if (parsedRedirectUrl.hostname !== parsedUrl.hostname) {
  5551. for (const header in headers) {
  5552. // header names are case insensitive
  5553. if (header.toLowerCase() === 'authorization') {
  5554. delete headers[header];
  5555. }
  5556. }
  5557. }
  5558. // let's make the request with the new redirectUrl
  5559. info = this._prepareRequest(verb, parsedRedirectUrl, headers);
  5560. response = yield this.requestRaw(info, data);
  5561. redirectsRemaining--;
  5562. }
  5563. if (!response.message.statusCode ||
  5564. !HttpResponseRetryCodes.includes(response.message.statusCode)) {
  5565. // If not a retry code, return immediately instead of retrying
  5566. return response;
  5567. }
  5568. numTries += 1;
  5569. if (numTries < maxTries) {
  5570. yield response.readBody();
  5571. yield this._performExponentialBackoff(numTries);
  5572. }
  5573. } while (numTries < maxTries);
  5574. return response;
  5575. });
  5576. }
  5577. /**
  5578. * Needs to be called if keepAlive is set to true in request options.
  5579. */
  5580. dispose() {
  5581. if (this._agent) {
  5582. this._agent.destroy();
  5583. }
  5584. this._disposed = true;
  5585. }
  5586. /**
  5587. * Raw request.
  5588. * @param info
  5589. * @param data
  5590. */
  5591. requestRaw(info, data) {
  5592. return __awaiter(this, void 0, void 0, function* () {
  5593. return new Promise((resolve, reject) => {
  5594. function callbackForResult(err, res) {
  5595. if (err) {
  5596. reject(err);
  5597. }
  5598. else if (!res) {
  5599. // If `err` is not passed, then `res` must be passed.
  5600. reject(new Error('Unknown error'));
  5601. }
  5602. else {
  5603. resolve(res);
  5604. }
  5605. }
  5606. this.requestRawWithCallback(info, data, callbackForResult);
  5607. });
  5608. });
  5609. }
  5610. /**
  5611. * Raw request with callback.
  5612. * @param info
  5613. * @param data
  5614. * @param onResult
  5615. */
  5616. requestRawWithCallback(info, data, onResult) {
  5617. if (typeof data === 'string') {
  5618. if (!info.options.headers) {
  5619. info.options.headers = {};
  5620. }
  5621. info.options.headers['Content-Length'] = Buffer.byteLength(data, 'utf8');
  5622. }
  5623. let callbackCalled = false;
  5624. function handleResult(err, res) {
  5625. if (!callbackCalled) {
  5626. callbackCalled = true;
  5627. onResult(err, res);
  5628. }
  5629. }
  5630. const req = info.httpModule.request(info.options, (msg) => {
  5631. const res = new HttpClientResponse(msg);
  5632. handleResult(undefined, res);
  5633. });
  5634. let socket;
  5635. req.on('socket', sock => {
  5636. socket = sock;
  5637. });
  5638. // If we ever get disconnected, we want the socket to timeout eventually
  5639. req.setTimeout(this._socketTimeout || 3 * 60000, () => {
  5640. if (socket) {
  5641. socket.end();
  5642. }
  5643. handleResult(new Error(`Request timeout: ${info.options.path}`));
  5644. });
  5645. req.on('error', function (err) {
  5646. // err has statusCode property
  5647. // res should have headers
  5648. handleResult(err);
  5649. });
  5650. if (data && typeof data === 'string') {
  5651. req.write(data, 'utf8');
  5652. }
  5653. if (data && typeof data !== 'string') {
  5654. data.on('close', function () {
  5655. req.end();
  5656. });
  5657. data.pipe(req);
  5658. }
  5659. else {
  5660. req.end();
  5661. }
  5662. }
  5663. /**
  5664. * Gets an http agent. This function is useful when you need an http agent that handles
  5665. * routing through a proxy server - depending upon the url and proxy environment variables.
  5666. * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com
  5667. */
  5668. getAgent(serverUrl) {
  5669. const parsedUrl = new URL(serverUrl);
  5670. return this._getAgent(parsedUrl);
  5671. }
  5672. getAgentDispatcher(serverUrl) {
  5673. const parsedUrl = new URL(serverUrl);
  5674. const proxyUrl = pm.getProxyUrl(parsedUrl);
  5675. const useProxy = proxyUrl && proxyUrl.hostname;
  5676. if (!useProxy) {
  5677. return;
  5678. }
  5679. return this._getProxyAgentDispatcher(parsedUrl, proxyUrl);
  5680. }
  5681. _prepareRequest(method, requestUrl, headers) {
  5682. const info = {};
  5683. info.parsedUrl = requestUrl;
  5684. const usingSsl = info.parsedUrl.protocol === 'https:';
  5685. info.httpModule = usingSsl ? https : http;
  5686. const defaultPort = usingSsl ? 443 : 80;
  5687. info.options = {};
  5688. info.options.host = info.parsedUrl.hostname;
  5689. info.options.port = info.parsedUrl.port
  5690. ? parseInt(info.parsedUrl.port)
  5691. : defaultPort;
  5692. info.options.path =
  5693. (info.parsedUrl.pathname || '') + (info.parsedUrl.search || '');
  5694. info.options.method = method;
  5695. info.options.headers = this._mergeHeaders(headers);
  5696. if (this.userAgent != null) {
  5697. info.options.headers['user-agent'] = this.userAgent;
  5698. }
  5699. info.options.agent = this._getAgent(info.parsedUrl);
  5700. // gives handlers an opportunity to participate
  5701. if (this.handlers) {
  5702. for (const handler of this.handlers) {
  5703. handler.prepareRequest(info.options);
  5704. }
  5705. }
  5706. return info;
  5707. }
  5708. _mergeHeaders(headers) {
  5709. if (this.requestOptions && this.requestOptions.headers) {
  5710. return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers || {}));
  5711. }
  5712. return lowercaseKeys(headers || {});
  5713. }
  5714. _getExistingOrDefaultHeader(additionalHeaders, header, _default) {
  5715. let clientHeader;
  5716. if (this.requestOptions && this.requestOptions.headers) {
  5717. clientHeader = lowercaseKeys(this.requestOptions.headers)[header];
  5718. }
  5719. return additionalHeaders[header] || clientHeader || _default;
  5720. }
  5721. _getAgent(parsedUrl) {
  5722. let agent;
  5723. const proxyUrl = pm.getProxyUrl(parsedUrl);
  5724. const useProxy = proxyUrl && proxyUrl.hostname;
  5725. if (this._keepAlive && useProxy) {
  5726. agent = this._proxyAgent;
  5727. }
  5728. if (!useProxy) {
  5729. agent = this._agent;
  5730. }
  5731. // if agent is already assigned use that agent.
  5732. if (agent) {
  5733. return agent;
  5734. }
  5735. const usingSsl = parsedUrl.protocol === 'https:';
  5736. let maxSockets = 100;
  5737. if (this.requestOptions) {
  5738. maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets;
  5739. }
  5740. // This is `useProxy` again, but we need to check `proxyURl` directly for TypeScripts's flow analysis.
  5741. if (proxyUrl && proxyUrl.hostname) {
  5742. const agentOptions = {
  5743. maxSockets,
  5744. keepAlive: this._keepAlive,
  5745. proxy: Object.assign(Object.assign({}, ((proxyUrl.username || proxyUrl.password) && {
  5746. proxyAuth: `${proxyUrl.username}:${proxyUrl.password}`
  5747. })), { host: proxyUrl.hostname, port: proxyUrl.port })
  5748. };
  5749. let tunnelAgent;
  5750. const overHttps = proxyUrl.protocol === 'https:';
  5751. if (usingSsl) {
  5752. tunnelAgent = overHttps ? tunnel.httpsOverHttps : tunnel.httpsOverHttp;
  5753. }
  5754. else {
  5755. tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp;
  5756. }
  5757. agent = tunnelAgent(agentOptions);
  5758. this._proxyAgent = agent;
  5759. }
  5760. // if tunneling agent isn't assigned create a new agent
  5761. if (!agent) {
  5762. const options = { keepAlive: this._keepAlive, maxSockets };
  5763. agent = usingSsl ? new https.Agent(options) : new http.Agent(options);
  5764. this._agent = agent;
  5765. }
  5766. if (usingSsl && this._ignoreSslError) {
  5767. // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process
  5768. // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options
  5769. // we have to cast it to any and change it directly
  5770. agent.options = Object.assign(agent.options || {}, {
  5771. rejectUnauthorized: false
  5772. });
  5773. }
  5774. return agent;
  5775. }
  5776. _getProxyAgentDispatcher(parsedUrl, proxyUrl) {
  5777. let proxyAgent;
  5778. if (this._keepAlive) {
  5779. proxyAgent = this._proxyAgentDispatcher;
  5780. }
  5781. // if agent is already assigned use that agent.
  5782. if (proxyAgent) {
  5783. return proxyAgent;
  5784. }
  5785. const usingSsl = parsedUrl.protocol === 'https:';
  5786. proxyAgent = new undici_1.ProxyAgent(Object.assign({ uri: proxyUrl.href, pipelining: !this._keepAlive ? 0 : 1 }, ((proxyUrl.username || proxyUrl.password) && {
  5787. token: `${proxyUrl.username}:${proxyUrl.password}`
  5788. })));
  5789. this._proxyAgentDispatcher = proxyAgent;
  5790. if (usingSsl && this._ignoreSslError) {
  5791. // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process
  5792. // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options
  5793. // we have to cast it to any and change it directly
  5794. proxyAgent.options = Object.assign(proxyAgent.options.requestTls || {}, {
  5795. rejectUnauthorized: false
  5796. });
  5797. }
  5798. return proxyAgent;
  5799. }
  5800. _performExponentialBackoff(retryNumber) {
  5801. return __awaiter(this, void 0, void 0, function* () {
  5802. retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber);
  5803. const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber);
  5804. return new Promise(resolve => setTimeout(() => resolve(), ms));
  5805. });
  5806. }
  5807. _processResponse(res, options) {
  5808. return __awaiter(this, void 0, void 0, function* () {
  5809. return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
  5810. const statusCode = res.message.statusCode || 0;
  5811. const response = {
  5812. statusCode,
  5813. result: null,
  5814. headers: {}
  5815. };
  5816. // not found leads to null obj returned
  5817. if (statusCode === HttpCodes.NotFound) {
  5818. resolve(response);
  5819. }
  5820. // get the result from the body
  5821. function dateTimeDeserializer(key, value) {
  5822. if (typeof value === 'string') {
  5823. const a = new Date(value);
  5824. if (!isNaN(a.valueOf())) {
  5825. return a;
  5826. }
  5827. }
  5828. return value;
  5829. }
  5830. let obj;
  5831. let contents;
  5832. try {
  5833. contents = yield res.readBody();
  5834. if (contents && contents.length > 0) {
  5835. if (options && options.deserializeDates) {
  5836. obj = JSON.parse(contents, dateTimeDeserializer);
  5837. }
  5838. else {
  5839. obj = JSON.parse(contents);
  5840. }
  5841. response.result = obj;
  5842. }
  5843. response.headers = res.message.headers;
  5844. }
  5845. catch (err) {
  5846. // Invalid resource (contents not json); leaving result obj null
  5847. }
  5848. // note that 3xx redirects are handled by the http layer.
  5849. if (statusCode > 299) {
  5850. let msg;
  5851. // if exception/error in body, attempt to get better error
  5852. if (obj && obj.message) {
  5853. msg = obj.message;
  5854. }
  5855. else if (contents && contents.length > 0) {
  5856. // it may be the case that the exception is in the body message as string
  5857. msg = contents;
  5858. }
  5859. else {
  5860. msg = `Failed request: (${statusCode})`;
  5861. }
  5862. const err = new HttpClientError(msg, statusCode);
  5863. err.result = response.result;
  5864. reject(err);
  5865. }
  5866. else {
  5867. resolve(response);
  5868. }
  5869. }));
  5870. });
  5871. }
  5872. }
  5873. exports.HttpClient = HttpClient;
  5874. const lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCase()] = obj[k]), c), {});
  5875. //# sourceMappingURL=index.js.map
  5876. /***/ }),
  5877. /***/ 9835:
  5878. /***/ ((__unused_webpack_module, exports) => {
  5879. "use strict";
  5880. Object.defineProperty(exports, "__esModule", ({ value: true }));
  5881. exports.checkBypass = exports.getProxyUrl = void 0;
  5882. function getProxyUrl(reqUrl) {
  5883. const usingSsl = reqUrl.protocol === 'https:';
  5884. if (checkBypass(reqUrl)) {
  5885. return undefined;
  5886. }
  5887. const proxyVar = (() => {
  5888. if (usingSsl) {
  5889. return process.env['https_proxy'] || process.env['HTTPS_PROXY'];
  5890. }
  5891. else {
  5892. return process.env['http_proxy'] || process.env['HTTP_PROXY'];
  5893. }
  5894. })();
  5895. if (proxyVar) {
  5896. try {
  5897. return new URL(proxyVar);
  5898. }
  5899. catch (_a) {
  5900. if (!proxyVar.startsWith('http://') && !proxyVar.startsWith('https://'))
  5901. return new URL(`http://${proxyVar}`);
  5902. }
  5903. }
  5904. else {
  5905. return undefined;
  5906. }
  5907. }
  5908. exports.getProxyUrl = getProxyUrl;
  5909. function checkBypass(reqUrl) {
  5910. if (!reqUrl.hostname) {
  5911. return false;
  5912. }
  5913. const reqHost = reqUrl.hostname;
  5914. if (isLoopbackAddress(reqHost)) {
  5915. return true;
  5916. }
  5917. const noProxy = process.env['no_proxy'] || process.env['NO_PROXY'] || '';
  5918. if (!noProxy) {
  5919. return false;
  5920. }
  5921. // Determine the request port
  5922. let reqPort;
  5923. if (reqUrl.port) {
  5924. reqPort = Number(reqUrl.port);
  5925. }
  5926. else if (reqUrl.protocol === 'http:') {
  5927. reqPort = 80;
  5928. }
  5929. else if (reqUrl.protocol === 'https:') {
  5930. reqPort = 443;
  5931. }
  5932. // Format the request hostname and hostname with port
  5933. const upperReqHosts = [reqUrl.hostname.toUpperCase()];
  5934. if (typeof reqPort === 'number') {
  5935. upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`);
  5936. }
  5937. // Compare request host against noproxy
  5938. for (const upperNoProxyItem of noProxy
  5939. .split(',')
  5940. .map(x => x.trim().toUpperCase())
  5941. .filter(x => x)) {
  5942. if (upperNoProxyItem === '*' ||
  5943. upperReqHosts.some(x => x === upperNoProxyItem ||
  5944. x.endsWith(`.${upperNoProxyItem}`) ||
  5945. (upperNoProxyItem.startsWith('.') &&
  5946. x.endsWith(`${upperNoProxyItem}`)))) {
  5947. return true;
  5948. }
  5949. }
  5950. return false;
  5951. }
  5952. exports.checkBypass = checkBypass;
  5953. function isLoopbackAddress(host) {
  5954. const hostLower = host.toLowerCase();
  5955. return (hostLower === 'localhost' ||
  5956. hostLower.startsWith('127.') ||
  5957. hostLower.startsWith('[::1]') ||
  5958. hostLower.startsWith('[0:0:0:0:0:0:0:1]'));
  5959. }
  5960. //# sourceMappingURL=proxy.js.map
  5961. /***/ }),
  5962. /***/ 1962:
  5963. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  5964. "use strict";
  5965. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  5966. if (k2 === undefined) k2 = k;
  5967. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  5968. }) : (function(o, m, k, k2) {
  5969. if (k2 === undefined) k2 = k;
  5970. o[k2] = m[k];
  5971. }));
  5972. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  5973. Object.defineProperty(o, "default", { enumerable: true, value: v });
  5974. }) : function(o, v) {
  5975. o["default"] = v;
  5976. });
  5977. var __importStar = (this && this.__importStar) || function (mod) {
  5978. if (mod && mod.__esModule) return mod;
  5979. var result = {};
  5980. if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  5981. __setModuleDefault(result, mod);
  5982. return result;
  5983. };
  5984. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  5985. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  5986. return new (P || (P = Promise))(function (resolve, reject) {
  5987. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  5988. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  5989. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  5990. step((generator = generator.apply(thisArg, _arguments || [])).next());
  5991. });
  5992. };
  5993. var _a;
  5994. Object.defineProperty(exports, "__esModule", ({ value: true }));
  5995. 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;
  5996. const fs = __importStar(__nccwpck_require__(7147));
  5997. const path = __importStar(__nccwpck_require__(1017));
  5998. _a = fs.promises
  5999. // export const {open} = 'fs'
  6000. , 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;
  6001. // export const {open} = 'fs'
  6002. exports.IS_WINDOWS = process.platform === 'win32';
  6003. // See https://github.com/nodejs/node/blob/d0153aee367422d0858105abec186da4dff0a0c5/deps/uv/include/uv/win.h#L691
  6004. exports.UV_FS_O_EXLOCK = 0x10000000;
  6005. exports.READONLY = fs.constants.O_RDONLY;
  6006. function exists(fsPath) {
  6007. return __awaiter(this, void 0, void 0, function* () {
  6008. try {
  6009. yield exports.stat(fsPath);
  6010. }
  6011. catch (err) {
  6012. if (err.code === 'ENOENT') {
  6013. return false;
  6014. }
  6015. throw err;
  6016. }
  6017. return true;
  6018. });
  6019. }
  6020. exports.exists = exists;
  6021. function isDirectory(fsPath, useStat = false) {
  6022. return __awaiter(this, void 0, void 0, function* () {
  6023. const stats = useStat ? yield exports.stat(fsPath) : yield exports.lstat(fsPath);
  6024. return stats.isDirectory();
  6025. });
  6026. }
  6027. exports.isDirectory = isDirectory;
  6028. /**
  6029. * On OSX/Linux, true if path starts with '/'. On Windows, true for paths like:
  6030. * \, \hello, \\hello\share, C:, and C:\hello (and corresponding alternate separator cases).
  6031. */
  6032. function isRooted(p) {
  6033. p = normalizeSeparators(p);
  6034. if (!p) {
  6035. throw new Error('isRooted() parameter "p" cannot be empty');
  6036. }
  6037. if (exports.IS_WINDOWS) {
  6038. return (p.startsWith('\\') || /^[A-Z]:/i.test(p) // e.g. \ or \hello or \\hello
  6039. ); // e.g. C: or C:\hello
  6040. }
  6041. return p.startsWith('/');
  6042. }
  6043. exports.isRooted = isRooted;
  6044. /**
  6045. * Best effort attempt to determine whether a file exists and is executable.
  6046. * @param filePath file path to check
  6047. * @param extensions additional file extensions to try
  6048. * @return if file exists and is executable, returns the file path. otherwise empty string.
  6049. */
  6050. function tryGetExecutablePath(filePath, extensions) {
  6051. return __awaiter(this, void 0, void 0, function* () {
  6052. let stats = undefined;
  6053. try {
  6054. // test file exists
  6055. stats = yield exports.stat(filePath);
  6056. }
  6057. catch (err) {
  6058. if (err.code !== 'ENOENT') {
  6059. // eslint-disable-next-line no-console
  6060. console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`);
  6061. }
  6062. }
  6063. if (stats && stats.isFile()) {
  6064. if (exports.IS_WINDOWS) {
  6065. // on Windows, test for valid extension
  6066. const upperExt = path.extname(filePath).toUpperCase();
  6067. if (extensions.some(validExt => validExt.toUpperCase() === upperExt)) {
  6068. return filePath;
  6069. }
  6070. }
  6071. else {
  6072. if (isUnixExecutable(stats)) {
  6073. return filePath;
  6074. }
  6075. }
  6076. }
  6077. // try each extension
  6078. const originalFilePath = filePath;
  6079. for (const extension of extensions) {
  6080. filePath = originalFilePath + extension;
  6081. stats = undefined;
  6082. try {
  6083. stats = yield exports.stat(filePath);
  6084. }
  6085. catch (err) {
  6086. if (err.code !== 'ENOENT') {
  6087. // eslint-disable-next-line no-console
  6088. console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`);
  6089. }
  6090. }
  6091. if (stats && stats.isFile()) {
  6092. if (exports.IS_WINDOWS) {
  6093. // preserve the case of the actual file (since an extension was appended)
  6094. try {
  6095. const directory = path.dirname(filePath);
  6096. const upperName = path.basename(filePath).toUpperCase();
  6097. for (const actualName of yield exports.readdir(directory)) {
  6098. if (upperName === actualName.toUpperCase()) {
  6099. filePath = path.join(directory, actualName);
  6100. break;
  6101. }
  6102. }
  6103. }
  6104. catch (err) {
  6105. // eslint-disable-next-line no-console
  6106. console.log(`Unexpected error attempting to determine the actual case of the file '${filePath}': ${err}`);
  6107. }
  6108. return filePath;
  6109. }
  6110. else {
  6111. if (isUnixExecutable(stats)) {
  6112. return filePath;
  6113. }
  6114. }
  6115. }
  6116. }
  6117. return '';
  6118. });
  6119. }
  6120. exports.tryGetExecutablePath = tryGetExecutablePath;
  6121. function normalizeSeparators(p) {
  6122. p = p || '';
  6123. if (exports.IS_WINDOWS) {
  6124. // convert slashes on Windows
  6125. p = p.replace(/\//g, '\\');
  6126. // remove redundant slashes
  6127. return p.replace(/\\\\+/g, '\\');
  6128. }
  6129. // remove redundant slashes
  6130. return p.replace(/\/\/+/g, '/');
  6131. }
  6132. // on Mac/Linux, test the execute bit
  6133. // R W X R W X R W X
  6134. // 256 128 64 32 16 8 4 2 1
  6135. function isUnixExecutable(stats) {
  6136. return ((stats.mode & 1) > 0 ||
  6137. ((stats.mode & 8) > 0 && stats.gid === process.getgid()) ||
  6138. ((stats.mode & 64) > 0 && stats.uid === process.getuid()));
  6139. }
  6140. // Get the path of cmd.exe in windows
  6141. function getCmdPath() {
  6142. var _a;
  6143. return (_a = process.env['COMSPEC']) !== null && _a !== void 0 ? _a : `cmd.exe`;
  6144. }
  6145. exports.getCmdPath = getCmdPath;
  6146. //# sourceMappingURL=io-util.js.map
  6147. /***/ }),
  6148. /***/ 7436:
  6149. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  6150. "use strict";
  6151. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  6152. if (k2 === undefined) k2 = k;
  6153. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  6154. }) : (function(o, m, k, k2) {
  6155. if (k2 === undefined) k2 = k;
  6156. o[k2] = m[k];
  6157. }));
  6158. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  6159. Object.defineProperty(o, "default", { enumerable: true, value: v });
  6160. }) : function(o, v) {
  6161. o["default"] = v;
  6162. });
  6163. var __importStar = (this && this.__importStar) || function (mod) {
  6164. if (mod && mod.__esModule) return mod;
  6165. var result = {};
  6166. if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  6167. __setModuleDefault(result, mod);
  6168. return result;
  6169. };
  6170. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  6171. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  6172. return new (P || (P = Promise))(function (resolve, reject) {
  6173. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  6174. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  6175. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  6176. step((generator = generator.apply(thisArg, _arguments || [])).next());
  6177. });
  6178. };
  6179. Object.defineProperty(exports, "__esModule", ({ value: true }));
  6180. exports.findInPath = exports.which = exports.mkdirP = exports.rmRF = exports.mv = exports.cp = void 0;
  6181. const assert_1 = __nccwpck_require__(9491);
  6182. const path = __importStar(__nccwpck_require__(1017));
  6183. const ioUtil = __importStar(__nccwpck_require__(1962));
  6184. /**
  6185. * Copies a file or folder.
  6186. * Based off of shelljs - https://github.com/shelljs/shelljs/blob/9237f66c52e5daa40458f94f9565e18e8132f5a6/src/cp.js
  6187. *
  6188. * @param source source path
  6189. * @param dest destination path
  6190. * @param options optional. See CopyOptions.
  6191. */
  6192. function cp(source, dest, options = {}) {
  6193. return __awaiter(this, void 0, void 0, function* () {
  6194. const { force, recursive, copySourceDirectory } = readCopyOptions(options);
  6195. const destStat = (yield ioUtil.exists(dest)) ? yield ioUtil.stat(dest) : null;
  6196. // Dest is an existing file, but not forcing
  6197. if (destStat && destStat.isFile() && !force) {
  6198. return;
  6199. }
  6200. // If dest is an existing directory, should copy inside.
  6201. const newDest = destStat && destStat.isDirectory() && copySourceDirectory
  6202. ? path.join(dest, path.basename(source))
  6203. : dest;
  6204. if (!(yield ioUtil.exists(source))) {
  6205. throw new Error(`no such file or directory: ${source}`);
  6206. }
  6207. const sourceStat = yield ioUtil.stat(source);
  6208. if (sourceStat.isDirectory()) {
  6209. if (!recursive) {
  6210. throw new Error(`Failed to copy. ${source} is a directory, but tried to copy without recursive flag.`);
  6211. }
  6212. else {
  6213. yield cpDirRecursive(source, newDest, 0, force);
  6214. }
  6215. }
  6216. else {
  6217. if (path.relative(source, newDest) === '') {
  6218. // a file cannot be copied to itself
  6219. throw new Error(`'${newDest}' and '${source}' are the same file`);
  6220. }
  6221. yield copyFile(source, newDest, force);
  6222. }
  6223. });
  6224. }
  6225. exports.cp = cp;
  6226. /**
  6227. * Moves a path.
  6228. *
  6229. * @param source source path
  6230. * @param dest destination path
  6231. * @param options optional. See MoveOptions.
  6232. */
  6233. function mv(source, dest, options = {}) {
  6234. return __awaiter(this, void 0, void 0, function* () {
  6235. if (yield ioUtil.exists(dest)) {
  6236. let destExists = true;
  6237. if (yield ioUtil.isDirectory(dest)) {
  6238. // If dest is directory copy src into dest
  6239. dest = path.join(dest, path.basename(source));
  6240. destExists = yield ioUtil.exists(dest);
  6241. }
  6242. if (destExists) {
  6243. if (options.force == null || options.force) {
  6244. yield rmRF(dest);
  6245. }
  6246. else {
  6247. throw new Error('Destination already exists');
  6248. }
  6249. }
  6250. }
  6251. yield mkdirP(path.dirname(dest));
  6252. yield ioUtil.rename(source, dest);
  6253. });
  6254. }
  6255. exports.mv = mv;
  6256. /**
  6257. * Remove a path recursively with force
  6258. *
  6259. * @param inputPath path to remove
  6260. */
  6261. function rmRF(inputPath) {
  6262. return __awaiter(this, void 0, void 0, function* () {
  6263. if (ioUtil.IS_WINDOWS) {
  6264. // Check for invalid characters
  6265. // https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file
  6266. if (/[*"<>|]/.test(inputPath)) {
  6267. throw new Error('File path must not contain `*`, `"`, `<`, `>` or `|` on Windows');
  6268. }
  6269. }
  6270. try {
  6271. // note if path does not exist, error is silent
  6272. yield ioUtil.rm(inputPath, {
  6273. force: true,
  6274. maxRetries: 3,
  6275. recursive: true,
  6276. retryDelay: 300
  6277. });
  6278. }
  6279. catch (err) {
  6280. throw new Error(`File was unable to be removed ${err}`);
  6281. }
  6282. });
  6283. }
  6284. exports.rmRF = rmRF;
  6285. /**
  6286. * Make a directory. Creates the full path with folders in between
  6287. * Will throw if it fails
  6288. *
  6289. * @param fsPath path to create
  6290. * @returns Promise<void>
  6291. */
  6292. function mkdirP(fsPath) {
  6293. return __awaiter(this, void 0, void 0, function* () {
  6294. assert_1.ok(fsPath, 'a path argument must be provided');
  6295. yield ioUtil.mkdir(fsPath, { recursive: true });
  6296. });
  6297. }
  6298. exports.mkdirP = mkdirP;
  6299. /**
  6300. * Returns path of a tool had the tool actually been invoked. Resolves via paths.
  6301. * If you check and the tool does not exist, it will throw.
  6302. *
  6303. * @param tool name of the tool
  6304. * @param check whether to check if tool exists
  6305. * @returns Promise<string> path to tool
  6306. */
  6307. function which(tool, check) {
  6308. return __awaiter(this, void 0, void 0, function* () {
  6309. if (!tool) {
  6310. throw new Error("parameter 'tool' is required");
  6311. }
  6312. // recursive when check=true
  6313. if (check) {
  6314. const result = yield which(tool, false);
  6315. if (!result) {
  6316. if (ioUtil.IS_WINDOWS) {
  6317. 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.`);
  6318. }
  6319. else {
  6320. 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.`);
  6321. }
  6322. }
  6323. return result;
  6324. }
  6325. const matches = yield findInPath(tool);
  6326. if (matches && matches.length > 0) {
  6327. return matches[0];
  6328. }
  6329. return '';
  6330. });
  6331. }
  6332. exports.which = which;
  6333. /**
  6334. * Returns a list of all occurrences of the given tool on the system path.
  6335. *
  6336. * @returns Promise<string[]> the paths of the tool
  6337. */
  6338. function findInPath(tool) {
  6339. return __awaiter(this, void 0, void 0, function* () {
  6340. if (!tool) {
  6341. throw new Error("parameter 'tool' is required");
  6342. }
  6343. // build the list of extensions to try
  6344. const extensions = [];
  6345. if (ioUtil.IS_WINDOWS && process.env['PATHEXT']) {
  6346. for (const extension of process.env['PATHEXT'].split(path.delimiter)) {
  6347. if (extension) {
  6348. extensions.push(extension);
  6349. }
  6350. }
  6351. }
  6352. // if it's rooted, return it if exists. otherwise return empty.
  6353. if (ioUtil.isRooted(tool)) {
  6354. const filePath = yield ioUtil.tryGetExecutablePath(tool, extensions);
  6355. if (filePath) {
  6356. return [filePath];
  6357. }
  6358. return [];
  6359. }
  6360. // if any path separators, return empty
  6361. if (tool.includes(path.sep)) {
  6362. return [];
  6363. }
  6364. // build the list of directories
  6365. //
  6366. // Note, technically "where" checks the current directory on Windows. From a toolkit perspective,
  6367. // it feels like we should not do this. Checking the current directory seems like more of a use
  6368. // case of a shell, and the which() function exposed by the toolkit should strive for consistency
  6369. // across platforms.
  6370. const directories = [];
  6371. if (process.env.PATH) {
  6372. for (const p of process.env.PATH.split(path.delimiter)) {
  6373. if (p) {
  6374. directories.push(p);
  6375. }
  6376. }
  6377. }
  6378. // find all matches
  6379. const matches = [];
  6380. for (const directory of directories) {
  6381. const filePath = yield ioUtil.tryGetExecutablePath(path.join(directory, tool), extensions);
  6382. if (filePath) {
  6383. matches.push(filePath);
  6384. }
  6385. }
  6386. return matches;
  6387. });
  6388. }
  6389. exports.findInPath = findInPath;
  6390. function readCopyOptions(options) {
  6391. const force = options.force == null ? true : options.force;
  6392. const recursive = Boolean(options.recursive);
  6393. const copySourceDirectory = options.copySourceDirectory == null
  6394. ? true
  6395. : Boolean(options.copySourceDirectory);
  6396. return { force, recursive, copySourceDirectory };
  6397. }
  6398. function cpDirRecursive(sourceDir, destDir, currentDepth, force) {
  6399. return __awaiter(this, void 0, void 0, function* () {
  6400. // Ensure there is not a run away recursive copy
  6401. if (currentDepth >= 255)
  6402. return;
  6403. currentDepth++;
  6404. yield mkdirP(destDir);
  6405. const files = yield ioUtil.readdir(sourceDir);
  6406. for (const fileName of files) {
  6407. const srcFile = `${sourceDir}/${fileName}`;
  6408. const destFile = `${destDir}/${fileName}`;
  6409. const srcFileStat = yield ioUtil.lstat(srcFile);
  6410. if (srcFileStat.isDirectory()) {
  6411. // Recurse
  6412. yield cpDirRecursive(srcFile, destFile, currentDepth, force);
  6413. }
  6414. else {
  6415. yield copyFile(srcFile, destFile, force);
  6416. }
  6417. }
  6418. // Change the mode for the newly created directory
  6419. yield ioUtil.chmod(destDir, (yield ioUtil.stat(sourceDir)).mode);
  6420. });
  6421. }
  6422. // Buffered file copy
  6423. function copyFile(srcFile, destFile, force) {
  6424. return __awaiter(this, void 0, void 0, function* () {
  6425. if ((yield ioUtil.lstat(srcFile)).isSymbolicLink()) {
  6426. // unlink/re-link it
  6427. try {
  6428. yield ioUtil.lstat(destFile);
  6429. yield ioUtil.unlink(destFile);
  6430. }
  6431. catch (e) {
  6432. // Try to override file permission
  6433. if (e.code === 'EPERM') {
  6434. yield ioUtil.chmod(destFile, '0666');
  6435. yield ioUtil.unlink(destFile);
  6436. }
  6437. // other errors = it doesn't exist, no work to do
  6438. }
  6439. // Copy over symlink
  6440. const symlinkFull = yield ioUtil.readlink(srcFile);
  6441. yield ioUtil.symlink(symlinkFull, destFile, ioUtil.IS_WINDOWS ? 'junction' : null);
  6442. }
  6443. else if (!(yield ioUtil.exists(destFile)) || force) {
  6444. yield ioUtil.copyFile(srcFile, destFile);
  6445. }
  6446. });
  6447. }
  6448. //# sourceMappingURL=io.js.map
  6449. /***/ }),
  6450. /***/ 2473:
  6451. /***/ (function(module, exports, __nccwpck_require__) {
  6452. "use strict";
  6453. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  6454. if (k2 === undefined) k2 = k;
  6455. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  6456. }) : (function(o, m, k, k2) {
  6457. if (k2 === undefined) k2 = k;
  6458. o[k2] = m[k];
  6459. }));
  6460. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  6461. Object.defineProperty(o, "default", { enumerable: true, value: v });
  6462. }) : function(o, v) {
  6463. o["default"] = v;
  6464. });
  6465. var __importStar = (this && this.__importStar) || function (mod) {
  6466. if (mod && mod.__esModule) return mod;
  6467. var result = {};
  6468. if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  6469. __setModuleDefault(result, mod);
  6470. return result;
  6471. };
  6472. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  6473. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  6474. return new (P || (P = Promise))(function (resolve, reject) {
  6475. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  6476. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  6477. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  6478. step((generator = generator.apply(thisArg, _arguments || [])).next());
  6479. });
  6480. };
  6481. Object.defineProperty(exports, "__esModule", ({ value: true }));
  6482. exports._readLinuxVersionFile = exports._getOsVersion = exports._findMatch = void 0;
  6483. const semver = __importStar(__nccwpck_require__(5911));
  6484. const core_1 = __nccwpck_require__(2186);
  6485. // needs to be require for core node modules to be mocked
  6486. /* eslint @typescript-eslint/no-require-imports: 0 */
  6487. const os = __nccwpck_require__(2037);
  6488. const cp = __nccwpck_require__(2081);
  6489. const fs = __nccwpck_require__(7147);
  6490. function _findMatch(versionSpec, stable, candidates, archFilter) {
  6491. return __awaiter(this, void 0, void 0, function* () {
  6492. const platFilter = os.platform();
  6493. let result;
  6494. let match;
  6495. let file;
  6496. for (const candidate of candidates) {
  6497. const version = candidate.version;
  6498. core_1.debug(`check ${version} satisfies ${versionSpec}`);
  6499. if (semver.satisfies(version, versionSpec) &&
  6500. (!stable || candidate.stable === stable)) {
  6501. file = candidate.files.find(item => {
  6502. core_1.debug(`${item.arch}===${archFilter} && ${item.platform}===${platFilter}`);
  6503. let chk = item.arch === archFilter && item.platform === platFilter;
  6504. if (chk && item.platform_version) {
  6505. const osVersion = module.exports._getOsVersion();
  6506. if (osVersion === item.platform_version) {
  6507. chk = true;
  6508. }
  6509. else {
  6510. chk = semver.satisfies(osVersion, item.platform_version);
  6511. }
  6512. }
  6513. return chk;
  6514. });
  6515. if (file) {
  6516. core_1.debug(`matched ${candidate.version}`);
  6517. match = candidate;
  6518. break;
  6519. }
  6520. }
  6521. }
  6522. if (match && file) {
  6523. // clone since we're mutating the file list to be only the file that matches
  6524. result = Object.assign({}, match);
  6525. result.files = [file];
  6526. }
  6527. return result;
  6528. });
  6529. }
  6530. exports._findMatch = _findMatch;
  6531. function _getOsVersion() {
  6532. // TODO: add windows and other linux, arm variants
  6533. // right now filtering on version is only an ubuntu and macos scenario for tools we build for hosted (python)
  6534. const plat = os.platform();
  6535. let version = '';
  6536. if (plat === 'darwin') {
  6537. version = cp.execSync('sw_vers -productVersion').toString();
  6538. }
  6539. else if (plat === 'linux') {
  6540. // lsb_release process not in some containers, readfile
  6541. // Run cat /etc/lsb-release
  6542. // DISTRIB_ID=Ubuntu
  6543. // DISTRIB_RELEASE=18.04
  6544. // DISTRIB_CODENAME=bionic
  6545. // DISTRIB_DESCRIPTION="Ubuntu 18.04.4 LTS"
  6546. const lsbContents = module.exports._readLinuxVersionFile();
  6547. if (lsbContents) {
  6548. const lines = lsbContents.split('\n');
  6549. for (const line of lines) {
  6550. const parts = line.split('=');
  6551. if (parts.length === 2 &&
  6552. (parts[0].trim() === 'VERSION_ID' ||
  6553. parts[0].trim() === 'DISTRIB_RELEASE')) {
  6554. version = parts[1]
  6555. .trim()
  6556. .replace(/^"/, '')
  6557. .replace(/"$/, '');
  6558. break;
  6559. }
  6560. }
  6561. }
  6562. }
  6563. return version;
  6564. }
  6565. exports._getOsVersion = _getOsVersion;
  6566. function _readLinuxVersionFile() {
  6567. const lsbReleaseFile = '/etc/lsb-release';
  6568. const osReleaseFile = '/etc/os-release';
  6569. let contents = '';
  6570. if (fs.existsSync(lsbReleaseFile)) {
  6571. contents = fs.readFileSync(lsbReleaseFile).toString();
  6572. }
  6573. else if (fs.existsSync(osReleaseFile)) {
  6574. contents = fs.readFileSync(osReleaseFile).toString();
  6575. }
  6576. return contents;
  6577. }
  6578. exports._readLinuxVersionFile = _readLinuxVersionFile;
  6579. //# sourceMappingURL=manifest.js.map
  6580. /***/ }),
  6581. /***/ 8279:
  6582. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  6583. "use strict";
  6584. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  6585. if (k2 === undefined) k2 = k;
  6586. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  6587. }) : (function(o, m, k, k2) {
  6588. if (k2 === undefined) k2 = k;
  6589. o[k2] = m[k];
  6590. }));
  6591. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  6592. Object.defineProperty(o, "default", { enumerable: true, value: v });
  6593. }) : function(o, v) {
  6594. o["default"] = v;
  6595. });
  6596. var __importStar = (this && this.__importStar) || function (mod) {
  6597. if (mod && mod.__esModule) return mod;
  6598. var result = {};
  6599. if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  6600. __setModuleDefault(result, mod);
  6601. return result;
  6602. };
  6603. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  6604. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  6605. return new (P || (P = Promise))(function (resolve, reject) {
  6606. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  6607. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  6608. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  6609. step((generator = generator.apply(thisArg, _arguments || [])).next());
  6610. });
  6611. };
  6612. Object.defineProperty(exports, "__esModule", ({ value: true }));
  6613. exports.RetryHelper = void 0;
  6614. const core = __importStar(__nccwpck_require__(2186));
  6615. /**
  6616. * Internal class for retries
  6617. */
  6618. class RetryHelper {
  6619. constructor(maxAttempts, minSeconds, maxSeconds) {
  6620. if (maxAttempts < 1) {
  6621. throw new Error('max attempts should be greater than or equal to 1');
  6622. }
  6623. this.maxAttempts = maxAttempts;
  6624. this.minSeconds = Math.floor(minSeconds);
  6625. this.maxSeconds = Math.floor(maxSeconds);
  6626. if (this.minSeconds > this.maxSeconds) {
  6627. throw new Error('min seconds should be less than or equal to max seconds');
  6628. }
  6629. }
  6630. execute(action, isRetryable) {
  6631. return __awaiter(this, void 0, void 0, function* () {
  6632. let attempt = 1;
  6633. while (attempt < this.maxAttempts) {
  6634. // Try
  6635. try {
  6636. return yield action();
  6637. }
  6638. catch (err) {
  6639. if (isRetryable && !isRetryable(err)) {
  6640. throw err;
  6641. }
  6642. core.info(err.message);
  6643. }
  6644. // Sleep
  6645. const seconds = this.getSleepAmount();
  6646. core.info(`Waiting ${seconds} seconds before trying again`);
  6647. yield this.sleep(seconds);
  6648. attempt++;
  6649. }
  6650. // Last attempt
  6651. return yield action();
  6652. });
  6653. }
  6654. getSleepAmount() {
  6655. return (Math.floor(Math.random() * (this.maxSeconds - this.minSeconds + 1)) +
  6656. this.minSeconds);
  6657. }
  6658. sleep(seconds) {
  6659. return __awaiter(this, void 0, void 0, function* () {
  6660. return new Promise(resolve => setTimeout(resolve, seconds * 1000));
  6661. });
  6662. }
  6663. }
  6664. exports.RetryHelper = RetryHelper;
  6665. //# sourceMappingURL=retry-helper.js.map
  6666. /***/ }),
  6667. /***/ 7784:
  6668. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  6669. "use strict";
  6670. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  6671. if (k2 === undefined) k2 = k;
  6672. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  6673. }) : (function(o, m, k, k2) {
  6674. if (k2 === undefined) k2 = k;
  6675. o[k2] = m[k];
  6676. }));
  6677. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  6678. Object.defineProperty(o, "default", { enumerable: true, value: v });
  6679. }) : function(o, v) {
  6680. o["default"] = v;
  6681. });
  6682. var __importStar = (this && this.__importStar) || function (mod) {
  6683. if (mod && mod.__esModule) return mod;
  6684. var result = {};
  6685. if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  6686. __setModuleDefault(result, mod);
  6687. return result;
  6688. };
  6689. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  6690. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  6691. return new (P || (P = Promise))(function (resolve, reject) {
  6692. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  6693. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  6694. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  6695. step((generator = generator.apply(thisArg, _arguments || [])).next());
  6696. });
  6697. };
  6698. var __importDefault = (this && this.__importDefault) || function (mod) {
  6699. return (mod && mod.__esModule) ? mod : { "default": mod };
  6700. };
  6701. Object.defineProperty(exports, "__esModule", ({ value: true }));
  6702. 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;
  6703. const core = __importStar(__nccwpck_require__(2186));
  6704. const io = __importStar(__nccwpck_require__(7436));
  6705. const fs = __importStar(__nccwpck_require__(7147));
  6706. const mm = __importStar(__nccwpck_require__(2473));
  6707. const os = __importStar(__nccwpck_require__(2037));
  6708. const path = __importStar(__nccwpck_require__(1017));
  6709. const httpm = __importStar(__nccwpck_require__(6255));
  6710. const semver = __importStar(__nccwpck_require__(5911));
  6711. const stream = __importStar(__nccwpck_require__(2781));
  6712. const util = __importStar(__nccwpck_require__(3837));
  6713. const assert_1 = __nccwpck_require__(9491);
  6714. const v4_1 = __importDefault(__nccwpck_require__(7468));
  6715. const exec_1 = __nccwpck_require__(1514);
  6716. const retry_helper_1 = __nccwpck_require__(8279);
  6717. class HTTPError extends Error {
  6718. constructor(httpStatusCode) {
  6719. super(`Unexpected HTTP response: ${httpStatusCode}`);
  6720. this.httpStatusCode = httpStatusCode;
  6721. Object.setPrototypeOf(this, new.target.prototype);
  6722. }
  6723. }
  6724. exports.HTTPError = HTTPError;
  6725. const IS_WINDOWS = process.platform === 'win32';
  6726. const IS_MAC = process.platform === 'darwin';
  6727. const userAgent = 'actions/tool-cache';
  6728. /**
  6729. * Download a tool from an url and stream it into a file
  6730. *
  6731. * @param url url of tool to download
  6732. * @param dest path to download tool
  6733. * @param auth authorization header
  6734. * @param headers other headers
  6735. * @returns path to downloaded tool
  6736. */
  6737. function downloadTool(url, dest, auth, headers) {
  6738. return __awaiter(this, void 0, void 0, function* () {
  6739. dest = dest || path.join(_getTempDirectory(), v4_1.default());
  6740. yield io.mkdirP(path.dirname(dest));
  6741. core.debug(`Downloading ${url}`);
  6742. core.debug(`Destination ${dest}`);
  6743. const maxAttempts = 3;
  6744. const minSeconds = _getGlobal('TEST_DOWNLOAD_TOOL_RETRY_MIN_SECONDS', 10);
  6745. const maxSeconds = _getGlobal('TEST_DOWNLOAD_TOOL_RETRY_MAX_SECONDS', 20);
  6746. const retryHelper = new retry_helper_1.RetryHelper(maxAttempts, minSeconds, maxSeconds);
  6747. return yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  6748. return yield downloadToolAttempt(url, dest || '', auth, headers);
  6749. }), (err) => {
  6750. if (err instanceof HTTPError && err.httpStatusCode) {
  6751. // Don't retry anything less than 500, except 408 Request Timeout and 429 Too Many Requests
  6752. if (err.httpStatusCode < 500 &&
  6753. err.httpStatusCode !== 408 &&
  6754. err.httpStatusCode !== 429) {
  6755. return false;
  6756. }
  6757. }
  6758. // Otherwise retry
  6759. return true;
  6760. });
  6761. });
  6762. }
  6763. exports.downloadTool = downloadTool;
  6764. function downloadToolAttempt(url, dest, auth, headers) {
  6765. return __awaiter(this, void 0, void 0, function* () {
  6766. if (fs.existsSync(dest)) {
  6767. throw new Error(`Destination file path ${dest} already exists`);
  6768. }
  6769. // Get the response headers
  6770. const http = new httpm.HttpClient(userAgent, [], {
  6771. allowRetries: false
  6772. });
  6773. if (auth) {
  6774. core.debug('set auth');
  6775. if (headers === undefined) {
  6776. headers = {};
  6777. }
  6778. headers.authorization = auth;
  6779. }
  6780. const response = yield http.get(url, headers);
  6781. if (response.message.statusCode !== 200) {
  6782. const err = new HTTPError(response.message.statusCode);
  6783. core.debug(`Failed to download from "${url}". Code(${response.message.statusCode}) Message(${response.message.statusMessage})`);
  6784. throw err;
  6785. }
  6786. // Download the response body
  6787. const pipeline = util.promisify(stream.pipeline);
  6788. const responseMessageFactory = _getGlobal('TEST_DOWNLOAD_TOOL_RESPONSE_MESSAGE_FACTORY', () => response.message);
  6789. const readStream = responseMessageFactory();
  6790. let succeeded = false;
  6791. try {
  6792. yield pipeline(readStream, fs.createWriteStream(dest));
  6793. core.debug('download complete');
  6794. succeeded = true;
  6795. return dest;
  6796. }
  6797. finally {
  6798. // Error, delete dest before retry
  6799. if (!succeeded) {
  6800. core.debug('download failed');
  6801. try {
  6802. yield io.rmRF(dest);
  6803. }
  6804. catch (err) {
  6805. core.debug(`Failed to delete '${dest}'. ${err.message}`);
  6806. }
  6807. }
  6808. }
  6809. });
  6810. }
  6811. /**
  6812. * Extract a .7z file
  6813. *
  6814. * @param file path to the .7z file
  6815. * @param dest destination directory. Optional.
  6816. * @param _7zPath path to 7zr.exe. Optional, for long path support. Most .7z archives do not have this
  6817. * problem. If your .7z archive contains very long paths, you can pass the path to 7zr.exe which will
  6818. * gracefully handle long paths. By default 7zdec.exe is used because it is a very small program and is
  6819. * bundled with the tool lib. However it does not support long paths. 7zr.exe is the reduced command line
  6820. * interface, it is smaller than the full command line interface, and it does support long paths. At the
  6821. * time of this writing, it is freely available from the LZMA SDK that is available on the 7zip website.
  6822. * Be sure to check the current license agreement. If 7zr.exe is bundled with your action, then the path
  6823. * to 7zr.exe can be pass to this function.
  6824. * @returns path to the destination directory
  6825. */
  6826. function extract7z(file, dest, _7zPath) {
  6827. return __awaiter(this, void 0, void 0, function* () {
  6828. assert_1.ok(IS_WINDOWS, 'extract7z() not supported on current OS');
  6829. assert_1.ok(file, 'parameter "file" is required');
  6830. dest = yield _createExtractFolder(dest);
  6831. const originalCwd = process.cwd();
  6832. process.chdir(dest);
  6833. if (_7zPath) {
  6834. try {
  6835. const logLevel = core.isDebug() ? '-bb1' : '-bb0';
  6836. const args = [
  6837. 'x',
  6838. logLevel,
  6839. '-bd',
  6840. '-sccUTF-8',
  6841. file
  6842. ];
  6843. const options = {
  6844. silent: true
  6845. };
  6846. yield exec_1.exec(`"${_7zPath}"`, args, options);
  6847. }
  6848. finally {
  6849. process.chdir(originalCwd);
  6850. }
  6851. }
  6852. else {
  6853. const escapedScript = path
  6854. .join(__dirname, '..', 'scripts', 'Invoke-7zdec.ps1')
  6855. .replace(/'/g, "''")
  6856. .replace(/"|\n|\r/g, ''); // double-up single quotes, remove double quotes and newlines
  6857. const escapedFile = file.replace(/'/g, "''").replace(/"|\n|\r/g, '');
  6858. const escapedTarget = dest.replace(/'/g, "''").replace(/"|\n|\r/g, '');
  6859. const command = `& '${escapedScript}' -Source '${escapedFile}' -Target '${escapedTarget}'`;
  6860. const args = [
  6861. '-NoLogo',
  6862. '-Sta',
  6863. '-NoProfile',
  6864. '-NonInteractive',
  6865. '-ExecutionPolicy',
  6866. 'Unrestricted',
  6867. '-Command',
  6868. command
  6869. ];
  6870. const options = {
  6871. silent: true
  6872. };
  6873. try {
  6874. const powershellPath = yield io.which('powershell', true);
  6875. yield exec_1.exec(`"${powershellPath}"`, args, options);
  6876. }
  6877. finally {
  6878. process.chdir(originalCwd);
  6879. }
  6880. }
  6881. return dest;
  6882. });
  6883. }
  6884. exports.extract7z = extract7z;
  6885. /**
  6886. * Extract a compressed tar archive
  6887. *
  6888. * @param file path to the tar
  6889. * @param dest destination directory. Optional.
  6890. * @param flags flags for the tar command to use for extraction. Defaults to 'xz' (extracting gzipped tars). Optional.
  6891. * @returns path to the destination directory
  6892. */
  6893. function extractTar(file, dest, flags = 'xz') {
  6894. return __awaiter(this, void 0, void 0, function* () {
  6895. if (!file) {
  6896. throw new Error("parameter 'file' is required");
  6897. }
  6898. // Create dest
  6899. dest = yield _createExtractFolder(dest);
  6900. // Determine whether GNU tar
  6901. core.debug('Checking tar --version');
  6902. let versionOutput = '';
  6903. yield exec_1.exec('tar --version', [], {
  6904. ignoreReturnCode: true,
  6905. silent: true,
  6906. listeners: {
  6907. stdout: (data) => (versionOutput += data.toString()),
  6908. stderr: (data) => (versionOutput += data.toString())
  6909. }
  6910. });
  6911. core.debug(versionOutput.trim());
  6912. const isGnuTar = versionOutput.toUpperCase().includes('GNU TAR');
  6913. // Initialize args
  6914. let args;
  6915. if (flags instanceof Array) {
  6916. args = flags;
  6917. }
  6918. else {
  6919. args = [flags];
  6920. }
  6921. if (core.isDebug() && !flags.includes('v')) {
  6922. args.push('-v');
  6923. }
  6924. let destArg = dest;
  6925. let fileArg = file;
  6926. if (IS_WINDOWS && isGnuTar) {
  6927. args.push('--force-local');
  6928. destArg = dest.replace(/\\/g, '/');
  6929. // Technically only the dest needs to have `/` but for aesthetic consistency
  6930. // convert slashes in the file arg too.
  6931. fileArg = file.replace(/\\/g, '/');
  6932. }
  6933. if (isGnuTar) {
  6934. // Suppress warnings when using GNU tar to extract archives created by BSD tar
  6935. args.push('--warning=no-unknown-keyword');
  6936. args.push('--overwrite');
  6937. }
  6938. args.push('-C', destArg, '-f', fileArg);
  6939. yield exec_1.exec(`tar`, args);
  6940. return dest;
  6941. });
  6942. }
  6943. exports.extractTar = extractTar;
  6944. /**
  6945. * Extract a xar compatible archive
  6946. *
  6947. * @param file path to the archive
  6948. * @param dest destination directory. Optional.
  6949. * @param flags flags for the xar. Optional.
  6950. * @returns path to the destination directory
  6951. */
  6952. function extractXar(file, dest, flags = []) {
  6953. return __awaiter(this, void 0, void 0, function* () {
  6954. assert_1.ok(IS_MAC, 'extractXar() not supported on current OS');
  6955. assert_1.ok(file, 'parameter "file" is required');
  6956. dest = yield _createExtractFolder(dest);
  6957. let args;
  6958. if (flags instanceof Array) {
  6959. args = flags;
  6960. }
  6961. else {
  6962. args = [flags];
  6963. }
  6964. args.push('-x', '-C', dest, '-f', file);
  6965. if (core.isDebug()) {
  6966. args.push('-v');
  6967. }
  6968. const xarPath = yield io.which('xar', true);
  6969. yield exec_1.exec(`"${xarPath}"`, _unique(args));
  6970. return dest;
  6971. });
  6972. }
  6973. exports.extractXar = extractXar;
  6974. /**
  6975. * Extract a zip
  6976. *
  6977. * @param file path to the zip
  6978. * @param dest destination directory. Optional.
  6979. * @returns path to the destination directory
  6980. */
  6981. function extractZip(file, dest) {
  6982. return __awaiter(this, void 0, void 0, function* () {
  6983. if (!file) {
  6984. throw new Error("parameter 'file' is required");
  6985. }
  6986. dest = yield _createExtractFolder(dest);
  6987. if (IS_WINDOWS) {
  6988. yield extractZipWin(file, dest);
  6989. }
  6990. else {
  6991. yield extractZipNix(file, dest);
  6992. }
  6993. return dest;
  6994. });
  6995. }
  6996. exports.extractZip = extractZip;
  6997. function extractZipWin(file, dest) {
  6998. return __awaiter(this, void 0, void 0, function* () {
  6999. // build the powershell command
  7000. const escapedFile = file.replace(/'/g, "''").replace(/"|\n|\r/g, ''); // double-up single quotes, remove double quotes and newlines
  7001. const escapedDest = dest.replace(/'/g, "''").replace(/"|\n|\r/g, '');
  7002. const pwshPath = yield io.which('pwsh', false);
  7003. //To match the file overwrite behavior on nix systems, we use the overwrite = true flag for ExtractToDirectory
  7004. //and the -Force flag for Expand-Archive as a fallback
  7005. if (pwshPath) {
  7006. //attempt to use pwsh with ExtractToDirectory, if this fails attempt Expand-Archive
  7007. const pwshCommand = [
  7008. `$ErrorActionPreference = 'Stop' ;`,
  7009. `try { Add-Type -AssemblyName System.IO.Compression.ZipFile } catch { } ;`,
  7010. `try { [System.IO.Compression.ZipFile]::ExtractToDirectory('${escapedFile}', '${escapedDest}', $true) }`,
  7011. `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 $_ } } ;`
  7012. ].join(' ');
  7013. const args = [
  7014. '-NoLogo',
  7015. '-NoProfile',
  7016. '-NonInteractive',
  7017. '-ExecutionPolicy',
  7018. 'Unrestricted',
  7019. '-Command',
  7020. pwshCommand
  7021. ];
  7022. core.debug(`Using pwsh at path: ${pwshPath}`);
  7023. yield exec_1.exec(`"${pwshPath}"`, args);
  7024. }
  7025. else {
  7026. const powershellCommand = [
  7027. `$ErrorActionPreference = 'Stop' ;`,
  7028. `try { Add-Type -AssemblyName System.IO.Compression.FileSystem } catch { } ;`,
  7029. `if ((Get-Command -Name Expand-Archive -Module Microsoft.PowerShell.Archive -ErrorAction Ignore)) { Expand-Archive -LiteralPath '${escapedFile}' -DestinationPath '${escapedDest}' -Force }`,
  7030. `else {[System.IO.Compression.ZipFile]::ExtractToDirectory('${escapedFile}', '${escapedDest}', $true) }`
  7031. ].join(' ');
  7032. const args = [
  7033. '-NoLogo',
  7034. '-Sta',
  7035. '-NoProfile',
  7036. '-NonInteractive',
  7037. '-ExecutionPolicy',
  7038. 'Unrestricted',
  7039. '-Command',
  7040. powershellCommand
  7041. ];
  7042. const powershellPath = yield io.which('powershell', true);
  7043. core.debug(`Using powershell at path: ${powershellPath}`);
  7044. yield exec_1.exec(`"${powershellPath}"`, args);
  7045. }
  7046. });
  7047. }
  7048. function extractZipNix(file, dest) {
  7049. return __awaiter(this, void 0, void 0, function* () {
  7050. const unzipPath = yield io.which('unzip', true);
  7051. const args = [file];
  7052. if (!core.isDebug()) {
  7053. args.unshift('-q');
  7054. }
  7055. args.unshift('-o'); //overwrite with -o, otherwise a prompt is shown which freezes the run
  7056. yield exec_1.exec(`"${unzipPath}"`, args, { cwd: dest });
  7057. });
  7058. }
  7059. /**
  7060. * Caches a directory and installs it into the tool cacheDir
  7061. *
  7062. * @param sourceDir the directory to cache into tools
  7063. * @param tool tool name
  7064. * @param version version of the tool. semver format
  7065. * @param arch architecture of the tool. Optional. Defaults to machine architecture
  7066. */
  7067. function cacheDir(sourceDir, tool, version, arch) {
  7068. return __awaiter(this, void 0, void 0, function* () {
  7069. version = semver.clean(version) || version;
  7070. arch = arch || os.arch();
  7071. core.debug(`Caching tool ${tool} ${version} ${arch}`);
  7072. core.debug(`source dir: ${sourceDir}`);
  7073. if (!fs.statSync(sourceDir).isDirectory()) {
  7074. throw new Error('sourceDir is not a directory');
  7075. }
  7076. // Create the tool dir
  7077. const destPath = yield _createToolPath(tool, version, arch);
  7078. // copy each child item. do not move. move can fail on Windows
  7079. // due to anti-virus software having an open handle on a file.
  7080. for (const itemName of fs.readdirSync(sourceDir)) {
  7081. const s = path.join(sourceDir, itemName);
  7082. yield io.cp(s, destPath, { recursive: true });
  7083. }
  7084. // write .complete
  7085. _completeToolPath(tool, version, arch);
  7086. return destPath;
  7087. });
  7088. }
  7089. exports.cacheDir = cacheDir;
  7090. /**
  7091. * Caches a downloaded file (GUID) and installs it
  7092. * into the tool cache with a given targetName
  7093. *
  7094. * @param sourceFile the file to cache into tools. Typically a result of downloadTool which is a guid.
  7095. * @param targetFile the name of the file name in the tools directory
  7096. * @param tool tool name
  7097. * @param version version of the tool. semver format
  7098. * @param arch architecture of the tool. Optional. Defaults to machine architecture
  7099. */
  7100. function cacheFile(sourceFile, targetFile, tool, version, arch) {
  7101. return __awaiter(this, void 0, void 0, function* () {
  7102. version = semver.clean(version) || version;
  7103. arch = arch || os.arch();
  7104. core.debug(`Caching tool ${tool} ${version} ${arch}`);
  7105. core.debug(`source file: ${sourceFile}`);
  7106. if (!fs.statSync(sourceFile).isFile()) {
  7107. throw new Error('sourceFile is not a file');
  7108. }
  7109. // create the tool dir
  7110. const destFolder = yield _createToolPath(tool, version, arch);
  7111. // copy instead of move. move can fail on Windows due to
  7112. // anti-virus software having an open handle on a file.
  7113. const destPath = path.join(destFolder, targetFile);
  7114. core.debug(`destination file ${destPath}`);
  7115. yield io.cp(sourceFile, destPath);
  7116. // write .complete
  7117. _completeToolPath(tool, version, arch);
  7118. return destFolder;
  7119. });
  7120. }
  7121. exports.cacheFile = cacheFile;
  7122. /**
  7123. * Finds the path to a tool version in the local installed tool cache
  7124. *
  7125. * @param toolName name of the tool
  7126. * @param versionSpec version of the tool
  7127. * @param arch optional arch. defaults to arch of computer
  7128. */
  7129. function find(toolName, versionSpec, arch) {
  7130. if (!toolName) {
  7131. throw new Error('toolName parameter is required');
  7132. }
  7133. if (!versionSpec) {
  7134. throw new Error('versionSpec parameter is required');
  7135. }
  7136. arch = arch || os.arch();
  7137. // attempt to resolve an explicit version
  7138. if (!isExplicitVersion(versionSpec)) {
  7139. const localVersions = findAllVersions(toolName, arch);
  7140. const match = evaluateVersions(localVersions, versionSpec);
  7141. versionSpec = match;
  7142. }
  7143. // check for the explicit version in the cache
  7144. let toolPath = '';
  7145. if (versionSpec) {
  7146. versionSpec = semver.clean(versionSpec) || '';
  7147. const cachePath = path.join(_getCacheDirectory(), toolName, versionSpec, arch);
  7148. core.debug(`checking cache: ${cachePath}`);
  7149. if (fs.existsSync(cachePath) && fs.existsSync(`${cachePath}.complete`)) {
  7150. core.debug(`Found tool in cache ${toolName} ${versionSpec} ${arch}`);
  7151. toolPath = cachePath;
  7152. }
  7153. else {
  7154. core.debug('not found');
  7155. }
  7156. }
  7157. return toolPath;
  7158. }
  7159. exports.find = find;
  7160. /**
  7161. * Finds the paths to all versions of a tool that are installed in the local tool cache
  7162. *
  7163. * @param toolName name of the tool
  7164. * @param arch optional arch. defaults to arch of computer
  7165. */
  7166. function findAllVersions(toolName, arch) {
  7167. const versions = [];
  7168. arch = arch || os.arch();
  7169. const toolPath = path.join(_getCacheDirectory(), toolName);
  7170. if (fs.existsSync(toolPath)) {
  7171. const children = fs.readdirSync(toolPath);
  7172. for (const child of children) {
  7173. if (isExplicitVersion(child)) {
  7174. const fullPath = path.join(toolPath, child, arch || '');
  7175. if (fs.existsSync(fullPath) && fs.existsSync(`${fullPath}.complete`)) {
  7176. versions.push(child);
  7177. }
  7178. }
  7179. }
  7180. }
  7181. return versions;
  7182. }
  7183. exports.findAllVersions = findAllVersions;
  7184. function getManifestFromRepo(owner, repo, auth, branch = 'master') {
  7185. return __awaiter(this, void 0, void 0, function* () {
  7186. let releases = [];
  7187. const treeUrl = `https://api.github.com/repos/${owner}/${repo}/git/trees/${branch}`;
  7188. const http = new httpm.HttpClient('tool-cache');
  7189. const headers = {};
  7190. if (auth) {
  7191. core.debug('set auth');
  7192. headers.authorization = auth;
  7193. }
  7194. const response = yield http.getJson(treeUrl, headers);
  7195. if (!response.result) {
  7196. return releases;
  7197. }
  7198. let manifestUrl = '';
  7199. for (const item of response.result.tree) {
  7200. if (item.path === 'versions-manifest.json') {
  7201. manifestUrl = item.url;
  7202. break;
  7203. }
  7204. }
  7205. headers['accept'] = 'application/vnd.github.VERSION.raw';
  7206. let versionsRaw = yield (yield http.get(manifestUrl, headers)).readBody();
  7207. if (versionsRaw) {
  7208. // shouldn't be needed but protects against invalid json saved with BOM
  7209. versionsRaw = versionsRaw.replace(/^\uFEFF/, '');
  7210. try {
  7211. releases = JSON.parse(versionsRaw);
  7212. }
  7213. catch (_a) {
  7214. core.debug('Invalid json');
  7215. }
  7216. }
  7217. return releases;
  7218. });
  7219. }
  7220. exports.getManifestFromRepo = getManifestFromRepo;
  7221. function findFromManifest(versionSpec, stable, manifest, archFilter = os.arch()) {
  7222. return __awaiter(this, void 0, void 0, function* () {
  7223. // wrap the internal impl
  7224. const match = yield mm._findMatch(versionSpec, stable, manifest, archFilter);
  7225. return match;
  7226. });
  7227. }
  7228. exports.findFromManifest = findFromManifest;
  7229. function _createExtractFolder(dest) {
  7230. return __awaiter(this, void 0, void 0, function* () {
  7231. if (!dest) {
  7232. // create a temp dir
  7233. dest = path.join(_getTempDirectory(), v4_1.default());
  7234. }
  7235. yield io.mkdirP(dest);
  7236. return dest;
  7237. });
  7238. }
  7239. function _createToolPath(tool, version, arch) {
  7240. return __awaiter(this, void 0, void 0, function* () {
  7241. const folderPath = path.join(_getCacheDirectory(), tool, semver.clean(version) || version, arch || '');
  7242. core.debug(`destination ${folderPath}`);
  7243. const markerPath = `${folderPath}.complete`;
  7244. yield io.rmRF(folderPath);
  7245. yield io.rmRF(markerPath);
  7246. yield io.mkdirP(folderPath);
  7247. return folderPath;
  7248. });
  7249. }
  7250. function _completeToolPath(tool, version, arch) {
  7251. const folderPath = path.join(_getCacheDirectory(), tool, semver.clean(version) || version, arch || '');
  7252. const markerPath = `${folderPath}.complete`;
  7253. fs.writeFileSync(markerPath, '');
  7254. core.debug('finished caching tool');
  7255. }
  7256. /**
  7257. * Check if version string is explicit
  7258. *
  7259. * @param versionSpec version string to check
  7260. */
  7261. function isExplicitVersion(versionSpec) {
  7262. const c = semver.clean(versionSpec) || '';
  7263. core.debug(`isExplicit: ${c}`);
  7264. const valid = semver.valid(c) != null;
  7265. core.debug(`explicit? ${valid}`);
  7266. return valid;
  7267. }
  7268. exports.isExplicitVersion = isExplicitVersion;
  7269. /**
  7270. * Get the highest satisfiying semantic version in `versions` which satisfies `versionSpec`
  7271. *
  7272. * @param versions array of versions to evaluate
  7273. * @param versionSpec semantic version spec to satisfy
  7274. */
  7275. function evaluateVersions(versions, versionSpec) {
  7276. let version = '';
  7277. core.debug(`evaluating ${versions.length} versions`);
  7278. versions = versions.sort((a, b) => {
  7279. if (semver.gt(a, b)) {
  7280. return 1;
  7281. }
  7282. return -1;
  7283. });
  7284. for (let i = versions.length - 1; i >= 0; i--) {
  7285. const potential = versions[i];
  7286. const satisfied = semver.satisfies(potential, versionSpec);
  7287. if (satisfied) {
  7288. version = potential;
  7289. break;
  7290. }
  7291. }
  7292. if (version) {
  7293. core.debug(`matched: ${version}`);
  7294. }
  7295. else {
  7296. core.debug('match not found');
  7297. }
  7298. return version;
  7299. }
  7300. exports.evaluateVersions = evaluateVersions;
  7301. /**
  7302. * Gets RUNNER_TOOL_CACHE
  7303. */
  7304. function _getCacheDirectory() {
  7305. const cacheDirectory = process.env['RUNNER_TOOL_CACHE'] || '';
  7306. assert_1.ok(cacheDirectory, 'Expected RUNNER_TOOL_CACHE to be defined');
  7307. return cacheDirectory;
  7308. }
  7309. /**
  7310. * Gets RUNNER_TEMP
  7311. */
  7312. function _getTempDirectory() {
  7313. const tempDirectory = process.env['RUNNER_TEMP'] || '';
  7314. assert_1.ok(tempDirectory, 'Expected RUNNER_TEMP to be defined');
  7315. return tempDirectory;
  7316. }
  7317. /**
  7318. * Gets a global variable
  7319. */
  7320. function _getGlobal(key, defaultValue) {
  7321. /* eslint-disable @typescript-eslint/no-explicit-any */
  7322. const value = global[key];
  7323. /* eslint-enable @typescript-eslint/no-explicit-any */
  7324. return value !== undefined ? value : defaultValue;
  7325. }
  7326. /**
  7327. * Returns an array of unique values.
  7328. * @param values Values to make unique.
  7329. */
  7330. function _unique(values) {
  7331. return Array.from(new Set(values));
  7332. }
  7333. //# sourceMappingURL=tool-cache.js.map
  7334. /***/ }),
  7335. /***/ 7701:
  7336. /***/ ((module) => {
  7337. /**
  7338. * Convert array of 16 byte values to UUID string format of the form:
  7339. * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
  7340. */
  7341. var byteToHex = [];
  7342. for (var i = 0; i < 256; ++i) {
  7343. byteToHex[i] = (i + 0x100).toString(16).substr(1);
  7344. }
  7345. function bytesToUuid(buf, offset) {
  7346. var i = offset || 0;
  7347. var bth = byteToHex;
  7348. // join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4
  7349. return ([
  7350. bth[buf[i++]], bth[buf[i++]],
  7351. bth[buf[i++]], bth[buf[i++]], '-',
  7352. bth[buf[i++]], bth[buf[i++]], '-',
  7353. bth[buf[i++]], bth[buf[i++]], '-',
  7354. bth[buf[i++]], bth[buf[i++]], '-',
  7355. bth[buf[i++]], bth[buf[i++]],
  7356. bth[buf[i++]], bth[buf[i++]],
  7357. bth[buf[i++]], bth[buf[i++]]
  7358. ]).join('');
  7359. }
  7360. module.exports = bytesToUuid;
  7361. /***/ }),
  7362. /***/ 7269:
  7363. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  7364. // Unique ID creation requires a high quality random # generator. In node.js
  7365. // this is pretty straight-forward - we use the crypto API.
  7366. var crypto = __nccwpck_require__(6113);
  7367. module.exports = function nodeRNG() {
  7368. return crypto.randomBytes(16);
  7369. };
  7370. /***/ }),
  7371. /***/ 7468:
  7372. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  7373. var rng = __nccwpck_require__(7269);
  7374. var bytesToUuid = __nccwpck_require__(7701);
  7375. function v4(options, buf, offset) {
  7376. var i = buf && offset || 0;
  7377. if (typeof(options) == 'string') {
  7378. buf = options === 'binary' ? new Array(16) : null;
  7379. options = null;
  7380. }
  7381. options = options || {};
  7382. var rnds = options.random || (options.rng || rng)();
  7383. // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
  7384. rnds[6] = (rnds[6] & 0x0f) | 0x40;
  7385. rnds[8] = (rnds[8] & 0x3f) | 0x80;
  7386. // Copy bytes to buffer, if provided
  7387. if (buf) {
  7388. for (var ii = 0; ii < 16; ++ii) {
  7389. buf[i + ii] = rnds[ii];
  7390. }
  7391. }
  7392. return buf || bytesToUuid(rnds);
  7393. }
  7394. module.exports = v4;
  7395. /***/ }),
  7396. /***/ 334:
  7397. /***/ ((module) => {
  7398. "use strict";
  7399. var __defProp = Object.defineProperty;
  7400. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  7401. var __getOwnPropNames = Object.getOwnPropertyNames;
  7402. var __hasOwnProp = Object.prototype.hasOwnProperty;
  7403. var __export = (target, all) => {
  7404. for (var name in all)
  7405. __defProp(target, name, { get: all[name], enumerable: true });
  7406. };
  7407. var __copyProps = (to, from, except, desc) => {
  7408. if (from && typeof from === "object" || typeof from === "function") {
  7409. for (let key of __getOwnPropNames(from))
  7410. if (!__hasOwnProp.call(to, key) && key !== except)
  7411. __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  7412. }
  7413. return to;
  7414. };
  7415. var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
  7416. // pkg/dist-src/index.js
  7417. var dist_src_exports = {};
  7418. __export(dist_src_exports, {
  7419. createTokenAuth: () => createTokenAuth
  7420. });
  7421. module.exports = __toCommonJS(dist_src_exports);
  7422. // pkg/dist-src/auth.js
  7423. var REGEX_IS_INSTALLATION_LEGACY = /^v1\./;
  7424. var REGEX_IS_INSTALLATION = /^ghs_/;
  7425. var REGEX_IS_USER_TO_SERVER = /^ghu_/;
  7426. async function auth(token) {
  7427. const isApp = token.split(/\./).length === 3;
  7428. const isInstallation = REGEX_IS_INSTALLATION_LEGACY.test(token) || REGEX_IS_INSTALLATION.test(token);
  7429. const isUserToServer = REGEX_IS_USER_TO_SERVER.test(token);
  7430. const tokenType = isApp ? "app" : isInstallation ? "installation" : isUserToServer ? "user-to-server" : "oauth";
  7431. return {
  7432. type: "token",
  7433. token,
  7434. tokenType
  7435. };
  7436. }
  7437. // pkg/dist-src/with-authorization-prefix.js
  7438. function withAuthorizationPrefix(token) {
  7439. if (token.split(/\./).length === 3) {
  7440. return `bearer ${token}`;
  7441. }
  7442. return `token ${token}`;
  7443. }
  7444. // pkg/dist-src/hook.js
  7445. async function hook(token, request, route, parameters) {
  7446. const endpoint = request.endpoint.merge(
  7447. route,
  7448. parameters
  7449. );
  7450. endpoint.headers.authorization = withAuthorizationPrefix(token);
  7451. return request(endpoint);
  7452. }
  7453. // pkg/dist-src/index.js
  7454. var createTokenAuth = function createTokenAuth2(token) {
  7455. if (!token) {
  7456. throw new Error("[@octokit/auth-token] No token passed to createTokenAuth");
  7457. }
  7458. if (typeof token !== "string") {
  7459. throw new Error(
  7460. "[@octokit/auth-token] Token passed to createTokenAuth is not a string"
  7461. );
  7462. }
  7463. token = token.replace(/^(token|bearer) +/i, "");
  7464. return Object.assign(auth.bind(null, token), {
  7465. hook: hook.bind(null, token)
  7466. });
  7467. };
  7468. // Annotate the CommonJS export names for ESM import in node:
  7469. 0 && (0);
  7470. /***/ }),
  7471. /***/ 6762:
  7472. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  7473. "use strict";
  7474. var __defProp = Object.defineProperty;
  7475. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  7476. var __getOwnPropNames = Object.getOwnPropertyNames;
  7477. var __hasOwnProp = Object.prototype.hasOwnProperty;
  7478. var __export = (target, all) => {
  7479. for (var name in all)
  7480. __defProp(target, name, { get: all[name], enumerable: true });
  7481. };
  7482. var __copyProps = (to, from, except, desc) => {
  7483. if (from && typeof from === "object" || typeof from === "function") {
  7484. for (let key of __getOwnPropNames(from))
  7485. if (!__hasOwnProp.call(to, key) && key !== except)
  7486. __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  7487. }
  7488. return to;
  7489. };
  7490. var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
  7491. // pkg/dist-src/index.js
  7492. var dist_src_exports = {};
  7493. __export(dist_src_exports, {
  7494. Octokit: () => Octokit
  7495. });
  7496. module.exports = __toCommonJS(dist_src_exports);
  7497. var import_universal_user_agent = __nccwpck_require__(5030);
  7498. var import_before_after_hook = __nccwpck_require__(3682);
  7499. var import_request = __nccwpck_require__(6234);
  7500. var import_graphql = __nccwpck_require__(8467);
  7501. var import_auth_token = __nccwpck_require__(334);
  7502. // pkg/dist-src/version.js
  7503. var VERSION = "5.2.0";
  7504. // pkg/dist-src/index.js
  7505. var noop = () => {
  7506. };
  7507. var consoleWarn = console.warn.bind(console);
  7508. var consoleError = console.error.bind(console);
  7509. var userAgentTrail = `octokit-core.js/${VERSION} ${(0, import_universal_user_agent.getUserAgent)()}`;
  7510. var Octokit = class {
  7511. static {
  7512. this.VERSION = VERSION;
  7513. }
  7514. static defaults(defaults) {
  7515. const OctokitWithDefaults = class extends this {
  7516. constructor(...args) {
  7517. const options = args[0] || {};
  7518. if (typeof defaults === "function") {
  7519. super(defaults(options));
  7520. return;
  7521. }
  7522. super(
  7523. Object.assign(
  7524. {},
  7525. defaults,
  7526. options,
  7527. options.userAgent && defaults.userAgent ? {
  7528. userAgent: `${options.userAgent} ${defaults.userAgent}`
  7529. } : null
  7530. )
  7531. );
  7532. }
  7533. };
  7534. return OctokitWithDefaults;
  7535. }
  7536. static {
  7537. this.plugins = [];
  7538. }
  7539. /**
  7540. * Attach a plugin (or many) to your Octokit instance.
  7541. *
  7542. * @example
  7543. * const API = Octokit.plugin(plugin1, plugin2, plugin3, ...)
  7544. */
  7545. static plugin(...newPlugins) {
  7546. const currentPlugins = this.plugins;
  7547. const NewOctokit = class extends this {
  7548. static {
  7549. this.plugins = currentPlugins.concat(
  7550. newPlugins.filter((plugin) => !currentPlugins.includes(plugin))
  7551. );
  7552. }
  7553. };
  7554. return NewOctokit;
  7555. }
  7556. constructor(options = {}) {
  7557. const hook = new import_before_after_hook.Collection();
  7558. const requestDefaults = {
  7559. baseUrl: import_request.request.endpoint.DEFAULTS.baseUrl,
  7560. headers: {},
  7561. request: Object.assign({}, options.request, {
  7562. // @ts-ignore internal usage only, no need to type
  7563. hook: hook.bind(null, "request")
  7564. }),
  7565. mediaType: {
  7566. previews: [],
  7567. format: ""
  7568. }
  7569. };
  7570. requestDefaults.headers["user-agent"] = options.userAgent ? `${options.userAgent} ${userAgentTrail}` : userAgentTrail;
  7571. if (options.baseUrl) {
  7572. requestDefaults.baseUrl = options.baseUrl;
  7573. }
  7574. if (options.previews) {
  7575. requestDefaults.mediaType.previews = options.previews;
  7576. }
  7577. if (options.timeZone) {
  7578. requestDefaults.headers["time-zone"] = options.timeZone;
  7579. }
  7580. this.request = import_request.request.defaults(requestDefaults);
  7581. this.graphql = (0, import_graphql.withCustomRequest)(this.request).defaults(requestDefaults);
  7582. this.log = Object.assign(
  7583. {
  7584. debug: noop,
  7585. info: noop,
  7586. warn: consoleWarn,
  7587. error: consoleError
  7588. },
  7589. options.log
  7590. );
  7591. this.hook = hook;
  7592. if (!options.authStrategy) {
  7593. if (!options.auth) {
  7594. this.auth = async () => ({
  7595. type: "unauthenticated"
  7596. });
  7597. } else {
  7598. const auth = (0, import_auth_token.createTokenAuth)(options.auth);
  7599. hook.wrap("request", auth.hook);
  7600. this.auth = auth;
  7601. }
  7602. } else {
  7603. const { authStrategy, ...otherOptions } = options;
  7604. const auth = authStrategy(
  7605. Object.assign(
  7606. {
  7607. request: this.request,
  7608. log: this.log,
  7609. // we pass the current octokit instance as well as its constructor options
  7610. // to allow for authentication strategies that return a new octokit instance
  7611. // that shares the same internal state as the current one. The original
  7612. // requirement for this was the "event-octokit" authentication strategy
  7613. // of https://github.com/probot/octokit-auth-probot.
  7614. octokit: this,
  7615. octokitOptions: otherOptions
  7616. },
  7617. options.auth
  7618. )
  7619. );
  7620. hook.wrap("request", auth.hook);
  7621. this.auth = auth;
  7622. }
  7623. const classConstructor = this.constructor;
  7624. for (let i = 0; i < classConstructor.plugins.length; ++i) {
  7625. Object.assign(this, classConstructor.plugins[i](this, options));
  7626. }
  7627. }
  7628. };
  7629. // Annotate the CommonJS export names for ESM import in node:
  7630. 0 && (0);
  7631. /***/ }),
  7632. /***/ 9440:
  7633. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  7634. "use strict";
  7635. var __defProp = Object.defineProperty;
  7636. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  7637. var __getOwnPropNames = Object.getOwnPropertyNames;
  7638. var __hasOwnProp = Object.prototype.hasOwnProperty;
  7639. var __export = (target, all) => {
  7640. for (var name in all)
  7641. __defProp(target, name, { get: all[name], enumerable: true });
  7642. };
  7643. var __copyProps = (to, from, except, desc) => {
  7644. if (from && typeof from === "object" || typeof from === "function") {
  7645. for (let key of __getOwnPropNames(from))
  7646. if (!__hasOwnProp.call(to, key) && key !== except)
  7647. __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  7648. }
  7649. return to;
  7650. };
  7651. var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
  7652. // pkg/dist-src/index.js
  7653. var dist_src_exports = {};
  7654. __export(dist_src_exports, {
  7655. endpoint: () => endpoint
  7656. });
  7657. module.exports = __toCommonJS(dist_src_exports);
  7658. // pkg/dist-src/defaults.js
  7659. var import_universal_user_agent = __nccwpck_require__(5030);
  7660. // pkg/dist-src/version.js
  7661. var VERSION = "9.0.6";
  7662. // pkg/dist-src/defaults.js
  7663. var userAgent = `octokit-endpoint.js/${VERSION} ${(0, import_universal_user_agent.getUserAgent)()}`;
  7664. var DEFAULTS = {
  7665. method: "GET",
  7666. baseUrl: "https://api.github.com",
  7667. headers: {
  7668. accept: "application/vnd.github.v3+json",
  7669. "user-agent": userAgent
  7670. },
  7671. mediaType: {
  7672. format: ""
  7673. }
  7674. };
  7675. // pkg/dist-src/util/lowercase-keys.js
  7676. function lowercaseKeys(object) {
  7677. if (!object) {
  7678. return {};
  7679. }
  7680. return Object.keys(object).reduce((newObj, key) => {
  7681. newObj[key.toLowerCase()] = object[key];
  7682. return newObj;
  7683. }, {});
  7684. }
  7685. // pkg/dist-src/util/is-plain-object.js
  7686. function isPlainObject(value) {
  7687. if (typeof value !== "object" || value === null)
  7688. return false;
  7689. if (Object.prototype.toString.call(value) !== "[object Object]")
  7690. return false;
  7691. const proto = Object.getPrototypeOf(value);
  7692. if (proto === null)
  7693. return true;
  7694. const Ctor = Object.prototype.hasOwnProperty.call(proto, "constructor") && proto.constructor;
  7695. return typeof Ctor === "function" && Ctor instanceof Ctor && Function.prototype.call(Ctor) === Function.prototype.call(value);
  7696. }
  7697. // pkg/dist-src/util/merge-deep.js
  7698. function mergeDeep(defaults, options) {
  7699. const result = Object.assign({}, defaults);
  7700. Object.keys(options).forEach((key) => {
  7701. if (isPlainObject(options[key])) {
  7702. if (!(key in defaults))
  7703. Object.assign(result, { [key]: options[key] });
  7704. else
  7705. result[key] = mergeDeep(defaults[key], options[key]);
  7706. } else {
  7707. Object.assign(result, { [key]: options[key] });
  7708. }
  7709. });
  7710. return result;
  7711. }
  7712. // pkg/dist-src/util/remove-undefined-properties.js
  7713. function removeUndefinedProperties(obj) {
  7714. for (const key in obj) {
  7715. if (obj[key] === void 0) {
  7716. delete obj[key];
  7717. }
  7718. }
  7719. return obj;
  7720. }
  7721. // pkg/dist-src/merge.js
  7722. function merge(defaults, route, options) {
  7723. if (typeof route === "string") {
  7724. let [method, url] = route.split(" ");
  7725. options = Object.assign(url ? { method, url } : { url: method }, options);
  7726. } else {
  7727. options = Object.assign({}, route);
  7728. }
  7729. options.headers = lowercaseKeys(options.headers);
  7730. removeUndefinedProperties(options);
  7731. removeUndefinedProperties(options.headers);
  7732. const mergedOptions = mergeDeep(defaults || {}, options);
  7733. if (options.url === "/graphql") {
  7734. if (defaults && defaults.mediaType.previews?.length) {
  7735. mergedOptions.mediaType.previews = defaults.mediaType.previews.filter(
  7736. (preview) => !mergedOptions.mediaType.previews.includes(preview)
  7737. ).concat(mergedOptions.mediaType.previews);
  7738. }
  7739. mergedOptions.mediaType.previews = (mergedOptions.mediaType.previews || []).map((preview) => preview.replace(/-preview/, ""));
  7740. }
  7741. return mergedOptions;
  7742. }
  7743. // pkg/dist-src/util/add-query-parameters.js
  7744. function addQueryParameters(url, parameters) {
  7745. const separator = /\?/.test(url) ? "&" : "?";
  7746. const names = Object.keys(parameters);
  7747. if (names.length === 0) {
  7748. return url;
  7749. }
  7750. return url + separator + names.map((name) => {
  7751. if (name === "q") {
  7752. return "q=" + parameters.q.split("+").map(encodeURIComponent).join("+");
  7753. }
  7754. return `${name}=${encodeURIComponent(parameters[name])}`;
  7755. }).join("&");
  7756. }
  7757. // pkg/dist-src/util/extract-url-variable-names.js
  7758. var urlVariableRegex = /\{[^{}}]+\}/g;
  7759. function removeNonChars(variableName) {
  7760. return variableName.replace(/(?:^\W+)|(?:(?<!\W)\W+$)/g, "").split(/,/);
  7761. }
  7762. function extractUrlVariableNames(url) {
  7763. const matches = url.match(urlVariableRegex);
  7764. if (!matches) {
  7765. return [];
  7766. }
  7767. return matches.map(removeNonChars).reduce((a, b) => a.concat(b), []);
  7768. }
  7769. // pkg/dist-src/util/omit.js
  7770. function omit(object, keysToOmit) {
  7771. const result = { __proto__: null };
  7772. for (const key of Object.keys(object)) {
  7773. if (keysToOmit.indexOf(key) === -1) {
  7774. result[key] = object[key];
  7775. }
  7776. }
  7777. return result;
  7778. }
  7779. // pkg/dist-src/util/url-template.js
  7780. function encodeReserved(str) {
  7781. return str.split(/(%[0-9A-Fa-f]{2})/g).map(function(part) {
  7782. if (!/%[0-9A-Fa-f]/.test(part)) {
  7783. part = encodeURI(part).replace(/%5B/g, "[").replace(/%5D/g, "]");
  7784. }
  7785. return part;
  7786. }).join("");
  7787. }
  7788. function encodeUnreserved(str) {
  7789. return encodeURIComponent(str).replace(/[!'()*]/g, function(c) {
  7790. return "%" + c.charCodeAt(0).toString(16).toUpperCase();
  7791. });
  7792. }
  7793. function encodeValue(operator, value, key) {
  7794. value = operator === "+" || operator === "#" ? encodeReserved(value) : encodeUnreserved(value);
  7795. if (key) {
  7796. return encodeUnreserved(key) + "=" + value;
  7797. } else {
  7798. return value;
  7799. }
  7800. }
  7801. function isDefined(value) {
  7802. return value !== void 0 && value !== null;
  7803. }
  7804. function isKeyOperator(operator) {
  7805. return operator === ";" || operator === "&" || operator === "?";
  7806. }
  7807. function getValues(context, operator, key, modifier) {
  7808. var value = context[key], result = [];
  7809. if (isDefined(value) && value !== "") {
  7810. if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
  7811. value = value.toString();
  7812. if (modifier && modifier !== "*") {
  7813. value = value.substring(0, parseInt(modifier, 10));
  7814. }
  7815. result.push(
  7816. encodeValue(operator, value, isKeyOperator(operator) ? key : "")
  7817. );
  7818. } else {
  7819. if (modifier === "*") {
  7820. if (Array.isArray(value)) {
  7821. value.filter(isDefined).forEach(function(value2) {
  7822. result.push(
  7823. encodeValue(operator, value2, isKeyOperator(operator) ? key : "")
  7824. );
  7825. });
  7826. } else {
  7827. Object.keys(value).forEach(function(k) {
  7828. if (isDefined(value[k])) {
  7829. result.push(encodeValue(operator, value[k], k));
  7830. }
  7831. });
  7832. }
  7833. } else {
  7834. const tmp = [];
  7835. if (Array.isArray(value)) {
  7836. value.filter(isDefined).forEach(function(value2) {
  7837. tmp.push(encodeValue(operator, value2));
  7838. });
  7839. } else {
  7840. Object.keys(value).forEach(function(k) {
  7841. if (isDefined(value[k])) {
  7842. tmp.push(encodeUnreserved(k));
  7843. tmp.push(encodeValue(operator, value[k].toString()));
  7844. }
  7845. });
  7846. }
  7847. if (isKeyOperator(operator)) {
  7848. result.push(encodeUnreserved(key) + "=" + tmp.join(","));
  7849. } else if (tmp.length !== 0) {
  7850. result.push(tmp.join(","));
  7851. }
  7852. }
  7853. }
  7854. } else {
  7855. if (operator === ";") {
  7856. if (isDefined(value)) {
  7857. result.push(encodeUnreserved(key));
  7858. }
  7859. } else if (value === "" && (operator === "&" || operator === "?")) {
  7860. result.push(encodeUnreserved(key) + "=");
  7861. } else if (value === "") {
  7862. result.push("");
  7863. }
  7864. }
  7865. return result;
  7866. }
  7867. function parseUrl(template) {
  7868. return {
  7869. expand: expand.bind(null, template)
  7870. };
  7871. }
  7872. function expand(template, context) {
  7873. var operators = ["+", "#", ".", "/", ";", "?", "&"];
  7874. template = template.replace(
  7875. /\{([^\{\}]+)\}|([^\{\}]+)/g,
  7876. function(_, expression, literal) {
  7877. if (expression) {
  7878. let operator = "";
  7879. const values = [];
  7880. if (operators.indexOf(expression.charAt(0)) !== -1) {
  7881. operator = expression.charAt(0);
  7882. expression = expression.substr(1);
  7883. }
  7884. expression.split(/,/g).forEach(function(variable) {
  7885. var tmp = /([^:\*]*)(?::(\d+)|(\*))?/.exec(variable);
  7886. values.push(getValues(context, operator, tmp[1], tmp[2] || tmp[3]));
  7887. });
  7888. if (operator && operator !== "+") {
  7889. var separator = ",";
  7890. if (operator === "?") {
  7891. separator = "&";
  7892. } else if (operator !== "#") {
  7893. separator = operator;
  7894. }
  7895. return (values.length !== 0 ? operator : "") + values.join(separator);
  7896. } else {
  7897. return values.join(",");
  7898. }
  7899. } else {
  7900. return encodeReserved(literal);
  7901. }
  7902. }
  7903. );
  7904. if (template === "/") {
  7905. return template;
  7906. } else {
  7907. return template.replace(/\/$/, "");
  7908. }
  7909. }
  7910. // pkg/dist-src/parse.js
  7911. function parse(options) {
  7912. let method = options.method.toUpperCase();
  7913. let url = (options.url || "/").replace(/:([a-z]\w+)/g, "{$1}");
  7914. let headers = Object.assign({}, options.headers);
  7915. let body;
  7916. let parameters = omit(options, [
  7917. "method",
  7918. "baseUrl",
  7919. "url",
  7920. "headers",
  7921. "request",
  7922. "mediaType"
  7923. ]);
  7924. const urlVariableNames = extractUrlVariableNames(url);
  7925. url = parseUrl(url).expand(parameters);
  7926. if (!/^http/.test(url)) {
  7927. url = options.baseUrl + url;
  7928. }
  7929. const omittedParameters = Object.keys(options).filter((option) => urlVariableNames.includes(option)).concat("baseUrl");
  7930. const remainingParameters = omit(parameters, omittedParameters);
  7931. const isBinaryRequest = /application\/octet-stream/i.test(headers.accept);
  7932. if (!isBinaryRequest) {
  7933. if (options.mediaType.format) {
  7934. headers.accept = headers.accept.split(/,/).map(
  7935. (format) => format.replace(
  7936. /application\/vnd(\.\w+)(\.v3)?(\.\w+)?(\+json)?$/,
  7937. `application/vnd$1$2.${options.mediaType.format}`
  7938. )
  7939. ).join(",");
  7940. }
  7941. if (url.endsWith("/graphql")) {
  7942. if (options.mediaType.previews?.length) {
  7943. const previewsFromAcceptHeader = headers.accept.match(/(?<![\w-])[\w-]+(?=-preview)/g) || [];
  7944. headers.accept = previewsFromAcceptHeader.concat(options.mediaType.previews).map((preview) => {
  7945. const format = options.mediaType.format ? `.${options.mediaType.format}` : "+json";
  7946. return `application/vnd.github.${preview}-preview${format}`;
  7947. }).join(",");
  7948. }
  7949. }
  7950. }
  7951. if (["GET", "HEAD"].includes(method)) {
  7952. url = addQueryParameters(url, remainingParameters);
  7953. } else {
  7954. if ("data" in remainingParameters) {
  7955. body = remainingParameters.data;
  7956. } else {
  7957. if (Object.keys(remainingParameters).length) {
  7958. body = remainingParameters;
  7959. }
  7960. }
  7961. }
  7962. if (!headers["content-type"] && typeof body !== "undefined") {
  7963. headers["content-type"] = "application/json; charset=utf-8";
  7964. }
  7965. if (["PATCH", "PUT"].includes(method) && typeof body === "undefined") {
  7966. body = "";
  7967. }
  7968. return Object.assign(
  7969. { method, url, headers },
  7970. typeof body !== "undefined" ? { body } : null,
  7971. options.request ? { request: options.request } : null
  7972. );
  7973. }
  7974. // pkg/dist-src/endpoint-with-defaults.js
  7975. function endpointWithDefaults(defaults, route, options) {
  7976. return parse(merge(defaults, route, options));
  7977. }
  7978. // pkg/dist-src/with-defaults.js
  7979. function withDefaults(oldDefaults, newDefaults) {
  7980. const DEFAULTS2 = merge(oldDefaults, newDefaults);
  7981. const endpoint2 = endpointWithDefaults.bind(null, DEFAULTS2);
  7982. return Object.assign(endpoint2, {
  7983. DEFAULTS: DEFAULTS2,
  7984. defaults: withDefaults.bind(null, DEFAULTS2),
  7985. merge: merge.bind(null, DEFAULTS2),
  7986. parse
  7987. });
  7988. }
  7989. // pkg/dist-src/index.js
  7990. var endpoint = withDefaults(null, DEFAULTS);
  7991. // Annotate the CommonJS export names for ESM import in node:
  7992. 0 && (0);
  7993. /***/ }),
  7994. /***/ 8467:
  7995. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  7996. "use strict";
  7997. var __defProp = Object.defineProperty;
  7998. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  7999. var __getOwnPropNames = Object.getOwnPropertyNames;
  8000. var __hasOwnProp = Object.prototype.hasOwnProperty;
  8001. var __export = (target, all) => {
  8002. for (var name in all)
  8003. __defProp(target, name, { get: all[name], enumerable: true });
  8004. };
  8005. var __copyProps = (to, from, except, desc) => {
  8006. if (from && typeof from === "object" || typeof from === "function") {
  8007. for (let key of __getOwnPropNames(from))
  8008. if (!__hasOwnProp.call(to, key) && key !== except)
  8009. __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  8010. }
  8011. return to;
  8012. };
  8013. var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
  8014. // pkg/dist-src/index.js
  8015. var dist_src_exports = {};
  8016. __export(dist_src_exports, {
  8017. GraphqlResponseError: () => GraphqlResponseError,
  8018. graphql: () => graphql2,
  8019. withCustomRequest: () => withCustomRequest
  8020. });
  8021. module.exports = __toCommonJS(dist_src_exports);
  8022. var import_request3 = __nccwpck_require__(6234);
  8023. var import_universal_user_agent = __nccwpck_require__(5030);
  8024. // pkg/dist-src/version.js
  8025. var VERSION = "7.1.0";
  8026. // pkg/dist-src/with-defaults.js
  8027. var import_request2 = __nccwpck_require__(6234);
  8028. // pkg/dist-src/graphql.js
  8029. var import_request = __nccwpck_require__(6234);
  8030. // pkg/dist-src/error.js
  8031. function _buildMessageForResponseErrors(data) {
  8032. return `Request failed due to following response errors:
  8033. ` + data.errors.map((e) => ` - ${e.message}`).join("\n");
  8034. }
  8035. var GraphqlResponseError = class extends Error {
  8036. constructor(request2, headers, response) {
  8037. super(_buildMessageForResponseErrors(response));
  8038. this.request = request2;
  8039. this.headers = headers;
  8040. this.response = response;
  8041. this.name = "GraphqlResponseError";
  8042. this.errors = response.errors;
  8043. this.data = response.data;
  8044. if (Error.captureStackTrace) {
  8045. Error.captureStackTrace(this, this.constructor);
  8046. }
  8047. }
  8048. };
  8049. // pkg/dist-src/graphql.js
  8050. var NON_VARIABLE_OPTIONS = [
  8051. "method",
  8052. "baseUrl",
  8053. "url",
  8054. "headers",
  8055. "request",
  8056. "query",
  8057. "mediaType"
  8058. ];
  8059. var FORBIDDEN_VARIABLE_OPTIONS = ["query", "method", "url"];
  8060. var GHES_V3_SUFFIX_REGEX = /\/api\/v3\/?$/;
  8061. function graphql(request2, query, options) {
  8062. if (options) {
  8063. if (typeof query === "string" && "query" in options) {
  8064. return Promise.reject(
  8065. new Error(`[@octokit/graphql] "query" cannot be used as variable name`)
  8066. );
  8067. }
  8068. for (const key in options) {
  8069. if (!FORBIDDEN_VARIABLE_OPTIONS.includes(key))
  8070. continue;
  8071. return Promise.reject(
  8072. new Error(
  8073. `[@octokit/graphql] "${key}" cannot be used as variable name`
  8074. )
  8075. );
  8076. }
  8077. }
  8078. const parsedOptions = typeof query === "string" ? Object.assign({ query }, options) : query;
  8079. const requestOptions = Object.keys(
  8080. parsedOptions
  8081. ).reduce((result, key) => {
  8082. if (NON_VARIABLE_OPTIONS.includes(key)) {
  8083. result[key] = parsedOptions[key];
  8084. return result;
  8085. }
  8086. if (!result.variables) {
  8087. result.variables = {};
  8088. }
  8089. result.variables[key] = parsedOptions[key];
  8090. return result;
  8091. }, {});
  8092. const baseUrl = parsedOptions.baseUrl || request2.endpoint.DEFAULTS.baseUrl;
  8093. if (GHES_V3_SUFFIX_REGEX.test(baseUrl)) {
  8094. requestOptions.url = baseUrl.replace(GHES_V3_SUFFIX_REGEX, "/api/graphql");
  8095. }
  8096. return request2(requestOptions).then((response) => {
  8097. if (response.data.errors) {
  8098. const headers = {};
  8099. for (const key of Object.keys(response.headers)) {
  8100. headers[key] = response.headers[key];
  8101. }
  8102. throw new GraphqlResponseError(
  8103. requestOptions,
  8104. headers,
  8105. response.data
  8106. );
  8107. }
  8108. return response.data.data;
  8109. });
  8110. }
  8111. // pkg/dist-src/with-defaults.js
  8112. function withDefaults(request2, newDefaults) {
  8113. const newRequest = request2.defaults(newDefaults);
  8114. const newApi = (query, options) => {
  8115. return graphql(newRequest, query, options);
  8116. };
  8117. return Object.assign(newApi, {
  8118. defaults: withDefaults.bind(null, newRequest),
  8119. endpoint: newRequest.endpoint
  8120. });
  8121. }
  8122. // pkg/dist-src/index.js
  8123. var graphql2 = withDefaults(import_request3.request, {
  8124. headers: {
  8125. "user-agent": `octokit-graphql.js/${VERSION} ${(0, import_universal_user_agent.getUserAgent)()}`
  8126. },
  8127. method: "POST",
  8128. url: "/graphql"
  8129. });
  8130. function withCustomRequest(customRequest) {
  8131. return withDefaults(customRequest, {
  8132. method: "POST",
  8133. url: "/graphql"
  8134. });
  8135. }
  8136. // Annotate the CommonJS export names for ESM import in node:
  8137. 0 && (0);
  8138. /***/ }),
  8139. /***/ 4193:
  8140. /***/ ((module) => {
  8141. "use strict";
  8142. var __defProp = Object.defineProperty;
  8143. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  8144. var __getOwnPropNames = Object.getOwnPropertyNames;
  8145. var __hasOwnProp = Object.prototype.hasOwnProperty;
  8146. var __export = (target, all) => {
  8147. for (var name in all)
  8148. __defProp(target, name, { get: all[name], enumerable: true });
  8149. };
  8150. var __copyProps = (to, from, except, desc) => {
  8151. if (from && typeof from === "object" || typeof from === "function") {
  8152. for (let key of __getOwnPropNames(from))
  8153. if (!__hasOwnProp.call(to, key) && key !== except)
  8154. __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  8155. }
  8156. return to;
  8157. };
  8158. var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
  8159. // pkg/dist-src/index.js
  8160. var dist_src_exports = {};
  8161. __export(dist_src_exports, {
  8162. composePaginateRest: () => composePaginateRest,
  8163. isPaginatingEndpoint: () => isPaginatingEndpoint,
  8164. paginateRest: () => paginateRest,
  8165. paginatingEndpoints: () => paginatingEndpoints
  8166. });
  8167. module.exports = __toCommonJS(dist_src_exports);
  8168. // pkg/dist-src/version.js
  8169. var VERSION = "9.2.2";
  8170. // pkg/dist-src/normalize-paginated-list-response.js
  8171. function normalizePaginatedListResponse(response) {
  8172. if (!response.data) {
  8173. return {
  8174. ...response,
  8175. data: []
  8176. };
  8177. }
  8178. const responseNeedsNormalization = "total_count" in response.data && !("url" in response.data);
  8179. if (!responseNeedsNormalization)
  8180. return response;
  8181. const incompleteResults = response.data.incomplete_results;
  8182. const repositorySelection = response.data.repository_selection;
  8183. const totalCount = response.data.total_count;
  8184. delete response.data.incomplete_results;
  8185. delete response.data.repository_selection;
  8186. delete response.data.total_count;
  8187. const namespaceKey = Object.keys(response.data)[0];
  8188. const data = response.data[namespaceKey];
  8189. response.data = data;
  8190. if (typeof incompleteResults !== "undefined") {
  8191. response.data.incomplete_results = incompleteResults;
  8192. }
  8193. if (typeof repositorySelection !== "undefined") {
  8194. response.data.repository_selection = repositorySelection;
  8195. }
  8196. response.data.total_count = totalCount;
  8197. return response;
  8198. }
  8199. // pkg/dist-src/iterator.js
  8200. function iterator(octokit, route, parameters) {
  8201. const options = typeof route === "function" ? route.endpoint(parameters) : octokit.request.endpoint(route, parameters);
  8202. const requestMethod = typeof route === "function" ? route : octokit.request;
  8203. const method = options.method;
  8204. const headers = options.headers;
  8205. let url = options.url;
  8206. return {
  8207. [Symbol.asyncIterator]: () => ({
  8208. async next() {
  8209. if (!url)
  8210. return { done: true };
  8211. try {
  8212. const response = await requestMethod({ method, url, headers });
  8213. const normalizedResponse = normalizePaginatedListResponse(response);
  8214. url = ((normalizedResponse.headers.link || "").match(
  8215. /<([^<>]+)>;\s*rel="next"/
  8216. ) || [])[1];
  8217. return { value: normalizedResponse };
  8218. } catch (error) {
  8219. if (error.status !== 409)
  8220. throw error;
  8221. url = "";
  8222. return {
  8223. value: {
  8224. status: 200,
  8225. headers: {},
  8226. data: []
  8227. }
  8228. };
  8229. }
  8230. }
  8231. })
  8232. };
  8233. }
  8234. // pkg/dist-src/paginate.js
  8235. function paginate(octokit, route, parameters, mapFn) {
  8236. if (typeof parameters === "function") {
  8237. mapFn = parameters;
  8238. parameters = void 0;
  8239. }
  8240. return gather(
  8241. octokit,
  8242. [],
  8243. iterator(octokit, route, parameters)[Symbol.asyncIterator](),
  8244. mapFn
  8245. );
  8246. }
  8247. function gather(octokit, results, iterator2, mapFn) {
  8248. return iterator2.next().then((result) => {
  8249. if (result.done) {
  8250. return results;
  8251. }
  8252. let earlyExit = false;
  8253. function done() {
  8254. earlyExit = true;
  8255. }
  8256. results = results.concat(
  8257. mapFn ? mapFn(result.value, done) : result.value.data
  8258. );
  8259. if (earlyExit) {
  8260. return results;
  8261. }
  8262. return gather(octokit, results, iterator2, mapFn);
  8263. });
  8264. }
  8265. // pkg/dist-src/compose-paginate.js
  8266. var composePaginateRest = Object.assign(paginate, {
  8267. iterator
  8268. });
  8269. // pkg/dist-src/generated/paginating-endpoints.js
  8270. var paginatingEndpoints = [
  8271. "GET /advisories",
  8272. "GET /app/hook/deliveries",
  8273. "GET /app/installation-requests",
  8274. "GET /app/installations",
  8275. "GET /assignments/{assignment_id}/accepted_assignments",
  8276. "GET /classrooms",
  8277. "GET /classrooms/{classroom_id}/assignments",
  8278. "GET /enterprises/{enterprise}/dependabot/alerts",
  8279. "GET /enterprises/{enterprise}/secret-scanning/alerts",
  8280. "GET /events",
  8281. "GET /gists",
  8282. "GET /gists/public",
  8283. "GET /gists/starred",
  8284. "GET /gists/{gist_id}/comments",
  8285. "GET /gists/{gist_id}/commits",
  8286. "GET /gists/{gist_id}/forks",
  8287. "GET /installation/repositories",
  8288. "GET /issues",
  8289. "GET /licenses",
  8290. "GET /marketplace_listing/plans",
  8291. "GET /marketplace_listing/plans/{plan_id}/accounts",
  8292. "GET /marketplace_listing/stubbed/plans",
  8293. "GET /marketplace_listing/stubbed/plans/{plan_id}/accounts",
  8294. "GET /networks/{owner}/{repo}/events",
  8295. "GET /notifications",
  8296. "GET /organizations",
  8297. "GET /orgs/{org}/actions/cache/usage-by-repository",
  8298. "GET /orgs/{org}/actions/permissions/repositories",
  8299. "GET /orgs/{org}/actions/runners",
  8300. "GET /orgs/{org}/actions/secrets",
  8301. "GET /orgs/{org}/actions/secrets/{secret_name}/repositories",
  8302. "GET /orgs/{org}/actions/variables",
  8303. "GET /orgs/{org}/actions/variables/{name}/repositories",
  8304. "GET /orgs/{org}/blocks",
  8305. "GET /orgs/{org}/code-scanning/alerts",
  8306. "GET /orgs/{org}/codespaces",
  8307. "GET /orgs/{org}/codespaces/secrets",
  8308. "GET /orgs/{org}/codespaces/secrets/{secret_name}/repositories",
  8309. "GET /orgs/{org}/copilot/billing/seats",
  8310. "GET /orgs/{org}/dependabot/alerts",
  8311. "GET /orgs/{org}/dependabot/secrets",
  8312. "GET /orgs/{org}/dependabot/secrets/{secret_name}/repositories",
  8313. "GET /orgs/{org}/events",
  8314. "GET /orgs/{org}/failed_invitations",
  8315. "GET /orgs/{org}/hooks",
  8316. "GET /orgs/{org}/hooks/{hook_id}/deliveries",
  8317. "GET /orgs/{org}/installations",
  8318. "GET /orgs/{org}/invitations",
  8319. "GET /orgs/{org}/invitations/{invitation_id}/teams",
  8320. "GET /orgs/{org}/issues",
  8321. "GET /orgs/{org}/members",
  8322. "GET /orgs/{org}/members/{username}/codespaces",
  8323. "GET /orgs/{org}/migrations",
  8324. "GET /orgs/{org}/migrations/{migration_id}/repositories",
  8325. "GET /orgs/{org}/organization-roles/{role_id}/teams",
  8326. "GET /orgs/{org}/organization-roles/{role_id}/users",
  8327. "GET /orgs/{org}/outside_collaborators",
  8328. "GET /orgs/{org}/packages",
  8329. "GET /orgs/{org}/packages/{package_type}/{package_name}/versions",
  8330. "GET /orgs/{org}/personal-access-token-requests",
  8331. "GET /orgs/{org}/personal-access-token-requests/{pat_request_id}/repositories",
  8332. "GET /orgs/{org}/personal-access-tokens",
  8333. "GET /orgs/{org}/personal-access-tokens/{pat_id}/repositories",
  8334. "GET /orgs/{org}/projects",
  8335. "GET /orgs/{org}/properties/values",
  8336. "GET /orgs/{org}/public_members",
  8337. "GET /orgs/{org}/repos",
  8338. "GET /orgs/{org}/rulesets",
  8339. "GET /orgs/{org}/rulesets/rule-suites",
  8340. "GET /orgs/{org}/secret-scanning/alerts",
  8341. "GET /orgs/{org}/security-advisories",
  8342. "GET /orgs/{org}/teams",
  8343. "GET /orgs/{org}/teams/{team_slug}/discussions",
  8344. "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments",
  8345. "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions",
  8346. "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions",
  8347. "GET /orgs/{org}/teams/{team_slug}/invitations",
  8348. "GET /orgs/{org}/teams/{team_slug}/members",
  8349. "GET /orgs/{org}/teams/{team_slug}/projects",
  8350. "GET /orgs/{org}/teams/{team_slug}/repos",
  8351. "GET /orgs/{org}/teams/{team_slug}/teams",
  8352. "GET /projects/columns/{column_id}/cards",
  8353. "GET /projects/{project_id}/collaborators",
  8354. "GET /projects/{project_id}/columns",
  8355. "GET /repos/{owner}/{repo}/actions/artifacts",
  8356. "GET /repos/{owner}/{repo}/actions/caches",
  8357. "GET /repos/{owner}/{repo}/actions/organization-secrets",
  8358. "GET /repos/{owner}/{repo}/actions/organization-variables",
  8359. "GET /repos/{owner}/{repo}/actions/runners",
  8360. "GET /repos/{owner}/{repo}/actions/runs",
  8361. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts",
  8362. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/jobs",
  8363. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs",
  8364. "GET /repos/{owner}/{repo}/actions/secrets",
  8365. "GET /repos/{owner}/{repo}/actions/variables",
  8366. "GET /repos/{owner}/{repo}/actions/workflows",
  8367. "GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs",
  8368. "GET /repos/{owner}/{repo}/activity",
  8369. "GET /repos/{owner}/{repo}/assignees",
  8370. "GET /repos/{owner}/{repo}/branches",
  8371. "GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations",
  8372. "GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs",
  8373. "GET /repos/{owner}/{repo}/code-scanning/alerts",
  8374. "GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances",
  8375. "GET /repos/{owner}/{repo}/code-scanning/analyses",
  8376. "GET /repos/{owner}/{repo}/codespaces",
  8377. "GET /repos/{owner}/{repo}/codespaces/devcontainers",
  8378. "GET /repos/{owner}/{repo}/codespaces/secrets",
  8379. "GET /repos/{owner}/{repo}/collaborators",
  8380. "GET /repos/{owner}/{repo}/comments",
  8381. "GET /repos/{owner}/{repo}/comments/{comment_id}/reactions",
  8382. "GET /repos/{owner}/{repo}/commits",
  8383. "GET /repos/{owner}/{repo}/commits/{commit_sha}/comments",
  8384. "GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls",
  8385. "GET /repos/{owner}/{repo}/commits/{ref}/check-runs",
  8386. "GET /repos/{owner}/{repo}/commits/{ref}/check-suites",
  8387. "GET /repos/{owner}/{repo}/commits/{ref}/status",
  8388. "GET /repos/{owner}/{repo}/commits/{ref}/statuses",
  8389. "GET /repos/{owner}/{repo}/contributors",
  8390. "GET /repos/{owner}/{repo}/dependabot/alerts",
  8391. "GET /repos/{owner}/{repo}/dependabot/secrets",
  8392. "GET /repos/{owner}/{repo}/deployments",
  8393. "GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses",
  8394. "GET /repos/{owner}/{repo}/environments",
  8395. "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies",
  8396. "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/apps",
  8397. "GET /repos/{owner}/{repo}/events",
  8398. "GET /repos/{owner}/{repo}/forks",
  8399. "GET /repos/{owner}/{repo}/hooks",
  8400. "GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries",
  8401. "GET /repos/{owner}/{repo}/invitations",
  8402. "GET /repos/{owner}/{repo}/issues",
  8403. "GET /repos/{owner}/{repo}/issues/comments",
  8404. "GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions",
  8405. "GET /repos/{owner}/{repo}/issues/events",
  8406. "GET /repos/{owner}/{repo}/issues/{issue_number}/comments",
  8407. "GET /repos/{owner}/{repo}/issues/{issue_number}/events",
  8408. "GET /repos/{owner}/{repo}/issues/{issue_number}/labels",
  8409. "GET /repos/{owner}/{repo}/issues/{issue_number}/reactions",
  8410. "GET /repos/{owner}/{repo}/issues/{issue_number}/timeline",
  8411. "GET /repos/{owner}/{repo}/keys",
  8412. "GET /repos/{owner}/{repo}/labels",
  8413. "GET /repos/{owner}/{repo}/milestones",
  8414. "GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels",
  8415. "GET /repos/{owner}/{repo}/notifications",
  8416. "GET /repos/{owner}/{repo}/pages/builds",
  8417. "GET /repos/{owner}/{repo}/projects",
  8418. "GET /repos/{owner}/{repo}/pulls",
  8419. "GET /repos/{owner}/{repo}/pulls/comments",
  8420. "GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions",
  8421. "GET /repos/{owner}/{repo}/pulls/{pull_number}/comments",
  8422. "GET /repos/{owner}/{repo}/pulls/{pull_number}/commits",
  8423. "GET /repos/{owner}/{repo}/pulls/{pull_number}/files",
  8424. "GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews",
  8425. "GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments",
  8426. "GET /repos/{owner}/{repo}/releases",
  8427. "GET /repos/{owner}/{repo}/releases/{release_id}/assets",
  8428. "GET /repos/{owner}/{repo}/releases/{release_id}/reactions",
  8429. "GET /repos/{owner}/{repo}/rules/branches/{branch}",
  8430. "GET /repos/{owner}/{repo}/rulesets",
  8431. "GET /repos/{owner}/{repo}/rulesets/rule-suites",
  8432. "GET /repos/{owner}/{repo}/secret-scanning/alerts",
  8433. "GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations",
  8434. "GET /repos/{owner}/{repo}/security-advisories",
  8435. "GET /repos/{owner}/{repo}/stargazers",
  8436. "GET /repos/{owner}/{repo}/subscribers",
  8437. "GET /repos/{owner}/{repo}/tags",
  8438. "GET /repos/{owner}/{repo}/teams",
  8439. "GET /repos/{owner}/{repo}/topics",
  8440. "GET /repositories",
  8441. "GET /repositories/{repository_id}/environments/{environment_name}/secrets",
  8442. "GET /repositories/{repository_id}/environments/{environment_name}/variables",
  8443. "GET /search/code",
  8444. "GET /search/commits",
  8445. "GET /search/issues",
  8446. "GET /search/labels",
  8447. "GET /search/repositories",
  8448. "GET /search/topics",
  8449. "GET /search/users",
  8450. "GET /teams/{team_id}/discussions",
  8451. "GET /teams/{team_id}/discussions/{discussion_number}/comments",
  8452. "GET /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions",
  8453. "GET /teams/{team_id}/discussions/{discussion_number}/reactions",
  8454. "GET /teams/{team_id}/invitations",
  8455. "GET /teams/{team_id}/members",
  8456. "GET /teams/{team_id}/projects",
  8457. "GET /teams/{team_id}/repos",
  8458. "GET /teams/{team_id}/teams",
  8459. "GET /user/blocks",
  8460. "GET /user/codespaces",
  8461. "GET /user/codespaces/secrets",
  8462. "GET /user/emails",
  8463. "GET /user/followers",
  8464. "GET /user/following",
  8465. "GET /user/gpg_keys",
  8466. "GET /user/installations",
  8467. "GET /user/installations/{installation_id}/repositories",
  8468. "GET /user/issues",
  8469. "GET /user/keys",
  8470. "GET /user/marketplace_purchases",
  8471. "GET /user/marketplace_purchases/stubbed",
  8472. "GET /user/memberships/orgs",
  8473. "GET /user/migrations",
  8474. "GET /user/migrations/{migration_id}/repositories",
  8475. "GET /user/orgs",
  8476. "GET /user/packages",
  8477. "GET /user/packages/{package_type}/{package_name}/versions",
  8478. "GET /user/public_emails",
  8479. "GET /user/repos",
  8480. "GET /user/repository_invitations",
  8481. "GET /user/social_accounts",
  8482. "GET /user/ssh_signing_keys",
  8483. "GET /user/starred",
  8484. "GET /user/subscriptions",
  8485. "GET /user/teams",
  8486. "GET /users",
  8487. "GET /users/{username}/events",
  8488. "GET /users/{username}/events/orgs/{org}",
  8489. "GET /users/{username}/events/public",
  8490. "GET /users/{username}/followers",
  8491. "GET /users/{username}/following",
  8492. "GET /users/{username}/gists",
  8493. "GET /users/{username}/gpg_keys",
  8494. "GET /users/{username}/keys",
  8495. "GET /users/{username}/orgs",
  8496. "GET /users/{username}/packages",
  8497. "GET /users/{username}/projects",
  8498. "GET /users/{username}/received_events",
  8499. "GET /users/{username}/received_events/public",
  8500. "GET /users/{username}/repos",
  8501. "GET /users/{username}/social_accounts",
  8502. "GET /users/{username}/ssh_signing_keys",
  8503. "GET /users/{username}/starred",
  8504. "GET /users/{username}/subscriptions"
  8505. ];
  8506. // pkg/dist-src/paginating-endpoints.js
  8507. function isPaginatingEndpoint(arg) {
  8508. if (typeof arg === "string") {
  8509. return paginatingEndpoints.includes(arg);
  8510. } else {
  8511. return false;
  8512. }
  8513. }
  8514. // pkg/dist-src/index.js
  8515. function paginateRest(octokit) {
  8516. return {
  8517. paginate: Object.assign(paginate.bind(null, octokit), {
  8518. iterator: iterator.bind(null, octokit)
  8519. })
  8520. };
  8521. }
  8522. paginateRest.VERSION = VERSION;
  8523. // Annotate the CommonJS export names for ESM import in node:
  8524. 0 && (0);
  8525. /***/ }),
  8526. /***/ 3044:
  8527. /***/ ((module) => {
  8528. "use strict";
  8529. var __defProp = Object.defineProperty;
  8530. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  8531. var __getOwnPropNames = Object.getOwnPropertyNames;
  8532. var __hasOwnProp = Object.prototype.hasOwnProperty;
  8533. var __export = (target, all) => {
  8534. for (var name in all)
  8535. __defProp(target, name, { get: all[name], enumerable: true });
  8536. };
  8537. var __copyProps = (to, from, except, desc) => {
  8538. if (from && typeof from === "object" || typeof from === "function") {
  8539. for (let key of __getOwnPropNames(from))
  8540. if (!__hasOwnProp.call(to, key) && key !== except)
  8541. __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  8542. }
  8543. return to;
  8544. };
  8545. var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
  8546. // pkg/dist-src/index.js
  8547. var dist_src_exports = {};
  8548. __export(dist_src_exports, {
  8549. legacyRestEndpointMethods: () => legacyRestEndpointMethods,
  8550. restEndpointMethods: () => restEndpointMethods
  8551. });
  8552. module.exports = __toCommonJS(dist_src_exports);
  8553. // pkg/dist-src/version.js
  8554. var VERSION = "10.4.1";
  8555. // pkg/dist-src/generated/endpoints.js
  8556. var Endpoints = {
  8557. actions: {
  8558. addCustomLabelsToSelfHostedRunnerForOrg: [
  8559. "POST /orgs/{org}/actions/runners/{runner_id}/labels"
  8560. ],
  8561. addCustomLabelsToSelfHostedRunnerForRepo: [
  8562. "POST /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"
  8563. ],
  8564. addSelectedRepoToOrgSecret: [
  8565. "PUT /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}"
  8566. ],
  8567. addSelectedRepoToOrgVariable: [
  8568. "PUT /orgs/{org}/actions/variables/{name}/repositories/{repository_id}"
  8569. ],
  8570. approveWorkflowRun: [
  8571. "POST /repos/{owner}/{repo}/actions/runs/{run_id}/approve"
  8572. ],
  8573. cancelWorkflowRun: [
  8574. "POST /repos/{owner}/{repo}/actions/runs/{run_id}/cancel"
  8575. ],
  8576. createEnvironmentVariable: [
  8577. "POST /repositories/{repository_id}/environments/{environment_name}/variables"
  8578. ],
  8579. createOrUpdateEnvironmentSecret: [
  8580. "PUT /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}"
  8581. ],
  8582. createOrUpdateOrgSecret: ["PUT /orgs/{org}/actions/secrets/{secret_name}"],
  8583. createOrUpdateRepoSecret: [
  8584. "PUT /repos/{owner}/{repo}/actions/secrets/{secret_name}"
  8585. ],
  8586. createOrgVariable: ["POST /orgs/{org}/actions/variables"],
  8587. createRegistrationTokenForOrg: [
  8588. "POST /orgs/{org}/actions/runners/registration-token"
  8589. ],
  8590. createRegistrationTokenForRepo: [
  8591. "POST /repos/{owner}/{repo}/actions/runners/registration-token"
  8592. ],
  8593. createRemoveTokenForOrg: ["POST /orgs/{org}/actions/runners/remove-token"],
  8594. createRemoveTokenForRepo: [
  8595. "POST /repos/{owner}/{repo}/actions/runners/remove-token"
  8596. ],
  8597. createRepoVariable: ["POST /repos/{owner}/{repo}/actions/variables"],
  8598. createWorkflowDispatch: [
  8599. "POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches"
  8600. ],
  8601. deleteActionsCacheById: [
  8602. "DELETE /repos/{owner}/{repo}/actions/caches/{cache_id}"
  8603. ],
  8604. deleteActionsCacheByKey: [
  8605. "DELETE /repos/{owner}/{repo}/actions/caches{?key,ref}"
  8606. ],
  8607. deleteArtifact: [
  8608. "DELETE /repos/{owner}/{repo}/actions/artifacts/{artifact_id}"
  8609. ],
  8610. deleteEnvironmentSecret: [
  8611. "DELETE /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}"
  8612. ],
  8613. deleteEnvironmentVariable: [
  8614. "DELETE /repositories/{repository_id}/environments/{environment_name}/variables/{name}"
  8615. ],
  8616. deleteOrgSecret: ["DELETE /orgs/{org}/actions/secrets/{secret_name}"],
  8617. deleteOrgVariable: ["DELETE /orgs/{org}/actions/variables/{name}"],
  8618. deleteRepoSecret: [
  8619. "DELETE /repos/{owner}/{repo}/actions/secrets/{secret_name}"
  8620. ],
  8621. deleteRepoVariable: [
  8622. "DELETE /repos/{owner}/{repo}/actions/variables/{name}"
  8623. ],
  8624. deleteSelfHostedRunnerFromOrg: [
  8625. "DELETE /orgs/{org}/actions/runners/{runner_id}"
  8626. ],
  8627. deleteSelfHostedRunnerFromRepo: [
  8628. "DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}"
  8629. ],
  8630. deleteWorkflowRun: ["DELETE /repos/{owner}/{repo}/actions/runs/{run_id}"],
  8631. deleteWorkflowRunLogs: [
  8632. "DELETE /repos/{owner}/{repo}/actions/runs/{run_id}/logs"
  8633. ],
  8634. disableSelectedRepositoryGithubActionsOrganization: [
  8635. "DELETE /orgs/{org}/actions/permissions/repositories/{repository_id}"
  8636. ],
  8637. disableWorkflow: [
  8638. "PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/disable"
  8639. ],
  8640. downloadArtifact: [
  8641. "GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}"
  8642. ],
  8643. downloadJobLogsForWorkflowRun: [
  8644. "GET /repos/{owner}/{repo}/actions/jobs/{job_id}/logs"
  8645. ],
  8646. downloadWorkflowRunAttemptLogs: [
  8647. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/logs"
  8648. ],
  8649. downloadWorkflowRunLogs: [
  8650. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/logs"
  8651. ],
  8652. enableSelectedRepositoryGithubActionsOrganization: [
  8653. "PUT /orgs/{org}/actions/permissions/repositories/{repository_id}"
  8654. ],
  8655. enableWorkflow: [
  8656. "PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/enable"
  8657. ],
  8658. forceCancelWorkflowRun: [
  8659. "POST /repos/{owner}/{repo}/actions/runs/{run_id}/force-cancel"
  8660. ],
  8661. generateRunnerJitconfigForOrg: [
  8662. "POST /orgs/{org}/actions/runners/generate-jitconfig"
  8663. ],
  8664. generateRunnerJitconfigForRepo: [
  8665. "POST /repos/{owner}/{repo}/actions/runners/generate-jitconfig"
  8666. ],
  8667. getActionsCacheList: ["GET /repos/{owner}/{repo}/actions/caches"],
  8668. getActionsCacheUsage: ["GET /repos/{owner}/{repo}/actions/cache/usage"],
  8669. getActionsCacheUsageByRepoForOrg: [
  8670. "GET /orgs/{org}/actions/cache/usage-by-repository"
  8671. ],
  8672. getActionsCacheUsageForOrg: ["GET /orgs/{org}/actions/cache/usage"],
  8673. getAllowedActionsOrganization: [
  8674. "GET /orgs/{org}/actions/permissions/selected-actions"
  8675. ],
  8676. getAllowedActionsRepository: [
  8677. "GET /repos/{owner}/{repo}/actions/permissions/selected-actions"
  8678. ],
  8679. getArtifact: ["GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}"],
  8680. getCustomOidcSubClaimForRepo: [
  8681. "GET /repos/{owner}/{repo}/actions/oidc/customization/sub"
  8682. ],
  8683. getEnvironmentPublicKey: [
  8684. "GET /repositories/{repository_id}/environments/{environment_name}/secrets/public-key"
  8685. ],
  8686. getEnvironmentSecret: [
  8687. "GET /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}"
  8688. ],
  8689. getEnvironmentVariable: [
  8690. "GET /repositories/{repository_id}/environments/{environment_name}/variables/{name}"
  8691. ],
  8692. getGithubActionsDefaultWorkflowPermissionsOrganization: [
  8693. "GET /orgs/{org}/actions/permissions/workflow"
  8694. ],
  8695. getGithubActionsDefaultWorkflowPermissionsRepository: [
  8696. "GET /repos/{owner}/{repo}/actions/permissions/workflow"
  8697. ],
  8698. getGithubActionsPermissionsOrganization: [
  8699. "GET /orgs/{org}/actions/permissions"
  8700. ],
  8701. getGithubActionsPermissionsRepository: [
  8702. "GET /repos/{owner}/{repo}/actions/permissions"
  8703. ],
  8704. getJobForWorkflowRun: ["GET /repos/{owner}/{repo}/actions/jobs/{job_id}"],
  8705. getOrgPublicKey: ["GET /orgs/{org}/actions/secrets/public-key"],
  8706. getOrgSecret: ["GET /orgs/{org}/actions/secrets/{secret_name}"],
  8707. getOrgVariable: ["GET /orgs/{org}/actions/variables/{name}"],
  8708. getPendingDeploymentsForRun: [
  8709. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments"
  8710. ],
  8711. getRepoPermissions: [
  8712. "GET /repos/{owner}/{repo}/actions/permissions",
  8713. {},
  8714. { renamed: ["actions", "getGithubActionsPermissionsRepository"] }
  8715. ],
  8716. getRepoPublicKey: ["GET /repos/{owner}/{repo}/actions/secrets/public-key"],
  8717. getRepoSecret: ["GET /repos/{owner}/{repo}/actions/secrets/{secret_name}"],
  8718. getRepoVariable: ["GET /repos/{owner}/{repo}/actions/variables/{name}"],
  8719. getReviewsForRun: [
  8720. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/approvals"
  8721. ],
  8722. getSelfHostedRunnerForOrg: ["GET /orgs/{org}/actions/runners/{runner_id}"],
  8723. getSelfHostedRunnerForRepo: [
  8724. "GET /repos/{owner}/{repo}/actions/runners/{runner_id}"
  8725. ],
  8726. getWorkflow: ["GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}"],
  8727. getWorkflowAccessToRepository: [
  8728. "GET /repos/{owner}/{repo}/actions/permissions/access"
  8729. ],
  8730. getWorkflowRun: ["GET /repos/{owner}/{repo}/actions/runs/{run_id}"],
  8731. getWorkflowRunAttempt: [
  8732. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}"
  8733. ],
  8734. getWorkflowRunUsage: [
  8735. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/timing"
  8736. ],
  8737. getWorkflowUsage: [
  8738. "GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/timing"
  8739. ],
  8740. listArtifactsForRepo: ["GET /repos/{owner}/{repo}/actions/artifacts"],
  8741. listEnvironmentSecrets: [
  8742. "GET /repositories/{repository_id}/environments/{environment_name}/secrets"
  8743. ],
  8744. listEnvironmentVariables: [
  8745. "GET /repositories/{repository_id}/environments/{environment_name}/variables"
  8746. ],
  8747. listJobsForWorkflowRun: [
  8748. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs"
  8749. ],
  8750. listJobsForWorkflowRunAttempt: [
  8751. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/jobs"
  8752. ],
  8753. listLabelsForSelfHostedRunnerForOrg: [
  8754. "GET /orgs/{org}/actions/runners/{runner_id}/labels"
  8755. ],
  8756. listLabelsForSelfHostedRunnerForRepo: [
  8757. "GET /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"
  8758. ],
  8759. listOrgSecrets: ["GET /orgs/{org}/actions/secrets"],
  8760. listOrgVariables: ["GET /orgs/{org}/actions/variables"],
  8761. listRepoOrganizationSecrets: [
  8762. "GET /repos/{owner}/{repo}/actions/organization-secrets"
  8763. ],
  8764. listRepoOrganizationVariables: [
  8765. "GET /repos/{owner}/{repo}/actions/organization-variables"
  8766. ],
  8767. listRepoSecrets: ["GET /repos/{owner}/{repo}/actions/secrets"],
  8768. listRepoVariables: ["GET /repos/{owner}/{repo}/actions/variables"],
  8769. listRepoWorkflows: ["GET /repos/{owner}/{repo}/actions/workflows"],
  8770. listRunnerApplicationsForOrg: ["GET /orgs/{org}/actions/runners/downloads"],
  8771. listRunnerApplicationsForRepo: [
  8772. "GET /repos/{owner}/{repo}/actions/runners/downloads"
  8773. ],
  8774. listSelectedReposForOrgSecret: [
  8775. "GET /orgs/{org}/actions/secrets/{secret_name}/repositories"
  8776. ],
  8777. listSelectedReposForOrgVariable: [
  8778. "GET /orgs/{org}/actions/variables/{name}/repositories"
  8779. ],
  8780. listSelectedRepositoriesEnabledGithubActionsOrganization: [
  8781. "GET /orgs/{org}/actions/permissions/repositories"
  8782. ],
  8783. listSelfHostedRunnersForOrg: ["GET /orgs/{org}/actions/runners"],
  8784. listSelfHostedRunnersForRepo: ["GET /repos/{owner}/{repo}/actions/runners"],
  8785. listWorkflowRunArtifacts: [
  8786. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts"
  8787. ],
  8788. listWorkflowRuns: [
  8789. "GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs"
  8790. ],
  8791. listWorkflowRunsForRepo: ["GET /repos/{owner}/{repo}/actions/runs"],
  8792. reRunJobForWorkflowRun: [
  8793. "POST /repos/{owner}/{repo}/actions/jobs/{job_id}/rerun"
  8794. ],
  8795. reRunWorkflow: ["POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun"],
  8796. reRunWorkflowFailedJobs: [
  8797. "POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun-failed-jobs"
  8798. ],
  8799. removeAllCustomLabelsFromSelfHostedRunnerForOrg: [
  8800. "DELETE /orgs/{org}/actions/runners/{runner_id}/labels"
  8801. ],
  8802. removeAllCustomLabelsFromSelfHostedRunnerForRepo: [
  8803. "DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"
  8804. ],
  8805. removeCustomLabelFromSelfHostedRunnerForOrg: [
  8806. "DELETE /orgs/{org}/actions/runners/{runner_id}/labels/{name}"
  8807. ],
  8808. removeCustomLabelFromSelfHostedRunnerForRepo: [
  8809. "DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}/labels/{name}"
  8810. ],
  8811. removeSelectedRepoFromOrgSecret: [
  8812. "DELETE /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}"
  8813. ],
  8814. removeSelectedRepoFromOrgVariable: [
  8815. "DELETE /orgs/{org}/actions/variables/{name}/repositories/{repository_id}"
  8816. ],
  8817. reviewCustomGatesForRun: [
  8818. "POST /repos/{owner}/{repo}/actions/runs/{run_id}/deployment_protection_rule"
  8819. ],
  8820. reviewPendingDeploymentsForRun: [
  8821. "POST /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments"
  8822. ],
  8823. setAllowedActionsOrganization: [
  8824. "PUT /orgs/{org}/actions/permissions/selected-actions"
  8825. ],
  8826. setAllowedActionsRepository: [
  8827. "PUT /repos/{owner}/{repo}/actions/permissions/selected-actions"
  8828. ],
  8829. setCustomLabelsForSelfHostedRunnerForOrg: [
  8830. "PUT /orgs/{org}/actions/runners/{runner_id}/labels"
  8831. ],
  8832. setCustomLabelsForSelfHostedRunnerForRepo: [
  8833. "PUT /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"
  8834. ],
  8835. setCustomOidcSubClaimForRepo: [
  8836. "PUT /repos/{owner}/{repo}/actions/oidc/customization/sub"
  8837. ],
  8838. setGithubActionsDefaultWorkflowPermissionsOrganization: [
  8839. "PUT /orgs/{org}/actions/permissions/workflow"
  8840. ],
  8841. setGithubActionsDefaultWorkflowPermissionsRepository: [
  8842. "PUT /repos/{owner}/{repo}/actions/permissions/workflow"
  8843. ],
  8844. setGithubActionsPermissionsOrganization: [
  8845. "PUT /orgs/{org}/actions/permissions"
  8846. ],
  8847. setGithubActionsPermissionsRepository: [
  8848. "PUT /repos/{owner}/{repo}/actions/permissions"
  8849. ],
  8850. setSelectedReposForOrgSecret: [
  8851. "PUT /orgs/{org}/actions/secrets/{secret_name}/repositories"
  8852. ],
  8853. setSelectedReposForOrgVariable: [
  8854. "PUT /orgs/{org}/actions/variables/{name}/repositories"
  8855. ],
  8856. setSelectedRepositoriesEnabledGithubActionsOrganization: [
  8857. "PUT /orgs/{org}/actions/permissions/repositories"
  8858. ],
  8859. setWorkflowAccessToRepository: [
  8860. "PUT /repos/{owner}/{repo}/actions/permissions/access"
  8861. ],
  8862. updateEnvironmentVariable: [
  8863. "PATCH /repositories/{repository_id}/environments/{environment_name}/variables/{name}"
  8864. ],
  8865. updateOrgVariable: ["PATCH /orgs/{org}/actions/variables/{name}"],
  8866. updateRepoVariable: [
  8867. "PATCH /repos/{owner}/{repo}/actions/variables/{name}"
  8868. ]
  8869. },
  8870. activity: {
  8871. checkRepoIsStarredByAuthenticatedUser: ["GET /user/starred/{owner}/{repo}"],
  8872. deleteRepoSubscription: ["DELETE /repos/{owner}/{repo}/subscription"],
  8873. deleteThreadSubscription: [
  8874. "DELETE /notifications/threads/{thread_id}/subscription"
  8875. ],
  8876. getFeeds: ["GET /feeds"],
  8877. getRepoSubscription: ["GET /repos/{owner}/{repo}/subscription"],
  8878. getThread: ["GET /notifications/threads/{thread_id}"],
  8879. getThreadSubscriptionForAuthenticatedUser: [
  8880. "GET /notifications/threads/{thread_id}/subscription"
  8881. ],
  8882. listEventsForAuthenticatedUser: ["GET /users/{username}/events"],
  8883. listNotificationsForAuthenticatedUser: ["GET /notifications"],
  8884. listOrgEventsForAuthenticatedUser: [
  8885. "GET /users/{username}/events/orgs/{org}"
  8886. ],
  8887. listPublicEvents: ["GET /events"],
  8888. listPublicEventsForRepoNetwork: ["GET /networks/{owner}/{repo}/events"],
  8889. listPublicEventsForUser: ["GET /users/{username}/events/public"],
  8890. listPublicOrgEvents: ["GET /orgs/{org}/events"],
  8891. listReceivedEventsForUser: ["GET /users/{username}/received_events"],
  8892. listReceivedPublicEventsForUser: [
  8893. "GET /users/{username}/received_events/public"
  8894. ],
  8895. listRepoEvents: ["GET /repos/{owner}/{repo}/events"],
  8896. listRepoNotificationsForAuthenticatedUser: [
  8897. "GET /repos/{owner}/{repo}/notifications"
  8898. ],
  8899. listReposStarredByAuthenticatedUser: ["GET /user/starred"],
  8900. listReposStarredByUser: ["GET /users/{username}/starred"],
  8901. listReposWatchedByUser: ["GET /users/{username}/subscriptions"],
  8902. listStargazersForRepo: ["GET /repos/{owner}/{repo}/stargazers"],
  8903. listWatchedReposForAuthenticatedUser: ["GET /user/subscriptions"],
  8904. listWatchersForRepo: ["GET /repos/{owner}/{repo}/subscribers"],
  8905. markNotificationsAsRead: ["PUT /notifications"],
  8906. markRepoNotificationsAsRead: ["PUT /repos/{owner}/{repo}/notifications"],
  8907. markThreadAsDone: ["DELETE /notifications/threads/{thread_id}"],
  8908. markThreadAsRead: ["PATCH /notifications/threads/{thread_id}"],
  8909. setRepoSubscription: ["PUT /repos/{owner}/{repo}/subscription"],
  8910. setThreadSubscription: [
  8911. "PUT /notifications/threads/{thread_id}/subscription"
  8912. ],
  8913. starRepoForAuthenticatedUser: ["PUT /user/starred/{owner}/{repo}"],
  8914. unstarRepoForAuthenticatedUser: ["DELETE /user/starred/{owner}/{repo}"]
  8915. },
  8916. apps: {
  8917. addRepoToInstallation: [
  8918. "PUT /user/installations/{installation_id}/repositories/{repository_id}",
  8919. {},
  8920. { renamed: ["apps", "addRepoToInstallationForAuthenticatedUser"] }
  8921. ],
  8922. addRepoToInstallationForAuthenticatedUser: [
  8923. "PUT /user/installations/{installation_id}/repositories/{repository_id}"
  8924. ],
  8925. checkToken: ["POST /applications/{client_id}/token"],
  8926. createFromManifest: ["POST /app-manifests/{code}/conversions"],
  8927. createInstallationAccessToken: [
  8928. "POST /app/installations/{installation_id}/access_tokens"
  8929. ],
  8930. deleteAuthorization: ["DELETE /applications/{client_id}/grant"],
  8931. deleteInstallation: ["DELETE /app/installations/{installation_id}"],
  8932. deleteToken: ["DELETE /applications/{client_id}/token"],
  8933. getAuthenticated: ["GET /app"],
  8934. getBySlug: ["GET /apps/{app_slug}"],
  8935. getInstallation: ["GET /app/installations/{installation_id}"],
  8936. getOrgInstallation: ["GET /orgs/{org}/installation"],
  8937. getRepoInstallation: ["GET /repos/{owner}/{repo}/installation"],
  8938. getSubscriptionPlanForAccount: [
  8939. "GET /marketplace_listing/accounts/{account_id}"
  8940. ],
  8941. getSubscriptionPlanForAccountStubbed: [
  8942. "GET /marketplace_listing/stubbed/accounts/{account_id}"
  8943. ],
  8944. getUserInstallation: ["GET /users/{username}/installation"],
  8945. getWebhookConfigForApp: ["GET /app/hook/config"],
  8946. getWebhookDelivery: ["GET /app/hook/deliveries/{delivery_id}"],
  8947. listAccountsForPlan: ["GET /marketplace_listing/plans/{plan_id}/accounts"],
  8948. listAccountsForPlanStubbed: [
  8949. "GET /marketplace_listing/stubbed/plans/{plan_id}/accounts"
  8950. ],
  8951. listInstallationReposForAuthenticatedUser: [
  8952. "GET /user/installations/{installation_id}/repositories"
  8953. ],
  8954. listInstallationRequestsForAuthenticatedApp: [
  8955. "GET /app/installation-requests"
  8956. ],
  8957. listInstallations: ["GET /app/installations"],
  8958. listInstallationsForAuthenticatedUser: ["GET /user/installations"],
  8959. listPlans: ["GET /marketplace_listing/plans"],
  8960. listPlansStubbed: ["GET /marketplace_listing/stubbed/plans"],
  8961. listReposAccessibleToInstallation: ["GET /installation/repositories"],
  8962. listSubscriptionsForAuthenticatedUser: ["GET /user/marketplace_purchases"],
  8963. listSubscriptionsForAuthenticatedUserStubbed: [
  8964. "GET /user/marketplace_purchases/stubbed"
  8965. ],
  8966. listWebhookDeliveries: ["GET /app/hook/deliveries"],
  8967. redeliverWebhookDelivery: [
  8968. "POST /app/hook/deliveries/{delivery_id}/attempts"
  8969. ],
  8970. removeRepoFromInstallation: [
  8971. "DELETE /user/installations/{installation_id}/repositories/{repository_id}",
  8972. {},
  8973. { renamed: ["apps", "removeRepoFromInstallationForAuthenticatedUser"] }
  8974. ],
  8975. removeRepoFromInstallationForAuthenticatedUser: [
  8976. "DELETE /user/installations/{installation_id}/repositories/{repository_id}"
  8977. ],
  8978. resetToken: ["PATCH /applications/{client_id}/token"],
  8979. revokeInstallationAccessToken: ["DELETE /installation/token"],
  8980. scopeToken: ["POST /applications/{client_id}/token/scoped"],
  8981. suspendInstallation: ["PUT /app/installations/{installation_id}/suspended"],
  8982. unsuspendInstallation: [
  8983. "DELETE /app/installations/{installation_id}/suspended"
  8984. ],
  8985. updateWebhookConfigForApp: ["PATCH /app/hook/config"]
  8986. },
  8987. billing: {
  8988. getGithubActionsBillingOrg: ["GET /orgs/{org}/settings/billing/actions"],
  8989. getGithubActionsBillingUser: [
  8990. "GET /users/{username}/settings/billing/actions"
  8991. ],
  8992. getGithubPackagesBillingOrg: ["GET /orgs/{org}/settings/billing/packages"],
  8993. getGithubPackagesBillingUser: [
  8994. "GET /users/{username}/settings/billing/packages"
  8995. ],
  8996. getSharedStorageBillingOrg: [
  8997. "GET /orgs/{org}/settings/billing/shared-storage"
  8998. ],
  8999. getSharedStorageBillingUser: [
  9000. "GET /users/{username}/settings/billing/shared-storage"
  9001. ]
  9002. },
  9003. checks: {
  9004. create: ["POST /repos/{owner}/{repo}/check-runs"],
  9005. createSuite: ["POST /repos/{owner}/{repo}/check-suites"],
  9006. get: ["GET /repos/{owner}/{repo}/check-runs/{check_run_id}"],
  9007. getSuite: ["GET /repos/{owner}/{repo}/check-suites/{check_suite_id}"],
  9008. listAnnotations: [
  9009. "GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations"
  9010. ],
  9011. listForRef: ["GET /repos/{owner}/{repo}/commits/{ref}/check-runs"],
  9012. listForSuite: [
  9013. "GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs"
  9014. ],
  9015. listSuitesForRef: ["GET /repos/{owner}/{repo}/commits/{ref}/check-suites"],
  9016. rerequestRun: [
  9017. "POST /repos/{owner}/{repo}/check-runs/{check_run_id}/rerequest"
  9018. ],
  9019. rerequestSuite: [
  9020. "POST /repos/{owner}/{repo}/check-suites/{check_suite_id}/rerequest"
  9021. ],
  9022. setSuitesPreferences: [
  9023. "PATCH /repos/{owner}/{repo}/check-suites/preferences"
  9024. ],
  9025. update: ["PATCH /repos/{owner}/{repo}/check-runs/{check_run_id}"]
  9026. },
  9027. codeScanning: {
  9028. deleteAnalysis: [
  9029. "DELETE /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}{?confirm_delete}"
  9030. ],
  9031. getAlert: [
  9032. "GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}",
  9033. {},
  9034. { renamedParameters: { alert_id: "alert_number" } }
  9035. ],
  9036. getAnalysis: [
  9037. "GET /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}"
  9038. ],
  9039. getCodeqlDatabase: [
  9040. "GET /repos/{owner}/{repo}/code-scanning/codeql/databases/{language}"
  9041. ],
  9042. getDefaultSetup: ["GET /repos/{owner}/{repo}/code-scanning/default-setup"],
  9043. getSarif: ["GET /repos/{owner}/{repo}/code-scanning/sarifs/{sarif_id}"],
  9044. listAlertInstances: [
  9045. "GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances"
  9046. ],
  9047. listAlertsForOrg: ["GET /orgs/{org}/code-scanning/alerts"],
  9048. listAlertsForRepo: ["GET /repos/{owner}/{repo}/code-scanning/alerts"],
  9049. listAlertsInstances: [
  9050. "GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances",
  9051. {},
  9052. { renamed: ["codeScanning", "listAlertInstances"] }
  9053. ],
  9054. listCodeqlDatabases: [
  9055. "GET /repos/{owner}/{repo}/code-scanning/codeql/databases"
  9056. ],
  9057. listRecentAnalyses: ["GET /repos/{owner}/{repo}/code-scanning/analyses"],
  9058. updateAlert: [
  9059. "PATCH /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}"
  9060. ],
  9061. updateDefaultSetup: [
  9062. "PATCH /repos/{owner}/{repo}/code-scanning/default-setup"
  9063. ],
  9064. uploadSarif: ["POST /repos/{owner}/{repo}/code-scanning/sarifs"]
  9065. },
  9066. codesOfConduct: {
  9067. getAllCodesOfConduct: ["GET /codes_of_conduct"],
  9068. getConductCode: ["GET /codes_of_conduct/{key}"]
  9069. },
  9070. codespaces: {
  9071. addRepositoryForSecretForAuthenticatedUser: [
  9072. "PUT /user/codespaces/secrets/{secret_name}/repositories/{repository_id}"
  9073. ],
  9074. addSelectedRepoToOrgSecret: [
  9075. "PUT /orgs/{org}/codespaces/secrets/{secret_name}/repositories/{repository_id}"
  9076. ],
  9077. checkPermissionsForDevcontainer: [
  9078. "GET /repos/{owner}/{repo}/codespaces/permissions_check"
  9079. ],
  9080. codespaceMachinesForAuthenticatedUser: [
  9081. "GET /user/codespaces/{codespace_name}/machines"
  9082. ],
  9083. createForAuthenticatedUser: ["POST /user/codespaces"],
  9084. createOrUpdateOrgSecret: [
  9085. "PUT /orgs/{org}/codespaces/secrets/{secret_name}"
  9086. ],
  9087. createOrUpdateRepoSecret: [
  9088. "PUT /repos/{owner}/{repo}/codespaces/secrets/{secret_name}"
  9089. ],
  9090. createOrUpdateSecretForAuthenticatedUser: [
  9091. "PUT /user/codespaces/secrets/{secret_name}"
  9092. ],
  9093. createWithPrForAuthenticatedUser: [
  9094. "POST /repos/{owner}/{repo}/pulls/{pull_number}/codespaces"
  9095. ],
  9096. createWithRepoForAuthenticatedUser: [
  9097. "POST /repos/{owner}/{repo}/codespaces"
  9098. ],
  9099. deleteForAuthenticatedUser: ["DELETE /user/codespaces/{codespace_name}"],
  9100. deleteFromOrganization: [
  9101. "DELETE /orgs/{org}/members/{username}/codespaces/{codespace_name}"
  9102. ],
  9103. deleteOrgSecret: ["DELETE /orgs/{org}/codespaces/secrets/{secret_name}"],
  9104. deleteRepoSecret: [
  9105. "DELETE /repos/{owner}/{repo}/codespaces/secrets/{secret_name}"
  9106. ],
  9107. deleteSecretForAuthenticatedUser: [
  9108. "DELETE /user/codespaces/secrets/{secret_name}"
  9109. ],
  9110. exportForAuthenticatedUser: [
  9111. "POST /user/codespaces/{codespace_name}/exports"
  9112. ],
  9113. getCodespacesForUserInOrg: [
  9114. "GET /orgs/{org}/members/{username}/codespaces"
  9115. ],
  9116. getExportDetailsForAuthenticatedUser: [
  9117. "GET /user/codespaces/{codespace_name}/exports/{export_id}"
  9118. ],
  9119. getForAuthenticatedUser: ["GET /user/codespaces/{codespace_name}"],
  9120. getOrgPublicKey: ["GET /orgs/{org}/codespaces/secrets/public-key"],
  9121. getOrgSecret: ["GET /orgs/{org}/codespaces/secrets/{secret_name}"],
  9122. getPublicKeyForAuthenticatedUser: [
  9123. "GET /user/codespaces/secrets/public-key"
  9124. ],
  9125. getRepoPublicKey: [
  9126. "GET /repos/{owner}/{repo}/codespaces/secrets/public-key"
  9127. ],
  9128. getRepoSecret: [
  9129. "GET /repos/{owner}/{repo}/codespaces/secrets/{secret_name}"
  9130. ],
  9131. getSecretForAuthenticatedUser: [
  9132. "GET /user/codespaces/secrets/{secret_name}"
  9133. ],
  9134. listDevcontainersInRepositoryForAuthenticatedUser: [
  9135. "GET /repos/{owner}/{repo}/codespaces/devcontainers"
  9136. ],
  9137. listForAuthenticatedUser: ["GET /user/codespaces"],
  9138. listInOrganization: [
  9139. "GET /orgs/{org}/codespaces",
  9140. {},
  9141. { renamedParameters: { org_id: "org" } }
  9142. ],
  9143. listInRepositoryForAuthenticatedUser: [
  9144. "GET /repos/{owner}/{repo}/codespaces"
  9145. ],
  9146. listOrgSecrets: ["GET /orgs/{org}/codespaces/secrets"],
  9147. listRepoSecrets: ["GET /repos/{owner}/{repo}/codespaces/secrets"],
  9148. listRepositoriesForSecretForAuthenticatedUser: [
  9149. "GET /user/codespaces/secrets/{secret_name}/repositories"
  9150. ],
  9151. listSecretsForAuthenticatedUser: ["GET /user/codespaces/secrets"],
  9152. listSelectedReposForOrgSecret: [
  9153. "GET /orgs/{org}/codespaces/secrets/{secret_name}/repositories"
  9154. ],
  9155. preFlightWithRepoForAuthenticatedUser: [
  9156. "GET /repos/{owner}/{repo}/codespaces/new"
  9157. ],
  9158. publishForAuthenticatedUser: [
  9159. "POST /user/codespaces/{codespace_name}/publish"
  9160. ],
  9161. removeRepositoryForSecretForAuthenticatedUser: [
  9162. "DELETE /user/codespaces/secrets/{secret_name}/repositories/{repository_id}"
  9163. ],
  9164. removeSelectedRepoFromOrgSecret: [
  9165. "DELETE /orgs/{org}/codespaces/secrets/{secret_name}/repositories/{repository_id}"
  9166. ],
  9167. repoMachinesForAuthenticatedUser: [
  9168. "GET /repos/{owner}/{repo}/codespaces/machines"
  9169. ],
  9170. setRepositoriesForSecretForAuthenticatedUser: [
  9171. "PUT /user/codespaces/secrets/{secret_name}/repositories"
  9172. ],
  9173. setSelectedReposForOrgSecret: [
  9174. "PUT /orgs/{org}/codespaces/secrets/{secret_name}/repositories"
  9175. ],
  9176. startForAuthenticatedUser: ["POST /user/codespaces/{codespace_name}/start"],
  9177. stopForAuthenticatedUser: ["POST /user/codespaces/{codespace_name}/stop"],
  9178. stopInOrganization: [
  9179. "POST /orgs/{org}/members/{username}/codespaces/{codespace_name}/stop"
  9180. ],
  9181. updateForAuthenticatedUser: ["PATCH /user/codespaces/{codespace_name}"]
  9182. },
  9183. copilot: {
  9184. addCopilotSeatsForTeams: [
  9185. "POST /orgs/{org}/copilot/billing/selected_teams"
  9186. ],
  9187. addCopilotSeatsForUsers: [
  9188. "POST /orgs/{org}/copilot/billing/selected_users"
  9189. ],
  9190. cancelCopilotSeatAssignmentForTeams: [
  9191. "DELETE /orgs/{org}/copilot/billing/selected_teams"
  9192. ],
  9193. cancelCopilotSeatAssignmentForUsers: [
  9194. "DELETE /orgs/{org}/copilot/billing/selected_users"
  9195. ],
  9196. getCopilotOrganizationDetails: ["GET /orgs/{org}/copilot/billing"],
  9197. getCopilotSeatDetailsForUser: [
  9198. "GET /orgs/{org}/members/{username}/copilot"
  9199. ],
  9200. listCopilotSeats: ["GET /orgs/{org}/copilot/billing/seats"]
  9201. },
  9202. dependabot: {
  9203. addSelectedRepoToOrgSecret: [
  9204. "PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id}"
  9205. ],
  9206. createOrUpdateOrgSecret: [
  9207. "PUT /orgs/{org}/dependabot/secrets/{secret_name}"
  9208. ],
  9209. createOrUpdateRepoSecret: [
  9210. "PUT /repos/{owner}/{repo}/dependabot/secrets/{secret_name}"
  9211. ],
  9212. deleteOrgSecret: ["DELETE /orgs/{org}/dependabot/secrets/{secret_name}"],
  9213. deleteRepoSecret: [
  9214. "DELETE /repos/{owner}/{repo}/dependabot/secrets/{secret_name}"
  9215. ],
  9216. getAlert: ["GET /repos/{owner}/{repo}/dependabot/alerts/{alert_number}"],
  9217. getOrgPublicKey: ["GET /orgs/{org}/dependabot/secrets/public-key"],
  9218. getOrgSecret: ["GET /orgs/{org}/dependabot/secrets/{secret_name}"],
  9219. getRepoPublicKey: [
  9220. "GET /repos/{owner}/{repo}/dependabot/secrets/public-key"
  9221. ],
  9222. getRepoSecret: [
  9223. "GET /repos/{owner}/{repo}/dependabot/secrets/{secret_name}"
  9224. ],
  9225. listAlertsForEnterprise: [
  9226. "GET /enterprises/{enterprise}/dependabot/alerts"
  9227. ],
  9228. listAlertsForOrg: ["GET /orgs/{org}/dependabot/alerts"],
  9229. listAlertsForRepo: ["GET /repos/{owner}/{repo}/dependabot/alerts"],
  9230. listOrgSecrets: ["GET /orgs/{org}/dependabot/secrets"],
  9231. listRepoSecrets: ["GET /repos/{owner}/{repo}/dependabot/secrets"],
  9232. listSelectedReposForOrgSecret: [
  9233. "GET /orgs/{org}/dependabot/secrets/{secret_name}/repositories"
  9234. ],
  9235. removeSelectedRepoFromOrgSecret: [
  9236. "DELETE /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id}"
  9237. ],
  9238. setSelectedReposForOrgSecret: [
  9239. "PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories"
  9240. ],
  9241. updateAlert: [
  9242. "PATCH /repos/{owner}/{repo}/dependabot/alerts/{alert_number}"
  9243. ]
  9244. },
  9245. dependencyGraph: {
  9246. createRepositorySnapshot: [
  9247. "POST /repos/{owner}/{repo}/dependency-graph/snapshots"
  9248. ],
  9249. diffRange: [
  9250. "GET /repos/{owner}/{repo}/dependency-graph/compare/{basehead}"
  9251. ],
  9252. exportSbom: ["GET /repos/{owner}/{repo}/dependency-graph/sbom"]
  9253. },
  9254. emojis: { get: ["GET /emojis"] },
  9255. gists: {
  9256. checkIsStarred: ["GET /gists/{gist_id}/star"],
  9257. create: ["POST /gists"],
  9258. createComment: ["POST /gists/{gist_id}/comments"],
  9259. delete: ["DELETE /gists/{gist_id}"],
  9260. deleteComment: ["DELETE /gists/{gist_id}/comments/{comment_id}"],
  9261. fork: ["POST /gists/{gist_id}/forks"],
  9262. get: ["GET /gists/{gist_id}"],
  9263. getComment: ["GET /gists/{gist_id}/comments/{comment_id}"],
  9264. getRevision: ["GET /gists/{gist_id}/{sha}"],
  9265. list: ["GET /gists"],
  9266. listComments: ["GET /gists/{gist_id}/comments"],
  9267. listCommits: ["GET /gists/{gist_id}/commits"],
  9268. listForUser: ["GET /users/{username}/gists"],
  9269. listForks: ["GET /gists/{gist_id}/forks"],
  9270. listPublic: ["GET /gists/public"],
  9271. listStarred: ["GET /gists/starred"],
  9272. star: ["PUT /gists/{gist_id}/star"],
  9273. unstar: ["DELETE /gists/{gist_id}/star"],
  9274. update: ["PATCH /gists/{gist_id}"],
  9275. updateComment: ["PATCH /gists/{gist_id}/comments/{comment_id}"]
  9276. },
  9277. git: {
  9278. createBlob: ["POST /repos/{owner}/{repo}/git/blobs"],
  9279. createCommit: ["POST /repos/{owner}/{repo}/git/commits"],
  9280. createRef: ["POST /repos/{owner}/{repo}/git/refs"],
  9281. createTag: ["POST /repos/{owner}/{repo}/git/tags"],
  9282. createTree: ["POST /repos/{owner}/{repo}/git/trees"],
  9283. deleteRef: ["DELETE /repos/{owner}/{repo}/git/refs/{ref}"],
  9284. getBlob: ["GET /repos/{owner}/{repo}/git/blobs/{file_sha}"],
  9285. getCommit: ["GET /repos/{owner}/{repo}/git/commits/{commit_sha}"],
  9286. getRef: ["GET /repos/{owner}/{repo}/git/ref/{ref}"],
  9287. getTag: ["GET /repos/{owner}/{repo}/git/tags/{tag_sha}"],
  9288. getTree: ["GET /repos/{owner}/{repo}/git/trees/{tree_sha}"],
  9289. listMatchingRefs: ["GET /repos/{owner}/{repo}/git/matching-refs/{ref}"],
  9290. updateRef: ["PATCH /repos/{owner}/{repo}/git/refs/{ref}"]
  9291. },
  9292. gitignore: {
  9293. getAllTemplates: ["GET /gitignore/templates"],
  9294. getTemplate: ["GET /gitignore/templates/{name}"]
  9295. },
  9296. interactions: {
  9297. getRestrictionsForAuthenticatedUser: ["GET /user/interaction-limits"],
  9298. getRestrictionsForOrg: ["GET /orgs/{org}/interaction-limits"],
  9299. getRestrictionsForRepo: ["GET /repos/{owner}/{repo}/interaction-limits"],
  9300. getRestrictionsForYourPublicRepos: [
  9301. "GET /user/interaction-limits",
  9302. {},
  9303. { renamed: ["interactions", "getRestrictionsForAuthenticatedUser"] }
  9304. ],
  9305. removeRestrictionsForAuthenticatedUser: ["DELETE /user/interaction-limits"],
  9306. removeRestrictionsForOrg: ["DELETE /orgs/{org}/interaction-limits"],
  9307. removeRestrictionsForRepo: [
  9308. "DELETE /repos/{owner}/{repo}/interaction-limits"
  9309. ],
  9310. removeRestrictionsForYourPublicRepos: [
  9311. "DELETE /user/interaction-limits",
  9312. {},
  9313. { renamed: ["interactions", "removeRestrictionsForAuthenticatedUser"] }
  9314. ],
  9315. setRestrictionsForAuthenticatedUser: ["PUT /user/interaction-limits"],
  9316. setRestrictionsForOrg: ["PUT /orgs/{org}/interaction-limits"],
  9317. setRestrictionsForRepo: ["PUT /repos/{owner}/{repo}/interaction-limits"],
  9318. setRestrictionsForYourPublicRepos: [
  9319. "PUT /user/interaction-limits",
  9320. {},
  9321. { renamed: ["interactions", "setRestrictionsForAuthenticatedUser"] }
  9322. ]
  9323. },
  9324. issues: {
  9325. addAssignees: [
  9326. "POST /repos/{owner}/{repo}/issues/{issue_number}/assignees"
  9327. ],
  9328. addLabels: ["POST /repos/{owner}/{repo}/issues/{issue_number}/labels"],
  9329. checkUserCanBeAssigned: ["GET /repos/{owner}/{repo}/assignees/{assignee}"],
  9330. checkUserCanBeAssignedToIssue: [
  9331. "GET /repos/{owner}/{repo}/issues/{issue_number}/assignees/{assignee}"
  9332. ],
  9333. create: ["POST /repos/{owner}/{repo}/issues"],
  9334. createComment: [
  9335. "POST /repos/{owner}/{repo}/issues/{issue_number}/comments"
  9336. ],
  9337. createLabel: ["POST /repos/{owner}/{repo}/labels"],
  9338. createMilestone: ["POST /repos/{owner}/{repo}/milestones"],
  9339. deleteComment: [
  9340. "DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}"
  9341. ],
  9342. deleteLabel: ["DELETE /repos/{owner}/{repo}/labels/{name}"],
  9343. deleteMilestone: [
  9344. "DELETE /repos/{owner}/{repo}/milestones/{milestone_number}"
  9345. ],
  9346. get: ["GET /repos/{owner}/{repo}/issues/{issue_number}"],
  9347. getComment: ["GET /repos/{owner}/{repo}/issues/comments/{comment_id}"],
  9348. getEvent: ["GET /repos/{owner}/{repo}/issues/events/{event_id}"],
  9349. getLabel: ["GET /repos/{owner}/{repo}/labels/{name}"],
  9350. getMilestone: ["GET /repos/{owner}/{repo}/milestones/{milestone_number}"],
  9351. list: ["GET /issues"],
  9352. listAssignees: ["GET /repos/{owner}/{repo}/assignees"],
  9353. listComments: ["GET /repos/{owner}/{repo}/issues/{issue_number}/comments"],
  9354. listCommentsForRepo: ["GET /repos/{owner}/{repo}/issues/comments"],
  9355. listEvents: ["GET /repos/{owner}/{repo}/issues/{issue_number}/events"],
  9356. listEventsForRepo: ["GET /repos/{owner}/{repo}/issues/events"],
  9357. listEventsForTimeline: [
  9358. "GET /repos/{owner}/{repo}/issues/{issue_number}/timeline"
  9359. ],
  9360. listForAuthenticatedUser: ["GET /user/issues"],
  9361. listForOrg: ["GET /orgs/{org}/issues"],
  9362. listForRepo: ["GET /repos/{owner}/{repo}/issues"],
  9363. listLabelsForMilestone: [
  9364. "GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels"
  9365. ],
  9366. listLabelsForRepo: ["GET /repos/{owner}/{repo}/labels"],
  9367. listLabelsOnIssue: [
  9368. "GET /repos/{owner}/{repo}/issues/{issue_number}/labels"
  9369. ],
  9370. listMilestones: ["GET /repos/{owner}/{repo}/milestones"],
  9371. lock: ["PUT /repos/{owner}/{repo}/issues/{issue_number}/lock"],
  9372. removeAllLabels: [
  9373. "DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels"
  9374. ],
  9375. removeAssignees: [
  9376. "DELETE /repos/{owner}/{repo}/issues/{issue_number}/assignees"
  9377. ],
  9378. removeLabel: [
  9379. "DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels/{name}"
  9380. ],
  9381. setLabels: ["PUT /repos/{owner}/{repo}/issues/{issue_number}/labels"],
  9382. unlock: ["DELETE /repos/{owner}/{repo}/issues/{issue_number}/lock"],
  9383. update: ["PATCH /repos/{owner}/{repo}/issues/{issue_number}"],
  9384. updateComment: ["PATCH /repos/{owner}/{repo}/issues/comments/{comment_id}"],
  9385. updateLabel: ["PATCH /repos/{owner}/{repo}/labels/{name}"],
  9386. updateMilestone: [
  9387. "PATCH /repos/{owner}/{repo}/milestones/{milestone_number}"
  9388. ]
  9389. },
  9390. licenses: {
  9391. get: ["GET /licenses/{license}"],
  9392. getAllCommonlyUsed: ["GET /licenses"],
  9393. getForRepo: ["GET /repos/{owner}/{repo}/license"]
  9394. },
  9395. markdown: {
  9396. render: ["POST /markdown"],
  9397. renderRaw: [
  9398. "POST /markdown/raw",
  9399. { headers: { "content-type": "text/plain; charset=utf-8" } }
  9400. ]
  9401. },
  9402. meta: {
  9403. get: ["GET /meta"],
  9404. getAllVersions: ["GET /versions"],
  9405. getOctocat: ["GET /octocat"],
  9406. getZen: ["GET /zen"],
  9407. root: ["GET /"]
  9408. },
  9409. migrations: {
  9410. cancelImport: [
  9411. "DELETE /repos/{owner}/{repo}/import",
  9412. {},
  9413. {
  9414. deprecated: "octokit.rest.migrations.cancelImport() is deprecated, see https://docs.github.com/rest/migrations/source-imports#cancel-an-import"
  9415. }
  9416. ],
  9417. deleteArchiveForAuthenticatedUser: [
  9418. "DELETE /user/migrations/{migration_id}/archive"
  9419. ],
  9420. deleteArchiveForOrg: [
  9421. "DELETE /orgs/{org}/migrations/{migration_id}/archive"
  9422. ],
  9423. downloadArchiveForOrg: [
  9424. "GET /orgs/{org}/migrations/{migration_id}/archive"
  9425. ],
  9426. getArchiveForAuthenticatedUser: [
  9427. "GET /user/migrations/{migration_id}/archive"
  9428. ],
  9429. getCommitAuthors: [
  9430. "GET /repos/{owner}/{repo}/import/authors",
  9431. {},
  9432. {
  9433. deprecated: "octokit.rest.migrations.getCommitAuthors() is deprecated, see https://docs.github.com/rest/migrations/source-imports#get-commit-authors"
  9434. }
  9435. ],
  9436. getImportStatus: [
  9437. "GET /repos/{owner}/{repo}/import",
  9438. {},
  9439. {
  9440. deprecated: "octokit.rest.migrations.getImportStatus() is deprecated, see https://docs.github.com/rest/migrations/source-imports#get-an-import-status"
  9441. }
  9442. ],
  9443. getLargeFiles: [
  9444. "GET /repos/{owner}/{repo}/import/large_files",
  9445. {},
  9446. {
  9447. deprecated: "octokit.rest.migrations.getLargeFiles() is deprecated, see https://docs.github.com/rest/migrations/source-imports#get-large-files"
  9448. }
  9449. ],
  9450. getStatusForAuthenticatedUser: ["GET /user/migrations/{migration_id}"],
  9451. getStatusForOrg: ["GET /orgs/{org}/migrations/{migration_id}"],
  9452. listForAuthenticatedUser: ["GET /user/migrations"],
  9453. listForOrg: ["GET /orgs/{org}/migrations"],
  9454. listReposForAuthenticatedUser: [
  9455. "GET /user/migrations/{migration_id}/repositories"
  9456. ],
  9457. listReposForOrg: ["GET /orgs/{org}/migrations/{migration_id}/repositories"],
  9458. listReposForUser: [
  9459. "GET /user/migrations/{migration_id}/repositories",
  9460. {},
  9461. { renamed: ["migrations", "listReposForAuthenticatedUser"] }
  9462. ],
  9463. mapCommitAuthor: [
  9464. "PATCH /repos/{owner}/{repo}/import/authors/{author_id}",
  9465. {},
  9466. {
  9467. deprecated: "octokit.rest.migrations.mapCommitAuthor() is deprecated, see https://docs.github.com/rest/migrations/source-imports#map-a-commit-author"
  9468. }
  9469. ],
  9470. setLfsPreference: [
  9471. "PATCH /repos/{owner}/{repo}/import/lfs",
  9472. {},
  9473. {
  9474. deprecated: "octokit.rest.migrations.setLfsPreference() is deprecated, see https://docs.github.com/rest/migrations/source-imports#update-git-lfs-preference"
  9475. }
  9476. ],
  9477. startForAuthenticatedUser: ["POST /user/migrations"],
  9478. startForOrg: ["POST /orgs/{org}/migrations"],
  9479. startImport: [
  9480. "PUT /repos/{owner}/{repo}/import",
  9481. {},
  9482. {
  9483. deprecated: "octokit.rest.migrations.startImport() is deprecated, see https://docs.github.com/rest/migrations/source-imports#start-an-import"
  9484. }
  9485. ],
  9486. unlockRepoForAuthenticatedUser: [
  9487. "DELETE /user/migrations/{migration_id}/repos/{repo_name}/lock"
  9488. ],
  9489. unlockRepoForOrg: [
  9490. "DELETE /orgs/{org}/migrations/{migration_id}/repos/{repo_name}/lock"
  9491. ],
  9492. updateImport: [
  9493. "PATCH /repos/{owner}/{repo}/import",
  9494. {},
  9495. {
  9496. deprecated: "octokit.rest.migrations.updateImport() is deprecated, see https://docs.github.com/rest/migrations/source-imports#update-an-import"
  9497. }
  9498. ]
  9499. },
  9500. oidc: {
  9501. getOidcCustomSubTemplateForOrg: [
  9502. "GET /orgs/{org}/actions/oidc/customization/sub"
  9503. ],
  9504. updateOidcCustomSubTemplateForOrg: [
  9505. "PUT /orgs/{org}/actions/oidc/customization/sub"
  9506. ]
  9507. },
  9508. orgs: {
  9509. addSecurityManagerTeam: [
  9510. "PUT /orgs/{org}/security-managers/teams/{team_slug}"
  9511. ],
  9512. assignTeamToOrgRole: [
  9513. "PUT /orgs/{org}/organization-roles/teams/{team_slug}/{role_id}"
  9514. ],
  9515. assignUserToOrgRole: [
  9516. "PUT /orgs/{org}/organization-roles/users/{username}/{role_id}"
  9517. ],
  9518. blockUser: ["PUT /orgs/{org}/blocks/{username}"],
  9519. cancelInvitation: ["DELETE /orgs/{org}/invitations/{invitation_id}"],
  9520. checkBlockedUser: ["GET /orgs/{org}/blocks/{username}"],
  9521. checkMembershipForUser: ["GET /orgs/{org}/members/{username}"],
  9522. checkPublicMembershipForUser: ["GET /orgs/{org}/public_members/{username}"],
  9523. convertMemberToOutsideCollaborator: [
  9524. "PUT /orgs/{org}/outside_collaborators/{username}"
  9525. ],
  9526. createCustomOrganizationRole: ["POST /orgs/{org}/organization-roles"],
  9527. createInvitation: ["POST /orgs/{org}/invitations"],
  9528. createOrUpdateCustomProperties: ["PATCH /orgs/{org}/properties/schema"],
  9529. createOrUpdateCustomPropertiesValuesForRepos: [
  9530. "PATCH /orgs/{org}/properties/values"
  9531. ],
  9532. createOrUpdateCustomProperty: [
  9533. "PUT /orgs/{org}/properties/schema/{custom_property_name}"
  9534. ],
  9535. createWebhook: ["POST /orgs/{org}/hooks"],
  9536. delete: ["DELETE /orgs/{org}"],
  9537. deleteCustomOrganizationRole: [
  9538. "DELETE /orgs/{org}/organization-roles/{role_id}"
  9539. ],
  9540. deleteWebhook: ["DELETE /orgs/{org}/hooks/{hook_id}"],
  9541. enableOrDisableSecurityProductOnAllOrgRepos: [
  9542. "POST /orgs/{org}/{security_product}/{enablement}"
  9543. ],
  9544. get: ["GET /orgs/{org}"],
  9545. getAllCustomProperties: ["GET /orgs/{org}/properties/schema"],
  9546. getCustomProperty: [
  9547. "GET /orgs/{org}/properties/schema/{custom_property_name}"
  9548. ],
  9549. getMembershipForAuthenticatedUser: ["GET /user/memberships/orgs/{org}"],
  9550. getMembershipForUser: ["GET /orgs/{org}/memberships/{username}"],
  9551. getOrgRole: ["GET /orgs/{org}/organization-roles/{role_id}"],
  9552. getWebhook: ["GET /orgs/{org}/hooks/{hook_id}"],
  9553. getWebhookConfigForOrg: ["GET /orgs/{org}/hooks/{hook_id}/config"],
  9554. getWebhookDelivery: [
  9555. "GET /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}"
  9556. ],
  9557. list: ["GET /organizations"],
  9558. listAppInstallations: ["GET /orgs/{org}/installations"],
  9559. listBlockedUsers: ["GET /orgs/{org}/blocks"],
  9560. listCustomPropertiesValuesForRepos: ["GET /orgs/{org}/properties/values"],
  9561. listFailedInvitations: ["GET /orgs/{org}/failed_invitations"],
  9562. listForAuthenticatedUser: ["GET /user/orgs"],
  9563. listForUser: ["GET /users/{username}/orgs"],
  9564. listInvitationTeams: ["GET /orgs/{org}/invitations/{invitation_id}/teams"],
  9565. listMembers: ["GET /orgs/{org}/members"],
  9566. listMembershipsForAuthenticatedUser: ["GET /user/memberships/orgs"],
  9567. listOrgRoleTeams: ["GET /orgs/{org}/organization-roles/{role_id}/teams"],
  9568. listOrgRoleUsers: ["GET /orgs/{org}/organization-roles/{role_id}/users"],
  9569. listOrgRoles: ["GET /orgs/{org}/organization-roles"],
  9570. listOrganizationFineGrainedPermissions: [
  9571. "GET /orgs/{org}/organization-fine-grained-permissions"
  9572. ],
  9573. listOutsideCollaborators: ["GET /orgs/{org}/outside_collaborators"],
  9574. listPatGrantRepositories: [
  9575. "GET /orgs/{org}/personal-access-tokens/{pat_id}/repositories"
  9576. ],
  9577. listPatGrantRequestRepositories: [
  9578. "GET /orgs/{org}/personal-access-token-requests/{pat_request_id}/repositories"
  9579. ],
  9580. listPatGrantRequests: ["GET /orgs/{org}/personal-access-token-requests"],
  9581. listPatGrants: ["GET /orgs/{org}/personal-access-tokens"],
  9582. listPendingInvitations: ["GET /orgs/{org}/invitations"],
  9583. listPublicMembers: ["GET /orgs/{org}/public_members"],
  9584. listSecurityManagerTeams: ["GET /orgs/{org}/security-managers"],
  9585. listWebhookDeliveries: ["GET /orgs/{org}/hooks/{hook_id}/deliveries"],
  9586. listWebhooks: ["GET /orgs/{org}/hooks"],
  9587. patchCustomOrganizationRole: [
  9588. "PATCH /orgs/{org}/organization-roles/{role_id}"
  9589. ],
  9590. pingWebhook: ["POST /orgs/{org}/hooks/{hook_id}/pings"],
  9591. redeliverWebhookDelivery: [
  9592. "POST /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts"
  9593. ],
  9594. removeCustomProperty: [
  9595. "DELETE /orgs/{org}/properties/schema/{custom_property_name}"
  9596. ],
  9597. removeMember: ["DELETE /orgs/{org}/members/{username}"],
  9598. removeMembershipForUser: ["DELETE /orgs/{org}/memberships/{username}"],
  9599. removeOutsideCollaborator: [
  9600. "DELETE /orgs/{org}/outside_collaborators/{username}"
  9601. ],
  9602. removePublicMembershipForAuthenticatedUser: [
  9603. "DELETE /orgs/{org}/public_members/{username}"
  9604. ],
  9605. removeSecurityManagerTeam: [
  9606. "DELETE /orgs/{org}/security-managers/teams/{team_slug}"
  9607. ],
  9608. reviewPatGrantRequest: [
  9609. "POST /orgs/{org}/personal-access-token-requests/{pat_request_id}"
  9610. ],
  9611. reviewPatGrantRequestsInBulk: [
  9612. "POST /orgs/{org}/personal-access-token-requests"
  9613. ],
  9614. revokeAllOrgRolesTeam: [
  9615. "DELETE /orgs/{org}/organization-roles/teams/{team_slug}"
  9616. ],
  9617. revokeAllOrgRolesUser: [
  9618. "DELETE /orgs/{org}/organization-roles/users/{username}"
  9619. ],
  9620. revokeOrgRoleTeam: [
  9621. "DELETE /orgs/{org}/organization-roles/teams/{team_slug}/{role_id}"
  9622. ],
  9623. revokeOrgRoleUser: [
  9624. "DELETE /orgs/{org}/organization-roles/users/{username}/{role_id}"
  9625. ],
  9626. setMembershipForUser: ["PUT /orgs/{org}/memberships/{username}"],
  9627. setPublicMembershipForAuthenticatedUser: [
  9628. "PUT /orgs/{org}/public_members/{username}"
  9629. ],
  9630. unblockUser: ["DELETE /orgs/{org}/blocks/{username}"],
  9631. update: ["PATCH /orgs/{org}"],
  9632. updateMembershipForAuthenticatedUser: [
  9633. "PATCH /user/memberships/orgs/{org}"
  9634. ],
  9635. updatePatAccess: ["POST /orgs/{org}/personal-access-tokens/{pat_id}"],
  9636. updatePatAccesses: ["POST /orgs/{org}/personal-access-tokens"],
  9637. updateWebhook: ["PATCH /orgs/{org}/hooks/{hook_id}"],
  9638. updateWebhookConfigForOrg: ["PATCH /orgs/{org}/hooks/{hook_id}/config"]
  9639. },
  9640. packages: {
  9641. deletePackageForAuthenticatedUser: [
  9642. "DELETE /user/packages/{package_type}/{package_name}"
  9643. ],
  9644. deletePackageForOrg: [
  9645. "DELETE /orgs/{org}/packages/{package_type}/{package_name}"
  9646. ],
  9647. deletePackageForUser: [
  9648. "DELETE /users/{username}/packages/{package_type}/{package_name}"
  9649. ],
  9650. deletePackageVersionForAuthenticatedUser: [
  9651. "DELETE /user/packages/{package_type}/{package_name}/versions/{package_version_id}"
  9652. ],
  9653. deletePackageVersionForOrg: [
  9654. "DELETE /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}"
  9655. ],
  9656. deletePackageVersionForUser: [
  9657. "DELETE /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}"
  9658. ],
  9659. getAllPackageVersionsForAPackageOwnedByAnOrg: [
  9660. "GET /orgs/{org}/packages/{package_type}/{package_name}/versions",
  9661. {},
  9662. { renamed: ["packages", "getAllPackageVersionsForPackageOwnedByOrg"] }
  9663. ],
  9664. getAllPackageVersionsForAPackageOwnedByTheAuthenticatedUser: [
  9665. "GET /user/packages/{package_type}/{package_name}/versions",
  9666. {},
  9667. {
  9668. renamed: [
  9669. "packages",
  9670. "getAllPackageVersionsForPackageOwnedByAuthenticatedUser"
  9671. ]
  9672. }
  9673. ],
  9674. getAllPackageVersionsForPackageOwnedByAuthenticatedUser: [
  9675. "GET /user/packages/{package_type}/{package_name}/versions"
  9676. ],
  9677. getAllPackageVersionsForPackageOwnedByOrg: [
  9678. "GET /orgs/{org}/packages/{package_type}/{package_name}/versions"
  9679. ],
  9680. getAllPackageVersionsForPackageOwnedByUser: [
  9681. "GET /users/{username}/packages/{package_type}/{package_name}/versions"
  9682. ],
  9683. getPackageForAuthenticatedUser: [
  9684. "GET /user/packages/{package_type}/{package_name}"
  9685. ],
  9686. getPackageForOrganization: [
  9687. "GET /orgs/{org}/packages/{package_type}/{package_name}"
  9688. ],
  9689. getPackageForUser: [
  9690. "GET /users/{username}/packages/{package_type}/{package_name}"
  9691. ],
  9692. getPackageVersionForAuthenticatedUser: [
  9693. "GET /user/packages/{package_type}/{package_name}/versions/{package_version_id}"
  9694. ],
  9695. getPackageVersionForOrganization: [
  9696. "GET /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}"
  9697. ],
  9698. getPackageVersionForUser: [
  9699. "GET /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}"
  9700. ],
  9701. listDockerMigrationConflictingPackagesForAuthenticatedUser: [
  9702. "GET /user/docker/conflicts"
  9703. ],
  9704. listDockerMigrationConflictingPackagesForOrganization: [
  9705. "GET /orgs/{org}/docker/conflicts"
  9706. ],
  9707. listDockerMigrationConflictingPackagesForUser: [
  9708. "GET /users/{username}/docker/conflicts"
  9709. ],
  9710. listPackagesForAuthenticatedUser: ["GET /user/packages"],
  9711. listPackagesForOrganization: ["GET /orgs/{org}/packages"],
  9712. listPackagesForUser: ["GET /users/{username}/packages"],
  9713. restorePackageForAuthenticatedUser: [
  9714. "POST /user/packages/{package_type}/{package_name}/restore{?token}"
  9715. ],
  9716. restorePackageForOrg: [
  9717. "POST /orgs/{org}/packages/{package_type}/{package_name}/restore{?token}"
  9718. ],
  9719. restorePackageForUser: [
  9720. "POST /users/{username}/packages/{package_type}/{package_name}/restore{?token}"
  9721. ],
  9722. restorePackageVersionForAuthenticatedUser: [
  9723. "POST /user/packages/{package_type}/{package_name}/versions/{package_version_id}/restore"
  9724. ],
  9725. restorePackageVersionForOrg: [
  9726. "POST /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore"
  9727. ],
  9728. restorePackageVersionForUser: [
  9729. "POST /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore"
  9730. ]
  9731. },
  9732. projects: {
  9733. addCollaborator: ["PUT /projects/{project_id}/collaborators/{username}"],
  9734. createCard: ["POST /projects/columns/{column_id}/cards"],
  9735. createColumn: ["POST /projects/{project_id}/columns"],
  9736. createForAuthenticatedUser: ["POST /user/projects"],
  9737. createForOrg: ["POST /orgs/{org}/projects"],
  9738. createForRepo: ["POST /repos/{owner}/{repo}/projects"],
  9739. delete: ["DELETE /projects/{project_id}"],
  9740. deleteCard: ["DELETE /projects/columns/cards/{card_id}"],
  9741. deleteColumn: ["DELETE /projects/columns/{column_id}"],
  9742. get: ["GET /projects/{project_id}"],
  9743. getCard: ["GET /projects/columns/cards/{card_id}"],
  9744. getColumn: ["GET /projects/columns/{column_id}"],
  9745. getPermissionForUser: [
  9746. "GET /projects/{project_id}/collaborators/{username}/permission"
  9747. ],
  9748. listCards: ["GET /projects/columns/{column_id}/cards"],
  9749. listCollaborators: ["GET /projects/{project_id}/collaborators"],
  9750. listColumns: ["GET /projects/{project_id}/columns"],
  9751. listForOrg: ["GET /orgs/{org}/projects"],
  9752. listForRepo: ["GET /repos/{owner}/{repo}/projects"],
  9753. listForUser: ["GET /users/{username}/projects"],
  9754. moveCard: ["POST /projects/columns/cards/{card_id}/moves"],
  9755. moveColumn: ["POST /projects/columns/{column_id}/moves"],
  9756. removeCollaborator: [
  9757. "DELETE /projects/{project_id}/collaborators/{username}"
  9758. ],
  9759. update: ["PATCH /projects/{project_id}"],
  9760. updateCard: ["PATCH /projects/columns/cards/{card_id}"],
  9761. updateColumn: ["PATCH /projects/columns/{column_id}"]
  9762. },
  9763. pulls: {
  9764. checkIfMerged: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/merge"],
  9765. create: ["POST /repos/{owner}/{repo}/pulls"],
  9766. createReplyForReviewComment: [
  9767. "POST /repos/{owner}/{repo}/pulls/{pull_number}/comments/{comment_id}/replies"
  9768. ],
  9769. createReview: ["POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews"],
  9770. createReviewComment: [
  9771. "POST /repos/{owner}/{repo}/pulls/{pull_number}/comments"
  9772. ],
  9773. deletePendingReview: [
  9774. "DELETE /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}"
  9775. ],
  9776. deleteReviewComment: [
  9777. "DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}"
  9778. ],
  9779. dismissReview: [
  9780. "PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/dismissals"
  9781. ],
  9782. get: ["GET /repos/{owner}/{repo}/pulls/{pull_number}"],
  9783. getReview: [
  9784. "GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}"
  9785. ],
  9786. getReviewComment: ["GET /repos/{owner}/{repo}/pulls/comments/{comment_id}"],
  9787. list: ["GET /repos/{owner}/{repo}/pulls"],
  9788. listCommentsForReview: [
  9789. "GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments"
  9790. ],
  9791. listCommits: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/commits"],
  9792. listFiles: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/files"],
  9793. listRequestedReviewers: [
  9794. "GET /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers"
  9795. ],
  9796. listReviewComments: [
  9797. "GET /repos/{owner}/{repo}/pulls/{pull_number}/comments"
  9798. ],
  9799. listReviewCommentsForRepo: ["GET /repos/{owner}/{repo}/pulls/comments"],
  9800. listReviews: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews"],
  9801. merge: ["PUT /repos/{owner}/{repo}/pulls/{pull_number}/merge"],
  9802. removeRequestedReviewers: [
  9803. "DELETE /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers"
  9804. ],
  9805. requestReviewers: [
  9806. "POST /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers"
  9807. ],
  9808. submitReview: [
  9809. "POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/events"
  9810. ],
  9811. update: ["PATCH /repos/{owner}/{repo}/pulls/{pull_number}"],
  9812. updateBranch: [
  9813. "PUT /repos/{owner}/{repo}/pulls/{pull_number}/update-branch"
  9814. ],
  9815. updateReview: [
  9816. "PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}"
  9817. ],
  9818. updateReviewComment: [
  9819. "PATCH /repos/{owner}/{repo}/pulls/comments/{comment_id}"
  9820. ]
  9821. },
  9822. rateLimit: { get: ["GET /rate_limit"] },
  9823. reactions: {
  9824. createForCommitComment: [
  9825. "POST /repos/{owner}/{repo}/comments/{comment_id}/reactions"
  9826. ],
  9827. createForIssue: [
  9828. "POST /repos/{owner}/{repo}/issues/{issue_number}/reactions"
  9829. ],
  9830. createForIssueComment: [
  9831. "POST /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions"
  9832. ],
  9833. createForPullRequestReviewComment: [
  9834. "POST /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions"
  9835. ],
  9836. createForRelease: [
  9837. "POST /repos/{owner}/{repo}/releases/{release_id}/reactions"
  9838. ],
  9839. createForTeamDiscussionCommentInOrg: [
  9840. "POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions"
  9841. ],
  9842. createForTeamDiscussionInOrg: [
  9843. "POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions"
  9844. ],
  9845. deleteForCommitComment: [
  9846. "DELETE /repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id}"
  9847. ],
  9848. deleteForIssue: [
  9849. "DELETE /repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id}"
  9850. ],
  9851. deleteForIssueComment: [
  9852. "DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/{reaction_id}"
  9853. ],
  9854. deleteForPullRequestComment: [
  9855. "DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/{reaction_id}"
  9856. ],
  9857. deleteForRelease: [
  9858. "DELETE /repos/{owner}/{repo}/releases/{release_id}/reactions/{reaction_id}"
  9859. ],
  9860. deleteForTeamDiscussion: [
  9861. "DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/{reaction_id}"
  9862. ],
  9863. deleteForTeamDiscussionComment: [
  9864. "DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/{reaction_id}"
  9865. ],
  9866. listForCommitComment: [
  9867. "GET /repos/{owner}/{repo}/comments/{comment_id}/reactions"
  9868. ],
  9869. listForIssue: ["GET /repos/{owner}/{repo}/issues/{issue_number}/reactions"],
  9870. listForIssueComment: [
  9871. "GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions"
  9872. ],
  9873. listForPullRequestReviewComment: [
  9874. "GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions"
  9875. ],
  9876. listForRelease: [
  9877. "GET /repos/{owner}/{repo}/releases/{release_id}/reactions"
  9878. ],
  9879. listForTeamDiscussionCommentInOrg: [
  9880. "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions"
  9881. ],
  9882. listForTeamDiscussionInOrg: [
  9883. "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions"
  9884. ]
  9885. },
  9886. repos: {
  9887. acceptInvitation: [
  9888. "PATCH /user/repository_invitations/{invitation_id}",
  9889. {},
  9890. { renamed: ["repos", "acceptInvitationForAuthenticatedUser"] }
  9891. ],
  9892. acceptInvitationForAuthenticatedUser: [
  9893. "PATCH /user/repository_invitations/{invitation_id}"
  9894. ],
  9895. addAppAccessRestrictions: [
  9896. "POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps",
  9897. {},
  9898. { mapToData: "apps" }
  9899. ],
  9900. addCollaborator: ["PUT /repos/{owner}/{repo}/collaborators/{username}"],
  9901. addStatusCheckContexts: [
  9902. "POST /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts",
  9903. {},
  9904. { mapToData: "contexts" }
  9905. ],
  9906. addTeamAccessRestrictions: [
  9907. "POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams",
  9908. {},
  9909. { mapToData: "teams" }
  9910. ],
  9911. addUserAccessRestrictions: [
  9912. "POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users",
  9913. {},
  9914. { mapToData: "users" }
  9915. ],
  9916. cancelPagesDeployment: [
  9917. "POST /repos/{owner}/{repo}/pages/deployments/{pages_deployment_id}/cancel"
  9918. ],
  9919. checkAutomatedSecurityFixes: [
  9920. "GET /repos/{owner}/{repo}/automated-security-fixes"
  9921. ],
  9922. checkCollaborator: ["GET /repos/{owner}/{repo}/collaborators/{username}"],
  9923. checkVulnerabilityAlerts: [
  9924. "GET /repos/{owner}/{repo}/vulnerability-alerts"
  9925. ],
  9926. codeownersErrors: ["GET /repos/{owner}/{repo}/codeowners/errors"],
  9927. compareCommits: ["GET /repos/{owner}/{repo}/compare/{base}...{head}"],
  9928. compareCommitsWithBasehead: [
  9929. "GET /repos/{owner}/{repo}/compare/{basehead}"
  9930. ],
  9931. createAutolink: ["POST /repos/{owner}/{repo}/autolinks"],
  9932. createCommitComment: [
  9933. "POST /repos/{owner}/{repo}/commits/{commit_sha}/comments"
  9934. ],
  9935. createCommitSignatureProtection: [
  9936. "POST /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures"
  9937. ],
  9938. createCommitStatus: ["POST /repos/{owner}/{repo}/statuses/{sha}"],
  9939. createDeployKey: ["POST /repos/{owner}/{repo}/keys"],
  9940. createDeployment: ["POST /repos/{owner}/{repo}/deployments"],
  9941. createDeploymentBranchPolicy: [
  9942. "POST /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies"
  9943. ],
  9944. createDeploymentProtectionRule: [
  9945. "POST /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules"
  9946. ],
  9947. createDeploymentStatus: [
  9948. "POST /repos/{owner}/{repo}/deployments/{deployment_id}/statuses"
  9949. ],
  9950. createDispatchEvent: ["POST /repos/{owner}/{repo}/dispatches"],
  9951. createForAuthenticatedUser: ["POST /user/repos"],
  9952. createFork: ["POST /repos/{owner}/{repo}/forks"],
  9953. createInOrg: ["POST /orgs/{org}/repos"],
  9954. createOrUpdateCustomPropertiesValues: [
  9955. "PATCH /repos/{owner}/{repo}/properties/values"
  9956. ],
  9957. createOrUpdateEnvironment: [
  9958. "PUT /repos/{owner}/{repo}/environments/{environment_name}"
  9959. ],
  9960. createOrUpdateFileContents: ["PUT /repos/{owner}/{repo}/contents/{path}"],
  9961. createOrgRuleset: ["POST /orgs/{org}/rulesets"],
  9962. createPagesDeployment: ["POST /repos/{owner}/{repo}/pages/deployments"],
  9963. createPagesSite: ["POST /repos/{owner}/{repo}/pages"],
  9964. createRelease: ["POST /repos/{owner}/{repo}/releases"],
  9965. createRepoRuleset: ["POST /repos/{owner}/{repo}/rulesets"],
  9966. createTagProtection: ["POST /repos/{owner}/{repo}/tags/protection"],
  9967. createUsingTemplate: [
  9968. "POST /repos/{template_owner}/{template_repo}/generate"
  9969. ],
  9970. createWebhook: ["POST /repos/{owner}/{repo}/hooks"],
  9971. declineInvitation: [
  9972. "DELETE /user/repository_invitations/{invitation_id}",
  9973. {},
  9974. { renamed: ["repos", "declineInvitationForAuthenticatedUser"] }
  9975. ],
  9976. declineInvitationForAuthenticatedUser: [
  9977. "DELETE /user/repository_invitations/{invitation_id}"
  9978. ],
  9979. delete: ["DELETE /repos/{owner}/{repo}"],
  9980. deleteAccessRestrictions: [
  9981. "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions"
  9982. ],
  9983. deleteAdminBranchProtection: [
  9984. "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins"
  9985. ],
  9986. deleteAnEnvironment: [
  9987. "DELETE /repos/{owner}/{repo}/environments/{environment_name}"
  9988. ],
  9989. deleteAutolink: ["DELETE /repos/{owner}/{repo}/autolinks/{autolink_id}"],
  9990. deleteBranchProtection: [
  9991. "DELETE /repos/{owner}/{repo}/branches/{branch}/protection"
  9992. ],
  9993. deleteCommitComment: ["DELETE /repos/{owner}/{repo}/comments/{comment_id}"],
  9994. deleteCommitSignatureProtection: [
  9995. "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures"
  9996. ],
  9997. deleteDeployKey: ["DELETE /repos/{owner}/{repo}/keys/{key_id}"],
  9998. deleteDeployment: [
  9999. "DELETE /repos/{owner}/{repo}/deployments/{deployment_id}"
  10000. ],
  10001. deleteDeploymentBranchPolicy: [
  10002. "DELETE /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}"
  10003. ],
  10004. deleteFile: ["DELETE /repos/{owner}/{repo}/contents/{path}"],
  10005. deleteInvitation: [
  10006. "DELETE /repos/{owner}/{repo}/invitations/{invitation_id}"
  10007. ],
  10008. deleteOrgRuleset: ["DELETE /orgs/{org}/rulesets/{ruleset_id}"],
  10009. deletePagesSite: ["DELETE /repos/{owner}/{repo}/pages"],
  10010. deletePullRequestReviewProtection: [
  10011. "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews"
  10012. ],
  10013. deleteRelease: ["DELETE /repos/{owner}/{repo}/releases/{release_id}"],
  10014. deleteReleaseAsset: [
  10015. "DELETE /repos/{owner}/{repo}/releases/assets/{asset_id}"
  10016. ],
  10017. deleteRepoRuleset: ["DELETE /repos/{owner}/{repo}/rulesets/{ruleset_id}"],
  10018. deleteTagProtection: [
  10019. "DELETE /repos/{owner}/{repo}/tags/protection/{tag_protection_id}"
  10020. ],
  10021. deleteWebhook: ["DELETE /repos/{owner}/{repo}/hooks/{hook_id}"],
  10022. disableAutomatedSecurityFixes: [
  10023. "DELETE /repos/{owner}/{repo}/automated-security-fixes"
  10024. ],
  10025. disableDeploymentProtectionRule: [
  10026. "DELETE /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/{protection_rule_id}"
  10027. ],
  10028. disablePrivateVulnerabilityReporting: [
  10029. "DELETE /repos/{owner}/{repo}/private-vulnerability-reporting"
  10030. ],
  10031. disableVulnerabilityAlerts: [
  10032. "DELETE /repos/{owner}/{repo}/vulnerability-alerts"
  10033. ],
  10034. downloadArchive: [
  10035. "GET /repos/{owner}/{repo}/zipball/{ref}",
  10036. {},
  10037. { renamed: ["repos", "downloadZipballArchive"] }
  10038. ],
  10039. downloadTarballArchive: ["GET /repos/{owner}/{repo}/tarball/{ref}"],
  10040. downloadZipballArchive: ["GET /repos/{owner}/{repo}/zipball/{ref}"],
  10041. enableAutomatedSecurityFixes: [
  10042. "PUT /repos/{owner}/{repo}/automated-security-fixes"
  10043. ],
  10044. enablePrivateVulnerabilityReporting: [
  10045. "PUT /repos/{owner}/{repo}/private-vulnerability-reporting"
  10046. ],
  10047. enableVulnerabilityAlerts: [
  10048. "PUT /repos/{owner}/{repo}/vulnerability-alerts"
  10049. ],
  10050. generateReleaseNotes: [
  10051. "POST /repos/{owner}/{repo}/releases/generate-notes"
  10052. ],
  10053. get: ["GET /repos/{owner}/{repo}"],
  10054. getAccessRestrictions: [
  10055. "GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions"
  10056. ],
  10057. getAdminBranchProtection: [
  10058. "GET /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins"
  10059. ],
  10060. getAllDeploymentProtectionRules: [
  10061. "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules"
  10062. ],
  10063. getAllEnvironments: ["GET /repos/{owner}/{repo}/environments"],
  10064. getAllStatusCheckContexts: [
  10065. "GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts"
  10066. ],
  10067. getAllTopics: ["GET /repos/{owner}/{repo}/topics"],
  10068. getAppsWithAccessToProtectedBranch: [
  10069. "GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps"
  10070. ],
  10071. getAutolink: ["GET /repos/{owner}/{repo}/autolinks/{autolink_id}"],
  10072. getBranch: ["GET /repos/{owner}/{repo}/branches/{branch}"],
  10073. getBranchProtection: [
  10074. "GET /repos/{owner}/{repo}/branches/{branch}/protection"
  10075. ],
  10076. getBranchRules: ["GET /repos/{owner}/{repo}/rules/branches/{branch}"],
  10077. getClones: ["GET /repos/{owner}/{repo}/traffic/clones"],
  10078. getCodeFrequencyStats: ["GET /repos/{owner}/{repo}/stats/code_frequency"],
  10079. getCollaboratorPermissionLevel: [
  10080. "GET /repos/{owner}/{repo}/collaborators/{username}/permission"
  10081. ],
  10082. getCombinedStatusForRef: ["GET /repos/{owner}/{repo}/commits/{ref}/status"],
  10083. getCommit: ["GET /repos/{owner}/{repo}/commits/{ref}"],
  10084. getCommitActivityStats: ["GET /repos/{owner}/{repo}/stats/commit_activity"],
  10085. getCommitComment: ["GET /repos/{owner}/{repo}/comments/{comment_id}"],
  10086. getCommitSignatureProtection: [
  10087. "GET /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures"
  10088. ],
  10089. getCommunityProfileMetrics: ["GET /repos/{owner}/{repo}/community/profile"],
  10090. getContent: ["GET /repos/{owner}/{repo}/contents/{path}"],
  10091. getContributorsStats: ["GET /repos/{owner}/{repo}/stats/contributors"],
  10092. getCustomDeploymentProtectionRule: [
  10093. "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/{protection_rule_id}"
  10094. ],
  10095. getCustomPropertiesValues: ["GET /repos/{owner}/{repo}/properties/values"],
  10096. getDeployKey: ["GET /repos/{owner}/{repo}/keys/{key_id}"],
  10097. getDeployment: ["GET /repos/{owner}/{repo}/deployments/{deployment_id}"],
  10098. getDeploymentBranchPolicy: [
  10099. "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}"
  10100. ],
  10101. getDeploymentStatus: [
  10102. "GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses/{status_id}"
  10103. ],
  10104. getEnvironment: [
  10105. "GET /repos/{owner}/{repo}/environments/{environment_name}"
  10106. ],
  10107. getLatestPagesBuild: ["GET /repos/{owner}/{repo}/pages/builds/latest"],
  10108. getLatestRelease: ["GET /repos/{owner}/{repo}/releases/latest"],
  10109. getOrgRuleSuite: ["GET /orgs/{org}/rulesets/rule-suites/{rule_suite_id}"],
  10110. getOrgRuleSuites: ["GET /orgs/{org}/rulesets/rule-suites"],
  10111. getOrgRuleset: ["GET /orgs/{org}/rulesets/{ruleset_id}"],
  10112. getOrgRulesets: ["GET /orgs/{org}/rulesets"],
  10113. getPages: ["GET /repos/{owner}/{repo}/pages"],
  10114. getPagesBuild: ["GET /repos/{owner}/{repo}/pages/builds/{build_id}"],
  10115. getPagesDeployment: [
  10116. "GET /repos/{owner}/{repo}/pages/deployments/{pages_deployment_id}"
  10117. ],
  10118. getPagesHealthCheck: ["GET /repos/{owner}/{repo}/pages/health"],
  10119. getParticipationStats: ["GET /repos/{owner}/{repo}/stats/participation"],
  10120. getPullRequestReviewProtection: [
  10121. "GET /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews"
  10122. ],
  10123. getPunchCardStats: ["GET /repos/{owner}/{repo}/stats/punch_card"],
  10124. getReadme: ["GET /repos/{owner}/{repo}/readme"],
  10125. getReadmeInDirectory: ["GET /repos/{owner}/{repo}/readme/{dir}"],
  10126. getRelease: ["GET /repos/{owner}/{repo}/releases/{release_id}"],
  10127. getReleaseAsset: ["GET /repos/{owner}/{repo}/releases/assets/{asset_id}"],
  10128. getReleaseByTag: ["GET /repos/{owner}/{repo}/releases/tags/{tag}"],
  10129. getRepoRuleSuite: [
  10130. "GET /repos/{owner}/{repo}/rulesets/rule-suites/{rule_suite_id}"
  10131. ],
  10132. getRepoRuleSuites: ["GET /repos/{owner}/{repo}/rulesets/rule-suites"],
  10133. getRepoRuleset: ["GET /repos/{owner}/{repo}/rulesets/{ruleset_id}"],
  10134. getRepoRulesets: ["GET /repos/{owner}/{repo}/rulesets"],
  10135. getStatusChecksProtection: [
  10136. "GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks"
  10137. ],
  10138. getTeamsWithAccessToProtectedBranch: [
  10139. "GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams"
  10140. ],
  10141. getTopPaths: ["GET /repos/{owner}/{repo}/traffic/popular/paths"],
  10142. getTopReferrers: ["GET /repos/{owner}/{repo}/traffic/popular/referrers"],
  10143. getUsersWithAccessToProtectedBranch: [
  10144. "GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users"
  10145. ],
  10146. getViews: ["GET /repos/{owner}/{repo}/traffic/views"],
  10147. getWebhook: ["GET /repos/{owner}/{repo}/hooks/{hook_id}"],
  10148. getWebhookConfigForRepo: [
  10149. "GET /repos/{owner}/{repo}/hooks/{hook_id}/config"
  10150. ],
  10151. getWebhookDelivery: [
  10152. "GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}"
  10153. ],
  10154. listActivities: ["GET /repos/{owner}/{repo}/activity"],
  10155. listAutolinks: ["GET /repos/{owner}/{repo}/autolinks"],
  10156. listBranches: ["GET /repos/{owner}/{repo}/branches"],
  10157. listBranchesForHeadCommit: [
  10158. "GET /repos/{owner}/{repo}/commits/{commit_sha}/branches-where-head"
  10159. ],
  10160. listCollaborators: ["GET /repos/{owner}/{repo}/collaborators"],
  10161. listCommentsForCommit: [
  10162. "GET /repos/{owner}/{repo}/commits/{commit_sha}/comments"
  10163. ],
  10164. listCommitCommentsForRepo: ["GET /repos/{owner}/{repo}/comments"],
  10165. listCommitStatusesForRef: [
  10166. "GET /repos/{owner}/{repo}/commits/{ref}/statuses"
  10167. ],
  10168. listCommits: ["GET /repos/{owner}/{repo}/commits"],
  10169. listContributors: ["GET /repos/{owner}/{repo}/contributors"],
  10170. listCustomDeploymentRuleIntegrations: [
  10171. "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/apps"
  10172. ],
  10173. listDeployKeys: ["GET /repos/{owner}/{repo}/keys"],
  10174. listDeploymentBranchPolicies: [
  10175. "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies"
  10176. ],
  10177. listDeploymentStatuses: [
  10178. "GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses"
  10179. ],
  10180. listDeployments: ["GET /repos/{owner}/{repo}/deployments"],
  10181. listForAuthenticatedUser: ["GET /user/repos"],
  10182. listForOrg: ["GET /orgs/{org}/repos"],
  10183. listForUser: ["GET /users/{username}/repos"],
  10184. listForks: ["GET /repos/{owner}/{repo}/forks"],
  10185. listInvitations: ["GET /repos/{owner}/{repo}/invitations"],
  10186. listInvitationsForAuthenticatedUser: ["GET /user/repository_invitations"],
  10187. listLanguages: ["GET /repos/{owner}/{repo}/languages"],
  10188. listPagesBuilds: ["GET /repos/{owner}/{repo}/pages/builds"],
  10189. listPublic: ["GET /repositories"],
  10190. listPullRequestsAssociatedWithCommit: [
  10191. "GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls"
  10192. ],
  10193. listReleaseAssets: [
  10194. "GET /repos/{owner}/{repo}/releases/{release_id}/assets"
  10195. ],
  10196. listReleases: ["GET /repos/{owner}/{repo}/releases"],
  10197. listTagProtection: ["GET /repos/{owner}/{repo}/tags/protection"],
  10198. listTags: ["GET /repos/{owner}/{repo}/tags"],
  10199. listTeams: ["GET /repos/{owner}/{repo}/teams"],
  10200. listWebhookDeliveries: [
  10201. "GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries"
  10202. ],
  10203. listWebhooks: ["GET /repos/{owner}/{repo}/hooks"],
  10204. merge: ["POST /repos/{owner}/{repo}/merges"],
  10205. mergeUpstream: ["POST /repos/{owner}/{repo}/merge-upstream"],
  10206. pingWebhook: ["POST /repos/{owner}/{repo}/hooks/{hook_id}/pings"],
  10207. redeliverWebhookDelivery: [
  10208. "POST /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}/attempts"
  10209. ],
  10210. removeAppAccessRestrictions: [
  10211. "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps",
  10212. {},
  10213. { mapToData: "apps" }
  10214. ],
  10215. removeCollaborator: [
  10216. "DELETE /repos/{owner}/{repo}/collaborators/{username}"
  10217. ],
  10218. removeStatusCheckContexts: [
  10219. "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts",
  10220. {},
  10221. { mapToData: "contexts" }
  10222. ],
  10223. removeStatusCheckProtection: [
  10224. "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks"
  10225. ],
  10226. removeTeamAccessRestrictions: [
  10227. "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams",
  10228. {},
  10229. { mapToData: "teams" }
  10230. ],
  10231. removeUserAccessRestrictions: [
  10232. "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users",
  10233. {},
  10234. { mapToData: "users" }
  10235. ],
  10236. renameBranch: ["POST /repos/{owner}/{repo}/branches/{branch}/rename"],
  10237. replaceAllTopics: ["PUT /repos/{owner}/{repo}/topics"],
  10238. requestPagesBuild: ["POST /repos/{owner}/{repo}/pages/builds"],
  10239. setAdminBranchProtection: [
  10240. "POST /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins"
  10241. ],
  10242. setAppAccessRestrictions: [
  10243. "PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps",
  10244. {},
  10245. { mapToData: "apps" }
  10246. ],
  10247. setStatusCheckContexts: [
  10248. "PUT /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts",
  10249. {},
  10250. { mapToData: "contexts" }
  10251. ],
  10252. setTeamAccessRestrictions: [
  10253. "PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams",
  10254. {},
  10255. { mapToData: "teams" }
  10256. ],
  10257. setUserAccessRestrictions: [
  10258. "PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users",
  10259. {},
  10260. { mapToData: "users" }
  10261. ],
  10262. testPushWebhook: ["POST /repos/{owner}/{repo}/hooks/{hook_id}/tests"],
  10263. transfer: ["POST /repos/{owner}/{repo}/transfer"],
  10264. update: ["PATCH /repos/{owner}/{repo}"],
  10265. updateBranchProtection: [
  10266. "PUT /repos/{owner}/{repo}/branches/{branch}/protection"
  10267. ],
  10268. updateCommitComment: ["PATCH /repos/{owner}/{repo}/comments/{comment_id}"],
  10269. updateDeploymentBranchPolicy: [
  10270. "PUT /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}"
  10271. ],
  10272. updateInformationAboutPagesSite: ["PUT /repos/{owner}/{repo}/pages"],
  10273. updateInvitation: [
  10274. "PATCH /repos/{owner}/{repo}/invitations/{invitation_id}"
  10275. ],
  10276. updateOrgRuleset: ["PUT /orgs/{org}/rulesets/{ruleset_id}"],
  10277. updatePullRequestReviewProtection: [
  10278. "PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews"
  10279. ],
  10280. updateRelease: ["PATCH /repos/{owner}/{repo}/releases/{release_id}"],
  10281. updateReleaseAsset: [
  10282. "PATCH /repos/{owner}/{repo}/releases/assets/{asset_id}"
  10283. ],
  10284. updateRepoRuleset: ["PUT /repos/{owner}/{repo}/rulesets/{ruleset_id}"],
  10285. updateStatusCheckPotection: [
  10286. "PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks",
  10287. {},
  10288. { renamed: ["repos", "updateStatusCheckProtection"] }
  10289. ],
  10290. updateStatusCheckProtection: [
  10291. "PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks"
  10292. ],
  10293. updateWebhook: ["PATCH /repos/{owner}/{repo}/hooks/{hook_id}"],
  10294. updateWebhookConfigForRepo: [
  10295. "PATCH /repos/{owner}/{repo}/hooks/{hook_id}/config"
  10296. ],
  10297. uploadReleaseAsset: [
  10298. "POST /repos/{owner}/{repo}/releases/{release_id}/assets{?name,label}",
  10299. { baseUrl: "https://uploads.github.com" }
  10300. ]
  10301. },
  10302. search: {
  10303. code: ["GET /search/code"],
  10304. commits: ["GET /search/commits"],
  10305. issuesAndPullRequests: ["GET /search/issues"],
  10306. labels: ["GET /search/labels"],
  10307. repos: ["GET /search/repositories"],
  10308. topics: ["GET /search/topics"],
  10309. users: ["GET /search/users"]
  10310. },
  10311. secretScanning: {
  10312. getAlert: [
  10313. "GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}"
  10314. ],
  10315. listAlertsForEnterprise: [
  10316. "GET /enterprises/{enterprise}/secret-scanning/alerts"
  10317. ],
  10318. listAlertsForOrg: ["GET /orgs/{org}/secret-scanning/alerts"],
  10319. listAlertsForRepo: ["GET /repos/{owner}/{repo}/secret-scanning/alerts"],
  10320. listLocationsForAlert: [
  10321. "GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations"
  10322. ],
  10323. updateAlert: [
  10324. "PATCH /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}"
  10325. ]
  10326. },
  10327. securityAdvisories: {
  10328. createFork: [
  10329. "POST /repos/{owner}/{repo}/security-advisories/{ghsa_id}/forks"
  10330. ],
  10331. createPrivateVulnerabilityReport: [
  10332. "POST /repos/{owner}/{repo}/security-advisories/reports"
  10333. ],
  10334. createRepositoryAdvisory: [
  10335. "POST /repos/{owner}/{repo}/security-advisories"
  10336. ],
  10337. createRepositoryAdvisoryCveRequest: [
  10338. "POST /repos/{owner}/{repo}/security-advisories/{ghsa_id}/cve"
  10339. ],
  10340. getGlobalAdvisory: ["GET /advisories/{ghsa_id}"],
  10341. getRepositoryAdvisory: [
  10342. "GET /repos/{owner}/{repo}/security-advisories/{ghsa_id}"
  10343. ],
  10344. listGlobalAdvisories: ["GET /advisories"],
  10345. listOrgRepositoryAdvisories: ["GET /orgs/{org}/security-advisories"],
  10346. listRepositoryAdvisories: ["GET /repos/{owner}/{repo}/security-advisories"],
  10347. updateRepositoryAdvisory: [
  10348. "PATCH /repos/{owner}/{repo}/security-advisories/{ghsa_id}"
  10349. ]
  10350. },
  10351. teams: {
  10352. addOrUpdateMembershipForUserInOrg: [
  10353. "PUT /orgs/{org}/teams/{team_slug}/memberships/{username}"
  10354. ],
  10355. addOrUpdateProjectPermissionsInOrg: [
  10356. "PUT /orgs/{org}/teams/{team_slug}/projects/{project_id}"
  10357. ],
  10358. addOrUpdateRepoPermissionsInOrg: [
  10359. "PUT /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"
  10360. ],
  10361. checkPermissionsForProjectInOrg: [
  10362. "GET /orgs/{org}/teams/{team_slug}/projects/{project_id}"
  10363. ],
  10364. checkPermissionsForRepoInOrg: [
  10365. "GET /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"
  10366. ],
  10367. create: ["POST /orgs/{org}/teams"],
  10368. createDiscussionCommentInOrg: [
  10369. "POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments"
  10370. ],
  10371. createDiscussionInOrg: ["POST /orgs/{org}/teams/{team_slug}/discussions"],
  10372. deleteDiscussionCommentInOrg: [
  10373. "DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}"
  10374. ],
  10375. deleteDiscussionInOrg: [
  10376. "DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}"
  10377. ],
  10378. deleteInOrg: ["DELETE /orgs/{org}/teams/{team_slug}"],
  10379. getByName: ["GET /orgs/{org}/teams/{team_slug}"],
  10380. getDiscussionCommentInOrg: [
  10381. "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}"
  10382. ],
  10383. getDiscussionInOrg: [
  10384. "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}"
  10385. ],
  10386. getMembershipForUserInOrg: [
  10387. "GET /orgs/{org}/teams/{team_slug}/memberships/{username}"
  10388. ],
  10389. list: ["GET /orgs/{org}/teams"],
  10390. listChildInOrg: ["GET /orgs/{org}/teams/{team_slug}/teams"],
  10391. listDiscussionCommentsInOrg: [
  10392. "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments"
  10393. ],
  10394. listDiscussionsInOrg: ["GET /orgs/{org}/teams/{team_slug}/discussions"],
  10395. listForAuthenticatedUser: ["GET /user/teams"],
  10396. listMembersInOrg: ["GET /orgs/{org}/teams/{team_slug}/members"],
  10397. listPendingInvitationsInOrg: [
  10398. "GET /orgs/{org}/teams/{team_slug}/invitations"
  10399. ],
  10400. listProjectsInOrg: ["GET /orgs/{org}/teams/{team_slug}/projects"],
  10401. listReposInOrg: ["GET /orgs/{org}/teams/{team_slug}/repos"],
  10402. removeMembershipForUserInOrg: [
  10403. "DELETE /orgs/{org}/teams/{team_slug}/memberships/{username}"
  10404. ],
  10405. removeProjectInOrg: [
  10406. "DELETE /orgs/{org}/teams/{team_slug}/projects/{project_id}"
  10407. ],
  10408. removeRepoInOrg: [
  10409. "DELETE /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"
  10410. ],
  10411. updateDiscussionCommentInOrg: [
  10412. "PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}"
  10413. ],
  10414. updateDiscussionInOrg: [
  10415. "PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}"
  10416. ],
  10417. updateInOrg: ["PATCH /orgs/{org}/teams/{team_slug}"]
  10418. },
  10419. users: {
  10420. addEmailForAuthenticated: [
  10421. "POST /user/emails",
  10422. {},
  10423. { renamed: ["users", "addEmailForAuthenticatedUser"] }
  10424. ],
  10425. addEmailForAuthenticatedUser: ["POST /user/emails"],
  10426. addSocialAccountForAuthenticatedUser: ["POST /user/social_accounts"],
  10427. block: ["PUT /user/blocks/{username}"],
  10428. checkBlocked: ["GET /user/blocks/{username}"],
  10429. checkFollowingForUser: ["GET /users/{username}/following/{target_user}"],
  10430. checkPersonIsFollowedByAuthenticated: ["GET /user/following/{username}"],
  10431. createGpgKeyForAuthenticated: [
  10432. "POST /user/gpg_keys",
  10433. {},
  10434. { renamed: ["users", "createGpgKeyForAuthenticatedUser"] }
  10435. ],
  10436. createGpgKeyForAuthenticatedUser: ["POST /user/gpg_keys"],
  10437. createPublicSshKeyForAuthenticated: [
  10438. "POST /user/keys",
  10439. {},
  10440. { renamed: ["users", "createPublicSshKeyForAuthenticatedUser"] }
  10441. ],
  10442. createPublicSshKeyForAuthenticatedUser: ["POST /user/keys"],
  10443. createSshSigningKeyForAuthenticatedUser: ["POST /user/ssh_signing_keys"],
  10444. deleteEmailForAuthenticated: [
  10445. "DELETE /user/emails",
  10446. {},
  10447. { renamed: ["users", "deleteEmailForAuthenticatedUser"] }
  10448. ],
  10449. deleteEmailForAuthenticatedUser: ["DELETE /user/emails"],
  10450. deleteGpgKeyForAuthenticated: [
  10451. "DELETE /user/gpg_keys/{gpg_key_id}",
  10452. {},
  10453. { renamed: ["users", "deleteGpgKeyForAuthenticatedUser"] }
  10454. ],
  10455. deleteGpgKeyForAuthenticatedUser: ["DELETE /user/gpg_keys/{gpg_key_id}"],
  10456. deletePublicSshKeyForAuthenticated: [
  10457. "DELETE /user/keys/{key_id}",
  10458. {},
  10459. { renamed: ["users", "deletePublicSshKeyForAuthenticatedUser"] }
  10460. ],
  10461. deletePublicSshKeyForAuthenticatedUser: ["DELETE /user/keys/{key_id}"],
  10462. deleteSocialAccountForAuthenticatedUser: ["DELETE /user/social_accounts"],
  10463. deleteSshSigningKeyForAuthenticatedUser: [
  10464. "DELETE /user/ssh_signing_keys/{ssh_signing_key_id}"
  10465. ],
  10466. follow: ["PUT /user/following/{username}"],
  10467. getAuthenticated: ["GET /user"],
  10468. getByUsername: ["GET /users/{username}"],
  10469. getContextForUser: ["GET /users/{username}/hovercard"],
  10470. getGpgKeyForAuthenticated: [
  10471. "GET /user/gpg_keys/{gpg_key_id}",
  10472. {},
  10473. { renamed: ["users", "getGpgKeyForAuthenticatedUser"] }
  10474. ],
  10475. getGpgKeyForAuthenticatedUser: ["GET /user/gpg_keys/{gpg_key_id}"],
  10476. getPublicSshKeyForAuthenticated: [
  10477. "GET /user/keys/{key_id}",
  10478. {},
  10479. { renamed: ["users", "getPublicSshKeyForAuthenticatedUser"] }
  10480. ],
  10481. getPublicSshKeyForAuthenticatedUser: ["GET /user/keys/{key_id}"],
  10482. getSshSigningKeyForAuthenticatedUser: [
  10483. "GET /user/ssh_signing_keys/{ssh_signing_key_id}"
  10484. ],
  10485. list: ["GET /users"],
  10486. listBlockedByAuthenticated: [
  10487. "GET /user/blocks",
  10488. {},
  10489. { renamed: ["users", "listBlockedByAuthenticatedUser"] }
  10490. ],
  10491. listBlockedByAuthenticatedUser: ["GET /user/blocks"],
  10492. listEmailsForAuthenticated: [
  10493. "GET /user/emails",
  10494. {},
  10495. { renamed: ["users", "listEmailsForAuthenticatedUser"] }
  10496. ],
  10497. listEmailsForAuthenticatedUser: ["GET /user/emails"],
  10498. listFollowedByAuthenticated: [
  10499. "GET /user/following",
  10500. {},
  10501. { renamed: ["users", "listFollowedByAuthenticatedUser"] }
  10502. ],
  10503. listFollowedByAuthenticatedUser: ["GET /user/following"],
  10504. listFollowersForAuthenticatedUser: ["GET /user/followers"],
  10505. listFollowersForUser: ["GET /users/{username}/followers"],
  10506. listFollowingForUser: ["GET /users/{username}/following"],
  10507. listGpgKeysForAuthenticated: [
  10508. "GET /user/gpg_keys",
  10509. {},
  10510. { renamed: ["users", "listGpgKeysForAuthenticatedUser"] }
  10511. ],
  10512. listGpgKeysForAuthenticatedUser: ["GET /user/gpg_keys"],
  10513. listGpgKeysForUser: ["GET /users/{username}/gpg_keys"],
  10514. listPublicEmailsForAuthenticated: [
  10515. "GET /user/public_emails",
  10516. {},
  10517. { renamed: ["users", "listPublicEmailsForAuthenticatedUser"] }
  10518. ],
  10519. listPublicEmailsForAuthenticatedUser: ["GET /user/public_emails"],
  10520. listPublicKeysForUser: ["GET /users/{username}/keys"],
  10521. listPublicSshKeysForAuthenticated: [
  10522. "GET /user/keys",
  10523. {},
  10524. { renamed: ["users", "listPublicSshKeysForAuthenticatedUser"] }
  10525. ],
  10526. listPublicSshKeysForAuthenticatedUser: ["GET /user/keys"],
  10527. listSocialAccountsForAuthenticatedUser: ["GET /user/social_accounts"],
  10528. listSocialAccountsForUser: ["GET /users/{username}/social_accounts"],
  10529. listSshSigningKeysForAuthenticatedUser: ["GET /user/ssh_signing_keys"],
  10530. listSshSigningKeysForUser: ["GET /users/{username}/ssh_signing_keys"],
  10531. setPrimaryEmailVisibilityForAuthenticated: [
  10532. "PATCH /user/email/visibility",
  10533. {},
  10534. { renamed: ["users", "setPrimaryEmailVisibilityForAuthenticatedUser"] }
  10535. ],
  10536. setPrimaryEmailVisibilityForAuthenticatedUser: [
  10537. "PATCH /user/email/visibility"
  10538. ],
  10539. unblock: ["DELETE /user/blocks/{username}"],
  10540. unfollow: ["DELETE /user/following/{username}"],
  10541. updateAuthenticated: ["PATCH /user"]
  10542. }
  10543. };
  10544. var endpoints_default = Endpoints;
  10545. // pkg/dist-src/endpoints-to-methods.js
  10546. var endpointMethodsMap = /* @__PURE__ */ new Map();
  10547. for (const [scope, endpoints] of Object.entries(endpoints_default)) {
  10548. for (const [methodName, endpoint] of Object.entries(endpoints)) {
  10549. const [route, defaults, decorations] = endpoint;
  10550. const [method, url] = route.split(/ /);
  10551. const endpointDefaults = Object.assign(
  10552. {
  10553. method,
  10554. url
  10555. },
  10556. defaults
  10557. );
  10558. if (!endpointMethodsMap.has(scope)) {
  10559. endpointMethodsMap.set(scope, /* @__PURE__ */ new Map());
  10560. }
  10561. endpointMethodsMap.get(scope).set(methodName, {
  10562. scope,
  10563. methodName,
  10564. endpointDefaults,
  10565. decorations
  10566. });
  10567. }
  10568. }
  10569. var handler = {
  10570. has({ scope }, methodName) {
  10571. return endpointMethodsMap.get(scope).has(methodName);
  10572. },
  10573. getOwnPropertyDescriptor(target, methodName) {
  10574. return {
  10575. value: this.get(target, methodName),
  10576. // ensures method is in the cache
  10577. configurable: true,
  10578. writable: true,
  10579. enumerable: true
  10580. };
  10581. },
  10582. defineProperty(target, methodName, descriptor) {
  10583. Object.defineProperty(target.cache, methodName, descriptor);
  10584. return true;
  10585. },
  10586. deleteProperty(target, methodName) {
  10587. delete target.cache[methodName];
  10588. return true;
  10589. },
  10590. ownKeys({ scope }) {
  10591. return [...endpointMethodsMap.get(scope).keys()];
  10592. },
  10593. set(target, methodName, value) {
  10594. return target.cache[methodName] = value;
  10595. },
  10596. get({ octokit, scope, cache }, methodName) {
  10597. if (cache[methodName]) {
  10598. return cache[methodName];
  10599. }
  10600. const method = endpointMethodsMap.get(scope).get(methodName);
  10601. if (!method) {
  10602. return void 0;
  10603. }
  10604. const { endpointDefaults, decorations } = method;
  10605. if (decorations) {
  10606. cache[methodName] = decorate(
  10607. octokit,
  10608. scope,
  10609. methodName,
  10610. endpointDefaults,
  10611. decorations
  10612. );
  10613. } else {
  10614. cache[methodName] = octokit.request.defaults(endpointDefaults);
  10615. }
  10616. return cache[methodName];
  10617. }
  10618. };
  10619. function endpointsToMethods(octokit) {
  10620. const newMethods = {};
  10621. for (const scope of endpointMethodsMap.keys()) {
  10622. newMethods[scope] = new Proxy({ octokit, scope, cache: {} }, handler);
  10623. }
  10624. return newMethods;
  10625. }
  10626. function decorate(octokit, scope, methodName, defaults, decorations) {
  10627. const requestWithDefaults = octokit.request.defaults(defaults);
  10628. function withDecorations(...args) {
  10629. let options = requestWithDefaults.endpoint.merge(...args);
  10630. if (decorations.mapToData) {
  10631. options = Object.assign({}, options, {
  10632. data: options[decorations.mapToData],
  10633. [decorations.mapToData]: void 0
  10634. });
  10635. return requestWithDefaults(options);
  10636. }
  10637. if (decorations.renamed) {
  10638. const [newScope, newMethodName] = decorations.renamed;
  10639. octokit.log.warn(
  10640. `octokit.${scope}.${methodName}() has been renamed to octokit.${newScope}.${newMethodName}()`
  10641. );
  10642. }
  10643. if (decorations.deprecated) {
  10644. octokit.log.warn(decorations.deprecated);
  10645. }
  10646. if (decorations.renamedParameters) {
  10647. const options2 = requestWithDefaults.endpoint.merge(...args);
  10648. for (const [name, alias] of Object.entries(
  10649. decorations.renamedParameters
  10650. )) {
  10651. if (name in options2) {
  10652. octokit.log.warn(
  10653. `"${name}" parameter is deprecated for "octokit.${scope}.${methodName}()". Use "${alias}" instead`
  10654. );
  10655. if (!(alias in options2)) {
  10656. options2[alias] = options2[name];
  10657. }
  10658. delete options2[name];
  10659. }
  10660. }
  10661. return requestWithDefaults(options2);
  10662. }
  10663. return requestWithDefaults(...args);
  10664. }
  10665. return Object.assign(withDecorations, requestWithDefaults);
  10666. }
  10667. // pkg/dist-src/index.js
  10668. function restEndpointMethods(octokit) {
  10669. const api = endpointsToMethods(octokit);
  10670. return {
  10671. rest: api
  10672. };
  10673. }
  10674. restEndpointMethods.VERSION = VERSION;
  10675. function legacyRestEndpointMethods(octokit) {
  10676. const api = endpointsToMethods(octokit);
  10677. return {
  10678. ...api,
  10679. rest: api
  10680. };
  10681. }
  10682. legacyRestEndpointMethods.VERSION = VERSION;
  10683. // Annotate the CommonJS export names for ESM import in node:
  10684. 0 && (0);
  10685. /***/ }),
  10686. /***/ 537:
  10687. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  10688. "use strict";
  10689. var __create = Object.create;
  10690. var __defProp = Object.defineProperty;
  10691. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  10692. var __getOwnPropNames = Object.getOwnPropertyNames;
  10693. var __getProtoOf = Object.getPrototypeOf;
  10694. var __hasOwnProp = Object.prototype.hasOwnProperty;
  10695. var __export = (target, all) => {
  10696. for (var name in all)
  10697. __defProp(target, name, { get: all[name], enumerable: true });
  10698. };
  10699. var __copyProps = (to, from, except, desc) => {
  10700. if (from && typeof from === "object" || typeof from === "function") {
  10701. for (let key of __getOwnPropNames(from))
  10702. if (!__hasOwnProp.call(to, key) && key !== except)
  10703. __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  10704. }
  10705. return to;
  10706. };
  10707. var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
  10708. // If the importer is in node compatibility mode or this is not an ESM
  10709. // file that has been converted to a CommonJS file using a Babel-
  10710. // compatible transform (i.e. "__esModule" has not been set), then set
  10711. // "default" to the CommonJS "module.exports" for node compatibility.
  10712. isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
  10713. mod
  10714. ));
  10715. var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
  10716. // pkg/dist-src/index.js
  10717. var dist_src_exports = {};
  10718. __export(dist_src_exports, {
  10719. RequestError: () => RequestError
  10720. });
  10721. module.exports = __toCommonJS(dist_src_exports);
  10722. var import_deprecation = __nccwpck_require__(8932);
  10723. var import_once = __toESM(__nccwpck_require__(1223));
  10724. var logOnceCode = (0, import_once.default)((deprecation) => console.warn(deprecation));
  10725. var logOnceHeaders = (0, import_once.default)((deprecation) => console.warn(deprecation));
  10726. var RequestError = class extends Error {
  10727. constructor(message, statusCode, options) {
  10728. super(message);
  10729. if (Error.captureStackTrace) {
  10730. Error.captureStackTrace(this, this.constructor);
  10731. }
  10732. this.name = "HttpError";
  10733. this.status = statusCode;
  10734. let headers;
  10735. if ("headers" in options && typeof options.headers !== "undefined") {
  10736. headers = options.headers;
  10737. }
  10738. if ("response" in options) {
  10739. this.response = options.response;
  10740. headers = options.response.headers;
  10741. }
  10742. const requestCopy = Object.assign({}, options.request);
  10743. if (options.request.headers.authorization) {
  10744. requestCopy.headers = Object.assign({}, options.request.headers, {
  10745. authorization: options.request.headers.authorization.replace(
  10746. /(?<! ) .*$/,
  10747. " [REDACTED]"
  10748. )
  10749. });
  10750. }
  10751. requestCopy.url = requestCopy.url.replace(/\bclient_secret=\w+/g, "client_secret=[REDACTED]").replace(/\baccess_token=\w+/g, "access_token=[REDACTED]");
  10752. this.request = requestCopy;
  10753. Object.defineProperty(this, "code", {
  10754. get() {
  10755. logOnceCode(
  10756. new import_deprecation.Deprecation(
  10757. "[@octokit/request-error] `error.code` is deprecated, use `error.status`."
  10758. )
  10759. );
  10760. return statusCode;
  10761. }
  10762. });
  10763. Object.defineProperty(this, "headers", {
  10764. get() {
  10765. logOnceHeaders(
  10766. new import_deprecation.Deprecation(
  10767. "[@octokit/request-error] `error.headers` is deprecated, use `error.response.headers`."
  10768. )
  10769. );
  10770. return headers || {};
  10771. }
  10772. });
  10773. }
  10774. };
  10775. // Annotate the CommonJS export names for ESM import in node:
  10776. 0 && (0);
  10777. /***/ }),
  10778. /***/ 6234:
  10779. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  10780. "use strict";
  10781. var __defProp = Object.defineProperty;
  10782. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  10783. var __getOwnPropNames = Object.getOwnPropertyNames;
  10784. var __hasOwnProp = Object.prototype.hasOwnProperty;
  10785. var __export = (target, all) => {
  10786. for (var name in all)
  10787. __defProp(target, name, { get: all[name], enumerable: true });
  10788. };
  10789. var __copyProps = (to, from, except, desc) => {
  10790. if (from && typeof from === "object" || typeof from === "function") {
  10791. for (let key of __getOwnPropNames(from))
  10792. if (!__hasOwnProp.call(to, key) && key !== except)
  10793. __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  10794. }
  10795. return to;
  10796. };
  10797. var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
  10798. // pkg/dist-src/index.js
  10799. var dist_src_exports = {};
  10800. __export(dist_src_exports, {
  10801. request: () => request
  10802. });
  10803. module.exports = __toCommonJS(dist_src_exports);
  10804. var import_endpoint = __nccwpck_require__(9440);
  10805. var import_universal_user_agent = __nccwpck_require__(5030);
  10806. // pkg/dist-src/version.js
  10807. var VERSION = "8.4.1";
  10808. // pkg/dist-src/is-plain-object.js
  10809. function isPlainObject(value) {
  10810. if (typeof value !== "object" || value === null)
  10811. return false;
  10812. if (Object.prototype.toString.call(value) !== "[object Object]")
  10813. return false;
  10814. const proto = Object.getPrototypeOf(value);
  10815. if (proto === null)
  10816. return true;
  10817. const Ctor = Object.prototype.hasOwnProperty.call(proto, "constructor") && proto.constructor;
  10818. return typeof Ctor === "function" && Ctor instanceof Ctor && Function.prototype.call(Ctor) === Function.prototype.call(value);
  10819. }
  10820. // pkg/dist-src/fetch-wrapper.js
  10821. var import_request_error = __nccwpck_require__(537);
  10822. // pkg/dist-src/get-buffer-response.js
  10823. function getBufferResponse(response) {
  10824. return response.arrayBuffer();
  10825. }
  10826. // pkg/dist-src/fetch-wrapper.js
  10827. function fetchWrapper(requestOptions) {
  10828. var _a, _b, _c, _d;
  10829. const log = requestOptions.request && requestOptions.request.log ? requestOptions.request.log : console;
  10830. const parseSuccessResponseBody = ((_a = requestOptions.request) == null ? void 0 : _a.parseSuccessResponseBody) !== false;
  10831. if (isPlainObject(requestOptions.body) || Array.isArray(requestOptions.body)) {
  10832. requestOptions.body = JSON.stringify(requestOptions.body);
  10833. }
  10834. let headers = {};
  10835. let status;
  10836. let url;
  10837. let { fetch } = globalThis;
  10838. if ((_b = requestOptions.request) == null ? void 0 : _b.fetch) {
  10839. fetch = requestOptions.request.fetch;
  10840. }
  10841. if (!fetch) {
  10842. throw new Error(
  10843. "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"
  10844. );
  10845. }
  10846. return fetch(requestOptions.url, {
  10847. method: requestOptions.method,
  10848. body: requestOptions.body,
  10849. redirect: (_c = requestOptions.request) == null ? void 0 : _c.redirect,
  10850. headers: requestOptions.headers,
  10851. signal: (_d = requestOptions.request) == null ? void 0 : _d.signal,
  10852. // duplex must be set if request.body is ReadableStream or Async Iterables.
  10853. // See https://fetch.spec.whatwg.org/#dom-requestinit-duplex.
  10854. ...requestOptions.body && { duplex: "half" }
  10855. }).then(async (response) => {
  10856. url = response.url;
  10857. status = response.status;
  10858. for (const keyAndValue of response.headers) {
  10859. headers[keyAndValue[0]] = keyAndValue[1];
  10860. }
  10861. if ("deprecation" in headers) {
  10862. const matches = headers.link && headers.link.match(/<([^<>]+)>; rel="deprecation"/);
  10863. const deprecationLink = matches && matches.pop();
  10864. log.warn(
  10865. `[@octokit/request] "${requestOptions.method} ${requestOptions.url}" is deprecated. It is scheduled to be removed on ${headers.sunset}${deprecationLink ? `. See ${deprecationLink}` : ""}`
  10866. );
  10867. }
  10868. if (status === 204 || status === 205) {
  10869. return;
  10870. }
  10871. if (requestOptions.method === "HEAD") {
  10872. if (status < 400) {
  10873. return;
  10874. }
  10875. throw new import_request_error.RequestError(response.statusText, status, {
  10876. response: {
  10877. url,
  10878. status,
  10879. headers,
  10880. data: void 0
  10881. },
  10882. request: requestOptions
  10883. });
  10884. }
  10885. if (status === 304) {
  10886. throw new import_request_error.RequestError("Not modified", status, {
  10887. response: {
  10888. url,
  10889. status,
  10890. headers,
  10891. data: await getResponseData(response)
  10892. },
  10893. request: requestOptions
  10894. });
  10895. }
  10896. if (status >= 400) {
  10897. const data = await getResponseData(response);
  10898. const error = new import_request_error.RequestError(toErrorMessage(data), status, {
  10899. response: {
  10900. url,
  10901. status,
  10902. headers,
  10903. data
  10904. },
  10905. request: requestOptions
  10906. });
  10907. throw error;
  10908. }
  10909. return parseSuccessResponseBody ? await getResponseData(response) : response.body;
  10910. }).then((data) => {
  10911. return {
  10912. status,
  10913. url,
  10914. headers,
  10915. data
  10916. };
  10917. }).catch((error) => {
  10918. if (error instanceof import_request_error.RequestError)
  10919. throw error;
  10920. else if (error.name === "AbortError")
  10921. throw error;
  10922. let message = error.message;
  10923. if (error.name === "TypeError" && "cause" in error) {
  10924. if (error.cause instanceof Error) {
  10925. message = error.cause.message;
  10926. } else if (typeof error.cause === "string") {
  10927. message = error.cause;
  10928. }
  10929. }
  10930. throw new import_request_error.RequestError(message, 500, {
  10931. request: requestOptions
  10932. });
  10933. });
  10934. }
  10935. async function getResponseData(response) {
  10936. const contentType = response.headers.get("content-type");
  10937. if (/application\/json/.test(contentType)) {
  10938. return response.json().catch(() => response.text()).catch(() => "");
  10939. }
  10940. if (!contentType || /^text\/|charset=utf-8$/.test(contentType)) {
  10941. return response.text();
  10942. }
  10943. return getBufferResponse(response);
  10944. }
  10945. function toErrorMessage(data) {
  10946. if (typeof data === "string")
  10947. return data;
  10948. let suffix;
  10949. if ("documentation_url" in data) {
  10950. suffix = ` - ${data.documentation_url}`;
  10951. } else {
  10952. suffix = "";
  10953. }
  10954. if ("message" in data) {
  10955. if (Array.isArray(data.errors)) {
  10956. return `${data.message}: ${data.errors.map(JSON.stringify).join(", ")}${suffix}`;
  10957. }
  10958. return `${data.message}${suffix}`;
  10959. }
  10960. return `Unknown error: ${JSON.stringify(data)}`;
  10961. }
  10962. // pkg/dist-src/with-defaults.js
  10963. function withDefaults(oldEndpoint, newDefaults) {
  10964. const endpoint2 = oldEndpoint.defaults(newDefaults);
  10965. const newApi = function(route, parameters) {
  10966. const endpointOptions = endpoint2.merge(route, parameters);
  10967. if (!endpointOptions.request || !endpointOptions.request.hook) {
  10968. return fetchWrapper(endpoint2.parse(endpointOptions));
  10969. }
  10970. const request2 = (route2, parameters2) => {
  10971. return fetchWrapper(
  10972. endpoint2.parse(endpoint2.merge(route2, parameters2))
  10973. );
  10974. };
  10975. Object.assign(request2, {
  10976. endpoint: endpoint2,
  10977. defaults: withDefaults.bind(null, endpoint2)
  10978. });
  10979. return endpointOptions.request.hook(request2, endpointOptions);
  10980. };
  10981. return Object.assign(newApi, {
  10982. endpoint: endpoint2,
  10983. defaults: withDefaults.bind(null, endpoint2)
  10984. });
  10985. }
  10986. // pkg/dist-src/index.js
  10987. var request = withDefaults(import_endpoint.endpoint, {
  10988. headers: {
  10989. "user-agent": `octokit-request.js/${VERSION} ${(0, import_universal_user_agent.getUserAgent)()}`
  10990. }
  10991. });
  10992. // Annotate the CommonJS export names for ESM import in node:
  10993. 0 && (0);
  10994. /***/ }),
  10995. /***/ 3682:
  10996. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  10997. var register = __nccwpck_require__(4670);
  10998. var addHook = __nccwpck_require__(5549);
  10999. var removeHook = __nccwpck_require__(6819);
  11000. // bind with array of arguments: https://stackoverflow.com/a/21792913
  11001. var bind = Function.bind;
  11002. var bindable = bind.bind(bind);
  11003. function bindApi(hook, state, name) {
  11004. var removeHookRef = bindable(removeHook, null).apply(
  11005. null,
  11006. name ? [state, name] : [state]
  11007. );
  11008. hook.api = { remove: removeHookRef };
  11009. hook.remove = removeHookRef;
  11010. ["before", "error", "after", "wrap"].forEach(function (kind) {
  11011. var args = name ? [state, kind, name] : [state, kind];
  11012. hook[kind] = hook.api[kind] = bindable(addHook, null).apply(null, args);
  11013. });
  11014. }
  11015. function HookSingular() {
  11016. var singularHookName = "h";
  11017. var singularHookState = {
  11018. registry: {},
  11019. };
  11020. var singularHook = register.bind(null, singularHookState, singularHookName);
  11021. bindApi(singularHook, singularHookState, singularHookName);
  11022. return singularHook;
  11023. }
  11024. function HookCollection() {
  11025. var state = {
  11026. registry: {},
  11027. };
  11028. var hook = register.bind(null, state);
  11029. bindApi(hook, state);
  11030. return hook;
  11031. }
  11032. var collectionHookDeprecationMessageDisplayed = false;
  11033. function Hook() {
  11034. if (!collectionHookDeprecationMessageDisplayed) {
  11035. console.warn(
  11036. '[before-after-hook]: "Hook()" repurposing warning, use "Hook.Collection()". Read more: https://git.io/upgrade-before-after-hook-to-1.4'
  11037. );
  11038. collectionHookDeprecationMessageDisplayed = true;
  11039. }
  11040. return HookCollection();
  11041. }
  11042. Hook.Singular = HookSingular.bind();
  11043. Hook.Collection = HookCollection.bind();
  11044. module.exports = Hook;
  11045. // expose constructors as a named property for TypeScript
  11046. module.exports.Hook = Hook;
  11047. module.exports.Singular = Hook.Singular;
  11048. module.exports.Collection = Hook.Collection;
  11049. /***/ }),
  11050. /***/ 5549:
  11051. /***/ ((module) => {
  11052. module.exports = addHook;
  11053. function addHook(state, kind, name, hook) {
  11054. var orig = hook;
  11055. if (!state.registry[name]) {
  11056. state.registry[name] = [];
  11057. }
  11058. if (kind === "before") {
  11059. hook = function (method, options) {
  11060. return Promise.resolve()
  11061. .then(orig.bind(null, options))
  11062. .then(method.bind(null, options));
  11063. };
  11064. }
  11065. if (kind === "after") {
  11066. hook = function (method, options) {
  11067. var result;
  11068. return Promise.resolve()
  11069. .then(method.bind(null, options))
  11070. .then(function (result_) {
  11071. result = result_;
  11072. return orig(result, options);
  11073. })
  11074. .then(function () {
  11075. return result;
  11076. });
  11077. };
  11078. }
  11079. if (kind === "error") {
  11080. hook = function (method, options) {
  11081. return Promise.resolve()
  11082. .then(method.bind(null, options))
  11083. .catch(function (error) {
  11084. return orig(error, options);
  11085. });
  11086. };
  11087. }
  11088. state.registry[name].push({
  11089. hook: hook,
  11090. orig: orig,
  11091. });
  11092. }
  11093. /***/ }),
  11094. /***/ 4670:
  11095. /***/ ((module) => {
  11096. module.exports = register;
  11097. function register(state, name, method, options) {
  11098. if (typeof method !== "function") {
  11099. throw new Error("method for before hook must be a function");
  11100. }
  11101. if (!options) {
  11102. options = {};
  11103. }
  11104. if (Array.isArray(name)) {
  11105. return name.reverse().reduce(function (callback, name) {
  11106. return register.bind(null, state, name, callback, options);
  11107. }, method)();
  11108. }
  11109. return Promise.resolve().then(function () {
  11110. if (!state.registry[name]) {
  11111. return method(options);
  11112. }
  11113. return state.registry[name].reduce(function (method, registered) {
  11114. return registered.hook.bind(null, method, options);
  11115. }, method)();
  11116. });
  11117. }
  11118. /***/ }),
  11119. /***/ 6819:
  11120. /***/ ((module) => {
  11121. module.exports = removeHook;
  11122. function removeHook(state, name, method) {
  11123. if (!state.registry[name]) {
  11124. return;
  11125. }
  11126. var index = state.registry[name]
  11127. .map(function (registered) {
  11128. return registered.orig;
  11129. })
  11130. .indexOf(method);
  11131. if (index === -1) {
  11132. return;
  11133. }
  11134. state.registry[name].splice(index, 1);
  11135. }
  11136. /***/ }),
  11137. /***/ 8932:
  11138. /***/ ((__unused_webpack_module, exports) => {
  11139. "use strict";
  11140. Object.defineProperty(exports, "__esModule", ({ value: true }));
  11141. class Deprecation extends Error {
  11142. constructor(message) {
  11143. super(message); // Maintains proper stack trace (only available on V8)
  11144. /* istanbul ignore next */
  11145. if (Error.captureStackTrace) {
  11146. Error.captureStackTrace(this, this.constructor);
  11147. }
  11148. this.name = 'Deprecation';
  11149. }
  11150. }
  11151. exports.Deprecation = Deprecation;
  11152. /***/ }),
  11153. /***/ 1223:
  11154. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  11155. var wrappy = __nccwpck_require__(2940)
  11156. module.exports = wrappy(once)
  11157. module.exports.strict = wrappy(onceStrict)
  11158. once.proto = once(function () {
  11159. Object.defineProperty(Function.prototype, 'once', {
  11160. value: function () {
  11161. return once(this)
  11162. },
  11163. configurable: true
  11164. })
  11165. Object.defineProperty(Function.prototype, 'onceStrict', {
  11166. value: function () {
  11167. return onceStrict(this)
  11168. },
  11169. configurable: true
  11170. })
  11171. })
  11172. function once (fn) {
  11173. var f = function () {
  11174. if (f.called) return f.value
  11175. f.called = true
  11176. return f.value = fn.apply(this, arguments)
  11177. }
  11178. f.called = false
  11179. return f
  11180. }
  11181. function onceStrict (fn) {
  11182. var f = function () {
  11183. if (f.called)
  11184. throw new Error(f.onceError)
  11185. f.called = true
  11186. return f.value = fn.apply(this, arguments)
  11187. }
  11188. var name = fn.name || 'Function wrapped with `once`'
  11189. f.onceError = name + " shouldn't be called more than once"
  11190. f.called = false
  11191. return f
  11192. }
  11193. /***/ }),
  11194. /***/ 5911:
  11195. /***/ ((module, exports) => {
  11196. exports = module.exports = SemVer
  11197. var debug
  11198. /* istanbul ignore next */
  11199. if (typeof process === 'object' &&
  11200. process.env &&
  11201. process.env.NODE_DEBUG &&
  11202. /\bsemver\b/i.test(process.env.NODE_DEBUG)) {
  11203. debug = function () {
  11204. var args = Array.prototype.slice.call(arguments, 0)
  11205. args.unshift('SEMVER')
  11206. console.log.apply(console, args)
  11207. }
  11208. } else {
  11209. debug = function () {}
  11210. }
  11211. // Note: this is the semver.org version of the spec that it implements
  11212. // Not necessarily the package version of this code.
  11213. exports.SEMVER_SPEC_VERSION = '2.0.0'
  11214. var MAX_LENGTH = 256
  11215. var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER ||
  11216. /* istanbul ignore next */ 9007199254740991
  11217. // Max safe segment length for coercion.
  11218. var MAX_SAFE_COMPONENT_LENGTH = 16
  11219. var MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6
  11220. // The actual regexps go on exports.re
  11221. var re = exports.re = []
  11222. var safeRe = exports.safeRe = []
  11223. var src = exports.src = []
  11224. var t = exports.tokens = {}
  11225. var R = 0
  11226. function tok (n) {
  11227. t[n] = R++
  11228. }
  11229. var LETTERDASHNUMBER = '[a-zA-Z0-9-]'
  11230. // Replace some greedy regex tokens to prevent regex dos issues. These regex are
  11231. // used internally via the safeRe object since all inputs in this library get
  11232. // normalized first to trim and collapse all extra whitespace. The original
  11233. // regexes are exported for userland consumption and lower level usage. A
  11234. // future breaking change could export the safer regex only with a note that
  11235. // all input should have extra whitespace removed.
  11236. var safeRegexReplacements = [
  11237. ['\\s', 1],
  11238. ['\\d', MAX_LENGTH],
  11239. [LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH],
  11240. ]
  11241. function makeSafeRe (value) {
  11242. for (var i = 0; i < safeRegexReplacements.length; i++) {
  11243. var token = safeRegexReplacements[i][0]
  11244. var max = safeRegexReplacements[i][1]
  11245. value = value
  11246. .split(token + '*').join(token + '{0,' + max + '}')
  11247. .split(token + '+').join(token + '{1,' + max + '}')
  11248. }
  11249. return value
  11250. }
  11251. // The following Regular Expressions can be used for tokenizing,
  11252. // validating, and parsing SemVer version strings.
  11253. // ## Numeric Identifier
  11254. // A single `0`, or a non-zero digit followed by zero or more digits.
  11255. tok('NUMERICIDENTIFIER')
  11256. src[t.NUMERICIDENTIFIER] = '0|[1-9]\\d*'
  11257. tok('NUMERICIDENTIFIERLOOSE')
  11258. src[t.NUMERICIDENTIFIERLOOSE] = '\\d+'
  11259. // ## Non-numeric Identifier
  11260. // Zero or more digits, followed by a letter or hyphen, and then zero or
  11261. // more letters, digits, or hyphens.
  11262. tok('NONNUMERICIDENTIFIER')
  11263. src[t.NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-]' + LETTERDASHNUMBER + '*'
  11264. // ## Main Version
  11265. // Three dot-separated numeric identifiers.
  11266. tok('MAINVERSION')
  11267. src[t.MAINVERSION] = '(' + src[t.NUMERICIDENTIFIER] + ')\\.' +
  11268. '(' + src[t.NUMERICIDENTIFIER] + ')\\.' +
  11269. '(' + src[t.NUMERICIDENTIFIER] + ')'
  11270. tok('MAINVERSIONLOOSE')
  11271. src[t.MAINVERSIONLOOSE] = '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')\\.' +
  11272. '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')\\.' +
  11273. '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')'
  11274. // ## Pre-release Version Identifier
  11275. // A numeric identifier, or a non-numeric identifier.
  11276. tok('PRERELEASEIDENTIFIER')
  11277. src[t.PRERELEASEIDENTIFIER] = '(?:' + src[t.NUMERICIDENTIFIER] +
  11278. '|' + src[t.NONNUMERICIDENTIFIER] + ')'
  11279. tok('PRERELEASEIDENTIFIERLOOSE')
  11280. src[t.PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[t.NUMERICIDENTIFIERLOOSE] +
  11281. '|' + src[t.NONNUMERICIDENTIFIER] + ')'
  11282. // ## Pre-release Version
  11283. // Hyphen, followed by one or more dot-separated pre-release version
  11284. // identifiers.
  11285. tok('PRERELEASE')
  11286. src[t.PRERELEASE] = '(?:-(' + src[t.PRERELEASEIDENTIFIER] +
  11287. '(?:\\.' + src[t.PRERELEASEIDENTIFIER] + ')*))'
  11288. tok('PRERELEASELOOSE')
  11289. src[t.PRERELEASELOOSE] = '(?:-?(' + src[t.PRERELEASEIDENTIFIERLOOSE] +
  11290. '(?:\\.' + src[t.PRERELEASEIDENTIFIERLOOSE] + ')*))'
  11291. // ## Build Metadata Identifier
  11292. // Any combination of digits, letters, or hyphens.
  11293. tok('BUILDIDENTIFIER')
  11294. src[t.BUILDIDENTIFIER] = LETTERDASHNUMBER + '+'
  11295. // ## Build Metadata
  11296. // Plus sign, followed by one or more period-separated build metadata
  11297. // identifiers.
  11298. tok('BUILD')
  11299. src[t.BUILD] = '(?:\\+(' + src[t.BUILDIDENTIFIER] +
  11300. '(?:\\.' + src[t.BUILDIDENTIFIER] + ')*))'
  11301. // ## Full Version String
  11302. // A main version, followed optionally by a pre-release version and
  11303. // build metadata.
  11304. // Note that the only major, minor, patch, and pre-release sections of
  11305. // the version string are capturing groups. The build metadata is not a
  11306. // capturing group, because it should not ever be used in version
  11307. // comparison.
  11308. tok('FULL')
  11309. tok('FULLPLAIN')
  11310. src[t.FULLPLAIN] = 'v?' + src[t.MAINVERSION] +
  11311. src[t.PRERELEASE] + '?' +
  11312. src[t.BUILD] + '?'
  11313. src[t.FULL] = '^' + src[t.FULLPLAIN] + '$'
  11314. // like full, but allows v1.2.3 and =1.2.3, which people do sometimes.
  11315. // also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty
  11316. // common in the npm registry.
  11317. tok('LOOSEPLAIN')
  11318. src[t.LOOSEPLAIN] = '[v=\\s]*' + src[t.MAINVERSIONLOOSE] +
  11319. src[t.PRERELEASELOOSE] + '?' +
  11320. src[t.BUILD] + '?'
  11321. tok('LOOSE')
  11322. src[t.LOOSE] = '^' + src[t.LOOSEPLAIN] + '$'
  11323. tok('GTLT')
  11324. src[t.GTLT] = '((?:<|>)?=?)'
  11325. // Something like "2.*" or "1.2.x".
  11326. // Note that "x.x" is a valid xRange identifer, meaning "any version"
  11327. // Only the first item is strictly required.
  11328. tok('XRANGEIDENTIFIERLOOSE')
  11329. src[t.XRANGEIDENTIFIERLOOSE] = src[t.NUMERICIDENTIFIERLOOSE] + '|x|X|\\*'
  11330. tok('XRANGEIDENTIFIER')
  11331. src[t.XRANGEIDENTIFIER] = src[t.NUMERICIDENTIFIER] + '|x|X|\\*'
  11332. tok('XRANGEPLAIN')
  11333. src[t.XRANGEPLAIN] = '[v=\\s]*(' + src[t.XRANGEIDENTIFIER] + ')' +
  11334. '(?:\\.(' + src[t.XRANGEIDENTIFIER] + ')' +
  11335. '(?:\\.(' + src[t.XRANGEIDENTIFIER] + ')' +
  11336. '(?:' + src[t.PRERELEASE] + ')?' +
  11337. src[t.BUILD] + '?' +
  11338. ')?)?'
  11339. tok('XRANGEPLAINLOOSE')
  11340. src[t.XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +
  11341. '(?:\\.(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +
  11342. '(?:\\.(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +
  11343. '(?:' + src[t.PRERELEASELOOSE] + ')?' +
  11344. src[t.BUILD] + '?' +
  11345. ')?)?'
  11346. tok('XRANGE')
  11347. src[t.XRANGE] = '^' + src[t.GTLT] + '\\s*' + src[t.XRANGEPLAIN] + '$'
  11348. tok('XRANGELOOSE')
  11349. src[t.XRANGELOOSE] = '^' + src[t.GTLT] + '\\s*' + src[t.XRANGEPLAINLOOSE] + '$'
  11350. // Coercion.
  11351. // Extract anything that could conceivably be a part of a valid semver
  11352. tok('COERCE')
  11353. src[t.COERCE] = '(^|[^\\d])' +
  11354. '(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '})' +
  11355. '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
  11356. '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
  11357. '(?:$|[^\\d])'
  11358. tok('COERCERTL')
  11359. re[t.COERCERTL] = new RegExp(src[t.COERCE], 'g')
  11360. safeRe[t.COERCERTL] = new RegExp(makeSafeRe(src[t.COERCE]), 'g')
  11361. // Tilde ranges.
  11362. // Meaning is "reasonably at or greater than"
  11363. tok('LONETILDE')
  11364. src[t.LONETILDE] = '(?:~>?)'
  11365. tok('TILDETRIM')
  11366. src[t.TILDETRIM] = '(\\s*)' + src[t.LONETILDE] + '\\s+'
  11367. re[t.TILDETRIM] = new RegExp(src[t.TILDETRIM], 'g')
  11368. safeRe[t.TILDETRIM] = new RegExp(makeSafeRe(src[t.TILDETRIM]), 'g')
  11369. var tildeTrimReplace = '$1~'
  11370. tok('TILDE')
  11371. src[t.TILDE] = '^' + src[t.LONETILDE] + src[t.XRANGEPLAIN] + '$'
  11372. tok('TILDELOOSE')
  11373. src[t.TILDELOOSE] = '^' + src[t.LONETILDE] + src[t.XRANGEPLAINLOOSE] + '$'
  11374. // Caret ranges.
  11375. // Meaning is "at least and backwards compatible with"
  11376. tok('LONECARET')
  11377. src[t.LONECARET] = '(?:\\^)'
  11378. tok('CARETTRIM')
  11379. src[t.CARETTRIM] = '(\\s*)' + src[t.LONECARET] + '\\s+'
  11380. re[t.CARETTRIM] = new RegExp(src[t.CARETTRIM], 'g')
  11381. safeRe[t.CARETTRIM] = new RegExp(makeSafeRe(src[t.CARETTRIM]), 'g')
  11382. var caretTrimReplace = '$1^'
  11383. tok('CARET')
  11384. src[t.CARET] = '^' + src[t.LONECARET] + src[t.XRANGEPLAIN] + '$'
  11385. tok('CARETLOOSE')
  11386. src[t.CARETLOOSE] = '^' + src[t.LONECARET] + src[t.XRANGEPLAINLOOSE] + '$'
  11387. // A simple gt/lt/eq thing, or just "" to indicate "any version"
  11388. tok('COMPARATORLOOSE')
  11389. src[t.COMPARATORLOOSE] = '^' + src[t.GTLT] + '\\s*(' + src[t.LOOSEPLAIN] + ')$|^$'
  11390. tok('COMPARATOR')
  11391. src[t.COMPARATOR] = '^' + src[t.GTLT] + '\\s*(' + src[t.FULLPLAIN] + ')$|^$'
  11392. // An expression to strip any whitespace between the gtlt and the thing
  11393. // it modifies, so that `> 1.2.3` ==> `>1.2.3`
  11394. tok('COMPARATORTRIM')
  11395. src[t.COMPARATORTRIM] = '(\\s*)' + src[t.GTLT] +
  11396. '\\s*(' + src[t.LOOSEPLAIN] + '|' + src[t.XRANGEPLAIN] + ')'
  11397. // this one has to use the /g flag
  11398. re[t.COMPARATORTRIM] = new RegExp(src[t.COMPARATORTRIM], 'g')
  11399. safeRe[t.COMPARATORTRIM] = new RegExp(makeSafeRe(src[t.COMPARATORTRIM]), 'g')
  11400. var comparatorTrimReplace = '$1$2$3'
  11401. // Something like `1.2.3 - 1.2.4`
  11402. // Note that these all use the loose form, because they'll be
  11403. // checked against either the strict or loose comparator form
  11404. // later.
  11405. tok('HYPHENRANGE')
  11406. src[t.HYPHENRANGE] = '^\\s*(' + src[t.XRANGEPLAIN] + ')' +
  11407. '\\s+-\\s+' +
  11408. '(' + src[t.XRANGEPLAIN] + ')' +
  11409. '\\s*$'
  11410. tok('HYPHENRANGELOOSE')
  11411. src[t.HYPHENRANGELOOSE] = '^\\s*(' + src[t.XRANGEPLAINLOOSE] + ')' +
  11412. '\\s+-\\s+' +
  11413. '(' + src[t.XRANGEPLAINLOOSE] + ')' +
  11414. '\\s*$'
  11415. // Star ranges basically just allow anything at all.
  11416. tok('STAR')
  11417. src[t.STAR] = '(<|>)?=?\\s*\\*'
  11418. // Compile to actual regexp objects.
  11419. // All are flag-free, unless they were created above with a flag.
  11420. for (var i = 0; i < R; i++) {
  11421. debug(i, src[i])
  11422. if (!re[i]) {
  11423. re[i] = new RegExp(src[i])
  11424. // Replace all greedy whitespace to prevent regex dos issues. These regex are
  11425. // used internally via the safeRe object since all inputs in this library get
  11426. // normalized first to trim and collapse all extra whitespace. The original
  11427. // regexes are exported for userland consumption and lower level usage. A
  11428. // future breaking change could export the safer regex only with a note that
  11429. // all input should have extra whitespace removed.
  11430. safeRe[i] = new RegExp(makeSafeRe(src[i]))
  11431. }
  11432. }
  11433. exports.parse = parse
  11434. function parse (version, options) {
  11435. if (!options || typeof options !== 'object') {
  11436. options = {
  11437. loose: !!options,
  11438. includePrerelease: false
  11439. }
  11440. }
  11441. if (version instanceof SemVer) {
  11442. return version
  11443. }
  11444. if (typeof version !== 'string') {
  11445. return null
  11446. }
  11447. if (version.length > MAX_LENGTH) {
  11448. return null
  11449. }
  11450. var r = options.loose ? safeRe[t.LOOSE] : safeRe[t.FULL]
  11451. if (!r.test(version)) {
  11452. return null
  11453. }
  11454. try {
  11455. return new SemVer(version, options)
  11456. } catch (er) {
  11457. return null
  11458. }
  11459. }
  11460. exports.valid = valid
  11461. function valid (version, options) {
  11462. var v = parse(version, options)
  11463. return v ? v.version : null
  11464. }
  11465. exports.clean = clean
  11466. function clean (version, options) {
  11467. var s = parse(version.trim().replace(/^[=v]+/, ''), options)
  11468. return s ? s.version : null
  11469. }
  11470. exports.SemVer = SemVer
  11471. function SemVer (version, options) {
  11472. if (!options || typeof options !== 'object') {
  11473. options = {
  11474. loose: !!options,
  11475. includePrerelease: false
  11476. }
  11477. }
  11478. if (version instanceof SemVer) {
  11479. if (version.loose === options.loose) {
  11480. return version
  11481. } else {
  11482. version = version.version
  11483. }
  11484. } else if (typeof version !== 'string') {
  11485. throw new TypeError('Invalid Version: ' + version)
  11486. }
  11487. if (version.length > MAX_LENGTH) {
  11488. throw new TypeError('version is longer than ' + MAX_LENGTH + ' characters')
  11489. }
  11490. if (!(this instanceof SemVer)) {
  11491. return new SemVer(version, options)
  11492. }
  11493. debug('SemVer', version, options)
  11494. this.options = options
  11495. this.loose = !!options.loose
  11496. var m = version.trim().match(options.loose ? safeRe[t.LOOSE] : safeRe[t.FULL])
  11497. if (!m) {
  11498. throw new TypeError('Invalid Version: ' + version)
  11499. }
  11500. this.raw = version
  11501. // these are actually numbers
  11502. this.major = +m[1]
  11503. this.minor = +m[2]
  11504. this.patch = +m[3]
  11505. if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
  11506. throw new TypeError('Invalid major version')
  11507. }
  11508. if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
  11509. throw new TypeError('Invalid minor version')
  11510. }
  11511. if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
  11512. throw new TypeError('Invalid patch version')
  11513. }
  11514. // numberify any prerelease numeric ids
  11515. if (!m[4]) {
  11516. this.prerelease = []
  11517. } else {
  11518. this.prerelease = m[4].split('.').map(function (id) {
  11519. if (/^[0-9]+$/.test(id)) {
  11520. var num = +id
  11521. if (num >= 0 && num < MAX_SAFE_INTEGER) {
  11522. return num
  11523. }
  11524. }
  11525. return id
  11526. })
  11527. }
  11528. this.build = m[5] ? m[5].split('.') : []
  11529. this.format()
  11530. }
  11531. SemVer.prototype.format = function () {
  11532. this.version = this.major + '.' + this.minor + '.' + this.patch
  11533. if (this.prerelease.length) {
  11534. this.version += '-' + this.prerelease.join('.')
  11535. }
  11536. return this.version
  11537. }
  11538. SemVer.prototype.toString = function () {
  11539. return this.version
  11540. }
  11541. SemVer.prototype.compare = function (other) {
  11542. debug('SemVer.compare', this.version, this.options, other)
  11543. if (!(other instanceof SemVer)) {
  11544. other = new SemVer(other, this.options)
  11545. }
  11546. return this.compareMain(other) || this.comparePre(other)
  11547. }
  11548. SemVer.prototype.compareMain = function (other) {
  11549. if (!(other instanceof SemVer)) {
  11550. other = new SemVer(other, this.options)
  11551. }
  11552. return compareIdentifiers(this.major, other.major) ||
  11553. compareIdentifiers(this.minor, other.minor) ||
  11554. compareIdentifiers(this.patch, other.patch)
  11555. }
  11556. SemVer.prototype.comparePre = function (other) {
  11557. if (!(other instanceof SemVer)) {
  11558. other = new SemVer(other, this.options)
  11559. }
  11560. // NOT having a prerelease is > having one
  11561. if (this.prerelease.length && !other.prerelease.length) {
  11562. return -1
  11563. } else if (!this.prerelease.length && other.prerelease.length) {
  11564. return 1
  11565. } else if (!this.prerelease.length && !other.prerelease.length) {
  11566. return 0
  11567. }
  11568. var i = 0
  11569. do {
  11570. var a = this.prerelease[i]
  11571. var b = other.prerelease[i]
  11572. debug('prerelease compare', i, a, b)
  11573. if (a === undefined && b === undefined) {
  11574. return 0
  11575. } else if (b === undefined) {
  11576. return 1
  11577. } else if (a === undefined) {
  11578. return -1
  11579. } else if (a === b) {
  11580. continue
  11581. } else {
  11582. return compareIdentifiers(a, b)
  11583. }
  11584. } while (++i)
  11585. }
  11586. SemVer.prototype.compareBuild = function (other) {
  11587. if (!(other instanceof SemVer)) {
  11588. other = new SemVer(other, this.options)
  11589. }
  11590. var i = 0
  11591. do {
  11592. var a = this.build[i]
  11593. var b = other.build[i]
  11594. debug('prerelease compare', i, a, b)
  11595. if (a === undefined && b === undefined) {
  11596. return 0
  11597. } else if (b === undefined) {
  11598. return 1
  11599. } else if (a === undefined) {
  11600. return -1
  11601. } else if (a === b) {
  11602. continue
  11603. } else {
  11604. return compareIdentifiers(a, b)
  11605. }
  11606. } while (++i)
  11607. }
  11608. // preminor will bump the version up to the next minor release, and immediately
  11609. // down to pre-release. premajor and prepatch work the same way.
  11610. SemVer.prototype.inc = function (release, identifier) {
  11611. switch (release) {
  11612. case 'premajor':
  11613. this.prerelease.length = 0
  11614. this.patch = 0
  11615. this.minor = 0
  11616. this.major++
  11617. this.inc('pre', identifier)
  11618. break
  11619. case 'preminor':
  11620. this.prerelease.length = 0
  11621. this.patch = 0
  11622. this.minor++
  11623. this.inc('pre', identifier)
  11624. break
  11625. case 'prepatch':
  11626. // If this is already a prerelease, it will bump to the next version
  11627. // drop any prereleases that might already exist, since they are not
  11628. // relevant at this point.
  11629. this.prerelease.length = 0
  11630. this.inc('patch', identifier)
  11631. this.inc('pre', identifier)
  11632. break
  11633. // If the input is a non-prerelease version, this acts the same as
  11634. // prepatch.
  11635. case 'prerelease':
  11636. if (this.prerelease.length === 0) {
  11637. this.inc('patch', identifier)
  11638. }
  11639. this.inc('pre', identifier)
  11640. break
  11641. case 'major':
  11642. // If this is a pre-major version, bump up to the same major version.
  11643. // Otherwise increment major.
  11644. // 1.0.0-5 bumps to 1.0.0
  11645. // 1.1.0 bumps to 2.0.0
  11646. if (this.minor !== 0 ||
  11647. this.patch !== 0 ||
  11648. this.prerelease.length === 0) {
  11649. this.major++
  11650. }
  11651. this.minor = 0
  11652. this.patch = 0
  11653. this.prerelease = []
  11654. break
  11655. case 'minor':
  11656. // If this is a pre-minor version, bump up to the same minor version.
  11657. // Otherwise increment minor.
  11658. // 1.2.0-5 bumps to 1.2.0
  11659. // 1.2.1 bumps to 1.3.0
  11660. if (this.patch !== 0 || this.prerelease.length === 0) {
  11661. this.minor++
  11662. }
  11663. this.patch = 0
  11664. this.prerelease = []
  11665. break
  11666. case 'patch':
  11667. // If this is not a pre-release version, it will increment the patch.
  11668. // If it is a pre-release it will bump up to the same patch version.
  11669. // 1.2.0-5 patches to 1.2.0
  11670. // 1.2.0 patches to 1.2.1
  11671. if (this.prerelease.length === 0) {
  11672. this.patch++
  11673. }
  11674. this.prerelease = []
  11675. break
  11676. // This probably shouldn't be used publicly.
  11677. // 1.0.0 "pre" would become 1.0.0-0 which is the wrong direction.
  11678. case 'pre':
  11679. if (this.prerelease.length === 0) {
  11680. this.prerelease = [0]
  11681. } else {
  11682. var i = this.prerelease.length
  11683. while (--i >= 0) {
  11684. if (typeof this.prerelease[i] === 'number') {
  11685. this.prerelease[i]++
  11686. i = -2
  11687. }
  11688. }
  11689. if (i === -1) {
  11690. // didn't increment anything
  11691. this.prerelease.push(0)
  11692. }
  11693. }
  11694. if (identifier) {
  11695. // 1.2.0-beta.1 bumps to 1.2.0-beta.2,
  11696. // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0
  11697. if (this.prerelease[0] === identifier) {
  11698. if (isNaN(this.prerelease[1])) {
  11699. this.prerelease = [identifier, 0]
  11700. }
  11701. } else {
  11702. this.prerelease = [identifier, 0]
  11703. }
  11704. }
  11705. break
  11706. default:
  11707. throw new Error('invalid increment argument: ' + release)
  11708. }
  11709. this.format()
  11710. this.raw = this.version
  11711. return this
  11712. }
  11713. exports.inc = inc
  11714. function inc (version, release, loose, identifier) {
  11715. if (typeof (loose) === 'string') {
  11716. identifier = loose
  11717. loose = undefined
  11718. }
  11719. try {
  11720. return new SemVer(version, loose).inc(release, identifier).version
  11721. } catch (er) {
  11722. return null
  11723. }
  11724. }
  11725. exports.diff = diff
  11726. function diff (version1, version2) {
  11727. if (eq(version1, version2)) {
  11728. return null
  11729. } else {
  11730. var v1 = parse(version1)
  11731. var v2 = parse(version2)
  11732. var prefix = ''
  11733. if (v1.prerelease.length || v2.prerelease.length) {
  11734. prefix = 'pre'
  11735. var defaultResult = 'prerelease'
  11736. }
  11737. for (var key in v1) {
  11738. if (key === 'major' || key === 'minor' || key === 'patch') {
  11739. if (v1[key] !== v2[key]) {
  11740. return prefix + key
  11741. }
  11742. }
  11743. }
  11744. return defaultResult // may be undefined
  11745. }
  11746. }
  11747. exports.compareIdentifiers = compareIdentifiers
  11748. var numeric = /^[0-9]+$/
  11749. function compareIdentifiers (a, b) {
  11750. var anum = numeric.test(a)
  11751. var bnum = numeric.test(b)
  11752. if (anum && bnum) {
  11753. a = +a
  11754. b = +b
  11755. }
  11756. return a === b ? 0
  11757. : (anum && !bnum) ? -1
  11758. : (bnum && !anum) ? 1
  11759. : a < b ? -1
  11760. : 1
  11761. }
  11762. exports.rcompareIdentifiers = rcompareIdentifiers
  11763. function rcompareIdentifiers (a, b) {
  11764. return compareIdentifiers(b, a)
  11765. }
  11766. exports.major = major
  11767. function major (a, loose) {
  11768. return new SemVer(a, loose).major
  11769. }
  11770. exports.minor = minor
  11771. function minor (a, loose) {
  11772. return new SemVer(a, loose).minor
  11773. }
  11774. exports.patch = patch
  11775. function patch (a, loose) {
  11776. return new SemVer(a, loose).patch
  11777. }
  11778. exports.compare = compare
  11779. function compare (a, b, loose) {
  11780. return new SemVer(a, loose).compare(new SemVer(b, loose))
  11781. }
  11782. exports.compareLoose = compareLoose
  11783. function compareLoose (a, b) {
  11784. return compare(a, b, true)
  11785. }
  11786. exports.compareBuild = compareBuild
  11787. function compareBuild (a, b, loose) {
  11788. var versionA = new SemVer(a, loose)
  11789. var versionB = new SemVer(b, loose)
  11790. return versionA.compare(versionB) || versionA.compareBuild(versionB)
  11791. }
  11792. exports.rcompare = rcompare
  11793. function rcompare (a, b, loose) {
  11794. return compare(b, a, loose)
  11795. }
  11796. exports.sort = sort
  11797. function sort (list, loose) {
  11798. return list.sort(function (a, b) {
  11799. return exports.compareBuild(a, b, loose)
  11800. })
  11801. }
  11802. exports.rsort = rsort
  11803. function rsort (list, loose) {
  11804. return list.sort(function (a, b) {
  11805. return exports.compareBuild(b, a, loose)
  11806. })
  11807. }
  11808. exports.gt = gt
  11809. function gt (a, b, loose) {
  11810. return compare(a, b, loose) > 0
  11811. }
  11812. exports.lt = lt
  11813. function lt (a, b, loose) {
  11814. return compare(a, b, loose) < 0
  11815. }
  11816. exports.eq = eq
  11817. function eq (a, b, loose) {
  11818. return compare(a, b, loose) === 0
  11819. }
  11820. exports.neq = neq
  11821. function neq (a, b, loose) {
  11822. return compare(a, b, loose) !== 0
  11823. }
  11824. exports.gte = gte
  11825. function gte (a, b, loose) {
  11826. return compare(a, b, loose) >= 0
  11827. }
  11828. exports.lte = lte
  11829. function lte (a, b, loose) {
  11830. return compare(a, b, loose) <= 0
  11831. }
  11832. exports.cmp = cmp
  11833. function cmp (a, op, b, loose) {
  11834. switch (op) {
  11835. case '===':
  11836. if (typeof a === 'object')
  11837. a = a.version
  11838. if (typeof b === 'object')
  11839. b = b.version
  11840. return a === b
  11841. case '!==':
  11842. if (typeof a === 'object')
  11843. a = a.version
  11844. if (typeof b === 'object')
  11845. b = b.version
  11846. return a !== b
  11847. case '':
  11848. case '=':
  11849. case '==':
  11850. return eq(a, b, loose)
  11851. case '!=':
  11852. return neq(a, b, loose)
  11853. case '>':
  11854. return gt(a, b, loose)
  11855. case '>=':
  11856. return gte(a, b, loose)
  11857. case '<':
  11858. return lt(a, b, loose)
  11859. case '<=':
  11860. return lte(a, b, loose)
  11861. default:
  11862. throw new TypeError('Invalid operator: ' + op)
  11863. }
  11864. }
  11865. exports.Comparator = Comparator
  11866. function Comparator (comp, options) {
  11867. if (!options || typeof options !== 'object') {
  11868. options = {
  11869. loose: !!options,
  11870. includePrerelease: false
  11871. }
  11872. }
  11873. if (comp instanceof Comparator) {
  11874. if (comp.loose === !!options.loose) {
  11875. return comp
  11876. } else {
  11877. comp = comp.value
  11878. }
  11879. }
  11880. if (!(this instanceof Comparator)) {
  11881. return new Comparator(comp, options)
  11882. }
  11883. comp = comp.trim().split(/\s+/).join(' ')
  11884. debug('comparator', comp, options)
  11885. this.options = options
  11886. this.loose = !!options.loose
  11887. this.parse(comp)
  11888. if (this.semver === ANY) {
  11889. this.value = ''
  11890. } else {
  11891. this.value = this.operator + this.semver.version
  11892. }
  11893. debug('comp', this)
  11894. }
  11895. var ANY = {}
  11896. Comparator.prototype.parse = function (comp) {
  11897. var r = this.options.loose ? safeRe[t.COMPARATORLOOSE] : safeRe[t.COMPARATOR]
  11898. var m = comp.match(r)
  11899. if (!m) {
  11900. throw new TypeError('Invalid comparator: ' + comp)
  11901. }
  11902. this.operator = m[1] !== undefined ? m[1] : ''
  11903. if (this.operator === '=') {
  11904. this.operator = ''
  11905. }
  11906. // if it literally is just '>' or '' then allow anything.
  11907. if (!m[2]) {
  11908. this.semver = ANY
  11909. } else {
  11910. this.semver = new SemVer(m[2], this.options.loose)
  11911. }
  11912. }
  11913. Comparator.prototype.toString = function () {
  11914. return this.value
  11915. }
  11916. Comparator.prototype.test = function (version) {
  11917. debug('Comparator.test', version, this.options.loose)
  11918. if (this.semver === ANY || version === ANY) {
  11919. return true
  11920. }
  11921. if (typeof version === 'string') {
  11922. try {
  11923. version = new SemVer(version, this.options)
  11924. } catch (er) {
  11925. return false
  11926. }
  11927. }
  11928. return cmp(version, this.operator, this.semver, this.options)
  11929. }
  11930. Comparator.prototype.intersects = function (comp, options) {
  11931. if (!(comp instanceof Comparator)) {
  11932. throw new TypeError('a Comparator is required')
  11933. }
  11934. if (!options || typeof options !== 'object') {
  11935. options = {
  11936. loose: !!options,
  11937. includePrerelease: false
  11938. }
  11939. }
  11940. var rangeTmp
  11941. if (this.operator === '') {
  11942. if (this.value === '') {
  11943. return true
  11944. }
  11945. rangeTmp = new Range(comp.value, options)
  11946. return satisfies(this.value, rangeTmp, options)
  11947. } else if (comp.operator === '') {
  11948. if (comp.value === '') {
  11949. return true
  11950. }
  11951. rangeTmp = new Range(this.value, options)
  11952. return satisfies(comp.semver, rangeTmp, options)
  11953. }
  11954. var sameDirectionIncreasing =
  11955. (this.operator === '>=' || this.operator === '>') &&
  11956. (comp.operator === '>=' || comp.operator === '>')
  11957. var sameDirectionDecreasing =
  11958. (this.operator === '<=' || this.operator === '<') &&
  11959. (comp.operator === '<=' || comp.operator === '<')
  11960. var sameSemVer = this.semver.version === comp.semver.version
  11961. var differentDirectionsInclusive =
  11962. (this.operator === '>=' || this.operator === '<=') &&
  11963. (comp.operator === '>=' || comp.operator === '<=')
  11964. var oppositeDirectionsLessThan =
  11965. cmp(this.semver, '<', comp.semver, options) &&
  11966. ((this.operator === '>=' || this.operator === '>') &&
  11967. (comp.operator === '<=' || comp.operator === '<'))
  11968. var oppositeDirectionsGreaterThan =
  11969. cmp(this.semver, '>', comp.semver, options) &&
  11970. ((this.operator === '<=' || this.operator === '<') &&
  11971. (comp.operator === '>=' || comp.operator === '>'))
  11972. return sameDirectionIncreasing || sameDirectionDecreasing ||
  11973. (sameSemVer && differentDirectionsInclusive) ||
  11974. oppositeDirectionsLessThan || oppositeDirectionsGreaterThan
  11975. }
  11976. exports.Range = Range
  11977. function Range (range, options) {
  11978. if (!options || typeof options !== 'object') {
  11979. options = {
  11980. loose: !!options,
  11981. includePrerelease: false
  11982. }
  11983. }
  11984. if (range instanceof Range) {
  11985. if (range.loose === !!options.loose &&
  11986. range.includePrerelease === !!options.includePrerelease) {
  11987. return range
  11988. } else {
  11989. return new Range(range.raw, options)
  11990. }
  11991. }
  11992. if (range instanceof Comparator) {
  11993. return new Range(range.value, options)
  11994. }
  11995. if (!(this instanceof Range)) {
  11996. return new Range(range, options)
  11997. }
  11998. this.options = options
  11999. this.loose = !!options.loose
  12000. this.includePrerelease = !!options.includePrerelease
  12001. // First reduce all whitespace as much as possible so we do not have to rely
  12002. // on potentially slow regexes like \s*. This is then stored and used for
  12003. // future error messages as well.
  12004. this.raw = range
  12005. .trim()
  12006. .split(/\s+/)
  12007. .join(' ')
  12008. // First, split based on boolean or ||
  12009. this.set = this.raw.split('||').map(function (range) {
  12010. return this.parseRange(range.trim())
  12011. }, this).filter(function (c) {
  12012. // throw out any that are not relevant for whatever reason
  12013. return c.length
  12014. })
  12015. if (!this.set.length) {
  12016. throw new TypeError('Invalid SemVer Range: ' + this.raw)
  12017. }
  12018. this.format()
  12019. }
  12020. Range.prototype.format = function () {
  12021. this.range = this.set.map(function (comps) {
  12022. return comps.join(' ').trim()
  12023. }).join('||').trim()
  12024. return this.range
  12025. }
  12026. Range.prototype.toString = function () {
  12027. return this.range
  12028. }
  12029. Range.prototype.parseRange = function (range) {
  12030. var loose = this.options.loose
  12031. // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`
  12032. var hr = loose ? safeRe[t.HYPHENRANGELOOSE] : safeRe[t.HYPHENRANGE]
  12033. range = range.replace(hr, hyphenReplace)
  12034. debug('hyphen replace', range)
  12035. // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`
  12036. range = range.replace(safeRe[t.COMPARATORTRIM], comparatorTrimReplace)
  12037. debug('comparator trim', range, safeRe[t.COMPARATORTRIM])
  12038. // `~ 1.2.3` => `~1.2.3`
  12039. range = range.replace(safeRe[t.TILDETRIM], tildeTrimReplace)
  12040. // `^ 1.2.3` => `^1.2.3`
  12041. range = range.replace(safeRe[t.CARETTRIM], caretTrimReplace)
  12042. // normalize spaces
  12043. range = range.split(/\s+/).join(' ')
  12044. // At this point, the range is completely trimmed and
  12045. // ready to be split into comparators.
  12046. var compRe = loose ? safeRe[t.COMPARATORLOOSE] : safeRe[t.COMPARATOR]
  12047. var set = range.split(' ').map(function (comp) {
  12048. return parseComparator(comp, this.options)
  12049. }, this).join(' ').split(/\s+/)
  12050. if (this.options.loose) {
  12051. // in loose mode, throw out any that are not valid comparators
  12052. set = set.filter(function (comp) {
  12053. return !!comp.match(compRe)
  12054. })
  12055. }
  12056. set = set.map(function (comp) {
  12057. return new Comparator(comp, this.options)
  12058. }, this)
  12059. return set
  12060. }
  12061. Range.prototype.intersects = function (range, options) {
  12062. if (!(range instanceof Range)) {
  12063. throw new TypeError('a Range is required')
  12064. }
  12065. return this.set.some(function (thisComparators) {
  12066. return (
  12067. isSatisfiable(thisComparators, options) &&
  12068. range.set.some(function (rangeComparators) {
  12069. return (
  12070. isSatisfiable(rangeComparators, options) &&
  12071. thisComparators.every(function (thisComparator) {
  12072. return rangeComparators.every(function (rangeComparator) {
  12073. return thisComparator.intersects(rangeComparator, options)
  12074. })
  12075. })
  12076. )
  12077. })
  12078. )
  12079. })
  12080. }
  12081. // take a set of comparators and determine whether there
  12082. // exists a version which can satisfy it
  12083. function isSatisfiable (comparators, options) {
  12084. var result = true
  12085. var remainingComparators = comparators.slice()
  12086. var testComparator = remainingComparators.pop()
  12087. while (result && remainingComparators.length) {
  12088. result = remainingComparators.every(function (otherComparator) {
  12089. return testComparator.intersects(otherComparator, options)
  12090. })
  12091. testComparator = remainingComparators.pop()
  12092. }
  12093. return result
  12094. }
  12095. // Mostly just for testing and legacy API reasons
  12096. exports.toComparators = toComparators
  12097. function toComparators (range, options) {
  12098. return new Range(range, options).set.map(function (comp) {
  12099. return comp.map(function (c) {
  12100. return c.value
  12101. }).join(' ').trim().split(' ')
  12102. })
  12103. }
  12104. // comprised of xranges, tildes, stars, and gtlt's at this point.
  12105. // already replaced the hyphen ranges
  12106. // turn into a set of JUST comparators.
  12107. function parseComparator (comp, options) {
  12108. debug('comp', comp, options)
  12109. comp = replaceCarets(comp, options)
  12110. debug('caret', comp)
  12111. comp = replaceTildes(comp, options)
  12112. debug('tildes', comp)
  12113. comp = replaceXRanges(comp, options)
  12114. debug('xrange', comp)
  12115. comp = replaceStars(comp, options)
  12116. debug('stars', comp)
  12117. return comp
  12118. }
  12119. function isX (id) {
  12120. return !id || id.toLowerCase() === 'x' || id === '*'
  12121. }
  12122. // ~, ~> --> * (any, kinda silly)
  12123. // ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0
  12124. // ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0
  12125. // ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0
  12126. // ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0
  12127. // ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0
  12128. function replaceTildes (comp, options) {
  12129. return comp.trim().split(/\s+/).map(function (comp) {
  12130. return replaceTilde(comp, options)
  12131. }).join(' ')
  12132. }
  12133. function replaceTilde (comp, options) {
  12134. var r = options.loose ? safeRe[t.TILDELOOSE] : safeRe[t.TILDE]
  12135. return comp.replace(r, function (_, M, m, p, pr) {
  12136. debug('tilde', comp, _, M, m, p, pr)
  12137. var ret
  12138. if (isX(M)) {
  12139. ret = ''
  12140. } else if (isX(m)) {
  12141. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  12142. } else if (isX(p)) {
  12143. // ~1.2 == >=1.2.0 <1.3.0
  12144. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  12145. } else if (pr) {
  12146. debug('replaceTilde pr', pr)
  12147. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  12148. ' <' + M + '.' + (+m + 1) + '.0'
  12149. } else {
  12150. // ~1.2.3 == >=1.2.3 <1.3.0
  12151. ret = '>=' + M + '.' + m + '.' + p +
  12152. ' <' + M + '.' + (+m + 1) + '.0'
  12153. }
  12154. debug('tilde return', ret)
  12155. return ret
  12156. })
  12157. }
  12158. // ^ --> * (any, kinda silly)
  12159. // ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0
  12160. // ^2.0, ^2.0.x --> >=2.0.0 <3.0.0
  12161. // ^1.2, ^1.2.x --> >=1.2.0 <2.0.0
  12162. // ^1.2.3 --> >=1.2.3 <2.0.0
  12163. // ^1.2.0 --> >=1.2.0 <2.0.0
  12164. function replaceCarets (comp, options) {
  12165. return comp.trim().split(/\s+/).map(function (comp) {
  12166. return replaceCaret(comp, options)
  12167. }).join(' ')
  12168. }
  12169. function replaceCaret (comp, options) {
  12170. debug('caret', comp, options)
  12171. var r = options.loose ? safeRe[t.CARETLOOSE] : safeRe[t.CARET]
  12172. return comp.replace(r, function (_, M, m, p, pr) {
  12173. debug('caret', comp, _, M, m, p, pr)
  12174. var ret
  12175. if (isX(M)) {
  12176. ret = ''
  12177. } else if (isX(m)) {
  12178. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  12179. } else if (isX(p)) {
  12180. if (M === '0') {
  12181. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  12182. } else {
  12183. ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0'
  12184. }
  12185. } else if (pr) {
  12186. debug('replaceCaret pr', pr)
  12187. if (M === '0') {
  12188. if (m === '0') {
  12189. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  12190. ' <' + M + '.' + m + '.' + (+p + 1)
  12191. } else {
  12192. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  12193. ' <' + M + '.' + (+m + 1) + '.0'
  12194. }
  12195. } else {
  12196. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  12197. ' <' + (+M + 1) + '.0.0'
  12198. }
  12199. } else {
  12200. debug('no pr')
  12201. if (M === '0') {
  12202. if (m === '0') {
  12203. ret = '>=' + M + '.' + m + '.' + p +
  12204. ' <' + M + '.' + m + '.' + (+p + 1)
  12205. } else {
  12206. ret = '>=' + M + '.' + m + '.' + p +
  12207. ' <' + M + '.' + (+m + 1) + '.0'
  12208. }
  12209. } else {
  12210. ret = '>=' + M + '.' + m + '.' + p +
  12211. ' <' + (+M + 1) + '.0.0'
  12212. }
  12213. }
  12214. debug('caret return', ret)
  12215. return ret
  12216. })
  12217. }
  12218. function replaceXRanges (comp, options) {
  12219. debug('replaceXRanges', comp, options)
  12220. return comp.split(/\s+/).map(function (comp) {
  12221. return replaceXRange(comp, options)
  12222. }).join(' ')
  12223. }
  12224. function replaceXRange (comp, options) {
  12225. comp = comp.trim()
  12226. var r = options.loose ? safeRe[t.XRANGELOOSE] : safeRe[t.XRANGE]
  12227. return comp.replace(r, function (ret, gtlt, M, m, p, pr) {
  12228. debug('xRange', comp, ret, gtlt, M, m, p, pr)
  12229. var xM = isX(M)
  12230. var xm = xM || isX(m)
  12231. var xp = xm || isX(p)
  12232. var anyX = xp
  12233. if (gtlt === '=' && anyX) {
  12234. gtlt = ''
  12235. }
  12236. // if we're including prereleases in the match, then we need
  12237. // to fix this to -0, the lowest possible prerelease value
  12238. pr = options.includePrerelease ? '-0' : ''
  12239. if (xM) {
  12240. if (gtlt === '>' || gtlt === '<') {
  12241. // nothing is allowed
  12242. ret = '<0.0.0-0'
  12243. } else {
  12244. // nothing is forbidden
  12245. ret = '*'
  12246. }
  12247. } else if (gtlt && anyX) {
  12248. // we know patch is an x, because we have any x at all.
  12249. // replace X with 0
  12250. if (xm) {
  12251. m = 0
  12252. }
  12253. p = 0
  12254. if (gtlt === '>') {
  12255. // >1 => >=2.0.0
  12256. // >1.2 => >=1.3.0
  12257. // >1.2.3 => >= 1.2.4
  12258. gtlt = '>='
  12259. if (xm) {
  12260. M = +M + 1
  12261. m = 0
  12262. p = 0
  12263. } else {
  12264. m = +m + 1
  12265. p = 0
  12266. }
  12267. } else if (gtlt === '<=') {
  12268. // <=0.7.x is actually <0.8.0, since any 0.7.x should
  12269. // pass. Similarly, <=7.x is actually <8.0.0, etc.
  12270. gtlt = '<'
  12271. if (xm) {
  12272. M = +M + 1
  12273. } else {
  12274. m = +m + 1
  12275. }
  12276. }
  12277. ret = gtlt + M + '.' + m + '.' + p + pr
  12278. } else if (xm) {
  12279. ret = '>=' + M + '.0.0' + pr + ' <' + (+M + 1) + '.0.0' + pr
  12280. } else if (xp) {
  12281. ret = '>=' + M + '.' + m + '.0' + pr +
  12282. ' <' + M + '.' + (+m + 1) + '.0' + pr
  12283. }
  12284. debug('xRange return', ret)
  12285. return ret
  12286. })
  12287. }
  12288. // Because * is AND-ed with everything else in the comparator,
  12289. // and '' means "any version", just remove the *s entirely.
  12290. function replaceStars (comp, options) {
  12291. debug('replaceStars', comp, options)
  12292. // Looseness is ignored here. star is always as loose as it gets!
  12293. return comp.trim().replace(safeRe[t.STAR], '')
  12294. }
  12295. // This function is passed to string.replace(re[t.HYPHENRANGE])
  12296. // M, m, patch, prerelease, build
  12297. // 1.2 - 3.4.5 => >=1.2.0 <=3.4.5
  12298. // 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do
  12299. // 1.2 - 3.4 => >=1.2.0 <3.5.0
  12300. function hyphenReplace ($0,
  12301. from, fM, fm, fp, fpr, fb,
  12302. to, tM, tm, tp, tpr, tb) {
  12303. if (isX(fM)) {
  12304. from = ''
  12305. } else if (isX(fm)) {
  12306. from = '>=' + fM + '.0.0'
  12307. } else if (isX(fp)) {
  12308. from = '>=' + fM + '.' + fm + '.0'
  12309. } else {
  12310. from = '>=' + from
  12311. }
  12312. if (isX(tM)) {
  12313. to = ''
  12314. } else if (isX(tm)) {
  12315. to = '<' + (+tM + 1) + '.0.0'
  12316. } else if (isX(tp)) {
  12317. to = '<' + tM + '.' + (+tm + 1) + '.0'
  12318. } else if (tpr) {
  12319. to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr
  12320. } else {
  12321. to = '<=' + to
  12322. }
  12323. return (from + ' ' + to).trim()
  12324. }
  12325. // if ANY of the sets match ALL of its comparators, then pass
  12326. Range.prototype.test = function (version) {
  12327. if (!version) {
  12328. return false
  12329. }
  12330. if (typeof version === 'string') {
  12331. try {
  12332. version = new SemVer(version, this.options)
  12333. } catch (er) {
  12334. return false
  12335. }
  12336. }
  12337. for (var i = 0; i < this.set.length; i++) {
  12338. if (testSet(this.set[i], version, this.options)) {
  12339. return true
  12340. }
  12341. }
  12342. return false
  12343. }
  12344. function testSet (set, version, options) {
  12345. for (var i = 0; i < set.length; i++) {
  12346. if (!set[i].test(version)) {
  12347. return false
  12348. }
  12349. }
  12350. if (version.prerelease.length && !options.includePrerelease) {
  12351. // Find the set of versions that are allowed to have prereleases
  12352. // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0
  12353. // That should allow `1.2.3-pr.2` to pass.
  12354. // However, `1.2.4-alpha.notready` should NOT be allowed,
  12355. // even though it's within the range set by the comparators.
  12356. for (i = 0; i < set.length; i++) {
  12357. debug(set[i].semver)
  12358. if (set[i].semver === ANY) {
  12359. continue
  12360. }
  12361. if (set[i].semver.prerelease.length > 0) {
  12362. var allowed = set[i].semver
  12363. if (allowed.major === version.major &&
  12364. allowed.minor === version.minor &&
  12365. allowed.patch === version.patch) {
  12366. return true
  12367. }
  12368. }
  12369. }
  12370. // Version has a -pre, but it's not one of the ones we like.
  12371. return false
  12372. }
  12373. return true
  12374. }
  12375. exports.satisfies = satisfies
  12376. function satisfies (version, range, options) {
  12377. try {
  12378. range = new Range(range, options)
  12379. } catch (er) {
  12380. return false
  12381. }
  12382. return range.test(version)
  12383. }
  12384. exports.maxSatisfying = maxSatisfying
  12385. function maxSatisfying (versions, range, options) {
  12386. var max = null
  12387. var maxSV = null
  12388. try {
  12389. var rangeObj = new Range(range, options)
  12390. } catch (er) {
  12391. return null
  12392. }
  12393. versions.forEach(function (v) {
  12394. if (rangeObj.test(v)) {
  12395. // satisfies(v, range, options)
  12396. if (!max || maxSV.compare(v) === -1) {
  12397. // compare(max, v, true)
  12398. max = v
  12399. maxSV = new SemVer(max, options)
  12400. }
  12401. }
  12402. })
  12403. return max
  12404. }
  12405. exports.minSatisfying = minSatisfying
  12406. function minSatisfying (versions, range, options) {
  12407. var min = null
  12408. var minSV = null
  12409. try {
  12410. var rangeObj = new Range(range, options)
  12411. } catch (er) {
  12412. return null
  12413. }
  12414. versions.forEach(function (v) {
  12415. if (rangeObj.test(v)) {
  12416. // satisfies(v, range, options)
  12417. if (!min || minSV.compare(v) === 1) {
  12418. // compare(min, v, true)
  12419. min = v
  12420. minSV = new SemVer(min, options)
  12421. }
  12422. }
  12423. })
  12424. return min
  12425. }
  12426. exports.minVersion = minVersion
  12427. function minVersion (range, loose) {
  12428. range = new Range(range, loose)
  12429. var minver = new SemVer('0.0.0')
  12430. if (range.test(minver)) {
  12431. return minver
  12432. }
  12433. minver = new SemVer('0.0.0-0')
  12434. if (range.test(minver)) {
  12435. return minver
  12436. }
  12437. minver = null
  12438. for (var i = 0; i < range.set.length; ++i) {
  12439. var comparators = range.set[i]
  12440. comparators.forEach(function (comparator) {
  12441. // Clone to avoid manipulating the comparator's semver object.
  12442. var compver = new SemVer(comparator.semver.version)
  12443. switch (comparator.operator) {
  12444. case '>':
  12445. if (compver.prerelease.length === 0) {
  12446. compver.patch++
  12447. } else {
  12448. compver.prerelease.push(0)
  12449. }
  12450. compver.raw = compver.format()
  12451. /* fallthrough */
  12452. case '':
  12453. case '>=':
  12454. if (!minver || gt(minver, compver)) {
  12455. minver = compver
  12456. }
  12457. break
  12458. case '<':
  12459. case '<=':
  12460. /* Ignore maximum versions */
  12461. break
  12462. /* istanbul ignore next */
  12463. default:
  12464. throw new Error('Unexpected operation: ' + comparator.operator)
  12465. }
  12466. })
  12467. }
  12468. if (minver && range.test(minver)) {
  12469. return minver
  12470. }
  12471. return null
  12472. }
  12473. exports.validRange = validRange
  12474. function validRange (range, options) {
  12475. try {
  12476. // Return '*' instead of '' so that truthiness works.
  12477. // This will throw if it's invalid anyway
  12478. return new Range(range, options).range || '*'
  12479. } catch (er) {
  12480. return null
  12481. }
  12482. }
  12483. // Determine if version is less than all the versions possible in the range
  12484. exports.ltr = ltr
  12485. function ltr (version, range, options) {
  12486. return outside(version, range, '<', options)
  12487. }
  12488. // Determine if version is greater than all the versions possible in the range.
  12489. exports.gtr = gtr
  12490. function gtr (version, range, options) {
  12491. return outside(version, range, '>', options)
  12492. }
  12493. exports.outside = outside
  12494. function outside (version, range, hilo, options) {
  12495. version = new SemVer(version, options)
  12496. range = new Range(range, options)
  12497. var gtfn, ltefn, ltfn, comp, ecomp
  12498. switch (hilo) {
  12499. case '>':
  12500. gtfn = gt
  12501. ltefn = lte
  12502. ltfn = lt
  12503. comp = '>'
  12504. ecomp = '>='
  12505. break
  12506. case '<':
  12507. gtfn = lt
  12508. ltefn = gte
  12509. ltfn = gt
  12510. comp = '<'
  12511. ecomp = '<='
  12512. break
  12513. default:
  12514. throw new TypeError('Must provide a hilo val of "<" or ">"')
  12515. }
  12516. // If it satisifes the range it is not outside
  12517. if (satisfies(version, range, options)) {
  12518. return false
  12519. }
  12520. // From now on, variable terms are as if we're in "gtr" mode.
  12521. // but note that everything is flipped for the "ltr" function.
  12522. for (var i = 0; i < range.set.length; ++i) {
  12523. var comparators = range.set[i]
  12524. var high = null
  12525. var low = null
  12526. comparators.forEach(function (comparator) {
  12527. if (comparator.semver === ANY) {
  12528. comparator = new Comparator('>=0.0.0')
  12529. }
  12530. high = high || comparator
  12531. low = low || comparator
  12532. if (gtfn(comparator.semver, high.semver, options)) {
  12533. high = comparator
  12534. } else if (ltfn(comparator.semver, low.semver, options)) {
  12535. low = comparator
  12536. }
  12537. })
  12538. // If the edge version comparator has a operator then our version
  12539. // isn't outside it
  12540. if (high.operator === comp || high.operator === ecomp) {
  12541. return false
  12542. }
  12543. // If the lowest version comparator has an operator and our version
  12544. // is less than it then it isn't higher than the range
  12545. if ((!low.operator || low.operator === comp) &&
  12546. ltefn(version, low.semver)) {
  12547. return false
  12548. } else if (low.operator === ecomp && ltfn(version, low.semver)) {
  12549. return false
  12550. }
  12551. }
  12552. return true
  12553. }
  12554. exports.prerelease = prerelease
  12555. function prerelease (version, options) {
  12556. var parsed = parse(version, options)
  12557. return (parsed && parsed.prerelease.length) ? parsed.prerelease : null
  12558. }
  12559. exports.intersects = intersects
  12560. function intersects (r1, r2, options) {
  12561. r1 = new Range(r1, options)
  12562. r2 = new Range(r2, options)
  12563. return r1.intersects(r2)
  12564. }
  12565. exports.coerce = coerce
  12566. function coerce (version, options) {
  12567. if (version instanceof SemVer) {
  12568. return version
  12569. }
  12570. if (typeof version === 'number') {
  12571. version = String(version)
  12572. }
  12573. if (typeof version !== 'string') {
  12574. return null
  12575. }
  12576. options = options || {}
  12577. var match = null
  12578. if (!options.rtl) {
  12579. match = version.match(safeRe[t.COERCE])
  12580. } else {
  12581. // Find the right-most coercible string that does not share
  12582. // a terminus with a more left-ward coercible string.
  12583. // Eg, '1.2.3.4' wants to coerce '2.3.4', not '3.4' or '4'
  12584. //
  12585. // Walk through the string checking with a /g regexp
  12586. // Manually set the index so as to pick up overlapping matches.
  12587. // Stop when we get a match that ends at the string end, since no
  12588. // coercible string can be more right-ward without the same terminus.
  12589. var next
  12590. while ((next = safeRe[t.COERCERTL].exec(version)) &&
  12591. (!match || match.index + match[0].length !== version.length)
  12592. ) {
  12593. if (!match ||
  12594. next.index + next[0].length !== match.index + match[0].length) {
  12595. match = next
  12596. }
  12597. safeRe[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length
  12598. }
  12599. // leave it in a clean state
  12600. safeRe[t.COERCERTL].lastIndex = -1
  12601. }
  12602. if (match === null) {
  12603. return null
  12604. }
  12605. return parse(match[2] +
  12606. '.' + (match[3] || '0') +
  12607. '.' + (match[4] || '0'), options)
  12608. }
  12609. /***/ }),
  12610. /***/ 4294:
  12611. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  12612. module.exports = __nccwpck_require__(4219);
  12613. /***/ }),
  12614. /***/ 4219:
  12615. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  12616. "use strict";
  12617. var net = __nccwpck_require__(1808);
  12618. var tls = __nccwpck_require__(4404);
  12619. var http = __nccwpck_require__(3685);
  12620. var https = __nccwpck_require__(5687);
  12621. var events = __nccwpck_require__(2361);
  12622. var assert = __nccwpck_require__(9491);
  12623. var util = __nccwpck_require__(3837);
  12624. exports.httpOverHttp = httpOverHttp;
  12625. exports.httpsOverHttp = httpsOverHttp;
  12626. exports.httpOverHttps = httpOverHttps;
  12627. exports.httpsOverHttps = httpsOverHttps;
  12628. function httpOverHttp(options) {
  12629. var agent = new TunnelingAgent(options);
  12630. agent.request = http.request;
  12631. return agent;
  12632. }
  12633. function httpsOverHttp(options) {
  12634. var agent = new TunnelingAgent(options);
  12635. agent.request = http.request;
  12636. agent.createSocket = createSecureSocket;
  12637. agent.defaultPort = 443;
  12638. return agent;
  12639. }
  12640. function httpOverHttps(options) {
  12641. var agent = new TunnelingAgent(options);
  12642. agent.request = https.request;
  12643. return agent;
  12644. }
  12645. function httpsOverHttps(options) {
  12646. var agent = new TunnelingAgent(options);
  12647. agent.request = https.request;
  12648. agent.createSocket = createSecureSocket;
  12649. agent.defaultPort = 443;
  12650. return agent;
  12651. }
  12652. function TunnelingAgent(options) {
  12653. var self = this;
  12654. self.options = options || {};
  12655. self.proxyOptions = self.options.proxy || {};
  12656. self.maxSockets = self.options.maxSockets || http.Agent.defaultMaxSockets;
  12657. self.requests = [];
  12658. self.sockets = [];
  12659. self.on('free', function onFree(socket, host, port, localAddress) {
  12660. var options = toOptions(host, port, localAddress);
  12661. for (var i = 0, len = self.requests.length; i < len; ++i) {
  12662. var pending = self.requests[i];
  12663. if (pending.host === options.host && pending.port === options.port) {
  12664. // Detect the request to connect same origin server,
  12665. // reuse the connection.
  12666. self.requests.splice(i, 1);
  12667. pending.request.onSocket(socket);
  12668. return;
  12669. }
  12670. }
  12671. socket.destroy();
  12672. self.removeSocket(socket);
  12673. });
  12674. }
  12675. util.inherits(TunnelingAgent, events.EventEmitter);
  12676. TunnelingAgent.prototype.addRequest = function addRequest(req, host, port, localAddress) {
  12677. var self = this;
  12678. var options = mergeOptions({request: req}, self.options, toOptions(host, port, localAddress));
  12679. if (self.sockets.length >= this.maxSockets) {
  12680. // We are over limit so we'll add it to the queue.
  12681. self.requests.push(options);
  12682. return;
  12683. }
  12684. // If we are under maxSockets create a new one.
  12685. self.createSocket(options, function(socket) {
  12686. socket.on('free', onFree);
  12687. socket.on('close', onCloseOrRemove);
  12688. socket.on('agentRemove', onCloseOrRemove);
  12689. req.onSocket(socket);
  12690. function onFree() {
  12691. self.emit('free', socket, options);
  12692. }
  12693. function onCloseOrRemove(err) {
  12694. self.removeSocket(socket);
  12695. socket.removeListener('free', onFree);
  12696. socket.removeListener('close', onCloseOrRemove);
  12697. socket.removeListener('agentRemove', onCloseOrRemove);
  12698. }
  12699. });
  12700. };
  12701. TunnelingAgent.prototype.createSocket = function createSocket(options, cb) {
  12702. var self = this;
  12703. var placeholder = {};
  12704. self.sockets.push(placeholder);
  12705. var connectOptions = mergeOptions({}, self.proxyOptions, {
  12706. method: 'CONNECT',
  12707. path: options.host + ':' + options.port,
  12708. agent: false,
  12709. headers: {
  12710. host: options.host + ':' + options.port
  12711. }
  12712. });
  12713. if (options.localAddress) {
  12714. connectOptions.localAddress = options.localAddress;
  12715. }
  12716. if (connectOptions.proxyAuth) {
  12717. connectOptions.headers = connectOptions.headers || {};
  12718. connectOptions.headers['Proxy-Authorization'] = 'Basic ' +
  12719. new Buffer(connectOptions.proxyAuth).toString('base64');
  12720. }
  12721. debug('making CONNECT request');
  12722. var connectReq = self.request(connectOptions);
  12723. connectReq.useChunkedEncodingByDefault = false; // for v0.6
  12724. connectReq.once('response', onResponse); // for v0.6
  12725. connectReq.once('upgrade', onUpgrade); // for v0.6
  12726. connectReq.once('connect', onConnect); // for v0.7 or later
  12727. connectReq.once('error', onError);
  12728. connectReq.end();
  12729. function onResponse(res) {
  12730. // Very hacky. This is necessary to avoid http-parser leaks.
  12731. res.upgrade = true;
  12732. }
  12733. function onUpgrade(res, socket, head) {
  12734. // Hacky.
  12735. process.nextTick(function() {
  12736. onConnect(res, socket, head);
  12737. });
  12738. }
  12739. function onConnect(res, socket, head) {
  12740. connectReq.removeAllListeners();
  12741. socket.removeAllListeners();
  12742. if (res.statusCode !== 200) {
  12743. debug('tunneling socket could not be established, statusCode=%d',
  12744. res.statusCode);
  12745. socket.destroy();
  12746. var error = new Error('tunneling socket could not be established, ' +
  12747. 'statusCode=' + res.statusCode);
  12748. error.code = 'ECONNRESET';
  12749. options.request.emit('error', error);
  12750. self.removeSocket(placeholder);
  12751. return;
  12752. }
  12753. if (head.length > 0) {
  12754. debug('got illegal response body from proxy');
  12755. socket.destroy();
  12756. var error = new Error('got illegal response body from proxy');
  12757. error.code = 'ECONNRESET';
  12758. options.request.emit('error', error);
  12759. self.removeSocket(placeholder);
  12760. return;
  12761. }
  12762. debug('tunneling connection has established');
  12763. self.sockets[self.sockets.indexOf(placeholder)] = socket;
  12764. return cb(socket);
  12765. }
  12766. function onError(cause) {
  12767. connectReq.removeAllListeners();
  12768. debug('tunneling socket could not be established, cause=%s\n',
  12769. cause.message, cause.stack);
  12770. var error = new Error('tunneling socket could not be established, ' +
  12771. 'cause=' + cause.message);
  12772. error.code = 'ECONNRESET';
  12773. options.request.emit('error', error);
  12774. self.removeSocket(placeholder);
  12775. }
  12776. };
  12777. TunnelingAgent.prototype.removeSocket = function removeSocket(socket) {
  12778. var pos = this.sockets.indexOf(socket)
  12779. if (pos === -1) {
  12780. return;
  12781. }
  12782. this.sockets.splice(pos, 1);
  12783. var pending = this.requests.shift();
  12784. if (pending) {
  12785. // If we have pending requests and a socket gets closed a new one
  12786. // needs to be created to take over in the pool for the one that closed.
  12787. this.createSocket(pending, function(socket) {
  12788. pending.request.onSocket(socket);
  12789. });
  12790. }
  12791. };
  12792. function createSecureSocket(options, cb) {
  12793. var self = this;
  12794. TunnelingAgent.prototype.createSocket.call(self, options, function(socket) {
  12795. var hostHeader = options.request.getHeader('host');
  12796. var tlsOptions = mergeOptions({}, self.options, {
  12797. socket: socket,
  12798. servername: hostHeader ? hostHeader.replace(/:.*$/, '') : options.host
  12799. });
  12800. // 0 is dummy port for v0.6
  12801. var secureSocket = tls.connect(0, tlsOptions);
  12802. self.sockets[self.sockets.indexOf(socket)] = secureSocket;
  12803. cb(secureSocket);
  12804. });
  12805. }
  12806. function toOptions(host, port, localAddress) {
  12807. if (typeof host === 'string') { // since v0.10
  12808. return {
  12809. host: host,
  12810. port: port,
  12811. localAddress: localAddress
  12812. };
  12813. }
  12814. return host; // for v0.11 or later
  12815. }
  12816. function mergeOptions(target) {
  12817. for (var i = 1, len = arguments.length; i < len; ++i) {
  12818. var overrides = arguments[i];
  12819. if (typeof overrides === 'object') {
  12820. var keys = Object.keys(overrides);
  12821. for (var j = 0, keyLen = keys.length; j < keyLen; ++j) {
  12822. var k = keys[j];
  12823. if (overrides[k] !== undefined) {
  12824. target[k] = overrides[k];
  12825. }
  12826. }
  12827. }
  12828. }
  12829. return target;
  12830. }
  12831. var debug;
  12832. if (process.env.NODE_DEBUG && /\btunnel\b/.test(process.env.NODE_DEBUG)) {
  12833. debug = function() {
  12834. var args = Array.prototype.slice.call(arguments);
  12835. if (typeof args[0] === 'string') {
  12836. args[0] = 'TUNNEL: ' + args[0];
  12837. } else {
  12838. args.unshift('TUNNEL:');
  12839. }
  12840. console.error.apply(console, args);
  12841. }
  12842. } else {
  12843. debug = function() {};
  12844. }
  12845. exports.debug = debug; // for test
  12846. /***/ }),
  12847. /***/ 1773:
  12848. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  12849. "use strict";
  12850. const Client = __nccwpck_require__(3598)
  12851. const Dispatcher = __nccwpck_require__(412)
  12852. const errors = __nccwpck_require__(8045)
  12853. const Pool = __nccwpck_require__(4634)
  12854. const BalancedPool = __nccwpck_require__(7931)
  12855. const Agent = __nccwpck_require__(7890)
  12856. const util = __nccwpck_require__(3983)
  12857. const { InvalidArgumentError } = errors
  12858. const api = __nccwpck_require__(4059)
  12859. const buildConnector = __nccwpck_require__(2067)
  12860. const MockClient = __nccwpck_require__(8687)
  12861. const MockAgent = __nccwpck_require__(6771)
  12862. const MockPool = __nccwpck_require__(6193)
  12863. const mockErrors = __nccwpck_require__(888)
  12864. const ProxyAgent = __nccwpck_require__(7858)
  12865. const RetryHandler = __nccwpck_require__(2286)
  12866. const { getGlobalDispatcher, setGlobalDispatcher } = __nccwpck_require__(1892)
  12867. const DecoratorHandler = __nccwpck_require__(6930)
  12868. const RedirectHandler = __nccwpck_require__(2860)
  12869. const createRedirectInterceptor = __nccwpck_require__(8861)
  12870. let hasCrypto
  12871. try {
  12872. __nccwpck_require__(6113)
  12873. hasCrypto = true
  12874. } catch {
  12875. hasCrypto = false
  12876. }
  12877. Object.assign(Dispatcher.prototype, api)
  12878. module.exports.Dispatcher = Dispatcher
  12879. module.exports.Client = Client
  12880. module.exports.Pool = Pool
  12881. module.exports.BalancedPool = BalancedPool
  12882. module.exports.Agent = Agent
  12883. module.exports.ProxyAgent = ProxyAgent
  12884. module.exports.RetryHandler = RetryHandler
  12885. module.exports.DecoratorHandler = DecoratorHandler
  12886. module.exports.RedirectHandler = RedirectHandler
  12887. module.exports.createRedirectInterceptor = createRedirectInterceptor
  12888. module.exports.buildConnector = buildConnector
  12889. module.exports.errors = errors
  12890. function makeDispatcher (fn) {
  12891. return (url, opts, handler) => {
  12892. if (typeof opts === 'function') {
  12893. handler = opts
  12894. opts = null
  12895. }
  12896. if (!url || (typeof url !== 'string' && typeof url !== 'object' && !(url instanceof URL))) {
  12897. throw new InvalidArgumentError('invalid url')
  12898. }
  12899. if (opts != null && typeof opts !== 'object') {
  12900. throw new InvalidArgumentError('invalid opts')
  12901. }
  12902. if (opts && opts.path != null) {
  12903. if (typeof opts.path !== 'string') {
  12904. throw new InvalidArgumentError('invalid opts.path')
  12905. }
  12906. let path = opts.path
  12907. if (!opts.path.startsWith('/')) {
  12908. path = `/${path}`
  12909. }
  12910. url = new URL(util.parseOrigin(url).origin + path)
  12911. } else {
  12912. if (!opts) {
  12913. opts = typeof url === 'object' ? url : {}
  12914. }
  12915. url = util.parseURL(url)
  12916. }
  12917. const { agent, dispatcher = getGlobalDispatcher() } = opts
  12918. if (agent) {
  12919. throw new InvalidArgumentError('unsupported opts.agent. Did you mean opts.client?')
  12920. }
  12921. return fn.call(dispatcher, {
  12922. ...opts,
  12923. origin: url.origin,
  12924. path: url.search ? `${url.pathname}${url.search}` : url.pathname,
  12925. method: opts.method || (opts.body ? 'PUT' : 'GET')
  12926. }, handler)
  12927. }
  12928. }
  12929. module.exports.setGlobalDispatcher = setGlobalDispatcher
  12930. module.exports.getGlobalDispatcher = getGlobalDispatcher
  12931. if (util.nodeMajor > 16 || (util.nodeMajor === 16 && util.nodeMinor >= 8)) {
  12932. let fetchImpl = null
  12933. module.exports.fetch = async function fetch (resource) {
  12934. if (!fetchImpl) {
  12935. fetchImpl = (__nccwpck_require__(4881).fetch)
  12936. }
  12937. try {
  12938. return await fetchImpl(...arguments)
  12939. } catch (err) {
  12940. if (typeof err === 'object') {
  12941. Error.captureStackTrace(err, this)
  12942. }
  12943. throw err
  12944. }
  12945. }
  12946. module.exports.Headers = __nccwpck_require__(554).Headers
  12947. module.exports.Response = __nccwpck_require__(7823).Response
  12948. module.exports.Request = __nccwpck_require__(8359).Request
  12949. module.exports.FormData = __nccwpck_require__(2015).FormData
  12950. module.exports.File = __nccwpck_require__(8511).File
  12951. module.exports.FileReader = __nccwpck_require__(1446).FileReader
  12952. const { setGlobalOrigin, getGlobalOrigin } = __nccwpck_require__(1246)
  12953. module.exports.setGlobalOrigin = setGlobalOrigin
  12954. module.exports.getGlobalOrigin = getGlobalOrigin
  12955. const { CacheStorage } = __nccwpck_require__(7907)
  12956. const { kConstruct } = __nccwpck_require__(9174)
  12957. // Cache & CacheStorage are tightly coupled with fetch. Even if it may run
  12958. // in an older version of Node, it doesn't have any use without fetch.
  12959. module.exports.caches = new CacheStorage(kConstruct)
  12960. }
  12961. if (util.nodeMajor >= 16) {
  12962. const { deleteCookie, getCookies, getSetCookies, setCookie } = __nccwpck_require__(1724)
  12963. module.exports.deleteCookie = deleteCookie
  12964. module.exports.getCookies = getCookies
  12965. module.exports.getSetCookies = getSetCookies
  12966. module.exports.setCookie = setCookie
  12967. const { parseMIMEType, serializeAMimeType } = __nccwpck_require__(685)
  12968. module.exports.parseMIMEType = parseMIMEType
  12969. module.exports.serializeAMimeType = serializeAMimeType
  12970. }
  12971. if (util.nodeMajor >= 18 && hasCrypto) {
  12972. const { WebSocket } = __nccwpck_require__(4284)
  12973. module.exports.WebSocket = WebSocket
  12974. }
  12975. module.exports.request = makeDispatcher(api.request)
  12976. module.exports.stream = makeDispatcher(api.stream)
  12977. module.exports.pipeline = makeDispatcher(api.pipeline)
  12978. module.exports.connect = makeDispatcher(api.connect)
  12979. module.exports.upgrade = makeDispatcher(api.upgrade)
  12980. module.exports.MockClient = MockClient
  12981. module.exports.MockPool = MockPool
  12982. module.exports.MockAgent = MockAgent
  12983. module.exports.mockErrors = mockErrors
  12984. /***/ }),
  12985. /***/ 7890:
  12986. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  12987. "use strict";
  12988. const { InvalidArgumentError } = __nccwpck_require__(8045)
  12989. const { kClients, kRunning, kClose, kDestroy, kDispatch, kInterceptors } = __nccwpck_require__(2785)
  12990. const DispatcherBase = __nccwpck_require__(4839)
  12991. const Pool = __nccwpck_require__(4634)
  12992. const Client = __nccwpck_require__(3598)
  12993. const util = __nccwpck_require__(3983)
  12994. const createRedirectInterceptor = __nccwpck_require__(8861)
  12995. const { WeakRef, FinalizationRegistry } = __nccwpck_require__(6436)()
  12996. const kOnConnect = Symbol('onConnect')
  12997. const kOnDisconnect = Symbol('onDisconnect')
  12998. const kOnConnectionError = Symbol('onConnectionError')
  12999. const kMaxRedirections = Symbol('maxRedirections')
  13000. const kOnDrain = Symbol('onDrain')
  13001. const kFactory = Symbol('factory')
  13002. const kFinalizer = Symbol('finalizer')
  13003. const kOptions = Symbol('options')
  13004. function defaultFactory (origin, opts) {
  13005. return opts && opts.connections === 1
  13006. ? new Client(origin, opts)
  13007. : new Pool(origin, opts)
  13008. }
  13009. class Agent extends DispatcherBase {
  13010. constructor ({ factory = defaultFactory, maxRedirections = 0, connect, ...options } = {}) {
  13011. super()
  13012. if (typeof factory !== 'function') {
  13013. throw new InvalidArgumentError('factory must be a function.')
  13014. }
  13015. if (connect != null && typeof connect !== 'function' && typeof connect !== 'object') {
  13016. throw new InvalidArgumentError('connect must be a function or an object')
  13017. }
  13018. if (!Number.isInteger(maxRedirections) || maxRedirections < 0) {
  13019. throw new InvalidArgumentError('maxRedirections must be a positive number')
  13020. }
  13021. if (connect && typeof connect !== 'function') {
  13022. connect = { ...connect }
  13023. }
  13024. this[kInterceptors] = options.interceptors && options.interceptors.Agent && Array.isArray(options.interceptors.Agent)
  13025. ? options.interceptors.Agent
  13026. : [createRedirectInterceptor({ maxRedirections })]
  13027. this[kOptions] = { ...util.deepClone(options), connect }
  13028. this[kOptions].interceptors = options.interceptors
  13029. ? { ...options.interceptors }
  13030. : undefined
  13031. this[kMaxRedirections] = maxRedirections
  13032. this[kFactory] = factory
  13033. this[kClients] = new Map()
  13034. this[kFinalizer] = new FinalizationRegistry(/* istanbul ignore next: gc is undeterministic */ key => {
  13035. const ref = this[kClients].get(key)
  13036. if (ref !== undefined && ref.deref() === undefined) {
  13037. this[kClients].delete(key)
  13038. }
  13039. })
  13040. const agent = this
  13041. this[kOnDrain] = (origin, targets) => {
  13042. agent.emit('drain', origin, [agent, ...targets])
  13043. }
  13044. this[kOnConnect] = (origin, targets) => {
  13045. agent.emit('connect', origin, [agent, ...targets])
  13046. }
  13047. this[kOnDisconnect] = (origin, targets, err) => {
  13048. agent.emit('disconnect', origin, [agent, ...targets], err)
  13049. }
  13050. this[kOnConnectionError] = (origin, targets, err) => {
  13051. agent.emit('connectionError', origin, [agent, ...targets], err)
  13052. }
  13053. }
  13054. get [kRunning] () {
  13055. let ret = 0
  13056. for (const ref of this[kClients].values()) {
  13057. const client = ref.deref()
  13058. /* istanbul ignore next: gc is undeterministic */
  13059. if (client) {
  13060. ret += client[kRunning]
  13061. }
  13062. }
  13063. return ret
  13064. }
  13065. [kDispatch] (opts, handler) {
  13066. let key
  13067. if (opts.origin && (typeof opts.origin === 'string' || opts.origin instanceof URL)) {
  13068. key = String(opts.origin)
  13069. } else {
  13070. throw new InvalidArgumentError('opts.origin must be a non-empty string or URL.')
  13071. }
  13072. const ref = this[kClients].get(key)
  13073. let dispatcher = ref ? ref.deref() : null
  13074. if (!dispatcher) {
  13075. dispatcher = this[kFactory](opts.origin, this[kOptions])
  13076. .on('drain', this[kOnDrain])
  13077. .on('connect', this[kOnConnect])
  13078. .on('disconnect', this[kOnDisconnect])
  13079. .on('connectionError', this[kOnConnectionError])
  13080. this[kClients].set(key, new WeakRef(dispatcher))
  13081. this[kFinalizer].register(dispatcher, key)
  13082. }
  13083. return dispatcher.dispatch(opts, handler)
  13084. }
  13085. async [kClose] () {
  13086. const closePromises = []
  13087. for (const ref of this[kClients].values()) {
  13088. const client = ref.deref()
  13089. /* istanbul ignore else: gc is undeterministic */
  13090. if (client) {
  13091. closePromises.push(client.close())
  13092. }
  13093. }
  13094. await Promise.all(closePromises)
  13095. }
  13096. async [kDestroy] (err) {
  13097. const destroyPromises = []
  13098. for (const ref of this[kClients].values()) {
  13099. const client = ref.deref()
  13100. /* istanbul ignore else: gc is undeterministic */
  13101. if (client) {
  13102. destroyPromises.push(client.destroy(err))
  13103. }
  13104. }
  13105. await Promise.all(destroyPromises)
  13106. }
  13107. }
  13108. module.exports = Agent
  13109. /***/ }),
  13110. /***/ 7032:
  13111. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  13112. const { addAbortListener } = __nccwpck_require__(3983)
  13113. const { RequestAbortedError } = __nccwpck_require__(8045)
  13114. const kListener = Symbol('kListener')
  13115. const kSignal = Symbol('kSignal')
  13116. function abort (self) {
  13117. if (self.abort) {
  13118. self.abort()
  13119. } else {
  13120. self.onError(new RequestAbortedError())
  13121. }
  13122. }
  13123. function addSignal (self, signal) {
  13124. self[kSignal] = null
  13125. self[kListener] = null
  13126. if (!signal) {
  13127. return
  13128. }
  13129. if (signal.aborted) {
  13130. abort(self)
  13131. return
  13132. }
  13133. self[kSignal] = signal
  13134. self[kListener] = () => {
  13135. abort(self)
  13136. }
  13137. addAbortListener(self[kSignal], self[kListener])
  13138. }
  13139. function removeSignal (self) {
  13140. if (!self[kSignal]) {
  13141. return
  13142. }
  13143. if ('removeEventListener' in self[kSignal]) {
  13144. self[kSignal].removeEventListener('abort', self[kListener])
  13145. } else {
  13146. self[kSignal].removeListener('abort', self[kListener])
  13147. }
  13148. self[kSignal] = null
  13149. self[kListener] = null
  13150. }
  13151. module.exports = {
  13152. addSignal,
  13153. removeSignal
  13154. }
  13155. /***/ }),
  13156. /***/ 9744:
  13157. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  13158. "use strict";
  13159. const { AsyncResource } = __nccwpck_require__(852)
  13160. const { InvalidArgumentError, RequestAbortedError, SocketError } = __nccwpck_require__(8045)
  13161. const util = __nccwpck_require__(3983)
  13162. const { addSignal, removeSignal } = __nccwpck_require__(7032)
  13163. class ConnectHandler extends AsyncResource {
  13164. constructor (opts, callback) {
  13165. if (!opts || typeof opts !== 'object') {
  13166. throw new InvalidArgumentError('invalid opts')
  13167. }
  13168. if (typeof callback !== 'function') {
  13169. throw new InvalidArgumentError('invalid callback')
  13170. }
  13171. const { signal, opaque, responseHeaders } = opts
  13172. if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') {
  13173. throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget')
  13174. }
  13175. super('UNDICI_CONNECT')
  13176. this.opaque = opaque || null
  13177. this.responseHeaders = responseHeaders || null
  13178. this.callback = callback
  13179. this.abort = null
  13180. addSignal(this, signal)
  13181. }
  13182. onConnect (abort, context) {
  13183. if (!this.callback) {
  13184. throw new RequestAbortedError()
  13185. }
  13186. this.abort = abort
  13187. this.context = context
  13188. }
  13189. onHeaders () {
  13190. throw new SocketError('bad connect', null)
  13191. }
  13192. onUpgrade (statusCode, rawHeaders, socket) {
  13193. const { callback, opaque, context } = this
  13194. removeSignal(this)
  13195. this.callback = null
  13196. let headers = rawHeaders
  13197. // Indicates is an HTTP2Session
  13198. if (headers != null) {
  13199. headers = this.responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)
  13200. }
  13201. this.runInAsyncScope(callback, null, null, {
  13202. statusCode,
  13203. headers,
  13204. socket,
  13205. opaque,
  13206. context
  13207. })
  13208. }
  13209. onError (err) {
  13210. const { callback, opaque } = this
  13211. removeSignal(this)
  13212. if (callback) {
  13213. this.callback = null
  13214. queueMicrotask(() => {
  13215. this.runInAsyncScope(callback, null, err, { opaque })
  13216. })
  13217. }
  13218. }
  13219. }
  13220. function connect (opts, callback) {
  13221. if (callback === undefined) {
  13222. return new Promise((resolve, reject) => {
  13223. connect.call(this, opts, (err, data) => {
  13224. return err ? reject(err) : resolve(data)
  13225. })
  13226. })
  13227. }
  13228. try {
  13229. const connectHandler = new ConnectHandler(opts, callback)
  13230. this.dispatch({ ...opts, method: 'CONNECT' }, connectHandler)
  13231. } catch (err) {
  13232. if (typeof callback !== 'function') {
  13233. throw err
  13234. }
  13235. const opaque = opts && opts.opaque
  13236. queueMicrotask(() => callback(err, { opaque }))
  13237. }
  13238. }
  13239. module.exports = connect
  13240. /***/ }),
  13241. /***/ 8752:
  13242. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  13243. "use strict";
  13244. const {
  13245. Readable,
  13246. Duplex,
  13247. PassThrough
  13248. } = __nccwpck_require__(2781)
  13249. const {
  13250. InvalidArgumentError,
  13251. InvalidReturnValueError,
  13252. RequestAbortedError
  13253. } = __nccwpck_require__(8045)
  13254. const util = __nccwpck_require__(3983)
  13255. const { AsyncResource } = __nccwpck_require__(852)
  13256. const { addSignal, removeSignal } = __nccwpck_require__(7032)
  13257. const assert = __nccwpck_require__(9491)
  13258. const kResume = Symbol('resume')
  13259. class PipelineRequest extends Readable {
  13260. constructor () {
  13261. super({ autoDestroy: true })
  13262. this[kResume] = null
  13263. }
  13264. _read () {
  13265. const { [kResume]: resume } = this
  13266. if (resume) {
  13267. this[kResume] = null
  13268. resume()
  13269. }
  13270. }
  13271. _destroy (err, callback) {
  13272. this._read()
  13273. callback(err)
  13274. }
  13275. }
  13276. class PipelineResponse extends Readable {
  13277. constructor (resume) {
  13278. super({ autoDestroy: true })
  13279. this[kResume] = resume
  13280. }
  13281. _read () {
  13282. this[kResume]()
  13283. }
  13284. _destroy (err, callback) {
  13285. if (!err && !this._readableState.endEmitted) {
  13286. err = new RequestAbortedError()
  13287. }
  13288. callback(err)
  13289. }
  13290. }
  13291. class PipelineHandler extends AsyncResource {
  13292. constructor (opts, handler) {
  13293. if (!opts || typeof opts !== 'object') {
  13294. throw new InvalidArgumentError('invalid opts')
  13295. }
  13296. if (typeof handler !== 'function') {
  13297. throw new InvalidArgumentError('invalid handler')
  13298. }
  13299. const { signal, method, opaque, onInfo, responseHeaders } = opts
  13300. if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') {
  13301. throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget')
  13302. }
  13303. if (method === 'CONNECT') {
  13304. throw new InvalidArgumentError('invalid method')
  13305. }
  13306. if (onInfo && typeof onInfo !== 'function') {
  13307. throw new InvalidArgumentError('invalid onInfo callback')
  13308. }
  13309. super('UNDICI_PIPELINE')
  13310. this.opaque = opaque || null
  13311. this.responseHeaders = responseHeaders || null
  13312. this.handler = handler
  13313. this.abort = null
  13314. this.context = null
  13315. this.onInfo = onInfo || null
  13316. this.req = new PipelineRequest().on('error', util.nop)
  13317. this.ret = new Duplex({
  13318. readableObjectMode: opts.objectMode,
  13319. autoDestroy: true,
  13320. read: () => {
  13321. const { body } = this
  13322. if (body && body.resume) {
  13323. body.resume()
  13324. }
  13325. },
  13326. write: (chunk, encoding, callback) => {
  13327. const { req } = this
  13328. if (req.push(chunk, encoding) || req._readableState.destroyed) {
  13329. callback()
  13330. } else {
  13331. req[kResume] = callback
  13332. }
  13333. },
  13334. destroy: (err, callback) => {
  13335. const { body, req, res, ret, abort } = this
  13336. if (!err && !ret._readableState.endEmitted) {
  13337. err = new RequestAbortedError()
  13338. }
  13339. if (abort && err) {
  13340. abort()
  13341. }
  13342. util.destroy(body, err)
  13343. util.destroy(req, err)
  13344. util.destroy(res, err)
  13345. removeSignal(this)
  13346. callback(err)
  13347. }
  13348. }).on('prefinish', () => {
  13349. const { req } = this
  13350. // Node < 15 does not call _final in same tick.
  13351. req.push(null)
  13352. })
  13353. this.res = null
  13354. addSignal(this, signal)
  13355. }
  13356. onConnect (abort, context) {
  13357. const { ret, res } = this
  13358. assert(!res, 'pipeline cannot be retried')
  13359. if (ret.destroyed) {
  13360. throw new RequestAbortedError()
  13361. }
  13362. this.abort = abort
  13363. this.context = context
  13364. }
  13365. onHeaders (statusCode, rawHeaders, resume) {
  13366. const { opaque, handler, context } = this
  13367. if (statusCode < 200) {
  13368. if (this.onInfo) {
  13369. const headers = this.responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)
  13370. this.onInfo({ statusCode, headers })
  13371. }
  13372. return
  13373. }
  13374. this.res = new PipelineResponse(resume)
  13375. let body
  13376. try {
  13377. this.handler = null
  13378. const headers = this.responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)
  13379. body = this.runInAsyncScope(handler, null, {
  13380. statusCode,
  13381. headers,
  13382. opaque,
  13383. body: this.res,
  13384. context
  13385. })
  13386. } catch (err) {
  13387. this.res.on('error', util.nop)
  13388. throw err
  13389. }
  13390. if (!body || typeof body.on !== 'function') {
  13391. throw new InvalidReturnValueError('expected Readable')
  13392. }
  13393. body
  13394. .on('data', (chunk) => {
  13395. const { ret, body } = this
  13396. if (!ret.push(chunk) && body.pause) {
  13397. body.pause()
  13398. }
  13399. })
  13400. .on('error', (err) => {
  13401. const { ret } = this
  13402. util.destroy(ret, err)
  13403. })
  13404. .on('end', () => {
  13405. const { ret } = this
  13406. ret.push(null)
  13407. })
  13408. .on('close', () => {
  13409. const { ret } = this
  13410. if (!ret._readableState.ended) {
  13411. util.destroy(ret, new RequestAbortedError())
  13412. }
  13413. })
  13414. this.body = body
  13415. }
  13416. onData (chunk) {
  13417. const { res } = this
  13418. return res.push(chunk)
  13419. }
  13420. onComplete (trailers) {
  13421. const { res } = this
  13422. res.push(null)
  13423. }
  13424. onError (err) {
  13425. const { ret } = this
  13426. this.handler = null
  13427. util.destroy(ret, err)
  13428. }
  13429. }
  13430. function pipeline (opts, handler) {
  13431. try {
  13432. const pipelineHandler = new PipelineHandler(opts, handler)
  13433. this.dispatch({ ...opts, body: pipelineHandler.req }, pipelineHandler)
  13434. return pipelineHandler.ret
  13435. } catch (err) {
  13436. return new PassThrough().destroy(err)
  13437. }
  13438. }
  13439. module.exports = pipeline
  13440. /***/ }),
  13441. /***/ 5448:
  13442. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  13443. "use strict";
  13444. const Readable = __nccwpck_require__(3858)
  13445. const {
  13446. InvalidArgumentError,
  13447. RequestAbortedError
  13448. } = __nccwpck_require__(8045)
  13449. const util = __nccwpck_require__(3983)
  13450. const { getResolveErrorBodyCallback } = __nccwpck_require__(7474)
  13451. const { AsyncResource } = __nccwpck_require__(852)
  13452. const { addSignal, removeSignal } = __nccwpck_require__(7032)
  13453. class RequestHandler extends AsyncResource {
  13454. constructor (opts, callback) {
  13455. if (!opts || typeof opts !== 'object') {
  13456. throw new InvalidArgumentError('invalid opts')
  13457. }
  13458. const { signal, method, opaque, body, onInfo, responseHeaders, throwOnError, highWaterMark } = opts
  13459. try {
  13460. if (typeof callback !== 'function') {
  13461. throw new InvalidArgumentError('invalid callback')
  13462. }
  13463. if (highWaterMark && (typeof highWaterMark !== 'number' || highWaterMark < 0)) {
  13464. throw new InvalidArgumentError('invalid highWaterMark')
  13465. }
  13466. if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') {
  13467. throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget')
  13468. }
  13469. if (method === 'CONNECT') {
  13470. throw new InvalidArgumentError('invalid method')
  13471. }
  13472. if (onInfo && typeof onInfo !== 'function') {
  13473. throw new InvalidArgumentError('invalid onInfo callback')
  13474. }
  13475. super('UNDICI_REQUEST')
  13476. } catch (err) {
  13477. if (util.isStream(body)) {
  13478. util.destroy(body.on('error', util.nop), err)
  13479. }
  13480. throw err
  13481. }
  13482. this.responseHeaders = responseHeaders || null
  13483. this.opaque = opaque || null
  13484. this.callback = callback
  13485. this.res = null
  13486. this.abort = null
  13487. this.body = body
  13488. this.trailers = {}
  13489. this.context = null
  13490. this.onInfo = onInfo || null
  13491. this.throwOnError = throwOnError
  13492. this.highWaterMark = highWaterMark
  13493. if (util.isStream(body)) {
  13494. body.on('error', (err) => {
  13495. this.onError(err)
  13496. })
  13497. }
  13498. addSignal(this, signal)
  13499. }
  13500. onConnect (abort, context) {
  13501. if (!this.callback) {
  13502. throw new RequestAbortedError()
  13503. }
  13504. this.abort = abort
  13505. this.context = context
  13506. }
  13507. onHeaders (statusCode, rawHeaders, resume, statusMessage) {
  13508. const { callback, opaque, abort, context, responseHeaders, highWaterMark } = this
  13509. const headers = responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)
  13510. if (statusCode < 200) {
  13511. if (this.onInfo) {
  13512. this.onInfo({ statusCode, headers })
  13513. }
  13514. return
  13515. }
  13516. const parsedHeaders = responseHeaders === 'raw' ? util.parseHeaders(rawHeaders) : headers
  13517. const contentType = parsedHeaders['content-type']
  13518. const body = new Readable({ resume, abort, contentType, highWaterMark })
  13519. this.callback = null
  13520. this.res = body
  13521. if (callback !== null) {
  13522. if (this.throwOnError && statusCode >= 400) {
  13523. this.runInAsyncScope(getResolveErrorBodyCallback, null,
  13524. { callback, body, contentType, statusCode, statusMessage, headers }
  13525. )
  13526. } else {
  13527. this.runInAsyncScope(callback, null, null, {
  13528. statusCode,
  13529. headers,
  13530. trailers: this.trailers,
  13531. opaque,
  13532. body,
  13533. context
  13534. })
  13535. }
  13536. }
  13537. }
  13538. onData (chunk) {
  13539. const { res } = this
  13540. return res.push(chunk)
  13541. }
  13542. onComplete (trailers) {
  13543. const { res } = this
  13544. removeSignal(this)
  13545. util.parseHeaders(trailers, this.trailers)
  13546. res.push(null)
  13547. }
  13548. onError (err) {
  13549. const { res, callback, body, opaque } = this
  13550. removeSignal(this)
  13551. if (callback) {
  13552. // TODO: Does this need queueMicrotask?
  13553. this.callback = null
  13554. queueMicrotask(() => {
  13555. this.runInAsyncScope(callback, null, err, { opaque })
  13556. })
  13557. }
  13558. if (res) {
  13559. this.res = null
  13560. // Ensure all queued handlers are invoked before destroying res.
  13561. queueMicrotask(() => {
  13562. util.destroy(res, err)
  13563. })
  13564. }
  13565. if (body) {
  13566. this.body = null
  13567. util.destroy(body, err)
  13568. }
  13569. }
  13570. }
  13571. function request (opts, callback) {
  13572. if (callback === undefined) {
  13573. return new Promise((resolve, reject) => {
  13574. request.call(this, opts, (err, data) => {
  13575. return err ? reject(err) : resolve(data)
  13576. })
  13577. })
  13578. }
  13579. try {
  13580. this.dispatch(opts, new RequestHandler(opts, callback))
  13581. } catch (err) {
  13582. if (typeof callback !== 'function') {
  13583. throw err
  13584. }
  13585. const opaque = opts && opts.opaque
  13586. queueMicrotask(() => callback(err, { opaque }))
  13587. }
  13588. }
  13589. module.exports = request
  13590. module.exports.RequestHandler = RequestHandler
  13591. /***/ }),
  13592. /***/ 5395:
  13593. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  13594. "use strict";
  13595. const { finished, PassThrough } = __nccwpck_require__(2781)
  13596. const {
  13597. InvalidArgumentError,
  13598. InvalidReturnValueError,
  13599. RequestAbortedError
  13600. } = __nccwpck_require__(8045)
  13601. const util = __nccwpck_require__(3983)
  13602. const { getResolveErrorBodyCallback } = __nccwpck_require__(7474)
  13603. const { AsyncResource } = __nccwpck_require__(852)
  13604. const { addSignal, removeSignal } = __nccwpck_require__(7032)
  13605. class StreamHandler extends AsyncResource {
  13606. constructor (opts, factory, callback) {
  13607. if (!opts || typeof opts !== 'object') {
  13608. throw new InvalidArgumentError('invalid opts')
  13609. }
  13610. const { signal, method, opaque, body, onInfo, responseHeaders, throwOnError } = opts
  13611. try {
  13612. if (typeof callback !== 'function') {
  13613. throw new InvalidArgumentError('invalid callback')
  13614. }
  13615. if (typeof factory !== 'function') {
  13616. throw new InvalidArgumentError('invalid factory')
  13617. }
  13618. if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') {
  13619. throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget')
  13620. }
  13621. if (method === 'CONNECT') {
  13622. throw new InvalidArgumentError('invalid method')
  13623. }
  13624. if (onInfo && typeof onInfo !== 'function') {
  13625. throw new InvalidArgumentError('invalid onInfo callback')
  13626. }
  13627. super('UNDICI_STREAM')
  13628. } catch (err) {
  13629. if (util.isStream(body)) {
  13630. util.destroy(body.on('error', util.nop), err)
  13631. }
  13632. throw err
  13633. }
  13634. this.responseHeaders = responseHeaders || null
  13635. this.opaque = opaque || null
  13636. this.factory = factory
  13637. this.callback = callback
  13638. this.res = null
  13639. this.abort = null
  13640. this.context = null
  13641. this.trailers = null
  13642. this.body = body
  13643. this.onInfo = onInfo || null
  13644. this.throwOnError = throwOnError || false
  13645. if (util.isStream(body)) {
  13646. body.on('error', (err) => {
  13647. this.onError(err)
  13648. })
  13649. }
  13650. addSignal(this, signal)
  13651. }
  13652. onConnect (abort, context) {
  13653. if (!this.callback) {
  13654. throw new RequestAbortedError()
  13655. }
  13656. this.abort = abort
  13657. this.context = context
  13658. }
  13659. onHeaders (statusCode, rawHeaders, resume, statusMessage) {
  13660. const { factory, opaque, context, callback, responseHeaders } = this
  13661. const headers = responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)
  13662. if (statusCode < 200) {
  13663. if (this.onInfo) {
  13664. this.onInfo({ statusCode, headers })
  13665. }
  13666. return
  13667. }
  13668. this.factory = null
  13669. let res
  13670. if (this.throwOnError && statusCode >= 400) {
  13671. const parsedHeaders = responseHeaders === 'raw' ? util.parseHeaders(rawHeaders) : headers
  13672. const contentType = parsedHeaders['content-type']
  13673. res = new PassThrough()
  13674. this.callback = null
  13675. this.runInAsyncScope(getResolveErrorBodyCallback, null,
  13676. { callback, body: res, contentType, statusCode, statusMessage, headers }
  13677. )
  13678. } else {
  13679. if (factory === null) {
  13680. return
  13681. }
  13682. res = this.runInAsyncScope(factory, null, {
  13683. statusCode,
  13684. headers,
  13685. opaque,
  13686. context
  13687. })
  13688. if (
  13689. !res ||
  13690. typeof res.write !== 'function' ||
  13691. typeof res.end !== 'function' ||
  13692. typeof res.on !== 'function'
  13693. ) {
  13694. throw new InvalidReturnValueError('expected Writable')
  13695. }
  13696. // TODO: Avoid finished. It registers an unnecessary amount of listeners.
  13697. finished(res, { readable: false }, (err) => {
  13698. const { callback, res, opaque, trailers, abort } = this
  13699. this.res = null
  13700. if (err || !res.readable) {
  13701. util.destroy(res, err)
  13702. }
  13703. this.callback = null
  13704. this.runInAsyncScope(callback, null, err || null, { opaque, trailers })
  13705. if (err) {
  13706. abort()
  13707. }
  13708. })
  13709. }
  13710. res.on('drain', resume)
  13711. this.res = res
  13712. const needDrain = res.writableNeedDrain !== undefined
  13713. ? res.writableNeedDrain
  13714. : res._writableState && res._writableState.needDrain
  13715. return needDrain !== true
  13716. }
  13717. onData (chunk) {
  13718. const { res } = this
  13719. return res ? res.write(chunk) : true
  13720. }
  13721. onComplete (trailers) {
  13722. const { res } = this
  13723. removeSignal(this)
  13724. if (!res) {
  13725. return
  13726. }
  13727. this.trailers = util.parseHeaders(trailers)
  13728. res.end()
  13729. }
  13730. onError (err) {
  13731. const { res, callback, opaque, body } = this
  13732. removeSignal(this)
  13733. this.factory = null
  13734. if (res) {
  13735. this.res = null
  13736. util.destroy(res, err)
  13737. } else if (callback) {
  13738. this.callback = null
  13739. queueMicrotask(() => {
  13740. this.runInAsyncScope(callback, null, err, { opaque })
  13741. })
  13742. }
  13743. if (body) {
  13744. this.body = null
  13745. util.destroy(body, err)
  13746. }
  13747. }
  13748. }
  13749. function stream (opts, factory, callback) {
  13750. if (callback === undefined) {
  13751. return new Promise((resolve, reject) => {
  13752. stream.call(this, opts, factory, (err, data) => {
  13753. return err ? reject(err) : resolve(data)
  13754. })
  13755. })
  13756. }
  13757. try {
  13758. this.dispatch(opts, new StreamHandler(opts, factory, callback))
  13759. } catch (err) {
  13760. if (typeof callback !== 'function') {
  13761. throw err
  13762. }
  13763. const opaque = opts && opts.opaque
  13764. queueMicrotask(() => callback(err, { opaque }))
  13765. }
  13766. }
  13767. module.exports = stream
  13768. /***/ }),
  13769. /***/ 6923:
  13770. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  13771. "use strict";
  13772. const { InvalidArgumentError, RequestAbortedError, SocketError } = __nccwpck_require__(8045)
  13773. const { AsyncResource } = __nccwpck_require__(852)
  13774. const util = __nccwpck_require__(3983)
  13775. const { addSignal, removeSignal } = __nccwpck_require__(7032)
  13776. const assert = __nccwpck_require__(9491)
  13777. class UpgradeHandler extends AsyncResource {
  13778. constructor (opts, callback) {
  13779. if (!opts || typeof opts !== 'object') {
  13780. throw new InvalidArgumentError('invalid opts')
  13781. }
  13782. if (typeof callback !== 'function') {
  13783. throw new InvalidArgumentError('invalid callback')
  13784. }
  13785. const { signal, opaque, responseHeaders } = opts
  13786. if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') {
  13787. throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget')
  13788. }
  13789. super('UNDICI_UPGRADE')
  13790. this.responseHeaders = responseHeaders || null
  13791. this.opaque = opaque || null
  13792. this.callback = callback
  13793. this.abort = null
  13794. this.context = null
  13795. addSignal(this, signal)
  13796. }
  13797. onConnect (abort, context) {
  13798. if (!this.callback) {
  13799. throw new RequestAbortedError()
  13800. }
  13801. this.abort = abort
  13802. this.context = null
  13803. }
  13804. onHeaders () {
  13805. throw new SocketError('bad upgrade', null)
  13806. }
  13807. onUpgrade (statusCode, rawHeaders, socket) {
  13808. const { callback, opaque, context } = this
  13809. assert.strictEqual(statusCode, 101)
  13810. removeSignal(this)
  13811. this.callback = null
  13812. const headers = this.responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)
  13813. this.runInAsyncScope(callback, null, null, {
  13814. headers,
  13815. socket,
  13816. opaque,
  13817. context
  13818. })
  13819. }
  13820. onError (err) {
  13821. const { callback, opaque } = this
  13822. removeSignal(this)
  13823. if (callback) {
  13824. this.callback = null
  13825. queueMicrotask(() => {
  13826. this.runInAsyncScope(callback, null, err, { opaque })
  13827. })
  13828. }
  13829. }
  13830. }
  13831. function upgrade (opts, callback) {
  13832. if (callback === undefined) {
  13833. return new Promise((resolve, reject) => {
  13834. upgrade.call(this, opts, (err, data) => {
  13835. return err ? reject(err) : resolve(data)
  13836. })
  13837. })
  13838. }
  13839. try {
  13840. const upgradeHandler = new UpgradeHandler(opts, callback)
  13841. this.dispatch({
  13842. ...opts,
  13843. method: opts.method || 'GET',
  13844. upgrade: opts.protocol || 'Websocket'
  13845. }, upgradeHandler)
  13846. } catch (err) {
  13847. if (typeof callback !== 'function') {
  13848. throw err
  13849. }
  13850. const opaque = opts && opts.opaque
  13851. queueMicrotask(() => callback(err, { opaque }))
  13852. }
  13853. }
  13854. module.exports = upgrade
  13855. /***/ }),
  13856. /***/ 4059:
  13857. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  13858. "use strict";
  13859. module.exports.request = __nccwpck_require__(5448)
  13860. module.exports.stream = __nccwpck_require__(5395)
  13861. module.exports.pipeline = __nccwpck_require__(8752)
  13862. module.exports.upgrade = __nccwpck_require__(6923)
  13863. module.exports.connect = __nccwpck_require__(9744)
  13864. /***/ }),
  13865. /***/ 3858:
  13866. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  13867. "use strict";
  13868. // Ported from https://github.com/nodejs/undici/pull/907
  13869. const assert = __nccwpck_require__(9491)
  13870. const { Readable } = __nccwpck_require__(2781)
  13871. const { RequestAbortedError, NotSupportedError, InvalidArgumentError } = __nccwpck_require__(8045)
  13872. const util = __nccwpck_require__(3983)
  13873. const { ReadableStreamFrom, toUSVString } = __nccwpck_require__(3983)
  13874. let Blob
  13875. const kConsume = Symbol('kConsume')
  13876. const kReading = Symbol('kReading')
  13877. const kBody = Symbol('kBody')
  13878. const kAbort = Symbol('abort')
  13879. const kContentType = Symbol('kContentType')
  13880. const noop = () => {}
  13881. module.exports = class BodyReadable extends Readable {
  13882. constructor ({
  13883. resume,
  13884. abort,
  13885. contentType = '',
  13886. highWaterMark = 64 * 1024 // Same as nodejs fs streams.
  13887. }) {
  13888. super({
  13889. autoDestroy: true,
  13890. read: resume,
  13891. highWaterMark
  13892. })
  13893. this._readableState.dataEmitted = false
  13894. this[kAbort] = abort
  13895. this[kConsume] = null
  13896. this[kBody] = null
  13897. this[kContentType] = contentType
  13898. // Is stream being consumed through Readable API?
  13899. // This is an optimization so that we avoid checking
  13900. // for 'data' and 'readable' listeners in the hot path
  13901. // inside push().
  13902. this[kReading] = false
  13903. }
  13904. destroy (err) {
  13905. if (this.destroyed) {
  13906. // Node < 16
  13907. return this
  13908. }
  13909. if (!err && !this._readableState.endEmitted) {
  13910. err = new RequestAbortedError()
  13911. }
  13912. if (err) {
  13913. this[kAbort]()
  13914. }
  13915. return super.destroy(err)
  13916. }
  13917. emit (ev, ...args) {
  13918. if (ev === 'data') {
  13919. // Node < 16.7
  13920. this._readableState.dataEmitted = true
  13921. } else if (ev === 'error') {
  13922. // Node < 16
  13923. this._readableState.errorEmitted = true
  13924. }
  13925. return super.emit(ev, ...args)
  13926. }
  13927. on (ev, ...args) {
  13928. if (ev === 'data' || ev === 'readable') {
  13929. this[kReading] = true
  13930. }
  13931. return super.on(ev, ...args)
  13932. }
  13933. addListener (ev, ...args) {
  13934. return this.on(ev, ...args)
  13935. }
  13936. off (ev, ...args) {
  13937. const ret = super.off(ev, ...args)
  13938. if (ev === 'data' || ev === 'readable') {
  13939. this[kReading] = (
  13940. this.listenerCount('data') > 0 ||
  13941. this.listenerCount('readable') > 0
  13942. )
  13943. }
  13944. return ret
  13945. }
  13946. removeListener (ev, ...args) {
  13947. return this.off(ev, ...args)
  13948. }
  13949. push (chunk) {
  13950. if (this[kConsume] && chunk !== null && this.readableLength === 0) {
  13951. consumePush(this[kConsume], chunk)
  13952. return this[kReading] ? super.push(chunk) : true
  13953. }
  13954. return super.push(chunk)
  13955. }
  13956. // https://fetch.spec.whatwg.org/#dom-body-text
  13957. async text () {
  13958. return consume(this, 'text')
  13959. }
  13960. // https://fetch.spec.whatwg.org/#dom-body-json
  13961. async json () {
  13962. return consume(this, 'json')
  13963. }
  13964. // https://fetch.spec.whatwg.org/#dom-body-blob
  13965. async blob () {
  13966. return consume(this, 'blob')
  13967. }
  13968. // https://fetch.spec.whatwg.org/#dom-body-arraybuffer
  13969. async arrayBuffer () {
  13970. return consume(this, 'arrayBuffer')
  13971. }
  13972. // https://fetch.spec.whatwg.org/#dom-body-formdata
  13973. async formData () {
  13974. // TODO: Implement.
  13975. throw new NotSupportedError()
  13976. }
  13977. // https://fetch.spec.whatwg.org/#dom-body-bodyused
  13978. get bodyUsed () {
  13979. return util.isDisturbed(this)
  13980. }
  13981. // https://fetch.spec.whatwg.org/#dom-body-body
  13982. get body () {
  13983. if (!this[kBody]) {
  13984. this[kBody] = ReadableStreamFrom(this)
  13985. if (this[kConsume]) {
  13986. // TODO: Is this the best way to force a lock?
  13987. this[kBody].getReader() // Ensure stream is locked.
  13988. assert(this[kBody].locked)
  13989. }
  13990. }
  13991. return this[kBody]
  13992. }
  13993. dump (opts) {
  13994. let limit = opts && Number.isFinite(opts.limit) ? opts.limit : 262144
  13995. const signal = opts && opts.signal
  13996. if (signal) {
  13997. try {
  13998. if (typeof signal !== 'object' || !('aborted' in signal)) {
  13999. throw new InvalidArgumentError('signal must be an AbortSignal')
  14000. }
  14001. util.throwIfAborted(signal)
  14002. } catch (err) {
  14003. return Promise.reject(err)
  14004. }
  14005. }
  14006. if (this.closed) {
  14007. return Promise.resolve(null)
  14008. }
  14009. return new Promise((resolve, reject) => {
  14010. const signalListenerCleanup = signal
  14011. ? util.addAbortListener(signal, () => {
  14012. this.destroy()
  14013. })
  14014. : noop
  14015. this
  14016. .on('close', function () {
  14017. signalListenerCleanup()
  14018. if (signal && signal.aborted) {
  14019. reject(signal.reason || Object.assign(new Error('The operation was aborted'), { name: 'AbortError' }))
  14020. } else {
  14021. resolve(null)
  14022. }
  14023. })
  14024. .on('error', noop)
  14025. .on('data', function (chunk) {
  14026. limit -= chunk.length
  14027. if (limit <= 0) {
  14028. this.destroy()
  14029. }
  14030. })
  14031. .resume()
  14032. })
  14033. }
  14034. }
  14035. // https://streams.spec.whatwg.org/#readablestream-locked
  14036. function isLocked (self) {
  14037. // Consume is an implicit lock.
  14038. return (self[kBody] && self[kBody].locked === true) || self[kConsume]
  14039. }
  14040. // https://fetch.spec.whatwg.org/#body-unusable
  14041. function isUnusable (self) {
  14042. return util.isDisturbed(self) || isLocked(self)
  14043. }
  14044. async function consume (stream, type) {
  14045. if (isUnusable(stream)) {
  14046. throw new TypeError('unusable')
  14047. }
  14048. assert(!stream[kConsume])
  14049. return new Promise((resolve, reject) => {
  14050. stream[kConsume] = {
  14051. type,
  14052. stream,
  14053. resolve,
  14054. reject,
  14055. length: 0,
  14056. body: []
  14057. }
  14058. stream
  14059. .on('error', function (err) {
  14060. consumeFinish(this[kConsume], err)
  14061. })
  14062. .on('close', function () {
  14063. if (this[kConsume].body !== null) {
  14064. consumeFinish(this[kConsume], new RequestAbortedError())
  14065. }
  14066. })
  14067. process.nextTick(consumeStart, stream[kConsume])
  14068. })
  14069. }
  14070. function consumeStart (consume) {
  14071. if (consume.body === null) {
  14072. return
  14073. }
  14074. const { _readableState: state } = consume.stream
  14075. for (const chunk of state.buffer) {
  14076. consumePush(consume, chunk)
  14077. }
  14078. if (state.endEmitted) {
  14079. consumeEnd(this[kConsume])
  14080. } else {
  14081. consume.stream.on('end', function () {
  14082. consumeEnd(this[kConsume])
  14083. })
  14084. }
  14085. consume.stream.resume()
  14086. while (consume.stream.read() != null) {
  14087. // Loop
  14088. }
  14089. }
  14090. function consumeEnd (consume) {
  14091. const { type, body, resolve, stream, length } = consume
  14092. try {
  14093. if (type === 'text') {
  14094. resolve(toUSVString(Buffer.concat(body)))
  14095. } else if (type === 'json') {
  14096. resolve(JSON.parse(Buffer.concat(body)))
  14097. } else if (type === 'arrayBuffer') {
  14098. const dst = new Uint8Array(length)
  14099. let pos = 0
  14100. for (const buf of body) {
  14101. dst.set(buf, pos)
  14102. pos += buf.byteLength
  14103. }
  14104. resolve(dst.buffer)
  14105. } else if (type === 'blob') {
  14106. if (!Blob) {
  14107. Blob = (__nccwpck_require__(4300).Blob)
  14108. }
  14109. resolve(new Blob(body, { type: stream[kContentType] }))
  14110. }
  14111. consumeFinish(consume)
  14112. } catch (err) {
  14113. stream.destroy(err)
  14114. }
  14115. }
  14116. function consumePush (consume, chunk) {
  14117. consume.length += chunk.length
  14118. consume.body.push(chunk)
  14119. }
  14120. function consumeFinish (consume, err) {
  14121. if (consume.body === null) {
  14122. return
  14123. }
  14124. if (err) {
  14125. consume.reject(err)
  14126. } else {
  14127. consume.resolve()
  14128. }
  14129. consume.type = null
  14130. consume.stream = null
  14131. consume.resolve = null
  14132. consume.reject = null
  14133. consume.length = 0
  14134. consume.body = null
  14135. }
  14136. /***/ }),
  14137. /***/ 7474:
  14138. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  14139. const assert = __nccwpck_require__(9491)
  14140. const {
  14141. ResponseStatusCodeError
  14142. } = __nccwpck_require__(8045)
  14143. const { toUSVString } = __nccwpck_require__(3983)
  14144. async function getResolveErrorBodyCallback ({ callback, body, contentType, statusCode, statusMessage, headers }) {
  14145. assert(body)
  14146. let chunks = []
  14147. let limit = 0
  14148. for await (const chunk of body) {
  14149. chunks.push(chunk)
  14150. limit += chunk.length
  14151. if (limit > 128 * 1024) {
  14152. chunks = null
  14153. break
  14154. }
  14155. }
  14156. if (statusCode === 204 || !contentType || !chunks) {
  14157. process.nextTick(callback, new ResponseStatusCodeError(`Response status code ${statusCode}${statusMessage ? `: ${statusMessage}` : ''}`, statusCode, headers))
  14158. return
  14159. }
  14160. try {
  14161. if (contentType.startsWith('application/json')) {
  14162. const payload = JSON.parse(toUSVString(Buffer.concat(chunks)))
  14163. process.nextTick(callback, new ResponseStatusCodeError(`Response status code ${statusCode}${statusMessage ? `: ${statusMessage}` : ''}`, statusCode, headers, payload))
  14164. return
  14165. }
  14166. if (contentType.startsWith('text/')) {
  14167. const payload = toUSVString(Buffer.concat(chunks))
  14168. process.nextTick(callback, new ResponseStatusCodeError(`Response status code ${statusCode}${statusMessage ? `: ${statusMessage}` : ''}`, statusCode, headers, payload))
  14169. return
  14170. }
  14171. } catch (err) {
  14172. // Process in a fallback if error
  14173. }
  14174. process.nextTick(callback, new ResponseStatusCodeError(`Response status code ${statusCode}${statusMessage ? `: ${statusMessage}` : ''}`, statusCode, headers))
  14175. }
  14176. module.exports = { getResolveErrorBodyCallback }
  14177. /***/ }),
  14178. /***/ 7931:
  14179. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  14180. "use strict";
  14181. const {
  14182. BalancedPoolMissingUpstreamError,
  14183. InvalidArgumentError
  14184. } = __nccwpck_require__(8045)
  14185. const {
  14186. PoolBase,
  14187. kClients,
  14188. kNeedDrain,
  14189. kAddClient,
  14190. kRemoveClient,
  14191. kGetDispatcher
  14192. } = __nccwpck_require__(3198)
  14193. const Pool = __nccwpck_require__(4634)
  14194. const { kUrl, kInterceptors } = __nccwpck_require__(2785)
  14195. const { parseOrigin } = __nccwpck_require__(3983)
  14196. const kFactory = Symbol('factory')
  14197. const kOptions = Symbol('options')
  14198. const kGreatestCommonDivisor = Symbol('kGreatestCommonDivisor')
  14199. const kCurrentWeight = Symbol('kCurrentWeight')
  14200. const kIndex = Symbol('kIndex')
  14201. const kWeight = Symbol('kWeight')
  14202. const kMaxWeightPerServer = Symbol('kMaxWeightPerServer')
  14203. const kErrorPenalty = Symbol('kErrorPenalty')
  14204. function getGreatestCommonDivisor (a, b) {
  14205. if (b === 0) return a
  14206. return getGreatestCommonDivisor(b, a % b)
  14207. }
  14208. function defaultFactory (origin, opts) {
  14209. return new Pool(origin, opts)
  14210. }
  14211. class BalancedPool extends PoolBase {
  14212. constructor (upstreams = [], { factory = defaultFactory, ...opts } = {}) {
  14213. super()
  14214. this[kOptions] = opts
  14215. this[kIndex] = -1
  14216. this[kCurrentWeight] = 0
  14217. this[kMaxWeightPerServer] = this[kOptions].maxWeightPerServer || 100
  14218. this[kErrorPenalty] = this[kOptions].errorPenalty || 15
  14219. if (!Array.isArray(upstreams)) {
  14220. upstreams = [upstreams]
  14221. }
  14222. if (typeof factory !== 'function') {
  14223. throw new InvalidArgumentError('factory must be a function.')
  14224. }
  14225. this[kInterceptors] = opts.interceptors && opts.interceptors.BalancedPool && Array.isArray(opts.interceptors.BalancedPool)
  14226. ? opts.interceptors.BalancedPool
  14227. : []
  14228. this[kFactory] = factory
  14229. for (const upstream of upstreams) {
  14230. this.addUpstream(upstream)
  14231. }
  14232. this._updateBalancedPoolStats()
  14233. }
  14234. addUpstream (upstream) {
  14235. const upstreamOrigin = parseOrigin(upstream).origin
  14236. if (this[kClients].find((pool) => (
  14237. pool[kUrl].origin === upstreamOrigin &&
  14238. pool.closed !== true &&
  14239. pool.destroyed !== true
  14240. ))) {
  14241. return this
  14242. }
  14243. const pool = this[kFactory](upstreamOrigin, Object.assign({}, this[kOptions]))
  14244. this[kAddClient](pool)
  14245. pool.on('connect', () => {
  14246. pool[kWeight] = Math.min(this[kMaxWeightPerServer], pool[kWeight] + this[kErrorPenalty])
  14247. })
  14248. pool.on('connectionError', () => {
  14249. pool[kWeight] = Math.max(1, pool[kWeight] - this[kErrorPenalty])
  14250. this._updateBalancedPoolStats()
  14251. })
  14252. pool.on('disconnect', (...args) => {
  14253. const err = args[2]
  14254. if (err && err.code === 'UND_ERR_SOCKET') {
  14255. // decrease the weight of the pool.
  14256. pool[kWeight] = Math.max(1, pool[kWeight] - this[kErrorPenalty])
  14257. this._updateBalancedPoolStats()
  14258. }
  14259. })
  14260. for (const client of this[kClients]) {
  14261. client[kWeight] = this[kMaxWeightPerServer]
  14262. }
  14263. this._updateBalancedPoolStats()
  14264. return this
  14265. }
  14266. _updateBalancedPoolStats () {
  14267. this[kGreatestCommonDivisor] = this[kClients].map(p => p[kWeight]).reduce(getGreatestCommonDivisor, 0)
  14268. }
  14269. removeUpstream (upstream) {
  14270. const upstreamOrigin = parseOrigin(upstream).origin
  14271. const pool = this[kClients].find((pool) => (
  14272. pool[kUrl].origin === upstreamOrigin &&
  14273. pool.closed !== true &&
  14274. pool.destroyed !== true
  14275. ))
  14276. if (pool) {
  14277. this[kRemoveClient](pool)
  14278. }
  14279. return this
  14280. }
  14281. get upstreams () {
  14282. return this[kClients]
  14283. .filter(dispatcher => dispatcher.closed !== true && dispatcher.destroyed !== true)
  14284. .map((p) => p[kUrl].origin)
  14285. }
  14286. [kGetDispatcher] () {
  14287. // We validate that pools is greater than 0,
  14288. // otherwise we would have to wait until an upstream
  14289. // is added, which might never happen.
  14290. if (this[kClients].length === 0) {
  14291. throw new BalancedPoolMissingUpstreamError()
  14292. }
  14293. const dispatcher = this[kClients].find(dispatcher => (
  14294. !dispatcher[kNeedDrain] &&
  14295. dispatcher.closed !== true &&
  14296. dispatcher.destroyed !== true
  14297. ))
  14298. if (!dispatcher) {
  14299. return
  14300. }
  14301. const allClientsBusy = this[kClients].map(pool => pool[kNeedDrain]).reduce((a, b) => a && b, true)
  14302. if (allClientsBusy) {
  14303. return
  14304. }
  14305. let counter = 0
  14306. let maxWeightIndex = this[kClients].findIndex(pool => !pool[kNeedDrain])
  14307. while (counter++ < this[kClients].length) {
  14308. this[kIndex] = (this[kIndex] + 1) % this[kClients].length
  14309. const pool = this[kClients][this[kIndex]]
  14310. // find pool index with the largest weight
  14311. if (pool[kWeight] > this[kClients][maxWeightIndex][kWeight] && !pool[kNeedDrain]) {
  14312. maxWeightIndex = this[kIndex]
  14313. }
  14314. // decrease the current weight every `this[kClients].length`.
  14315. if (this[kIndex] === 0) {
  14316. // Set the current weight to the next lower weight.
  14317. this[kCurrentWeight] = this[kCurrentWeight] - this[kGreatestCommonDivisor]
  14318. if (this[kCurrentWeight] <= 0) {
  14319. this[kCurrentWeight] = this[kMaxWeightPerServer]
  14320. }
  14321. }
  14322. if (pool[kWeight] >= this[kCurrentWeight] && (!pool[kNeedDrain])) {
  14323. return pool
  14324. }
  14325. }
  14326. this[kCurrentWeight] = this[kClients][maxWeightIndex][kWeight]
  14327. this[kIndex] = maxWeightIndex
  14328. return this[kClients][maxWeightIndex]
  14329. }
  14330. }
  14331. module.exports = BalancedPool
  14332. /***/ }),
  14333. /***/ 6101:
  14334. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  14335. "use strict";
  14336. const { kConstruct } = __nccwpck_require__(9174)
  14337. const { urlEquals, fieldValues: getFieldValues } = __nccwpck_require__(2396)
  14338. const { kEnumerableProperty, isDisturbed } = __nccwpck_require__(3983)
  14339. const { kHeadersList } = __nccwpck_require__(2785)
  14340. const { webidl } = __nccwpck_require__(1744)
  14341. const { Response, cloneResponse } = __nccwpck_require__(7823)
  14342. const { Request } = __nccwpck_require__(8359)
  14343. const { kState, kHeaders, kGuard, kRealm } = __nccwpck_require__(5861)
  14344. const { fetching } = __nccwpck_require__(4881)
  14345. const { urlIsHttpHttpsScheme, createDeferredPromise, readAllBytes } = __nccwpck_require__(2538)
  14346. const assert = __nccwpck_require__(9491)
  14347. const { getGlobalDispatcher } = __nccwpck_require__(1892)
  14348. /**
  14349. * @see https://w3c.github.io/ServiceWorker/#dfn-cache-batch-operation
  14350. * @typedef {Object} CacheBatchOperation
  14351. * @property {'delete' | 'put'} type
  14352. * @property {any} request
  14353. * @property {any} response
  14354. * @property {import('../../types/cache').CacheQueryOptions} options
  14355. */
  14356. /**
  14357. * @see https://w3c.github.io/ServiceWorker/#dfn-request-response-list
  14358. * @typedef {[any, any][]} requestResponseList
  14359. */
  14360. class Cache {
  14361. /**
  14362. * @see https://w3c.github.io/ServiceWorker/#dfn-relevant-request-response-list
  14363. * @type {requestResponseList}
  14364. */
  14365. #relevantRequestResponseList
  14366. constructor () {
  14367. if (arguments[0] !== kConstruct) {
  14368. webidl.illegalConstructor()
  14369. }
  14370. this.#relevantRequestResponseList = arguments[1]
  14371. }
  14372. async match (request, options = {}) {
  14373. webidl.brandCheck(this, Cache)
  14374. webidl.argumentLengthCheck(arguments, 1, { header: 'Cache.match' })
  14375. request = webidl.converters.RequestInfo(request)
  14376. options = webidl.converters.CacheQueryOptions(options)
  14377. const p = await this.matchAll(request, options)
  14378. if (p.length === 0) {
  14379. return
  14380. }
  14381. return p[0]
  14382. }
  14383. async matchAll (request = undefined, options = {}) {
  14384. webidl.brandCheck(this, Cache)
  14385. if (request !== undefined) request = webidl.converters.RequestInfo(request)
  14386. options = webidl.converters.CacheQueryOptions(options)
  14387. // 1.
  14388. let r = null
  14389. // 2.
  14390. if (request !== undefined) {
  14391. if (request instanceof Request) {
  14392. // 2.1.1
  14393. r = request[kState]
  14394. // 2.1.2
  14395. if (r.method !== 'GET' && !options.ignoreMethod) {
  14396. return []
  14397. }
  14398. } else if (typeof request === 'string') {
  14399. // 2.2.1
  14400. r = new Request(request)[kState]
  14401. }
  14402. }
  14403. // 5.
  14404. // 5.1
  14405. const responses = []
  14406. // 5.2
  14407. if (request === undefined) {
  14408. // 5.2.1
  14409. for (const requestResponse of this.#relevantRequestResponseList) {
  14410. responses.push(requestResponse[1])
  14411. }
  14412. } else { // 5.3
  14413. // 5.3.1
  14414. const requestResponses = this.#queryCache(r, options)
  14415. // 5.3.2
  14416. for (const requestResponse of requestResponses) {
  14417. responses.push(requestResponse[1])
  14418. }
  14419. }
  14420. // 5.4
  14421. // We don't implement CORs so we don't need to loop over the responses, yay!
  14422. // 5.5.1
  14423. const responseList = []
  14424. // 5.5.2
  14425. for (const response of responses) {
  14426. // 5.5.2.1
  14427. const responseObject = new Response(response.body?.source ?? null)
  14428. const body = responseObject[kState].body
  14429. responseObject[kState] = response
  14430. responseObject[kState].body = body
  14431. responseObject[kHeaders][kHeadersList] = response.headersList
  14432. responseObject[kHeaders][kGuard] = 'immutable'
  14433. responseList.push(responseObject)
  14434. }
  14435. // 6.
  14436. return Object.freeze(responseList)
  14437. }
  14438. async add (request) {
  14439. webidl.brandCheck(this, Cache)
  14440. webidl.argumentLengthCheck(arguments, 1, { header: 'Cache.add' })
  14441. request = webidl.converters.RequestInfo(request)
  14442. // 1.
  14443. const requests = [request]
  14444. // 2.
  14445. const responseArrayPromise = this.addAll(requests)
  14446. // 3.
  14447. return await responseArrayPromise
  14448. }
  14449. async addAll (requests) {
  14450. webidl.brandCheck(this, Cache)
  14451. webidl.argumentLengthCheck(arguments, 1, { header: 'Cache.addAll' })
  14452. requests = webidl.converters['sequence<RequestInfo>'](requests)
  14453. // 1.
  14454. const responsePromises = []
  14455. // 2.
  14456. const requestList = []
  14457. // 3.
  14458. for (const request of requests) {
  14459. if (typeof request === 'string') {
  14460. continue
  14461. }
  14462. // 3.1
  14463. const r = request[kState]
  14464. // 3.2
  14465. if (!urlIsHttpHttpsScheme(r.url) || r.method !== 'GET') {
  14466. throw webidl.errors.exception({
  14467. header: 'Cache.addAll',
  14468. message: 'Expected http/s scheme when method is not GET.'
  14469. })
  14470. }
  14471. }
  14472. // 4.
  14473. /** @type {ReturnType<typeof fetching>[]} */
  14474. const fetchControllers = []
  14475. // 5.
  14476. for (const request of requests) {
  14477. // 5.1
  14478. const r = new Request(request)[kState]
  14479. // 5.2
  14480. if (!urlIsHttpHttpsScheme(r.url)) {
  14481. throw webidl.errors.exception({
  14482. header: 'Cache.addAll',
  14483. message: 'Expected http/s scheme.'
  14484. })
  14485. }
  14486. // 5.4
  14487. r.initiator = 'fetch'
  14488. r.destination = 'subresource'
  14489. // 5.5
  14490. requestList.push(r)
  14491. // 5.6
  14492. const responsePromise = createDeferredPromise()
  14493. // 5.7
  14494. fetchControllers.push(fetching({
  14495. request: r,
  14496. dispatcher: getGlobalDispatcher(),
  14497. processResponse (response) {
  14498. // 1.
  14499. if (response.type === 'error' || response.status === 206 || response.status < 200 || response.status > 299) {
  14500. responsePromise.reject(webidl.errors.exception({
  14501. header: 'Cache.addAll',
  14502. message: 'Received an invalid status code or the request failed.'
  14503. }))
  14504. } else if (response.headersList.contains('vary')) { // 2.
  14505. // 2.1
  14506. const fieldValues = getFieldValues(response.headersList.get('vary'))
  14507. // 2.2
  14508. for (const fieldValue of fieldValues) {
  14509. // 2.2.1
  14510. if (fieldValue === '*') {
  14511. responsePromise.reject(webidl.errors.exception({
  14512. header: 'Cache.addAll',
  14513. message: 'invalid vary field value'
  14514. }))
  14515. for (const controller of fetchControllers) {
  14516. controller.abort()
  14517. }
  14518. return
  14519. }
  14520. }
  14521. }
  14522. },
  14523. processResponseEndOfBody (response) {
  14524. // 1.
  14525. if (response.aborted) {
  14526. responsePromise.reject(new DOMException('aborted', 'AbortError'))
  14527. return
  14528. }
  14529. // 2.
  14530. responsePromise.resolve(response)
  14531. }
  14532. }))
  14533. // 5.8
  14534. responsePromises.push(responsePromise.promise)
  14535. }
  14536. // 6.
  14537. const p = Promise.all(responsePromises)
  14538. // 7.
  14539. const responses = await p
  14540. // 7.1
  14541. const operations = []
  14542. // 7.2
  14543. let index = 0
  14544. // 7.3
  14545. for (const response of responses) {
  14546. // 7.3.1
  14547. /** @type {CacheBatchOperation} */
  14548. const operation = {
  14549. type: 'put', // 7.3.2
  14550. request: requestList[index], // 7.3.3
  14551. response // 7.3.4
  14552. }
  14553. operations.push(operation) // 7.3.5
  14554. index++ // 7.3.6
  14555. }
  14556. // 7.5
  14557. const cacheJobPromise = createDeferredPromise()
  14558. // 7.6.1
  14559. let errorData = null
  14560. // 7.6.2
  14561. try {
  14562. this.#batchCacheOperations(operations)
  14563. } catch (e) {
  14564. errorData = e
  14565. }
  14566. // 7.6.3
  14567. queueMicrotask(() => {
  14568. // 7.6.3.1
  14569. if (errorData === null) {
  14570. cacheJobPromise.resolve(undefined)
  14571. } else {
  14572. // 7.6.3.2
  14573. cacheJobPromise.reject(errorData)
  14574. }
  14575. })
  14576. // 7.7
  14577. return cacheJobPromise.promise
  14578. }
  14579. async put (request, response) {
  14580. webidl.brandCheck(this, Cache)
  14581. webidl.argumentLengthCheck(arguments, 2, { header: 'Cache.put' })
  14582. request = webidl.converters.RequestInfo(request)
  14583. response = webidl.converters.Response(response)
  14584. // 1.
  14585. let innerRequest = null
  14586. // 2.
  14587. if (request instanceof Request) {
  14588. innerRequest = request[kState]
  14589. } else { // 3.
  14590. innerRequest = new Request(request)[kState]
  14591. }
  14592. // 4.
  14593. if (!urlIsHttpHttpsScheme(innerRequest.url) || innerRequest.method !== 'GET') {
  14594. throw webidl.errors.exception({
  14595. header: 'Cache.put',
  14596. message: 'Expected an http/s scheme when method is not GET'
  14597. })
  14598. }
  14599. // 5.
  14600. const innerResponse = response[kState]
  14601. // 6.
  14602. if (innerResponse.status === 206) {
  14603. throw webidl.errors.exception({
  14604. header: 'Cache.put',
  14605. message: 'Got 206 status'
  14606. })
  14607. }
  14608. // 7.
  14609. if (innerResponse.headersList.contains('vary')) {
  14610. // 7.1.
  14611. const fieldValues = getFieldValues(innerResponse.headersList.get('vary'))
  14612. // 7.2.
  14613. for (const fieldValue of fieldValues) {
  14614. // 7.2.1
  14615. if (fieldValue === '*') {
  14616. throw webidl.errors.exception({
  14617. header: 'Cache.put',
  14618. message: 'Got * vary field value'
  14619. })
  14620. }
  14621. }
  14622. }
  14623. // 8.
  14624. if (innerResponse.body && (isDisturbed(innerResponse.body.stream) || innerResponse.body.stream.locked)) {
  14625. throw webidl.errors.exception({
  14626. header: 'Cache.put',
  14627. message: 'Response body is locked or disturbed'
  14628. })
  14629. }
  14630. // 9.
  14631. const clonedResponse = cloneResponse(innerResponse)
  14632. // 10.
  14633. const bodyReadPromise = createDeferredPromise()
  14634. // 11.
  14635. if (innerResponse.body != null) {
  14636. // 11.1
  14637. const stream = innerResponse.body.stream
  14638. // 11.2
  14639. const reader = stream.getReader()
  14640. // 11.3
  14641. readAllBytes(reader).then(bodyReadPromise.resolve, bodyReadPromise.reject)
  14642. } else {
  14643. bodyReadPromise.resolve(undefined)
  14644. }
  14645. // 12.
  14646. /** @type {CacheBatchOperation[]} */
  14647. const operations = []
  14648. // 13.
  14649. /** @type {CacheBatchOperation} */
  14650. const operation = {
  14651. type: 'put', // 14.
  14652. request: innerRequest, // 15.
  14653. response: clonedResponse // 16.
  14654. }
  14655. // 17.
  14656. operations.push(operation)
  14657. // 19.
  14658. const bytes = await bodyReadPromise.promise
  14659. if (clonedResponse.body != null) {
  14660. clonedResponse.body.source = bytes
  14661. }
  14662. // 19.1
  14663. const cacheJobPromise = createDeferredPromise()
  14664. // 19.2.1
  14665. let errorData = null
  14666. // 19.2.2
  14667. try {
  14668. this.#batchCacheOperations(operations)
  14669. } catch (e) {
  14670. errorData = e
  14671. }
  14672. // 19.2.3
  14673. queueMicrotask(() => {
  14674. // 19.2.3.1
  14675. if (errorData === null) {
  14676. cacheJobPromise.resolve()
  14677. } else { // 19.2.3.2
  14678. cacheJobPromise.reject(errorData)
  14679. }
  14680. })
  14681. return cacheJobPromise.promise
  14682. }
  14683. async delete (request, options = {}) {
  14684. webidl.brandCheck(this, Cache)
  14685. webidl.argumentLengthCheck(arguments, 1, { header: 'Cache.delete' })
  14686. request = webidl.converters.RequestInfo(request)
  14687. options = webidl.converters.CacheQueryOptions(options)
  14688. /**
  14689. * @type {Request}
  14690. */
  14691. let r = null
  14692. if (request instanceof Request) {
  14693. r = request[kState]
  14694. if (r.method !== 'GET' && !options.ignoreMethod) {
  14695. return false
  14696. }
  14697. } else {
  14698. assert(typeof request === 'string')
  14699. r = new Request(request)[kState]
  14700. }
  14701. /** @type {CacheBatchOperation[]} */
  14702. const operations = []
  14703. /** @type {CacheBatchOperation} */
  14704. const operation = {
  14705. type: 'delete',
  14706. request: r,
  14707. options
  14708. }
  14709. operations.push(operation)
  14710. const cacheJobPromise = createDeferredPromise()
  14711. let errorData = null
  14712. let requestResponses
  14713. try {
  14714. requestResponses = this.#batchCacheOperations(operations)
  14715. } catch (e) {
  14716. errorData = e
  14717. }
  14718. queueMicrotask(() => {
  14719. if (errorData === null) {
  14720. cacheJobPromise.resolve(!!requestResponses?.length)
  14721. } else {
  14722. cacheJobPromise.reject(errorData)
  14723. }
  14724. })
  14725. return cacheJobPromise.promise
  14726. }
  14727. /**
  14728. * @see https://w3c.github.io/ServiceWorker/#dom-cache-keys
  14729. * @param {any} request
  14730. * @param {import('../../types/cache').CacheQueryOptions} options
  14731. * @returns {readonly Request[]}
  14732. */
  14733. async keys (request = undefined, options = {}) {
  14734. webidl.brandCheck(this, Cache)
  14735. if (request !== undefined) request = webidl.converters.RequestInfo(request)
  14736. options = webidl.converters.CacheQueryOptions(options)
  14737. // 1.
  14738. let r = null
  14739. // 2.
  14740. if (request !== undefined) {
  14741. // 2.1
  14742. if (request instanceof Request) {
  14743. // 2.1.1
  14744. r = request[kState]
  14745. // 2.1.2
  14746. if (r.method !== 'GET' && !options.ignoreMethod) {
  14747. return []
  14748. }
  14749. } else if (typeof request === 'string') { // 2.2
  14750. r = new Request(request)[kState]
  14751. }
  14752. }
  14753. // 4.
  14754. const promise = createDeferredPromise()
  14755. // 5.
  14756. // 5.1
  14757. const requests = []
  14758. // 5.2
  14759. if (request === undefined) {
  14760. // 5.2.1
  14761. for (const requestResponse of this.#relevantRequestResponseList) {
  14762. // 5.2.1.1
  14763. requests.push(requestResponse[0])
  14764. }
  14765. } else { // 5.3
  14766. // 5.3.1
  14767. const requestResponses = this.#queryCache(r, options)
  14768. // 5.3.2
  14769. for (const requestResponse of requestResponses) {
  14770. // 5.3.2.1
  14771. requests.push(requestResponse[0])
  14772. }
  14773. }
  14774. // 5.4
  14775. queueMicrotask(() => {
  14776. // 5.4.1
  14777. const requestList = []
  14778. // 5.4.2
  14779. for (const request of requests) {
  14780. const requestObject = new Request('https://a')
  14781. requestObject[kState] = request
  14782. requestObject[kHeaders][kHeadersList] = request.headersList
  14783. requestObject[kHeaders][kGuard] = 'immutable'
  14784. requestObject[kRealm] = request.client
  14785. // 5.4.2.1
  14786. requestList.push(requestObject)
  14787. }
  14788. // 5.4.3
  14789. promise.resolve(Object.freeze(requestList))
  14790. })
  14791. return promise.promise
  14792. }
  14793. /**
  14794. * @see https://w3c.github.io/ServiceWorker/#batch-cache-operations-algorithm
  14795. * @param {CacheBatchOperation[]} operations
  14796. * @returns {requestResponseList}
  14797. */
  14798. #batchCacheOperations (operations) {
  14799. // 1.
  14800. const cache = this.#relevantRequestResponseList
  14801. // 2.
  14802. const backupCache = [...cache]
  14803. // 3.
  14804. const addedItems = []
  14805. // 4.1
  14806. const resultList = []
  14807. try {
  14808. // 4.2
  14809. for (const operation of operations) {
  14810. // 4.2.1
  14811. if (operation.type !== 'delete' && operation.type !== 'put') {
  14812. throw webidl.errors.exception({
  14813. header: 'Cache.#batchCacheOperations',
  14814. message: 'operation type does not match "delete" or "put"'
  14815. })
  14816. }
  14817. // 4.2.2
  14818. if (operation.type === 'delete' && operation.response != null) {
  14819. throw webidl.errors.exception({
  14820. header: 'Cache.#batchCacheOperations',
  14821. message: 'delete operation should not have an associated response'
  14822. })
  14823. }
  14824. // 4.2.3
  14825. if (this.#queryCache(operation.request, operation.options, addedItems).length) {
  14826. throw new DOMException('???', 'InvalidStateError')
  14827. }
  14828. // 4.2.4
  14829. let requestResponses
  14830. // 4.2.5
  14831. if (operation.type === 'delete') {
  14832. // 4.2.5.1
  14833. requestResponses = this.#queryCache(operation.request, operation.options)
  14834. // TODO: the spec is wrong, this is needed to pass WPTs
  14835. if (requestResponses.length === 0) {
  14836. return []
  14837. }
  14838. // 4.2.5.2
  14839. for (const requestResponse of requestResponses) {
  14840. const idx = cache.indexOf(requestResponse)
  14841. assert(idx !== -1)
  14842. // 4.2.5.2.1
  14843. cache.splice(idx, 1)
  14844. }
  14845. } else if (operation.type === 'put') { // 4.2.6
  14846. // 4.2.6.1
  14847. if (operation.response == null) {
  14848. throw webidl.errors.exception({
  14849. header: 'Cache.#batchCacheOperations',
  14850. message: 'put operation should have an associated response'
  14851. })
  14852. }
  14853. // 4.2.6.2
  14854. const r = operation.request
  14855. // 4.2.6.3
  14856. if (!urlIsHttpHttpsScheme(r.url)) {
  14857. throw webidl.errors.exception({
  14858. header: 'Cache.#batchCacheOperations',
  14859. message: 'expected http or https scheme'
  14860. })
  14861. }
  14862. // 4.2.6.4
  14863. if (r.method !== 'GET') {
  14864. throw webidl.errors.exception({
  14865. header: 'Cache.#batchCacheOperations',
  14866. message: 'not get method'
  14867. })
  14868. }
  14869. // 4.2.6.5
  14870. if (operation.options != null) {
  14871. throw webidl.errors.exception({
  14872. header: 'Cache.#batchCacheOperations',
  14873. message: 'options must not be defined'
  14874. })
  14875. }
  14876. // 4.2.6.6
  14877. requestResponses = this.#queryCache(operation.request)
  14878. // 4.2.6.7
  14879. for (const requestResponse of requestResponses) {
  14880. const idx = cache.indexOf(requestResponse)
  14881. assert(idx !== -1)
  14882. // 4.2.6.7.1
  14883. cache.splice(idx, 1)
  14884. }
  14885. // 4.2.6.8
  14886. cache.push([operation.request, operation.response])
  14887. // 4.2.6.10
  14888. addedItems.push([operation.request, operation.response])
  14889. }
  14890. // 4.2.7
  14891. resultList.push([operation.request, operation.response])
  14892. }
  14893. // 4.3
  14894. return resultList
  14895. } catch (e) { // 5.
  14896. // 5.1
  14897. this.#relevantRequestResponseList.length = 0
  14898. // 5.2
  14899. this.#relevantRequestResponseList = backupCache
  14900. // 5.3
  14901. throw e
  14902. }
  14903. }
  14904. /**
  14905. * @see https://w3c.github.io/ServiceWorker/#query-cache
  14906. * @param {any} requestQuery
  14907. * @param {import('../../types/cache').CacheQueryOptions} options
  14908. * @param {requestResponseList} targetStorage
  14909. * @returns {requestResponseList}
  14910. */
  14911. #queryCache (requestQuery, options, targetStorage) {
  14912. /** @type {requestResponseList} */
  14913. const resultList = []
  14914. const storage = targetStorage ?? this.#relevantRequestResponseList
  14915. for (const requestResponse of storage) {
  14916. const [cachedRequest, cachedResponse] = requestResponse
  14917. if (this.#requestMatchesCachedItem(requestQuery, cachedRequest, cachedResponse, options)) {
  14918. resultList.push(requestResponse)
  14919. }
  14920. }
  14921. return resultList
  14922. }
  14923. /**
  14924. * @see https://w3c.github.io/ServiceWorker/#request-matches-cached-item-algorithm
  14925. * @param {any} requestQuery
  14926. * @param {any} request
  14927. * @param {any | null} response
  14928. * @param {import('../../types/cache').CacheQueryOptions | undefined} options
  14929. * @returns {boolean}
  14930. */
  14931. #requestMatchesCachedItem (requestQuery, request, response = null, options) {
  14932. // if (options?.ignoreMethod === false && request.method === 'GET') {
  14933. // return false
  14934. // }
  14935. const queryURL = new URL(requestQuery.url)
  14936. const cachedURL = new URL(request.url)
  14937. if (options?.ignoreSearch) {
  14938. cachedURL.search = ''
  14939. queryURL.search = ''
  14940. }
  14941. if (!urlEquals(queryURL, cachedURL, true)) {
  14942. return false
  14943. }
  14944. if (
  14945. response == null ||
  14946. options?.ignoreVary ||
  14947. !response.headersList.contains('vary')
  14948. ) {
  14949. return true
  14950. }
  14951. const fieldValues = getFieldValues(response.headersList.get('vary'))
  14952. for (const fieldValue of fieldValues) {
  14953. if (fieldValue === '*') {
  14954. return false
  14955. }
  14956. const requestValue = request.headersList.get(fieldValue)
  14957. const queryValue = requestQuery.headersList.get(fieldValue)
  14958. // If one has the header and the other doesn't, or one has
  14959. // a different value than the other, return false
  14960. if (requestValue !== queryValue) {
  14961. return false
  14962. }
  14963. }
  14964. return true
  14965. }
  14966. }
  14967. Object.defineProperties(Cache.prototype, {
  14968. [Symbol.toStringTag]: {
  14969. value: 'Cache',
  14970. configurable: true
  14971. },
  14972. match: kEnumerableProperty,
  14973. matchAll: kEnumerableProperty,
  14974. add: kEnumerableProperty,
  14975. addAll: kEnumerableProperty,
  14976. put: kEnumerableProperty,
  14977. delete: kEnumerableProperty,
  14978. keys: kEnumerableProperty
  14979. })
  14980. const cacheQueryOptionConverters = [
  14981. {
  14982. key: 'ignoreSearch',
  14983. converter: webidl.converters.boolean,
  14984. defaultValue: false
  14985. },
  14986. {
  14987. key: 'ignoreMethod',
  14988. converter: webidl.converters.boolean,
  14989. defaultValue: false
  14990. },
  14991. {
  14992. key: 'ignoreVary',
  14993. converter: webidl.converters.boolean,
  14994. defaultValue: false
  14995. }
  14996. ]
  14997. webidl.converters.CacheQueryOptions = webidl.dictionaryConverter(cacheQueryOptionConverters)
  14998. webidl.converters.MultiCacheQueryOptions = webidl.dictionaryConverter([
  14999. ...cacheQueryOptionConverters,
  15000. {
  15001. key: 'cacheName',
  15002. converter: webidl.converters.DOMString
  15003. }
  15004. ])
  15005. webidl.converters.Response = webidl.interfaceConverter(Response)
  15006. webidl.converters['sequence<RequestInfo>'] = webidl.sequenceConverter(
  15007. webidl.converters.RequestInfo
  15008. )
  15009. module.exports = {
  15010. Cache
  15011. }
  15012. /***/ }),
  15013. /***/ 7907:
  15014. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  15015. "use strict";
  15016. const { kConstruct } = __nccwpck_require__(9174)
  15017. const { Cache } = __nccwpck_require__(6101)
  15018. const { webidl } = __nccwpck_require__(1744)
  15019. const { kEnumerableProperty } = __nccwpck_require__(3983)
  15020. class CacheStorage {
  15021. /**
  15022. * @see https://w3c.github.io/ServiceWorker/#dfn-relevant-name-to-cache-map
  15023. * @type {Map<string, import('./cache').requestResponseList}
  15024. */
  15025. #caches = new Map()
  15026. constructor () {
  15027. if (arguments[0] !== kConstruct) {
  15028. webidl.illegalConstructor()
  15029. }
  15030. }
  15031. async match (request, options = {}) {
  15032. webidl.brandCheck(this, CacheStorage)
  15033. webidl.argumentLengthCheck(arguments, 1, { header: 'CacheStorage.match' })
  15034. request = webidl.converters.RequestInfo(request)
  15035. options = webidl.converters.MultiCacheQueryOptions(options)
  15036. // 1.
  15037. if (options.cacheName != null) {
  15038. // 1.1.1.1
  15039. if (this.#caches.has(options.cacheName)) {
  15040. // 1.1.1.1.1
  15041. const cacheList = this.#caches.get(options.cacheName)
  15042. const cache = new Cache(kConstruct, cacheList)
  15043. return await cache.match(request, options)
  15044. }
  15045. } else { // 2.
  15046. // 2.2
  15047. for (const cacheList of this.#caches.values()) {
  15048. const cache = new Cache(kConstruct, cacheList)
  15049. // 2.2.1.2
  15050. const response = await cache.match(request, options)
  15051. if (response !== undefined) {
  15052. return response
  15053. }
  15054. }
  15055. }
  15056. }
  15057. /**
  15058. * @see https://w3c.github.io/ServiceWorker/#cache-storage-has
  15059. * @param {string} cacheName
  15060. * @returns {Promise<boolean>}
  15061. */
  15062. async has (cacheName) {
  15063. webidl.brandCheck(this, CacheStorage)
  15064. webidl.argumentLengthCheck(arguments, 1, { header: 'CacheStorage.has' })
  15065. cacheName = webidl.converters.DOMString(cacheName)
  15066. // 2.1.1
  15067. // 2.2
  15068. return this.#caches.has(cacheName)
  15069. }
  15070. /**
  15071. * @see https://w3c.github.io/ServiceWorker/#dom-cachestorage-open
  15072. * @param {string} cacheName
  15073. * @returns {Promise<Cache>}
  15074. */
  15075. async open (cacheName) {
  15076. webidl.brandCheck(this, CacheStorage)
  15077. webidl.argumentLengthCheck(arguments, 1, { header: 'CacheStorage.open' })
  15078. cacheName = webidl.converters.DOMString(cacheName)
  15079. // 2.1
  15080. if (this.#caches.has(cacheName)) {
  15081. // await caches.open('v1') !== await caches.open('v1')
  15082. // 2.1.1
  15083. const cache = this.#caches.get(cacheName)
  15084. // 2.1.1.1
  15085. return new Cache(kConstruct, cache)
  15086. }
  15087. // 2.2
  15088. const cache = []
  15089. // 2.3
  15090. this.#caches.set(cacheName, cache)
  15091. // 2.4
  15092. return new Cache(kConstruct, cache)
  15093. }
  15094. /**
  15095. * @see https://w3c.github.io/ServiceWorker/#cache-storage-delete
  15096. * @param {string} cacheName
  15097. * @returns {Promise<boolean>}
  15098. */
  15099. async delete (cacheName) {
  15100. webidl.brandCheck(this, CacheStorage)
  15101. webidl.argumentLengthCheck(arguments, 1, { header: 'CacheStorage.delete' })
  15102. cacheName = webidl.converters.DOMString(cacheName)
  15103. return this.#caches.delete(cacheName)
  15104. }
  15105. /**
  15106. * @see https://w3c.github.io/ServiceWorker/#cache-storage-keys
  15107. * @returns {string[]}
  15108. */
  15109. async keys () {
  15110. webidl.brandCheck(this, CacheStorage)
  15111. // 2.1
  15112. const keys = this.#caches.keys()
  15113. // 2.2
  15114. return [...keys]
  15115. }
  15116. }
  15117. Object.defineProperties(CacheStorage.prototype, {
  15118. [Symbol.toStringTag]: {
  15119. value: 'CacheStorage',
  15120. configurable: true
  15121. },
  15122. match: kEnumerableProperty,
  15123. has: kEnumerableProperty,
  15124. open: kEnumerableProperty,
  15125. delete: kEnumerableProperty,
  15126. keys: kEnumerableProperty
  15127. })
  15128. module.exports = {
  15129. CacheStorage
  15130. }
  15131. /***/ }),
  15132. /***/ 9174:
  15133. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  15134. "use strict";
  15135. module.exports = {
  15136. kConstruct: (__nccwpck_require__(2785).kConstruct)
  15137. }
  15138. /***/ }),
  15139. /***/ 2396:
  15140. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  15141. "use strict";
  15142. const assert = __nccwpck_require__(9491)
  15143. const { URLSerializer } = __nccwpck_require__(685)
  15144. const { isValidHeaderName } = __nccwpck_require__(2538)
  15145. /**
  15146. * @see https://url.spec.whatwg.org/#concept-url-equals
  15147. * @param {URL} A
  15148. * @param {URL} B
  15149. * @param {boolean | undefined} excludeFragment
  15150. * @returns {boolean}
  15151. */
  15152. function urlEquals (A, B, excludeFragment = false) {
  15153. const serializedA = URLSerializer(A, excludeFragment)
  15154. const serializedB = URLSerializer(B, excludeFragment)
  15155. return serializedA === serializedB
  15156. }
  15157. /**
  15158. * @see https://github.com/chromium/chromium/blob/694d20d134cb553d8d89e5500b9148012b1ba299/content/browser/cache_storage/cache_storage_cache.cc#L260-L262
  15159. * @param {string} header
  15160. */
  15161. function fieldValues (header) {
  15162. assert(header !== null)
  15163. const values = []
  15164. for (let value of header.split(',')) {
  15165. value = value.trim()
  15166. if (!value.length) {
  15167. continue
  15168. } else if (!isValidHeaderName(value)) {
  15169. continue
  15170. }
  15171. values.push(value)
  15172. }
  15173. return values
  15174. }
  15175. module.exports = {
  15176. urlEquals,
  15177. fieldValues
  15178. }
  15179. /***/ }),
  15180. /***/ 3598:
  15181. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  15182. "use strict";
  15183. // @ts-check
  15184. /* global WebAssembly */
  15185. const assert = __nccwpck_require__(9491)
  15186. const net = __nccwpck_require__(1808)
  15187. const http = __nccwpck_require__(3685)
  15188. const { pipeline } = __nccwpck_require__(2781)
  15189. const util = __nccwpck_require__(3983)
  15190. const timers = __nccwpck_require__(9459)
  15191. const Request = __nccwpck_require__(2905)
  15192. const DispatcherBase = __nccwpck_require__(4839)
  15193. const {
  15194. RequestContentLengthMismatchError,
  15195. ResponseContentLengthMismatchError,
  15196. InvalidArgumentError,
  15197. RequestAbortedError,
  15198. HeadersTimeoutError,
  15199. HeadersOverflowError,
  15200. SocketError,
  15201. InformationalError,
  15202. BodyTimeoutError,
  15203. HTTPParserError,
  15204. ResponseExceededMaxSizeError,
  15205. ClientDestroyedError
  15206. } = __nccwpck_require__(8045)
  15207. const buildConnector = __nccwpck_require__(2067)
  15208. const {
  15209. kUrl,
  15210. kReset,
  15211. kServerName,
  15212. kClient,
  15213. kBusy,
  15214. kParser,
  15215. kConnect,
  15216. kBlocking,
  15217. kResuming,
  15218. kRunning,
  15219. kPending,
  15220. kSize,
  15221. kWriting,
  15222. kQueue,
  15223. kConnected,
  15224. kConnecting,
  15225. kNeedDrain,
  15226. kNoRef,
  15227. kKeepAliveDefaultTimeout,
  15228. kHostHeader,
  15229. kPendingIdx,
  15230. kRunningIdx,
  15231. kError,
  15232. kPipelining,
  15233. kSocket,
  15234. kKeepAliveTimeoutValue,
  15235. kMaxHeadersSize,
  15236. kKeepAliveMaxTimeout,
  15237. kKeepAliveTimeoutThreshold,
  15238. kHeadersTimeout,
  15239. kBodyTimeout,
  15240. kStrictContentLength,
  15241. kConnector,
  15242. kMaxRedirections,
  15243. kMaxRequests,
  15244. kCounter,
  15245. kClose,
  15246. kDestroy,
  15247. kDispatch,
  15248. kInterceptors,
  15249. kLocalAddress,
  15250. kMaxResponseSize,
  15251. kHTTPConnVersion,
  15252. // HTTP2
  15253. kHost,
  15254. kHTTP2Session,
  15255. kHTTP2SessionState,
  15256. kHTTP2BuildRequest,
  15257. kHTTP2CopyHeaders,
  15258. kHTTP1BuildRequest
  15259. } = __nccwpck_require__(2785)
  15260. /** @type {import('http2')} */
  15261. let http2
  15262. try {
  15263. http2 = __nccwpck_require__(5158)
  15264. } catch {
  15265. // @ts-ignore
  15266. http2 = { constants: {} }
  15267. }
  15268. const {
  15269. constants: {
  15270. HTTP2_HEADER_AUTHORITY,
  15271. HTTP2_HEADER_METHOD,
  15272. HTTP2_HEADER_PATH,
  15273. HTTP2_HEADER_SCHEME,
  15274. HTTP2_HEADER_CONTENT_LENGTH,
  15275. HTTP2_HEADER_EXPECT,
  15276. HTTP2_HEADER_STATUS
  15277. }
  15278. } = http2
  15279. // Experimental
  15280. let h2ExperimentalWarned = false
  15281. const FastBuffer = Buffer[Symbol.species]
  15282. const kClosedResolve = Symbol('kClosedResolve')
  15283. const channels = {}
  15284. try {
  15285. const diagnosticsChannel = __nccwpck_require__(7643)
  15286. channels.sendHeaders = diagnosticsChannel.channel('undici:client:sendHeaders')
  15287. channels.beforeConnect = diagnosticsChannel.channel('undici:client:beforeConnect')
  15288. channels.connectError = diagnosticsChannel.channel('undici:client:connectError')
  15289. channels.connected = diagnosticsChannel.channel('undici:client:connected')
  15290. } catch {
  15291. channels.sendHeaders = { hasSubscribers: false }
  15292. channels.beforeConnect = { hasSubscribers: false }
  15293. channels.connectError = { hasSubscribers: false }
  15294. channels.connected = { hasSubscribers: false }
  15295. }
  15296. /**
  15297. * @type {import('../types/client').default}
  15298. */
  15299. class Client extends DispatcherBase {
  15300. /**
  15301. *
  15302. * @param {string|URL} url
  15303. * @param {import('../types/client').Client.Options} options
  15304. */
  15305. constructor (url, {
  15306. interceptors,
  15307. maxHeaderSize,
  15308. headersTimeout,
  15309. socketTimeout,
  15310. requestTimeout,
  15311. connectTimeout,
  15312. bodyTimeout,
  15313. idleTimeout,
  15314. keepAlive,
  15315. keepAliveTimeout,
  15316. maxKeepAliveTimeout,
  15317. keepAliveMaxTimeout,
  15318. keepAliveTimeoutThreshold,
  15319. socketPath,
  15320. pipelining,
  15321. tls,
  15322. strictContentLength,
  15323. maxCachedSessions,
  15324. maxRedirections,
  15325. connect,
  15326. maxRequestsPerClient,
  15327. localAddress,
  15328. maxResponseSize,
  15329. autoSelectFamily,
  15330. autoSelectFamilyAttemptTimeout,
  15331. // h2
  15332. allowH2,
  15333. maxConcurrentStreams
  15334. } = {}) {
  15335. super()
  15336. if (keepAlive !== undefined) {
  15337. throw new InvalidArgumentError('unsupported keepAlive, use pipelining=0 instead')
  15338. }
  15339. if (socketTimeout !== undefined) {
  15340. throw new InvalidArgumentError('unsupported socketTimeout, use headersTimeout & bodyTimeout instead')
  15341. }
  15342. if (requestTimeout !== undefined) {
  15343. throw new InvalidArgumentError('unsupported requestTimeout, use headersTimeout & bodyTimeout instead')
  15344. }
  15345. if (idleTimeout !== undefined) {
  15346. throw new InvalidArgumentError('unsupported idleTimeout, use keepAliveTimeout instead')
  15347. }
  15348. if (maxKeepAliveTimeout !== undefined) {
  15349. throw new InvalidArgumentError('unsupported maxKeepAliveTimeout, use keepAliveMaxTimeout instead')
  15350. }
  15351. if (maxHeaderSize != null && !Number.isFinite(maxHeaderSize)) {
  15352. throw new InvalidArgumentError('invalid maxHeaderSize')
  15353. }
  15354. if (socketPath != null && typeof socketPath !== 'string') {
  15355. throw new InvalidArgumentError('invalid socketPath')
  15356. }
  15357. if (connectTimeout != null && (!Number.isFinite(connectTimeout) || connectTimeout < 0)) {
  15358. throw new InvalidArgumentError('invalid connectTimeout')
  15359. }
  15360. if (keepAliveTimeout != null && (!Number.isFinite(keepAliveTimeout) || keepAliveTimeout <= 0)) {
  15361. throw new InvalidArgumentError('invalid keepAliveTimeout')
  15362. }
  15363. if (keepAliveMaxTimeout != null && (!Number.isFinite(keepAliveMaxTimeout) || keepAliveMaxTimeout <= 0)) {
  15364. throw new InvalidArgumentError('invalid keepAliveMaxTimeout')
  15365. }
  15366. if (keepAliveTimeoutThreshold != null && !Number.isFinite(keepAliveTimeoutThreshold)) {
  15367. throw new InvalidArgumentError('invalid keepAliveTimeoutThreshold')
  15368. }
  15369. if (headersTimeout != null && (!Number.isInteger(headersTimeout) || headersTimeout < 0)) {
  15370. throw new InvalidArgumentError('headersTimeout must be a positive integer or zero')
  15371. }
  15372. if (bodyTimeout != null && (!Number.isInteger(bodyTimeout) || bodyTimeout < 0)) {
  15373. throw new InvalidArgumentError('bodyTimeout must be a positive integer or zero')
  15374. }
  15375. if (connect != null && typeof connect !== 'function' && typeof connect !== 'object') {
  15376. throw new InvalidArgumentError('connect must be a function or an object')
  15377. }
  15378. if (maxRedirections != null && (!Number.isInteger(maxRedirections) || maxRedirections < 0)) {
  15379. throw new InvalidArgumentError('maxRedirections must be a positive number')
  15380. }
  15381. if (maxRequestsPerClient != null && (!Number.isInteger(maxRequestsPerClient) || maxRequestsPerClient < 0)) {
  15382. throw new InvalidArgumentError('maxRequestsPerClient must be a positive number')
  15383. }
  15384. if (localAddress != null && (typeof localAddress !== 'string' || net.isIP(localAddress) === 0)) {
  15385. throw new InvalidArgumentError('localAddress must be valid string IP address')
  15386. }
  15387. if (maxResponseSize != null && (!Number.isInteger(maxResponseSize) || maxResponseSize < -1)) {
  15388. throw new InvalidArgumentError('maxResponseSize must be a positive number')
  15389. }
  15390. if (
  15391. autoSelectFamilyAttemptTimeout != null &&
  15392. (!Number.isInteger(autoSelectFamilyAttemptTimeout) || autoSelectFamilyAttemptTimeout < -1)
  15393. ) {
  15394. throw new InvalidArgumentError('autoSelectFamilyAttemptTimeout must be a positive number')
  15395. }
  15396. // h2
  15397. if (allowH2 != null && typeof allowH2 !== 'boolean') {
  15398. throw new InvalidArgumentError('allowH2 must be a valid boolean value')
  15399. }
  15400. if (maxConcurrentStreams != null && (typeof maxConcurrentStreams !== 'number' || maxConcurrentStreams < 1)) {
  15401. throw new InvalidArgumentError('maxConcurrentStreams must be a possitive integer, greater than 0')
  15402. }
  15403. if (typeof connect !== 'function') {
  15404. connect = buildConnector({
  15405. ...tls,
  15406. maxCachedSessions,
  15407. allowH2,
  15408. socketPath,
  15409. timeout: connectTimeout,
  15410. ...(util.nodeHasAutoSelectFamily && autoSelectFamily ? { autoSelectFamily, autoSelectFamilyAttemptTimeout } : undefined),
  15411. ...connect
  15412. })
  15413. }
  15414. this[kInterceptors] = interceptors && interceptors.Client && Array.isArray(interceptors.Client)
  15415. ? interceptors.Client
  15416. : [createRedirectInterceptor({ maxRedirections })]
  15417. this[kUrl] = util.parseOrigin(url)
  15418. this[kConnector] = connect
  15419. this[kSocket] = null
  15420. this[kPipelining] = pipelining != null ? pipelining : 1
  15421. this[kMaxHeadersSize] = maxHeaderSize || http.maxHeaderSize
  15422. this[kKeepAliveDefaultTimeout] = keepAliveTimeout == null ? 4e3 : keepAliveTimeout
  15423. this[kKeepAliveMaxTimeout] = keepAliveMaxTimeout == null ? 600e3 : keepAliveMaxTimeout
  15424. this[kKeepAliveTimeoutThreshold] = keepAliveTimeoutThreshold == null ? 1e3 : keepAliveTimeoutThreshold
  15425. this[kKeepAliveTimeoutValue] = this[kKeepAliveDefaultTimeout]
  15426. this[kServerName] = null
  15427. this[kLocalAddress] = localAddress != null ? localAddress : null
  15428. this[kResuming] = 0 // 0, idle, 1, scheduled, 2 resuming
  15429. this[kNeedDrain] = 0 // 0, idle, 1, scheduled, 2 resuming
  15430. this[kHostHeader] = `host: ${this[kUrl].hostname}${this[kUrl].port ? `:${this[kUrl].port}` : ''}\r\n`
  15431. this[kBodyTimeout] = bodyTimeout != null ? bodyTimeout : 300e3
  15432. this[kHeadersTimeout] = headersTimeout != null ? headersTimeout : 300e3
  15433. this[kStrictContentLength] = strictContentLength == null ? true : strictContentLength
  15434. this[kMaxRedirections] = maxRedirections
  15435. this[kMaxRequests] = maxRequestsPerClient
  15436. this[kClosedResolve] = null
  15437. this[kMaxResponseSize] = maxResponseSize > -1 ? maxResponseSize : -1
  15438. this[kHTTPConnVersion] = 'h1'
  15439. // HTTP/2
  15440. this[kHTTP2Session] = null
  15441. this[kHTTP2SessionState] = !allowH2
  15442. ? null
  15443. : {
  15444. // streams: null, // Fixed queue of streams - For future support of `push`
  15445. openStreams: 0, // Keep track of them to decide wether or not unref the session
  15446. maxConcurrentStreams: maxConcurrentStreams != null ? maxConcurrentStreams : 100 // Max peerConcurrentStreams for a Node h2 server
  15447. }
  15448. this[kHost] = `${this[kUrl].hostname}${this[kUrl].port ? `:${this[kUrl].port}` : ''}`
  15449. // kQueue is built up of 3 sections separated by
  15450. // the kRunningIdx and kPendingIdx indices.
  15451. // | complete | running | pending |
  15452. // ^ kRunningIdx ^ kPendingIdx ^ kQueue.length
  15453. // kRunningIdx points to the first running element.
  15454. // kPendingIdx points to the first pending element.
  15455. // This implements a fast queue with an amortized
  15456. // time of O(1).
  15457. this[kQueue] = []
  15458. this[kRunningIdx] = 0
  15459. this[kPendingIdx] = 0
  15460. }
  15461. get pipelining () {
  15462. return this[kPipelining]
  15463. }
  15464. set pipelining (value) {
  15465. this[kPipelining] = value
  15466. resume(this, true)
  15467. }
  15468. get [kPending] () {
  15469. return this[kQueue].length - this[kPendingIdx]
  15470. }
  15471. get [kRunning] () {
  15472. return this[kPendingIdx] - this[kRunningIdx]
  15473. }
  15474. get [kSize] () {
  15475. return this[kQueue].length - this[kRunningIdx]
  15476. }
  15477. get [kConnected] () {
  15478. return !!this[kSocket] && !this[kConnecting] && !this[kSocket].destroyed
  15479. }
  15480. get [kBusy] () {
  15481. const socket = this[kSocket]
  15482. return (
  15483. (socket && (socket[kReset] || socket[kWriting] || socket[kBlocking])) ||
  15484. (this[kSize] >= (this[kPipelining] || 1)) ||
  15485. this[kPending] > 0
  15486. )
  15487. }
  15488. /* istanbul ignore: only used for test */
  15489. [kConnect] (cb) {
  15490. connect(this)
  15491. this.once('connect', cb)
  15492. }
  15493. [kDispatch] (opts, handler) {
  15494. const origin = opts.origin || this[kUrl].origin
  15495. const request = this[kHTTPConnVersion] === 'h2'
  15496. ? Request[kHTTP2BuildRequest](origin, opts, handler)
  15497. : Request[kHTTP1BuildRequest](origin, opts, handler)
  15498. this[kQueue].push(request)
  15499. if (this[kResuming]) {
  15500. // Do nothing.
  15501. } else if (util.bodyLength(request.body) == null && util.isIterable(request.body)) {
  15502. // Wait a tick in case stream/iterator is ended in the same tick.
  15503. this[kResuming] = 1
  15504. process.nextTick(resume, this)
  15505. } else {
  15506. resume(this, true)
  15507. }
  15508. if (this[kResuming] && this[kNeedDrain] !== 2 && this[kBusy]) {
  15509. this[kNeedDrain] = 2
  15510. }
  15511. return this[kNeedDrain] < 2
  15512. }
  15513. async [kClose] () {
  15514. // TODO: for H2 we need to gracefully flush the remaining enqueued
  15515. // request and close each stream.
  15516. return new Promise((resolve) => {
  15517. if (!this[kSize]) {
  15518. resolve(null)
  15519. } else {
  15520. this[kClosedResolve] = resolve
  15521. }
  15522. })
  15523. }
  15524. async [kDestroy] (err) {
  15525. return new Promise((resolve) => {
  15526. const requests = this[kQueue].splice(this[kPendingIdx])
  15527. for (let i = 0; i < requests.length; i++) {
  15528. const request = requests[i]
  15529. errorRequest(this, request, err)
  15530. }
  15531. const callback = () => {
  15532. if (this[kClosedResolve]) {
  15533. // TODO (fix): Should we error here with ClientDestroyedError?
  15534. this[kClosedResolve]()
  15535. this[kClosedResolve] = null
  15536. }
  15537. resolve()
  15538. }
  15539. if (this[kHTTP2Session] != null) {
  15540. util.destroy(this[kHTTP2Session], err)
  15541. this[kHTTP2Session] = null
  15542. this[kHTTP2SessionState] = null
  15543. }
  15544. if (!this[kSocket]) {
  15545. queueMicrotask(callback)
  15546. } else {
  15547. util.destroy(this[kSocket].on('close', callback), err)
  15548. }
  15549. resume(this)
  15550. })
  15551. }
  15552. }
  15553. function onHttp2SessionError (err) {
  15554. assert(err.code !== 'ERR_TLS_CERT_ALTNAME_INVALID')
  15555. this[kSocket][kError] = err
  15556. onError(this[kClient], err)
  15557. }
  15558. function onHttp2FrameError (type, code, id) {
  15559. const err = new InformationalError(`HTTP/2: "frameError" received - type ${type}, code ${code}`)
  15560. if (id === 0) {
  15561. this[kSocket][kError] = err
  15562. onError(this[kClient], err)
  15563. }
  15564. }
  15565. function onHttp2SessionEnd () {
  15566. util.destroy(this, new SocketError('other side closed'))
  15567. util.destroy(this[kSocket], new SocketError('other side closed'))
  15568. }
  15569. function onHTTP2GoAway (code) {
  15570. const client = this[kClient]
  15571. const err = new InformationalError(`HTTP/2: "GOAWAY" frame received with code ${code}`)
  15572. client[kSocket] = null
  15573. client[kHTTP2Session] = null
  15574. if (client.destroyed) {
  15575. assert(this[kPending] === 0)
  15576. // Fail entire queue.
  15577. const requests = client[kQueue].splice(client[kRunningIdx])
  15578. for (let i = 0; i < requests.length; i++) {
  15579. const request = requests[i]
  15580. errorRequest(this, request, err)
  15581. }
  15582. } else if (client[kRunning] > 0) {
  15583. // Fail head of pipeline.
  15584. const request = client[kQueue][client[kRunningIdx]]
  15585. client[kQueue][client[kRunningIdx]++] = null
  15586. errorRequest(client, request, err)
  15587. }
  15588. client[kPendingIdx] = client[kRunningIdx]
  15589. assert(client[kRunning] === 0)
  15590. client.emit('disconnect',
  15591. client[kUrl],
  15592. [client],
  15593. err
  15594. )
  15595. resume(client)
  15596. }
  15597. const constants = __nccwpck_require__(953)
  15598. const createRedirectInterceptor = __nccwpck_require__(8861)
  15599. const EMPTY_BUF = Buffer.alloc(0)
  15600. async function lazyllhttp () {
  15601. const llhttpWasmData = process.env.JEST_WORKER_ID ? __nccwpck_require__(1145) : undefined
  15602. let mod
  15603. try {
  15604. mod = await WebAssembly.compile(Buffer.from(__nccwpck_require__(5627), 'base64'))
  15605. } catch (e) {
  15606. /* istanbul ignore next */
  15607. // We could check if the error was caused by the simd option not
  15608. // being enabled, but the occurring of this other error
  15609. // * https://github.com/emscripten-core/emscripten/issues/11495
  15610. // got me to remove that check to avoid breaking Node 12.
  15611. mod = await WebAssembly.compile(Buffer.from(llhttpWasmData || __nccwpck_require__(1145), 'base64'))
  15612. }
  15613. return await WebAssembly.instantiate(mod, {
  15614. env: {
  15615. /* eslint-disable camelcase */
  15616. wasm_on_url: (p, at, len) => {
  15617. /* istanbul ignore next */
  15618. return 0
  15619. },
  15620. wasm_on_status: (p, at, len) => {
  15621. assert.strictEqual(currentParser.ptr, p)
  15622. const start = at - currentBufferPtr + currentBufferRef.byteOffset
  15623. return currentParser.onStatus(new FastBuffer(currentBufferRef.buffer, start, len)) || 0
  15624. },
  15625. wasm_on_message_begin: (p) => {
  15626. assert.strictEqual(currentParser.ptr, p)
  15627. return currentParser.onMessageBegin() || 0
  15628. },
  15629. wasm_on_header_field: (p, at, len) => {
  15630. assert.strictEqual(currentParser.ptr, p)
  15631. const start = at - currentBufferPtr + currentBufferRef.byteOffset
  15632. return currentParser.onHeaderField(new FastBuffer(currentBufferRef.buffer, start, len)) || 0
  15633. },
  15634. wasm_on_header_value: (p, at, len) => {
  15635. assert.strictEqual(currentParser.ptr, p)
  15636. const start = at - currentBufferPtr + currentBufferRef.byteOffset
  15637. return currentParser.onHeaderValue(new FastBuffer(currentBufferRef.buffer, start, len)) || 0
  15638. },
  15639. wasm_on_headers_complete: (p, statusCode, upgrade, shouldKeepAlive) => {
  15640. assert.strictEqual(currentParser.ptr, p)
  15641. return currentParser.onHeadersComplete(statusCode, Boolean(upgrade), Boolean(shouldKeepAlive)) || 0
  15642. },
  15643. wasm_on_body: (p, at, len) => {
  15644. assert.strictEqual(currentParser.ptr, p)
  15645. const start = at - currentBufferPtr + currentBufferRef.byteOffset
  15646. return currentParser.onBody(new FastBuffer(currentBufferRef.buffer, start, len)) || 0
  15647. },
  15648. wasm_on_message_complete: (p) => {
  15649. assert.strictEqual(currentParser.ptr, p)
  15650. return currentParser.onMessageComplete() || 0
  15651. }
  15652. /* eslint-enable camelcase */
  15653. }
  15654. })
  15655. }
  15656. let llhttpInstance = null
  15657. let llhttpPromise = lazyllhttp()
  15658. llhttpPromise.catch()
  15659. let currentParser = null
  15660. let currentBufferRef = null
  15661. let currentBufferSize = 0
  15662. let currentBufferPtr = null
  15663. const TIMEOUT_HEADERS = 1
  15664. const TIMEOUT_BODY = 2
  15665. const TIMEOUT_IDLE = 3
  15666. class Parser {
  15667. constructor (client, socket, { exports }) {
  15668. assert(Number.isFinite(client[kMaxHeadersSize]) && client[kMaxHeadersSize] > 0)
  15669. this.llhttp = exports
  15670. this.ptr = this.llhttp.llhttp_alloc(constants.TYPE.RESPONSE)
  15671. this.client = client
  15672. this.socket = socket
  15673. this.timeout = null
  15674. this.timeoutValue = null
  15675. this.timeoutType = null
  15676. this.statusCode = null
  15677. this.statusText = ''
  15678. this.upgrade = false
  15679. this.headers = []
  15680. this.headersSize = 0
  15681. this.headersMaxSize = client[kMaxHeadersSize]
  15682. this.shouldKeepAlive = false
  15683. this.paused = false
  15684. this.resume = this.resume.bind(this)
  15685. this.bytesRead = 0
  15686. this.keepAlive = ''
  15687. this.contentLength = ''
  15688. this.connection = ''
  15689. this.maxResponseSize = client[kMaxResponseSize]
  15690. }
  15691. setTimeout (value, type) {
  15692. this.timeoutType = type
  15693. if (value !== this.timeoutValue) {
  15694. timers.clearTimeout(this.timeout)
  15695. if (value) {
  15696. this.timeout = timers.setTimeout(onParserTimeout, value, this)
  15697. // istanbul ignore else: only for jest
  15698. if (this.timeout.unref) {
  15699. this.timeout.unref()
  15700. }
  15701. } else {
  15702. this.timeout = null
  15703. }
  15704. this.timeoutValue = value
  15705. } else if (this.timeout) {
  15706. // istanbul ignore else: only for jest
  15707. if (this.timeout.refresh) {
  15708. this.timeout.refresh()
  15709. }
  15710. }
  15711. }
  15712. resume () {
  15713. if (this.socket.destroyed || !this.paused) {
  15714. return
  15715. }
  15716. assert(this.ptr != null)
  15717. assert(currentParser == null)
  15718. this.llhttp.llhttp_resume(this.ptr)
  15719. assert(this.timeoutType === TIMEOUT_BODY)
  15720. if (this.timeout) {
  15721. // istanbul ignore else: only for jest
  15722. if (this.timeout.refresh) {
  15723. this.timeout.refresh()
  15724. }
  15725. }
  15726. this.paused = false
  15727. this.execute(this.socket.read() || EMPTY_BUF) // Flush parser.
  15728. this.readMore()
  15729. }
  15730. readMore () {
  15731. while (!this.paused && this.ptr) {
  15732. const chunk = this.socket.read()
  15733. if (chunk === null) {
  15734. break
  15735. }
  15736. this.execute(chunk)
  15737. }
  15738. }
  15739. execute (data) {
  15740. assert(this.ptr != null)
  15741. assert(currentParser == null)
  15742. assert(!this.paused)
  15743. const { socket, llhttp } = this
  15744. if (data.length > currentBufferSize) {
  15745. if (currentBufferPtr) {
  15746. llhttp.free(currentBufferPtr)
  15747. }
  15748. currentBufferSize = Math.ceil(data.length / 4096) * 4096
  15749. currentBufferPtr = llhttp.malloc(currentBufferSize)
  15750. }
  15751. new Uint8Array(llhttp.memory.buffer, currentBufferPtr, currentBufferSize).set(data)
  15752. // Call `execute` on the wasm parser.
  15753. // We pass the `llhttp_parser` pointer address, the pointer address of buffer view data,
  15754. // and finally the length of bytes to parse.
  15755. // The return value is an error code or `constants.ERROR.OK`.
  15756. try {
  15757. let ret
  15758. try {
  15759. currentBufferRef = data
  15760. currentParser = this
  15761. ret = llhttp.llhttp_execute(this.ptr, currentBufferPtr, data.length)
  15762. /* eslint-disable-next-line no-useless-catch */
  15763. } catch (err) {
  15764. /* istanbul ignore next: difficult to make a test case for */
  15765. throw err
  15766. } finally {
  15767. currentParser = null
  15768. currentBufferRef = null
  15769. }
  15770. const offset = llhttp.llhttp_get_error_pos(this.ptr) - currentBufferPtr
  15771. if (ret === constants.ERROR.PAUSED_UPGRADE) {
  15772. this.onUpgrade(data.slice(offset))
  15773. } else if (ret === constants.ERROR.PAUSED) {
  15774. this.paused = true
  15775. socket.unshift(data.slice(offset))
  15776. } else if (ret !== constants.ERROR.OK) {
  15777. const ptr = llhttp.llhttp_get_error_reason(this.ptr)
  15778. let message = ''
  15779. /* istanbul ignore else: difficult to make a test case for */
  15780. if (ptr) {
  15781. const len = new Uint8Array(llhttp.memory.buffer, ptr).indexOf(0)
  15782. message =
  15783. 'Response does not match the HTTP/1.1 protocol (' +
  15784. Buffer.from(llhttp.memory.buffer, ptr, len).toString() +
  15785. ')'
  15786. }
  15787. throw new HTTPParserError(message, constants.ERROR[ret], data.slice(offset))
  15788. }
  15789. } catch (err) {
  15790. util.destroy(socket, err)
  15791. }
  15792. }
  15793. destroy () {
  15794. assert(this.ptr != null)
  15795. assert(currentParser == null)
  15796. this.llhttp.llhttp_free(this.ptr)
  15797. this.ptr = null
  15798. timers.clearTimeout(this.timeout)
  15799. this.timeout = null
  15800. this.timeoutValue = null
  15801. this.timeoutType = null
  15802. this.paused = false
  15803. }
  15804. onStatus (buf) {
  15805. this.statusText = buf.toString()
  15806. }
  15807. onMessageBegin () {
  15808. const { socket, client } = this
  15809. /* istanbul ignore next: difficult to make a test case for */
  15810. if (socket.destroyed) {
  15811. return -1
  15812. }
  15813. const request = client[kQueue][client[kRunningIdx]]
  15814. if (!request) {
  15815. return -1
  15816. }
  15817. }
  15818. onHeaderField (buf) {
  15819. const len = this.headers.length
  15820. if ((len & 1) === 0) {
  15821. this.headers.push(buf)
  15822. } else {
  15823. this.headers[len - 1] = Buffer.concat([this.headers[len - 1], buf])
  15824. }
  15825. this.trackHeader(buf.length)
  15826. }
  15827. onHeaderValue (buf) {
  15828. let len = this.headers.length
  15829. if ((len & 1) === 1) {
  15830. this.headers.push(buf)
  15831. len += 1
  15832. } else {
  15833. this.headers[len - 1] = Buffer.concat([this.headers[len - 1], buf])
  15834. }
  15835. const key = this.headers[len - 2]
  15836. if (key.length === 10 && key.toString().toLowerCase() === 'keep-alive') {
  15837. this.keepAlive += buf.toString()
  15838. } else if (key.length === 10 && key.toString().toLowerCase() === 'connection') {
  15839. this.connection += buf.toString()
  15840. } else if (key.length === 14 && key.toString().toLowerCase() === 'content-length') {
  15841. this.contentLength += buf.toString()
  15842. }
  15843. this.trackHeader(buf.length)
  15844. }
  15845. trackHeader (len) {
  15846. this.headersSize += len
  15847. if (this.headersSize >= this.headersMaxSize) {
  15848. util.destroy(this.socket, new HeadersOverflowError())
  15849. }
  15850. }
  15851. onUpgrade (head) {
  15852. const { upgrade, client, socket, headers, statusCode } = this
  15853. assert(upgrade)
  15854. const request = client[kQueue][client[kRunningIdx]]
  15855. assert(request)
  15856. assert(!socket.destroyed)
  15857. assert(socket === client[kSocket])
  15858. assert(!this.paused)
  15859. assert(request.upgrade || request.method === 'CONNECT')
  15860. this.statusCode = null
  15861. this.statusText = ''
  15862. this.shouldKeepAlive = null
  15863. assert(this.headers.length % 2 === 0)
  15864. this.headers = []
  15865. this.headersSize = 0
  15866. socket.unshift(head)
  15867. socket[kParser].destroy()
  15868. socket[kParser] = null
  15869. socket[kClient] = null
  15870. socket[kError] = null
  15871. socket
  15872. .removeListener('error', onSocketError)
  15873. .removeListener('readable', onSocketReadable)
  15874. .removeListener('end', onSocketEnd)
  15875. .removeListener('close', onSocketClose)
  15876. client[kSocket] = null
  15877. client[kQueue][client[kRunningIdx]++] = null
  15878. client.emit('disconnect', client[kUrl], [client], new InformationalError('upgrade'))
  15879. try {
  15880. request.onUpgrade(statusCode, headers, socket)
  15881. } catch (err) {
  15882. util.destroy(socket, err)
  15883. }
  15884. resume(client)
  15885. }
  15886. onHeadersComplete (statusCode, upgrade, shouldKeepAlive) {
  15887. const { client, socket, headers, statusText } = this
  15888. /* istanbul ignore next: difficult to make a test case for */
  15889. if (socket.destroyed) {
  15890. return -1
  15891. }
  15892. const request = client[kQueue][client[kRunningIdx]]
  15893. /* istanbul ignore next: difficult to make a test case for */
  15894. if (!request) {
  15895. return -1
  15896. }
  15897. assert(!this.upgrade)
  15898. assert(this.statusCode < 200)
  15899. if (statusCode === 100) {
  15900. util.destroy(socket, new SocketError('bad response', util.getSocketInfo(socket)))
  15901. return -1
  15902. }
  15903. /* this can only happen if server is misbehaving */
  15904. if (upgrade && !request.upgrade) {
  15905. util.destroy(socket, new SocketError('bad upgrade', util.getSocketInfo(socket)))
  15906. return -1
  15907. }
  15908. assert.strictEqual(this.timeoutType, TIMEOUT_HEADERS)
  15909. this.statusCode = statusCode
  15910. this.shouldKeepAlive = (
  15911. shouldKeepAlive ||
  15912. // Override llhttp value which does not allow keepAlive for HEAD.
  15913. (request.method === 'HEAD' && !socket[kReset] && this.connection.toLowerCase() === 'keep-alive')
  15914. )
  15915. if (this.statusCode >= 200) {
  15916. const bodyTimeout = request.bodyTimeout != null
  15917. ? request.bodyTimeout
  15918. : client[kBodyTimeout]
  15919. this.setTimeout(bodyTimeout, TIMEOUT_BODY)
  15920. } else if (this.timeout) {
  15921. // istanbul ignore else: only for jest
  15922. if (this.timeout.refresh) {
  15923. this.timeout.refresh()
  15924. }
  15925. }
  15926. if (request.method === 'CONNECT') {
  15927. assert(client[kRunning] === 1)
  15928. this.upgrade = true
  15929. return 2
  15930. }
  15931. if (upgrade) {
  15932. assert(client[kRunning] === 1)
  15933. this.upgrade = true
  15934. return 2
  15935. }
  15936. assert(this.headers.length % 2 === 0)
  15937. this.headers = []
  15938. this.headersSize = 0
  15939. if (this.shouldKeepAlive && client[kPipelining]) {
  15940. const keepAliveTimeout = this.keepAlive ? util.parseKeepAliveTimeout(this.keepAlive) : null
  15941. if (keepAliveTimeout != null) {
  15942. const timeout = Math.min(
  15943. keepAliveTimeout - client[kKeepAliveTimeoutThreshold],
  15944. client[kKeepAliveMaxTimeout]
  15945. )
  15946. if (timeout <= 0) {
  15947. socket[kReset] = true
  15948. } else {
  15949. client[kKeepAliveTimeoutValue] = timeout
  15950. }
  15951. } else {
  15952. client[kKeepAliveTimeoutValue] = client[kKeepAliveDefaultTimeout]
  15953. }
  15954. } else {
  15955. // Stop more requests from being dispatched.
  15956. socket[kReset] = true
  15957. }
  15958. const pause = request.onHeaders(statusCode, headers, this.resume, statusText) === false
  15959. if (request.aborted) {
  15960. return -1
  15961. }
  15962. if (request.method === 'HEAD') {
  15963. return 1
  15964. }
  15965. if (statusCode < 200) {
  15966. return 1
  15967. }
  15968. if (socket[kBlocking]) {
  15969. socket[kBlocking] = false
  15970. resume(client)
  15971. }
  15972. return pause ? constants.ERROR.PAUSED : 0
  15973. }
  15974. onBody (buf) {
  15975. const { client, socket, statusCode, maxResponseSize } = this
  15976. if (socket.destroyed) {
  15977. return -1
  15978. }
  15979. const request = client[kQueue][client[kRunningIdx]]
  15980. assert(request)
  15981. assert.strictEqual(this.timeoutType, TIMEOUT_BODY)
  15982. if (this.timeout) {
  15983. // istanbul ignore else: only for jest
  15984. if (this.timeout.refresh) {
  15985. this.timeout.refresh()
  15986. }
  15987. }
  15988. assert(statusCode >= 200)
  15989. if (maxResponseSize > -1 && this.bytesRead + buf.length > maxResponseSize) {
  15990. util.destroy(socket, new ResponseExceededMaxSizeError())
  15991. return -1
  15992. }
  15993. this.bytesRead += buf.length
  15994. if (request.onData(buf) === false) {
  15995. return constants.ERROR.PAUSED
  15996. }
  15997. }
  15998. onMessageComplete () {
  15999. const { client, socket, statusCode, upgrade, headers, contentLength, bytesRead, shouldKeepAlive } = this
  16000. if (socket.destroyed && (!statusCode || shouldKeepAlive)) {
  16001. return -1
  16002. }
  16003. if (upgrade) {
  16004. return
  16005. }
  16006. const request = client[kQueue][client[kRunningIdx]]
  16007. assert(request)
  16008. assert(statusCode >= 100)
  16009. this.statusCode = null
  16010. this.statusText = ''
  16011. this.bytesRead = 0
  16012. this.contentLength = ''
  16013. this.keepAlive = ''
  16014. this.connection = ''
  16015. assert(this.headers.length % 2 === 0)
  16016. this.headers = []
  16017. this.headersSize = 0
  16018. if (statusCode < 200) {
  16019. return
  16020. }
  16021. /* istanbul ignore next: should be handled by llhttp? */
  16022. if (request.method !== 'HEAD' && contentLength && bytesRead !== parseInt(contentLength, 10)) {
  16023. util.destroy(socket, new ResponseContentLengthMismatchError())
  16024. return -1
  16025. }
  16026. request.onComplete(headers)
  16027. client[kQueue][client[kRunningIdx]++] = null
  16028. if (socket[kWriting]) {
  16029. assert.strictEqual(client[kRunning], 0)
  16030. // Response completed before request.
  16031. util.destroy(socket, new InformationalError('reset'))
  16032. return constants.ERROR.PAUSED
  16033. } else if (!shouldKeepAlive) {
  16034. util.destroy(socket, new InformationalError('reset'))
  16035. return constants.ERROR.PAUSED
  16036. } else if (socket[kReset] && client[kRunning] === 0) {
  16037. // Destroy socket once all requests have completed.
  16038. // The request at the tail of the pipeline is the one
  16039. // that requested reset and no further requests should
  16040. // have been queued since then.
  16041. util.destroy(socket, new InformationalError('reset'))
  16042. return constants.ERROR.PAUSED
  16043. } else if (client[kPipelining] === 1) {
  16044. // We must wait a full event loop cycle to reuse this socket to make sure
  16045. // that non-spec compliant servers are not closing the connection even if they
  16046. // said they won't.
  16047. setImmediate(resume, client)
  16048. } else {
  16049. resume(client)
  16050. }
  16051. }
  16052. }
  16053. function onParserTimeout (parser) {
  16054. const { socket, timeoutType, client } = parser
  16055. /* istanbul ignore else */
  16056. if (timeoutType === TIMEOUT_HEADERS) {
  16057. if (!socket[kWriting] || socket.writableNeedDrain || client[kRunning] > 1) {
  16058. assert(!parser.paused, 'cannot be paused while waiting for headers')
  16059. util.destroy(socket, new HeadersTimeoutError())
  16060. }
  16061. } else if (timeoutType === TIMEOUT_BODY) {
  16062. if (!parser.paused) {
  16063. util.destroy(socket, new BodyTimeoutError())
  16064. }
  16065. } else if (timeoutType === TIMEOUT_IDLE) {
  16066. assert(client[kRunning] === 0 && client[kKeepAliveTimeoutValue])
  16067. util.destroy(socket, new InformationalError('socket idle timeout'))
  16068. }
  16069. }
  16070. function onSocketReadable () {
  16071. const { [kParser]: parser } = this
  16072. if (parser) {
  16073. parser.readMore()
  16074. }
  16075. }
  16076. function onSocketError (err) {
  16077. const { [kClient]: client, [kParser]: parser } = this
  16078. assert(err.code !== 'ERR_TLS_CERT_ALTNAME_INVALID')
  16079. if (client[kHTTPConnVersion] !== 'h2') {
  16080. // On Mac OS, we get an ECONNRESET even if there is a full body to be forwarded
  16081. // to the user.
  16082. if (err.code === 'ECONNRESET' && parser.statusCode && !parser.shouldKeepAlive) {
  16083. // We treat all incoming data so for as a valid response.
  16084. parser.onMessageComplete()
  16085. return
  16086. }
  16087. }
  16088. this[kError] = err
  16089. onError(this[kClient], err)
  16090. }
  16091. function onError (client, err) {
  16092. if (
  16093. client[kRunning] === 0 &&
  16094. err.code !== 'UND_ERR_INFO' &&
  16095. err.code !== 'UND_ERR_SOCKET'
  16096. ) {
  16097. // Error is not caused by running request and not a recoverable
  16098. // socket error.
  16099. assert(client[kPendingIdx] === client[kRunningIdx])
  16100. const requests = client[kQueue].splice(client[kRunningIdx])
  16101. for (let i = 0; i < requests.length; i++) {
  16102. const request = requests[i]
  16103. errorRequest(client, request, err)
  16104. }
  16105. assert(client[kSize] === 0)
  16106. }
  16107. }
  16108. function onSocketEnd () {
  16109. const { [kParser]: parser, [kClient]: client } = this
  16110. if (client[kHTTPConnVersion] !== 'h2') {
  16111. if (parser.statusCode && !parser.shouldKeepAlive) {
  16112. // We treat all incoming data so far as a valid response.
  16113. parser.onMessageComplete()
  16114. return
  16115. }
  16116. }
  16117. util.destroy(this, new SocketError('other side closed', util.getSocketInfo(this)))
  16118. }
  16119. function onSocketClose () {
  16120. const { [kClient]: client, [kParser]: parser } = this
  16121. if (client[kHTTPConnVersion] === 'h1' && parser) {
  16122. if (!this[kError] && parser.statusCode && !parser.shouldKeepAlive) {
  16123. // We treat all incoming data so far as a valid response.
  16124. parser.onMessageComplete()
  16125. }
  16126. this[kParser].destroy()
  16127. this[kParser] = null
  16128. }
  16129. const err = this[kError] || new SocketError('closed', util.getSocketInfo(this))
  16130. client[kSocket] = null
  16131. if (client.destroyed) {
  16132. assert(client[kPending] === 0)
  16133. // Fail entire queue.
  16134. const requests = client[kQueue].splice(client[kRunningIdx])
  16135. for (let i = 0; i < requests.length; i++) {
  16136. const request = requests[i]
  16137. errorRequest(client, request, err)
  16138. }
  16139. } else if (client[kRunning] > 0 && err.code !== 'UND_ERR_INFO') {
  16140. // Fail head of pipeline.
  16141. const request = client[kQueue][client[kRunningIdx]]
  16142. client[kQueue][client[kRunningIdx]++] = null
  16143. errorRequest(client, request, err)
  16144. }
  16145. client[kPendingIdx] = client[kRunningIdx]
  16146. assert(client[kRunning] === 0)
  16147. client.emit('disconnect', client[kUrl], [client], err)
  16148. resume(client)
  16149. }
  16150. async function connect (client) {
  16151. assert(!client[kConnecting])
  16152. assert(!client[kSocket])
  16153. let { host, hostname, protocol, port } = client[kUrl]
  16154. // Resolve ipv6
  16155. if (hostname[0] === '[') {
  16156. const idx = hostname.indexOf(']')
  16157. assert(idx !== -1)
  16158. const ip = hostname.substring(1, idx)
  16159. assert(net.isIP(ip))
  16160. hostname = ip
  16161. }
  16162. client[kConnecting] = true
  16163. if (channels.beforeConnect.hasSubscribers) {
  16164. channels.beforeConnect.publish({
  16165. connectParams: {
  16166. host,
  16167. hostname,
  16168. protocol,
  16169. port,
  16170. servername: client[kServerName],
  16171. localAddress: client[kLocalAddress]
  16172. },
  16173. connector: client[kConnector]
  16174. })
  16175. }
  16176. try {
  16177. const socket = await new Promise((resolve, reject) => {
  16178. client[kConnector]({
  16179. host,
  16180. hostname,
  16181. protocol,
  16182. port,
  16183. servername: client[kServerName],
  16184. localAddress: client[kLocalAddress]
  16185. }, (err, socket) => {
  16186. if (err) {
  16187. reject(err)
  16188. } else {
  16189. resolve(socket)
  16190. }
  16191. })
  16192. })
  16193. if (client.destroyed) {
  16194. util.destroy(socket.on('error', () => {}), new ClientDestroyedError())
  16195. return
  16196. }
  16197. client[kConnecting] = false
  16198. assert(socket)
  16199. const isH2 = socket.alpnProtocol === 'h2'
  16200. if (isH2) {
  16201. if (!h2ExperimentalWarned) {
  16202. h2ExperimentalWarned = true
  16203. process.emitWarning('H2 support is experimental, expect them to change at any time.', {
  16204. code: 'UNDICI-H2'
  16205. })
  16206. }
  16207. const session = http2.connect(client[kUrl], {
  16208. createConnection: () => socket,
  16209. peerMaxConcurrentStreams: client[kHTTP2SessionState].maxConcurrentStreams
  16210. })
  16211. client[kHTTPConnVersion] = 'h2'
  16212. session[kClient] = client
  16213. session[kSocket] = socket
  16214. session.on('error', onHttp2SessionError)
  16215. session.on('frameError', onHttp2FrameError)
  16216. session.on('end', onHttp2SessionEnd)
  16217. session.on('goaway', onHTTP2GoAway)
  16218. session.on('close', onSocketClose)
  16219. session.unref()
  16220. client[kHTTP2Session] = session
  16221. socket[kHTTP2Session] = session
  16222. } else {
  16223. if (!llhttpInstance) {
  16224. llhttpInstance = await llhttpPromise
  16225. llhttpPromise = null
  16226. }
  16227. socket[kNoRef] = false
  16228. socket[kWriting] = false
  16229. socket[kReset] = false
  16230. socket[kBlocking] = false
  16231. socket[kParser] = new Parser(client, socket, llhttpInstance)
  16232. }
  16233. socket[kCounter] = 0
  16234. socket[kMaxRequests] = client[kMaxRequests]
  16235. socket[kClient] = client
  16236. socket[kError] = null
  16237. socket
  16238. .on('error', onSocketError)
  16239. .on('readable', onSocketReadable)
  16240. .on('end', onSocketEnd)
  16241. .on('close', onSocketClose)
  16242. client[kSocket] = socket
  16243. if (channels.connected.hasSubscribers) {
  16244. channels.connected.publish({
  16245. connectParams: {
  16246. host,
  16247. hostname,
  16248. protocol,
  16249. port,
  16250. servername: client[kServerName],
  16251. localAddress: client[kLocalAddress]
  16252. },
  16253. connector: client[kConnector],
  16254. socket
  16255. })
  16256. }
  16257. client.emit('connect', client[kUrl], [client])
  16258. } catch (err) {
  16259. if (client.destroyed) {
  16260. return
  16261. }
  16262. client[kConnecting] = false
  16263. if (channels.connectError.hasSubscribers) {
  16264. channels.connectError.publish({
  16265. connectParams: {
  16266. host,
  16267. hostname,
  16268. protocol,
  16269. port,
  16270. servername: client[kServerName],
  16271. localAddress: client[kLocalAddress]
  16272. },
  16273. connector: client[kConnector],
  16274. error: err
  16275. })
  16276. }
  16277. if (err.code === 'ERR_TLS_CERT_ALTNAME_INVALID') {
  16278. assert(client[kRunning] === 0)
  16279. while (client[kPending] > 0 && client[kQueue][client[kPendingIdx]].servername === client[kServerName]) {
  16280. const request = client[kQueue][client[kPendingIdx]++]
  16281. errorRequest(client, request, err)
  16282. }
  16283. } else {
  16284. onError(client, err)
  16285. }
  16286. client.emit('connectionError', client[kUrl], [client], err)
  16287. }
  16288. resume(client)
  16289. }
  16290. function emitDrain (client) {
  16291. client[kNeedDrain] = 0
  16292. client.emit('drain', client[kUrl], [client])
  16293. }
  16294. function resume (client, sync) {
  16295. if (client[kResuming] === 2) {
  16296. return
  16297. }
  16298. client[kResuming] = 2
  16299. _resume(client, sync)
  16300. client[kResuming] = 0
  16301. if (client[kRunningIdx] > 256) {
  16302. client[kQueue].splice(0, client[kRunningIdx])
  16303. client[kPendingIdx] -= client[kRunningIdx]
  16304. client[kRunningIdx] = 0
  16305. }
  16306. }
  16307. function _resume (client, sync) {
  16308. while (true) {
  16309. if (client.destroyed) {
  16310. assert(client[kPending] === 0)
  16311. return
  16312. }
  16313. if (client[kClosedResolve] && !client[kSize]) {
  16314. client[kClosedResolve]()
  16315. client[kClosedResolve] = null
  16316. return
  16317. }
  16318. const socket = client[kSocket]
  16319. if (socket && !socket.destroyed && socket.alpnProtocol !== 'h2') {
  16320. if (client[kSize] === 0) {
  16321. if (!socket[kNoRef] && socket.unref) {
  16322. socket.unref()
  16323. socket[kNoRef] = true
  16324. }
  16325. } else if (socket[kNoRef] && socket.ref) {
  16326. socket.ref()
  16327. socket[kNoRef] = false
  16328. }
  16329. if (client[kSize] === 0) {
  16330. if (socket[kParser].timeoutType !== TIMEOUT_IDLE) {
  16331. socket[kParser].setTimeout(client[kKeepAliveTimeoutValue], TIMEOUT_IDLE)
  16332. }
  16333. } else if (client[kRunning] > 0 && socket[kParser].statusCode < 200) {
  16334. if (socket[kParser].timeoutType !== TIMEOUT_HEADERS) {
  16335. const request = client[kQueue][client[kRunningIdx]]
  16336. const headersTimeout = request.headersTimeout != null
  16337. ? request.headersTimeout
  16338. : client[kHeadersTimeout]
  16339. socket[kParser].setTimeout(headersTimeout, TIMEOUT_HEADERS)
  16340. }
  16341. }
  16342. }
  16343. if (client[kBusy]) {
  16344. client[kNeedDrain] = 2
  16345. } else if (client[kNeedDrain] === 2) {
  16346. if (sync) {
  16347. client[kNeedDrain] = 1
  16348. process.nextTick(emitDrain, client)
  16349. } else {
  16350. emitDrain(client)
  16351. }
  16352. continue
  16353. }
  16354. if (client[kPending] === 0) {
  16355. return
  16356. }
  16357. if (client[kRunning] >= (client[kPipelining] || 1)) {
  16358. return
  16359. }
  16360. const request = client[kQueue][client[kPendingIdx]]
  16361. if (client[kUrl].protocol === 'https:' && client[kServerName] !== request.servername) {
  16362. if (client[kRunning] > 0) {
  16363. return
  16364. }
  16365. client[kServerName] = request.servername
  16366. if (socket && socket.servername !== request.servername) {
  16367. util.destroy(socket, new InformationalError('servername changed'))
  16368. return
  16369. }
  16370. }
  16371. if (client[kConnecting]) {
  16372. return
  16373. }
  16374. if (!socket && !client[kHTTP2Session]) {
  16375. connect(client)
  16376. return
  16377. }
  16378. if (socket.destroyed || socket[kWriting] || socket[kReset] || socket[kBlocking]) {
  16379. return
  16380. }
  16381. if (client[kRunning] > 0 && !request.idempotent) {
  16382. // Non-idempotent request cannot be retried.
  16383. // Ensure that no other requests are inflight and
  16384. // could cause failure.
  16385. return
  16386. }
  16387. if (client[kRunning] > 0 && (request.upgrade || request.method === 'CONNECT')) {
  16388. // Don't dispatch an upgrade until all preceding requests have completed.
  16389. // A misbehaving server might upgrade the connection before all pipelined
  16390. // request has completed.
  16391. return
  16392. }
  16393. if (client[kRunning] > 0 && util.bodyLength(request.body) !== 0 &&
  16394. (util.isStream(request.body) || util.isAsyncIterable(request.body))) {
  16395. // Request with stream or iterator body can error while other requests
  16396. // are inflight and indirectly error those as well.
  16397. // Ensure this doesn't happen by waiting for inflight
  16398. // to complete before dispatching.
  16399. // Request with stream or iterator body cannot be retried.
  16400. // Ensure that no other requests are inflight and
  16401. // could cause failure.
  16402. return
  16403. }
  16404. if (!request.aborted && write(client, request)) {
  16405. client[kPendingIdx]++
  16406. } else {
  16407. client[kQueue].splice(client[kPendingIdx], 1)
  16408. }
  16409. }
  16410. }
  16411. // https://www.rfc-editor.org/rfc/rfc7230#section-3.3.2
  16412. function shouldSendContentLength (method) {
  16413. return method !== 'GET' && method !== 'HEAD' && method !== 'OPTIONS' && method !== 'TRACE' && method !== 'CONNECT'
  16414. }
  16415. function write (client, request) {
  16416. if (client[kHTTPConnVersion] === 'h2') {
  16417. writeH2(client, client[kHTTP2Session], request)
  16418. return
  16419. }
  16420. const { body, method, path, host, upgrade, headers, blocking, reset } = request
  16421. // https://tools.ietf.org/html/rfc7231#section-4.3.1
  16422. // https://tools.ietf.org/html/rfc7231#section-4.3.2
  16423. // https://tools.ietf.org/html/rfc7231#section-4.3.5
  16424. // Sending a payload body on a request that does not
  16425. // expect it can cause undefined behavior on some
  16426. // servers and corrupt connection state. Do not
  16427. // re-use the connection for further requests.
  16428. const expectsPayload = (
  16429. method === 'PUT' ||
  16430. method === 'POST' ||
  16431. method === 'PATCH'
  16432. )
  16433. if (body && typeof body.read === 'function') {
  16434. // Try to read EOF in order to get length.
  16435. body.read(0)
  16436. }
  16437. const bodyLength = util.bodyLength(body)
  16438. let contentLength = bodyLength
  16439. if (contentLength === null) {
  16440. contentLength = request.contentLength
  16441. }
  16442. if (contentLength === 0 && !expectsPayload) {
  16443. // https://tools.ietf.org/html/rfc7230#section-3.3.2
  16444. // A user agent SHOULD NOT send a Content-Length header field when
  16445. // the request message does not contain a payload body and the method
  16446. // semantics do not anticipate such a body.
  16447. contentLength = null
  16448. }
  16449. // https://github.com/nodejs/undici/issues/2046
  16450. // A user agent may send a Content-Length header with 0 value, this should be allowed.
  16451. if (shouldSendContentLength(method) && contentLength > 0 && request.contentLength !== null && request.contentLength !== contentLength) {
  16452. if (client[kStrictContentLength]) {
  16453. errorRequest(client, request, new RequestContentLengthMismatchError())
  16454. return false
  16455. }
  16456. process.emitWarning(new RequestContentLengthMismatchError())
  16457. }
  16458. const socket = client[kSocket]
  16459. try {
  16460. request.onConnect((err) => {
  16461. if (request.aborted || request.completed) {
  16462. return
  16463. }
  16464. errorRequest(client, request, err || new RequestAbortedError())
  16465. util.destroy(socket, new InformationalError('aborted'))
  16466. })
  16467. } catch (err) {
  16468. errorRequest(client, request, err)
  16469. }
  16470. if (request.aborted) {
  16471. return false
  16472. }
  16473. if (method === 'HEAD') {
  16474. // https://github.com/mcollina/undici/issues/258
  16475. // Close after a HEAD request to interop with misbehaving servers
  16476. // that may send a body in the response.
  16477. socket[kReset] = true
  16478. }
  16479. if (upgrade || method === 'CONNECT') {
  16480. // On CONNECT or upgrade, block pipeline from dispatching further
  16481. // requests on this connection.
  16482. socket[kReset] = true
  16483. }
  16484. if (reset != null) {
  16485. socket[kReset] = reset
  16486. }
  16487. if (client[kMaxRequests] && socket[kCounter]++ >= client[kMaxRequests]) {
  16488. socket[kReset] = true
  16489. }
  16490. if (blocking) {
  16491. socket[kBlocking] = true
  16492. }
  16493. let header = `${method} ${path} HTTP/1.1\r\n`
  16494. if (typeof host === 'string') {
  16495. header += `host: ${host}\r\n`
  16496. } else {
  16497. header += client[kHostHeader]
  16498. }
  16499. if (upgrade) {
  16500. header += `connection: upgrade\r\nupgrade: ${upgrade}\r\n`
  16501. } else if (client[kPipelining] && !socket[kReset]) {
  16502. header += 'connection: keep-alive\r\n'
  16503. } else {
  16504. header += 'connection: close\r\n'
  16505. }
  16506. if (headers) {
  16507. header += headers
  16508. }
  16509. if (channels.sendHeaders.hasSubscribers) {
  16510. channels.sendHeaders.publish({ request, headers: header, socket })
  16511. }
  16512. /* istanbul ignore else: assertion */
  16513. if (!body || bodyLength === 0) {
  16514. if (contentLength === 0) {
  16515. socket.write(`${header}content-length: 0\r\n\r\n`, 'latin1')
  16516. } else {
  16517. assert(contentLength === null, 'no body must not have content length')
  16518. socket.write(`${header}\r\n`, 'latin1')
  16519. }
  16520. request.onRequestSent()
  16521. } else if (util.isBuffer(body)) {
  16522. assert(contentLength === body.byteLength, 'buffer body must have content length')
  16523. socket.cork()
  16524. socket.write(`${header}content-length: ${contentLength}\r\n\r\n`, 'latin1')
  16525. socket.write(body)
  16526. socket.uncork()
  16527. request.onBodySent(body)
  16528. request.onRequestSent()
  16529. if (!expectsPayload) {
  16530. socket[kReset] = true
  16531. }
  16532. } else if (util.isBlobLike(body)) {
  16533. if (typeof body.stream === 'function') {
  16534. writeIterable({ body: body.stream(), client, request, socket, contentLength, header, expectsPayload })
  16535. } else {
  16536. writeBlob({ body, client, request, socket, contentLength, header, expectsPayload })
  16537. }
  16538. } else if (util.isStream(body)) {
  16539. writeStream({ body, client, request, socket, contentLength, header, expectsPayload })
  16540. } else if (util.isIterable(body)) {
  16541. writeIterable({ body, client, request, socket, contentLength, header, expectsPayload })
  16542. } else {
  16543. assert(false)
  16544. }
  16545. return true
  16546. }
  16547. function writeH2 (client, session, request) {
  16548. const { body, method, path, host, upgrade, expectContinue, signal, headers: reqHeaders } = request
  16549. let headers
  16550. if (typeof reqHeaders === 'string') headers = Request[kHTTP2CopyHeaders](reqHeaders.trim())
  16551. else headers = reqHeaders
  16552. if (upgrade) {
  16553. errorRequest(client, request, new Error('Upgrade not supported for H2'))
  16554. return false
  16555. }
  16556. try {
  16557. // TODO(HTTP/2): Should we call onConnect immediately or on stream ready event?
  16558. request.onConnect((err) => {
  16559. if (request.aborted || request.completed) {
  16560. return
  16561. }
  16562. errorRequest(client, request, err || new RequestAbortedError())
  16563. })
  16564. } catch (err) {
  16565. errorRequest(client, request, err)
  16566. }
  16567. if (request.aborted) {
  16568. return false
  16569. }
  16570. /** @type {import('node:http2').ClientHttp2Stream} */
  16571. let stream
  16572. const h2State = client[kHTTP2SessionState]
  16573. headers[HTTP2_HEADER_AUTHORITY] = host || client[kHost]
  16574. headers[HTTP2_HEADER_METHOD] = method
  16575. if (method === 'CONNECT') {
  16576. session.ref()
  16577. // we are already connected, streams are pending, first request
  16578. // will create a new stream. We trigger a request to create the stream and wait until
  16579. // `ready` event is triggered
  16580. // We disabled endStream to allow the user to write to the stream
  16581. stream = session.request(headers, { endStream: false, signal })
  16582. if (stream.id && !stream.pending) {
  16583. request.onUpgrade(null, null, stream)
  16584. ++h2State.openStreams
  16585. } else {
  16586. stream.once('ready', () => {
  16587. request.onUpgrade(null, null, stream)
  16588. ++h2State.openStreams
  16589. })
  16590. }
  16591. stream.once('close', () => {
  16592. h2State.openStreams -= 1
  16593. // TODO(HTTP/2): unref only if current streams count is 0
  16594. if (h2State.openStreams === 0) session.unref()
  16595. })
  16596. return true
  16597. }
  16598. // https://tools.ietf.org/html/rfc7540#section-8.3
  16599. // :path and :scheme headers must be omited when sending CONNECT
  16600. headers[HTTP2_HEADER_PATH] = path
  16601. headers[HTTP2_HEADER_SCHEME] = 'https'
  16602. // https://tools.ietf.org/html/rfc7231#section-4.3.1
  16603. // https://tools.ietf.org/html/rfc7231#section-4.3.2
  16604. // https://tools.ietf.org/html/rfc7231#section-4.3.5
  16605. // Sending a payload body on a request that does not
  16606. // expect it can cause undefined behavior on some
  16607. // servers and corrupt connection state. Do not
  16608. // re-use the connection for further requests.
  16609. const expectsPayload = (
  16610. method === 'PUT' ||
  16611. method === 'POST' ||
  16612. method === 'PATCH'
  16613. )
  16614. if (body && typeof body.read === 'function') {
  16615. // Try to read EOF in order to get length.
  16616. body.read(0)
  16617. }
  16618. let contentLength = util.bodyLength(body)
  16619. if (contentLength == null) {
  16620. contentLength = request.contentLength
  16621. }
  16622. if (contentLength === 0 || !expectsPayload) {
  16623. // https://tools.ietf.org/html/rfc7230#section-3.3.2
  16624. // A user agent SHOULD NOT send a Content-Length header field when
  16625. // the request message does not contain a payload body and the method
  16626. // semantics do not anticipate such a body.
  16627. contentLength = null
  16628. }
  16629. // https://github.com/nodejs/undici/issues/2046
  16630. // A user agent may send a Content-Length header with 0 value, this should be allowed.
  16631. if (shouldSendContentLength(method) && contentLength > 0 && request.contentLength != null && request.contentLength !== contentLength) {
  16632. if (client[kStrictContentLength]) {
  16633. errorRequest(client, request, new RequestContentLengthMismatchError())
  16634. return false
  16635. }
  16636. process.emitWarning(new RequestContentLengthMismatchError())
  16637. }
  16638. if (contentLength != null) {
  16639. assert(body, 'no body must not have content length')
  16640. headers[HTTP2_HEADER_CONTENT_LENGTH] = `${contentLength}`
  16641. }
  16642. session.ref()
  16643. const shouldEndStream = method === 'GET' || method === 'HEAD'
  16644. if (expectContinue) {
  16645. headers[HTTP2_HEADER_EXPECT] = '100-continue'
  16646. stream = session.request(headers, { endStream: shouldEndStream, signal })
  16647. stream.once('continue', writeBodyH2)
  16648. } else {
  16649. stream = session.request(headers, {
  16650. endStream: shouldEndStream,
  16651. signal
  16652. })
  16653. writeBodyH2()
  16654. }
  16655. // Increment counter as we have new several streams open
  16656. ++h2State.openStreams
  16657. stream.once('response', headers => {
  16658. const { [HTTP2_HEADER_STATUS]: statusCode, ...realHeaders } = headers
  16659. if (request.onHeaders(Number(statusCode), realHeaders, stream.resume.bind(stream), '') === false) {
  16660. stream.pause()
  16661. }
  16662. })
  16663. stream.once('end', () => {
  16664. request.onComplete([])
  16665. })
  16666. stream.on('data', (chunk) => {
  16667. if (request.onData(chunk) === false) {
  16668. stream.pause()
  16669. }
  16670. })
  16671. stream.once('close', () => {
  16672. h2State.openStreams -= 1
  16673. // TODO(HTTP/2): unref only if current streams count is 0
  16674. if (h2State.openStreams === 0) {
  16675. session.unref()
  16676. }
  16677. })
  16678. stream.once('error', function (err) {
  16679. if (client[kHTTP2Session] && !client[kHTTP2Session].destroyed && !this.closed && !this.destroyed) {
  16680. h2State.streams -= 1
  16681. util.destroy(stream, err)
  16682. }
  16683. })
  16684. stream.once('frameError', (type, code) => {
  16685. const err = new InformationalError(`HTTP/2: "frameError" received - type ${type}, code ${code}`)
  16686. errorRequest(client, request, err)
  16687. if (client[kHTTP2Session] && !client[kHTTP2Session].destroyed && !this.closed && !this.destroyed) {
  16688. h2State.streams -= 1
  16689. util.destroy(stream, err)
  16690. }
  16691. })
  16692. // stream.on('aborted', () => {
  16693. // // TODO(HTTP/2): Support aborted
  16694. // })
  16695. // stream.on('timeout', () => {
  16696. // // TODO(HTTP/2): Support timeout
  16697. // })
  16698. // stream.on('push', headers => {
  16699. // // TODO(HTTP/2): Suppor push
  16700. // })
  16701. // stream.on('trailers', headers => {
  16702. // // TODO(HTTP/2): Support trailers
  16703. // })
  16704. return true
  16705. function writeBodyH2 () {
  16706. /* istanbul ignore else: assertion */
  16707. if (!body) {
  16708. request.onRequestSent()
  16709. } else if (util.isBuffer(body)) {
  16710. assert(contentLength === body.byteLength, 'buffer body must have content length')
  16711. stream.cork()
  16712. stream.write(body)
  16713. stream.uncork()
  16714. stream.end()
  16715. request.onBodySent(body)
  16716. request.onRequestSent()
  16717. } else if (util.isBlobLike(body)) {
  16718. if (typeof body.stream === 'function') {
  16719. writeIterable({
  16720. client,
  16721. request,
  16722. contentLength,
  16723. h2stream: stream,
  16724. expectsPayload,
  16725. body: body.stream(),
  16726. socket: client[kSocket],
  16727. header: ''
  16728. })
  16729. } else {
  16730. writeBlob({
  16731. body,
  16732. client,
  16733. request,
  16734. contentLength,
  16735. expectsPayload,
  16736. h2stream: stream,
  16737. header: '',
  16738. socket: client[kSocket]
  16739. })
  16740. }
  16741. } else if (util.isStream(body)) {
  16742. writeStream({
  16743. body,
  16744. client,
  16745. request,
  16746. contentLength,
  16747. expectsPayload,
  16748. socket: client[kSocket],
  16749. h2stream: stream,
  16750. header: ''
  16751. })
  16752. } else if (util.isIterable(body)) {
  16753. writeIterable({
  16754. body,
  16755. client,
  16756. request,
  16757. contentLength,
  16758. expectsPayload,
  16759. header: '',
  16760. h2stream: stream,
  16761. socket: client[kSocket]
  16762. })
  16763. } else {
  16764. assert(false)
  16765. }
  16766. }
  16767. }
  16768. function writeStream ({ h2stream, body, client, request, socket, contentLength, header, expectsPayload }) {
  16769. assert(contentLength !== 0 || client[kRunning] === 0, 'stream body cannot be pipelined')
  16770. if (client[kHTTPConnVersion] === 'h2') {
  16771. // For HTTP/2, is enough to pipe the stream
  16772. const pipe = pipeline(
  16773. body,
  16774. h2stream,
  16775. (err) => {
  16776. if (err) {
  16777. util.destroy(body, err)
  16778. util.destroy(h2stream, err)
  16779. } else {
  16780. request.onRequestSent()
  16781. }
  16782. }
  16783. )
  16784. pipe.on('data', onPipeData)
  16785. pipe.once('end', () => {
  16786. pipe.removeListener('data', onPipeData)
  16787. util.destroy(pipe)
  16788. })
  16789. function onPipeData (chunk) {
  16790. request.onBodySent(chunk)
  16791. }
  16792. return
  16793. }
  16794. let finished = false
  16795. const writer = new AsyncWriter({ socket, request, contentLength, client, expectsPayload, header })
  16796. const onData = function (chunk) {
  16797. if (finished) {
  16798. return
  16799. }
  16800. try {
  16801. if (!writer.write(chunk) && this.pause) {
  16802. this.pause()
  16803. }
  16804. } catch (err) {
  16805. util.destroy(this, err)
  16806. }
  16807. }
  16808. const onDrain = function () {
  16809. if (finished) {
  16810. return
  16811. }
  16812. if (body.resume) {
  16813. body.resume()
  16814. }
  16815. }
  16816. const onAbort = function () {
  16817. if (finished) {
  16818. return
  16819. }
  16820. const err = new RequestAbortedError()
  16821. queueMicrotask(() => onFinished(err))
  16822. }
  16823. const onFinished = function (err) {
  16824. if (finished) {
  16825. return
  16826. }
  16827. finished = true
  16828. assert(socket.destroyed || (socket[kWriting] && client[kRunning] <= 1))
  16829. socket
  16830. .off('drain', onDrain)
  16831. .off('error', onFinished)
  16832. body
  16833. .removeListener('data', onData)
  16834. .removeListener('end', onFinished)
  16835. .removeListener('error', onFinished)
  16836. .removeListener('close', onAbort)
  16837. if (!err) {
  16838. try {
  16839. writer.end()
  16840. } catch (er) {
  16841. err = er
  16842. }
  16843. }
  16844. writer.destroy(err)
  16845. if (err && (err.code !== 'UND_ERR_INFO' || err.message !== 'reset')) {
  16846. util.destroy(body, err)
  16847. } else {
  16848. util.destroy(body)
  16849. }
  16850. }
  16851. body
  16852. .on('data', onData)
  16853. .on('end', onFinished)
  16854. .on('error', onFinished)
  16855. .on('close', onAbort)
  16856. if (body.resume) {
  16857. body.resume()
  16858. }
  16859. socket
  16860. .on('drain', onDrain)
  16861. .on('error', onFinished)
  16862. }
  16863. async function writeBlob ({ h2stream, body, client, request, socket, contentLength, header, expectsPayload }) {
  16864. assert(contentLength === body.size, 'blob body must have content length')
  16865. const isH2 = client[kHTTPConnVersion] === 'h2'
  16866. try {
  16867. if (contentLength != null && contentLength !== body.size) {
  16868. throw new RequestContentLengthMismatchError()
  16869. }
  16870. const buffer = Buffer.from(await body.arrayBuffer())
  16871. if (isH2) {
  16872. h2stream.cork()
  16873. h2stream.write(buffer)
  16874. h2stream.uncork()
  16875. } else {
  16876. socket.cork()
  16877. socket.write(`${header}content-length: ${contentLength}\r\n\r\n`, 'latin1')
  16878. socket.write(buffer)
  16879. socket.uncork()
  16880. }
  16881. request.onBodySent(buffer)
  16882. request.onRequestSent()
  16883. if (!expectsPayload) {
  16884. socket[kReset] = true
  16885. }
  16886. resume(client)
  16887. } catch (err) {
  16888. util.destroy(isH2 ? h2stream : socket, err)
  16889. }
  16890. }
  16891. async function writeIterable ({ h2stream, body, client, request, socket, contentLength, header, expectsPayload }) {
  16892. assert(contentLength !== 0 || client[kRunning] === 0, 'iterator body cannot be pipelined')
  16893. let callback = null
  16894. function onDrain () {
  16895. if (callback) {
  16896. const cb = callback
  16897. callback = null
  16898. cb()
  16899. }
  16900. }
  16901. const waitForDrain = () => new Promise((resolve, reject) => {
  16902. assert(callback === null)
  16903. if (socket[kError]) {
  16904. reject(socket[kError])
  16905. } else {
  16906. callback = resolve
  16907. }
  16908. })
  16909. if (client[kHTTPConnVersion] === 'h2') {
  16910. h2stream
  16911. .on('close', onDrain)
  16912. .on('drain', onDrain)
  16913. try {
  16914. // It's up to the user to somehow abort the async iterable.
  16915. for await (const chunk of body) {
  16916. if (socket[kError]) {
  16917. throw socket[kError]
  16918. }
  16919. const res = h2stream.write(chunk)
  16920. request.onBodySent(chunk)
  16921. if (!res) {
  16922. await waitForDrain()
  16923. }
  16924. }
  16925. } catch (err) {
  16926. h2stream.destroy(err)
  16927. } finally {
  16928. request.onRequestSent()
  16929. h2stream.end()
  16930. h2stream
  16931. .off('close', onDrain)
  16932. .off('drain', onDrain)
  16933. }
  16934. return
  16935. }
  16936. socket
  16937. .on('close', onDrain)
  16938. .on('drain', onDrain)
  16939. const writer = new AsyncWriter({ socket, request, contentLength, client, expectsPayload, header })
  16940. try {
  16941. // It's up to the user to somehow abort the async iterable.
  16942. for await (const chunk of body) {
  16943. if (socket[kError]) {
  16944. throw socket[kError]
  16945. }
  16946. if (!writer.write(chunk)) {
  16947. await waitForDrain()
  16948. }
  16949. }
  16950. writer.end()
  16951. } catch (err) {
  16952. writer.destroy(err)
  16953. } finally {
  16954. socket
  16955. .off('close', onDrain)
  16956. .off('drain', onDrain)
  16957. }
  16958. }
  16959. class AsyncWriter {
  16960. constructor ({ socket, request, contentLength, client, expectsPayload, header }) {
  16961. this.socket = socket
  16962. this.request = request
  16963. this.contentLength = contentLength
  16964. this.client = client
  16965. this.bytesWritten = 0
  16966. this.expectsPayload = expectsPayload
  16967. this.header = header
  16968. socket[kWriting] = true
  16969. }
  16970. write (chunk) {
  16971. const { socket, request, contentLength, client, bytesWritten, expectsPayload, header } = this
  16972. if (socket[kError]) {
  16973. throw socket[kError]
  16974. }
  16975. if (socket.destroyed) {
  16976. return false
  16977. }
  16978. const len = Buffer.byteLength(chunk)
  16979. if (!len) {
  16980. return true
  16981. }
  16982. // We should defer writing chunks.
  16983. if (contentLength !== null && bytesWritten + len > contentLength) {
  16984. if (client[kStrictContentLength]) {
  16985. throw new RequestContentLengthMismatchError()
  16986. }
  16987. process.emitWarning(new RequestContentLengthMismatchError())
  16988. }
  16989. socket.cork()
  16990. if (bytesWritten === 0) {
  16991. if (!expectsPayload) {
  16992. socket[kReset] = true
  16993. }
  16994. if (contentLength === null) {
  16995. socket.write(`${header}transfer-encoding: chunked\r\n`, 'latin1')
  16996. } else {
  16997. socket.write(`${header}content-length: ${contentLength}\r\n\r\n`, 'latin1')
  16998. }
  16999. }
  17000. if (contentLength === null) {
  17001. socket.write(`\r\n${len.toString(16)}\r\n`, 'latin1')
  17002. }
  17003. this.bytesWritten += len
  17004. const ret = socket.write(chunk)
  17005. socket.uncork()
  17006. request.onBodySent(chunk)
  17007. if (!ret) {
  17008. if (socket[kParser].timeout && socket[kParser].timeoutType === TIMEOUT_HEADERS) {
  17009. // istanbul ignore else: only for jest
  17010. if (socket[kParser].timeout.refresh) {
  17011. socket[kParser].timeout.refresh()
  17012. }
  17013. }
  17014. }
  17015. return ret
  17016. }
  17017. end () {
  17018. const { socket, contentLength, client, bytesWritten, expectsPayload, header, request } = this
  17019. request.onRequestSent()
  17020. socket[kWriting] = false
  17021. if (socket[kError]) {
  17022. throw socket[kError]
  17023. }
  17024. if (socket.destroyed) {
  17025. return
  17026. }
  17027. if (bytesWritten === 0) {
  17028. if (expectsPayload) {
  17029. // https://tools.ietf.org/html/rfc7230#section-3.3.2
  17030. // A user agent SHOULD send a Content-Length in a request message when
  17031. // no Transfer-Encoding is sent and the request method defines a meaning
  17032. // for an enclosed payload body.
  17033. socket.write(`${header}content-length: 0\r\n\r\n`, 'latin1')
  17034. } else {
  17035. socket.write(`${header}\r\n`, 'latin1')
  17036. }
  17037. } else if (contentLength === null) {
  17038. socket.write('\r\n0\r\n\r\n', 'latin1')
  17039. }
  17040. if (contentLength !== null && bytesWritten !== contentLength) {
  17041. if (client[kStrictContentLength]) {
  17042. throw new RequestContentLengthMismatchError()
  17043. } else {
  17044. process.emitWarning(new RequestContentLengthMismatchError())
  17045. }
  17046. }
  17047. if (socket[kParser].timeout && socket[kParser].timeoutType === TIMEOUT_HEADERS) {
  17048. // istanbul ignore else: only for jest
  17049. if (socket[kParser].timeout.refresh) {
  17050. socket[kParser].timeout.refresh()
  17051. }
  17052. }
  17053. resume(client)
  17054. }
  17055. destroy (err) {
  17056. const { socket, client } = this
  17057. socket[kWriting] = false
  17058. if (err) {
  17059. assert(client[kRunning] <= 1, 'pipeline should only contain this request')
  17060. util.destroy(socket, err)
  17061. }
  17062. }
  17063. }
  17064. function errorRequest (client, request, err) {
  17065. try {
  17066. request.onError(err)
  17067. assert(request.aborted)
  17068. } catch (err) {
  17069. client.emit('error', err)
  17070. }
  17071. }
  17072. module.exports = Client
  17073. /***/ }),
  17074. /***/ 6436:
  17075. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  17076. "use strict";
  17077. /* istanbul ignore file: only for Node 12 */
  17078. const { kConnected, kSize } = __nccwpck_require__(2785)
  17079. class CompatWeakRef {
  17080. constructor (value) {
  17081. this.value = value
  17082. }
  17083. deref () {
  17084. return this.value[kConnected] === 0 && this.value[kSize] === 0
  17085. ? undefined
  17086. : this.value
  17087. }
  17088. }
  17089. class CompatFinalizer {
  17090. constructor (finalizer) {
  17091. this.finalizer = finalizer
  17092. }
  17093. register (dispatcher, key) {
  17094. if (dispatcher.on) {
  17095. dispatcher.on('disconnect', () => {
  17096. if (dispatcher[kConnected] === 0 && dispatcher[kSize] === 0) {
  17097. this.finalizer(key)
  17098. }
  17099. })
  17100. }
  17101. }
  17102. }
  17103. module.exports = function () {
  17104. // FIXME: remove workaround when the Node bug is fixed
  17105. // https://github.com/nodejs/node/issues/49344#issuecomment-1741776308
  17106. if (process.env.NODE_V8_COVERAGE) {
  17107. return {
  17108. WeakRef: CompatWeakRef,
  17109. FinalizationRegistry: CompatFinalizer
  17110. }
  17111. }
  17112. return {
  17113. WeakRef: global.WeakRef || CompatWeakRef,
  17114. FinalizationRegistry: global.FinalizationRegistry || CompatFinalizer
  17115. }
  17116. }
  17117. /***/ }),
  17118. /***/ 663:
  17119. /***/ ((module) => {
  17120. "use strict";
  17121. // https://wicg.github.io/cookie-store/#cookie-maximum-attribute-value-size
  17122. const maxAttributeValueSize = 1024
  17123. // https://wicg.github.io/cookie-store/#cookie-maximum-name-value-pair-size
  17124. const maxNameValuePairSize = 4096
  17125. module.exports = {
  17126. maxAttributeValueSize,
  17127. maxNameValuePairSize
  17128. }
  17129. /***/ }),
  17130. /***/ 1724:
  17131. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  17132. "use strict";
  17133. const { parseSetCookie } = __nccwpck_require__(4408)
  17134. const { stringify } = __nccwpck_require__(3121)
  17135. const { webidl } = __nccwpck_require__(1744)
  17136. const { Headers } = __nccwpck_require__(554)
  17137. /**
  17138. * @typedef {Object} Cookie
  17139. * @property {string} name
  17140. * @property {string} value
  17141. * @property {Date|number|undefined} expires
  17142. * @property {number|undefined} maxAge
  17143. * @property {string|undefined} domain
  17144. * @property {string|undefined} path
  17145. * @property {boolean|undefined} secure
  17146. * @property {boolean|undefined} httpOnly
  17147. * @property {'Strict'|'Lax'|'None'} sameSite
  17148. * @property {string[]} unparsed
  17149. */
  17150. /**
  17151. * @param {Headers} headers
  17152. * @returns {Record<string, string>}
  17153. */
  17154. function getCookies (headers) {
  17155. webidl.argumentLengthCheck(arguments, 1, { header: 'getCookies' })
  17156. webidl.brandCheck(headers, Headers, { strict: false })
  17157. const cookie = headers.get('cookie')
  17158. const out = {}
  17159. if (!cookie) {
  17160. return out
  17161. }
  17162. for (const piece of cookie.split(';')) {
  17163. const [name, ...value] = piece.split('=')
  17164. out[name.trim()] = value.join('=')
  17165. }
  17166. return out
  17167. }
  17168. /**
  17169. * @param {Headers} headers
  17170. * @param {string} name
  17171. * @param {{ path?: string, domain?: string }|undefined} attributes
  17172. * @returns {void}
  17173. */
  17174. function deleteCookie (headers, name, attributes) {
  17175. webidl.argumentLengthCheck(arguments, 2, { header: 'deleteCookie' })
  17176. webidl.brandCheck(headers, Headers, { strict: false })
  17177. name = webidl.converters.DOMString(name)
  17178. attributes = webidl.converters.DeleteCookieAttributes(attributes)
  17179. // Matches behavior of
  17180. // https://github.com/denoland/deno_std/blob/63827b16330b82489a04614027c33b7904e08be5/http/cookie.ts#L278
  17181. setCookie(headers, {
  17182. name,
  17183. value: '',
  17184. expires: new Date(0),
  17185. ...attributes
  17186. })
  17187. }
  17188. /**
  17189. * @param {Headers} headers
  17190. * @returns {Cookie[]}
  17191. */
  17192. function getSetCookies (headers) {
  17193. webidl.argumentLengthCheck(arguments, 1, { header: 'getSetCookies' })
  17194. webidl.brandCheck(headers, Headers, { strict: false })
  17195. const cookies = headers.getSetCookie()
  17196. if (!cookies) {
  17197. return []
  17198. }
  17199. return cookies.map((pair) => parseSetCookie(pair))
  17200. }
  17201. /**
  17202. * @param {Headers} headers
  17203. * @param {Cookie} cookie
  17204. * @returns {void}
  17205. */
  17206. function setCookie (headers, cookie) {
  17207. webidl.argumentLengthCheck(arguments, 2, { header: 'setCookie' })
  17208. webidl.brandCheck(headers, Headers, { strict: false })
  17209. cookie = webidl.converters.Cookie(cookie)
  17210. const str = stringify(cookie)
  17211. if (str) {
  17212. headers.append('Set-Cookie', stringify(cookie))
  17213. }
  17214. }
  17215. webidl.converters.DeleteCookieAttributes = webidl.dictionaryConverter([
  17216. {
  17217. converter: webidl.nullableConverter(webidl.converters.DOMString),
  17218. key: 'path',
  17219. defaultValue: null
  17220. },
  17221. {
  17222. converter: webidl.nullableConverter(webidl.converters.DOMString),
  17223. key: 'domain',
  17224. defaultValue: null
  17225. }
  17226. ])
  17227. webidl.converters.Cookie = webidl.dictionaryConverter([
  17228. {
  17229. converter: webidl.converters.DOMString,
  17230. key: 'name'
  17231. },
  17232. {
  17233. converter: webidl.converters.DOMString,
  17234. key: 'value'
  17235. },
  17236. {
  17237. converter: webidl.nullableConverter((value) => {
  17238. if (typeof value === 'number') {
  17239. return webidl.converters['unsigned long long'](value)
  17240. }
  17241. return new Date(value)
  17242. }),
  17243. key: 'expires',
  17244. defaultValue: null
  17245. },
  17246. {
  17247. converter: webidl.nullableConverter(webidl.converters['long long']),
  17248. key: 'maxAge',
  17249. defaultValue: null
  17250. },
  17251. {
  17252. converter: webidl.nullableConverter(webidl.converters.DOMString),
  17253. key: 'domain',
  17254. defaultValue: null
  17255. },
  17256. {
  17257. converter: webidl.nullableConverter(webidl.converters.DOMString),
  17258. key: 'path',
  17259. defaultValue: null
  17260. },
  17261. {
  17262. converter: webidl.nullableConverter(webidl.converters.boolean),
  17263. key: 'secure',
  17264. defaultValue: null
  17265. },
  17266. {
  17267. converter: webidl.nullableConverter(webidl.converters.boolean),
  17268. key: 'httpOnly',
  17269. defaultValue: null
  17270. },
  17271. {
  17272. converter: webidl.converters.USVString,
  17273. key: 'sameSite',
  17274. allowedValues: ['Strict', 'Lax', 'None']
  17275. },
  17276. {
  17277. converter: webidl.sequenceConverter(webidl.converters.DOMString),
  17278. key: 'unparsed',
  17279. defaultValue: []
  17280. }
  17281. ])
  17282. module.exports = {
  17283. getCookies,
  17284. deleteCookie,
  17285. getSetCookies,
  17286. setCookie
  17287. }
  17288. /***/ }),
  17289. /***/ 4408:
  17290. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  17291. "use strict";
  17292. const { maxNameValuePairSize, maxAttributeValueSize } = __nccwpck_require__(663)
  17293. const { isCTLExcludingHtab } = __nccwpck_require__(3121)
  17294. const { collectASequenceOfCodePointsFast } = __nccwpck_require__(685)
  17295. const assert = __nccwpck_require__(9491)
  17296. /**
  17297. * @description Parses the field-value attributes of a set-cookie header string.
  17298. * @see https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4
  17299. * @param {string} header
  17300. * @returns if the header is invalid, null will be returned
  17301. */
  17302. function parseSetCookie (header) {
  17303. // 1. If the set-cookie-string contains a %x00-08 / %x0A-1F / %x7F
  17304. // character (CTL characters excluding HTAB): Abort these steps and
  17305. // ignore the set-cookie-string entirely.
  17306. if (isCTLExcludingHtab(header)) {
  17307. return null
  17308. }
  17309. let nameValuePair = ''
  17310. let unparsedAttributes = ''
  17311. let name = ''
  17312. let value = ''
  17313. // 2. If the set-cookie-string contains a %x3B (";") character:
  17314. if (header.includes(';')) {
  17315. // 1. The name-value-pair string consists of the characters up to,
  17316. // but not including, the first %x3B (";"), and the unparsed-
  17317. // attributes consist of the remainder of the set-cookie-string
  17318. // (including the %x3B (";") in question).
  17319. const position = { position: 0 }
  17320. nameValuePair = collectASequenceOfCodePointsFast(';', header, position)
  17321. unparsedAttributes = header.slice(position.position)
  17322. } else {
  17323. // Otherwise:
  17324. // 1. The name-value-pair string consists of all the characters
  17325. // contained in the set-cookie-string, and the unparsed-
  17326. // attributes is the empty string.
  17327. nameValuePair = header
  17328. }
  17329. // 3. If the name-value-pair string lacks a %x3D ("=") character, then
  17330. // the name string is empty, and the value string is the value of
  17331. // name-value-pair.
  17332. if (!nameValuePair.includes('=')) {
  17333. value = nameValuePair
  17334. } else {
  17335. // Otherwise, the name string consists of the characters up to, but
  17336. // not including, the first %x3D ("=") character, and the (possibly
  17337. // empty) value string consists of the characters after the first
  17338. // %x3D ("=") character.
  17339. const position = { position: 0 }
  17340. name = collectASequenceOfCodePointsFast(
  17341. '=',
  17342. nameValuePair,
  17343. position
  17344. )
  17345. value = nameValuePair.slice(position.position + 1)
  17346. }
  17347. // 4. Remove any leading or trailing WSP characters from the name
  17348. // string and the value string.
  17349. name = name.trim()
  17350. value = value.trim()
  17351. // 5. If the sum of the lengths of the name string and the value string
  17352. // is more than 4096 octets, abort these steps and ignore the set-
  17353. // cookie-string entirely.
  17354. if (name.length + value.length > maxNameValuePairSize) {
  17355. return null
  17356. }
  17357. // 6. The cookie-name is the name string, and the cookie-value is the
  17358. // value string.
  17359. return {
  17360. name, value, ...parseUnparsedAttributes(unparsedAttributes)
  17361. }
  17362. }
  17363. /**
  17364. * Parses the remaining attributes of a set-cookie header
  17365. * @see https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4
  17366. * @param {string} unparsedAttributes
  17367. * @param {[Object.<string, unknown>]={}} cookieAttributeList
  17368. */
  17369. function parseUnparsedAttributes (unparsedAttributes, cookieAttributeList = {}) {
  17370. // 1. If the unparsed-attributes string is empty, skip the rest of
  17371. // these steps.
  17372. if (unparsedAttributes.length === 0) {
  17373. return cookieAttributeList
  17374. }
  17375. // 2. Discard the first character of the unparsed-attributes (which
  17376. // will be a %x3B (";") character).
  17377. assert(unparsedAttributes[0] === ';')
  17378. unparsedAttributes = unparsedAttributes.slice(1)
  17379. let cookieAv = ''
  17380. // 3. If the remaining unparsed-attributes contains a %x3B (";")
  17381. // character:
  17382. if (unparsedAttributes.includes(';')) {
  17383. // 1. Consume the characters of the unparsed-attributes up to, but
  17384. // not including, the first %x3B (";") character.
  17385. cookieAv = collectASequenceOfCodePointsFast(
  17386. ';',
  17387. unparsedAttributes,
  17388. { position: 0 }
  17389. )
  17390. unparsedAttributes = unparsedAttributes.slice(cookieAv.length)
  17391. } else {
  17392. // Otherwise:
  17393. // 1. Consume the remainder of the unparsed-attributes.
  17394. cookieAv = unparsedAttributes
  17395. unparsedAttributes = ''
  17396. }
  17397. // Let the cookie-av string be the characters consumed in this step.
  17398. let attributeName = ''
  17399. let attributeValue = ''
  17400. // 4. If the cookie-av string contains a %x3D ("=") character:
  17401. if (cookieAv.includes('=')) {
  17402. // 1. The (possibly empty) attribute-name string consists of the
  17403. // characters up to, but not including, the first %x3D ("=")
  17404. // character, and the (possibly empty) attribute-value string
  17405. // consists of the characters after the first %x3D ("=")
  17406. // character.
  17407. const position = { position: 0 }
  17408. attributeName = collectASequenceOfCodePointsFast(
  17409. '=',
  17410. cookieAv,
  17411. position
  17412. )
  17413. attributeValue = cookieAv.slice(position.position + 1)
  17414. } else {
  17415. // Otherwise:
  17416. // 1. The attribute-name string consists of the entire cookie-av
  17417. // string, and the attribute-value string is empty.
  17418. attributeName = cookieAv
  17419. }
  17420. // 5. Remove any leading or trailing WSP characters from the attribute-
  17421. // name string and the attribute-value string.
  17422. attributeName = attributeName.trim()
  17423. attributeValue = attributeValue.trim()
  17424. // 6. If the attribute-value is longer than 1024 octets, ignore the
  17425. // cookie-av string and return to Step 1 of this algorithm.
  17426. if (attributeValue.length > maxAttributeValueSize) {
  17427. return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList)
  17428. }
  17429. // 7. Process the attribute-name and attribute-value according to the
  17430. // requirements in the following subsections. (Notice that
  17431. // attributes with unrecognized attribute-names are ignored.)
  17432. const attributeNameLowercase = attributeName.toLowerCase()
  17433. // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.1
  17434. // If the attribute-name case-insensitively matches the string
  17435. // "Expires", the user agent MUST process the cookie-av as follows.
  17436. if (attributeNameLowercase === 'expires') {
  17437. // 1. Let the expiry-time be the result of parsing the attribute-value
  17438. // as cookie-date (see Section 5.1.1).
  17439. const expiryTime = new Date(attributeValue)
  17440. // 2. If the attribute-value failed to parse as a cookie date, ignore
  17441. // the cookie-av.
  17442. cookieAttributeList.expires = expiryTime
  17443. } else if (attributeNameLowercase === 'max-age') {
  17444. // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.2
  17445. // If the attribute-name case-insensitively matches the string "Max-
  17446. // Age", the user agent MUST process the cookie-av as follows.
  17447. // 1. If the first character of the attribute-value is not a DIGIT or a
  17448. // "-" character, ignore the cookie-av.
  17449. const charCode = attributeValue.charCodeAt(0)
  17450. if ((charCode < 48 || charCode > 57) && attributeValue[0] !== '-') {
  17451. return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList)
  17452. }
  17453. // 2. If the remainder of attribute-value contains a non-DIGIT
  17454. // character, ignore the cookie-av.
  17455. if (!/^\d+$/.test(attributeValue)) {
  17456. return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList)
  17457. }
  17458. // 3. Let delta-seconds be the attribute-value converted to an integer.
  17459. const deltaSeconds = Number(attributeValue)
  17460. // 4. Let cookie-age-limit be the maximum age of the cookie (which
  17461. // SHOULD be 400 days or less, see Section 4.1.2.2).
  17462. // 5. Set delta-seconds to the smaller of its present value and cookie-
  17463. // age-limit.
  17464. // deltaSeconds = Math.min(deltaSeconds * 1000, maxExpiresMs)
  17465. // 6. If delta-seconds is less than or equal to zero (0), let expiry-
  17466. // time be the earliest representable date and time. Otherwise, let
  17467. // the expiry-time be the current date and time plus delta-seconds
  17468. // seconds.
  17469. // const expiryTime = deltaSeconds <= 0 ? Date.now() : Date.now() + deltaSeconds
  17470. // 7. Append an attribute to the cookie-attribute-list with an
  17471. // attribute-name of Max-Age and an attribute-value of expiry-time.
  17472. cookieAttributeList.maxAge = deltaSeconds
  17473. } else if (attributeNameLowercase === 'domain') {
  17474. // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.3
  17475. // If the attribute-name case-insensitively matches the string "Domain",
  17476. // the user agent MUST process the cookie-av as follows.
  17477. // 1. Let cookie-domain be the attribute-value.
  17478. let cookieDomain = attributeValue
  17479. // 2. If cookie-domain starts with %x2E ("."), let cookie-domain be
  17480. // cookie-domain without its leading %x2E (".").
  17481. if (cookieDomain[0] === '.') {
  17482. cookieDomain = cookieDomain.slice(1)
  17483. }
  17484. // 3. Convert the cookie-domain to lower case.
  17485. cookieDomain = cookieDomain.toLowerCase()
  17486. // 4. Append an attribute to the cookie-attribute-list with an
  17487. // attribute-name of Domain and an attribute-value of cookie-domain.
  17488. cookieAttributeList.domain = cookieDomain
  17489. } else if (attributeNameLowercase === 'path') {
  17490. // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.4
  17491. // If the attribute-name case-insensitively matches the string "Path",
  17492. // the user agent MUST process the cookie-av as follows.
  17493. // 1. If the attribute-value is empty or if the first character of the
  17494. // attribute-value is not %x2F ("/"):
  17495. let cookiePath = ''
  17496. if (attributeValue.length === 0 || attributeValue[0] !== '/') {
  17497. // 1. Let cookie-path be the default-path.
  17498. cookiePath = '/'
  17499. } else {
  17500. // Otherwise:
  17501. // 1. Let cookie-path be the attribute-value.
  17502. cookiePath = attributeValue
  17503. }
  17504. // 2. Append an attribute to the cookie-attribute-list with an
  17505. // attribute-name of Path and an attribute-value of cookie-path.
  17506. cookieAttributeList.path = cookiePath
  17507. } else if (attributeNameLowercase === 'secure') {
  17508. // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.5
  17509. // If the attribute-name case-insensitively matches the string "Secure",
  17510. // the user agent MUST append an attribute to the cookie-attribute-list
  17511. // with an attribute-name of Secure and an empty attribute-value.
  17512. cookieAttributeList.secure = true
  17513. } else if (attributeNameLowercase === 'httponly') {
  17514. // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.6
  17515. // If the attribute-name case-insensitively matches the string
  17516. // "HttpOnly", the user agent MUST append an attribute to the cookie-
  17517. // attribute-list with an attribute-name of HttpOnly and an empty
  17518. // attribute-value.
  17519. cookieAttributeList.httpOnly = true
  17520. } else if (attributeNameLowercase === 'samesite') {
  17521. // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.7
  17522. // If the attribute-name case-insensitively matches the string
  17523. // "SameSite", the user agent MUST process the cookie-av as follows:
  17524. // 1. Let enforcement be "Default".
  17525. let enforcement = 'Default'
  17526. const attributeValueLowercase = attributeValue.toLowerCase()
  17527. // 2. If cookie-av's attribute-value is a case-insensitive match for
  17528. // "None", set enforcement to "None".
  17529. if (attributeValueLowercase.includes('none')) {
  17530. enforcement = 'None'
  17531. }
  17532. // 3. If cookie-av's attribute-value is a case-insensitive match for
  17533. // "Strict", set enforcement to "Strict".
  17534. if (attributeValueLowercase.includes('strict')) {
  17535. enforcement = 'Strict'
  17536. }
  17537. // 4. If cookie-av's attribute-value is a case-insensitive match for
  17538. // "Lax", set enforcement to "Lax".
  17539. if (attributeValueLowercase.includes('lax')) {
  17540. enforcement = 'Lax'
  17541. }
  17542. // 5. Append an attribute to the cookie-attribute-list with an
  17543. // attribute-name of "SameSite" and an attribute-value of
  17544. // enforcement.
  17545. cookieAttributeList.sameSite = enforcement
  17546. } else {
  17547. cookieAttributeList.unparsed ??= []
  17548. cookieAttributeList.unparsed.push(`${attributeName}=${attributeValue}`)
  17549. }
  17550. // 8. Return to Step 1 of this algorithm.
  17551. return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList)
  17552. }
  17553. module.exports = {
  17554. parseSetCookie,
  17555. parseUnparsedAttributes
  17556. }
  17557. /***/ }),
  17558. /***/ 3121:
  17559. /***/ ((module) => {
  17560. "use strict";
  17561. /**
  17562. * @param {string} value
  17563. * @returns {boolean}
  17564. */
  17565. function isCTLExcludingHtab (value) {
  17566. if (value.length === 0) {
  17567. return false
  17568. }
  17569. for (const char of value) {
  17570. const code = char.charCodeAt(0)
  17571. if (
  17572. (code >= 0x00 || code <= 0x08) ||
  17573. (code >= 0x0A || code <= 0x1F) ||
  17574. code === 0x7F
  17575. ) {
  17576. return false
  17577. }
  17578. }
  17579. }
  17580. /**
  17581. CHAR = <any US-ASCII character (octets 0 - 127)>
  17582. token = 1*<any CHAR except CTLs or separators>
  17583. separators = "(" | ")" | "<" | ">" | "@"
  17584. | "," | ";" | ":" | "\" | <">
  17585. | "/" | "[" | "]" | "?" | "="
  17586. | "{" | "}" | SP | HT
  17587. * @param {string} name
  17588. */
  17589. function validateCookieName (name) {
  17590. for (const char of name) {
  17591. const code = char.charCodeAt(0)
  17592. if (
  17593. (code <= 0x20 || code > 0x7F) ||
  17594. char === '(' ||
  17595. char === ')' ||
  17596. char === '>' ||
  17597. char === '<' ||
  17598. char === '@' ||
  17599. char === ',' ||
  17600. char === ';' ||
  17601. char === ':' ||
  17602. char === '\\' ||
  17603. char === '"' ||
  17604. char === '/' ||
  17605. char === '[' ||
  17606. char === ']' ||
  17607. char === '?' ||
  17608. char === '=' ||
  17609. char === '{' ||
  17610. char === '}'
  17611. ) {
  17612. throw new Error('Invalid cookie name')
  17613. }
  17614. }
  17615. }
  17616. /**
  17617. cookie-value = *cookie-octet / ( DQUOTE *cookie-octet DQUOTE )
  17618. cookie-octet = %x21 / %x23-2B / %x2D-3A / %x3C-5B / %x5D-7E
  17619. ; US-ASCII characters excluding CTLs,
  17620. ; whitespace DQUOTE, comma, semicolon,
  17621. ; and backslash
  17622. * @param {string} value
  17623. */
  17624. function validateCookieValue (value) {
  17625. for (const char of value) {
  17626. const code = char.charCodeAt(0)
  17627. if (
  17628. code < 0x21 || // exclude CTLs (0-31)
  17629. code === 0x22 ||
  17630. code === 0x2C ||
  17631. code === 0x3B ||
  17632. code === 0x5C ||
  17633. code > 0x7E // non-ascii
  17634. ) {
  17635. throw new Error('Invalid header value')
  17636. }
  17637. }
  17638. }
  17639. /**
  17640. * path-value = <any CHAR except CTLs or ";">
  17641. * @param {string} path
  17642. */
  17643. function validateCookiePath (path) {
  17644. for (const char of path) {
  17645. const code = char.charCodeAt(0)
  17646. if (code < 0x21 || char === ';') {
  17647. throw new Error('Invalid cookie path')
  17648. }
  17649. }
  17650. }
  17651. /**
  17652. * I have no idea why these values aren't allowed to be honest,
  17653. * but Deno tests these. - Khafra
  17654. * @param {string} domain
  17655. */
  17656. function validateCookieDomain (domain) {
  17657. if (
  17658. domain.startsWith('-') ||
  17659. domain.endsWith('.') ||
  17660. domain.endsWith('-')
  17661. ) {
  17662. throw new Error('Invalid cookie domain')
  17663. }
  17664. }
  17665. /**
  17666. * @see https://www.rfc-editor.org/rfc/rfc7231#section-7.1.1.1
  17667. * @param {number|Date} date
  17668. IMF-fixdate = day-name "," SP date1 SP time-of-day SP GMT
  17669. ; fixed length/zone/capitalization subset of the format
  17670. ; see Section 3.3 of [RFC5322]
  17671. day-name = %x4D.6F.6E ; "Mon", case-sensitive
  17672. / %x54.75.65 ; "Tue", case-sensitive
  17673. / %x57.65.64 ; "Wed", case-sensitive
  17674. / %x54.68.75 ; "Thu", case-sensitive
  17675. / %x46.72.69 ; "Fri", case-sensitive
  17676. / %x53.61.74 ; "Sat", case-sensitive
  17677. / %x53.75.6E ; "Sun", case-sensitive
  17678. date1 = day SP month SP year
  17679. ; e.g., 02 Jun 1982
  17680. day = 2DIGIT
  17681. month = %x4A.61.6E ; "Jan", case-sensitive
  17682. / %x46.65.62 ; "Feb", case-sensitive
  17683. / %x4D.61.72 ; "Mar", case-sensitive
  17684. / %x41.70.72 ; "Apr", case-sensitive
  17685. / %x4D.61.79 ; "May", case-sensitive
  17686. / %x4A.75.6E ; "Jun", case-sensitive
  17687. / %x4A.75.6C ; "Jul", case-sensitive
  17688. / %x41.75.67 ; "Aug", case-sensitive
  17689. / %x53.65.70 ; "Sep", case-sensitive
  17690. / %x4F.63.74 ; "Oct", case-sensitive
  17691. / %x4E.6F.76 ; "Nov", case-sensitive
  17692. / %x44.65.63 ; "Dec", case-sensitive
  17693. year = 4DIGIT
  17694. GMT = %x47.4D.54 ; "GMT", case-sensitive
  17695. time-of-day = hour ":" minute ":" second
  17696. ; 00:00:00 - 23:59:60 (leap second)
  17697. hour = 2DIGIT
  17698. minute = 2DIGIT
  17699. second = 2DIGIT
  17700. */
  17701. function toIMFDate (date) {
  17702. if (typeof date === 'number') {
  17703. date = new Date(date)
  17704. }
  17705. const days = [
  17706. 'Sun', 'Mon', 'Tue', 'Wed',
  17707. 'Thu', 'Fri', 'Sat'
  17708. ]
  17709. const months = [
  17710. 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
  17711. 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'
  17712. ]
  17713. const dayName = days[date.getUTCDay()]
  17714. const day = date.getUTCDate().toString().padStart(2, '0')
  17715. const month = months[date.getUTCMonth()]
  17716. const year = date.getUTCFullYear()
  17717. const hour = date.getUTCHours().toString().padStart(2, '0')
  17718. const minute = date.getUTCMinutes().toString().padStart(2, '0')
  17719. const second = date.getUTCSeconds().toString().padStart(2, '0')
  17720. return `${dayName}, ${day} ${month} ${year} ${hour}:${minute}:${second} GMT`
  17721. }
  17722. /**
  17723. max-age-av = "Max-Age=" non-zero-digit *DIGIT
  17724. ; In practice, both expires-av and max-age-av
  17725. ; are limited to dates representable by the
  17726. ; user agent.
  17727. * @param {number} maxAge
  17728. */
  17729. function validateCookieMaxAge (maxAge) {
  17730. if (maxAge < 0) {
  17731. throw new Error('Invalid cookie max-age')
  17732. }
  17733. }
  17734. /**
  17735. * @see https://www.rfc-editor.org/rfc/rfc6265#section-4.1.1
  17736. * @param {import('./index').Cookie} cookie
  17737. */
  17738. function stringify (cookie) {
  17739. if (cookie.name.length === 0) {
  17740. return null
  17741. }
  17742. validateCookieName(cookie.name)
  17743. validateCookieValue(cookie.value)
  17744. const out = [`${cookie.name}=${cookie.value}`]
  17745. // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-cookie-prefixes-00#section-3.1
  17746. // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-cookie-prefixes-00#section-3.2
  17747. if (cookie.name.startsWith('__Secure-')) {
  17748. cookie.secure = true
  17749. }
  17750. if (cookie.name.startsWith('__Host-')) {
  17751. cookie.secure = true
  17752. cookie.domain = null
  17753. cookie.path = '/'
  17754. }
  17755. if (cookie.secure) {
  17756. out.push('Secure')
  17757. }
  17758. if (cookie.httpOnly) {
  17759. out.push('HttpOnly')
  17760. }
  17761. if (typeof cookie.maxAge === 'number') {
  17762. validateCookieMaxAge(cookie.maxAge)
  17763. out.push(`Max-Age=${cookie.maxAge}`)
  17764. }
  17765. if (cookie.domain) {
  17766. validateCookieDomain(cookie.domain)
  17767. out.push(`Domain=${cookie.domain}`)
  17768. }
  17769. if (cookie.path) {
  17770. validateCookiePath(cookie.path)
  17771. out.push(`Path=${cookie.path}`)
  17772. }
  17773. if (cookie.expires && cookie.expires.toString() !== 'Invalid Date') {
  17774. out.push(`Expires=${toIMFDate(cookie.expires)}`)
  17775. }
  17776. if (cookie.sameSite) {
  17777. out.push(`SameSite=${cookie.sameSite}`)
  17778. }
  17779. for (const part of cookie.unparsed) {
  17780. if (!part.includes('=')) {
  17781. throw new Error('Invalid unparsed')
  17782. }
  17783. const [key, ...value] = part.split('=')
  17784. out.push(`${key.trim()}=${value.join('=')}`)
  17785. }
  17786. return out.join('; ')
  17787. }
  17788. module.exports = {
  17789. isCTLExcludingHtab,
  17790. validateCookieName,
  17791. validateCookiePath,
  17792. validateCookieValue,
  17793. toIMFDate,
  17794. stringify
  17795. }
  17796. /***/ }),
  17797. /***/ 2067:
  17798. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  17799. "use strict";
  17800. const net = __nccwpck_require__(1808)
  17801. const assert = __nccwpck_require__(9491)
  17802. const util = __nccwpck_require__(3983)
  17803. const { InvalidArgumentError, ConnectTimeoutError } = __nccwpck_require__(8045)
  17804. let tls // include tls conditionally since it is not always available
  17805. // TODO: session re-use does not wait for the first
  17806. // connection to resolve the session and might therefore
  17807. // resolve the same servername multiple times even when
  17808. // re-use is enabled.
  17809. let SessionCache
  17810. // FIXME: remove workaround when the Node bug is fixed
  17811. // https://github.com/nodejs/node/issues/49344#issuecomment-1741776308
  17812. if (global.FinalizationRegistry && !process.env.NODE_V8_COVERAGE) {
  17813. SessionCache = class WeakSessionCache {
  17814. constructor (maxCachedSessions) {
  17815. this._maxCachedSessions = maxCachedSessions
  17816. this._sessionCache = new Map()
  17817. this._sessionRegistry = new global.FinalizationRegistry((key) => {
  17818. if (this._sessionCache.size < this._maxCachedSessions) {
  17819. return
  17820. }
  17821. const ref = this._sessionCache.get(key)
  17822. if (ref !== undefined && ref.deref() === undefined) {
  17823. this._sessionCache.delete(key)
  17824. }
  17825. })
  17826. }
  17827. get (sessionKey) {
  17828. const ref = this._sessionCache.get(sessionKey)
  17829. return ref ? ref.deref() : null
  17830. }
  17831. set (sessionKey, session) {
  17832. if (this._maxCachedSessions === 0) {
  17833. return
  17834. }
  17835. this._sessionCache.set(sessionKey, new WeakRef(session))
  17836. this._sessionRegistry.register(session, sessionKey)
  17837. }
  17838. }
  17839. } else {
  17840. SessionCache = class SimpleSessionCache {
  17841. constructor (maxCachedSessions) {
  17842. this._maxCachedSessions = maxCachedSessions
  17843. this._sessionCache = new Map()
  17844. }
  17845. get (sessionKey) {
  17846. return this._sessionCache.get(sessionKey)
  17847. }
  17848. set (sessionKey, session) {
  17849. if (this._maxCachedSessions === 0) {
  17850. return
  17851. }
  17852. if (this._sessionCache.size >= this._maxCachedSessions) {
  17853. // remove the oldest session
  17854. const { value: oldestKey } = this._sessionCache.keys().next()
  17855. this._sessionCache.delete(oldestKey)
  17856. }
  17857. this._sessionCache.set(sessionKey, session)
  17858. }
  17859. }
  17860. }
  17861. function buildConnector ({ allowH2, maxCachedSessions, socketPath, timeout, ...opts }) {
  17862. if (maxCachedSessions != null && (!Number.isInteger(maxCachedSessions) || maxCachedSessions < 0)) {
  17863. throw new InvalidArgumentError('maxCachedSessions must be a positive integer or zero')
  17864. }
  17865. const options = { path: socketPath, ...opts }
  17866. const sessionCache = new SessionCache(maxCachedSessions == null ? 100 : maxCachedSessions)
  17867. timeout = timeout == null ? 10e3 : timeout
  17868. allowH2 = allowH2 != null ? allowH2 : false
  17869. return function connect ({ hostname, host, protocol, port, servername, localAddress, httpSocket }, callback) {
  17870. let socket
  17871. if (protocol === 'https:') {
  17872. if (!tls) {
  17873. tls = __nccwpck_require__(4404)
  17874. }
  17875. servername = servername || options.servername || util.getServerName(host) || null
  17876. const sessionKey = servername || hostname
  17877. const session = sessionCache.get(sessionKey) || null
  17878. assert(sessionKey)
  17879. socket = tls.connect({
  17880. highWaterMark: 16384, // TLS in node can't have bigger HWM anyway...
  17881. ...options,
  17882. servername,
  17883. session,
  17884. localAddress,
  17885. // TODO(HTTP/2): Add support for h2c
  17886. ALPNProtocols: allowH2 ? ['http/1.1', 'h2'] : ['http/1.1'],
  17887. socket: httpSocket, // upgrade socket connection
  17888. port: port || 443,
  17889. host: hostname
  17890. })
  17891. socket
  17892. .on('session', function (session) {
  17893. // TODO (fix): Can a session become invalid once established? Don't think so?
  17894. sessionCache.set(sessionKey, session)
  17895. })
  17896. } else {
  17897. assert(!httpSocket, 'httpSocket can only be sent on TLS update')
  17898. socket = net.connect({
  17899. highWaterMark: 64 * 1024, // Same as nodejs fs streams.
  17900. ...options,
  17901. localAddress,
  17902. port: port || 80,
  17903. host: hostname
  17904. })
  17905. }
  17906. // Set TCP keep alive options on the socket here instead of in connect() for the case of assigning the socket
  17907. if (options.keepAlive == null || options.keepAlive) {
  17908. const keepAliveInitialDelay = options.keepAliveInitialDelay === undefined ? 60e3 : options.keepAliveInitialDelay
  17909. socket.setKeepAlive(true, keepAliveInitialDelay)
  17910. }
  17911. const cancelTimeout = setupTimeout(() => onConnectTimeout(socket), timeout)
  17912. socket
  17913. .setNoDelay(true)
  17914. .once(protocol === 'https:' ? 'secureConnect' : 'connect', function () {
  17915. cancelTimeout()
  17916. if (callback) {
  17917. const cb = callback
  17918. callback = null
  17919. cb(null, this)
  17920. }
  17921. })
  17922. .on('error', function (err) {
  17923. cancelTimeout()
  17924. if (callback) {
  17925. const cb = callback
  17926. callback = null
  17927. cb(err)
  17928. }
  17929. })
  17930. return socket
  17931. }
  17932. }
  17933. function setupTimeout (onConnectTimeout, timeout) {
  17934. if (!timeout) {
  17935. return () => {}
  17936. }
  17937. let s1 = null
  17938. let s2 = null
  17939. const timeoutId = setTimeout(() => {
  17940. // setImmediate is added to make sure that we priotorise socket error events over timeouts
  17941. s1 = setImmediate(() => {
  17942. if (process.platform === 'win32') {
  17943. // Windows needs an extra setImmediate probably due to implementation differences in the socket logic
  17944. s2 = setImmediate(() => onConnectTimeout())
  17945. } else {
  17946. onConnectTimeout()
  17947. }
  17948. })
  17949. }, timeout)
  17950. return () => {
  17951. clearTimeout(timeoutId)
  17952. clearImmediate(s1)
  17953. clearImmediate(s2)
  17954. }
  17955. }
  17956. function onConnectTimeout (socket) {
  17957. util.destroy(socket, new ConnectTimeoutError())
  17958. }
  17959. module.exports = buildConnector
  17960. /***/ }),
  17961. /***/ 4462:
  17962. /***/ ((module) => {
  17963. "use strict";
  17964. /** @type {Record<string, string | undefined>} */
  17965. const headerNameLowerCasedRecord = {}
  17966. // https://developer.mozilla.org/docs/Web/HTTP/Headers
  17967. const wellknownHeaderNames = [
  17968. 'Accept',
  17969. 'Accept-Encoding',
  17970. 'Accept-Language',
  17971. 'Accept-Ranges',
  17972. 'Access-Control-Allow-Credentials',
  17973. 'Access-Control-Allow-Headers',
  17974. 'Access-Control-Allow-Methods',
  17975. 'Access-Control-Allow-Origin',
  17976. 'Access-Control-Expose-Headers',
  17977. 'Access-Control-Max-Age',
  17978. 'Access-Control-Request-Headers',
  17979. 'Access-Control-Request-Method',
  17980. 'Age',
  17981. 'Allow',
  17982. 'Alt-Svc',
  17983. 'Alt-Used',
  17984. 'Authorization',
  17985. 'Cache-Control',
  17986. 'Clear-Site-Data',
  17987. 'Connection',
  17988. 'Content-Disposition',
  17989. 'Content-Encoding',
  17990. 'Content-Language',
  17991. 'Content-Length',
  17992. 'Content-Location',
  17993. 'Content-Range',
  17994. 'Content-Security-Policy',
  17995. 'Content-Security-Policy-Report-Only',
  17996. 'Content-Type',
  17997. 'Cookie',
  17998. 'Cross-Origin-Embedder-Policy',
  17999. 'Cross-Origin-Opener-Policy',
  18000. 'Cross-Origin-Resource-Policy',
  18001. 'Date',
  18002. 'Device-Memory',
  18003. 'Downlink',
  18004. 'ECT',
  18005. 'ETag',
  18006. 'Expect',
  18007. 'Expect-CT',
  18008. 'Expires',
  18009. 'Forwarded',
  18010. 'From',
  18011. 'Host',
  18012. 'If-Match',
  18013. 'If-Modified-Since',
  18014. 'If-None-Match',
  18015. 'If-Range',
  18016. 'If-Unmodified-Since',
  18017. 'Keep-Alive',
  18018. 'Last-Modified',
  18019. 'Link',
  18020. 'Location',
  18021. 'Max-Forwards',
  18022. 'Origin',
  18023. 'Permissions-Policy',
  18024. 'Pragma',
  18025. 'Proxy-Authenticate',
  18026. 'Proxy-Authorization',
  18027. 'RTT',
  18028. 'Range',
  18029. 'Referer',
  18030. 'Referrer-Policy',
  18031. 'Refresh',
  18032. 'Retry-After',
  18033. 'Sec-WebSocket-Accept',
  18034. 'Sec-WebSocket-Extensions',
  18035. 'Sec-WebSocket-Key',
  18036. 'Sec-WebSocket-Protocol',
  18037. 'Sec-WebSocket-Version',
  18038. 'Server',
  18039. 'Server-Timing',
  18040. 'Service-Worker-Allowed',
  18041. 'Service-Worker-Navigation-Preload',
  18042. 'Set-Cookie',
  18043. 'SourceMap',
  18044. 'Strict-Transport-Security',
  18045. 'Supports-Loading-Mode',
  18046. 'TE',
  18047. 'Timing-Allow-Origin',
  18048. 'Trailer',
  18049. 'Transfer-Encoding',
  18050. 'Upgrade',
  18051. 'Upgrade-Insecure-Requests',
  18052. 'User-Agent',
  18053. 'Vary',
  18054. 'Via',
  18055. 'WWW-Authenticate',
  18056. 'X-Content-Type-Options',
  18057. 'X-DNS-Prefetch-Control',
  18058. 'X-Frame-Options',
  18059. 'X-Permitted-Cross-Domain-Policies',
  18060. 'X-Powered-By',
  18061. 'X-Requested-With',
  18062. 'X-XSS-Protection'
  18063. ]
  18064. for (let i = 0; i < wellknownHeaderNames.length; ++i) {
  18065. const key = wellknownHeaderNames[i]
  18066. const lowerCasedKey = key.toLowerCase()
  18067. headerNameLowerCasedRecord[key] = headerNameLowerCasedRecord[lowerCasedKey] =
  18068. lowerCasedKey
  18069. }
  18070. // Note: object prototypes should not be able to be referenced. e.g. `Object#hasOwnProperty`.
  18071. Object.setPrototypeOf(headerNameLowerCasedRecord, null)
  18072. module.exports = {
  18073. wellknownHeaderNames,
  18074. headerNameLowerCasedRecord
  18075. }
  18076. /***/ }),
  18077. /***/ 8045:
  18078. /***/ ((module) => {
  18079. "use strict";
  18080. class UndiciError extends Error {
  18081. constructor (message) {
  18082. super(message)
  18083. this.name = 'UndiciError'
  18084. this.code = 'UND_ERR'
  18085. }
  18086. }
  18087. class ConnectTimeoutError extends UndiciError {
  18088. constructor (message) {
  18089. super(message)
  18090. Error.captureStackTrace(this, ConnectTimeoutError)
  18091. this.name = 'ConnectTimeoutError'
  18092. this.message = message || 'Connect Timeout Error'
  18093. this.code = 'UND_ERR_CONNECT_TIMEOUT'
  18094. }
  18095. }
  18096. class HeadersTimeoutError extends UndiciError {
  18097. constructor (message) {
  18098. super(message)
  18099. Error.captureStackTrace(this, HeadersTimeoutError)
  18100. this.name = 'HeadersTimeoutError'
  18101. this.message = message || 'Headers Timeout Error'
  18102. this.code = 'UND_ERR_HEADERS_TIMEOUT'
  18103. }
  18104. }
  18105. class HeadersOverflowError extends UndiciError {
  18106. constructor (message) {
  18107. super(message)
  18108. Error.captureStackTrace(this, HeadersOverflowError)
  18109. this.name = 'HeadersOverflowError'
  18110. this.message = message || 'Headers Overflow Error'
  18111. this.code = 'UND_ERR_HEADERS_OVERFLOW'
  18112. }
  18113. }
  18114. class BodyTimeoutError extends UndiciError {
  18115. constructor (message) {
  18116. super(message)
  18117. Error.captureStackTrace(this, BodyTimeoutError)
  18118. this.name = 'BodyTimeoutError'
  18119. this.message = message || 'Body Timeout Error'
  18120. this.code = 'UND_ERR_BODY_TIMEOUT'
  18121. }
  18122. }
  18123. class ResponseStatusCodeError extends UndiciError {
  18124. constructor (message, statusCode, headers, body) {
  18125. super(message)
  18126. Error.captureStackTrace(this, ResponseStatusCodeError)
  18127. this.name = 'ResponseStatusCodeError'
  18128. this.message = message || 'Response Status Code Error'
  18129. this.code = 'UND_ERR_RESPONSE_STATUS_CODE'
  18130. this.body = body
  18131. this.status = statusCode
  18132. this.statusCode = statusCode
  18133. this.headers = headers
  18134. }
  18135. }
  18136. class InvalidArgumentError extends UndiciError {
  18137. constructor (message) {
  18138. super(message)
  18139. Error.captureStackTrace(this, InvalidArgumentError)
  18140. this.name = 'InvalidArgumentError'
  18141. this.message = message || 'Invalid Argument Error'
  18142. this.code = 'UND_ERR_INVALID_ARG'
  18143. }
  18144. }
  18145. class InvalidReturnValueError extends UndiciError {
  18146. constructor (message) {
  18147. super(message)
  18148. Error.captureStackTrace(this, InvalidReturnValueError)
  18149. this.name = 'InvalidReturnValueError'
  18150. this.message = message || 'Invalid Return Value Error'
  18151. this.code = 'UND_ERR_INVALID_RETURN_VALUE'
  18152. }
  18153. }
  18154. class RequestAbortedError extends UndiciError {
  18155. constructor (message) {
  18156. super(message)
  18157. Error.captureStackTrace(this, RequestAbortedError)
  18158. this.name = 'AbortError'
  18159. this.message = message || 'Request aborted'
  18160. this.code = 'UND_ERR_ABORTED'
  18161. }
  18162. }
  18163. class InformationalError extends UndiciError {
  18164. constructor (message) {
  18165. super(message)
  18166. Error.captureStackTrace(this, InformationalError)
  18167. this.name = 'InformationalError'
  18168. this.message = message || 'Request information'
  18169. this.code = 'UND_ERR_INFO'
  18170. }
  18171. }
  18172. class RequestContentLengthMismatchError extends UndiciError {
  18173. constructor (message) {
  18174. super(message)
  18175. Error.captureStackTrace(this, RequestContentLengthMismatchError)
  18176. this.name = 'RequestContentLengthMismatchError'
  18177. this.message = message || 'Request body length does not match content-length header'
  18178. this.code = 'UND_ERR_REQ_CONTENT_LENGTH_MISMATCH'
  18179. }
  18180. }
  18181. class ResponseContentLengthMismatchError extends UndiciError {
  18182. constructor (message) {
  18183. super(message)
  18184. Error.captureStackTrace(this, ResponseContentLengthMismatchError)
  18185. this.name = 'ResponseContentLengthMismatchError'
  18186. this.message = message || 'Response body length does not match content-length header'
  18187. this.code = 'UND_ERR_RES_CONTENT_LENGTH_MISMATCH'
  18188. }
  18189. }
  18190. class ClientDestroyedError extends UndiciError {
  18191. constructor (message) {
  18192. super(message)
  18193. Error.captureStackTrace(this, ClientDestroyedError)
  18194. this.name = 'ClientDestroyedError'
  18195. this.message = message || 'The client is destroyed'
  18196. this.code = 'UND_ERR_DESTROYED'
  18197. }
  18198. }
  18199. class ClientClosedError extends UndiciError {
  18200. constructor (message) {
  18201. super(message)
  18202. Error.captureStackTrace(this, ClientClosedError)
  18203. this.name = 'ClientClosedError'
  18204. this.message = message || 'The client is closed'
  18205. this.code = 'UND_ERR_CLOSED'
  18206. }
  18207. }
  18208. class SocketError extends UndiciError {
  18209. constructor (message, socket) {
  18210. super(message)
  18211. Error.captureStackTrace(this, SocketError)
  18212. this.name = 'SocketError'
  18213. this.message = message || 'Socket error'
  18214. this.code = 'UND_ERR_SOCKET'
  18215. this.socket = socket
  18216. }
  18217. }
  18218. class NotSupportedError extends UndiciError {
  18219. constructor (message) {
  18220. super(message)
  18221. Error.captureStackTrace(this, NotSupportedError)
  18222. this.name = 'NotSupportedError'
  18223. this.message = message || 'Not supported error'
  18224. this.code = 'UND_ERR_NOT_SUPPORTED'
  18225. }
  18226. }
  18227. class BalancedPoolMissingUpstreamError extends UndiciError {
  18228. constructor (message) {
  18229. super(message)
  18230. Error.captureStackTrace(this, NotSupportedError)
  18231. this.name = 'MissingUpstreamError'
  18232. this.message = message || 'No upstream has been added to the BalancedPool'
  18233. this.code = 'UND_ERR_BPL_MISSING_UPSTREAM'
  18234. }
  18235. }
  18236. class HTTPParserError extends Error {
  18237. constructor (message, code, data) {
  18238. super(message)
  18239. Error.captureStackTrace(this, HTTPParserError)
  18240. this.name = 'HTTPParserError'
  18241. this.code = code ? `HPE_${code}` : undefined
  18242. this.data = data ? data.toString() : undefined
  18243. }
  18244. }
  18245. class ResponseExceededMaxSizeError extends UndiciError {
  18246. constructor (message) {
  18247. super(message)
  18248. Error.captureStackTrace(this, ResponseExceededMaxSizeError)
  18249. this.name = 'ResponseExceededMaxSizeError'
  18250. this.message = message || 'Response content exceeded max size'
  18251. this.code = 'UND_ERR_RES_EXCEEDED_MAX_SIZE'
  18252. }
  18253. }
  18254. class RequestRetryError extends UndiciError {
  18255. constructor (message, code, { headers, data }) {
  18256. super(message)
  18257. Error.captureStackTrace(this, RequestRetryError)
  18258. this.name = 'RequestRetryError'
  18259. this.message = message || 'Request retry error'
  18260. this.code = 'UND_ERR_REQ_RETRY'
  18261. this.statusCode = code
  18262. this.data = data
  18263. this.headers = headers
  18264. }
  18265. }
  18266. module.exports = {
  18267. HTTPParserError,
  18268. UndiciError,
  18269. HeadersTimeoutError,
  18270. HeadersOverflowError,
  18271. BodyTimeoutError,
  18272. RequestContentLengthMismatchError,
  18273. ConnectTimeoutError,
  18274. ResponseStatusCodeError,
  18275. InvalidArgumentError,
  18276. InvalidReturnValueError,
  18277. RequestAbortedError,
  18278. ClientDestroyedError,
  18279. ClientClosedError,
  18280. InformationalError,
  18281. SocketError,
  18282. NotSupportedError,
  18283. ResponseContentLengthMismatchError,
  18284. BalancedPoolMissingUpstreamError,
  18285. ResponseExceededMaxSizeError,
  18286. RequestRetryError
  18287. }
  18288. /***/ }),
  18289. /***/ 2905:
  18290. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  18291. "use strict";
  18292. const {
  18293. InvalidArgumentError,
  18294. NotSupportedError
  18295. } = __nccwpck_require__(8045)
  18296. const assert = __nccwpck_require__(9491)
  18297. const { kHTTP2BuildRequest, kHTTP2CopyHeaders, kHTTP1BuildRequest } = __nccwpck_require__(2785)
  18298. const util = __nccwpck_require__(3983)
  18299. // tokenRegExp and headerCharRegex have been lifted from
  18300. // https://github.com/nodejs/node/blob/main/lib/_http_common.js
  18301. /**
  18302. * Verifies that the given val is a valid HTTP token
  18303. * per the rules defined in RFC 7230
  18304. * See https://tools.ietf.org/html/rfc7230#section-3.2.6
  18305. */
  18306. const tokenRegExp = /^[\^_`a-zA-Z\-0-9!#$%&'*+.|~]+$/
  18307. /**
  18308. * Matches if val contains an invalid field-vchar
  18309. * field-value = *( field-content / obs-fold )
  18310. * field-content = field-vchar [ 1*( SP / HTAB ) field-vchar ]
  18311. * field-vchar = VCHAR / obs-text
  18312. */
  18313. const headerCharRegex = /[^\t\x20-\x7e\x80-\xff]/
  18314. // Verifies that a given path is valid does not contain control chars \x00 to \x20
  18315. const invalidPathRegex = /[^\u0021-\u00ff]/
  18316. const kHandler = Symbol('handler')
  18317. const channels = {}
  18318. let extractBody
  18319. try {
  18320. const diagnosticsChannel = __nccwpck_require__(7643)
  18321. channels.create = diagnosticsChannel.channel('undici:request:create')
  18322. channels.bodySent = diagnosticsChannel.channel('undici:request:bodySent')
  18323. channels.headers = diagnosticsChannel.channel('undici:request:headers')
  18324. channels.trailers = diagnosticsChannel.channel('undici:request:trailers')
  18325. channels.error = diagnosticsChannel.channel('undici:request:error')
  18326. } catch {
  18327. channels.create = { hasSubscribers: false }
  18328. channels.bodySent = { hasSubscribers: false }
  18329. channels.headers = { hasSubscribers: false }
  18330. channels.trailers = { hasSubscribers: false }
  18331. channels.error = { hasSubscribers: false }
  18332. }
  18333. class Request {
  18334. constructor (origin, {
  18335. path,
  18336. method,
  18337. body,
  18338. headers,
  18339. query,
  18340. idempotent,
  18341. blocking,
  18342. upgrade,
  18343. headersTimeout,
  18344. bodyTimeout,
  18345. reset,
  18346. throwOnError,
  18347. expectContinue
  18348. }, handler) {
  18349. if (typeof path !== 'string') {
  18350. throw new InvalidArgumentError('path must be a string')
  18351. } else if (
  18352. path[0] !== '/' &&
  18353. !(path.startsWith('http://') || path.startsWith('https://')) &&
  18354. method !== 'CONNECT'
  18355. ) {
  18356. throw new InvalidArgumentError('path must be an absolute URL or start with a slash')
  18357. } else if (invalidPathRegex.exec(path) !== null) {
  18358. throw new InvalidArgumentError('invalid request path')
  18359. }
  18360. if (typeof method !== 'string') {
  18361. throw new InvalidArgumentError('method must be a string')
  18362. } else if (tokenRegExp.exec(method) === null) {
  18363. throw new InvalidArgumentError('invalid request method')
  18364. }
  18365. if (upgrade && typeof upgrade !== 'string') {
  18366. throw new InvalidArgumentError('upgrade must be a string')
  18367. }
  18368. if (headersTimeout != null && (!Number.isFinite(headersTimeout) || headersTimeout < 0)) {
  18369. throw new InvalidArgumentError('invalid headersTimeout')
  18370. }
  18371. if (bodyTimeout != null && (!Number.isFinite(bodyTimeout) || bodyTimeout < 0)) {
  18372. throw new InvalidArgumentError('invalid bodyTimeout')
  18373. }
  18374. if (reset != null && typeof reset !== 'boolean') {
  18375. throw new InvalidArgumentError('invalid reset')
  18376. }
  18377. if (expectContinue != null && typeof expectContinue !== 'boolean') {
  18378. throw new InvalidArgumentError('invalid expectContinue')
  18379. }
  18380. this.headersTimeout = headersTimeout
  18381. this.bodyTimeout = bodyTimeout
  18382. this.throwOnError = throwOnError === true
  18383. this.method = method
  18384. this.abort = null
  18385. if (body == null) {
  18386. this.body = null
  18387. } else if (util.isStream(body)) {
  18388. this.body = body
  18389. const rState = this.body._readableState
  18390. if (!rState || !rState.autoDestroy) {
  18391. this.endHandler = function autoDestroy () {
  18392. util.destroy(this)
  18393. }
  18394. this.body.on('end', this.endHandler)
  18395. }
  18396. this.errorHandler = err => {
  18397. if (this.abort) {
  18398. this.abort(err)
  18399. } else {
  18400. this.error = err
  18401. }
  18402. }
  18403. this.body.on('error', this.errorHandler)
  18404. } else if (util.isBuffer(body)) {
  18405. this.body = body.byteLength ? body : null
  18406. } else if (ArrayBuffer.isView(body)) {
  18407. this.body = body.buffer.byteLength ? Buffer.from(body.buffer, body.byteOffset, body.byteLength) : null
  18408. } else if (body instanceof ArrayBuffer) {
  18409. this.body = body.byteLength ? Buffer.from(body) : null
  18410. } else if (typeof body === 'string') {
  18411. this.body = body.length ? Buffer.from(body) : null
  18412. } else if (util.isFormDataLike(body) || util.isIterable(body) || util.isBlobLike(body)) {
  18413. this.body = body
  18414. } else {
  18415. throw new InvalidArgumentError('body must be a string, a Buffer, a Readable stream, an iterable, or an async iterable')
  18416. }
  18417. this.completed = false
  18418. this.aborted = false
  18419. this.upgrade = upgrade || null
  18420. this.path = query ? util.buildURL(path, query) : path
  18421. this.origin = origin
  18422. this.idempotent = idempotent == null
  18423. ? method === 'HEAD' || method === 'GET'
  18424. : idempotent
  18425. this.blocking = blocking == null ? false : blocking
  18426. this.reset = reset == null ? null : reset
  18427. this.host = null
  18428. this.contentLength = null
  18429. this.contentType = null
  18430. this.headers = ''
  18431. // Only for H2
  18432. this.expectContinue = expectContinue != null ? expectContinue : false
  18433. if (Array.isArray(headers)) {
  18434. if (headers.length % 2 !== 0) {
  18435. throw new InvalidArgumentError('headers array must be even')
  18436. }
  18437. for (let i = 0; i < headers.length; i += 2) {
  18438. processHeader(this, headers[i], headers[i + 1])
  18439. }
  18440. } else if (headers && typeof headers === 'object') {
  18441. const keys = Object.keys(headers)
  18442. for (let i = 0; i < keys.length; i++) {
  18443. const key = keys[i]
  18444. processHeader(this, key, headers[key])
  18445. }
  18446. } else if (headers != null) {
  18447. throw new InvalidArgumentError('headers must be an object or an array')
  18448. }
  18449. if (util.isFormDataLike(this.body)) {
  18450. if (util.nodeMajor < 16 || (util.nodeMajor === 16 && util.nodeMinor < 8)) {
  18451. throw new InvalidArgumentError('Form-Data bodies are only supported in node v16.8 and newer.')
  18452. }
  18453. if (!extractBody) {
  18454. extractBody = (__nccwpck_require__(9990).extractBody)
  18455. }
  18456. const [bodyStream, contentType] = extractBody(body)
  18457. if (this.contentType == null) {
  18458. this.contentType = contentType
  18459. this.headers += `content-type: ${contentType}\r\n`
  18460. }
  18461. this.body = bodyStream.stream
  18462. this.contentLength = bodyStream.length
  18463. } else if (util.isBlobLike(body) && this.contentType == null && body.type) {
  18464. this.contentType = body.type
  18465. this.headers += `content-type: ${body.type}\r\n`
  18466. }
  18467. util.validateHandler(handler, method, upgrade)
  18468. this.servername = util.getServerName(this.host)
  18469. this[kHandler] = handler
  18470. if (channels.create.hasSubscribers) {
  18471. channels.create.publish({ request: this })
  18472. }
  18473. }
  18474. onBodySent (chunk) {
  18475. if (this[kHandler].onBodySent) {
  18476. try {
  18477. return this[kHandler].onBodySent(chunk)
  18478. } catch (err) {
  18479. this.abort(err)
  18480. }
  18481. }
  18482. }
  18483. onRequestSent () {
  18484. if (channels.bodySent.hasSubscribers) {
  18485. channels.bodySent.publish({ request: this })
  18486. }
  18487. if (this[kHandler].onRequestSent) {
  18488. try {
  18489. return this[kHandler].onRequestSent()
  18490. } catch (err) {
  18491. this.abort(err)
  18492. }
  18493. }
  18494. }
  18495. onConnect (abort) {
  18496. assert(!this.aborted)
  18497. assert(!this.completed)
  18498. if (this.error) {
  18499. abort(this.error)
  18500. } else {
  18501. this.abort = abort
  18502. return this[kHandler].onConnect(abort)
  18503. }
  18504. }
  18505. onHeaders (statusCode, headers, resume, statusText) {
  18506. assert(!this.aborted)
  18507. assert(!this.completed)
  18508. if (channels.headers.hasSubscribers) {
  18509. channels.headers.publish({ request: this, response: { statusCode, headers, statusText } })
  18510. }
  18511. try {
  18512. return this[kHandler].onHeaders(statusCode, headers, resume, statusText)
  18513. } catch (err) {
  18514. this.abort(err)
  18515. }
  18516. }
  18517. onData (chunk) {
  18518. assert(!this.aborted)
  18519. assert(!this.completed)
  18520. try {
  18521. return this[kHandler].onData(chunk)
  18522. } catch (err) {
  18523. this.abort(err)
  18524. return false
  18525. }
  18526. }
  18527. onUpgrade (statusCode, headers, socket) {
  18528. assert(!this.aborted)
  18529. assert(!this.completed)
  18530. return this[kHandler].onUpgrade(statusCode, headers, socket)
  18531. }
  18532. onComplete (trailers) {
  18533. this.onFinally()
  18534. assert(!this.aborted)
  18535. this.completed = true
  18536. if (channels.trailers.hasSubscribers) {
  18537. channels.trailers.publish({ request: this, trailers })
  18538. }
  18539. try {
  18540. return this[kHandler].onComplete(trailers)
  18541. } catch (err) {
  18542. // TODO (fix): This might be a bad idea?
  18543. this.onError(err)
  18544. }
  18545. }
  18546. onError (error) {
  18547. this.onFinally()
  18548. if (channels.error.hasSubscribers) {
  18549. channels.error.publish({ request: this, error })
  18550. }
  18551. if (this.aborted) {
  18552. return
  18553. }
  18554. this.aborted = true
  18555. return this[kHandler].onError(error)
  18556. }
  18557. onFinally () {
  18558. if (this.errorHandler) {
  18559. this.body.off('error', this.errorHandler)
  18560. this.errorHandler = null
  18561. }
  18562. if (this.endHandler) {
  18563. this.body.off('end', this.endHandler)
  18564. this.endHandler = null
  18565. }
  18566. }
  18567. // TODO: adjust to support H2
  18568. addHeader (key, value) {
  18569. processHeader(this, key, value)
  18570. return this
  18571. }
  18572. static [kHTTP1BuildRequest] (origin, opts, handler) {
  18573. // TODO: Migrate header parsing here, to make Requests
  18574. // HTTP agnostic
  18575. return new Request(origin, opts, handler)
  18576. }
  18577. static [kHTTP2BuildRequest] (origin, opts, handler) {
  18578. const headers = opts.headers
  18579. opts = { ...opts, headers: null }
  18580. const request = new Request(origin, opts, handler)
  18581. request.headers = {}
  18582. if (Array.isArray(headers)) {
  18583. if (headers.length % 2 !== 0) {
  18584. throw new InvalidArgumentError('headers array must be even')
  18585. }
  18586. for (let i = 0; i < headers.length; i += 2) {
  18587. processHeader(request, headers[i], headers[i + 1], true)
  18588. }
  18589. } else if (headers && typeof headers === 'object') {
  18590. const keys = Object.keys(headers)
  18591. for (let i = 0; i < keys.length; i++) {
  18592. const key = keys[i]
  18593. processHeader(request, key, headers[key], true)
  18594. }
  18595. } else if (headers != null) {
  18596. throw new InvalidArgumentError('headers must be an object or an array')
  18597. }
  18598. return request
  18599. }
  18600. static [kHTTP2CopyHeaders] (raw) {
  18601. const rawHeaders = raw.split('\r\n')
  18602. const headers = {}
  18603. for (const header of rawHeaders) {
  18604. const [key, value] = header.split(': ')
  18605. if (value == null || value.length === 0) continue
  18606. if (headers[key]) headers[key] += `,${value}`
  18607. else headers[key] = value
  18608. }
  18609. return headers
  18610. }
  18611. }
  18612. function processHeaderValue (key, val, skipAppend) {
  18613. if (val && typeof val === 'object') {
  18614. throw new InvalidArgumentError(`invalid ${key} header`)
  18615. }
  18616. val = val != null ? `${val}` : ''
  18617. if (headerCharRegex.exec(val) !== null) {
  18618. throw new InvalidArgumentError(`invalid ${key} header`)
  18619. }
  18620. return skipAppend ? val : `${key}: ${val}\r\n`
  18621. }
  18622. function processHeader (request, key, val, skipAppend = false) {
  18623. if (val && (typeof val === 'object' && !Array.isArray(val))) {
  18624. throw new InvalidArgumentError(`invalid ${key} header`)
  18625. } else if (val === undefined) {
  18626. return
  18627. }
  18628. if (
  18629. request.host === null &&
  18630. key.length === 4 &&
  18631. key.toLowerCase() === 'host'
  18632. ) {
  18633. if (headerCharRegex.exec(val) !== null) {
  18634. throw new InvalidArgumentError(`invalid ${key} header`)
  18635. }
  18636. // Consumed by Client
  18637. request.host = val
  18638. } else if (
  18639. request.contentLength === null &&
  18640. key.length === 14 &&
  18641. key.toLowerCase() === 'content-length'
  18642. ) {
  18643. request.contentLength = parseInt(val, 10)
  18644. if (!Number.isFinite(request.contentLength)) {
  18645. throw new InvalidArgumentError('invalid content-length header')
  18646. }
  18647. } else if (
  18648. request.contentType === null &&
  18649. key.length === 12 &&
  18650. key.toLowerCase() === 'content-type'
  18651. ) {
  18652. request.contentType = val
  18653. if (skipAppend) request.headers[key] = processHeaderValue(key, val, skipAppend)
  18654. else request.headers += processHeaderValue(key, val)
  18655. } else if (
  18656. key.length === 17 &&
  18657. key.toLowerCase() === 'transfer-encoding'
  18658. ) {
  18659. throw new InvalidArgumentError('invalid transfer-encoding header')
  18660. } else if (
  18661. key.length === 10 &&
  18662. key.toLowerCase() === 'connection'
  18663. ) {
  18664. const value = typeof val === 'string' ? val.toLowerCase() : null
  18665. if (value !== 'close' && value !== 'keep-alive') {
  18666. throw new InvalidArgumentError('invalid connection header')
  18667. } else if (value === 'close') {
  18668. request.reset = true
  18669. }
  18670. } else if (
  18671. key.length === 10 &&
  18672. key.toLowerCase() === 'keep-alive'
  18673. ) {
  18674. throw new InvalidArgumentError('invalid keep-alive header')
  18675. } else if (
  18676. key.length === 7 &&
  18677. key.toLowerCase() === 'upgrade'
  18678. ) {
  18679. throw new InvalidArgumentError('invalid upgrade header')
  18680. } else if (
  18681. key.length === 6 &&
  18682. key.toLowerCase() === 'expect'
  18683. ) {
  18684. throw new NotSupportedError('expect header not supported')
  18685. } else if (tokenRegExp.exec(key) === null) {
  18686. throw new InvalidArgumentError('invalid header key')
  18687. } else {
  18688. if (Array.isArray(val)) {
  18689. for (let i = 0; i < val.length; i++) {
  18690. if (skipAppend) {
  18691. if (request.headers[key]) request.headers[key] += `,${processHeaderValue(key, val[i], skipAppend)}`
  18692. else request.headers[key] = processHeaderValue(key, val[i], skipAppend)
  18693. } else {
  18694. request.headers += processHeaderValue(key, val[i])
  18695. }
  18696. }
  18697. } else {
  18698. if (skipAppend) request.headers[key] = processHeaderValue(key, val, skipAppend)
  18699. else request.headers += processHeaderValue(key, val)
  18700. }
  18701. }
  18702. }
  18703. module.exports = Request
  18704. /***/ }),
  18705. /***/ 2785:
  18706. /***/ ((module) => {
  18707. module.exports = {
  18708. kClose: Symbol('close'),
  18709. kDestroy: Symbol('destroy'),
  18710. kDispatch: Symbol('dispatch'),
  18711. kUrl: Symbol('url'),
  18712. kWriting: Symbol('writing'),
  18713. kResuming: Symbol('resuming'),
  18714. kQueue: Symbol('queue'),
  18715. kConnect: Symbol('connect'),
  18716. kConnecting: Symbol('connecting'),
  18717. kHeadersList: Symbol('headers list'),
  18718. kKeepAliveDefaultTimeout: Symbol('default keep alive timeout'),
  18719. kKeepAliveMaxTimeout: Symbol('max keep alive timeout'),
  18720. kKeepAliveTimeoutThreshold: Symbol('keep alive timeout threshold'),
  18721. kKeepAliveTimeoutValue: Symbol('keep alive timeout'),
  18722. kKeepAlive: Symbol('keep alive'),
  18723. kHeadersTimeout: Symbol('headers timeout'),
  18724. kBodyTimeout: Symbol('body timeout'),
  18725. kServerName: Symbol('server name'),
  18726. kLocalAddress: Symbol('local address'),
  18727. kHost: Symbol('host'),
  18728. kNoRef: Symbol('no ref'),
  18729. kBodyUsed: Symbol('used'),
  18730. kRunning: Symbol('running'),
  18731. kBlocking: Symbol('blocking'),
  18732. kPending: Symbol('pending'),
  18733. kSize: Symbol('size'),
  18734. kBusy: Symbol('busy'),
  18735. kQueued: Symbol('queued'),
  18736. kFree: Symbol('free'),
  18737. kConnected: Symbol('connected'),
  18738. kClosed: Symbol('closed'),
  18739. kNeedDrain: Symbol('need drain'),
  18740. kReset: Symbol('reset'),
  18741. kDestroyed: Symbol.for('nodejs.stream.destroyed'),
  18742. kMaxHeadersSize: Symbol('max headers size'),
  18743. kRunningIdx: Symbol('running index'),
  18744. kPendingIdx: Symbol('pending index'),
  18745. kError: Symbol('error'),
  18746. kClients: Symbol('clients'),
  18747. kClient: Symbol('client'),
  18748. kParser: Symbol('parser'),
  18749. kOnDestroyed: Symbol('destroy callbacks'),
  18750. kPipelining: Symbol('pipelining'),
  18751. kSocket: Symbol('socket'),
  18752. kHostHeader: Symbol('host header'),
  18753. kConnector: Symbol('connector'),
  18754. kStrictContentLength: Symbol('strict content length'),
  18755. kMaxRedirections: Symbol('maxRedirections'),
  18756. kMaxRequests: Symbol('maxRequestsPerClient'),
  18757. kProxy: Symbol('proxy agent options'),
  18758. kCounter: Symbol('socket request counter'),
  18759. kInterceptors: Symbol('dispatch interceptors'),
  18760. kMaxResponseSize: Symbol('max response size'),
  18761. kHTTP2Session: Symbol('http2Session'),
  18762. kHTTP2SessionState: Symbol('http2Session state'),
  18763. kHTTP2BuildRequest: Symbol('http2 build request'),
  18764. kHTTP1BuildRequest: Symbol('http1 build request'),
  18765. kHTTP2CopyHeaders: Symbol('http2 copy headers'),
  18766. kHTTPConnVersion: Symbol('http connection version'),
  18767. kRetryHandlerDefaultRetry: Symbol('retry agent default retry'),
  18768. kConstruct: Symbol('constructable')
  18769. }
  18770. /***/ }),
  18771. /***/ 3983:
  18772. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  18773. "use strict";
  18774. const assert = __nccwpck_require__(9491)
  18775. const { kDestroyed, kBodyUsed } = __nccwpck_require__(2785)
  18776. const { IncomingMessage } = __nccwpck_require__(3685)
  18777. const stream = __nccwpck_require__(2781)
  18778. const net = __nccwpck_require__(1808)
  18779. const { InvalidArgumentError } = __nccwpck_require__(8045)
  18780. const { Blob } = __nccwpck_require__(4300)
  18781. const nodeUtil = __nccwpck_require__(3837)
  18782. const { stringify } = __nccwpck_require__(3477)
  18783. const { headerNameLowerCasedRecord } = __nccwpck_require__(4462)
  18784. const [nodeMajor, nodeMinor] = process.versions.node.split('.').map(v => Number(v))
  18785. function nop () {}
  18786. function isStream (obj) {
  18787. return obj && typeof obj === 'object' && typeof obj.pipe === 'function' && typeof obj.on === 'function'
  18788. }
  18789. // based on https://github.com/node-fetch/fetch-blob/blob/8ab587d34080de94140b54f07168451e7d0b655e/index.js#L229-L241 (MIT License)
  18790. function isBlobLike (object) {
  18791. return (Blob && object instanceof Blob) || (
  18792. object &&
  18793. typeof object === 'object' &&
  18794. (typeof object.stream === 'function' ||
  18795. typeof object.arrayBuffer === 'function') &&
  18796. /^(Blob|File)$/.test(object[Symbol.toStringTag])
  18797. )
  18798. }
  18799. function buildURL (url, queryParams) {
  18800. if (url.includes('?') || url.includes('#')) {
  18801. throw new Error('Query params cannot be passed when url already contains "?" or "#".')
  18802. }
  18803. const stringified = stringify(queryParams)
  18804. if (stringified) {
  18805. url += '?' + stringified
  18806. }
  18807. return url
  18808. }
  18809. function parseURL (url) {
  18810. if (typeof url === 'string') {
  18811. url = new URL(url)
  18812. if (!/^https?:/.test(url.origin || url.protocol)) {
  18813. throw new InvalidArgumentError('Invalid URL protocol: the URL must start with `http:` or `https:`.')
  18814. }
  18815. return url
  18816. }
  18817. if (!url || typeof url !== 'object') {
  18818. throw new InvalidArgumentError('Invalid URL: The URL argument must be a non-null object.')
  18819. }
  18820. if (!/^https?:/.test(url.origin || url.protocol)) {
  18821. throw new InvalidArgumentError('Invalid URL protocol: the URL must start with `http:` or `https:`.')
  18822. }
  18823. if (!(url instanceof URL)) {
  18824. if (url.port != null && url.port !== '' && !Number.isFinite(parseInt(url.port))) {
  18825. throw new InvalidArgumentError('Invalid URL: port must be a valid integer or a string representation of an integer.')
  18826. }
  18827. if (url.path != null && typeof url.path !== 'string') {
  18828. throw new InvalidArgumentError('Invalid URL path: the path must be a string or null/undefined.')
  18829. }
  18830. if (url.pathname != null && typeof url.pathname !== 'string') {
  18831. throw new InvalidArgumentError('Invalid URL pathname: the pathname must be a string or null/undefined.')
  18832. }
  18833. if (url.hostname != null && typeof url.hostname !== 'string') {
  18834. throw new InvalidArgumentError('Invalid URL hostname: the hostname must be a string or null/undefined.')
  18835. }
  18836. if (url.origin != null && typeof url.origin !== 'string') {
  18837. throw new InvalidArgumentError('Invalid URL origin: the origin must be a string or null/undefined.')
  18838. }
  18839. const port = url.port != null
  18840. ? url.port
  18841. : (url.protocol === 'https:' ? 443 : 80)
  18842. let origin = url.origin != null
  18843. ? url.origin
  18844. : `${url.protocol}//${url.hostname}:${port}`
  18845. let path = url.path != null
  18846. ? url.path
  18847. : `${url.pathname || ''}${url.search || ''}`
  18848. if (origin.endsWith('/')) {
  18849. origin = origin.substring(0, origin.length - 1)
  18850. }
  18851. if (path && !path.startsWith('/')) {
  18852. path = `/${path}`
  18853. }
  18854. // new URL(path, origin) is unsafe when `path` contains an absolute URL
  18855. // From https://developer.mozilla.org/en-US/docs/Web/API/URL/URL:
  18856. // If first parameter is a relative URL, second param is required, and will be used as the base URL.
  18857. // If first parameter is an absolute URL, a given second param will be ignored.
  18858. url = new URL(origin + path)
  18859. }
  18860. return url
  18861. }
  18862. function parseOrigin (url) {
  18863. url = parseURL(url)
  18864. if (url.pathname !== '/' || url.search || url.hash) {
  18865. throw new InvalidArgumentError('invalid url')
  18866. }
  18867. return url
  18868. }
  18869. function getHostname (host) {
  18870. if (host[0] === '[') {
  18871. const idx = host.indexOf(']')
  18872. assert(idx !== -1)
  18873. return host.substring(1, idx)
  18874. }
  18875. const idx = host.indexOf(':')
  18876. if (idx === -1) return host
  18877. return host.substring(0, idx)
  18878. }
  18879. // IP addresses are not valid server names per RFC6066
  18880. // > Currently, the only server names supported are DNS hostnames
  18881. function getServerName (host) {
  18882. if (!host) {
  18883. return null
  18884. }
  18885. assert.strictEqual(typeof host, 'string')
  18886. const servername = getHostname(host)
  18887. if (net.isIP(servername)) {
  18888. return ''
  18889. }
  18890. return servername
  18891. }
  18892. function deepClone (obj) {
  18893. return JSON.parse(JSON.stringify(obj))
  18894. }
  18895. function isAsyncIterable (obj) {
  18896. return !!(obj != null && typeof obj[Symbol.asyncIterator] === 'function')
  18897. }
  18898. function isIterable (obj) {
  18899. return !!(obj != null && (typeof obj[Symbol.iterator] === 'function' || typeof obj[Symbol.asyncIterator] === 'function'))
  18900. }
  18901. function bodyLength (body) {
  18902. if (body == null) {
  18903. return 0
  18904. } else if (isStream(body)) {
  18905. const state = body._readableState
  18906. return state && state.objectMode === false && state.ended === true && Number.isFinite(state.length)
  18907. ? state.length
  18908. : null
  18909. } else if (isBlobLike(body)) {
  18910. return body.size != null ? body.size : null
  18911. } else if (isBuffer(body)) {
  18912. return body.byteLength
  18913. }
  18914. return null
  18915. }
  18916. function isDestroyed (stream) {
  18917. return !stream || !!(stream.destroyed || stream[kDestroyed])
  18918. }
  18919. function isReadableAborted (stream) {
  18920. const state = stream && stream._readableState
  18921. return isDestroyed(stream) && state && !state.endEmitted
  18922. }
  18923. function destroy (stream, err) {
  18924. if (stream == null || !isStream(stream) || isDestroyed(stream)) {
  18925. return
  18926. }
  18927. if (typeof stream.destroy === 'function') {
  18928. if (Object.getPrototypeOf(stream).constructor === IncomingMessage) {
  18929. // See: https://github.com/nodejs/node/pull/38505/files
  18930. stream.socket = null
  18931. }
  18932. stream.destroy(err)
  18933. } else if (err) {
  18934. process.nextTick((stream, err) => {
  18935. stream.emit('error', err)
  18936. }, stream, err)
  18937. }
  18938. if (stream.destroyed !== true) {
  18939. stream[kDestroyed] = true
  18940. }
  18941. }
  18942. const KEEPALIVE_TIMEOUT_EXPR = /timeout=(\d+)/
  18943. function parseKeepAliveTimeout (val) {
  18944. const m = val.toString().match(KEEPALIVE_TIMEOUT_EXPR)
  18945. return m ? parseInt(m[1], 10) * 1000 : null
  18946. }
  18947. /**
  18948. * Retrieves a header name and returns its lowercase value.
  18949. * @param {string | Buffer} value Header name
  18950. * @returns {string}
  18951. */
  18952. function headerNameToString (value) {
  18953. return headerNameLowerCasedRecord[value] || value.toLowerCase()
  18954. }
  18955. function parseHeaders (headers, obj = {}) {
  18956. // For H2 support
  18957. if (!Array.isArray(headers)) return headers
  18958. for (let i = 0; i < headers.length; i += 2) {
  18959. const key = headers[i].toString().toLowerCase()
  18960. let val = obj[key]
  18961. if (!val) {
  18962. if (Array.isArray(headers[i + 1])) {
  18963. obj[key] = headers[i + 1].map(x => x.toString('utf8'))
  18964. } else {
  18965. obj[key] = headers[i + 1].toString('utf8')
  18966. }
  18967. } else {
  18968. if (!Array.isArray(val)) {
  18969. val = [val]
  18970. obj[key] = val
  18971. }
  18972. val.push(headers[i + 1].toString('utf8'))
  18973. }
  18974. }
  18975. // See https://github.com/nodejs/node/pull/46528
  18976. if ('content-length' in obj && 'content-disposition' in obj) {
  18977. obj['content-disposition'] = Buffer.from(obj['content-disposition']).toString('latin1')
  18978. }
  18979. return obj
  18980. }
  18981. function parseRawHeaders (headers) {
  18982. const ret = []
  18983. let hasContentLength = false
  18984. let contentDispositionIdx = -1
  18985. for (let n = 0; n < headers.length; n += 2) {
  18986. const key = headers[n + 0].toString()
  18987. const val = headers[n + 1].toString('utf8')
  18988. if (key.length === 14 && (key === 'content-length' || key.toLowerCase() === 'content-length')) {
  18989. ret.push(key, val)
  18990. hasContentLength = true
  18991. } else if (key.length === 19 && (key === 'content-disposition' || key.toLowerCase() === 'content-disposition')) {
  18992. contentDispositionIdx = ret.push(key, val) - 1
  18993. } else {
  18994. ret.push(key, val)
  18995. }
  18996. }
  18997. // See https://github.com/nodejs/node/pull/46528
  18998. if (hasContentLength && contentDispositionIdx !== -1) {
  18999. ret[contentDispositionIdx] = Buffer.from(ret[contentDispositionIdx]).toString('latin1')
  19000. }
  19001. return ret
  19002. }
  19003. function isBuffer (buffer) {
  19004. // See, https://github.com/mcollina/undici/pull/319
  19005. return buffer instanceof Uint8Array || Buffer.isBuffer(buffer)
  19006. }
  19007. function validateHandler (handler, method, upgrade) {
  19008. if (!handler || typeof handler !== 'object') {
  19009. throw new InvalidArgumentError('handler must be an object')
  19010. }
  19011. if (typeof handler.onConnect !== 'function') {
  19012. throw new InvalidArgumentError('invalid onConnect method')
  19013. }
  19014. if (typeof handler.onError !== 'function') {
  19015. throw new InvalidArgumentError('invalid onError method')
  19016. }
  19017. if (typeof handler.onBodySent !== 'function' && handler.onBodySent !== undefined) {
  19018. throw new InvalidArgumentError('invalid onBodySent method')
  19019. }
  19020. if (upgrade || method === 'CONNECT') {
  19021. if (typeof handler.onUpgrade !== 'function') {
  19022. throw new InvalidArgumentError('invalid onUpgrade method')
  19023. }
  19024. } else {
  19025. if (typeof handler.onHeaders !== 'function') {
  19026. throw new InvalidArgumentError('invalid onHeaders method')
  19027. }
  19028. if (typeof handler.onData !== 'function') {
  19029. throw new InvalidArgumentError('invalid onData method')
  19030. }
  19031. if (typeof handler.onComplete !== 'function') {
  19032. throw new InvalidArgumentError('invalid onComplete method')
  19033. }
  19034. }
  19035. }
  19036. // A body is disturbed if it has been read from and it cannot
  19037. // be re-used without losing state or data.
  19038. function isDisturbed (body) {
  19039. return !!(body && (
  19040. stream.isDisturbed
  19041. ? stream.isDisturbed(body) || body[kBodyUsed] // TODO (fix): Why is body[kBodyUsed] needed?
  19042. : body[kBodyUsed] ||
  19043. body.readableDidRead ||
  19044. (body._readableState && body._readableState.dataEmitted) ||
  19045. isReadableAborted(body)
  19046. ))
  19047. }
  19048. function isErrored (body) {
  19049. return !!(body && (
  19050. stream.isErrored
  19051. ? stream.isErrored(body)
  19052. : /state: 'errored'/.test(nodeUtil.inspect(body)
  19053. )))
  19054. }
  19055. function isReadable (body) {
  19056. return !!(body && (
  19057. stream.isReadable
  19058. ? stream.isReadable(body)
  19059. : /state: 'readable'/.test(nodeUtil.inspect(body)
  19060. )))
  19061. }
  19062. function getSocketInfo (socket) {
  19063. return {
  19064. localAddress: socket.localAddress,
  19065. localPort: socket.localPort,
  19066. remoteAddress: socket.remoteAddress,
  19067. remotePort: socket.remotePort,
  19068. remoteFamily: socket.remoteFamily,
  19069. timeout: socket.timeout,
  19070. bytesWritten: socket.bytesWritten,
  19071. bytesRead: socket.bytesRead
  19072. }
  19073. }
  19074. async function * convertIterableToBuffer (iterable) {
  19075. for await (const chunk of iterable) {
  19076. yield Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk)
  19077. }
  19078. }
  19079. let ReadableStream
  19080. function ReadableStreamFrom (iterable) {
  19081. if (!ReadableStream) {
  19082. ReadableStream = (__nccwpck_require__(5356).ReadableStream)
  19083. }
  19084. if (ReadableStream.from) {
  19085. return ReadableStream.from(convertIterableToBuffer(iterable))
  19086. }
  19087. let iterator
  19088. return new ReadableStream(
  19089. {
  19090. async start () {
  19091. iterator = iterable[Symbol.asyncIterator]()
  19092. },
  19093. async pull (controller) {
  19094. const { done, value } = await iterator.next()
  19095. if (done) {
  19096. queueMicrotask(() => {
  19097. controller.close()
  19098. })
  19099. } else {
  19100. const buf = Buffer.isBuffer(value) ? value : Buffer.from(value)
  19101. controller.enqueue(new Uint8Array(buf))
  19102. }
  19103. return controller.desiredSize > 0
  19104. },
  19105. async cancel (reason) {
  19106. await iterator.return()
  19107. }
  19108. },
  19109. 0
  19110. )
  19111. }
  19112. // The chunk should be a FormData instance and contains
  19113. // all the required methods.
  19114. function isFormDataLike (object) {
  19115. return (
  19116. object &&
  19117. typeof object === 'object' &&
  19118. typeof object.append === 'function' &&
  19119. typeof object.delete === 'function' &&
  19120. typeof object.get === 'function' &&
  19121. typeof object.getAll === 'function' &&
  19122. typeof object.has === 'function' &&
  19123. typeof object.set === 'function' &&
  19124. object[Symbol.toStringTag] === 'FormData'
  19125. )
  19126. }
  19127. function throwIfAborted (signal) {
  19128. if (!signal) { return }
  19129. if (typeof signal.throwIfAborted === 'function') {
  19130. signal.throwIfAborted()
  19131. } else {
  19132. if (signal.aborted) {
  19133. // DOMException not available < v17.0.0
  19134. const err = new Error('The operation was aborted')
  19135. err.name = 'AbortError'
  19136. throw err
  19137. }
  19138. }
  19139. }
  19140. function addAbortListener (signal, listener) {
  19141. if ('addEventListener' in signal) {
  19142. signal.addEventListener('abort', listener, { once: true })
  19143. return () => signal.removeEventListener('abort', listener)
  19144. }
  19145. signal.addListener('abort', listener)
  19146. return () => signal.removeListener('abort', listener)
  19147. }
  19148. const hasToWellFormed = !!String.prototype.toWellFormed
  19149. /**
  19150. * @param {string} val
  19151. */
  19152. function toUSVString (val) {
  19153. if (hasToWellFormed) {
  19154. return `${val}`.toWellFormed()
  19155. } else if (nodeUtil.toUSVString) {
  19156. return nodeUtil.toUSVString(val)
  19157. }
  19158. return `${val}`
  19159. }
  19160. // Parsed accordingly to RFC 9110
  19161. // https://www.rfc-editor.org/rfc/rfc9110#field.content-range
  19162. function parseRangeHeader (range) {
  19163. if (range == null || range === '') return { start: 0, end: null, size: null }
  19164. const m = range ? range.match(/^bytes (\d+)-(\d+)\/(\d+)?$/) : null
  19165. return m
  19166. ? {
  19167. start: parseInt(m[1]),
  19168. end: m[2] ? parseInt(m[2]) : null,
  19169. size: m[3] ? parseInt(m[3]) : null
  19170. }
  19171. : null
  19172. }
  19173. const kEnumerableProperty = Object.create(null)
  19174. kEnumerableProperty.enumerable = true
  19175. module.exports = {
  19176. kEnumerableProperty,
  19177. nop,
  19178. isDisturbed,
  19179. isErrored,
  19180. isReadable,
  19181. toUSVString,
  19182. isReadableAborted,
  19183. isBlobLike,
  19184. parseOrigin,
  19185. parseURL,
  19186. getServerName,
  19187. isStream,
  19188. isIterable,
  19189. isAsyncIterable,
  19190. isDestroyed,
  19191. headerNameToString,
  19192. parseRawHeaders,
  19193. parseHeaders,
  19194. parseKeepAliveTimeout,
  19195. destroy,
  19196. bodyLength,
  19197. deepClone,
  19198. ReadableStreamFrom,
  19199. isBuffer,
  19200. validateHandler,
  19201. getSocketInfo,
  19202. isFormDataLike,
  19203. buildURL,
  19204. throwIfAborted,
  19205. addAbortListener,
  19206. parseRangeHeader,
  19207. nodeMajor,
  19208. nodeMinor,
  19209. nodeHasAutoSelectFamily: nodeMajor > 18 || (nodeMajor === 18 && nodeMinor >= 13),
  19210. safeHTTPMethods: ['GET', 'HEAD', 'OPTIONS', 'TRACE']
  19211. }
  19212. /***/ }),
  19213. /***/ 4839:
  19214. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  19215. "use strict";
  19216. const Dispatcher = __nccwpck_require__(412)
  19217. const {
  19218. ClientDestroyedError,
  19219. ClientClosedError,
  19220. InvalidArgumentError
  19221. } = __nccwpck_require__(8045)
  19222. const { kDestroy, kClose, kDispatch, kInterceptors } = __nccwpck_require__(2785)
  19223. const kDestroyed = Symbol('destroyed')
  19224. const kClosed = Symbol('closed')
  19225. const kOnDestroyed = Symbol('onDestroyed')
  19226. const kOnClosed = Symbol('onClosed')
  19227. const kInterceptedDispatch = Symbol('Intercepted Dispatch')
  19228. class DispatcherBase extends Dispatcher {
  19229. constructor () {
  19230. super()
  19231. this[kDestroyed] = false
  19232. this[kOnDestroyed] = null
  19233. this[kClosed] = false
  19234. this[kOnClosed] = []
  19235. }
  19236. get destroyed () {
  19237. return this[kDestroyed]
  19238. }
  19239. get closed () {
  19240. return this[kClosed]
  19241. }
  19242. get interceptors () {
  19243. return this[kInterceptors]
  19244. }
  19245. set interceptors (newInterceptors) {
  19246. if (newInterceptors) {
  19247. for (let i = newInterceptors.length - 1; i >= 0; i--) {
  19248. const interceptor = this[kInterceptors][i]
  19249. if (typeof interceptor !== 'function') {
  19250. throw new InvalidArgumentError('interceptor must be an function')
  19251. }
  19252. }
  19253. }
  19254. this[kInterceptors] = newInterceptors
  19255. }
  19256. close (callback) {
  19257. if (callback === undefined) {
  19258. return new Promise((resolve, reject) => {
  19259. this.close((err, data) => {
  19260. return err ? reject(err) : resolve(data)
  19261. })
  19262. })
  19263. }
  19264. if (typeof callback !== 'function') {
  19265. throw new InvalidArgumentError('invalid callback')
  19266. }
  19267. if (this[kDestroyed]) {
  19268. queueMicrotask(() => callback(new ClientDestroyedError(), null))
  19269. return
  19270. }
  19271. if (this[kClosed]) {
  19272. if (this[kOnClosed]) {
  19273. this[kOnClosed].push(callback)
  19274. } else {
  19275. queueMicrotask(() => callback(null, null))
  19276. }
  19277. return
  19278. }
  19279. this[kClosed] = true
  19280. this[kOnClosed].push(callback)
  19281. const onClosed = () => {
  19282. const callbacks = this[kOnClosed]
  19283. this[kOnClosed] = null
  19284. for (let i = 0; i < callbacks.length; i++) {
  19285. callbacks[i](null, null)
  19286. }
  19287. }
  19288. // Should not error.
  19289. this[kClose]()
  19290. .then(() => this.destroy())
  19291. .then(() => {
  19292. queueMicrotask(onClosed)
  19293. })
  19294. }
  19295. destroy (err, callback) {
  19296. if (typeof err === 'function') {
  19297. callback = err
  19298. err = null
  19299. }
  19300. if (callback === undefined) {
  19301. return new Promise((resolve, reject) => {
  19302. this.destroy(err, (err, data) => {
  19303. return err ? /* istanbul ignore next: should never error */ reject(err) : resolve(data)
  19304. })
  19305. })
  19306. }
  19307. if (typeof callback !== 'function') {
  19308. throw new InvalidArgumentError('invalid callback')
  19309. }
  19310. if (this[kDestroyed]) {
  19311. if (this[kOnDestroyed]) {
  19312. this[kOnDestroyed].push(callback)
  19313. } else {
  19314. queueMicrotask(() => callback(null, null))
  19315. }
  19316. return
  19317. }
  19318. if (!err) {
  19319. err = new ClientDestroyedError()
  19320. }
  19321. this[kDestroyed] = true
  19322. this[kOnDestroyed] = this[kOnDestroyed] || []
  19323. this[kOnDestroyed].push(callback)
  19324. const onDestroyed = () => {
  19325. const callbacks = this[kOnDestroyed]
  19326. this[kOnDestroyed] = null
  19327. for (let i = 0; i < callbacks.length; i++) {
  19328. callbacks[i](null, null)
  19329. }
  19330. }
  19331. // Should not error.
  19332. this[kDestroy](err).then(() => {
  19333. queueMicrotask(onDestroyed)
  19334. })
  19335. }
  19336. [kInterceptedDispatch] (opts, handler) {
  19337. if (!this[kInterceptors] || this[kInterceptors].length === 0) {
  19338. this[kInterceptedDispatch] = this[kDispatch]
  19339. return this[kDispatch](opts, handler)
  19340. }
  19341. let dispatch = this[kDispatch].bind(this)
  19342. for (let i = this[kInterceptors].length - 1; i >= 0; i--) {
  19343. dispatch = this[kInterceptors][i](dispatch)
  19344. }
  19345. this[kInterceptedDispatch] = dispatch
  19346. return dispatch(opts, handler)
  19347. }
  19348. dispatch (opts, handler) {
  19349. if (!handler || typeof handler !== 'object') {
  19350. throw new InvalidArgumentError('handler must be an object')
  19351. }
  19352. try {
  19353. if (!opts || typeof opts !== 'object') {
  19354. throw new InvalidArgumentError('opts must be an object.')
  19355. }
  19356. if (this[kDestroyed] || this[kOnDestroyed]) {
  19357. throw new ClientDestroyedError()
  19358. }
  19359. if (this[kClosed]) {
  19360. throw new ClientClosedError()
  19361. }
  19362. return this[kInterceptedDispatch](opts, handler)
  19363. } catch (err) {
  19364. if (typeof handler.onError !== 'function') {
  19365. throw new InvalidArgumentError('invalid onError method')
  19366. }
  19367. handler.onError(err)
  19368. return false
  19369. }
  19370. }
  19371. }
  19372. module.exports = DispatcherBase
  19373. /***/ }),
  19374. /***/ 412:
  19375. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  19376. "use strict";
  19377. const EventEmitter = __nccwpck_require__(2361)
  19378. class Dispatcher extends EventEmitter {
  19379. dispatch () {
  19380. throw new Error('not implemented')
  19381. }
  19382. close () {
  19383. throw new Error('not implemented')
  19384. }
  19385. destroy () {
  19386. throw new Error('not implemented')
  19387. }
  19388. }
  19389. module.exports = Dispatcher
  19390. /***/ }),
  19391. /***/ 9990:
  19392. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  19393. "use strict";
  19394. const Busboy = __nccwpck_require__(727)
  19395. const util = __nccwpck_require__(3983)
  19396. const {
  19397. ReadableStreamFrom,
  19398. isBlobLike,
  19399. isReadableStreamLike,
  19400. readableStreamClose,
  19401. createDeferredPromise,
  19402. fullyReadBody
  19403. } = __nccwpck_require__(2538)
  19404. const { FormData } = __nccwpck_require__(2015)
  19405. const { kState } = __nccwpck_require__(5861)
  19406. const { webidl } = __nccwpck_require__(1744)
  19407. const { DOMException, structuredClone } = __nccwpck_require__(1037)
  19408. const { Blob, File: NativeFile } = __nccwpck_require__(4300)
  19409. const { kBodyUsed } = __nccwpck_require__(2785)
  19410. const assert = __nccwpck_require__(9491)
  19411. const { isErrored } = __nccwpck_require__(3983)
  19412. const { isUint8Array, isArrayBuffer } = __nccwpck_require__(9830)
  19413. const { File: UndiciFile } = __nccwpck_require__(8511)
  19414. const { parseMIMEType, serializeAMimeType } = __nccwpck_require__(685)
  19415. let random
  19416. try {
  19417. const crypto = __nccwpck_require__(6005)
  19418. random = (max) => crypto.randomInt(0, max)
  19419. } catch {
  19420. random = (max) => Math.floor(Math.random(max))
  19421. }
  19422. let ReadableStream = globalThis.ReadableStream
  19423. /** @type {globalThis['File']} */
  19424. const File = NativeFile ?? UndiciFile
  19425. const textEncoder = new TextEncoder()
  19426. const textDecoder = new TextDecoder()
  19427. // https://fetch.spec.whatwg.org/#concept-bodyinit-extract
  19428. function extractBody (object, keepalive = false) {
  19429. if (!ReadableStream) {
  19430. ReadableStream = (__nccwpck_require__(5356).ReadableStream)
  19431. }
  19432. // 1. Let stream be null.
  19433. let stream = null
  19434. // 2. If object is a ReadableStream object, then set stream to object.
  19435. if (object instanceof ReadableStream) {
  19436. stream = object
  19437. } else if (isBlobLike(object)) {
  19438. // 3. Otherwise, if object is a Blob object, set stream to the
  19439. // result of running object’s get stream.
  19440. stream = object.stream()
  19441. } else {
  19442. // 4. Otherwise, set stream to a new ReadableStream object, and set
  19443. // up stream.
  19444. stream = new ReadableStream({
  19445. async pull (controller) {
  19446. controller.enqueue(
  19447. typeof source === 'string' ? textEncoder.encode(source) : source
  19448. )
  19449. queueMicrotask(() => readableStreamClose(controller))
  19450. },
  19451. start () {},
  19452. type: undefined
  19453. })
  19454. }
  19455. // 5. Assert: stream is a ReadableStream object.
  19456. assert(isReadableStreamLike(stream))
  19457. // 6. Let action be null.
  19458. let action = null
  19459. // 7. Let source be null.
  19460. let source = null
  19461. // 8. Let length be null.
  19462. let length = null
  19463. // 9. Let type be null.
  19464. let type = null
  19465. // 10. Switch on object:
  19466. if (typeof object === 'string') {
  19467. // Set source to the UTF-8 encoding of object.
  19468. // Note: setting source to a Uint8Array here breaks some mocking assumptions.
  19469. source = object
  19470. // Set type to `text/plain;charset=UTF-8`.
  19471. type = 'text/plain;charset=UTF-8'
  19472. } else if (object instanceof URLSearchParams) {
  19473. // URLSearchParams
  19474. // spec says to run application/x-www-form-urlencoded on body.list
  19475. // this is implemented in Node.js as apart of an URLSearchParams instance toString method
  19476. // See: https://github.com/nodejs/node/blob/e46c680bf2b211bbd52cf959ca17ee98c7f657f5/lib/internal/url.js#L490
  19477. // and https://github.com/nodejs/node/blob/e46c680bf2b211bbd52cf959ca17ee98c7f657f5/lib/internal/url.js#L1100
  19478. // Set source to the result of running the application/x-www-form-urlencoded serializer with object’s list.
  19479. source = object.toString()
  19480. // Set type to `application/x-www-form-urlencoded;charset=UTF-8`.
  19481. type = 'application/x-www-form-urlencoded;charset=UTF-8'
  19482. } else if (isArrayBuffer(object)) {
  19483. // BufferSource/ArrayBuffer
  19484. // Set source to a copy of the bytes held by object.
  19485. source = new Uint8Array(object.slice())
  19486. } else if (ArrayBuffer.isView(object)) {
  19487. // BufferSource/ArrayBufferView
  19488. // Set source to a copy of the bytes held by object.
  19489. source = new Uint8Array(object.buffer.slice(object.byteOffset, object.byteOffset + object.byteLength))
  19490. } else if (util.isFormDataLike(object)) {
  19491. const boundary = `----formdata-undici-0${`${random(1e11)}`.padStart(11, '0')}`
  19492. const prefix = `--${boundary}\r\nContent-Disposition: form-data`
  19493. /*! formdata-polyfill. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> */
  19494. const escape = (str) =>
  19495. str.replace(/\n/g, '%0A').replace(/\r/g, '%0D').replace(/"/g, '%22')
  19496. const normalizeLinefeeds = (value) => value.replace(/\r?\n|\r/g, '\r\n')
  19497. // Set action to this step: run the multipart/form-data
  19498. // encoding algorithm, with object’s entry list and UTF-8.
  19499. // - This ensures that the body is immutable and can't be changed afterwords
  19500. // - That the content-length is calculated in advance.
  19501. // - And that all parts are pre-encoded and ready to be sent.
  19502. const blobParts = []
  19503. const rn = new Uint8Array([13, 10]) // '\r\n'
  19504. length = 0
  19505. let hasUnknownSizeValue = false
  19506. for (const [name, value] of object) {
  19507. if (typeof value === 'string') {
  19508. const chunk = textEncoder.encode(prefix +
  19509. `; name="${escape(normalizeLinefeeds(name))}"` +
  19510. `\r\n\r\n${normalizeLinefeeds(value)}\r\n`)
  19511. blobParts.push(chunk)
  19512. length += chunk.byteLength
  19513. } else {
  19514. const chunk = textEncoder.encode(`${prefix}; name="${escape(normalizeLinefeeds(name))}"` +
  19515. (value.name ? `; filename="${escape(value.name)}"` : '') + '\r\n' +
  19516. `Content-Type: ${
  19517. value.type || 'application/octet-stream'
  19518. }\r\n\r\n`)
  19519. blobParts.push(chunk, value, rn)
  19520. if (typeof value.size === 'number') {
  19521. length += chunk.byteLength + value.size + rn.byteLength
  19522. } else {
  19523. hasUnknownSizeValue = true
  19524. }
  19525. }
  19526. }
  19527. const chunk = textEncoder.encode(`--${boundary}--`)
  19528. blobParts.push(chunk)
  19529. length += chunk.byteLength
  19530. if (hasUnknownSizeValue) {
  19531. length = null
  19532. }
  19533. // Set source to object.
  19534. source = object
  19535. action = async function * () {
  19536. for (const part of blobParts) {
  19537. if (part.stream) {
  19538. yield * part.stream()
  19539. } else {
  19540. yield part
  19541. }
  19542. }
  19543. }
  19544. // Set type to `multipart/form-data; boundary=`,
  19545. // followed by the multipart/form-data boundary string generated
  19546. // by the multipart/form-data encoding algorithm.
  19547. type = 'multipart/form-data; boundary=' + boundary
  19548. } else if (isBlobLike(object)) {
  19549. // Blob
  19550. // Set source to object.
  19551. source = object
  19552. // Set length to object’s size.
  19553. length = object.size
  19554. // If object’s type attribute is not the empty byte sequence, set
  19555. // type to its value.
  19556. if (object.type) {
  19557. type = object.type
  19558. }
  19559. } else if (typeof object[Symbol.asyncIterator] === 'function') {
  19560. // If keepalive is true, then throw a TypeError.
  19561. if (keepalive) {
  19562. throw new TypeError('keepalive')
  19563. }
  19564. // If object is disturbed or locked, then throw a TypeError.
  19565. if (util.isDisturbed(object) || object.locked) {
  19566. throw new TypeError(
  19567. 'Response body object should not be disturbed or locked'
  19568. )
  19569. }
  19570. stream =
  19571. object instanceof ReadableStream ? object : ReadableStreamFrom(object)
  19572. }
  19573. // 11. If source is a byte sequence, then set action to a
  19574. // step that returns source and length to source’s length.
  19575. if (typeof source === 'string' || util.isBuffer(source)) {
  19576. length = Buffer.byteLength(source)
  19577. }
  19578. // 12. If action is non-null, then run these steps in in parallel:
  19579. if (action != null) {
  19580. // Run action.
  19581. let iterator
  19582. stream = new ReadableStream({
  19583. async start () {
  19584. iterator = action(object)[Symbol.asyncIterator]()
  19585. },
  19586. async pull (controller) {
  19587. const { value, done } = await iterator.next()
  19588. if (done) {
  19589. // When running action is done, close stream.
  19590. queueMicrotask(() => {
  19591. controller.close()
  19592. })
  19593. } else {
  19594. // Whenever one or more bytes are available and stream is not errored,
  19595. // enqueue a Uint8Array wrapping an ArrayBuffer containing the available
  19596. // bytes into stream.
  19597. if (!isErrored(stream)) {
  19598. controller.enqueue(new Uint8Array(value))
  19599. }
  19600. }
  19601. return controller.desiredSize > 0
  19602. },
  19603. async cancel (reason) {
  19604. await iterator.return()
  19605. },
  19606. type: undefined
  19607. })
  19608. }
  19609. // 13. Let body be a body whose stream is stream, source is source,
  19610. // and length is length.
  19611. const body = { stream, source, length }
  19612. // 14. Return (body, type).
  19613. return [body, type]
  19614. }
  19615. // https://fetch.spec.whatwg.org/#bodyinit-safely-extract
  19616. function safelyExtractBody (object, keepalive = false) {
  19617. if (!ReadableStream) {
  19618. // istanbul ignore next
  19619. ReadableStream = (__nccwpck_require__(5356).ReadableStream)
  19620. }
  19621. // To safely extract a body and a `Content-Type` value from
  19622. // a byte sequence or BodyInit object object, run these steps:
  19623. // 1. If object is a ReadableStream object, then:
  19624. if (object instanceof ReadableStream) {
  19625. // Assert: object is neither disturbed nor locked.
  19626. // istanbul ignore next
  19627. assert(!util.isDisturbed(object), 'The body has already been consumed.')
  19628. // istanbul ignore next
  19629. assert(!object.locked, 'The stream is locked.')
  19630. }
  19631. // 2. Return the results of extracting object.
  19632. return extractBody(object, keepalive)
  19633. }
  19634. function cloneBody (body) {
  19635. // To clone a body body, run these steps:
  19636. // https://fetch.spec.whatwg.org/#concept-body-clone
  19637. // 1. Let « out1, out2 » be the result of teeing body’s stream.
  19638. const [out1, out2] = body.stream.tee()
  19639. const out2Clone = structuredClone(out2, { transfer: [out2] })
  19640. // This, for whatever reasons, unrefs out2Clone which allows
  19641. // the process to exit by itself.
  19642. const [, finalClone] = out2Clone.tee()
  19643. // 2. Set body’s stream to out1.
  19644. body.stream = out1
  19645. // 3. Return a body whose stream is out2 and other members are copied from body.
  19646. return {
  19647. stream: finalClone,
  19648. length: body.length,
  19649. source: body.source
  19650. }
  19651. }
  19652. async function * consumeBody (body) {
  19653. if (body) {
  19654. if (isUint8Array(body)) {
  19655. yield body
  19656. } else {
  19657. const stream = body.stream
  19658. if (util.isDisturbed(stream)) {
  19659. throw new TypeError('The body has already been consumed.')
  19660. }
  19661. if (stream.locked) {
  19662. throw new TypeError('The stream is locked.')
  19663. }
  19664. // Compat.
  19665. stream[kBodyUsed] = true
  19666. yield * stream
  19667. }
  19668. }
  19669. }
  19670. function throwIfAborted (state) {
  19671. if (state.aborted) {
  19672. throw new DOMException('The operation was aborted.', 'AbortError')
  19673. }
  19674. }
  19675. function bodyMixinMethods (instance) {
  19676. const methods = {
  19677. blob () {
  19678. // The blob() method steps are to return the result of
  19679. // running consume body with this and the following step
  19680. // given a byte sequence bytes: return a Blob whose
  19681. // contents are bytes and whose type attribute is this’s
  19682. // MIME type.
  19683. return specConsumeBody(this, (bytes) => {
  19684. let mimeType = bodyMimeType(this)
  19685. if (mimeType === 'failure') {
  19686. mimeType = ''
  19687. } else if (mimeType) {
  19688. mimeType = serializeAMimeType(mimeType)
  19689. }
  19690. // Return a Blob whose contents are bytes and type attribute
  19691. // is mimeType.
  19692. return new Blob([bytes], { type: mimeType })
  19693. }, instance)
  19694. },
  19695. arrayBuffer () {
  19696. // The arrayBuffer() method steps are to return the result
  19697. // of running consume body with this and the following step
  19698. // given a byte sequence bytes: return a new ArrayBuffer
  19699. // whose contents are bytes.
  19700. return specConsumeBody(this, (bytes) => {
  19701. return new Uint8Array(bytes).buffer
  19702. }, instance)
  19703. },
  19704. text () {
  19705. // The text() method steps are to return the result of running
  19706. // consume body with this and UTF-8 decode.
  19707. return specConsumeBody(this, utf8DecodeBytes, instance)
  19708. },
  19709. json () {
  19710. // The json() method steps are to return the result of running
  19711. // consume body with this and parse JSON from bytes.
  19712. return specConsumeBody(this, parseJSONFromBytes, instance)
  19713. },
  19714. async formData () {
  19715. webidl.brandCheck(this, instance)
  19716. throwIfAborted(this[kState])
  19717. const contentType = this.headers.get('Content-Type')
  19718. // If mimeType’s essence is "multipart/form-data", then:
  19719. if (/multipart\/form-data/.test(contentType)) {
  19720. const headers = {}
  19721. for (const [key, value] of this.headers) headers[key.toLowerCase()] = value
  19722. const responseFormData = new FormData()
  19723. let busboy
  19724. try {
  19725. busboy = new Busboy({
  19726. headers,
  19727. preservePath: true
  19728. })
  19729. } catch (err) {
  19730. throw new DOMException(`${err}`, 'AbortError')
  19731. }
  19732. busboy.on('field', (name, value) => {
  19733. responseFormData.append(name, value)
  19734. })
  19735. busboy.on('file', (name, value, filename, encoding, mimeType) => {
  19736. const chunks = []
  19737. if (encoding === 'base64' || encoding.toLowerCase() === 'base64') {
  19738. let base64chunk = ''
  19739. value.on('data', (chunk) => {
  19740. base64chunk += chunk.toString().replace(/[\r\n]/gm, '')
  19741. const end = base64chunk.length - base64chunk.length % 4
  19742. chunks.push(Buffer.from(base64chunk.slice(0, end), 'base64'))
  19743. base64chunk = base64chunk.slice(end)
  19744. })
  19745. value.on('end', () => {
  19746. chunks.push(Buffer.from(base64chunk, 'base64'))
  19747. responseFormData.append(name, new File(chunks, filename, { type: mimeType }))
  19748. })
  19749. } else {
  19750. value.on('data', (chunk) => {
  19751. chunks.push(chunk)
  19752. })
  19753. value.on('end', () => {
  19754. responseFormData.append(name, new File(chunks, filename, { type: mimeType }))
  19755. })
  19756. }
  19757. })
  19758. const busboyResolve = new Promise((resolve, reject) => {
  19759. busboy.on('finish', resolve)
  19760. busboy.on('error', (err) => reject(new TypeError(err)))
  19761. })
  19762. if (this.body !== null) for await (const chunk of consumeBody(this[kState].body)) busboy.write(chunk)
  19763. busboy.end()
  19764. await busboyResolve
  19765. return responseFormData
  19766. } else if (/application\/x-www-form-urlencoded/.test(contentType)) {
  19767. // Otherwise, if mimeType’s essence is "application/x-www-form-urlencoded", then:
  19768. // 1. Let entries be the result of parsing bytes.
  19769. let entries
  19770. try {
  19771. let text = ''
  19772. // application/x-www-form-urlencoded parser will keep the BOM.
  19773. // https://url.spec.whatwg.org/#concept-urlencoded-parser
  19774. // Note that streaming decoder is stateful and cannot be reused
  19775. const streamingDecoder = new TextDecoder('utf-8', { ignoreBOM: true })
  19776. for await (const chunk of consumeBody(this[kState].body)) {
  19777. if (!isUint8Array(chunk)) {
  19778. throw new TypeError('Expected Uint8Array chunk')
  19779. }
  19780. text += streamingDecoder.decode(chunk, { stream: true })
  19781. }
  19782. text += streamingDecoder.decode()
  19783. entries = new URLSearchParams(text)
  19784. } catch (err) {
  19785. // istanbul ignore next: Unclear when new URLSearchParams can fail on a string.
  19786. // 2. If entries is failure, then throw a TypeError.
  19787. throw Object.assign(new TypeError(), { cause: err })
  19788. }
  19789. // 3. Return a new FormData object whose entries are entries.
  19790. const formData = new FormData()
  19791. for (const [name, value] of entries) {
  19792. formData.append(name, value)
  19793. }
  19794. return formData
  19795. } else {
  19796. // Wait a tick before checking if the request has been aborted.
  19797. // Otherwise, a TypeError can be thrown when an AbortError should.
  19798. await Promise.resolve()
  19799. throwIfAborted(this[kState])
  19800. // Otherwise, throw a TypeError.
  19801. throw webidl.errors.exception({
  19802. header: `${instance.name}.formData`,
  19803. message: 'Could not parse content as FormData.'
  19804. })
  19805. }
  19806. }
  19807. }
  19808. return methods
  19809. }
  19810. function mixinBody (prototype) {
  19811. Object.assign(prototype.prototype, bodyMixinMethods(prototype))
  19812. }
  19813. /**
  19814. * @see https://fetch.spec.whatwg.org/#concept-body-consume-body
  19815. * @param {Response|Request} object
  19816. * @param {(value: unknown) => unknown} convertBytesToJSValue
  19817. * @param {Response|Request} instance
  19818. */
  19819. async function specConsumeBody (object, convertBytesToJSValue, instance) {
  19820. webidl.brandCheck(object, instance)
  19821. throwIfAborted(object[kState])
  19822. // 1. If object is unusable, then return a promise rejected
  19823. // with a TypeError.
  19824. if (bodyUnusable(object[kState].body)) {
  19825. throw new TypeError('Body is unusable')
  19826. }
  19827. // 2. Let promise be a new promise.
  19828. const promise = createDeferredPromise()
  19829. // 3. Let errorSteps given error be to reject promise with error.
  19830. const errorSteps = (error) => promise.reject(error)
  19831. // 4. Let successSteps given a byte sequence data be to resolve
  19832. // promise with the result of running convertBytesToJSValue
  19833. // with data. If that threw an exception, then run errorSteps
  19834. // with that exception.
  19835. const successSteps = (data) => {
  19836. try {
  19837. promise.resolve(convertBytesToJSValue(data))
  19838. } catch (e) {
  19839. errorSteps(e)
  19840. }
  19841. }
  19842. // 5. If object’s body is null, then run successSteps with an
  19843. // empty byte sequence.
  19844. if (object[kState].body == null) {
  19845. successSteps(new Uint8Array())
  19846. return promise.promise
  19847. }
  19848. // 6. Otherwise, fully read object’s body given successSteps,
  19849. // errorSteps, and object’s relevant global object.
  19850. await fullyReadBody(object[kState].body, successSteps, errorSteps)
  19851. // 7. Return promise.
  19852. return promise.promise
  19853. }
  19854. // https://fetch.spec.whatwg.org/#body-unusable
  19855. function bodyUnusable (body) {
  19856. // An object including the Body interface mixin is
  19857. // said to be unusable if its body is non-null and
  19858. // its body’s stream is disturbed or locked.
  19859. return body != null && (body.stream.locked || util.isDisturbed(body.stream))
  19860. }
  19861. /**
  19862. * @see https://encoding.spec.whatwg.org/#utf-8-decode
  19863. * @param {Buffer} buffer
  19864. */
  19865. function utf8DecodeBytes (buffer) {
  19866. if (buffer.length === 0) {
  19867. return ''
  19868. }
  19869. // 1. Let buffer be the result of peeking three bytes from
  19870. // ioQueue, converted to a byte sequence.
  19871. // 2. If buffer is 0xEF 0xBB 0xBF, then read three
  19872. // bytes from ioQueue. (Do nothing with those bytes.)
  19873. if (buffer[0] === 0xEF && buffer[1] === 0xBB && buffer[2] === 0xBF) {
  19874. buffer = buffer.subarray(3)
  19875. }
  19876. // 3. Process a queue with an instance of UTF-8’s
  19877. // decoder, ioQueue, output, and "replacement".
  19878. const output = textDecoder.decode(buffer)
  19879. // 4. Return output.
  19880. return output
  19881. }
  19882. /**
  19883. * @see https://infra.spec.whatwg.org/#parse-json-bytes-to-a-javascript-value
  19884. * @param {Uint8Array} bytes
  19885. */
  19886. function parseJSONFromBytes (bytes) {
  19887. return JSON.parse(utf8DecodeBytes(bytes))
  19888. }
  19889. /**
  19890. * @see https://fetch.spec.whatwg.org/#concept-body-mime-type
  19891. * @param {import('./response').Response|import('./request').Request} object
  19892. */
  19893. function bodyMimeType (object) {
  19894. const { headersList } = object[kState]
  19895. const contentType = headersList.get('content-type')
  19896. if (contentType === null) {
  19897. return 'failure'
  19898. }
  19899. return parseMIMEType(contentType)
  19900. }
  19901. module.exports = {
  19902. extractBody,
  19903. safelyExtractBody,
  19904. cloneBody,
  19905. mixinBody
  19906. }
  19907. /***/ }),
  19908. /***/ 1037:
  19909. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  19910. "use strict";
  19911. const { MessageChannel, receiveMessageOnPort } = __nccwpck_require__(1267)
  19912. const corsSafeListedMethods = ['GET', 'HEAD', 'POST']
  19913. const corsSafeListedMethodsSet = new Set(corsSafeListedMethods)
  19914. const nullBodyStatus = [101, 204, 205, 304]
  19915. const redirectStatus = [301, 302, 303, 307, 308]
  19916. const redirectStatusSet = new Set(redirectStatus)
  19917. // https://fetch.spec.whatwg.org/#block-bad-port
  19918. const badPorts = [
  19919. '1', '7', '9', '11', '13', '15', '17', '19', '20', '21', '22', '23', '25', '37', '42', '43', '53', '69', '77', '79',
  19920. '87', '95', '101', '102', '103', '104', '109', '110', '111', '113', '115', '117', '119', '123', '135', '137',
  19921. '139', '143', '161', '179', '389', '427', '465', '512', '513', '514', '515', '526', '530', '531', '532',
  19922. '540', '548', '554', '556', '563', '587', '601', '636', '989', '990', '993', '995', '1719', '1720', '1723',
  19923. '2049', '3659', '4045', '5060', '5061', '6000', '6566', '6665', '6666', '6667', '6668', '6669', '6697',
  19924. '10080'
  19925. ]
  19926. const badPortsSet = new Set(badPorts)
  19927. // https://w3c.github.io/webappsec-referrer-policy/#referrer-policies
  19928. const referrerPolicy = [
  19929. '',
  19930. 'no-referrer',
  19931. 'no-referrer-when-downgrade',
  19932. 'same-origin',
  19933. 'origin',
  19934. 'strict-origin',
  19935. 'origin-when-cross-origin',
  19936. 'strict-origin-when-cross-origin',
  19937. 'unsafe-url'
  19938. ]
  19939. const referrerPolicySet = new Set(referrerPolicy)
  19940. const requestRedirect = ['follow', 'manual', 'error']
  19941. const safeMethods = ['GET', 'HEAD', 'OPTIONS', 'TRACE']
  19942. const safeMethodsSet = new Set(safeMethods)
  19943. const requestMode = ['navigate', 'same-origin', 'no-cors', 'cors']
  19944. const requestCredentials = ['omit', 'same-origin', 'include']
  19945. const requestCache = [
  19946. 'default',
  19947. 'no-store',
  19948. 'reload',
  19949. 'no-cache',
  19950. 'force-cache',
  19951. 'only-if-cached'
  19952. ]
  19953. // https://fetch.spec.whatwg.org/#request-body-header-name
  19954. const requestBodyHeader = [
  19955. 'content-encoding',
  19956. 'content-language',
  19957. 'content-location',
  19958. 'content-type',
  19959. // See https://github.com/nodejs/undici/issues/2021
  19960. // 'Content-Length' is a forbidden header name, which is typically
  19961. // removed in the Headers implementation. However, undici doesn't
  19962. // filter out headers, so we add it here.
  19963. 'content-length'
  19964. ]
  19965. // https://fetch.spec.whatwg.org/#enumdef-requestduplex
  19966. const requestDuplex = [
  19967. 'half'
  19968. ]
  19969. // http://fetch.spec.whatwg.org/#forbidden-method
  19970. const forbiddenMethods = ['CONNECT', 'TRACE', 'TRACK']
  19971. const forbiddenMethodsSet = new Set(forbiddenMethods)
  19972. const subresource = [
  19973. 'audio',
  19974. 'audioworklet',
  19975. 'font',
  19976. 'image',
  19977. 'manifest',
  19978. 'paintworklet',
  19979. 'script',
  19980. 'style',
  19981. 'track',
  19982. 'video',
  19983. 'xslt',
  19984. ''
  19985. ]
  19986. const subresourceSet = new Set(subresource)
  19987. /** @type {globalThis['DOMException']} */
  19988. const DOMException = globalThis.DOMException ?? (() => {
  19989. // DOMException was only made a global in Node v17.0.0,
  19990. // but fetch supports >= v16.8.
  19991. try {
  19992. atob('~')
  19993. } catch (err) {
  19994. return Object.getPrototypeOf(err).constructor
  19995. }
  19996. })()
  19997. let channel
  19998. /** @type {globalThis['structuredClone']} */
  19999. const structuredClone =
  20000. globalThis.structuredClone ??
  20001. // https://github.com/nodejs/node/blob/b27ae24dcc4251bad726d9d84baf678d1f707fed/lib/internal/structured_clone.js
  20002. // structuredClone was added in v17.0.0, but fetch supports v16.8
  20003. function structuredClone (value, options = undefined) {
  20004. if (arguments.length === 0) {
  20005. throw new TypeError('missing argument')
  20006. }
  20007. if (!channel) {
  20008. channel = new MessageChannel()
  20009. }
  20010. channel.port1.unref()
  20011. channel.port2.unref()
  20012. channel.port1.postMessage(value, options?.transfer)
  20013. return receiveMessageOnPort(channel.port2).message
  20014. }
  20015. module.exports = {
  20016. DOMException,
  20017. structuredClone,
  20018. subresource,
  20019. forbiddenMethods,
  20020. requestBodyHeader,
  20021. referrerPolicy,
  20022. requestRedirect,
  20023. requestMode,
  20024. requestCredentials,
  20025. requestCache,
  20026. redirectStatus,
  20027. corsSafeListedMethods,
  20028. nullBodyStatus,
  20029. safeMethods,
  20030. badPorts,
  20031. requestDuplex,
  20032. subresourceSet,
  20033. badPortsSet,
  20034. redirectStatusSet,
  20035. corsSafeListedMethodsSet,
  20036. safeMethodsSet,
  20037. forbiddenMethodsSet,
  20038. referrerPolicySet
  20039. }
  20040. /***/ }),
  20041. /***/ 685:
  20042. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  20043. const assert = __nccwpck_require__(9491)
  20044. const { atob } = __nccwpck_require__(4300)
  20045. const { isomorphicDecode } = __nccwpck_require__(2538)
  20046. const encoder = new TextEncoder()
  20047. /**
  20048. * @see https://mimesniff.spec.whatwg.org/#http-token-code-point
  20049. */
  20050. const HTTP_TOKEN_CODEPOINTS = /^[!#$%&'*+-.^_|~A-Za-z0-9]+$/
  20051. const HTTP_WHITESPACE_REGEX = /(\u000A|\u000D|\u0009|\u0020)/ // eslint-disable-line
  20052. /**
  20053. * @see https://mimesniff.spec.whatwg.org/#http-quoted-string-token-code-point
  20054. */
  20055. const HTTP_QUOTED_STRING_TOKENS = /[\u0009|\u0020-\u007E|\u0080-\u00FF]/ // eslint-disable-line
  20056. // https://fetch.spec.whatwg.org/#data-url-processor
  20057. /** @param {URL} dataURL */
  20058. function dataURLProcessor (dataURL) {
  20059. // 1. Assert: dataURL’s scheme is "data".
  20060. assert(dataURL.protocol === 'data:')
  20061. // 2. Let input be the result of running the URL
  20062. // serializer on dataURL with exclude fragment
  20063. // set to true.
  20064. let input = URLSerializer(dataURL, true)
  20065. // 3. Remove the leading "data:" string from input.
  20066. input = input.slice(5)
  20067. // 4. Let position point at the start of input.
  20068. const position = { position: 0 }
  20069. // 5. Let mimeType be the result of collecting a
  20070. // sequence of code points that are not equal
  20071. // to U+002C (,), given position.
  20072. let mimeType = collectASequenceOfCodePointsFast(
  20073. ',',
  20074. input,
  20075. position
  20076. )
  20077. // 6. Strip leading and trailing ASCII whitespace
  20078. // from mimeType.
  20079. // Undici implementation note: we need to store the
  20080. // length because if the mimetype has spaces removed,
  20081. // the wrong amount will be sliced from the input in
  20082. // step #9
  20083. const mimeTypeLength = mimeType.length
  20084. mimeType = removeASCIIWhitespace(mimeType, true, true)
  20085. // 7. If position is past the end of input, then
  20086. // return failure
  20087. if (position.position >= input.length) {
  20088. return 'failure'
  20089. }
  20090. // 8. Advance position by 1.
  20091. position.position++
  20092. // 9. Let encodedBody be the remainder of input.
  20093. const encodedBody = input.slice(mimeTypeLength + 1)
  20094. // 10. Let body be the percent-decoding of encodedBody.
  20095. let body = stringPercentDecode(encodedBody)
  20096. // 11. If mimeType ends with U+003B (;), followed by
  20097. // zero or more U+0020 SPACE, followed by an ASCII
  20098. // case-insensitive match for "base64", then:
  20099. if (/;(\u0020){0,}base64$/i.test(mimeType)) {
  20100. // 1. Let stringBody be the isomorphic decode of body.
  20101. const stringBody = isomorphicDecode(body)
  20102. // 2. Set body to the forgiving-base64 decode of
  20103. // stringBody.
  20104. body = forgivingBase64(stringBody)
  20105. // 3. If body is failure, then return failure.
  20106. if (body === 'failure') {
  20107. return 'failure'
  20108. }
  20109. // 4. Remove the last 6 code points from mimeType.
  20110. mimeType = mimeType.slice(0, -6)
  20111. // 5. Remove trailing U+0020 SPACE code points from mimeType,
  20112. // if any.
  20113. mimeType = mimeType.replace(/(\u0020)+$/, '')
  20114. // 6. Remove the last U+003B (;) code point from mimeType.
  20115. mimeType = mimeType.slice(0, -1)
  20116. }
  20117. // 12. If mimeType starts with U+003B (;), then prepend
  20118. // "text/plain" to mimeType.
  20119. if (mimeType.startsWith(';')) {
  20120. mimeType = 'text/plain' + mimeType
  20121. }
  20122. // 13. Let mimeTypeRecord be the result of parsing
  20123. // mimeType.
  20124. let mimeTypeRecord = parseMIMEType(mimeType)
  20125. // 14. If mimeTypeRecord is failure, then set
  20126. // mimeTypeRecord to text/plain;charset=US-ASCII.
  20127. if (mimeTypeRecord === 'failure') {
  20128. mimeTypeRecord = parseMIMEType('text/plain;charset=US-ASCII')
  20129. }
  20130. // 15. Return a new data: URL struct whose MIME
  20131. // type is mimeTypeRecord and body is body.
  20132. // https://fetch.spec.whatwg.org/#data-url-struct
  20133. return { mimeType: mimeTypeRecord, body }
  20134. }
  20135. // https://url.spec.whatwg.org/#concept-url-serializer
  20136. /**
  20137. * @param {URL} url
  20138. * @param {boolean} excludeFragment
  20139. */
  20140. function URLSerializer (url, excludeFragment = false) {
  20141. if (!excludeFragment) {
  20142. return url.href
  20143. }
  20144. const href = url.href
  20145. const hashLength = url.hash.length
  20146. return hashLength === 0 ? href : href.substring(0, href.length - hashLength)
  20147. }
  20148. // https://infra.spec.whatwg.org/#collect-a-sequence-of-code-points
  20149. /**
  20150. * @param {(char: string) => boolean} condition
  20151. * @param {string} input
  20152. * @param {{ position: number }} position
  20153. */
  20154. function collectASequenceOfCodePoints (condition, input, position) {
  20155. // 1. Let result be the empty string.
  20156. let result = ''
  20157. // 2. While position doesn’t point past the end of input and the
  20158. // code point at position within input meets the condition condition:
  20159. while (position.position < input.length && condition(input[position.position])) {
  20160. // 1. Append that code point to the end of result.
  20161. result += input[position.position]
  20162. // 2. Advance position by 1.
  20163. position.position++
  20164. }
  20165. // 3. Return result.
  20166. return result
  20167. }
  20168. /**
  20169. * A faster collectASequenceOfCodePoints that only works when comparing a single character.
  20170. * @param {string} char
  20171. * @param {string} input
  20172. * @param {{ position: number }} position
  20173. */
  20174. function collectASequenceOfCodePointsFast (char, input, position) {
  20175. const idx = input.indexOf(char, position.position)
  20176. const start = position.position
  20177. if (idx === -1) {
  20178. position.position = input.length
  20179. return input.slice(start)
  20180. }
  20181. position.position = idx
  20182. return input.slice(start, position.position)
  20183. }
  20184. // https://url.spec.whatwg.org/#string-percent-decode
  20185. /** @param {string} input */
  20186. function stringPercentDecode (input) {
  20187. // 1. Let bytes be the UTF-8 encoding of input.
  20188. const bytes = encoder.encode(input)
  20189. // 2. Return the percent-decoding of bytes.
  20190. return percentDecode(bytes)
  20191. }
  20192. // https://url.spec.whatwg.org/#percent-decode
  20193. /** @param {Uint8Array} input */
  20194. function percentDecode (input) {
  20195. // 1. Let output be an empty byte sequence.
  20196. /** @type {number[]} */
  20197. const output = []
  20198. // 2. For each byte byte in input:
  20199. for (let i = 0; i < input.length; i++) {
  20200. const byte = input[i]
  20201. // 1. If byte is not 0x25 (%), then append byte to output.
  20202. if (byte !== 0x25) {
  20203. output.push(byte)
  20204. // 2. Otherwise, if byte is 0x25 (%) and the next two bytes
  20205. // after byte in input are not in the ranges
  20206. // 0x30 (0) to 0x39 (9), 0x41 (A) to 0x46 (F),
  20207. // and 0x61 (a) to 0x66 (f), all inclusive, append byte
  20208. // to output.
  20209. } else if (
  20210. byte === 0x25 &&
  20211. !/^[0-9A-Fa-f]{2}$/i.test(String.fromCharCode(input[i + 1], input[i + 2]))
  20212. ) {
  20213. output.push(0x25)
  20214. // 3. Otherwise:
  20215. } else {
  20216. // 1. Let bytePoint be the two bytes after byte in input,
  20217. // decoded, and then interpreted as hexadecimal number.
  20218. const nextTwoBytes = String.fromCharCode(input[i + 1], input[i + 2])
  20219. const bytePoint = Number.parseInt(nextTwoBytes, 16)
  20220. // 2. Append a byte whose value is bytePoint to output.
  20221. output.push(bytePoint)
  20222. // 3. Skip the next two bytes in input.
  20223. i += 2
  20224. }
  20225. }
  20226. // 3. Return output.
  20227. return Uint8Array.from(output)
  20228. }
  20229. // https://mimesniff.spec.whatwg.org/#parse-a-mime-type
  20230. /** @param {string} input */
  20231. function parseMIMEType (input) {
  20232. // 1. Remove any leading and trailing HTTP whitespace
  20233. // from input.
  20234. input = removeHTTPWhitespace(input, true, true)
  20235. // 2. Let position be a position variable for input,
  20236. // initially pointing at the start of input.
  20237. const position = { position: 0 }
  20238. // 3. Let type be the result of collecting a sequence
  20239. // of code points that are not U+002F (/) from
  20240. // input, given position.
  20241. const type = collectASequenceOfCodePointsFast(
  20242. '/',
  20243. input,
  20244. position
  20245. )
  20246. // 4. If type is the empty string or does not solely
  20247. // contain HTTP token code points, then return failure.
  20248. // https://mimesniff.spec.whatwg.org/#http-token-code-point
  20249. if (type.length === 0 || !HTTP_TOKEN_CODEPOINTS.test(type)) {
  20250. return 'failure'
  20251. }
  20252. // 5. If position is past the end of input, then return
  20253. // failure
  20254. if (position.position > input.length) {
  20255. return 'failure'
  20256. }
  20257. // 6. Advance position by 1. (This skips past U+002F (/).)
  20258. position.position++
  20259. // 7. Let subtype be the result of collecting a sequence of
  20260. // code points that are not U+003B (;) from input, given
  20261. // position.
  20262. let subtype = collectASequenceOfCodePointsFast(
  20263. ';',
  20264. input,
  20265. position
  20266. )
  20267. // 8. Remove any trailing HTTP whitespace from subtype.
  20268. subtype = removeHTTPWhitespace(subtype, false, true)
  20269. // 9. If subtype is the empty string or does not solely
  20270. // contain HTTP token code points, then return failure.
  20271. if (subtype.length === 0 || !HTTP_TOKEN_CODEPOINTS.test(subtype)) {
  20272. return 'failure'
  20273. }
  20274. const typeLowercase = type.toLowerCase()
  20275. const subtypeLowercase = subtype.toLowerCase()
  20276. // 10. Let mimeType be a new MIME type record whose type
  20277. // is type, in ASCII lowercase, and subtype is subtype,
  20278. // in ASCII lowercase.
  20279. // https://mimesniff.spec.whatwg.org/#mime-type
  20280. const mimeType = {
  20281. type: typeLowercase,
  20282. subtype: subtypeLowercase,
  20283. /** @type {Map<string, string>} */
  20284. parameters: new Map(),
  20285. // https://mimesniff.spec.whatwg.org/#mime-type-essence
  20286. essence: `${typeLowercase}/${subtypeLowercase}`
  20287. }
  20288. // 11. While position is not past the end of input:
  20289. while (position.position < input.length) {
  20290. // 1. Advance position by 1. (This skips past U+003B (;).)
  20291. position.position++
  20292. // 2. Collect a sequence of code points that are HTTP
  20293. // whitespace from input given position.
  20294. collectASequenceOfCodePoints(
  20295. // https://fetch.spec.whatwg.org/#http-whitespace
  20296. char => HTTP_WHITESPACE_REGEX.test(char),
  20297. input,
  20298. position
  20299. )
  20300. // 3. Let parameterName be the result of collecting a
  20301. // sequence of code points that are not U+003B (;)
  20302. // or U+003D (=) from input, given position.
  20303. let parameterName = collectASequenceOfCodePoints(
  20304. (char) => char !== ';' && char !== '=',
  20305. input,
  20306. position
  20307. )
  20308. // 4. Set parameterName to parameterName, in ASCII
  20309. // lowercase.
  20310. parameterName = parameterName.toLowerCase()
  20311. // 5. If position is not past the end of input, then:
  20312. if (position.position < input.length) {
  20313. // 1. If the code point at position within input is
  20314. // U+003B (;), then continue.
  20315. if (input[position.position] === ';') {
  20316. continue
  20317. }
  20318. // 2. Advance position by 1. (This skips past U+003D (=).)
  20319. position.position++
  20320. }
  20321. // 6. If position is past the end of input, then break.
  20322. if (position.position > input.length) {
  20323. break
  20324. }
  20325. // 7. Let parameterValue be null.
  20326. let parameterValue = null
  20327. // 8. If the code point at position within input is
  20328. // U+0022 ("), then:
  20329. if (input[position.position] === '"') {
  20330. // 1. Set parameterValue to the result of collecting
  20331. // an HTTP quoted string from input, given position
  20332. // and the extract-value flag.
  20333. parameterValue = collectAnHTTPQuotedString(input, position, true)
  20334. // 2. Collect a sequence of code points that are not
  20335. // U+003B (;) from input, given position.
  20336. collectASequenceOfCodePointsFast(
  20337. ';',
  20338. input,
  20339. position
  20340. )
  20341. // 9. Otherwise:
  20342. } else {
  20343. // 1. Set parameterValue to the result of collecting
  20344. // a sequence of code points that are not U+003B (;)
  20345. // from input, given position.
  20346. parameterValue = collectASequenceOfCodePointsFast(
  20347. ';',
  20348. input,
  20349. position
  20350. )
  20351. // 2. Remove any trailing HTTP whitespace from parameterValue.
  20352. parameterValue = removeHTTPWhitespace(parameterValue, false, true)
  20353. // 3. If parameterValue is the empty string, then continue.
  20354. if (parameterValue.length === 0) {
  20355. continue
  20356. }
  20357. }
  20358. // 10. If all of the following are true
  20359. // - parameterName is not the empty string
  20360. // - parameterName solely contains HTTP token code points
  20361. // - parameterValue solely contains HTTP quoted-string token code points
  20362. // - mimeType’s parameters[parameterName] does not exist
  20363. // then set mimeType’s parameters[parameterName] to parameterValue.
  20364. if (
  20365. parameterName.length !== 0 &&
  20366. HTTP_TOKEN_CODEPOINTS.test(parameterName) &&
  20367. (parameterValue.length === 0 || HTTP_QUOTED_STRING_TOKENS.test(parameterValue)) &&
  20368. !mimeType.parameters.has(parameterName)
  20369. ) {
  20370. mimeType.parameters.set(parameterName, parameterValue)
  20371. }
  20372. }
  20373. // 12. Return mimeType.
  20374. return mimeType
  20375. }
  20376. // https://infra.spec.whatwg.org/#forgiving-base64-decode
  20377. /** @param {string} data */
  20378. function forgivingBase64 (data) {
  20379. // 1. Remove all ASCII whitespace from data.
  20380. data = data.replace(/[\u0009\u000A\u000C\u000D\u0020]/g, '') // eslint-disable-line
  20381. // 2. If data’s code point length divides by 4 leaving
  20382. // no remainder, then:
  20383. if (data.length % 4 === 0) {
  20384. // 1. If data ends with one or two U+003D (=) code points,
  20385. // then remove them from data.
  20386. data = data.replace(/=?=$/, '')
  20387. }
  20388. // 3. If data’s code point length divides by 4 leaving
  20389. // a remainder of 1, then return failure.
  20390. if (data.length % 4 === 1) {
  20391. return 'failure'
  20392. }
  20393. // 4. If data contains a code point that is not one of
  20394. // U+002B (+)
  20395. // U+002F (/)
  20396. // ASCII alphanumeric
  20397. // then return failure.
  20398. if (/[^+/0-9A-Za-z]/.test(data)) {
  20399. return 'failure'
  20400. }
  20401. const binary = atob(data)
  20402. const bytes = new Uint8Array(binary.length)
  20403. for (let byte = 0; byte < binary.length; byte++) {
  20404. bytes[byte] = binary.charCodeAt(byte)
  20405. }
  20406. return bytes
  20407. }
  20408. // https://fetch.spec.whatwg.org/#collect-an-http-quoted-string
  20409. // tests: https://fetch.spec.whatwg.org/#example-http-quoted-string
  20410. /**
  20411. * @param {string} input
  20412. * @param {{ position: number }} position
  20413. * @param {boolean?} extractValue
  20414. */
  20415. function collectAnHTTPQuotedString (input, position, extractValue) {
  20416. // 1. Let positionStart be position.
  20417. const positionStart = position.position
  20418. // 2. Let value be the empty string.
  20419. let value = ''
  20420. // 3. Assert: the code point at position within input
  20421. // is U+0022 (").
  20422. assert(input[position.position] === '"')
  20423. // 4. Advance position by 1.
  20424. position.position++
  20425. // 5. While true:
  20426. while (true) {
  20427. // 1. Append the result of collecting a sequence of code points
  20428. // that are not U+0022 (") or U+005C (\) from input, given
  20429. // position, to value.
  20430. value += collectASequenceOfCodePoints(
  20431. (char) => char !== '"' && char !== '\\',
  20432. input,
  20433. position
  20434. )
  20435. // 2. If position is past the end of input, then break.
  20436. if (position.position >= input.length) {
  20437. break
  20438. }
  20439. // 3. Let quoteOrBackslash be the code point at position within
  20440. // input.
  20441. const quoteOrBackslash = input[position.position]
  20442. // 4. Advance position by 1.
  20443. position.position++
  20444. // 5. If quoteOrBackslash is U+005C (\), then:
  20445. if (quoteOrBackslash === '\\') {
  20446. // 1. If position is past the end of input, then append
  20447. // U+005C (\) to value and break.
  20448. if (position.position >= input.length) {
  20449. value += '\\'
  20450. break
  20451. }
  20452. // 2. Append the code point at position within input to value.
  20453. value += input[position.position]
  20454. // 3. Advance position by 1.
  20455. position.position++
  20456. // 6. Otherwise:
  20457. } else {
  20458. // 1. Assert: quoteOrBackslash is U+0022 (").
  20459. assert(quoteOrBackslash === '"')
  20460. // 2. Break.
  20461. break
  20462. }
  20463. }
  20464. // 6. If the extract-value flag is set, then return value.
  20465. if (extractValue) {
  20466. return value
  20467. }
  20468. // 7. Return the code points from positionStart to position,
  20469. // inclusive, within input.
  20470. return input.slice(positionStart, position.position)
  20471. }
  20472. /**
  20473. * @see https://mimesniff.spec.whatwg.org/#serialize-a-mime-type
  20474. */
  20475. function serializeAMimeType (mimeType) {
  20476. assert(mimeType !== 'failure')
  20477. const { parameters, essence } = mimeType
  20478. // 1. Let serialization be the concatenation of mimeType’s
  20479. // type, U+002F (/), and mimeType’s subtype.
  20480. let serialization = essence
  20481. // 2. For each name → value of mimeType’s parameters:
  20482. for (let [name, value] of parameters.entries()) {
  20483. // 1. Append U+003B (;) to serialization.
  20484. serialization += ';'
  20485. // 2. Append name to serialization.
  20486. serialization += name
  20487. // 3. Append U+003D (=) to serialization.
  20488. serialization += '='
  20489. // 4. If value does not solely contain HTTP token code
  20490. // points or value is the empty string, then:
  20491. if (!HTTP_TOKEN_CODEPOINTS.test(value)) {
  20492. // 1. Precede each occurence of U+0022 (") or
  20493. // U+005C (\) in value with U+005C (\).
  20494. value = value.replace(/(\\|")/g, '\\$1')
  20495. // 2. Prepend U+0022 (") to value.
  20496. value = '"' + value
  20497. // 3. Append U+0022 (") to value.
  20498. value += '"'
  20499. }
  20500. // 5. Append value to serialization.
  20501. serialization += value
  20502. }
  20503. // 3. Return serialization.
  20504. return serialization
  20505. }
  20506. /**
  20507. * @see https://fetch.spec.whatwg.org/#http-whitespace
  20508. * @param {string} char
  20509. */
  20510. function isHTTPWhiteSpace (char) {
  20511. return char === '\r' || char === '\n' || char === '\t' || char === ' '
  20512. }
  20513. /**
  20514. * @see https://fetch.spec.whatwg.org/#http-whitespace
  20515. * @param {string} str
  20516. */
  20517. function removeHTTPWhitespace (str, leading = true, trailing = true) {
  20518. let lead = 0
  20519. let trail = str.length - 1
  20520. if (leading) {
  20521. for (; lead < str.length && isHTTPWhiteSpace(str[lead]); lead++);
  20522. }
  20523. if (trailing) {
  20524. for (; trail > 0 && isHTTPWhiteSpace(str[trail]); trail--);
  20525. }
  20526. return str.slice(lead, trail + 1)
  20527. }
  20528. /**
  20529. * @see https://infra.spec.whatwg.org/#ascii-whitespace
  20530. * @param {string} char
  20531. */
  20532. function isASCIIWhitespace (char) {
  20533. return char === '\r' || char === '\n' || char === '\t' || char === '\f' || char === ' '
  20534. }
  20535. /**
  20536. * @see https://infra.spec.whatwg.org/#strip-leading-and-trailing-ascii-whitespace
  20537. */
  20538. function removeASCIIWhitespace (str, leading = true, trailing = true) {
  20539. let lead = 0
  20540. let trail = str.length - 1
  20541. if (leading) {
  20542. for (; lead < str.length && isASCIIWhitespace(str[lead]); lead++);
  20543. }
  20544. if (trailing) {
  20545. for (; trail > 0 && isASCIIWhitespace(str[trail]); trail--);
  20546. }
  20547. return str.slice(lead, trail + 1)
  20548. }
  20549. module.exports = {
  20550. dataURLProcessor,
  20551. URLSerializer,
  20552. collectASequenceOfCodePoints,
  20553. collectASequenceOfCodePointsFast,
  20554. stringPercentDecode,
  20555. parseMIMEType,
  20556. collectAnHTTPQuotedString,
  20557. serializeAMimeType
  20558. }
  20559. /***/ }),
  20560. /***/ 8511:
  20561. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  20562. "use strict";
  20563. const { Blob, File: NativeFile } = __nccwpck_require__(4300)
  20564. const { types } = __nccwpck_require__(3837)
  20565. const { kState } = __nccwpck_require__(5861)
  20566. const { isBlobLike } = __nccwpck_require__(2538)
  20567. const { webidl } = __nccwpck_require__(1744)
  20568. const { parseMIMEType, serializeAMimeType } = __nccwpck_require__(685)
  20569. const { kEnumerableProperty } = __nccwpck_require__(3983)
  20570. const encoder = new TextEncoder()
  20571. class File extends Blob {
  20572. constructor (fileBits, fileName, options = {}) {
  20573. // The File constructor is invoked with two or three parameters, depending
  20574. // on whether the optional dictionary parameter is used. When the File()
  20575. // constructor is invoked, user agents must run the following steps:
  20576. webidl.argumentLengthCheck(arguments, 2, { header: 'File constructor' })
  20577. fileBits = webidl.converters['sequence<BlobPart>'](fileBits)
  20578. fileName = webidl.converters.USVString(fileName)
  20579. options = webidl.converters.FilePropertyBag(options)
  20580. // 1. Let bytes be the result of processing blob parts given fileBits and
  20581. // options.
  20582. // Note: Blob handles this for us
  20583. // 2. Let n be the fileName argument to the constructor.
  20584. const n = fileName
  20585. // 3. Process FilePropertyBag dictionary argument by running the following
  20586. // substeps:
  20587. // 1. If the type member is provided and is not the empty string, let t
  20588. // be set to the type dictionary member. If t contains any characters
  20589. // outside the range U+0020 to U+007E, then set t to the empty string
  20590. // and return from these substeps.
  20591. // 2. Convert every character in t to ASCII lowercase.
  20592. let t = options.type
  20593. let d
  20594. // eslint-disable-next-line no-labels
  20595. substep: {
  20596. if (t) {
  20597. t = parseMIMEType(t)
  20598. if (t === 'failure') {
  20599. t = ''
  20600. // eslint-disable-next-line no-labels
  20601. break substep
  20602. }
  20603. t = serializeAMimeType(t).toLowerCase()
  20604. }
  20605. // 3. If the lastModified member is provided, let d be set to the
  20606. // lastModified dictionary member. If it is not provided, set d to the
  20607. // current date and time represented as the number of milliseconds since
  20608. // the Unix Epoch (which is the equivalent of Date.now() [ECMA-262]).
  20609. d = options.lastModified
  20610. }
  20611. // 4. Return a new File object F such that:
  20612. // F refers to the bytes byte sequence.
  20613. // F.size is set to the number of total bytes in bytes.
  20614. // F.name is set to n.
  20615. // F.type is set to t.
  20616. // F.lastModified is set to d.
  20617. super(processBlobParts(fileBits, options), { type: t })
  20618. this[kState] = {
  20619. name: n,
  20620. lastModified: d,
  20621. type: t
  20622. }
  20623. }
  20624. get name () {
  20625. webidl.brandCheck(this, File)
  20626. return this[kState].name
  20627. }
  20628. get lastModified () {
  20629. webidl.brandCheck(this, File)
  20630. return this[kState].lastModified
  20631. }
  20632. get type () {
  20633. webidl.brandCheck(this, File)
  20634. return this[kState].type
  20635. }
  20636. }
  20637. class FileLike {
  20638. constructor (blobLike, fileName, options = {}) {
  20639. // TODO: argument idl type check
  20640. // The File constructor is invoked with two or three parameters, depending
  20641. // on whether the optional dictionary parameter is used. When the File()
  20642. // constructor is invoked, user agents must run the following steps:
  20643. // 1. Let bytes be the result of processing blob parts given fileBits and
  20644. // options.
  20645. // 2. Let n be the fileName argument to the constructor.
  20646. const n = fileName
  20647. // 3. Process FilePropertyBag dictionary argument by running the following
  20648. // substeps:
  20649. // 1. If the type member is provided and is not the empty string, let t
  20650. // be set to the type dictionary member. If t contains any characters
  20651. // outside the range U+0020 to U+007E, then set t to the empty string
  20652. // and return from these substeps.
  20653. // TODO
  20654. const t = options.type
  20655. // 2. Convert every character in t to ASCII lowercase.
  20656. // TODO
  20657. // 3. If the lastModified member is provided, let d be set to the
  20658. // lastModified dictionary member. If it is not provided, set d to the
  20659. // current date and time represented as the number of milliseconds since
  20660. // the Unix Epoch (which is the equivalent of Date.now() [ECMA-262]).
  20661. const d = options.lastModified ?? Date.now()
  20662. // 4. Return a new File object F such that:
  20663. // F refers to the bytes byte sequence.
  20664. // F.size is set to the number of total bytes in bytes.
  20665. // F.name is set to n.
  20666. // F.type is set to t.
  20667. // F.lastModified is set to d.
  20668. this[kState] = {
  20669. blobLike,
  20670. name: n,
  20671. type: t,
  20672. lastModified: d
  20673. }
  20674. }
  20675. stream (...args) {
  20676. webidl.brandCheck(this, FileLike)
  20677. return this[kState].blobLike.stream(...args)
  20678. }
  20679. arrayBuffer (...args) {
  20680. webidl.brandCheck(this, FileLike)
  20681. return this[kState].blobLike.arrayBuffer(...args)
  20682. }
  20683. slice (...args) {
  20684. webidl.brandCheck(this, FileLike)
  20685. return this[kState].blobLike.slice(...args)
  20686. }
  20687. text (...args) {
  20688. webidl.brandCheck(this, FileLike)
  20689. return this[kState].blobLike.text(...args)
  20690. }
  20691. get size () {
  20692. webidl.brandCheck(this, FileLike)
  20693. return this[kState].blobLike.size
  20694. }
  20695. get type () {
  20696. webidl.brandCheck(this, FileLike)
  20697. return this[kState].blobLike.type
  20698. }
  20699. get name () {
  20700. webidl.brandCheck(this, FileLike)
  20701. return this[kState].name
  20702. }
  20703. get lastModified () {
  20704. webidl.brandCheck(this, FileLike)
  20705. return this[kState].lastModified
  20706. }
  20707. get [Symbol.toStringTag] () {
  20708. return 'File'
  20709. }
  20710. }
  20711. Object.defineProperties(File.prototype, {
  20712. [Symbol.toStringTag]: {
  20713. value: 'File',
  20714. configurable: true
  20715. },
  20716. name: kEnumerableProperty,
  20717. lastModified: kEnumerableProperty
  20718. })
  20719. webidl.converters.Blob = webidl.interfaceConverter(Blob)
  20720. webidl.converters.BlobPart = function (V, opts) {
  20721. if (webidl.util.Type(V) === 'Object') {
  20722. if (isBlobLike(V)) {
  20723. return webidl.converters.Blob(V, { strict: false })
  20724. }
  20725. if (
  20726. ArrayBuffer.isView(V) ||
  20727. types.isAnyArrayBuffer(V)
  20728. ) {
  20729. return webidl.converters.BufferSource(V, opts)
  20730. }
  20731. }
  20732. return webidl.converters.USVString(V, opts)
  20733. }
  20734. webidl.converters['sequence<BlobPart>'] = webidl.sequenceConverter(
  20735. webidl.converters.BlobPart
  20736. )
  20737. // https://www.w3.org/TR/FileAPI/#dfn-FilePropertyBag
  20738. webidl.converters.FilePropertyBag = webidl.dictionaryConverter([
  20739. {
  20740. key: 'lastModified',
  20741. converter: webidl.converters['long long'],
  20742. get defaultValue () {
  20743. return Date.now()
  20744. }
  20745. },
  20746. {
  20747. key: 'type',
  20748. converter: webidl.converters.DOMString,
  20749. defaultValue: ''
  20750. },
  20751. {
  20752. key: 'endings',
  20753. converter: (value) => {
  20754. value = webidl.converters.DOMString(value)
  20755. value = value.toLowerCase()
  20756. if (value !== 'native') {
  20757. value = 'transparent'
  20758. }
  20759. return value
  20760. },
  20761. defaultValue: 'transparent'
  20762. }
  20763. ])
  20764. /**
  20765. * @see https://www.w3.org/TR/FileAPI/#process-blob-parts
  20766. * @param {(NodeJS.TypedArray|Blob|string)[]} parts
  20767. * @param {{ type: string, endings: string }} options
  20768. */
  20769. function processBlobParts (parts, options) {
  20770. // 1. Let bytes be an empty sequence of bytes.
  20771. /** @type {NodeJS.TypedArray[]} */
  20772. const bytes = []
  20773. // 2. For each element in parts:
  20774. for (const element of parts) {
  20775. // 1. If element is a USVString, run the following substeps:
  20776. if (typeof element === 'string') {
  20777. // 1. Let s be element.
  20778. let s = element
  20779. // 2. If the endings member of options is "native", set s
  20780. // to the result of converting line endings to native
  20781. // of element.
  20782. if (options.endings === 'native') {
  20783. s = convertLineEndingsNative(s)
  20784. }
  20785. // 3. Append the result of UTF-8 encoding s to bytes.
  20786. bytes.push(encoder.encode(s))
  20787. } else if (
  20788. types.isAnyArrayBuffer(element) ||
  20789. types.isTypedArray(element)
  20790. ) {
  20791. // 2. If element is a BufferSource, get a copy of the
  20792. // bytes held by the buffer source, and append those
  20793. // bytes to bytes.
  20794. if (!element.buffer) { // ArrayBuffer
  20795. bytes.push(new Uint8Array(element))
  20796. } else {
  20797. bytes.push(
  20798. new Uint8Array(element.buffer, element.byteOffset, element.byteLength)
  20799. )
  20800. }
  20801. } else if (isBlobLike(element)) {
  20802. // 3. If element is a Blob, append the bytes it represents
  20803. // to bytes.
  20804. bytes.push(element)
  20805. }
  20806. }
  20807. // 3. Return bytes.
  20808. return bytes
  20809. }
  20810. /**
  20811. * @see https://www.w3.org/TR/FileAPI/#convert-line-endings-to-native
  20812. * @param {string} s
  20813. */
  20814. function convertLineEndingsNative (s) {
  20815. // 1. Let native line ending be be the code point U+000A LF.
  20816. let nativeLineEnding = '\n'
  20817. // 2. If the underlying platform’s conventions are to
  20818. // represent newlines as a carriage return and line feed
  20819. // sequence, set native line ending to the code point
  20820. // U+000D CR followed by the code point U+000A LF.
  20821. if (process.platform === 'win32') {
  20822. nativeLineEnding = '\r\n'
  20823. }
  20824. return s.replace(/\r?\n/g, nativeLineEnding)
  20825. }
  20826. // If this function is moved to ./util.js, some tools (such as
  20827. // rollup) will warn about circular dependencies. See:
  20828. // https://github.com/nodejs/undici/issues/1629
  20829. function isFileLike (object) {
  20830. return (
  20831. (NativeFile && object instanceof NativeFile) ||
  20832. object instanceof File || (
  20833. object &&
  20834. (typeof object.stream === 'function' ||
  20835. typeof object.arrayBuffer === 'function') &&
  20836. object[Symbol.toStringTag] === 'File'
  20837. )
  20838. )
  20839. }
  20840. module.exports = { File, FileLike, isFileLike }
  20841. /***/ }),
  20842. /***/ 2015:
  20843. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  20844. "use strict";
  20845. const { isBlobLike, toUSVString, makeIterator } = __nccwpck_require__(2538)
  20846. const { kState } = __nccwpck_require__(5861)
  20847. const { File: UndiciFile, FileLike, isFileLike } = __nccwpck_require__(8511)
  20848. const { webidl } = __nccwpck_require__(1744)
  20849. const { Blob, File: NativeFile } = __nccwpck_require__(4300)
  20850. /** @type {globalThis['File']} */
  20851. const File = NativeFile ?? UndiciFile
  20852. // https://xhr.spec.whatwg.org/#formdata
  20853. class FormData {
  20854. constructor (form) {
  20855. if (form !== undefined) {
  20856. throw webidl.errors.conversionFailed({
  20857. prefix: 'FormData constructor',
  20858. argument: 'Argument 1',
  20859. types: ['undefined']
  20860. })
  20861. }
  20862. this[kState] = []
  20863. }
  20864. append (name, value, filename = undefined) {
  20865. webidl.brandCheck(this, FormData)
  20866. webidl.argumentLengthCheck(arguments, 2, { header: 'FormData.append' })
  20867. if (arguments.length === 3 && !isBlobLike(value)) {
  20868. throw new TypeError(
  20869. "Failed to execute 'append' on 'FormData': parameter 2 is not of type 'Blob'"
  20870. )
  20871. }
  20872. // 1. Let value be value if given; otherwise blobValue.
  20873. name = webidl.converters.USVString(name)
  20874. value = isBlobLike(value)
  20875. ? webidl.converters.Blob(value, { strict: false })
  20876. : webidl.converters.USVString(value)
  20877. filename = arguments.length === 3
  20878. ? webidl.converters.USVString(filename)
  20879. : undefined
  20880. // 2. Let entry be the result of creating an entry with
  20881. // name, value, and filename if given.
  20882. const entry = makeEntry(name, value, filename)
  20883. // 3. Append entry to this’s entry list.
  20884. this[kState].push(entry)
  20885. }
  20886. delete (name) {
  20887. webidl.brandCheck(this, FormData)
  20888. webidl.argumentLengthCheck(arguments, 1, { header: 'FormData.delete' })
  20889. name = webidl.converters.USVString(name)
  20890. // The delete(name) method steps are to remove all entries whose name
  20891. // is name from this’s entry list.
  20892. this[kState] = this[kState].filter(entry => entry.name !== name)
  20893. }
  20894. get (name) {
  20895. webidl.brandCheck(this, FormData)
  20896. webidl.argumentLengthCheck(arguments, 1, { header: 'FormData.get' })
  20897. name = webidl.converters.USVString(name)
  20898. // 1. If there is no entry whose name is name in this’s entry list,
  20899. // then return null.
  20900. const idx = this[kState].findIndex((entry) => entry.name === name)
  20901. if (idx === -1) {
  20902. return null
  20903. }
  20904. // 2. Return the value of the first entry whose name is name from
  20905. // this’s entry list.
  20906. return this[kState][idx].value
  20907. }
  20908. getAll (name) {
  20909. webidl.brandCheck(this, FormData)
  20910. webidl.argumentLengthCheck(arguments, 1, { header: 'FormData.getAll' })
  20911. name = webidl.converters.USVString(name)
  20912. // 1. If there is no entry whose name is name in this’s entry list,
  20913. // then return the empty list.
  20914. // 2. Return the values of all entries whose name is name, in order,
  20915. // from this’s entry list.
  20916. return this[kState]
  20917. .filter((entry) => entry.name === name)
  20918. .map((entry) => entry.value)
  20919. }
  20920. has (name) {
  20921. webidl.brandCheck(this, FormData)
  20922. webidl.argumentLengthCheck(arguments, 1, { header: 'FormData.has' })
  20923. name = webidl.converters.USVString(name)
  20924. // The has(name) method steps are to return true if there is an entry
  20925. // whose name is name in this’s entry list; otherwise false.
  20926. return this[kState].findIndex((entry) => entry.name === name) !== -1
  20927. }
  20928. set (name, value, filename = undefined) {
  20929. webidl.brandCheck(this, FormData)
  20930. webidl.argumentLengthCheck(arguments, 2, { header: 'FormData.set' })
  20931. if (arguments.length === 3 && !isBlobLike(value)) {
  20932. throw new TypeError(
  20933. "Failed to execute 'set' on 'FormData': parameter 2 is not of type 'Blob'"
  20934. )
  20935. }
  20936. // The set(name, value) and set(name, blobValue, filename) method steps
  20937. // are:
  20938. // 1. Let value be value if given; otherwise blobValue.
  20939. name = webidl.converters.USVString(name)
  20940. value = isBlobLike(value)
  20941. ? webidl.converters.Blob(value, { strict: false })
  20942. : webidl.converters.USVString(value)
  20943. filename = arguments.length === 3
  20944. ? toUSVString(filename)
  20945. : undefined
  20946. // 2. Let entry be the result of creating an entry with name, value, and
  20947. // filename if given.
  20948. const entry = makeEntry(name, value, filename)
  20949. // 3. If there are entries in this’s entry list whose name is name, then
  20950. // replace the first such entry with entry and remove the others.
  20951. const idx = this[kState].findIndex((entry) => entry.name === name)
  20952. if (idx !== -1) {
  20953. this[kState] = [
  20954. ...this[kState].slice(0, idx),
  20955. entry,
  20956. ...this[kState].slice(idx + 1).filter((entry) => entry.name !== name)
  20957. ]
  20958. } else {
  20959. // 4. Otherwise, append entry to this’s entry list.
  20960. this[kState].push(entry)
  20961. }
  20962. }
  20963. entries () {
  20964. webidl.brandCheck(this, FormData)
  20965. return makeIterator(
  20966. () => this[kState].map(pair => [pair.name, pair.value]),
  20967. 'FormData',
  20968. 'key+value'
  20969. )
  20970. }
  20971. keys () {
  20972. webidl.brandCheck(this, FormData)
  20973. return makeIterator(
  20974. () => this[kState].map(pair => [pair.name, pair.value]),
  20975. 'FormData',
  20976. 'key'
  20977. )
  20978. }
  20979. values () {
  20980. webidl.brandCheck(this, FormData)
  20981. return makeIterator(
  20982. () => this[kState].map(pair => [pair.name, pair.value]),
  20983. 'FormData',
  20984. 'value'
  20985. )
  20986. }
  20987. /**
  20988. * @param {(value: string, key: string, self: FormData) => void} callbackFn
  20989. * @param {unknown} thisArg
  20990. */
  20991. forEach (callbackFn, thisArg = globalThis) {
  20992. webidl.brandCheck(this, FormData)
  20993. webidl.argumentLengthCheck(arguments, 1, { header: 'FormData.forEach' })
  20994. if (typeof callbackFn !== 'function') {
  20995. throw new TypeError(
  20996. "Failed to execute 'forEach' on 'FormData': parameter 1 is not of type 'Function'."
  20997. )
  20998. }
  20999. for (const [key, value] of this) {
  21000. callbackFn.apply(thisArg, [value, key, this])
  21001. }
  21002. }
  21003. }
  21004. FormData.prototype[Symbol.iterator] = FormData.prototype.entries
  21005. Object.defineProperties(FormData.prototype, {
  21006. [Symbol.toStringTag]: {
  21007. value: 'FormData',
  21008. configurable: true
  21009. }
  21010. })
  21011. /**
  21012. * @see https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#create-an-entry
  21013. * @param {string} name
  21014. * @param {string|Blob} value
  21015. * @param {?string} filename
  21016. * @returns
  21017. */
  21018. function makeEntry (name, value, filename) {
  21019. // 1. Set name to the result of converting name into a scalar value string.
  21020. // "To convert a string into a scalar value string, replace any surrogates
  21021. // with U+FFFD."
  21022. // see: https://nodejs.org/dist/latest-v18.x/docs/api/buffer.html#buftostringencoding-start-end
  21023. name = Buffer.from(name).toString('utf8')
  21024. // 2. If value is a string, then set value to the result of converting
  21025. // value into a scalar value string.
  21026. if (typeof value === 'string') {
  21027. value = Buffer.from(value).toString('utf8')
  21028. } else {
  21029. // 3. Otherwise:
  21030. // 1. If value is not a File object, then set value to a new File object,
  21031. // representing the same bytes, whose name attribute value is "blob"
  21032. if (!isFileLike(value)) {
  21033. value = value instanceof Blob
  21034. ? new File([value], 'blob', { type: value.type })
  21035. : new FileLike(value, 'blob', { type: value.type })
  21036. }
  21037. // 2. If filename is given, then set value to a new File object,
  21038. // representing the same bytes, whose name attribute is filename.
  21039. if (filename !== undefined) {
  21040. /** @type {FilePropertyBag} */
  21041. const options = {
  21042. type: value.type,
  21043. lastModified: value.lastModified
  21044. }
  21045. value = (NativeFile && value instanceof NativeFile) || value instanceof UndiciFile
  21046. ? new File([value], filename, options)
  21047. : new FileLike(value, filename, options)
  21048. }
  21049. }
  21050. // 4. Return an entry whose name is name and whose value is value.
  21051. return { name, value }
  21052. }
  21053. module.exports = { FormData }
  21054. /***/ }),
  21055. /***/ 1246:
  21056. /***/ ((module) => {
  21057. "use strict";
  21058. // In case of breaking changes, increase the version
  21059. // number to avoid conflicts.
  21060. const globalOrigin = Symbol.for('undici.globalOrigin.1')
  21061. function getGlobalOrigin () {
  21062. return globalThis[globalOrigin]
  21063. }
  21064. function setGlobalOrigin (newOrigin) {
  21065. if (newOrigin === undefined) {
  21066. Object.defineProperty(globalThis, globalOrigin, {
  21067. value: undefined,
  21068. writable: true,
  21069. enumerable: false,
  21070. configurable: false
  21071. })
  21072. return
  21073. }
  21074. const parsedURL = new URL(newOrigin)
  21075. if (parsedURL.protocol !== 'http:' && parsedURL.protocol !== 'https:') {
  21076. throw new TypeError(`Only http & https urls are allowed, received ${parsedURL.protocol}`)
  21077. }
  21078. Object.defineProperty(globalThis, globalOrigin, {
  21079. value: parsedURL,
  21080. writable: true,
  21081. enumerable: false,
  21082. configurable: false
  21083. })
  21084. }
  21085. module.exports = {
  21086. getGlobalOrigin,
  21087. setGlobalOrigin
  21088. }
  21089. /***/ }),
  21090. /***/ 554:
  21091. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  21092. "use strict";
  21093. // https://github.com/Ethan-Arrowood/undici-fetch
  21094. const { kHeadersList, kConstruct } = __nccwpck_require__(2785)
  21095. const { kGuard } = __nccwpck_require__(5861)
  21096. const { kEnumerableProperty } = __nccwpck_require__(3983)
  21097. const {
  21098. makeIterator,
  21099. isValidHeaderName,
  21100. isValidHeaderValue
  21101. } = __nccwpck_require__(2538)
  21102. const util = __nccwpck_require__(3837)
  21103. const { webidl } = __nccwpck_require__(1744)
  21104. const assert = __nccwpck_require__(9491)
  21105. const kHeadersMap = Symbol('headers map')
  21106. const kHeadersSortedMap = Symbol('headers map sorted')
  21107. /**
  21108. * @param {number} code
  21109. */
  21110. function isHTTPWhiteSpaceCharCode (code) {
  21111. return code === 0x00a || code === 0x00d || code === 0x009 || code === 0x020
  21112. }
  21113. /**
  21114. * @see https://fetch.spec.whatwg.org/#concept-header-value-normalize
  21115. * @param {string} potentialValue
  21116. */
  21117. function headerValueNormalize (potentialValue) {
  21118. // To normalize a byte sequence potentialValue, remove
  21119. // any leading and trailing HTTP whitespace bytes from
  21120. // potentialValue.
  21121. let i = 0; let j = potentialValue.length
  21122. while (j > i && isHTTPWhiteSpaceCharCode(potentialValue.charCodeAt(j - 1))) --j
  21123. while (j > i && isHTTPWhiteSpaceCharCode(potentialValue.charCodeAt(i))) ++i
  21124. return i === 0 && j === potentialValue.length ? potentialValue : potentialValue.substring(i, j)
  21125. }
  21126. function fill (headers, object) {
  21127. // To fill a Headers object headers with a given object object, run these steps:
  21128. // 1. If object is a sequence, then for each header in object:
  21129. // Note: webidl conversion to array has already been done.
  21130. if (Array.isArray(object)) {
  21131. for (let i = 0; i < object.length; ++i) {
  21132. const header = object[i]
  21133. // 1. If header does not contain exactly two items, then throw a TypeError.
  21134. if (header.length !== 2) {
  21135. throw webidl.errors.exception({
  21136. header: 'Headers constructor',
  21137. message: `expected name/value pair to be length 2, found ${header.length}.`
  21138. })
  21139. }
  21140. // 2. Append (header’s first item, header’s second item) to headers.
  21141. appendHeader(headers, header[0], header[1])
  21142. }
  21143. } else if (typeof object === 'object' && object !== null) {
  21144. // Note: null should throw
  21145. // 2. Otherwise, object is a record, then for each key → value in object,
  21146. // append (key, value) to headers
  21147. const keys = Object.keys(object)
  21148. for (let i = 0; i < keys.length; ++i) {
  21149. appendHeader(headers, keys[i], object[keys[i]])
  21150. }
  21151. } else {
  21152. throw webidl.errors.conversionFailed({
  21153. prefix: 'Headers constructor',
  21154. argument: 'Argument 1',
  21155. types: ['sequence<sequence<ByteString>>', 'record<ByteString, ByteString>']
  21156. })
  21157. }
  21158. }
  21159. /**
  21160. * @see https://fetch.spec.whatwg.org/#concept-headers-append
  21161. */
  21162. function appendHeader (headers, name, value) {
  21163. // 1. Normalize value.
  21164. value = headerValueNormalize(value)
  21165. // 2. If name is not a header name or value is not a
  21166. // header value, then throw a TypeError.
  21167. if (!isValidHeaderName(name)) {
  21168. throw webidl.errors.invalidArgument({
  21169. prefix: 'Headers.append',
  21170. value: name,
  21171. type: 'header name'
  21172. })
  21173. } else if (!isValidHeaderValue(value)) {
  21174. throw webidl.errors.invalidArgument({
  21175. prefix: 'Headers.append',
  21176. value,
  21177. type: 'header value'
  21178. })
  21179. }
  21180. // 3. If headers’s guard is "immutable", then throw a TypeError.
  21181. // 4. Otherwise, if headers’s guard is "request" and name is a
  21182. // forbidden header name, return.
  21183. // Note: undici does not implement forbidden header names
  21184. if (headers[kGuard] === 'immutable') {
  21185. throw new TypeError('immutable')
  21186. } else if (headers[kGuard] === 'request-no-cors') {
  21187. // 5. Otherwise, if headers’s guard is "request-no-cors":
  21188. // TODO
  21189. }
  21190. // 6. Otherwise, if headers’s guard is "response" and name is a
  21191. // forbidden response-header name, return.
  21192. // 7. Append (name, value) to headers’s header list.
  21193. return headers[kHeadersList].append(name, value)
  21194. // 8. If headers’s guard is "request-no-cors", then remove
  21195. // privileged no-CORS request headers from headers
  21196. }
  21197. class HeadersList {
  21198. /** @type {[string, string][]|null} */
  21199. cookies = null
  21200. constructor (init) {
  21201. if (init instanceof HeadersList) {
  21202. this[kHeadersMap] = new Map(init[kHeadersMap])
  21203. this[kHeadersSortedMap] = init[kHeadersSortedMap]
  21204. this.cookies = init.cookies === null ? null : [...init.cookies]
  21205. } else {
  21206. this[kHeadersMap] = new Map(init)
  21207. this[kHeadersSortedMap] = null
  21208. }
  21209. }
  21210. // https://fetch.spec.whatwg.org/#header-list-contains
  21211. contains (name) {
  21212. // A header list list contains a header name name if list
  21213. // contains a header whose name is a byte-case-insensitive
  21214. // match for name.
  21215. name = name.toLowerCase()
  21216. return this[kHeadersMap].has(name)
  21217. }
  21218. clear () {
  21219. this[kHeadersMap].clear()
  21220. this[kHeadersSortedMap] = null
  21221. this.cookies = null
  21222. }
  21223. // https://fetch.spec.whatwg.org/#concept-header-list-append
  21224. append (name, value) {
  21225. this[kHeadersSortedMap] = null
  21226. // 1. If list contains name, then set name to the first such
  21227. // header’s name.
  21228. const lowercaseName = name.toLowerCase()
  21229. const exists = this[kHeadersMap].get(lowercaseName)
  21230. // 2. Append (name, value) to list.
  21231. if (exists) {
  21232. const delimiter = lowercaseName === 'cookie' ? '; ' : ', '
  21233. this[kHeadersMap].set(lowercaseName, {
  21234. name: exists.name,
  21235. value: `${exists.value}${delimiter}${value}`
  21236. })
  21237. } else {
  21238. this[kHeadersMap].set(lowercaseName, { name, value })
  21239. }
  21240. if (lowercaseName === 'set-cookie') {
  21241. this.cookies ??= []
  21242. this.cookies.push(value)
  21243. }
  21244. }
  21245. // https://fetch.spec.whatwg.org/#concept-header-list-set
  21246. set (name, value) {
  21247. this[kHeadersSortedMap] = null
  21248. const lowercaseName = name.toLowerCase()
  21249. if (lowercaseName === 'set-cookie') {
  21250. this.cookies = [value]
  21251. }
  21252. // 1. If list contains name, then set the value of
  21253. // the first such header to value and remove the
  21254. // others.
  21255. // 2. Otherwise, append header (name, value) to list.
  21256. this[kHeadersMap].set(lowercaseName, { name, value })
  21257. }
  21258. // https://fetch.spec.whatwg.org/#concept-header-list-delete
  21259. delete (name) {
  21260. this[kHeadersSortedMap] = null
  21261. name = name.toLowerCase()
  21262. if (name === 'set-cookie') {
  21263. this.cookies = null
  21264. }
  21265. this[kHeadersMap].delete(name)
  21266. }
  21267. // https://fetch.spec.whatwg.org/#concept-header-list-get
  21268. get (name) {
  21269. const value = this[kHeadersMap].get(name.toLowerCase())
  21270. // 1. If list does not contain name, then return null.
  21271. // 2. Return the values of all headers in list whose name
  21272. // is a byte-case-insensitive match for name,
  21273. // separated from each other by 0x2C 0x20, in order.
  21274. return value === undefined ? null : value.value
  21275. }
  21276. * [Symbol.iterator] () {
  21277. // use the lowercased name
  21278. for (const [name, { value }] of this[kHeadersMap]) {
  21279. yield [name, value]
  21280. }
  21281. }
  21282. get entries () {
  21283. const headers = {}
  21284. if (this[kHeadersMap].size) {
  21285. for (const { name, value } of this[kHeadersMap].values()) {
  21286. headers[name] = value
  21287. }
  21288. }
  21289. return headers
  21290. }
  21291. }
  21292. // https://fetch.spec.whatwg.org/#headers-class
  21293. class Headers {
  21294. constructor (init = undefined) {
  21295. if (init === kConstruct) {
  21296. return
  21297. }
  21298. this[kHeadersList] = new HeadersList()
  21299. // The new Headers(init) constructor steps are:
  21300. // 1. Set this’s guard to "none".
  21301. this[kGuard] = 'none'
  21302. // 2. If init is given, then fill this with init.
  21303. if (init !== undefined) {
  21304. init = webidl.converters.HeadersInit(init)
  21305. fill(this, init)
  21306. }
  21307. }
  21308. // https://fetch.spec.whatwg.org/#dom-headers-append
  21309. append (name, value) {
  21310. webidl.brandCheck(this, Headers)
  21311. webidl.argumentLengthCheck(arguments, 2, { header: 'Headers.append' })
  21312. name = webidl.converters.ByteString(name)
  21313. value = webidl.converters.ByteString(value)
  21314. return appendHeader(this, name, value)
  21315. }
  21316. // https://fetch.spec.whatwg.org/#dom-headers-delete
  21317. delete (name) {
  21318. webidl.brandCheck(this, Headers)
  21319. webidl.argumentLengthCheck(arguments, 1, { header: 'Headers.delete' })
  21320. name = webidl.converters.ByteString(name)
  21321. // 1. If name is not a header name, then throw a TypeError.
  21322. if (!isValidHeaderName(name)) {
  21323. throw webidl.errors.invalidArgument({
  21324. prefix: 'Headers.delete',
  21325. value: name,
  21326. type: 'header name'
  21327. })
  21328. }
  21329. // 2. If this’s guard is "immutable", then throw a TypeError.
  21330. // 3. Otherwise, if this’s guard is "request" and name is a
  21331. // forbidden header name, return.
  21332. // 4. Otherwise, if this’s guard is "request-no-cors", name
  21333. // is not a no-CORS-safelisted request-header name, and
  21334. // name is not a privileged no-CORS request-header name,
  21335. // return.
  21336. // 5. Otherwise, if this’s guard is "response" and name is
  21337. // a forbidden response-header name, return.
  21338. // Note: undici does not implement forbidden header names
  21339. if (this[kGuard] === 'immutable') {
  21340. throw new TypeError('immutable')
  21341. } else if (this[kGuard] === 'request-no-cors') {
  21342. // TODO
  21343. }
  21344. // 6. If this’s header list does not contain name, then
  21345. // return.
  21346. if (!this[kHeadersList].contains(name)) {
  21347. return
  21348. }
  21349. // 7. Delete name from this’s header list.
  21350. // 8. If this’s guard is "request-no-cors", then remove
  21351. // privileged no-CORS request headers from this.
  21352. this[kHeadersList].delete(name)
  21353. }
  21354. // https://fetch.spec.whatwg.org/#dom-headers-get
  21355. get (name) {
  21356. webidl.brandCheck(this, Headers)
  21357. webidl.argumentLengthCheck(arguments, 1, { header: 'Headers.get' })
  21358. name = webidl.converters.ByteString(name)
  21359. // 1. If name is not a header name, then throw a TypeError.
  21360. if (!isValidHeaderName(name)) {
  21361. throw webidl.errors.invalidArgument({
  21362. prefix: 'Headers.get',
  21363. value: name,
  21364. type: 'header name'
  21365. })
  21366. }
  21367. // 2. Return the result of getting name from this’s header
  21368. // list.
  21369. return this[kHeadersList].get(name)
  21370. }
  21371. // https://fetch.spec.whatwg.org/#dom-headers-has
  21372. has (name) {
  21373. webidl.brandCheck(this, Headers)
  21374. webidl.argumentLengthCheck(arguments, 1, { header: 'Headers.has' })
  21375. name = webidl.converters.ByteString(name)
  21376. // 1. If name is not a header name, then throw a TypeError.
  21377. if (!isValidHeaderName(name)) {
  21378. throw webidl.errors.invalidArgument({
  21379. prefix: 'Headers.has',
  21380. value: name,
  21381. type: 'header name'
  21382. })
  21383. }
  21384. // 2. Return true if this’s header list contains name;
  21385. // otherwise false.
  21386. return this[kHeadersList].contains(name)
  21387. }
  21388. // https://fetch.spec.whatwg.org/#dom-headers-set
  21389. set (name, value) {
  21390. webidl.brandCheck(this, Headers)
  21391. webidl.argumentLengthCheck(arguments, 2, { header: 'Headers.set' })
  21392. name = webidl.converters.ByteString(name)
  21393. value = webidl.converters.ByteString(value)
  21394. // 1. Normalize value.
  21395. value = headerValueNormalize(value)
  21396. // 2. If name is not a header name or value is not a
  21397. // header value, then throw a TypeError.
  21398. if (!isValidHeaderName(name)) {
  21399. throw webidl.errors.invalidArgument({
  21400. prefix: 'Headers.set',
  21401. value: name,
  21402. type: 'header name'
  21403. })
  21404. } else if (!isValidHeaderValue(value)) {
  21405. throw webidl.errors.invalidArgument({
  21406. prefix: 'Headers.set',
  21407. value,
  21408. type: 'header value'
  21409. })
  21410. }
  21411. // 3. If this’s guard is "immutable", then throw a TypeError.
  21412. // 4. Otherwise, if this’s guard is "request" and name is a
  21413. // forbidden header name, return.
  21414. // 5. Otherwise, if this’s guard is "request-no-cors" and
  21415. // name/value is not a no-CORS-safelisted request-header,
  21416. // return.
  21417. // 6. Otherwise, if this’s guard is "response" and name is a
  21418. // forbidden response-header name, return.
  21419. // Note: undici does not implement forbidden header names
  21420. if (this[kGuard] === 'immutable') {
  21421. throw new TypeError('immutable')
  21422. } else if (this[kGuard] === 'request-no-cors') {
  21423. // TODO
  21424. }
  21425. // 7. Set (name, value) in this’s header list.
  21426. // 8. If this’s guard is "request-no-cors", then remove
  21427. // privileged no-CORS request headers from this
  21428. this[kHeadersList].set(name, value)
  21429. }
  21430. // https://fetch.spec.whatwg.org/#dom-headers-getsetcookie
  21431. getSetCookie () {
  21432. webidl.brandCheck(this, Headers)
  21433. // 1. If this’s header list does not contain `Set-Cookie`, then return « ».
  21434. // 2. Return the values of all headers in this’s header list whose name is
  21435. // a byte-case-insensitive match for `Set-Cookie`, in order.
  21436. const list = this[kHeadersList].cookies
  21437. if (list) {
  21438. return [...list]
  21439. }
  21440. return []
  21441. }
  21442. // https://fetch.spec.whatwg.org/#concept-header-list-sort-and-combine
  21443. get [kHeadersSortedMap] () {
  21444. if (this[kHeadersList][kHeadersSortedMap]) {
  21445. return this[kHeadersList][kHeadersSortedMap]
  21446. }
  21447. // 1. Let headers be an empty list of headers with the key being the name
  21448. // and value the value.
  21449. const headers = []
  21450. // 2. Let names be the result of convert header names to a sorted-lowercase
  21451. // set with all the names of the headers in list.
  21452. const names = [...this[kHeadersList]].sort((a, b) => a[0] < b[0] ? -1 : 1)
  21453. const cookies = this[kHeadersList].cookies
  21454. // 3. For each name of names:
  21455. for (let i = 0; i < names.length; ++i) {
  21456. const [name, value] = names[i]
  21457. // 1. If name is `set-cookie`, then:
  21458. if (name === 'set-cookie') {
  21459. // 1. Let values be a list of all values of headers in list whose name
  21460. // is a byte-case-insensitive match for name, in order.
  21461. // 2. For each value of values:
  21462. // 1. Append (name, value) to headers.
  21463. for (let j = 0; j < cookies.length; ++j) {
  21464. headers.push([name, cookies[j]])
  21465. }
  21466. } else {
  21467. // 2. Otherwise:
  21468. // 1. Let value be the result of getting name from list.
  21469. // 2. Assert: value is non-null.
  21470. assert(value !== null)
  21471. // 3. Append (name, value) to headers.
  21472. headers.push([name, value])
  21473. }
  21474. }
  21475. this[kHeadersList][kHeadersSortedMap] = headers
  21476. // 4. Return headers.
  21477. return headers
  21478. }
  21479. keys () {
  21480. webidl.brandCheck(this, Headers)
  21481. if (this[kGuard] === 'immutable') {
  21482. const value = this[kHeadersSortedMap]
  21483. return makeIterator(() => value, 'Headers',
  21484. 'key')
  21485. }
  21486. return makeIterator(
  21487. () => [...this[kHeadersSortedMap].values()],
  21488. 'Headers',
  21489. 'key'
  21490. )
  21491. }
  21492. values () {
  21493. webidl.brandCheck(this, Headers)
  21494. if (this[kGuard] === 'immutable') {
  21495. const value = this[kHeadersSortedMap]
  21496. return makeIterator(() => value, 'Headers',
  21497. 'value')
  21498. }
  21499. return makeIterator(
  21500. () => [...this[kHeadersSortedMap].values()],
  21501. 'Headers',
  21502. 'value'
  21503. )
  21504. }
  21505. entries () {
  21506. webidl.brandCheck(this, Headers)
  21507. if (this[kGuard] === 'immutable') {
  21508. const value = this[kHeadersSortedMap]
  21509. return makeIterator(() => value, 'Headers',
  21510. 'key+value')
  21511. }
  21512. return makeIterator(
  21513. () => [...this[kHeadersSortedMap].values()],
  21514. 'Headers',
  21515. 'key+value'
  21516. )
  21517. }
  21518. /**
  21519. * @param {(value: string, key: string, self: Headers) => void} callbackFn
  21520. * @param {unknown} thisArg
  21521. */
  21522. forEach (callbackFn, thisArg = globalThis) {
  21523. webidl.brandCheck(this, Headers)
  21524. webidl.argumentLengthCheck(arguments, 1, { header: 'Headers.forEach' })
  21525. if (typeof callbackFn !== 'function') {
  21526. throw new TypeError(
  21527. "Failed to execute 'forEach' on 'Headers': parameter 1 is not of type 'Function'."
  21528. )
  21529. }
  21530. for (const [key, value] of this) {
  21531. callbackFn.apply(thisArg, [value, key, this])
  21532. }
  21533. }
  21534. [Symbol.for('nodejs.util.inspect.custom')] () {
  21535. webidl.brandCheck(this, Headers)
  21536. return this[kHeadersList]
  21537. }
  21538. }
  21539. Headers.prototype[Symbol.iterator] = Headers.prototype.entries
  21540. Object.defineProperties(Headers.prototype, {
  21541. append: kEnumerableProperty,
  21542. delete: kEnumerableProperty,
  21543. get: kEnumerableProperty,
  21544. has: kEnumerableProperty,
  21545. set: kEnumerableProperty,
  21546. getSetCookie: kEnumerableProperty,
  21547. keys: kEnumerableProperty,
  21548. values: kEnumerableProperty,
  21549. entries: kEnumerableProperty,
  21550. forEach: kEnumerableProperty,
  21551. [Symbol.iterator]: { enumerable: false },
  21552. [Symbol.toStringTag]: {
  21553. value: 'Headers',
  21554. configurable: true
  21555. },
  21556. [util.inspect.custom]: {
  21557. enumerable: false
  21558. }
  21559. })
  21560. webidl.converters.HeadersInit = function (V) {
  21561. if (webidl.util.Type(V) === 'Object') {
  21562. if (V[Symbol.iterator]) {
  21563. return webidl.converters['sequence<sequence<ByteString>>'](V)
  21564. }
  21565. return webidl.converters['record<ByteString, ByteString>'](V)
  21566. }
  21567. throw webidl.errors.conversionFailed({
  21568. prefix: 'Headers constructor',
  21569. argument: 'Argument 1',
  21570. types: ['sequence<sequence<ByteString>>', 'record<ByteString, ByteString>']
  21571. })
  21572. }
  21573. module.exports = {
  21574. fill,
  21575. Headers,
  21576. HeadersList
  21577. }
  21578. /***/ }),
  21579. /***/ 4881:
  21580. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  21581. "use strict";
  21582. // https://github.com/Ethan-Arrowood/undici-fetch
  21583. const {
  21584. Response,
  21585. makeNetworkError,
  21586. makeAppropriateNetworkError,
  21587. filterResponse,
  21588. makeResponse
  21589. } = __nccwpck_require__(7823)
  21590. const { Headers } = __nccwpck_require__(554)
  21591. const { Request, makeRequest } = __nccwpck_require__(8359)
  21592. const zlib = __nccwpck_require__(9796)
  21593. const {
  21594. bytesMatch,
  21595. makePolicyContainer,
  21596. clonePolicyContainer,
  21597. requestBadPort,
  21598. TAOCheck,
  21599. appendRequestOriginHeader,
  21600. responseLocationURL,
  21601. requestCurrentURL,
  21602. setRequestReferrerPolicyOnRedirect,
  21603. tryUpgradeRequestToAPotentiallyTrustworthyURL,
  21604. createOpaqueTimingInfo,
  21605. appendFetchMetadata,
  21606. corsCheck,
  21607. crossOriginResourcePolicyCheck,
  21608. determineRequestsReferrer,
  21609. coarsenedSharedCurrentTime,
  21610. createDeferredPromise,
  21611. isBlobLike,
  21612. sameOrigin,
  21613. isCancelled,
  21614. isAborted,
  21615. isErrorLike,
  21616. fullyReadBody,
  21617. readableStreamClose,
  21618. isomorphicEncode,
  21619. urlIsLocal,
  21620. urlIsHttpHttpsScheme,
  21621. urlHasHttpsScheme
  21622. } = __nccwpck_require__(2538)
  21623. const { kState, kHeaders, kGuard, kRealm } = __nccwpck_require__(5861)
  21624. const assert = __nccwpck_require__(9491)
  21625. const { safelyExtractBody } = __nccwpck_require__(9990)
  21626. const {
  21627. redirectStatusSet,
  21628. nullBodyStatus,
  21629. safeMethodsSet,
  21630. requestBodyHeader,
  21631. subresourceSet,
  21632. DOMException
  21633. } = __nccwpck_require__(1037)
  21634. const { kHeadersList } = __nccwpck_require__(2785)
  21635. const EE = __nccwpck_require__(2361)
  21636. const { Readable, pipeline } = __nccwpck_require__(2781)
  21637. const { addAbortListener, isErrored, isReadable, nodeMajor, nodeMinor } = __nccwpck_require__(3983)
  21638. const { dataURLProcessor, serializeAMimeType } = __nccwpck_require__(685)
  21639. const { TransformStream } = __nccwpck_require__(5356)
  21640. const { getGlobalDispatcher } = __nccwpck_require__(1892)
  21641. const { webidl } = __nccwpck_require__(1744)
  21642. const { STATUS_CODES } = __nccwpck_require__(3685)
  21643. const GET_OR_HEAD = ['GET', 'HEAD']
  21644. /** @type {import('buffer').resolveObjectURL} */
  21645. let resolveObjectURL
  21646. let ReadableStream = globalThis.ReadableStream
  21647. class Fetch extends EE {
  21648. constructor (dispatcher) {
  21649. super()
  21650. this.dispatcher = dispatcher
  21651. this.connection = null
  21652. this.dump = false
  21653. this.state = 'ongoing'
  21654. // 2 terminated listeners get added per request,
  21655. // but only 1 gets removed. If there are 20 redirects,
  21656. // 21 listeners will be added.
  21657. // See https://github.com/nodejs/undici/issues/1711
  21658. // TODO (fix): Find and fix root cause for leaked listener.
  21659. this.setMaxListeners(21)
  21660. }
  21661. terminate (reason) {
  21662. if (this.state !== 'ongoing') {
  21663. return
  21664. }
  21665. this.state = 'terminated'
  21666. this.connection?.destroy(reason)
  21667. this.emit('terminated', reason)
  21668. }
  21669. // https://fetch.spec.whatwg.org/#fetch-controller-abort
  21670. abort (error) {
  21671. if (this.state !== 'ongoing') {
  21672. return
  21673. }
  21674. // 1. Set controller’s state to "aborted".
  21675. this.state = 'aborted'
  21676. // 2. Let fallbackError be an "AbortError" DOMException.
  21677. // 3. Set error to fallbackError if it is not given.
  21678. if (!error) {
  21679. error = new DOMException('The operation was aborted.', 'AbortError')
  21680. }
  21681. // 4. Let serializedError be StructuredSerialize(error).
  21682. // If that threw an exception, catch it, and let
  21683. // serializedError be StructuredSerialize(fallbackError).
  21684. // 5. Set controller’s serialized abort reason to serializedError.
  21685. this.serializedAbortReason = error
  21686. this.connection?.destroy(error)
  21687. this.emit('terminated', error)
  21688. }
  21689. }
  21690. // https://fetch.spec.whatwg.org/#fetch-method
  21691. function fetch (input, init = {}) {
  21692. webidl.argumentLengthCheck(arguments, 1, { header: 'globalThis.fetch' })
  21693. // 1. Let p be a new promise.
  21694. const p = createDeferredPromise()
  21695. // 2. Let requestObject be the result of invoking the initial value of
  21696. // Request as constructor with input and init as arguments. If this throws
  21697. // an exception, reject p with it and return p.
  21698. let requestObject
  21699. try {
  21700. requestObject = new Request(input, init)
  21701. } catch (e) {
  21702. p.reject(e)
  21703. return p.promise
  21704. }
  21705. // 3. Let request be requestObject’s request.
  21706. const request = requestObject[kState]
  21707. // 4. If requestObject’s signal’s aborted flag is set, then:
  21708. if (requestObject.signal.aborted) {
  21709. // 1. Abort the fetch() call with p, request, null, and
  21710. // requestObject’s signal’s abort reason.
  21711. abortFetch(p, request, null, requestObject.signal.reason)
  21712. // 2. Return p.
  21713. return p.promise
  21714. }
  21715. // 5. Let globalObject be request’s client’s global object.
  21716. const globalObject = request.client.globalObject
  21717. // 6. If globalObject is a ServiceWorkerGlobalScope object, then set
  21718. // request’s service-workers mode to "none".
  21719. if (globalObject?.constructor?.name === 'ServiceWorkerGlobalScope') {
  21720. request.serviceWorkers = 'none'
  21721. }
  21722. // 7. Let responseObject be null.
  21723. let responseObject = null
  21724. // 8. Let relevantRealm be this’s relevant Realm.
  21725. const relevantRealm = null
  21726. // 9. Let locallyAborted be false.
  21727. let locallyAborted = false
  21728. // 10. Let controller be null.
  21729. let controller = null
  21730. // 11. Add the following abort steps to requestObject’s signal:
  21731. addAbortListener(
  21732. requestObject.signal,
  21733. () => {
  21734. // 1. Set locallyAborted to true.
  21735. locallyAborted = true
  21736. // 2. Assert: controller is non-null.
  21737. assert(controller != null)
  21738. // 3. Abort controller with requestObject’s signal’s abort reason.
  21739. controller.abort(requestObject.signal.reason)
  21740. // 4. Abort the fetch() call with p, request, responseObject,
  21741. // and requestObject’s signal’s abort reason.
  21742. abortFetch(p, request, responseObject, requestObject.signal.reason)
  21743. }
  21744. )
  21745. // 12. Let handleFetchDone given response response be to finalize and
  21746. // report timing with response, globalObject, and "fetch".
  21747. const handleFetchDone = (response) =>
  21748. finalizeAndReportTiming(response, 'fetch')
  21749. // 13. Set controller to the result of calling fetch given request,
  21750. // with processResponseEndOfBody set to handleFetchDone, and processResponse
  21751. // given response being these substeps:
  21752. const processResponse = (response) => {
  21753. // 1. If locallyAborted is true, terminate these substeps.
  21754. if (locallyAborted) {
  21755. return Promise.resolve()
  21756. }
  21757. // 2. If response’s aborted flag is set, then:
  21758. if (response.aborted) {
  21759. // 1. Let deserializedError be the result of deserialize a serialized
  21760. // abort reason given controller’s serialized abort reason and
  21761. // relevantRealm.
  21762. // 2. Abort the fetch() call with p, request, responseObject, and
  21763. // deserializedError.
  21764. abortFetch(p, request, responseObject, controller.serializedAbortReason)
  21765. return Promise.resolve()
  21766. }
  21767. // 3. If response is a network error, then reject p with a TypeError
  21768. // and terminate these substeps.
  21769. if (response.type === 'error') {
  21770. p.reject(
  21771. Object.assign(new TypeError('fetch failed'), { cause: response.error })
  21772. )
  21773. return Promise.resolve()
  21774. }
  21775. // 4. Set responseObject to the result of creating a Response object,
  21776. // given response, "immutable", and relevantRealm.
  21777. responseObject = new Response()
  21778. responseObject[kState] = response
  21779. responseObject[kRealm] = relevantRealm
  21780. responseObject[kHeaders][kHeadersList] = response.headersList
  21781. responseObject[kHeaders][kGuard] = 'immutable'
  21782. responseObject[kHeaders][kRealm] = relevantRealm
  21783. // 5. Resolve p with responseObject.
  21784. p.resolve(responseObject)
  21785. }
  21786. controller = fetching({
  21787. request,
  21788. processResponseEndOfBody: handleFetchDone,
  21789. processResponse,
  21790. dispatcher: init.dispatcher ?? getGlobalDispatcher() // undici
  21791. })
  21792. // 14. Return p.
  21793. return p.promise
  21794. }
  21795. // https://fetch.spec.whatwg.org/#finalize-and-report-timing
  21796. function finalizeAndReportTiming (response, initiatorType = 'other') {
  21797. // 1. If response is an aborted network error, then return.
  21798. if (response.type === 'error' && response.aborted) {
  21799. return
  21800. }
  21801. // 2. If response’s URL list is null or empty, then return.
  21802. if (!response.urlList?.length) {
  21803. return
  21804. }
  21805. // 3. Let originalURL be response’s URL list[0].
  21806. const originalURL = response.urlList[0]
  21807. // 4. Let timingInfo be response’s timing info.
  21808. let timingInfo = response.timingInfo
  21809. // 5. Let cacheState be response’s cache state.
  21810. let cacheState = response.cacheState
  21811. // 6. If originalURL’s scheme is not an HTTP(S) scheme, then return.
  21812. if (!urlIsHttpHttpsScheme(originalURL)) {
  21813. return
  21814. }
  21815. // 7. If timingInfo is null, then return.
  21816. if (timingInfo === null) {
  21817. return
  21818. }
  21819. // 8. If response’s timing allow passed flag is not set, then:
  21820. if (!response.timingAllowPassed) {
  21821. // 1. Set timingInfo to a the result of creating an opaque timing info for timingInfo.
  21822. timingInfo = createOpaqueTimingInfo({
  21823. startTime: timingInfo.startTime
  21824. })
  21825. // 2. Set cacheState to the empty string.
  21826. cacheState = ''
  21827. }
  21828. // 9. Set timingInfo’s end time to the coarsened shared current time
  21829. // given global’s relevant settings object’s cross-origin isolated
  21830. // capability.
  21831. // TODO: given global’s relevant settings object’s cross-origin isolated
  21832. // capability?
  21833. timingInfo.endTime = coarsenedSharedCurrentTime()
  21834. // 10. Set response’s timing info to timingInfo.
  21835. response.timingInfo = timingInfo
  21836. // 11. Mark resource timing for timingInfo, originalURL, initiatorType,
  21837. // global, and cacheState.
  21838. markResourceTiming(
  21839. timingInfo,
  21840. originalURL,
  21841. initiatorType,
  21842. globalThis,
  21843. cacheState
  21844. )
  21845. }
  21846. // https://w3c.github.io/resource-timing/#dfn-mark-resource-timing
  21847. function markResourceTiming (timingInfo, originalURL, initiatorType, globalThis, cacheState) {
  21848. if (nodeMajor > 18 || (nodeMajor === 18 && nodeMinor >= 2)) {
  21849. performance.markResourceTiming(timingInfo, originalURL.href, initiatorType, globalThis, cacheState)
  21850. }
  21851. }
  21852. // https://fetch.spec.whatwg.org/#abort-fetch
  21853. function abortFetch (p, request, responseObject, error) {
  21854. // Note: AbortSignal.reason was added in node v17.2.0
  21855. // which would give us an undefined error to reject with.
  21856. // Remove this once node v16 is no longer supported.
  21857. if (!error) {
  21858. error = new DOMException('The operation was aborted.', 'AbortError')
  21859. }
  21860. // 1. Reject promise with error.
  21861. p.reject(error)
  21862. // 2. If request’s body is not null and is readable, then cancel request’s
  21863. // body with error.
  21864. if (request.body != null && isReadable(request.body?.stream)) {
  21865. request.body.stream.cancel(error).catch((err) => {
  21866. if (err.code === 'ERR_INVALID_STATE') {
  21867. // Node bug?
  21868. return
  21869. }
  21870. throw err
  21871. })
  21872. }
  21873. // 3. If responseObject is null, then return.
  21874. if (responseObject == null) {
  21875. return
  21876. }
  21877. // 4. Let response be responseObject’s response.
  21878. const response = responseObject[kState]
  21879. // 5. If response’s body is not null and is readable, then error response’s
  21880. // body with error.
  21881. if (response.body != null && isReadable(response.body?.stream)) {
  21882. response.body.stream.cancel(error).catch((err) => {
  21883. if (err.code === 'ERR_INVALID_STATE') {
  21884. // Node bug?
  21885. return
  21886. }
  21887. throw err
  21888. })
  21889. }
  21890. }
  21891. // https://fetch.spec.whatwg.org/#fetching
  21892. function fetching ({
  21893. request,
  21894. processRequestBodyChunkLength,
  21895. processRequestEndOfBody,
  21896. processResponse,
  21897. processResponseEndOfBody,
  21898. processResponseConsumeBody,
  21899. useParallelQueue = false,
  21900. dispatcher // undici
  21901. }) {
  21902. // 1. Let taskDestination be null.
  21903. let taskDestination = null
  21904. // 2. Let crossOriginIsolatedCapability be false.
  21905. let crossOriginIsolatedCapability = false
  21906. // 3. If request’s client is non-null, then:
  21907. if (request.client != null) {
  21908. // 1. Set taskDestination to request’s client’s global object.
  21909. taskDestination = request.client.globalObject
  21910. // 2. Set crossOriginIsolatedCapability to request’s client’s cross-origin
  21911. // isolated capability.
  21912. crossOriginIsolatedCapability =
  21913. request.client.crossOriginIsolatedCapability
  21914. }
  21915. // 4. If useParallelQueue is true, then set taskDestination to the result of
  21916. // starting a new parallel queue.
  21917. // TODO
  21918. // 5. Let timingInfo be a new fetch timing info whose start time and
  21919. // post-redirect start time are the coarsened shared current time given
  21920. // crossOriginIsolatedCapability.
  21921. const currenTime = coarsenedSharedCurrentTime(crossOriginIsolatedCapability)
  21922. const timingInfo = createOpaqueTimingInfo({
  21923. startTime: currenTime
  21924. })
  21925. // 6. Let fetchParams be a new fetch params whose
  21926. // request is request,
  21927. // timing info is timingInfo,
  21928. // process request body chunk length is processRequestBodyChunkLength,
  21929. // process request end-of-body is processRequestEndOfBody,
  21930. // process response is processResponse,
  21931. // process response consume body is processResponseConsumeBody,
  21932. // process response end-of-body is processResponseEndOfBody,
  21933. // task destination is taskDestination,
  21934. // and cross-origin isolated capability is crossOriginIsolatedCapability.
  21935. const fetchParams = {
  21936. controller: new Fetch(dispatcher),
  21937. request,
  21938. timingInfo,
  21939. processRequestBodyChunkLength,
  21940. processRequestEndOfBody,
  21941. processResponse,
  21942. processResponseConsumeBody,
  21943. processResponseEndOfBody,
  21944. taskDestination,
  21945. crossOriginIsolatedCapability
  21946. }
  21947. // 7. If request’s body is a byte sequence, then set request’s body to
  21948. // request’s body as a body.
  21949. // NOTE: Since fetching is only called from fetch, body should already be
  21950. // extracted.
  21951. assert(!request.body || request.body.stream)
  21952. // 8. If request’s window is "client", then set request’s window to request’s
  21953. // client, if request’s client’s global object is a Window object; otherwise
  21954. // "no-window".
  21955. if (request.window === 'client') {
  21956. // TODO: What if request.client is null?
  21957. request.window =
  21958. request.client?.globalObject?.constructor?.name === 'Window'
  21959. ? request.client
  21960. : 'no-window'
  21961. }
  21962. // 9. If request’s origin is "client", then set request’s origin to request’s
  21963. // client’s origin.
  21964. if (request.origin === 'client') {
  21965. // TODO: What if request.client is null?
  21966. request.origin = request.client?.origin
  21967. }
  21968. // 10. If all of the following conditions are true:
  21969. // TODO
  21970. // 11. If request’s policy container is "client", then:
  21971. if (request.policyContainer === 'client') {
  21972. // 1. If request’s client is non-null, then set request’s policy
  21973. // container to a clone of request’s client’s policy container. [HTML]
  21974. if (request.client != null) {
  21975. request.policyContainer = clonePolicyContainer(
  21976. request.client.policyContainer
  21977. )
  21978. } else {
  21979. // 2. Otherwise, set request’s policy container to a new policy
  21980. // container.
  21981. request.policyContainer = makePolicyContainer()
  21982. }
  21983. }
  21984. // 12. If request’s header list does not contain `Accept`, then:
  21985. if (!request.headersList.contains('accept')) {
  21986. // 1. Let value be `*/*`.
  21987. const value = '*/*'
  21988. // 2. A user agent should set value to the first matching statement, if
  21989. // any, switching on request’s destination:
  21990. // "document"
  21991. // "frame"
  21992. // "iframe"
  21993. // `text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8`
  21994. // "image"
  21995. // `image/png,image/svg+xml,image/*;q=0.8,*/*;q=0.5`
  21996. // "style"
  21997. // `text/css,*/*;q=0.1`
  21998. // TODO
  21999. // 3. Append `Accept`/value to request’s header list.
  22000. request.headersList.append('accept', value)
  22001. }
  22002. // 13. If request’s header list does not contain `Accept-Language`, then
  22003. // user agents should append `Accept-Language`/an appropriate value to
  22004. // request’s header list.
  22005. if (!request.headersList.contains('accept-language')) {
  22006. request.headersList.append('accept-language', '*')
  22007. }
  22008. // 14. If request’s priority is null, then use request’s initiator and
  22009. // destination appropriately in setting request’s priority to a
  22010. // user-agent-defined object.
  22011. if (request.priority === null) {
  22012. // TODO
  22013. }
  22014. // 15. If request is a subresource request, then:
  22015. if (subresourceSet.has(request.destination)) {
  22016. // TODO
  22017. }
  22018. // 16. Run main fetch given fetchParams.
  22019. mainFetch(fetchParams)
  22020. .catch(err => {
  22021. fetchParams.controller.terminate(err)
  22022. })
  22023. // 17. Return fetchParam's controller
  22024. return fetchParams.controller
  22025. }
  22026. // https://fetch.spec.whatwg.org/#concept-main-fetch
  22027. async function mainFetch (fetchParams, recursive = false) {
  22028. // 1. Let request be fetchParams’s request.
  22029. const request = fetchParams.request
  22030. // 2. Let response be null.
  22031. let response = null
  22032. // 3. If request’s local-URLs-only flag is set and request’s current URL is
  22033. // not local, then set response to a network error.
  22034. if (request.localURLsOnly && !urlIsLocal(requestCurrentURL(request))) {
  22035. response = makeNetworkError('local URLs only')
  22036. }
  22037. // 4. Run report Content Security Policy violations for request.
  22038. // TODO
  22039. // 5. Upgrade request to a potentially trustworthy URL, if appropriate.
  22040. tryUpgradeRequestToAPotentiallyTrustworthyURL(request)
  22041. // 6. If should request be blocked due to a bad port, should fetching request
  22042. // be blocked as mixed content, or should request be blocked by Content
  22043. // Security Policy returns blocked, then set response to a network error.
  22044. if (requestBadPort(request) === 'blocked') {
  22045. response = makeNetworkError('bad port')
  22046. }
  22047. // TODO: should fetching request be blocked as mixed content?
  22048. // TODO: should request be blocked by Content Security Policy?
  22049. // 7. If request’s referrer policy is the empty string, then set request’s
  22050. // referrer policy to request’s policy container’s referrer policy.
  22051. if (request.referrerPolicy === '') {
  22052. request.referrerPolicy = request.policyContainer.referrerPolicy
  22053. }
  22054. // 8. If request’s referrer is not "no-referrer", then set request’s
  22055. // referrer to the result of invoking determine request’s referrer.
  22056. if (request.referrer !== 'no-referrer') {
  22057. request.referrer = determineRequestsReferrer(request)
  22058. }
  22059. // 9. Set request’s current URL’s scheme to "https" if all of the following
  22060. // conditions are true:
  22061. // - request’s current URL’s scheme is "http"
  22062. // - request’s current URL’s host is a domain
  22063. // - Matching request’s current URL’s host per Known HSTS Host Domain Name
  22064. // Matching results in either a superdomain match with an asserted
  22065. // includeSubDomains directive or a congruent match (with or without an
  22066. // asserted includeSubDomains directive). [HSTS]
  22067. // TODO
  22068. // 10. If recursive is false, then run the remaining steps in parallel.
  22069. // TODO
  22070. // 11. If response is null, then set response to the result of running
  22071. // the steps corresponding to the first matching statement:
  22072. if (response === null) {
  22073. response = await (async () => {
  22074. const currentURL = requestCurrentURL(request)
  22075. if (
  22076. // - request’s current URL’s origin is same origin with request’s origin,
  22077. // and request’s response tainting is "basic"
  22078. (sameOrigin(currentURL, request.url) && request.responseTainting === 'basic') ||
  22079. // request’s current URL’s scheme is "data"
  22080. (currentURL.protocol === 'data:') ||
  22081. // - request’s mode is "navigate" or "websocket"
  22082. (request.mode === 'navigate' || request.mode === 'websocket')
  22083. ) {
  22084. // 1. Set request’s response tainting to "basic".
  22085. request.responseTainting = 'basic'
  22086. // 2. Return the result of running scheme fetch given fetchParams.
  22087. return await schemeFetch(fetchParams)
  22088. }
  22089. // request’s mode is "same-origin"
  22090. if (request.mode === 'same-origin') {
  22091. // 1. Return a network error.
  22092. return makeNetworkError('request mode cannot be "same-origin"')
  22093. }
  22094. // request’s mode is "no-cors"
  22095. if (request.mode === 'no-cors') {
  22096. // 1. If request’s redirect mode is not "follow", then return a network
  22097. // error.
  22098. if (request.redirect !== 'follow') {
  22099. return makeNetworkError(
  22100. 'redirect mode cannot be "follow" for "no-cors" request'
  22101. )
  22102. }
  22103. // 2. Set request’s response tainting to "opaque".
  22104. request.responseTainting = 'opaque'
  22105. // 3. Return the result of running scheme fetch given fetchParams.
  22106. return await schemeFetch(fetchParams)
  22107. }
  22108. // request’s current URL’s scheme is not an HTTP(S) scheme
  22109. if (!urlIsHttpHttpsScheme(requestCurrentURL(request))) {
  22110. // Return a network error.
  22111. return makeNetworkError('URL scheme must be a HTTP(S) scheme')
  22112. }
  22113. // - request’s use-CORS-preflight flag is set
  22114. // - request’s unsafe-request flag is set and either request’s method is
  22115. // not a CORS-safelisted method or CORS-unsafe request-header names with
  22116. // request’s header list is not empty
  22117. // 1. Set request’s response tainting to "cors".
  22118. // 2. Let corsWithPreflightResponse be the result of running HTTP fetch
  22119. // given fetchParams and true.
  22120. // 3. If corsWithPreflightResponse is a network error, then clear cache
  22121. // entries using request.
  22122. // 4. Return corsWithPreflightResponse.
  22123. // TODO
  22124. // Otherwise
  22125. // 1. Set request’s response tainting to "cors".
  22126. request.responseTainting = 'cors'
  22127. // 2. Return the result of running HTTP fetch given fetchParams.
  22128. return await httpFetch(fetchParams)
  22129. })()
  22130. }
  22131. // 12. If recursive is true, then return response.
  22132. if (recursive) {
  22133. return response
  22134. }
  22135. // 13. If response is not a network error and response is not a filtered
  22136. // response, then:
  22137. if (response.status !== 0 && !response.internalResponse) {
  22138. // If request’s response tainting is "cors", then:
  22139. if (request.responseTainting === 'cors') {
  22140. // 1. Let headerNames be the result of extracting header list values
  22141. // given `Access-Control-Expose-Headers` and response’s header list.
  22142. // TODO
  22143. // 2. If request’s credentials mode is not "include" and headerNames
  22144. // contains `*`, then set response’s CORS-exposed header-name list to
  22145. // all unique header names in response’s header list.
  22146. // TODO
  22147. // 3. Otherwise, if headerNames is not null or failure, then set
  22148. // response’s CORS-exposed header-name list to headerNames.
  22149. // TODO
  22150. }
  22151. // Set response to the following filtered response with response as its
  22152. // internal response, depending on request’s response tainting:
  22153. if (request.responseTainting === 'basic') {
  22154. response = filterResponse(response, 'basic')
  22155. } else if (request.responseTainting === 'cors') {
  22156. response = filterResponse(response, 'cors')
  22157. } else if (request.responseTainting === 'opaque') {
  22158. response = filterResponse(response, 'opaque')
  22159. } else {
  22160. assert(false)
  22161. }
  22162. }
  22163. // 14. Let internalResponse be response, if response is a network error,
  22164. // and response’s internal response otherwise.
  22165. let internalResponse =
  22166. response.status === 0 ? response : response.internalResponse
  22167. // 15. If internalResponse’s URL list is empty, then set it to a clone of
  22168. // request’s URL list.
  22169. if (internalResponse.urlList.length === 0) {
  22170. internalResponse.urlList.push(...request.urlList)
  22171. }
  22172. // 16. If request’s timing allow failed flag is unset, then set
  22173. // internalResponse’s timing allow passed flag.
  22174. if (!request.timingAllowFailed) {
  22175. response.timingAllowPassed = true
  22176. }
  22177. // 17. If response is not a network error and any of the following returns
  22178. // blocked
  22179. // - should internalResponse to request be blocked as mixed content
  22180. // - should internalResponse to request be blocked by Content Security Policy
  22181. // - should internalResponse to request be blocked due to its MIME type
  22182. // - should internalResponse to request be blocked due to nosniff
  22183. // TODO
  22184. // 18. If response’s type is "opaque", internalResponse’s status is 206,
  22185. // internalResponse’s range-requested flag is set, and request’s header
  22186. // list does not contain `Range`, then set response and internalResponse
  22187. // to a network error.
  22188. if (
  22189. response.type === 'opaque' &&
  22190. internalResponse.status === 206 &&
  22191. internalResponse.rangeRequested &&
  22192. !request.headers.contains('range')
  22193. ) {
  22194. response = internalResponse = makeNetworkError()
  22195. }
  22196. // 19. If response is not a network error and either request’s method is
  22197. // `HEAD` or `CONNECT`, or internalResponse’s status is a null body status,
  22198. // set internalResponse’s body to null and disregard any enqueuing toward
  22199. // it (if any).
  22200. if (
  22201. response.status !== 0 &&
  22202. (request.method === 'HEAD' ||
  22203. request.method === 'CONNECT' ||
  22204. nullBodyStatus.includes(internalResponse.status))
  22205. ) {
  22206. internalResponse.body = null
  22207. fetchParams.controller.dump = true
  22208. }
  22209. // 20. If request’s integrity metadata is not the empty string, then:
  22210. if (request.integrity) {
  22211. // 1. Let processBodyError be this step: run fetch finale given fetchParams
  22212. // and a network error.
  22213. const processBodyError = (reason) =>
  22214. fetchFinale(fetchParams, makeNetworkError(reason))
  22215. // 2. If request’s response tainting is "opaque", or response’s body is null,
  22216. // then run processBodyError and abort these steps.
  22217. if (request.responseTainting === 'opaque' || response.body == null) {
  22218. processBodyError(response.error)
  22219. return
  22220. }
  22221. // 3. Let processBody given bytes be these steps:
  22222. const processBody = (bytes) => {
  22223. // 1. If bytes do not match request’s integrity metadata,
  22224. // then run processBodyError and abort these steps. [SRI]
  22225. if (!bytesMatch(bytes, request.integrity)) {
  22226. processBodyError('integrity mismatch')
  22227. return
  22228. }
  22229. // 2. Set response’s body to bytes as a body.
  22230. response.body = safelyExtractBody(bytes)[0]
  22231. // 3. Run fetch finale given fetchParams and response.
  22232. fetchFinale(fetchParams, response)
  22233. }
  22234. // 4. Fully read response’s body given processBody and processBodyError.
  22235. await fullyReadBody(response.body, processBody, processBodyError)
  22236. } else {
  22237. // 21. Otherwise, run fetch finale given fetchParams and response.
  22238. fetchFinale(fetchParams, response)
  22239. }
  22240. }
  22241. // https://fetch.spec.whatwg.org/#concept-scheme-fetch
  22242. // given a fetch params fetchParams
  22243. function schemeFetch (fetchParams) {
  22244. // Note: since the connection is destroyed on redirect, which sets fetchParams to a
  22245. // cancelled state, we do not want this condition to trigger *unless* there have been
  22246. // no redirects. See https://github.com/nodejs/undici/issues/1776
  22247. // 1. If fetchParams is canceled, then return the appropriate network error for fetchParams.
  22248. if (isCancelled(fetchParams) && fetchParams.request.redirectCount === 0) {
  22249. return Promise.resolve(makeAppropriateNetworkError(fetchParams))
  22250. }
  22251. // 2. Let request be fetchParams’s request.
  22252. const { request } = fetchParams
  22253. const { protocol: scheme } = requestCurrentURL(request)
  22254. // 3. Switch on request’s current URL’s scheme and run the associated steps:
  22255. switch (scheme) {
  22256. case 'about:': {
  22257. // If request’s current URL’s path is the string "blank", then return a new response
  22258. // whose status message is `OK`, header list is « (`Content-Type`, `text/html;charset=utf-8`) »,
  22259. // and body is the empty byte sequence as a body.
  22260. // Otherwise, return a network error.
  22261. return Promise.resolve(makeNetworkError('about scheme is not supported'))
  22262. }
  22263. case 'blob:': {
  22264. if (!resolveObjectURL) {
  22265. resolveObjectURL = (__nccwpck_require__(4300).resolveObjectURL)
  22266. }
  22267. // 1. Let blobURLEntry be request’s current URL’s blob URL entry.
  22268. const blobURLEntry = requestCurrentURL(request)
  22269. // https://github.com/web-platform-tests/wpt/blob/7b0ebaccc62b566a1965396e5be7bb2bc06f841f/FileAPI/url/resources/fetch-tests.js#L52-L56
  22270. // Buffer.resolveObjectURL does not ignore URL queries.
  22271. if (blobURLEntry.search.length !== 0) {
  22272. return Promise.resolve(makeNetworkError('NetworkError when attempting to fetch resource.'))
  22273. }
  22274. const blobURLEntryObject = resolveObjectURL(blobURLEntry.toString())
  22275. // 2. If request’s method is not `GET`, blobURLEntry is null, or blobURLEntry’s
  22276. // object is not a Blob object, then return a network error.
  22277. if (request.method !== 'GET' || !isBlobLike(blobURLEntryObject)) {
  22278. return Promise.resolve(makeNetworkError('invalid method'))
  22279. }
  22280. // 3. Let bodyWithType be the result of safely extracting blobURLEntry’s object.
  22281. const bodyWithType = safelyExtractBody(blobURLEntryObject)
  22282. // 4. Let body be bodyWithType’s body.
  22283. const body = bodyWithType[0]
  22284. // 5. Let length be body’s length, serialized and isomorphic encoded.
  22285. const length = isomorphicEncode(`${body.length}`)
  22286. // 6. Let type be bodyWithType’s type if it is non-null; otherwise the empty byte sequence.
  22287. const type = bodyWithType[1] ?? ''
  22288. // 7. Return a new response whose status message is `OK`, header list is
  22289. // « (`Content-Length`, length), (`Content-Type`, type) », and body is body.
  22290. const response = makeResponse({
  22291. statusText: 'OK',
  22292. headersList: [
  22293. ['content-length', { name: 'Content-Length', value: length }],
  22294. ['content-type', { name: 'Content-Type', value: type }]
  22295. ]
  22296. })
  22297. response.body = body
  22298. return Promise.resolve(response)
  22299. }
  22300. case 'data:': {
  22301. // 1. Let dataURLStruct be the result of running the
  22302. // data: URL processor on request’s current URL.
  22303. const currentURL = requestCurrentURL(request)
  22304. const dataURLStruct = dataURLProcessor(currentURL)
  22305. // 2. If dataURLStruct is failure, then return a
  22306. // network error.
  22307. if (dataURLStruct === 'failure') {
  22308. return Promise.resolve(makeNetworkError('failed to fetch the data URL'))
  22309. }
  22310. // 3. Let mimeType be dataURLStruct’s MIME type, serialized.
  22311. const mimeType = serializeAMimeType(dataURLStruct.mimeType)
  22312. // 4. Return a response whose status message is `OK`,
  22313. // header list is « (`Content-Type`, mimeType) »,
  22314. // and body is dataURLStruct’s body as a body.
  22315. return Promise.resolve(makeResponse({
  22316. statusText: 'OK',
  22317. headersList: [
  22318. ['content-type', { name: 'Content-Type', value: mimeType }]
  22319. ],
  22320. body: safelyExtractBody(dataURLStruct.body)[0]
  22321. }))
  22322. }
  22323. case 'file:': {
  22324. // For now, unfortunate as it is, file URLs are left as an exercise for the reader.
  22325. // When in doubt, return a network error.
  22326. return Promise.resolve(makeNetworkError('not implemented... yet...'))
  22327. }
  22328. case 'http:':
  22329. case 'https:': {
  22330. // Return the result of running HTTP fetch given fetchParams.
  22331. return httpFetch(fetchParams)
  22332. .catch((err) => makeNetworkError(err))
  22333. }
  22334. default: {
  22335. return Promise.resolve(makeNetworkError('unknown scheme'))
  22336. }
  22337. }
  22338. }
  22339. // https://fetch.spec.whatwg.org/#finalize-response
  22340. function finalizeResponse (fetchParams, response) {
  22341. // 1. Set fetchParams’s request’s done flag.
  22342. fetchParams.request.done = true
  22343. // 2, If fetchParams’s process response done is not null, then queue a fetch
  22344. // task to run fetchParams’s process response done given response, with
  22345. // fetchParams’s task destination.
  22346. if (fetchParams.processResponseDone != null) {
  22347. queueMicrotask(() => fetchParams.processResponseDone(response))
  22348. }
  22349. }
  22350. // https://fetch.spec.whatwg.org/#fetch-finale
  22351. function fetchFinale (fetchParams, response) {
  22352. // 1. If response is a network error, then:
  22353. if (response.type === 'error') {
  22354. // 1. Set response’s URL list to « fetchParams’s request’s URL list[0] ».
  22355. response.urlList = [fetchParams.request.urlList[0]]
  22356. // 2. Set response’s timing info to the result of creating an opaque timing
  22357. // info for fetchParams’s timing info.
  22358. response.timingInfo = createOpaqueTimingInfo({
  22359. startTime: fetchParams.timingInfo.startTime
  22360. })
  22361. }
  22362. // 2. Let processResponseEndOfBody be the following steps:
  22363. const processResponseEndOfBody = () => {
  22364. // 1. Set fetchParams’s request’s done flag.
  22365. fetchParams.request.done = true
  22366. // If fetchParams’s process response end-of-body is not null,
  22367. // then queue a fetch task to run fetchParams’s process response
  22368. // end-of-body given response with fetchParams’s task destination.
  22369. if (fetchParams.processResponseEndOfBody != null) {
  22370. queueMicrotask(() => fetchParams.processResponseEndOfBody(response))
  22371. }
  22372. }
  22373. // 3. If fetchParams’s process response is non-null, then queue a fetch task
  22374. // to run fetchParams’s process response given response, with fetchParams’s
  22375. // task destination.
  22376. if (fetchParams.processResponse != null) {
  22377. queueMicrotask(() => fetchParams.processResponse(response))
  22378. }
  22379. // 4. If response’s body is null, then run processResponseEndOfBody.
  22380. if (response.body == null) {
  22381. processResponseEndOfBody()
  22382. } else {
  22383. // 5. Otherwise:
  22384. // 1. Let transformStream be a new a TransformStream.
  22385. // 2. Let identityTransformAlgorithm be an algorithm which, given chunk,
  22386. // enqueues chunk in transformStream.
  22387. const identityTransformAlgorithm = (chunk, controller) => {
  22388. controller.enqueue(chunk)
  22389. }
  22390. // 3. Set up transformStream with transformAlgorithm set to identityTransformAlgorithm
  22391. // and flushAlgorithm set to processResponseEndOfBody.
  22392. const transformStream = new TransformStream({
  22393. start () {},
  22394. transform: identityTransformAlgorithm,
  22395. flush: processResponseEndOfBody
  22396. }, {
  22397. size () {
  22398. return 1
  22399. }
  22400. }, {
  22401. size () {
  22402. return 1
  22403. }
  22404. })
  22405. // 4. Set response’s body to the result of piping response’s body through transformStream.
  22406. response.body = { stream: response.body.stream.pipeThrough(transformStream) }
  22407. }
  22408. // 6. If fetchParams’s process response consume body is non-null, then:
  22409. if (fetchParams.processResponseConsumeBody != null) {
  22410. // 1. Let processBody given nullOrBytes be this step: run fetchParams’s
  22411. // process response consume body given response and nullOrBytes.
  22412. const processBody = (nullOrBytes) => fetchParams.processResponseConsumeBody(response, nullOrBytes)
  22413. // 2. Let processBodyError be this step: run fetchParams’s process
  22414. // response consume body given response and failure.
  22415. const processBodyError = (failure) => fetchParams.processResponseConsumeBody(response, failure)
  22416. // 3. If response’s body is null, then queue a fetch task to run processBody
  22417. // given null, with fetchParams’s task destination.
  22418. if (response.body == null) {
  22419. queueMicrotask(() => processBody(null))
  22420. } else {
  22421. // 4. Otherwise, fully read response’s body given processBody, processBodyError,
  22422. // and fetchParams’s task destination.
  22423. return fullyReadBody(response.body, processBody, processBodyError)
  22424. }
  22425. return Promise.resolve()
  22426. }
  22427. }
  22428. // https://fetch.spec.whatwg.org/#http-fetch
  22429. async function httpFetch (fetchParams) {
  22430. // 1. Let request be fetchParams’s request.
  22431. const request = fetchParams.request
  22432. // 2. Let response be null.
  22433. let response = null
  22434. // 3. Let actualResponse be null.
  22435. let actualResponse = null
  22436. // 4. Let timingInfo be fetchParams’s timing info.
  22437. const timingInfo = fetchParams.timingInfo
  22438. // 5. If request’s service-workers mode is "all", then:
  22439. if (request.serviceWorkers === 'all') {
  22440. // TODO
  22441. }
  22442. // 6. If response is null, then:
  22443. if (response === null) {
  22444. // 1. If makeCORSPreflight is true and one of these conditions is true:
  22445. // TODO
  22446. // 2. If request’s redirect mode is "follow", then set request’s
  22447. // service-workers mode to "none".
  22448. if (request.redirect === 'follow') {
  22449. request.serviceWorkers = 'none'
  22450. }
  22451. // 3. Set response and actualResponse to the result of running
  22452. // HTTP-network-or-cache fetch given fetchParams.
  22453. actualResponse = response = await httpNetworkOrCacheFetch(fetchParams)
  22454. // 4. If request’s response tainting is "cors" and a CORS check
  22455. // for request and response returns failure, then return a network error.
  22456. if (
  22457. request.responseTainting === 'cors' &&
  22458. corsCheck(request, response) === 'failure'
  22459. ) {
  22460. return makeNetworkError('cors failure')
  22461. }
  22462. // 5. If the TAO check for request and response returns failure, then set
  22463. // request’s timing allow failed flag.
  22464. if (TAOCheck(request, response) === 'failure') {
  22465. request.timingAllowFailed = true
  22466. }
  22467. }
  22468. // 7. If either request’s response tainting or response’s type
  22469. // is "opaque", and the cross-origin resource policy check with
  22470. // request’s origin, request’s client, request’s destination,
  22471. // and actualResponse returns blocked, then return a network error.
  22472. if (
  22473. (request.responseTainting === 'opaque' || response.type === 'opaque') &&
  22474. crossOriginResourcePolicyCheck(
  22475. request.origin,
  22476. request.client,
  22477. request.destination,
  22478. actualResponse
  22479. ) === 'blocked'
  22480. ) {
  22481. return makeNetworkError('blocked')
  22482. }
  22483. // 8. If actualResponse’s status is a redirect status, then:
  22484. if (redirectStatusSet.has(actualResponse.status)) {
  22485. // 1. If actualResponse’s status is not 303, request’s body is not null,
  22486. // and the connection uses HTTP/2, then user agents may, and are even
  22487. // encouraged to, transmit an RST_STREAM frame.
  22488. // See, https://github.com/whatwg/fetch/issues/1288
  22489. if (request.redirect !== 'manual') {
  22490. fetchParams.controller.connection.destroy()
  22491. }
  22492. // 2. Switch on request’s redirect mode:
  22493. if (request.redirect === 'error') {
  22494. // Set response to a network error.
  22495. response = makeNetworkError('unexpected redirect')
  22496. } else if (request.redirect === 'manual') {
  22497. // Set response to an opaque-redirect filtered response whose internal
  22498. // response is actualResponse.
  22499. // NOTE(spec): On the web this would return an `opaqueredirect` response,
  22500. // but that doesn't make sense server side.
  22501. // See https://github.com/nodejs/undici/issues/1193.
  22502. response = actualResponse
  22503. } else if (request.redirect === 'follow') {
  22504. // Set response to the result of running HTTP-redirect fetch given
  22505. // fetchParams and response.
  22506. response = await httpRedirectFetch(fetchParams, response)
  22507. } else {
  22508. assert(false)
  22509. }
  22510. }
  22511. // 9. Set response’s timing info to timingInfo.
  22512. response.timingInfo = timingInfo
  22513. // 10. Return response.
  22514. return response
  22515. }
  22516. // https://fetch.spec.whatwg.org/#http-redirect-fetch
  22517. function httpRedirectFetch (fetchParams, response) {
  22518. // 1. Let request be fetchParams’s request.
  22519. const request = fetchParams.request
  22520. // 2. Let actualResponse be response, if response is not a filtered response,
  22521. // and response’s internal response otherwise.
  22522. const actualResponse = response.internalResponse
  22523. ? response.internalResponse
  22524. : response
  22525. // 3. Let locationURL be actualResponse’s location URL given request’s current
  22526. // URL’s fragment.
  22527. let locationURL
  22528. try {
  22529. locationURL = responseLocationURL(
  22530. actualResponse,
  22531. requestCurrentURL(request).hash
  22532. )
  22533. // 4. If locationURL is null, then return response.
  22534. if (locationURL == null) {
  22535. return response
  22536. }
  22537. } catch (err) {
  22538. // 5. If locationURL is failure, then return a network error.
  22539. return Promise.resolve(makeNetworkError(err))
  22540. }
  22541. // 6. If locationURL’s scheme is not an HTTP(S) scheme, then return a network
  22542. // error.
  22543. if (!urlIsHttpHttpsScheme(locationURL)) {
  22544. return Promise.resolve(makeNetworkError('URL scheme must be a HTTP(S) scheme'))
  22545. }
  22546. // 7. If request’s redirect count is 20, then return a network error.
  22547. if (request.redirectCount === 20) {
  22548. return Promise.resolve(makeNetworkError('redirect count exceeded'))
  22549. }
  22550. // 8. Increase request’s redirect count by 1.
  22551. request.redirectCount += 1
  22552. // 9. If request’s mode is "cors", locationURL includes credentials, and
  22553. // request’s origin is not same origin with locationURL’s origin, then return
  22554. // a network error.
  22555. if (
  22556. request.mode === 'cors' &&
  22557. (locationURL.username || locationURL.password) &&
  22558. !sameOrigin(request, locationURL)
  22559. ) {
  22560. return Promise.resolve(makeNetworkError('cross origin not allowed for request mode "cors"'))
  22561. }
  22562. // 10. If request’s response tainting is "cors" and locationURL includes
  22563. // credentials, then return a network error.
  22564. if (
  22565. request.responseTainting === 'cors' &&
  22566. (locationURL.username || locationURL.password)
  22567. ) {
  22568. return Promise.resolve(makeNetworkError(
  22569. 'URL cannot contain credentials for request mode "cors"'
  22570. ))
  22571. }
  22572. // 11. If actualResponse’s status is not 303, request’s body is non-null,
  22573. // and request’s body’s source is null, then return a network error.
  22574. if (
  22575. actualResponse.status !== 303 &&
  22576. request.body != null &&
  22577. request.body.source == null
  22578. ) {
  22579. return Promise.resolve(makeNetworkError())
  22580. }
  22581. // 12. If one of the following is true
  22582. // - actualResponse’s status is 301 or 302 and request’s method is `POST`
  22583. // - actualResponse’s status is 303 and request’s method is not `GET` or `HEAD`
  22584. if (
  22585. ([301, 302].includes(actualResponse.status) && request.method === 'POST') ||
  22586. (actualResponse.status === 303 &&
  22587. !GET_OR_HEAD.includes(request.method))
  22588. ) {
  22589. // then:
  22590. // 1. Set request’s method to `GET` and request’s body to null.
  22591. request.method = 'GET'
  22592. request.body = null
  22593. // 2. For each headerName of request-body-header name, delete headerName from
  22594. // request’s header list.
  22595. for (const headerName of requestBodyHeader) {
  22596. request.headersList.delete(headerName)
  22597. }
  22598. }
  22599. // 13. If request’s current URL’s origin is not same origin with locationURL’s
  22600. // origin, then for each headerName of CORS non-wildcard request-header name,
  22601. // delete headerName from request’s header list.
  22602. if (!sameOrigin(requestCurrentURL(request), locationURL)) {
  22603. // https://fetch.spec.whatwg.org/#cors-non-wildcard-request-header-name
  22604. request.headersList.delete('authorization')
  22605. // https://fetch.spec.whatwg.org/#authentication-entries
  22606. request.headersList.delete('proxy-authorization', true)
  22607. // "Cookie" and "Host" are forbidden request-headers, which undici doesn't implement.
  22608. request.headersList.delete('cookie')
  22609. request.headersList.delete('host')
  22610. }
  22611. // 14. If request’s body is non-null, then set request’s body to the first return
  22612. // value of safely extracting request’s body’s source.
  22613. if (request.body != null) {
  22614. assert(request.body.source != null)
  22615. request.body = safelyExtractBody(request.body.source)[0]
  22616. }
  22617. // 15. Let timingInfo be fetchParams’s timing info.
  22618. const timingInfo = fetchParams.timingInfo
  22619. // 16. Set timingInfo’s redirect end time and post-redirect start time to the
  22620. // coarsened shared current time given fetchParams’s cross-origin isolated
  22621. // capability.
  22622. timingInfo.redirectEndTime = timingInfo.postRedirectStartTime =
  22623. coarsenedSharedCurrentTime(fetchParams.crossOriginIsolatedCapability)
  22624. // 17. If timingInfo’s redirect start time is 0, then set timingInfo’s
  22625. // redirect start time to timingInfo’s start time.
  22626. if (timingInfo.redirectStartTime === 0) {
  22627. timingInfo.redirectStartTime = timingInfo.startTime
  22628. }
  22629. // 18. Append locationURL to request’s URL list.
  22630. request.urlList.push(locationURL)
  22631. // 19. Invoke set request’s referrer policy on redirect on request and
  22632. // actualResponse.
  22633. setRequestReferrerPolicyOnRedirect(request, actualResponse)
  22634. // 20. Return the result of running main fetch given fetchParams and true.
  22635. return mainFetch(fetchParams, true)
  22636. }
  22637. // https://fetch.spec.whatwg.org/#http-network-or-cache-fetch
  22638. async function httpNetworkOrCacheFetch (
  22639. fetchParams,
  22640. isAuthenticationFetch = false,
  22641. isNewConnectionFetch = false
  22642. ) {
  22643. // 1. Let request be fetchParams’s request.
  22644. const request = fetchParams.request
  22645. // 2. Let httpFetchParams be null.
  22646. let httpFetchParams = null
  22647. // 3. Let httpRequest be null.
  22648. let httpRequest = null
  22649. // 4. Let response be null.
  22650. let response = null
  22651. // 5. Let storedResponse be null.
  22652. // TODO: cache
  22653. // 6. Let httpCache be null.
  22654. const httpCache = null
  22655. // 7. Let the revalidatingFlag be unset.
  22656. const revalidatingFlag = false
  22657. // 8. Run these steps, but abort when the ongoing fetch is terminated:
  22658. // 1. If request’s window is "no-window" and request’s redirect mode is
  22659. // "error", then set httpFetchParams to fetchParams and httpRequest to
  22660. // request.
  22661. if (request.window === 'no-window' && request.redirect === 'error') {
  22662. httpFetchParams = fetchParams
  22663. httpRequest = request
  22664. } else {
  22665. // Otherwise:
  22666. // 1. Set httpRequest to a clone of request.
  22667. httpRequest = makeRequest(request)
  22668. // 2. Set httpFetchParams to a copy of fetchParams.
  22669. httpFetchParams = { ...fetchParams }
  22670. // 3. Set httpFetchParams’s request to httpRequest.
  22671. httpFetchParams.request = httpRequest
  22672. }
  22673. // 3. Let includeCredentials be true if one of
  22674. const includeCredentials =
  22675. request.credentials === 'include' ||
  22676. (request.credentials === 'same-origin' &&
  22677. request.responseTainting === 'basic')
  22678. // 4. Let contentLength be httpRequest’s body’s length, if httpRequest’s
  22679. // body is non-null; otherwise null.
  22680. const contentLength = httpRequest.body ? httpRequest.body.length : null
  22681. // 5. Let contentLengthHeaderValue be null.
  22682. let contentLengthHeaderValue = null
  22683. // 6. If httpRequest’s body is null and httpRequest’s method is `POST` or
  22684. // `PUT`, then set contentLengthHeaderValue to `0`.
  22685. if (
  22686. httpRequest.body == null &&
  22687. ['POST', 'PUT'].includes(httpRequest.method)
  22688. ) {
  22689. contentLengthHeaderValue = '0'
  22690. }
  22691. // 7. If contentLength is non-null, then set contentLengthHeaderValue to
  22692. // contentLength, serialized and isomorphic encoded.
  22693. if (contentLength != null) {
  22694. contentLengthHeaderValue = isomorphicEncode(`${contentLength}`)
  22695. }
  22696. // 8. If contentLengthHeaderValue is non-null, then append
  22697. // `Content-Length`/contentLengthHeaderValue to httpRequest’s header
  22698. // list.
  22699. if (contentLengthHeaderValue != null) {
  22700. httpRequest.headersList.append('content-length', contentLengthHeaderValue)
  22701. }
  22702. // 9. If contentLengthHeaderValue is non-null, then append (`Content-Length`,
  22703. // contentLengthHeaderValue) to httpRequest’s header list.
  22704. // 10. If contentLength is non-null and httpRequest’s keepalive is true,
  22705. // then:
  22706. if (contentLength != null && httpRequest.keepalive) {
  22707. // NOTE: keepalive is a noop outside of browser context.
  22708. }
  22709. // 11. If httpRequest’s referrer is a URL, then append
  22710. // `Referer`/httpRequest’s referrer, serialized and isomorphic encoded,
  22711. // to httpRequest’s header list.
  22712. if (httpRequest.referrer instanceof URL) {
  22713. httpRequest.headersList.append('referer', isomorphicEncode(httpRequest.referrer.href))
  22714. }
  22715. // 12. Append a request `Origin` header for httpRequest.
  22716. appendRequestOriginHeader(httpRequest)
  22717. // 13. Append the Fetch metadata headers for httpRequest. [FETCH-METADATA]
  22718. appendFetchMetadata(httpRequest)
  22719. // 14. If httpRequest’s header list does not contain `User-Agent`, then
  22720. // user agents should append `User-Agent`/default `User-Agent` value to
  22721. // httpRequest’s header list.
  22722. if (!httpRequest.headersList.contains('user-agent')) {
  22723. httpRequest.headersList.append('user-agent', typeof esbuildDetection === 'undefined' ? 'undici' : 'node')
  22724. }
  22725. // 15. If httpRequest’s cache mode is "default" and httpRequest’s header
  22726. // list contains `If-Modified-Since`, `If-None-Match`,
  22727. // `If-Unmodified-Since`, `If-Match`, or `If-Range`, then set
  22728. // httpRequest’s cache mode to "no-store".
  22729. if (
  22730. httpRequest.cache === 'default' &&
  22731. (httpRequest.headersList.contains('if-modified-since') ||
  22732. httpRequest.headersList.contains('if-none-match') ||
  22733. httpRequest.headersList.contains('if-unmodified-since') ||
  22734. httpRequest.headersList.contains('if-match') ||
  22735. httpRequest.headersList.contains('if-range'))
  22736. ) {
  22737. httpRequest.cache = 'no-store'
  22738. }
  22739. // 16. If httpRequest’s cache mode is "no-cache", httpRequest’s prevent
  22740. // no-cache cache-control header modification flag is unset, and
  22741. // httpRequest’s header list does not contain `Cache-Control`, then append
  22742. // `Cache-Control`/`max-age=0` to httpRequest’s header list.
  22743. if (
  22744. httpRequest.cache === 'no-cache' &&
  22745. !httpRequest.preventNoCacheCacheControlHeaderModification &&
  22746. !httpRequest.headersList.contains('cache-control')
  22747. ) {
  22748. httpRequest.headersList.append('cache-control', 'max-age=0')
  22749. }
  22750. // 17. If httpRequest’s cache mode is "no-store" or "reload", then:
  22751. if (httpRequest.cache === 'no-store' || httpRequest.cache === 'reload') {
  22752. // 1. If httpRequest’s header list does not contain `Pragma`, then append
  22753. // `Pragma`/`no-cache` to httpRequest’s header list.
  22754. if (!httpRequest.headersList.contains('pragma')) {
  22755. httpRequest.headersList.append('pragma', 'no-cache')
  22756. }
  22757. // 2. If httpRequest’s header list does not contain `Cache-Control`,
  22758. // then append `Cache-Control`/`no-cache` to httpRequest’s header list.
  22759. if (!httpRequest.headersList.contains('cache-control')) {
  22760. httpRequest.headersList.append('cache-control', 'no-cache')
  22761. }
  22762. }
  22763. // 18. If httpRequest’s header list contains `Range`, then append
  22764. // `Accept-Encoding`/`identity` to httpRequest’s header list.
  22765. if (httpRequest.headersList.contains('range')) {
  22766. httpRequest.headersList.append('accept-encoding', 'identity')
  22767. }
  22768. // 19. Modify httpRequest’s header list per HTTP. Do not append a given
  22769. // header if httpRequest’s header list contains that header’s name.
  22770. // TODO: https://github.com/whatwg/fetch/issues/1285#issuecomment-896560129
  22771. if (!httpRequest.headersList.contains('accept-encoding')) {
  22772. if (urlHasHttpsScheme(requestCurrentURL(httpRequest))) {
  22773. httpRequest.headersList.append('accept-encoding', 'br, gzip, deflate')
  22774. } else {
  22775. httpRequest.headersList.append('accept-encoding', 'gzip, deflate')
  22776. }
  22777. }
  22778. httpRequest.headersList.delete('host')
  22779. // 20. If includeCredentials is true, then:
  22780. if (includeCredentials) {
  22781. // 1. If the user agent is not configured to block cookies for httpRequest
  22782. // (see section 7 of [COOKIES]), then:
  22783. // TODO: credentials
  22784. // 2. If httpRequest’s header list does not contain `Authorization`, then:
  22785. // TODO: credentials
  22786. }
  22787. // 21. If there’s a proxy-authentication entry, use it as appropriate.
  22788. // TODO: proxy-authentication
  22789. // 22. Set httpCache to the result of determining the HTTP cache
  22790. // partition, given httpRequest.
  22791. // TODO: cache
  22792. // 23. If httpCache is null, then set httpRequest’s cache mode to
  22793. // "no-store".
  22794. if (httpCache == null) {
  22795. httpRequest.cache = 'no-store'
  22796. }
  22797. // 24. If httpRequest’s cache mode is neither "no-store" nor "reload",
  22798. // then:
  22799. if (httpRequest.mode !== 'no-store' && httpRequest.mode !== 'reload') {
  22800. // TODO: cache
  22801. }
  22802. // 9. If aborted, then return the appropriate network error for fetchParams.
  22803. // TODO
  22804. // 10. If response is null, then:
  22805. if (response == null) {
  22806. // 1. If httpRequest’s cache mode is "only-if-cached", then return a
  22807. // network error.
  22808. if (httpRequest.mode === 'only-if-cached') {
  22809. return makeNetworkError('only if cached')
  22810. }
  22811. // 2. Let forwardResponse be the result of running HTTP-network fetch
  22812. // given httpFetchParams, includeCredentials, and isNewConnectionFetch.
  22813. const forwardResponse = await httpNetworkFetch(
  22814. httpFetchParams,
  22815. includeCredentials,
  22816. isNewConnectionFetch
  22817. )
  22818. // 3. If httpRequest’s method is unsafe and forwardResponse’s status is
  22819. // in the range 200 to 399, inclusive, invalidate appropriate stored
  22820. // responses in httpCache, as per the "Invalidation" chapter of HTTP
  22821. // Caching, and set storedResponse to null. [HTTP-CACHING]
  22822. if (
  22823. !safeMethodsSet.has(httpRequest.method) &&
  22824. forwardResponse.status >= 200 &&
  22825. forwardResponse.status <= 399
  22826. ) {
  22827. // TODO: cache
  22828. }
  22829. // 4. If the revalidatingFlag is set and forwardResponse’s status is 304,
  22830. // then:
  22831. if (revalidatingFlag && forwardResponse.status === 304) {
  22832. // TODO: cache
  22833. }
  22834. // 5. If response is null, then:
  22835. if (response == null) {
  22836. // 1. Set response to forwardResponse.
  22837. response = forwardResponse
  22838. // 2. Store httpRequest and forwardResponse in httpCache, as per the
  22839. // "Storing Responses in Caches" chapter of HTTP Caching. [HTTP-CACHING]
  22840. // TODO: cache
  22841. }
  22842. }
  22843. // 11. Set response’s URL list to a clone of httpRequest’s URL list.
  22844. response.urlList = [...httpRequest.urlList]
  22845. // 12. If httpRequest’s header list contains `Range`, then set response’s
  22846. // range-requested flag.
  22847. if (httpRequest.headersList.contains('range')) {
  22848. response.rangeRequested = true
  22849. }
  22850. // 13. Set response’s request-includes-credentials to includeCredentials.
  22851. response.requestIncludesCredentials = includeCredentials
  22852. // 14. If response’s status is 401, httpRequest’s response tainting is not
  22853. // "cors", includeCredentials is true, and request’s window is an environment
  22854. // settings object, then:
  22855. // TODO
  22856. // 15. If response’s status is 407, then:
  22857. if (response.status === 407) {
  22858. // 1. If request’s window is "no-window", then return a network error.
  22859. if (request.window === 'no-window') {
  22860. return makeNetworkError()
  22861. }
  22862. // 2. ???
  22863. // 3. If fetchParams is canceled, then return the appropriate network error for fetchParams.
  22864. if (isCancelled(fetchParams)) {
  22865. return makeAppropriateNetworkError(fetchParams)
  22866. }
  22867. // 4. Prompt the end user as appropriate in request’s window and store
  22868. // the result as a proxy-authentication entry. [HTTP-AUTH]
  22869. // TODO: Invoke some kind of callback?
  22870. // 5. Set response to the result of running HTTP-network-or-cache fetch given
  22871. // fetchParams.
  22872. // TODO
  22873. return makeNetworkError('proxy authentication required')
  22874. }
  22875. // 16. If all of the following are true
  22876. if (
  22877. // response’s status is 421
  22878. response.status === 421 &&
  22879. // isNewConnectionFetch is false
  22880. !isNewConnectionFetch &&
  22881. // request’s body is null, or request’s body is non-null and request’s body’s source is non-null
  22882. (request.body == null || request.body.source != null)
  22883. ) {
  22884. // then:
  22885. // 1. If fetchParams is canceled, then return the appropriate network error for fetchParams.
  22886. if (isCancelled(fetchParams)) {
  22887. return makeAppropriateNetworkError(fetchParams)
  22888. }
  22889. // 2. Set response to the result of running HTTP-network-or-cache
  22890. // fetch given fetchParams, isAuthenticationFetch, and true.
  22891. // TODO (spec): The spec doesn't specify this but we need to cancel
  22892. // the active response before we can start a new one.
  22893. // https://github.com/whatwg/fetch/issues/1293
  22894. fetchParams.controller.connection.destroy()
  22895. response = await httpNetworkOrCacheFetch(
  22896. fetchParams,
  22897. isAuthenticationFetch,
  22898. true
  22899. )
  22900. }
  22901. // 17. If isAuthenticationFetch is true, then create an authentication entry
  22902. if (isAuthenticationFetch) {
  22903. // TODO
  22904. }
  22905. // 18. Return response.
  22906. return response
  22907. }
  22908. // https://fetch.spec.whatwg.org/#http-network-fetch
  22909. async function httpNetworkFetch (
  22910. fetchParams,
  22911. includeCredentials = false,
  22912. forceNewConnection = false
  22913. ) {
  22914. assert(!fetchParams.controller.connection || fetchParams.controller.connection.destroyed)
  22915. fetchParams.controller.connection = {
  22916. abort: null,
  22917. destroyed: false,
  22918. destroy (err) {
  22919. if (!this.destroyed) {
  22920. this.destroyed = true
  22921. this.abort?.(err ?? new DOMException('The operation was aborted.', 'AbortError'))
  22922. }
  22923. }
  22924. }
  22925. // 1. Let request be fetchParams’s request.
  22926. const request = fetchParams.request
  22927. // 2. Let response be null.
  22928. let response = null
  22929. // 3. Let timingInfo be fetchParams’s timing info.
  22930. const timingInfo = fetchParams.timingInfo
  22931. // 4. Let httpCache be the result of determining the HTTP cache partition,
  22932. // given request.
  22933. // TODO: cache
  22934. const httpCache = null
  22935. // 5. If httpCache is null, then set request’s cache mode to "no-store".
  22936. if (httpCache == null) {
  22937. request.cache = 'no-store'
  22938. }
  22939. // 6. Let networkPartitionKey be the result of determining the network
  22940. // partition key given request.
  22941. // TODO
  22942. // 7. Let newConnection be "yes" if forceNewConnection is true; otherwise
  22943. // "no".
  22944. const newConnection = forceNewConnection ? 'yes' : 'no' // eslint-disable-line no-unused-vars
  22945. // 8. Switch on request’s mode:
  22946. if (request.mode === 'websocket') {
  22947. // Let connection be the result of obtaining a WebSocket connection,
  22948. // given request’s current URL.
  22949. // TODO
  22950. } else {
  22951. // Let connection be the result of obtaining a connection, given
  22952. // networkPartitionKey, request’s current URL’s origin,
  22953. // includeCredentials, and forceNewConnection.
  22954. // TODO
  22955. }
  22956. // 9. Run these steps, but abort when the ongoing fetch is terminated:
  22957. // 1. If connection is failure, then return a network error.
  22958. // 2. Set timingInfo’s final connection timing info to the result of
  22959. // calling clamp and coarsen connection timing info with connection’s
  22960. // timing info, timingInfo’s post-redirect start time, and fetchParams’s
  22961. // cross-origin isolated capability.
  22962. // 3. If connection is not an HTTP/2 connection, request’s body is non-null,
  22963. // and request’s body’s source is null, then append (`Transfer-Encoding`,
  22964. // `chunked`) to request’s header list.
  22965. // 4. Set timingInfo’s final network-request start time to the coarsened
  22966. // shared current time given fetchParams’s cross-origin isolated
  22967. // capability.
  22968. // 5. Set response to the result of making an HTTP request over connection
  22969. // using request with the following caveats:
  22970. // - Follow the relevant requirements from HTTP. [HTTP] [HTTP-SEMANTICS]
  22971. // [HTTP-COND] [HTTP-CACHING] [HTTP-AUTH]
  22972. // - If request’s body is non-null, and request’s body’s source is null,
  22973. // then the user agent may have a buffer of up to 64 kibibytes and store
  22974. // a part of request’s body in that buffer. If the user agent reads from
  22975. // request’s body beyond that buffer’s size and the user agent needs to
  22976. // resend request, then instead return a network error.
  22977. // - Set timingInfo’s final network-response start time to the coarsened
  22978. // shared current time given fetchParams’s cross-origin isolated capability,
  22979. // immediately after the user agent’s HTTP parser receives the first byte
  22980. // of the response (e.g., frame header bytes for HTTP/2 or response status
  22981. // line for HTTP/1.x).
  22982. // - Wait until all the headers are transmitted.
  22983. // - Any responses whose status is in the range 100 to 199, inclusive,
  22984. // and is not 101, are to be ignored, except for the purposes of setting
  22985. // timingInfo’s final network-response start time above.
  22986. // - If request’s header list contains `Transfer-Encoding`/`chunked` and
  22987. // response is transferred via HTTP/1.0 or older, then return a network
  22988. // error.
  22989. // - If the HTTP request results in a TLS client certificate dialog, then:
  22990. // 1. If request’s window is an environment settings object, make the
  22991. // dialog available in request’s window.
  22992. // 2. Otherwise, return a network error.
  22993. // To transmit request’s body body, run these steps:
  22994. let requestBody = null
  22995. // 1. If body is null and fetchParams’s process request end-of-body is
  22996. // non-null, then queue a fetch task given fetchParams’s process request
  22997. // end-of-body and fetchParams’s task destination.
  22998. if (request.body == null && fetchParams.processRequestEndOfBody) {
  22999. queueMicrotask(() => fetchParams.processRequestEndOfBody())
  23000. } else if (request.body != null) {
  23001. // 2. Otherwise, if body is non-null:
  23002. // 1. Let processBodyChunk given bytes be these steps:
  23003. const processBodyChunk = async function * (bytes) {
  23004. // 1. If the ongoing fetch is terminated, then abort these steps.
  23005. if (isCancelled(fetchParams)) {
  23006. return
  23007. }
  23008. // 2. Run this step in parallel: transmit bytes.
  23009. yield bytes
  23010. // 3. If fetchParams’s process request body is non-null, then run
  23011. // fetchParams’s process request body given bytes’s length.
  23012. fetchParams.processRequestBodyChunkLength?.(bytes.byteLength)
  23013. }
  23014. // 2. Let processEndOfBody be these steps:
  23015. const processEndOfBody = () => {
  23016. // 1. If fetchParams is canceled, then abort these steps.
  23017. if (isCancelled(fetchParams)) {
  23018. return
  23019. }
  23020. // 2. If fetchParams’s process request end-of-body is non-null,
  23021. // then run fetchParams’s process request end-of-body.
  23022. if (fetchParams.processRequestEndOfBody) {
  23023. fetchParams.processRequestEndOfBody()
  23024. }
  23025. }
  23026. // 3. Let processBodyError given e be these steps:
  23027. const processBodyError = (e) => {
  23028. // 1. If fetchParams is canceled, then abort these steps.
  23029. if (isCancelled(fetchParams)) {
  23030. return
  23031. }
  23032. // 2. If e is an "AbortError" DOMException, then abort fetchParams’s controller.
  23033. if (e.name === 'AbortError') {
  23034. fetchParams.controller.abort()
  23035. } else {
  23036. fetchParams.controller.terminate(e)
  23037. }
  23038. }
  23039. // 4. Incrementally read request’s body given processBodyChunk, processEndOfBody,
  23040. // processBodyError, and fetchParams’s task destination.
  23041. requestBody = (async function * () {
  23042. try {
  23043. for await (const bytes of request.body.stream) {
  23044. yield * processBodyChunk(bytes)
  23045. }
  23046. processEndOfBody()
  23047. } catch (err) {
  23048. processBodyError(err)
  23049. }
  23050. })()
  23051. }
  23052. try {
  23053. // socket is only provided for websockets
  23054. const { body, status, statusText, headersList, socket } = await dispatch({ body: requestBody })
  23055. if (socket) {
  23056. response = makeResponse({ status, statusText, headersList, socket })
  23057. } else {
  23058. const iterator = body[Symbol.asyncIterator]()
  23059. fetchParams.controller.next = () => iterator.next()
  23060. response = makeResponse({ status, statusText, headersList })
  23061. }
  23062. } catch (err) {
  23063. // 10. If aborted, then:
  23064. if (err.name === 'AbortError') {
  23065. // 1. If connection uses HTTP/2, then transmit an RST_STREAM frame.
  23066. fetchParams.controller.connection.destroy()
  23067. // 2. Return the appropriate network error for fetchParams.
  23068. return makeAppropriateNetworkError(fetchParams, err)
  23069. }
  23070. return makeNetworkError(err)
  23071. }
  23072. // 11. Let pullAlgorithm be an action that resumes the ongoing fetch
  23073. // if it is suspended.
  23074. const pullAlgorithm = () => {
  23075. fetchParams.controller.resume()
  23076. }
  23077. // 12. Let cancelAlgorithm be an algorithm that aborts fetchParams’s
  23078. // controller with reason, given reason.
  23079. const cancelAlgorithm = (reason) => {
  23080. fetchParams.controller.abort(reason)
  23081. }
  23082. // 13. Let highWaterMark be a non-negative, non-NaN number, chosen by
  23083. // the user agent.
  23084. // TODO
  23085. // 14. Let sizeAlgorithm be an algorithm that accepts a chunk object
  23086. // and returns a non-negative, non-NaN, non-infinite number, chosen by the user agent.
  23087. // TODO
  23088. // 15. Let stream be a new ReadableStream.
  23089. // 16. Set up stream with pullAlgorithm set to pullAlgorithm,
  23090. // cancelAlgorithm set to cancelAlgorithm, highWaterMark set to
  23091. // highWaterMark, and sizeAlgorithm set to sizeAlgorithm.
  23092. if (!ReadableStream) {
  23093. ReadableStream = (__nccwpck_require__(5356).ReadableStream)
  23094. }
  23095. const stream = new ReadableStream(
  23096. {
  23097. async start (controller) {
  23098. fetchParams.controller.controller = controller
  23099. },
  23100. async pull (controller) {
  23101. await pullAlgorithm(controller)
  23102. },
  23103. async cancel (reason) {
  23104. await cancelAlgorithm(reason)
  23105. }
  23106. },
  23107. {
  23108. highWaterMark: 0,
  23109. size () {
  23110. return 1
  23111. }
  23112. }
  23113. )
  23114. // 17. Run these steps, but abort when the ongoing fetch is terminated:
  23115. // 1. Set response’s body to a new body whose stream is stream.
  23116. response.body = { stream }
  23117. // 2. If response is not a network error and request’s cache mode is
  23118. // not "no-store", then update response in httpCache for request.
  23119. // TODO
  23120. // 3. If includeCredentials is true and the user agent is not configured
  23121. // to block cookies for request (see section 7 of [COOKIES]), then run the
  23122. // "set-cookie-string" parsing algorithm (see section 5.2 of [COOKIES]) on
  23123. // the value of each header whose name is a byte-case-insensitive match for
  23124. // `Set-Cookie` in response’s header list, if any, and request’s current URL.
  23125. // TODO
  23126. // 18. If aborted, then:
  23127. // TODO
  23128. // 19. Run these steps in parallel:
  23129. // 1. Run these steps, but abort when fetchParams is canceled:
  23130. fetchParams.controller.on('terminated', onAborted)
  23131. fetchParams.controller.resume = async () => {
  23132. // 1. While true
  23133. while (true) {
  23134. // 1-3. See onData...
  23135. // 4. Set bytes to the result of handling content codings given
  23136. // codings and bytes.
  23137. let bytes
  23138. let isFailure
  23139. try {
  23140. const { done, value } = await fetchParams.controller.next()
  23141. if (isAborted(fetchParams)) {
  23142. break
  23143. }
  23144. bytes = done ? undefined : value
  23145. } catch (err) {
  23146. if (fetchParams.controller.ended && !timingInfo.encodedBodySize) {
  23147. // zlib doesn't like empty streams.
  23148. bytes = undefined
  23149. } else {
  23150. bytes = err
  23151. // err may be propagated from the result of calling readablestream.cancel,
  23152. // which might not be an error. https://github.com/nodejs/undici/issues/2009
  23153. isFailure = true
  23154. }
  23155. }
  23156. if (bytes === undefined) {
  23157. // 2. Otherwise, if the bytes transmission for response’s message
  23158. // body is done normally and stream is readable, then close
  23159. // stream, finalize response for fetchParams and response, and
  23160. // abort these in-parallel steps.
  23161. readableStreamClose(fetchParams.controller.controller)
  23162. finalizeResponse(fetchParams, response)
  23163. return
  23164. }
  23165. // 5. Increase timingInfo’s decoded body size by bytes’s length.
  23166. timingInfo.decodedBodySize += bytes?.byteLength ?? 0
  23167. // 6. If bytes is failure, then terminate fetchParams’s controller.
  23168. if (isFailure) {
  23169. fetchParams.controller.terminate(bytes)
  23170. return
  23171. }
  23172. // 7. Enqueue a Uint8Array wrapping an ArrayBuffer containing bytes
  23173. // into stream.
  23174. fetchParams.controller.controller.enqueue(new Uint8Array(bytes))
  23175. // 8. If stream is errored, then terminate the ongoing fetch.
  23176. if (isErrored(stream)) {
  23177. fetchParams.controller.terminate()
  23178. return
  23179. }
  23180. // 9. If stream doesn’t need more data ask the user agent to suspend
  23181. // the ongoing fetch.
  23182. if (!fetchParams.controller.controller.desiredSize) {
  23183. return
  23184. }
  23185. }
  23186. }
  23187. // 2. If aborted, then:
  23188. function onAborted (reason) {
  23189. // 2. If fetchParams is aborted, then:
  23190. if (isAborted(fetchParams)) {
  23191. // 1. Set response’s aborted flag.
  23192. response.aborted = true
  23193. // 2. If stream is readable, then error stream with the result of
  23194. // deserialize a serialized abort reason given fetchParams’s
  23195. // controller’s serialized abort reason and an
  23196. // implementation-defined realm.
  23197. if (isReadable(stream)) {
  23198. fetchParams.controller.controller.error(
  23199. fetchParams.controller.serializedAbortReason
  23200. )
  23201. }
  23202. } else {
  23203. // 3. Otherwise, if stream is readable, error stream with a TypeError.
  23204. if (isReadable(stream)) {
  23205. fetchParams.controller.controller.error(new TypeError('terminated', {
  23206. cause: isErrorLike(reason) ? reason : undefined
  23207. }))
  23208. }
  23209. }
  23210. // 4. If connection uses HTTP/2, then transmit an RST_STREAM frame.
  23211. // 5. Otherwise, the user agent should close connection unless it would be bad for performance to do so.
  23212. fetchParams.controller.connection.destroy()
  23213. }
  23214. // 20. Return response.
  23215. return response
  23216. async function dispatch ({ body }) {
  23217. const url = requestCurrentURL(request)
  23218. /** @type {import('../..').Agent} */
  23219. const agent = fetchParams.controller.dispatcher
  23220. return new Promise((resolve, reject) => agent.dispatch(
  23221. {
  23222. path: url.pathname + url.search,
  23223. origin: url.origin,
  23224. method: request.method,
  23225. body: fetchParams.controller.dispatcher.isMockActive ? request.body && (request.body.source || request.body.stream) : body,
  23226. headers: request.headersList.entries,
  23227. maxRedirections: 0,
  23228. upgrade: request.mode === 'websocket' ? 'websocket' : undefined
  23229. },
  23230. {
  23231. body: null,
  23232. abort: null,
  23233. onConnect (abort) {
  23234. // TODO (fix): Do we need connection here?
  23235. const { connection } = fetchParams.controller
  23236. if (connection.destroyed) {
  23237. abort(new DOMException('The operation was aborted.', 'AbortError'))
  23238. } else {
  23239. fetchParams.controller.on('terminated', abort)
  23240. this.abort = connection.abort = abort
  23241. }
  23242. },
  23243. onHeaders (status, headersList, resume, statusText) {
  23244. if (status < 200) {
  23245. return
  23246. }
  23247. let codings = []
  23248. let location = ''
  23249. const headers = new Headers()
  23250. // For H2, the headers are a plain JS object
  23251. // We distinguish between them and iterate accordingly
  23252. if (Array.isArray(headersList)) {
  23253. for (let n = 0; n < headersList.length; n += 2) {
  23254. const key = headersList[n + 0].toString('latin1')
  23255. const val = headersList[n + 1].toString('latin1')
  23256. if (key.toLowerCase() === 'content-encoding') {
  23257. // https://www.rfc-editor.org/rfc/rfc7231#section-3.1.2.1
  23258. // "All content-coding values are case-insensitive..."
  23259. codings = val.toLowerCase().split(',').map((x) => x.trim())
  23260. } else if (key.toLowerCase() === 'location') {
  23261. location = val
  23262. }
  23263. headers[kHeadersList].append(key, val)
  23264. }
  23265. } else {
  23266. const keys = Object.keys(headersList)
  23267. for (const key of keys) {
  23268. const val = headersList[key]
  23269. if (key.toLowerCase() === 'content-encoding') {
  23270. // https://www.rfc-editor.org/rfc/rfc7231#section-3.1.2.1
  23271. // "All content-coding values are case-insensitive..."
  23272. codings = val.toLowerCase().split(',').map((x) => x.trim()).reverse()
  23273. } else if (key.toLowerCase() === 'location') {
  23274. location = val
  23275. }
  23276. headers[kHeadersList].append(key, val)
  23277. }
  23278. }
  23279. this.body = new Readable({ read: resume })
  23280. const decoders = []
  23281. const willFollow = request.redirect === 'follow' &&
  23282. location &&
  23283. redirectStatusSet.has(status)
  23284. // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Encoding
  23285. if (request.method !== 'HEAD' && request.method !== 'CONNECT' && !nullBodyStatus.includes(status) && !willFollow) {
  23286. for (const coding of codings) {
  23287. // https://www.rfc-editor.org/rfc/rfc9112.html#section-7.2
  23288. if (coding === 'x-gzip' || coding === 'gzip') {
  23289. decoders.push(zlib.createGunzip({
  23290. // Be less strict when decoding compressed responses, since sometimes
  23291. // servers send slightly invalid responses that are still accepted
  23292. // by common browsers.
  23293. // Always using Z_SYNC_FLUSH is what cURL does.
  23294. flush: zlib.constants.Z_SYNC_FLUSH,
  23295. finishFlush: zlib.constants.Z_SYNC_FLUSH
  23296. }))
  23297. } else if (coding === 'deflate') {
  23298. decoders.push(zlib.createInflate())
  23299. } else if (coding === 'br') {
  23300. decoders.push(zlib.createBrotliDecompress())
  23301. } else {
  23302. decoders.length = 0
  23303. break
  23304. }
  23305. }
  23306. }
  23307. resolve({
  23308. status,
  23309. statusText,
  23310. headersList: headers[kHeadersList],
  23311. body: decoders.length
  23312. ? pipeline(this.body, ...decoders, () => { })
  23313. : this.body.on('error', () => {})
  23314. })
  23315. return true
  23316. },
  23317. onData (chunk) {
  23318. if (fetchParams.controller.dump) {
  23319. return
  23320. }
  23321. // 1. If one or more bytes have been transmitted from response’s
  23322. // message body, then:
  23323. // 1. Let bytes be the transmitted bytes.
  23324. const bytes = chunk
  23325. // 2. Let codings be the result of extracting header list values
  23326. // given `Content-Encoding` and response’s header list.
  23327. // See pullAlgorithm.
  23328. // 3. Increase timingInfo’s encoded body size by bytes’s length.
  23329. timingInfo.encodedBodySize += bytes.byteLength
  23330. // 4. See pullAlgorithm...
  23331. return this.body.push(bytes)
  23332. },
  23333. onComplete () {
  23334. if (this.abort) {
  23335. fetchParams.controller.off('terminated', this.abort)
  23336. }
  23337. fetchParams.controller.ended = true
  23338. this.body.push(null)
  23339. },
  23340. onError (error) {
  23341. if (this.abort) {
  23342. fetchParams.controller.off('terminated', this.abort)
  23343. }
  23344. this.body?.destroy(error)
  23345. fetchParams.controller.terminate(error)
  23346. reject(error)
  23347. },
  23348. onUpgrade (status, headersList, socket) {
  23349. if (status !== 101) {
  23350. return
  23351. }
  23352. const headers = new Headers()
  23353. for (let n = 0; n < headersList.length; n += 2) {
  23354. const key = headersList[n + 0].toString('latin1')
  23355. const val = headersList[n + 1].toString('latin1')
  23356. headers[kHeadersList].append(key, val)
  23357. }
  23358. resolve({
  23359. status,
  23360. statusText: STATUS_CODES[status],
  23361. headersList: headers[kHeadersList],
  23362. socket
  23363. })
  23364. return true
  23365. }
  23366. }
  23367. ))
  23368. }
  23369. }
  23370. module.exports = {
  23371. fetch,
  23372. Fetch,
  23373. fetching,
  23374. finalizeAndReportTiming
  23375. }
  23376. /***/ }),
  23377. /***/ 8359:
  23378. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  23379. "use strict";
  23380. /* globals AbortController */
  23381. const { extractBody, mixinBody, cloneBody } = __nccwpck_require__(9990)
  23382. const { Headers, fill: fillHeaders, HeadersList } = __nccwpck_require__(554)
  23383. const { FinalizationRegistry } = __nccwpck_require__(6436)()
  23384. const util = __nccwpck_require__(3983)
  23385. const {
  23386. isValidHTTPToken,
  23387. sameOrigin,
  23388. normalizeMethod,
  23389. makePolicyContainer,
  23390. normalizeMethodRecord
  23391. } = __nccwpck_require__(2538)
  23392. const {
  23393. forbiddenMethodsSet,
  23394. corsSafeListedMethodsSet,
  23395. referrerPolicy,
  23396. requestRedirect,
  23397. requestMode,
  23398. requestCredentials,
  23399. requestCache,
  23400. requestDuplex
  23401. } = __nccwpck_require__(1037)
  23402. const { kEnumerableProperty } = util
  23403. const { kHeaders, kSignal, kState, kGuard, kRealm } = __nccwpck_require__(5861)
  23404. const { webidl } = __nccwpck_require__(1744)
  23405. const { getGlobalOrigin } = __nccwpck_require__(1246)
  23406. const { URLSerializer } = __nccwpck_require__(685)
  23407. const { kHeadersList, kConstruct } = __nccwpck_require__(2785)
  23408. const assert = __nccwpck_require__(9491)
  23409. const { getMaxListeners, setMaxListeners, getEventListeners, defaultMaxListeners } = __nccwpck_require__(2361)
  23410. let TransformStream = globalThis.TransformStream
  23411. const kAbortController = Symbol('abortController')
  23412. const requestFinalizer = new FinalizationRegistry(({ signal, abort }) => {
  23413. signal.removeEventListener('abort', abort)
  23414. })
  23415. // https://fetch.spec.whatwg.org/#request-class
  23416. class Request {
  23417. // https://fetch.spec.whatwg.org/#dom-request
  23418. constructor (input, init = {}) {
  23419. if (input === kConstruct) {
  23420. return
  23421. }
  23422. webidl.argumentLengthCheck(arguments, 1, { header: 'Request constructor' })
  23423. input = webidl.converters.RequestInfo(input)
  23424. init = webidl.converters.RequestInit(init)
  23425. // https://html.spec.whatwg.org/multipage/webappapis.html#environment-settings-object
  23426. this[kRealm] = {
  23427. settingsObject: {
  23428. baseUrl: getGlobalOrigin(),
  23429. get origin () {
  23430. return this.baseUrl?.origin
  23431. },
  23432. policyContainer: makePolicyContainer()
  23433. }
  23434. }
  23435. // 1. Let request be null.
  23436. let request = null
  23437. // 2. Let fallbackMode be null.
  23438. let fallbackMode = null
  23439. // 3. Let baseURL be this’s relevant settings object’s API base URL.
  23440. const baseUrl = this[kRealm].settingsObject.baseUrl
  23441. // 4. Let signal be null.
  23442. let signal = null
  23443. // 5. If input is a string, then:
  23444. if (typeof input === 'string') {
  23445. // 1. Let parsedURL be the result of parsing input with baseURL.
  23446. // 2. If parsedURL is failure, then throw a TypeError.
  23447. let parsedURL
  23448. try {
  23449. parsedURL = new URL(input, baseUrl)
  23450. } catch (err) {
  23451. throw new TypeError('Failed to parse URL from ' + input, { cause: err })
  23452. }
  23453. // 3. If parsedURL includes credentials, then throw a TypeError.
  23454. if (parsedURL.username || parsedURL.password) {
  23455. throw new TypeError(
  23456. 'Request cannot be constructed from a URL that includes credentials: ' +
  23457. input
  23458. )
  23459. }
  23460. // 4. Set request to a new request whose URL is parsedURL.
  23461. request = makeRequest({ urlList: [parsedURL] })
  23462. // 5. Set fallbackMode to "cors".
  23463. fallbackMode = 'cors'
  23464. } else {
  23465. // 6. Otherwise:
  23466. // 7. Assert: input is a Request object.
  23467. assert(input instanceof Request)
  23468. // 8. Set request to input’s request.
  23469. request = input[kState]
  23470. // 9. Set signal to input’s signal.
  23471. signal = input[kSignal]
  23472. }
  23473. // 7. Let origin be this’s relevant settings object’s origin.
  23474. const origin = this[kRealm].settingsObject.origin
  23475. // 8. Let window be "client".
  23476. let window = 'client'
  23477. // 9. If request’s window is an environment settings object and its origin
  23478. // is same origin with origin, then set window to request’s window.
  23479. if (
  23480. request.window?.constructor?.name === 'EnvironmentSettingsObject' &&
  23481. sameOrigin(request.window, origin)
  23482. ) {
  23483. window = request.window
  23484. }
  23485. // 10. If init["window"] exists and is non-null, then throw a TypeError.
  23486. if (init.window != null) {
  23487. throw new TypeError(`'window' option '${window}' must be null`)
  23488. }
  23489. // 11. If init["window"] exists, then set window to "no-window".
  23490. if ('window' in init) {
  23491. window = 'no-window'
  23492. }
  23493. // 12. Set request to a new request with the following properties:
  23494. request = makeRequest({
  23495. // URL request’s URL.
  23496. // undici implementation note: this is set as the first item in request's urlList in makeRequest
  23497. // method request’s method.
  23498. method: request.method,
  23499. // header list A copy of request’s header list.
  23500. // undici implementation note: headersList is cloned in makeRequest
  23501. headersList: request.headersList,
  23502. // unsafe-request flag Set.
  23503. unsafeRequest: request.unsafeRequest,
  23504. // client This’s relevant settings object.
  23505. client: this[kRealm].settingsObject,
  23506. // window window.
  23507. window,
  23508. // priority request’s priority.
  23509. priority: request.priority,
  23510. // origin request’s origin. The propagation of the origin is only significant for navigation requests
  23511. // being handled by a service worker. In this scenario a request can have an origin that is different
  23512. // from the current client.
  23513. origin: request.origin,
  23514. // referrer request’s referrer.
  23515. referrer: request.referrer,
  23516. // referrer policy request’s referrer policy.
  23517. referrerPolicy: request.referrerPolicy,
  23518. // mode request’s mode.
  23519. mode: request.mode,
  23520. // credentials mode request’s credentials mode.
  23521. credentials: request.credentials,
  23522. // cache mode request’s cache mode.
  23523. cache: request.cache,
  23524. // redirect mode request’s redirect mode.
  23525. redirect: request.redirect,
  23526. // integrity metadata request’s integrity metadata.
  23527. integrity: request.integrity,
  23528. // keepalive request’s keepalive.
  23529. keepalive: request.keepalive,
  23530. // reload-navigation flag request’s reload-navigation flag.
  23531. reloadNavigation: request.reloadNavigation,
  23532. // history-navigation flag request’s history-navigation flag.
  23533. historyNavigation: request.historyNavigation,
  23534. // URL list A clone of request’s URL list.
  23535. urlList: [...request.urlList]
  23536. })
  23537. const initHasKey = Object.keys(init).length !== 0
  23538. // 13. If init is not empty, then:
  23539. if (initHasKey) {
  23540. // 1. If request’s mode is "navigate", then set it to "same-origin".
  23541. if (request.mode === 'navigate') {
  23542. request.mode = 'same-origin'
  23543. }
  23544. // 2. Unset request’s reload-navigation flag.
  23545. request.reloadNavigation = false
  23546. // 3. Unset request’s history-navigation flag.
  23547. request.historyNavigation = false
  23548. // 4. Set request’s origin to "client".
  23549. request.origin = 'client'
  23550. // 5. Set request’s referrer to "client"
  23551. request.referrer = 'client'
  23552. // 6. Set request’s referrer policy to the empty string.
  23553. request.referrerPolicy = ''
  23554. // 7. Set request’s URL to request’s current URL.
  23555. request.url = request.urlList[request.urlList.length - 1]
  23556. // 8. Set request’s URL list to « request’s URL ».
  23557. request.urlList = [request.url]
  23558. }
  23559. // 14. If init["referrer"] exists, then:
  23560. if (init.referrer !== undefined) {
  23561. // 1. Let referrer be init["referrer"].
  23562. const referrer = init.referrer
  23563. // 2. If referrer is the empty string, then set request’s referrer to "no-referrer".
  23564. if (referrer === '') {
  23565. request.referrer = 'no-referrer'
  23566. } else {
  23567. // 1. Let parsedReferrer be the result of parsing referrer with
  23568. // baseURL.
  23569. // 2. If parsedReferrer is failure, then throw a TypeError.
  23570. let parsedReferrer
  23571. try {
  23572. parsedReferrer = new URL(referrer, baseUrl)
  23573. } catch (err) {
  23574. throw new TypeError(`Referrer "${referrer}" is not a valid URL.`, { cause: err })
  23575. }
  23576. // 3. If one of the following is true
  23577. // - parsedReferrer’s scheme is "about" and path is the string "client"
  23578. // - parsedReferrer’s origin is not same origin with origin
  23579. // then set request’s referrer to "client".
  23580. if (
  23581. (parsedReferrer.protocol === 'about:' && parsedReferrer.hostname === 'client') ||
  23582. (origin && !sameOrigin(parsedReferrer, this[kRealm].settingsObject.baseUrl))
  23583. ) {
  23584. request.referrer = 'client'
  23585. } else {
  23586. // 4. Otherwise, set request’s referrer to parsedReferrer.
  23587. request.referrer = parsedReferrer
  23588. }
  23589. }
  23590. }
  23591. // 15. If init["referrerPolicy"] exists, then set request’s referrer policy
  23592. // to it.
  23593. if (init.referrerPolicy !== undefined) {
  23594. request.referrerPolicy = init.referrerPolicy
  23595. }
  23596. // 16. Let mode be init["mode"] if it exists, and fallbackMode otherwise.
  23597. let mode
  23598. if (init.mode !== undefined) {
  23599. mode = init.mode
  23600. } else {
  23601. mode = fallbackMode
  23602. }
  23603. // 17. If mode is "navigate", then throw a TypeError.
  23604. if (mode === 'navigate') {
  23605. throw webidl.errors.exception({
  23606. header: 'Request constructor',
  23607. message: 'invalid request mode navigate.'
  23608. })
  23609. }
  23610. // 18. If mode is non-null, set request’s mode to mode.
  23611. if (mode != null) {
  23612. request.mode = mode
  23613. }
  23614. // 19. If init["credentials"] exists, then set request’s credentials mode
  23615. // to it.
  23616. if (init.credentials !== undefined) {
  23617. request.credentials = init.credentials
  23618. }
  23619. // 18. If init["cache"] exists, then set request’s cache mode to it.
  23620. if (init.cache !== undefined) {
  23621. request.cache = init.cache
  23622. }
  23623. // 21. If request’s cache mode is "only-if-cached" and request’s mode is
  23624. // not "same-origin", then throw a TypeError.
  23625. if (request.cache === 'only-if-cached' && request.mode !== 'same-origin') {
  23626. throw new TypeError(
  23627. "'only-if-cached' can be set only with 'same-origin' mode"
  23628. )
  23629. }
  23630. // 22. If init["redirect"] exists, then set request’s redirect mode to it.
  23631. if (init.redirect !== undefined) {
  23632. request.redirect = init.redirect
  23633. }
  23634. // 23. If init["integrity"] exists, then set request’s integrity metadata to it.
  23635. if (init.integrity != null) {
  23636. request.integrity = String(init.integrity)
  23637. }
  23638. // 24. If init["keepalive"] exists, then set request’s keepalive to it.
  23639. if (init.keepalive !== undefined) {
  23640. request.keepalive = Boolean(init.keepalive)
  23641. }
  23642. // 25. If init["method"] exists, then:
  23643. if (init.method !== undefined) {
  23644. // 1. Let method be init["method"].
  23645. let method = init.method
  23646. // 2. If method is not a method or method is a forbidden method, then
  23647. // throw a TypeError.
  23648. if (!isValidHTTPToken(method)) {
  23649. throw new TypeError(`'${method}' is not a valid HTTP method.`)
  23650. }
  23651. if (forbiddenMethodsSet.has(method.toUpperCase())) {
  23652. throw new TypeError(`'${method}' HTTP method is unsupported.`)
  23653. }
  23654. // 3. Normalize method.
  23655. method = normalizeMethodRecord[method] ?? normalizeMethod(method)
  23656. // 4. Set request’s method to method.
  23657. request.method = method
  23658. }
  23659. // 26. If init["signal"] exists, then set signal to it.
  23660. if (init.signal !== undefined) {
  23661. signal = init.signal
  23662. }
  23663. // 27. Set this’s request to request.
  23664. this[kState] = request
  23665. // 28. Set this’s signal to a new AbortSignal object with this’s relevant
  23666. // Realm.
  23667. // TODO: could this be simplified with AbortSignal.any
  23668. // (https://dom.spec.whatwg.org/#dom-abortsignal-any)
  23669. const ac = new AbortController()
  23670. this[kSignal] = ac.signal
  23671. this[kSignal][kRealm] = this[kRealm]
  23672. // 29. If signal is not null, then make this’s signal follow signal.
  23673. if (signal != null) {
  23674. if (
  23675. !signal ||
  23676. typeof signal.aborted !== 'boolean' ||
  23677. typeof signal.addEventListener !== 'function'
  23678. ) {
  23679. throw new TypeError(
  23680. "Failed to construct 'Request': member signal is not of type AbortSignal."
  23681. )
  23682. }
  23683. if (signal.aborted) {
  23684. ac.abort(signal.reason)
  23685. } else {
  23686. // Keep a strong ref to ac while request object
  23687. // is alive. This is needed to prevent AbortController
  23688. // from being prematurely garbage collected.
  23689. // See, https://github.com/nodejs/undici/issues/1926.
  23690. this[kAbortController] = ac
  23691. const acRef = new WeakRef(ac)
  23692. const abort = function () {
  23693. const ac = acRef.deref()
  23694. if (ac !== undefined) {
  23695. ac.abort(this.reason)
  23696. }
  23697. }
  23698. // Third-party AbortControllers may not work with these.
  23699. // See, https://github.com/nodejs/undici/pull/1910#issuecomment-1464495619.
  23700. try {
  23701. // If the max amount of listeners is equal to the default, increase it
  23702. // This is only available in node >= v19.9.0
  23703. if (typeof getMaxListeners === 'function' && getMaxListeners(signal) === defaultMaxListeners) {
  23704. setMaxListeners(100, signal)
  23705. } else if (getEventListeners(signal, 'abort').length >= defaultMaxListeners) {
  23706. setMaxListeners(100, signal)
  23707. }
  23708. } catch {}
  23709. util.addAbortListener(signal, abort)
  23710. requestFinalizer.register(ac, { signal, abort })
  23711. }
  23712. }
  23713. // 30. Set this’s headers to a new Headers object with this’s relevant
  23714. // Realm, whose header list is request’s header list and guard is
  23715. // "request".
  23716. this[kHeaders] = new Headers(kConstruct)
  23717. this[kHeaders][kHeadersList] = request.headersList
  23718. this[kHeaders][kGuard] = 'request'
  23719. this[kHeaders][kRealm] = this[kRealm]
  23720. // 31. If this’s request’s mode is "no-cors", then:
  23721. if (mode === 'no-cors') {
  23722. // 1. If this’s request’s method is not a CORS-safelisted method,
  23723. // then throw a TypeError.
  23724. if (!corsSafeListedMethodsSet.has(request.method)) {
  23725. throw new TypeError(
  23726. `'${request.method} is unsupported in no-cors mode.`
  23727. )
  23728. }
  23729. // 2. Set this’s headers’s guard to "request-no-cors".
  23730. this[kHeaders][kGuard] = 'request-no-cors'
  23731. }
  23732. // 32. If init is not empty, then:
  23733. if (initHasKey) {
  23734. /** @type {HeadersList} */
  23735. const headersList = this[kHeaders][kHeadersList]
  23736. // 1. Let headers be a copy of this’s headers and its associated header
  23737. // list.
  23738. // 2. If init["headers"] exists, then set headers to init["headers"].
  23739. const headers = init.headers !== undefined ? init.headers : new HeadersList(headersList)
  23740. // 3. Empty this’s headers’s header list.
  23741. headersList.clear()
  23742. // 4. If headers is a Headers object, then for each header in its header
  23743. // list, append header’s name/header’s value to this’s headers.
  23744. if (headers instanceof HeadersList) {
  23745. for (const [key, val] of headers) {
  23746. headersList.append(key, val)
  23747. }
  23748. // Note: Copy the `set-cookie` meta-data.
  23749. headersList.cookies = headers.cookies
  23750. } else {
  23751. // 5. Otherwise, fill this’s headers with headers.
  23752. fillHeaders(this[kHeaders], headers)
  23753. }
  23754. }
  23755. // 33. Let inputBody be input’s request’s body if input is a Request
  23756. // object; otherwise null.
  23757. const inputBody = input instanceof Request ? input[kState].body : null
  23758. // 34. If either init["body"] exists and is non-null or inputBody is
  23759. // non-null, and request’s method is `GET` or `HEAD`, then throw a
  23760. // TypeError.
  23761. if (
  23762. (init.body != null || inputBody != null) &&
  23763. (request.method === 'GET' || request.method === 'HEAD')
  23764. ) {
  23765. throw new TypeError('Request with GET/HEAD method cannot have body.')
  23766. }
  23767. // 35. Let initBody be null.
  23768. let initBody = null
  23769. // 36. If init["body"] exists and is non-null, then:
  23770. if (init.body != null) {
  23771. // 1. Let Content-Type be null.
  23772. // 2. Set initBody and Content-Type to the result of extracting
  23773. // init["body"], with keepalive set to request’s keepalive.
  23774. const [extractedBody, contentType] = extractBody(
  23775. init.body,
  23776. request.keepalive
  23777. )
  23778. initBody = extractedBody
  23779. // 3, If Content-Type is non-null and this’s headers’s header list does
  23780. // not contain `Content-Type`, then append `Content-Type`/Content-Type to
  23781. // this’s headers.
  23782. if (contentType && !this[kHeaders][kHeadersList].contains('content-type')) {
  23783. this[kHeaders].append('content-type', contentType)
  23784. }
  23785. }
  23786. // 37. Let inputOrInitBody be initBody if it is non-null; otherwise
  23787. // inputBody.
  23788. const inputOrInitBody = initBody ?? inputBody
  23789. // 38. If inputOrInitBody is non-null and inputOrInitBody’s source is
  23790. // null, then:
  23791. if (inputOrInitBody != null && inputOrInitBody.source == null) {
  23792. // 1. If initBody is non-null and init["duplex"] does not exist,
  23793. // then throw a TypeError.
  23794. if (initBody != null && init.duplex == null) {
  23795. throw new TypeError('RequestInit: duplex option is required when sending a body.')
  23796. }
  23797. // 2. If this’s request’s mode is neither "same-origin" nor "cors",
  23798. // then throw a TypeError.
  23799. if (request.mode !== 'same-origin' && request.mode !== 'cors') {
  23800. throw new TypeError(
  23801. 'If request is made from ReadableStream, mode should be "same-origin" or "cors"'
  23802. )
  23803. }
  23804. // 3. Set this’s request’s use-CORS-preflight flag.
  23805. request.useCORSPreflightFlag = true
  23806. }
  23807. // 39. Let finalBody be inputOrInitBody.
  23808. let finalBody = inputOrInitBody
  23809. // 40. If initBody is null and inputBody is non-null, then:
  23810. if (initBody == null && inputBody != null) {
  23811. // 1. If input is unusable, then throw a TypeError.
  23812. if (util.isDisturbed(inputBody.stream) || inputBody.stream.locked) {
  23813. throw new TypeError(
  23814. 'Cannot construct a Request with a Request object that has already been used.'
  23815. )
  23816. }
  23817. // 2. Set finalBody to the result of creating a proxy for inputBody.
  23818. if (!TransformStream) {
  23819. TransformStream = (__nccwpck_require__(5356).TransformStream)
  23820. }
  23821. // https://streams.spec.whatwg.org/#readablestream-create-a-proxy
  23822. const identityTransform = new TransformStream()
  23823. inputBody.stream.pipeThrough(identityTransform)
  23824. finalBody = {
  23825. source: inputBody.source,
  23826. length: inputBody.length,
  23827. stream: identityTransform.readable
  23828. }
  23829. }
  23830. // 41. Set this’s request’s body to finalBody.
  23831. this[kState].body = finalBody
  23832. }
  23833. // Returns request’s HTTP method, which is "GET" by default.
  23834. get method () {
  23835. webidl.brandCheck(this, Request)
  23836. // The method getter steps are to return this’s request’s method.
  23837. return this[kState].method
  23838. }
  23839. // Returns the URL of request as a string.
  23840. get url () {
  23841. webidl.brandCheck(this, Request)
  23842. // The url getter steps are to return this’s request’s URL, serialized.
  23843. return URLSerializer(this[kState].url)
  23844. }
  23845. // Returns a Headers object consisting of the headers associated with request.
  23846. // Note that headers added in the network layer by the user agent will not
  23847. // be accounted for in this object, e.g., the "Host" header.
  23848. get headers () {
  23849. webidl.brandCheck(this, Request)
  23850. // The headers getter steps are to return this’s headers.
  23851. return this[kHeaders]
  23852. }
  23853. // Returns the kind of resource requested by request, e.g., "document"
  23854. // or "script".
  23855. get destination () {
  23856. webidl.brandCheck(this, Request)
  23857. // The destination getter are to return this’s request’s destination.
  23858. return this[kState].destination
  23859. }
  23860. // Returns the referrer of request. Its value can be a same-origin URL if
  23861. // explicitly set in init, the empty string to indicate no referrer, and
  23862. // "about:client" when defaulting to the global’s default. This is used
  23863. // during fetching to determine the value of the `Referer` header of the
  23864. // request being made.
  23865. get referrer () {
  23866. webidl.brandCheck(this, Request)
  23867. // 1. If this’s request’s referrer is "no-referrer", then return the
  23868. // empty string.
  23869. if (this[kState].referrer === 'no-referrer') {
  23870. return ''
  23871. }
  23872. // 2. If this’s request’s referrer is "client", then return
  23873. // "about:client".
  23874. if (this[kState].referrer === 'client') {
  23875. return 'about:client'
  23876. }
  23877. // Return this’s request’s referrer, serialized.
  23878. return this[kState].referrer.toString()
  23879. }
  23880. // Returns the referrer policy associated with request.
  23881. // This is used during fetching to compute the value of the request’s
  23882. // referrer.
  23883. get referrerPolicy () {
  23884. webidl.brandCheck(this, Request)
  23885. // The referrerPolicy getter steps are to return this’s request’s referrer policy.
  23886. return this[kState].referrerPolicy
  23887. }
  23888. // Returns the mode associated with request, which is a string indicating
  23889. // whether the request will use CORS, or will be restricted to same-origin
  23890. // URLs.
  23891. get mode () {
  23892. webidl.brandCheck(this, Request)
  23893. // The mode getter steps are to return this’s request’s mode.
  23894. return this[kState].mode
  23895. }
  23896. // Returns the credentials mode associated with request,
  23897. // which is a string indicating whether credentials will be sent with the
  23898. // request always, never, or only when sent to a same-origin URL.
  23899. get credentials () {
  23900. // The credentials getter steps are to return this’s request’s credentials mode.
  23901. return this[kState].credentials
  23902. }
  23903. // Returns the cache mode associated with request,
  23904. // which is a string indicating how the request will
  23905. // interact with the browser’s cache when fetching.
  23906. get cache () {
  23907. webidl.brandCheck(this, Request)
  23908. // The cache getter steps are to return this’s request’s cache mode.
  23909. return this[kState].cache
  23910. }
  23911. // Returns the redirect mode associated with request,
  23912. // which is a string indicating how redirects for the
  23913. // request will be handled during fetching. A request
  23914. // will follow redirects by default.
  23915. get redirect () {
  23916. webidl.brandCheck(this, Request)
  23917. // The redirect getter steps are to return this’s request’s redirect mode.
  23918. return this[kState].redirect
  23919. }
  23920. // Returns request’s subresource integrity metadata, which is a
  23921. // cryptographic hash of the resource being fetched. Its value
  23922. // consists of multiple hashes separated by whitespace. [SRI]
  23923. get integrity () {
  23924. webidl.brandCheck(this, Request)
  23925. // The integrity getter steps are to return this’s request’s integrity
  23926. // metadata.
  23927. return this[kState].integrity
  23928. }
  23929. // Returns a boolean indicating whether or not request can outlive the
  23930. // global in which it was created.
  23931. get keepalive () {
  23932. webidl.brandCheck(this, Request)
  23933. // The keepalive getter steps are to return this’s request’s keepalive.
  23934. return this[kState].keepalive
  23935. }
  23936. // Returns a boolean indicating whether or not request is for a reload
  23937. // navigation.
  23938. get isReloadNavigation () {
  23939. webidl.brandCheck(this, Request)
  23940. // The isReloadNavigation getter steps are to return true if this’s
  23941. // request’s reload-navigation flag is set; otherwise false.
  23942. return this[kState].reloadNavigation
  23943. }
  23944. // Returns a boolean indicating whether or not request is for a history
  23945. // navigation (a.k.a. back-foward navigation).
  23946. get isHistoryNavigation () {
  23947. webidl.brandCheck(this, Request)
  23948. // The isHistoryNavigation getter steps are to return true if this’s request’s
  23949. // history-navigation flag is set; otherwise false.
  23950. return this[kState].historyNavigation
  23951. }
  23952. // Returns the signal associated with request, which is an AbortSignal
  23953. // object indicating whether or not request has been aborted, and its
  23954. // abort event handler.
  23955. get signal () {
  23956. webidl.brandCheck(this, Request)
  23957. // The signal getter steps are to return this’s signal.
  23958. return this[kSignal]
  23959. }
  23960. get body () {
  23961. webidl.brandCheck(this, Request)
  23962. return this[kState].body ? this[kState].body.stream : null
  23963. }
  23964. get bodyUsed () {
  23965. webidl.brandCheck(this, Request)
  23966. return !!this[kState].body && util.isDisturbed(this[kState].body.stream)
  23967. }
  23968. get duplex () {
  23969. webidl.brandCheck(this, Request)
  23970. return 'half'
  23971. }
  23972. // Returns a clone of request.
  23973. clone () {
  23974. webidl.brandCheck(this, Request)
  23975. // 1. If this is unusable, then throw a TypeError.
  23976. if (this.bodyUsed || this.body?.locked) {
  23977. throw new TypeError('unusable')
  23978. }
  23979. // 2. Let clonedRequest be the result of cloning this’s request.
  23980. const clonedRequest = cloneRequest(this[kState])
  23981. // 3. Let clonedRequestObject be the result of creating a Request object,
  23982. // given clonedRequest, this’s headers’s guard, and this’s relevant Realm.
  23983. const clonedRequestObject = new Request(kConstruct)
  23984. clonedRequestObject[kState] = clonedRequest
  23985. clonedRequestObject[kRealm] = this[kRealm]
  23986. clonedRequestObject[kHeaders] = new Headers(kConstruct)
  23987. clonedRequestObject[kHeaders][kHeadersList] = clonedRequest.headersList
  23988. clonedRequestObject[kHeaders][kGuard] = this[kHeaders][kGuard]
  23989. clonedRequestObject[kHeaders][kRealm] = this[kHeaders][kRealm]
  23990. // 4. Make clonedRequestObject’s signal follow this’s signal.
  23991. const ac = new AbortController()
  23992. if (this.signal.aborted) {
  23993. ac.abort(this.signal.reason)
  23994. } else {
  23995. util.addAbortListener(
  23996. this.signal,
  23997. () => {
  23998. ac.abort(this.signal.reason)
  23999. }
  24000. )
  24001. }
  24002. clonedRequestObject[kSignal] = ac.signal
  24003. // 4. Return clonedRequestObject.
  24004. return clonedRequestObject
  24005. }
  24006. }
  24007. mixinBody(Request)
  24008. function makeRequest (init) {
  24009. // https://fetch.spec.whatwg.org/#requests
  24010. const request = {
  24011. method: 'GET',
  24012. localURLsOnly: false,
  24013. unsafeRequest: false,
  24014. body: null,
  24015. client: null,
  24016. reservedClient: null,
  24017. replacesClientId: '',
  24018. window: 'client',
  24019. keepalive: false,
  24020. serviceWorkers: 'all',
  24021. initiator: '',
  24022. destination: '',
  24023. priority: null,
  24024. origin: 'client',
  24025. policyContainer: 'client',
  24026. referrer: 'client',
  24027. referrerPolicy: '',
  24028. mode: 'no-cors',
  24029. useCORSPreflightFlag: false,
  24030. credentials: 'same-origin',
  24031. useCredentials: false,
  24032. cache: 'default',
  24033. redirect: 'follow',
  24034. integrity: '',
  24035. cryptoGraphicsNonceMetadata: '',
  24036. parserMetadata: '',
  24037. reloadNavigation: false,
  24038. historyNavigation: false,
  24039. userActivation: false,
  24040. taintedOrigin: false,
  24041. redirectCount: 0,
  24042. responseTainting: 'basic',
  24043. preventNoCacheCacheControlHeaderModification: false,
  24044. done: false,
  24045. timingAllowFailed: false,
  24046. ...init,
  24047. headersList: init.headersList
  24048. ? new HeadersList(init.headersList)
  24049. : new HeadersList()
  24050. }
  24051. request.url = request.urlList[0]
  24052. return request
  24053. }
  24054. // https://fetch.spec.whatwg.org/#concept-request-clone
  24055. function cloneRequest (request) {
  24056. // To clone a request request, run these steps:
  24057. // 1. Let newRequest be a copy of request, except for its body.
  24058. const newRequest = makeRequest({ ...request, body: null })
  24059. // 2. If request’s body is non-null, set newRequest’s body to the
  24060. // result of cloning request’s body.
  24061. if (request.body != null) {
  24062. newRequest.body = cloneBody(request.body)
  24063. }
  24064. // 3. Return newRequest.
  24065. return newRequest
  24066. }
  24067. Object.defineProperties(Request.prototype, {
  24068. method: kEnumerableProperty,
  24069. url: kEnumerableProperty,
  24070. headers: kEnumerableProperty,
  24071. redirect: kEnumerableProperty,
  24072. clone: kEnumerableProperty,
  24073. signal: kEnumerableProperty,
  24074. duplex: kEnumerableProperty,
  24075. destination: kEnumerableProperty,
  24076. body: kEnumerableProperty,
  24077. bodyUsed: kEnumerableProperty,
  24078. isHistoryNavigation: kEnumerableProperty,
  24079. isReloadNavigation: kEnumerableProperty,
  24080. keepalive: kEnumerableProperty,
  24081. integrity: kEnumerableProperty,
  24082. cache: kEnumerableProperty,
  24083. credentials: kEnumerableProperty,
  24084. attribute: kEnumerableProperty,
  24085. referrerPolicy: kEnumerableProperty,
  24086. referrer: kEnumerableProperty,
  24087. mode: kEnumerableProperty,
  24088. [Symbol.toStringTag]: {
  24089. value: 'Request',
  24090. configurable: true
  24091. }
  24092. })
  24093. webidl.converters.Request = webidl.interfaceConverter(
  24094. Request
  24095. )
  24096. // https://fetch.spec.whatwg.org/#requestinfo
  24097. webidl.converters.RequestInfo = function (V) {
  24098. if (typeof V === 'string') {
  24099. return webidl.converters.USVString(V)
  24100. }
  24101. if (V instanceof Request) {
  24102. return webidl.converters.Request(V)
  24103. }
  24104. return webidl.converters.USVString(V)
  24105. }
  24106. webidl.converters.AbortSignal = webidl.interfaceConverter(
  24107. AbortSignal
  24108. )
  24109. // https://fetch.spec.whatwg.org/#requestinit
  24110. webidl.converters.RequestInit = webidl.dictionaryConverter([
  24111. {
  24112. key: 'method',
  24113. converter: webidl.converters.ByteString
  24114. },
  24115. {
  24116. key: 'headers',
  24117. converter: webidl.converters.HeadersInit
  24118. },
  24119. {
  24120. key: 'body',
  24121. converter: webidl.nullableConverter(
  24122. webidl.converters.BodyInit
  24123. )
  24124. },
  24125. {
  24126. key: 'referrer',
  24127. converter: webidl.converters.USVString
  24128. },
  24129. {
  24130. key: 'referrerPolicy',
  24131. converter: webidl.converters.DOMString,
  24132. // https://w3c.github.io/webappsec-referrer-policy/#referrer-policy
  24133. allowedValues: referrerPolicy
  24134. },
  24135. {
  24136. key: 'mode',
  24137. converter: webidl.converters.DOMString,
  24138. // https://fetch.spec.whatwg.org/#concept-request-mode
  24139. allowedValues: requestMode
  24140. },
  24141. {
  24142. key: 'credentials',
  24143. converter: webidl.converters.DOMString,
  24144. // https://fetch.spec.whatwg.org/#requestcredentials
  24145. allowedValues: requestCredentials
  24146. },
  24147. {
  24148. key: 'cache',
  24149. converter: webidl.converters.DOMString,
  24150. // https://fetch.spec.whatwg.org/#requestcache
  24151. allowedValues: requestCache
  24152. },
  24153. {
  24154. key: 'redirect',
  24155. converter: webidl.converters.DOMString,
  24156. // https://fetch.spec.whatwg.org/#requestredirect
  24157. allowedValues: requestRedirect
  24158. },
  24159. {
  24160. key: 'integrity',
  24161. converter: webidl.converters.DOMString
  24162. },
  24163. {
  24164. key: 'keepalive',
  24165. converter: webidl.converters.boolean
  24166. },
  24167. {
  24168. key: 'signal',
  24169. converter: webidl.nullableConverter(
  24170. (signal) => webidl.converters.AbortSignal(
  24171. signal,
  24172. { strict: false }
  24173. )
  24174. )
  24175. },
  24176. {
  24177. key: 'window',
  24178. converter: webidl.converters.any
  24179. },
  24180. {
  24181. key: 'duplex',
  24182. converter: webidl.converters.DOMString,
  24183. allowedValues: requestDuplex
  24184. }
  24185. ])
  24186. module.exports = { Request, makeRequest }
  24187. /***/ }),
  24188. /***/ 7823:
  24189. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  24190. "use strict";
  24191. const { Headers, HeadersList, fill } = __nccwpck_require__(554)
  24192. const { extractBody, cloneBody, mixinBody } = __nccwpck_require__(9990)
  24193. const util = __nccwpck_require__(3983)
  24194. const { kEnumerableProperty } = util
  24195. const {
  24196. isValidReasonPhrase,
  24197. isCancelled,
  24198. isAborted,
  24199. isBlobLike,
  24200. serializeJavascriptValueToJSONString,
  24201. isErrorLike,
  24202. isomorphicEncode
  24203. } = __nccwpck_require__(2538)
  24204. const {
  24205. redirectStatusSet,
  24206. nullBodyStatus,
  24207. DOMException
  24208. } = __nccwpck_require__(1037)
  24209. const { kState, kHeaders, kGuard, kRealm } = __nccwpck_require__(5861)
  24210. const { webidl } = __nccwpck_require__(1744)
  24211. const { FormData } = __nccwpck_require__(2015)
  24212. const { getGlobalOrigin } = __nccwpck_require__(1246)
  24213. const { URLSerializer } = __nccwpck_require__(685)
  24214. const { kHeadersList, kConstruct } = __nccwpck_require__(2785)
  24215. const assert = __nccwpck_require__(9491)
  24216. const { types } = __nccwpck_require__(3837)
  24217. const ReadableStream = globalThis.ReadableStream || (__nccwpck_require__(5356).ReadableStream)
  24218. const textEncoder = new TextEncoder('utf-8')
  24219. // https://fetch.spec.whatwg.org/#response-class
  24220. class Response {
  24221. // Creates network error Response.
  24222. static error () {
  24223. // TODO
  24224. const relevantRealm = { settingsObject: {} }
  24225. // The static error() method steps are to return the result of creating a
  24226. // Response object, given a new network error, "immutable", and this’s
  24227. // relevant Realm.
  24228. const responseObject = new Response()
  24229. responseObject[kState] = makeNetworkError()
  24230. responseObject[kRealm] = relevantRealm
  24231. responseObject[kHeaders][kHeadersList] = responseObject[kState].headersList
  24232. responseObject[kHeaders][kGuard] = 'immutable'
  24233. responseObject[kHeaders][kRealm] = relevantRealm
  24234. return responseObject
  24235. }
  24236. // https://fetch.spec.whatwg.org/#dom-response-json
  24237. static json (data, init = {}) {
  24238. webidl.argumentLengthCheck(arguments, 1, { header: 'Response.json' })
  24239. if (init !== null) {
  24240. init = webidl.converters.ResponseInit(init)
  24241. }
  24242. // 1. Let bytes the result of running serialize a JavaScript value to JSON bytes on data.
  24243. const bytes = textEncoder.encode(
  24244. serializeJavascriptValueToJSONString(data)
  24245. )
  24246. // 2. Let body be the result of extracting bytes.
  24247. const body = extractBody(bytes)
  24248. // 3. Let responseObject be the result of creating a Response object, given a new response,
  24249. // "response", and this’s relevant Realm.
  24250. const relevantRealm = { settingsObject: {} }
  24251. const responseObject = new Response()
  24252. responseObject[kRealm] = relevantRealm
  24253. responseObject[kHeaders][kGuard] = 'response'
  24254. responseObject[kHeaders][kRealm] = relevantRealm
  24255. // 4. Perform initialize a response given responseObject, init, and (body, "application/json").
  24256. initializeResponse(responseObject, init, { body: body[0], type: 'application/json' })
  24257. // 5. Return responseObject.
  24258. return responseObject
  24259. }
  24260. // Creates a redirect Response that redirects to url with status status.
  24261. static redirect (url, status = 302) {
  24262. const relevantRealm = { settingsObject: {} }
  24263. webidl.argumentLengthCheck(arguments, 1, { header: 'Response.redirect' })
  24264. url = webidl.converters.USVString(url)
  24265. status = webidl.converters['unsigned short'](status)
  24266. // 1. Let parsedURL be the result of parsing url with current settings
  24267. // object’s API base URL.
  24268. // 2. If parsedURL is failure, then throw a TypeError.
  24269. // TODO: base-URL?
  24270. let parsedURL
  24271. try {
  24272. parsedURL = new URL(url, getGlobalOrigin())
  24273. } catch (err) {
  24274. throw Object.assign(new TypeError('Failed to parse URL from ' + url), {
  24275. cause: err
  24276. })
  24277. }
  24278. // 3. If status is not a redirect status, then throw a RangeError.
  24279. if (!redirectStatusSet.has(status)) {
  24280. throw new RangeError('Invalid status code ' + status)
  24281. }
  24282. // 4. Let responseObject be the result of creating a Response object,
  24283. // given a new response, "immutable", and this’s relevant Realm.
  24284. const responseObject = new Response()
  24285. responseObject[kRealm] = relevantRealm
  24286. responseObject[kHeaders][kGuard] = 'immutable'
  24287. responseObject[kHeaders][kRealm] = relevantRealm
  24288. // 5. Set responseObject’s response’s status to status.
  24289. responseObject[kState].status = status
  24290. // 6. Let value be parsedURL, serialized and isomorphic encoded.
  24291. const value = isomorphicEncode(URLSerializer(parsedURL))
  24292. // 7. Append `Location`/value to responseObject’s response’s header list.
  24293. responseObject[kState].headersList.append('location', value)
  24294. // 8. Return responseObject.
  24295. return responseObject
  24296. }
  24297. // https://fetch.spec.whatwg.org/#dom-response
  24298. constructor (body = null, init = {}) {
  24299. if (body !== null) {
  24300. body = webidl.converters.BodyInit(body)
  24301. }
  24302. init = webidl.converters.ResponseInit(init)
  24303. // TODO
  24304. this[kRealm] = { settingsObject: {} }
  24305. // 1. Set this’s response to a new response.
  24306. this[kState] = makeResponse({})
  24307. // 2. Set this’s headers to a new Headers object with this’s relevant
  24308. // Realm, whose header list is this’s response’s header list and guard
  24309. // is "response".
  24310. this[kHeaders] = new Headers(kConstruct)
  24311. this[kHeaders][kGuard] = 'response'
  24312. this[kHeaders][kHeadersList] = this[kState].headersList
  24313. this[kHeaders][kRealm] = this[kRealm]
  24314. // 3. Let bodyWithType be null.
  24315. let bodyWithType = null
  24316. // 4. If body is non-null, then set bodyWithType to the result of extracting body.
  24317. if (body != null) {
  24318. const [extractedBody, type] = extractBody(body)
  24319. bodyWithType = { body: extractedBody, type }
  24320. }
  24321. // 5. Perform initialize a response given this, init, and bodyWithType.
  24322. initializeResponse(this, init, bodyWithType)
  24323. }
  24324. // Returns response’s type, e.g., "cors".
  24325. get type () {
  24326. webidl.brandCheck(this, Response)
  24327. // The type getter steps are to return this’s response’s type.
  24328. return this[kState].type
  24329. }
  24330. // Returns response’s URL, if it has one; otherwise the empty string.
  24331. get url () {
  24332. webidl.brandCheck(this, Response)
  24333. const urlList = this[kState].urlList
  24334. // The url getter steps are to return the empty string if this’s
  24335. // response’s URL is null; otherwise this’s response’s URL,
  24336. // serialized with exclude fragment set to true.
  24337. const url = urlList[urlList.length - 1] ?? null
  24338. if (url === null) {
  24339. return ''
  24340. }
  24341. return URLSerializer(url, true)
  24342. }
  24343. // Returns whether response was obtained through a redirect.
  24344. get redirected () {
  24345. webidl.brandCheck(this, Response)
  24346. // The redirected getter steps are to return true if this’s response’s URL
  24347. // list has more than one item; otherwise false.
  24348. return this[kState].urlList.length > 1
  24349. }
  24350. // Returns response’s status.
  24351. get status () {
  24352. webidl.brandCheck(this, Response)
  24353. // The status getter steps are to return this’s response’s status.
  24354. return this[kState].status
  24355. }
  24356. // Returns whether response’s status is an ok status.
  24357. get ok () {
  24358. webidl.brandCheck(this, Response)
  24359. // The ok getter steps are to return true if this’s response’s status is an
  24360. // ok status; otherwise false.
  24361. return this[kState].status >= 200 && this[kState].status <= 299
  24362. }
  24363. // Returns response’s status message.
  24364. get statusText () {
  24365. webidl.brandCheck(this, Response)
  24366. // The statusText getter steps are to return this’s response’s status
  24367. // message.
  24368. return this[kState].statusText
  24369. }
  24370. // Returns response’s headers as Headers.
  24371. get headers () {
  24372. webidl.brandCheck(this, Response)
  24373. // The headers getter steps are to return this’s headers.
  24374. return this[kHeaders]
  24375. }
  24376. get body () {
  24377. webidl.brandCheck(this, Response)
  24378. return this[kState].body ? this[kState].body.stream : null
  24379. }
  24380. get bodyUsed () {
  24381. webidl.brandCheck(this, Response)
  24382. return !!this[kState].body && util.isDisturbed(this[kState].body.stream)
  24383. }
  24384. // Returns a clone of response.
  24385. clone () {
  24386. webidl.brandCheck(this, Response)
  24387. // 1. If this is unusable, then throw a TypeError.
  24388. if (this.bodyUsed || (this.body && this.body.locked)) {
  24389. throw webidl.errors.exception({
  24390. header: 'Response.clone',
  24391. message: 'Body has already been consumed.'
  24392. })
  24393. }
  24394. // 2. Let clonedResponse be the result of cloning this’s response.
  24395. const clonedResponse = cloneResponse(this[kState])
  24396. // 3. Return the result of creating a Response object, given
  24397. // clonedResponse, this’s headers’s guard, and this’s relevant Realm.
  24398. const clonedResponseObject = new Response()
  24399. clonedResponseObject[kState] = clonedResponse
  24400. clonedResponseObject[kRealm] = this[kRealm]
  24401. clonedResponseObject[kHeaders][kHeadersList] = clonedResponse.headersList
  24402. clonedResponseObject[kHeaders][kGuard] = this[kHeaders][kGuard]
  24403. clonedResponseObject[kHeaders][kRealm] = this[kHeaders][kRealm]
  24404. return clonedResponseObject
  24405. }
  24406. }
  24407. mixinBody(Response)
  24408. Object.defineProperties(Response.prototype, {
  24409. type: kEnumerableProperty,
  24410. url: kEnumerableProperty,
  24411. status: kEnumerableProperty,
  24412. ok: kEnumerableProperty,
  24413. redirected: kEnumerableProperty,
  24414. statusText: kEnumerableProperty,
  24415. headers: kEnumerableProperty,
  24416. clone: kEnumerableProperty,
  24417. body: kEnumerableProperty,
  24418. bodyUsed: kEnumerableProperty,
  24419. [Symbol.toStringTag]: {
  24420. value: 'Response',
  24421. configurable: true
  24422. }
  24423. })
  24424. Object.defineProperties(Response, {
  24425. json: kEnumerableProperty,
  24426. redirect: kEnumerableProperty,
  24427. error: kEnumerableProperty
  24428. })
  24429. // https://fetch.spec.whatwg.org/#concept-response-clone
  24430. function cloneResponse (response) {
  24431. // To clone a response response, run these steps:
  24432. // 1. If response is a filtered response, then return a new identical
  24433. // filtered response whose internal response is a clone of response’s
  24434. // internal response.
  24435. if (response.internalResponse) {
  24436. return filterResponse(
  24437. cloneResponse(response.internalResponse),
  24438. response.type
  24439. )
  24440. }
  24441. // 2. Let newResponse be a copy of response, except for its body.
  24442. const newResponse = makeResponse({ ...response, body: null })
  24443. // 3. If response’s body is non-null, then set newResponse’s body to the
  24444. // result of cloning response’s body.
  24445. if (response.body != null) {
  24446. newResponse.body = cloneBody(response.body)
  24447. }
  24448. // 4. Return newResponse.
  24449. return newResponse
  24450. }
  24451. function makeResponse (init) {
  24452. return {
  24453. aborted: false,
  24454. rangeRequested: false,
  24455. timingAllowPassed: false,
  24456. requestIncludesCredentials: false,
  24457. type: 'default',
  24458. status: 200,
  24459. timingInfo: null,
  24460. cacheState: '',
  24461. statusText: '',
  24462. ...init,
  24463. headersList: init.headersList
  24464. ? new HeadersList(init.headersList)
  24465. : new HeadersList(),
  24466. urlList: init.urlList ? [...init.urlList] : []
  24467. }
  24468. }
  24469. function makeNetworkError (reason) {
  24470. const isError = isErrorLike(reason)
  24471. return makeResponse({
  24472. type: 'error',
  24473. status: 0,
  24474. error: isError
  24475. ? reason
  24476. : new Error(reason ? String(reason) : reason),
  24477. aborted: reason && reason.name === 'AbortError'
  24478. })
  24479. }
  24480. function makeFilteredResponse (response, state) {
  24481. state = {
  24482. internalResponse: response,
  24483. ...state
  24484. }
  24485. return new Proxy(response, {
  24486. get (target, p) {
  24487. return p in state ? state[p] : target[p]
  24488. },
  24489. set (target, p, value) {
  24490. assert(!(p in state))
  24491. target[p] = value
  24492. return true
  24493. }
  24494. })
  24495. }
  24496. // https://fetch.spec.whatwg.org/#concept-filtered-response
  24497. function filterResponse (response, type) {
  24498. // Set response to the following filtered response with response as its
  24499. // internal response, depending on request’s response tainting:
  24500. if (type === 'basic') {
  24501. // A basic filtered response is a filtered response whose type is "basic"
  24502. // and header list excludes any headers in internal response’s header list
  24503. // whose name is a forbidden response-header name.
  24504. // Note: undici does not implement forbidden response-header names
  24505. return makeFilteredResponse(response, {
  24506. type: 'basic',
  24507. headersList: response.headersList
  24508. })
  24509. } else if (type === 'cors') {
  24510. // A CORS filtered response is a filtered response whose type is "cors"
  24511. // and header list excludes any headers in internal response’s header
  24512. // list whose name is not a CORS-safelisted response-header name, given
  24513. // internal response’s CORS-exposed header-name list.
  24514. // Note: undici does not implement CORS-safelisted response-header names
  24515. return makeFilteredResponse(response, {
  24516. type: 'cors',
  24517. headersList: response.headersList
  24518. })
  24519. } else if (type === 'opaque') {
  24520. // An opaque filtered response is a filtered response whose type is
  24521. // "opaque", URL list is the empty list, status is 0, status message
  24522. // is the empty byte sequence, header list is empty, and body is null.
  24523. return makeFilteredResponse(response, {
  24524. type: 'opaque',
  24525. urlList: Object.freeze([]),
  24526. status: 0,
  24527. statusText: '',
  24528. body: null
  24529. })
  24530. } else if (type === 'opaqueredirect') {
  24531. // An opaque-redirect filtered response is a filtered response whose type
  24532. // is "opaqueredirect", status is 0, status message is the empty byte
  24533. // sequence, header list is empty, and body is null.
  24534. return makeFilteredResponse(response, {
  24535. type: 'opaqueredirect',
  24536. status: 0,
  24537. statusText: '',
  24538. headersList: [],
  24539. body: null
  24540. })
  24541. } else {
  24542. assert(false)
  24543. }
  24544. }
  24545. // https://fetch.spec.whatwg.org/#appropriate-network-error
  24546. function makeAppropriateNetworkError (fetchParams, err = null) {
  24547. // 1. Assert: fetchParams is canceled.
  24548. assert(isCancelled(fetchParams))
  24549. // 2. Return an aborted network error if fetchParams is aborted;
  24550. // otherwise return a network error.
  24551. return isAborted(fetchParams)
  24552. ? makeNetworkError(Object.assign(new DOMException('The operation was aborted.', 'AbortError'), { cause: err }))
  24553. : makeNetworkError(Object.assign(new DOMException('Request was cancelled.'), { cause: err }))
  24554. }
  24555. // https://whatpr.org/fetch/1392.html#initialize-a-response
  24556. function initializeResponse (response, init, body) {
  24557. // 1. If init["status"] is not in the range 200 to 599, inclusive, then
  24558. // throw a RangeError.
  24559. if (init.status !== null && (init.status < 200 || init.status > 599)) {
  24560. throw new RangeError('init["status"] must be in the range of 200 to 599, inclusive.')
  24561. }
  24562. // 2. If init["statusText"] does not match the reason-phrase token production,
  24563. // then throw a TypeError.
  24564. if ('statusText' in init && init.statusText != null) {
  24565. // See, https://datatracker.ietf.org/doc/html/rfc7230#section-3.1.2:
  24566. // reason-phrase = *( HTAB / SP / VCHAR / obs-text )
  24567. if (!isValidReasonPhrase(String(init.statusText))) {
  24568. throw new TypeError('Invalid statusText')
  24569. }
  24570. }
  24571. // 3. Set response’s response’s status to init["status"].
  24572. if ('status' in init && init.status != null) {
  24573. response[kState].status = init.status
  24574. }
  24575. // 4. Set response’s response’s status message to init["statusText"].
  24576. if ('statusText' in init && init.statusText != null) {
  24577. response[kState].statusText = init.statusText
  24578. }
  24579. // 5. If init["headers"] exists, then fill response’s headers with init["headers"].
  24580. if ('headers' in init && init.headers != null) {
  24581. fill(response[kHeaders], init.headers)
  24582. }
  24583. // 6. If body was given, then:
  24584. if (body) {
  24585. // 1. If response's status is a null body status, then throw a TypeError.
  24586. if (nullBodyStatus.includes(response.status)) {
  24587. throw webidl.errors.exception({
  24588. header: 'Response constructor',
  24589. message: 'Invalid response status code ' + response.status
  24590. })
  24591. }
  24592. // 2. Set response's body to body's body.
  24593. response[kState].body = body.body
  24594. // 3. If body's type is non-null and response's header list does not contain
  24595. // `Content-Type`, then append (`Content-Type`, body's type) to response's header list.
  24596. if (body.type != null && !response[kState].headersList.contains('Content-Type')) {
  24597. response[kState].headersList.append('content-type', body.type)
  24598. }
  24599. }
  24600. }
  24601. webidl.converters.ReadableStream = webidl.interfaceConverter(
  24602. ReadableStream
  24603. )
  24604. webidl.converters.FormData = webidl.interfaceConverter(
  24605. FormData
  24606. )
  24607. webidl.converters.URLSearchParams = webidl.interfaceConverter(
  24608. URLSearchParams
  24609. )
  24610. // https://fetch.spec.whatwg.org/#typedefdef-xmlhttprequestbodyinit
  24611. webidl.converters.XMLHttpRequestBodyInit = function (V) {
  24612. if (typeof V === 'string') {
  24613. return webidl.converters.USVString(V)
  24614. }
  24615. if (isBlobLike(V)) {
  24616. return webidl.converters.Blob(V, { strict: false })
  24617. }
  24618. if (types.isArrayBuffer(V) || types.isTypedArray(V) || types.isDataView(V)) {
  24619. return webidl.converters.BufferSource(V)
  24620. }
  24621. if (util.isFormDataLike(V)) {
  24622. return webidl.converters.FormData(V, { strict: false })
  24623. }
  24624. if (V instanceof URLSearchParams) {
  24625. return webidl.converters.URLSearchParams(V)
  24626. }
  24627. return webidl.converters.DOMString(V)
  24628. }
  24629. // https://fetch.spec.whatwg.org/#bodyinit
  24630. webidl.converters.BodyInit = function (V) {
  24631. if (V instanceof ReadableStream) {
  24632. return webidl.converters.ReadableStream(V)
  24633. }
  24634. // Note: the spec doesn't include async iterables,
  24635. // this is an undici extension.
  24636. if (V?.[Symbol.asyncIterator]) {
  24637. return V
  24638. }
  24639. return webidl.converters.XMLHttpRequestBodyInit(V)
  24640. }
  24641. webidl.converters.ResponseInit = webidl.dictionaryConverter([
  24642. {
  24643. key: 'status',
  24644. converter: webidl.converters['unsigned short'],
  24645. defaultValue: 200
  24646. },
  24647. {
  24648. key: 'statusText',
  24649. converter: webidl.converters.ByteString,
  24650. defaultValue: ''
  24651. },
  24652. {
  24653. key: 'headers',
  24654. converter: webidl.converters.HeadersInit
  24655. }
  24656. ])
  24657. module.exports = {
  24658. makeNetworkError,
  24659. makeResponse,
  24660. makeAppropriateNetworkError,
  24661. filterResponse,
  24662. Response,
  24663. cloneResponse
  24664. }
  24665. /***/ }),
  24666. /***/ 5861:
  24667. /***/ ((module) => {
  24668. "use strict";
  24669. module.exports = {
  24670. kUrl: Symbol('url'),
  24671. kHeaders: Symbol('headers'),
  24672. kSignal: Symbol('signal'),
  24673. kState: Symbol('state'),
  24674. kGuard: Symbol('guard'),
  24675. kRealm: Symbol('realm')
  24676. }
  24677. /***/ }),
  24678. /***/ 2538:
  24679. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  24680. "use strict";
  24681. const { redirectStatusSet, referrerPolicySet: referrerPolicyTokens, badPortsSet } = __nccwpck_require__(1037)
  24682. const { getGlobalOrigin } = __nccwpck_require__(1246)
  24683. const { performance } = __nccwpck_require__(4074)
  24684. const { isBlobLike, toUSVString, ReadableStreamFrom } = __nccwpck_require__(3983)
  24685. const assert = __nccwpck_require__(9491)
  24686. const { isUint8Array } = __nccwpck_require__(9830)
  24687. let supportedHashes = []
  24688. // https://nodejs.org/api/crypto.html#determining-if-crypto-support-is-unavailable
  24689. /** @type {import('crypto')|undefined} */
  24690. let crypto
  24691. try {
  24692. crypto = __nccwpck_require__(6113)
  24693. const possibleRelevantHashes = ['sha256', 'sha384', 'sha512']
  24694. supportedHashes = crypto.getHashes().filter((hash) => possibleRelevantHashes.includes(hash))
  24695. /* c8 ignore next 3 */
  24696. } catch {
  24697. }
  24698. function responseURL (response) {
  24699. // https://fetch.spec.whatwg.org/#responses
  24700. // A response has an associated URL. It is a pointer to the last URL
  24701. // in response’s URL list and null if response’s URL list is empty.
  24702. const urlList = response.urlList
  24703. const length = urlList.length
  24704. return length === 0 ? null : urlList[length - 1].toString()
  24705. }
  24706. // https://fetch.spec.whatwg.org/#concept-response-location-url
  24707. function responseLocationURL (response, requestFragment) {
  24708. // 1. If response’s status is not a redirect status, then return null.
  24709. if (!redirectStatusSet.has(response.status)) {
  24710. return null
  24711. }
  24712. // 2. Let location be the result of extracting header list values given
  24713. // `Location` and response’s header list.
  24714. let location = response.headersList.get('location')
  24715. // 3. If location is a header value, then set location to the result of
  24716. // parsing location with response’s URL.
  24717. if (location !== null && isValidHeaderValue(location)) {
  24718. location = new URL(location, responseURL(response))
  24719. }
  24720. // 4. If location is a URL whose fragment is null, then set location’s
  24721. // fragment to requestFragment.
  24722. if (location && !location.hash) {
  24723. location.hash = requestFragment
  24724. }
  24725. // 5. Return location.
  24726. return location
  24727. }
  24728. /** @returns {URL} */
  24729. function requestCurrentURL (request) {
  24730. return request.urlList[request.urlList.length - 1]
  24731. }
  24732. function requestBadPort (request) {
  24733. // 1. Let url be request’s current URL.
  24734. const url = requestCurrentURL(request)
  24735. // 2. If url’s scheme is an HTTP(S) scheme and url’s port is a bad port,
  24736. // then return blocked.
  24737. if (urlIsHttpHttpsScheme(url) && badPortsSet.has(url.port)) {
  24738. return 'blocked'
  24739. }
  24740. // 3. Return allowed.
  24741. return 'allowed'
  24742. }
  24743. function isErrorLike (object) {
  24744. return object instanceof Error || (
  24745. object?.constructor?.name === 'Error' ||
  24746. object?.constructor?.name === 'DOMException'
  24747. )
  24748. }
  24749. // Check whether |statusText| is a ByteString and
  24750. // matches the Reason-Phrase token production.
  24751. // RFC 2616: https://tools.ietf.org/html/rfc2616
  24752. // RFC 7230: https://tools.ietf.org/html/rfc7230
  24753. // "reason-phrase = *( HTAB / SP / VCHAR / obs-text )"
  24754. // https://github.com/chromium/chromium/blob/94.0.4604.1/third_party/blink/renderer/core/fetch/response.cc#L116
  24755. function isValidReasonPhrase (statusText) {
  24756. for (let i = 0; i < statusText.length; ++i) {
  24757. const c = statusText.charCodeAt(i)
  24758. if (
  24759. !(
  24760. (
  24761. c === 0x09 || // HTAB
  24762. (c >= 0x20 && c <= 0x7e) || // SP / VCHAR
  24763. (c >= 0x80 && c <= 0xff)
  24764. ) // obs-text
  24765. )
  24766. ) {
  24767. return false
  24768. }
  24769. }
  24770. return true
  24771. }
  24772. /**
  24773. * @see https://tools.ietf.org/html/rfc7230#section-3.2.6
  24774. * @param {number} c
  24775. */
  24776. function isTokenCharCode (c) {
  24777. switch (c) {
  24778. case 0x22:
  24779. case 0x28:
  24780. case 0x29:
  24781. case 0x2c:
  24782. case 0x2f:
  24783. case 0x3a:
  24784. case 0x3b:
  24785. case 0x3c:
  24786. case 0x3d:
  24787. case 0x3e:
  24788. case 0x3f:
  24789. case 0x40:
  24790. case 0x5b:
  24791. case 0x5c:
  24792. case 0x5d:
  24793. case 0x7b:
  24794. case 0x7d:
  24795. // DQUOTE and "(),/:;<=>?@[\]{}"
  24796. return false
  24797. default:
  24798. // VCHAR %x21-7E
  24799. return c >= 0x21 && c <= 0x7e
  24800. }
  24801. }
  24802. /**
  24803. * @param {string} characters
  24804. */
  24805. function isValidHTTPToken (characters) {
  24806. if (characters.length === 0) {
  24807. return false
  24808. }
  24809. for (let i = 0; i < characters.length; ++i) {
  24810. if (!isTokenCharCode(characters.charCodeAt(i))) {
  24811. return false
  24812. }
  24813. }
  24814. return true
  24815. }
  24816. /**
  24817. * @see https://fetch.spec.whatwg.org/#header-name
  24818. * @param {string} potentialValue
  24819. */
  24820. function isValidHeaderName (potentialValue) {
  24821. return isValidHTTPToken(potentialValue)
  24822. }
  24823. /**
  24824. * @see https://fetch.spec.whatwg.org/#header-value
  24825. * @param {string} potentialValue
  24826. */
  24827. function isValidHeaderValue (potentialValue) {
  24828. // - Has no leading or trailing HTTP tab or space bytes.
  24829. // - Contains no 0x00 (NUL) or HTTP newline bytes.
  24830. if (
  24831. potentialValue.startsWith('\t') ||
  24832. potentialValue.startsWith(' ') ||
  24833. potentialValue.endsWith('\t') ||
  24834. potentialValue.endsWith(' ')
  24835. ) {
  24836. return false
  24837. }
  24838. if (
  24839. potentialValue.includes('\0') ||
  24840. potentialValue.includes('\r') ||
  24841. potentialValue.includes('\n')
  24842. ) {
  24843. return false
  24844. }
  24845. return true
  24846. }
  24847. // https://w3c.github.io/webappsec-referrer-policy/#set-requests-referrer-policy-on-redirect
  24848. function setRequestReferrerPolicyOnRedirect (request, actualResponse) {
  24849. // Given a request request and a response actualResponse, this algorithm
  24850. // updates request’s referrer policy according to the Referrer-Policy
  24851. // header (if any) in actualResponse.
  24852. // 1. Let policy be the result of executing § 8.1 Parse a referrer policy
  24853. // from a Referrer-Policy header on actualResponse.
  24854. // 8.1 Parse a referrer policy from a Referrer-Policy header
  24855. // 1. Let policy-tokens be the result of extracting header list values given `Referrer-Policy` and response’s header list.
  24856. const { headersList } = actualResponse
  24857. // 2. Let policy be the empty string.
  24858. // 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.
  24859. // 4. Return policy.
  24860. const policyHeader = (headersList.get('referrer-policy') ?? '').split(',')
  24861. // Note: As the referrer-policy can contain multiple policies
  24862. // separated by comma, we need to loop through all of them
  24863. // and pick the first valid one.
  24864. // Ref: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Referrer-Policy#specify_a_fallback_policy
  24865. let policy = ''
  24866. if (policyHeader.length > 0) {
  24867. // The right-most policy takes precedence.
  24868. // The left-most policy is the fallback.
  24869. for (let i = policyHeader.length; i !== 0; i--) {
  24870. const token = policyHeader[i - 1].trim()
  24871. if (referrerPolicyTokens.has(token)) {
  24872. policy = token
  24873. break
  24874. }
  24875. }
  24876. }
  24877. // 2. If policy is not the empty string, then set request’s referrer policy to policy.
  24878. if (policy !== '') {
  24879. request.referrerPolicy = policy
  24880. }
  24881. }
  24882. // https://fetch.spec.whatwg.org/#cross-origin-resource-policy-check
  24883. function crossOriginResourcePolicyCheck () {
  24884. // TODO
  24885. return 'allowed'
  24886. }
  24887. // https://fetch.spec.whatwg.org/#concept-cors-check
  24888. function corsCheck () {
  24889. // TODO
  24890. return 'success'
  24891. }
  24892. // https://fetch.spec.whatwg.org/#concept-tao-check
  24893. function TAOCheck () {
  24894. // TODO
  24895. return 'success'
  24896. }
  24897. function appendFetchMetadata (httpRequest) {
  24898. // https://w3c.github.io/webappsec-fetch-metadata/#sec-fetch-dest-header
  24899. // TODO
  24900. // https://w3c.github.io/webappsec-fetch-metadata/#sec-fetch-mode-header
  24901. // 1. Assert: r’s url is a potentially trustworthy URL.
  24902. // TODO
  24903. // 2. Let header be a Structured Header whose value is a token.
  24904. let header = null
  24905. // 3. Set header’s value to r’s mode.
  24906. header = httpRequest.mode
  24907. // 4. Set a structured field value `Sec-Fetch-Mode`/header in r’s header list.
  24908. httpRequest.headersList.set('sec-fetch-mode', header)
  24909. // https://w3c.github.io/webappsec-fetch-metadata/#sec-fetch-site-header
  24910. // TODO
  24911. // https://w3c.github.io/webappsec-fetch-metadata/#sec-fetch-user-header
  24912. // TODO
  24913. }
  24914. // https://fetch.spec.whatwg.org/#append-a-request-origin-header
  24915. function appendRequestOriginHeader (request) {
  24916. // 1. Let serializedOrigin be the result of byte-serializing a request origin with request.
  24917. let serializedOrigin = request.origin
  24918. // 2. If request’s response tainting is "cors" or request’s mode is "websocket", then append (`Origin`, serializedOrigin) to request’s header list.
  24919. if (request.responseTainting === 'cors' || request.mode === 'websocket') {
  24920. if (serializedOrigin) {
  24921. request.headersList.append('origin', serializedOrigin)
  24922. }
  24923. // 3. Otherwise, if request’s method is neither `GET` nor `HEAD`, then:
  24924. } else if (request.method !== 'GET' && request.method !== 'HEAD') {
  24925. // 1. Switch on request’s referrer policy:
  24926. switch (request.referrerPolicy) {
  24927. case 'no-referrer':
  24928. // Set serializedOrigin to `null`.
  24929. serializedOrigin = null
  24930. break
  24931. case 'no-referrer-when-downgrade':
  24932. case 'strict-origin':
  24933. case 'strict-origin-when-cross-origin':
  24934. // 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`.
  24935. if (request.origin && urlHasHttpsScheme(request.origin) && !urlHasHttpsScheme(requestCurrentURL(request))) {
  24936. serializedOrigin = null
  24937. }
  24938. break
  24939. case 'same-origin':
  24940. // If request’s origin is not same origin with request’s current URL’s origin, then set serializedOrigin to `null`.
  24941. if (!sameOrigin(request, requestCurrentURL(request))) {
  24942. serializedOrigin = null
  24943. }
  24944. break
  24945. default:
  24946. // Do nothing.
  24947. }
  24948. if (serializedOrigin) {
  24949. // 2. Append (`Origin`, serializedOrigin) to request’s header list.
  24950. request.headersList.append('origin', serializedOrigin)
  24951. }
  24952. }
  24953. }
  24954. function coarsenedSharedCurrentTime (crossOriginIsolatedCapability) {
  24955. // TODO
  24956. return performance.now()
  24957. }
  24958. // https://fetch.spec.whatwg.org/#create-an-opaque-timing-info
  24959. function createOpaqueTimingInfo (timingInfo) {
  24960. return {
  24961. startTime: timingInfo.startTime ?? 0,
  24962. redirectStartTime: 0,
  24963. redirectEndTime: 0,
  24964. postRedirectStartTime: timingInfo.startTime ?? 0,
  24965. finalServiceWorkerStartTime: 0,
  24966. finalNetworkResponseStartTime: 0,
  24967. finalNetworkRequestStartTime: 0,
  24968. endTime: 0,
  24969. encodedBodySize: 0,
  24970. decodedBodySize: 0,
  24971. finalConnectionTimingInfo: null
  24972. }
  24973. }
  24974. // https://html.spec.whatwg.org/multipage/origin.html#policy-container
  24975. function makePolicyContainer () {
  24976. // Note: the fetch spec doesn't make use of embedder policy or CSP list
  24977. return {
  24978. referrerPolicy: 'strict-origin-when-cross-origin'
  24979. }
  24980. }
  24981. // https://html.spec.whatwg.org/multipage/origin.html#clone-a-policy-container
  24982. function clonePolicyContainer (policyContainer) {
  24983. return {
  24984. referrerPolicy: policyContainer.referrerPolicy
  24985. }
  24986. }
  24987. // https://w3c.github.io/webappsec-referrer-policy/#determine-requests-referrer
  24988. function determineRequestsReferrer (request) {
  24989. // 1. Let policy be request's referrer policy.
  24990. const policy = request.referrerPolicy
  24991. // Note: policy cannot (shouldn't) be null or an empty string.
  24992. assert(policy)
  24993. // 2. Let environment be request’s client.
  24994. let referrerSource = null
  24995. // 3. Switch on request’s referrer:
  24996. if (request.referrer === 'client') {
  24997. // Note: node isn't a browser and doesn't implement document/iframes,
  24998. // so we bypass this step and replace it with our own.
  24999. const globalOrigin = getGlobalOrigin()
  25000. if (!globalOrigin || globalOrigin.origin === 'null') {
  25001. return 'no-referrer'
  25002. }
  25003. // note: we need to clone it as it's mutated
  25004. referrerSource = new URL(globalOrigin)
  25005. } else if (request.referrer instanceof URL) {
  25006. // Let referrerSource be request’s referrer.
  25007. referrerSource = request.referrer
  25008. }
  25009. // 4. Let request’s referrerURL be the result of stripping referrerSource for
  25010. // use as a referrer.
  25011. let referrerURL = stripURLForReferrer(referrerSource)
  25012. // 5. Let referrerOrigin be the result of stripping referrerSource for use as
  25013. // a referrer, with the origin-only flag set to true.
  25014. const referrerOrigin = stripURLForReferrer(referrerSource, true)
  25015. // 6. If the result of serializing referrerURL is a string whose length is
  25016. // greater than 4096, set referrerURL to referrerOrigin.
  25017. if (referrerURL.toString().length > 4096) {
  25018. referrerURL = referrerOrigin
  25019. }
  25020. const areSameOrigin = sameOrigin(request, referrerURL)
  25021. const isNonPotentiallyTrustWorthy = isURLPotentiallyTrustworthy(referrerURL) &&
  25022. !isURLPotentiallyTrustworthy(request.url)
  25023. // 8. Execute the switch statements corresponding to the value of policy:
  25024. switch (policy) {
  25025. case 'origin': return referrerOrigin != null ? referrerOrigin : stripURLForReferrer(referrerSource, true)
  25026. case 'unsafe-url': return referrerURL
  25027. case 'same-origin':
  25028. return areSameOrigin ? referrerOrigin : 'no-referrer'
  25029. case 'origin-when-cross-origin':
  25030. return areSameOrigin ? referrerURL : referrerOrigin
  25031. case 'strict-origin-when-cross-origin': {
  25032. const currentURL = requestCurrentURL(request)
  25033. // 1. If the origin of referrerURL and the origin of request’s current
  25034. // URL are the same, then return referrerURL.
  25035. if (sameOrigin(referrerURL, currentURL)) {
  25036. return referrerURL
  25037. }
  25038. // 2. If referrerURL is a potentially trustworthy URL and request’s
  25039. // current URL is not a potentially trustworthy URL, then return no
  25040. // referrer.
  25041. if (isURLPotentiallyTrustworthy(referrerURL) && !isURLPotentiallyTrustworthy(currentURL)) {
  25042. return 'no-referrer'
  25043. }
  25044. // 3. Return referrerOrigin.
  25045. return referrerOrigin
  25046. }
  25047. case 'strict-origin': // eslint-disable-line
  25048. /**
  25049. * 1. If referrerURL is a potentially trustworthy URL and
  25050. * request’s current URL is not a potentially trustworthy URL,
  25051. * then return no referrer.
  25052. * 2. Return referrerOrigin
  25053. */
  25054. case 'no-referrer-when-downgrade': // eslint-disable-line
  25055. /**
  25056. * 1. If referrerURL is a potentially trustworthy URL and
  25057. * request’s current URL is not a potentially trustworthy URL,
  25058. * then return no referrer.
  25059. * 2. Return referrerOrigin
  25060. */
  25061. default: // eslint-disable-line
  25062. return isNonPotentiallyTrustWorthy ? 'no-referrer' : referrerOrigin
  25063. }
  25064. }
  25065. /**
  25066. * @see https://w3c.github.io/webappsec-referrer-policy/#strip-url
  25067. * @param {URL} url
  25068. * @param {boolean|undefined} originOnly
  25069. */
  25070. function stripURLForReferrer (url, originOnly) {
  25071. // 1. Assert: url is a URL.
  25072. assert(url instanceof URL)
  25073. // 2. If url’s scheme is a local scheme, then return no referrer.
  25074. if (url.protocol === 'file:' || url.protocol === 'about:' || url.protocol === 'blank:') {
  25075. return 'no-referrer'
  25076. }
  25077. // 3. Set url’s username to the empty string.
  25078. url.username = ''
  25079. // 4. Set url’s password to the empty string.
  25080. url.password = ''
  25081. // 5. Set url’s fragment to null.
  25082. url.hash = ''
  25083. // 6. If the origin-only flag is true, then:
  25084. if (originOnly) {
  25085. // 1. Set url’s path to « the empty string ».
  25086. url.pathname = ''
  25087. // 2. Set url’s query to null.
  25088. url.search = ''
  25089. }
  25090. // 7. Return url.
  25091. return url
  25092. }
  25093. function isURLPotentiallyTrustworthy (url) {
  25094. if (!(url instanceof URL)) {
  25095. return false
  25096. }
  25097. // If child of about, return true
  25098. if (url.href === 'about:blank' || url.href === 'about:srcdoc') {
  25099. return true
  25100. }
  25101. // If scheme is data, return true
  25102. if (url.protocol === 'data:') return true
  25103. // If file, return true
  25104. if (url.protocol === 'file:') return true
  25105. return isOriginPotentiallyTrustworthy(url.origin)
  25106. function isOriginPotentiallyTrustworthy (origin) {
  25107. // If origin is explicitly null, return false
  25108. if (origin == null || origin === 'null') return false
  25109. const originAsURL = new URL(origin)
  25110. // If secure, return true
  25111. if (originAsURL.protocol === 'https:' || originAsURL.protocol === 'wss:') {
  25112. return true
  25113. }
  25114. // If localhost or variants, return true
  25115. if (/^127(?:\.[0-9]+){0,2}\.[0-9]+$|^\[(?:0*:)*?:?0*1\]$/.test(originAsURL.hostname) ||
  25116. (originAsURL.hostname === 'localhost' || originAsURL.hostname.includes('localhost.')) ||
  25117. (originAsURL.hostname.endsWith('.localhost'))) {
  25118. return true
  25119. }
  25120. // If any other, return false
  25121. return false
  25122. }
  25123. }
  25124. /**
  25125. * @see https://w3c.github.io/webappsec-subresource-integrity/#does-response-match-metadatalist
  25126. * @param {Uint8Array} bytes
  25127. * @param {string} metadataList
  25128. */
  25129. function bytesMatch (bytes, metadataList) {
  25130. // If node is not built with OpenSSL support, we cannot check
  25131. // a request's integrity, so allow it by default (the spec will
  25132. // allow requests if an invalid hash is given, as precedence).
  25133. /* istanbul ignore if: only if node is built with --without-ssl */
  25134. if (crypto === undefined) {
  25135. return true
  25136. }
  25137. // 1. Let parsedMetadata be the result of parsing metadataList.
  25138. const parsedMetadata = parseMetadata(metadataList)
  25139. // 2. If parsedMetadata is no metadata, return true.
  25140. if (parsedMetadata === 'no metadata') {
  25141. return true
  25142. }
  25143. // 3. If response is not eligible for integrity validation, return false.
  25144. // TODO
  25145. // 4. If parsedMetadata is the empty set, return true.
  25146. if (parsedMetadata.length === 0) {
  25147. return true
  25148. }
  25149. // 5. Let metadata be the result of getting the strongest
  25150. // metadata from parsedMetadata.
  25151. const strongest = getStrongestMetadata(parsedMetadata)
  25152. const metadata = filterMetadataListByAlgorithm(parsedMetadata, strongest)
  25153. // 6. For each item in metadata:
  25154. for (const item of metadata) {
  25155. // 1. Let algorithm be the alg component of item.
  25156. const algorithm = item.algo
  25157. // 2. Let expectedValue be the val component of item.
  25158. const expectedValue = item.hash
  25159. // See https://github.com/web-platform-tests/wpt/commit/e4c5cc7a5e48093220528dfdd1c4012dc3837a0e
  25160. // "be liberal with padding". This is annoying, and it's not even in the spec.
  25161. // 3. Let actualValue be the result of applying algorithm to bytes.
  25162. let actualValue = crypto.createHash(algorithm).update(bytes).digest('base64')
  25163. if (actualValue[actualValue.length - 1] === '=') {
  25164. if (actualValue[actualValue.length - 2] === '=') {
  25165. actualValue = actualValue.slice(0, -2)
  25166. } else {
  25167. actualValue = actualValue.slice(0, -1)
  25168. }
  25169. }
  25170. // 4. If actualValue is a case-sensitive match for expectedValue,
  25171. // return true.
  25172. if (compareBase64Mixed(actualValue, expectedValue)) {
  25173. return true
  25174. }
  25175. }
  25176. // 7. Return false.
  25177. return false
  25178. }
  25179. // https://w3c.github.io/webappsec-subresource-integrity/#grammardef-hash-with-options
  25180. // https://www.w3.org/TR/CSP2/#source-list-syntax
  25181. // https://www.rfc-editor.org/rfc/rfc5234#appendix-B.1
  25182. const parseHashWithOptions = /(?<algo>sha256|sha384|sha512)-((?<hash>[A-Za-z0-9+/]+|[A-Za-z0-9_-]+)={0,2}(?:\s|$)( +[!-~]*)?)?/i
  25183. /**
  25184. * @see https://w3c.github.io/webappsec-subresource-integrity/#parse-metadata
  25185. * @param {string} metadata
  25186. */
  25187. function parseMetadata (metadata) {
  25188. // 1. Let result be the empty set.
  25189. /** @type {{ algo: string, hash: string }[]} */
  25190. const result = []
  25191. // 2. Let empty be equal to true.
  25192. let empty = true
  25193. // 3. For each token returned by splitting metadata on spaces:
  25194. for (const token of metadata.split(' ')) {
  25195. // 1. Set empty to false.
  25196. empty = false
  25197. // 2. Parse token as a hash-with-options.
  25198. const parsedToken = parseHashWithOptions.exec(token)
  25199. // 3. If token does not parse, continue to the next token.
  25200. if (
  25201. parsedToken === null ||
  25202. parsedToken.groups === undefined ||
  25203. parsedToken.groups.algo === undefined
  25204. ) {
  25205. // Note: Chromium blocks the request at this point, but Firefox
  25206. // gives a warning that an invalid integrity was given. The
  25207. // correct behavior is to ignore these, and subsequently not
  25208. // check the integrity of the resource.
  25209. continue
  25210. }
  25211. // 4. Let algorithm be the hash-algo component of token.
  25212. const algorithm = parsedToken.groups.algo.toLowerCase()
  25213. // 5. If algorithm is a hash function recognized by the user
  25214. // agent, add the parsed token to result.
  25215. if (supportedHashes.includes(algorithm)) {
  25216. result.push(parsedToken.groups)
  25217. }
  25218. }
  25219. // 4. Return no metadata if empty is true, otherwise return result.
  25220. if (empty === true) {
  25221. return 'no metadata'
  25222. }
  25223. return result
  25224. }
  25225. /**
  25226. * @param {{ algo: 'sha256' | 'sha384' | 'sha512' }[]} metadataList
  25227. */
  25228. function getStrongestMetadata (metadataList) {
  25229. // Let algorithm be the algo component of the first item in metadataList.
  25230. // Can be sha256
  25231. let algorithm = metadataList[0].algo
  25232. // If the algorithm is sha512, then it is the strongest
  25233. // and we can return immediately
  25234. if (algorithm[3] === '5') {
  25235. return algorithm
  25236. }
  25237. for (let i = 1; i < metadataList.length; ++i) {
  25238. const metadata = metadataList[i]
  25239. // If the algorithm is sha512, then it is the strongest
  25240. // and we can break the loop immediately
  25241. if (metadata.algo[3] === '5') {
  25242. algorithm = 'sha512'
  25243. break
  25244. // If the algorithm is sha384, then a potential sha256 or sha384 is ignored
  25245. } else if (algorithm[3] === '3') {
  25246. continue
  25247. // algorithm is sha256, check if algorithm is sha384 and if so, set it as
  25248. // the strongest
  25249. } else if (metadata.algo[3] === '3') {
  25250. algorithm = 'sha384'
  25251. }
  25252. }
  25253. return algorithm
  25254. }
  25255. function filterMetadataListByAlgorithm (metadataList, algorithm) {
  25256. if (metadataList.length === 1) {
  25257. return metadataList
  25258. }
  25259. let pos = 0
  25260. for (let i = 0; i < metadataList.length; ++i) {
  25261. if (metadataList[i].algo === algorithm) {
  25262. metadataList[pos++] = metadataList[i]
  25263. }
  25264. }
  25265. metadataList.length = pos
  25266. return metadataList
  25267. }
  25268. /**
  25269. * Compares two base64 strings, allowing for base64url
  25270. * in the second string.
  25271. *
  25272. * @param {string} actualValue always base64
  25273. * @param {string} expectedValue base64 or base64url
  25274. * @returns {boolean}
  25275. */
  25276. function compareBase64Mixed (actualValue, expectedValue) {
  25277. if (actualValue.length !== expectedValue.length) {
  25278. return false
  25279. }
  25280. for (let i = 0; i < actualValue.length; ++i) {
  25281. if (actualValue[i] !== expectedValue[i]) {
  25282. if (
  25283. (actualValue[i] === '+' && expectedValue[i] === '-') ||
  25284. (actualValue[i] === '/' && expectedValue[i] === '_')
  25285. ) {
  25286. continue
  25287. }
  25288. return false
  25289. }
  25290. }
  25291. return true
  25292. }
  25293. // https://w3c.github.io/webappsec-upgrade-insecure-requests/#upgrade-request
  25294. function tryUpgradeRequestToAPotentiallyTrustworthyURL (request) {
  25295. // TODO
  25296. }
  25297. /**
  25298. * @link {https://html.spec.whatwg.org/multipage/origin.html#same-origin}
  25299. * @param {URL} A
  25300. * @param {URL} B
  25301. */
  25302. function sameOrigin (A, B) {
  25303. // 1. If A and B are the same opaque origin, then return true.
  25304. if (A.origin === B.origin && A.origin === 'null') {
  25305. return true
  25306. }
  25307. // 2. If A and B are both tuple origins and their schemes,
  25308. // hosts, and port are identical, then return true.
  25309. if (A.protocol === B.protocol && A.hostname === B.hostname && A.port === B.port) {
  25310. return true
  25311. }
  25312. // 3. Return false.
  25313. return false
  25314. }
  25315. function createDeferredPromise () {
  25316. let res
  25317. let rej
  25318. const promise = new Promise((resolve, reject) => {
  25319. res = resolve
  25320. rej = reject
  25321. })
  25322. return { promise, resolve: res, reject: rej }
  25323. }
  25324. function isAborted (fetchParams) {
  25325. return fetchParams.controller.state === 'aborted'
  25326. }
  25327. function isCancelled (fetchParams) {
  25328. return fetchParams.controller.state === 'aborted' ||
  25329. fetchParams.controller.state === 'terminated'
  25330. }
  25331. const normalizeMethodRecord = {
  25332. delete: 'DELETE',
  25333. DELETE: 'DELETE',
  25334. get: 'GET',
  25335. GET: 'GET',
  25336. head: 'HEAD',
  25337. HEAD: 'HEAD',
  25338. options: 'OPTIONS',
  25339. OPTIONS: 'OPTIONS',
  25340. post: 'POST',
  25341. POST: 'POST',
  25342. put: 'PUT',
  25343. PUT: 'PUT'
  25344. }
  25345. // Note: object prototypes should not be able to be referenced. e.g. `Object#hasOwnProperty`.
  25346. Object.setPrototypeOf(normalizeMethodRecord, null)
  25347. /**
  25348. * @see https://fetch.spec.whatwg.org/#concept-method-normalize
  25349. * @param {string} method
  25350. */
  25351. function normalizeMethod (method) {
  25352. return normalizeMethodRecord[method.toLowerCase()] ?? method
  25353. }
  25354. // https://infra.spec.whatwg.org/#serialize-a-javascript-value-to-a-json-string
  25355. function serializeJavascriptValueToJSONString (value) {
  25356. // 1. Let result be ? Call(%JSON.stringify%, undefined, « value »).
  25357. const result = JSON.stringify(value)
  25358. // 2. If result is undefined, then throw a TypeError.
  25359. if (result === undefined) {
  25360. throw new TypeError('Value is not JSON serializable')
  25361. }
  25362. // 3. Assert: result is a string.
  25363. assert(typeof result === 'string')
  25364. // 4. Return result.
  25365. return result
  25366. }
  25367. // https://tc39.es/ecma262/#sec-%25iteratorprototype%25-object
  25368. const esIteratorPrototype = Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]()))
  25369. /**
  25370. * @see https://webidl.spec.whatwg.org/#dfn-iterator-prototype-object
  25371. * @param {() => unknown[]} iterator
  25372. * @param {string} name name of the instance
  25373. * @param {'key'|'value'|'key+value'} kind
  25374. */
  25375. function makeIterator (iterator, name, kind) {
  25376. const object = {
  25377. index: 0,
  25378. kind,
  25379. target: iterator
  25380. }
  25381. const i = {
  25382. next () {
  25383. // 1. Let interface be the interface for which the iterator prototype object exists.
  25384. // 2. Let thisValue be the this value.
  25385. // 3. Let object be ? ToObject(thisValue).
  25386. // 4. If object is a platform object, then perform a security
  25387. // check, passing:
  25388. // 5. If object is not a default iterator object for interface,
  25389. // then throw a TypeError.
  25390. if (Object.getPrototypeOf(this) !== i) {
  25391. throw new TypeError(
  25392. `'next' called on an object that does not implement interface ${name} Iterator.`
  25393. )
  25394. }
  25395. // 6. Let index be object’s index.
  25396. // 7. Let kind be object’s kind.
  25397. // 8. Let values be object’s target's value pairs to iterate over.
  25398. const { index, kind, target } = object
  25399. const values = target()
  25400. // 9. Let len be the length of values.
  25401. const len = values.length
  25402. // 10. If index is greater than or equal to len, then return
  25403. // CreateIterResultObject(undefined, true).
  25404. if (index >= len) {
  25405. return { value: undefined, done: true }
  25406. }
  25407. // 11. Let pair be the entry in values at index index.
  25408. const pair = values[index]
  25409. // 12. Set object’s index to index + 1.
  25410. object.index = index + 1
  25411. // 13. Return the iterator result for pair and kind.
  25412. return iteratorResult(pair, kind)
  25413. },
  25414. // The class string of an iterator prototype object for a given interface is the
  25415. // result of concatenating the identifier of the interface and the string " Iterator".
  25416. [Symbol.toStringTag]: `${name} Iterator`
  25417. }
  25418. // The [[Prototype]] internal slot of an iterator prototype object must be %IteratorPrototype%.
  25419. Object.setPrototypeOf(i, esIteratorPrototype)
  25420. // esIteratorPrototype needs to be the prototype of i
  25421. // which is the prototype of an empty object. Yes, it's confusing.
  25422. return Object.setPrototypeOf({}, i)
  25423. }
  25424. // https://webidl.spec.whatwg.org/#iterator-result
  25425. function iteratorResult (pair, kind) {
  25426. let result
  25427. // 1. Let result be a value determined by the value of kind:
  25428. switch (kind) {
  25429. case 'key': {
  25430. // 1. Let idlKey be pair’s key.
  25431. // 2. Let key be the result of converting idlKey to an
  25432. // ECMAScript value.
  25433. // 3. result is key.
  25434. result = pair[0]
  25435. break
  25436. }
  25437. case 'value': {
  25438. // 1. Let idlValue be pair’s value.
  25439. // 2. Let value be the result of converting idlValue to
  25440. // an ECMAScript value.
  25441. // 3. result is value.
  25442. result = pair[1]
  25443. break
  25444. }
  25445. case 'key+value': {
  25446. // 1. Let idlKey be pair’s key.
  25447. // 2. Let idlValue be pair’s value.
  25448. // 3. Let key be the result of converting idlKey to an
  25449. // ECMAScript value.
  25450. // 4. Let value be the result of converting idlValue to
  25451. // an ECMAScript value.
  25452. // 5. Let array be ! ArrayCreate(2).
  25453. // 6. Call ! CreateDataProperty(array, "0", key).
  25454. // 7. Call ! CreateDataProperty(array, "1", value).
  25455. // 8. result is array.
  25456. result = pair
  25457. break
  25458. }
  25459. }
  25460. // 2. Return CreateIterResultObject(result, false).
  25461. return { value: result, done: false }
  25462. }
  25463. /**
  25464. * @see https://fetch.spec.whatwg.org/#body-fully-read
  25465. */
  25466. async function fullyReadBody (body, processBody, processBodyError) {
  25467. // 1. If taskDestination is null, then set taskDestination to
  25468. // the result of starting a new parallel queue.
  25469. // 2. Let successSteps given a byte sequence bytes be to queue a
  25470. // fetch task to run processBody given bytes, with taskDestination.
  25471. const successSteps = processBody
  25472. // 3. Let errorSteps be to queue a fetch task to run processBodyError,
  25473. // with taskDestination.
  25474. const errorSteps = processBodyError
  25475. // 4. Let reader be the result of getting a reader for body’s stream.
  25476. // If that threw an exception, then run errorSteps with that
  25477. // exception and return.
  25478. let reader
  25479. try {
  25480. reader = body.stream.getReader()
  25481. } catch (e) {
  25482. errorSteps(e)
  25483. return
  25484. }
  25485. // 5. Read all bytes from reader, given successSteps and errorSteps.
  25486. try {
  25487. const result = await readAllBytes(reader)
  25488. successSteps(result)
  25489. } catch (e) {
  25490. errorSteps(e)
  25491. }
  25492. }
  25493. /** @type {ReadableStream} */
  25494. let ReadableStream = globalThis.ReadableStream
  25495. function isReadableStreamLike (stream) {
  25496. if (!ReadableStream) {
  25497. ReadableStream = (__nccwpck_require__(5356).ReadableStream)
  25498. }
  25499. return stream instanceof ReadableStream || (
  25500. stream[Symbol.toStringTag] === 'ReadableStream' &&
  25501. typeof stream.tee === 'function'
  25502. )
  25503. }
  25504. const MAXIMUM_ARGUMENT_LENGTH = 65535
  25505. /**
  25506. * @see https://infra.spec.whatwg.org/#isomorphic-decode
  25507. * @param {number[]|Uint8Array} input
  25508. */
  25509. function isomorphicDecode (input) {
  25510. // 1. To isomorphic decode a byte sequence input, return a string whose code point
  25511. // length is equal to input’s length and whose code points have the same values
  25512. // as the values of input’s bytes, in the same order.
  25513. if (input.length < MAXIMUM_ARGUMENT_LENGTH) {
  25514. return String.fromCharCode(...input)
  25515. }
  25516. return input.reduce((previous, current) => previous + String.fromCharCode(current), '')
  25517. }
  25518. /**
  25519. * @param {ReadableStreamController<Uint8Array>} controller
  25520. */
  25521. function readableStreamClose (controller) {
  25522. try {
  25523. controller.close()
  25524. } catch (err) {
  25525. // TODO: add comment explaining why this error occurs.
  25526. if (!err.message.includes('Controller is already closed')) {
  25527. throw err
  25528. }
  25529. }
  25530. }
  25531. /**
  25532. * @see https://infra.spec.whatwg.org/#isomorphic-encode
  25533. * @param {string} input
  25534. */
  25535. function isomorphicEncode (input) {
  25536. // 1. Assert: input contains no code points greater than U+00FF.
  25537. for (let i = 0; i < input.length; i++) {
  25538. assert(input.charCodeAt(i) <= 0xFF)
  25539. }
  25540. // 2. Return a byte sequence whose length is equal to input’s code
  25541. // point length and whose bytes have the same values as the
  25542. // values of input’s code points, in the same order
  25543. return input
  25544. }
  25545. /**
  25546. * @see https://streams.spec.whatwg.org/#readablestreamdefaultreader-read-all-bytes
  25547. * @see https://streams.spec.whatwg.org/#read-loop
  25548. * @param {ReadableStreamDefaultReader} reader
  25549. */
  25550. async function readAllBytes (reader) {
  25551. const bytes = []
  25552. let byteLength = 0
  25553. while (true) {
  25554. const { done, value: chunk } = await reader.read()
  25555. if (done) {
  25556. // 1. Call successSteps with bytes.
  25557. return Buffer.concat(bytes, byteLength)
  25558. }
  25559. // 1. If chunk is not a Uint8Array object, call failureSteps
  25560. // with a TypeError and abort these steps.
  25561. if (!isUint8Array(chunk)) {
  25562. throw new TypeError('Received non-Uint8Array chunk')
  25563. }
  25564. // 2. Append the bytes represented by chunk to bytes.
  25565. bytes.push(chunk)
  25566. byteLength += chunk.length
  25567. // 3. Read-loop given reader, bytes, successSteps, and failureSteps.
  25568. }
  25569. }
  25570. /**
  25571. * @see https://fetch.spec.whatwg.org/#is-local
  25572. * @param {URL} url
  25573. */
  25574. function urlIsLocal (url) {
  25575. assert('protocol' in url) // ensure it's a url object
  25576. const protocol = url.protocol
  25577. return protocol === 'about:' || protocol === 'blob:' || protocol === 'data:'
  25578. }
  25579. /**
  25580. * @param {string|URL} url
  25581. */
  25582. function urlHasHttpsScheme (url) {
  25583. if (typeof url === 'string') {
  25584. return url.startsWith('https:')
  25585. }
  25586. return url.protocol === 'https:'
  25587. }
  25588. /**
  25589. * @see https://fetch.spec.whatwg.org/#http-scheme
  25590. * @param {URL} url
  25591. */
  25592. function urlIsHttpHttpsScheme (url) {
  25593. assert('protocol' in url) // ensure it's a url object
  25594. const protocol = url.protocol
  25595. return protocol === 'http:' || protocol === 'https:'
  25596. }
  25597. /**
  25598. * Fetch supports node >= 16.8.0, but Object.hasOwn was added in v16.9.0.
  25599. */
  25600. const hasOwn = Object.hasOwn || ((dict, key) => Object.prototype.hasOwnProperty.call(dict, key))
  25601. module.exports = {
  25602. isAborted,
  25603. isCancelled,
  25604. createDeferredPromise,
  25605. ReadableStreamFrom,
  25606. toUSVString,
  25607. tryUpgradeRequestToAPotentiallyTrustworthyURL,
  25608. coarsenedSharedCurrentTime,
  25609. determineRequestsReferrer,
  25610. makePolicyContainer,
  25611. clonePolicyContainer,
  25612. appendFetchMetadata,
  25613. appendRequestOriginHeader,
  25614. TAOCheck,
  25615. corsCheck,
  25616. crossOriginResourcePolicyCheck,
  25617. createOpaqueTimingInfo,
  25618. setRequestReferrerPolicyOnRedirect,
  25619. isValidHTTPToken,
  25620. requestBadPort,
  25621. requestCurrentURL,
  25622. responseURL,
  25623. responseLocationURL,
  25624. isBlobLike,
  25625. isURLPotentiallyTrustworthy,
  25626. isValidReasonPhrase,
  25627. sameOrigin,
  25628. normalizeMethod,
  25629. serializeJavascriptValueToJSONString,
  25630. makeIterator,
  25631. isValidHeaderName,
  25632. isValidHeaderValue,
  25633. hasOwn,
  25634. isErrorLike,
  25635. fullyReadBody,
  25636. bytesMatch,
  25637. isReadableStreamLike,
  25638. readableStreamClose,
  25639. isomorphicEncode,
  25640. isomorphicDecode,
  25641. urlIsLocal,
  25642. urlHasHttpsScheme,
  25643. urlIsHttpHttpsScheme,
  25644. readAllBytes,
  25645. normalizeMethodRecord,
  25646. parseMetadata
  25647. }
  25648. /***/ }),
  25649. /***/ 1744:
  25650. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  25651. "use strict";
  25652. const { types } = __nccwpck_require__(3837)
  25653. const { hasOwn, toUSVString } = __nccwpck_require__(2538)
  25654. /** @type {import('../../types/webidl').Webidl} */
  25655. const webidl = {}
  25656. webidl.converters = {}
  25657. webidl.util = {}
  25658. webidl.errors = {}
  25659. webidl.errors.exception = function (message) {
  25660. return new TypeError(`${message.header}: ${message.message}`)
  25661. }
  25662. webidl.errors.conversionFailed = function (context) {
  25663. const plural = context.types.length === 1 ? '' : ' one of'
  25664. const message =
  25665. `${context.argument} could not be converted to` +
  25666. `${plural}: ${context.types.join(', ')}.`
  25667. return webidl.errors.exception({
  25668. header: context.prefix,
  25669. message
  25670. })
  25671. }
  25672. webidl.errors.invalidArgument = function (context) {
  25673. return webidl.errors.exception({
  25674. header: context.prefix,
  25675. message: `"${context.value}" is an invalid ${context.type}.`
  25676. })
  25677. }
  25678. // https://webidl.spec.whatwg.org/#implements
  25679. webidl.brandCheck = function (V, I, opts = undefined) {
  25680. if (opts?.strict !== false && !(V instanceof I)) {
  25681. throw new TypeError('Illegal invocation')
  25682. } else {
  25683. return V?.[Symbol.toStringTag] === I.prototype[Symbol.toStringTag]
  25684. }
  25685. }
  25686. webidl.argumentLengthCheck = function ({ length }, min, ctx) {
  25687. if (length < min) {
  25688. throw webidl.errors.exception({
  25689. message: `${min} argument${min !== 1 ? 's' : ''} required, ` +
  25690. `but${length ? ' only' : ''} ${length} found.`,
  25691. ...ctx
  25692. })
  25693. }
  25694. }
  25695. webidl.illegalConstructor = function () {
  25696. throw webidl.errors.exception({
  25697. header: 'TypeError',
  25698. message: 'Illegal constructor'
  25699. })
  25700. }
  25701. // https://tc39.es/ecma262/#sec-ecmascript-data-types-and-values
  25702. webidl.util.Type = function (V) {
  25703. switch (typeof V) {
  25704. case 'undefined': return 'Undefined'
  25705. case 'boolean': return 'Boolean'
  25706. case 'string': return 'String'
  25707. case 'symbol': return 'Symbol'
  25708. case 'number': return 'Number'
  25709. case 'bigint': return 'BigInt'
  25710. case 'function':
  25711. case 'object': {
  25712. if (V === null) {
  25713. return 'Null'
  25714. }
  25715. return 'Object'
  25716. }
  25717. }
  25718. }
  25719. // https://webidl.spec.whatwg.org/#abstract-opdef-converttoint
  25720. webidl.util.ConvertToInt = function (V, bitLength, signedness, opts = {}) {
  25721. let upperBound
  25722. let lowerBound
  25723. // 1. If bitLength is 64, then:
  25724. if (bitLength === 64) {
  25725. // 1. Let upperBound be 2^53 − 1.
  25726. upperBound = Math.pow(2, 53) - 1
  25727. // 2. If signedness is "unsigned", then let lowerBound be 0.
  25728. if (signedness === 'unsigned') {
  25729. lowerBound = 0
  25730. } else {
  25731. // 3. Otherwise let lowerBound be −2^53 + 1.
  25732. lowerBound = Math.pow(-2, 53) + 1
  25733. }
  25734. } else if (signedness === 'unsigned') {
  25735. // 2. Otherwise, if signedness is "unsigned", then:
  25736. // 1. Let lowerBound be 0.
  25737. lowerBound = 0
  25738. // 2. Let upperBound be 2^bitLength − 1.
  25739. upperBound = Math.pow(2, bitLength) - 1
  25740. } else {
  25741. // 3. Otherwise:
  25742. // 1. Let lowerBound be -2^bitLength − 1.
  25743. lowerBound = Math.pow(-2, bitLength) - 1
  25744. // 2. Let upperBound be 2^bitLength − 1 − 1.
  25745. upperBound = Math.pow(2, bitLength - 1) - 1
  25746. }
  25747. // 4. Let x be ? ToNumber(V).
  25748. let x = Number(V)
  25749. // 5. If x is −0, then set x to +0.
  25750. if (x === 0) {
  25751. x = 0
  25752. }
  25753. // 6. If the conversion is to an IDL type associated
  25754. // with the [EnforceRange] extended attribute, then:
  25755. if (opts.enforceRange === true) {
  25756. // 1. If x is NaN, +∞, or −∞, then throw a TypeError.
  25757. if (
  25758. Number.isNaN(x) ||
  25759. x === Number.POSITIVE_INFINITY ||
  25760. x === Number.NEGATIVE_INFINITY
  25761. ) {
  25762. throw webidl.errors.exception({
  25763. header: 'Integer conversion',
  25764. message: `Could not convert ${V} to an integer.`
  25765. })
  25766. }
  25767. // 2. Set x to IntegerPart(x).
  25768. x = webidl.util.IntegerPart(x)
  25769. // 3. If x < lowerBound or x > upperBound, then
  25770. // throw a TypeError.
  25771. if (x < lowerBound || x > upperBound) {
  25772. throw webidl.errors.exception({
  25773. header: 'Integer conversion',
  25774. message: `Value must be between ${lowerBound}-${upperBound}, got ${x}.`
  25775. })
  25776. }
  25777. // 4. Return x.
  25778. return x
  25779. }
  25780. // 7. If x is not NaN and the conversion is to an IDL
  25781. // type associated with the [Clamp] extended
  25782. // attribute, then:
  25783. if (!Number.isNaN(x) && opts.clamp === true) {
  25784. // 1. Set x to min(max(x, lowerBound), upperBound).
  25785. x = Math.min(Math.max(x, lowerBound), upperBound)
  25786. // 2. Round x to the nearest integer, choosing the
  25787. // even integer if it lies halfway between two,
  25788. // and choosing +0 rather than −0.
  25789. if (Math.floor(x) % 2 === 0) {
  25790. x = Math.floor(x)
  25791. } else {
  25792. x = Math.ceil(x)
  25793. }
  25794. // 3. Return x.
  25795. return x
  25796. }
  25797. // 8. If x is NaN, +0, +∞, or −∞, then return +0.
  25798. if (
  25799. Number.isNaN(x) ||
  25800. (x === 0 && Object.is(0, x)) ||
  25801. x === Number.POSITIVE_INFINITY ||
  25802. x === Number.NEGATIVE_INFINITY
  25803. ) {
  25804. return 0
  25805. }
  25806. // 9. Set x to IntegerPart(x).
  25807. x = webidl.util.IntegerPart(x)
  25808. // 10. Set x to x modulo 2^bitLength.
  25809. x = x % Math.pow(2, bitLength)
  25810. // 11. If signedness is "signed" and x ≥ 2^bitLength − 1,
  25811. // then return x − 2^bitLength.
  25812. if (signedness === 'signed' && x >= Math.pow(2, bitLength) - 1) {
  25813. return x - Math.pow(2, bitLength)
  25814. }
  25815. // 12. Otherwise, return x.
  25816. return x
  25817. }
  25818. // https://webidl.spec.whatwg.org/#abstract-opdef-integerpart
  25819. webidl.util.IntegerPart = function (n) {
  25820. // 1. Let r be floor(abs(n)).
  25821. const r = Math.floor(Math.abs(n))
  25822. // 2. If n < 0, then return -1 × r.
  25823. if (n < 0) {
  25824. return -1 * r
  25825. }
  25826. // 3. Otherwise, return r.
  25827. return r
  25828. }
  25829. // https://webidl.spec.whatwg.org/#es-sequence
  25830. webidl.sequenceConverter = function (converter) {
  25831. return (V) => {
  25832. // 1. If Type(V) is not Object, throw a TypeError.
  25833. if (webidl.util.Type(V) !== 'Object') {
  25834. throw webidl.errors.exception({
  25835. header: 'Sequence',
  25836. message: `Value of type ${webidl.util.Type(V)} is not an Object.`
  25837. })
  25838. }
  25839. // 2. Let method be ? GetMethod(V, @@iterator).
  25840. /** @type {Generator} */
  25841. const method = V?.[Symbol.iterator]?.()
  25842. const seq = []
  25843. // 3. If method is undefined, throw a TypeError.
  25844. if (
  25845. method === undefined ||
  25846. typeof method.next !== 'function'
  25847. ) {
  25848. throw webidl.errors.exception({
  25849. header: 'Sequence',
  25850. message: 'Object is not an iterator.'
  25851. })
  25852. }
  25853. // https://webidl.spec.whatwg.org/#create-sequence-from-iterable
  25854. while (true) {
  25855. const { done, value } = method.next()
  25856. if (done) {
  25857. break
  25858. }
  25859. seq.push(converter(value))
  25860. }
  25861. return seq
  25862. }
  25863. }
  25864. // https://webidl.spec.whatwg.org/#es-to-record
  25865. webidl.recordConverter = function (keyConverter, valueConverter) {
  25866. return (O) => {
  25867. // 1. If Type(O) is not Object, throw a TypeError.
  25868. if (webidl.util.Type(O) !== 'Object') {
  25869. throw webidl.errors.exception({
  25870. header: 'Record',
  25871. message: `Value of type ${webidl.util.Type(O)} is not an Object.`
  25872. })
  25873. }
  25874. // 2. Let result be a new empty instance of record<K, V>.
  25875. const result = {}
  25876. if (!types.isProxy(O)) {
  25877. // Object.keys only returns enumerable properties
  25878. const keys = Object.keys(O)
  25879. for (const key of keys) {
  25880. // 1. Let typedKey be key converted to an IDL value of type K.
  25881. const typedKey = keyConverter(key)
  25882. // 2. Let value be ? Get(O, key).
  25883. // 3. Let typedValue be value converted to an IDL value of type V.
  25884. const typedValue = valueConverter(O[key])
  25885. // 4. Set result[typedKey] to typedValue.
  25886. result[typedKey] = typedValue
  25887. }
  25888. // 5. Return result.
  25889. return result
  25890. }
  25891. // 3. Let keys be ? O.[[OwnPropertyKeys]]().
  25892. const keys = Reflect.ownKeys(O)
  25893. // 4. For each key of keys.
  25894. for (const key of keys) {
  25895. // 1. Let desc be ? O.[[GetOwnProperty]](key).
  25896. const desc = Reflect.getOwnPropertyDescriptor(O, key)
  25897. // 2. If desc is not undefined and desc.[[Enumerable]] is true:
  25898. if (desc?.enumerable) {
  25899. // 1. Let typedKey be key converted to an IDL value of type K.
  25900. const typedKey = keyConverter(key)
  25901. // 2. Let value be ? Get(O, key).
  25902. // 3. Let typedValue be value converted to an IDL value of type V.
  25903. const typedValue = valueConverter(O[key])
  25904. // 4. Set result[typedKey] to typedValue.
  25905. result[typedKey] = typedValue
  25906. }
  25907. }
  25908. // 5. Return result.
  25909. return result
  25910. }
  25911. }
  25912. webidl.interfaceConverter = function (i) {
  25913. return (V, opts = {}) => {
  25914. if (opts.strict !== false && !(V instanceof i)) {
  25915. throw webidl.errors.exception({
  25916. header: i.name,
  25917. message: `Expected ${V} to be an instance of ${i.name}.`
  25918. })
  25919. }
  25920. return V
  25921. }
  25922. }
  25923. webidl.dictionaryConverter = function (converters) {
  25924. return (dictionary) => {
  25925. const type = webidl.util.Type(dictionary)
  25926. const dict = {}
  25927. if (type === 'Null' || type === 'Undefined') {
  25928. return dict
  25929. } else if (type !== 'Object') {
  25930. throw webidl.errors.exception({
  25931. header: 'Dictionary',
  25932. message: `Expected ${dictionary} to be one of: Null, Undefined, Object.`
  25933. })
  25934. }
  25935. for (const options of converters) {
  25936. const { key, defaultValue, required, converter } = options
  25937. if (required === true) {
  25938. if (!hasOwn(dictionary, key)) {
  25939. throw webidl.errors.exception({
  25940. header: 'Dictionary',
  25941. message: `Missing required key "${key}".`
  25942. })
  25943. }
  25944. }
  25945. let value = dictionary[key]
  25946. const hasDefault = hasOwn(options, 'defaultValue')
  25947. // Only use defaultValue if value is undefined and
  25948. // a defaultValue options was provided.
  25949. if (hasDefault && value !== null) {
  25950. value = value ?? defaultValue
  25951. }
  25952. // A key can be optional and have no default value.
  25953. // When this happens, do not perform a conversion,
  25954. // and do not assign the key a value.
  25955. if (required || hasDefault || value !== undefined) {
  25956. value = converter(value)
  25957. if (
  25958. options.allowedValues &&
  25959. !options.allowedValues.includes(value)
  25960. ) {
  25961. throw webidl.errors.exception({
  25962. header: 'Dictionary',
  25963. message: `${value} is not an accepted type. Expected one of ${options.allowedValues.join(', ')}.`
  25964. })
  25965. }
  25966. dict[key] = value
  25967. }
  25968. }
  25969. return dict
  25970. }
  25971. }
  25972. webidl.nullableConverter = function (converter) {
  25973. return (V) => {
  25974. if (V === null) {
  25975. return V
  25976. }
  25977. return converter(V)
  25978. }
  25979. }
  25980. // https://webidl.spec.whatwg.org/#es-DOMString
  25981. webidl.converters.DOMString = function (V, opts = {}) {
  25982. // 1. If V is null and the conversion is to an IDL type
  25983. // associated with the [LegacyNullToEmptyString]
  25984. // extended attribute, then return the DOMString value
  25985. // that represents the empty string.
  25986. if (V === null && opts.legacyNullToEmptyString) {
  25987. return ''
  25988. }
  25989. // 2. Let x be ? ToString(V).
  25990. if (typeof V === 'symbol') {
  25991. throw new TypeError('Could not convert argument of type symbol to string.')
  25992. }
  25993. // 3. Return the IDL DOMString value that represents the
  25994. // same sequence of code units as the one the
  25995. // ECMAScript String value x represents.
  25996. return String(V)
  25997. }
  25998. // https://webidl.spec.whatwg.org/#es-ByteString
  25999. webidl.converters.ByteString = function (V) {
  26000. // 1. Let x be ? ToString(V).
  26001. // Note: DOMString converter perform ? ToString(V)
  26002. const x = webidl.converters.DOMString(V)
  26003. // 2. If the value of any element of x is greater than
  26004. // 255, then throw a TypeError.
  26005. for (let index = 0; index < x.length; index++) {
  26006. if (x.charCodeAt(index) > 255) {
  26007. throw new TypeError(
  26008. 'Cannot convert argument to a ByteString because the character at ' +
  26009. `index ${index} has a value of ${x.charCodeAt(index)} which is greater than 255.`
  26010. )
  26011. }
  26012. }
  26013. // 3. Return an IDL ByteString value whose length is the
  26014. // length of x, and where the value of each element is
  26015. // the value of the corresponding element of x.
  26016. return x
  26017. }
  26018. // https://webidl.spec.whatwg.org/#es-USVString
  26019. webidl.converters.USVString = toUSVString
  26020. // https://webidl.spec.whatwg.org/#es-boolean
  26021. webidl.converters.boolean = function (V) {
  26022. // 1. Let x be the result of computing ToBoolean(V).
  26023. const x = Boolean(V)
  26024. // 2. Return the IDL boolean value that is the one that represents
  26025. // the same truth value as the ECMAScript Boolean value x.
  26026. return x
  26027. }
  26028. // https://webidl.spec.whatwg.org/#es-any
  26029. webidl.converters.any = function (V) {
  26030. return V
  26031. }
  26032. // https://webidl.spec.whatwg.org/#es-long-long
  26033. webidl.converters['long long'] = function (V) {
  26034. // 1. Let x be ? ConvertToInt(V, 64, "signed").
  26035. const x = webidl.util.ConvertToInt(V, 64, 'signed')
  26036. // 2. Return the IDL long long value that represents
  26037. // the same numeric value as x.
  26038. return x
  26039. }
  26040. // https://webidl.spec.whatwg.org/#es-unsigned-long-long
  26041. webidl.converters['unsigned long long'] = function (V) {
  26042. // 1. Let x be ? ConvertToInt(V, 64, "unsigned").
  26043. const x = webidl.util.ConvertToInt(V, 64, 'unsigned')
  26044. // 2. Return the IDL unsigned long long value that
  26045. // represents the same numeric value as x.
  26046. return x
  26047. }
  26048. // https://webidl.spec.whatwg.org/#es-unsigned-long
  26049. webidl.converters['unsigned long'] = function (V) {
  26050. // 1. Let x be ? ConvertToInt(V, 32, "unsigned").
  26051. const x = webidl.util.ConvertToInt(V, 32, 'unsigned')
  26052. // 2. Return the IDL unsigned long value that
  26053. // represents the same numeric value as x.
  26054. return x
  26055. }
  26056. // https://webidl.spec.whatwg.org/#es-unsigned-short
  26057. webidl.converters['unsigned short'] = function (V, opts) {
  26058. // 1. Let x be ? ConvertToInt(V, 16, "unsigned").
  26059. const x = webidl.util.ConvertToInt(V, 16, 'unsigned', opts)
  26060. // 2. Return the IDL unsigned short value that represents
  26061. // the same numeric value as x.
  26062. return x
  26063. }
  26064. // https://webidl.spec.whatwg.org/#idl-ArrayBuffer
  26065. webidl.converters.ArrayBuffer = function (V, opts = {}) {
  26066. // 1. If Type(V) is not Object, or V does not have an
  26067. // [[ArrayBufferData]] internal slot, then throw a
  26068. // TypeError.
  26069. // see: https://tc39.es/ecma262/#sec-properties-of-the-arraybuffer-instances
  26070. // see: https://tc39.es/ecma262/#sec-properties-of-the-sharedarraybuffer-instances
  26071. if (
  26072. webidl.util.Type(V) !== 'Object' ||
  26073. !types.isAnyArrayBuffer(V)
  26074. ) {
  26075. throw webidl.errors.conversionFailed({
  26076. prefix: `${V}`,
  26077. argument: `${V}`,
  26078. types: ['ArrayBuffer']
  26079. })
  26080. }
  26081. // 2. If the conversion is not to an IDL type associated
  26082. // with the [AllowShared] extended attribute, and
  26083. // IsSharedArrayBuffer(V) is true, then throw a
  26084. // TypeError.
  26085. if (opts.allowShared === false && types.isSharedArrayBuffer(V)) {
  26086. throw webidl.errors.exception({
  26087. header: 'ArrayBuffer',
  26088. message: 'SharedArrayBuffer is not allowed.'
  26089. })
  26090. }
  26091. // 3. If the conversion is not to an IDL type associated
  26092. // with the [AllowResizable] extended attribute, and
  26093. // IsResizableArrayBuffer(V) is true, then throw a
  26094. // TypeError.
  26095. // Note: resizable ArrayBuffers are currently a proposal.
  26096. // 4. Return the IDL ArrayBuffer value that is a
  26097. // reference to the same object as V.
  26098. return V
  26099. }
  26100. webidl.converters.TypedArray = function (V, T, opts = {}) {
  26101. // 1. Let T be the IDL type V is being converted to.
  26102. // 2. If Type(V) is not Object, or V does not have a
  26103. // [[TypedArrayName]] internal slot with a value
  26104. // equal to T’s name, then throw a TypeError.
  26105. if (
  26106. webidl.util.Type(V) !== 'Object' ||
  26107. !types.isTypedArray(V) ||
  26108. V.constructor.name !== T.name
  26109. ) {
  26110. throw webidl.errors.conversionFailed({
  26111. prefix: `${T.name}`,
  26112. argument: `${V}`,
  26113. types: [T.name]
  26114. })
  26115. }
  26116. // 3. If the conversion is not to an IDL type associated
  26117. // with the [AllowShared] extended attribute, and
  26118. // IsSharedArrayBuffer(V.[[ViewedArrayBuffer]]) is
  26119. // true, then throw a TypeError.
  26120. if (opts.allowShared === false && types.isSharedArrayBuffer(V.buffer)) {
  26121. throw webidl.errors.exception({
  26122. header: 'ArrayBuffer',
  26123. message: 'SharedArrayBuffer is not allowed.'
  26124. })
  26125. }
  26126. // 4. If the conversion is not to an IDL type associated
  26127. // with the [AllowResizable] extended attribute, and
  26128. // IsResizableArrayBuffer(V.[[ViewedArrayBuffer]]) is
  26129. // true, then throw a TypeError.
  26130. // Note: resizable array buffers are currently a proposal
  26131. // 5. Return the IDL value of type T that is a reference
  26132. // to the same object as V.
  26133. return V
  26134. }
  26135. webidl.converters.DataView = function (V, opts = {}) {
  26136. // 1. If Type(V) is not Object, or V does not have a
  26137. // [[DataView]] internal slot, then throw a TypeError.
  26138. if (webidl.util.Type(V) !== 'Object' || !types.isDataView(V)) {
  26139. throw webidl.errors.exception({
  26140. header: 'DataView',
  26141. message: 'Object is not a DataView.'
  26142. })
  26143. }
  26144. // 2. If the conversion is not to an IDL type associated
  26145. // with the [AllowShared] extended attribute, and
  26146. // IsSharedArrayBuffer(V.[[ViewedArrayBuffer]]) is true,
  26147. // then throw a TypeError.
  26148. if (opts.allowShared === false && types.isSharedArrayBuffer(V.buffer)) {
  26149. throw webidl.errors.exception({
  26150. header: 'ArrayBuffer',
  26151. message: 'SharedArrayBuffer is not allowed.'
  26152. })
  26153. }
  26154. // 3. If the conversion is not to an IDL type associated
  26155. // with the [AllowResizable] extended attribute, and
  26156. // IsResizableArrayBuffer(V.[[ViewedArrayBuffer]]) is
  26157. // true, then throw a TypeError.
  26158. // Note: resizable ArrayBuffers are currently a proposal
  26159. // 4. Return the IDL DataView value that is a reference
  26160. // to the same object as V.
  26161. return V
  26162. }
  26163. // https://webidl.spec.whatwg.org/#BufferSource
  26164. webidl.converters.BufferSource = function (V, opts = {}) {
  26165. if (types.isAnyArrayBuffer(V)) {
  26166. return webidl.converters.ArrayBuffer(V, opts)
  26167. }
  26168. if (types.isTypedArray(V)) {
  26169. return webidl.converters.TypedArray(V, V.constructor)
  26170. }
  26171. if (types.isDataView(V)) {
  26172. return webidl.converters.DataView(V, opts)
  26173. }
  26174. throw new TypeError(`Could not convert ${V} to a BufferSource.`)
  26175. }
  26176. webidl.converters['sequence<ByteString>'] = webidl.sequenceConverter(
  26177. webidl.converters.ByteString
  26178. )
  26179. webidl.converters['sequence<sequence<ByteString>>'] = webidl.sequenceConverter(
  26180. webidl.converters['sequence<ByteString>']
  26181. )
  26182. webidl.converters['record<ByteString, ByteString>'] = webidl.recordConverter(
  26183. webidl.converters.ByteString,
  26184. webidl.converters.ByteString
  26185. )
  26186. module.exports = {
  26187. webidl
  26188. }
  26189. /***/ }),
  26190. /***/ 4854:
  26191. /***/ ((module) => {
  26192. "use strict";
  26193. /**
  26194. * @see https://encoding.spec.whatwg.org/#concept-encoding-get
  26195. * @param {string|undefined} label
  26196. */
  26197. function getEncoding (label) {
  26198. if (!label) {
  26199. return 'failure'
  26200. }
  26201. // 1. Remove any leading and trailing ASCII whitespace from label.
  26202. // 2. If label is an ASCII case-insensitive match for any of the
  26203. // labels listed in the table below, then return the
  26204. // corresponding encoding; otherwise return failure.
  26205. switch (label.trim().toLowerCase()) {
  26206. case 'unicode-1-1-utf-8':
  26207. case 'unicode11utf8':
  26208. case 'unicode20utf8':
  26209. case 'utf-8':
  26210. case 'utf8':
  26211. case 'x-unicode20utf8':
  26212. return 'UTF-8'
  26213. case '866':
  26214. case 'cp866':
  26215. case 'csibm866':
  26216. case 'ibm866':
  26217. return 'IBM866'
  26218. case 'csisolatin2':
  26219. case 'iso-8859-2':
  26220. case 'iso-ir-101':
  26221. case 'iso8859-2':
  26222. case 'iso88592':
  26223. case 'iso_8859-2':
  26224. case 'iso_8859-2:1987':
  26225. case 'l2':
  26226. case 'latin2':
  26227. return 'ISO-8859-2'
  26228. case 'csisolatin3':
  26229. case 'iso-8859-3':
  26230. case 'iso-ir-109':
  26231. case 'iso8859-3':
  26232. case 'iso88593':
  26233. case 'iso_8859-3':
  26234. case 'iso_8859-3:1988':
  26235. case 'l3':
  26236. case 'latin3':
  26237. return 'ISO-8859-3'
  26238. case 'csisolatin4':
  26239. case 'iso-8859-4':
  26240. case 'iso-ir-110':
  26241. case 'iso8859-4':
  26242. case 'iso88594':
  26243. case 'iso_8859-4':
  26244. case 'iso_8859-4:1988':
  26245. case 'l4':
  26246. case 'latin4':
  26247. return 'ISO-8859-4'
  26248. case 'csisolatincyrillic':
  26249. case 'cyrillic':
  26250. case 'iso-8859-5':
  26251. case 'iso-ir-144':
  26252. case 'iso8859-5':
  26253. case 'iso88595':
  26254. case 'iso_8859-5':
  26255. case 'iso_8859-5:1988':
  26256. return 'ISO-8859-5'
  26257. case 'arabic':
  26258. case 'asmo-708':
  26259. case 'csiso88596e':
  26260. case 'csiso88596i':
  26261. case 'csisolatinarabic':
  26262. case 'ecma-114':
  26263. case 'iso-8859-6':
  26264. case 'iso-8859-6-e':
  26265. case 'iso-8859-6-i':
  26266. case 'iso-ir-127':
  26267. case 'iso8859-6':
  26268. case 'iso88596':
  26269. case 'iso_8859-6':
  26270. case 'iso_8859-6:1987':
  26271. return 'ISO-8859-6'
  26272. case 'csisolatingreek':
  26273. case 'ecma-118':
  26274. case 'elot_928':
  26275. case 'greek':
  26276. case 'greek8':
  26277. case 'iso-8859-7':
  26278. case 'iso-ir-126':
  26279. case 'iso8859-7':
  26280. case 'iso88597':
  26281. case 'iso_8859-7':
  26282. case 'iso_8859-7:1987':
  26283. case 'sun_eu_greek':
  26284. return 'ISO-8859-7'
  26285. case 'csiso88598e':
  26286. case 'csisolatinhebrew':
  26287. case 'hebrew':
  26288. case 'iso-8859-8':
  26289. case 'iso-8859-8-e':
  26290. case 'iso-ir-138':
  26291. case 'iso8859-8':
  26292. case 'iso88598':
  26293. case 'iso_8859-8':
  26294. case 'iso_8859-8:1988':
  26295. case 'visual':
  26296. return 'ISO-8859-8'
  26297. case 'csiso88598i':
  26298. case 'iso-8859-8-i':
  26299. case 'logical':
  26300. return 'ISO-8859-8-I'
  26301. case 'csisolatin6':
  26302. case 'iso-8859-10':
  26303. case 'iso-ir-157':
  26304. case 'iso8859-10':
  26305. case 'iso885910':
  26306. case 'l6':
  26307. case 'latin6':
  26308. return 'ISO-8859-10'
  26309. case 'iso-8859-13':
  26310. case 'iso8859-13':
  26311. case 'iso885913':
  26312. return 'ISO-8859-13'
  26313. case 'iso-8859-14':
  26314. case 'iso8859-14':
  26315. case 'iso885914':
  26316. return 'ISO-8859-14'
  26317. case 'csisolatin9':
  26318. case 'iso-8859-15':
  26319. case 'iso8859-15':
  26320. case 'iso885915':
  26321. case 'iso_8859-15':
  26322. case 'l9':
  26323. return 'ISO-8859-15'
  26324. case 'iso-8859-16':
  26325. return 'ISO-8859-16'
  26326. case 'cskoi8r':
  26327. case 'koi':
  26328. case 'koi8':
  26329. case 'koi8-r':
  26330. case 'koi8_r':
  26331. return 'KOI8-R'
  26332. case 'koi8-ru':
  26333. case 'koi8-u':
  26334. return 'KOI8-U'
  26335. case 'csmacintosh':
  26336. case 'mac':
  26337. case 'macintosh':
  26338. case 'x-mac-roman':
  26339. return 'macintosh'
  26340. case 'iso-8859-11':
  26341. case 'iso8859-11':
  26342. case 'iso885911':
  26343. case 'tis-620':
  26344. case 'windows-874':
  26345. return 'windows-874'
  26346. case 'cp1250':
  26347. case 'windows-1250':
  26348. case 'x-cp1250':
  26349. return 'windows-1250'
  26350. case 'cp1251':
  26351. case 'windows-1251':
  26352. case 'x-cp1251':
  26353. return 'windows-1251'
  26354. case 'ansi_x3.4-1968':
  26355. case 'ascii':
  26356. case 'cp1252':
  26357. case 'cp819':
  26358. case 'csisolatin1':
  26359. case 'ibm819':
  26360. case 'iso-8859-1':
  26361. case 'iso-ir-100':
  26362. case 'iso8859-1':
  26363. case 'iso88591':
  26364. case 'iso_8859-1':
  26365. case 'iso_8859-1:1987':
  26366. case 'l1':
  26367. case 'latin1':
  26368. case 'us-ascii':
  26369. case 'windows-1252':
  26370. case 'x-cp1252':
  26371. return 'windows-1252'
  26372. case 'cp1253':
  26373. case 'windows-1253':
  26374. case 'x-cp1253':
  26375. return 'windows-1253'
  26376. case 'cp1254':
  26377. case 'csisolatin5':
  26378. case 'iso-8859-9':
  26379. case 'iso-ir-148':
  26380. case 'iso8859-9':
  26381. case 'iso88599':
  26382. case 'iso_8859-9':
  26383. case 'iso_8859-9:1989':
  26384. case 'l5':
  26385. case 'latin5':
  26386. case 'windows-1254':
  26387. case 'x-cp1254':
  26388. return 'windows-1254'
  26389. case 'cp1255':
  26390. case 'windows-1255':
  26391. case 'x-cp1255':
  26392. return 'windows-1255'
  26393. case 'cp1256':
  26394. case 'windows-1256':
  26395. case 'x-cp1256':
  26396. return 'windows-1256'
  26397. case 'cp1257':
  26398. case 'windows-1257':
  26399. case 'x-cp1257':
  26400. return 'windows-1257'
  26401. case 'cp1258':
  26402. case 'windows-1258':
  26403. case 'x-cp1258':
  26404. return 'windows-1258'
  26405. case 'x-mac-cyrillic':
  26406. case 'x-mac-ukrainian':
  26407. return 'x-mac-cyrillic'
  26408. case 'chinese':
  26409. case 'csgb2312':
  26410. case 'csiso58gb231280':
  26411. case 'gb2312':
  26412. case 'gb_2312':
  26413. case 'gb_2312-80':
  26414. case 'gbk':
  26415. case 'iso-ir-58':
  26416. case 'x-gbk':
  26417. return 'GBK'
  26418. case 'gb18030':
  26419. return 'gb18030'
  26420. case 'big5':
  26421. case 'big5-hkscs':
  26422. case 'cn-big5':
  26423. case 'csbig5':
  26424. case 'x-x-big5':
  26425. return 'Big5'
  26426. case 'cseucpkdfmtjapanese':
  26427. case 'euc-jp':
  26428. case 'x-euc-jp':
  26429. return 'EUC-JP'
  26430. case 'csiso2022jp':
  26431. case 'iso-2022-jp':
  26432. return 'ISO-2022-JP'
  26433. case 'csshiftjis':
  26434. case 'ms932':
  26435. case 'ms_kanji':
  26436. case 'shift-jis':
  26437. case 'shift_jis':
  26438. case 'sjis':
  26439. case 'windows-31j':
  26440. case 'x-sjis':
  26441. return 'Shift_JIS'
  26442. case 'cseuckr':
  26443. case 'csksc56011987':
  26444. case 'euc-kr':
  26445. case 'iso-ir-149':
  26446. case 'korean':
  26447. case 'ks_c_5601-1987':
  26448. case 'ks_c_5601-1989':
  26449. case 'ksc5601':
  26450. case 'ksc_5601':
  26451. case 'windows-949':
  26452. return 'EUC-KR'
  26453. case 'csiso2022kr':
  26454. case 'hz-gb-2312':
  26455. case 'iso-2022-cn':
  26456. case 'iso-2022-cn-ext':
  26457. case 'iso-2022-kr':
  26458. case 'replacement':
  26459. return 'replacement'
  26460. case 'unicodefffe':
  26461. case 'utf-16be':
  26462. return 'UTF-16BE'
  26463. case 'csunicode':
  26464. case 'iso-10646-ucs-2':
  26465. case 'ucs-2':
  26466. case 'unicode':
  26467. case 'unicodefeff':
  26468. case 'utf-16':
  26469. case 'utf-16le':
  26470. return 'UTF-16LE'
  26471. case 'x-user-defined':
  26472. return 'x-user-defined'
  26473. default: return 'failure'
  26474. }
  26475. }
  26476. module.exports = {
  26477. getEncoding
  26478. }
  26479. /***/ }),
  26480. /***/ 1446:
  26481. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  26482. "use strict";
  26483. const {
  26484. staticPropertyDescriptors,
  26485. readOperation,
  26486. fireAProgressEvent
  26487. } = __nccwpck_require__(7530)
  26488. const {
  26489. kState,
  26490. kError,
  26491. kResult,
  26492. kEvents,
  26493. kAborted
  26494. } = __nccwpck_require__(9054)
  26495. const { webidl } = __nccwpck_require__(1744)
  26496. const { kEnumerableProperty } = __nccwpck_require__(3983)
  26497. class FileReader extends EventTarget {
  26498. constructor () {
  26499. super()
  26500. this[kState] = 'empty'
  26501. this[kResult] = null
  26502. this[kError] = null
  26503. this[kEvents] = {
  26504. loadend: null,
  26505. error: null,
  26506. abort: null,
  26507. load: null,
  26508. progress: null,
  26509. loadstart: null
  26510. }
  26511. }
  26512. /**
  26513. * @see https://w3c.github.io/FileAPI/#dfn-readAsArrayBuffer
  26514. * @param {import('buffer').Blob} blob
  26515. */
  26516. readAsArrayBuffer (blob) {
  26517. webidl.brandCheck(this, FileReader)
  26518. webidl.argumentLengthCheck(arguments, 1, { header: 'FileReader.readAsArrayBuffer' })
  26519. blob = webidl.converters.Blob(blob, { strict: false })
  26520. // The readAsArrayBuffer(blob) method, when invoked,
  26521. // must initiate a read operation for blob with ArrayBuffer.
  26522. readOperation(this, blob, 'ArrayBuffer')
  26523. }
  26524. /**
  26525. * @see https://w3c.github.io/FileAPI/#readAsBinaryString
  26526. * @param {import('buffer').Blob} blob
  26527. */
  26528. readAsBinaryString (blob) {
  26529. webidl.brandCheck(this, FileReader)
  26530. webidl.argumentLengthCheck(arguments, 1, { header: 'FileReader.readAsBinaryString' })
  26531. blob = webidl.converters.Blob(blob, { strict: false })
  26532. // The readAsBinaryString(blob) method, when invoked,
  26533. // must initiate a read operation for blob with BinaryString.
  26534. readOperation(this, blob, 'BinaryString')
  26535. }
  26536. /**
  26537. * @see https://w3c.github.io/FileAPI/#readAsDataText
  26538. * @param {import('buffer').Blob} blob
  26539. * @param {string?} encoding
  26540. */
  26541. readAsText (blob, encoding = undefined) {
  26542. webidl.brandCheck(this, FileReader)
  26543. webidl.argumentLengthCheck(arguments, 1, { header: 'FileReader.readAsText' })
  26544. blob = webidl.converters.Blob(blob, { strict: false })
  26545. if (encoding !== undefined) {
  26546. encoding = webidl.converters.DOMString(encoding)
  26547. }
  26548. // The readAsText(blob, encoding) method, when invoked,
  26549. // must initiate a read operation for blob with Text and encoding.
  26550. readOperation(this, blob, 'Text', encoding)
  26551. }
  26552. /**
  26553. * @see https://w3c.github.io/FileAPI/#dfn-readAsDataURL
  26554. * @param {import('buffer').Blob} blob
  26555. */
  26556. readAsDataURL (blob) {
  26557. webidl.brandCheck(this, FileReader)
  26558. webidl.argumentLengthCheck(arguments, 1, { header: 'FileReader.readAsDataURL' })
  26559. blob = webidl.converters.Blob(blob, { strict: false })
  26560. // The readAsDataURL(blob) method, when invoked, must
  26561. // initiate a read operation for blob with DataURL.
  26562. readOperation(this, blob, 'DataURL')
  26563. }
  26564. /**
  26565. * @see https://w3c.github.io/FileAPI/#dfn-abort
  26566. */
  26567. abort () {
  26568. // 1. If this's state is "empty" or if this's state is
  26569. // "done" set this's result to null and terminate
  26570. // this algorithm.
  26571. if (this[kState] === 'empty' || this[kState] === 'done') {
  26572. this[kResult] = null
  26573. return
  26574. }
  26575. // 2. If this's state is "loading" set this's state to
  26576. // "done" and set this's result to null.
  26577. if (this[kState] === 'loading') {
  26578. this[kState] = 'done'
  26579. this[kResult] = null
  26580. }
  26581. // 3. If there are any tasks from this on the file reading
  26582. // task source in an affiliated task queue, then remove
  26583. // those tasks from that task queue.
  26584. this[kAborted] = true
  26585. // 4. Terminate the algorithm for the read method being processed.
  26586. // TODO
  26587. // 5. Fire a progress event called abort at this.
  26588. fireAProgressEvent('abort', this)
  26589. // 6. If this's state is not "loading", fire a progress
  26590. // event called loadend at this.
  26591. if (this[kState] !== 'loading') {
  26592. fireAProgressEvent('loadend', this)
  26593. }
  26594. }
  26595. /**
  26596. * @see https://w3c.github.io/FileAPI/#dom-filereader-readystate
  26597. */
  26598. get readyState () {
  26599. webidl.brandCheck(this, FileReader)
  26600. switch (this[kState]) {
  26601. case 'empty': return this.EMPTY
  26602. case 'loading': return this.LOADING
  26603. case 'done': return this.DONE
  26604. }
  26605. }
  26606. /**
  26607. * @see https://w3c.github.io/FileAPI/#dom-filereader-result
  26608. */
  26609. get result () {
  26610. webidl.brandCheck(this, FileReader)
  26611. // The result attribute’s getter, when invoked, must return
  26612. // this's result.
  26613. return this[kResult]
  26614. }
  26615. /**
  26616. * @see https://w3c.github.io/FileAPI/#dom-filereader-error
  26617. */
  26618. get error () {
  26619. webidl.brandCheck(this, FileReader)
  26620. // The error attribute’s getter, when invoked, must return
  26621. // this's error.
  26622. return this[kError]
  26623. }
  26624. get onloadend () {
  26625. webidl.brandCheck(this, FileReader)
  26626. return this[kEvents].loadend
  26627. }
  26628. set onloadend (fn) {
  26629. webidl.brandCheck(this, FileReader)
  26630. if (this[kEvents].loadend) {
  26631. this.removeEventListener('loadend', this[kEvents].loadend)
  26632. }
  26633. if (typeof fn === 'function') {
  26634. this[kEvents].loadend = fn
  26635. this.addEventListener('loadend', fn)
  26636. } else {
  26637. this[kEvents].loadend = null
  26638. }
  26639. }
  26640. get onerror () {
  26641. webidl.brandCheck(this, FileReader)
  26642. return this[kEvents].error
  26643. }
  26644. set onerror (fn) {
  26645. webidl.brandCheck(this, FileReader)
  26646. if (this[kEvents].error) {
  26647. this.removeEventListener('error', this[kEvents].error)
  26648. }
  26649. if (typeof fn === 'function') {
  26650. this[kEvents].error = fn
  26651. this.addEventListener('error', fn)
  26652. } else {
  26653. this[kEvents].error = null
  26654. }
  26655. }
  26656. get onloadstart () {
  26657. webidl.brandCheck(this, FileReader)
  26658. return this[kEvents].loadstart
  26659. }
  26660. set onloadstart (fn) {
  26661. webidl.brandCheck(this, FileReader)
  26662. if (this[kEvents].loadstart) {
  26663. this.removeEventListener('loadstart', this[kEvents].loadstart)
  26664. }
  26665. if (typeof fn === 'function') {
  26666. this[kEvents].loadstart = fn
  26667. this.addEventListener('loadstart', fn)
  26668. } else {
  26669. this[kEvents].loadstart = null
  26670. }
  26671. }
  26672. get onprogress () {
  26673. webidl.brandCheck(this, FileReader)
  26674. return this[kEvents].progress
  26675. }
  26676. set onprogress (fn) {
  26677. webidl.brandCheck(this, FileReader)
  26678. if (this[kEvents].progress) {
  26679. this.removeEventListener('progress', this[kEvents].progress)
  26680. }
  26681. if (typeof fn === 'function') {
  26682. this[kEvents].progress = fn
  26683. this.addEventListener('progress', fn)
  26684. } else {
  26685. this[kEvents].progress = null
  26686. }
  26687. }
  26688. get onload () {
  26689. webidl.brandCheck(this, FileReader)
  26690. return this[kEvents].load
  26691. }
  26692. set onload (fn) {
  26693. webidl.brandCheck(this, FileReader)
  26694. if (this[kEvents].load) {
  26695. this.removeEventListener('load', this[kEvents].load)
  26696. }
  26697. if (typeof fn === 'function') {
  26698. this[kEvents].load = fn
  26699. this.addEventListener('load', fn)
  26700. } else {
  26701. this[kEvents].load = null
  26702. }
  26703. }
  26704. get onabort () {
  26705. webidl.brandCheck(this, FileReader)
  26706. return this[kEvents].abort
  26707. }
  26708. set onabort (fn) {
  26709. webidl.brandCheck(this, FileReader)
  26710. if (this[kEvents].abort) {
  26711. this.removeEventListener('abort', this[kEvents].abort)
  26712. }
  26713. if (typeof fn === 'function') {
  26714. this[kEvents].abort = fn
  26715. this.addEventListener('abort', fn)
  26716. } else {
  26717. this[kEvents].abort = null
  26718. }
  26719. }
  26720. }
  26721. // https://w3c.github.io/FileAPI/#dom-filereader-empty
  26722. FileReader.EMPTY = FileReader.prototype.EMPTY = 0
  26723. // https://w3c.github.io/FileAPI/#dom-filereader-loading
  26724. FileReader.LOADING = FileReader.prototype.LOADING = 1
  26725. // https://w3c.github.io/FileAPI/#dom-filereader-done
  26726. FileReader.DONE = FileReader.prototype.DONE = 2
  26727. Object.defineProperties(FileReader.prototype, {
  26728. EMPTY: staticPropertyDescriptors,
  26729. LOADING: staticPropertyDescriptors,
  26730. DONE: staticPropertyDescriptors,
  26731. readAsArrayBuffer: kEnumerableProperty,
  26732. readAsBinaryString: kEnumerableProperty,
  26733. readAsText: kEnumerableProperty,
  26734. readAsDataURL: kEnumerableProperty,
  26735. abort: kEnumerableProperty,
  26736. readyState: kEnumerableProperty,
  26737. result: kEnumerableProperty,
  26738. error: kEnumerableProperty,
  26739. onloadstart: kEnumerableProperty,
  26740. onprogress: kEnumerableProperty,
  26741. onload: kEnumerableProperty,
  26742. onabort: kEnumerableProperty,
  26743. onerror: kEnumerableProperty,
  26744. onloadend: kEnumerableProperty,
  26745. [Symbol.toStringTag]: {
  26746. value: 'FileReader',
  26747. writable: false,
  26748. enumerable: false,
  26749. configurable: true
  26750. }
  26751. })
  26752. Object.defineProperties(FileReader, {
  26753. EMPTY: staticPropertyDescriptors,
  26754. LOADING: staticPropertyDescriptors,
  26755. DONE: staticPropertyDescriptors
  26756. })
  26757. module.exports = {
  26758. FileReader
  26759. }
  26760. /***/ }),
  26761. /***/ 5504:
  26762. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  26763. "use strict";
  26764. const { webidl } = __nccwpck_require__(1744)
  26765. const kState = Symbol('ProgressEvent state')
  26766. /**
  26767. * @see https://xhr.spec.whatwg.org/#progressevent
  26768. */
  26769. class ProgressEvent extends Event {
  26770. constructor (type, eventInitDict = {}) {
  26771. type = webidl.converters.DOMString(type)
  26772. eventInitDict = webidl.converters.ProgressEventInit(eventInitDict ?? {})
  26773. super(type, eventInitDict)
  26774. this[kState] = {
  26775. lengthComputable: eventInitDict.lengthComputable,
  26776. loaded: eventInitDict.loaded,
  26777. total: eventInitDict.total
  26778. }
  26779. }
  26780. get lengthComputable () {
  26781. webidl.brandCheck(this, ProgressEvent)
  26782. return this[kState].lengthComputable
  26783. }
  26784. get loaded () {
  26785. webidl.brandCheck(this, ProgressEvent)
  26786. return this[kState].loaded
  26787. }
  26788. get total () {
  26789. webidl.brandCheck(this, ProgressEvent)
  26790. return this[kState].total
  26791. }
  26792. }
  26793. webidl.converters.ProgressEventInit = webidl.dictionaryConverter([
  26794. {
  26795. key: 'lengthComputable',
  26796. converter: webidl.converters.boolean,
  26797. defaultValue: false
  26798. },
  26799. {
  26800. key: 'loaded',
  26801. converter: webidl.converters['unsigned long long'],
  26802. defaultValue: 0
  26803. },
  26804. {
  26805. key: 'total',
  26806. converter: webidl.converters['unsigned long long'],
  26807. defaultValue: 0
  26808. },
  26809. {
  26810. key: 'bubbles',
  26811. converter: webidl.converters.boolean,
  26812. defaultValue: false
  26813. },
  26814. {
  26815. key: 'cancelable',
  26816. converter: webidl.converters.boolean,
  26817. defaultValue: false
  26818. },
  26819. {
  26820. key: 'composed',
  26821. converter: webidl.converters.boolean,
  26822. defaultValue: false
  26823. }
  26824. ])
  26825. module.exports = {
  26826. ProgressEvent
  26827. }
  26828. /***/ }),
  26829. /***/ 9054:
  26830. /***/ ((module) => {
  26831. "use strict";
  26832. module.exports = {
  26833. kState: Symbol('FileReader state'),
  26834. kResult: Symbol('FileReader result'),
  26835. kError: Symbol('FileReader error'),
  26836. kLastProgressEventFired: Symbol('FileReader last progress event fired timestamp'),
  26837. kEvents: Symbol('FileReader events'),
  26838. kAborted: Symbol('FileReader aborted')
  26839. }
  26840. /***/ }),
  26841. /***/ 7530:
  26842. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  26843. "use strict";
  26844. const {
  26845. kState,
  26846. kError,
  26847. kResult,
  26848. kAborted,
  26849. kLastProgressEventFired
  26850. } = __nccwpck_require__(9054)
  26851. const { ProgressEvent } = __nccwpck_require__(5504)
  26852. const { getEncoding } = __nccwpck_require__(4854)
  26853. const { DOMException } = __nccwpck_require__(1037)
  26854. const { serializeAMimeType, parseMIMEType } = __nccwpck_require__(685)
  26855. const { types } = __nccwpck_require__(3837)
  26856. const { StringDecoder } = __nccwpck_require__(1576)
  26857. const { btoa } = __nccwpck_require__(4300)
  26858. /** @type {PropertyDescriptor} */
  26859. const staticPropertyDescriptors = {
  26860. enumerable: true,
  26861. writable: false,
  26862. configurable: false
  26863. }
  26864. /**
  26865. * @see https://w3c.github.io/FileAPI/#readOperation
  26866. * @param {import('./filereader').FileReader} fr
  26867. * @param {import('buffer').Blob} blob
  26868. * @param {string} type
  26869. * @param {string?} encodingName
  26870. */
  26871. function readOperation (fr, blob, type, encodingName) {
  26872. // 1. If fr’s state is "loading", throw an InvalidStateError
  26873. // DOMException.
  26874. if (fr[kState] === 'loading') {
  26875. throw new DOMException('Invalid state', 'InvalidStateError')
  26876. }
  26877. // 2. Set fr’s state to "loading".
  26878. fr[kState] = 'loading'
  26879. // 3. Set fr’s result to null.
  26880. fr[kResult] = null
  26881. // 4. Set fr’s error to null.
  26882. fr[kError] = null
  26883. // 5. Let stream be the result of calling get stream on blob.
  26884. /** @type {import('stream/web').ReadableStream} */
  26885. const stream = blob.stream()
  26886. // 6. Let reader be the result of getting a reader from stream.
  26887. const reader = stream.getReader()
  26888. // 7. Let bytes be an empty byte sequence.
  26889. /** @type {Uint8Array[]} */
  26890. const bytes = []
  26891. // 8. Let chunkPromise be the result of reading a chunk from
  26892. // stream with reader.
  26893. let chunkPromise = reader.read()
  26894. // 9. Let isFirstChunk be true.
  26895. let isFirstChunk = true
  26896. // 10. In parallel, while true:
  26897. // Note: "In parallel" just means non-blocking
  26898. // Note 2: readOperation itself cannot be async as double
  26899. // reading the body would then reject the promise, instead
  26900. // of throwing an error.
  26901. ;(async () => {
  26902. while (!fr[kAborted]) {
  26903. // 1. Wait for chunkPromise to be fulfilled or rejected.
  26904. try {
  26905. const { done, value } = await chunkPromise
  26906. // 2. If chunkPromise is fulfilled, and isFirstChunk is
  26907. // true, queue a task to fire a progress event called
  26908. // loadstart at fr.
  26909. if (isFirstChunk && !fr[kAborted]) {
  26910. queueMicrotask(() => {
  26911. fireAProgressEvent('loadstart', fr)
  26912. })
  26913. }
  26914. // 3. Set isFirstChunk to false.
  26915. isFirstChunk = false
  26916. // 4. If chunkPromise is fulfilled with an object whose
  26917. // done property is false and whose value property is
  26918. // a Uint8Array object, run these steps:
  26919. if (!done && types.isUint8Array(value)) {
  26920. // 1. Let bs be the byte sequence represented by the
  26921. // Uint8Array object.
  26922. // 2. Append bs to bytes.
  26923. bytes.push(value)
  26924. // 3. If roughly 50ms have passed since these steps
  26925. // were last invoked, queue a task to fire a
  26926. // progress event called progress at fr.
  26927. if (
  26928. (
  26929. fr[kLastProgressEventFired] === undefined ||
  26930. Date.now() - fr[kLastProgressEventFired] >= 50
  26931. ) &&
  26932. !fr[kAborted]
  26933. ) {
  26934. fr[kLastProgressEventFired] = Date.now()
  26935. queueMicrotask(() => {
  26936. fireAProgressEvent('progress', fr)
  26937. })
  26938. }
  26939. // 4. Set chunkPromise to the result of reading a
  26940. // chunk from stream with reader.
  26941. chunkPromise = reader.read()
  26942. } else if (done) {
  26943. // 5. Otherwise, if chunkPromise is fulfilled with an
  26944. // object whose done property is true, queue a task
  26945. // to run the following steps and abort this algorithm:
  26946. queueMicrotask(() => {
  26947. // 1. Set fr’s state to "done".
  26948. fr[kState] = 'done'
  26949. // 2. Let result be the result of package data given
  26950. // bytes, type, blob’s type, and encodingName.
  26951. try {
  26952. const result = packageData(bytes, type, blob.type, encodingName)
  26953. // 4. Else:
  26954. if (fr[kAborted]) {
  26955. return
  26956. }
  26957. // 1. Set fr’s result to result.
  26958. fr[kResult] = result
  26959. // 2. Fire a progress event called load at the fr.
  26960. fireAProgressEvent('load', fr)
  26961. } catch (error) {
  26962. // 3. If package data threw an exception error:
  26963. // 1. Set fr’s error to error.
  26964. fr[kError] = error
  26965. // 2. Fire a progress event called error at fr.
  26966. fireAProgressEvent('error', fr)
  26967. }
  26968. // 5. If fr’s state is not "loading", fire a progress
  26969. // event called loadend at the fr.
  26970. if (fr[kState] !== 'loading') {
  26971. fireAProgressEvent('loadend', fr)
  26972. }
  26973. })
  26974. break
  26975. }
  26976. } catch (error) {
  26977. if (fr[kAborted]) {
  26978. return
  26979. }
  26980. // 6. Otherwise, if chunkPromise is rejected with an
  26981. // error error, queue a task to run the following
  26982. // steps and abort this algorithm:
  26983. queueMicrotask(() => {
  26984. // 1. Set fr’s state to "done".
  26985. fr[kState] = 'done'
  26986. // 2. Set fr’s error to error.
  26987. fr[kError] = error
  26988. // 3. Fire a progress event called error at fr.
  26989. fireAProgressEvent('error', fr)
  26990. // 4. If fr’s state is not "loading", fire a progress
  26991. // event called loadend at fr.
  26992. if (fr[kState] !== 'loading') {
  26993. fireAProgressEvent('loadend', fr)
  26994. }
  26995. })
  26996. break
  26997. }
  26998. }
  26999. })()
  27000. }
  27001. /**
  27002. * @see https://w3c.github.io/FileAPI/#fire-a-progress-event
  27003. * @see https://dom.spec.whatwg.org/#concept-event-fire
  27004. * @param {string} e The name of the event
  27005. * @param {import('./filereader').FileReader} reader
  27006. */
  27007. function fireAProgressEvent (e, reader) {
  27008. // The progress event e does not bubble. e.bubbles must be false
  27009. // The progress event e is NOT cancelable. e.cancelable must be false
  27010. const event = new ProgressEvent(e, {
  27011. bubbles: false,
  27012. cancelable: false
  27013. })
  27014. reader.dispatchEvent(event)
  27015. }
  27016. /**
  27017. * @see https://w3c.github.io/FileAPI/#blob-package-data
  27018. * @param {Uint8Array[]} bytes
  27019. * @param {string} type
  27020. * @param {string?} mimeType
  27021. * @param {string?} encodingName
  27022. */
  27023. function packageData (bytes, type, mimeType, encodingName) {
  27024. // 1. A Blob has an associated package data algorithm, given
  27025. // bytes, a type, a optional mimeType, and a optional
  27026. // encodingName, which switches on type and runs the
  27027. // associated steps:
  27028. switch (type) {
  27029. case 'DataURL': {
  27030. // 1. Return bytes as a DataURL [RFC2397] subject to
  27031. // the considerations below:
  27032. // * Use mimeType as part of the Data URL if it is
  27033. // available in keeping with the Data URL
  27034. // specification [RFC2397].
  27035. // * If mimeType is not available return a Data URL
  27036. // without a media-type. [RFC2397].
  27037. // https://datatracker.ietf.org/doc/html/rfc2397#section-3
  27038. // dataurl := "data:" [ mediatype ] [ ";base64" ] "," data
  27039. // mediatype := [ type "/" subtype ] *( ";" parameter )
  27040. // data := *urlchar
  27041. // parameter := attribute "=" value
  27042. let dataURL = 'data:'
  27043. const parsed = parseMIMEType(mimeType || 'application/octet-stream')
  27044. if (parsed !== 'failure') {
  27045. dataURL += serializeAMimeType(parsed)
  27046. }
  27047. dataURL += ';base64,'
  27048. const decoder = new StringDecoder('latin1')
  27049. for (const chunk of bytes) {
  27050. dataURL += btoa(decoder.write(chunk))
  27051. }
  27052. dataURL += btoa(decoder.end())
  27053. return dataURL
  27054. }
  27055. case 'Text': {
  27056. // 1. Let encoding be failure
  27057. let encoding = 'failure'
  27058. // 2. If the encodingName is present, set encoding to the
  27059. // result of getting an encoding from encodingName.
  27060. if (encodingName) {
  27061. encoding = getEncoding(encodingName)
  27062. }
  27063. // 3. If encoding is failure, and mimeType is present:
  27064. if (encoding === 'failure' && mimeType) {
  27065. // 1. Let type be the result of parse a MIME type
  27066. // given mimeType.
  27067. const type = parseMIMEType(mimeType)
  27068. // 2. If type is not failure, set encoding to the result
  27069. // of getting an encoding from type’s parameters["charset"].
  27070. if (type !== 'failure') {
  27071. encoding = getEncoding(type.parameters.get('charset'))
  27072. }
  27073. }
  27074. // 4. If encoding is failure, then set encoding to UTF-8.
  27075. if (encoding === 'failure') {
  27076. encoding = 'UTF-8'
  27077. }
  27078. // 5. Decode bytes using fallback encoding encoding, and
  27079. // return the result.
  27080. return decode(bytes, encoding)
  27081. }
  27082. case 'ArrayBuffer': {
  27083. // Return a new ArrayBuffer whose contents are bytes.
  27084. const sequence = combineByteSequences(bytes)
  27085. return sequence.buffer
  27086. }
  27087. case 'BinaryString': {
  27088. // Return bytes as a binary string, in which every byte
  27089. // is represented by a code unit of equal value [0..255].
  27090. let binaryString = ''
  27091. const decoder = new StringDecoder('latin1')
  27092. for (const chunk of bytes) {
  27093. binaryString += decoder.write(chunk)
  27094. }
  27095. binaryString += decoder.end()
  27096. return binaryString
  27097. }
  27098. }
  27099. }
  27100. /**
  27101. * @see https://encoding.spec.whatwg.org/#decode
  27102. * @param {Uint8Array[]} ioQueue
  27103. * @param {string} encoding
  27104. */
  27105. function decode (ioQueue, encoding) {
  27106. const bytes = combineByteSequences(ioQueue)
  27107. // 1. Let BOMEncoding be the result of BOM sniffing ioQueue.
  27108. const BOMEncoding = BOMSniffing(bytes)
  27109. let slice = 0
  27110. // 2. If BOMEncoding is non-null:
  27111. if (BOMEncoding !== null) {
  27112. // 1. Set encoding to BOMEncoding.
  27113. encoding = BOMEncoding
  27114. // 2. Read three bytes from ioQueue, if BOMEncoding is
  27115. // UTF-8; otherwise read two bytes.
  27116. // (Do nothing with those bytes.)
  27117. slice = BOMEncoding === 'UTF-8' ? 3 : 2
  27118. }
  27119. // 3. Process a queue with an instance of encoding’s
  27120. // decoder, ioQueue, output, and "replacement".
  27121. // 4. Return output.
  27122. const sliced = bytes.slice(slice)
  27123. return new TextDecoder(encoding).decode(sliced)
  27124. }
  27125. /**
  27126. * @see https://encoding.spec.whatwg.org/#bom-sniff
  27127. * @param {Uint8Array} ioQueue
  27128. */
  27129. function BOMSniffing (ioQueue) {
  27130. // 1. Let BOM be the result of peeking 3 bytes from ioQueue,
  27131. // converted to a byte sequence.
  27132. const [a, b, c] = ioQueue
  27133. // 2. For each of the rows in the table below, starting with
  27134. // the first one and going down, if BOM starts with the
  27135. // bytes given in the first column, then return the
  27136. // encoding given in the cell in the second column of that
  27137. // row. Otherwise, return null.
  27138. if (a === 0xEF && b === 0xBB && c === 0xBF) {
  27139. return 'UTF-8'
  27140. } else if (a === 0xFE && b === 0xFF) {
  27141. return 'UTF-16BE'
  27142. } else if (a === 0xFF && b === 0xFE) {
  27143. return 'UTF-16LE'
  27144. }
  27145. return null
  27146. }
  27147. /**
  27148. * @param {Uint8Array[]} sequences
  27149. */
  27150. function combineByteSequences (sequences) {
  27151. const size = sequences.reduce((a, b) => {
  27152. return a + b.byteLength
  27153. }, 0)
  27154. let offset = 0
  27155. return sequences.reduce((a, b) => {
  27156. a.set(b, offset)
  27157. offset += b.byteLength
  27158. return a
  27159. }, new Uint8Array(size))
  27160. }
  27161. module.exports = {
  27162. staticPropertyDescriptors,
  27163. readOperation,
  27164. fireAProgressEvent
  27165. }
  27166. /***/ }),
  27167. /***/ 1892:
  27168. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  27169. "use strict";
  27170. // We include a version number for the Dispatcher API. In case of breaking changes,
  27171. // this version number must be increased to avoid conflicts.
  27172. const globalDispatcher = Symbol.for('undici.globalDispatcher.1')
  27173. const { InvalidArgumentError } = __nccwpck_require__(8045)
  27174. const Agent = __nccwpck_require__(7890)
  27175. if (getGlobalDispatcher() === undefined) {
  27176. setGlobalDispatcher(new Agent())
  27177. }
  27178. function setGlobalDispatcher (agent) {
  27179. if (!agent || typeof agent.dispatch !== 'function') {
  27180. throw new InvalidArgumentError('Argument agent must implement Agent')
  27181. }
  27182. Object.defineProperty(globalThis, globalDispatcher, {
  27183. value: agent,
  27184. writable: true,
  27185. enumerable: false,
  27186. configurable: false
  27187. })
  27188. }
  27189. function getGlobalDispatcher () {
  27190. return globalThis[globalDispatcher]
  27191. }
  27192. module.exports = {
  27193. setGlobalDispatcher,
  27194. getGlobalDispatcher
  27195. }
  27196. /***/ }),
  27197. /***/ 6930:
  27198. /***/ ((module) => {
  27199. "use strict";
  27200. module.exports = class DecoratorHandler {
  27201. constructor (handler) {
  27202. this.handler = handler
  27203. }
  27204. onConnect (...args) {
  27205. return this.handler.onConnect(...args)
  27206. }
  27207. onError (...args) {
  27208. return this.handler.onError(...args)
  27209. }
  27210. onUpgrade (...args) {
  27211. return this.handler.onUpgrade(...args)
  27212. }
  27213. onHeaders (...args) {
  27214. return this.handler.onHeaders(...args)
  27215. }
  27216. onData (...args) {
  27217. return this.handler.onData(...args)
  27218. }
  27219. onComplete (...args) {
  27220. return this.handler.onComplete(...args)
  27221. }
  27222. onBodySent (...args) {
  27223. return this.handler.onBodySent(...args)
  27224. }
  27225. }
  27226. /***/ }),
  27227. /***/ 2860:
  27228. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  27229. "use strict";
  27230. const util = __nccwpck_require__(3983)
  27231. const { kBodyUsed } = __nccwpck_require__(2785)
  27232. const assert = __nccwpck_require__(9491)
  27233. const { InvalidArgumentError } = __nccwpck_require__(8045)
  27234. const EE = __nccwpck_require__(2361)
  27235. const redirectableStatusCodes = [300, 301, 302, 303, 307, 308]
  27236. const kBody = Symbol('body')
  27237. class BodyAsyncIterable {
  27238. constructor (body) {
  27239. this[kBody] = body
  27240. this[kBodyUsed] = false
  27241. }
  27242. async * [Symbol.asyncIterator] () {
  27243. assert(!this[kBodyUsed], 'disturbed')
  27244. this[kBodyUsed] = true
  27245. yield * this[kBody]
  27246. }
  27247. }
  27248. class RedirectHandler {
  27249. constructor (dispatch, maxRedirections, opts, handler) {
  27250. if (maxRedirections != null && (!Number.isInteger(maxRedirections) || maxRedirections < 0)) {
  27251. throw new InvalidArgumentError('maxRedirections must be a positive number')
  27252. }
  27253. util.validateHandler(handler, opts.method, opts.upgrade)
  27254. this.dispatch = dispatch
  27255. this.location = null
  27256. this.abort = null
  27257. this.opts = { ...opts, maxRedirections: 0 } // opts must be a copy
  27258. this.maxRedirections = maxRedirections
  27259. this.handler = handler
  27260. this.history = []
  27261. if (util.isStream(this.opts.body)) {
  27262. // TODO (fix): Provide some way for the user to cache the file to e.g. /tmp
  27263. // so that it can be dispatched again?
  27264. // TODO (fix): Do we need 100-expect support to provide a way to do this properly?
  27265. if (util.bodyLength(this.opts.body) === 0) {
  27266. this.opts.body
  27267. .on('data', function () {
  27268. assert(false)
  27269. })
  27270. }
  27271. if (typeof this.opts.body.readableDidRead !== 'boolean') {
  27272. this.opts.body[kBodyUsed] = false
  27273. EE.prototype.on.call(this.opts.body, 'data', function () {
  27274. this[kBodyUsed] = true
  27275. })
  27276. }
  27277. } else if (this.opts.body && typeof this.opts.body.pipeTo === 'function') {
  27278. // TODO (fix): We can't access ReadableStream internal state
  27279. // to determine whether or not it has been disturbed. This is just
  27280. // a workaround.
  27281. this.opts.body = new BodyAsyncIterable(this.opts.body)
  27282. } else if (
  27283. this.opts.body &&
  27284. typeof this.opts.body !== 'string' &&
  27285. !ArrayBuffer.isView(this.opts.body) &&
  27286. util.isIterable(this.opts.body)
  27287. ) {
  27288. // TODO: Should we allow re-using iterable if !this.opts.idempotent
  27289. // or through some other flag?
  27290. this.opts.body = new BodyAsyncIterable(this.opts.body)
  27291. }
  27292. }
  27293. onConnect (abort) {
  27294. this.abort = abort
  27295. this.handler.onConnect(abort, { history: this.history })
  27296. }
  27297. onUpgrade (statusCode, headers, socket) {
  27298. this.handler.onUpgrade(statusCode, headers, socket)
  27299. }
  27300. onError (error) {
  27301. this.handler.onError(error)
  27302. }
  27303. onHeaders (statusCode, headers, resume, statusText) {
  27304. this.location = this.history.length >= this.maxRedirections || util.isDisturbed(this.opts.body)
  27305. ? null
  27306. : parseLocation(statusCode, headers)
  27307. if (this.opts.origin) {
  27308. this.history.push(new URL(this.opts.path, this.opts.origin))
  27309. }
  27310. if (!this.location) {
  27311. return this.handler.onHeaders(statusCode, headers, resume, statusText)
  27312. }
  27313. const { origin, pathname, search } = util.parseURL(new URL(this.location, this.opts.origin && new URL(this.opts.path, this.opts.origin)))
  27314. const path = search ? `${pathname}${search}` : pathname
  27315. // Remove headers referring to the original URL.
  27316. // By default it is Host only, unless it's a 303 (see below), which removes also all Content-* headers.
  27317. // https://tools.ietf.org/html/rfc7231#section-6.4
  27318. this.opts.headers = cleanRequestHeaders(this.opts.headers, statusCode === 303, this.opts.origin !== origin)
  27319. this.opts.path = path
  27320. this.opts.origin = origin
  27321. this.opts.maxRedirections = 0
  27322. this.opts.query = null
  27323. // https://tools.ietf.org/html/rfc7231#section-6.4.4
  27324. // In case of HTTP 303, always replace method to be either HEAD or GET
  27325. if (statusCode === 303 && this.opts.method !== 'HEAD') {
  27326. this.opts.method = 'GET'
  27327. this.opts.body = null
  27328. }
  27329. }
  27330. onData (chunk) {
  27331. if (this.location) {
  27332. /*
  27333. https://tools.ietf.org/html/rfc7231#section-6.4
  27334. TLDR: undici always ignores 3xx response bodies.
  27335. Redirection is used to serve the requested resource from another URL, so it is assumes that
  27336. no body is generated (and thus can be ignored). Even though generating a body is not prohibited.
  27337. For status 301, 302, 303, 307 and 308 (the latter from RFC 7238), the specs mention that the body usually
  27338. (which means it's optional and not mandated) contain just an hyperlink to the value of
  27339. the Location response header, so the body can be ignored safely.
  27340. For status 300, which is "Multiple Choices", the spec mentions both generating a Location
  27341. response header AND a response body with the other possible location to follow.
  27342. Since the spec explicitily chooses not to specify a format for such body and leave it to
  27343. servers and browsers implementors, we ignore the body as there is no specified way to eventually parse it.
  27344. */
  27345. } else {
  27346. return this.handler.onData(chunk)
  27347. }
  27348. }
  27349. onComplete (trailers) {
  27350. if (this.location) {
  27351. /*
  27352. https://tools.ietf.org/html/rfc7231#section-6.4
  27353. TLDR: undici always ignores 3xx response trailers as they are not expected in case of redirections
  27354. and neither are useful if present.
  27355. See comment on onData method above for more detailed informations.
  27356. */
  27357. this.location = null
  27358. this.abort = null
  27359. this.dispatch(this.opts, this)
  27360. } else {
  27361. this.handler.onComplete(trailers)
  27362. }
  27363. }
  27364. onBodySent (chunk) {
  27365. if (this.handler.onBodySent) {
  27366. this.handler.onBodySent(chunk)
  27367. }
  27368. }
  27369. }
  27370. function parseLocation (statusCode, headers) {
  27371. if (redirectableStatusCodes.indexOf(statusCode) === -1) {
  27372. return null
  27373. }
  27374. for (let i = 0; i < headers.length; i += 2) {
  27375. if (headers[i].toString().toLowerCase() === 'location') {
  27376. return headers[i + 1]
  27377. }
  27378. }
  27379. }
  27380. // https://tools.ietf.org/html/rfc7231#section-6.4.4
  27381. function shouldRemoveHeader (header, removeContent, unknownOrigin) {
  27382. if (header.length === 4) {
  27383. return util.headerNameToString(header) === 'host'
  27384. }
  27385. if (removeContent && util.headerNameToString(header).startsWith('content-')) {
  27386. return true
  27387. }
  27388. if (unknownOrigin && (header.length === 13 || header.length === 6 || header.length === 19)) {
  27389. const name = util.headerNameToString(header)
  27390. return name === 'authorization' || name === 'cookie' || name === 'proxy-authorization'
  27391. }
  27392. return false
  27393. }
  27394. // https://tools.ietf.org/html/rfc7231#section-6.4
  27395. function cleanRequestHeaders (headers, removeContent, unknownOrigin) {
  27396. const ret = []
  27397. if (Array.isArray(headers)) {
  27398. for (let i = 0; i < headers.length; i += 2) {
  27399. if (!shouldRemoveHeader(headers[i], removeContent, unknownOrigin)) {
  27400. ret.push(headers[i], headers[i + 1])
  27401. }
  27402. }
  27403. } else if (headers && typeof headers === 'object') {
  27404. for (const key of Object.keys(headers)) {
  27405. if (!shouldRemoveHeader(key, removeContent, unknownOrigin)) {
  27406. ret.push(key, headers[key])
  27407. }
  27408. }
  27409. } else {
  27410. assert(headers == null, 'headers must be an object or an array')
  27411. }
  27412. return ret
  27413. }
  27414. module.exports = RedirectHandler
  27415. /***/ }),
  27416. /***/ 2286:
  27417. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  27418. const assert = __nccwpck_require__(9491)
  27419. const { kRetryHandlerDefaultRetry } = __nccwpck_require__(2785)
  27420. const { RequestRetryError } = __nccwpck_require__(8045)
  27421. const { isDisturbed, parseHeaders, parseRangeHeader } = __nccwpck_require__(3983)
  27422. function calculateRetryAfterHeader (retryAfter) {
  27423. const current = Date.now()
  27424. const diff = new Date(retryAfter).getTime() - current
  27425. return diff
  27426. }
  27427. class RetryHandler {
  27428. constructor (opts, handlers) {
  27429. const { retryOptions, ...dispatchOpts } = opts
  27430. const {
  27431. // Retry scoped
  27432. retry: retryFn,
  27433. maxRetries,
  27434. maxTimeout,
  27435. minTimeout,
  27436. timeoutFactor,
  27437. // Response scoped
  27438. methods,
  27439. errorCodes,
  27440. retryAfter,
  27441. statusCodes
  27442. } = retryOptions ?? {}
  27443. this.dispatch = handlers.dispatch
  27444. this.handler = handlers.handler
  27445. this.opts = dispatchOpts
  27446. this.abort = null
  27447. this.aborted = false
  27448. this.retryOpts = {
  27449. retry: retryFn ?? RetryHandler[kRetryHandlerDefaultRetry],
  27450. retryAfter: retryAfter ?? true,
  27451. maxTimeout: maxTimeout ?? 30 * 1000, // 30s,
  27452. timeout: minTimeout ?? 500, // .5s
  27453. timeoutFactor: timeoutFactor ?? 2,
  27454. maxRetries: maxRetries ?? 5,
  27455. // What errors we should retry
  27456. methods: methods ?? ['GET', 'HEAD', 'OPTIONS', 'PUT', 'DELETE', 'TRACE'],
  27457. // Indicates which errors to retry
  27458. statusCodes: statusCodes ?? [500, 502, 503, 504, 429],
  27459. // List of errors to retry
  27460. errorCodes: errorCodes ?? [
  27461. 'ECONNRESET',
  27462. 'ECONNREFUSED',
  27463. 'ENOTFOUND',
  27464. 'ENETDOWN',
  27465. 'ENETUNREACH',
  27466. 'EHOSTDOWN',
  27467. 'EHOSTUNREACH',
  27468. 'EPIPE'
  27469. ]
  27470. }
  27471. this.retryCount = 0
  27472. this.start = 0
  27473. this.end = null
  27474. this.etag = null
  27475. this.resume = null
  27476. // Handle possible onConnect duplication
  27477. this.handler.onConnect(reason => {
  27478. this.aborted = true
  27479. if (this.abort) {
  27480. this.abort(reason)
  27481. } else {
  27482. this.reason = reason
  27483. }
  27484. })
  27485. }
  27486. onRequestSent () {
  27487. if (this.handler.onRequestSent) {
  27488. this.handler.onRequestSent()
  27489. }
  27490. }
  27491. onUpgrade (statusCode, headers, socket) {
  27492. if (this.handler.onUpgrade) {
  27493. this.handler.onUpgrade(statusCode, headers, socket)
  27494. }
  27495. }
  27496. onConnect (abort) {
  27497. if (this.aborted) {
  27498. abort(this.reason)
  27499. } else {
  27500. this.abort = abort
  27501. }
  27502. }
  27503. onBodySent (chunk) {
  27504. if (this.handler.onBodySent) return this.handler.onBodySent(chunk)
  27505. }
  27506. static [kRetryHandlerDefaultRetry] (err, { state, opts }, cb) {
  27507. const { statusCode, code, headers } = err
  27508. const { method, retryOptions } = opts
  27509. const {
  27510. maxRetries,
  27511. timeout,
  27512. maxTimeout,
  27513. timeoutFactor,
  27514. statusCodes,
  27515. errorCodes,
  27516. methods
  27517. } = retryOptions
  27518. let { counter, currentTimeout } = state
  27519. currentTimeout =
  27520. currentTimeout != null && currentTimeout > 0 ? currentTimeout : timeout
  27521. // Any code that is not a Undici's originated and allowed to retry
  27522. if (
  27523. code &&
  27524. code !== 'UND_ERR_REQ_RETRY' &&
  27525. code !== 'UND_ERR_SOCKET' &&
  27526. !errorCodes.includes(code)
  27527. ) {
  27528. cb(err)
  27529. return
  27530. }
  27531. // If a set of method are provided and the current method is not in the list
  27532. if (Array.isArray(methods) && !methods.includes(method)) {
  27533. cb(err)
  27534. return
  27535. }
  27536. // If a set of status code are provided and the current status code is not in the list
  27537. if (
  27538. statusCode != null &&
  27539. Array.isArray(statusCodes) &&
  27540. !statusCodes.includes(statusCode)
  27541. ) {
  27542. cb(err)
  27543. return
  27544. }
  27545. // If we reached the max number of retries
  27546. if (counter > maxRetries) {
  27547. cb(err)
  27548. return
  27549. }
  27550. let retryAfterHeader = headers != null && headers['retry-after']
  27551. if (retryAfterHeader) {
  27552. retryAfterHeader = Number(retryAfterHeader)
  27553. retryAfterHeader = isNaN(retryAfterHeader)
  27554. ? calculateRetryAfterHeader(retryAfterHeader)
  27555. : retryAfterHeader * 1e3 // Retry-After is in seconds
  27556. }
  27557. const retryTimeout =
  27558. retryAfterHeader > 0
  27559. ? Math.min(retryAfterHeader, maxTimeout)
  27560. : Math.min(currentTimeout * timeoutFactor ** counter, maxTimeout)
  27561. state.currentTimeout = retryTimeout
  27562. setTimeout(() => cb(null), retryTimeout)
  27563. }
  27564. onHeaders (statusCode, rawHeaders, resume, statusMessage) {
  27565. const headers = parseHeaders(rawHeaders)
  27566. this.retryCount += 1
  27567. if (statusCode >= 300) {
  27568. this.abort(
  27569. new RequestRetryError('Request failed', statusCode, {
  27570. headers,
  27571. count: this.retryCount
  27572. })
  27573. )
  27574. return false
  27575. }
  27576. // Checkpoint for resume from where we left it
  27577. if (this.resume != null) {
  27578. this.resume = null
  27579. if (statusCode !== 206) {
  27580. return true
  27581. }
  27582. const contentRange = parseRangeHeader(headers['content-range'])
  27583. // If no content range
  27584. if (!contentRange) {
  27585. this.abort(
  27586. new RequestRetryError('Content-Range mismatch', statusCode, {
  27587. headers,
  27588. count: this.retryCount
  27589. })
  27590. )
  27591. return false
  27592. }
  27593. // Let's start with a weak etag check
  27594. if (this.etag != null && this.etag !== headers.etag) {
  27595. this.abort(
  27596. new RequestRetryError('ETag mismatch', statusCode, {
  27597. headers,
  27598. count: this.retryCount
  27599. })
  27600. )
  27601. return false
  27602. }
  27603. const { start, size, end = size } = contentRange
  27604. assert(this.start === start, 'content-range mismatch')
  27605. assert(this.end == null || this.end === end, 'content-range mismatch')
  27606. this.resume = resume
  27607. return true
  27608. }
  27609. if (this.end == null) {
  27610. if (statusCode === 206) {
  27611. // First time we receive 206
  27612. const range = parseRangeHeader(headers['content-range'])
  27613. if (range == null) {
  27614. return this.handler.onHeaders(
  27615. statusCode,
  27616. rawHeaders,
  27617. resume,
  27618. statusMessage
  27619. )
  27620. }
  27621. const { start, size, end = size } = range
  27622. assert(
  27623. start != null && Number.isFinite(start) && this.start !== start,
  27624. 'content-range mismatch'
  27625. )
  27626. assert(Number.isFinite(start))
  27627. assert(
  27628. end != null && Number.isFinite(end) && this.end !== end,
  27629. 'invalid content-length'
  27630. )
  27631. this.start = start
  27632. this.end = end
  27633. }
  27634. // We make our best to checkpoint the body for further range headers
  27635. if (this.end == null) {
  27636. const contentLength = headers['content-length']
  27637. this.end = contentLength != null ? Number(contentLength) : null
  27638. }
  27639. assert(Number.isFinite(this.start))
  27640. assert(
  27641. this.end == null || Number.isFinite(this.end),
  27642. 'invalid content-length'
  27643. )
  27644. this.resume = resume
  27645. this.etag = headers.etag != null ? headers.etag : null
  27646. return this.handler.onHeaders(
  27647. statusCode,
  27648. rawHeaders,
  27649. resume,
  27650. statusMessage
  27651. )
  27652. }
  27653. const err = new RequestRetryError('Request failed', statusCode, {
  27654. headers,
  27655. count: this.retryCount
  27656. })
  27657. this.abort(err)
  27658. return false
  27659. }
  27660. onData (chunk) {
  27661. this.start += chunk.length
  27662. return this.handler.onData(chunk)
  27663. }
  27664. onComplete (rawTrailers) {
  27665. this.retryCount = 0
  27666. return this.handler.onComplete(rawTrailers)
  27667. }
  27668. onError (err) {
  27669. if (this.aborted || isDisturbed(this.opts.body)) {
  27670. return this.handler.onError(err)
  27671. }
  27672. this.retryOpts.retry(
  27673. err,
  27674. {
  27675. state: { counter: this.retryCount++, currentTimeout: this.retryAfter },
  27676. opts: { retryOptions: this.retryOpts, ...this.opts }
  27677. },
  27678. onRetry.bind(this)
  27679. )
  27680. function onRetry (err) {
  27681. if (err != null || this.aborted || isDisturbed(this.opts.body)) {
  27682. return this.handler.onError(err)
  27683. }
  27684. if (this.start !== 0) {
  27685. this.opts = {
  27686. ...this.opts,
  27687. headers: {
  27688. ...this.opts.headers,
  27689. range: `bytes=${this.start}-${this.end ?? ''}`
  27690. }
  27691. }
  27692. }
  27693. try {
  27694. this.dispatch(this.opts, this)
  27695. } catch (err) {
  27696. this.handler.onError(err)
  27697. }
  27698. }
  27699. }
  27700. }
  27701. module.exports = RetryHandler
  27702. /***/ }),
  27703. /***/ 8861:
  27704. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  27705. "use strict";
  27706. const RedirectHandler = __nccwpck_require__(2860)
  27707. function createRedirectInterceptor ({ maxRedirections: defaultMaxRedirections }) {
  27708. return (dispatch) => {
  27709. return function Intercept (opts, handler) {
  27710. const { maxRedirections = defaultMaxRedirections } = opts
  27711. if (!maxRedirections) {
  27712. return dispatch(opts, handler)
  27713. }
  27714. const redirectHandler = new RedirectHandler(dispatch, maxRedirections, opts, handler)
  27715. opts = { ...opts, maxRedirections: 0 } // Stop sub dispatcher from also redirecting.
  27716. return dispatch(opts, redirectHandler)
  27717. }
  27718. }
  27719. }
  27720. module.exports = createRedirectInterceptor
  27721. /***/ }),
  27722. /***/ 953:
  27723. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  27724. "use strict";
  27725. Object.defineProperty(exports, "__esModule", ({ value: true }));
  27726. 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;
  27727. const utils_1 = __nccwpck_require__(1891);
  27728. // C headers
  27729. var ERROR;
  27730. (function (ERROR) {
  27731. ERROR[ERROR["OK"] = 0] = "OK";
  27732. ERROR[ERROR["INTERNAL"] = 1] = "INTERNAL";
  27733. ERROR[ERROR["STRICT"] = 2] = "STRICT";
  27734. ERROR[ERROR["LF_EXPECTED"] = 3] = "LF_EXPECTED";
  27735. ERROR[ERROR["UNEXPECTED_CONTENT_LENGTH"] = 4] = "UNEXPECTED_CONTENT_LENGTH";
  27736. ERROR[ERROR["CLOSED_CONNECTION"] = 5] = "CLOSED_CONNECTION";
  27737. ERROR[ERROR["INVALID_METHOD"] = 6] = "INVALID_METHOD";
  27738. ERROR[ERROR["INVALID_URL"] = 7] = "INVALID_URL";
  27739. ERROR[ERROR["INVALID_CONSTANT"] = 8] = "INVALID_CONSTANT";
  27740. ERROR[ERROR["INVALID_VERSION"] = 9] = "INVALID_VERSION";
  27741. ERROR[ERROR["INVALID_HEADER_TOKEN"] = 10] = "INVALID_HEADER_TOKEN";
  27742. ERROR[ERROR["INVALID_CONTENT_LENGTH"] = 11] = "INVALID_CONTENT_LENGTH";
  27743. ERROR[ERROR["INVALID_CHUNK_SIZE"] = 12] = "INVALID_CHUNK_SIZE";
  27744. ERROR[ERROR["INVALID_STATUS"] = 13] = "INVALID_STATUS";
  27745. ERROR[ERROR["INVALID_EOF_STATE"] = 14] = "INVALID_EOF_STATE";
  27746. ERROR[ERROR["INVALID_TRANSFER_ENCODING"] = 15] = "INVALID_TRANSFER_ENCODING";
  27747. ERROR[ERROR["CB_MESSAGE_BEGIN"] = 16] = "CB_MESSAGE_BEGIN";
  27748. ERROR[ERROR["CB_HEADERS_COMPLETE"] = 17] = "CB_HEADERS_COMPLETE";
  27749. ERROR[ERROR["CB_MESSAGE_COMPLETE"] = 18] = "CB_MESSAGE_COMPLETE";
  27750. ERROR[ERROR["CB_CHUNK_HEADER"] = 19] = "CB_CHUNK_HEADER";
  27751. ERROR[ERROR["CB_CHUNK_COMPLETE"] = 20] = "CB_CHUNK_COMPLETE";
  27752. ERROR[ERROR["PAUSED"] = 21] = "PAUSED";
  27753. ERROR[ERROR["PAUSED_UPGRADE"] = 22] = "PAUSED_UPGRADE";
  27754. ERROR[ERROR["PAUSED_H2_UPGRADE"] = 23] = "PAUSED_H2_UPGRADE";
  27755. ERROR[ERROR["USER"] = 24] = "USER";
  27756. })(ERROR = exports.ERROR || (exports.ERROR = {}));
  27757. var TYPE;
  27758. (function (TYPE) {
  27759. TYPE[TYPE["BOTH"] = 0] = "BOTH";
  27760. TYPE[TYPE["REQUEST"] = 1] = "REQUEST";
  27761. TYPE[TYPE["RESPONSE"] = 2] = "RESPONSE";
  27762. })(TYPE = exports.TYPE || (exports.TYPE = {}));
  27763. var FLAGS;
  27764. (function (FLAGS) {
  27765. FLAGS[FLAGS["CONNECTION_KEEP_ALIVE"] = 1] = "CONNECTION_KEEP_ALIVE";
  27766. FLAGS[FLAGS["CONNECTION_CLOSE"] = 2] = "CONNECTION_CLOSE";
  27767. FLAGS[FLAGS["CONNECTION_UPGRADE"] = 4] = "CONNECTION_UPGRADE";
  27768. FLAGS[FLAGS["CHUNKED"] = 8] = "CHUNKED";
  27769. FLAGS[FLAGS["UPGRADE"] = 16] = "UPGRADE";
  27770. FLAGS[FLAGS["CONTENT_LENGTH"] = 32] = "CONTENT_LENGTH";
  27771. FLAGS[FLAGS["SKIPBODY"] = 64] = "SKIPBODY";
  27772. FLAGS[FLAGS["TRAILING"] = 128] = "TRAILING";
  27773. // 1 << 8 is unused
  27774. FLAGS[FLAGS["TRANSFER_ENCODING"] = 512] = "TRANSFER_ENCODING";
  27775. })(FLAGS = exports.FLAGS || (exports.FLAGS = {}));
  27776. var LENIENT_FLAGS;
  27777. (function (LENIENT_FLAGS) {
  27778. LENIENT_FLAGS[LENIENT_FLAGS["HEADERS"] = 1] = "HEADERS";
  27779. LENIENT_FLAGS[LENIENT_FLAGS["CHUNKED_LENGTH"] = 2] = "CHUNKED_LENGTH";
  27780. LENIENT_FLAGS[LENIENT_FLAGS["KEEP_ALIVE"] = 4] = "KEEP_ALIVE";
  27781. })(LENIENT_FLAGS = exports.LENIENT_FLAGS || (exports.LENIENT_FLAGS = {}));
  27782. var METHODS;
  27783. (function (METHODS) {
  27784. METHODS[METHODS["DELETE"] = 0] = "DELETE";
  27785. METHODS[METHODS["GET"] = 1] = "GET";
  27786. METHODS[METHODS["HEAD"] = 2] = "HEAD";
  27787. METHODS[METHODS["POST"] = 3] = "POST";
  27788. METHODS[METHODS["PUT"] = 4] = "PUT";
  27789. /* pathological */
  27790. METHODS[METHODS["CONNECT"] = 5] = "CONNECT";
  27791. METHODS[METHODS["OPTIONS"] = 6] = "OPTIONS";
  27792. METHODS[METHODS["TRACE"] = 7] = "TRACE";
  27793. /* WebDAV */
  27794. METHODS[METHODS["COPY"] = 8] = "COPY";
  27795. METHODS[METHODS["LOCK"] = 9] = "LOCK";
  27796. METHODS[METHODS["MKCOL"] = 10] = "MKCOL";
  27797. METHODS[METHODS["MOVE"] = 11] = "MOVE";
  27798. METHODS[METHODS["PROPFIND"] = 12] = "PROPFIND";
  27799. METHODS[METHODS["PROPPATCH"] = 13] = "PROPPATCH";
  27800. METHODS[METHODS["SEARCH"] = 14] = "SEARCH";
  27801. METHODS[METHODS["UNLOCK"] = 15] = "UNLOCK";
  27802. METHODS[METHODS["BIND"] = 16] = "BIND";
  27803. METHODS[METHODS["REBIND"] = 17] = "REBIND";
  27804. METHODS[METHODS["UNBIND"] = 18] = "UNBIND";
  27805. METHODS[METHODS["ACL"] = 19] = "ACL";
  27806. /* subversion */
  27807. METHODS[METHODS["REPORT"] = 20] = "REPORT";
  27808. METHODS[METHODS["MKACTIVITY"] = 21] = "MKACTIVITY";
  27809. METHODS[METHODS["CHECKOUT"] = 22] = "CHECKOUT";
  27810. METHODS[METHODS["MERGE"] = 23] = "MERGE";
  27811. /* upnp */
  27812. METHODS[METHODS["M-SEARCH"] = 24] = "M-SEARCH";
  27813. METHODS[METHODS["NOTIFY"] = 25] = "NOTIFY";
  27814. METHODS[METHODS["SUBSCRIBE"] = 26] = "SUBSCRIBE";
  27815. METHODS[METHODS["UNSUBSCRIBE"] = 27] = "UNSUBSCRIBE";
  27816. /* RFC-5789 */
  27817. METHODS[METHODS["PATCH"] = 28] = "PATCH";
  27818. METHODS[METHODS["PURGE"] = 29] = "PURGE";
  27819. /* CalDAV */
  27820. METHODS[METHODS["MKCALENDAR"] = 30] = "MKCALENDAR";
  27821. /* RFC-2068, section 19.6.1.2 */
  27822. METHODS[METHODS["LINK"] = 31] = "LINK";
  27823. METHODS[METHODS["UNLINK"] = 32] = "UNLINK";
  27824. /* icecast */
  27825. METHODS[METHODS["SOURCE"] = 33] = "SOURCE";
  27826. /* RFC-7540, section 11.6 */
  27827. METHODS[METHODS["PRI"] = 34] = "PRI";
  27828. /* RFC-2326 RTSP */
  27829. METHODS[METHODS["DESCRIBE"] = 35] = "DESCRIBE";
  27830. METHODS[METHODS["ANNOUNCE"] = 36] = "ANNOUNCE";
  27831. METHODS[METHODS["SETUP"] = 37] = "SETUP";
  27832. METHODS[METHODS["PLAY"] = 38] = "PLAY";
  27833. METHODS[METHODS["PAUSE"] = 39] = "PAUSE";
  27834. METHODS[METHODS["TEARDOWN"] = 40] = "TEARDOWN";
  27835. METHODS[METHODS["GET_PARAMETER"] = 41] = "GET_PARAMETER";
  27836. METHODS[METHODS["SET_PARAMETER"] = 42] = "SET_PARAMETER";
  27837. METHODS[METHODS["REDIRECT"] = 43] = "REDIRECT";
  27838. METHODS[METHODS["RECORD"] = 44] = "RECORD";
  27839. /* RAOP */
  27840. METHODS[METHODS["FLUSH"] = 45] = "FLUSH";
  27841. })(METHODS = exports.METHODS || (exports.METHODS = {}));
  27842. exports.METHODS_HTTP = [
  27843. METHODS.DELETE,
  27844. METHODS.GET,
  27845. METHODS.HEAD,
  27846. METHODS.POST,
  27847. METHODS.PUT,
  27848. METHODS.CONNECT,
  27849. METHODS.OPTIONS,
  27850. METHODS.TRACE,
  27851. METHODS.COPY,
  27852. METHODS.LOCK,
  27853. METHODS.MKCOL,
  27854. METHODS.MOVE,
  27855. METHODS.PROPFIND,
  27856. METHODS.PROPPATCH,
  27857. METHODS.SEARCH,
  27858. METHODS.UNLOCK,
  27859. METHODS.BIND,
  27860. METHODS.REBIND,
  27861. METHODS.UNBIND,
  27862. METHODS.ACL,
  27863. METHODS.REPORT,
  27864. METHODS.MKACTIVITY,
  27865. METHODS.CHECKOUT,
  27866. METHODS.MERGE,
  27867. METHODS['M-SEARCH'],
  27868. METHODS.NOTIFY,
  27869. METHODS.SUBSCRIBE,
  27870. METHODS.UNSUBSCRIBE,
  27871. METHODS.PATCH,
  27872. METHODS.PURGE,
  27873. METHODS.MKCALENDAR,
  27874. METHODS.LINK,
  27875. METHODS.UNLINK,
  27876. METHODS.PRI,
  27877. // TODO(indutny): should we allow it with HTTP?
  27878. METHODS.SOURCE,
  27879. ];
  27880. exports.METHODS_ICE = [
  27881. METHODS.SOURCE,
  27882. ];
  27883. exports.METHODS_RTSP = [
  27884. METHODS.OPTIONS,
  27885. METHODS.DESCRIBE,
  27886. METHODS.ANNOUNCE,
  27887. METHODS.SETUP,
  27888. METHODS.PLAY,
  27889. METHODS.PAUSE,
  27890. METHODS.TEARDOWN,
  27891. METHODS.GET_PARAMETER,
  27892. METHODS.SET_PARAMETER,
  27893. METHODS.REDIRECT,
  27894. METHODS.RECORD,
  27895. METHODS.FLUSH,
  27896. // For AirPlay
  27897. METHODS.GET,
  27898. METHODS.POST,
  27899. ];
  27900. exports.METHOD_MAP = utils_1.enumToMap(METHODS);
  27901. exports.H_METHOD_MAP = {};
  27902. Object.keys(exports.METHOD_MAP).forEach((key) => {
  27903. if (/^H/.test(key)) {
  27904. exports.H_METHOD_MAP[key] = exports.METHOD_MAP[key];
  27905. }
  27906. });
  27907. var FINISH;
  27908. (function (FINISH) {
  27909. FINISH[FINISH["SAFE"] = 0] = "SAFE";
  27910. FINISH[FINISH["SAFE_WITH_CB"] = 1] = "SAFE_WITH_CB";
  27911. FINISH[FINISH["UNSAFE"] = 2] = "UNSAFE";
  27912. })(FINISH = exports.FINISH || (exports.FINISH = {}));
  27913. exports.ALPHA = [];
  27914. for (let i = 'A'.charCodeAt(0); i <= 'Z'.charCodeAt(0); i++) {
  27915. // Upper case
  27916. exports.ALPHA.push(String.fromCharCode(i));
  27917. // Lower case
  27918. exports.ALPHA.push(String.fromCharCode(i + 0x20));
  27919. }
  27920. exports.NUM_MAP = {
  27921. 0: 0, 1: 1, 2: 2, 3: 3, 4: 4,
  27922. 5: 5, 6: 6, 7: 7, 8: 8, 9: 9,
  27923. };
  27924. exports.HEX_MAP = {
  27925. 0: 0, 1: 1, 2: 2, 3: 3, 4: 4,
  27926. 5: 5, 6: 6, 7: 7, 8: 8, 9: 9,
  27927. A: 0XA, B: 0XB, C: 0XC, D: 0XD, E: 0XE, F: 0XF,
  27928. a: 0xa, b: 0xb, c: 0xc, d: 0xd, e: 0xe, f: 0xf,
  27929. };
  27930. exports.NUM = [
  27931. '0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
  27932. ];
  27933. exports.ALPHANUM = exports.ALPHA.concat(exports.NUM);
  27934. exports.MARK = ['-', '_', '.', '!', '~', '*', '\'', '(', ')'];
  27935. exports.USERINFO_CHARS = exports.ALPHANUM
  27936. .concat(exports.MARK)
  27937. .concat(['%', ';', ':', '&', '=', '+', '$', ',']);
  27938. // TODO(indutny): use RFC
  27939. exports.STRICT_URL_CHAR = [
  27940. '!', '"', '$', '%', '&', '\'',
  27941. '(', ')', '*', '+', ',', '-', '.', '/',
  27942. ':', ';', '<', '=', '>',
  27943. '@', '[', '\\', ']', '^', '_',
  27944. '`',
  27945. '{', '|', '}', '~',
  27946. ].concat(exports.ALPHANUM);
  27947. exports.URL_CHAR = exports.STRICT_URL_CHAR
  27948. .concat(['\t', '\f']);
  27949. // All characters with 0x80 bit set to 1
  27950. for (let i = 0x80; i <= 0xff; i++) {
  27951. exports.URL_CHAR.push(i);
  27952. }
  27953. exports.HEX = exports.NUM.concat(['a', 'b', 'c', 'd', 'e', 'f', 'A', 'B', 'C', 'D', 'E', 'F']);
  27954. /* Tokens as defined by rfc 2616. Also lowercases them.
  27955. * token = 1*<any CHAR except CTLs or separators>
  27956. * separators = "(" | ")" | "<" | ">" | "@"
  27957. * | "," | ";" | ":" | "\" | <">
  27958. * | "/" | "[" | "]" | "?" | "="
  27959. * | "{" | "}" | SP | HT
  27960. */
  27961. exports.STRICT_TOKEN = [
  27962. '!', '#', '$', '%', '&', '\'',
  27963. '*', '+', '-', '.',
  27964. '^', '_', '`',
  27965. '|', '~',
  27966. ].concat(exports.ALPHANUM);
  27967. exports.TOKEN = exports.STRICT_TOKEN.concat([' ']);
  27968. /*
  27969. * Verify that a char is a valid visible (printable) US-ASCII
  27970. * character or %x80-FF
  27971. */
  27972. exports.HEADER_CHARS = ['\t'];
  27973. for (let i = 32; i <= 255; i++) {
  27974. if (i !== 127) {
  27975. exports.HEADER_CHARS.push(i);
  27976. }
  27977. }
  27978. // ',' = \x44
  27979. exports.CONNECTION_TOKEN_CHARS = exports.HEADER_CHARS.filter((c) => c !== 44);
  27980. exports.MAJOR = exports.NUM_MAP;
  27981. exports.MINOR = exports.MAJOR;
  27982. var HEADER_STATE;
  27983. (function (HEADER_STATE) {
  27984. HEADER_STATE[HEADER_STATE["GENERAL"] = 0] = "GENERAL";
  27985. HEADER_STATE[HEADER_STATE["CONNECTION"] = 1] = "CONNECTION";
  27986. HEADER_STATE[HEADER_STATE["CONTENT_LENGTH"] = 2] = "CONTENT_LENGTH";
  27987. HEADER_STATE[HEADER_STATE["TRANSFER_ENCODING"] = 3] = "TRANSFER_ENCODING";
  27988. HEADER_STATE[HEADER_STATE["UPGRADE"] = 4] = "UPGRADE";
  27989. HEADER_STATE[HEADER_STATE["CONNECTION_KEEP_ALIVE"] = 5] = "CONNECTION_KEEP_ALIVE";
  27990. HEADER_STATE[HEADER_STATE["CONNECTION_CLOSE"] = 6] = "CONNECTION_CLOSE";
  27991. HEADER_STATE[HEADER_STATE["CONNECTION_UPGRADE"] = 7] = "CONNECTION_UPGRADE";
  27992. HEADER_STATE[HEADER_STATE["TRANSFER_ENCODING_CHUNKED"] = 8] = "TRANSFER_ENCODING_CHUNKED";
  27993. })(HEADER_STATE = exports.HEADER_STATE || (exports.HEADER_STATE = {}));
  27994. exports.SPECIAL_HEADERS = {
  27995. 'connection': HEADER_STATE.CONNECTION,
  27996. 'content-length': HEADER_STATE.CONTENT_LENGTH,
  27997. 'proxy-connection': HEADER_STATE.CONNECTION,
  27998. 'transfer-encoding': HEADER_STATE.TRANSFER_ENCODING,
  27999. 'upgrade': HEADER_STATE.UPGRADE,
  28000. };
  28001. //# sourceMappingURL=constants.js.map
  28002. /***/ }),
  28003. /***/ 1145:
  28004. /***/ ((module) => {
  28005. module.exports = 'AGFzbQEAAAABMAhgAX8Bf2ADf39/AX9gBH9/f38Bf2AAAGADf39/AGABfwBgAn9/AGAGf39/f39/AALLAQgDZW52GHdhc21f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AAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCAQDscBAAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxweHyAhIyUoP0BBREVGR0hJSktMTU9QUVJT3gNXWVtcXWBiZWZnaGlqa2xtb3BxcnN0dXZ3eHl6e3x9foABggGFAYYBhwGJ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AAADxAREhMUAAtBHiEQDL0DC0ICIREM5QELQgMhEQzkAQtCBCERDOMBC0IFIREM4gELQgYhEQzhAQtCByERDOABC0IIIREM3wELQgkhEQzeAQtCCiERDN0BC0ILIREM3AELQgwhEQzbAQtCDSERDNoBC0IOIREM2QELQg8hEQzYAQtCCiERDNcBC0ILIREM1gELQgwhEQzVAQtCDSERDNQBC0IOIREM0wELQg8hEQzSAQtCACERAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCAQLQAAQVBqDjflAeQBAAECAwQFBgfmAeYB5gHmAeYB5gHmAQgJCgsMDeYB5gHmAeYB5gHmAeYB5gHmAeYB5gHmAeYB5gHmAeYB5gHmAeYB5gHmAeYB5gHmAeYB5gEODxAREhPmAQtCAiERDOQBC0IDIREM4wELQgQhEQziAQtCBSERDOEBC0IGIREM4AELQgchEQzfAQtCCCERDN4BC0IJIREM3QELQgohEQzcAQtCCyERDNsBC0IMIREM2gELQg0hEQzZAQtCDiERDNgBC0IPIREM1wELQgohEQzWAQtCCyERDNUBC0IMIREM1AELQg0hEQzTAQtCDiERDNIBC0IPIREM0QELIABCACAAKQMgIhEgAiABIhBrrSISfSITIBMgEVYbNwMgIBEgElYiFEUN0gFBHyEQDMADCwJAIAEiASACRg0AIABBiYCAgAA2AgggACABNgIEIAEhAUEkIRAMpwMLQSAhEAy/AwsgACABIhAgAhC+gICAAEF/ag4FtgEAxQIB0QHSAQtBESEQDKQDCyAAQQE6AC8gECEBDLsDCyABIgEgAkcN0gFBJCEQDLsDCyABIg0gAkcNHkHGACEQDLoDCyAAIAEiASACELKAgIAAIhAN1AEgASEBDLUBCyABIhAgAkcNJkHQACEQDLgDCwJAIAEiASACRw0AQSghEAy4AwsgAEEANgIEIABBjICAgAA2AgggACABIAEQsYCAgAAiEA3TASABIQEM2AELAkAgASIQIAJHDQBBKSEQDLcDCyAQLQAAIgFBIEYNFCABQQlHDdMBIBBBAWohAQwVCwJAIAEiASACRg0AIAFBAWoh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AgATYCFCAAIBA2AgxBACEQDLMBCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQp4CAgAAiEA0AIAEhAQxNCyAAQdIANgIcIAAgATYCFCAAIBA2AgxBACEQDLIBCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQp4CAgAAiEA0AIAEhAQxNCyAAQdMANgIcIAAgATYCFCAAIBA2AgxBACEQDLEBCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQp4CAgAAiEA0AIAEhAQxRCyAAQeUANgIcIAAgATYCFCAAIBA2AgxBACEQDLABCyAAQQA2AhwgACABNgIUIABBxoqAgAA2AhAgAEEHNgIMQQAhEAyvAQsgACgCBCEQIABBADYCBAJAIAAgECABEKeAgIAAIhANACABIQEMSQsgAEHSADYCHCAAIAE2AhQgACAQNgIMQQAhEAyuAQsgACgCBCEQIABBADYCBAJAIAAgECABEKeAgIAAIhANACABIQEMSQsgAEHTADYCHCAAIAE2AhQgACAQNgIMQQAhEAytAQsgACgCBCEQIABBADYCBAJAIAAgECABEKeAgIAAIhANACABIQEMTQsgAEHlADYCHCAAIAE2AhQgACAQNgIMQQAhEAysAQsgAEEANgIcIAAgATYCFCAAQdyIgIAANgIQIABBBzYCDEEAIRAMqwELIBBBP0cNASABQQFqIQELQQUhEAyQAQtBACEQIABBADYCHCAAIAE2AhQgAEH9koCAADYCECAAQQc2AgwMqAELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDEILIABB0gA2AhwgACABNgIUIAAgEDYCDEEAIRAMpwELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDEILIABB0wA2AhwgACABNgIUIAAgEDYCDEEAIRAMpgELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDEYLIABB5QA2AhwgACABNgIUIAAgEDYCDEEAIRAMpQELIAAoAgQhASAAQQA2AgQCQCAAIAEgFBCngICAACIBDQAgFCEBDD8LIABB0gA2AhwgACAUNgIUIAAgATYCDEEAI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ECcUUNAQwCC0EAIQEgAC8BMCICQQFxRQ0BC0EBIQEgAC0AKEEBRg0AIAAvATJB//8DcSIAQZx/akHkAEkNACAAQcwBRg0AIABBsAJGDQAgAkHAAHENAEEAIQEgAkGIBHFBgARGDQAgAkEocUEARyEBCyABC0kBAXsgAEEQav0MAAAAAAAAAAAAAAAAAAAAACIB/QsDACAAIAH9CwMAIABBMGogAf0LAwAgAEEgaiAB/QsDACAAQd0BNgIcQQALewEBfwJAIAAoAgwiAw0AAkAgACgCBEUNACAAIAE2AgQLAkAgACABIAIQxICAgAAiAw0AIAAoAgwPCyAAIAM2AhxBACEDIAAoAgQiAUUNACAAIAEgAiAAKAIIEYGAgIAAACIBRQ0AIAAgAjYCFCAAIAE2AgwgASEDCyADC+TzAQMOfwN+BH8jgICAgABBEGsiAySAgICAACABIQQgASEFIAEhBiABIQcgASEIIAEhCSABIQogASELIAEhDCABIQ0gASEOIAEhDwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCAAKAIcIhBBf2oO3QHaAQH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AwmC0GfASEQDCULQaABIRAMJAtBoQEhEAwjC0GiASEQDCILQaMBIRAMIQtBpAEhEAwgC0GlASEQDB8LQaYBIRAMHgtBpwEhEAwdC0GoASEQDBwLQakBIRAMGwtBqgEhEAwaC0GrASEQDBkLQawBIRAMGAtBrQEhEAwXC0GuASEQDBYLQQEhEAwVC0GvASEQDBQLQbABIRAMEwtBsQEhEAwSC0GzASEQDBELQbIBIRAMEAtBtAEhEAwPC0G1ASEQDA4LQbYBIRAMDQtBtwEhEAwMC0G4ASEQDAsLQbkBIRAMCgtBugEhEAwJC0G7ASEQDAgLQcYBIRAMBwtBvAEhEAwGC0G9ASEQDAULQb4BIRAMBAtBvwEhEAwDC0HAASEQDAILQcIBIRAMAQtBwQEhEAsDQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAk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oAIRAM+wMLIAEiASACRw17QegAIRAM+gMLIAEiASACRw14QeYAIRAM+QMLIAEiASACRw0aQRghEAz4AwsgASIBIAJHDRRBEiEQDPcDCyABIgEgAkcNWUHFACEQDPYDCyABIgEgAkcNSkE/IRAM9QMLIAEiASACRw1IQTwhEAz0AwsgASIBIAJHDUFBMSEQDPMDCyAALQAuQQFGDesDDIcCCyAAIAEiASACEMCAgIAAQQFHDeYBIABCADcDIAznAQsgACABIgEgAhC0gICAACIQDecBIAEhAQz1AgsCQCABIgEgAkcNAEEGIRAM8AMLIAAgAUEBaiIBIAIQu4CAgAAiEA3oASABIQEMMQsgAEIANwMgQRIhEAzVAwsgASIQIAJHDStBHSEQDO0DCwJAIAEiASACRg0AIAFBAWohAUEQIRAM1AMLQQchEAzsAwsgAEIAIAApAyAiESACIAEiEGutIhJ9IhMgEyARVhs3AyAgESASViIURQ3lAUEIIRAM6wMLAkAgASIBIAJGDQAgAEGJgICAADYCCCAAIAE2AgQgASEBQRQhEAzSAwtBCSEQDOoDCyABIQEgACkDIFAN5AEgASEBDPICCwJAIAEiASACRw0AQQshEAzpAwsgACABQQFqIgEgAhC2gICAACIQDeUBIAEhAQzyAgsgACABIgEgAhC4gICAACIQDeUBIAEhAQzyAgsgACABIgEgAhC4gICAACIQDeYBIAEhAQwNCyAAIAEiASACELqAgIAAIhAN5wEgASEBDPACCwJAIAEiASACRw0AQQ8hEAzlAwsgAS0AACIQQTtGDQggEEENRw3oASABQQFqIQEM7wILIAAgASIBIAIQuoCAgAAiEA3oASABIQEM8gILA0ACQCABLQAAQfC1gIAAai0AACIQQQFGDQAgEEECRw3rASAAKAIEIRAgAEEANgIEIAAgECABQQFqIgEQuYCAgAAiEA3qASABIQEM9AILIAFBAWoiASACRw0AC0ESIRAM4gMLIAAgASIBIAIQuoCAgAAiEA3pASABIQEMCgsgASIBIAJHDQZBGyEQDOADCwJAIAEiASACRw0AQRYhEAzgAwsgAEGKgICAADYCCCAAIAE2AgQgACABIAIQuICA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IRAMogELIAAoAgQhBCAAQQA2AgQCQCAAIAQgARCtgICAACIEDQAgASEBDKcBCyAAQd4ANgIcIAAgATYCFCAAIAQ2AgxBACEQDLoBCyAAQQA2AgAgF0EBaiEBAkAgAC0AKUEjTw0AIAEhAQxZCyAAQQA2AhwgACABNgIUIABB04mAgAA2AhAgAEEINgIMQQAhEAy5AQsgAEEANgIAC0EAIRAgAEEANgIcIAAgATYCFCAAQZCzgIAANgIQIABBCDYCDAy3AQsgAEEANgIAIBdBAWohAQJAIAAtAClBIUcNACABIQEMVgsgAEEANgIcIAAgATYCFCAAQZuKgIAANgIQIABBCDYCDEEAIRAMtgELIABBADYCACAXQQFqIQECQCAALQApIhBBXWpBC08NACABIQEMVQsCQCAQQQZLDQBBASAQdEHKAHFFDQAgASEBDFULQQAhECAAQQA2AhwgACABNgIUIABB94mAgAA2AhAgAEEINgIMDLUBCyAQQRVGDXEgAEEANgIcIAAgATYCFCAAQbmNgIAANgIQIABBGjYCDEEAIRAMtAELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDFQLIABB5QA2AhwgACABNgIUIAAgEDYCDEEAIRAMswELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDE0LIABB0gA2AhwgACABNgIUIAAgEDYCDEEAIRAMsgELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDE0LIABB0wA2AhwgACABNgIUIAAgEDYCDEEAIRAMsQELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDFELIABB5QA2AhwgACABNgIUIAAgEDYCDEEAIRAMsAELIABBADYCHCAAIAE2AhQgAEHGioCAADYCECAAQQc2AgxBACEQDK8BCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQp4CAgAAiEA0AIAEhAQxJCyAAQdIANgIcIAAgATYCFCAAIBA2AgxBACEQDK4BCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQp4CAgAAiEA0AIAEhAQxJC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UFZU1RBVENIR0VPUkRJUkVDVE9SVFJDSFBBUkFNRVRFUlVSQ0VCU0NSSUJFQVJET1dOQUNFSU5ETktDS1VCU0NSSUJFSFRUUC9BRFRQLw=='
  28010. /***/ }),
  28011. /***/ 1891:
  28012. /***/ ((__unused_webpack_module, exports) => {
  28013. "use strict";
  28014. Object.defineProperty(exports, "__esModule", ({ value: true }));
  28015. exports.enumToMap = void 0;
  28016. function enumToMap(obj) {
  28017. const res = {};
  28018. Object.keys(obj).forEach((key) => {
  28019. const value = obj[key];
  28020. if (typeof value === 'number') {
  28021. res[key] = value;
  28022. }
  28023. });
  28024. return res;
  28025. }
  28026. exports.enumToMap = enumToMap;
  28027. //# sourceMappingURL=utils.js.map
  28028. /***/ }),
  28029. /***/ 6771:
  28030. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  28031. "use strict";
  28032. const { kClients } = __nccwpck_require__(2785)
  28033. const Agent = __nccwpck_require__(7890)
  28034. const {
  28035. kAgent,
  28036. kMockAgentSet,
  28037. kMockAgentGet,
  28038. kDispatches,
  28039. kIsMockActive,
  28040. kNetConnect,
  28041. kGetNetConnect,
  28042. kOptions,
  28043. kFactory
  28044. } = __nccwpck_require__(4347)
  28045. const MockClient = __nccwpck_require__(8687)
  28046. const MockPool = __nccwpck_require__(6193)
  28047. const { matchValue, buildMockOptions } = __nccwpck_require__(9323)
  28048. const { InvalidArgumentError, UndiciError } = __nccwpck_require__(8045)
  28049. const Dispatcher = __nccwpck_require__(412)
  28050. const Pluralizer = __nccwpck_require__(8891)
  28051. const PendingInterceptorsFormatter = __nccwpck_require__(6823)
  28052. class FakeWeakRef {
  28053. constructor (value) {
  28054. this.value = value
  28055. }
  28056. deref () {
  28057. return this.value
  28058. }
  28059. }
  28060. class MockAgent extends Dispatcher {
  28061. constructor (opts) {
  28062. super(opts)
  28063. this[kNetConnect] = true
  28064. this[kIsMockActive] = true
  28065. // Instantiate Agent and encapsulate
  28066. if ((opts && opts.agent && typeof opts.agent.dispatch !== 'function')) {
  28067. throw new InvalidArgumentError('Argument opts.agent must implement Agent')
  28068. }
  28069. const agent = opts && opts.agent ? opts.agent : new Agent(opts)
  28070. this[kAgent] = agent
  28071. this[kClients] = agent[kClients]
  28072. this[kOptions] = buildMockOptions(opts)
  28073. }
  28074. get (origin) {
  28075. let dispatcher = this[kMockAgentGet](origin)
  28076. if (!dispatcher) {
  28077. dispatcher = this[kFactory](origin)
  28078. this[kMockAgentSet](origin, dispatcher)
  28079. }
  28080. return dispatcher
  28081. }
  28082. dispatch (opts, handler) {
  28083. // Call MockAgent.get to perform additional setup before dispatching as normal
  28084. this.get(opts.origin)
  28085. return this[kAgent].dispatch(opts, handler)
  28086. }
  28087. async close () {
  28088. await this[kAgent].close()
  28089. this[kClients].clear()
  28090. }
  28091. deactivate () {
  28092. this[kIsMockActive] = false
  28093. }
  28094. activate () {
  28095. this[kIsMockActive] = true
  28096. }
  28097. enableNetConnect (matcher) {
  28098. if (typeof matcher === 'string' || typeof matcher === 'function' || matcher instanceof RegExp) {
  28099. if (Array.isArray(this[kNetConnect])) {
  28100. this[kNetConnect].push(matcher)
  28101. } else {
  28102. this[kNetConnect] = [matcher]
  28103. }
  28104. } else if (typeof matcher === 'undefined') {
  28105. this[kNetConnect] = true
  28106. } else {
  28107. throw new InvalidArgumentError('Unsupported matcher. Must be one of String|Function|RegExp.')
  28108. }
  28109. }
  28110. disableNetConnect () {
  28111. this[kNetConnect] = false
  28112. }
  28113. // This is required to bypass issues caused by using global symbols - see:
  28114. // https://github.com/nodejs/undici/issues/1447
  28115. get isMockActive () {
  28116. return this[kIsMockActive]
  28117. }
  28118. [kMockAgentSet] (origin, dispatcher) {
  28119. this[kClients].set(origin, new FakeWeakRef(dispatcher))
  28120. }
  28121. [kFactory] (origin) {
  28122. const mockOptions = Object.assign({ agent: this }, this[kOptions])
  28123. return this[kOptions] && this[kOptions].connections === 1
  28124. ? new MockClient(origin, mockOptions)
  28125. : new MockPool(origin, mockOptions)
  28126. }
  28127. [kMockAgentGet] (origin) {
  28128. // First check if we can immediately find it
  28129. const ref = this[kClients].get(origin)
  28130. if (ref) {
  28131. return ref.deref()
  28132. }
  28133. // If the origin is not a string create a dummy parent pool and return to user
  28134. if (typeof origin !== 'string') {
  28135. const dispatcher = this[kFactory]('http://localhost:9999')
  28136. this[kMockAgentSet](origin, dispatcher)
  28137. return dispatcher
  28138. }
  28139. // If we match, create a pool and assign the same dispatches
  28140. for (const [keyMatcher, nonExplicitRef] of Array.from(this[kClients])) {
  28141. const nonExplicitDispatcher = nonExplicitRef.deref()
  28142. if (nonExplicitDispatcher && typeof keyMatcher !== 'string' && matchValue(keyMatcher, origin)) {
  28143. const dispatcher = this[kFactory](origin)
  28144. this[kMockAgentSet](origin, dispatcher)
  28145. dispatcher[kDispatches] = nonExplicitDispatcher[kDispatches]
  28146. return dispatcher
  28147. }
  28148. }
  28149. }
  28150. [kGetNetConnect] () {
  28151. return this[kNetConnect]
  28152. }
  28153. pendingInterceptors () {
  28154. const mockAgentClients = this[kClients]
  28155. return Array.from(mockAgentClients.entries())
  28156. .flatMap(([origin, scope]) => scope.deref()[kDispatches].map(dispatch => ({ ...dispatch, origin })))
  28157. .filter(({ pending }) => pending)
  28158. }
  28159. assertNoPendingInterceptors ({ pendingInterceptorsFormatter = new PendingInterceptorsFormatter() } = {}) {
  28160. const pending = this.pendingInterceptors()
  28161. if (pending.length === 0) {
  28162. return
  28163. }
  28164. const pluralizer = new Pluralizer('interceptor', 'interceptors').pluralize(pending.length)
  28165. throw new UndiciError(`
  28166. ${pluralizer.count} ${pluralizer.noun} ${pluralizer.is} pending:
  28167. ${pendingInterceptorsFormatter.format(pending)}
  28168. `.trim())
  28169. }
  28170. }
  28171. module.exports = MockAgent
  28172. /***/ }),
  28173. /***/ 8687:
  28174. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  28175. "use strict";
  28176. const { promisify } = __nccwpck_require__(3837)
  28177. const Client = __nccwpck_require__(3598)
  28178. const { buildMockDispatch } = __nccwpck_require__(9323)
  28179. const {
  28180. kDispatches,
  28181. kMockAgent,
  28182. kClose,
  28183. kOriginalClose,
  28184. kOrigin,
  28185. kOriginalDispatch,
  28186. kConnected
  28187. } = __nccwpck_require__(4347)
  28188. const { MockInterceptor } = __nccwpck_require__(410)
  28189. const Symbols = __nccwpck_require__(2785)
  28190. const { InvalidArgumentError } = __nccwpck_require__(8045)
  28191. /**
  28192. * MockClient provides an API that extends the Client to influence the mockDispatches.
  28193. */
  28194. class MockClient extends Client {
  28195. constructor (origin, opts) {
  28196. super(origin, opts)
  28197. if (!opts || !opts.agent || typeof opts.agent.dispatch !== 'function') {
  28198. throw new InvalidArgumentError('Argument opts.agent must implement Agent')
  28199. }
  28200. this[kMockAgent] = opts.agent
  28201. this[kOrigin] = origin
  28202. this[kDispatches] = []
  28203. this[kConnected] = 1
  28204. this[kOriginalDispatch] = this.dispatch
  28205. this[kOriginalClose] = this.close.bind(this)
  28206. this.dispatch = buildMockDispatch.call(this)
  28207. this.close = this[kClose]
  28208. }
  28209. get [Symbols.kConnected] () {
  28210. return this[kConnected]
  28211. }
  28212. /**
  28213. * Sets up the base interceptor for mocking replies from undici.
  28214. */
  28215. intercept (opts) {
  28216. return new MockInterceptor(opts, this[kDispatches])
  28217. }
  28218. async [kClose] () {
  28219. await promisify(this[kOriginalClose])()
  28220. this[kConnected] = 0
  28221. this[kMockAgent][Symbols.kClients].delete(this[kOrigin])
  28222. }
  28223. }
  28224. module.exports = MockClient
  28225. /***/ }),
  28226. /***/ 888:
  28227. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  28228. "use strict";
  28229. const { UndiciError } = __nccwpck_require__(8045)
  28230. class MockNotMatchedError extends UndiciError {
  28231. constructor (message) {
  28232. super(message)
  28233. Error.captureStackTrace(this, MockNotMatchedError)
  28234. this.name = 'MockNotMatchedError'
  28235. this.message = message || 'The request does not match any registered mock dispatches'
  28236. this.code = 'UND_MOCK_ERR_MOCK_NOT_MATCHED'
  28237. }
  28238. }
  28239. module.exports = {
  28240. MockNotMatchedError
  28241. }
  28242. /***/ }),
  28243. /***/ 410:
  28244. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  28245. "use strict";
  28246. const { getResponseData, buildKey, addMockDispatch } = __nccwpck_require__(9323)
  28247. const {
  28248. kDispatches,
  28249. kDispatchKey,
  28250. kDefaultHeaders,
  28251. kDefaultTrailers,
  28252. kContentLength,
  28253. kMockDispatch
  28254. } = __nccwpck_require__(4347)
  28255. const { InvalidArgumentError } = __nccwpck_require__(8045)
  28256. const { buildURL } = __nccwpck_require__(3983)
  28257. /**
  28258. * Defines the scope API for an interceptor reply
  28259. */
  28260. class MockScope {
  28261. constructor (mockDispatch) {
  28262. this[kMockDispatch] = mockDispatch
  28263. }
  28264. /**
  28265. * Delay a reply by a set amount in ms.
  28266. */
  28267. delay (waitInMs) {
  28268. if (typeof waitInMs !== 'number' || !Number.isInteger(waitInMs) || waitInMs <= 0) {
  28269. throw new InvalidArgumentError('waitInMs must be a valid integer > 0')
  28270. }
  28271. this[kMockDispatch].delay = waitInMs
  28272. return this
  28273. }
  28274. /**
  28275. * For a defined reply, never mark as consumed.
  28276. */
  28277. persist () {
  28278. this[kMockDispatch].persist = true
  28279. return this
  28280. }
  28281. /**
  28282. * Allow one to define a reply for a set amount of matching requests.
  28283. */
  28284. times (repeatTimes) {
  28285. if (typeof repeatTimes !== 'number' || !Number.isInteger(repeatTimes) || repeatTimes <= 0) {
  28286. throw new InvalidArgumentError('repeatTimes must be a valid integer > 0')
  28287. }
  28288. this[kMockDispatch].times = repeatTimes
  28289. return this
  28290. }
  28291. }
  28292. /**
  28293. * Defines an interceptor for a Mock
  28294. */
  28295. class MockInterceptor {
  28296. constructor (opts, mockDispatches) {
  28297. if (typeof opts !== 'object') {
  28298. throw new InvalidArgumentError('opts must be an object')
  28299. }
  28300. if (typeof opts.path === 'undefined') {
  28301. throw new InvalidArgumentError('opts.path must be defined')
  28302. }
  28303. if (typeof opts.method === 'undefined') {
  28304. opts.method = 'GET'
  28305. }
  28306. // See https://github.com/nodejs/undici/issues/1245
  28307. // As per RFC 3986, clients are not supposed to send URI
  28308. // fragments to servers when they retrieve a document,
  28309. if (typeof opts.path === 'string') {
  28310. if (opts.query) {
  28311. opts.path = buildURL(opts.path, opts.query)
  28312. } else {
  28313. // Matches https://github.com/nodejs/undici/blob/main/lib/fetch/index.js#L1811
  28314. const parsedURL = new URL(opts.path, 'data://')
  28315. opts.path = parsedURL.pathname + parsedURL.search
  28316. }
  28317. }
  28318. if (typeof opts.method === 'string') {
  28319. opts.method = opts.method.toUpperCase()
  28320. }
  28321. this[kDispatchKey] = buildKey(opts)
  28322. this[kDispatches] = mockDispatches
  28323. this[kDefaultHeaders] = {}
  28324. this[kDefaultTrailers] = {}
  28325. this[kContentLength] = false
  28326. }
  28327. createMockScopeDispatchData (statusCode, data, responseOptions = {}) {
  28328. const responseData = getResponseData(data)
  28329. const contentLength = this[kContentLength] ? { 'content-length': responseData.length } : {}
  28330. const headers = { ...this[kDefaultHeaders], ...contentLength, ...responseOptions.headers }
  28331. const trailers = { ...this[kDefaultTrailers], ...responseOptions.trailers }
  28332. return { statusCode, data, headers, trailers }
  28333. }
  28334. validateReplyParameters (statusCode, data, responseOptions) {
  28335. if (typeof statusCode === 'undefined') {
  28336. throw new InvalidArgumentError('statusCode must be defined')
  28337. }
  28338. if (typeof data === 'undefined') {
  28339. throw new InvalidArgumentError('data must be defined')
  28340. }
  28341. if (typeof responseOptions !== 'object') {
  28342. throw new InvalidArgumentError('responseOptions must be an object')
  28343. }
  28344. }
  28345. /**
  28346. * Mock an undici request with a defined reply.
  28347. */
  28348. reply (replyData) {
  28349. // Values of reply aren't available right now as they
  28350. // can only be available when the reply callback is invoked.
  28351. if (typeof replyData === 'function') {
  28352. // We'll first wrap the provided callback in another function,
  28353. // this function will properly resolve the data from the callback
  28354. // when invoked.
  28355. const wrappedDefaultsCallback = (opts) => {
  28356. // Our reply options callback contains the parameter for statusCode, data and options.
  28357. const resolvedData = replyData(opts)
  28358. // Check if it is in the right format
  28359. if (typeof resolvedData !== 'object') {
  28360. throw new InvalidArgumentError('reply options callback must return an object')
  28361. }
  28362. const { statusCode, data = '', responseOptions = {} } = resolvedData
  28363. this.validateReplyParameters(statusCode, data, responseOptions)
  28364. // Since the values can be obtained immediately we return them
  28365. // from this higher order function that will be resolved later.
  28366. return {
  28367. ...this.createMockScopeDispatchData(statusCode, data, responseOptions)
  28368. }
  28369. }
  28370. // Add usual dispatch data, but this time set the data parameter to function that will eventually provide data.
  28371. const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], wrappedDefaultsCallback)
  28372. return new MockScope(newMockDispatch)
  28373. }
  28374. // We can have either one or three parameters, if we get here,
  28375. // we should have 1-3 parameters. So we spread the arguments of
  28376. // this function to obtain the parameters, since replyData will always
  28377. // just be the statusCode.
  28378. const [statusCode, data = '', responseOptions = {}] = [...arguments]
  28379. this.validateReplyParameters(statusCode, data, responseOptions)
  28380. // Send in-already provided data like usual
  28381. const dispatchData = this.createMockScopeDispatchData(statusCode, data, responseOptions)
  28382. const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], dispatchData)
  28383. return new MockScope(newMockDispatch)
  28384. }
  28385. /**
  28386. * Mock an undici request with a defined error.
  28387. */
  28388. replyWithError (error) {
  28389. if (typeof error === 'undefined') {
  28390. throw new InvalidArgumentError('error must be defined')
  28391. }
  28392. const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], { error })
  28393. return new MockScope(newMockDispatch)
  28394. }
  28395. /**
  28396. * Set default reply headers on the interceptor for subsequent replies
  28397. */
  28398. defaultReplyHeaders (headers) {
  28399. if (typeof headers === 'undefined') {
  28400. throw new InvalidArgumentError('headers must be defined')
  28401. }
  28402. this[kDefaultHeaders] = headers
  28403. return this
  28404. }
  28405. /**
  28406. * Set default reply trailers on the interceptor for subsequent replies
  28407. */
  28408. defaultReplyTrailers (trailers) {
  28409. if (typeof trailers === 'undefined') {
  28410. throw new InvalidArgumentError('trailers must be defined')
  28411. }
  28412. this[kDefaultTrailers] = trailers
  28413. return this
  28414. }
  28415. /**
  28416. * Set reply content length header for replies on the interceptor
  28417. */
  28418. replyContentLength () {
  28419. this[kContentLength] = true
  28420. return this
  28421. }
  28422. }
  28423. module.exports.MockInterceptor = MockInterceptor
  28424. module.exports.MockScope = MockScope
  28425. /***/ }),
  28426. /***/ 6193:
  28427. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  28428. "use strict";
  28429. const { promisify } = __nccwpck_require__(3837)
  28430. const Pool = __nccwpck_require__(4634)
  28431. const { buildMockDispatch } = __nccwpck_require__(9323)
  28432. const {
  28433. kDispatches,
  28434. kMockAgent,
  28435. kClose,
  28436. kOriginalClose,
  28437. kOrigin,
  28438. kOriginalDispatch,
  28439. kConnected
  28440. } = __nccwpck_require__(4347)
  28441. const { MockInterceptor } = __nccwpck_require__(410)
  28442. const Symbols = __nccwpck_require__(2785)
  28443. const { InvalidArgumentError } = __nccwpck_require__(8045)
  28444. /**
  28445. * MockPool provides an API that extends the Pool to influence the mockDispatches.
  28446. */
  28447. class MockPool extends Pool {
  28448. constructor (origin, opts) {
  28449. super(origin, opts)
  28450. if (!opts || !opts.agent || typeof opts.agent.dispatch !== 'function') {
  28451. throw new InvalidArgumentError('Argument opts.agent must implement Agent')
  28452. }
  28453. this[kMockAgent] = opts.agent
  28454. this[kOrigin] = origin
  28455. this[kDispatches] = []
  28456. this[kConnected] = 1
  28457. this[kOriginalDispatch] = this.dispatch
  28458. this[kOriginalClose] = this.close.bind(this)
  28459. this.dispatch = buildMockDispatch.call(this)
  28460. this.close = this[kClose]
  28461. }
  28462. get [Symbols.kConnected] () {
  28463. return this[kConnected]
  28464. }
  28465. /**
  28466. * Sets up the base interceptor for mocking replies from undici.
  28467. */
  28468. intercept (opts) {
  28469. return new MockInterceptor(opts, this[kDispatches])
  28470. }
  28471. async [kClose] () {
  28472. await promisify(this[kOriginalClose])()
  28473. this[kConnected] = 0
  28474. this[kMockAgent][Symbols.kClients].delete(this[kOrigin])
  28475. }
  28476. }
  28477. module.exports = MockPool
  28478. /***/ }),
  28479. /***/ 4347:
  28480. /***/ ((module) => {
  28481. "use strict";
  28482. module.exports = {
  28483. kAgent: Symbol('agent'),
  28484. kOptions: Symbol('options'),
  28485. kFactory: Symbol('factory'),
  28486. kDispatches: Symbol('dispatches'),
  28487. kDispatchKey: Symbol('dispatch key'),
  28488. kDefaultHeaders: Symbol('default headers'),
  28489. kDefaultTrailers: Symbol('default trailers'),
  28490. kContentLength: Symbol('content length'),
  28491. kMockAgent: Symbol('mock agent'),
  28492. kMockAgentSet: Symbol('mock agent set'),
  28493. kMockAgentGet: Symbol('mock agent get'),
  28494. kMockDispatch: Symbol('mock dispatch'),
  28495. kClose: Symbol('close'),
  28496. kOriginalClose: Symbol('original agent close'),
  28497. kOrigin: Symbol('origin'),
  28498. kIsMockActive: Symbol('is mock active'),
  28499. kNetConnect: Symbol('net connect'),
  28500. kGetNetConnect: Symbol('get net connect'),
  28501. kConnected: Symbol('connected')
  28502. }
  28503. /***/ }),
  28504. /***/ 9323:
  28505. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  28506. "use strict";
  28507. const { MockNotMatchedError } = __nccwpck_require__(888)
  28508. const {
  28509. kDispatches,
  28510. kMockAgent,
  28511. kOriginalDispatch,
  28512. kOrigin,
  28513. kGetNetConnect
  28514. } = __nccwpck_require__(4347)
  28515. const { buildURL, nop } = __nccwpck_require__(3983)
  28516. const { STATUS_CODES } = __nccwpck_require__(3685)
  28517. const {
  28518. types: {
  28519. isPromise
  28520. }
  28521. } = __nccwpck_require__(3837)
  28522. function matchValue (match, value) {
  28523. if (typeof match === 'string') {
  28524. return match === value
  28525. }
  28526. if (match instanceof RegExp) {
  28527. return match.test(value)
  28528. }
  28529. if (typeof match === 'function') {
  28530. return match(value) === true
  28531. }
  28532. return false
  28533. }
  28534. function lowerCaseEntries (headers) {
  28535. return Object.fromEntries(
  28536. Object.entries(headers).map(([headerName, headerValue]) => {
  28537. return [headerName.toLocaleLowerCase(), headerValue]
  28538. })
  28539. )
  28540. }
  28541. /**
  28542. * @param {import('../../index').Headers|string[]|Record<string, string>} headers
  28543. * @param {string} key
  28544. */
  28545. function getHeaderByName (headers, key) {
  28546. if (Array.isArray(headers)) {
  28547. for (let i = 0; i < headers.length; i += 2) {
  28548. if (headers[i].toLocaleLowerCase() === key.toLocaleLowerCase()) {
  28549. return headers[i + 1]
  28550. }
  28551. }
  28552. return undefined
  28553. } else if (typeof headers.get === 'function') {
  28554. return headers.get(key)
  28555. } else {
  28556. return lowerCaseEntries(headers)[key.toLocaleLowerCase()]
  28557. }
  28558. }
  28559. /** @param {string[]} headers */
  28560. function buildHeadersFromArray (headers) { // fetch HeadersList
  28561. const clone = headers.slice()
  28562. const entries = []
  28563. for (let index = 0; index < clone.length; index += 2) {
  28564. entries.push([clone[index], clone[index + 1]])
  28565. }
  28566. return Object.fromEntries(entries)
  28567. }
  28568. function matchHeaders (mockDispatch, headers) {
  28569. if (typeof mockDispatch.headers === 'function') {
  28570. if (Array.isArray(headers)) { // fetch HeadersList
  28571. headers = buildHeadersFromArray(headers)
  28572. }
  28573. return mockDispatch.headers(headers ? lowerCaseEntries(headers) : {})
  28574. }
  28575. if (typeof mockDispatch.headers === 'undefined') {
  28576. return true
  28577. }
  28578. if (typeof headers !== 'object' || typeof mockDispatch.headers !== 'object') {
  28579. return false
  28580. }
  28581. for (const [matchHeaderName, matchHeaderValue] of Object.entries(mockDispatch.headers)) {
  28582. const headerValue = getHeaderByName(headers, matchHeaderName)
  28583. if (!matchValue(matchHeaderValue, headerValue)) {
  28584. return false
  28585. }
  28586. }
  28587. return true
  28588. }
  28589. function safeUrl (path) {
  28590. if (typeof path !== 'string') {
  28591. return path
  28592. }
  28593. const pathSegments = path.split('?')
  28594. if (pathSegments.length !== 2) {
  28595. return path
  28596. }
  28597. const qp = new URLSearchParams(pathSegments.pop())
  28598. qp.sort()
  28599. return [...pathSegments, qp.toString()].join('?')
  28600. }
  28601. function matchKey (mockDispatch, { path, method, body, headers }) {
  28602. const pathMatch = matchValue(mockDispatch.path, path)
  28603. const methodMatch = matchValue(mockDispatch.method, method)
  28604. const bodyMatch = typeof mockDispatch.body !== 'undefined' ? matchValue(mockDispatch.body, body) : true
  28605. const headersMatch = matchHeaders(mockDispatch, headers)
  28606. return pathMatch && methodMatch && bodyMatch && headersMatch
  28607. }
  28608. function getResponseData (data) {
  28609. if (Buffer.isBuffer(data)) {
  28610. return data
  28611. } else if (typeof data === 'object') {
  28612. return JSON.stringify(data)
  28613. } else {
  28614. return data.toString()
  28615. }
  28616. }
  28617. function getMockDispatch (mockDispatches, key) {
  28618. const basePath = key.query ? buildURL(key.path, key.query) : key.path
  28619. const resolvedPath = typeof basePath === 'string' ? safeUrl(basePath) : basePath
  28620. // Match path
  28621. let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path }) => matchValue(safeUrl(path), resolvedPath))
  28622. if (matchedMockDispatches.length === 0) {
  28623. throw new MockNotMatchedError(`Mock dispatch not matched for path '${resolvedPath}'`)
  28624. }
  28625. // Match method
  28626. matchedMockDispatches = matchedMockDispatches.filter(({ method }) => matchValue(method, key.method))
  28627. if (matchedMockDispatches.length === 0) {
  28628. throw new MockNotMatchedError(`Mock dispatch not matched for method '${key.method}'`)
  28629. }
  28630. // Match body
  28631. matchedMockDispatches = matchedMockDispatches.filter(({ body }) => typeof body !== 'undefined' ? matchValue(body, key.body) : true)
  28632. if (matchedMockDispatches.length === 0) {
  28633. throw new MockNotMatchedError(`Mock dispatch not matched for body '${key.body}'`)
  28634. }
  28635. // Match headers
  28636. matchedMockDispatches = matchedMockDispatches.filter((mockDispatch) => matchHeaders(mockDispatch, key.headers))
  28637. if (matchedMockDispatches.length === 0) {
  28638. throw new MockNotMatchedError(`Mock dispatch not matched for headers '${typeof key.headers === 'object' ? JSON.stringify(key.headers) : key.headers}'`)
  28639. }
  28640. return matchedMockDispatches[0]
  28641. }
  28642. function addMockDispatch (mockDispatches, key, data) {
  28643. const baseData = { timesInvoked: 0, times: 1, persist: false, consumed: false }
  28644. const replyData = typeof data === 'function' ? { callback: data } : { ...data }
  28645. const newMockDispatch = { ...baseData, ...key, pending: true, data: { error: null, ...replyData } }
  28646. mockDispatches.push(newMockDispatch)
  28647. return newMockDispatch
  28648. }
  28649. function deleteMockDispatch (mockDispatches, key) {
  28650. const index = mockDispatches.findIndex(dispatch => {
  28651. if (!dispatch.consumed) {
  28652. return false
  28653. }
  28654. return matchKey(dispatch, key)
  28655. })
  28656. if (index !== -1) {
  28657. mockDispatches.splice(index, 1)
  28658. }
  28659. }
  28660. function buildKey (opts) {
  28661. const { path, method, body, headers, query } = opts
  28662. return {
  28663. path,
  28664. method,
  28665. body,
  28666. headers,
  28667. query
  28668. }
  28669. }
  28670. function generateKeyValues (data) {
  28671. return Object.entries(data).reduce((keyValuePairs, [key, value]) => [
  28672. ...keyValuePairs,
  28673. Buffer.from(`${key}`),
  28674. Array.isArray(value) ? value.map(x => Buffer.from(`${x}`)) : Buffer.from(`${value}`)
  28675. ], [])
  28676. }
  28677. /**
  28678. * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Status
  28679. * @param {number} statusCode
  28680. */
  28681. function getStatusText (statusCode) {
  28682. return STATUS_CODES[statusCode] || 'unknown'
  28683. }
  28684. async function getResponse (body) {
  28685. const buffers = []
  28686. for await (const data of body) {
  28687. buffers.push(data)
  28688. }
  28689. return Buffer.concat(buffers).toString('utf8')
  28690. }
  28691. /**
  28692. * Mock dispatch function used to simulate undici dispatches
  28693. */
  28694. function mockDispatch (opts, handler) {
  28695. // Get mock dispatch from built key
  28696. const key = buildKey(opts)
  28697. const mockDispatch = getMockDispatch(this[kDispatches], key)
  28698. mockDispatch.timesInvoked++
  28699. // Here's where we resolve a callback if a callback is present for the dispatch data.
  28700. if (mockDispatch.data.callback) {
  28701. mockDispatch.data = { ...mockDispatch.data, ...mockDispatch.data.callback(opts) }
  28702. }
  28703. // Parse mockDispatch data
  28704. const { data: { statusCode, data, headers, trailers, error }, delay, persist } = mockDispatch
  28705. const { timesInvoked, times } = mockDispatch
  28706. // If it's used up and not persistent, mark as consumed
  28707. mockDispatch.consumed = !persist && timesInvoked >= times
  28708. mockDispatch.pending = timesInvoked < times
  28709. // If specified, trigger dispatch error
  28710. if (error !== null) {
  28711. deleteMockDispatch(this[kDispatches], key)
  28712. handler.onError(error)
  28713. return true
  28714. }
  28715. // Handle the request with a delay if necessary
  28716. if (typeof delay === 'number' && delay > 0) {
  28717. setTimeout(() => {
  28718. handleReply(this[kDispatches])
  28719. }, delay)
  28720. } else {
  28721. handleReply(this[kDispatches])
  28722. }
  28723. function handleReply (mockDispatches, _data = data) {
  28724. // fetch's HeadersList is a 1D string array
  28725. const optsHeaders = Array.isArray(opts.headers)
  28726. ? buildHeadersFromArray(opts.headers)
  28727. : opts.headers
  28728. const body = typeof _data === 'function'
  28729. ? _data({ ...opts, headers: optsHeaders })
  28730. : _data
  28731. // util.types.isPromise is likely needed for jest.
  28732. if (isPromise(body)) {
  28733. // If handleReply is asynchronous, throwing an error
  28734. // in the callback will reject the promise, rather than
  28735. // synchronously throw the error, which breaks some tests.
  28736. // Rather, we wait for the callback to resolve if it is a
  28737. // promise, and then re-run handleReply with the new body.
  28738. body.then((newData) => handleReply(mockDispatches, newData))
  28739. return
  28740. }
  28741. const responseData = getResponseData(body)
  28742. const responseHeaders = generateKeyValues(headers)
  28743. const responseTrailers = generateKeyValues(trailers)
  28744. handler.abort = nop
  28745. handler.onHeaders(statusCode, responseHeaders, resume, getStatusText(statusCode))
  28746. handler.onData(Buffer.from(responseData))
  28747. handler.onComplete(responseTrailers)
  28748. deleteMockDispatch(mockDispatches, key)
  28749. }
  28750. function resume () {}
  28751. return true
  28752. }
  28753. function buildMockDispatch () {
  28754. const agent = this[kMockAgent]
  28755. const origin = this[kOrigin]
  28756. const originalDispatch = this[kOriginalDispatch]
  28757. return function dispatch (opts, handler) {
  28758. if (agent.isMockActive) {
  28759. try {
  28760. mockDispatch.call(this, opts, handler)
  28761. } catch (error) {
  28762. if (error instanceof MockNotMatchedError) {
  28763. const netConnect = agent[kGetNetConnect]()
  28764. if (netConnect === false) {
  28765. throw new MockNotMatchedError(`${error.message}: subsequent request to origin ${origin} was not allowed (net.connect disabled)`)
  28766. }
  28767. if (checkNetConnect(netConnect, origin)) {
  28768. originalDispatch.call(this, opts, handler)
  28769. } else {
  28770. throw new MockNotMatchedError(`${error.message}: subsequent request to origin ${origin} was not allowed (net.connect is not enabled for this origin)`)
  28771. }
  28772. } else {
  28773. throw error
  28774. }
  28775. }
  28776. } else {
  28777. originalDispatch.call(this, opts, handler)
  28778. }
  28779. }
  28780. }
  28781. function checkNetConnect (netConnect, origin) {
  28782. const url = new URL(origin)
  28783. if (netConnect === true) {
  28784. return true
  28785. } else if (Array.isArray(netConnect) && netConnect.some((matcher) => matchValue(matcher, url.host))) {
  28786. return true
  28787. }
  28788. return false
  28789. }
  28790. function buildMockOptions (opts) {
  28791. if (opts) {
  28792. const { agent, ...mockOptions } = opts
  28793. return mockOptions
  28794. }
  28795. }
  28796. module.exports = {
  28797. getResponseData,
  28798. getMockDispatch,
  28799. addMockDispatch,
  28800. deleteMockDispatch,
  28801. buildKey,
  28802. generateKeyValues,
  28803. matchValue,
  28804. getResponse,
  28805. getStatusText,
  28806. mockDispatch,
  28807. buildMockDispatch,
  28808. checkNetConnect,
  28809. buildMockOptions,
  28810. getHeaderByName
  28811. }
  28812. /***/ }),
  28813. /***/ 6823:
  28814. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  28815. "use strict";
  28816. const { Transform } = __nccwpck_require__(2781)
  28817. const { Console } = __nccwpck_require__(6206)
  28818. /**
  28819. * Gets the output of `console.table(…)` as a string.
  28820. */
  28821. module.exports = class PendingInterceptorsFormatter {
  28822. constructor ({ disableColors } = {}) {
  28823. this.transform = new Transform({
  28824. transform (chunk, _enc, cb) {
  28825. cb(null, chunk)
  28826. }
  28827. })
  28828. this.logger = new Console({
  28829. stdout: this.transform,
  28830. inspectOptions: {
  28831. colors: !disableColors && !process.env.CI
  28832. }
  28833. })
  28834. }
  28835. format (pendingInterceptors) {
  28836. const withPrettyHeaders = pendingInterceptors.map(
  28837. ({ method, path, data: { statusCode }, persist, times, timesInvoked, origin }) => ({
  28838. Method: method,
  28839. Origin: origin,
  28840. Path: path,
  28841. 'Status code': statusCode,
  28842. Persistent: persist ? '✅' : '❌',
  28843. Invocations: timesInvoked,
  28844. Remaining: persist ? Infinity : times - timesInvoked
  28845. }))
  28846. this.logger.table(withPrettyHeaders)
  28847. return this.transform.read().toString()
  28848. }
  28849. }
  28850. /***/ }),
  28851. /***/ 8891:
  28852. /***/ ((module) => {
  28853. "use strict";
  28854. const singulars = {
  28855. pronoun: 'it',
  28856. is: 'is',
  28857. was: 'was',
  28858. this: 'this'
  28859. }
  28860. const plurals = {
  28861. pronoun: 'they',
  28862. is: 'are',
  28863. was: 'were',
  28864. this: 'these'
  28865. }
  28866. module.exports = class Pluralizer {
  28867. constructor (singular, plural) {
  28868. this.singular = singular
  28869. this.plural = plural
  28870. }
  28871. pluralize (count) {
  28872. const one = count === 1
  28873. const keys = one ? singulars : plurals
  28874. const noun = one ? this.singular : this.plural
  28875. return { ...keys, count, noun }
  28876. }
  28877. }
  28878. /***/ }),
  28879. /***/ 8266:
  28880. /***/ ((module) => {
  28881. "use strict";
  28882. /* eslint-disable */
  28883. // Extracted from node/lib/internal/fixed_queue.js
  28884. // Currently optimal queue size, tested on V8 6.0 - 6.6. Must be power of two.
  28885. const kSize = 2048;
  28886. const kMask = kSize - 1;
  28887. // The FixedQueue is implemented as a singly-linked list of fixed-size
  28888. // circular buffers. It looks something like this:
  28889. //
  28890. // head tail
  28891. // | |
  28892. // v v
  28893. // +-----------+ <-----\ +-----------+ <------\ +-----------+
  28894. // | [null] | \----- | next | \------- | next |
  28895. // +-----------+ +-----------+ +-----------+
  28896. // | item | <-- bottom | item | <-- bottom | [empty] |
  28897. // | item | | item | | [empty] |
  28898. // | item | | item | | [empty] |
  28899. // | item | | item | | [empty] |
  28900. // | item | | item | bottom --> | item |
  28901. // | item | | item | | item |
  28902. // | ... | | ... | | ... |
  28903. // | item | | item | | item |
  28904. // | item | | item | | item |
  28905. // | [empty] | <-- top | item | | item |
  28906. // | [empty] | | item | | item |
  28907. // | [empty] | | [empty] | <-- top top --> | [empty] |
  28908. // +-----------+ +-----------+ +-----------+
  28909. //
  28910. // Or, if there is only one circular buffer, it looks something
  28911. // like either of these:
  28912. //
  28913. // head tail head tail
  28914. // | | | |
  28915. // v v v v
  28916. // +-----------+ +-----------+
  28917. // | [null] | | [null] |
  28918. // +-----------+ +-----------+
  28919. // | [empty] | | item |
  28920. // | [empty] | | item |
  28921. // | item | <-- bottom top --> | [empty] |
  28922. // | item | | [empty] |
  28923. // | [empty] | <-- top bottom --> | item |
  28924. // | [empty] | | item |
  28925. // +-----------+ +-----------+
  28926. //
  28927. // Adding a value means moving `top` forward by one, removing means
  28928. // moving `bottom` forward by one. After reaching the end, the queue
  28929. // wraps around.
  28930. //
  28931. // When `top === bottom` the current queue is empty and when
  28932. // `top + 1 === bottom` it's full. This wastes a single space of storage
  28933. // but allows much quicker checks.
  28934. class FixedCircularBuffer {
  28935. constructor() {
  28936. this.bottom = 0;
  28937. this.top = 0;
  28938. this.list = new Array(kSize);
  28939. this.next = null;
  28940. }
  28941. isEmpty() {
  28942. return this.top === this.bottom;
  28943. }
  28944. isFull() {
  28945. return ((this.top + 1) & kMask) === this.bottom;
  28946. }
  28947. push(data) {
  28948. this.list[this.top] = data;
  28949. this.top = (this.top + 1) & kMask;
  28950. }
  28951. shift() {
  28952. const nextItem = this.list[this.bottom];
  28953. if (nextItem === undefined)
  28954. return null;
  28955. this.list[this.bottom] = undefined;
  28956. this.bottom = (this.bottom + 1) & kMask;
  28957. return nextItem;
  28958. }
  28959. }
  28960. module.exports = class FixedQueue {
  28961. constructor() {
  28962. this.head = this.tail = new FixedCircularBuffer();
  28963. }
  28964. isEmpty() {
  28965. return this.head.isEmpty();
  28966. }
  28967. push(data) {
  28968. if (this.head.isFull()) {
  28969. // Head is full: Creates a new queue, sets the old queue's `.next` to it,
  28970. // and sets it as the new main queue.
  28971. this.head = this.head.next = new FixedCircularBuffer();
  28972. }
  28973. this.head.push(data);
  28974. }
  28975. shift() {
  28976. const tail = this.tail;
  28977. const next = tail.shift();
  28978. if (tail.isEmpty() && tail.next !== null) {
  28979. // If there is another queue, it forms the new tail.
  28980. this.tail = tail.next;
  28981. }
  28982. return next;
  28983. }
  28984. };
  28985. /***/ }),
  28986. /***/ 3198:
  28987. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  28988. "use strict";
  28989. const DispatcherBase = __nccwpck_require__(4839)
  28990. const FixedQueue = __nccwpck_require__(8266)
  28991. const { kConnected, kSize, kRunning, kPending, kQueued, kBusy, kFree, kUrl, kClose, kDestroy, kDispatch } = __nccwpck_require__(2785)
  28992. const PoolStats = __nccwpck_require__(9689)
  28993. const kClients = Symbol('clients')
  28994. const kNeedDrain = Symbol('needDrain')
  28995. const kQueue = Symbol('queue')
  28996. const kClosedResolve = Symbol('closed resolve')
  28997. const kOnDrain = Symbol('onDrain')
  28998. const kOnConnect = Symbol('onConnect')
  28999. const kOnDisconnect = Symbol('onDisconnect')
  29000. const kOnConnectionError = Symbol('onConnectionError')
  29001. const kGetDispatcher = Symbol('get dispatcher')
  29002. const kAddClient = Symbol('add client')
  29003. const kRemoveClient = Symbol('remove client')
  29004. const kStats = Symbol('stats')
  29005. class PoolBase extends DispatcherBase {
  29006. constructor () {
  29007. super()
  29008. this[kQueue] = new FixedQueue()
  29009. this[kClients] = []
  29010. this[kQueued] = 0
  29011. const pool = this
  29012. this[kOnDrain] = function onDrain (origin, targets) {
  29013. const queue = pool[kQueue]
  29014. let needDrain = false
  29015. while (!needDrain) {
  29016. const item = queue.shift()
  29017. if (!item) {
  29018. break
  29019. }
  29020. pool[kQueued]--
  29021. needDrain = !this.dispatch(item.opts, item.handler)
  29022. }
  29023. this[kNeedDrain] = needDrain
  29024. if (!this[kNeedDrain] && pool[kNeedDrain]) {
  29025. pool[kNeedDrain] = false
  29026. pool.emit('drain', origin, [pool, ...targets])
  29027. }
  29028. if (pool[kClosedResolve] && queue.isEmpty()) {
  29029. Promise
  29030. .all(pool[kClients].map(c => c.close()))
  29031. .then(pool[kClosedResolve])
  29032. }
  29033. }
  29034. this[kOnConnect] = (origin, targets) => {
  29035. pool.emit('connect', origin, [pool, ...targets])
  29036. }
  29037. this[kOnDisconnect] = (origin, targets, err) => {
  29038. pool.emit('disconnect', origin, [pool, ...targets], err)
  29039. }
  29040. this[kOnConnectionError] = (origin, targets, err) => {
  29041. pool.emit('connectionError', origin, [pool, ...targets], err)
  29042. }
  29043. this[kStats] = new PoolStats(this)
  29044. }
  29045. get [kBusy] () {
  29046. return this[kNeedDrain]
  29047. }
  29048. get [kConnected] () {
  29049. return this[kClients].filter(client => client[kConnected]).length
  29050. }
  29051. get [kFree] () {
  29052. return this[kClients].filter(client => client[kConnected] && !client[kNeedDrain]).length
  29053. }
  29054. get [kPending] () {
  29055. let ret = this[kQueued]
  29056. for (const { [kPending]: pending } of this[kClients]) {
  29057. ret += pending
  29058. }
  29059. return ret
  29060. }
  29061. get [kRunning] () {
  29062. let ret = 0
  29063. for (const { [kRunning]: running } of this[kClients]) {
  29064. ret += running
  29065. }
  29066. return ret
  29067. }
  29068. get [kSize] () {
  29069. let ret = this[kQueued]
  29070. for (const { [kSize]: size } of this[kClients]) {
  29071. ret += size
  29072. }
  29073. return ret
  29074. }
  29075. get stats () {
  29076. return this[kStats]
  29077. }
  29078. async [kClose] () {
  29079. if (this[kQueue].isEmpty()) {
  29080. return Promise.all(this[kClients].map(c => c.close()))
  29081. } else {
  29082. return new Promise((resolve) => {
  29083. this[kClosedResolve] = resolve
  29084. })
  29085. }
  29086. }
  29087. async [kDestroy] (err) {
  29088. while (true) {
  29089. const item = this[kQueue].shift()
  29090. if (!item) {
  29091. break
  29092. }
  29093. item.handler.onError(err)
  29094. }
  29095. return Promise.all(this[kClients].map(c => c.destroy(err)))
  29096. }
  29097. [kDispatch] (opts, handler) {
  29098. const dispatcher = this[kGetDispatcher]()
  29099. if (!dispatcher) {
  29100. this[kNeedDrain] = true
  29101. this[kQueue].push({ opts, handler })
  29102. this[kQueued]++
  29103. } else if (!dispatcher.dispatch(opts, handler)) {
  29104. dispatcher[kNeedDrain] = true
  29105. this[kNeedDrain] = !this[kGetDispatcher]()
  29106. }
  29107. return !this[kNeedDrain]
  29108. }
  29109. [kAddClient] (client) {
  29110. client
  29111. .on('drain', this[kOnDrain])
  29112. .on('connect', this[kOnConnect])
  29113. .on('disconnect', this[kOnDisconnect])
  29114. .on('connectionError', this[kOnConnectionError])
  29115. this[kClients].push(client)
  29116. if (this[kNeedDrain]) {
  29117. process.nextTick(() => {
  29118. if (this[kNeedDrain]) {
  29119. this[kOnDrain](client[kUrl], [this, client])
  29120. }
  29121. })
  29122. }
  29123. return this
  29124. }
  29125. [kRemoveClient] (client) {
  29126. client.close(() => {
  29127. const idx = this[kClients].indexOf(client)
  29128. if (idx !== -1) {
  29129. this[kClients].splice(idx, 1)
  29130. }
  29131. })
  29132. this[kNeedDrain] = this[kClients].some(dispatcher => (
  29133. !dispatcher[kNeedDrain] &&
  29134. dispatcher.closed !== true &&
  29135. dispatcher.destroyed !== true
  29136. ))
  29137. }
  29138. }
  29139. module.exports = {
  29140. PoolBase,
  29141. kClients,
  29142. kNeedDrain,
  29143. kAddClient,
  29144. kRemoveClient,
  29145. kGetDispatcher
  29146. }
  29147. /***/ }),
  29148. /***/ 9689:
  29149. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  29150. const { kFree, kConnected, kPending, kQueued, kRunning, kSize } = __nccwpck_require__(2785)
  29151. const kPool = Symbol('pool')
  29152. class PoolStats {
  29153. constructor (pool) {
  29154. this[kPool] = pool
  29155. }
  29156. get connected () {
  29157. return this[kPool][kConnected]
  29158. }
  29159. get free () {
  29160. return this[kPool][kFree]
  29161. }
  29162. get pending () {
  29163. return this[kPool][kPending]
  29164. }
  29165. get queued () {
  29166. return this[kPool][kQueued]
  29167. }
  29168. get running () {
  29169. return this[kPool][kRunning]
  29170. }
  29171. get size () {
  29172. return this[kPool][kSize]
  29173. }
  29174. }
  29175. module.exports = PoolStats
  29176. /***/ }),
  29177. /***/ 4634:
  29178. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  29179. "use strict";
  29180. const {
  29181. PoolBase,
  29182. kClients,
  29183. kNeedDrain,
  29184. kAddClient,
  29185. kGetDispatcher
  29186. } = __nccwpck_require__(3198)
  29187. const Client = __nccwpck_require__(3598)
  29188. const {
  29189. InvalidArgumentError
  29190. } = __nccwpck_require__(8045)
  29191. const util = __nccwpck_require__(3983)
  29192. const { kUrl, kInterceptors } = __nccwpck_require__(2785)
  29193. const buildConnector = __nccwpck_require__(2067)
  29194. const kOptions = Symbol('options')
  29195. const kConnections = Symbol('connections')
  29196. const kFactory = Symbol('factory')
  29197. function defaultFactory (origin, opts) {
  29198. return new Client(origin, opts)
  29199. }
  29200. class Pool extends PoolBase {
  29201. constructor (origin, {
  29202. connections,
  29203. factory = defaultFactory,
  29204. connect,
  29205. connectTimeout,
  29206. tls,
  29207. maxCachedSessions,
  29208. socketPath,
  29209. autoSelectFamily,
  29210. autoSelectFamilyAttemptTimeout,
  29211. allowH2,
  29212. ...options
  29213. } = {}) {
  29214. super()
  29215. if (connections != null && (!Number.isFinite(connections) || connections < 0)) {
  29216. throw new InvalidArgumentError('invalid connections')
  29217. }
  29218. if (typeof factory !== 'function') {
  29219. throw new InvalidArgumentError('factory must be a function.')
  29220. }
  29221. if (connect != null && typeof connect !== 'function' && typeof connect !== 'object') {
  29222. throw new InvalidArgumentError('connect must be a function or an object')
  29223. }
  29224. if (typeof connect !== 'function') {
  29225. connect = buildConnector({
  29226. ...tls,
  29227. maxCachedSessions,
  29228. allowH2,
  29229. socketPath,
  29230. timeout: connectTimeout,
  29231. ...(util.nodeHasAutoSelectFamily && autoSelectFamily ? { autoSelectFamily, autoSelectFamilyAttemptTimeout } : undefined),
  29232. ...connect
  29233. })
  29234. }
  29235. this[kInterceptors] = options.interceptors && options.interceptors.Pool && Array.isArray(options.interceptors.Pool)
  29236. ? options.interceptors.Pool
  29237. : []
  29238. this[kConnections] = connections || null
  29239. this[kUrl] = util.parseOrigin(origin)
  29240. this[kOptions] = { ...util.deepClone(options), connect, allowH2 }
  29241. this[kOptions].interceptors = options.interceptors
  29242. ? { ...options.interceptors }
  29243. : undefined
  29244. this[kFactory] = factory
  29245. this.on('connectionError', (origin, targets, error) => {
  29246. // If a connection error occurs, we remove the client from the pool,
  29247. // and emit a connectionError event. They will not be re-used.
  29248. // Fixes https://github.com/nodejs/undici/issues/3895
  29249. for (const target of targets) {
  29250. // Do not use kRemoveClient here, as it will close the client,
  29251. // but the client cannot be closed in this state.
  29252. const idx = this[kClients].indexOf(target)
  29253. if (idx !== -1) {
  29254. this[kClients].splice(idx, 1)
  29255. }
  29256. }
  29257. })
  29258. }
  29259. [kGetDispatcher] () {
  29260. let dispatcher = this[kClients].find(dispatcher => !dispatcher[kNeedDrain])
  29261. if (dispatcher) {
  29262. return dispatcher
  29263. }
  29264. if (!this[kConnections] || this[kClients].length < this[kConnections]) {
  29265. dispatcher = this[kFactory](this[kUrl], this[kOptions])
  29266. this[kAddClient](dispatcher)
  29267. }
  29268. return dispatcher
  29269. }
  29270. }
  29271. module.exports = Pool
  29272. /***/ }),
  29273. /***/ 7858:
  29274. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  29275. "use strict";
  29276. const { kProxy, kClose, kDestroy, kInterceptors } = __nccwpck_require__(2785)
  29277. const { URL } = __nccwpck_require__(7310)
  29278. const Agent = __nccwpck_require__(7890)
  29279. const Pool = __nccwpck_require__(4634)
  29280. const DispatcherBase = __nccwpck_require__(4839)
  29281. const { InvalidArgumentError, RequestAbortedError } = __nccwpck_require__(8045)
  29282. const buildConnector = __nccwpck_require__(2067)
  29283. const kAgent = Symbol('proxy agent')
  29284. const kClient = Symbol('proxy client')
  29285. const kProxyHeaders = Symbol('proxy headers')
  29286. const kRequestTls = Symbol('request tls settings')
  29287. const kProxyTls = Symbol('proxy tls settings')
  29288. const kConnectEndpoint = Symbol('connect endpoint function')
  29289. function defaultProtocolPort (protocol) {
  29290. return protocol === 'https:' ? 443 : 80
  29291. }
  29292. function buildProxyOptions (opts) {
  29293. if (typeof opts === 'string') {
  29294. opts = { uri: opts }
  29295. }
  29296. if (!opts || !opts.uri) {
  29297. throw new InvalidArgumentError('Proxy opts.uri is mandatory')
  29298. }
  29299. return {
  29300. uri: opts.uri,
  29301. protocol: opts.protocol || 'https'
  29302. }
  29303. }
  29304. function defaultFactory (origin, opts) {
  29305. return new Pool(origin, opts)
  29306. }
  29307. class ProxyAgent extends DispatcherBase {
  29308. constructor (opts) {
  29309. super(opts)
  29310. this[kProxy] = buildProxyOptions(opts)
  29311. this[kAgent] = new Agent(opts)
  29312. this[kInterceptors] = opts.interceptors && opts.interceptors.ProxyAgent && Array.isArray(opts.interceptors.ProxyAgent)
  29313. ? opts.interceptors.ProxyAgent
  29314. : []
  29315. if (typeof opts === 'string') {
  29316. opts = { uri: opts }
  29317. }
  29318. if (!opts || !opts.uri) {
  29319. throw new InvalidArgumentError('Proxy opts.uri is mandatory')
  29320. }
  29321. const { clientFactory = defaultFactory } = opts
  29322. if (typeof clientFactory !== 'function') {
  29323. throw new InvalidArgumentError('Proxy opts.clientFactory must be a function.')
  29324. }
  29325. this[kRequestTls] = opts.requestTls
  29326. this[kProxyTls] = opts.proxyTls
  29327. this[kProxyHeaders] = opts.headers || {}
  29328. const resolvedUrl = new URL(opts.uri)
  29329. const { origin, port, host, username, password } = resolvedUrl
  29330. if (opts.auth && opts.token) {
  29331. throw new InvalidArgumentError('opts.auth cannot be used in combination with opts.token')
  29332. } else if (opts.auth) {
  29333. /* @deprecated in favour of opts.token */
  29334. this[kProxyHeaders]['proxy-authorization'] = `Basic ${opts.auth}`
  29335. } else if (opts.token) {
  29336. this[kProxyHeaders]['proxy-authorization'] = opts.token
  29337. } else if (username && password) {
  29338. this[kProxyHeaders]['proxy-authorization'] = `Basic ${Buffer.from(`${decodeURIComponent(username)}:${decodeURIComponent(password)}`).toString('base64')}`
  29339. }
  29340. const connect = buildConnector({ ...opts.proxyTls })
  29341. this[kConnectEndpoint] = buildConnector({ ...opts.requestTls })
  29342. this[kClient] = clientFactory(resolvedUrl, { connect })
  29343. this[kAgent] = new Agent({
  29344. ...opts,
  29345. connect: async (opts, callback) => {
  29346. let requestedHost = opts.host
  29347. if (!opts.port) {
  29348. requestedHost += `:${defaultProtocolPort(opts.protocol)}`
  29349. }
  29350. try {
  29351. const { socket, statusCode } = await this[kClient].connect({
  29352. origin,
  29353. port,
  29354. path: requestedHost,
  29355. signal: opts.signal,
  29356. headers: {
  29357. ...this[kProxyHeaders],
  29358. host
  29359. }
  29360. })
  29361. if (statusCode !== 200) {
  29362. socket.on('error', () => {}).destroy()
  29363. callback(new RequestAbortedError(`Proxy response (${statusCode}) !== 200 when HTTP Tunneling`))
  29364. }
  29365. if (opts.protocol !== 'https:') {
  29366. callback(null, socket)
  29367. return
  29368. }
  29369. let servername
  29370. if (this[kRequestTls]) {
  29371. servername = this[kRequestTls].servername
  29372. } else {
  29373. servername = opts.servername
  29374. }
  29375. this[kConnectEndpoint]({ ...opts, servername, httpSocket: socket }, callback)
  29376. } catch (err) {
  29377. callback(err)
  29378. }
  29379. }
  29380. })
  29381. }
  29382. dispatch (opts, handler) {
  29383. const { host } = new URL(opts.origin)
  29384. const headers = buildHeaders(opts.headers)
  29385. throwIfProxyAuthIsSent(headers)
  29386. return this[kAgent].dispatch(
  29387. {
  29388. ...opts,
  29389. headers: {
  29390. ...headers,
  29391. host
  29392. }
  29393. },
  29394. handler
  29395. )
  29396. }
  29397. async [kClose] () {
  29398. await this[kAgent].close()
  29399. await this[kClient].close()
  29400. }
  29401. async [kDestroy] () {
  29402. await this[kAgent].destroy()
  29403. await this[kClient].destroy()
  29404. }
  29405. }
  29406. /**
  29407. * @param {string[] | Record<string, string>} headers
  29408. * @returns {Record<string, string>}
  29409. */
  29410. function buildHeaders (headers) {
  29411. // When using undici.fetch, the headers list is stored
  29412. // as an array.
  29413. if (Array.isArray(headers)) {
  29414. /** @type {Record<string, string>} */
  29415. const headersPair = {}
  29416. for (let i = 0; i < headers.length; i += 2) {
  29417. headersPair[headers[i]] = headers[i + 1]
  29418. }
  29419. return headersPair
  29420. }
  29421. return headers
  29422. }
  29423. /**
  29424. * @param {Record<string, string>} headers
  29425. *
  29426. * Previous versions of ProxyAgent suggests the Proxy-Authorization in request headers
  29427. * Nevertheless, it was changed and to avoid a security vulnerability by end users
  29428. * this check was created.
  29429. * It should be removed in the next major version for performance reasons
  29430. */
  29431. function throwIfProxyAuthIsSent (headers) {
  29432. const existProxyAuth = headers && Object.keys(headers)
  29433. .find((key) => key.toLowerCase() === 'proxy-authorization')
  29434. if (existProxyAuth) {
  29435. throw new InvalidArgumentError('Proxy-Authorization should be sent in ProxyAgent constructor')
  29436. }
  29437. }
  29438. module.exports = ProxyAgent
  29439. /***/ }),
  29440. /***/ 9459:
  29441. /***/ ((module) => {
  29442. "use strict";
  29443. let fastNow = Date.now()
  29444. let fastNowTimeout
  29445. const fastTimers = []
  29446. function onTimeout () {
  29447. fastNow = Date.now()
  29448. let len = fastTimers.length
  29449. let idx = 0
  29450. while (idx < len) {
  29451. const timer = fastTimers[idx]
  29452. if (timer.state === 0) {
  29453. timer.state = fastNow + timer.delay
  29454. } else if (timer.state > 0 && fastNow >= timer.state) {
  29455. timer.state = -1
  29456. timer.callback(timer.opaque)
  29457. }
  29458. if (timer.state === -1) {
  29459. timer.state = -2
  29460. if (idx !== len - 1) {
  29461. fastTimers[idx] = fastTimers.pop()
  29462. } else {
  29463. fastTimers.pop()
  29464. }
  29465. len -= 1
  29466. } else {
  29467. idx += 1
  29468. }
  29469. }
  29470. if (fastTimers.length > 0) {
  29471. refreshTimeout()
  29472. }
  29473. }
  29474. function refreshTimeout () {
  29475. if (fastNowTimeout && fastNowTimeout.refresh) {
  29476. fastNowTimeout.refresh()
  29477. } else {
  29478. clearTimeout(fastNowTimeout)
  29479. fastNowTimeout = setTimeout(onTimeout, 1e3)
  29480. if (fastNowTimeout.unref) {
  29481. fastNowTimeout.unref()
  29482. }
  29483. }
  29484. }
  29485. class Timeout {
  29486. constructor (callback, delay, opaque) {
  29487. this.callback = callback
  29488. this.delay = delay
  29489. this.opaque = opaque
  29490. // -2 not in timer list
  29491. // -1 in timer list but inactive
  29492. // 0 in timer list waiting for time
  29493. // > 0 in timer list waiting for time to expire
  29494. this.state = -2
  29495. this.refresh()
  29496. }
  29497. refresh () {
  29498. if (this.state === -2) {
  29499. fastTimers.push(this)
  29500. if (!fastNowTimeout || fastTimers.length === 1) {
  29501. refreshTimeout()
  29502. }
  29503. }
  29504. this.state = 0
  29505. }
  29506. clear () {
  29507. this.state = -1
  29508. }
  29509. }
  29510. module.exports = {
  29511. setTimeout (callback, delay, opaque) {
  29512. return delay < 1e3
  29513. ? setTimeout(callback, delay, opaque)
  29514. : new Timeout(callback, delay, opaque)
  29515. },
  29516. clearTimeout (timeout) {
  29517. if (timeout instanceof Timeout) {
  29518. timeout.clear()
  29519. } else {
  29520. clearTimeout(timeout)
  29521. }
  29522. }
  29523. }
  29524. /***/ }),
  29525. /***/ 5354:
  29526. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  29527. "use strict";
  29528. const diagnosticsChannel = __nccwpck_require__(7643)
  29529. const { uid, states } = __nccwpck_require__(9188)
  29530. const {
  29531. kReadyState,
  29532. kSentClose,
  29533. kByteParser,
  29534. kReceivedClose
  29535. } = __nccwpck_require__(7578)
  29536. const { fireEvent, failWebsocketConnection } = __nccwpck_require__(5515)
  29537. const { CloseEvent } = __nccwpck_require__(2611)
  29538. const { makeRequest } = __nccwpck_require__(8359)
  29539. const { fetching } = __nccwpck_require__(4881)
  29540. const { Headers } = __nccwpck_require__(554)
  29541. const { getGlobalDispatcher } = __nccwpck_require__(1892)
  29542. const { kHeadersList } = __nccwpck_require__(2785)
  29543. const channels = {}
  29544. channels.open = diagnosticsChannel.channel('undici:websocket:open')
  29545. channels.close = diagnosticsChannel.channel('undici:websocket:close')
  29546. channels.socketError = diagnosticsChannel.channel('undici:websocket:socket_error')
  29547. /** @type {import('crypto')} */
  29548. let crypto
  29549. try {
  29550. crypto = __nccwpck_require__(6113)
  29551. } catch {
  29552. }
  29553. /**
  29554. * @see https://websockets.spec.whatwg.org/#concept-websocket-establish
  29555. * @param {URL} url
  29556. * @param {string|string[]} protocols
  29557. * @param {import('./websocket').WebSocket} ws
  29558. * @param {(response: any) => void} onEstablish
  29559. * @param {Partial<import('../../types/websocket').WebSocketInit>} options
  29560. */
  29561. function establishWebSocketConnection (url, protocols, ws, onEstablish, options) {
  29562. // 1. Let requestURL be a copy of url, with its scheme set to "http", if url’s
  29563. // scheme is "ws", and to "https" otherwise.
  29564. const requestURL = url
  29565. requestURL.protocol = url.protocol === 'ws:' ? 'http:' : 'https:'
  29566. // 2. Let request be a new request, whose URL is requestURL, client is client,
  29567. // service-workers mode is "none", referrer is "no-referrer", mode is
  29568. // "websocket", credentials mode is "include", cache mode is "no-store" ,
  29569. // and redirect mode is "error".
  29570. const request = makeRequest({
  29571. urlList: [requestURL],
  29572. serviceWorkers: 'none',
  29573. referrer: 'no-referrer',
  29574. mode: 'websocket',
  29575. credentials: 'include',
  29576. cache: 'no-store',
  29577. redirect: 'error'
  29578. })
  29579. // Note: undici extension, allow setting custom headers.
  29580. if (options.headers) {
  29581. const headersList = new Headers(options.headers)[kHeadersList]
  29582. request.headersList = headersList
  29583. }
  29584. // 3. Append (`Upgrade`, `websocket`) to request’s header list.
  29585. // 4. Append (`Connection`, `Upgrade`) to request’s header list.
  29586. // Note: both of these are handled by undici currently.
  29587. // https://github.com/nodejs/undici/blob/68c269c4144c446f3f1220951338daef4a6b5ec4/lib/client.js#L1397
  29588. // 5. Let keyValue be a nonce consisting of a randomly selected
  29589. // 16-byte value that has been forgiving-base64-encoded and
  29590. // isomorphic encoded.
  29591. const keyValue = crypto.randomBytes(16).toString('base64')
  29592. // 6. Append (`Sec-WebSocket-Key`, keyValue) to request’s
  29593. // header list.
  29594. request.headersList.append('sec-websocket-key', keyValue)
  29595. // 7. Append (`Sec-WebSocket-Version`, `13`) to request’s
  29596. // header list.
  29597. request.headersList.append('sec-websocket-version', '13')
  29598. // 8. For each protocol in protocols, combine
  29599. // (`Sec-WebSocket-Protocol`, protocol) in request’s header
  29600. // list.
  29601. for (const protocol of protocols) {
  29602. request.headersList.append('sec-websocket-protocol', protocol)
  29603. }
  29604. // 9. Let permessageDeflate be a user-agent defined
  29605. // "permessage-deflate" extension header value.
  29606. // https://github.com/mozilla/gecko-dev/blob/ce78234f5e653a5d3916813ff990f053510227bc/netwerk/protocol/websocket/WebSocketChannel.cpp#L2673
  29607. // TODO: enable once permessage-deflate is supported
  29608. const permessageDeflate = '' // 'permessage-deflate; 15'
  29609. // 10. Append (`Sec-WebSocket-Extensions`, permessageDeflate) to
  29610. // request’s header list.
  29611. // request.headersList.append('sec-websocket-extensions', permessageDeflate)
  29612. // 11. Fetch request with useParallelQueue set to true, and
  29613. // processResponse given response being these steps:
  29614. const controller = fetching({
  29615. request,
  29616. useParallelQueue: true,
  29617. dispatcher: options.dispatcher ?? getGlobalDispatcher(),
  29618. processResponse (response) {
  29619. // 1. If response is a network error or its status is not 101,
  29620. // fail the WebSocket connection.
  29621. if (response.type === 'error' || response.status !== 101) {
  29622. failWebsocketConnection(ws, 'Received network error or non-101 status code.')
  29623. return
  29624. }
  29625. // 2. If protocols is not the empty list and extracting header
  29626. // list values given `Sec-WebSocket-Protocol` and response’s
  29627. // header list results in null, failure, or the empty byte
  29628. // sequence, then fail the WebSocket connection.
  29629. if (protocols.length !== 0 && !response.headersList.get('Sec-WebSocket-Protocol')) {
  29630. failWebsocketConnection(ws, 'Server did not respond with sent protocols.')
  29631. return
  29632. }
  29633. // 3. Follow the requirements stated step 2 to step 6, inclusive,
  29634. // of the last set of steps in section 4.1 of The WebSocket
  29635. // Protocol to validate response. This either results in fail
  29636. // the WebSocket connection or the WebSocket connection is
  29637. // established.
  29638. // 2. If the response lacks an |Upgrade| header field or the |Upgrade|
  29639. // header field contains a value that is not an ASCII case-
  29640. // insensitive match for the value "websocket", the client MUST
  29641. // _Fail the WebSocket Connection_.
  29642. if (response.headersList.get('Upgrade')?.toLowerCase() !== 'websocket') {
  29643. failWebsocketConnection(ws, 'Server did not set Upgrade header to "websocket".')
  29644. return
  29645. }
  29646. // 3. If the response lacks a |Connection| header field or the
  29647. // |Connection| header field doesn't contain a token that is an
  29648. // ASCII case-insensitive match for the value "Upgrade", the client
  29649. // MUST _Fail the WebSocket Connection_.
  29650. if (response.headersList.get('Connection')?.toLowerCase() !== 'upgrade') {
  29651. failWebsocketConnection(ws, 'Server did not set Connection header to "upgrade".')
  29652. return
  29653. }
  29654. // 4. If the response lacks a |Sec-WebSocket-Accept| header field or
  29655. // the |Sec-WebSocket-Accept| contains a value other than the
  29656. // base64-encoded SHA-1 of the concatenation of the |Sec-WebSocket-
  29657. // Key| (as a string, not base64-decoded) with the string "258EAFA5-
  29658. // E914-47DA-95CA-C5AB0DC85B11" but ignoring any leading and
  29659. // trailing whitespace, the client MUST _Fail the WebSocket
  29660. // Connection_.
  29661. const secWSAccept = response.headersList.get('Sec-WebSocket-Accept')
  29662. const digest = crypto.createHash('sha1').update(keyValue + uid).digest('base64')
  29663. if (secWSAccept !== digest) {
  29664. failWebsocketConnection(ws, 'Incorrect hash received in Sec-WebSocket-Accept header.')
  29665. return
  29666. }
  29667. // 5. If the response includes a |Sec-WebSocket-Extensions| header
  29668. // field and this header field indicates the use of an extension
  29669. // that was not present in the client's handshake (the server has
  29670. // indicated an extension not requested by the client), the client
  29671. // MUST _Fail the WebSocket Connection_. (The parsing of this
  29672. // header field to determine which extensions are requested is
  29673. // discussed in Section 9.1.)
  29674. const secExtension = response.headersList.get('Sec-WebSocket-Extensions')
  29675. if (secExtension !== null && secExtension !== permessageDeflate) {
  29676. failWebsocketConnection(ws, 'Received different permessage-deflate than the one set.')
  29677. return
  29678. }
  29679. // 6. If the response includes a |Sec-WebSocket-Protocol| header field
  29680. // and this header field indicates the use of a subprotocol that was
  29681. // not present in the client's handshake (the server has indicated a
  29682. // subprotocol not requested by the client), the client MUST _Fail
  29683. // the WebSocket Connection_.
  29684. const secProtocol = response.headersList.get('Sec-WebSocket-Protocol')
  29685. if (secProtocol !== null && secProtocol !== request.headersList.get('Sec-WebSocket-Protocol')) {
  29686. failWebsocketConnection(ws, 'Protocol was not set in the opening handshake.')
  29687. return
  29688. }
  29689. response.socket.on('data', onSocketData)
  29690. response.socket.on('close', onSocketClose)
  29691. response.socket.on('error', onSocketError)
  29692. if (channels.open.hasSubscribers) {
  29693. channels.open.publish({
  29694. address: response.socket.address(),
  29695. protocol: secProtocol,
  29696. extensions: secExtension
  29697. })
  29698. }
  29699. onEstablish(response)
  29700. }
  29701. })
  29702. return controller
  29703. }
  29704. /**
  29705. * @param {Buffer} chunk
  29706. */
  29707. function onSocketData (chunk) {
  29708. if (!this.ws[kByteParser].write(chunk)) {
  29709. this.pause()
  29710. }
  29711. }
  29712. /**
  29713. * @see https://websockets.spec.whatwg.org/#feedback-from-the-protocol
  29714. * @see https://datatracker.ietf.org/doc/html/rfc6455#section-7.1.4
  29715. */
  29716. function onSocketClose () {
  29717. const { ws } = this
  29718. // If the TCP connection was closed after the
  29719. // WebSocket closing handshake was completed, the WebSocket connection
  29720. // is said to have been closed _cleanly_.
  29721. const wasClean = ws[kSentClose] && ws[kReceivedClose]
  29722. let code = 1005
  29723. let reason = ''
  29724. const result = ws[kByteParser].closingInfo
  29725. if (result) {
  29726. code = result.code ?? 1005
  29727. reason = result.reason
  29728. } else if (!ws[kSentClose]) {
  29729. // If _The WebSocket
  29730. // Connection is Closed_ and no Close control frame was received by the
  29731. // endpoint (such as could occur if the underlying transport connection
  29732. // is lost), _The WebSocket Connection Close Code_ is considered to be
  29733. // 1006.
  29734. code = 1006
  29735. }
  29736. // 1. Change the ready state to CLOSED (3).
  29737. ws[kReadyState] = states.CLOSED
  29738. // 2. If the user agent was required to fail the WebSocket
  29739. // connection, or if the WebSocket connection was closed
  29740. // after being flagged as full, fire an event named error
  29741. // at the WebSocket object.
  29742. // TODO
  29743. // 3. Fire an event named close at the WebSocket object,
  29744. // using CloseEvent, with the wasClean attribute
  29745. // initialized to true if the connection closed cleanly
  29746. // and false otherwise, the code attribute initialized to
  29747. // the WebSocket connection close code, and the reason
  29748. // attribute initialized to the result of applying UTF-8
  29749. // decode without BOM to the WebSocket connection close
  29750. // reason.
  29751. fireEvent('close', ws, CloseEvent, {
  29752. wasClean, code, reason
  29753. })
  29754. if (channels.close.hasSubscribers) {
  29755. channels.close.publish({
  29756. websocket: ws,
  29757. code,
  29758. reason
  29759. })
  29760. }
  29761. }
  29762. function onSocketError (error) {
  29763. const { ws } = this
  29764. ws[kReadyState] = states.CLOSING
  29765. if (channels.socketError.hasSubscribers) {
  29766. channels.socketError.publish(error)
  29767. }
  29768. this.destroy()
  29769. }
  29770. module.exports = {
  29771. establishWebSocketConnection
  29772. }
  29773. /***/ }),
  29774. /***/ 9188:
  29775. /***/ ((module) => {
  29776. "use strict";
  29777. // This is a Globally Unique Identifier unique used
  29778. // to validate that the endpoint accepts websocket
  29779. // connections.
  29780. // See https://www.rfc-editor.org/rfc/rfc6455.html#section-1.3
  29781. const uid = '258EAFA5-E914-47DA-95CA-C5AB0DC85B11'
  29782. /** @type {PropertyDescriptor} */
  29783. const staticPropertyDescriptors = {
  29784. enumerable: true,
  29785. writable: false,
  29786. configurable: false
  29787. }
  29788. const states = {
  29789. CONNECTING: 0,
  29790. OPEN: 1,
  29791. CLOSING: 2,
  29792. CLOSED: 3
  29793. }
  29794. const opcodes = {
  29795. CONTINUATION: 0x0,
  29796. TEXT: 0x1,
  29797. BINARY: 0x2,
  29798. CLOSE: 0x8,
  29799. PING: 0x9,
  29800. PONG: 0xA
  29801. }
  29802. const maxUnsigned16Bit = 2 ** 16 - 1 // 65535
  29803. const parserStates = {
  29804. INFO: 0,
  29805. PAYLOADLENGTH_16: 2,
  29806. PAYLOADLENGTH_64: 3,
  29807. READ_DATA: 4
  29808. }
  29809. const emptyBuffer = Buffer.allocUnsafe(0)
  29810. module.exports = {
  29811. uid,
  29812. staticPropertyDescriptors,
  29813. states,
  29814. opcodes,
  29815. maxUnsigned16Bit,
  29816. parserStates,
  29817. emptyBuffer
  29818. }
  29819. /***/ }),
  29820. /***/ 2611:
  29821. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  29822. "use strict";
  29823. const { webidl } = __nccwpck_require__(1744)
  29824. const { kEnumerableProperty } = __nccwpck_require__(3983)
  29825. const { MessagePort } = __nccwpck_require__(1267)
  29826. /**
  29827. * @see https://html.spec.whatwg.org/multipage/comms.html#messageevent
  29828. */
  29829. class MessageEvent extends Event {
  29830. #eventInit
  29831. constructor (type, eventInitDict = {}) {
  29832. webidl.argumentLengthCheck(arguments, 1, { header: 'MessageEvent constructor' })
  29833. type = webidl.converters.DOMString(type)
  29834. eventInitDict = webidl.converters.MessageEventInit(eventInitDict)
  29835. super(type, eventInitDict)
  29836. this.#eventInit = eventInitDict
  29837. }
  29838. get data () {
  29839. webidl.brandCheck(this, MessageEvent)
  29840. return this.#eventInit.data
  29841. }
  29842. get origin () {
  29843. webidl.brandCheck(this, MessageEvent)
  29844. return this.#eventInit.origin
  29845. }
  29846. get lastEventId () {
  29847. webidl.brandCheck(this, MessageEvent)
  29848. return this.#eventInit.lastEventId
  29849. }
  29850. get source () {
  29851. webidl.brandCheck(this, MessageEvent)
  29852. return this.#eventInit.source
  29853. }
  29854. get ports () {
  29855. webidl.brandCheck(this, MessageEvent)
  29856. if (!Object.isFrozen(this.#eventInit.ports)) {
  29857. Object.freeze(this.#eventInit.ports)
  29858. }
  29859. return this.#eventInit.ports
  29860. }
  29861. initMessageEvent (
  29862. type,
  29863. bubbles = false,
  29864. cancelable = false,
  29865. data = null,
  29866. origin = '',
  29867. lastEventId = '',
  29868. source = null,
  29869. ports = []
  29870. ) {
  29871. webidl.brandCheck(this, MessageEvent)
  29872. webidl.argumentLengthCheck(arguments, 1, { header: 'MessageEvent.initMessageEvent' })
  29873. return new MessageEvent(type, {
  29874. bubbles, cancelable, data, origin, lastEventId, source, ports
  29875. })
  29876. }
  29877. }
  29878. /**
  29879. * @see https://websockets.spec.whatwg.org/#the-closeevent-interface
  29880. */
  29881. class CloseEvent extends Event {
  29882. #eventInit
  29883. constructor (type, eventInitDict = {}) {
  29884. webidl.argumentLengthCheck(arguments, 1, { header: 'CloseEvent constructor' })
  29885. type = webidl.converters.DOMString(type)
  29886. eventInitDict = webidl.converters.CloseEventInit(eventInitDict)
  29887. super(type, eventInitDict)
  29888. this.#eventInit = eventInitDict
  29889. }
  29890. get wasClean () {
  29891. webidl.brandCheck(this, CloseEvent)
  29892. return this.#eventInit.wasClean
  29893. }
  29894. get code () {
  29895. webidl.brandCheck(this, CloseEvent)
  29896. return this.#eventInit.code
  29897. }
  29898. get reason () {
  29899. webidl.brandCheck(this, CloseEvent)
  29900. return this.#eventInit.reason
  29901. }
  29902. }
  29903. // https://html.spec.whatwg.org/multipage/webappapis.html#the-errorevent-interface
  29904. class ErrorEvent extends Event {
  29905. #eventInit
  29906. constructor (type, eventInitDict) {
  29907. webidl.argumentLengthCheck(arguments, 1, { header: 'ErrorEvent constructor' })
  29908. super(type, eventInitDict)
  29909. type = webidl.converters.DOMString(type)
  29910. eventInitDict = webidl.converters.ErrorEventInit(eventInitDict ?? {})
  29911. this.#eventInit = eventInitDict
  29912. }
  29913. get message () {
  29914. webidl.brandCheck(this, ErrorEvent)
  29915. return this.#eventInit.message
  29916. }
  29917. get filename () {
  29918. webidl.brandCheck(this, ErrorEvent)
  29919. return this.#eventInit.filename
  29920. }
  29921. get lineno () {
  29922. webidl.brandCheck(this, ErrorEvent)
  29923. return this.#eventInit.lineno
  29924. }
  29925. get colno () {
  29926. webidl.brandCheck(this, ErrorEvent)
  29927. return this.#eventInit.colno
  29928. }
  29929. get error () {
  29930. webidl.brandCheck(this, ErrorEvent)
  29931. return this.#eventInit.error
  29932. }
  29933. }
  29934. Object.defineProperties(MessageEvent.prototype, {
  29935. [Symbol.toStringTag]: {
  29936. value: 'MessageEvent',
  29937. configurable: true
  29938. },
  29939. data: kEnumerableProperty,
  29940. origin: kEnumerableProperty,
  29941. lastEventId: kEnumerableProperty,
  29942. source: kEnumerableProperty,
  29943. ports: kEnumerableProperty,
  29944. initMessageEvent: kEnumerableProperty
  29945. })
  29946. Object.defineProperties(CloseEvent.prototype, {
  29947. [Symbol.toStringTag]: {
  29948. value: 'CloseEvent',
  29949. configurable: true
  29950. },
  29951. reason: kEnumerableProperty,
  29952. code: kEnumerableProperty,
  29953. wasClean: kEnumerableProperty
  29954. })
  29955. Object.defineProperties(ErrorEvent.prototype, {
  29956. [Symbol.toStringTag]: {
  29957. value: 'ErrorEvent',
  29958. configurable: true
  29959. },
  29960. message: kEnumerableProperty,
  29961. filename: kEnumerableProperty,
  29962. lineno: kEnumerableProperty,
  29963. colno: kEnumerableProperty,
  29964. error: kEnumerableProperty
  29965. })
  29966. webidl.converters.MessagePort = webidl.interfaceConverter(MessagePort)
  29967. webidl.converters['sequence<MessagePort>'] = webidl.sequenceConverter(
  29968. webidl.converters.MessagePort
  29969. )
  29970. const eventInit = [
  29971. {
  29972. key: 'bubbles',
  29973. converter: webidl.converters.boolean,
  29974. defaultValue: false
  29975. },
  29976. {
  29977. key: 'cancelable',
  29978. converter: webidl.converters.boolean,
  29979. defaultValue: false
  29980. },
  29981. {
  29982. key: 'composed',
  29983. converter: webidl.converters.boolean,
  29984. defaultValue: false
  29985. }
  29986. ]
  29987. webidl.converters.MessageEventInit = webidl.dictionaryConverter([
  29988. ...eventInit,
  29989. {
  29990. key: 'data',
  29991. converter: webidl.converters.any,
  29992. defaultValue: null
  29993. },
  29994. {
  29995. key: 'origin',
  29996. converter: webidl.converters.USVString,
  29997. defaultValue: ''
  29998. },
  29999. {
  30000. key: 'lastEventId',
  30001. converter: webidl.converters.DOMString,
  30002. defaultValue: ''
  30003. },
  30004. {
  30005. key: 'source',
  30006. // Node doesn't implement WindowProxy or ServiceWorker, so the only
  30007. // valid value for source is a MessagePort.
  30008. converter: webidl.nullableConverter(webidl.converters.MessagePort),
  30009. defaultValue: null
  30010. },
  30011. {
  30012. key: 'ports',
  30013. converter: webidl.converters['sequence<MessagePort>'],
  30014. get defaultValue () {
  30015. return []
  30016. }
  30017. }
  30018. ])
  30019. webidl.converters.CloseEventInit = webidl.dictionaryConverter([
  30020. ...eventInit,
  30021. {
  30022. key: 'wasClean',
  30023. converter: webidl.converters.boolean,
  30024. defaultValue: false
  30025. },
  30026. {
  30027. key: 'code',
  30028. converter: webidl.converters['unsigned short'],
  30029. defaultValue: 0
  30030. },
  30031. {
  30032. key: 'reason',
  30033. converter: webidl.converters.USVString,
  30034. defaultValue: ''
  30035. }
  30036. ])
  30037. webidl.converters.ErrorEventInit = webidl.dictionaryConverter([
  30038. ...eventInit,
  30039. {
  30040. key: 'message',
  30041. converter: webidl.converters.DOMString,
  30042. defaultValue: ''
  30043. },
  30044. {
  30045. key: 'filename',
  30046. converter: webidl.converters.USVString,
  30047. defaultValue: ''
  30048. },
  30049. {
  30050. key: 'lineno',
  30051. converter: webidl.converters['unsigned long'],
  30052. defaultValue: 0
  30053. },
  30054. {
  30055. key: 'colno',
  30056. converter: webidl.converters['unsigned long'],
  30057. defaultValue: 0
  30058. },
  30059. {
  30060. key: 'error',
  30061. converter: webidl.converters.any
  30062. }
  30063. ])
  30064. module.exports = {
  30065. MessageEvent,
  30066. CloseEvent,
  30067. ErrorEvent
  30068. }
  30069. /***/ }),
  30070. /***/ 5444:
  30071. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  30072. "use strict";
  30073. const { maxUnsigned16Bit } = __nccwpck_require__(9188)
  30074. /** @type {import('crypto')} */
  30075. let crypto
  30076. try {
  30077. crypto = __nccwpck_require__(6113)
  30078. } catch {
  30079. }
  30080. class WebsocketFrameSend {
  30081. /**
  30082. * @param {Buffer|undefined} data
  30083. */
  30084. constructor (data) {
  30085. this.frameData = data
  30086. this.maskKey = crypto.randomBytes(4)
  30087. }
  30088. createFrame (opcode) {
  30089. const bodyLength = this.frameData?.byteLength ?? 0
  30090. /** @type {number} */
  30091. let payloadLength = bodyLength // 0-125
  30092. let offset = 6
  30093. if (bodyLength > maxUnsigned16Bit) {
  30094. offset += 8 // payload length is next 8 bytes
  30095. payloadLength = 127
  30096. } else if (bodyLength > 125) {
  30097. offset += 2 // payload length is next 2 bytes
  30098. payloadLength = 126
  30099. }
  30100. const buffer = Buffer.allocUnsafe(bodyLength + offset)
  30101. // Clear first 2 bytes, everything else is overwritten
  30102. buffer[0] = buffer[1] = 0
  30103. buffer[0] |= 0x80 // FIN
  30104. buffer[0] = (buffer[0] & 0xF0) + opcode // opcode
  30105. /*! ws. MIT License. Einar Otto Stangvik <einaros@gmail.com> */
  30106. buffer[offset - 4] = this.maskKey[0]
  30107. buffer[offset - 3] = this.maskKey[1]
  30108. buffer[offset - 2] = this.maskKey[2]
  30109. buffer[offset - 1] = this.maskKey[3]
  30110. buffer[1] = payloadLength
  30111. if (payloadLength === 126) {
  30112. buffer.writeUInt16BE(bodyLength, 2)
  30113. } else if (payloadLength === 127) {
  30114. // Clear extended payload length
  30115. buffer[2] = buffer[3] = 0
  30116. buffer.writeUIntBE(bodyLength, 4, 6)
  30117. }
  30118. buffer[1] |= 0x80 // MASK
  30119. // mask body
  30120. for (let i = 0; i < bodyLength; i++) {
  30121. buffer[offset + i] = this.frameData[i] ^ this.maskKey[i % 4]
  30122. }
  30123. return buffer
  30124. }
  30125. }
  30126. module.exports = {
  30127. WebsocketFrameSend
  30128. }
  30129. /***/ }),
  30130. /***/ 1688:
  30131. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  30132. "use strict";
  30133. const { Writable } = __nccwpck_require__(2781)
  30134. const diagnosticsChannel = __nccwpck_require__(7643)
  30135. const { parserStates, opcodes, states, emptyBuffer } = __nccwpck_require__(9188)
  30136. const { kReadyState, kSentClose, kResponse, kReceivedClose } = __nccwpck_require__(7578)
  30137. const { isValidStatusCode, failWebsocketConnection, websocketMessageReceived } = __nccwpck_require__(5515)
  30138. const { WebsocketFrameSend } = __nccwpck_require__(5444)
  30139. // This code was influenced by ws released under the MIT license.
  30140. // Copyright (c) 2011 Einar Otto Stangvik <einaros@gmail.com>
  30141. // Copyright (c) 2013 Arnout Kazemier and contributors
  30142. // Copyright (c) 2016 Luigi Pinca and contributors
  30143. const channels = {}
  30144. channels.ping = diagnosticsChannel.channel('undici:websocket:ping')
  30145. channels.pong = diagnosticsChannel.channel('undici:websocket:pong')
  30146. class ByteParser extends Writable {
  30147. #buffers = []
  30148. #byteOffset = 0
  30149. #state = parserStates.INFO
  30150. #info = {}
  30151. #fragments = []
  30152. constructor (ws) {
  30153. super()
  30154. this.ws = ws
  30155. }
  30156. /**
  30157. * @param {Buffer} chunk
  30158. * @param {() => void} callback
  30159. */
  30160. _write (chunk, _, callback) {
  30161. this.#buffers.push(chunk)
  30162. this.#byteOffset += chunk.length
  30163. this.run(callback)
  30164. }
  30165. /**
  30166. * Runs whenever a new chunk is received.
  30167. * Callback is called whenever there are no more chunks buffering,
  30168. * or not enough bytes are buffered to parse.
  30169. */
  30170. run (callback) {
  30171. while (true) {
  30172. if (this.#state === parserStates.INFO) {
  30173. // If there aren't enough bytes to parse the payload length, etc.
  30174. if (this.#byteOffset < 2) {
  30175. return callback()
  30176. }
  30177. const buffer = this.consume(2)
  30178. this.#info.fin = (buffer[0] & 0x80) !== 0
  30179. this.#info.opcode = buffer[0] & 0x0F
  30180. // If we receive a fragmented message, we use the type of the first
  30181. // frame to parse the full message as binary/text, when it's terminated
  30182. this.#info.originalOpcode ??= this.#info.opcode
  30183. this.#info.fragmented = !this.#info.fin && this.#info.opcode !== opcodes.CONTINUATION
  30184. if (this.#info.fragmented && this.#info.opcode !== opcodes.BINARY && this.#info.opcode !== opcodes.TEXT) {
  30185. // Only text and binary frames can be fragmented
  30186. failWebsocketConnection(this.ws, 'Invalid frame type was fragmented.')
  30187. return
  30188. }
  30189. const payloadLength = buffer[1] & 0x7F
  30190. if (payloadLength <= 125) {
  30191. this.#info.payloadLength = payloadLength
  30192. this.#state = parserStates.READ_DATA
  30193. } else if (payloadLength === 126) {
  30194. this.#state = parserStates.PAYLOADLENGTH_16
  30195. } else if (payloadLength === 127) {
  30196. this.#state = parserStates.PAYLOADLENGTH_64
  30197. }
  30198. if (this.#info.fragmented && payloadLength > 125) {
  30199. // A fragmented frame can't be fragmented itself
  30200. failWebsocketConnection(this.ws, 'Fragmented frame exceeded 125 bytes.')
  30201. return
  30202. } else if (
  30203. (this.#info.opcode === opcodes.PING ||
  30204. this.#info.opcode === opcodes.PONG ||
  30205. this.#info.opcode === opcodes.CLOSE) &&
  30206. payloadLength > 125
  30207. ) {
  30208. // Control frames can have a payload length of 125 bytes MAX
  30209. failWebsocketConnection(this.ws, 'Payload length for control frame exceeded 125 bytes.')
  30210. return
  30211. } else if (this.#info.opcode === opcodes.CLOSE) {
  30212. if (payloadLength === 1) {
  30213. failWebsocketConnection(this.ws, 'Received close frame with a 1-byte body.')
  30214. return
  30215. }
  30216. const body = this.consume(payloadLength)
  30217. this.#info.closeInfo = this.parseCloseBody(false, body)
  30218. if (!this.ws[kSentClose]) {
  30219. // If an endpoint receives a Close frame and did not previously send a
  30220. // Close frame, the endpoint MUST send a Close frame in response. (When
  30221. // sending a Close frame in response, the endpoint typically echos the
  30222. // status code it received.)
  30223. const body = Buffer.allocUnsafe(2)
  30224. body.writeUInt16BE(this.#info.closeInfo.code, 0)
  30225. const closeFrame = new WebsocketFrameSend(body)
  30226. this.ws[kResponse].socket.write(
  30227. closeFrame.createFrame(opcodes.CLOSE),
  30228. (err) => {
  30229. if (!err) {
  30230. this.ws[kSentClose] = true
  30231. }
  30232. }
  30233. )
  30234. }
  30235. // Upon either sending or receiving a Close control frame, it is said
  30236. // that _The WebSocket Closing Handshake is Started_ and that the
  30237. // WebSocket connection is in the CLOSING state.
  30238. this.ws[kReadyState] = states.CLOSING
  30239. this.ws[kReceivedClose] = true
  30240. this.end()
  30241. return
  30242. } else if (this.#info.opcode === opcodes.PING) {
  30243. // Upon receipt of a Ping frame, an endpoint MUST send a Pong frame in
  30244. // response, unless it already received a Close frame.
  30245. // A Pong frame sent in response to a Ping frame must have identical
  30246. // "Application data"
  30247. const body = this.consume(payloadLength)
  30248. if (!this.ws[kReceivedClose]) {
  30249. const frame = new WebsocketFrameSend(body)
  30250. this.ws[kResponse].socket.write(frame.createFrame(opcodes.PONG))
  30251. if (channels.ping.hasSubscribers) {
  30252. channels.ping.publish({
  30253. payload: body
  30254. })
  30255. }
  30256. }
  30257. this.#state = parserStates.INFO
  30258. if (this.#byteOffset > 0) {
  30259. continue
  30260. } else {
  30261. callback()
  30262. return
  30263. }
  30264. } else if (this.#info.opcode === opcodes.PONG) {
  30265. // A Pong frame MAY be sent unsolicited. This serves as a
  30266. // unidirectional heartbeat. A response to an unsolicited Pong frame is
  30267. // not expected.
  30268. const body = this.consume(payloadLength)
  30269. if (channels.pong.hasSubscribers) {
  30270. channels.pong.publish({
  30271. payload: body
  30272. })
  30273. }
  30274. if (this.#byteOffset > 0) {
  30275. continue
  30276. } else {
  30277. callback()
  30278. return
  30279. }
  30280. }
  30281. } else if (this.#state === parserStates.PAYLOADLENGTH_16) {
  30282. if (this.#byteOffset < 2) {
  30283. return callback()
  30284. }
  30285. const buffer = this.consume(2)
  30286. this.#info.payloadLength = buffer.readUInt16BE(0)
  30287. this.#state = parserStates.READ_DATA
  30288. } else if (this.#state === parserStates.PAYLOADLENGTH_64) {
  30289. if (this.#byteOffset < 8) {
  30290. return callback()
  30291. }
  30292. const buffer = this.consume(8)
  30293. const upper = buffer.readUInt32BE(0)
  30294. // 2^31 is the maxinimum bytes an arraybuffer can contain
  30295. // on 32-bit systems. Although, on 64-bit systems, this is
  30296. // 2^53-1 bytes.
  30297. // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Invalid_array_length
  30298. // https://source.chromium.org/chromium/chromium/src/+/main:v8/src/common/globals.h;drc=1946212ac0100668f14eb9e2843bdd846e510a1e;bpv=1;bpt=1;l=1275
  30299. // https://source.chromium.org/chromium/chromium/src/+/main:v8/src/objects/js-array-buffer.h;l=34;drc=1946212ac0100668f14eb9e2843bdd846e510a1e
  30300. if (upper > 2 ** 31 - 1) {
  30301. failWebsocketConnection(this.ws, 'Received payload length > 2^31 bytes.')
  30302. return
  30303. }
  30304. const lower = buffer.readUInt32BE(4)
  30305. this.#info.payloadLength = (upper << 8) + lower
  30306. this.#state = parserStates.READ_DATA
  30307. } else if (this.#state === parserStates.READ_DATA) {
  30308. if (this.#byteOffset < this.#info.payloadLength) {
  30309. // If there is still more data in this chunk that needs to be read
  30310. return callback()
  30311. } else if (this.#byteOffset >= this.#info.payloadLength) {
  30312. // If the server sent multiple frames in a single chunk
  30313. const body = this.consume(this.#info.payloadLength)
  30314. this.#fragments.push(body)
  30315. // If the frame is unfragmented, or a fragmented frame was terminated,
  30316. // a message was received
  30317. if (!this.#info.fragmented || (this.#info.fin && this.#info.opcode === opcodes.CONTINUATION)) {
  30318. const fullMessage = Buffer.concat(this.#fragments)
  30319. websocketMessageReceived(this.ws, this.#info.originalOpcode, fullMessage)
  30320. this.#info = {}
  30321. this.#fragments.length = 0
  30322. }
  30323. this.#state = parserStates.INFO
  30324. }
  30325. }
  30326. if (this.#byteOffset > 0) {
  30327. continue
  30328. } else {
  30329. callback()
  30330. break
  30331. }
  30332. }
  30333. }
  30334. /**
  30335. * Take n bytes from the buffered Buffers
  30336. * @param {number} n
  30337. * @returns {Buffer|null}
  30338. */
  30339. consume (n) {
  30340. if (n > this.#byteOffset) {
  30341. return null
  30342. } else if (n === 0) {
  30343. return emptyBuffer
  30344. }
  30345. if (this.#buffers[0].length === n) {
  30346. this.#byteOffset -= this.#buffers[0].length
  30347. return this.#buffers.shift()
  30348. }
  30349. const buffer = Buffer.allocUnsafe(n)
  30350. let offset = 0
  30351. while (offset !== n) {
  30352. const next = this.#buffers[0]
  30353. const { length } = next
  30354. if (length + offset === n) {
  30355. buffer.set(this.#buffers.shift(), offset)
  30356. break
  30357. } else if (length + offset > n) {
  30358. buffer.set(next.subarray(0, n - offset), offset)
  30359. this.#buffers[0] = next.subarray(n - offset)
  30360. break
  30361. } else {
  30362. buffer.set(this.#buffers.shift(), offset)
  30363. offset += next.length
  30364. }
  30365. }
  30366. this.#byteOffset -= n
  30367. return buffer
  30368. }
  30369. parseCloseBody (onlyCode, data) {
  30370. // https://datatracker.ietf.org/doc/html/rfc6455#section-7.1.5
  30371. /** @type {number|undefined} */
  30372. let code
  30373. if (data.length >= 2) {
  30374. // _The WebSocket Connection Close Code_ is
  30375. // defined as the status code (Section 7.4) contained in the first Close
  30376. // control frame received by the application
  30377. code = data.readUInt16BE(0)
  30378. }
  30379. if (onlyCode) {
  30380. if (!isValidStatusCode(code)) {
  30381. return null
  30382. }
  30383. return { code }
  30384. }
  30385. // https://datatracker.ietf.org/doc/html/rfc6455#section-7.1.6
  30386. /** @type {Buffer} */
  30387. let reason = data.subarray(2)
  30388. // Remove BOM
  30389. if (reason[0] === 0xEF && reason[1] === 0xBB && reason[2] === 0xBF) {
  30390. reason = reason.subarray(3)
  30391. }
  30392. if (code !== undefined && !isValidStatusCode(code)) {
  30393. return null
  30394. }
  30395. try {
  30396. // TODO: optimize this
  30397. reason = new TextDecoder('utf-8', { fatal: true }).decode(reason)
  30398. } catch {
  30399. return null
  30400. }
  30401. return { code, reason }
  30402. }
  30403. get closingInfo () {
  30404. return this.#info.closeInfo
  30405. }
  30406. }
  30407. module.exports = {
  30408. ByteParser
  30409. }
  30410. /***/ }),
  30411. /***/ 7578:
  30412. /***/ ((module) => {
  30413. "use strict";
  30414. module.exports = {
  30415. kWebSocketURL: Symbol('url'),
  30416. kReadyState: Symbol('ready state'),
  30417. kController: Symbol('controller'),
  30418. kResponse: Symbol('response'),
  30419. kBinaryType: Symbol('binary type'),
  30420. kSentClose: Symbol('sent close'),
  30421. kReceivedClose: Symbol('received close'),
  30422. kByteParser: Symbol('byte parser')
  30423. }
  30424. /***/ }),
  30425. /***/ 5515:
  30426. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  30427. "use strict";
  30428. const { kReadyState, kController, kResponse, kBinaryType, kWebSocketURL } = __nccwpck_require__(7578)
  30429. const { states, opcodes } = __nccwpck_require__(9188)
  30430. const { MessageEvent, ErrorEvent } = __nccwpck_require__(2611)
  30431. /* globals Blob */
  30432. /**
  30433. * @param {import('./websocket').WebSocket} ws
  30434. */
  30435. function isEstablished (ws) {
  30436. // If the server's response is validated as provided for above, it is
  30437. // said that _The WebSocket Connection is Established_ and that the
  30438. // WebSocket Connection is in the OPEN state.
  30439. return ws[kReadyState] === states.OPEN
  30440. }
  30441. /**
  30442. * @param {import('./websocket').WebSocket} ws
  30443. */
  30444. function isClosing (ws) {
  30445. // Upon either sending or receiving a Close control frame, it is said
  30446. // that _The WebSocket Closing Handshake is Started_ and that the
  30447. // WebSocket connection is in the CLOSING state.
  30448. return ws[kReadyState] === states.CLOSING
  30449. }
  30450. /**
  30451. * @param {import('./websocket').WebSocket} ws
  30452. */
  30453. function isClosed (ws) {
  30454. return ws[kReadyState] === states.CLOSED
  30455. }
  30456. /**
  30457. * @see https://dom.spec.whatwg.org/#concept-event-fire
  30458. * @param {string} e
  30459. * @param {EventTarget} target
  30460. * @param {EventInit | undefined} eventInitDict
  30461. */
  30462. function fireEvent (e, target, eventConstructor = Event, eventInitDict) {
  30463. // 1. If eventConstructor is not given, then let eventConstructor be Event.
  30464. // 2. Let event be the result of creating an event given eventConstructor,
  30465. // in the relevant realm of target.
  30466. // 3. Initialize event’s type attribute to e.
  30467. const event = new eventConstructor(e, eventInitDict) // eslint-disable-line new-cap
  30468. // 4. Initialize any other IDL attributes of event as described in the
  30469. // invocation of this algorithm.
  30470. // 5. Return the result of dispatching event at target, with legacy target
  30471. // override flag set if set.
  30472. target.dispatchEvent(event)
  30473. }
  30474. /**
  30475. * @see https://websockets.spec.whatwg.org/#feedback-from-the-protocol
  30476. * @param {import('./websocket').WebSocket} ws
  30477. * @param {number} type Opcode
  30478. * @param {Buffer} data application data
  30479. */
  30480. function websocketMessageReceived (ws, type, data) {
  30481. // 1. If ready state is not OPEN (1), then return.
  30482. if (ws[kReadyState] !== states.OPEN) {
  30483. return
  30484. }
  30485. // 2. Let dataForEvent be determined by switching on type and binary type:
  30486. let dataForEvent
  30487. if (type === opcodes.TEXT) {
  30488. // -> type indicates that the data is Text
  30489. // a new DOMString containing data
  30490. try {
  30491. dataForEvent = new TextDecoder('utf-8', { fatal: true }).decode(data)
  30492. } catch {
  30493. failWebsocketConnection(ws, 'Received invalid UTF-8 in text frame.')
  30494. return
  30495. }
  30496. } else if (type === opcodes.BINARY) {
  30497. if (ws[kBinaryType] === 'blob') {
  30498. // -> type indicates that the data is Binary and binary type is "blob"
  30499. // a new Blob object, created in the relevant Realm of the WebSocket
  30500. // object, that represents data as its raw data
  30501. dataForEvent = new Blob([data])
  30502. } else {
  30503. // -> type indicates that the data is Binary and binary type is "arraybuffer"
  30504. // a new ArrayBuffer object, created in the relevant Realm of the
  30505. // WebSocket object, whose contents are data
  30506. dataForEvent = new Uint8Array(data).buffer
  30507. }
  30508. }
  30509. // 3. Fire an event named message at the WebSocket object, using MessageEvent,
  30510. // with the origin attribute initialized to the serialization of the WebSocket
  30511. // object’s url's origin, and the data attribute initialized to dataForEvent.
  30512. fireEvent('message', ws, MessageEvent, {
  30513. origin: ws[kWebSocketURL].origin,
  30514. data: dataForEvent
  30515. })
  30516. }
  30517. /**
  30518. * @see https://datatracker.ietf.org/doc/html/rfc6455
  30519. * @see https://datatracker.ietf.org/doc/html/rfc2616
  30520. * @see https://bugs.chromium.org/p/chromium/issues/detail?id=398407
  30521. * @param {string} protocol
  30522. */
  30523. function isValidSubprotocol (protocol) {
  30524. // If present, this value indicates one
  30525. // or more comma-separated subprotocol the client wishes to speak,
  30526. // ordered by preference. The elements that comprise this value
  30527. // MUST be non-empty strings with characters in the range U+0021 to
  30528. // U+007E not including separator characters as defined in
  30529. // [RFC2616] and MUST all be unique strings.
  30530. if (protocol.length === 0) {
  30531. return false
  30532. }
  30533. for (const char of protocol) {
  30534. const code = char.charCodeAt(0)
  30535. if (
  30536. code < 0x21 ||
  30537. code > 0x7E ||
  30538. char === '(' ||
  30539. char === ')' ||
  30540. char === '<' ||
  30541. char === '>' ||
  30542. char === '@' ||
  30543. char === ',' ||
  30544. char === ';' ||
  30545. char === ':' ||
  30546. char === '\\' ||
  30547. char === '"' ||
  30548. char === '/' ||
  30549. char === '[' ||
  30550. char === ']' ||
  30551. char === '?' ||
  30552. char === '=' ||
  30553. char === '{' ||
  30554. char === '}' ||
  30555. code === 32 || // SP
  30556. code === 9 // HT
  30557. ) {
  30558. return false
  30559. }
  30560. }
  30561. return true
  30562. }
  30563. /**
  30564. * @see https://datatracker.ietf.org/doc/html/rfc6455#section-7-4
  30565. * @param {number} code
  30566. */
  30567. function isValidStatusCode (code) {
  30568. if (code >= 1000 && code < 1015) {
  30569. return (
  30570. code !== 1004 && // reserved
  30571. code !== 1005 && // "MUST NOT be set as a status code"
  30572. code !== 1006 // "MUST NOT be set as a status code"
  30573. )
  30574. }
  30575. return code >= 3000 && code <= 4999
  30576. }
  30577. /**
  30578. * @param {import('./websocket').WebSocket} ws
  30579. * @param {string|undefined} reason
  30580. */
  30581. function failWebsocketConnection (ws, reason) {
  30582. const { [kController]: controller, [kResponse]: response } = ws
  30583. controller.abort()
  30584. if (response?.socket && !response.socket.destroyed) {
  30585. response.socket.destroy()
  30586. }
  30587. if (reason) {
  30588. fireEvent('error', ws, ErrorEvent, {
  30589. error: new Error(reason)
  30590. })
  30591. }
  30592. }
  30593. module.exports = {
  30594. isEstablished,
  30595. isClosing,
  30596. isClosed,
  30597. fireEvent,
  30598. isValidSubprotocol,
  30599. isValidStatusCode,
  30600. failWebsocketConnection,
  30601. websocketMessageReceived
  30602. }
  30603. /***/ }),
  30604. /***/ 4284:
  30605. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  30606. "use strict";
  30607. const { webidl } = __nccwpck_require__(1744)
  30608. const { DOMException } = __nccwpck_require__(1037)
  30609. const { URLSerializer } = __nccwpck_require__(685)
  30610. const { getGlobalOrigin } = __nccwpck_require__(1246)
  30611. const { staticPropertyDescriptors, states, opcodes, emptyBuffer } = __nccwpck_require__(9188)
  30612. const {
  30613. kWebSocketURL,
  30614. kReadyState,
  30615. kController,
  30616. kBinaryType,
  30617. kResponse,
  30618. kSentClose,
  30619. kByteParser
  30620. } = __nccwpck_require__(7578)
  30621. const { isEstablished, isClosing, isValidSubprotocol, failWebsocketConnection, fireEvent } = __nccwpck_require__(5515)
  30622. const { establishWebSocketConnection } = __nccwpck_require__(5354)
  30623. const { WebsocketFrameSend } = __nccwpck_require__(5444)
  30624. const { ByteParser } = __nccwpck_require__(1688)
  30625. const { kEnumerableProperty, isBlobLike } = __nccwpck_require__(3983)
  30626. const { getGlobalDispatcher } = __nccwpck_require__(1892)
  30627. const { types } = __nccwpck_require__(3837)
  30628. let experimentalWarned = false
  30629. // https://websockets.spec.whatwg.org/#interface-definition
  30630. class WebSocket extends EventTarget {
  30631. #events = {
  30632. open: null,
  30633. error: null,
  30634. close: null,
  30635. message: null
  30636. }
  30637. #bufferedAmount = 0
  30638. #protocol = ''
  30639. #extensions = ''
  30640. /**
  30641. * @param {string} url
  30642. * @param {string|string[]} protocols
  30643. */
  30644. constructor (url, protocols = []) {
  30645. super()
  30646. webidl.argumentLengthCheck(arguments, 1, { header: 'WebSocket constructor' })
  30647. if (!experimentalWarned) {
  30648. experimentalWarned = true
  30649. process.emitWarning('WebSockets are experimental, expect them to change at any time.', {
  30650. code: 'UNDICI-WS'
  30651. })
  30652. }
  30653. const options = webidl.converters['DOMString or sequence<DOMString> or WebSocketInit'](protocols)
  30654. url = webidl.converters.USVString(url)
  30655. protocols = options.protocols
  30656. // 1. Let baseURL be this's relevant settings object's API base URL.
  30657. const baseURL = getGlobalOrigin()
  30658. // 1. Let urlRecord be the result of applying the URL parser to url with baseURL.
  30659. let urlRecord
  30660. try {
  30661. urlRecord = new URL(url, baseURL)
  30662. } catch (e) {
  30663. // 3. If urlRecord is failure, then throw a "SyntaxError" DOMException.
  30664. throw new DOMException(e, 'SyntaxError')
  30665. }
  30666. // 4. If urlRecord’s scheme is "http", then set urlRecord’s scheme to "ws".
  30667. if (urlRecord.protocol === 'http:') {
  30668. urlRecord.protocol = 'ws:'
  30669. } else if (urlRecord.protocol === 'https:') {
  30670. // 5. Otherwise, if urlRecord’s scheme is "https", set urlRecord’s scheme to "wss".
  30671. urlRecord.protocol = 'wss:'
  30672. }
  30673. // 6. If urlRecord’s scheme is not "ws" or "wss", then throw a "SyntaxError" DOMException.
  30674. if (urlRecord.protocol !== 'ws:' && urlRecord.protocol !== 'wss:') {
  30675. throw new DOMException(
  30676. `Expected a ws: or wss: protocol, got ${urlRecord.protocol}`,
  30677. 'SyntaxError'
  30678. )
  30679. }
  30680. // 7. If urlRecord’s fragment is non-null, then throw a "SyntaxError"
  30681. // DOMException.
  30682. if (urlRecord.hash || urlRecord.href.endsWith('#')) {
  30683. throw new DOMException('Got fragment', 'SyntaxError')
  30684. }
  30685. // 8. If protocols is a string, set protocols to a sequence consisting
  30686. // of just that string.
  30687. if (typeof protocols === 'string') {
  30688. protocols = [protocols]
  30689. }
  30690. // 9. If any of the values in protocols occur more than once or otherwise
  30691. // fail to match the requirements for elements that comprise the value
  30692. // of `Sec-WebSocket-Protocol` fields as defined by The WebSocket
  30693. // protocol, then throw a "SyntaxError" DOMException.
  30694. if (protocols.length !== new Set(protocols.map(p => p.toLowerCase())).size) {
  30695. throw new DOMException('Invalid Sec-WebSocket-Protocol value', 'SyntaxError')
  30696. }
  30697. if (protocols.length > 0 && !protocols.every(p => isValidSubprotocol(p))) {
  30698. throw new DOMException('Invalid Sec-WebSocket-Protocol value', 'SyntaxError')
  30699. }
  30700. // 10. Set this's url to urlRecord.
  30701. this[kWebSocketURL] = new URL(urlRecord.href)
  30702. // 11. Let client be this's relevant settings object.
  30703. // 12. Run this step in parallel:
  30704. // 1. Establish a WebSocket connection given urlRecord, protocols,
  30705. // and client.
  30706. this[kController] = establishWebSocketConnection(
  30707. urlRecord,
  30708. protocols,
  30709. this,
  30710. (response) => this.#onConnectionEstablished(response),
  30711. options
  30712. )
  30713. // Each WebSocket object has an associated ready state, which is a
  30714. // number representing the state of the connection. Initially it must
  30715. // be CONNECTING (0).
  30716. this[kReadyState] = WebSocket.CONNECTING
  30717. // The extensions attribute must initially return the empty string.
  30718. // The protocol attribute must initially return the empty string.
  30719. // Each WebSocket object has an associated binary type, which is a
  30720. // BinaryType. Initially it must be "blob".
  30721. this[kBinaryType] = 'blob'
  30722. }
  30723. /**
  30724. * @see https://websockets.spec.whatwg.org/#dom-websocket-close
  30725. * @param {number|undefined} code
  30726. * @param {string|undefined} reason
  30727. */
  30728. close (code = undefined, reason = undefined) {
  30729. webidl.brandCheck(this, WebSocket)
  30730. if (code !== undefined) {
  30731. code = webidl.converters['unsigned short'](code, { clamp: true })
  30732. }
  30733. if (reason !== undefined) {
  30734. reason = webidl.converters.USVString(reason)
  30735. }
  30736. // 1. If code is present, but is neither an integer equal to 1000 nor an
  30737. // integer in the range 3000 to 4999, inclusive, throw an
  30738. // "InvalidAccessError" DOMException.
  30739. if (code !== undefined) {
  30740. if (code !== 1000 && (code < 3000 || code > 4999)) {
  30741. throw new DOMException('invalid code', 'InvalidAccessError')
  30742. }
  30743. }
  30744. let reasonByteLength = 0
  30745. // 2. If reason is present, then run these substeps:
  30746. if (reason !== undefined) {
  30747. // 1. Let reasonBytes be the result of encoding reason.
  30748. // 2. If reasonBytes is longer than 123 bytes, then throw a
  30749. // "SyntaxError" DOMException.
  30750. reasonByteLength = Buffer.byteLength(reason)
  30751. if (reasonByteLength > 123) {
  30752. throw new DOMException(
  30753. `Reason must be less than 123 bytes; received ${reasonByteLength}`,
  30754. 'SyntaxError'
  30755. )
  30756. }
  30757. }
  30758. // 3. Run the first matching steps from the following list:
  30759. if (this[kReadyState] === WebSocket.CLOSING || this[kReadyState] === WebSocket.CLOSED) {
  30760. // If this's ready state is CLOSING (2) or CLOSED (3)
  30761. // Do nothing.
  30762. } else if (!isEstablished(this)) {
  30763. // If the WebSocket connection is not yet established
  30764. // Fail the WebSocket connection and set this's ready state
  30765. // to CLOSING (2).
  30766. failWebsocketConnection(this, 'Connection was closed before it was established.')
  30767. this[kReadyState] = WebSocket.CLOSING
  30768. } else if (!isClosing(this)) {
  30769. // If the WebSocket closing handshake has not yet been started
  30770. // Start the WebSocket closing handshake and set this's ready
  30771. // state to CLOSING (2).
  30772. // - If neither code nor reason is present, the WebSocket Close
  30773. // message must not have a body.
  30774. // - If code is present, then the status code to use in the
  30775. // WebSocket Close message must be the integer given by code.
  30776. // - If reason is also present, then reasonBytes must be
  30777. // provided in the Close message after the status code.
  30778. const frame = new WebsocketFrameSend()
  30779. // If neither code nor reason is present, the WebSocket Close
  30780. // message must not have a body.
  30781. // If code is present, then the status code to use in the
  30782. // WebSocket Close message must be the integer given by code.
  30783. if (code !== undefined && reason === undefined) {
  30784. frame.frameData = Buffer.allocUnsafe(2)
  30785. frame.frameData.writeUInt16BE(code, 0)
  30786. } else if (code !== undefined && reason !== undefined) {
  30787. // If reason is also present, then reasonBytes must be
  30788. // provided in the Close message after the status code.
  30789. frame.frameData = Buffer.allocUnsafe(2 + reasonByteLength)
  30790. frame.frameData.writeUInt16BE(code, 0)
  30791. // the body MAY contain UTF-8-encoded data with value /reason/
  30792. frame.frameData.write(reason, 2, 'utf-8')
  30793. } else {
  30794. frame.frameData = emptyBuffer
  30795. }
  30796. /** @type {import('stream').Duplex} */
  30797. const socket = this[kResponse].socket
  30798. socket.write(frame.createFrame(opcodes.CLOSE), (err) => {
  30799. if (!err) {
  30800. this[kSentClose] = true
  30801. }
  30802. })
  30803. // Upon either sending or receiving a Close control frame, it is said
  30804. // that _The WebSocket Closing Handshake is Started_ and that the
  30805. // WebSocket connection is in the CLOSING state.
  30806. this[kReadyState] = states.CLOSING
  30807. } else {
  30808. // Otherwise
  30809. // Set this's ready state to CLOSING (2).
  30810. this[kReadyState] = WebSocket.CLOSING
  30811. }
  30812. }
  30813. /**
  30814. * @see https://websockets.spec.whatwg.org/#dom-websocket-send
  30815. * @param {NodeJS.TypedArray|ArrayBuffer|Blob|string} data
  30816. */
  30817. send (data) {
  30818. webidl.brandCheck(this, WebSocket)
  30819. webidl.argumentLengthCheck(arguments, 1, { header: 'WebSocket.send' })
  30820. data = webidl.converters.WebSocketSendData(data)
  30821. // 1. If this's ready state is CONNECTING, then throw an
  30822. // "InvalidStateError" DOMException.
  30823. if (this[kReadyState] === WebSocket.CONNECTING) {
  30824. throw new DOMException('Sent before connected.', 'InvalidStateError')
  30825. }
  30826. // 2. Run the appropriate set of steps from the following list:
  30827. // https://datatracker.ietf.org/doc/html/rfc6455#section-6.1
  30828. // https://datatracker.ietf.org/doc/html/rfc6455#section-5.2
  30829. if (!isEstablished(this) || isClosing(this)) {
  30830. return
  30831. }
  30832. /** @type {import('stream').Duplex} */
  30833. const socket = this[kResponse].socket
  30834. // If data is a string
  30835. if (typeof data === 'string') {
  30836. // If the WebSocket connection is established and the WebSocket
  30837. // closing handshake has not yet started, then the user agent
  30838. // must send a WebSocket Message comprised of the data argument
  30839. // using a text frame opcode; if the data cannot be sent, e.g.
  30840. // because it would need to be buffered but the buffer is full,
  30841. // the user agent must flag the WebSocket as full and then close
  30842. // the WebSocket connection. Any invocation of this method with a
  30843. // string argument that does not throw an exception must increase
  30844. // the bufferedAmount attribute by the number of bytes needed to
  30845. // express the argument as UTF-8.
  30846. const value = Buffer.from(data)
  30847. const frame = new WebsocketFrameSend(value)
  30848. const buffer = frame.createFrame(opcodes.TEXT)
  30849. this.#bufferedAmount += value.byteLength
  30850. socket.write(buffer, () => {
  30851. this.#bufferedAmount -= value.byteLength
  30852. })
  30853. } else if (types.isArrayBuffer(data)) {
  30854. // If the WebSocket connection is established, and the WebSocket
  30855. // closing handshake has not yet started, then the user agent must
  30856. // send a WebSocket Message comprised of data using a binary frame
  30857. // opcode; if the data cannot be sent, e.g. because it would need
  30858. // to be buffered but the buffer is full, the user agent must flag
  30859. // the WebSocket as full and then close the WebSocket connection.
  30860. // The data to be sent is the data stored in the buffer described
  30861. // by the ArrayBuffer object. Any invocation of this method with an
  30862. // ArrayBuffer argument that does not throw an exception must
  30863. // increase the bufferedAmount attribute by the length of the
  30864. // ArrayBuffer in bytes.
  30865. const value = Buffer.from(data)
  30866. const frame = new WebsocketFrameSend(value)
  30867. const buffer = frame.createFrame(opcodes.BINARY)
  30868. this.#bufferedAmount += value.byteLength
  30869. socket.write(buffer, () => {
  30870. this.#bufferedAmount -= value.byteLength
  30871. })
  30872. } else if (ArrayBuffer.isView(data)) {
  30873. // If the WebSocket connection is established, and the WebSocket
  30874. // closing handshake has not yet started, then the user agent must
  30875. // send a WebSocket Message comprised of data using a binary frame
  30876. // opcode; if the data cannot be sent, e.g. because it would need to
  30877. // be buffered but the buffer is full, the user agent must flag the
  30878. // WebSocket as full and then close the WebSocket connection. The
  30879. // data to be sent is the data stored in the section of the buffer
  30880. // described by the ArrayBuffer object that data references. Any
  30881. // invocation of this method with this kind of argument that does
  30882. // not throw an exception must increase the bufferedAmount attribute
  30883. // by the length of data’s buffer in bytes.
  30884. const ab = Buffer.from(data, data.byteOffset, data.byteLength)
  30885. const frame = new WebsocketFrameSend(ab)
  30886. const buffer = frame.createFrame(opcodes.BINARY)
  30887. this.#bufferedAmount += ab.byteLength
  30888. socket.write(buffer, () => {
  30889. this.#bufferedAmount -= ab.byteLength
  30890. })
  30891. } else if (isBlobLike(data)) {
  30892. // If the WebSocket connection is established, and the WebSocket
  30893. // closing handshake has not yet started, then the user agent must
  30894. // send a WebSocket Message comprised of data using a binary frame
  30895. // opcode; if the data cannot be sent, e.g. because it would need to
  30896. // be buffered but the buffer is full, the user agent must flag the
  30897. // WebSocket as full and then close the WebSocket connection. The data
  30898. // to be sent is the raw data represented by the Blob object. Any
  30899. // invocation of this method with a Blob argument that does not throw
  30900. // an exception must increase the bufferedAmount attribute by the size
  30901. // of the Blob object’s raw data, in bytes.
  30902. const frame = new WebsocketFrameSend()
  30903. data.arrayBuffer().then((ab) => {
  30904. const value = Buffer.from(ab)
  30905. frame.frameData = value
  30906. const buffer = frame.createFrame(opcodes.BINARY)
  30907. this.#bufferedAmount += value.byteLength
  30908. socket.write(buffer, () => {
  30909. this.#bufferedAmount -= value.byteLength
  30910. })
  30911. })
  30912. }
  30913. }
  30914. get readyState () {
  30915. webidl.brandCheck(this, WebSocket)
  30916. // The readyState getter steps are to return this's ready state.
  30917. return this[kReadyState]
  30918. }
  30919. get bufferedAmount () {
  30920. webidl.brandCheck(this, WebSocket)
  30921. return this.#bufferedAmount
  30922. }
  30923. get url () {
  30924. webidl.brandCheck(this, WebSocket)
  30925. // The url getter steps are to return this's url, serialized.
  30926. return URLSerializer(this[kWebSocketURL])
  30927. }
  30928. get extensions () {
  30929. webidl.brandCheck(this, WebSocket)
  30930. return this.#extensions
  30931. }
  30932. get protocol () {
  30933. webidl.brandCheck(this, WebSocket)
  30934. return this.#protocol
  30935. }
  30936. get onopen () {
  30937. webidl.brandCheck(this, WebSocket)
  30938. return this.#events.open
  30939. }
  30940. set onopen (fn) {
  30941. webidl.brandCheck(this, WebSocket)
  30942. if (this.#events.open) {
  30943. this.removeEventListener('open', this.#events.open)
  30944. }
  30945. if (typeof fn === 'function') {
  30946. this.#events.open = fn
  30947. this.addEventListener('open', fn)
  30948. } else {
  30949. this.#events.open = null
  30950. }
  30951. }
  30952. get onerror () {
  30953. webidl.brandCheck(this, WebSocket)
  30954. return this.#events.error
  30955. }
  30956. set onerror (fn) {
  30957. webidl.brandCheck(this, WebSocket)
  30958. if (this.#events.error) {
  30959. this.removeEventListener('error', this.#events.error)
  30960. }
  30961. if (typeof fn === 'function') {
  30962. this.#events.error = fn
  30963. this.addEventListener('error', fn)
  30964. } else {
  30965. this.#events.error = null
  30966. }
  30967. }
  30968. get onclose () {
  30969. webidl.brandCheck(this, WebSocket)
  30970. return this.#events.close
  30971. }
  30972. set onclose (fn) {
  30973. webidl.brandCheck(this, WebSocket)
  30974. if (this.#events.close) {
  30975. this.removeEventListener('close', this.#events.close)
  30976. }
  30977. if (typeof fn === 'function') {
  30978. this.#events.close = fn
  30979. this.addEventListener('close', fn)
  30980. } else {
  30981. this.#events.close = null
  30982. }
  30983. }
  30984. get onmessage () {
  30985. webidl.brandCheck(this, WebSocket)
  30986. return this.#events.message
  30987. }
  30988. set onmessage (fn) {
  30989. webidl.brandCheck(this, WebSocket)
  30990. if (this.#events.message) {
  30991. this.removeEventListener('message', this.#events.message)
  30992. }
  30993. if (typeof fn === 'function') {
  30994. this.#events.message = fn
  30995. this.addEventListener('message', fn)
  30996. } else {
  30997. this.#events.message = null
  30998. }
  30999. }
  31000. get binaryType () {
  31001. webidl.brandCheck(this, WebSocket)
  31002. return this[kBinaryType]
  31003. }
  31004. set binaryType (type) {
  31005. webidl.brandCheck(this, WebSocket)
  31006. if (type !== 'blob' && type !== 'arraybuffer') {
  31007. this[kBinaryType] = 'blob'
  31008. } else {
  31009. this[kBinaryType] = type
  31010. }
  31011. }
  31012. /**
  31013. * @see https://websockets.spec.whatwg.org/#feedback-from-the-protocol
  31014. */
  31015. #onConnectionEstablished (response) {
  31016. // processResponse is called when the "response’s header list has been received and initialized."
  31017. // once this happens, the connection is open
  31018. this[kResponse] = response
  31019. const parser = new ByteParser(this)
  31020. parser.on('drain', function onParserDrain () {
  31021. this.ws[kResponse].socket.resume()
  31022. })
  31023. response.socket.ws = this
  31024. this[kByteParser] = parser
  31025. // 1. Change the ready state to OPEN (1).
  31026. this[kReadyState] = states.OPEN
  31027. // 2. Change the extensions attribute’s value to the extensions in use, if
  31028. // it is not the null value.
  31029. // https://datatracker.ietf.org/doc/html/rfc6455#section-9.1
  31030. const extensions = response.headersList.get('sec-websocket-extensions')
  31031. if (extensions !== null) {
  31032. this.#extensions = extensions
  31033. }
  31034. // 3. Change the protocol attribute’s value to the subprotocol in use, if
  31035. // it is not the null value.
  31036. // https://datatracker.ietf.org/doc/html/rfc6455#section-1.9
  31037. const protocol = response.headersList.get('sec-websocket-protocol')
  31038. if (protocol !== null) {
  31039. this.#protocol = protocol
  31040. }
  31041. // 4. Fire an event named open at the WebSocket object.
  31042. fireEvent('open', this)
  31043. }
  31044. }
  31045. // https://websockets.spec.whatwg.org/#dom-websocket-connecting
  31046. WebSocket.CONNECTING = WebSocket.prototype.CONNECTING = states.CONNECTING
  31047. // https://websockets.spec.whatwg.org/#dom-websocket-open
  31048. WebSocket.OPEN = WebSocket.prototype.OPEN = states.OPEN
  31049. // https://websockets.spec.whatwg.org/#dom-websocket-closing
  31050. WebSocket.CLOSING = WebSocket.prototype.CLOSING = states.CLOSING
  31051. // https://websockets.spec.whatwg.org/#dom-websocket-closed
  31052. WebSocket.CLOSED = WebSocket.prototype.CLOSED = states.CLOSED
  31053. Object.defineProperties(WebSocket.prototype, {
  31054. CONNECTING: staticPropertyDescriptors,
  31055. OPEN: staticPropertyDescriptors,
  31056. CLOSING: staticPropertyDescriptors,
  31057. CLOSED: staticPropertyDescriptors,
  31058. url: kEnumerableProperty,
  31059. readyState: kEnumerableProperty,
  31060. bufferedAmount: kEnumerableProperty,
  31061. onopen: kEnumerableProperty,
  31062. onerror: kEnumerableProperty,
  31063. onclose: kEnumerableProperty,
  31064. close: kEnumerableProperty,
  31065. onmessage: kEnumerableProperty,
  31066. binaryType: kEnumerableProperty,
  31067. send: kEnumerableProperty,
  31068. extensions: kEnumerableProperty,
  31069. protocol: kEnumerableProperty,
  31070. [Symbol.toStringTag]: {
  31071. value: 'WebSocket',
  31072. writable: false,
  31073. enumerable: false,
  31074. configurable: true
  31075. }
  31076. })
  31077. Object.defineProperties(WebSocket, {
  31078. CONNECTING: staticPropertyDescriptors,
  31079. OPEN: staticPropertyDescriptors,
  31080. CLOSING: staticPropertyDescriptors,
  31081. CLOSED: staticPropertyDescriptors
  31082. })
  31083. webidl.converters['sequence<DOMString>'] = webidl.sequenceConverter(
  31084. webidl.converters.DOMString
  31085. )
  31086. webidl.converters['DOMString or sequence<DOMString>'] = function (V) {
  31087. if (webidl.util.Type(V) === 'Object' && Symbol.iterator in V) {
  31088. return webidl.converters['sequence<DOMString>'](V)
  31089. }
  31090. return webidl.converters.DOMString(V)
  31091. }
  31092. // This implements the propsal made in https://github.com/whatwg/websockets/issues/42
  31093. webidl.converters.WebSocketInit = webidl.dictionaryConverter([
  31094. {
  31095. key: 'protocols',
  31096. converter: webidl.converters['DOMString or sequence<DOMString>'],
  31097. get defaultValue () {
  31098. return []
  31099. }
  31100. },
  31101. {
  31102. key: 'dispatcher',
  31103. converter: (V) => V,
  31104. get defaultValue () {
  31105. return getGlobalDispatcher()
  31106. }
  31107. },
  31108. {
  31109. key: 'headers',
  31110. converter: webidl.nullableConverter(webidl.converters.HeadersInit)
  31111. }
  31112. ])
  31113. webidl.converters['DOMString or sequence<DOMString> or WebSocketInit'] = function (V) {
  31114. if (webidl.util.Type(V) === 'Object' && !(Symbol.iterator in V)) {
  31115. return webidl.converters.WebSocketInit(V)
  31116. }
  31117. return { protocols: webidl.converters['DOMString or sequence<DOMString>'](V) }
  31118. }
  31119. webidl.converters.WebSocketSendData = function (V) {
  31120. if (webidl.util.Type(V) === 'Object') {
  31121. if (isBlobLike(V)) {
  31122. return webidl.converters.Blob(V, { strict: false })
  31123. }
  31124. if (ArrayBuffer.isView(V) || types.isAnyArrayBuffer(V)) {
  31125. return webidl.converters.BufferSource(V)
  31126. }
  31127. }
  31128. return webidl.converters.USVString(V)
  31129. }
  31130. module.exports = {
  31131. WebSocket
  31132. }
  31133. /***/ }),
  31134. /***/ 5030:
  31135. /***/ ((__unused_webpack_module, exports) => {
  31136. "use strict";
  31137. Object.defineProperty(exports, "__esModule", ({ value: true }));
  31138. function getUserAgent() {
  31139. if (typeof navigator === "object" && "userAgent" in navigator) {
  31140. return navigator.userAgent;
  31141. }
  31142. if (typeof process === "object" && process.version !== undefined) {
  31143. return `Node.js/${process.version.substr(1)} (${process.platform}; ${process.arch})`;
  31144. }
  31145. return "<environment undetectable>";
  31146. }
  31147. exports.getUserAgent = getUserAgent;
  31148. //# sourceMappingURL=index.js.map
  31149. /***/ }),
  31150. /***/ 5840:
  31151. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31152. "use strict";
  31153. Object.defineProperty(exports, "__esModule", ({
  31154. value: true
  31155. }));
  31156. Object.defineProperty(exports, "NIL", ({
  31157. enumerable: true,
  31158. get: function () {
  31159. return _nil.default;
  31160. }
  31161. }));
  31162. Object.defineProperty(exports, "parse", ({
  31163. enumerable: true,
  31164. get: function () {
  31165. return _parse.default;
  31166. }
  31167. }));
  31168. Object.defineProperty(exports, "stringify", ({
  31169. enumerable: true,
  31170. get: function () {
  31171. return _stringify.default;
  31172. }
  31173. }));
  31174. Object.defineProperty(exports, "v1", ({
  31175. enumerable: true,
  31176. get: function () {
  31177. return _v.default;
  31178. }
  31179. }));
  31180. Object.defineProperty(exports, "v3", ({
  31181. enumerable: true,
  31182. get: function () {
  31183. return _v2.default;
  31184. }
  31185. }));
  31186. Object.defineProperty(exports, "v4", ({
  31187. enumerable: true,
  31188. get: function () {
  31189. return _v3.default;
  31190. }
  31191. }));
  31192. Object.defineProperty(exports, "v5", ({
  31193. enumerable: true,
  31194. get: function () {
  31195. return _v4.default;
  31196. }
  31197. }));
  31198. Object.defineProperty(exports, "validate", ({
  31199. enumerable: true,
  31200. get: function () {
  31201. return _validate.default;
  31202. }
  31203. }));
  31204. Object.defineProperty(exports, "version", ({
  31205. enumerable: true,
  31206. get: function () {
  31207. return _version.default;
  31208. }
  31209. }));
  31210. var _v = _interopRequireDefault(__nccwpck_require__(8628));
  31211. var _v2 = _interopRequireDefault(__nccwpck_require__(6409));
  31212. var _v3 = _interopRequireDefault(__nccwpck_require__(5122));
  31213. var _v4 = _interopRequireDefault(__nccwpck_require__(9120));
  31214. var _nil = _interopRequireDefault(__nccwpck_require__(5332));
  31215. var _version = _interopRequireDefault(__nccwpck_require__(2414));
  31216. var _validate = _interopRequireDefault(__nccwpck_require__(6900));
  31217. var _stringify = _interopRequireDefault(__nccwpck_require__(8950));
  31218. var _parse = _interopRequireDefault(__nccwpck_require__(2746));
  31219. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31220. /***/ }),
  31221. /***/ 4569:
  31222. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31223. "use strict";
  31224. Object.defineProperty(exports, "__esModule", ({
  31225. value: true
  31226. }));
  31227. exports["default"] = void 0;
  31228. var _crypto = _interopRequireDefault(__nccwpck_require__(6113));
  31229. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31230. function md5(bytes) {
  31231. if (Array.isArray(bytes)) {
  31232. bytes = Buffer.from(bytes);
  31233. } else if (typeof bytes === 'string') {
  31234. bytes = Buffer.from(bytes, 'utf8');
  31235. }
  31236. return _crypto.default.createHash('md5').update(bytes).digest();
  31237. }
  31238. var _default = md5;
  31239. exports["default"] = _default;
  31240. /***/ }),
  31241. /***/ 2054:
  31242. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31243. "use strict";
  31244. Object.defineProperty(exports, "__esModule", ({
  31245. value: true
  31246. }));
  31247. exports["default"] = void 0;
  31248. var _crypto = _interopRequireDefault(__nccwpck_require__(6113));
  31249. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31250. var _default = {
  31251. randomUUID: _crypto.default.randomUUID
  31252. };
  31253. exports["default"] = _default;
  31254. /***/ }),
  31255. /***/ 5332:
  31256. /***/ ((__unused_webpack_module, exports) => {
  31257. "use strict";
  31258. Object.defineProperty(exports, "__esModule", ({
  31259. value: true
  31260. }));
  31261. exports["default"] = void 0;
  31262. var _default = '00000000-0000-0000-0000-000000000000';
  31263. exports["default"] = _default;
  31264. /***/ }),
  31265. /***/ 2746:
  31266. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31267. "use strict";
  31268. Object.defineProperty(exports, "__esModule", ({
  31269. value: true
  31270. }));
  31271. exports["default"] = void 0;
  31272. var _validate = _interopRequireDefault(__nccwpck_require__(6900));
  31273. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31274. function parse(uuid) {
  31275. if (!(0, _validate.default)(uuid)) {
  31276. throw TypeError('Invalid UUID');
  31277. }
  31278. let v;
  31279. const arr = new Uint8Array(16); // Parse ########-....-....-....-............
  31280. arr[0] = (v = parseInt(uuid.slice(0, 8), 16)) >>> 24;
  31281. arr[1] = v >>> 16 & 0xff;
  31282. arr[2] = v >>> 8 & 0xff;
  31283. arr[3] = v & 0xff; // Parse ........-####-....-....-............
  31284. arr[4] = (v = parseInt(uuid.slice(9, 13), 16)) >>> 8;
  31285. arr[5] = v & 0xff; // Parse ........-....-####-....-............
  31286. arr[6] = (v = parseInt(uuid.slice(14, 18), 16)) >>> 8;
  31287. arr[7] = v & 0xff; // Parse ........-....-....-####-............
  31288. arr[8] = (v = parseInt(uuid.slice(19, 23), 16)) >>> 8;
  31289. arr[9] = v & 0xff; // Parse ........-....-....-....-############
  31290. // (Use "/" to avoid 32-bit truncation when bit-shifting high-order bytes)
  31291. arr[10] = (v = parseInt(uuid.slice(24, 36), 16)) / 0x10000000000 & 0xff;
  31292. arr[11] = v / 0x100000000 & 0xff;
  31293. arr[12] = v >>> 24 & 0xff;
  31294. arr[13] = v >>> 16 & 0xff;
  31295. arr[14] = v >>> 8 & 0xff;
  31296. arr[15] = v & 0xff;
  31297. return arr;
  31298. }
  31299. var _default = parse;
  31300. exports["default"] = _default;
  31301. /***/ }),
  31302. /***/ 814:
  31303. /***/ ((__unused_webpack_module, exports) => {
  31304. "use strict";
  31305. Object.defineProperty(exports, "__esModule", ({
  31306. value: true
  31307. }));
  31308. exports["default"] = void 0;
  31309. 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;
  31310. exports["default"] = _default;
  31311. /***/ }),
  31312. /***/ 807:
  31313. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31314. "use strict";
  31315. Object.defineProperty(exports, "__esModule", ({
  31316. value: true
  31317. }));
  31318. exports["default"] = rng;
  31319. var _crypto = _interopRequireDefault(__nccwpck_require__(6113));
  31320. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31321. const rnds8Pool = new Uint8Array(256); // # of random values to pre-allocate
  31322. let poolPtr = rnds8Pool.length;
  31323. function rng() {
  31324. if (poolPtr > rnds8Pool.length - 16) {
  31325. _crypto.default.randomFillSync(rnds8Pool);
  31326. poolPtr = 0;
  31327. }
  31328. return rnds8Pool.slice(poolPtr, poolPtr += 16);
  31329. }
  31330. /***/ }),
  31331. /***/ 5274:
  31332. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31333. "use strict";
  31334. Object.defineProperty(exports, "__esModule", ({
  31335. value: true
  31336. }));
  31337. exports["default"] = void 0;
  31338. var _crypto = _interopRequireDefault(__nccwpck_require__(6113));
  31339. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31340. function sha1(bytes) {
  31341. if (Array.isArray(bytes)) {
  31342. bytes = Buffer.from(bytes);
  31343. } else if (typeof bytes === 'string') {
  31344. bytes = Buffer.from(bytes, 'utf8');
  31345. }
  31346. return _crypto.default.createHash('sha1').update(bytes).digest();
  31347. }
  31348. var _default = sha1;
  31349. exports["default"] = _default;
  31350. /***/ }),
  31351. /***/ 8950:
  31352. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31353. "use strict";
  31354. Object.defineProperty(exports, "__esModule", ({
  31355. value: true
  31356. }));
  31357. exports["default"] = void 0;
  31358. exports.unsafeStringify = unsafeStringify;
  31359. var _validate = _interopRequireDefault(__nccwpck_require__(6900));
  31360. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31361. /**
  31362. * Convert array of 16 byte values to UUID string format of the form:
  31363. * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
  31364. */
  31365. const byteToHex = [];
  31366. for (let i = 0; i < 256; ++i) {
  31367. byteToHex.push((i + 0x100).toString(16).slice(1));
  31368. }
  31369. function unsafeStringify(arr, offset = 0) {
  31370. // Note: Be careful editing this code! It's been tuned for performance
  31371. // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
  31372. 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]];
  31373. }
  31374. function stringify(arr, offset = 0) {
  31375. const uuid = unsafeStringify(arr, offset); // Consistency check for valid UUID. If this throws, it's likely due to one
  31376. // of the following:
  31377. // - One or more input array values don't map to a hex octet (leading to
  31378. // "undefined" in the uuid)
  31379. // - Invalid input values for the RFC `version` or `variant` fields
  31380. if (!(0, _validate.default)(uuid)) {
  31381. throw TypeError('Stringified UUID is invalid');
  31382. }
  31383. return uuid;
  31384. }
  31385. var _default = stringify;
  31386. exports["default"] = _default;
  31387. /***/ }),
  31388. /***/ 8628:
  31389. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31390. "use strict";
  31391. Object.defineProperty(exports, "__esModule", ({
  31392. value: true
  31393. }));
  31394. exports["default"] = void 0;
  31395. var _rng = _interopRequireDefault(__nccwpck_require__(807));
  31396. var _stringify = __nccwpck_require__(8950);
  31397. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31398. // **`v1()` - Generate time-based UUID**
  31399. //
  31400. // Inspired by https://github.com/LiosK/UUID.js
  31401. // and http://docs.python.org/library/uuid.html
  31402. let _nodeId;
  31403. let _clockseq; // Previous uuid creation time
  31404. let _lastMSecs = 0;
  31405. let _lastNSecs = 0; // See https://github.com/uuidjs/uuid for API details
  31406. function v1(options, buf, offset) {
  31407. let i = buf && offset || 0;
  31408. const b = buf || new Array(16);
  31409. options = options || {};
  31410. let node = options.node || _nodeId;
  31411. let clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq; // node and clockseq need to be initialized to random values if they're not
  31412. // specified. We do this lazily to minimize issues related to insufficient
  31413. // system entropy. See #189
  31414. if (node == null || clockseq == null) {
  31415. const seedBytes = options.random || (options.rng || _rng.default)();
  31416. if (node == null) {
  31417. // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1)
  31418. node = _nodeId = [seedBytes[0] | 0x01, seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]];
  31419. }
  31420. if (clockseq == null) {
  31421. // Per 4.2.2, randomize (14 bit) clockseq
  31422. clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff;
  31423. }
  31424. } // UUID timestamps are 100 nano-second units since the Gregorian epoch,
  31425. // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so
  31426. // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs'
  31427. // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00.
  31428. let msecs = options.msecs !== undefined ? options.msecs : Date.now(); // Per 4.2.1.2, use count of uuid's generated during the current clock
  31429. // cycle to simulate higher resolution clock
  31430. let nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1; // Time since last uuid creation (in msecs)
  31431. const dt = msecs - _lastMSecs + (nsecs - _lastNSecs) / 10000; // Per 4.2.1.2, Bump clockseq on clock regression
  31432. if (dt < 0 && options.clockseq === undefined) {
  31433. clockseq = clockseq + 1 & 0x3fff;
  31434. } // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new
  31435. // time interval
  31436. if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) {
  31437. nsecs = 0;
  31438. } // Per 4.2.1.2 Throw error if too many uuids are requested
  31439. if (nsecs >= 10000) {
  31440. throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");
  31441. }
  31442. _lastMSecs = msecs;
  31443. _lastNSecs = nsecs;
  31444. _clockseq = clockseq; // Per 4.1.4 - Convert from unix epoch to Gregorian epoch
  31445. msecs += 12219292800000; // `time_low`
  31446. const tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000;
  31447. b[i++] = tl >>> 24 & 0xff;
  31448. b[i++] = tl >>> 16 & 0xff;
  31449. b[i++] = tl >>> 8 & 0xff;
  31450. b[i++] = tl & 0xff; // `time_mid`
  31451. const tmh = msecs / 0x100000000 * 10000 & 0xfffffff;
  31452. b[i++] = tmh >>> 8 & 0xff;
  31453. b[i++] = tmh & 0xff; // `time_high_and_version`
  31454. b[i++] = tmh >>> 24 & 0xf | 0x10; // include version
  31455. b[i++] = tmh >>> 16 & 0xff; // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant)
  31456. b[i++] = clockseq >>> 8 | 0x80; // `clock_seq_low`
  31457. b[i++] = clockseq & 0xff; // `node`
  31458. for (let n = 0; n < 6; ++n) {
  31459. b[i + n] = node[n];
  31460. }
  31461. return buf || (0, _stringify.unsafeStringify)(b);
  31462. }
  31463. var _default = v1;
  31464. exports["default"] = _default;
  31465. /***/ }),
  31466. /***/ 6409:
  31467. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31468. "use strict";
  31469. Object.defineProperty(exports, "__esModule", ({
  31470. value: true
  31471. }));
  31472. exports["default"] = void 0;
  31473. var _v = _interopRequireDefault(__nccwpck_require__(5998));
  31474. var _md = _interopRequireDefault(__nccwpck_require__(4569));
  31475. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31476. const v3 = (0, _v.default)('v3', 0x30, _md.default);
  31477. var _default = v3;
  31478. exports["default"] = _default;
  31479. /***/ }),
  31480. /***/ 5998:
  31481. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31482. "use strict";
  31483. Object.defineProperty(exports, "__esModule", ({
  31484. value: true
  31485. }));
  31486. exports.URL = exports.DNS = void 0;
  31487. exports["default"] = v35;
  31488. var _stringify = __nccwpck_require__(8950);
  31489. var _parse = _interopRequireDefault(__nccwpck_require__(2746));
  31490. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31491. function stringToBytes(str) {
  31492. str = unescape(encodeURIComponent(str)); // UTF8 escape
  31493. const bytes = [];
  31494. for (let i = 0; i < str.length; ++i) {
  31495. bytes.push(str.charCodeAt(i));
  31496. }
  31497. return bytes;
  31498. }
  31499. const DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8';
  31500. exports.DNS = DNS;
  31501. const URL = '6ba7b811-9dad-11d1-80b4-00c04fd430c8';
  31502. exports.URL = URL;
  31503. function v35(name, version, hashfunc) {
  31504. function generateUUID(value, namespace, buf, offset) {
  31505. var _namespace;
  31506. if (typeof value === 'string') {
  31507. value = stringToBytes(value);
  31508. }
  31509. if (typeof namespace === 'string') {
  31510. namespace = (0, _parse.default)(namespace);
  31511. }
  31512. if (((_namespace = namespace) === null || _namespace === void 0 ? void 0 : _namespace.length) !== 16) {
  31513. throw TypeError('Namespace must be array-like (16 iterable integer values, 0-255)');
  31514. } // Compute hash of namespace and value, Per 4.3
  31515. // Future: Use spread syntax when supported on all platforms, e.g. `bytes =
  31516. // hashfunc([...namespace, ... value])`
  31517. let bytes = new Uint8Array(16 + value.length);
  31518. bytes.set(namespace);
  31519. bytes.set(value, namespace.length);
  31520. bytes = hashfunc(bytes);
  31521. bytes[6] = bytes[6] & 0x0f | version;
  31522. bytes[8] = bytes[8] & 0x3f | 0x80;
  31523. if (buf) {
  31524. offset = offset || 0;
  31525. for (let i = 0; i < 16; ++i) {
  31526. buf[offset + i] = bytes[i];
  31527. }
  31528. return buf;
  31529. }
  31530. return (0, _stringify.unsafeStringify)(bytes);
  31531. } // Function#name is not settable on some platforms (#270)
  31532. try {
  31533. generateUUID.name = name; // eslint-disable-next-line no-empty
  31534. } catch (err) {} // For CommonJS default export support
  31535. generateUUID.DNS = DNS;
  31536. generateUUID.URL = URL;
  31537. return generateUUID;
  31538. }
  31539. /***/ }),
  31540. /***/ 5122:
  31541. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31542. "use strict";
  31543. Object.defineProperty(exports, "__esModule", ({
  31544. value: true
  31545. }));
  31546. exports["default"] = void 0;
  31547. var _native = _interopRequireDefault(__nccwpck_require__(2054));
  31548. var _rng = _interopRequireDefault(__nccwpck_require__(807));
  31549. var _stringify = __nccwpck_require__(8950);
  31550. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31551. function v4(options, buf, offset) {
  31552. if (_native.default.randomUUID && !buf && !options) {
  31553. return _native.default.randomUUID();
  31554. }
  31555. options = options || {};
  31556. const rnds = options.random || (options.rng || _rng.default)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
  31557. rnds[6] = rnds[6] & 0x0f | 0x40;
  31558. rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided
  31559. if (buf) {
  31560. offset = offset || 0;
  31561. for (let i = 0; i < 16; ++i) {
  31562. buf[offset + i] = rnds[i];
  31563. }
  31564. return buf;
  31565. }
  31566. return (0, _stringify.unsafeStringify)(rnds);
  31567. }
  31568. var _default = v4;
  31569. exports["default"] = _default;
  31570. /***/ }),
  31571. /***/ 9120:
  31572. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31573. "use strict";
  31574. Object.defineProperty(exports, "__esModule", ({
  31575. value: true
  31576. }));
  31577. exports["default"] = void 0;
  31578. var _v = _interopRequireDefault(__nccwpck_require__(5998));
  31579. var _sha = _interopRequireDefault(__nccwpck_require__(5274));
  31580. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31581. const v5 = (0, _v.default)('v5', 0x50, _sha.default);
  31582. var _default = v5;
  31583. exports["default"] = _default;
  31584. /***/ }),
  31585. /***/ 6900:
  31586. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31587. "use strict";
  31588. Object.defineProperty(exports, "__esModule", ({
  31589. value: true
  31590. }));
  31591. exports["default"] = void 0;
  31592. var _regex = _interopRequireDefault(__nccwpck_require__(814));
  31593. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31594. function validate(uuid) {
  31595. return typeof uuid === 'string' && _regex.default.test(uuid);
  31596. }
  31597. var _default = validate;
  31598. exports["default"] = _default;
  31599. /***/ }),
  31600. /***/ 2414:
  31601. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31602. "use strict";
  31603. Object.defineProperty(exports, "__esModule", ({
  31604. value: true
  31605. }));
  31606. exports["default"] = void 0;
  31607. var _validate = _interopRequireDefault(__nccwpck_require__(6900));
  31608. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31609. function version(uuid) {
  31610. if (!(0, _validate.default)(uuid)) {
  31611. throw TypeError('Invalid UUID');
  31612. }
  31613. return parseInt(uuid.slice(14, 15), 16);
  31614. }
  31615. var _default = version;
  31616. exports["default"] = _default;
  31617. /***/ }),
  31618. /***/ 2940:
  31619. /***/ ((module) => {
  31620. // Returns a wrapper function that returns a wrapped callback
  31621. // The wrapper function should do some stuff, and return a
  31622. // presumably different callback function.
  31623. // This makes sure that own properties are retained, so that
  31624. // decorations and such are not lost along the way.
  31625. module.exports = wrappy
  31626. function wrappy (fn, cb) {
  31627. if (fn && cb) return wrappy(fn)(cb)
  31628. if (typeof fn !== 'function')
  31629. throw new TypeError('need wrapper function')
  31630. Object.keys(fn).forEach(function (k) {
  31631. wrapper[k] = fn[k]
  31632. })
  31633. return wrapper
  31634. function wrapper() {
  31635. var args = new Array(arguments.length)
  31636. for (var i = 0; i < args.length; i++) {
  31637. args[i] = arguments[i]
  31638. }
  31639. var ret = fn.apply(this, args)
  31640. var cb = args[args.length-1]
  31641. if (typeof ret === 'function' && ret !== cb) {
  31642. Object.keys(cb).forEach(function (k) {
  31643. ret[k] = cb[k]
  31644. })
  31645. }
  31646. return ret
  31647. }
  31648. }
  31649. /***/ }),
  31650. /***/ 9491:
  31651. /***/ ((module) => {
  31652. "use strict";
  31653. module.exports = require("assert");
  31654. /***/ }),
  31655. /***/ 852:
  31656. /***/ ((module) => {
  31657. "use strict";
  31658. module.exports = require("async_hooks");
  31659. /***/ }),
  31660. /***/ 4300:
  31661. /***/ ((module) => {
  31662. "use strict";
  31663. module.exports = require("buffer");
  31664. /***/ }),
  31665. /***/ 2081:
  31666. /***/ ((module) => {
  31667. "use strict";
  31668. module.exports = require("child_process");
  31669. /***/ }),
  31670. /***/ 6206:
  31671. /***/ ((module) => {
  31672. "use strict";
  31673. module.exports = require("console");
  31674. /***/ }),
  31675. /***/ 6113:
  31676. /***/ ((module) => {
  31677. "use strict";
  31678. module.exports = require("crypto");
  31679. /***/ }),
  31680. /***/ 7643:
  31681. /***/ ((module) => {
  31682. "use strict";
  31683. module.exports = require("diagnostics_channel");
  31684. /***/ }),
  31685. /***/ 2361:
  31686. /***/ ((module) => {
  31687. "use strict";
  31688. module.exports = require("events");
  31689. /***/ }),
  31690. /***/ 7147:
  31691. /***/ ((module) => {
  31692. "use strict";
  31693. module.exports = require("fs");
  31694. /***/ }),
  31695. /***/ 3685:
  31696. /***/ ((module) => {
  31697. "use strict";
  31698. module.exports = require("http");
  31699. /***/ }),
  31700. /***/ 5158:
  31701. /***/ ((module) => {
  31702. "use strict";
  31703. module.exports = require("http2");
  31704. /***/ }),
  31705. /***/ 5687:
  31706. /***/ ((module) => {
  31707. "use strict";
  31708. module.exports = require("https");
  31709. /***/ }),
  31710. /***/ 1808:
  31711. /***/ ((module) => {
  31712. "use strict";
  31713. module.exports = require("net");
  31714. /***/ }),
  31715. /***/ 6005:
  31716. /***/ ((module) => {
  31717. "use strict";
  31718. module.exports = require("node:crypto");
  31719. /***/ }),
  31720. /***/ 5673:
  31721. /***/ ((module) => {
  31722. "use strict";
  31723. module.exports = require("node:events");
  31724. /***/ }),
  31725. /***/ 4492:
  31726. /***/ ((module) => {
  31727. "use strict";
  31728. module.exports = require("node:stream");
  31729. /***/ }),
  31730. /***/ 7261:
  31731. /***/ ((module) => {
  31732. "use strict";
  31733. module.exports = require("node:util");
  31734. /***/ }),
  31735. /***/ 2037:
  31736. /***/ ((module) => {
  31737. "use strict";
  31738. module.exports = require("os");
  31739. /***/ }),
  31740. /***/ 1017:
  31741. /***/ ((module) => {
  31742. "use strict";
  31743. module.exports = require("path");
  31744. /***/ }),
  31745. /***/ 4074:
  31746. /***/ ((module) => {
  31747. "use strict";
  31748. module.exports = require("perf_hooks");
  31749. /***/ }),
  31750. /***/ 3477:
  31751. /***/ ((module) => {
  31752. "use strict";
  31753. module.exports = require("querystring");
  31754. /***/ }),
  31755. /***/ 2781:
  31756. /***/ ((module) => {
  31757. "use strict";
  31758. module.exports = require("stream");
  31759. /***/ }),
  31760. /***/ 5356:
  31761. /***/ ((module) => {
  31762. "use strict";
  31763. module.exports = require("stream/web");
  31764. /***/ }),
  31765. /***/ 1576:
  31766. /***/ ((module) => {
  31767. "use strict";
  31768. module.exports = require("string_decoder");
  31769. /***/ }),
  31770. /***/ 9512:
  31771. /***/ ((module) => {
  31772. "use strict";
  31773. module.exports = require("timers");
  31774. /***/ }),
  31775. /***/ 4404:
  31776. /***/ ((module) => {
  31777. "use strict";
  31778. module.exports = require("tls");
  31779. /***/ }),
  31780. /***/ 7310:
  31781. /***/ ((module) => {
  31782. "use strict";
  31783. module.exports = require("url");
  31784. /***/ }),
  31785. /***/ 3837:
  31786. /***/ ((module) => {
  31787. "use strict";
  31788. module.exports = require("util");
  31789. /***/ }),
  31790. /***/ 9830:
  31791. /***/ ((module) => {
  31792. "use strict";
  31793. module.exports = require("util/types");
  31794. /***/ }),
  31795. /***/ 1267:
  31796. /***/ ((module) => {
  31797. "use strict";
  31798. module.exports = require("worker_threads");
  31799. /***/ }),
  31800. /***/ 9796:
  31801. /***/ ((module) => {
  31802. "use strict";
  31803. module.exports = require("zlib");
  31804. /***/ }),
  31805. /***/ 2960:
  31806. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  31807. "use strict";
  31808. const WritableStream = (__nccwpck_require__(4492).Writable)
  31809. const inherits = (__nccwpck_require__(7261).inherits)
  31810. const StreamSearch = __nccwpck_require__(1142)
  31811. const PartStream = __nccwpck_require__(1620)
  31812. const HeaderParser = __nccwpck_require__(2032)
  31813. const DASH = 45
  31814. const B_ONEDASH = Buffer.from('-')
  31815. const B_CRLF = Buffer.from('\r\n')
  31816. const EMPTY_FN = function () {}
  31817. function Dicer (cfg) {
  31818. if (!(this instanceof Dicer)) { return new Dicer(cfg) }
  31819. WritableStream.call(this, cfg)
  31820. if (!cfg || (!cfg.headerFirst && typeof cfg.boundary !== 'string')) { throw new TypeError('Boundary required') }
  31821. if (typeof cfg.boundary === 'string') { this.setBoundary(cfg.boundary) } else { this._bparser = undefined }
  31822. this._headerFirst = cfg.headerFirst
  31823. this._dashes = 0
  31824. this._parts = 0
  31825. this._finished = false
  31826. this._realFinish = false
  31827. this._isPreamble = true
  31828. this._justMatched = false
  31829. this._firstWrite = true
  31830. this._inHeader = true
  31831. this._part = undefined
  31832. this._cb = undefined
  31833. this._ignoreData = false
  31834. this._partOpts = { highWaterMark: cfg.partHwm }
  31835. this._pause = false
  31836. const self = this
  31837. this._hparser = new HeaderParser(cfg)
  31838. this._hparser.on('header', function (header) {
  31839. self._inHeader = false
  31840. self._part.emit('header', header)
  31841. })
  31842. }
  31843. inherits(Dicer, WritableStream)
  31844. Dicer.prototype.emit = function (ev) {
  31845. if (ev === 'finish' && !this._realFinish) {
  31846. if (!this._finished) {
  31847. const self = this
  31848. process.nextTick(function () {
  31849. self.emit('error', new Error('Unexpected end of multipart data'))
  31850. if (self._part && !self._ignoreData) {
  31851. const type = (self._isPreamble ? 'Preamble' : 'Part')
  31852. self._part.emit('error', new Error(type + ' terminated early due to unexpected end of multipart data'))
  31853. self._part.push(null)
  31854. process.nextTick(function () {
  31855. self._realFinish = true
  31856. self.emit('finish')
  31857. self._realFinish = false
  31858. })
  31859. return
  31860. }
  31861. self._realFinish = true
  31862. self.emit('finish')
  31863. self._realFinish = false
  31864. })
  31865. }
  31866. } else { WritableStream.prototype.emit.apply(this, arguments) }
  31867. }
  31868. Dicer.prototype._write = function (data, encoding, cb) {
  31869. // ignore unexpected data (e.g. extra trailer data after finished)
  31870. if (!this._hparser && !this._bparser) { return cb() }
  31871. if (this._headerFirst && this._isPreamble) {
  31872. if (!this._part) {
  31873. this._part = new PartStream(this._partOpts)
  31874. if (this.listenerCount('preamble') !== 0) { this.emit('preamble', this._part) } else { this._ignore() }
  31875. }
  31876. const r = this._hparser.push(data)
  31877. if (!this._inHeader && r !== undefined && r < data.length) { data = data.slice(r) } else { return cb() }
  31878. }
  31879. // allows for "easier" testing
  31880. if (this._firstWrite) {
  31881. this._bparser.push(B_CRLF)
  31882. this._firstWrite = false
  31883. }
  31884. this._bparser.push(data)
  31885. if (this._pause) { this._cb = cb } else { cb() }
  31886. }
  31887. Dicer.prototype.reset = function () {
  31888. this._part = undefined
  31889. this._bparser = undefined
  31890. this._hparser = undefined
  31891. }
  31892. Dicer.prototype.setBoundary = function (boundary) {
  31893. const self = this
  31894. this._bparser = new StreamSearch('\r\n--' + boundary)
  31895. this._bparser.on('info', function (isMatch, data, start, end) {
  31896. self._oninfo(isMatch, data, start, end)
  31897. })
  31898. }
  31899. Dicer.prototype._ignore = function () {
  31900. if (this._part && !this._ignoreData) {
  31901. this._ignoreData = true
  31902. this._part.on('error', EMPTY_FN)
  31903. // we must perform some kind of read on the stream even though we are
  31904. // ignoring the data, otherwise node's Readable stream will not emit 'end'
  31905. // after pushing null to the stream
  31906. this._part.resume()
  31907. }
  31908. }
  31909. Dicer.prototype._oninfo = function (isMatch, data, start, end) {
  31910. let buf; const self = this; let i = 0; let r; let shouldWriteMore = true
  31911. if (!this._part && this._justMatched && data) {
  31912. while (this._dashes < 2 && (start + i) < end) {
  31913. if (data[start + i] === DASH) {
  31914. ++i
  31915. ++this._dashes
  31916. } else {
  31917. if (this._dashes) { buf = B_ONEDASH }
  31918. this._dashes = 0
  31919. break
  31920. }
  31921. }
  31922. if (this._dashes === 2) {
  31923. if ((start + i) < end && this.listenerCount('trailer') !== 0) { this.emit('trailer', data.slice(start + i, end)) }
  31924. this.reset()
  31925. this._finished = true
  31926. // no more parts will be added
  31927. if (self._parts === 0) {
  31928. self._realFinish = true
  31929. self.emit('finish')
  31930. self._realFinish = false
  31931. }
  31932. }
  31933. if (this._dashes) { return }
  31934. }
  31935. if (this._justMatched) { this._justMatched = false }
  31936. if (!this._part) {
  31937. this._part = new PartStream(this._partOpts)
  31938. this._part._read = function (n) {
  31939. self._unpause()
  31940. }
  31941. if (this._isPreamble && this.listenerCount('preamble') !== 0) {
  31942. this.emit('preamble', this._part)
  31943. } else if (this._isPreamble !== true && this.listenerCount('part') !== 0) {
  31944. this.emit('part', this._part)
  31945. } else {
  31946. this._ignore()
  31947. }
  31948. if (!this._isPreamble) { this._inHeader = true }
  31949. }
  31950. if (data && start < end && !this._ignoreData) {
  31951. if (this._isPreamble || !this._inHeader) {
  31952. if (buf) { shouldWriteMore = this._part.push(buf) }
  31953. shouldWriteMore = this._part.push(data.slice(start, end))
  31954. if (!shouldWriteMore) { this._pause = true }
  31955. } else if (!this._isPreamble && this._inHeader) {
  31956. if (buf) { this._hparser.push(buf) }
  31957. r = this._hparser.push(data.slice(start, end))
  31958. if (!this._inHeader && r !== undefined && r < end) { this._oninfo(false, data, start + r, end) }
  31959. }
  31960. }
  31961. if (isMatch) {
  31962. this._hparser.reset()
  31963. if (this._isPreamble) { this._isPreamble = false } else {
  31964. if (start !== end) {
  31965. ++this._parts
  31966. this._part.on('end', function () {
  31967. if (--self._parts === 0) {
  31968. if (self._finished) {
  31969. self._realFinish = true
  31970. self.emit('finish')
  31971. self._realFinish = false
  31972. } else {
  31973. self._unpause()
  31974. }
  31975. }
  31976. })
  31977. }
  31978. }
  31979. this._part.push(null)
  31980. this._part = undefined
  31981. this._ignoreData = false
  31982. this._justMatched = true
  31983. this._dashes = 0
  31984. }
  31985. }
  31986. Dicer.prototype._unpause = function () {
  31987. if (!this._pause) { return }
  31988. this._pause = false
  31989. if (this._cb) {
  31990. const cb = this._cb
  31991. this._cb = undefined
  31992. cb()
  31993. }
  31994. }
  31995. module.exports = Dicer
  31996. /***/ }),
  31997. /***/ 2032:
  31998. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  31999. "use strict";
  32000. const EventEmitter = (__nccwpck_require__(5673).EventEmitter)
  32001. const inherits = (__nccwpck_require__(7261).inherits)
  32002. const getLimit = __nccwpck_require__(1467)
  32003. const StreamSearch = __nccwpck_require__(1142)
  32004. const B_DCRLF = Buffer.from('\r\n\r\n')
  32005. const RE_CRLF = /\r\n/g
  32006. const RE_HDR = /^([^:]+):[ \t]?([\x00-\xFF]+)?$/ // eslint-disable-line no-control-regex
  32007. function HeaderParser (cfg) {
  32008. EventEmitter.call(this)
  32009. cfg = cfg || {}
  32010. const self = this
  32011. this.nread = 0
  32012. this.maxed = false
  32013. this.npairs = 0
  32014. this.maxHeaderPairs = getLimit(cfg, 'maxHeaderPairs', 2000)
  32015. this.maxHeaderSize = getLimit(cfg, 'maxHeaderSize', 80 * 1024)
  32016. this.buffer = ''
  32017. this.header = {}
  32018. this.finished = false
  32019. this.ss = new StreamSearch(B_DCRLF)
  32020. this.ss.on('info', function (isMatch, data, start, end) {
  32021. if (data && !self.maxed) {
  32022. if (self.nread + end - start >= self.maxHeaderSize) {
  32023. end = self.maxHeaderSize - self.nread + start
  32024. self.nread = self.maxHeaderSize
  32025. self.maxed = true
  32026. } else { self.nread += (end - start) }
  32027. self.buffer += data.toString('binary', start, end)
  32028. }
  32029. if (isMatch) { self._finish() }
  32030. })
  32031. }
  32032. inherits(HeaderParser, EventEmitter)
  32033. HeaderParser.prototype.push = function (data) {
  32034. const r = this.ss.push(data)
  32035. if (this.finished) { return r }
  32036. }
  32037. HeaderParser.prototype.reset = function () {
  32038. this.finished = false
  32039. this.buffer = ''
  32040. this.header = {}
  32041. this.ss.reset()
  32042. }
  32043. HeaderParser.prototype._finish = function () {
  32044. if (this.buffer) { this._parseHeader() }
  32045. this.ss.matches = this.ss.maxMatches
  32046. const header = this.header
  32047. this.header = {}
  32048. this.buffer = ''
  32049. this.finished = true
  32050. this.nread = this.npairs = 0
  32051. this.maxed = false
  32052. this.emit('header', header)
  32053. }
  32054. HeaderParser.prototype._parseHeader = function () {
  32055. if (this.npairs === this.maxHeaderPairs) { return }
  32056. const lines = this.buffer.split(RE_CRLF)
  32057. const len = lines.length
  32058. let m, h
  32059. for (var i = 0; i < len; ++i) { // eslint-disable-line no-var
  32060. if (lines[i].length === 0) { continue }
  32061. if (lines[i][0] === '\t' || lines[i][0] === ' ') {
  32062. // folded header content
  32063. // RFC2822 says to just remove the CRLF and not the whitespace following
  32064. // it, so we follow the RFC and include the leading whitespace ...
  32065. if (h) {
  32066. this.header[h][this.header[h].length - 1] += lines[i]
  32067. continue
  32068. }
  32069. }
  32070. const posColon = lines[i].indexOf(':')
  32071. if (
  32072. posColon === -1 ||
  32073. posColon === 0
  32074. ) {
  32075. return
  32076. }
  32077. m = RE_HDR.exec(lines[i])
  32078. h = m[1].toLowerCase()
  32079. this.header[h] = this.header[h] || []
  32080. this.header[h].push((m[2] || ''))
  32081. if (++this.npairs === this.maxHeaderPairs) { break }
  32082. }
  32083. }
  32084. module.exports = HeaderParser
  32085. /***/ }),
  32086. /***/ 1620:
  32087. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  32088. "use strict";
  32089. const inherits = (__nccwpck_require__(7261).inherits)
  32090. const ReadableStream = (__nccwpck_require__(4492).Readable)
  32091. function PartStream (opts) {
  32092. ReadableStream.call(this, opts)
  32093. }
  32094. inherits(PartStream, ReadableStream)
  32095. PartStream.prototype._read = function (n) {}
  32096. module.exports = PartStream
  32097. /***/ }),
  32098. /***/ 1142:
  32099. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  32100. "use strict";
  32101. /**
  32102. * Copyright Brian White. All rights reserved.
  32103. *
  32104. * @see https://github.com/mscdex/streamsearch
  32105. *
  32106. * Permission is hereby granted, free of charge, to any person obtaining a copy
  32107. * of this software and associated documentation files (the "Software"), to
  32108. * deal in the Software without restriction, including without limitation the
  32109. * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
  32110. * sell copies of the Software, and to permit persons to whom the Software is
  32111. * furnished to do so, subject to the following conditions:
  32112. *
  32113. * The above copyright notice and this permission notice shall be included in
  32114. * all copies or substantial portions of the Software.
  32115. *
  32116. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  32117. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  32118. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  32119. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  32120. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  32121. * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
  32122. * IN THE SOFTWARE.
  32123. *
  32124. * Based heavily on the Streaming Boyer-Moore-Horspool C++ implementation
  32125. * by Hongli Lai at: https://github.com/FooBarWidget/boyer-moore-horspool
  32126. */
  32127. const EventEmitter = (__nccwpck_require__(5673).EventEmitter)
  32128. const inherits = (__nccwpck_require__(7261).inherits)
  32129. function SBMH (needle) {
  32130. if (typeof needle === 'string') {
  32131. needle = Buffer.from(needle)
  32132. }
  32133. if (!Buffer.isBuffer(needle)) {
  32134. throw new TypeError('The needle has to be a String or a Buffer.')
  32135. }
  32136. const needleLength = needle.length
  32137. if (needleLength === 0) {
  32138. throw new Error('The needle cannot be an empty String/Buffer.')
  32139. }
  32140. if (needleLength > 256) {
  32141. throw new Error('The needle cannot have a length bigger than 256.')
  32142. }
  32143. this.maxMatches = Infinity
  32144. this.matches = 0
  32145. this._occ = new Array(256)
  32146. .fill(needleLength) // Initialize occurrence table.
  32147. this._lookbehind_size = 0
  32148. this._needle = needle
  32149. this._bufpos = 0
  32150. this._lookbehind = Buffer.alloc(needleLength)
  32151. // Populate occurrence table with analysis of the needle,
  32152. // ignoring last letter.
  32153. for (var i = 0; i < needleLength - 1; ++i) { // eslint-disable-line no-var
  32154. this._occ[needle[i]] = needleLength - 1 - i
  32155. }
  32156. }
  32157. inherits(SBMH, EventEmitter)
  32158. SBMH.prototype.reset = function () {
  32159. this._lookbehind_size = 0
  32160. this.matches = 0
  32161. this._bufpos = 0
  32162. }
  32163. SBMH.prototype.push = function (chunk, pos) {
  32164. if (!Buffer.isBuffer(chunk)) {
  32165. chunk = Buffer.from(chunk, 'binary')
  32166. }
  32167. const chlen = chunk.length
  32168. this._bufpos = pos || 0
  32169. let r
  32170. while (r !== chlen && this.matches < this.maxMatches) { r = this._sbmh_feed(chunk) }
  32171. return r
  32172. }
  32173. SBMH.prototype._sbmh_feed = function (data) {
  32174. const len = data.length
  32175. const needle = this._needle
  32176. const needleLength = needle.length
  32177. const lastNeedleChar = needle[needleLength - 1]
  32178. // Positive: points to a position in `data`
  32179. // pos == 3 points to data[3]
  32180. // Negative: points to a position in the lookbehind buffer
  32181. // pos == -2 points to lookbehind[lookbehind_size - 2]
  32182. let pos = -this._lookbehind_size
  32183. let ch
  32184. if (pos < 0) {
  32185. // Lookbehind buffer is not empty. Perform Boyer-Moore-Horspool
  32186. // search with character lookup code that considers both the
  32187. // lookbehind buffer and the current round's haystack data.
  32188. //
  32189. // Loop until
  32190. // there is a match.
  32191. // or until
  32192. // we've moved past the position that requires the
  32193. // lookbehind buffer. In this case we switch to the
  32194. // optimized loop.
  32195. // or until
  32196. // the character to look at lies outside the haystack.
  32197. while (pos < 0 && pos <= len - needleLength) {
  32198. ch = this._sbmh_lookup_char(data, pos + needleLength - 1)
  32199. if (
  32200. ch === lastNeedleChar &&
  32201. this._sbmh_memcmp(data, pos, needleLength - 1)
  32202. ) {
  32203. this._lookbehind_size = 0
  32204. ++this.matches
  32205. this.emit('info', true)
  32206. return (this._bufpos = pos + needleLength)
  32207. }
  32208. pos += this._occ[ch]
  32209. }
  32210. // No match.
  32211. if (pos < 0) {
  32212. // There's too few data for Boyer-Moore-Horspool to run,
  32213. // so let's use a different algorithm to skip as much as
  32214. // we can.
  32215. // Forward pos until
  32216. // the trailing part of lookbehind + data
  32217. // looks like the beginning of the needle
  32218. // or until
  32219. // pos == 0
  32220. while (pos < 0 && !this._sbmh_memcmp(data, pos, len - pos)) { ++pos }
  32221. }
  32222. if (pos >= 0) {
  32223. // Discard lookbehind buffer.
  32224. this.emit('info', false, this._lookbehind, 0, this._lookbehind_size)
  32225. this._lookbehind_size = 0
  32226. } else {
  32227. // Cut off part of the lookbehind buffer that has
  32228. // been processed and append the entire haystack
  32229. // into it.
  32230. const bytesToCutOff = this._lookbehind_size + pos
  32231. if (bytesToCutOff > 0) {
  32232. // The cut off data is guaranteed not to contain the needle.
  32233. this.emit('info', false, this._lookbehind, 0, bytesToCutOff)
  32234. }
  32235. this._lookbehind.copy(this._lookbehind, 0, bytesToCutOff,
  32236. this._lookbehind_size - bytesToCutOff)
  32237. this._lookbehind_size -= bytesToCutOff
  32238. data.copy(this._lookbehind, this._lookbehind_size)
  32239. this._lookbehind_size += len
  32240. this._bufpos = len
  32241. return len
  32242. }
  32243. }
  32244. pos += (pos >= 0) * this._bufpos
  32245. // Lookbehind buffer is now empty. We only need to check if the
  32246. // needle is in the haystack.
  32247. if (data.indexOf(needle, pos) !== -1) {
  32248. pos = data.indexOf(needle, pos)
  32249. ++this.matches
  32250. if (pos > 0) { this.emit('info', true, data, this._bufpos, pos) } else { this.emit('info', true) }
  32251. return (this._bufpos = pos + needleLength)
  32252. } else {
  32253. pos = len - needleLength
  32254. }
  32255. // There was no match. If there's trailing haystack data that we cannot
  32256. // match yet using the Boyer-Moore-Horspool algorithm (because the trailing
  32257. // data is less than the needle size) then match using a modified
  32258. // algorithm that starts matching from the beginning instead of the end.
  32259. // Whatever trailing data is left after running this algorithm is added to
  32260. // the lookbehind buffer.
  32261. while (
  32262. pos < len &&
  32263. (
  32264. data[pos] !== needle[0] ||
  32265. (
  32266. (Buffer.compare(
  32267. data.subarray(pos, pos + len - pos),
  32268. needle.subarray(0, len - pos)
  32269. ) !== 0)
  32270. )
  32271. )
  32272. ) {
  32273. ++pos
  32274. }
  32275. if (pos < len) {
  32276. data.copy(this._lookbehind, 0, pos, pos + (len - pos))
  32277. this._lookbehind_size = len - pos
  32278. }
  32279. // Everything until pos is guaranteed not to contain needle data.
  32280. if (pos > 0) { this.emit('info', false, data, this._bufpos, pos < len ? pos : len) }
  32281. this._bufpos = len
  32282. return len
  32283. }
  32284. SBMH.prototype._sbmh_lookup_char = function (data, pos) {
  32285. return (pos < 0)
  32286. ? this._lookbehind[this._lookbehind_size + pos]
  32287. : data[pos]
  32288. }
  32289. SBMH.prototype._sbmh_memcmp = function (data, pos, len) {
  32290. for (var i = 0; i < len; ++i) { // eslint-disable-line no-var
  32291. if (this._sbmh_lookup_char(data, pos + i) !== this._needle[i]) { return false }
  32292. }
  32293. return true
  32294. }
  32295. module.exports = SBMH
  32296. /***/ }),
  32297. /***/ 727:
  32298. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  32299. "use strict";
  32300. const WritableStream = (__nccwpck_require__(4492).Writable)
  32301. const { inherits } = __nccwpck_require__(7261)
  32302. const Dicer = __nccwpck_require__(2960)
  32303. const MultipartParser = __nccwpck_require__(2183)
  32304. const UrlencodedParser = __nccwpck_require__(8306)
  32305. const parseParams = __nccwpck_require__(1854)
  32306. function Busboy (opts) {
  32307. if (!(this instanceof Busboy)) { return new Busboy(opts) }
  32308. if (typeof opts !== 'object') {
  32309. throw new TypeError('Busboy expected an options-Object.')
  32310. }
  32311. if (typeof opts.headers !== 'object') {
  32312. throw new TypeError('Busboy expected an options-Object with headers-attribute.')
  32313. }
  32314. if (typeof opts.headers['content-type'] !== 'string') {
  32315. throw new TypeError('Missing Content-Type-header.')
  32316. }
  32317. const {
  32318. headers,
  32319. ...streamOptions
  32320. } = opts
  32321. this.opts = {
  32322. autoDestroy: false,
  32323. ...streamOptions
  32324. }
  32325. WritableStream.call(this, this.opts)
  32326. this._done = false
  32327. this._parser = this.getParserByHeaders(headers)
  32328. this._finished = false
  32329. }
  32330. inherits(Busboy, WritableStream)
  32331. Busboy.prototype.emit = function (ev) {
  32332. if (ev === 'finish') {
  32333. if (!this._done) {
  32334. this._parser?.end()
  32335. return
  32336. } else if (this._finished) {
  32337. return
  32338. }
  32339. this._finished = true
  32340. }
  32341. WritableStream.prototype.emit.apply(this, arguments)
  32342. }
  32343. Busboy.prototype.getParserByHeaders = function (headers) {
  32344. const parsed = parseParams(headers['content-type'])
  32345. const cfg = {
  32346. defCharset: this.opts.defCharset,
  32347. fileHwm: this.opts.fileHwm,
  32348. headers,
  32349. highWaterMark: this.opts.highWaterMark,
  32350. isPartAFile: this.opts.isPartAFile,
  32351. limits: this.opts.limits,
  32352. parsedConType: parsed,
  32353. preservePath: this.opts.preservePath
  32354. }
  32355. if (MultipartParser.detect.test(parsed[0])) {
  32356. return new MultipartParser(this, cfg)
  32357. }
  32358. if (UrlencodedParser.detect.test(parsed[0])) {
  32359. return new UrlencodedParser(this, cfg)
  32360. }
  32361. throw new Error('Unsupported Content-Type.')
  32362. }
  32363. Busboy.prototype._write = function (chunk, encoding, cb) {
  32364. this._parser.write(chunk, cb)
  32365. }
  32366. module.exports = Busboy
  32367. module.exports["default"] = Busboy
  32368. module.exports.Busboy = Busboy
  32369. module.exports.Dicer = Dicer
  32370. /***/ }),
  32371. /***/ 2183:
  32372. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  32373. "use strict";
  32374. // TODO:
  32375. // * support 1 nested multipart level
  32376. // (see second multipart example here:
  32377. // http://www.w3.org/TR/html401/interact/forms.html#didx-multipartform-data)
  32378. // * support limits.fieldNameSize
  32379. // -- this will require modifications to utils.parseParams
  32380. const { Readable } = __nccwpck_require__(4492)
  32381. const { inherits } = __nccwpck_require__(7261)
  32382. const Dicer = __nccwpck_require__(2960)
  32383. const parseParams = __nccwpck_require__(1854)
  32384. const decodeText = __nccwpck_require__(4619)
  32385. const basename = __nccwpck_require__(8647)
  32386. const getLimit = __nccwpck_require__(1467)
  32387. const RE_BOUNDARY = /^boundary$/i
  32388. const RE_FIELD = /^form-data$/i
  32389. const RE_CHARSET = /^charset$/i
  32390. const RE_FILENAME = /^filename$/i
  32391. const RE_NAME = /^name$/i
  32392. Multipart.detect = /^multipart\/form-data/i
  32393. function Multipart (boy, cfg) {
  32394. let i
  32395. let len
  32396. const self = this
  32397. let boundary
  32398. const limits = cfg.limits
  32399. const isPartAFile = cfg.isPartAFile || ((fieldName, contentType, fileName) => (contentType === 'application/octet-stream' || fileName !== undefined))
  32400. const parsedConType = cfg.parsedConType || []
  32401. const defCharset = cfg.defCharset || 'utf8'
  32402. const preservePath = cfg.preservePath
  32403. const fileOpts = { highWaterMark: cfg.fileHwm }
  32404. for (i = 0, len = parsedConType.length; i < len; ++i) {
  32405. if (Array.isArray(parsedConType[i]) &&
  32406. RE_BOUNDARY.test(parsedConType[i][0])) {
  32407. boundary = parsedConType[i][1]
  32408. break
  32409. }
  32410. }
  32411. function checkFinished () {
  32412. if (nends === 0 && finished && !boy._done) {
  32413. finished = false
  32414. self.end()
  32415. }
  32416. }
  32417. if (typeof boundary !== 'string') { throw new Error('Multipart: Boundary not found') }
  32418. const fieldSizeLimit = getLimit(limits, 'fieldSize', 1 * 1024 * 1024)
  32419. const fileSizeLimit = getLimit(limits, 'fileSize', Infinity)
  32420. const filesLimit = getLimit(limits, 'files', Infinity)
  32421. const fieldsLimit = getLimit(limits, 'fields', Infinity)
  32422. const partsLimit = getLimit(limits, 'parts', Infinity)
  32423. const headerPairsLimit = getLimit(limits, 'headerPairs', 2000)
  32424. const headerSizeLimit = getLimit(limits, 'headerSize', 80 * 1024)
  32425. let nfiles = 0
  32426. let nfields = 0
  32427. let nends = 0
  32428. let curFile
  32429. let curField
  32430. let finished = false
  32431. this._needDrain = false
  32432. this._pause = false
  32433. this._cb = undefined
  32434. this._nparts = 0
  32435. this._boy = boy
  32436. const parserCfg = {
  32437. boundary,
  32438. maxHeaderPairs: headerPairsLimit,
  32439. maxHeaderSize: headerSizeLimit,
  32440. partHwm: fileOpts.highWaterMark,
  32441. highWaterMark: cfg.highWaterMark
  32442. }
  32443. this.parser = new Dicer(parserCfg)
  32444. this.parser.on('drain', function () {
  32445. self._needDrain = false
  32446. if (self._cb && !self._pause) {
  32447. const cb = self._cb
  32448. self._cb = undefined
  32449. cb()
  32450. }
  32451. }).on('part', function onPart (part) {
  32452. if (++self._nparts > partsLimit) {
  32453. self.parser.removeListener('part', onPart)
  32454. self.parser.on('part', skipPart)
  32455. boy.hitPartsLimit = true
  32456. boy.emit('partsLimit')
  32457. return skipPart(part)
  32458. }
  32459. // hack because streams2 _always_ doesn't emit 'end' until nextTick, so let
  32460. // us emit 'end' early since we know the part has ended if we are already
  32461. // seeing the next part
  32462. if (curField) {
  32463. const field = curField
  32464. field.emit('end')
  32465. field.removeAllListeners('end')
  32466. }
  32467. part.on('header', function (header) {
  32468. let contype
  32469. let fieldname
  32470. let parsed
  32471. let charset
  32472. let encoding
  32473. let filename
  32474. let nsize = 0
  32475. if (header['content-type']) {
  32476. parsed = parseParams(header['content-type'][0])
  32477. if (parsed[0]) {
  32478. contype = parsed[0].toLowerCase()
  32479. for (i = 0, len = parsed.length; i < len; ++i) {
  32480. if (RE_CHARSET.test(parsed[i][0])) {
  32481. charset = parsed[i][1].toLowerCase()
  32482. break
  32483. }
  32484. }
  32485. }
  32486. }
  32487. if (contype === undefined) { contype = 'text/plain' }
  32488. if (charset === undefined) { charset = defCharset }
  32489. if (header['content-disposition']) {
  32490. parsed = parseParams(header['content-disposition'][0])
  32491. if (!RE_FIELD.test(parsed[0])) { return skipPart(part) }
  32492. for (i = 0, len = parsed.length; i < len; ++i) {
  32493. if (RE_NAME.test(parsed[i][0])) {
  32494. fieldname = parsed[i][1]
  32495. } else if (RE_FILENAME.test(parsed[i][0])) {
  32496. filename = parsed[i][1]
  32497. if (!preservePath) { filename = basename(filename) }
  32498. }
  32499. }
  32500. } else { return skipPart(part) }
  32501. if (header['content-transfer-encoding']) { encoding = header['content-transfer-encoding'][0].toLowerCase() } else { encoding = '7bit' }
  32502. let onData,
  32503. onEnd
  32504. if (isPartAFile(fieldname, contype, filename)) {
  32505. // file/binary field
  32506. if (nfiles === filesLimit) {
  32507. if (!boy.hitFilesLimit) {
  32508. boy.hitFilesLimit = true
  32509. boy.emit('filesLimit')
  32510. }
  32511. return skipPart(part)
  32512. }
  32513. ++nfiles
  32514. if (boy.listenerCount('file') === 0) {
  32515. self.parser._ignore()
  32516. return
  32517. }
  32518. ++nends
  32519. const file = new FileStream(fileOpts)
  32520. curFile = file
  32521. file.on('end', function () {
  32522. --nends
  32523. self._pause = false
  32524. checkFinished()
  32525. if (self._cb && !self._needDrain) {
  32526. const cb = self._cb
  32527. self._cb = undefined
  32528. cb()
  32529. }
  32530. })
  32531. file._read = function (n) {
  32532. if (!self._pause) { return }
  32533. self._pause = false
  32534. if (self._cb && !self._needDrain) {
  32535. const cb = self._cb
  32536. self._cb = undefined
  32537. cb()
  32538. }
  32539. }
  32540. boy.emit('file', fieldname, file, filename, encoding, contype)
  32541. onData = function (data) {
  32542. if ((nsize += data.length) > fileSizeLimit) {
  32543. const extralen = fileSizeLimit - nsize + data.length
  32544. if (extralen > 0) { file.push(data.slice(0, extralen)) }
  32545. file.truncated = true
  32546. file.bytesRead = fileSizeLimit
  32547. part.removeAllListeners('data')
  32548. file.emit('limit')
  32549. return
  32550. } else if (!file.push(data)) { self._pause = true }
  32551. file.bytesRead = nsize
  32552. }
  32553. onEnd = function () {
  32554. curFile = undefined
  32555. file.push(null)
  32556. }
  32557. } else {
  32558. // non-file field
  32559. if (nfields === fieldsLimit) {
  32560. if (!boy.hitFieldsLimit) {
  32561. boy.hitFieldsLimit = true
  32562. boy.emit('fieldsLimit')
  32563. }
  32564. return skipPart(part)
  32565. }
  32566. ++nfields
  32567. ++nends
  32568. let buffer = ''
  32569. let truncated = false
  32570. curField = part
  32571. onData = function (data) {
  32572. if ((nsize += data.length) > fieldSizeLimit) {
  32573. const extralen = (fieldSizeLimit - (nsize - data.length))
  32574. buffer += data.toString('binary', 0, extralen)
  32575. truncated = true
  32576. part.removeAllListeners('data')
  32577. } else { buffer += data.toString('binary') }
  32578. }
  32579. onEnd = function () {
  32580. curField = undefined
  32581. if (buffer.length) { buffer = decodeText(buffer, 'binary', charset) }
  32582. boy.emit('field', fieldname, buffer, false, truncated, encoding, contype)
  32583. --nends
  32584. checkFinished()
  32585. }
  32586. }
  32587. /* As of node@2efe4ab761666 (v0.10.29+/v0.11.14+), busboy had become
  32588. broken. Streams2/streams3 is a huge black box of confusion, but
  32589. somehow overriding the sync state seems to fix things again (and still
  32590. seems to work for previous node versions).
  32591. */
  32592. part._readableState.sync = false
  32593. part.on('data', onData)
  32594. part.on('end', onEnd)
  32595. }).on('error', function (err) {
  32596. if (curFile) { curFile.emit('error', err) }
  32597. })
  32598. }).on('error', function (err) {
  32599. boy.emit('error', err)
  32600. }).on('finish', function () {
  32601. finished = true
  32602. checkFinished()
  32603. })
  32604. }
  32605. Multipart.prototype.write = function (chunk, cb) {
  32606. const r = this.parser.write(chunk)
  32607. if (r && !this._pause) {
  32608. cb()
  32609. } else {
  32610. this._needDrain = !r
  32611. this._cb = cb
  32612. }
  32613. }
  32614. Multipart.prototype.end = function () {
  32615. const self = this
  32616. if (self.parser.writable) {
  32617. self.parser.end()
  32618. } else if (!self._boy._done) {
  32619. process.nextTick(function () {
  32620. self._boy._done = true
  32621. self._boy.emit('finish')
  32622. })
  32623. }
  32624. }
  32625. function skipPart (part) {
  32626. part.resume()
  32627. }
  32628. function FileStream (opts) {
  32629. Readable.call(this, opts)
  32630. this.bytesRead = 0
  32631. this.truncated = false
  32632. }
  32633. inherits(FileStream, Readable)
  32634. FileStream.prototype._read = function (n) {}
  32635. module.exports = Multipart
  32636. /***/ }),
  32637. /***/ 8306:
  32638. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  32639. "use strict";
  32640. const Decoder = __nccwpck_require__(7100)
  32641. const decodeText = __nccwpck_require__(4619)
  32642. const getLimit = __nccwpck_require__(1467)
  32643. const RE_CHARSET = /^charset$/i
  32644. UrlEncoded.detect = /^application\/x-www-form-urlencoded/i
  32645. function UrlEncoded (boy, cfg) {
  32646. const limits = cfg.limits
  32647. const parsedConType = cfg.parsedConType
  32648. this.boy = boy
  32649. this.fieldSizeLimit = getLimit(limits, 'fieldSize', 1 * 1024 * 1024)
  32650. this.fieldNameSizeLimit = getLimit(limits, 'fieldNameSize', 100)
  32651. this.fieldsLimit = getLimit(limits, 'fields', Infinity)
  32652. let charset
  32653. for (var i = 0, len = parsedConType.length; i < len; ++i) { // eslint-disable-line no-var
  32654. if (Array.isArray(parsedConType[i]) &&
  32655. RE_CHARSET.test(parsedConType[i][0])) {
  32656. charset = parsedConType[i][1].toLowerCase()
  32657. break
  32658. }
  32659. }
  32660. if (charset === undefined) { charset = cfg.defCharset || 'utf8' }
  32661. this.decoder = new Decoder()
  32662. this.charset = charset
  32663. this._fields = 0
  32664. this._state = 'key'
  32665. this._checkingBytes = true
  32666. this._bytesKey = 0
  32667. this._bytesVal = 0
  32668. this._key = ''
  32669. this._val = ''
  32670. this._keyTrunc = false
  32671. this._valTrunc = false
  32672. this._hitLimit = false
  32673. }
  32674. UrlEncoded.prototype.write = function (data, cb) {
  32675. if (this._fields === this.fieldsLimit) {
  32676. if (!this.boy.hitFieldsLimit) {
  32677. this.boy.hitFieldsLimit = true
  32678. this.boy.emit('fieldsLimit')
  32679. }
  32680. return cb()
  32681. }
  32682. let idxeq; let idxamp; let i; let p = 0; const len = data.length
  32683. while (p < len) {
  32684. if (this._state === 'key') {
  32685. idxeq = idxamp = undefined
  32686. for (i = p; i < len; ++i) {
  32687. if (!this._checkingBytes) { ++p }
  32688. if (data[i] === 0x3D/* = */) {
  32689. idxeq = i
  32690. break
  32691. } else if (data[i] === 0x26/* & */) {
  32692. idxamp = i
  32693. break
  32694. }
  32695. if (this._checkingBytes && this._bytesKey === this.fieldNameSizeLimit) {
  32696. this._hitLimit = true
  32697. break
  32698. } else if (this._checkingBytes) { ++this._bytesKey }
  32699. }
  32700. if (idxeq !== undefined) {
  32701. // key with assignment
  32702. if (idxeq > p) { this._key += this.decoder.write(data.toString('binary', p, idxeq)) }
  32703. this._state = 'val'
  32704. this._hitLimit = false
  32705. this._checkingBytes = true
  32706. this._val = ''
  32707. this._bytesVal = 0
  32708. this._valTrunc = false
  32709. this.decoder.reset()
  32710. p = idxeq + 1
  32711. } else if (idxamp !== undefined) {
  32712. // key with no assignment
  32713. ++this._fields
  32714. let key; const keyTrunc = this._keyTrunc
  32715. if (idxamp > p) { key = (this._key += this.decoder.write(data.toString('binary', p, idxamp))) } else { key = this._key }
  32716. this._hitLimit = false
  32717. this._checkingBytes = true
  32718. this._key = ''
  32719. this._bytesKey = 0
  32720. this._keyTrunc = false
  32721. this.decoder.reset()
  32722. if (key.length) {
  32723. this.boy.emit('field', decodeText(key, 'binary', this.charset),
  32724. '',
  32725. keyTrunc,
  32726. false)
  32727. }
  32728. p = idxamp + 1
  32729. if (this._fields === this.fieldsLimit) { return cb() }
  32730. } else if (this._hitLimit) {
  32731. // we may not have hit the actual limit if there are encoded bytes...
  32732. if (i > p) { this._key += this.decoder.write(data.toString('binary', p, i)) }
  32733. p = i
  32734. if ((this._bytesKey = this._key.length) === this.fieldNameSizeLimit) {
  32735. // yep, we actually did hit the limit
  32736. this._checkingBytes = false
  32737. this._keyTrunc = true
  32738. }
  32739. } else {
  32740. if (p < len) { this._key += this.decoder.write(data.toString('binary', p)) }
  32741. p = len
  32742. }
  32743. } else {
  32744. idxamp = undefined
  32745. for (i = p; i < len; ++i) {
  32746. if (!this._checkingBytes) { ++p }
  32747. if (data[i] === 0x26/* & */) {
  32748. idxamp = i
  32749. break
  32750. }
  32751. if (this._checkingBytes && this._bytesVal === this.fieldSizeLimit) {
  32752. this._hitLimit = true
  32753. break
  32754. } else if (this._checkingBytes) { ++this._bytesVal }
  32755. }
  32756. if (idxamp !== undefined) {
  32757. ++this._fields
  32758. if (idxamp > p) { this._val += this.decoder.write(data.toString('binary', p, idxamp)) }
  32759. this.boy.emit('field', decodeText(this._key, 'binary', this.charset),
  32760. decodeText(this._val, 'binary', this.charset),
  32761. this._keyTrunc,
  32762. this._valTrunc)
  32763. this._state = 'key'
  32764. this._hitLimit = false
  32765. this._checkingBytes = true
  32766. this._key = ''
  32767. this._bytesKey = 0
  32768. this._keyTrunc = false
  32769. this.decoder.reset()
  32770. p = idxamp + 1
  32771. if (this._fields === this.fieldsLimit) { return cb() }
  32772. } else if (this._hitLimit) {
  32773. // we may not have hit the actual limit if there are encoded bytes...
  32774. if (i > p) { this._val += this.decoder.write(data.toString('binary', p, i)) }
  32775. p = i
  32776. if ((this._val === '' && this.fieldSizeLimit === 0) ||
  32777. (this._bytesVal = this._val.length) === this.fieldSizeLimit) {
  32778. // yep, we actually did hit the limit
  32779. this._checkingBytes = false
  32780. this._valTrunc = true
  32781. }
  32782. } else {
  32783. if (p < len) { this._val += this.decoder.write(data.toString('binary', p)) }
  32784. p = len
  32785. }
  32786. }
  32787. }
  32788. cb()
  32789. }
  32790. UrlEncoded.prototype.end = function () {
  32791. if (this.boy._done) { return }
  32792. if (this._state === 'key' && this._key.length > 0) {
  32793. this.boy.emit('field', decodeText(this._key, 'binary', this.charset),
  32794. '',
  32795. this._keyTrunc,
  32796. false)
  32797. } else if (this._state === 'val') {
  32798. this.boy.emit('field', decodeText(this._key, 'binary', this.charset),
  32799. decodeText(this._val, 'binary', this.charset),
  32800. this._keyTrunc,
  32801. this._valTrunc)
  32802. }
  32803. this.boy._done = true
  32804. this.boy.emit('finish')
  32805. }
  32806. module.exports = UrlEncoded
  32807. /***/ }),
  32808. /***/ 7100:
  32809. /***/ ((module) => {
  32810. "use strict";
  32811. const RE_PLUS = /\+/g
  32812. const HEX = [
  32813. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  32814. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  32815. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  32816. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0,
  32817. 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  32818. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  32819. 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  32820. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
  32821. ]
  32822. function Decoder () {
  32823. this.buffer = undefined
  32824. }
  32825. Decoder.prototype.write = function (str) {
  32826. // Replace '+' with ' ' before decoding
  32827. str = str.replace(RE_PLUS, ' ')
  32828. let res = ''
  32829. let i = 0; let p = 0; const len = str.length
  32830. for (; i < len; ++i) {
  32831. if (this.buffer !== undefined) {
  32832. if (!HEX[str.charCodeAt(i)]) {
  32833. res += '%' + this.buffer
  32834. this.buffer = undefined
  32835. --i // retry character
  32836. } else {
  32837. this.buffer += str[i]
  32838. ++p
  32839. if (this.buffer.length === 2) {
  32840. res += String.fromCharCode(parseInt(this.buffer, 16))
  32841. this.buffer = undefined
  32842. }
  32843. }
  32844. } else if (str[i] === '%') {
  32845. if (i > p) {
  32846. res += str.substring(p, i)
  32847. p = i
  32848. }
  32849. this.buffer = ''
  32850. ++p
  32851. }
  32852. }
  32853. if (p < len && this.buffer === undefined) { res += str.substring(p) }
  32854. return res
  32855. }
  32856. Decoder.prototype.reset = function () {
  32857. this.buffer = undefined
  32858. }
  32859. module.exports = Decoder
  32860. /***/ }),
  32861. /***/ 8647:
  32862. /***/ ((module) => {
  32863. "use strict";
  32864. module.exports = function basename (path) {
  32865. if (typeof path !== 'string') { return '' }
  32866. for (var i = path.length - 1; i >= 0; --i) { // eslint-disable-line no-var
  32867. switch (path.charCodeAt(i)) {
  32868. case 0x2F: // '/'
  32869. case 0x5C: // '\'
  32870. path = path.slice(i + 1)
  32871. return (path === '..' || path === '.' ? '' : path)
  32872. }
  32873. }
  32874. return (path === '..' || path === '.' ? '' : path)
  32875. }
  32876. /***/ }),
  32877. /***/ 4619:
  32878. /***/ (function(module) {
  32879. "use strict";
  32880. // Node has always utf-8
  32881. const utf8Decoder = new TextDecoder('utf-8')
  32882. const textDecoders = new Map([
  32883. ['utf-8', utf8Decoder],
  32884. ['utf8', utf8Decoder]
  32885. ])
  32886. function getDecoder (charset) {
  32887. let lc
  32888. while (true) {
  32889. switch (charset) {
  32890. case 'utf-8':
  32891. case 'utf8':
  32892. return decoders.utf8
  32893. case 'latin1':
  32894. case 'ascii': // TODO: Make these a separate, strict decoder?
  32895. case 'us-ascii':
  32896. case 'iso-8859-1':
  32897. case 'iso8859-1':
  32898. case 'iso88591':
  32899. case 'iso_8859-1':
  32900. case 'windows-1252':
  32901. case 'iso_8859-1:1987':
  32902. case 'cp1252':
  32903. case 'x-cp1252':
  32904. return decoders.latin1
  32905. case 'utf16le':
  32906. case 'utf-16le':
  32907. case 'ucs2':
  32908. case 'ucs-2':
  32909. return decoders.utf16le
  32910. case 'base64':
  32911. return decoders.base64
  32912. default:
  32913. if (lc === undefined) {
  32914. lc = true
  32915. charset = charset.toLowerCase()
  32916. continue
  32917. }
  32918. return decoders.other.bind(charset)
  32919. }
  32920. }
  32921. }
  32922. const decoders = {
  32923. utf8: (data, sourceEncoding) => {
  32924. if (data.length === 0) {
  32925. return ''
  32926. }
  32927. if (typeof data === 'string') {
  32928. data = Buffer.from(data, sourceEncoding)
  32929. }
  32930. return data.utf8Slice(0, data.length)
  32931. },
  32932. latin1: (data, sourceEncoding) => {
  32933. if (data.length === 0) {
  32934. return ''
  32935. }
  32936. if (typeof data === 'string') {
  32937. return data
  32938. }
  32939. return data.latin1Slice(0, data.length)
  32940. },
  32941. utf16le: (data, sourceEncoding) => {
  32942. if (data.length === 0) {
  32943. return ''
  32944. }
  32945. if (typeof data === 'string') {
  32946. data = Buffer.from(data, sourceEncoding)
  32947. }
  32948. return data.ucs2Slice(0, data.length)
  32949. },
  32950. base64: (data, sourceEncoding) => {
  32951. if (data.length === 0) {
  32952. return ''
  32953. }
  32954. if (typeof data === 'string') {
  32955. data = Buffer.from(data, sourceEncoding)
  32956. }
  32957. return data.base64Slice(0, data.length)
  32958. },
  32959. other: (data, sourceEncoding) => {
  32960. if (data.length === 0) {
  32961. return ''
  32962. }
  32963. if (typeof data === 'string') {
  32964. data = Buffer.from(data, sourceEncoding)
  32965. }
  32966. if (textDecoders.has(this.toString())) {
  32967. try {
  32968. return textDecoders.get(this).decode(data)
  32969. } catch {}
  32970. }
  32971. return typeof data === 'string'
  32972. ? data
  32973. : data.toString()
  32974. }
  32975. }
  32976. function decodeText (text, sourceEncoding, destEncoding) {
  32977. if (text) {
  32978. return getDecoder(destEncoding)(text, sourceEncoding)
  32979. }
  32980. return text
  32981. }
  32982. module.exports = decodeText
  32983. /***/ }),
  32984. /***/ 1467:
  32985. /***/ ((module) => {
  32986. "use strict";
  32987. module.exports = function getLimit (limits, name, defaultLimit) {
  32988. if (
  32989. !limits ||
  32990. limits[name] === undefined ||
  32991. limits[name] === null
  32992. ) { return defaultLimit }
  32993. if (
  32994. typeof limits[name] !== 'number' ||
  32995. isNaN(limits[name])
  32996. ) { throw new TypeError('Limit ' + name + ' is not a valid number') }
  32997. return limits[name]
  32998. }
  32999. /***/ }),
  33000. /***/ 1854:
  33001. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  33002. "use strict";
  33003. /* eslint-disable object-property-newline */
  33004. const decodeText = __nccwpck_require__(4619)
  33005. const RE_ENCODED = /%[a-fA-F0-9][a-fA-F0-9]/g
  33006. const EncodedLookup = {
  33007. '%00': '\x00', '%01': '\x01', '%02': '\x02', '%03': '\x03', '%04': '\x04',
  33008. '%05': '\x05', '%06': '\x06', '%07': '\x07', '%08': '\x08', '%09': '\x09',
  33009. '%0a': '\x0a', '%0A': '\x0a', '%0b': '\x0b', '%0B': '\x0b', '%0c': '\x0c',
  33010. '%0C': '\x0c', '%0d': '\x0d', '%0D': '\x0d', '%0e': '\x0e', '%0E': '\x0e',
  33011. '%0f': '\x0f', '%0F': '\x0f', '%10': '\x10', '%11': '\x11', '%12': '\x12',
  33012. '%13': '\x13', '%14': '\x14', '%15': '\x15', '%16': '\x16', '%17': '\x17',
  33013. '%18': '\x18', '%19': '\x19', '%1a': '\x1a', '%1A': '\x1a', '%1b': '\x1b',
  33014. '%1B': '\x1b', '%1c': '\x1c', '%1C': '\x1c', '%1d': '\x1d', '%1D': '\x1d',
  33015. '%1e': '\x1e', '%1E': '\x1e', '%1f': '\x1f', '%1F': '\x1f', '%20': '\x20',
  33016. '%21': '\x21', '%22': '\x22', '%23': '\x23', '%24': '\x24', '%25': '\x25',
  33017. '%26': '\x26', '%27': '\x27', '%28': '\x28', '%29': '\x29', '%2a': '\x2a',
  33018. '%2A': '\x2a', '%2b': '\x2b', '%2B': '\x2b', '%2c': '\x2c', '%2C': '\x2c',
  33019. '%2d': '\x2d', '%2D': '\x2d', '%2e': '\x2e', '%2E': '\x2e', '%2f': '\x2f',
  33020. '%2F': '\x2f', '%30': '\x30', '%31': '\x31', '%32': '\x32', '%33': '\x33',
  33021. '%34': '\x34', '%35': '\x35', '%36': '\x36', '%37': '\x37', '%38': '\x38',
  33022. '%39': '\x39', '%3a': '\x3a', '%3A': '\x3a', '%3b': '\x3b', '%3B': '\x3b',
  33023. '%3c': '\x3c', '%3C': '\x3c', '%3d': '\x3d', '%3D': '\x3d', '%3e': '\x3e',
  33024. '%3E': '\x3e', '%3f': '\x3f', '%3F': '\x3f', '%40': '\x40', '%41': '\x41',
  33025. '%42': '\x42', '%43': '\x43', '%44': '\x44', '%45': '\x45', '%46': '\x46',
  33026. '%47': '\x47', '%48': '\x48', '%49': '\x49', '%4a': '\x4a', '%4A': '\x4a',
  33027. '%4b': '\x4b', '%4B': '\x4b', '%4c': '\x4c', '%4C': '\x4c', '%4d': '\x4d',
  33028. '%4D': '\x4d', '%4e': '\x4e', '%4E': '\x4e', '%4f': '\x4f', '%4F': '\x4f',
  33029. '%50': '\x50', '%51': '\x51', '%52': '\x52', '%53': '\x53', '%54': '\x54',
  33030. '%55': '\x55', '%56': '\x56', '%57': '\x57', '%58': '\x58', '%59': '\x59',
  33031. '%5a': '\x5a', '%5A': '\x5a', '%5b': '\x5b', '%5B': '\x5b', '%5c': '\x5c',
  33032. '%5C': '\x5c', '%5d': '\x5d', '%5D': '\x5d', '%5e': '\x5e', '%5E': '\x5e',
  33033. '%5f': '\x5f', '%5F': '\x5f', '%60': '\x60', '%61': '\x61', '%62': '\x62',
  33034. '%63': '\x63', '%64': '\x64', '%65': '\x65', '%66': '\x66', '%67': '\x67',
  33035. '%68': '\x68', '%69': '\x69', '%6a': '\x6a', '%6A': '\x6a', '%6b': '\x6b',
  33036. '%6B': '\x6b', '%6c': '\x6c', '%6C': '\x6c', '%6d': '\x6d', '%6D': '\x6d',
  33037. '%6e': '\x6e', '%6E': '\x6e', '%6f': '\x6f', '%6F': '\x6f', '%70': '\x70',
  33038. '%71': '\x71', '%72': '\x72', '%73': '\x73', '%74': '\x74', '%75': '\x75',
  33039. '%76': '\x76', '%77': '\x77', '%78': '\x78', '%79': '\x79', '%7a': '\x7a',
  33040. '%7A': '\x7a', '%7b': '\x7b', '%7B': '\x7b', '%7c': '\x7c', '%7C': '\x7c',
  33041. '%7d': '\x7d', '%7D': '\x7d', '%7e': '\x7e', '%7E': '\x7e', '%7f': '\x7f',
  33042. '%7F': '\x7f', '%80': '\x80', '%81': '\x81', '%82': '\x82', '%83': '\x83',
  33043. '%84': '\x84', '%85': '\x85', '%86': '\x86', '%87': '\x87', '%88': '\x88',
  33044. '%89': '\x89', '%8a': '\x8a', '%8A': '\x8a', '%8b': '\x8b', '%8B': '\x8b',
  33045. '%8c': '\x8c', '%8C': '\x8c', '%8d': '\x8d', '%8D': '\x8d', '%8e': '\x8e',
  33046. '%8E': '\x8e', '%8f': '\x8f', '%8F': '\x8f', '%90': '\x90', '%91': '\x91',
  33047. '%92': '\x92', '%93': '\x93', '%94': '\x94', '%95': '\x95', '%96': '\x96',
  33048. '%97': '\x97', '%98': '\x98', '%99': '\x99', '%9a': '\x9a', '%9A': '\x9a',
  33049. '%9b': '\x9b', '%9B': '\x9b', '%9c': '\x9c', '%9C': '\x9c', '%9d': '\x9d',
  33050. '%9D': '\x9d', '%9e': '\x9e', '%9E': '\x9e', '%9f': '\x9f', '%9F': '\x9f',
  33051. '%a0': '\xa0', '%A0': '\xa0', '%a1': '\xa1', '%A1': '\xa1', '%a2': '\xa2',
  33052. '%A2': '\xa2', '%a3': '\xa3', '%A3': '\xa3', '%a4': '\xa4', '%A4': '\xa4',
  33053. '%a5': '\xa5', '%A5': '\xa5', '%a6': '\xa6', '%A6': '\xa6', '%a7': '\xa7',
  33054. '%A7': '\xa7', '%a8': '\xa8', '%A8': '\xa8', '%a9': '\xa9', '%A9': '\xa9',
  33055. '%aa': '\xaa', '%Aa': '\xaa', '%aA': '\xaa', '%AA': '\xaa', '%ab': '\xab',
  33056. '%Ab': '\xab', '%aB': '\xab', '%AB': '\xab', '%ac': '\xac', '%Ac': '\xac',
  33057. '%aC': '\xac', '%AC': '\xac', '%ad': '\xad', '%Ad': '\xad', '%aD': '\xad',
  33058. '%AD': '\xad', '%ae': '\xae', '%Ae': '\xae', '%aE': '\xae', '%AE': '\xae',
  33059. '%af': '\xaf', '%Af': '\xaf', '%aF': '\xaf', '%AF': '\xaf', '%b0': '\xb0',
  33060. '%B0': '\xb0', '%b1': '\xb1', '%B1': '\xb1', '%b2': '\xb2', '%B2': '\xb2',
  33061. '%b3': '\xb3', '%B3': '\xb3', '%b4': '\xb4', '%B4': '\xb4', '%b5': '\xb5',
  33062. '%B5': '\xb5', '%b6': '\xb6', '%B6': '\xb6', '%b7': '\xb7', '%B7': '\xb7',
  33063. '%b8': '\xb8', '%B8': '\xb8', '%b9': '\xb9', '%B9': '\xb9', '%ba': '\xba',
  33064. '%Ba': '\xba', '%bA': '\xba', '%BA': '\xba', '%bb': '\xbb', '%Bb': '\xbb',
  33065. '%bB': '\xbb', '%BB': '\xbb', '%bc': '\xbc', '%Bc': '\xbc', '%bC': '\xbc',
  33066. '%BC': '\xbc', '%bd': '\xbd', '%Bd': '\xbd', '%bD': '\xbd', '%BD': '\xbd',
  33067. '%be': '\xbe', '%Be': '\xbe', '%bE': '\xbe', '%BE': '\xbe', '%bf': '\xbf',
  33068. '%Bf': '\xbf', '%bF': '\xbf', '%BF': '\xbf', '%c0': '\xc0', '%C0': '\xc0',
  33069. '%c1': '\xc1', '%C1': '\xc1', '%c2': '\xc2', '%C2': '\xc2', '%c3': '\xc3',
  33070. '%C3': '\xc3', '%c4': '\xc4', '%C4': '\xc4', '%c5': '\xc5', '%C5': '\xc5',
  33071. '%c6': '\xc6', '%C6': '\xc6', '%c7': '\xc7', '%C7': '\xc7', '%c8': '\xc8',
  33072. '%C8': '\xc8', '%c9': '\xc9', '%C9': '\xc9', '%ca': '\xca', '%Ca': '\xca',
  33073. '%cA': '\xca', '%CA': '\xca', '%cb': '\xcb', '%Cb': '\xcb', '%cB': '\xcb',
  33074. '%CB': '\xcb', '%cc': '\xcc', '%Cc': '\xcc', '%cC': '\xcc', '%CC': '\xcc',
  33075. '%cd': '\xcd', '%Cd': '\xcd', '%cD': '\xcd', '%CD': '\xcd', '%ce': '\xce',
  33076. '%Ce': '\xce', '%cE': '\xce', '%CE': '\xce', '%cf': '\xcf', '%Cf': '\xcf',
  33077. '%cF': '\xcf', '%CF': '\xcf', '%d0': '\xd0', '%D0': '\xd0', '%d1': '\xd1',
  33078. '%D1': '\xd1', '%d2': '\xd2', '%D2': '\xd2', '%d3': '\xd3', '%D3': '\xd3',
  33079. '%d4': '\xd4', '%D4': '\xd4', '%d5': '\xd5', '%D5': '\xd5', '%d6': '\xd6',
  33080. '%D6': '\xd6', '%d7': '\xd7', '%D7': '\xd7', '%d8': '\xd8', '%D8': '\xd8',
  33081. '%d9': '\xd9', '%D9': '\xd9', '%da': '\xda', '%Da': '\xda', '%dA': '\xda',
  33082. '%DA': '\xda', '%db': '\xdb', '%Db': '\xdb', '%dB': '\xdb', '%DB': '\xdb',
  33083. '%dc': '\xdc', '%Dc': '\xdc', '%dC': '\xdc', '%DC': '\xdc', '%dd': '\xdd',
  33084. '%Dd': '\xdd', '%dD': '\xdd', '%DD': '\xdd', '%de': '\xde', '%De': '\xde',
  33085. '%dE': '\xde', '%DE': '\xde', '%df': '\xdf', '%Df': '\xdf', '%dF': '\xdf',
  33086. '%DF': '\xdf', '%e0': '\xe0', '%E0': '\xe0', '%e1': '\xe1', '%E1': '\xe1',
  33087. '%e2': '\xe2', '%E2': '\xe2', '%e3': '\xe3', '%E3': '\xe3', '%e4': '\xe4',
  33088. '%E4': '\xe4', '%e5': '\xe5', '%E5': '\xe5', '%e6': '\xe6', '%E6': '\xe6',
  33089. '%e7': '\xe7', '%E7': '\xe7', '%e8': '\xe8', '%E8': '\xe8', '%e9': '\xe9',
  33090. '%E9': '\xe9', '%ea': '\xea', '%Ea': '\xea', '%eA': '\xea', '%EA': '\xea',
  33091. '%eb': '\xeb', '%Eb': '\xeb', '%eB': '\xeb', '%EB': '\xeb', '%ec': '\xec',
  33092. '%Ec': '\xec', '%eC': '\xec', '%EC': '\xec', '%ed': '\xed', '%Ed': '\xed',
  33093. '%eD': '\xed', '%ED': '\xed', '%ee': '\xee', '%Ee': '\xee', '%eE': '\xee',
  33094. '%EE': '\xee', '%ef': '\xef', '%Ef': '\xef', '%eF': '\xef', '%EF': '\xef',
  33095. '%f0': '\xf0', '%F0': '\xf0', '%f1': '\xf1', '%F1': '\xf1', '%f2': '\xf2',
  33096. '%F2': '\xf2', '%f3': '\xf3', '%F3': '\xf3', '%f4': '\xf4', '%F4': '\xf4',
  33097. '%f5': '\xf5', '%F5': '\xf5', '%f6': '\xf6', '%F6': '\xf6', '%f7': '\xf7',
  33098. '%F7': '\xf7', '%f8': '\xf8', '%F8': '\xf8', '%f9': '\xf9', '%F9': '\xf9',
  33099. '%fa': '\xfa', '%Fa': '\xfa', '%fA': '\xfa', '%FA': '\xfa', '%fb': '\xfb',
  33100. '%Fb': '\xfb', '%fB': '\xfb', '%FB': '\xfb', '%fc': '\xfc', '%Fc': '\xfc',
  33101. '%fC': '\xfc', '%FC': '\xfc', '%fd': '\xfd', '%Fd': '\xfd', '%fD': '\xfd',
  33102. '%FD': '\xfd', '%fe': '\xfe', '%Fe': '\xfe', '%fE': '\xfe', '%FE': '\xfe',
  33103. '%ff': '\xff', '%Ff': '\xff', '%fF': '\xff', '%FF': '\xff'
  33104. }
  33105. function encodedReplacer (match) {
  33106. return EncodedLookup[match]
  33107. }
  33108. const STATE_KEY = 0
  33109. const STATE_VALUE = 1
  33110. const STATE_CHARSET = 2
  33111. const STATE_LANG = 3
  33112. function parseParams (str) {
  33113. const res = []
  33114. let state = STATE_KEY
  33115. let charset = ''
  33116. let inquote = false
  33117. let escaping = false
  33118. let p = 0
  33119. let tmp = ''
  33120. const len = str.length
  33121. for (var i = 0; i < len; ++i) { // eslint-disable-line no-var
  33122. const char = str[i]
  33123. if (char === '\\' && inquote) {
  33124. if (escaping) { escaping = false } else {
  33125. escaping = true
  33126. continue
  33127. }
  33128. } else if (char === '"') {
  33129. if (!escaping) {
  33130. if (inquote) {
  33131. inquote = false
  33132. state = STATE_KEY
  33133. } else { inquote = true }
  33134. continue
  33135. } else { escaping = false }
  33136. } else {
  33137. if (escaping && inquote) { tmp += '\\' }
  33138. escaping = false
  33139. if ((state === STATE_CHARSET || state === STATE_LANG) && char === "'") {
  33140. if (state === STATE_CHARSET) {
  33141. state = STATE_LANG
  33142. charset = tmp.substring(1)
  33143. } else { state = STATE_VALUE }
  33144. tmp = ''
  33145. continue
  33146. } else if (state === STATE_KEY &&
  33147. (char === '*' || char === '=') &&
  33148. res.length) {
  33149. state = char === '*'
  33150. ? STATE_CHARSET
  33151. : STATE_VALUE
  33152. res[p] = [tmp, undefined]
  33153. tmp = ''
  33154. continue
  33155. } else if (!inquote && char === ';') {
  33156. state = STATE_KEY
  33157. if (charset) {
  33158. if (tmp.length) {
  33159. tmp = decodeText(tmp.replace(RE_ENCODED, encodedReplacer),
  33160. 'binary',
  33161. charset)
  33162. }
  33163. charset = ''
  33164. } else if (tmp.length) {
  33165. tmp = decodeText(tmp, 'binary', 'utf8')
  33166. }
  33167. if (res[p] === undefined) { res[p] = tmp } else { res[p][1] = tmp }
  33168. tmp = ''
  33169. ++p
  33170. continue
  33171. } else if (!inquote && (char === ' ' || char === '\t')) { continue }
  33172. }
  33173. tmp += char
  33174. }
  33175. if (charset && tmp.length) {
  33176. tmp = decodeText(tmp.replace(RE_ENCODED, encodedReplacer),
  33177. 'binary',
  33178. charset)
  33179. } else if (tmp) {
  33180. tmp = decodeText(tmp, 'binary', 'utf8')
  33181. }
  33182. if (res[p] === undefined) {
  33183. if (tmp) { res[p] = tmp }
  33184. } else { res[p][1] = tmp }
  33185. return res
  33186. }
  33187. module.exports = parseParams
  33188. /***/ })
  33189. /******/ });
  33190. /************************************************************************/
  33191. /******/ // The module cache
  33192. /******/ var __webpack_module_cache__ = {};
  33193. /******/
  33194. /******/ // The require function
  33195. /******/ function __nccwpck_require__(moduleId) {
  33196. /******/ // Check if module is in cache
  33197. /******/ var cachedModule = __webpack_module_cache__[moduleId];
  33198. /******/ if (cachedModule !== undefined) {
  33199. /******/ return cachedModule.exports;
  33200. /******/ }
  33201. /******/ // Create a new module (and put it into the cache)
  33202. /******/ var module = __webpack_module_cache__[moduleId] = {
  33203. /******/ // no module.id needed
  33204. /******/ // no module.loaded needed
  33205. /******/ exports: {}
  33206. /******/ };
  33207. /******/
  33208. /******/ // Execute the module function
  33209. /******/ var threw = true;
  33210. /******/ try {
  33211. /******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __nccwpck_require__);
  33212. /******/ threw = false;
  33213. /******/ } finally {
  33214. /******/ if(threw) delete __webpack_module_cache__[moduleId];
  33215. /******/ }
  33216. /******/
  33217. /******/ // Return the exports of the module
  33218. /******/ return module.exports;
  33219. /******/ }
  33220. /******/
  33221. /************************************************************************/
  33222. /******/ /* webpack/runtime/compat */
  33223. /******/
  33224. /******/ if (typeof __nccwpck_require__ !== 'undefined') __nccwpck_require__.ab = __dirname + "/";
  33225. /******/
  33226. /************************************************************************/
  33227. /******/
  33228. /******/ // startup
  33229. /******/ // Load entry module and return exports
  33230. /******/ // This entry module is referenced by other modules so it can't be inlined
  33231. /******/ var __webpack_exports__ = __nccwpck_require__(3109);
  33232. /******/ module.exports = __webpack_exports__;
  33233. /******/
  33234. /******/ })()
  33235. ;