index.js 1.3 MB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391193921939319394193951939619397193981939919400194011940219403194041940519406194071940819409194101941119412194131941419415194161941719418194191942019421194221942319424194251942619427194281942919430194311943219433194341943519436194371943819439194401944119442194431944419445194461944719448194491945019451194521945319454194551945619457194581945919460194611946219463194641946519466194671946819469194701947119472194731947419475194761947719478194791948019481194821948319484194851948619487194881948919490194911949219493194941949519496194971949819499195001950119502195031950419505195061950719508195091951019511195121951319514195151951619517195181951919520195211952219523195241952519526195271952819529195301953119532195331953419535195361953719538195391954019541195421954319544195451954619547195481954919550195511955219553195541955519556195571955819559195601956119562195631956419565195661956719568195691957019571195721957319574195751957619577195781957919580195811958219583195841958519586195871958819589195901959119592195931959419595195961959719598195991960019601196021960319604196051960619607196081960919610196111961219613196141961519616196171961819619196201962119622196231962419625196261962719628196291963019631196321963319634196351963619637196381963919640196411964219643196441964519646196471964819649196501965119652196531965419655196561965719658196591966019661196621966319664196651966619667196681966919670196711967219673196741967519676196771967819679196801968119682196831968419685196861968719688196891969019691196921969319694196951969619697196981969919700197011970219703197041970519706197071970819709197101971119712197131971419715197161971719718197191972019721197221972319724197251972619727197281972919730197311973219733197341973519736197371973819739197401974119742197431974419745197461974719748197491975019751197521975319754197551975619757197581975919760197611976219763197641976519766197671976819769197701977119772197731977419775197761977719778197791978019781197821978319784197851978619787197881978919790197911979219793197941979519796197971979819799198001980119802198031980419805198061980719808198091981019811198121981319814198151981619817198181981919820198211982219823198241982519826198271982819829198301983119832198331983419835198361983719838198391984019841198421984319844198451984619847198481984919850198511985219853198541985519856198571985819859198601986119862198631986419865198661986719868198691987019871198721987319874198751987619877198781987919880198811988219883198841988519886198871988819889198901989119892198931989419895198961989719898198991990019901199021990319904199051990619907199081990919910199111991219913199141991519916199171991819919199201992119922199231992419925199261992719928199291993019931199321993319934199351993619937199381993919940199411994219943199441994519946199471994819949199501995119952199531995419955199561995719958199591996019961199621996319964199651996619967199681996919970199711997219973199741997519976199771997819979199801998119982199831998419985199861998719988199891999019991199921999319994199951999619997199981999920000200012000220003200042000520006200072000820009200102001120012200132001420015200162001720018200192002020021200222002320024200252002620027200282002920030200312003220033200342003520036200372003820039200402004120042200432004420045200462004720048200492005020051200522005320054200552005620057200582005920060200612006220063200642006520066200672006820069200702007120072200732007420075200762007720078200792008020081200822008320084200852008620087200882008920090200912009220093200942009520096200972009820099201002010120102201032010420105201062010720108201092011020111201122011320114201152011620117201182011920120201212012220123201242012520126201272012820129201302013120132201332013420135201362013720138201392014020141201422014320144201452014620147201482014920150201512015220153201542015520156201572015820159201602016120162201632016420165201662016720168201692017020171201722017320174201752017620177201782017920180201812018220183201842018520186201872018820189201902019120192201932019420195201962019720198201992020020201202022020320204202052020620207202082020920210202112021220213202142021520216202172021820219202202022120222202232022420225202262022720228202292023020231202322023320234202352023620237202382023920240202412024220243202442024520246202472024820249202502025120252202532025420255202562025720258202592026020261202622026320264202652026620267202682026920270202712027220273202742027520276202772027820279202802028120282202832028420285202862028720288202892029020291202922029320294202952029620297202982029920300203012030220303203042030520306203072030820309203102031120312203132031420315203162031720318203192032020321203222032320324203252032620327203282032920330203312033220333203342033520336203372033820339203402034120342203432034420345203462034720348203492035020351203522035320354203552035620357203582035920360203612036220363203642036520366203672036820369203702037120372203732037420375203762037720378203792038020381203822038320384203852038620387203882038920390203912039220393203942039520396203972039820399204002040120402204032040420405204062040720408204092041020411204122041320414204152041620417204182041920420204212042220423204242042520426204272042820429204302043120432204332043420435204362043720438204392044020441204422044320444204452044620447204482044920450204512045220453204542045520456204572045820459204602046120462204632046420465204662046720468204692047020471204722047320474204752047620477204782047920480204812048220483204842048520486204872048820489204902049120492204932049420495204962049720498204992050020501205022050320504205052050620507205082050920510205112051220513205142051520516205172051820519205202052120522205232052420525205262052720528205292053020531205322053320534205352053620537205382053920540205412054220543205442054520546205472054820549205502055120552205532055420555205562055720558205592056020561205622056320564205652056620567205682056920570205712057220573205742057520576205772057820579205802058120582205832058420585205862058720588205892059020591205922059320594205952059620597205982059920600206012060220603206042060520606206072060820609206102061120612206132061420615206162061720618206192062020621206222062320624206252062620627206282062920630206312063220633206342063520636206372063820639206402064120642206432064420645206462064720648206492065020651206522065320654206552065620657206582065920660206612066220663206642066520666206672066820669206702067120672206732067420675206762067720678206792068020681206822068320684206852068620687206882068920690206912069220693206942069520696206972069820699207002070120702207032070420705207062070720708207092071020711207122071320714207152071620717207182071920720207212072220723207242072520726207272072820729207302073120732207332073420735207362073720738207392074020741207422074320744207452074620747207482074920750207512075220753207542075520756207572075820759207602076120762207632076420765207662076720768207692077020771207722077320774207752077620777207782077920780207812078220783207842078520786207872078820789207902079120792207932079420795207962079720798207992080020801208022080320804208052080620807208082080920810208112081220813208142081520816208172081820819208202082120822208232082420825208262082720828208292083020831208322083320834208352083620837208382083920840208412084220843208442084520846208472084820849208502085120852208532085420855208562085720858208592086020861208622086320864208652086620867208682086920870208712087220873208742087520876208772087820879208802088120882208832088420885208862088720888208892089020891208922089320894208952089620897208982089920900209012090220903209042090520906209072090820909209102091120912209132091420915209162091720918209192092020921209222092320924209252092620927209282092920930209312093220933209342093520936209372093820939209402094120942209432094420945209462094720948209492095020951209522095320954209552095620957209582095920960209612096220963209642096520966209672096820969209702097120972209732097420975209762097720978209792098020981209822098320984209852098620987209882098920990209912099220993209942099520996209972099820999210002100121002210032100421005210062100721008210092101021011210122101321014210152101621017210182101921020210212102221023210242102521026210272102821029210302103121032210332103421035210362103721038210392104021041210422104321044210452104621047210482104921050210512105221053210542105521056210572105821059210602106121062210632106421065210662106721068210692107021071210722107321074210752107621077210782107921080210812108221083210842108521086210872108821089210902109121092210932109421095210962109721098210992110021101211022110321104211052110621107211082110921110211112111221113211142111521116211172111821119211202112121122211232112421125211262112721128211292113021131211322113321134211352113621137211382113921140211412114221143211442114521146211472114821149211502115121152211532115421155211562115721158211592116021161211622116321164211652116621167211682116921170211712117221173211742117521176211772117821179211802118121182211832118421185211862118721188211892119021191211922119321194211952119621197211982119921200212012120221203212042120521206212072120821209212102121121212212132121421215212162121721218212192122021221212222122321224212252122621227212282122921230212312123221233212342123521236212372123821239212402124121242212432124421245212462124721248212492125021251212522125321254212552125621257212582125921260212612126221263212642126521266212672126821269212702127121272212732127421275212762127721278212792128021281212822128321284212852128621287212882128921290212912129221293212942129521296212972129821299213002130121302213032130421305213062130721308213092131021311213122131321314213152131621317213182131921320213212132221323213242132521326213272132821329213302133121332213332133421335213362133721338213392134021341213422134321344213452134621347213482134921350213512135221353213542135521356213572135821359213602136121362213632136421365213662136721368213692137021371213722137321374213752137621377213782137921380213812138221383213842138521386213872138821389213902139121392213932139421395213962139721398213992140021401214022140321404214052140621407214082140921410214112141221413214142141521416214172141821419214202142121422214232142421425214262142721428214292143021431214322143321434214352143621437214382143921440214412144221443214442144521446214472144821449214502145121452214532145421455214562145721458214592146021461214622146321464214652146621467214682146921470214712147221473214742147521476214772147821479214802148121482214832148421485214862148721488214892149021491214922149321494214952149621497214982149921500215012150221503215042150521506215072150821509215102151121512215132151421515215162151721518215192152021521215222152321524215252152621527215282152921530215312153221533215342153521536215372153821539215402154121542215432154421545215462154721548215492155021551215522155321554215552155621557215582155921560215612156221563215642156521566215672156821569215702157121572215732157421575215762157721578215792158021581215822158321584215852158621587215882158921590215912159221593215942159521596215972159821599216002160121602216032160421605216062160721608216092161021611216122161321614216152161621617216182161921620216212162221623216242162521626216272162821629216302163121632216332163421635216362163721638216392164021641216422164321644216452164621647216482164921650216512165221653216542165521656216572165821659216602166121662216632166421665216662166721668216692167021671216722167321674216752167621677216782167921680216812168221683216842168521686216872168821689216902169121692216932169421695216962169721698216992170021701217022170321704217052170621707217082170921710217112171221713217142171521716217172171821719217202172121722217232172421725217262172721728217292173021731217322173321734217352173621737217382173921740217412174221743217442174521746217472174821749217502175121752217532175421755217562175721758217592176021761217622176321764217652176621767217682176921770217712177221773217742177521776217772177821779217802178121782217832178421785217862178721788217892179021791217922179321794217952179621797217982179921800218012180221803218042180521806218072180821809218102181121812218132181421815218162181721818218192182021821218222182321824218252182621827218282182921830218312183221833218342183521836218372183821839218402184121842218432184421845218462184721848218492185021851218522185321854218552185621857218582185921860218612186221863218642186521866218672186821869218702187121872218732187421875218762187721878218792188021881218822188321884218852188621887218882188921890218912189221893218942189521896218972189821899219002190121902219032190421905219062190721908219092191021911219122191321914219152191621917219182191921920219212192221923219242192521926219272192821929219302193121932219332193421935219362193721938219392194021941219422194321944219452194621947219482194921950219512195221953219542195521956219572195821959219602196121962219632196421965219662196721968219692197021971219722197321974219752197621977219782197921980219812198221983219842198521986219872198821989219902199121992219932199421995219962199721998219992200022001220022200322004220052200622007220082200922010220112201222013220142201522016220172201822019220202202122022220232202422025220262202722028220292203022031220322203322034220352203622037220382203922040220412204222043220442204522046220472204822049220502205122052220532205422055220562205722058220592206022061220622206322064220652206622067220682206922070220712207222073220742207522076220772207822079220802208122082220832208422085220862208722088220892209022091220922209322094220952209622097220982209922100221012210222103221042210522106221072210822109221102211122112221132211422115221162211722118221192212022121221222212322124221252212622127221282212922130221312213222133221342213522136221372213822139221402214122142221432214422145221462214722148221492215022151221522215322154221552215622157221582215922160221612216222163221642216522166221672216822169221702217122172221732217422175221762217722178221792218022181221822218322184221852218622187221882218922190221912219222193221942219522196221972219822199222002220122202222032220422205222062220722208222092221022211222122221322214222152221622217222182221922220222212222222223222242222522226222272222822229222302223122232222332223422235222362223722238222392224022241222422224322244222452224622247222482224922250222512225222253222542225522256222572225822259222602226122262222632226422265222662226722268222692227022271222722227322274222752227622277222782227922280222812228222283222842228522286222872228822289222902229122292222932229422295222962229722298222992230022301223022230322304223052230622307223082230922310223112231222313223142231522316223172231822319223202232122322223232232422325223262232722328223292233022331223322233322334223352233622337223382233922340223412234222343223442234522346223472234822349223502235122352223532235422355223562235722358223592236022361223622236322364223652236622367223682236922370223712237222373223742237522376223772237822379223802238122382223832238422385223862238722388223892239022391223922239322394223952239622397223982239922400224012240222403224042240522406224072240822409224102241122412224132241422415224162241722418224192242022421224222242322424224252242622427224282242922430224312243222433224342243522436224372243822439224402244122442224432244422445224462244722448224492245022451224522245322454224552245622457224582245922460224612246222463224642246522466224672246822469224702247122472224732247422475224762247722478224792248022481224822248322484224852248622487224882248922490224912249222493224942249522496224972249822499225002250122502225032250422505225062250722508225092251022511225122251322514225152251622517225182251922520225212252222523225242252522526225272252822529225302253122532225332253422535225362253722538225392254022541225422254322544225452254622547225482254922550225512255222553225542255522556225572255822559225602256122562225632256422565225662256722568225692257022571225722257322574225752257622577225782257922580225812258222583225842258522586225872258822589225902259122592225932259422595225962259722598225992260022601226022260322604226052260622607226082260922610226112261222613226142261522616226172261822619226202262122622226232262422625226262262722628226292263022631226322263322634226352263622637226382263922640226412264222643226442264522646226472264822649226502265122652226532265422655226562265722658226592266022661226622266322664226652266622667226682266922670226712267222673226742267522676226772267822679226802268122682226832268422685226862268722688226892269022691226922269322694226952269622697226982269922700227012270222703227042270522706227072270822709227102271122712227132271422715227162271722718227192272022721227222272322724227252272622727227282272922730227312273222733227342273522736227372273822739227402274122742227432274422745227462274722748227492275022751227522275322754227552275622757227582275922760227612276222763227642276522766227672276822769227702277122772227732277422775227762277722778227792278022781227822278322784227852278622787227882278922790227912279222793227942279522796227972279822799228002280122802228032280422805228062280722808228092281022811228122281322814228152281622817228182281922820228212282222823228242282522826228272282822829228302283122832228332283422835228362283722838228392284022841228422284322844228452284622847228482284922850228512285222853228542285522856228572285822859228602286122862228632286422865228662286722868228692287022871228722287322874228752287622877228782287922880228812288222883228842288522886228872288822889228902289122892228932289422895228962289722898228992290022901229022290322904229052290622907229082290922910229112291222913229142291522916229172291822919229202292122922229232292422925229262292722928229292293022931229322293322934229352293622937229382293922940229412294222943229442294522946229472294822949229502295122952229532295422955229562295722958229592296022961229622296322964229652296622967229682296922970229712297222973229742297522976229772297822979229802298122982229832298422985229862298722988229892299022991229922299322994229952299622997229982299923000230012300223003230042300523006230072300823009230102301123012230132301423015230162301723018230192302023021230222302323024230252302623027230282302923030230312303223033230342303523036230372303823039230402304123042230432304423045230462304723048230492305023051230522305323054230552305623057230582305923060230612306223063230642306523066230672306823069230702307123072230732307423075230762307723078230792308023081230822308323084230852308623087230882308923090230912309223093230942309523096230972309823099231002310123102231032310423105231062310723108231092311023111231122311323114231152311623117231182311923120231212312223123231242312523126231272312823129231302313123132231332313423135231362313723138231392314023141231422314323144231452314623147231482314923150231512315223153231542315523156231572315823159231602316123162231632316423165231662316723168231692317023171231722317323174231752317623177231782317923180231812318223183231842318523186231872318823189231902319123192231932319423195231962319723198231992320023201232022320323204232052320623207232082320923210232112321223213232142321523216232172321823219232202322123222232232322423225232262322723228232292323023231232322323323234232352323623237232382323923240232412324223243232442324523246232472324823249232502325123252232532325423255232562325723258232592326023261232622326323264232652326623267232682326923270232712327223273232742327523276232772327823279232802328123282232832328423285232862328723288232892329023291232922329323294232952329623297232982329923300233012330223303233042330523306233072330823309233102331123312233132331423315233162331723318233192332023321233222332323324233252332623327233282332923330233312333223333233342333523336233372333823339233402334123342233432334423345233462334723348233492335023351233522335323354233552335623357233582335923360233612336223363233642336523366233672336823369233702337123372233732337423375233762337723378233792338023381233822338323384233852338623387233882338923390233912339223393233942339523396233972339823399234002340123402234032340423405234062340723408234092341023411234122341323414234152341623417234182341923420234212342223423234242342523426234272342823429234302343123432234332343423435234362343723438234392344023441234422344323444234452344623447234482344923450234512345223453234542345523456234572345823459234602346123462234632346423465234662346723468234692347023471234722347323474234752347623477234782347923480234812348223483234842348523486234872348823489234902349123492234932349423495234962349723498234992350023501235022350323504235052350623507235082350923510235112351223513235142351523516235172351823519235202352123522235232352423525235262352723528235292353023531235322353323534235352353623537235382353923540235412354223543235442354523546235472354823549235502355123552235532355423555235562355723558235592356023561235622356323564235652356623567235682356923570235712357223573235742357523576235772357823579235802358123582235832358423585235862358723588235892359023591235922359323594235952359623597235982359923600236012360223603236042360523606236072360823609236102361123612236132361423615236162361723618236192362023621236222362323624236252362623627236282362923630236312363223633236342363523636236372363823639236402364123642236432364423645236462364723648236492365023651236522365323654236552365623657236582365923660236612366223663236642366523666236672366823669236702367123672236732367423675236762367723678236792368023681236822368323684236852368623687236882368923690236912369223693236942369523696236972369823699237002370123702237032370423705237062370723708237092371023711237122371323714237152371623717237182371923720237212372223723237242372523726237272372823729237302373123732237332373423735237362373723738237392374023741237422374323744237452374623747237482374923750237512375223753237542375523756237572375823759237602376123762237632376423765237662376723768237692377023771237722377323774237752377623777237782377923780237812378223783237842378523786237872378823789237902379123792237932379423795237962379723798237992380023801238022380323804238052380623807238082380923810238112381223813238142381523816238172381823819238202382123822238232382423825238262382723828238292383023831238322383323834238352383623837238382383923840238412384223843238442384523846238472384823849238502385123852238532385423855238562385723858238592386023861238622386323864238652386623867238682386923870238712387223873238742387523876238772387823879238802388123882238832388423885238862388723888238892389023891238922389323894238952389623897238982389923900239012390223903239042390523906239072390823909239102391123912239132391423915239162391723918239192392023921239222392323924239252392623927239282392923930239312393223933239342393523936239372393823939239402394123942239432394423945239462394723948239492395023951239522395323954239552395623957239582395923960239612396223963239642396523966239672396823969239702397123972239732397423975239762397723978239792398023981239822398323984239852398623987239882398923990239912399223993239942399523996239972399823999240002400124002240032400424005240062400724008240092401024011240122401324014240152401624017240182401924020240212402224023240242402524026240272402824029240302403124032240332403424035240362403724038240392404024041240422404324044240452404624047240482404924050240512405224053240542405524056240572405824059240602406124062240632406424065240662406724068240692407024071240722407324074240752407624077240782407924080240812408224083240842408524086240872408824089240902409124092240932409424095240962409724098240992410024101241022410324104241052410624107241082410924110241112411224113241142411524116241172411824119241202412124122241232412424125241262412724128241292413024131241322413324134241352413624137241382413924140241412414224143241442414524146241472414824149241502415124152241532415424155241562415724158241592416024161241622416324164241652416624167241682416924170241712417224173241742417524176241772417824179241802418124182241832418424185241862418724188241892419024191241922419324194241952419624197241982419924200242012420224203242042420524206242072420824209242102421124212242132421424215242162421724218242192422024221242222422324224242252422624227242282422924230242312423224233242342423524236242372423824239242402424124242242432424424245242462424724248242492425024251242522425324254242552425624257242582425924260242612426224263242642426524266242672426824269242702427124272242732427424275242762427724278242792428024281242822428324284242852428624287242882428924290242912429224293242942429524296242972429824299243002430124302243032430424305243062430724308243092431024311243122431324314243152431624317243182431924320243212432224323243242432524326243272432824329243302433124332243332433424335243362433724338243392434024341243422434324344243452434624347243482434924350243512435224353243542435524356243572435824359243602436124362243632436424365243662436724368243692437024371243722437324374243752437624377243782437924380243812438224383243842438524386243872438824389243902439124392243932439424395243962439724398243992440024401244022440324404244052440624407244082440924410244112441224413244142441524416244172441824419244202442124422244232442424425244262442724428244292443024431244322443324434244352443624437244382443924440244412444224443244442444524446244472444824449244502445124452244532445424455244562445724458244592446024461244622446324464244652446624467244682446924470244712447224473244742447524476244772447824479244802448124482244832448424485244862448724488244892449024491244922449324494244952449624497244982449924500245012450224503245042450524506245072450824509245102451124512245132451424515245162451724518245192452024521245222452324524245252452624527245282452924530245312453224533245342453524536245372453824539245402454124542245432454424545245462454724548245492455024551245522455324554245552455624557245582455924560245612456224563245642456524566245672456824569245702457124572245732457424575245762457724578245792458024581245822458324584245852458624587245882458924590245912459224593245942459524596245972459824599246002460124602246032460424605246062460724608246092461024611246122461324614246152461624617246182461924620246212462224623246242462524626246272462824629246302463124632246332463424635246362463724638246392464024641246422464324644246452464624647246482464924650246512465224653246542465524656246572465824659246602466124662246632466424665246662466724668246692467024671246722467324674246752467624677246782467924680246812468224683246842468524686246872468824689246902469124692246932469424695246962469724698246992470024701247022470324704247052470624707247082470924710247112471224713247142471524716247172471824719247202472124722247232472424725247262472724728247292473024731247322473324734247352473624737247382473924740247412474224743247442474524746247472474824749247502475124752247532475424755247562475724758247592476024761247622476324764247652476624767247682476924770247712477224773247742477524776247772477824779247802478124782247832478424785247862478724788247892479024791247922479324794247952479624797247982479924800248012480224803248042480524806248072480824809248102481124812248132481424815248162481724818248192482024821248222482324824248252482624827248282482924830248312483224833248342483524836248372483824839248402484124842248432484424845248462484724848248492485024851248522485324854248552485624857248582485924860248612486224863248642486524866248672486824869248702487124872248732487424875248762487724878248792488024881248822488324884248852488624887248882488924890248912489224893248942489524896248972489824899249002490124902249032490424905249062490724908249092491024911249122491324914249152491624917249182491924920249212492224923249242492524926249272492824929249302493124932249332493424935249362493724938249392494024941249422494324944249452494624947249482494924950249512495224953249542495524956249572495824959249602496124962249632496424965249662496724968249692497024971249722497324974249752497624977249782497924980249812498224983249842498524986249872498824989249902499124992249932499424995249962499724998249992500025001250022500325004250052500625007250082500925010250112501225013250142501525016250172501825019250202502125022250232502425025250262502725028250292503025031250322503325034250352503625037250382503925040250412504225043250442504525046250472504825049250502505125052250532505425055250562505725058250592506025061250622506325064250652506625067250682506925070250712507225073250742507525076250772507825079250802508125082250832508425085250862508725088250892509025091250922509325094250952509625097250982509925100251012510225103251042510525106251072510825109251102511125112251132511425115251162511725118251192512025121251222512325124251252512625127251282512925130251312513225133251342513525136251372513825139251402514125142251432514425145251462514725148251492515025151251522515325154251552515625157251582515925160251612516225163251642516525166251672516825169251702517125172251732517425175251762517725178251792518025181251822518325184251852518625187251882518925190251912519225193251942519525196251972519825199252002520125202252032520425205252062520725208252092521025211252122521325214252152521625217252182521925220252212522225223252242522525226252272522825229252302523125232252332523425235252362523725238252392524025241252422524325244252452524625247252482524925250252512525225253252542525525256252572525825259252602526125262252632526425265252662526725268252692527025271252722527325274252752527625277252782527925280252812528225283252842528525286252872528825289252902529125292252932529425295252962529725298252992530025301253022530325304253052530625307253082530925310253112531225313253142531525316253172531825319253202532125322253232532425325253262532725328253292533025331253322533325334253352533625337253382533925340253412534225343253442534525346253472534825349253502535125352253532535425355253562535725358253592536025361253622536325364253652536625367253682536925370253712537225373253742537525376253772537825379253802538125382253832538425385253862538725388253892539025391253922539325394253952539625397253982539925400254012540225403254042540525406254072540825409254102541125412254132541425415254162541725418254192542025421254222542325424254252542625427254282542925430254312543225433254342543525436254372543825439254402544125442254432544425445254462544725448254492545025451254522545325454254552545625457254582545925460254612546225463254642546525466254672546825469254702547125472254732547425475254762547725478254792548025481254822548325484254852548625487254882548925490254912549225493254942549525496254972549825499255002550125502255032550425505255062550725508255092551025511255122551325514255152551625517255182551925520255212552225523255242552525526255272552825529255302553125532255332553425535255362553725538255392554025541255422554325544255452554625547255482554925550255512555225553255542555525556255572555825559255602556125562255632556425565255662556725568255692557025571255722557325574255752557625577255782557925580255812558225583255842558525586255872558825589255902559125592255932559425595255962559725598255992560025601256022560325604256052560625607256082560925610256112561225613256142561525616256172561825619256202562125622256232562425625256262562725628256292563025631256322563325634256352563625637256382563925640256412564225643256442564525646256472564825649256502565125652256532565425655256562565725658256592566025661256622566325664256652566625667256682566925670256712567225673256742567525676256772567825679256802568125682256832568425685256862568725688256892569025691256922569325694256952569625697256982569925700257012570225703257042570525706257072570825709257102571125712257132571425715257162571725718257192572025721257222572325724257252572625727257282572925730257312573225733257342573525736257372573825739257402574125742257432574425745257462574725748257492575025751257522575325754257552575625757257582575925760257612576225763257642576525766257672576825769257702577125772257732577425775257762577725778257792578025781257822578325784257852578625787257882578925790257912579225793257942579525796257972579825799258002580125802258032580425805258062580725808258092581025811258122581325814258152581625817258182581925820258212582225823258242582525826258272582825829258302583125832258332583425835258362583725838258392584025841258422584325844258452584625847258482584925850258512585225853258542585525856258572585825859258602586125862258632586425865258662586725868258692587025871258722587325874258752587625877258782587925880258812588225883258842588525886258872588825889258902589125892258932589425895258962589725898258992590025901259022590325904259052590625907259082590925910259112591225913259142591525916259172591825919259202592125922259232592425925259262592725928259292593025931259322593325934259352593625937259382593925940259412594225943259442594525946259472594825949259502595125952259532595425955259562595725958259592596025961259622596325964259652596625967259682596925970259712597225973259742597525976259772597825979259802598125982259832598425985259862598725988259892599025991259922599325994259952599625997259982599926000260012600226003260042600526006260072600826009260102601126012260132601426015260162601726018260192602026021260222602326024260252602626027260282602926030260312603226033260342603526036260372603826039260402604126042260432604426045260462604726048260492605026051260522605326054260552605626057260582605926060260612606226063260642606526066260672606826069260702607126072260732607426075260762607726078260792608026081260822608326084260852608626087260882608926090260912609226093260942609526096260972609826099261002610126102261032610426105261062610726108261092611026111261122611326114261152611626117261182611926120261212612226123261242612526126261272612826129261302613126132261332613426135261362613726138261392614026141261422614326144261452614626147261482614926150261512615226153261542615526156261572615826159261602616126162261632616426165261662616726168261692617026171261722617326174261752617626177261782617926180261812618226183261842618526186261872618826189261902619126192261932619426195261962619726198261992620026201262022620326204262052620626207262082620926210262112621226213262142621526216262172621826219262202622126222262232622426225262262622726228262292623026231262322623326234262352623626237262382623926240262412624226243262442624526246262472624826249262502625126252262532625426255262562625726258262592626026261262622626326264262652626626267262682626926270262712627226273262742627526276262772627826279262802628126282262832628426285262862628726288262892629026291262922629326294262952629626297262982629926300263012630226303263042630526306263072630826309263102631126312263132631426315263162631726318263192632026321263222632326324263252632626327263282632926330263312633226333263342633526336263372633826339263402634126342263432634426345263462634726348263492635026351263522635326354263552635626357263582635926360263612636226363263642636526366263672636826369263702637126372263732637426375263762637726378263792638026381263822638326384263852638626387263882638926390263912639226393263942639526396263972639826399264002640126402264032640426405264062640726408264092641026411264122641326414264152641626417264182641926420264212642226423264242642526426264272642826429264302643126432264332643426435264362643726438264392644026441264422644326444264452644626447264482644926450264512645226453264542645526456264572645826459264602646126462264632646426465264662646726468264692647026471264722647326474264752647626477264782647926480264812648226483264842648526486264872648826489264902649126492264932649426495264962649726498264992650026501265022650326504265052650626507265082650926510265112651226513265142651526516265172651826519265202652126522265232652426525265262652726528265292653026531265322653326534265352653626537265382653926540265412654226543265442654526546265472654826549265502655126552265532655426555265562655726558265592656026561265622656326564265652656626567265682656926570265712657226573265742657526576265772657826579265802658126582265832658426585265862658726588265892659026591265922659326594265952659626597265982659926600266012660226603266042660526606266072660826609266102661126612266132661426615266162661726618266192662026621266222662326624266252662626627266282662926630266312663226633266342663526636266372663826639266402664126642266432664426645266462664726648266492665026651266522665326654266552665626657266582665926660266612666226663266642666526666266672666826669266702667126672266732667426675266762667726678266792668026681266822668326684266852668626687266882668926690266912669226693266942669526696266972669826699267002670126702267032670426705267062670726708267092671026711267122671326714267152671626717267182671926720267212672226723267242672526726267272672826729267302673126732267332673426735267362673726738267392674026741267422674326744267452674626747267482674926750267512675226753267542675526756267572675826759267602676126762267632676426765267662676726768267692677026771267722677326774267752677626777267782677926780267812678226783267842678526786267872678826789267902679126792267932679426795267962679726798267992680026801268022680326804268052680626807268082680926810268112681226813268142681526816268172681826819268202682126822268232682426825268262682726828268292683026831268322683326834268352683626837268382683926840268412684226843268442684526846268472684826849268502685126852268532685426855268562685726858268592686026861268622686326864268652686626867268682686926870268712687226873268742687526876268772687826879268802688126882268832688426885268862688726888268892689026891268922689326894268952689626897268982689926900269012690226903269042690526906269072690826909269102691126912269132691426915269162691726918269192692026921269222692326924269252692626927269282692926930269312693226933269342693526936269372693826939269402694126942269432694426945269462694726948269492695026951269522695326954269552695626957269582695926960269612696226963269642696526966269672696826969269702697126972269732697426975269762697726978269792698026981269822698326984269852698626987269882698926990269912699226993269942699526996269972699826999270002700127002270032700427005270062700727008270092701027011270122701327014270152701627017270182701927020270212702227023270242702527026270272702827029270302703127032270332703427035270362703727038270392704027041270422704327044270452704627047270482704927050270512705227053270542705527056270572705827059270602706127062270632706427065270662706727068270692707027071270722707327074270752707627077270782707927080270812708227083270842708527086270872708827089270902709127092270932709427095270962709727098270992710027101271022710327104271052710627107271082710927110271112711227113271142711527116271172711827119271202712127122271232712427125271262712727128271292713027131271322713327134271352713627137271382713927140271412714227143271442714527146271472714827149271502715127152271532715427155271562715727158271592716027161271622716327164271652716627167271682716927170271712717227173271742717527176271772717827179271802718127182271832718427185271862718727188271892719027191271922719327194271952719627197271982719927200272012720227203272042720527206272072720827209272102721127212272132721427215272162721727218272192722027221272222722327224272252722627227272282722927230272312723227233272342723527236272372723827239272402724127242272432724427245272462724727248272492725027251272522725327254272552725627257272582725927260272612726227263272642726527266272672726827269272702727127272272732727427275272762727727278272792728027281272822728327284272852728627287272882728927290272912729227293272942729527296272972729827299273002730127302273032730427305273062730727308273092731027311273122731327314273152731627317273182731927320273212732227323273242732527326273272732827329273302733127332273332733427335273362733727338273392734027341273422734327344273452734627347273482734927350273512735227353273542735527356273572735827359273602736127362273632736427365273662736727368273692737027371273722737327374273752737627377273782737927380273812738227383273842738527386273872738827389273902739127392273932739427395273962739727398273992740027401274022740327404274052740627407274082740927410274112741227413274142741527416274172741827419274202742127422274232742427425274262742727428274292743027431274322743327434274352743627437274382743927440274412744227443274442744527446274472744827449274502745127452274532745427455274562745727458274592746027461274622746327464274652746627467274682746927470274712747227473274742747527476274772747827479274802748127482274832748427485274862748727488274892749027491274922749327494274952749627497274982749927500275012750227503275042750527506275072750827509275102751127512275132751427515275162751727518275192752027521275222752327524275252752627527275282752927530275312753227533275342753527536275372753827539275402754127542275432754427545275462754727548275492755027551275522755327554275552755627557275582755927560275612756227563275642756527566275672756827569275702757127572275732757427575275762757727578275792758027581275822758327584275852758627587275882758927590275912759227593275942759527596275972759827599276002760127602276032760427605276062760727608276092761027611276122761327614276152761627617276182761927620276212762227623276242762527626276272762827629276302763127632276332763427635276362763727638276392764027641276422764327644276452764627647276482764927650276512765227653276542765527656276572765827659276602766127662276632766427665276662766727668276692767027671276722767327674276752767627677276782767927680276812768227683276842768527686276872768827689276902769127692276932769427695276962769727698276992770027701277022770327704277052770627707277082770927710277112771227713277142771527716277172771827719277202772127722277232772427725277262772727728277292773027731277322773327734277352773627737277382773927740277412774227743277442774527746277472774827749277502775127752277532775427755277562775727758277592776027761277622776327764277652776627767277682776927770277712777227773277742777527776277772777827779277802778127782277832778427785277862778727788277892779027791277922779327794277952779627797277982779927800278012780227803278042780527806278072780827809278102781127812278132781427815278162781727818278192782027821278222782327824278252782627827278282782927830278312783227833278342783527836278372783827839278402784127842278432784427845278462784727848278492785027851278522785327854278552785627857278582785927860278612786227863278642786527866278672786827869278702787127872278732787427875278762787727878278792788027881278822788327884278852788627887278882788927890278912789227893278942789527896278972789827899279002790127902279032790427905279062790727908279092791027911279122791327914279152791627917279182791927920279212792227923279242792527926279272792827929279302793127932279332793427935279362793727938279392794027941279422794327944279452794627947279482794927950279512795227953279542795527956279572795827959279602796127962279632796427965279662796727968279692797027971279722797327974279752797627977279782797927980279812798227983279842798527986279872798827989279902799127992279932799427995279962799727998279992800028001280022800328004280052800628007280082800928010280112801228013280142801528016280172801828019280202802128022280232802428025280262802728028280292803028031280322803328034280352803628037280382803928040280412804228043280442804528046280472804828049280502805128052280532805428055280562805728058280592806028061280622806328064280652806628067280682806928070280712807228073280742807528076280772807828079280802808128082280832808428085280862808728088280892809028091280922809328094280952809628097280982809928100281012810228103281042810528106281072810828109281102811128112281132811428115281162811728118281192812028121281222812328124281252812628127281282812928130281312813228133281342813528136281372813828139281402814128142281432814428145281462814728148281492815028151281522815328154281552815628157281582815928160281612816228163281642816528166281672816828169281702817128172281732817428175281762817728178281792818028181281822818328184281852818628187281882818928190281912819228193281942819528196281972819828199282002820128202282032820428205282062820728208282092821028211282122821328214282152821628217282182821928220282212822228223282242822528226282272822828229282302823128232282332823428235282362823728238282392824028241282422824328244282452824628247282482824928250282512825228253282542825528256282572825828259282602826128262282632826428265282662826728268282692827028271282722827328274282752827628277282782827928280282812828228283282842828528286282872828828289282902829128292282932829428295282962829728298282992830028301283022830328304283052830628307283082830928310283112831228313283142831528316283172831828319283202832128322283232832428325283262832728328283292833028331283322833328334283352833628337283382833928340283412834228343283442834528346283472834828349283502835128352283532835428355283562835728358283592836028361283622836328364283652836628367283682836928370283712837228373283742837528376283772837828379283802838128382283832838428385283862838728388283892839028391283922839328394283952839628397283982839928400284012840228403284042840528406284072840828409284102841128412284132841428415284162841728418284192842028421284222842328424284252842628427284282842928430284312843228433284342843528436284372843828439284402844128442284432844428445284462844728448284492845028451284522845328454284552845628457284582845928460284612846228463284642846528466284672846828469284702847128472284732847428475284762847728478284792848028481284822848328484284852848628487284882848928490284912849228493284942849528496284972849828499285002850128502285032850428505285062850728508285092851028511285122851328514285152851628517285182851928520285212852228523285242852528526285272852828529285302853128532285332853428535285362853728538285392854028541285422854328544285452854628547285482854928550285512855228553285542855528556285572855828559285602856128562285632856428565285662856728568285692857028571285722857328574285752857628577285782857928580285812858228583285842858528586285872858828589285902859128592285932859428595285962859728598285992860028601286022860328604286052860628607286082860928610286112861228613286142861528616286172861828619286202862128622286232862428625286262862728628286292863028631286322863328634286352863628637286382863928640286412864228643286442864528646286472864828649286502865128652286532865428655286562865728658286592866028661286622866328664286652866628667286682866928670286712867228673286742867528676286772867828679286802868128682286832868428685286862868728688286892869028691286922869328694286952869628697286982869928700287012870228703287042870528706287072870828709287102871128712287132871428715287162871728718287192872028721287222872328724287252872628727287282872928730287312873228733287342873528736287372873828739287402874128742287432874428745287462874728748287492875028751287522875328754287552875628757287582875928760287612876228763287642876528766287672876828769287702877128772287732877428775287762877728778287792878028781287822878328784287852878628787287882878928790287912879228793287942879528796287972879828799288002880128802288032880428805288062880728808288092881028811288122881328814288152881628817288182881928820288212882228823288242882528826288272882828829288302883128832288332883428835288362883728838288392884028841288422884328844288452884628847288482884928850288512885228853288542885528856288572885828859288602886128862288632886428865288662886728868288692887028871288722887328874288752887628877288782887928880288812888228883288842888528886288872888828889288902889128892288932889428895288962889728898288992890028901289022890328904289052890628907289082890928910289112891228913289142891528916289172891828919289202892128922289232892428925289262892728928289292893028931289322893328934289352893628937289382893928940289412894228943289442894528946289472894828949289502895128952289532895428955289562895728958289592896028961289622896328964289652896628967289682896928970289712897228973289742897528976289772897828979289802898128982289832898428985289862898728988289892899028991289922899328994289952899628997289982899929000290012900229003290042900529006290072900829009290102901129012290132901429015290162901729018290192902029021290222902329024290252902629027290282902929030290312903229033290342903529036290372903829039290402904129042290432904429045290462904729048290492905029051290522905329054290552905629057290582905929060290612906229063290642906529066290672906829069290702907129072290732907429075290762907729078290792908029081290822908329084290852908629087290882908929090290912909229093290942909529096290972909829099291002910129102291032910429105291062910729108291092911029111291122911329114291152911629117291182911929120291212912229123291242912529126291272912829129291302913129132291332913429135291362913729138291392914029141291422914329144291452914629147291482914929150291512915229153291542915529156291572915829159291602916129162291632916429165291662916729168291692917029171291722917329174291752917629177291782917929180291812918229183291842918529186291872918829189291902919129192291932919429195291962919729198291992920029201292022920329204292052920629207292082920929210292112921229213292142921529216292172921829219292202922129222292232922429225292262922729228292292923029231292322923329234292352923629237292382923929240292412924229243292442924529246292472924829249292502925129252292532925429255292562925729258292592926029261292622926329264292652926629267292682926929270292712927229273292742927529276292772927829279292802928129282292832928429285292862928729288292892929029291292922929329294292952929629297292982929929300293012930229303293042930529306293072930829309293102931129312293132931429315293162931729318293192932029321293222932329324293252932629327293282932929330293312933229333293342933529336293372933829339293402934129342293432934429345293462934729348293492935029351293522935329354293552935629357293582935929360293612936229363293642936529366293672936829369293702937129372293732937429375293762937729378293792938029381293822938329384293852938629387293882938929390293912939229393293942939529396293972939829399294002940129402294032940429405294062940729408294092941029411294122941329414294152941629417294182941929420294212942229423294242942529426294272942829429294302943129432294332943429435294362943729438294392944029441294422944329444294452944629447294482944929450294512945229453294542945529456294572945829459294602946129462294632946429465294662946729468294692947029471294722947329474294752947629477294782947929480294812948229483294842948529486294872948829489294902949129492294932949429495294962949729498294992950029501295022950329504295052950629507295082950929510295112951229513295142951529516295172951829519295202952129522295232952429525295262952729528295292953029531295322953329534295352953629537295382953929540295412954229543295442954529546295472954829549295502955129552295532955429555295562955729558295592956029561295622956329564295652956629567295682956929570295712957229573295742957529576295772957829579295802958129582295832958429585295862958729588295892959029591295922959329594295952959629597295982959929600296012960229603296042960529606296072960829609296102961129612296132961429615296162961729618296192962029621296222962329624296252962629627296282962929630296312963229633296342963529636296372963829639296402964129642296432964429645296462964729648296492965029651296522965329654296552965629657296582965929660296612966229663296642966529666296672966829669296702967129672296732967429675296762967729678296792968029681296822968329684296852968629687296882968929690296912969229693296942969529696296972969829699297002970129702297032970429705297062970729708297092971029711297122971329714297152971629717297182971929720297212972229723297242972529726297272972829729297302973129732297332973429735297362973729738297392974029741297422974329744297452974629747297482974929750297512975229753297542975529756297572975829759297602976129762297632976429765297662976729768297692977029771297722977329774297752977629777297782977929780297812978229783297842978529786297872978829789297902979129792297932979429795297962979729798297992980029801298022980329804298052980629807298082980929810298112981229813298142981529816298172981829819298202982129822298232982429825298262982729828298292983029831298322983329834298352983629837298382983929840298412984229843298442984529846298472984829849298502985129852298532985429855298562985729858298592986029861298622986329864298652986629867298682986929870298712987229873298742987529876298772987829879298802988129882298832988429885298862988729888298892989029891298922989329894298952989629897298982989929900299012990229903299042990529906299072990829909299102991129912299132991429915299162991729918299192992029921299222992329924299252992629927299282992929930299312993229933299342993529936299372993829939299402994129942299432994429945299462994729948299492995029951299522995329954299552995629957299582995929960299612996229963299642996529966299672996829969299702997129972299732997429975299762997729978299792998029981299822998329984299852998629987299882998929990299912999229993299942999529996299972999829999300003000130002300033000430005300063000730008300093001030011300123001330014300153001630017300183001930020300213002230023300243002530026300273002830029300303003130032300333003430035300363003730038300393004030041300423004330044300453004630047300483004930050300513005230053300543005530056300573005830059300603006130062300633006430065300663006730068300693007030071300723007330074300753007630077300783007930080300813008230083300843008530086300873008830089300903009130092300933009430095300963009730098300993010030101301023010330104301053010630107301083010930110301113011230113301143011530116301173011830119301203012130122301233012430125301263012730128301293013030131301323013330134301353013630137301383013930140301413014230143301443014530146301473014830149301503015130152301533015430155301563015730158301593016030161301623016330164301653016630167301683016930170301713017230173301743017530176301773017830179301803018130182301833018430185301863018730188301893019030191301923019330194301953019630197301983019930200302013020230203302043020530206302073020830209302103021130212302133021430215302163021730218302193022030221302223022330224302253022630227302283022930230302313023230233302343023530236302373023830239302403024130242302433024430245302463024730248302493025030251302523025330254302553025630257302583025930260302613026230263302643026530266302673026830269302703027130272302733027430275302763027730278302793028030281302823028330284302853028630287302883028930290302913029230293302943029530296302973029830299303003030130302303033030430305303063030730308303093031030311303123031330314303153031630317303183031930320303213032230323303243032530326303273032830329303303033130332303333033430335303363033730338303393034030341303423034330344303453034630347303483034930350303513035230353303543035530356303573035830359303603036130362303633036430365303663036730368303693037030371303723037330374303753037630377303783037930380303813038230383303843038530386303873038830389303903039130392303933039430395303963039730398303993040030401304023040330404304053040630407304083040930410304113041230413304143041530416304173041830419304203042130422304233042430425304263042730428304293043030431304323043330434304353043630437304383043930440304413044230443304443044530446304473044830449304503045130452304533045430455304563045730458304593046030461304623046330464304653046630467304683046930470304713047230473304743047530476304773047830479304803048130482304833048430485304863048730488304893049030491304923049330494304953049630497304983049930500305013050230503305043050530506305073050830509305103051130512305133051430515305163051730518305193052030521305223052330524305253052630527305283052930530305313053230533305343053530536305373053830539305403054130542305433054430545305463054730548305493055030551305523055330554305553055630557305583055930560305613056230563305643056530566305673056830569305703057130572305733057430575305763057730578305793058030581305823058330584305853058630587305883058930590305913059230593305943059530596305973059830599306003060130602306033060430605306063060730608306093061030611306123061330614306153061630617306183061930620306213062230623306243062530626306273062830629306303063130632306333063430635306363063730638306393064030641306423064330644306453064630647306483064930650306513065230653306543065530656306573065830659306603066130662306633066430665306663066730668306693067030671306723067330674306753067630677306783067930680306813068230683306843068530686306873068830689306903069130692306933069430695306963069730698306993070030701307023070330704307053070630707307083070930710307113071230713307143071530716307173071830719307203072130722307233072430725307263072730728307293073030731307323073330734307353073630737307383073930740307413074230743307443074530746307473074830749307503075130752307533075430755307563075730758307593076030761307623076330764307653076630767307683076930770307713077230773307743077530776307773077830779307803078130782307833078430785307863078730788307893079030791307923079330794307953079630797307983079930800308013080230803308043080530806308073080830809308103081130812308133081430815308163081730818308193082030821308223082330824308253082630827308283082930830308313083230833308343083530836308373083830839308403084130842308433084430845308463084730848308493085030851308523085330854308553085630857308583085930860308613086230863308643086530866308673086830869308703087130872308733087430875308763087730878308793088030881308823088330884308853088630887308883088930890308913089230893308943089530896308973089830899309003090130902309033090430905309063090730908309093091030911309123091330914309153091630917309183091930920309213092230923309243092530926309273092830929309303093130932309333093430935309363093730938309393094030941309423094330944309453094630947309483094930950309513095230953309543095530956309573095830959309603096130962309633096430965309663096730968309693097030971309723097330974309753097630977309783097930980309813098230983309843098530986309873098830989309903099130992309933099430995309963099730998309993100031001310023100331004310053100631007310083100931010310113101231013310143101531016310173101831019310203102131022310233102431025310263102731028310293103031031310323103331034310353103631037310383103931040310413104231043310443104531046310473104831049310503105131052310533105431055310563105731058310593106031061310623106331064310653106631067310683106931070310713107231073310743107531076310773107831079310803108131082310833108431085310863108731088310893109031091310923109331094310953109631097310983109931100311013110231103311043110531106311073110831109311103111131112311133111431115311163111731118311193112031121311223112331124311253112631127311283112931130311313113231133311343113531136311373113831139311403114131142311433114431145311463114731148311493115031151311523115331154311553115631157311583115931160311613116231163311643116531166311673116831169311703117131172311733117431175311763117731178311793118031181311823118331184311853118631187311883118931190311913119231193311943119531196311973119831199312003120131202312033120431205312063120731208312093121031211312123121331214312153121631217312183121931220312213122231223312243122531226312273122831229312303123131232312333123431235312363123731238312393124031241312423124331244312453124631247312483124931250312513125231253312543125531256312573125831259312603126131262312633126431265312663126731268312693127031271312723127331274312753127631277312783127931280312813128231283312843128531286312873128831289312903129131292312933129431295312963129731298312993130031301313023130331304313053130631307313083130931310313113131231313313143131531316313173131831319313203132131322313233132431325313263132731328313293133031331313323133331334313353133631337313383133931340313413134231343313443134531346313473134831349313503135131352313533135431355313563135731358313593136031361313623136331364313653136631367313683136931370313713137231373313743137531376313773137831379313803138131382313833138431385313863138731388313893139031391313923139331394313953139631397313983139931400314013140231403314043140531406314073140831409314103141131412314133141431415314163141731418314193142031421314223142331424314253142631427314283142931430314313143231433314343143531436314373143831439314403144131442314433144431445314463144731448314493145031451314523145331454314553145631457314583145931460314613146231463314643146531466314673146831469314703147131472314733147431475314763147731478314793148031481314823148331484314853148631487314883148931490314913149231493314943149531496314973149831499315003150131502315033150431505315063150731508315093151031511315123151331514315153151631517315183151931520315213152231523315243152531526315273152831529315303153131532315333153431535315363153731538315393154031541315423154331544315453154631547315483154931550315513155231553315543155531556315573155831559315603156131562315633156431565315663156731568315693157031571315723157331574315753157631577315783157931580315813158231583315843158531586315873158831589315903159131592315933159431595315963159731598315993160031601316023160331604316053160631607316083160931610316113161231613316143161531616316173161831619316203162131622316233162431625316263162731628316293163031631316323163331634316353163631637316383163931640316413164231643316443164531646316473164831649316503165131652316533165431655316563165731658316593166031661316623166331664316653166631667316683166931670316713167231673316743167531676316773167831679316803168131682316833168431685316863168731688316893169031691316923169331694316953169631697316983169931700317013170231703317043170531706317073170831709317103171131712317133171431715317163171731718317193172031721317223172331724317253172631727317283172931730317313173231733317343173531736317373173831739317403174131742317433174431745317463174731748317493175031751317523175331754317553175631757317583175931760317613176231763317643176531766317673176831769317703177131772317733177431775317763177731778317793178031781317823178331784317853178631787317883178931790317913179231793317943179531796317973179831799318003180131802318033180431805318063180731808318093181031811318123181331814318153181631817318183181931820318213182231823318243182531826318273182831829318303183131832318333183431835318363183731838318393184031841318423184331844318453184631847318483184931850318513185231853318543185531856318573185831859318603186131862318633186431865318663186731868318693187031871318723187331874318753187631877318783187931880318813188231883318843188531886318873188831889318903189131892318933189431895318963189731898318993190031901319023190331904319053190631907319083190931910319113191231913319143191531916319173191831919319203192131922319233192431925319263192731928319293193031931319323193331934319353193631937319383193931940319413194231943319443194531946319473194831949319503195131952319533195431955319563195731958319593196031961319623196331964319653196631967319683196931970319713197231973319743197531976319773197831979319803198131982319833198431985319863198731988319893199031991319923199331994319953199631997319983199932000320013200232003320043200532006320073200832009320103201132012320133201432015320163201732018320193202032021320223202332024320253202632027320283202932030320313203232033320343203532036320373203832039320403204132042320433204432045320463204732048320493205032051320523205332054320553205632057320583205932060320613206232063320643206532066320673206832069320703207132072320733207432075320763207732078320793208032081320823208332084320853208632087320883208932090320913209232093320943209532096320973209832099321003210132102321033210432105321063210732108321093211032111321123211332114321153211632117321183211932120321213212232123321243212532126321273212832129321303213132132321333213432135321363213732138321393214032141321423214332144321453214632147321483214932150321513215232153321543215532156321573215832159321603216132162321633216432165321663216732168321693217032171321723217332174321753217632177321783217932180321813218232183321843218532186321873218832189321903219132192321933219432195321963219732198321993220032201322023220332204322053220632207322083220932210322113221232213322143221532216322173221832219322203222132222322233222432225322263222732228322293223032231322323223332234322353223632237322383223932240322413224232243322443224532246322473224832249322503225132252322533225432255322563225732258322593226032261322623226332264322653226632267322683226932270322713227232273322743227532276322773227832279322803228132282322833228432285322863228732288322893229032291322923229332294322953229632297322983229932300323013230232303323043230532306323073230832309323103231132312323133231432315323163231732318323193232032321323223232332324323253232632327323283232932330323313233232333323343233532336323373233832339323403234132342323433234432345323463234732348323493235032351323523235332354323553235632357323583235932360323613236232363323643236532366323673236832369323703237132372323733237432375323763237732378323793238032381323823238332384323853238632387323883238932390323913239232393323943239532396323973239832399324003240132402324033240432405324063240732408324093241032411324123241332414324153241632417324183241932420324213242232423324243242532426324273242832429324303243132432324333243432435324363243732438324393244032441324423244332444324453244632447324483244932450324513245232453324543245532456324573245832459324603246132462324633246432465324663246732468324693247032471324723247332474324753247632477324783247932480324813248232483324843248532486324873248832489324903249132492324933249432495324963249732498324993250032501325023250332504325053250632507325083250932510325113251232513325143251532516325173251832519325203252132522325233252432525325263252732528325293253032531325323253332534325353253632537325383253932540325413254232543325443254532546325473254832549325503255132552325533255432555325563255732558325593256032561325623256332564325653256632567325683256932570325713257232573325743257532576325773257832579325803258132582325833258432585325863258732588325893259032591325923259332594325953259632597325983259932600326013260232603326043260532606326073260832609326103261132612326133261432615326163261732618326193262032621326223262332624326253262632627326283262932630326313263232633326343263532636326373263832639326403264132642326433264432645326463264732648326493265032651326523265332654326553265632657326583265932660326613266232663326643266532666326673266832669326703267132672326733267432675326763267732678326793268032681326823268332684326853268632687326883268932690326913269232693326943269532696326973269832699327003270132702327033270432705327063270732708327093271032711327123271332714327153271632717327183271932720327213272232723327243272532726327273272832729327303273132732327333273432735327363273732738327393274032741327423274332744327453274632747327483274932750327513275232753327543275532756327573275832759327603276132762327633276432765327663276732768327693277032771327723277332774327753277632777327783277932780327813278232783327843278532786327873278832789327903279132792327933279432795327963279732798327993280032801328023280332804328053280632807328083280932810328113281232813328143281532816328173281832819328203282132822328233282432825328263282732828328293283032831328323283332834328353283632837328383283932840328413284232843328443284532846328473284832849328503285132852328533285432855328563285732858328593286032861328623286332864328653286632867328683286932870328713287232873328743287532876328773287832879328803288132882328833288432885328863288732888328893289032891328923289332894328953289632897328983289932900329013290232903329043290532906329073290832909329103291132912329133291432915329163291732918329193292032921329223292332924329253292632927329283292932930329313293232933329343293532936329373293832939329403294132942329433294432945329463294732948329493295032951329523295332954329553295632957329583295932960329613296232963329643296532966329673296832969329703297132972329733297432975329763297732978329793298032981329823298332984329853298632987329883298932990329913299232993329943299532996329973299832999330003300133002330033300433005330063300733008330093301033011330123301333014330153301633017330183301933020330213302233023330243302533026330273302833029330303303133032330333303433035330363303733038330393304033041330423304333044330453304633047330483304933050330513305233053330543305533056330573305833059330603306133062330633306433065330663306733068330693307033071330723307333074330753307633077330783307933080330813308233083330843308533086330873308833089330903309133092330933309433095330963309733098330993310033101331023310333104331053310633107331083310933110331113311233113331143311533116331173311833119331203312133122331233312433125331263312733128331293313033131331323313333134331353313633137331383313933140331413314233143331443314533146331473314833149331503315133152331533315433155331563315733158331593316033161331623316333164331653316633167331683316933170331713317233173331743317533176331773317833179331803318133182331833318433185331863318733188331893319033191331923319333194331953319633197331983319933200332013320233203332043320533206332073320833209332103321133212332133321433215332163321733218332193322033221332223322333224332253322633227332283322933230332313323233233332343323533236332373323833239332403324133242332433324433245332463324733248332493325033251332523325333254332553325633257332583325933260332613326233263332643326533266332673326833269332703327133272332733327433275332763327733278332793328033281332823328333284332853328633287332883328933290332913329233293332943329533296332973329833299333003330133302333033330433305333063330733308333093331033311333123331333314333153331633317333183331933320333213332233323333243332533326333273332833329333303333133332333333333433335333363333733338333393334033341333423334333344333453334633347333483334933350333513335233353333543335533356333573335833359333603336133362333633336433365333663336733368333693337033371333723337333374333753337633377333783337933380333813338233383333843338533386333873338833389333903339133392333933339433395333963339733398333993340033401334023340333404334053340633407334083340933410334113341233413334143341533416334173341833419334203342133422334233342433425334263342733428334293343033431334323343333434334353343633437334383343933440334413344233443334443344533446334473344833449334503345133452334533345433455334563345733458334593346033461334623346333464334653346633467334683346933470334713347233473334743347533476334773347833479334803348133482334833348433485334863348733488334893349033491334923349333494334953349633497334983349933500335013350233503335043350533506335073350833509335103351133512335133351433515335163351733518335193352033521335223352333524335253352633527335283352933530335313353233533335343353533536335373353833539335403354133542335433354433545335463354733548335493355033551335523355333554335553355633557335583355933560335613356233563335643356533566335673356833569335703357133572335733357433575335763357733578335793358033581335823358333584335853358633587335883358933590335913359233593335943359533596335973359833599336003360133602336033360433605336063360733608336093361033611336123361333614336153361633617336183361933620336213362233623336243362533626336273362833629336303363133632336333363433635336363363733638336393364033641336423364333644336453364633647336483364933650336513365233653336543365533656336573365833659336603366133662336633366433665336663366733668336693367033671336723367333674336753367633677336783367933680336813368233683336843368533686336873368833689336903369133692336933369433695336963369733698336993370033701337023370333704337053370633707337083370933710337113371233713337143371533716337173371833719337203372133722337233372433725337263372733728337293373033731337323373333734337353373633737337383373933740337413374233743337443374533746337473374833749337503375133752337533375433755337563375733758337593376033761337623376333764337653376633767337683376933770337713377233773337743377533776337773377833779337803378133782337833378433785337863378733788337893379033791337923379333794337953379633797337983379933800338013380233803338043380533806338073380833809338103381133812338133381433815338163381733818338193382033821338223382333824338253382633827338283382933830338313383233833338343383533836338373383833839338403384133842338433384433845338463384733848338493385033851338523385333854338553385633857338583385933860338613386233863338643386533866338673386833869338703387133872338733387433875338763387733878338793388033881338823388333884338853388633887338883388933890338913389233893338943389533896338973389833899339003390133902339033390433905339063390733908339093391033911339123391333914339153391633917339183391933920339213392233923339243392533926339273392833929339303393133932339333393433935339363393733938339393394033941339423394333944339453394633947339483394933950339513395233953339543395533956339573395833959339603396133962339633396433965339663396733968339693397033971339723397333974339753397633977339783397933980339813398233983339843398533986339873398833989339903399133992339933399433995339963399733998339993400034001340023400334004340053400634007340083400934010340113401234013340143401534016340173401834019340203402134022340233402434025340263402734028340293403034031340323403334034340353403634037340383403934040340413404234043340443404534046340473404834049340503405134052340533405434055340563405734058340593406034061340623406334064340653406634067340683406934070340713407234073340743407534076340773407834079340803408134082340833408434085340863408734088340893409034091340923409334094340953409634097340983409934100341013410234103341043410534106341073410834109341103411134112341133411434115341163411734118341193412034121341223412334124341253412634127341283412934130341313413234133341343413534136341373413834139341403414134142341433414434145341463414734148341493415034151341523415334154341553415634157341583415934160341613416234163341643416534166341673416834169341703417134172341733417434175341763417734178341793418034181341823418334184341853418634187341883418934190341913419234193341943419534196341973419834199342003420134202342033420434205342063420734208342093421034211342123421334214342153421634217342183421934220342213422234223342243422534226342273422834229342303423134232342333423434235342363423734238342393424034241342423424334244342453424634247342483424934250342513425234253342543425534256342573425834259342603426134262342633426434265342663426734268342693427034271342723427334274342753427634277342783427934280342813428234283342843428534286342873428834289342903429134292342933429434295342963429734298342993430034301343023430334304343053430634307343083430934310343113431234313343143431534316343173431834319343203432134322343233432434325343263432734328343293433034331343323433334334343353433634337343383433934340343413434234343343443434534346343473434834349343503435134352343533435434355343563435734358343593436034361343623436334364343653436634367343683436934370343713437234373343743437534376343773437834379343803438134382343833438434385343863438734388343893439034391343923439334394343953439634397343983439934400344013440234403344043440534406344073440834409344103441134412344133441434415344163441734418344193442034421344223442334424344253442634427344283442934430344313443234433344343443534436344373443834439344403444134442344433444434445344463444734448344493445034451344523445334454344553445634457344583445934460344613446234463344643446534466344673446834469344703447134472344733447434475344763447734478344793448034481344823448334484344853448634487344883448934490344913449234493344943449534496344973449834499345003450134502345033450434505345063450734508345093451034511345123451334514345153451634517345183451934520345213452234523345243452534526345273452834529345303453134532345333453434535345363453734538345393454034541345423454334544345453454634547345483454934550345513455234553345543455534556345573455834559345603456134562345633456434565345663456734568345693457034571345723457334574345753457634577345783457934580345813458234583345843458534586345873458834589345903459134592345933459434595345963459734598345993460034601346023460334604346053460634607346083460934610346113461234613346143461534616346173461834619346203462134622346233462434625346263462734628346293463034631346323463334634346353463634637346383463934640346413464234643346443464534646346473464834649346503465134652346533465434655346563465734658346593466034661346623466334664346653466634667346683466934670346713467234673346743467534676346773467834679346803468134682346833468434685346863468734688346893469034691346923469334694346953469634697346983469934700347013470234703347043470534706347073470834709347103471134712347133471434715347163471734718347193472034721347223472334724347253472634727347283472934730347313473234733347343473534736347373473834739347403474134742347433474434745347463474734748347493475034751347523475334754347553475634757347583475934760347613476234763347643476534766347673476834769347703477134772347733477434775347763477734778347793478034781347823478334784347853478634787347883478934790347913479234793347943479534796347973479834799348003480134802348033480434805348063480734808348093481034811348123481334814348153481634817348183481934820348213482234823348243482534826348273482834829348303483134832348333483434835348363483734838348393484034841348423484334844348453484634847348483484934850348513485234853348543485534856348573485834859348603486134862348633486434865348663486734868348693487034871348723487334874348753487634877348783487934880348813488234883348843488534886348873488834889348903489134892348933489434895348963489734898348993490034901349023490334904349053490634907349083490934910349113491234913349143491534916349173491834919349203492134922349233492434925349263492734928349293493034931349323493334934349353493634937349383493934940349413494234943349443494534946349473494834949349503495134952349533495434955349563495734958349593496034961349623496334964349653496634967349683496934970349713497234973349743497534976349773497834979349803498134982349833498434985349863498734988349893499034991349923499334994349953499634997349983499935000350013500235003350043500535006350073500835009350103501135012350133501435015350163501735018350193502035021350223502335024350253502635027350283502935030350313503235033350343503535036350373503835039350403504135042350433504435045350463504735048350493505035051350523505335054350553505635057350583505935060350613506235063350643506535066350673506835069350703507135072350733507435075350763507735078350793508035081350823508335084350853508635087350883508935090350913509235093350943509535096350973509835099351003510135102351033510435105351063510735108351093511035111351123511335114351153511635117351183511935120351213512235123351243512535126351273512835129351303513135132351333513435135351363513735138351393514035141351423514335144351453514635147351483514935150351513515235153351543515535156351573515835159351603516135162351633516435165351663516735168351693517035171351723517335174351753517635177351783517935180351813518235183351843518535186351873518835189351903519135192351933519435195351963519735198351993520035201352023520335204352053520635207352083520935210352113521235213352143521535216352173521835219352203522135222352233522435225352263522735228352293523035231352323523335234352353523635237352383523935240352413524235243352443524535246352473524835249352503525135252352533525435255352563525735258352593526035261352623526335264352653526635267352683526935270352713527235273352743527535276352773527835279352803528135282352833528435285352863528735288352893529035291352923529335294352953529635297352983529935300353013530235303353043530535306353073530835309353103531135312353133531435315353163531735318353193532035321353223532335324353253532635327353283532935330353313533235333353343533535336353373533835339353403534135342353433534435345353463534735348353493535035351353523535335354353553535635357353583535935360353613536235363353643536535366353673536835369353703537135372353733537435375353763537735378353793538035381353823538335384353853538635387353883538935390353913539235393353943539535396353973539835399354003540135402354033540435405354063540735408354093541035411354123541335414354153541635417354183541935420354213542235423354243542535426354273542835429354303543135432354333543435435354363543735438354393544035441354423544335444354453544635447354483544935450354513545235453354543545535456354573545835459354603546135462354633546435465354663546735468354693547035471354723547335474354753547635477354783547935480354813548235483354843548535486354873548835489354903549135492354933549435495354963549735498354993550035501355023550335504355053550635507355083550935510355113551235513355143551535516355173551835519355203552135522355233552435525355263552735528355293553035531355323553335534355353553635537355383553935540355413554235543355443554535546355473554835549355503555135552355533555435555355563555735558355593556035561355623556335564355653556635567355683556935570355713557235573355743557535576355773557835579355803558135582355833558435585355863558735588355893559035591355923559335594355953559635597355983559935600356013560235603356043560535606356073560835609356103561135612356133561435615356163561735618356193562035621356223562335624356253562635627356283562935630356313563235633356343563535636356373563835639356403564135642356433564435645356463564735648356493565035651356523565335654356553565635657356583565935660356613566235663356643566535666356673566835669356703567135672356733567435675356763567735678356793568035681356823568335684356853568635687356883568935690356913569235693356943569535696356973569835699357003570135702357033570435705357063570735708357093571035711357123571335714357153571635717357183571935720357213572235723357243572535726357273572835729357303573135732357333573435735357363573735738357393574035741357423574335744357453574635747357483574935750357513575235753357543575535756357573575835759357603576135762357633576435765357663576735768357693577035771357723577335774357753577635777357783577935780357813578235783357843578535786357873578835789357903579135792357933579435795357963579735798357993580035801358023580335804358053580635807358083580935810358113581235813358143581535816358173581835819358203582135822358233582435825358263582735828358293583035831358323583335834358353583635837358383583935840358413584235843358443584535846358473584835849358503585135852358533585435855358563585735858358593586035861358623586335864358653586635867358683586935870358713587235873358743587535876358773587835879358803588135882358833588435885358863588735888358893589035891358923589335894358953589635897358983589935900359013590235903359043590535906359073590835909359103591135912359133591435915359163591735918359193592035921359223592335924359253592635927359283592935930359313593235933359343593535936359373593835939359403594135942359433594435945359463594735948359493595035951359523595335954359553595635957359583595935960359613596235963359643596535966359673596835969359703597135972359733597435975359763597735978359793598035981359823598335984359853598635987359883598935990359913599235993359943599535996359973599835999360003600136002360033600436005360063600736008360093601036011360123601336014360153601636017360183601936020360213602236023360243602536026360273602836029360303603136032360333603436035360363603736038360393604036041360423604336044360453604636047360483604936050360513605236053360543605536056360573605836059360603606136062360633606436065360663606736068360693607036071360723607336074360753607636077360783607936080360813608236083360843608536086360873608836089360903609136092360933609436095360963609736098360993610036101361023610336104361053610636107361083610936110361113611236113361143611536116361173611836119361203612136122361233612436125361263612736128361293613036131361323613336134361353613636137361383613936140361413614236143361443614536146361473614836149361503615136152361533615436155361563615736158361593616036161361623616336164361653616636167361683616936170361713617236173361743617536176361773617836179361803618136182361833618436185361863618736188361893619036191361923619336194361953619636197361983619936200362013620236203362043620536206362073620836209362103621136212362133621436215362163621736218362193622036221362223622336224362253622636227362283622936230362313623236233362343623536236362373623836239362403624136242362433624436245362463624736248362493625036251362523625336254362553625636257362583625936260362613626236263362643626536266362673626836269362703627136272362733627436275362763627736278362793628036281362823628336284362853628636287362883628936290362913629236293362943629536296362973629836299363003630136302363033630436305363063630736308363093631036311363123631336314363153631636317363183631936320363213632236323363243632536326363273632836329363303633136332363333633436335363363633736338363393634036341363423634336344363453634636347363483634936350363513635236353363543635536356363573635836359363603636136362363633636436365363663636736368363693637036371363723637336374363753637636377363783637936380363813638236383363843638536386363873638836389363903639136392363933639436395363963639736398363993640036401364023640336404364053640636407364083640936410364113641236413364143641536416364173641836419364203642136422364233642436425364263642736428364293643036431364323643336434364353643636437364383643936440364413644236443364443644536446364473644836449364503645136452364533645436455364563645736458364593646036461364623646336464364653646636467364683646936470364713647236473364743647536476364773647836479364803648136482364833648436485364863648736488364893649036491364923649336494364953649636497364983649936500365013650236503365043650536506365073650836509365103651136512365133651436515365163651736518365193652036521365223652336524365253652636527365283652936530365313653236533365343653536536365373653836539365403654136542365433654436545365463654736548365493655036551365523655336554365553655636557365583655936560365613656236563365643656536566365673656836569365703657136572365733657436575365763657736578365793658036581365823658336584365853658636587365883658936590365913659236593365943659536596365973659836599366003660136602366033660436605366063660736608366093661036611366123661336614366153661636617366183661936620366213662236623366243662536626366273662836629366303663136632366333663436635366363663736638366393664036641366423664336644366453664636647366483664936650366513665236653366543665536656366573665836659366603666136662366633666436665366663666736668366693667036671366723667336674366753667636677366783667936680366813668236683366843668536686366873668836689366903669136692366933669436695366963669736698366993670036701367023670336704367053670636707367083670936710367113671236713367143671536716367173671836719367203672136722367233672436725367263672736728367293673036731367323673336734367353673636737367383673936740367413674236743367443674536746367473674836749367503675136752367533675436755367563675736758367593676036761367623676336764367653676636767367683676936770367713677236773367743677536776367773677836779367803678136782367833678436785367863678736788367893679036791367923679336794367953679636797367983679936800368013680236803368043680536806368073680836809368103681136812368133681436815368163681736818368193682036821368223682336824368253682636827368283682936830368313683236833368343683536836368373683836839368403684136842368433684436845368463684736848368493685036851368523685336854368553685636857368583685936860368613686236863368643686536866368673686836869368703687136872368733687436875368763687736878368793688036881368823688336884368853688636887368883688936890368913689236893368943689536896368973689836899369003690136902369033690436905369063690736908369093691036911369123691336914369153691636917369183691936920369213692236923369243692536926369273692836929369303693136932369333693436935369363693736938369393694036941369423694336944369453694636947369483694936950369513695236953369543695536956369573695836959369603696136962369633696436965369663696736968369693697036971369723697336974369753697636977369783697936980369813698236983369843698536986369873698836989369903699136992369933699436995369963699736998369993700037001370023700337004370053700637007370083700937010370113701237013370143701537016370173701837019370203702137022370233702437025370263702737028370293703037031370323703337034370353703637037370383703937040370413704237043370443704537046370473704837049370503705137052370533705437055370563705737058370593706037061370623706337064370653706637067370683706937070370713707237073370743707537076370773707837079370803708137082370833708437085370863708737088370893709037091370923709337094370953709637097370983709937100371013710237103371043710537106371073710837109371103711137112371133711437115371163711737118371193712037121371223712337124371253712637127371283712937130371313713237133371343713537136371373713837139371403714137142371433714437145371463714737148371493715037151371523715337154371553715637157371583715937160371613716237163371643716537166371673716837169371703717137172371733717437175371763717737178371793718037181371823718337184371853718637187371883718937190371913719237193371943719537196371973719837199372003720137202372033720437205372063720737208372093721037211372123721337214372153721637217372183721937220372213722237223372243722537226372273722837229372303723137232372333723437235372363723737238372393724037241372423724337244372453724637247372483724937250372513725237253372543725537256372573725837259372603726137262372633726437265372663726737268372693727037271372723727337274372753727637277372783727937280372813728237283372843728537286372873728837289372903729137292372933729437295372963729737298372993730037301373023730337304373053730637307373083730937310373113731237313373143731537316373173731837319373203732137322373233732437325373263732737328373293733037331373323733337334373353733637337373383733937340373413734237343373443734537346373473734837349373503735137352373533735437355373563735737358373593736037361373623736337364373653736637367373683736937370373713737237373373743737537376373773737837379373803738137382373833738437385373863738737388373893739037391373923739337394373953739637397373983739937400374013740237403374043740537406374073740837409374103741137412374133741437415374163741737418374193742037421374223742337424374253742637427374283742937430374313743237433374343743537436374373743837439374403744137442374433744437445374463744737448374493745037451374523745337454374553745637457374583745937460374613746237463374643746537466374673746837469374703747137472374733747437475374763747737478374793748037481374823748337484374853748637487374883748937490374913749237493374943749537496374973749837499375003750137502375033750437505375063750737508375093751037511375123751337514375153751637517375183751937520375213752237523375243752537526375273752837529375303753137532375333753437535375363753737538375393754037541375423754337544375453754637547375483754937550375513755237553375543755537556375573755837559375603756137562375633756437565375663756737568375693757037571375723757337574375753757637577375783757937580375813758237583375843758537586375873758837589375903759137592375933759437595375963759737598375993760037601376023760337604376053760637607376083760937610376113761237613376143761537616376173761837619376203762137622376233762437625376263762737628376293763037631376323763337634376353763637637376383763937640376413764237643376443764537646376473764837649376503765137652376533765437655376563765737658376593766037661376623766337664376653766637667376683766937670376713767237673376743767537676376773767837679376803768137682376833768437685376863768737688376893769037691376923769337694376953769637697376983769937700377013770237703377043770537706377073770837709377103771137712377133771437715377163771737718377193772037721377223772337724377253772637727377283772937730377313773237733377343773537736377373773837739377403774137742377433774437745377463774737748377493775037751377523775337754377553775637757377583775937760377613776237763377643776537766377673776837769377703777137772377733777437775377763777737778377793778037781377823778337784377853778637787377883778937790377913779237793377943779537796377973779837799378003780137802378033780437805378063780737808378093781037811378123781337814378153781637817378183781937820378213782237823378243782537826378273782837829378303783137832378333783437835378363783737838378393784037841378423784337844378453784637847378483784937850378513785237853378543785537856378573785837859378603786137862378633786437865378663786737868378693787037871378723787337874378753787637877378783787937880378813788237883378843788537886378873788837889378903789137892378933789437895378963789737898378993790037901379023790337904379053790637907379083790937910379113791237913379143791537916379173791837919379203792137922379233792437925379263792737928379293793037931379323793337934379353793637937379383793937940379413794237943379443794537946379473794837949379503795137952379533795437955379563795737958379593796037961379623796337964379653796637967379683796937970379713797237973379743797537976379773797837979379803798137982379833798437985379863798737988379893799037991379923799337994379953799637997379983799938000380013800238003380043800538006380073800838009380103801138012380133801438015380163801738018380193802038021380223802338024380253802638027380283802938030380313803238033380343803538036380373803838039380403804138042380433804438045380463804738048380493805038051380523805338054380553805638057380583805938060380613806238063380643806538066380673806838069380703807138072380733807438075380763807738078380793808038081380823808338084380853808638087380883808938090380913809238093380943809538096380973809838099381003810138102381033810438105381063810738108381093811038111381123811338114381153811638117381183811938120381213812238123381243812538126381273812838129381303813138132381333813438135381363813738138381393814038141381423814338144381453814638147381483814938150381513815238153381543815538156381573815838159381603816138162381633816438165381663816738168381693817038171381723817338174381753817638177381783817938180381813818238183381843818538186381873818838189381903819138192381933819438195381963819738198381993820038201382023820338204382053820638207382083820938210382113821238213382143821538216382173821838219382203822138222382233822438225382263822738228382293823038231382323823338234382353823638237382383823938240382413824238243382443824538246382473824838249382503825138252382533825438255382563825738258382593826038261382623826338264382653826638267382683826938270382713827238273382743827538276382773827838279382803828138282382833828438285382863828738288382893829038291382923829338294382953829638297382983829938300383013830238303383043830538306383073830838309383103831138312383133831438315383163831738318383193832038321383223832338324383253832638327383283832938330383313833238333383343833538336383373833838339383403834138342383433834438345383463834738348383493835038351383523835338354383553835638357383583835938360383613836238363383643836538366383673836838369383703837138372383733837438375383763837738378383793838038381383823838338384383853838638387383883838938390383913839238393383943839538396383973839838399384003840138402384033840438405384063840738408384093841038411384123841338414384153841638417384183841938420384213842238423384243842538426384273842838429384303843138432384333843438435384363843738438384393844038441384423844338444384453844638447384483844938450384513845238453384543845538456384573845838459384603846138462384633846438465384663846738468384693847038471384723847338474384753847638477384783847938480384813848238483384843848538486
  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.credentialsConfigPath = ''; // Path to separate credentials config file in RUNNER_TEMP
  158. this.git = gitCommandManager;
  159. this.settings = gitSourceSettings || {};
  160. // Token auth header
  161. const serverUrl = urlHelper.getServerUrl(this.settings.githubServerUrl);
  162. this.tokenConfigKey = `http.${serverUrl.origin}/.extraheader`; // "origin" is SCHEME://HOSTNAME[:PORT]
  163. const basicCredential = Buffer.from(`x-access-token:${this.settings.authToken}`, 'utf8').toString('base64');
  164. core.setSecret(basicCredential);
  165. this.tokenPlaceholderConfigValue = `AUTHORIZATION: basic ***`;
  166. this.tokenConfigValue = `AUTHORIZATION: basic ${basicCredential}`;
  167. // Instead of SSH URL
  168. this.insteadOfKey = `url.${serverUrl.origin}/.insteadOf`; // "origin" is SCHEME://HOSTNAME[:PORT]
  169. this.insteadOfValues.push(`git@${serverUrl.hostname}:`);
  170. if (this.settings.workflowOrganizationId) {
  171. this.insteadOfValues.push(`org-${this.settings.workflowOrganizationId}@github.com:`);
  172. }
  173. }
  174. configureAuth() {
  175. return __awaiter(this, void 0, void 0, function* () {
  176. // Remove possible previous values
  177. yield this.removeAuth();
  178. // Configure new values
  179. yield this.configureSsh();
  180. yield this.configureToken();
  181. });
  182. }
  183. configureTempGlobalConfig() {
  184. return __awaiter(this, void 0, void 0, function* () {
  185. var _a;
  186. // Already setup global config
  187. if (((_a = this.temporaryHomePath) === null || _a === void 0 ? void 0 : _a.length) > 0) {
  188. return path.join(this.temporaryHomePath, '.gitconfig');
  189. }
  190. // Create a temp home directory
  191. const runnerTemp = process.env['RUNNER_TEMP'] || '';
  192. assert.ok(runnerTemp, 'RUNNER_TEMP is not defined');
  193. const uniqueId = (0, uuid_1.v4)();
  194. this.temporaryHomePath = path.join(runnerTemp, uniqueId);
  195. yield fs.promises.mkdir(this.temporaryHomePath, { recursive: true });
  196. // Copy the global git config
  197. const gitConfigPath = path.join(process.env['HOME'] || os.homedir(), '.gitconfig');
  198. const newGitConfigPath = path.join(this.temporaryHomePath, '.gitconfig');
  199. let configExists = false;
  200. try {
  201. yield fs.promises.stat(gitConfigPath);
  202. configExists = true;
  203. }
  204. catch (err) {
  205. if ((err === null || err === void 0 ? void 0 : err.code) !== 'ENOENT') {
  206. throw err;
  207. }
  208. }
  209. if (configExists) {
  210. core.info(`Copying '${gitConfigPath}' to '${newGitConfigPath}'`);
  211. yield io.cp(gitConfigPath, newGitConfigPath);
  212. }
  213. else {
  214. yield fs.promises.writeFile(newGitConfigPath, '');
  215. }
  216. // Override HOME
  217. core.info(`Temporarily overriding HOME='${this.temporaryHomePath}' before making global git config changes`);
  218. this.git.setEnvironmentVariable('HOME', this.temporaryHomePath);
  219. return newGitConfigPath;
  220. });
  221. }
  222. configureGlobalAuth() {
  223. return __awaiter(this, void 0, void 0, function* () {
  224. // 'configureTempGlobalConfig' noops if already set, just returns the path
  225. yield this.configureTempGlobalConfig();
  226. try {
  227. // Configure the token
  228. yield this.configureToken(true);
  229. // Configure HTTPS instead of SSH
  230. yield this.git.tryConfigUnset(this.insteadOfKey, true);
  231. if (!this.settings.sshKey) {
  232. for (const insteadOfValue of this.insteadOfValues) {
  233. yield this.git.config(this.insteadOfKey, insteadOfValue, true, // globalConfig?
  234. true // add?
  235. );
  236. }
  237. }
  238. }
  239. catch (err) {
  240. // Unset in case somehow written to the real global config
  241. core.info('Encountered an error when attempting to configure token. Attempting unconfigure.');
  242. yield this.git.tryConfigUnset(this.tokenConfigKey, true);
  243. throw err;
  244. }
  245. });
  246. }
  247. configureSubmoduleAuth() {
  248. return __awaiter(this, void 0, void 0, function* () {
  249. // Remove possible previous HTTPS instead of SSH
  250. yield this.removeSubmoduleGitConfig(this.insteadOfKey);
  251. if (this.settings.persistCredentials) {
  252. // Get the credentials config file path in RUNNER_TEMP
  253. const credentialsConfigPath = this.getCredentialsConfigPath();
  254. // Container credentials config path
  255. const containerCredentialsPath = path.posix.join('/github/runner_temp', path.basename(credentialsConfigPath));
  256. // Get submodule config file paths.
  257. const configPaths = yield this.git.getSubmoduleConfigPaths(this.settings.nestedSubmodules);
  258. // For each submodule, configure includeIf entries pointing to the shared credentials file.
  259. // Configure both host and container paths to support Docker container actions.
  260. for (const configPath of configPaths) {
  261. // Submodule Git directory
  262. let submoduleGitDir = path.dirname(configPath); // The config file is at .git/modules/submodule-name/config
  263. submoduleGitDir = submoduleGitDir.replace(/\\/g, '/'); // Use forward slashes, even on Windows
  264. // Configure host includeIf
  265. yield this.git.config(`includeIf.gitdir:${submoduleGitDir}.path`, credentialsConfigPath, false, // globalConfig?
  266. false, // add?
  267. configPath);
  268. // Container submodule git directory
  269. const githubWorkspace = process.env['GITHUB_WORKSPACE'];
  270. assert.ok(githubWorkspace, 'GITHUB_WORKSPACE is not defined');
  271. let relativeSubmoduleGitDir = path.relative(githubWorkspace, submoduleGitDir);
  272. relativeSubmoduleGitDir = relativeSubmoduleGitDir.replace(/\\/g, '/'); // Use forward slashes, even on Windows
  273. const containerSubmoduleGitDir = path.posix.join('/github/workspace', relativeSubmoduleGitDir);
  274. // Configure container includeIf
  275. yield this.git.config(`includeIf.gitdir:${containerSubmoduleGitDir}.path`, containerCredentialsPath, false, // globalConfig?
  276. false, // add?
  277. configPath);
  278. }
  279. if (this.settings.sshKey) {
  280. // Configure core.sshCommand
  281. yield this.git.submoduleForeach(`git config --local '${SSH_COMMAND_KEY}' '${this.sshCommand}'`, this.settings.nestedSubmodules);
  282. }
  283. else {
  284. // Configure HTTPS instead of SSH
  285. for (const insteadOfValue of this.insteadOfValues) {
  286. yield this.git.submoduleForeach(`git config --local --add '${this.insteadOfKey}' '${insteadOfValue}'`, this.settings.nestedSubmodules);
  287. }
  288. }
  289. }
  290. });
  291. }
  292. removeAuth() {
  293. return __awaiter(this, void 0, void 0, function* () {
  294. yield this.removeSsh();
  295. yield this.removeToken();
  296. });
  297. }
  298. removeGlobalConfig() {
  299. return __awaiter(this, void 0, void 0, function* () {
  300. var _a;
  301. if (((_a = this.temporaryHomePath) === null || _a === void 0 ? void 0 : _a.length) > 0) {
  302. core.debug(`Unsetting HOME override`);
  303. this.git.removeEnvironmentVariable('HOME');
  304. yield io.rmRF(this.temporaryHomePath);
  305. }
  306. });
  307. }
  308. /**
  309. * Configures SSH authentication by writing the SSH key and known hosts,
  310. * and setting up the GIT_SSH_COMMAND environment variable.
  311. */
  312. configureSsh() {
  313. return __awaiter(this, void 0, void 0, function* () {
  314. if (!this.settings.sshKey) {
  315. return;
  316. }
  317. // Write key
  318. const runnerTemp = process.env['RUNNER_TEMP'] || '';
  319. assert.ok(runnerTemp, 'RUNNER_TEMP is not defined');
  320. const uniqueId = (0, uuid_1.v4)();
  321. this.sshKeyPath = path.join(runnerTemp, uniqueId);
  322. stateHelper.setSshKeyPath(this.sshKeyPath);
  323. yield fs.promises.mkdir(runnerTemp, { recursive: true });
  324. yield fs.promises.writeFile(this.sshKeyPath, this.settings.sshKey.trim() + '\n', { mode: 0o600 });
  325. // Remove inherited permissions on Windows
  326. if (IS_WINDOWS) {
  327. const icacls = yield io.which('icacls.exe');
  328. yield exec.exec(`"${icacls}" "${this.sshKeyPath}" /grant:r "${process.env['USERDOMAIN']}\\${process.env['USERNAME']}:F"`);
  329. yield exec.exec(`"${icacls}" "${this.sshKeyPath}" /inheritance:r`);
  330. }
  331. // Write known hosts
  332. const userKnownHostsPath = path.join(os.homedir(), '.ssh', 'known_hosts');
  333. let userKnownHosts = '';
  334. try {
  335. userKnownHosts = (yield fs.promises.readFile(userKnownHostsPath)).toString();
  336. }
  337. catch (err) {
  338. if ((err === null || err === void 0 ? void 0 : err.code) !== 'ENOENT') {
  339. throw err;
  340. }
  341. }
  342. let knownHosts = '';
  343. if (userKnownHosts) {
  344. knownHosts += `# Begin from ${userKnownHostsPath}\n${userKnownHosts}\n# End from ${userKnownHostsPath}\n`;
  345. }
  346. if (this.settings.sshKnownHosts) {
  347. knownHosts += `# Begin from input known hosts\n${this.settings.sshKnownHosts}\n# end from input known hosts\n`;
  348. }
  349. 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`;
  350. this.sshKnownHostsPath = path.join(runnerTemp, `${uniqueId}_known_hosts`);
  351. stateHelper.setSshKnownHostsPath(this.sshKnownHostsPath);
  352. yield fs.promises.writeFile(this.sshKnownHostsPath, knownHosts);
  353. // Configure GIT_SSH_COMMAND
  354. const sshPath = yield io.which('ssh', true);
  355. this.sshCommand = `"${sshPath}" -i "$RUNNER_TEMP/${path.basename(this.sshKeyPath)}"`;
  356. if (this.settings.sshStrict) {
  357. this.sshCommand += ' -o StrictHostKeyChecking=yes -o CheckHostIP=no';
  358. }
  359. this.sshCommand += ` -o "UserKnownHostsFile=$RUNNER_TEMP/${path.basename(this.sshKnownHostsPath)}"`;
  360. core.info(`Temporarily overriding GIT_SSH_COMMAND=${this.sshCommand}`);
  361. this.git.setEnvironmentVariable('GIT_SSH_COMMAND', this.sshCommand);
  362. // Configure core.sshCommand
  363. if (this.settings.persistCredentials) {
  364. yield this.git.config(SSH_COMMAND_KEY, this.sshCommand);
  365. }
  366. });
  367. }
  368. /**
  369. * Configures token-based authentication by creating a credentials config file
  370. * and setting up includeIf entries to reference it.
  371. * @param globalConfig Whether to configure global config instead of local
  372. */
  373. configureToken(globalConfig) {
  374. return __awaiter(this, void 0, void 0, function* () {
  375. // Get the credentials config file path in RUNNER_TEMP
  376. const credentialsConfigPath = this.getCredentialsConfigPath();
  377. // Write placeholder to the separate credentials config file using git config.
  378. // This approach avoids the credential being captured by process creation audit events,
  379. // which are commonly logged. For more information, refer to
  380. // https://docs.microsoft.com/en-us/windows-server/identity/ad-ds/manage/component-updates/command-line-process-auditing
  381. yield this.git.config(this.tokenConfigKey, this.tokenPlaceholderConfigValue, false, // globalConfig?
  382. false, // add?
  383. credentialsConfigPath);
  384. // Replace the placeholder in the credentials config file
  385. let content = (yield fs.promises.readFile(credentialsConfigPath)).toString();
  386. const placeholderIndex = content.indexOf(this.tokenPlaceholderConfigValue);
  387. if (placeholderIndex < 0 ||
  388. placeholderIndex != content.lastIndexOf(this.tokenPlaceholderConfigValue)) {
  389. throw new Error(`Unable to replace auth placeholder in ${credentialsConfigPath}`);
  390. }
  391. assert.ok(this.tokenConfigValue, 'tokenConfigValue is not defined');
  392. content = content.replace(this.tokenPlaceholderConfigValue, this.tokenConfigValue);
  393. yield fs.promises.writeFile(credentialsConfigPath, content);
  394. // Add include or includeIf to reference the credentials config
  395. if (globalConfig) {
  396. // Global config file is temporary
  397. yield this.git.config('include.path', credentialsConfigPath, true // globalConfig?
  398. );
  399. }
  400. else {
  401. // Host git directory
  402. let gitDir = path.join(this.git.getWorkingDirectory(), '.git');
  403. gitDir = gitDir.replace(/\\/g, '/'); // Use forward slashes, even on Windows
  404. // Configure host includeIf
  405. const hostIncludeKey = `includeIf.gitdir:${gitDir}.path`;
  406. yield this.git.config(hostIncludeKey, credentialsConfigPath);
  407. // Configure host includeIf for worktrees
  408. const hostWorktreeIncludeKey = `includeIf.gitdir:${gitDir}/worktrees/*.path`;
  409. yield this.git.config(hostWorktreeIncludeKey, credentialsConfigPath);
  410. // Container git directory
  411. const workingDirectory = this.git.getWorkingDirectory();
  412. const githubWorkspace = process.env['GITHUB_WORKSPACE'];
  413. assert.ok(githubWorkspace, 'GITHUB_WORKSPACE is not defined');
  414. let relativePath = path.relative(githubWorkspace, workingDirectory);
  415. relativePath = relativePath.replace(/\\/g, '/'); // Use forward slashes, even on Windows
  416. const containerGitDir = path.posix.join('/github/workspace', relativePath, '.git');
  417. // Container credentials config path
  418. const containerCredentialsPath = path.posix.join('/github/runner_temp', path.basename(credentialsConfigPath));
  419. // Configure container includeIf
  420. const containerIncludeKey = `includeIf.gitdir:${containerGitDir}.path`;
  421. yield this.git.config(containerIncludeKey, containerCredentialsPath);
  422. // Configure container includeIf for worktrees
  423. const containerWorktreeIncludeKey = `includeIf.gitdir:${containerGitDir}/worktrees/*.path`;
  424. yield this.git.config(containerWorktreeIncludeKey, containerCredentialsPath);
  425. }
  426. });
  427. }
  428. /**
  429. * Gets or creates the path to the credentials config file in RUNNER_TEMP.
  430. * @returns The absolute path to the credentials config file
  431. */
  432. getCredentialsConfigPath() {
  433. if (this.credentialsConfigPath) {
  434. return this.credentialsConfigPath;
  435. }
  436. const runnerTemp = process.env['RUNNER_TEMP'] || '';
  437. assert.ok(runnerTemp, 'RUNNER_TEMP is not defined');
  438. // Create a unique filename for this checkout instance
  439. const configFileName = `git-credentials-${(0, uuid_1.v4)()}.config`;
  440. this.credentialsConfigPath = path.join(runnerTemp, configFileName);
  441. core.debug(`Credentials config path: ${this.credentialsConfigPath}`);
  442. return this.credentialsConfigPath;
  443. }
  444. /**
  445. * Removes SSH authentication configuration by cleaning up SSH keys,
  446. * known hosts files, and SSH command configurations.
  447. */
  448. removeSsh() {
  449. return __awaiter(this, void 0, void 0, function* () {
  450. var _a, _b;
  451. // SSH key
  452. const keyPath = this.sshKeyPath || stateHelper.SshKeyPath;
  453. if (keyPath) {
  454. try {
  455. core.info(`Removing SSH key '${keyPath}'`);
  456. yield io.rmRF(keyPath);
  457. }
  458. catch (err) {
  459. core.debug(`${(_a = err === null || err === void 0 ? void 0 : err.message) !== null && _a !== void 0 ? _a : err}`);
  460. core.warning(`Failed to remove SSH key '${keyPath}'`);
  461. }
  462. }
  463. // SSH known hosts
  464. const knownHostsPath = this.sshKnownHostsPath || stateHelper.SshKnownHostsPath;
  465. if (knownHostsPath) {
  466. try {
  467. core.info(`Removing SSH known hosts '${knownHostsPath}'`);
  468. yield io.rmRF(knownHostsPath);
  469. }
  470. catch (err) {
  471. core.debug(`${(_b = err === null || err === void 0 ? void 0 : err.message) !== null && _b !== void 0 ? _b : err}`);
  472. core.warning(`Failed to remove SSH known hosts '${knownHostsPath}'`);
  473. }
  474. }
  475. // SSH command
  476. core.info('Removing SSH command configuration');
  477. yield this.removeGitConfig(SSH_COMMAND_KEY);
  478. yield this.removeSubmoduleGitConfig(SSH_COMMAND_KEY);
  479. });
  480. }
  481. /**
  482. * Removes token-based authentication by cleaning up HTTP headers,
  483. * includeIf entries, and credentials config files.
  484. */
  485. removeToken() {
  486. return __awaiter(this, void 0, void 0, function* () {
  487. var _a;
  488. // Remove HTTP extra header
  489. core.info('Removing HTTP extra header');
  490. yield this.removeGitConfig(this.tokenConfigKey);
  491. yield this.removeSubmoduleGitConfig(this.tokenConfigKey);
  492. // Collect credentials config paths that need to be removed
  493. const credentialsPaths = new Set();
  494. // Remove includeIf entries that point to git-credentials-*.config files
  495. core.info('Removing includeIf entries pointing to credentials config files');
  496. const mainCredentialsPaths = yield this.removeIncludeIfCredentials();
  497. mainCredentialsPaths.forEach(path => credentialsPaths.add(path));
  498. // Remove submodule includeIf entries that point to git-credentials-*.config files
  499. const submoduleConfigPaths = yield this.git.getSubmoduleConfigPaths(true);
  500. for (const configPath of submoduleConfigPaths) {
  501. const submoduleCredentialsPaths = yield this.removeIncludeIfCredentials(configPath);
  502. submoduleCredentialsPaths.forEach(path => credentialsPaths.add(path));
  503. }
  504. // Remove credentials config files
  505. for (const credentialsPath of credentialsPaths) {
  506. // Only remove credentials config files if they are under RUNNER_TEMP
  507. const runnerTemp = process.env['RUNNER_TEMP'];
  508. assert.ok(runnerTemp, 'RUNNER_TEMP is not defined');
  509. if (credentialsPath.startsWith(runnerTemp)) {
  510. try {
  511. core.info(`Removing credentials config '${credentialsPath}'`);
  512. yield io.rmRF(credentialsPath);
  513. }
  514. catch (err) {
  515. core.debug(`${(_a = err === null || err === void 0 ? void 0 : err.message) !== null && _a !== void 0 ? _a : err}`);
  516. core.warning(`Failed to remove credentials config '${credentialsPath}'`);
  517. }
  518. }
  519. else {
  520. core.debug(`Skipping removal of credentials config '${credentialsPath}' - not under RUNNER_TEMP`);
  521. }
  522. }
  523. });
  524. }
  525. /**
  526. * Removes a git config key from the local repository config.
  527. * @param configKey The git config key to remove
  528. */
  529. removeGitConfig(configKey) {
  530. return __awaiter(this, void 0, void 0, function* () {
  531. if ((yield this.git.configExists(configKey)) &&
  532. !(yield this.git.tryConfigUnset(configKey))) {
  533. // Load the config contents
  534. core.warning(`Failed to remove '${configKey}' from the git config`);
  535. }
  536. });
  537. }
  538. /**
  539. * Removes a git config key from all submodule configs.
  540. * @param configKey The git config key to remove
  541. */
  542. removeSubmoduleGitConfig(configKey) {
  543. return __awaiter(this, void 0, void 0, function* () {
  544. const pattern = regexpHelper.escape(configKey);
  545. yield this.git.submoduleForeach(
  546. // Wrap the pipeline in quotes to make sure it's handled properly by submoduleForeach, rather than just the first part of the pipeline.
  547. `sh -c "git config --local --name-only --get-regexp '${pattern}' && git config --local --unset-all '${configKey}' || :"`, true);
  548. });
  549. }
  550. /**
  551. * Removes includeIf entries that point to git-credentials-*.config files.
  552. * @param configPath Optional path to a specific git config file to operate on
  553. * @returns Array of unique credentials config file paths that were found and removed
  554. */
  555. removeIncludeIfCredentials(configPath) {
  556. return __awaiter(this, void 0, void 0, function* () {
  557. const credentialsPaths = new Set();
  558. try {
  559. // Get all includeIf.gitdir keys
  560. const keys = yield this.git.tryGetConfigKeys('^includeIf\\.gitdir:', false, // globalConfig?
  561. configPath);
  562. for (const key of keys) {
  563. // Get all values for this key
  564. const values = yield this.git.tryGetConfigValues(key, false, // globalConfig?
  565. configPath);
  566. if (values.length > 0) {
  567. // Remove only values that match git-credentials-<uuid>.config pattern
  568. for (const value of values) {
  569. if (this.testCredentialsConfigPath(value)) {
  570. credentialsPaths.add(value);
  571. yield this.git.tryConfigUnsetValue(key, value, false, configPath);
  572. }
  573. }
  574. }
  575. }
  576. }
  577. catch (err) {
  578. // Ignore errors - this is cleanup code
  579. if (configPath) {
  580. core.debug(`Error during includeIf cleanup for ${configPath}: ${err}`);
  581. }
  582. else {
  583. core.debug(`Error during includeIf cleanup: ${err}`);
  584. }
  585. }
  586. return Array.from(credentialsPaths);
  587. });
  588. }
  589. /**
  590. * Tests if a path matches the git-credentials-*.config pattern.
  591. * @param path The path to test
  592. * @returns True if the path matches the credentials config pattern
  593. */
  594. testCredentialsConfigPath(path) {
  595. return /git-credentials-[0-9a-f-]+\.config$/i.test(path);
  596. }
  597. }
  598. /***/ }),
  599. /***/ 738:
  600. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  601. "use strict";
  602. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  603. if (k2 === undefined) k2 = k;
  604. var desc = Object.getOwnPropertyDescriptor(m, k);
  605. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  606. desc = { enumerable: true, get: function() { return m[k]; } };
  607. }
  608. Object.defineProperty(o, k2, desc);
  609. }) : (function(o, m, k, k2) {
  610. if (k2 === undefined) k2 = k;
  611. o[k2] = m[k];
  612. }));
  613. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  614. Object.defineProperty(o, "default", { enumerable: true, value: v });
  615. }) : function(o, v) {
  616. o["default"] = v;
  617. });
  618. var __importStar = (this && this.__importStar) || function (mod) {
  619. if (mod && mod.__esModule) return mod;
  620. var result = {};
  621. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  622. __setModuleDefault(result, mod);
  623. return result;
  624. };
  625. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  626. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  627. return new (P || (P = Promise))(function (resolve, reject) {
  628. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  629. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  630. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  631. step((generator = generator.apply(thisArg, _arguments || [])).next());
  632. });
  633. };
  634. Object.defineProperty(exports, "__esModule", ({ value: true }));
  635. exports.MinimumGitSparseCheckoutVersion = exports.MinimumGitVersion = void 0;
  636. exports.createCommandManager = createCommandManager;
  637. const core = __importStar(__nccwpck_require__(2186));
  638. const exec = __importStar(__nccwpck_require__(1514));
  639. const fs = __importStar(__nccwpck_require__(7147));
  640. const fshelper = __importStar(__nccwpck_require__(7219));
  641. const io = __importStar(__nccwpck_require__(7436));
  642. const path = __importStar(__nccwpck_require__(1017));
  643. const refHelper = __importStar(__nccwpck_require__(8601));
  644. const regexpHelper = __importStar(__nccwpck_require__(3120));
  645. const retryHelper = __importStar(__nccwpck_require__(2155));
  646. const git_version_1 = __nccwpck_require__(3142);
  647. // Auth header not supported before 2.9
  648. // Wire protocol v2 not supported before 2.18
  649. // sparse-checkout not [well-]supported before 2.28 (see https://github.com/actions/checkout/issues/1386)
  650. exports.MinimumGitVersion = new git_version_1.GitVersion('2.18');
  651. exports.MinimumGitSparseCheckoutVersion = new git_version_1.GitVersion('2.28');
  652. function createCommandManager(workingDirectory, lfs, doSparseCheckout) {
  653. return __awaiter(this, void 0, void 0, function* () {
  654. return yield GitCommandManager.createCommandManager(workingDirectory, lfs, doSparseCheckout);
  655. });
  656. }
  657. class GitCommandManager {
  658. // Private constructor; use createCommandManager()
  659. constructor() {
  660. this.gitEnv = {
  661. GIT_TERMINAL_PROMPT: '0', // Disable git prompt
  662. GCM_INTERACTIVE: 'Never' // Disable prompting for git credential manager
  663. };
  664. this.gitPath = '';
  665. this.lfs = false;
  666. this.doSparseCheckout = false;
  667. this.workingDirectory = '';
  668. this.gitVersion = new git_version_1.GitVersion();
  669. }
  670. branchDelete(remote, branch) {
  671. return __awaiter(this, void 0, void 0, function* () {
  672. const args = ['branch', '--delete', '--force'];
  673. if (remote) {
  674. args.push('--remote');
  675. }
  676. args.push(branch);
  677. yield this.execGit(args);
  678. });
  679. }
  680. branchExists(remote, pattern) {
  681. return __awaiter(this, void 0, void 0, function* () {
  682. const args = ['branch', '--list'];
  683. if (remote) {
  684. args.push('--remote');
  685. }
  686. args.push(pattern);
  687. const output = yield this.execGit(args);
  688. return !!output.stdout.trim();
  689. });
  690. }
  691. branchList(remote) {
  692. return __awaiter(this, void 0, void 0, function* () {
  693. const result = [];
  694. // Note, this implementation uses "rev-parse --symbolic-full-name" because the output from
  695. // "branch --list" is more difficult when in a detached HEAD state.
  696. // TODO(https://github.com/actions/checkout/issues/786): this implementation uses
  697. // "rev-parse --symbolic-full-name" because there is a bug
  698. // in Git 2.18 that causes "rev-parse --symbolic" to output symbolic full names. When
  699. // 2.18 is no longer supported, we can switch back to --symbolic.
  700. const args = ['rev-parse', '--symbolic-full-name'];
  701. if (remote) {
  702. args.push('--remotes=origin');
  703. }
  704. else {
  705. args.push('--branches');
  706. }
  707. const stderr = [];
  708. const errline = [];
  709. const stdout = [];
  710. const stdline = [];
  711. const listeners = {
  712. stderr: (data) => {
  713. stderr.push(data.toString());
  714. },
  715. errline: (data) => {
  716. errline.push(data.toString());
  717. },
  718. stdout: (data) => {
  719. stdout.push(data.toString());
  720. },
  721. stdline: (data) => {
  722. stdline.push(data.toString());
  723. }
  724. };
  725. // Suppress the output in order to avoid flooding annotations with innocuous errors.
  726. yield this.execGit(args, false, true, listeners);
  727. core.debug(`stderr callback is: ${stderr}`);
  728. core.debug(`errline callback is: ${errline}`);
  729. core.debug(`stdout callback is: ${stdout}`);
  730. core.debug(`stdline callback is: ${stdline}`);
  731. for (let branch of stdline) {
  732. branch = branch.trim();
  733. if (!branch) {
  734. continue;
  735. }
  736. if (branch.startsWith('refs/heads/')) {
  737. branch = branch.substring('refs/heads/'.length);
  738. }
  739. else if (branch.startsWith('refs/remotes/')) {
  740. branch = branch.substring('refs/remotes/'.length);
  741. }
  742. result.push(branch);
  743. }
  744. return result;
  745. });
  746. }
  747. disableSparseCheckout() {
  748. return __awaiter(this, void 0, void 0, function* () {
  749. yield this.execGit(['sparse-checkout', 'disable']);
  750. // Disabling 'sparse-checkout` leaves behind an undesirable side-effect in config (even in a pristine environment).
  751. yield this.tryConfigUnset('extensions.worktreeConfig', false);
  752. });
  753. }
  754. sparseCheckout(sparseCheckout) {
  755. return __awaiter(this, void 0, void 0, function* () {
  756. yield this.execGit(['sparse-checkout', 'set', ...sparseCheckout]);
  757. });
  758. }
  759. sparseCheckoutNonConeMode(sparseCheckout) {
  760. return __awaiter(this, void 0, void 0, function* () {
  761. yield this.execGit(['config', 'core.sparseCheckout', 'true']);
  762. const output = yield this.execGit([
  763. 'rev-parse',
  764. '--git-path',
  765. 'info/sparse-checkout'
  766. ]);
  767. const sparseCheckoutPath = path.join(this.workingDirectory, output.stdout.trimRight());
  768. yield fs.promises.appendFile(sparseCheckoutPath, `\n${sparseCheckout.join('\n')}\n`);
  769. });
  770. }
  771. checkout(ref, startPoint) {
  772. return __awaiter(this, void 0, void 0, function* () {
  773. const args = ['checkout', '--progress', '--force'];
  774. if (startPoint) {
  775. args.push('-B', ref, startPoint);
  776. }
  777. else {
  778. args.push(ref);
  779. }
  780. yield this.execGit(args);
  781. });
  782. }
  783. checkoutDetach() {
  784. return __awaiter(this, void 0, void 0, function* () {
  785. const args = ['checkout', '--detach'];
  786. yield this.execGit(args);
  787. });
  788. }
  789. config(configKey, configValue, globalConfig, add, configFile) {
  790. return __awaiter(this, void 0, void 0, function* () {
  791. const args = ['config'];
  792. if (configFile) {
  793. args.push('--file', configFile);
  794. }
  795. else {
  796. args.push(globalConfig ? '--global' : '--local');
  797. }
  798. if (add) {
  799. args.push('--add');
  800. }
  801. args.push(...[configKey, configValue]);
  802. yield this.execGit(args);
  803. });
  804. }
  805. configExists(configKey, globalConfig) {
  806. return __awaiter(this, void 0, void 0, function* () {
  807. const pattern = regexpHelper.escape(configKey);
  808. const output = yield this.execGit([
  809. 'config',
  810. globalConfig ? '--global' : '--local',
  811. '--name-only',
  812. '--get-regexp',
  813. pattern
  814. ], true);
  815. return output.exitCode === 0;
  816. });
  817. }
  818. fetch(refSpec, options) {
  819. return __awaiter(this, void 0, void 0, function* () {
  820. const args = ['-c', 'protocol.version=2', 'fetch'];
  821. if (!refSpec.some(x => x === refHelper.tagsRefSpec) && !options.fetchTags) {
  822. args.push('--no-tags');
  823. }
  824. args.push('--prune', '--no-recurse-submodules');
  825. if (options.showProgress) {
  826. args.push('--progress');
  827. }
  828. if (options.filter) {
  829. args.push(`--filter=${options.filter}`);
  830. }
  831. if (options.fetchDepth && options.fetchDepth > 0) {
  832. args.push(`--depth=${options.fetchDepth}`);
  833. }
  834. else if (fshelper.fileExistsSync(path.join(this.workingDirectory, '.git', 'shallow'))) {
  835. args.push('--unshallow');
  836. }
  837. args.push('origin');
  838. for (const arg of refSpec) {
  839. args.push(arg);
  840. }
  841. const that = this;
  842. yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  843. yield that.execGit(args);
  844. }));
  845. });
  846. }
  847. getDefaultBranch(repositoryUrl) {
  848. return __awaiter(this, void 0, void 0, function* () {
  849. let output;
  850. yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  851. output = yield this.execGit([
  852. 'ls-remote',
  853. '--quiet',
  854. '--exit-code',
  855. '--symref',
  856. repositoryUrl,
  857. 'HEAD'
  858. ]);
  859. }));
  860. if (output) {
  861. // Satisfy compiler, will always be set
  862. for (let line of output.stdout.trim().split('\n')) {
  863. line = line.trim();
  864. if (line.startsWith('ref:') || line.endsWith('HEAD')) {
  865. return line
  866. .substr('ref:'.length, line.length - 'ref:'.length - 'HEAD'.length)
  867. .trim();
  868. }
  869. }
  870. }
  871. throw new Error('Unexpected output when retrieving default branch');
  872. });
  873. }
  874. getSubmoduleConfigPaths(recursive) {
  875. return __awaiter(this, void 0, void 0, function* () {
  876. // Get submodule config file paths.
  877. // Use `--show-origin` to get the config file path for each submodule.
  878. const output = yield this.submoduleForeach(`git config --local --show-origin --name-only --get-regexp remote.origin.url`, recursive);
  879. // Extract config file paths from the output (lines starting with "file:").
  880. const configPaths = output.match(/(?<=(^|\n)file:)[^\t]+(?=\tremote\.origin\.url)/g) || [];
  881. return configPaths;
  882. });
  883. }
  884. getWorkingDirectory() {
  885. return this.workingDirectory;
  886. }
  887. init() {
  888. return __awaiter(this, void 0, void 0, function* () {
  889. yield this.execGit(['init', this.workingDirectory]);
  890. });
  891. }
  892. isDetached() {
  893. return __awaiter(this, void 0, void 0, function* () {
  894. // Note, "branch --show-current" would be simpler but isn't available until Git 2.22
  895. const output = yield this.execGit(['rev-parse', '--symbolic-full-name', '--verify', '--quiet', 'HEAD'], true);
  896. return !output.stdout.trim().startsWith('refs/heads/');
  897. });
  898. }
  899. lfsFetch(ref) {
  900. return __awaiter(this, void 0, void 0, function* () {
  901. const args = ['lfs', 'fetch', 'origin', ref];
  902. const that = this;
  903. yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  904. yield that.execGit(args);
  905. }));
  906. });
  907. }
  908. lfsInstall() {
  909. return __awaiter(this, void 0, void 0, function* () {
  910. yield this.execGit(['lfs', 'install', '--local']);
  911. });
  912. }
  913. log1(format) {
  914. return __awaiter(this, void 0, void 0, function* () {
  915. const args = format ? ['log', '-1', format] : ['log', '-1'];
  916. const silent = format ? false : true;
  917. const output = yield this.execGit(args, false, silent);
  918. return output.stdout;
  919. });
  920. }
  921. remoteAdd(remoteName, remoteUrl) {
  922. return __awaiter(this, void 0, void 0, function* () {
  923. yield this.execGit(['remote', 'add', remoteName, remoteUrl]);
  924. });
  925. }
  926. removeEnvironmentVariable(name) {
  927. delete this.gitEnv[name];
  928. }
  929. /**
  930. * Resolves a ref to a SHA. For a branch or lightweight tag, the commit SHA is returned.
  931. * For an annotated tag, the tag SHA is returned.
  932. * @param {string} ref For example: 'refs/heads/main' or '/refs/tags/v1'
  933. * @returns {Promise<string>}
  934. */
  935. revParse(ref) {
  936. return __awaiter(this, void 0, void 0, function* () {
  937. const output = yield this.execGit(['rev-parse', ref]);
  938. return output.stdout.trim();
  939. });
  940. }
  941. setEnvironmentVariable(name, value) {
  942. this.gitEnv[name] = value;
  943. }
  944. shaExists(sha) {
  945. return __awaiter(this, void 0, void 0, function* () {
  946. const args = ['rev-parse', '--verify', '--quiet', `${sha}^{object}`];
  947. const output = yield this.execGit(args, true);
  948. return output.exitCode === 0;
  949. });
  950. }
  951. submoduleForeach(command, recursive) {
  952. return __awaiter(this, void 0, void 0, function* () {
  953. const args = ['submodule', 'foreach'];
  954. if (recursive) {
  955. args.push('--recursive');
  956. }
  957. args.push(command);
  958. const output = yield this.execGit(args);
  959. return output.stdout;
  960. });
  961. }
  962. submoduleSync(recursive) {
  963. return __awaiter(this, void 0, void 0, function* () {
  964. const args = ['submodule', 'sync'];
  965. if (recursive) {
  966. args.push('--recursive');
  967. }
  968. yield this.execGit(args);
  969. });
  970. }
  971. submoduleUpdate(fetchDepth, recursive) {
  972. return __awaiter(this, void 0, void 0, function* () {
  973. const args = ['-c', 'protocol.version=2'];
  974. args.push('submodule', 'update', '--init', '--force');
  975. if (fetchDepth > 0) {
  976. args.push(`--depth=${fetchDepth}`);
  977. }
  978. if (recursive) {
  979. args.push('--recursive');
  980. }
  981. yield this.execGit(args);
  982. });
  983. }
  984. submoduleStatus() {
  985. return __awaiter(this, void 0, void 0, function* () {
  986. const output = yield this.execGit(['submodule', 'status'], true);
  987. core.debug(output.stdout);
  988. return output.exitCode === 0;
  989. });
  990. }
  991. tagExists(pattern) {
  992. return __awaiter(this, void 0, void 0, function* () {
  993. const output = yield this.execGit(['tag', '--list', pattern]);
  994. return !!output.stdout.trim();
  995. });
  996. }
  997. tryClean() {
  998. return __awaiter(this, void 0, void 0, function* () {
  999. const output = yield this.execGit(['clean', '-ffdx'], true);
  1000. return output.exitCode === 0;
  1001. });
  1002. }
  1003. tryConfigUnset(configKey, globalConfig) {
  1004. return __awaiter(this, void 0, void 0, function* () {
  1005. const output = yield this.execGit([
  1006. 'config',
  1007. globalConfig ? '--global' : '--local',
  1008. '--unset-all',
  1009. configKey
  1010. ], true);
  1011. return output.exitCode === 0;
  1012. });
  1013. }
  1014. tryConfigUnsetValue(configKey, configValue, globalConfig, configFile) {
  1015. return __awaiter(this, void 0, void 0, function* () {
  1016. const args = ['config'];
  1017. if (configFile) {
  1018. args.push('--file', configFile);
  1019. }
  1020. else {
  1021. args.push(globalConfig ? '--global' : '--local');
  1022. }
  1023. args.push('--unset', configKey, configValue);
  1024. const output = yield this.execGit(args, true);
  1025. return output.exitCode === 0;
  1026. });
  1027. }
  1028. tryDisableAutomaticGarbageCollection() {
  1029. return __awaiter(this, void 0, void 0, function* () {
  1030. const output = yield this.execGit(['config', '--local', 'gc.auto', '0'], true);
  1031. return output.exitCode === 0;
  1032. });
  1033. }
  1034. tryGetFetchUrl() {
  1035. return __awaiter(this, void 0, void 0, function* () {
  1036. const output = yield this.execGit(['config', '--local', '--get', 'remote.origin.url'], true);
  1037. if (output.exitCode !== 0) {
  1038. return '';
  1039. }
  1040. const stdout = output.stdout.trim();
  1041. if (stdout.includes('\n')) {
  1042. return '';
  1043. }
  1044. return stdout;
  1045. });
  1046. }
  1047. tryGetConfigValues(configKey, globalConfig, configFile) {
  1048. return __awaiter(this, void 0, void 0, function* () {
  1049. const args = ['config'];
  1050. if (configFile) {
  1051. args.push('--file', configFile);
  1052. }
  1053. else {
  1054. args.push(globalConfig ? '--global' : '--local');
  1055. }
  1056. args.push('--get-all', configKey);
  1057. const output = yield this.execGit(args, true);
  1058. if (output.exitCode !== 0) {
  1059. return [];
  1060. }
  1061. return output.stdout
  1062. .trim()
  1063. .split('\n')
  1064. .filter(value => value.trim());
  1065. });
  1066. }
  1067. tryGetConfigKeys(pattern, globalConfig, configFile) {
  1068. return __awaiter(this, void 0, void 0, function* () {
  1069. const args = ['config'];
  1070. if (configFile) {
  1071. args.push('--file', configFile);
  1072. }
  1073. else {
  1074. args.push(globalConfig ? '--global' : '--local');
  1075. }
  1076. args.push('--name-only', '--get-regexp', pattern);
  1077. const output = yield this.execGit(args, true);
  1078. if (output.exitCode !== 0) {
  1079. return [];
  1080. }
  1081. return output.stdout
  1082. .trim()
  1083. .split('\n')
  1084. .filter(key => key.trim());
  1085. });
  1086. }
  1087. tryReset() {
  1088. return __awaiter(this, void 0, void 0, function* () {
  1089. const output = yield this.execGit(['reset', '--hard', 'HEAD'], true);
  1090. return output.exitCode === 0;
  1091. });
  1092. }
  1093. version() {
  1094. return __awaiter(this, void 0, void 0, function* () {
  1095. return this.gitVersion;
  1096. });
  1097. }
  1098. static createCommandManager(workingDirectory, lfs, doSparseCheckout) {
  1099. return __awaiter(this, void 0, void 0, function* () {
  1100. const result = new GitCommandManager();
  1101. yield result.initializeCommandManager(workingDirectory, lfs, doSparseCheckout);
  1102. return result;
  1103. });
  1104. }
  1105. execGit(args_1) {
  1106. return __awaiter(this, arguments, void 0, function* (args, allowAllExitCodes = false, silent = false, customListeners = {}) {
  1107. fshelper.directoryExistsSync(this.workingDirectory, true);
  1108. const result = new GitOutput();
  1109. const env = {};
  1110. for (const key of Object.keys(process.env)) {
  1111. env[key] = process.env[key];
  1112. }
  1113. for (const key of Object.keys(this.gitEnv)) {
  1114. env[key] = this.gitEnv[key];
  1115. }
  1116. const defaultListener = {
  1117. stdout: (data) => {
  1118. stdout.push(data.toString());
  1119. }
  1120. };
  1121. const mergedListeners = Object.assign(Object.assign({}, defaultListener), customListeners);
  1122. const stdout = [];
  1123. const options = {
  1124. cwd: this.workingDirectory,
  1125. env,
  1126. silent,
  1127. ignoreReturnCode: allowAllExitCodes,
  1128. listeners: mergedListeners
  1129. };
  1130. result.exitCode = yield exec.exec(`"${this.gitPath}"`, args, options);
  1131. result.stdout = stdout.join('');
  1132. core.debug(result.exitCode.toString());
  1133. core.debug(result.stdout);
  1134. return result;
  1135. });
  1136. }
  1137. initializeCommandManager(workingDirectory, lfs, doSparseCheckout) {
  1138. return __awaiter(this, void 0, void 0, function* () {
  1139. this.workingDirectory = workingDirectory;
  1140. // Git-lfs will try to pull down assets if any of the local/user/system setting exist.
  1141. // If the user didn't enable `LFS` in their pipeline definition, disable LFS fetch/checkout.
  1142. this.lfs = lfs;
  1143. if (!this.lfs) {
  1144. this.gitEnv['GIT_LFS_SKIP_SMUDGE'] = '1';
  1145. }
  1146. this.gitPath = yield io.which('git', true);
  1147. // Git version
  1148. core.debug('Getting git version');
  1149. this.gitVersion = new git_version_1.GitVersion();
  1150. let gitOutput = yield this.execGit(['version']);
  1151. let stdout = gitOutput.stdout.trim();
  1152. if (!stdout.includes('\n')) {
  1153. const match = stdout.match(/\d+\.\d+(\.\d+)?/);
  1154. if (match) {
  1155. this.gitVersion = new git_version_1.GitVersion(match[0]);
  1156. }
  1157. }
  1158. if (!this.gitVersion.isValid()) {
  1159. throw new Error('Unable to determine git version');
  1160. }
  1161. // Minimum git version
  1162. if (!this.gitVersion.checkMinimum(exports.MinimumGitVersion)) {
  1163. throw new Error(`Minimum required git version is ${exports.MinimumGitVersion}. Your git ('${this.gitPath}') is ${this.gitVersion}`);
  1164. }
  1165. if (this.lfs) {
  1166. // Git-lfs version
  1167. core.debug('Getting git-lfs version');
  1168. let gitLfsVersion = new git_version_1.GitVersion();
  1169. const gitLfsPath = yield io.which('git-lfs', true);
  1170. gitOutput = yield this.execGit(['lfs', 'version']);
  1171. stdout = gitOutput.stdout.trim();
  1172. if (!stdout.includes('\n')) {
  1173. const match = stdout.match(/\d+\.\d+(\.\d+)?/);
  1174. if (match) {
  1175. gitLfsVersion = new git_version_1.GitVersion(match[0]);
  1176. }
  1177. }
  1178. if (!gitLfsVersion.isValid()) {
  1179. throw new Error('Unable to determine git-lfs version');
  1180. }
  1181. // Minimum git-lfs version
  1182. // Note:
  1183. // - Auth header not supported before 2.1
  1184. const minimumGitLfsVersion = new git_version_1.GitVersion('2.1');
  1185. if (!gitLfsVersion.checkMinimum(minimumGitLfsVersion)) {
  1186. throw new Error(`Minimum required git-lfs version is ${minimumGitLfsVersion}. Your git-lfs ('${gitLfsPath}') is ${gitLfsVersion}`);
  1187. }
  1188. }
  1189. this.doSparseCheckout = doSparseCheckout;
  1190. if (this.doSparseCheckout) {
  1191. if (!this.gitVersion.checkMinimum(exports.MinimumGitSparseCheckoutVersion)) {
  1192. throw new Error(`Minimum Git version required for sparse checkout is ${exports.MinimumGitSparseCheckoutVersion}. Your git ('${this.gitPath}') is ${this.gitVersion}`);
  1193. }
  1194. }
  1195. // Set the user agent
  1196. let gitHttpUserAgent = `git/${this.gitVersion} (github-actions-checkout)`;
  1197. // Append orchestration ID if set
  1198. const orchId = process.env['ACTIONS_ORCHESTRATION_ID'];
  1199. if (orchId) {
  1200. // Sanitize the orchestration ID to ensure it contains only valid characters
  1201. // Valid characters: 0-9, a-z, _, -, .
  1202. const sanitizedId = orchId.replace(/[^a-z0-9_.-]/gi, '_');
  1203. if (sanitizedId) {
  1204. gitHttpUserAgent = `${gitHttpUserAgent} actions_orchestration_id/${sanitizedId}`;
  1205. }
  1206. }
  1207. core.debug(`Set git useragent to: ${gitHttpUserAgent}`);
  1208. this.gitEnv['GIT_HTTP_USER_AGENT'] = gitHttpUserAgent;
  1209. });
  1210. }
  1211. }
  1212. class GitOutput {
  1213. constructor() {
  1214. this.stdout = '';
  1215. this.exitCode = 0;
  1216. }
  1217. }
  1218. /***/ }),
  1219. /***/ 8609:
  1220. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  1221. "use strict";
  1222. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  1223. if (k2 === undefined) k2 = k;
  1224. var desc = Object.getOwnPropertyDescriptor(m, k);
  1225. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  1226. desc = { enumerable: true, get: function() { return m[k]; } };
  1227. }
  1228. Object.defineProperty(o, k2, desc);
  1229. }) : (function(o, m, k, k2) {
  1230. if (k2 === undefined) k2 = k;
  1231. o[k2] = m[k];
  1232. }));
  1233. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  1234. Object.defineProperty(o, "default", { enumerable: true, value: v });
  1235. }) : function(o, v) {
  1236. o["default"] = v;
  1237. });
  1238. var __importStar = (this && this.__importStar) || function (mod) {
  1239. if (mod && mod.__esModule) return mod;
  1240. var result = {};
  1241. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  1242. __setModuleDefault(result, mod);
  1243. return result;
  1244. };
  1245. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  1246. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  1247. return new (P || (P = Promise))(function (resolve, reject) {
  1248. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  1249. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  1250. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  1251. step((generator = generator.apply(thisArg, _arguments || [])).next());
  1252. });
  1253. };
  1254. Object.defineProperty(exports, "__esModule", ({ value: true }));
  1255. exports.prepareExistingDirectory = prepareExistingDirectory;
  1256. const assert = __importStar(__nccwpck_require__(9491));
  1257. const core = __importStar(__nccwpck_require__(2186));
  1258. const fs = __importStar(__nccwpck_require__(7147));
  1259. const fsHelper = __importStar(__nccwpck_require__(7219));
  1260. const io = __importStar(__nccwpck_require__(7436));
  1261. const path = __importStar(__nccwpck_require__(1017));
  1262. function prepareExistingDirectory(git, repositoryPath, repositoryUrl, clean, ref) {
  1263. return __awaiter(this, void 0, void 0, function* () {
  1264. var _a;
  1265. assert.ok(repositoryPath, 'Expected repositoryPath to be defined');
  1266. assert.ok(repositoryUrl, 'Expected repositoryUrl to be defined');
  1267. // Indicates whether to delete the directory contents
  1268. let remove = false;
  1269. // Check whether using git or REST API
  1270. if (!git) {
  1271. remove = true;
  1272. }
  1273. // Fetch URL does not match
  1274. else if (!fsHelper.directoryExistsSync(path.join(repositoryPath, '.git')) ||
  1275. repositoryUrl !== (yield git.tryGetFetchUrl())) {
  1276. remove = true;
  1277. }
  1278. else {
  1279. // Delete any index.lock and shallow.lock left by a previously canceled run or crashed git process
  1280. const lockPaths = [
  1281. path.join(repositoryPath, '.git', 'index.lock'),
  1282. path.join(repositoryPath, '.git', 'shallow.lock')
  1283. ];
  1284. for (const lockPath of lockPaths) {
  1285. try {
  1286. yield io.rmRF(lockPath);
  1287. }
  1288. catch (error) {
  1289. core.debug(`Unable to delete '${lockPath}'. ${(_a = error === null || error === void 0 ? void 0 : error.message) !== null && _a !== void 0 ? _a : error}`);
  1290. }
  1291. }
  1292. try {
  1293. core.startGroup('Removing previously created refs, to avoid conflicts');
  1294. // Checkout detached HEAD
  1295. if (!(yield git.isDetached())) {
  1296. yield git.checkoutDetach();
  1297. }
  1298. // Remove all refs/heads/*
  1299. let branches = yield git.branchList(false);
  1300. for (const branch of branches) {
  1301. yield git.branchDelete(false, branch);
  1302. }
  1303. // Remove any conflicting refs/remotes/origin/*
  1304. // Example 1: Consider ref is refs/heads/foo and previously fetched refs/remotes/origin/foo/bar
  1305. // Example 2: Consider ref is refs/heads/foo/bar and previously fetched refs/remotes/origin/foo
  1306. if (ref) {
  1307. ref = ref.startsWith('refs/') ? ref : `refs/heads/${ref}`;
  1308. if (ref.startsWith('refs/heads/')) {
  1309. const upperName1 = ref.toUpperCase().substr('REFS/HEADS/'.length);
  1310. const upperName1Slash = `${upperName1}/`;
  1311. branches = yield git.branchList(true);
  1312. for (const branch of branches) {
  1313. const upperName2 = branch.substr('origin/'.length).toUpperCase();
  1314. const upperName2Slash = `${upperName2}/`;
  1315. if (upperName1.startsWith(upperName2Slash) ||
  1316. upperName2.startsWith(upperName1Slash)) {
  1317. yield git.branchDelete(true, branch);
  1318. }
  1319. }
  1320. }
  1321. }
  1322. core.endGroup();
  1323. // Check for submodules and delete any existing files if submodules are present
  1324. if (!(yield git.submoduleStatus())) {
  1325. remove = true;
  1326. core.info('Bad Submodules found, removing existing files');
  1327. }
  1328. // Clean
  1329. if (clean) {
  1330. core.startGroup('Cleaning the repository');
  1331. if (!(yield git.tryClean())) {
  1332. 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}'.`);
  1333. remove = true;
  1334. }
  1335. else if (!(yield git.tryReset())) {
  1336. remove = true;
  1337. }
  1338. core.endGroup();
  1339. if (remove) {
  1340. core.warning(`Unable to clean or reset the repository. The repository will be recreated instead.`);
  1341. }
  1342. }
  1343. }
  1344. catch (error) {
  1345. core.warning(`Unable to prepare the existing repository. The repository will be recreated instead.`);
  1346. remove = true;
  1347. }
  1348. }
  1349. if (remove) {
  1350. // Delete the contents of the directory. Don't delete the directory itself
  1351. // since it might be the current working directory.
  1352. core.info(`Deleting the contents of '${repositoryPath}'`);
  1353. for (const file of yield fs.promises.readdir(repositoryPath)) {
  1354. yield io.rmRF(path.join(repositoryPath, file));
  1355. }
  1356. }
  1357. });
  1358. }
  1359. /***/ }),
  1360. /***/ 9210:
  1361. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  1362. "use strict";
  1363. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  1364. if (k2 === undefined) k2 = k;
  1365. var desc = Object.getOwnPropertyDescriptor(m, k);
  1366. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  1367. desc = { enumerable: true, get: function() { return m[k]; } };
  1368. }
  1369. Object.defineProperty(o, k2, desc);
  1370. }) : (function(o, m, k, k2) {
  1371. if (k2 === undefined) k2 = k;
  1372. o[k2] = m[k];
  1373. }));
  1374. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  1375. Object.defineProperty(o, "default", { enumerable: true, value: v });
  1376. }) : function(o, v) {
  1377. o["default"] = v;
  1378. });
  1379. var __importStar = (this && this.__importStar) || function (mod) {
  1380. if (mod && mod.__esModule) return mod;
  1381. var result = {};
  1382. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  1383. __setModuleDefault(result, mod);
  1384. return result;
  1385. };
  1386. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  1387. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  1388. return new (P || (P = Promise))(function (resolve, reject) {
  1389. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  1390. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  1391. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  1392. step((generator = generator.apply(thisArg, _arguments || [])).next());
  1393. });
  1394. };
  1395. Object.defineProperty(exports, "__esModule", ({ value: true }));
  1396. exports.getSource = getSource;
  1397. exports.cleanup = cleanup;
  1398. const core = __importStar(__nccwpck_require__(2186));
  1399. const fsHelper = __importStar(__nccwpck_require__(7219));
  1400. const gitAuthHelper = __importStar(__nccwpck_require__(2565));
  1401. const gitCommandManager = __importStar(__nccwpck_require__(738));
  1402. const gitDirectoryHelper = __importStar(__nccwpck_require__(8609));
  1403. const githubApiHelper = __importStar(__nccwpck_require__(138));
  1404. const io = __importStar(__nccwpck_require__(7436));
  1405. const path = __importStar(__nccwpck_require__(1017));
  1406. const refHelper = __importStar(__nccwpck_require__(8601));
  1407. const stateHelper = __importStar(__nccwpck_require__(4866));
  1408. const urlHelper = __importStar(__nccwpck_require__(9437));
  1409. const git_command_manager_1 = __nccwpck_require__(738);
  1410. function getSource(settings) {
  1411. return __awaiter(this, void 0, void 0, function* () {
  1412. // Repository URL
  1413. core.info(`Syncing repository: ${settings.repositoryOwner}/${settings.repositoryName}`);
  1414. const repositoryUrl = urlHelper.getFetchUrl(settings);
  1415. // Remove conflicting file path
  1416. if (fsHelper.fileExistsSync(settings.repositoryPath)) {
  1417. yield io.rmRF(settings.repositoryPath);
  1418. }
  1419. // Create directory
  1420. let isExisting = true;
  1421. if (!fsHelper.directoryExistsSync(settings.repositoryPath)) {
  1422. isExisting = false;
  1423. yield io.mkdirP(settings.repositoryPath);
  1424. }
  1425. // Git command manager
  1426. core.startGroup('Getting Git version info');
  1427. const git = yield getGitCommandManager(settings);
  1428. core.endGroup();
  1429. let authHelper = null;
  1430. try {
  1431. if (git) {
  1432. authHelper = gitAuthHelper.createAuthHelper(git, settings);
  1433. if (settings.setSafeDirectory) {
  1434. // 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
  1435. // Otherwise all git commands we run in a container fail
  1436. yield authHelper.configureTempGlobalConfig();
  1437. core.info(`Adding repository directory to the temporary git global config as a safe directory`);
  1438. yield git
  1439. .config('safe.directory', settings.repositoryPath, true, true)
  1440. .catch(error => {
  1441. core.info(`Failed to initialize safe directory with error: ${error}`);
  1442. });
  1443. stateHelper.setSafeDirectory();
  1444. }
  1445. }
  1446. // Prepare existing directory, otherwise recreate
  1447. if (isExisting) {
  1448. yield gitDirectoryHelper.prepareExistingDirectory(git, settings.repositoryPath, repositoryUrl, settings.clean, settings.ref);
  1449. }
  1450. if (!git) {
  1451. // Downloading using REST API
  1452. core.info(`The repository will be downloaded using the GitHub REST API`);
  1453. core.info(`To create a local Git repository instead, add Git ${gitCommandManager.MinimumGitVersion} or higher to the PATH`);
  1454. if (settings.submodules) {
  1455. 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.`);
  1456. }
  1457. else if (settings.sshKey) {
  1458. 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.`);
  1459. }
  1460. yield githubApiHelper.downloadRepository(settings.authToken, settings.repositoryOwner, settings.repositoryName, settings.ref, settings.commit, settings.repositoryPath, settings.githubServerUrl);
  1461. return;
  1462. }
  1463. // Save state for POST action
  1464. stateHelper.setRepositoryPath(settings.repositoryPath);
  1465. // Initialize the repository
  1466. if (!fsHelper.directoryExistsSync(path.join(settings.repositoryPath, '.git'))) {
  1467. core.startGroup('Initializing the repository');
  1468. yield git.init();
  1469. yield git.remoteAdd('origin', repositoryUrl);
  1470. core.endGroup();
  1471. }
  1472. // Disable automatic garbage collection
  1473. core.startGroup('Disabling automatic garbage collection');
  1474. if (!(yield git.tryDisableAutomaticGarbageCollection())) {
  1475. core.warning(`Unable to turn off git automatic garbage collection. The git fetch operation may trigger garbage collection and cause a delay.`);
  1476. }
  1477. core.endGroup();
  1478. // If we didn't initialize it above, do it now
  1479. if (!authHelper) {
  1480. authHelper = gitAuthHelper.createAuthHelper(git, settings);
  1481. }
  1482. // Configure auth
  1483. core.startGroup('Setting up auth');
  1484. yield authHelper.configureAuth();
  1485. core.endGroup();
  1486. // Determine the default branch
  1487. if (!settings.ref && !settings.commit) {
  1488. core.startGroup('Determining the default branch');
  1489. if (settings.sshKey) {
  1490. settings.ref = yield git.getDefaultBranch(repositoryUrl);
  1491. }
  1492. else {
  1493. settings.ref = yield githubApiHelper.getDefaultBranch(settings.authToken, settings.repositoryOwner, settings.repositoryName, settings.githubServerUrl);
  1494. }
  1495. core.endGroup();
  1496. }
  1497. // LFS install
  1498. if (settings.lfs) {
  1499. yield git.lfsInstall();
  1500. }
  1501. // Fetch
  1502. core.startGroup('Fetching the repository');
  1503. const fetchOptions = {};
  1504. if (settings.filter) {
  1505. fetchOptions.filter = settings.filter;
  1506. }
  1507. else if (settings.sparseCheckout) {
  1508. fetchOptions.filter = 'blob:none';
  1509. }
  1510. if (settings.fetchDepth <= 0) {
  1511. // Fetch all branches and tags
  1512. let refSpec = refHelper.getRefSpecForAllHistory(settings.ref, settings.commit);
  1513. yield git.fetch(refSpec, fetchOptions);
  1514. // When all history is fetched, the ref we're interested in may have moved to a different
  1515. // commit (push or force push). If so, fetch again with a targeted refspec.
  1516. if (!(yield refHelper.testRef(git, settings.ref, settings.commit))) {
  1517. refSpec = refHelper.getRefSpec(settings.ref, settings.commit);
  1518. yield git.fetch(refSpec, fetchOptions);
  1519. }
  1520. }
  1521. else {
  1522. fetchOptions.fetchDepth = settings.fetchDepth;
  1523. fetchOptions.fetchTags = settings.fetchTags;
  1524. const refSpec = refHelper.getRefSpec(settings.ref, settings.commit);
  1525. yield git.fetch(refSpec, fetchOptions);
  1526. }
  1527. core.endGroup();
  1528. // Checkout info
  1529. core.startGroup('Determining the checkout info');
  1530. const checkoutInfo = yield refHelper.getCheckoutInfo(git, settings.ref, settings.commit);
  1531. core.endGroup();
  1532. // LFS fetch
  1533. // Explicit lfs-fetch to avoid slow checkout (fetches one lfs object at a time).
  1534. // Explicit lfs fetch will fetch lfs objects in parallel.
  1535. // For sparse checkouts, let `checkout` fetch the needed objects lazily.
  1536. if (settings.lfs && !settings.sparseCheckout) {
  1537. core.startGroup('Fetching LFS objects');
  1538. yield git.lfsFetch(checkoutInfo.startPoint || checkoutInfo.ref);
  1539. core.endGroup();
  1540. }
  1541. // Sparse checkout
  1542. if (!settings.sparseCheckout) {
  1543. let gitVersion = yield git.version();
  1544. // no need to disable sparse-checkout if the installed git runtime doesn't even support it.
  1545. if (gitVersion.checkMinimum(git_command_manager_1.MinimumGitSparseCheckoutVersion)) {
  1546. yield git.disableSparseCheckout();
  1547. }
  1548. }
  1549. else {
  1550. core.startGroup('Setting up sparse checkout');
  1551. if (settings.sparseCheckoutConeMode) {
  1552. yield git.sparseCheckout(settings.sparseCheckout);
  1553. }
  1554. else {
  1555. yield git.sparseCheckoutNonConeMode(settings.sparseCheckout);
  1556. }
  1557. core.endGroup();
  1558. }
  1559. // Checkout
  1560. core.startGroup('Checking out the ref');
  1561. yield git.checkout(checkoutInfo.ref, checkoutInfo.startPoint);
  1562. core.endGroup();
  1563. // Submodules
  1564. if (settings.submodules) {
  1565. // Temporarily override global config
  1566. core.startGroup('Setting up auth for fetching submodules');
  1567. yield authHelper.configureGlobalAuth();
  1568. core.endGroup();
  1569. // Checkout submodules
  1570. core.startGroup('Fetching submodules');
  1571. yield git.submoduleSync(settings.nestedSubmodules);
  1572. yield git.submoduleUpdate(settings.fetchDepth, settings.nestedSubmodules);
  1573. yield git.submoduleForeach('git config --local gc.auto 0', settings.nestedSubmodules);
  1574. core.endGroup();
  1575. // Persist credentials
  1576. if (settings.persistCredentials) {
  1577. core.startGroup('Persisting credentials for submodules');
  1578. yield authHelper.configureSubmoduleAuth();
  1579. core.endGroup();
  1580. }
  1581. }
  1582. // Get commit information
  1583. const commitInfo = yield git.log1();
  1584. // Log commit sha
  1585. const commitSHA = yield git.log1('--format=%H');
  1586. core.setOutput('commit', commitSHA.trim());
  1587. // Check for incorrect pull request merge commit
  1588. yield refHelper.checkCommitInfo(settings.authToken, commitInfo, settings.repositoryOwner, settings.repositoryName, settings.ref, settings.commit, settings.githubServerUrl);
  1589. }
  1590. finally {
  1591. // Remove auth
  1592. if (authHelper) {
  1593. if (!settings.persistCredentials) {
  1594. core.startGroup('Removing auth');
  1595. yield authHelper.removeAuth();
  1596. core.endGroup();
  1597. }
  1598. authHelper.removeGlobalConfig();
  1599. }
  1600. }
  1601. });
  1602. }
  1603. function cleanup(repositoryPath) {
  1604. return __awaiter(this, void 0, void 0, function* () {
  1605. // Repo exists?
  1606. if (!repositoryPath ||
  1607. !fsHelper.fileExistsSync(path.join(repositoryPath, '.git', 'config'))) {
  1608. return;
  1609. }
  1610. let git;
  1611. try {
  1612. git = yield gitCommandManager.createCommandManager(repositoryPath, false, false);
  1613. }
  1614. catch (_a) {
  1615. return;
  1616. }
  1617. // Remove auth
  1618. const authHelper = gitAuthHelper.createAuthHelper(git);
  1619. try {
  1620. if (stateHelper.PostSetSafeDirectory) {
  1621. // 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
  1622. // Otherwise all git commands we run in a container fail
  1623. yield authHelper.configureTempGlobalConfig();
  1624. core.info(`Adding repository directory to the temporary git global config as a safe directory`);
  1625. yield git
  1626. .config('safe.directory', repositoryPath, true, true)
  1627. .catch(error => {
  1628. core.info(`Failed to initialize safe directory with error: ${error}`);
  1629. });
  1630. }
  1631. yield authHelper.removeAuth();
  1632. }
  1633. finally {
  1634. yield authHelper.removeGlobalConfig();
  1635. }
  1636. });
  1637. }
  1638. function getGitCommandManager(settings) {
  1639. return __awaiter(this, void 0, void 0, function* () {
  1640. core.info(`Working directory is '${settings.repositoryPath}'`);
  1641. try {
  1642. return yield gitCommandManager.createCommandManager(settings.repositoryPath, settings.lfs, settings.sparseCheckout != null);
  1643. }
  1644. catch (err) {
  1645. // Git is required for LFS
  1646. if (settings.lfs) {
  1647. throw err;
  1648. }
  1649. // Otherwise fallback to REST API
  1650. return undefined;
  1651. }
  1652. });
  1653. }
  1654. /***/ }),
  1655. /***/ 3142:
  1656. /***/ ((__unused_webpack_module, exports) => {
  1657. "use strict";
  1658. Object.defineProperty(exports, "__esModule", ({ value: true }));
  1659. exports.GitVersion = void 0;
  1660. class GitVersion {
  1661. /**
  1662. * Used for comparing the version of git and git-lfs against the minimum required version
  1663. * @param version the version string, e.g. 1.2 or 1.2.3
  1664. */
  1665. constructor(version) {
  1666. this.major = NaN;
  1667. this.minor = NaN;
  1668. this.patch = NaN;
  1669. if (version) {
  1670. const match = version.match(/^(\d+)\.(\d+)(\.(\d+))?$/);
  1671. if (match) {
  1672. this.major = Number(match[1]);
  1673. this.minor = Number(match[2]);
  1674. if (match[4]) {
  1675. this.patch = Number(match[4]);
  1676. }
  1677. }
  1678. }
  1679. }
  1680. /**
  1681. * Compares the instance against a minimum required version
  1682. * @param minimum Minimum version
  1683. */
  1684. checkMinimum(minimum) {
  1685. if (!minimum.isValid()) {
  1686. throw new Error('Arg minimum is not a valid version');
  1687. }
  1688. // Major is insufficient
  1689. if (this.major < minimum.major) {
  1690. return false;
  1691. }
  1692. // Major is equal
  1693. if (this.major === minimum.major) {
  1694. // Minor is insufficient
  1695. if (this.minor < minimum.minor) {
  1696. return false;
  1697. }
  1698. // Minor is equal
  1699. if (this.minor === minimum.minor) {
  1700. // Patch is insufficient
  1701. if (this.patch && this.patch < (minimum.patch || 0)) {
  1702. return false;
  1703. }
  1704. }
  1705. }
  1706. return true;
  1707. }
  1708. /**
  1709. * Indicates whether the instance was constructed from a valid version string
  1710. */
  1711. isValid() {
  1712. return !isNaN(this.major);
  1713. }
  1714. /**
  1715. * Returns the version as a string, e.g. 1.2 or 1.2.3
  1716. */
  1717. toString() {
  1718. let result = '';
  1719. if (this.isValid()) {
  1720. result = `${this.major}.${this.minor}`;
  1721. if (!isNaN(this.patch)) {
  1722. result += `.${this.patch}`;
  1723. }
  1724. }
  1725. return result;
  1726. }
  1727. }
  1728. exports.GitVersion = GitVersion;
  1729. /***/ }),
  1730. /***/ 138:
  1731. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  1732. "use strict";
  1733. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  1734. if (k2 === undefined) k2 = k;
  1735. var desc = Object.getOwnPropertyDescriptor(m, k);
  1736. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  1737. desc = { enumerable: true, get: function() { return m[k]; } };
  1738. }
  1739. Object.defineProperty(o, k2, desc);
  1740. }) : (function(o, m, k, k2) {
  1741. if (k2 === undefined) k2 = k;
  1742. o[k2] = m[k];
  1743. }));
  1744. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  1745. Object.defineProperty(o, "default", { enumerable: true, value: v });
  1746. }) : function(o, v) {
  1747. o["default"] = v;
  1748. });
  1749. var __importStar = (this && this.__importStar) || function (mod) {
  1750. if (mod && mod.__esModule) return mod;
  1751. var result = {};
  1752. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  1753. __setModuleDefault(result, mod);
  1754. return result;
  1755. };
  1756. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  1757. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  1758. return new (P || (P = Promise))(function (resolve, reject) {
  1759. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  1760. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  1761. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  1762. step((generator = generator.apply(thisArg, _arguments || [])).next());
  1763. });
  1764. };
  1765. Object.defineProperty(exports, "__esModule", ({ value: true }));
  1766. exports.downloadRepository = downloadRepository;
  1767. exports.getDefaultBranch = getDefaultBranch;
  1768. const assert = __importStar(__nccwpck_require__(9491));
  1769. const core = __importStar(__nccwpck_require__(2186));
  1770. const fs = __importStar(__nccwpck_require__(7147));
  1771. const github = __importStar(__nccwpck_require__(5438));
  1772. const io = __importStar(__nccwpck_require__(7436));
  1773. const path = __importStar(__nccwpck_require__(1017));
  1774. const retryHelper = __importStar(__nccwpck_require__(2155));
  1775. const toolCache = __importStar(__nccwpck_require__(7784));
  1776. const uuid_1 = __nccwpck_require__(5840);
  1777. const url_helper_1 = __nccwpck_require__(9437);
  1778. const IS_WINDOWS = process.platform === 'win32';
  1779. function downloadRepository(authToken, owner, repo, ref, commit, repositoryPath, baseUrl) {
  1780. return __awaiter(this, void 0, void 0, function* () {
  1781. // Determine the default branch
  1782. if (!ref && !commit) {
  1783. core.info('Determining the default branch');
  1784. ref = yield getDefaultBranch(authToken, owner, repo, baseUrl);
  1785. }
  1786. // Download the archive
  1787. let archiveData = yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  1788. core.info('Downloading the archive');
  1789. return yield downloadArchive(authToken, owner, repo, ref, commit, baseUrl);
  1790. }));
  1791. // Write archive to disk
  1792. core.info('Writing archive to disk');
  1793. const uniqueId = (0, uuid_1.v4)();
  1794. const archivePath = IS_WINDOWS
  1795. ? path.join(repositoryPath, `${uniqueId}.zip`)
  1796. : path.join(repositoryPath, `${uniqueId}.tar.gz`);
  1797. yield fs.promises.writeFile(archivePath, archiveData);
  1798. archiveData = Buffer.from(''); // Free memory
  1799. // Extract archive
  1800. core.info('Extracting the archive');
  1801. const extractPath = path.join(repositoryPath, uniqueId);
  1802. yield io.mkdirP(extractPath);
  1803. if (IS_WINDOWS) {
  1804. yield toolCache.extractZip(archivePath, extractPath);
  1805. }
  1806. else {
  1807. yield toolCache.extractTar(archivePath, extractPath);
  1808. }
  1809. yield io.rmRF(archivePath);
  1810. // Determine the path of the repository content. The archive contains
  1811. // a top-level folder and the repository content is inside.
  1812. const archiveFileNames = yield fs.promises.readdir(extractPath);
  1813. assert.ok(archiveFileNames.length == 1, 'Expected exactly one directory inside archive');
  1814. const archiveVersion = archiveFileNames[0]; // The top-level folder name includes the short SHA
  1815. core.info(`Resolved version ${archiveVersion}`);
  1816. const tempRepositoryPath = path.join(extractPath, archiveVersion);
  1817. // Move the files
  1818. for (const fileName of yield fs.promises.readdir(tempRepositoryPath)) {
  1819. const sourcePath = path.join(tempRepositoryPath, fileName);
  1820. const targetPath = path.join(repositoryPath, fileName);
  1821. if (IS_WINDOWS) {
  1822. yield io.cp(sourcePath, targetPath, { recursive: true }); // Copy on Windows (Windows Defender may have a lock)
  1823. }
  1824. else {
  1825. yield io.mv(sourcePath, targetPath);
  1826. }
  1827. }
  1828. yield io.rmRF(extractPath);
  1829. });
  1830. }
  1831. /**
  1832. * Looks up the default branch name
  1833. */
  1834. function getDefaultBranch(authToken, owner, repo, baseUrl) {
  1835. return __awaiter(this, void 0, void 0, function* () {
  1836. return yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  1837. core.info('Retrieving the default branch name');
  1838. const octokit = github.getOctokit(authToken, {
  1839. baseUrl: (0, url_helper_1.getServerApiUrl)(baseUrl)
  1840. });
  1841. let result;
  1842. try {
  1843. // Get the default branch from the repo info
  1844. const response = yield octokit.rest.repos.get({ owner, repo });
  1845. result = response.data.default_branch;
  1846. assert.ok(result, 'default_branch cannot be empty');
  1847. }
  1848. catch (err) {
  1849. // Handle .wiki repo
  1850. if ((err === null || err === void 0 ? void 0 : err.status) === 404 &&
  1851. repo.toUpperCase().endsWith('.WIKI')) {
  1852. result = 'master';
  1853. }
  1854. // Otherwise error
  1855. else {
  1856. throw err;
  1857. }
  1858. }
  1859. // Print the default branch
  1860. core.info(`Default branch '${result}'`);
  1861. // Prefix with 'refs/heads'
  1862. if (!result.startsWith('refs/')) {
  1863. result = `refs/heads/${result}`;
  1864. }
  1865. return result;
  1866. }));
  1867. });
  1868. }
  1869. function downloadArchive(authToken, owner, repo, ref, commit, baseUrl) {
  1870. return __awaiter(this, void 0, void 0, function* () {
  1871. const octokit = github.getOctokit(authToken, {
  1872. baseUrl: (0, url_helper_1.getServerApiUrl)(baseUrl)
  1873. });
  1874. const download = IS_WINDOWS
  1875. ? octokit.rest.repos.downloadZipballArchive
  1876. : octokit.rest.repos.downloadTarballArchive;
  1877. const response = yield download({
  1878. owner: owner,
  1879. repo: repo,
  1880. ref: commit || ref
  1881. });
  1882. return Buffer.from(response.data); // response.data is ArrayBuffer
  1883. });
  1884. }
  1885. /***/ }),
  1886. /***/ 5480:
  1887. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  1888. "use strict";
  1889. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  1890. if (k2 === undefined) k2 = k;
  1891. var desc = Object.getOwnPropertyDescriptor(m, k);
  1892. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  1893. desc = { enumerable: true, get: function() { return m[k]; } };
  1894. }
  1895. Object.defineProperty(o, k2, desc);
  1896. }) : (function(o, m, k, k2) {
  1897. if (k2 === undefined) k2 = k;
  1898. o[k2] = m[k];
  1899. }));
  1900. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  1901. Object.defineProperty(o, "default", { enumerable: true, value: v });
  1902. }) : function(o, v) {
  1903. o["default"] = v;
  1904. });
  1905. var __importStar = (this && this.__importStar) || function (mod) {
  1906. if (mod && mod.__esModule) return mod;
  1907. var result = {};
  1908. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  1909. __setModuleDefault(result, mod);
  1910. return result;
  1911. };
  1912. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  1913. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  1914. return new (P || (P = Promise))(function (resolve, reject) {
  1915. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  1916. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  1917. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  1918. step((generator = generator.apply(thisArg, _arguments || [])).next());
  1919. });
  1920. };
  1921. Object.defineProperty(exports, "__esModule", ({ value: true }));
  1922. exports.getInputs = getInputs;
  1923. const core = __importStar(__nccwpck_require__(2186));
  1924. const fsHelper = __importStar(__nccwpck_require__(7219));
  1925. const github = __importStar(__nccwpck_require__(5438));
  1926. const path = __importStar(__nccwpck_require__(1017));
  1927. const workflowContextHelper = __importStar(__nccwpck_require__(9568));
  1928. function getInputs() {
  1929. return __awaiter(this, void 0, void 0, function* () {
  1930. const result = {};
  1931. // GitHub workspace
  1932. let githubWorkspacePath = process.env['GITHUB_WORKSPACE'];
  1933. if (!githubWorkspacePath) {
  1934. throw new Error('GITHUB_WORKSPACE not defined');
  1935. }
  1936. githubWorkspacePath = path.resolve(githubWorkspacePath);
  1937. core.debug(`GITHUB_WORKSPACE = '${githubWorkspacePath}'`);
  1938. fsHelper.directoryExistsSync(githubWorkspacePath, true);
  1939. // Qualified repository
  1940. const qualifiedRepository = core.getInput('repository') ||
  1941. `${github.context.repo.owner}/${github.context.repo.repo}`;
  1942. core.debug(`qualified repository = '${qualifiedRepository}'`);
  1943. const splitRepository = qualifiedRepository.split('/');
  1944. if (splitRepository.length !== 2 ||
  1945. !splitRepository[0] ||
  1946. !splitRepository[1]) {
  1947. throw new Error(`Invalid repository '${qualifiedRepository}'. Expected format {owner}/{repo}.`);
  1948. }
  1949. result.repositoryOwner = splitRepository[0];
  1950. result.repositoryName = splitRepository[1];
  1951. // Repository path
  1952. result.repositoryPath = core.getInput('path') || '.';
  1953. result.repositoryPath = path.resolve(githubWorkspacePath, result.repositoryPath);
  1954. if (!(result.repositoryPath + path.sep).startsWith(githubWorkspacePath + path.sep)) {
  1955. throw new Error(`Repository path '${result.repositoryPath}' is not under '${githubWorkspacePath}'`);
  1956. }
  1957. // Workflow repository?
  1958. const isWorkflowRepository = qualifiedRepository.toUpperCase() ===
  1959. `${github.context.repo.owner}/${github.context.repo.repo}`.toUpperCase();
  1960. // Source branch, source version
  1961. result.ref = core.getInput('ref');
  1962. if (!result.ref) {
  1963. if (isWorkflowRepository) {
  1964. result.ref = github.context.ref;
  1965. result.commit = github.context.sha;
  1966. // Some events have an unqualifed ref. For example when a PR is merged (pull_request closed event),
  1967. // the ref is unqualifed like "main" instead of "refs/heads/main".
  1968. if (result.commit && result.ref && !result.ref.startsWith('refs/')) {
  1969. result.ref = `refs/heads/${result.ref}`;
  1970. }
  1971. }
  1972. }
  1973. // SHA?
  1974. else if (result.ref.match(/^[0-9a-fA-F]{40}$/)) {
  1975. result.commit = result.ref;
  1976. result.ref = '';
  1977. }
  1978. core.debug(`ref = '${result.ref}'`);
  1979. core.debug(`commit = '${result.commit}'`);
  1980. // Clean
  1981. result.clean = (core.getInput('clean') || 'true').toUpperCase() === 'TRUE';
  1982. core.debug(`clean = ${result.clean}`);
  1983. // Filter
  1984. const filter = core.getInput('filter');
  1985. if (filter) {
  1986. result.filter = filter;
  1987. }
  1988. core.debug(`filter = ${result.filter}`);
  1989. // Sparse checkout
  1990. const sparseCheckout = core.getMultilineInput('sparse-checkout');
  1991. if (sparseCheckout.length) {
  1992. result.sparseCheckout = sparseCheckout;
  1993. core.debug(`sparse checkout = ${result.sparseCheckout}`);
  1994. }
  1995. result.sparseCheckoutConeMode =
  1996. (core.getInput('sparse-checkout-cone-mode') || 'true').toUpperCase() ===
  1997. 'TRUE';
  1998. // Fetch depth
  1999. result.fetchDepth = Math.floor(Number(core.getInput('fetch-depth') || '1'));
  2000. if (isNaN(result.fetchDepth) || result.fetchDepth < 0) {
  2001. result.fetchDepth = 0;
  2002. }
  2003. core.debug(`fetch depth = ${result.fetchDepth}`);
  2004. // Fetch tags
  2005. result.fetchTags =
  2006. (core.getInput('fetch-tags') || 'false').toUpperCase() === 'TRUE';
  2007. core.debug(`fetch tags = ${result.fetchTags}`);
  2008. // Show fetch progress
  2009. result.showProgress =
  2010. (core.getInput('show-progress') || 'true').toUpperCase() === 'TRUE';
  2011. core.debug(`show progress = ${result.showProgress}`);
  2012. // LFS
  2013. result.lfs = (core.getInput('lfs') || 'false').toUpperCase() === 'TRUE';
  2014. core.debug(`lfs = ${result.lfs}`);
  2015. // Submodules
  2016. result.submodules = false;
  2017. result.nestedSubmodules = false;
  2018. const submodulesString = (core.getInput('submodules') || '').toUpperCase();
  2019. if (submodulesString == 'RECURSIVE') {
  2020. result.submodules = true;
  2021. result.nestedSubmodules = true;
  2022. }
  2023. else if (submodulesString == 'TRUE') {
  2024. result.submodules = true;
  2025. }
  2026. core.debug(`submodules = ${result.submodules}`);
  2027. core.debug(`recursive submodules = ${result.nestedSubmodules}`);
  2028. // Auth token
  2029. result.authToken = core.getInput('token', { required: true });
  2030. // SSH
  2031. result.sshKey = core.getInput('ssh-key');
  2032. result.sshKnownHosts = core.getInput('ssh-known-hosts');
  2033. result.sshStrict =
  2034. (core.getInput('ssh-strict') || 'true').toUpperCase() === 'TRUE';
  2035. result.sshUser = core.getInput('ssh-user');
  2036. // Persist credentials
  2037. result.persistCredentials =
  2038. (core.getInput('persist-credentials') || 'false').toUpperCase() === 'TRUE';
  2039. // Workflow organization ID
  2040. result.workflowOrganizationId =
  2041. yield workflowContextHelper.getOrganizationId();
  2042. // Set safe.directory in git global config.
  2043. result.setSafeDirectory =
  2044. (core.getInput('set-safe-directory') || 'true').toUpperCase() === 'TRUE';
  2045. // Determine the GitHub URL that the repository is being hosted from
  2046. result.githubServerUrl = core.getInput('github-server-url');
  2047. core.debug(`GitHub Host URL = ${result.githubServerUrl}`);
  2048. return result;
  2049. });
  2050. }
  2051. /***/ }),
  2052. /***/ 3109:
  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. const core = __importStar(__nccwpck_require__(2186));
  2089. const coreCommand = __importStar(__nccwpck_require__(7351));
  2090. const gitSourceProvider = __importStar(__nccwpck_require__(9210));
  2091. const inputHelper = __importStar(__nccwpck_require__(5480));
  2092. const path = __importStar(__nccwpck_require__(1017));
  2093. const stateHelper = __importStar(__nccwpck_require__(4866));
  2094. function run() {
  2095. return __awaiter(this, void 0, void 0, function* () {
  2096. var _a;
  2097. try {
  2098. const sourceSettings = yield inputHelper.getInputs();
  2099. try {
  2100. // Register problem matcher
  2101. coreCommand.issueCommand('add-matcher', {}, path.join(__dirname, 'problem-matcher.json'));
  2102. // Get sources
  2103. yield gitSourceProvider.getSource(sourceSettings);
  2104. core.setOutput('ref', sourceSettings.ref);
  2105. }
  2106. finally {
  2107. // Unregister problem matcher
  2108. coreCommand.issueCommand('remove-matcher', { owner: 'checkout-git' }, '');
  2109. }
  2110. }
  2111. catch (error) {
  2112. core.setFailed(`${(_a = error === null || error === void 0 ? void 0 : error.message) !== null && _a !== void 0 ? _a : error}`);
  2113. }
  2114. });
  2115. }
  2116. function cleanup() {
  2117. return __awaiter(this, void 0, void 0, function* () {
  2118. var _a;
  2119. try {
  2120. yield gitSourceProvider.cleanup(stateHelper.RepositoryPath);
  2121. }
  2122. catch (error) {
  2123. core.warning(`${(_a = error === null || error === void 0 ? void 0 : error.message) !== null && _a !== void 0 ? _a : error}`);
  2124. }
  2125. });
  2126. }
  2127. // Main
  2128. if (!stateHelper.IsPost) {
  2129. run();
  2130. }
  2131. // Post
  2132. else {
  2133. cleanup();
  2134. }
  2135. /***/ }),
  2136. /***/ 8601:
  2137. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  2138. "use strict";
  2139. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  2140. if (k2 === undefined) k2 = k;
  2141. var desc = Object.getOwnPropertyDescriptor(m, k);
  2142. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  2143. desc = { enumerable: true, get: function() { return m[k]; } };
  2144. }
  2145. Object.defineProperty(o, k2, desc);
  2146. }) : (function(o, m, k, k2) {
  2147. if (k2 === undefined) k2 = k;
  2148. o[k2] = m[k];
  2149. }));
  2150. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  2151. Object.defineProperty(o, "default", { enumerable: true, value: v });
  2152. }) : function(o, v) {
  2153. o["default"] = v;
  2154. });
  2155. var __importStar = (this && this.__importStar) || function (mod) {
  2156. if (mod && mod.__esModule) return mod;
  2157. var result = {};
  2158. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  2159. __setModuleDefault(result, mod);
  2160. return result;
  2161. };
  2162. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  2163. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  2164. return new (P || (P = Promise))(function (resolve, reject) {
  2165. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  2166. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  2167. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  2168. step((generator = generator.apply(thisArg, _arguments || [])).next());
  2169. });
  2170. };
  2171. Object.defineProperty(exports, "__esModule", ({ value: true }));
  2172. exports.tagsRefSpec = void 0;
  2173. exports.getCheckoutInfo = getCheckoutInfo;
  2174. exports.getRefSpecForAllHistory = getRefSpecForAllHistory;
  2175. exports.getRefSpec = getRefSpec;
  2176. exports.testRef = testRef;
  2177. exports.checkCommitInfo = checkCommitInfo;
  2178. const core = __importStar(__nccwpck_require__(2186));
  2179. const github = __importStar(__nccwpck_require__(5438));
  2180. const url_helper_1 = __nccwpck_require__(9437);
  2181. exports.tagsRefSpec = '+refs/tags/*:refs/tags/*';
  2182. function getCheckoutInfo(git, ref, commit) {
  2183. return __awaiter(this, void 0, void 0, function* () {
  2184. if (!git) {
  2185. throw new Error('Arg git cannot be empty');
  2186. }
  2187. if (!ref && !commit) {
  2188. throw new Error('Args ref and commit cannot both be empty');
  2189. }
  2190. const result = {};
  2191. const upperRef = (ref || '').toUpperCase();
  2192. // SHA only
  2193. if (!ref) {
  2194. result.ref = commit;
  2195. }
  2196. // refs/heads/
  2197. else if (upperRef.startsWith('REFS/HEADS/')) {
  2198. const branch = ref.substring('refs/heads/'.length);
  2199. result.ref = branch;
  2200. result.startPoint = `refs/remotes/origin/${branch}`;
  2201. }
  2202. // refs/pull/
  2203. else if (upperRef.startsWith('REFS/PULL/')) {
  2204. const branch = ref.substring('refs/pull/'.length);
  2205. result.ref = `refs/remotes/pull/${branch}`;
  2206. }
  2207. // refs/tags/
  2208. else if (upperRef.startsWith('REFS/TAGS/')) {
  2209. result.ref = ref;
  2210. }
  2211. // refs/
  2212. else if (upperRef.startsWith('REFS/')) {
  2213. result.ref = commit ? commit : ref;
  2214. }
  2215. // Unqualified ref, check for a matching branch or tag
  2216. else {
  2217. if (yield git.branchExists(true, `origin/${ref}`)) {
  2218. result.ref = ref;
  2219. result.startPoint = `refs/remotes/origin/${ref}`;
  2220. }
  2221. else if (yield git.tagExists(`${ref}`)) {
  2222. result.ref = `refs/tags/${ref}`;
  2223. }
  2224. else {
  2225. throw new Error(`A branch or tag with the name '${ref}' could not be found`);
  2226. }
  2227. }
  2228. return result;
  2229. });
  2230. }
  2231. function getRefSpecForAllHistory(ref, commit) {
  2232. const result = ['+refs/heads/*:refs/remotes/origin/*', exports.tagsRefSpec];
  2233. if (ref && ref.toUpperCase().startsWith('REFS/PULL/')) {
  2234. const branch = ref.substring('refs/pull/'.length);
  2235. result.push(`+${commit || ref}:refs/remotes/pull/${branch}`);
  2236. }
  2237. return result;
  2238. }
  2239. function getRefSpec(ref, commit) {
  2240. if (!ref && !commit) {
  2241. throw new Error('Args ref and commit cannot both be empty');
  2242. }
  2243. const upperRef = (ref || '').toUpperCase();
  2244. // SHA
  2245. if (commit) {
  2246. // refs/heads
  2247. if (upperRef.startsWith('REFS/HEADS/')) {
  2248. const branch = ref.substring('refs/heads/'.length);
  2249. return [`+${commit}:refs/remotes/origin/${branch}`];
  2250. }
  2251. // refs/pull/
  2252. else if (upperRef.startsWith('REFS/PULL/')) {
  2253. const branch = ref.substring('refs/pull/'.length);
  2254. return [`+${commit}:refs/remotes/pull/${branch}`];
  2255. }
  2256. // refs/tags/
  2257. else if (upperRef.startsWith('REFS/TAGS/')) {
  2258. return [`+${commit}:${ref}`];
  2259. }
  2260. // Otherwise no destination ref
  2261. else {
  2262. return [commit];
  2263. }
  2264. }
  2265. // Unqualified ref, check for a matching branch or tag
  2266. else if (!upperRef.startsWith('REFS/')) {
  2267. return [
  2268. `+refs/heads/${ref}*:refs/remotes/origin/${ref}*`,
  2269. `+refs/tags/${ref}*:refs/tags/${ref}*`
  2270. ];
  2271. }
  2272. // refs/heads/
  2273. else if (upperRef.startsWith('REFS/HEADS/')) {
  2274. const branch = ref.substring('refs/heads/'.length);
  2275. return [`+${ref}:refs/remotes/origin/${branch}`];
  2276. }
  2277. // refs/pull/
  2278. else if (upperRef.startsWith('REFS/PULL/')) {
  2279. const branch = ref.substring('refs/pull/'.length);
  2280. return [`+${ref}:refs/remotes/pull/${branch}`];
  2281. }
  2282. // refs/tags/
  2283. else {
  2284. return [`+${ref}:${ref}`];
  2285. }
  2286. }
  2287. /**
  2288. * Tests whether the initial fetch created the ref at the expected commit
  2289. */
  2290. function testRef(git, ref, commit) {
  2291. return __awaiter(this, void 0, void 0, function* () {
  2292. if (!git) {
  2293. throw new Error('Arg git cannot be empty');
  2294. }
  2295. if (!ref && !commit) {
  2296. throw new Error('Args ref and commit cannot both be empty');
  2297. }
  2298. // No SHA? Nothing to test
  2299. if (!commit) {
  2300. return true;
  2301. }
  2302. // SHA only?
  2303. else if (!ref) {
  2304. return yield git.shaExists(commit);
  2305. }
  2306. const upperRef = ref.toUpperCase();
  2307. // refs/heads/
  2308. if (upperRef.startsWith('REFS/HEADS/')) {
  2309. const branch = ref.substring('refs/heads/'.length);
  2310. return ((yield git.branchExists(true, `origin/${branch}`)) &&
  2311. commit === (yield git.revParse(`refs/remotes/origin/${branch}`)));
  2312. }
  2313. // refs/pull/
  2314. else if (upperRef.startsWith('REFS/PULL/')) {
  2315. // Assume matches because fetched using the commit
  2316. return true;
  2317. }
  2318. // refs/tags/
  2319. else if (upperRef.startsWith('REFS/TAGS/')) {
  2320. const tagName = ref.substring('refs/tags/'.length);
  2321. return ((yield git.tagExists(tagName)) && commit === (yield git.revParse(ref)));
  2322. }
  2323. // Unexpected
  2324. else {
  2325. core.debug(`Unexpected ref format '${ref}' when testing ref info`);
  2326. return true;
  2327. }
  2328. });
  2329. }
  2330. function checkCommitInfo(token, commitInfo, repositoryOwner, repositoryName, ref, commit, baseUrl) {
  2331. return __awaiter(this, void 0, void 0, function* () {
  2332. var _a;
  2333. try {
  2334. // GHES?
  2335. if ((0, url_helper_1.isGhes)(baseUrl)) {
  2336. return;
  2337. }
  2338. // Auth token?
  2339. if (!token) {
  2340. return;
  2341. }
  2342. // Public PR synchronize, for workflow repo?
  2343. if (fromPayload('repository.private') !== false ||
  2344. github.context.eventName !== 'pull_request' ||
  2345. fromPayload('action') !== 'synchronize' ||
  2346. repositoryOwner !== github.context.repo.owner ||
  2347. repositoryName !== github.context.repo.repo ||
  2348. ref !== github.context.ref ||
  2349. !ref.startsWith('refs/pull/') ||
  2350. commit !== github.context.sha) {
  2351. return;
  2352. }
  2353. // Head SHA
  2354. const expectedHeadSha = fromPayload('after');
  2355. if (!expectedHeadSha) {
  2356. core.debug('Unable to determine head sha');
  2357. return;
  2358. }
  2359. // Base SHA
  2360. const expectedBaseSha = fromPayload('pull_request.base.sha');
  2361. if (!expectedBaseSha) {
  2362. core.debug('Unable to determine base sha');
  2363. return;
  2364. }
  2365. // Expected message?
  2366. const expectedMessage = `Merge ${expectedHeadSha} into ${expectedBaseSha}`;
  2367. if (commitInfo.indexOf(expectedMessage) >= 0) {
  2368. return;
  2369. }
  2370. // Extract details from message
  2371. const match = commitInfo.match(/Merge ([0-9a-f]{40}) into ([0-9a-f]{40})/);
  2372. if (!match) {
  2373. core.debug('Unexpected message format');
  2374. return;
  2375. }
  2376. // Post telemetry
  2377. const actualHeadSha = match[1];
  2378. if (actualHeadSha !== expectedHeadSha) {
  2379. core.debug(`Expected head sha ${expectedHeadSha}; actual head sha ${actualHeadSha}`);
  2380. const octokit = github.getOctokit(token, {
  2381. baseUrl: (0, url_helper_1.getServerApiUrl)(baseUrl),
  2382. 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})`
  2383. });
  2384. yield octokit.rest.repos.get({
  2385. owner: repositoryOwner,
  2386. repo: repositoryName
  2387. });
  2388. }
  2389. }
  2390. catch (err) {
  2391. core.debug(`Error when validating commit info: ${(_a = err === null || err === void 0 ? void 0 : err.stack) !== null && _a !== void 0 ? _a : err}`);
  2392. }
  2393. });
  2394. }
  2395. function fromPayload(path) {
  2396. return select(github.context.payload, path);
  2397. }
  2398. function select(obj, path) {
  2399. if (!obj) {
  2400. return undefined;
  2401. }
  2402. const i = path.indexOf('.');
  2403. if (i < 0) {
  2404. return obj[path];
  2405. }
  2406. const key = path.substr(0, i);
  2407. return select(obj[key], path.substr(i + 1));
  2408. }
  2409. /***/ }),
  2410. /***/ 3120:
  2411. /***/ ((__unused_webpack_module, exports) => {
  2412. "use strict";
  2413. Object.defineProperty(exports, "__esModule", ({ value: true }));
  2414. exports.escape = escape;
  2415. function escape(value) {
  2416. return value.replace(/[^a-zA-Z0-9_]/g, x => {
  2417. return `\\${x}`;
  2418. });
  2419. }
  2420. /***/ }),
  2421. /***/ 2155:
  2422. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  2423. "use strict";
  2424. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  2425. if (k2 === undefined) k2 = k;
  2426. var desc = Object.getOwnPropertyDescriptor(m, k);
  2427. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  2428. desc = { enumerable: true, get: function() { return m[k]; } };
  2429. }
  2430. Object.defineProperty(o, k2, desc);
  2431. }) : (function(o, m, k, k2) {
  2432. if (k2 === undefined) k2 = k;
  2433. o[k2] = m[k];
  2434. }));
  2435. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  2436. Object.defineProperty(o, "default", { enumerable: true, value: v });
  2437. }) : function(o, v) {
  2438. o["default"] = v;
  2439. });
  2440. var __importStar = (this && this.__importStar) || function (mod) {
  2441. if (mod && mod.__esModule) return mod;
  2442. var result = {};
  2443. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  2444. __setModuleDefault(result, mod);
  2445. return result;
  2446. };
  2447. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  2448. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  2449. return new (P || (P = Promise))(function (resolve, reject) {
  2450. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  2451. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  2452. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  2453. step((generator = generator.apply(thisArg, _arguments || [])).next());
  2454. });
  2455. };
  2456. Object.defineProperty(exports, "__esModule", ({ value: true }));
  2457. exports.RetryHelper = void 0;
  2458. exports.execute = execute;
  2459. const core = __importStar(__nccwpck_require__(2186));
  2460. const defaultMaxAttempts = 3;
  2461. const defaultMinSeconds = 10;
  2462. const defaultMaxSeconds = 20;
  2463. class RetryHelper {
  2464. constructor(maxAttempts = defaultMaxAttempts, minSeconds = defaultMinSeconds, maxSeconds = defaultMaxSeconds) {
  2465. this.maxAttempts = maxAttempts;
  2466. this.minSeconds = Math.floor(minSeconds);
  2467. this.maxSeconds = Math.floor(maxSeconds);
  2468. if (this.minSeconds > this.maxSeconds) {
  2469. throw new Error('min seconds should be less than or equal to max seconds');
  2470. }
  2471. }
  2472. execute(action) {
  2473. return __awaiter(this, void 0, void 0, function* () {
  2474. let attempt = 1;
  2475. while (attempt < this.maxAttempts) {
  2476. // Try
  2477. try {
  2478. return yield action();
  2479. }
  2480. catch (err) {
  2481. core.info(err === null || err === void 0 ? void 0 : err.message);
  2482. }
  2483. // Sleep
  2484. const seconds = this.getSleepAmount();
  2485. core.info(`Waiting ${seconds} seconds before trying again`);
  2486. yield this.sleep(seconds);
  2487. attempt++;
  2488. }
  2489. // Last attempt
  2490. return yield action();
  2491. });
  2492. }
  2493. getSleepAmount() {
  2494. return (Math.floor(Math.random() * (this.maxSeconds - this.minSeconds + 1)) +
  2495. this.minSeconds);
  2496. }
  2497. sleep(seconds) {
  2498. return __awaiter(this, void 0, void 0, function* () {
  2499. return new Promise(resolve => setTimeout(resolve, seconds * 1000));
  2500. });
  2501. }
  2502. }
  2503. exports.RetryHelper = RetryHelper;
  2504. function execute(action) {
  2505. return __awaiter(this, void 0, void 0, function* () {
  2506. const retryHelper = new RetryHelper();
  2507. return yield retryHelper.execute(action);
  2508. });
  2509. }
  2510. /***/ }),
  2511. /***/ 4866:
  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.SshKnownHostsPath = exports.SshKeyPath = exports.PostSetSafeDirectory = exports.RepositoryPath = exports.IsPost = void 0;
  2539. exports.setRepositoryPath = setRepositoryPath;
  2540. exports.setSshKeyPath = setSshKeyPath;
  2541. exports.setSshKnownHostsPath = setSshKnownHostsPath;
  2542. exports.setSafeDirectory = setSafeDirectory;
  2543. const core = __importStar(__nccwpck_require__(2186));
  2544. /**
  2545. * Indicates whether the POST action is running
  2546. */
  2547. exports.IsPost = !!core.getState('isPost');
  2548. /**
  2549. * The repository path for the POST action. The value is empty during the MAIN action.
  2550. */
  2551. exports.RepositoryPath = core.getState('repositoryPath');
  2552. /**
  2553. * The set-safe-directory for the POST action. The value is set if input: 'safe-directory' is set during the MAIN action.
  2554. */
  2555. exports.PostSetSafeDirectory = core.getState('setSafeDirectory') === 'true';
  2556. /**
  2557. * The SSH key path for the POST action. The value is empty during the MAIN action.
  2558. */
  2559. exports.SshKeyPath = core.getState('sshKeyPath');
  2560. /**
  2561. * The SSH known hosts path for the POST action. The value is empty during the MAIN action.
  2562. */
  2563. exports.SshKnownHostsPath = core.getState('sshKnownHostsPath');
  2564. /**
  2565. * Save the repository path so the POST action can retrieve the value.
  2566. */
  2567. function setRepositoryPath(repositoryPath) {
  2568. core.saveState('repositoryPath', repositoryPath);
  2569. }
  2570. /**
  2571. * Save the SSH key path so the POST action can retrieve the value.
  2572. */
  2573. function setSshKeyPath(sshKeyPath) {
  2574. core.saveState('sshKeyPath', sshKeyPath);
  2575. }
  2576. /**
  2577. * Save the SSH known hosts path so the POST action can retrieve the value.
  2578. */
  2579. function setSshKnownHostsPath(sshKnownHostsPath) {
  2580. core.saveState('sshKnownHostsPath', sshKnownHostsPath);
  2581. }
  2582. /**
  2583. * Save the set-safe-directory input so the POST action can retrieve the value.
  2584. */
  2585. function setSafeDirectory() {
  2586. core.saveState('setSafeDirectory', 'true');
  2587. }
  2588. // Publish a variable so that when the POST action runs, it can determine it should run the cleanup logic.
  2589. // This is necessary since we don't have a separate entry point.
  2590. if (!exports.IsPost) {
  2591. core.saveState('isPost', 'true');
  2592. }
  2593. /***/ }),
  2594. /***/ 9437:
  2595. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  2596. "use strict";
  2597. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  2598. if (k2 === undefined) k2 = k;
  2599. var desc = Object.getOwnPropertyDescriptor(m, k);
  2600. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  2601. desc = { enumerable: true, get: function() { return m[k]; } };
  2602. }
  2603. Object.defineProperty(o, k2, desc);
  2604. }) : (function(o, m, k, k2) {
  2605. if (k2 === undefined) k2 = k;
  2606. o[k2] = m[k];
  2607. }));
  2608. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  2609. Object.defineProperty(o, "default", { enumerable: true, value: v });
  2610. }) : function(o, v) {
  2611. o["default"] = v;
  2612. });
  2613. var __importStar = (this && this.__importStar) || function (mod) {
  2614. if (mod && mod.__esModule) return mod;
  2615. var result = {};
  2616. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  2617. __setModuleDefault(result, mod);
  2618. return result;
  2619. };
  2620. Object.defineProperty(exports, "__esModule", ({ value: true }));
  2621. exports.getFetchUrl = getFetchUrl;
  2622. exports.getServerUrl = getServerUrl;
  2623. exports.getServerApiUrl = getServerApiUrl;
  2624. exports.isGhes = isGhes;
  2625. const assert = __importStar(__nccwpck_require__(9491));
  2626. const url_1 = __nccwpck_require__(7310);
  2627. function getFetchUrl(settings) {
  2628. assert.ok(settings.repositoryOwner, 'settings.repositoryOwner must be defined');
  2629. assert.ok(settings.repositoryName, 'settings.repositoryName must be defined');
  2630. const serviceUrl = getServerUrl(settings.githubServerUrl);
  2631. const encodedOwner = encodeURIComponent(settings.repositoryOwner);
  2632. const encodedName = encodeURIComponent(settings.repositoryName);
  2633. if (settings.sshKey) {
  2634. const user = settings.sshUser.length > 0 ? settings.sshUser : 'git';
  2635. return `${user}@${serviceUrl.hostname}:${encodedOwner}/${encodedName}.git`;
  2636. }
  2637. // "origin" is SCHEME://HOSTNAME[:PORT]
  2638. return `${serviceUrl.origin}/${encodedOwner}/${encodedName}`;
  2639. }
  2640. function getServerUrl(url) {
  2641. let resolvedUrl = process.env['GITHUB_SERVER_URL'] || 'https://github.com';
  2642. if (hasContent(url, WhitespaceMode.Trim)) {
  2643. resolvedUrl = url;
  2644. }
  2645. return new url_1.URL(resolvedUrl);
  2646. }
  2647. function getServerApiUrl(url) {
  2648. if (hasContent(url, WhitespaceMode.Trim)) {
  2649. let serverUrl = getServerUrl(url);
  2650. if (isGhes(url)) {
  2651. serverUrl.pathname = 'api/v3';
  2652. }
  2653. else {
  2654. serverUrl.hostname = 'api.' + serverUrl.hostname;
  2655. }
  2656. return pruneSuffix(serverUrl.toString(), '/');
  2657. }
  2658. return process.env['GITHUB_API_URL'] || 'https://api.github.com';
  2659. }
  2660. function isGhes(url) {
  2661. const ghUrl = new url_1.URL(url || process.env['GITHUB_SERVER_URL'] || 'https://github.com');
  2662. const hostname = ghUrl.hostname.trimEnd().toUpperCase();
  2663. const isGitHubHost = hostname === 'GITHUB.COM';
  2664. const isGitHubEnterpriseCloudHost = hostname.endsWith('.GHE.COM');
  2665. const isLocalHost = hostname.endsWith('.LOCALHOST');
  2666. return !isGitHubHost && !isGitHubEnterpriseCloudHost && !isLocalHost;
  2667. }
  2668. function pruneSuffix(text, suffix) {
  2669. if (hasContent(suffix, WhitespaceMode.Preserve) && (text === null || text === void 0 ? void 0 : text.endsWith(suffix))) {
  2670. return text.substring(0, text.length - suffix.length);
  2671. }
  2672. return text;
  2673. }
  2674. var WhitespaceMode;
  2675. (function (WhitespaceMode) {
  2676. WhitespaceMode[WhitespaceMode["Trim"] = 0] = "Trim";
  2677. WhitespaceMode[WhitespaceMode["Preserve"] = 1] = "Preserve";
  2678. })(WhitespaceMode || (WhitespaceMode = {}));
  2679. function hasContent(text, whitespaceMode) {
  2680. let refinedText = text !== null && text !== void 0 ? text : '';
  2681. if (whitespaceMode == WhitespaceMode.Trim) {
  2682. refinedText = refinedText.trim();
  2683. }
  2684. return refinedText.length > 0;
  2685. }
  2686. /***/ }),
  2687. /***/ 9568:
  2688. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  2689. "use strict";
  2690. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  2691. if (k2 === undefined) k2 = k;
  2692. var desc = Object.getOwnPropertyDescriptor(m, k);
  2693. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  2694. desc = { enumerable: true, get: function() { return m[k]; } };
  2695. }
  2696. Object.defineProperty(o, k2, desc);
  2697. }) : (function(o, m, k, k2) {
  2698. if (k2 === undefined) k2 = k;
  2699. o[k2] = m[k];
  2700. }));
  2701. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  2702. Object.defineProperty(o, "default", { enumerable: true, value: v });
  2703. }) : function(o, v) {
  2704. o["default"] = v;
  2705. });
  2706. var __importStar = (this && this.__importStar) || function (mod) {
  2707. if (mod && mod.__esModule) return mod;
  2708. var result = {};
  2709. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  2710. __setModuleDefault(result, mod);
  2711. return result;
  2712. };
  2713. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  2714. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  2715. return new (P || (P = Promise))(function (resolve, reject) {
  2716. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  2717. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  2718. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  2719. step((generator = generator.apply(thisArg, _arguments || [])).next());
  2720. });
  2721. };
  2722. Object.defineProperty(exports, "__esModule", ({ value: true }));
  2723. exports.getOrganizationId = getOrganizationId;
  2724. const core = __importStar(__nccwpck_require__(2186));
  2725. const fs = __importStar(__nccwpck_require__(7147));
  2726. /**
  2727. * Gets the organization ID of the running workflow or undefined if the value cannot be loaded from the GITHUB_EVENT_PATH
  2728. */
  2729. function getOrganizationId() {
  2730. return __awaiter(this, void 0, void 0, function* () {
  2731. var _a, _b;
  2732. try {
  2733. const eventPath = process.env.GITHUB_EVENT_PATH;
  2734. if (!eventPath) {
  2735. core.debug(`GITHUB_EVENT_PATH is not defined`);
  2736. return;
  2737. }
  2738. const content = yield fs.promises.readFile(eventPath, { encoding: 'utf8' });
  2739. const event = JSON.parse(content);
  2740. 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;
  2741. if (typeof id !== 'number') {
  2742. core.debug('Repository owner ID not found within GITHUB event info');
  2743. return;
  2744. }
  2745. return id;
  2746. }
  2747. catch (err) {
  2748. core.debug(`Unable to load organization ID from GITHUB_EVENT_PATH: ${err.message || err}`);
  2749. }
  2750. });
  2751. }
  2752. /***/ }),
  2753. /***/ 7351:
  2754. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  2755. "use strict";
  2756. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  2757. if (k2 === undefined) k2 = k;
  2758. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  2759. }) : (function(o, m, k, k2) {
  2760. if (k2 === undefined) k2 = k;
  2761. o[k2] = m[k];
  2762. }));
  2763. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  2764. Object.defineProperty(o, "default", { enumerable: true, value: v });
  2765. }) : function(o, v) {
  2766. o["default"] = v;
  2767. });
  2768. var __importStar = (this && this.__importStar) || function (mod) {
  2769. if (mod && mod.__esModule) return mod;
  2770. var result = {};
  2771. if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  2772. __setModuleDefault(result, mod);
  2773. return result;
  2774. };
  2775. Object.defineProperty(exports, "__esModule", ({ value: true }));
  2776. exports.issue = exports.issueCommand = void 0;
  2777. const os = __importStar(__nccwpck_require__(2037));
  2778. const utils_1 = __nccwpck_require__(5278);
  2779. /**
  2780. * Commands
  2781. *
  2782. * Command Format:
  2783. * ::name key=value,key=value::message
  2784. *
  2785. * Examples:
  2786. * ::warning::This is the message
  2787. * ::set-env name=MY_VAR::some value
  2788. */
  2789. function issueCommand(command, properties, message) {
  2790. const cmd = new Command(command, properties, message);
  2791. process.stdout.write(cmd.toString() + os.EOL);
  2792. }
  2793. exports.issueCommand = issueCommand;
  2794. function issue(name, message = '') {
  2795. issueCommand(name, {}, message);
  2796. }
  2797. exports.issue = issue;
  2798. const CMD_STRING = '::';
  2799. class Command {
  2800. constructor(command, properties, message) {
  2801. if (!command) {
  2802. command = 'missing.command';
  2803. }
  2804. this.command = command;
  2805. this.properties = properties;
  2806. this.message = message;
  2807. }
  2808. toString() {
  2809. let cmdStr = CMD_STRING + this.command;
  2810. if (this.properties && Object.keys(this.properties).length > 0) {
  2811. cmdStr += ' ';
  2812. let first = true;
  2813. for (const key in this.properties) {
  2814. if (this.properties.hasOwnProperty(key)) {
  2815. const val = this.properties[key];
  2816. if (val) {
  2817. if (first) {
  2818. first = false;
  2819. }
  2820. else {
  2821. cmdStr += ',';
  2822. }
  2823. cmdStr += `${key}=${escapeProperty(val)}`;
  2824. }
  2825. }
  2826. }
  2827. }
  2828. cmdStr += `${CMD_STRING}${escapeData(this.message)}`;
  2829. return cmdStr;
  2830. }
  2831. }
  2832. function escapeData(s) {
  2833. return utils_1.toCommandValue(s)
  2834. .replace(/%/g, '%25')
  2835. .replace(/\r/g, '%0D')
  2836. .replace(/\n/g, '%0A');
  2837. }
  2838. function escapeProperty(s) {
  2839. return utils_1.toCommandValue(s)
  2840. .replace(/%/g, '%25')
  2841. .replace(/\r/g, '%0D')
  2842. .replace(/\n/g, '%0A')
  2843. .replace(/:/g, '%3A')
  2844. .replace(/,/g, '%2C');
  2845. }
  2846. //# sourceMappingURL=command.js.map
  2847. /***/ }),
  2848. /***/ 2186:
  2849. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  2850. "use strict";
  2851. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  2852. if (k2 === undefined) k2 = k;
  2853. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  2854. }) : (function(o, m, k, k2) {
  2855. if (k2 === undefined) k2 = k;
  2856. o[k2] = m[k];
  2857. }));
  2858. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  2859. Object.defineProperty(o, "default", { enumerable: true, value: v });
  2860. }) : function(o, v) {
  2861. o["default"] = v;
  2862. });
  2863. var __importStar = (this && this.__importStar) || function (mod) {
  2864. if (mod && mod.__esModule) return mod;
  2865. var result = {};
  2866. if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  2867. __setModuleDefault(result, mod);
  2868. return result;
  2869. };
  2870. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  2871. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  2872. return new (P || (P = Promise))(function (resolve, reject) {
  2873. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  2874. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  2875. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  2876. step((generator = generator.apply(thisArg, _arguments || [])).next());
  2877. });
  2878. };
  2879. Object.defineProperty(exports, "__esModule", ({ value: true }));
  2880. 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;
  2881. const command_1 = __nccwpck_require__(7351);
  2882. const file_command_1 = __nccwpck_require__(717);
  2883. const utils_1 = __nccwpck_require__(5278);
  2884. const os = __importStar(__nccwpck_require__(2037));
  2885. const path = __importStar(__nccwpck_require__(1017));
  2886. const oidc_utils_1 = __nccwpck_require__(8041);
  2887. /**
  2888. * The code to exit an action
  2889. */
  2890. var ExitCode;
  2891. (function (ExitCode) {
  2892. /**
  2893. * A code indicating that the action was successful
  2894. */
  2895. ExitCode[ExitCode["Success"] = 0] = "Success";
  2896. /**
  2897. * A code indicating that the action was a failure
  2898. */
  2899. ExitCode[ExitCode["Failure"] = 1] = "Failure";
  2900. })(ExitCode = exports.ExitCode || (exports.ExitCode = {}));
  2901. //-----------------------------------------------------------------------
  2902. // Variables
  2903. //-----------------------------------------------------------------------
  2904. /**
  2905. * Sets env variable for this action and future actions in the job
  2906. * @param name the name of the variable to set
  2907. * @param val the value of the variable. Non-string values will be converted to a string via JSON.stringify
  2908. */
  2909. // eslint-disable-next-line @typescript-eslint/no-explicit-any
  2910. function exportVariable(name, val) {
  2911. const convertedVal = utils_1.toCommandValue(val);
  2912. process.env[name] = convertedVal;
  2913. const filePath = process.env['GITHUB_ENV'] || '';
  2914. if (filePath) {
  2915. return file_command_1.issueFileCommand('ENV', file_command_1.prepareKeyValueMessage(name, val));
  2916. }
  2917. command_1.issueCommand('set-env', { name }, convertedVal);
  2918. }
  2919. exports.exportVariable = exportVariable;
  2920. /**
  2921. * Registers a secret which will get masked from logs
  2922. * @param secret value of the secret
  2923. */
  2924. function setSecret(secret) {
  2925. command_1.issueCommand('add-mask', {}, secret);
  2926. }
  2927. exports.setSecret = setSecret;
  2928. /**
  2929. * Prepends inputPath to the PATH (for this action and future actions)
  2930. * @param inputPath
  2931. */
  2932. function addPath(inputPath) {
  2933. const filePath = process.env['GITHUB_PATH'] || '';
  2934. if (filePath) {
  2935. file_command_1.issueFileCommand('PATH', inputPath);
  2936. }
  2937. else {
  2938. command_1.issueCommand('add-path', {}, inputPath);
  2939. }
  2940. process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`;
  2941. }
  2942. exports.addPath = addPath;
  2943. /**
  2944. * Gets the value of an input.
  2945. * Unless trimWhitespace is set to false in InputOptions, the value is also trimmed.
  2946. * Returns an empty string if the value is not defined.
  2947. *
  2948. * @param name name of the input to get
  2949. * @param options optional. See InputOptions.
  2950. * @returns string
  2951. */
  2952. function getInput(name, options) {
  2953. const val = process.env[`INPUT_${name.replace(/ /g, '_').toUpperCase()}`] || '';
  2954. if (options && options.required && !val) {
  2955. throw new Error(`Input required and not supplied: ${name}`);
  2956. }
  2957. if (options && options.trimWhitespace === false) {
  2958. return val;
  2959. }
  2960. return val.trim();
  2961. }
  2962. exports.getInput = getInput;
  2963. /**
  2964. * Gets the values of an multiline input. Each value is also trimmed.
  2965. *
  2966. * @param name name of the input to get
  2967. * @param options optional. See InputOptions.
  2968. * @returns string[]
  2969. *
  2970. */
  2971. function getMultilineInput(name, options) {
  2972. const inputs = getInput(name, options)
  2973. .split('\n')
  2974. .filter(x => x !== '');
  2975. if (options && options.trimWhitespace === false) {
  2976. return inputs;
  2977. }
  2978. return inputs.map(input => input.trim());
  2979. }
  2980. exports.getMultilineInput = getMultilineInput;
  2981. /**
  2982. * Gets the input value of the boolean type in the YAML 1.2 "core schema" specification.
  2983. * Support boolean input list: `true | True | TRUE | false | False | FALSE` .
  2984. * The return value is also in boolean type.
  2985. * ref: https://yaml.org/spec/1.2/spec.html#id2804923
  2986. *
  2987. * @param name name of the input to get
  2988. * @param options optional. See InputOptions.
  2989. * @returns boolean
  2990. */
  2991. function getBooleanInput(name, options) {
  2992. const trueValue = ['true', 'True', 'TRUE'];
  2993. const falseValue = ['false', 'False', 'FALSE'];
  2994. const val = getInput(name, options);
  2995. if (trueValue.includes(val))
  2996. return true;
  2997. if (falseValue.includes(val))
  2998. return false;
  2999. throw new TypeError(`Input does not meet YAML 1.2 "Core Schema" specification: ${name}\n` +
  3000. `Support boolean input list: \`true | True | TRUE | false | False | FALSE\``);
  3001. }
  3002. exports.getBooleanInput = getBooleanInput;
  3003. /**
  3004. * Sets the value of an output.
  3005. *
  3006. * @param name name of the output to set
  3007. * @param value value to store. Non-string values will be converted to a string via JSON.stringify
  3008. */
  3009. // eslint-disable-next-line @typescript-eslint/no-explicit-any
  3010. function setOutput(name, value) {
  3011. const filePath = process.env['GITHUB_OUTPUT'] || '';
  3012. if (filePath) {
  3013. return file_command_1.issueFileCommand('OUTPUT', file_command_1.prepareKeyValueMessage(name, value));
  3014. }
  3015. process.stdout.write(os.EOL);
  3016. command_1.issueCommand('set-output', { name }, utils_1.toCommandValue(value));
  3017. }
  3018. exports.setOutput = setOutput;
  3019. /**
  3020. * Enables or disables the echoing of commands into stdout for the rest of the step.
  3021. * Echoing is disabled by default if ACTIONS_STEP_DEBUG is not set.
  3022. *
  3023. */
  3024. function setCommandEcho(enabled) {
  3025. command_1.issue('echo', enabled ? 'on' : 'off');
  3026. }
  3027. exports.setCommandEcho = setCommandEcho;
  3028. //-----------------------------------------------------------------------
  3029. // Results
  3030. //-----------------------------------------------------------------------
  3031. /**
  3032. * Sets the action status to failed.
  3033. * When the action exits it will be with an exit code of 1
  3034. * @param message add error issue message
  3035. */
  3036. function setFailed(message) {
  3037. process.exitCode = ExitCode.Failure;
  3038. error(message);
  3039. }
  3040. exports.setFailed = setFailed;
  3041. //-----------------------------------------------------------------------
  3042. // Logging Commands
  3043. //-----------------------------------------------------------------------
  3044. /**
  3045. * Gets whether Actions Step Debug is on or not
  3046. */
  3047. function isDebug() {
  3048. return process.env['RUNNER_DEBUG'] === '1';
  3049. }
  3050. exports.isDebug = isDebug;
  3051. /**
  3052. * Writes debug message to user log
  3053. * @param message debug message
  3054. */
  3055. function debug(message) {
  3056. command_1.issueCommand('debug', {}, message);
  3057. }
  3058. exports.debug = debug;
  3059. /**
  3060. * Adds an error issue
  3061. * @param message error issue message. Errors will be converted to string via toString()
  3062. * @param properties optional properties to add to the annotation.
  3063. */
  3064. function error(message, properties = {}) {
  3065. command_1.issueCommand('error', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message);
  3066. }
  3067. exports.error = error;
  3068. /**
  3069. * Adds a warning issue
  3070. * @param message warning issue message. Errors will be converted to string via toString()
  3071. * @param properties optional properties to add to the annotation.
  3072. */
  3073. function warning(message, properties = {}) {
  3074. command_1.issueCommand('warning', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message);
  3075. }
  3076. exports.warning = warning;
  3077. /**
  3078. * Adds a notice issue
  3079. * @param message notice issue message. Errors will be converted to string via toString()
  3080. * @param properties optional properties to add to the annotation.
  3081. */
  3082. function notice(message, properties = {}) {
  3083. command_1.issueCommand('notice', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message);
  3084. }
  3085. exports.notice = notice;
  3086. /**
  3087. * Writes info to log with console.log.
  3088. * @param message info message
  3089. */
  3090. function info(message) {
  3091. process.stdout.write(message + os.EOL);
  3092. }
  3093. exports.info = info;
  3094. /**
  3095. * Begin an output group.
  3096. *
  3097. * Output until the next `groupEnd` will be foldable in this group
  3098. *
  3099. * @param name The name of the output group
  3100. */
  3101. function startGroup(name) {
  3102. command_1.issue('group', name);
  3103. }
  3104. exports.startGroup = startGroup;
  3105. /**
  3106. * End an output group.
  3107. */
  3108. function endGroup() {
  3109. command_1.issue('endgroup');
  3110. }
  3111. exports.endGroup = endGroup;
  3112. /**
  3113. * Wrap an asynchronous function call in a group.
  3114. *
  3115. * Returns the same type as the function itself.
  3116. *
  3117. * @param name The name of the group
  3118. * @param fn The function to wrap in the group
  3119. */
  3120. function group(name, fn) {
  3121. return __awaiter(this, void 0, void 0, function* () {
  3122. startGroup(name);
  3123. let result;
  3124. try {
  3125. result = yield fn();
  3126. }
  3127. finally {
  3128. endGroup();
  3129. }
  3130. return result;
  3131. });
  3132. }
  3133. exports.group = group;
  3134. //-----------------------------------------------------------------------
  3135. // Wrapper action state
  3136. //-----------------------------------------------------------------------
  3137. /**
  3138. * Saves state for current action, the state can only be retrieved by this action's post job execution.
  3139. *
  3140. * @param name name of the state to store
  3141. * @param value value to store. Non-string values will be converted to a string via JSON.stringify
  3142. */
  3143. // eslint-disable-next-line @typescript-eslint/no-explicit-any
  3144. function saveState(name, value) {
  3145. const filePath = process.env['GITHUB_STATE'] || '';
  3146. if (filePath) {
  3147. return file_command_1.issueFileCommand('STATE', file_command_1.prepareKeyValueMessage(name, value));
  3148. }
  3149. command_1.issueCommand('save-state', { name }, utils_1.toCommandValue(value));
  3150. }
  3151. exports.saveState = saveState;
  3152. /**
  3153. * Gets the value of an state set by this action's main execution.
  3154. *
  3155. * @param name name of the state to get
  3156. * @returns string
  3157. */
  3158. function getState(name) {
  3159. return process.env[`STATE_${name}`] || '';
  3160. }
  3161. exports.getState = getState;
  3162. function getIDToken(aud) {
  3163. return __awaiter(this, void 0, void 0, function* () {
  3164. return yield oidc_utils_1.OidcClient.getIDToken(aud);
  3165. });
  3166. }
  3167. exports.getIDToken = getIDToken;
  3168. /**
  3169. * Summary exports
  3170. */
  3171. var summary_1 = __nccwpck_require__(1327);
  3172. Object.defineProperty(exports, "summary", ({ enumerable: true, get: function () { return summary_1.summary; } }));
  3173. /**
  3174. * @deprecated use core.summary
  3175. */
  3176. var summary_2 = __nccwpck_require__(1327);
  3177. Object.defineProperty(exports, "markdownSummary", ({ enumerable: true, get: function () { return summary_2.markdownSummary; } }));
  3178. /**
  3179. * Path exports
  3180. */
  3181. var path_utils_1 = __nccwpck_require__(2981);
  3182. Object.defineProperty(exports, "toPosixPath", ({ enumerable: true, get: function () { return path_utils_1.toPosixPath; } }));
  3183. Object.defineProperty(exports, "toWin32Path", ({ enumerable: true, get: function () { return path_utils_1.toWin32Path; } }));
  3184. Object.defineProperty(exports, "toPlatformPath", ({ enumerable: true, get: function () { return path_utils_1.toPlatformPath; } }));
  3185. //# sourceMappingURL=core.js.map
  3186. /***/ }),
  3187. /***/ 717:
  3188. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  3189. "use strict";
  3190. // For internal use, subject to change.
  3191. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  3192. if (k2 === undefined) k2 = k;
  3193. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  3194. }) : (function(o, m, k, k2) {
  3195. if (k2 === undefined) k2 = k;
  3196. o[k2] = m[k];
  3197. }));
  3198. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  3199. Object.defineProperty(o, "default", { enumerable: true, value: v });
  3200. }) : function(o, v) {
  3201. o["default"] = v;
  3202. });
  3203. var __importStar = (this && this.__importStar) || function (mod) {
  3204. if (mod && mod.__esModule) return mod;
  3205. var result = {};
  3206. if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  3207. __setModuleDefault(result, mod);
  3208. return result;
  3209. };
  3210. Object.defineProperty(exports, "__esModule", ({ value: true }));
  3211. exports.prepareKeyValueMessage = exports.issueFileCommand = void 0;
  3212. // We use any as a valid input type
  3213. /* eslint-disable @typescript-eslint/no-explicit-any */
  3214. const fs = __importStar(__nccwpck_require__(7147));
  3215. const os = __importStar(__nccwpck_require__(2037));
  3216. const uuid_1 = __nccwpck_require__(8974);
  3217. const utils_1 = __nccwpck_require__(5278);
  3218. function issueFileCommand(command, message) {
  3219. const filePath = process.env[`GITHUB_${command}`];
  3220. if (!filePath) {
  3221. throw new Error(`Unable to find environment variable for file command ${command}`);
  3222. }
  3223. if (!fs.existsSync(filePath)) {
  3224. throw new Error(`Missing file at path: ${filePath}`);
  3225. }
  3226. fs.appendFileSync(filePath, `${utils_1.toCommandValue(message)}${os.EOL}`, {
  3227. encoding: 'utf8'
  3228. });
  3229. }
  3230. exports.issueFileCommand = issueFileCommand;
  3231. function prepareKeyValueMessage(key, value) {
  3232. const delimiter = `ghadelimiter_${uuid_1.v4()}`;
  3233. const convertedValue = utils_1.toCommandValue(value);
  3234. // These should realistically never happen, but just in case someone finds a
  3235. // way to exploit uuid generation let's not allow keys or values that contain
  3236. // the delimiter.
  3237. if (key.includes(delimiter)) {
  3238. throw new Error(`Unexpected input: name should not contain the delimiter "${delimiter}"`);
  3239. }
  3240. if (convertedValue.includes(delimiter)) {
  3241. throw new Error(`Unexpected input: value should not contain the delimiter "${delimiter}"`);
  3242. }
  3243. return `${key}<<${delimiter}${os.EOL}${convertedValue}${os.EOL}${delimiter}`;
  3244. }
  3245. exports.prepareKeyValueMessage = prepareKeyValueMessage;
  3246. //# sourceMappingURL=file-command.js.map
  3247. /***/ }),
  3248. /***/ 8041:
  3249. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  3250. "use strict";
  3251. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  3252. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  3253. return new (P || (P = Promise))(function (resolve, reject) {
  3254. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  3255. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  3256. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  3257. step((generator = generator.apply(thisArg, _arguments || [])).next());
  3258. });
  3259. };
  3260. Object.defineProperty(exports, "__esModule", ({ value: true }));
  3261. exports.OidcClient = void 0;
  3262. const http_client_1 = __nccwpck_require__(6255);
  3263. const auth_1 = __nccwpck_require__(5526);
  3264. const core_1 = __nccwpck_require__(2186);
  3265. class OidcClient {
  3266. static createHttpClient(allowRetry = true, maxRetry = 10) {
  3267. const requestOptions = {
  3268. allowRetries: allowRetry,
  3269. maxRetries: maxRetry
  3270. };
  3271. return new http_client_1.HttpClient('actions/oidc-client', [new auth_1.BearerCredentialHandler(OidcClient.getRequestToken())], requestOptions);
  3272. }
  3273. static getRequestToken() {
  3274. const token = process.env['ACTIONS_ID_TOKEN_REQUEST_TOKEN'];
  3275. if (!token) {
  3276. throw new Error('Unable to get ACTIONS_ID_TOKEN_REQUEST_TOKEN env variable');
  3277. }
  3278. return token;
  3279. }
  3280. static getIDTokenUrl() {
  3281. const runtimeUrl = process.env['ACTIONS_ID_TOKEN_REQUEST_URL'];
  3282. if (!runtimeUrl) {
  3283. throw new Error('Unable to get ACTIONS_ID_TOKEN_REQUEST_URL env variable');
  3284. }
  3285. return runtimeUrl;
  3286. }
  3287. static getCall(id_token_url) {
  3288. var _a;
  3289. return __awaiter(this, void 0, void 0, function* () {
  3290. const httpclient = OidcClient.createHttpClient();
  3291. const res = yield httpclient
  3292. .getJson(id_token_url)
  3293. .catch(error => {
  3294. throw new Error(`Failed to get ID Token. \n
  3295. Error Code : ${error.statusCode}\n
  3296. Error Message: ${error.message}`);
  3297. });
  3298. const id_token = (_a = res.result) === null || _a === void 0 ? void 0 : _a.value;
  3299. if (!id_token) {
  3300. throw new Error('Response json body do not have ID Token field');
  3301. }
  3302. return id_token;
  3303. });
  3304. }
  3305. static getIDToken(audience) {
  3306. return __awaiter(this, void 0, void 0, function* () {
  3307. try {
  3308. // New ID Token is requested from action service
  3309. let id_token_url = OidcClient.getIDTokenUrl();
  3310. if (audience) {
  3311. const encodedAudience = encodeURIComponent(audience);
  3312. id_token_url = `${id_token_url}&audience=${encodedAudience}`;
  3313. }
  3314. core_1.debug(`ID token url is ${id_token_url}`);
  3315. const id_token = yield OidcClient.getCall(id_token_url);
  3316. core_1.setSecret(id_token);
  3317. return id_token;
  3318. }
  3319. catch (error) {
  3320. throw new Error(`Error message: ${error.message}`);
  3321. }
  3322. });
  3323. }
  3324. }
  3325. exports.OidcClient = OidcClient;
  3326. //# sourceMappingURL=oidc-utils.js.map
  3327. /***/ }),
  3328. /***/ 2981:
  3329. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  3330. "use strict";
  3331. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  3332. if (k2 === undefined) k2 = k;
  3333. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  3334. }) : (function(o, m, k, k2) {
  3335. if (k2 === undefined) k2 = k;
  3336. o[k2] = m[k];
  3337. }));
  3338. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  3339. Object.defineProperty(o, "default", { enumerable: true, value: v });
  3340. }) : function(o, v) {
  3341. o["default"] = v;
  3342. });
  3343. var __importStar = (this && this.__importStar) || function (mod) {
  3344. if (mod && mod.__esModule) return mod;
  3345. var result = {};
  3346. if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  3347. __setModuleDefault(result, mod);
  3348. return result;
  3349. };
  3350. Object.defineProperty(exports, "__esModule", ({ value: true }));
  3351. exports.toPlatformPath = exports.toWin32Path = exports.toPosixPath = void 0;
  3352. const path = __importStar(__nccwpck_require__(1017));
  3353. /**
  3354. * toPosixPath converts the given path to the posix form. On Windows, \\ will be
  3355. * replaced with /.
  3356. *
  3357. * @param pth. Path to transform.
  3358. * @return string Posix path.
  3359. */
  3360. function toPosixPath(pth) {
  3361. return pth.replace(/[\\]/g, '/');
  3362. }
  3363. exports.toPosixPath = toPosixPath;
  3364. /**
  3365. * toWin32Path converts the given path to the win32 form. On Linux, / will be
  3366. * replaced with \\.
  3367. *
  3368. * @param pth. Path to transform.
  3369. * @return string Win32 path.
  3370. */
  3371. function toWin32Path(pth) {
  3372. return pth.replace(/[/]/g, '\\');
  3373. }
  3374. exports.toWin32Path = toWin32Path;
  3375. /**
  3376. * toPlatformPath converts the given path to a platform-specific path. It does
  3377. * this by replacing instances of / and \ with the platform-specific path
  3378. * separator.
  3379. *
  3380. * @param pth The path to platformize.
  3381. * @return string The platform-specific path.
  3382. */
  3383. function toPlatformPath(pth) {
  3384. return pth.replace(/[/\\]/g, path.sep);
  3385. }
  3386. exports.toPlatformPath = toPlatformPath;
  3387. //# sourceMappingURL=path-utils.js.map
  3388. /***/ }),
  3389. /***/ 1327:
  3390. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  3391. "use strict";
  3392. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  3393. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  3394. return new (P || (P = Promise))(function (resolve, reject) {
  3395. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  3396. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  3397. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  3398. step((generator = generator.apply(thisArg, _arguments || [])).next());
  3399. });
  3400. };
  3401. Object.defineProperty(exports, "__esModule", ({ value: true }));
  3402. exports.summary = exports.markdownSummary = exports.SUMMARY_DOCS_URL = exports.SUMMARY_ENV_VAR = void 0;
  3403. const os_1 = __nccwpck_require__(2037);
  3404. const fs_1 = __nccwpck_require__(7147);
  3405. const { access, appendFile, writeFile } = fs_1.promises;
  3406. exports.SUMMARY_ENV_VAR = 'GITHUB_STEP_SUMMARY';
  3407. exports.SUMMARY_DOCS_URL = 'https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#adding-a-job-summary';
  3408. class Summary {
  3409. constructor() {
  3410. this._buffer = '';
  3411. }
  3412. /**
  3413. * Finds the summary file path from the environment, rejects if env var is not found or file does not exist
  3414. * Also checks r/w permissions.
  3415. *
  3416. * @returns step summary file path
  3417. */
  3418. filePath() {
  3419. return __awaiter(this, void 0, void 0, function* () {
  3420. if (this._filePath) {
  3421. return this._filePath;
  3422. }
  3423. const pathFromEnv = process.env[exports.SUMMARY_ENV_VAR];
  3424. if (!pathFromEnv) {
  3425. throw new Error(`Unable to find environment variable for $${exports.SUMMARY_ENV_VAR}. Check if your runtime environment supports job summaries.`);
  3426. }
  3427. try {
  3428. yield access(pathFromEnv, fs_1.constants.R_OK | fs_1.constants.W_OK);
  3429. }
  3430. catch (_a) {
  3431. throw new Error(`Unable to access summary file: '${pathFromEnv}'. Check if the file has correct read/write permissions.`);
  3432. }
  3433. this._filePath = pathFromEnv;
  3434. return this._filePath;
  3435. });
  3436. }
  3437. /**
  3438. * Wraps content in an HTML tag, adding any HTML attributes
  3439. *
  3440. * @param {string} tag HTML tag to wrap
  3441. * @param {string | null} content content within the tag
  3442. * @param {[attribute: string]: string} attrs key-value list of HTML attributes to add
  3443. *
  3444. * @returns {string} content wrapped in HTML element
  3445. */
  3446. wrap(tag, content, attrs = {}) {
  3447. const htmlAttrs = Object.entries(attrs)
  3448. .map(([key, value]) => ` ${key}="${value}"`)
  3449. .join('');
  3450. if (!content) {
  3451. return `<${tag}${htmlAttrs}>`;
  3452. }
  3453. return `<${tag}${htmlAttrs}>${content}</${tag}>`;
  3454. }
  3455. /**
  3456. * Writes text in the buffer to the summary buffer file and empties buffer. Will append by default.
  3457. *
  3458. * @param {SummaryWriteOptions} [options] (optional) options for write operation
  3459. *
  3460. * @returns {Promise<Summary>} summary instance
  3461. */
  3462. write(options) {
  3463. return __awaiter(this, void 0, void 0, function* () {
  3464. const overwrite = !!(options === null || options === void 0 ? void 0 : options.overwrite);
  3465. const filePath = yield this.filePath();
  3466. const writeFunc = overwrite ? writeFile : appendFile;
  3467. yield writeFunc(filePath, this._buffer, { encoding: 'utf8' });
  3468. return this.emptyBuffer();
  3469. });
  3470. }
  3471. /**
  3472. * Clears the summary buffer and wipes the summary file
  3473. *
  3474. * @returns {Summary} summary instance
  3475. */
  3476. clear() {
  3477. return __awaiter(this, void 0, void 0, function* () {
  3478. return this.emptyBuffer().write({ overwrite: true });
  3479. });
  3480. }
  3481. /**
  3482. * Returns the current summary buffer as a string
  3483. *
  3484. * @returns {string} string of summary buffer
  3485. */
  3486. stringify() {
  3487. return this._buffer;
  3488. }
  3489. /**
  3490. * If the summary buffer is empty
  3491. *
  3492. * @returns {boolen} true if the buffer is empty
  3493. */
  3494. isEmptyBuffer() {
  3495. return this._buffer.length === 0;
  3496. }
  3497. /**
  3498. * Resets the summary buffer without writing to summary file
  3499. *
  3500. * @returns {Summary} summary instance
  3501. */
  3502. emptyBuffer() {
  3503. this._buffer = '';
  3504. return this;
  3505. }
  3506. /**
  3507. * Adds raw text to the summary buffer
  3508. *
  3509. * @param {string} text content to add
  3510. * @param {boolean} [addEOL=false] (optional) append an EOL to the raw text (default: false)
  3511. *
  3512. * @returns {Summary} summary instance
  3513. */
  3514. addRaw(text, addEOL = false) {
  3515. this._buffer += text;
  3516. return addEOL ? this.addEOL() : this;
  3517. }
  3518. /**
  3519. * Adds the operating system-specific end-of-line marker to the buffer
  3520. *
  3521. * @returns {Summary} summary instance
  3522. */
  3523. addEOL() {
  3524. return this.addRaw(os_1.EOL);
  3525. }
  3526. /**
  3527. * Adds an HTML codeblock to the summary buffer
  3528. *
  3529. * @param {string} code content to render within fenced code block
  3530. * @param {string} lang (optional) language to syntax highlight code
  3531. *
  3532. * @returns {Summary} summary instance
  3533. */
  3534. addCodeBlock(code, lang) {
  3535. const attrs = Object.assign({}, (lang && { lang }));
  3536. const element = this.wrap('pre', this.wrap('code', code), attrs);
  3537. return this.addRaw(element).addEOL();
  3538. }
  3539. /**
  3540. * Adds an HTML list to the summary buffer
  3541. *
  3542. * @param {string[]} items list of items to render
  3543. * @param {boolean} [ordered=false] (optional) if the rendered list should be ordered or not (default: false)
  3544. *
  3545. * @returns {Summary} summary instance
  3546. */
  3547. addList(items, ordered = false) {
  3548. const tag = ordered ? 'ol' : 'ul';
  3549. const listItems = items.map(item => this.wrap('li', item)).join('');
  3550. const element = this.wrap(tag, listItems);
  3551. return this.addRaw(element).addEOL();
  3552. }
  3553. /**
  3554. * Adds an HTML table to the summary buffer
  3555. *
  3556. * @param {SummaryTableCell[]} rows table rows
  3557. *
  3558. * @returns {Summary} summary instance
  3559. */
  3560. addTable(rows) {
  3561. const tableBody = rows
  3562. .map(row => {
  3563. const cells = row
  3564. .map(cell => {
  3565. if (typeof cell === 'string') {
  3566. return this.wrap('td', cell);
  3567. }
  3568. const { header, data, colspan, rowspan } = cell;
  3569. const tag = header ? 'th' : 'td';
  3570. const attrs = Object.assign(Object.assign({}, (colspan && { colspan })), (rowspan && { rowspan }));
  3571. return this.wrap(tag, data, attrs);
  3572. })
  3573. .join('');
  3574. return this.wrap('tr', cells);
  3575. })
  3576. .join('');
  3577. const element = this.wrap('table', tableBody);
  3578. return this.addRaw(element).addEOL();
  3579. }
  3580. /**
  3581. * Adds a collapsable HTML details element to the summary buffer
  3582. *
  3583. * @param {string} label text for the closed state
  3584. * @param {string} content collapsable content
  3585. *
  3586. * @returns {Summary} summary instance
  3587. */
  3588. addDetails(label, content) {
  3589. const element = this.wrap('details', this.wrap('summary', label) + content);
  3590. return this.addRaw(element).addEOL();
  3591. }
  3592. /**
  3593. * Adds an HTML image tag to the summary buffer
  3594. *
  3595. * @param {string} src path to the image you to embed
  3596. * @param {string} alt text description of the image
  3597. * @param {SummaryImageOptions} options (optional) addition image attributes
  3598. *
  3599. * @returns {Summary} summary instance
  3600. */
  3601. addImage(src, alt, options) {
  3602. const { width, height } = options || {};
  3603. const attrs = Object.assign(Object.assign({}, (width && { width })), (height && { height }));
  3604. const element = this.wrap('img', null, Object.assign({ src, alt }, attrs));
  3605. return this.addRaw(element).addEOL();
  3606. }
  3607. /**
  3608. * Adds an HTML section heading element
  3609. *
  3610. * @param {string} text heading text
  3611. * @param {number | string} [level=1] (optional) the heading level, default: 1
  3612. *
  3613. * @returns {Summary} summary instance
  3614. */
  3615. addHeading(text, level) {
  3616. const tag = `h${level}`;
  3617. const allowedTag = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'].includes(tag)
  3618. ? tag
  3619. : 'h1';
  3620. const element = this.wrap(allowedTag, text);
  3621. return this.addRaw(element).addEOL();
  3622. }
  3623. /**
  3624. * Adds an HTML thematic break (<hr>) to the summary buffer
  3625. *
  3626. * @returns {Summary} summary instance
  3627. */
  3628. addSeparator() {
  3629. const element = this.wrap('hr', null);
  3630. return this.addRaw(element).addEOL();
  3631. }
  3632. /**
  3633. * Adds an HTML line break (<br>) to the summary buffer
  3634. *
  3635. * @returns {Summary} summary instance
  3636. */
  3637. addBreak() {
  3638. const element = this.wrap('br', null);
  3639. return this.addRaw(element).addEOL();
  3640. }
  3641. /**
  3642. * Adds an HTML blockquote to the summary buffer
  3643. *
  3644. * @param {string} text quote text
  3645. * @param {string} cite (optional) citation url
  3646. *
  3647. * @returns {Summary} summary instance
  3648. */
  3649. addQuote(text, cite) {
  3650. const attrs = Object.assign({}, (cite && { cite }));
  3651. const element = this.wrap('blockquote', text, attrs);
  3652. return this.addRaw(element).addEOL();
  3653. }
  3654. /**
  3655. * Adds an HTML anchor tag to the summary buffer
  3656. *
  3657. * @param {string} text link text/content
  3658. * @param {string} href hyperlink
  3659. *
  3660. * @returns {Summary} summary instance
  3661. */
  3662. addLink(text, href) {
  3663. const element = this.wrap('a', text, { href });
  3664. return this.addRaw(element).addEOL();
  3665. }
  3666. }
  3667. const _summary = new Summary();
  3668. /**
  3669. * @deprecated use `core.summary`
  3670. */
  3671. exports.markdownSummary = _summary;
  3672. exports.summary = _summary;
  3673. //# sourceMappingURL=summary.js.map
  3674. /***/ }),
  3675. /***/ 5278:
  3676. /***/ ((__unused_webpack_module, exports) => {
  3677. "use strict";
  3678. // We use any as a valid input type
  3679. /* eslint-disable @typescript-eslint/no-explicit-any */
  3680. Object.defineProperty(exports, "__esModule", ({ value: true }));
  3681. exports.toCommandProperties = exports.toCommandValue = void 0;
  3682. /**
  3683. * Sanitizes an input into a string so it can be passed into issueCommand safely
  3684. * @param input input to sanitize into a string
  3685. */
  3686. function toCommandValue(input) {
  3687. if (input === null || input === undefined) {
  3688. return '';
  3689. }
  3690. else if (typeof input === 'string' || input instanceof String) {
  3691. return input;
  3692. }
  3693. return JSON.stringify(input);
  3694. }
  3695. exports.toCommandValue = toCommandValue;
  3696. /**
  3697. *
  3698. * @param annotationProperties
  3699. * @returns The command properties to send with the actual annotation command
  3700. * See IssueCommandProperties: https://github.com/actions/runner/blob/main/src/Runner.Worker/ActionCommandManager.cs#L646
  3701. */
  3702. function toCommandProperties(annotationProperties) {
  3703. if (!Object.keys(annotationProperties).length) {
  3704. return {};
  3705. }
  3706. return {
  3707. title: annotationProperties.title,
  3708. file: annotationProperties.file,
  3709. line: annotationProperties.startLine,
  3710. endLine: annotationProperties.endLine,
  3711. col: annotationProperties.startColumn,
  3712. endColumn: annotationProperties.endColumn
  3713. };
  3714. }
  3715. exports.toCommandProperties = toCommandProperties;
  3716. //# sourceMappingURL=utils.js.map
  3717. /***/ }),
  3718. /***/ 8974:
  3719. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  3720. "use strict";
  3721. Object.defineProperty(exports, "__esModule", ({
  3722. value: true
  3723. }));
  3724. Object.defineProperty(exports, "v1", ({
  3725. enumerable: true,
  3726. get: function () {
  3727. return _v.default;
  3728. }
  3729. }));
  3730. Object.defineProperty(exports, "v3", ({
  3731. enumerable: true,
  3732. get: function () {
  3733. return _v2.default;
  3734. }
  3735. }));
  3736. Object.defineProperty(exports, "v4", ({
  3737. enumerable: true,
  3738. get: function () {
  3739. return _v3.default;
  3740. }
  3741. }));
  3742. Object.defineProperty(exports, "v5", ({
  3743. enumerable: true,
  3744. get: function () {
  3745. return _v4.default;
  3746. }
  3747. }));
  3748. Object.defineProperty(exports, "NIL", ({
  3749. enumerable: true,
  3750. get: function () {
  3751. return _nil.default;
  3752. }
  3753. }));
  3754. Object.defineProperty(exports, "version", ({
  3755. enumerable: true,
  3756. get: function () {
  3757. return _version.default;
  3758. }
  3759. }));
  3760. Object.defineProperty(exports, "validate", ({
  3761. enumerable: true,
  3762. get: function () {
  3763. return _validate.default;
  3764. }
  3765. }));
  3766. Object.defineProperty(exports, "stringify", ({
  3767. enumerable: true,
  3768. get: function () {
  3769. return _stringify.default;
  3770. }
  3771. }));
  3772. Object.defineProperty(exports, "parse", ({
  3773. enumerable: true,
  3774. get: function () {
  3775. return _parse.default;
  3776. }
  3777. }));
  3778. var _v = _interopRequireDefault(__nccwpck_require__(1595));
  3779. var _v2 = _interopRequireDefault(__nccwpck_require__(6993));
  3780. var _v3 = _interopRequireDefault(__nccwpck_require__(1472));
  3781. var _v4 = _interopRequireDefault(__nccwpck_require__(6217));
  3782. var _nil = _interopRequireDefault(__nccwpck_require__(2381));
  3783. var _version = _interopRequireDefault(__nccwpck_require__(427));
  3784. var _validate = _interopRequireDefault(__nccwpck_require__(2609));
  3785. var _stringify = _interopRequireDefault(__nccwpck_require__(1458));
  3786. var _parse = _interopRequireDefault(__nccwpck_require__(6385));
  3787. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  3788. /***/ }),
  3789. /***/ 5842:
  3790. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  3791. "use strict";
  3792. Object.defineProperty(exports, "__esModule", ({
  3793. value: true
  3794. }));
  3795. exports["default"] = void 0;
  3796. var _crypto = _interopRequireDefault(__nccwpck_require__(6113));
  3797. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  3798. function md5(bytes) {
  3799. if (Array.isArray(bytes)) {
  3800. bytes = Buffer.from(bytes);
  3801. } else if (typeof bytes === 'string') {
  3802. bytes = Buffer.from(bytes, 'utf8');
  3803. }
  3804. return _crypto.default.createHash('md5').update(bytes).digest();
  3805. }
  3806. var _default = md5;
  3807. exports["default"] = _default;
  3808. /***/ }),
  3809. /***/ 2381:
  3810. /***/ ((__unused_webpack_module, exports) => {
  3811. "use strict";
  3812. Object.defineProperty(exports, "__esModule", ({
  3813. value: true
  3814. }));
  3815. exports["default"] = void 0;
  3816. var _default = '00000000-0000-0000-0000-000000000000';
  3817. exports["default"] = _default;
  3818. /***/ }),
  3819. /***/ 6385:
  3820. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  3821. "use strict";
  3822. Object.defineProperty(exports, "__esModule", ({
  3823. value: true
  3824. }));
  3825. exports["default"] = void 0;
  3826. var _validate = _interopRequireDefault(__nccwpck_require__(2609));
  3827. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  3828. function parse(uuid) {
  3829. if (!(0, _validate.default)(uuid)) {
  3830. throw TypeError('Invalid UUID');
  3831. }
  3832. let v;
  3833. const arr = new Uint8Array(16); // Parse ########-....-....-....-............
  3834. arr[0] = (v = parseInt(uuid.slice(0, 8), 16)) >>> 24;
  3835. arr[1] = v >>> 16 & 0xff;
  3836. arr[2] = v >>> 8 & 0xff;
  3837. arr[3] = v & 0xff; // Parse ........-####-....-....-............
  3838. arr[4] = (v = parseInt(uuid.slice(9, 13), 16)) >>> 8;
  3839. arr[5] = v & 0xff; // Parse ........-....-####-....-............
  3840. arr[6] = (v = parseInt(uuid.slice(14, 18), 16)) >>> 8;
  3841. arr[7] = v & 0xff; // Parse ........-....-....-####-............
  3842. arr[8] = (v = parseInt(uuid.slice(19, 23), 16)) >>> 8;
  3843. arr[9] = v & 0xff; // Parse ........-....-....-....-############
  3844. // (Use "/" to avoid 32-bit truncation when bit-shifting high-order bytes)
  3845. arr[10] = (v = parseInt(uuid.slice(24, 36), 16)) / 0x10000000000 & 0xff;
  3846. arr[11] = v / 0x100000000 & 0xff;
  3847. arr[12] = v >>> 24 & 0xff;
  3848. arr[13] = v >>> 16 & 0xff;
  3849. arr[14] = v >>> 8 & 0xff;
  3850. arr[15] = v & 0xff;
  3851. return arr;
  3852. }
  3853. var _default = parse;
  3854. exports["default"] = _default;
  3855. /***/ }),
  3856. /***/ 6230:
  3857. /***/ ((__unused_webpack_module, exports) => {
  3858. "use strict";
  3859. Object.defineProperty(exports, "__esModule", ({
  3860. value: true
  3861. }));
  3862. exports["default"] = void 0;
  3863. 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;
  3864. exports["default"] = _default;
  3865. /***/ }),
  3866. /***/ 9784:
  3867. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  3868. "use strict";
  3869. Object.defineProperty(exports, "__esModule", ({
  3870. value: true
  3871. }));
  3872. exports["default"] = rng;
  3873. var _crypto = _interopRequireDefault(__nccwpck_require__(6113));
  3874. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  3875. const rnds8Pool = new Uint8Array(256); // # of random values to pre-allocate
  3876. let poolPtr = rnds8Pool.length;
  3877. function rng() {
  3878. if (poolPtr > rnds8Pool.length - 16) {
  3879. _crypto.default.randomFillSync(rnds8Pool);
  3880. poolPtr = 0;
  3881. }
  3882. return rnds8Pool.slice(poolPtr, poolPtr += 16);
  3883. }
  3884. /***/ }),
  3885. /***/ 8844:
  3886. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  3887. "use strict";
  3888. Object.defineProperty(exports, "__esModule", ({
  3889. value: true
  3890. }));
  3891. exports["default"] = void 0;
  3892. var _crypto = _interopRequireDefault(__nccwpck_require__(6113));
  3893. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  3894. function sha1(bytes) {
  3895. if (Array.isArray(bytes)) {
  3896. bytes = Buffer.from(bytes);
  3897. } else if (typeof bytes === 'string') {
  3898. bytes = Buffer.from(bytes, 'utf8');
  3899. }
  3900. return _crypto.default.createHash('sha1').update(bytes).digest();
  3901. }
  3902. var _default = sha1;
  3903. exports["default"] = _default;
  3904. /***/ }),
  3905. /***/ 1458:
  3906. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  3907. "use strict";
  3908. Object.defineProperty(exports, "__esModule", ({
  3909. value: true
  3910. }));
  3911. exports["default"] = void 0;
  3912. var _validate = _interopRequireDefault(__nccwpck_require__(2609));
  3913. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  3914. /**
  3915. * Convert array of 16 byte values to UUID string format of the form:
  3916. * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
  3917. */
  3918. const byteToHex = [];
  3919. for (let i = 0; i < 256; ++i) {
  3920. byteToHex.push((i + 0x100).toString(16).substr(1));
  3921. }
  3922. function stringify(arr, offset = 0) {
  3923. // Note: Be careful editing this code! It's been tuned for performance
  3924. // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
  3925. 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
  3926. // of the following:
  3927. // - One or more input array values don't map to a hex octet (leading to
  3928. // "undefined" in the uuid)
  3929. // - Invalid input values for the RFC `version` or `variant` fields
  3930. if (!(0, _validate.default)(uuid)) {
  3931. throw TypeError('Stringified UUID is invalid');
  3932. }
  3933. return uuid;
  3934. }
  3935. var _default = stringify;
  3936. exports["default"] = _default;
  3937. /***/ }),
  3938. /***/ 1595:
  3939. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  3940. "use strict";
  3941. Object.defineProperty(exports, "__esModule", ({
  3942. value: true
  3943. }));
  3944. exports["default"] = void 0;
  3945. var _rng = _interopRequireDefault(__nccwpck_require__(9784));
  3946. var _stringify = _interopRequireDefault(__nccwpck_require__(1458));
  3947. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  3948. // **`v1()` - Generate time-based UUID**
  3949. //
  3950. // Inspired by https://github.com/LiosK/UUID.js
  3951. // and http://docs.python.org/library/uuid.html
  3952. let _nodeId;
  3953. let _clockseq; // Previous uuid creation time
  3954. let _lastMSecs = 0;
  3955. let _lastNSecs = 0; // See https://github.com/uuidjs/uuid for API details
  3956. function v1(options, buf, offset) {
  3957. let i = buf && offset || 0;
  3958. const b = buf || new Array(16);
  3959. options = options || {};
  3960. let node = options.node || _nodeId;
  3961. let clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq; // node and clockseq need to be initialized to random values if they're not
  3962. // specified. We do this lazily to minimize issues related to insufficient
  3963. // system entropy. See #189
  3964. if (node == null || clockseq == null) {
  3965. const seedBytes = options.random || (options.rng || _rng.default)();
  3966. if (node == null) {
  3967. // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1)
  3968. node = _nodeId = [seedBytes[0] | 0x01, seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]];
  3969. }
  3970. if (clockseq == null) {
  3971. // Per 4.2.2, randomize (14 bit) clockseq
  3972. clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff;
  3973. }
  3974. } // UUID timestamps are 100 nano-second units since the Gregorian epoch,
  3975. // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so
  3976. // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs'
  3977. // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00.
  3978. let msecs = options.msecs !== undefined ? options.msecs : Date.now(); // Per 4.2.1.2, use count of uuid's generated during the current clock
  3979. // cycle to simulate higher resolution clock
  3980. let nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1; // Time since last uuid creation (in msecs)
  3981. const dt = msecs - _lastMSecs + (nsecs - _lastNSecs) / 10000; // Per 4.2.1.2, Bump clockseq on clock regression
  3982. if (dt < 0 && options.clockseq === undefined) {
  3983. clockseq = clockseq + 1 & 0x3fff;
  3984. } // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new
  3985. // time interval
  3986. if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) {
  3987. nsecs = 0;
  3988. } // Per 4.2.1.2 Throw error if too many uuids are requested
  3989. if (nsecs >= 10000) {
  3990. throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");
  3991. }
  3992. _lastMSecs = msecs;
  3993. _lastNSecs = nsecs;
  3994. _clockseq = clockseq; // Per 4.1.4 - Convert from unix epoch to Gregorian epoch
  3995. msecs += 12219292800000; // `time_low`
  3996. const tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000;
  3997. b[i++] = tl >>> 24 & 0xff;
  3998. b[i++] = tl >>> 16 & 0xff;
  3999. b[i++] = tl >>> 8 & 0xff;
  4000. b[i++] = tl & 0xff; // `time_mid`
  4001. const tmh = msecs / 0x100000000 * 10000 & 0xfffffff;
  4002. b[i++] = tmh >>> 8 & 0xff;
  4003. b[i++] = tmh & 0xff; // `time_high_and_version`
  4004. b[i++] = tmh >>> 24 & 0xf | 0x10; // include version
  4005. b[i++] = tmh >>> 16 & 0xff; // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant)
  4006. b[i++] = clockseq >>> 8 | 0x80; // `clock_seq_low`
  4007. b[i++] = clockseq & 0xff; // `node`
  4008. for (let n = 0; n < 6; ++n) {
  4009. b[i + n] = node[n];
  4010. }
  4011. return buf || (0, _stringify.default)(b);
  4012. }
  4013. var _default = v1;
  4014. exports["default"] = _default;
  4015. /***/ }),
  4016. /***/ 6993:
  4017. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  4018. "use strict";
  4019. Object.defineProperty(exports, "__esModule", ({
  4020. value: true
  4021. }));
  4022. exports["default"] = void 0;
  4023. var _v = _interopRequireDefault(__nccwpck_require__(5920));
  4024. var _md = _interopRequireDefault(__nccwpck_require__(5842));
  4025. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  4026. const v3 = (0, _v.default)('v3', 0x30, _md.default);
  4027. var _default = v3;
  4028. exports["default"] = _default;
  4029. /***/ }),
  4030. /***/ 5920:
  4031. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  4032. "use strict";
  4033. Object.defineProperty(exports, "__esModule", ({
  4034. value: true
  4035. }));
  4036. exports["default"] = _default;
  4037. exports.URL = exports.DNS = void 0;
  4038. var _stringify = _interopRequireDefault(__nccwpck_require__(1458));
  4039. var _parse = _interopRequireDefault(__nccwpck_require__(6385));
  4040. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  4041. function stringToBytes(str) {
  4042. str = unescape(encodeURIComponent(str)); // UTF8 escape
  4043. const bytes = [];
  4044. for (let i = 0; i < str.length; ++i) {
  4045. bytes.push(str.charCodeAt(i));
  4046. }
  4047. return bytes;
  4048. }
  4049. const DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8';
  4050. exports.DNS = DNS;
  4051. const URL = '6ba7b811-9dad-11d1-80b4-00c04fd430c8';
  4052. exports.URL = URL;
  4053. function _default(name, version, hashfunc) {
  4054. function generateUUID(value, namespace, buf, offset) {
  4055. if (typeof value === 'string') {
  4056. value = stringToBytes(value);
  4057. }
  4058. if (typeof namespace === 'string') {
  4059. namespace = (0, _parse.default)(namespace);
  4060. }
  4061. if (namespace.length !== 16) {
  4062. throw TypeError('Namespace must be array-like (16 iterable integer values, 0-255)');
  4063. } // Compute hash of namespace and value, Per 4.3
  4064. // Future: Use spread syntax when supported on all platforms, e.g. `bytes =
  4065. // hashfunc([...namespace, ... value])`
  4066. let bytes = new Uint8Array(16 + value.length);
  4067. bytes.set(namespace);
  4068. bytes.set(value, namespace.length);
  4069. bytes = hashfunc(bytes);
  4070. bytes[6] = bytes[6] & 0x0f | version;
  4071. bytes[8] = bytes[8] & 0x3f | 0x80;
  4072. if (buf) {
  4073. offset = offset || 0;
  4074. for (let i = 0; i < 16; ++i) {
  4075. buf[offset + i] = bytes[i];
  4076. }
  4077. return buf;
  4078. }
  4079. return (0, _stringify.default)(bytes);
  4080. } // Function#name is not settable on some platforms (#270)
  4081. try {
  4082. generateUUID.name = name; // eslint-disable-next-line no-empty
  4083. } catch (err) {} // For CommonJS default export support
  4084. generateUUID.DNS = DNS;
  4085. generateUUID.URL = URL;
  4086. return generateUUID;
  4087. }
  4088. /***/ }),
  4089. /***/ 1472:
  4090. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  4091. "use strict";
  4092. Object.defineProperty(exports, "__esModule", ({
  4093. value: true
  4094. }));
  4095. exports["default"] = void 0;
  4096. var _rng = _interopRequireDefault(__nccwpck_require__(9784));
  4097. var _stringify = _interopRequireDefault(__nccwpck_require__(1458));
  4098. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  4099. function v4(options, buf, offset) {
  4100. options = options || {};
  4101. const rnds = options.random || (options.rng || _rng.default)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
  4102. rnds[6] = rnds[6] & 0x0f | 0x40;
  4103. rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided
  4104. if (buf) {
  4105. offset = offset || 0;
  4106. for (let i = 0; i < 16; ++i) {
  4107. buf[offset + i] = rnds[i];
  4108. }
  4109. return buf;
  4110. }
  4111. return (0, _stringify.default)(rnds);
  4112. }
  4113. var _default = v4;
  4114. exports["default"] = _default;
  4115. /***/ }),
  4116. /***/ 6217:
  4117. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  4118. "use strict";
  4119. Object.defineProperty(exports, "__esModule", ({
  4120. value: true
  4121. }));
  4122. exports["default"] = void 0;
  4123. var _v = _interopRequireDefault(__nccwpck_require__(5920));
  4124. var _sha = _interopRequireDefault(__nccwpck_require__(8844));
  4125. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  4126. const v5 = (0, _v.default)('v5', 0x50, _sha.default);
  4127. var _default = v5;
  4128. exports["default"] = _default;
  4129. /***/ }),
  4130. /***/ 2609:
  4131. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  4132. "use strict";
  4133. Object.defineProperty(exports, "__esModule", ({
  4134. value: true
  4135. }));
  4136. exports["default"] = void 0;
  4137. var _regex = _interopRequireDefault(__nccwpck_require__(6230));
  4138. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  4139. function validate(uuid) {
  4140. return typeof uuid === 'string' && _regex.default.test(uuid);
  4141. }
  4142. var _default = validate;
  4143. exports["default"] = _default;
  4144. /***/ }),
  4145. /***/ 427:
  4146. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  4147. "use strict";
  4148. Object.defineProperty(exports, "__esModule", ({
  4149. value: true
  4150. }));
  4151. exports["default"] = void 0;
  4152. var _validate = _interopRequireDefault(__nccwpck_require__(2609));
  4153. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  4154. function version(uuid) {
  4155. if (!(0, _validate.default)(uuid)) {
  4156. throw TypeError('Invalid UUID');
  4157. }
  4158. return parseInt(uuid.substr(14, 1), 16);
  4159. }
  4160. var _default = version;
  4161. exports["default"] = _default;
  4162. /***/ }),
  4163. /***/ 1514:
  4164. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  4165. "use strict";
  4166. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  4167. if (k2 === undefined) k2 = k;
  4168. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  4169. }) : (function(o, m, k, k2) {
  4170. if (k2 === undefined) k2 = k;
  4171. o[k2] = m[k];
  4172. }));
  4173. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  4174. Object.defineProperty(o, "default", { enumerable: true, value: v });
  4175. }) : function(o, v) {
  4176. o["default"] = v;
  4177. });
  4178. var __importStar = (this && this.__importStar) || function (mod) {
  4179. if (mod && mod.__esModule) return mod;
  4180. var result = {};
  4181. if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  4182. __setModuleDefault(result, mod);
  4183. return result;
  4184. };
  4185. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  4186. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  4187. return new (P || (P = Promise))(function (resolve, reject) {
  4188. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  4189. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  4190. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  4191. step((generator = generator.apply(thisArg, _arguments || [])).next());
  4192. });
  4193. };
  4194. Object.defineProperty(exports, "__esModule", ({ value: true }));
  4195. exports.getExecOutput = exports.exec = void 0;
  4196. const string_decoder_1 = __nccwpck_require__(1576);
  4197. const tr = __importStar(__nccwpck_require__(8159));
  4198. /**
  4199. * Exec a command.
  4200. * Output will be streamed to the live console.
  4201. * Returns promise with return code
  4202. *
  4203. * @param commandLine command to execute (can include additional args). Must be correctly escaped.
  4204. * @param args optional arguments for tool. Escaping is handled by the lib.
  4205. * @param options optional exec options. See ExecOptions
  4206. * @returns Promise<number> exit code
  4207. */
  4208. function exec(commandLine, args, options) {
  4209. return __awaiter(this, void 0, void 0, function* () {
  4210. const commandArgs = tr.argStringToArray(commandLine);
  4211. if (commandArgs.length === 0) {
  4212. throw new Error(`Parameter 'commandLine' cannot be null or empty.`);
  4213. }
  4214. // Path to tool to execute should be first arg
  4215. const toolPath = commandArgs[0];
  4216. args = commandArgs.slice(1).concat(args || []);
  4217. const runner = new tr.ToolRunner(toolPath, args, options);
  4218. return runner.exec();
  4219. });
  4220. }
  4221. exports.exec = exec;
  4222. /**
  4223. * Exec a command and get the output.
  4224. * Output will be streamed to the live console.
  4225. * Returns promise with the exit code and collected stdout and stderr
  4226. *
  4227. * @param commandLine command to execute (can include additional args). Must be correctly escaped.
  4228. * @param args optional arguments for tool. Escaping is handled by the lib.
  4229. * @param options optional exec options. See ExecOptions
  4230. * @returns Promise<ExecOutput> exit code, stdout, and stderr
  4231. */
  4232. function getExecOutput(commandLine, args, options) {
  4233. var _a, _b;
  4234. return __awaiter(this, void 0, void 0, function* () {
  4235. let stdout = '';
  4236. let stderr = '';
  4237. //Using string decoder covers the case where a mult-byte character is split
  4238. const stdoutDecoder = new string_decoder_1.StringDecoder('utf8');
  4239. const stderrDecoder = new string_decoder_1.StringDecoder('utf8');
  4240. const originalStdoutListener = (_a = options === null || options === void 0 ? void 0 : options.listeners) === null || _a === void 0 ? void 0 : _a.stdout;
  4241. const originalStdErrListener = (_b = options === null || options === void 0 ? void 0 : options.listeners) === null || _b === void 0 ? void 0 : _b.stderr;
  4242. const stdErrListener = (data) => {
  4243. stderr += stderrDecoder.write(data);
  4244. if (originalStdErrListener) {
  4245. originalStdErrListener(data);
  4246. }
  4247. };
  4248. const stdOutListener = (data) => {
  4249. stdout += stdoutDecoder.write(data);
  4250. if (originalStdoutListener) {
  4251. originalStdoutListener(data);
  4252. }
  4253. };
  4254. const listeners = Object.assign(Object.assign({}, options === null || options === void 0 ? void 0 : options.listeners), { stdout: stdOutListener, stderr: stdErrListener });
  4255. const exitCode = yield exec(commandLine, args, Object.assign(Object.assign({}, options), { listeners }));
  4256. //flush any remaining characters
  4257. stdout += stdoutDecoder.end();
  4258. stderr += stderrDecoder.end();
  4259. return {
  4260. exitCode,
  4261. stdout,
  4262. stderr
  4263. };
  4264. });
  4265. }
  4266. exports.getExecOutput = getExecOutput;
  4267. //# sourceMappingURL=exec.js.map
  4268. /***/ }),
  4269. /***/ 8159:
  4270. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  4271. "use strict";
  4272. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  4273. if (k2 === undefined) k2 = k;
  4274. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  4275. }) : (function(o, m, k, k2) {
  4276. if (k2 === undefined) k2 = k;
  4277. o[k2] = m[k];
  4278. }));
  4279. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  4280. Object.defineProperty(o, "default", { enumerable: true, value: v });
  4281. }) : function(o, v) {
  4282. o["default"] = v;
  4283. });
  4284. var __importStar = (this && this.__importStar) || function (mod) {
  4285. if (mod && mod.__esModule) return mod;
  4286. var result = {};
  4287. if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  4288. __setModuleDefault(result, mod);
  4289. return result;
  4290. };
  4291. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  4292. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  4293. return new (P || (P = Promise))(function (resolve, reject) {
  4294. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  4295. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  4296. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  4297. step((generator = generator.apply(thisArg, _arguments || [])).next());
  4298. });
  4299. };
  4300. Object.defineProperty(exports, "__esModule", ({ value: true }));
  4301. exports.argStringToArray = exports.ToolRunner = void 0;
  4302. const os = __importStar(__nccwpck_require__(2037));
  4303. const events = __importStar(__nccwpck_require__(2361));
  4304. const child = __importStar(__nccwpck_require__(2081));
  4305. const path = __importStar(__nccwpck_require__(1017));
  4306. const io = __importStar(__nccwpck_require__(7436));
  4307. const ioUtil = __importStar(__nccwpck_require__(1962));
  4308. const timers_1 = __nccwpck_require__(9512);
  4309. /* eslint-disable @typescript-eslint/unbound-method */
  4310. const IS_WINDOWS = process.platform === 'win32';
  4311. /*
  4312. * Class for running command line tools. Handles quoting and arg parsing in a platform agnostic way.
  4313. */
  4314. class ToolRunner extends events.EventEmitter {
  4315. constructor(toolPath, args, options) {
  4316. super();
  4317. if (!toolPath) {
  4318. throw new Error("Parameter 'toolPath' cannot be null or empty.");
  4319. }
  4320. this.toolPath = toolPath;
  4321. this.args = args || [];
  4322. this.options = options || {};
  4323. }
  4324. _debug(message) {
  4325. if (this.options.listeners && this.options.listeners.debug) {
  4326. this.options.listeners.debug(message);
  4327. }
  4328. }
  4329. _getCommandString(options, noPrefix) {
  4330. const toolPath = this._getSpawnFileName();
  4331. const args = this._getSpawnArgs(options);
  4332. let cmd = noPrefix ? '' : '[command]'; // omit prefix when piped to a second tool
  4333. if (IS_WINDOWS) {
  4334. // Windows + cmd file
  4335. if (this._isCmdFile()) {
  4336. cmd += toolPath;
  4337. for (const a of args) {
  4338. cmd += ` ${a}`;
  4339. }
  4340. }
  4341. // Windows + verbatim
  4342. else if (options.windowsVerbatimArguments) {
  4343. cmd += `"${toolPath}"`;
  4344. for (const a of args) {
  4345. cmd += ` ${a}`;
  4346. }
  4347. }
  4348. // Windows (regular)
  4349. else {
  4350. cmd += this._windowsQuoteCmdArg(toolPath);
  4351. for (const a of args) {
  4352. cmd += ` ${this._windowsQuoteCmdArg(a)}`;
  4353. }
  4354. }
  4355. }
  4356. else {
  4357. // OSX/Linux - this can likely be improved with some form of quoting.
  4358. // creating processes on Unix is fundamentally different than Windows.
  4359. // on Unix, execvp() takes an arg array.
  4360. cmd += toolPath;
  4361. for (const a of args) {
  4362. cmd += ` ${a}`;
  4363. }
  4364. }
  4365. return cmd;
  4366. }
  4367. _processLineBuffer(data, strBuffer, onLine) {
  4368. try {
  4369. let s = strBuffer + data.toString();
  4370. let n = s.indexOf(os.EOL);
  4371. while (n > -1) {
  4372. const line = s.substring(0, n);
  4373. onLine(line);
  4374. // the rest of the string ...
  4375. s = s.substring(n + os.EOL.length);
  4376. n = s.indexOf(os.EOL);
  4377. }
  4378. return s;
  4379. }
  4380. catch (err) {
  4381. // streaming lines to console is best effort. Don't fail a build.
  4382. this._debug(`error processing line. Failed with error ${err}`);
  4383. return '';
  4384. }
  4385. }
  4386. _getSpawnFileName() {
  4387. if (IS_WINDOWS) {
  4388. if (this._isCmdFile()) {
  4389. return process.env['COMSPEC'] || 'cmd.exe';
  4390. }
  4391. }
  4392. return this.toolPath;
  4393. }
  4394. _getSpawnArgs(options) {
  4395. if (IS_WINDOWS) {
  4396. if (this._isCmdFile()) {
  4397. let argline = `/D /S /C "${this._windowsQuoteCmdArg(this.toolPath)}`;
  4398. for (const a of this.args) {
  4399. argline += ' ';
  4400. argline += options.windowsVerbatimArguments
  4401. ? a
  4402. : this._windowsQuoteCmdArg(a);
  4403. }
  4404. argline += '"';
  4405. return [argline];
  4406. }
  4407. }
  4408. return this.args;
  4409. }
  4410. _endsWith(str, end) {
  4411. return str.endsWith(end);
  4412. }
  4413. _isCmdFile() {
  4414. const upperToolPath = this.toolPath.toUpperCase();
  4415. return (this._endsWith(upperToolPath, '.CMD') ||
  4416. this._endsWith(upperToolPath, '.BAT'));
  4417. }
  4418. _windowsQuoteCmdArg(arg) {
  4419. // for .exe, apply the normal quoting rules that libuv applies
  4420. if (!this._isCmdFile()) {
  4421. return this._uvQuoteCmdArg(arg);
  4422. }
  4423. // otherwise apply quoting rules specific to the cmd.exe command line parser.
  4424. // the libuv rules are generic and are not designed specifically for cmd.exe
  4425. // command line parser.
  4426. //
  4427. // for a detailed description of the cmd.exe command line parser, refer to
  4428. // http://stackoverflow.com/questions/4094699/how-does-the-windows-command-interpreter-cmd-exe-parse-scripts/7970912#7970912
  4429. // need quotes for empty arg
  4430. if (!arg) {
  4431. return '""';
  4432. }
  4433. // determine whether the arg needs to be quoted
  4434. const cmdSpecialChars = [
  4435. ' ',
  4436. '\t',
  4437. '&',
  4438. '(',
  4439. ')',
  4440. '[',
  4441. ']',
  4442. '{',
  4443. '}',
  4444. '^',
  4445. '=',
  4446. ';',
  4447. '!',
  4448. "'",
  4449. '+',
  4450. ',',
  4451. '`',
  4452. '~',
  4453. '|',
  4454. '<',
  4455. '>',
  4456. '"'
  4457. ];
  4458. let needsQuotes = false;
  4459. for (const char of arg) {
  4460. if (cmdSpecialChars.some(x => x === char)) {
  4461. needsQuotes = true;
  4462. break;
  4463. }
  4464. }
  4465. // short-circuit if quotes not needed
  4466. if (!needsQuotes) {
  4467. return arg;
  4468. }
  4469. // the following quoting rules are very similar to the rules that by libuv applies.
  4470. //
  4471. // 1) wrap the string in quotes
  4472. //
  4473. // 2) double-up quotes - i.e. " => ""
  4474. //
  4475. // this is different from the libuv quoting rules. libuv replaces " with \", which unfortunately
  4476. // doesn't work well with a cmd.exe command line.
  4477. //
  4478. // note, replacing " with "" also works well if the arg is passed to a downstream .NET console app.
  4479. // for example, the command line:
  4480. // foo.exe "myarg:""my val"""
  4481. // is parsed by a .NET console app into an arg array:
  4482. // [ "myarg:\"my val\"" ]
  4483. // which is the same end result when applying libuv quoting rules. although the actual
  4484. // command line from libuv quoting rules would look like:
  4485. // foo.exe "myarg:\"my val\""
  4486. //
  4487. // 3) double-up slashes that precede a quote,
  4488. // e.g. hello \world => "hello \world"
  4489. // hello\"world => "hello\\""world"
  4490. // hello\\"world => "hello\\\\""world"
  4491. // hello world\ => "hello world\\"
  4492. //
  4493. // technically this is not required for a cmd.exe command line, or the batch argument parser.
  4494. // the reasons for including this as a .cmd quoting rule are:
  4495. //
  4496. // a) this is optimized for the scenario where the argument is passed from the .cmd file to an
  4497. // external program. many programs (e.g. .NET console apps) rely on the slash-doubling rule.
  4498. //
  4499. // b) it's what we've been doing previously (by deferring to node default behavior) and we
  4500. // haven't heard any complaints about that aspect.
  4501. //
  4502. // note, a weakness of the quoting rules chosen here, is that % is not escaped. in fact, % cannot be
  4503. // escaped when used on the command line directly - even though within a .cmd file % can be escaped
  4504. // by using %%.
  4505. //
  4506. // the saving grace is, on the command line, %var% is left as-is if var is not defined. this contrasts
  4507. // the line parsing rules within a .cmd file, where if var is not defined it is replaced with nothing.
  4508. //
  4509. // one option that was explored was replacing % with ^% - i.e. %var% => ^%var^%. this hack would
  4510. // often work, since it is unlikely that var^ would exist, and the ^ character is removed when the
  4511. // variable is used. the problem, however, is that ^ is not removed when %* is used to pass the args
  4512. // to an external program.
  4513. //
  4514. // an unexplored potential solution for the % escaping problem, is to create a wrapper .cmd file.
  4515. // % can be escaped within a .cmd file.
  4516. let reverse = '"';
  4517. let quoteHit = true;
  4518. for (let i = arg.length; i > 0; i--) {
  4519. // walk the string in reverse
  4520. reverse += arg[i - 1];
  4521. if (quoteHit && arg[i - 1] === '\\') {
  4522. reverse += '\\'; // double the slash
  4523. }
  4524. else if (arg[i - 1] === '"') {
  4525. quoteHit = true;
  4526. reverse += '"'; // double the quote
  4527. }
  4528. else {
  4529. quoteHit = false;
  4530. }
  4531. }
  4532. reverse += '"';
  4533. return reverse
  4534. .split('')
  4535. .reverse()
  4536. .join('');
  4537. }
  4538. _uvQuoteCmdArg(arg) {
  4539. // Tool runner wraps child_process.spawn() and needs to apply the same quoting as
  4540. // Node in certain cases where the undocumented spawn option windowsVerbatimArguments
  4541. // is used.
  4542. //
  4543. // Since this function is a port of quote_cmd_arg from Node 4.x (technically, lib UV,
  4544. // see https://github.com/nodejs/node/blob/v4.x/deps/uv/src/win/process.c for details),
  4545. // pasting copyright notice from Node within this function:
  4546. //
  4547. // Copyright Joyent, Inc. and other Node contributors. All rights reserved.
  4548. //
  4549. // Permission is hereby granted, free of charge, to any person obtaining a copy
  4550. // of this software and associated documentation files (the "Software"), to
  4551. // deal in the Software without restriction, including without limitation the
  4552. // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
  4553. // sell copies of the Software, and to permit persons to whom the Software is
  4554. // furnished to do so, subject to the following conditions:
  4555. //
  4556. // The above copyright notice and this permission notice shall be included in
  4557. // all copies or substantial portions of the Software.
  4558. //
  4559. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  4560. // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  4561. // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  4562. // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  4563. // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  4564. // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
  4565. // IN THE SOFTWARE.
  4566. if (!arg) {
  4567. // Need double quotation for empty argument
  4568. return '""';
  4569. }
  4570. if (!arg.includes(' ') && !arg.includes('\t') && !arg.includes('"')) {
  4571. // No quotation needed
  4572. return arg;
  4573. }
  4574. if (!arg.includes('"') && !arg.includes('\\')) {
  4575. // No embedded double quotes or backslashes, so I can just wrap
  4576. // quote marks around the whole thing.
  4577. return `"${arg}"`;
  4578. }
  4579. // Expected input/output:
  4580. // input : hello"world
  4581. // output: "hello\"world"
  4582. // input : hello""world
  4583. // output: "hello\"\"world"
  4584. // input : hello\world
  4585. // output: hello\world
  4586. // input : hello\\world
  4587. // output: hello\\world
  4588. // input : hello\"world
  4589. // output: "hello\\\"world"
  4590. // input : hello\\"world
  4591. // output: "hello\\\\\"world"
  4592. // input : hello world\
  4593. // output: "hello world\\" - note the comment in libuv actually reads "hello world\"
  4594. // but it appears the comment is wrong, it should be "hello world\\"
  4595. let reverse = '"';
  4596. let quoteHit = true;
  4597. for (let i = arg.length; i > 0; i--) {
  4598. // walk the string in reverse
  4599. reverse += arg[i - 1];
  4600. if (quoteHit && arg[i - 1] === '\\') {
  4601. reverse += '\\';
  4602. }
  4603. else if (arg[i - 1] === '"') {
  4604. quoteHit = true;
  4605. reverse += '\\';
  4606. }
  4607. else {
  4608. quoteHit = false;
  4609. }
  4610. }
  4611. reverse += '"';
  4612. return reverse
  4613. .split('')
  4614. .reverse()
  4615. .join('');
  4616. }
  4617. _cloneExecOptions(options) {
  4618. options = options || {};
  4619. const result = {
  4620. cwd: options.cwd || process.cwd(),
  4621. env: options.env || process.env,
  4622. silent: options.silent || false,
  4623. windowsVerbatimArguments: options.windowsVerbatimArguments || false,
  4624. failOnStdErr: options.failOnStdErr || false,
  4625. ignoreReturnCode: options.ignoreReturnCode || false,
  4626. delay: options.delay || 10000
  4627. };
  4628. result.outStream = options.outStream || process.stdout;
  4629. result.errStream = options.errStream || process.stderr;
  4630. return result;
  4631. }
  4632. _getSpawnOptions(options, toolPath) {
  4633. options = options || {};
  4634. const result = {};
  4635. result.cwd = options.cwd;
  4636. result.env = options.env;
  4637. result['windowsVerbatimArguments'] =
  4638. options.windowsVerbatimArguments || this._isCmdFile();
  4639. if (options.windowsVerbatimArguments) {
  4640. result.argv0 = `"${toolPath}"`;
  4641. }
  4642. return result;
  4643. }
  4644. /**
  4645. * Exec a tool.
  4646. * Output will be streamed to the live console.
  4647. * Returns promise with return code
  4648. *
  4649. * @param tool path to tool to exec
  4650. * @param options optional exec options. See ExecOptions
  4651. * @returns number
  4652. */
  4653. exec() {
  4654. return __awaiter(this, void 0, void 0, function* () {
  4655. // root the tool path if it is unrooted and contains relative pathing
  4656. if (!ioUtil.isRooted(this.toolPath) &&
  4657. (this.toolPath.includes('/') ||
  4658. (IS_WINDOWS && this.toolPath.includes('\\')))) {
  4659. // prefer options.cwd if it is specified, however options.cwd may also need to be rooted
  4660. this.toolPath = path.resolve(process.cwd(), this.options.cwd || process.cwd(), this.toolPath);
  4661. }
  4662. // if the tool is only a file name, then resolve it from the PATH
  4663. // otherwise verify it exists (add extension on Windows if necessary)
  4664. this.toolPath = yield io.which(this.toolPath, true);
  4665. return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
  4666. this._debug(`exec tool: ${this.toolPath}`);
  4667. this._debug('arguments:');
  4668. for (const arg of this.args) {
  4669. this._debug(` ${arg}`);
  4670. }
  4671. const optionsNonNull = this._cloneExecOptions(this.options);
  4672. if (!optionsNonNull.silent && optionsNonNull.outStream) {
  4673. optionsNonNull.outStream.write(this._getCommandString(optionsNonNull) + os.EOL);
  4674. }
  4675. const state = new ExecState(optionsNonNull, this.toolPath);
  4676. state.on('debug', (message) => {
  4677. this._debug(message);
  4678. });
  4679. if (this.options.cwd && !(yield ioUtil.exists(this.options.cwd))) {
  4680. return reject(new Error(`The cwd: ${this.options.cwd} does not exist!`));
  4681. }
  4682. const fileName = this._getSpawnFileName();
  4683. const cp = child.spawn(fileName, this._getSpawnArgs(optionsNonNull), this._getSpawnOptions(this.options, fileName));
  4684. let stdbuffer = '';
  4685. if (cp.stdout) {
  4686. cp.stdout.on('data', (data) => {
  4687. if (this.options.listeners && this.options.listeners.stdout) {
  4688. this.options.listeners.stdout(data);
  4689. }
  4690. if (!optionsNonNull.silent && optionsNonNull.outStream) {
  4691. optionsNonNull.outStream.write(data);
  4692. }
  4693. stdbuffer = this._processLineBuffer(data, stdbuffer, (line) => {
  4694. if (this.options.listeners && this.options.listeners.stdline) {
  4695. this.options.listeners.stdline(line);
  4696. }
  4697. });
  4698. });
  4699. }
  4700. let errbuffer = '';
  4701. if (cp.stderr) {
  4702. cp.stderr.on('data', (data) => {
  4703. state.processStderr = true;
  4704. if (this.options.listeners && this.options.listeners.stderr) {
  4705. this.options.listeners.stderr(data);
  4706. }
  4707. if (!optionsNonNull.silent &&
  4708. optionsNonNull.errStream &&
  4709. optionsNonNull.outStream) {
  4710. const s = optionsNonNull.failOnStdErr
  4711. ? optionsNonNull.errStream
  4712. : optionsNonNull.outStream;
  4713. s.write(data);
  4714. }
  4715. errbuffer = this._processLineBuffer(data, errbuffer, (line) => {
  4716. if (this.options.listeners && this.options.listeners.errline) {
  4717. this.options.listeners.errline(line);
  4718. }
  4719. });
  4720. });
  4721. }
  4722. cp.on('error', (err) => {
  4723. state.processError = err.message;
  4724. state.processExited = true;
  4725. state.processClosed = true;
  4726. state.CheckComplete();
  4727. });
  4728. cp.on('exit', (code) => {
  4729. state.processExitCode = code;
  4730. state.processExited = true;
  4731. this._debug(`Exit code ${code} received from tool '${this.toolPath}'`);
  4732. state.CheckComplete();
  4733. });
  4734. cp.on('close', (code) => {
  4735. state.processExitCode = code;
  4736. state.processExited = true;
  4737. state.processClosed = true;
  4738. this._debug(`STDIO streams have closed for tool '${this.toolPath}'`);
  4739. state.CheckComplete();
  4740. });
  4741. state.on('done', (error, exitCode) => {
  4742. if (stdbuffer.length > 0) {
  4743. this.emit('stdline', stdbuffer);
  4744. }
  4745. if (errbuffer.length > 0) {
  4746. this.emit('errline', errbuffer);
  4747. }
  4748. cp.removeAllListeners();
  4749. if (error) {
  4750. reject(error);
  4751. }
  4752. else {
  4753. resolve(exitCode);
  4754. }
  4755. });
  4756. if (this.options.input) {
  4757. if (!cp.stdin) {
  4758. throw new Error('child process missing stdin');
  4759. }
  4760. cp.stdin.end(this.options.input);
  4761. }
  4762. }));
  4763. });
  4764. }
  4765. }
  4766. exports.ToolRunner = ToolRunner;
  4767. /**
  4768. * Convert an arg string to an array of args. Handles escaping
  4769. *
  4770. * @param argString string of arguments
  4771. * @returns string[] array of arguments
  4772. */
  4773. function argStringToArray(argString) {
  4774. const args = [];
  4775. let inQuotes = false;
  4776. let escaped = false;
  4777. let arg = '';
  4778. function append(c) {
  4779. // we only escape double quotes.
  4780. if (escaped && c !== '"') {
  4781. arg += '\\';
  4782. }
  4783. arg += c;
  4784. escaped = false;
  4785. }
  4786. for (let i = 0; i < argString.length; i++) {
  4787. const c = argString.charAt(i);
  4788. if (c === '"') {
  4789. if (!escaped) {
  4790. inQuotes = !inQuotes;
  4791. }
  4792. else {
  4793. append(c);
  4794. }
  4795. continue;
  4796. }
  4797. if (c === '\\' && escaped) {
  4798. append(c);
  4799. continue;
  4800. }
  4801. if (c === '\\' && inQuotes) {
  4802. escaped = true;
  4803. continue;
  4804. }
  4805. if (c === ' ' && !inQuotes) {
  4806. if (arg.length > 0) {
  4807. args.push(arg);
  4808. arg = '';
  4809. }
  4810. continue;
  4811. }
  4812. append(c);
  4813. }
  4814. if (arg.length > 0) {
  4815. args.push(arg.trim());
  4816. }
  4817. return args;
  4818. }
  4819. exports.argStringToArray = argStringToArray;
  4820. class ExecState extends events.EventEmitter {
  4821. constructor(options, toolPath) {
  4822. super();
  4823. this.processClosed = false; // tracks whether the process has exited and stdio is closed
  4824. this.processError = '';
  4825. this.processExitCode = 0;
  4826. this.processExited = false; // tracks whether the process has exited
  4827. this.processStderr = false; // tracks whether stderr was written to
  4828. this.delay = 10000; // 10 seconds
  4829. this.done = false;
  4830. this.timeout = null;
  4831. if (!toolPath) {
  4832. throw new Error('toolPath must not be empty');
  4833. }
  4834. this.options = options;
  4835. this.toolPath = toolPath;
  4836. if (options.delay) {
  4837. this.delay = options.delay;
  4838. }
  4839. }
  4840. CheckComplete() {
  4841. if (this.done) {
  4842. return;
  4843. }
  4844. if (this.processClosed) {
  4845. this._setResult();
  4846. }
  4847. else if (this.processExited) {
  4848. this.timeout = timers_1.setTimeout(ExecState.HandleTimeout, this.delay, this);
  4849. }
  4850. }
  4851. _debug(message) {
  4852. this.emit('debug', message);
  4853. }
  4854. _setResult() {
  4855. // determine whether there is an error
  4856. let error;
  4857. if (this.processExited) {
  4858. if (this.processError) {
  4859. 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}`);
  4860. }
  4861. else if (this.processExitCode !== 0 && !this.options.ignoreReturnCode) {
  4862. error = new Error(`The process '${this.toolPath}' failed with exit code ${this.processExitCode}`);
  4863. }
  4864. else if (this.processStderr && this.options.failOnStdErr) {
  4865. error = new Error(`The process '${this.toolPath}' failed because one or more lines were written to the STDERR stream`);
  4866. }
  4867. }
  4868. // clear the timeout
  4869. if (this.timeout) {
  4870. clearTimeout(this.timeout);
  4871. this.timeout = null;
  4872. }
  4873. this.done = true;
  4874. this.emit('done', error, this.processExitCode);
  4875. }
  4876. static HandleTimeout(state) {
  4877. if (state.done) {
  4878. return;
  4879. }
  4880. if (!state.processClosed && state.processExited) {
  4881. const message = `The STDIO streams did not close within ${state.delay /
  4882. 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.`;
  4883. state._debug(message);
  4884. }
  4885. state._setResult();
  4886. }
  4887. }
  4888. //# sourceMappingURL=toolrunner.js.map
  4889. /***/ }),
  4890. /***/ 4087:
  4891. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  4892. "use strict";
  4893. Object.defineProperty(exports, "__esModule", ({ value: true }));
  4894. exports.Context = void 0;
  4895. const fs_1 = __nccwpck_require__(7147);
  4896. const os_1 = __nccwpck_require__(2037);
  4897. class Context {
  4898. /**
  4899. * Hydrate the context from the environment
  4900. */
  4901. constructor() {
  4902. var _a, _b, _c;
  4903. this.payload = {};
  4904. if (process.env.GITHUB_EVENT_PATH) {
  4905. if ((0, fs_1.existsSync)(process.env.GITHUB_EVENT_PATH)) {
  4906. this.payload = JSON.parse((0, fs_1.readFileSync)(process.env.GITHUB_EVENT_PATH, { encoding: 'utf8' }));
  4907. }
  4908. else {
  4909. const path = process.env.GITHUB_EVENT_PATH;
  4910. process.stdout.write(`GITHUB_EVENT_PATH ${path} does not exist${os_1.EOL}`);
  4911. }
  4912. }
  4913. this.eventName = process.env.GITHUB_EVENT_NAME;
  4914. this.sha = process.env.GITHUB_SHA;
  4915. this.ref = process.env.GITHUB_REF;
  4916. this.workflow = process.env.GITHUB_WORKFLOW;
  4917. this.action = process.env.GITHUB_ACTION;
  4918. this.actor = process.env.GITHUB_ACTOR;
  4919. this.job = process.env.GITHUB_JOB;
  4920. this.runNumber = parseInt(process.env.GITHUB_RUN_NUMBER, 10);
  4921. this.runId = parseInt(process.env.GITHUB_RUN_ID, 10);
  4922. this.apiUrl = (_a = process.env.GITHUB_API_URL) !== null && _a !== void 0 ? _a : `https://api.github.com`;
  4923. this.serverUrl = (_b = process.env.GITHUB_SERVER_URL) !== null && _b !== void 0 ? _b : `https://github.com`;
  4924. this.graphqlUrl =
  4925. (_c = process.env.GITHUB_GRAPHQL_URL) !== null && _c !== void 0 ? _c : `https://api.github.com/graphql`;
  4926. }
  4927. get issue() {
  4928. const payload = this.payload;
  4929. return Object.assign(Object.assign({}, this.repo), { number: (payload.issue || payload.pull_request || payload).number });
  4930. }
  4931. get repo() {
  4932. if (process.env.GITHUB_REPOSITORY) {
  4933. const [owner, repo] = process.env.GITHUB_REPOSITORY.split('/');
  4934. return { owner, repo };
  4935. }
  4936. if (this.payload.repository) {
  4937. return {
  4938. owner: this.payload.repository.owner.login,
  4939. repo: this.payload.repository.name
  4940. };
  4941. }
  4942. throw new Error("context.repo requires a GITHUB_REPOSITORY environment variable like 'owner/repo'");
  4943. }
  4944. }
  4945. exports.Context = Context;
  4946. //# sourceMappingURL=context.js.map
  4947. /***/ }),
  4948. /***/ 5438:
  4949. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  4950. "use strict";
  4951. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  4952. if (k2 === undefined) k2 = k;
  4953. var desc = Object.getOwnPropertyDescriptor(m, k);
  4954. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  4955. desc = { enumerable: true, get: function() { return m[k]; } };
  4956. }
  4957. Object.defineProperty(o, k2, desc);
  4958. }) : (function(o, m, k, k2) {
  4959. if (k2 === undefined) k2 = k;
  4960. o[k2] = m[k];
  4961. }));
  4962. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  4963. Object.defineProperty(o, "default", { enumerable: true, value: v });
  4964. }) : function(o, v) {
  4965. o["default"] = v;
  4966. });
  4967. var __importStar = (this && this.__importStar) || function (mod) {
  4968. if (mod && mod.__esModule) return mod;
  4969. var result = {};
  4970. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  4971. __setModuleDefault(result, mod);
  4972. return result;
  4973. };
  4974. Object.defineProperty(exports, "__esModule", ({ value: true }));
  4975. exports.getOctokit = exports.context = void 0;
  4976. const Context = __importStar(__nccwpck_require__(4087));
  4977. const utils_1 = __nccwpck_require__(3030);
  4978. exports.context = new Context.Context();
  4979. /**
  4980. * Returns a hydrated octokit ready to use for GitHub Actions
  4981. *
  4982. * @param token the repo PAT or GITHUB_TOKEN
  4983. * @param options other options to set
  4984. */
  4985. function getOctokit(token, options, ...additionalPlugins) {
  4986. const GitHubWithPlugins = utils_1.GitHub.plugin(...additionalPlugins);
  4987. return new GitHubWithPlugins((0, utils_1.getOctokitOptions)(token, options));
  4988. }
  4989. exports.getOctokit = getOctokit;
  4990. //# sourceMappingURL=github.js.map
  4991. /***/ }),
  4992. /***/ 7914:
  4993. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  4994. "use strict";
  4995. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  4996. if (k2 === undefined) k2 = k;
  4997. var desc = Object.getOwnPropertyDescriptor(m, k);
  4998. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  4999. desc = { enumerable: true, get: function() { return m[k]; } };
  5000. }
  5001. Object.defineProperty(o, k2, desc);
  5002. }) : (function(o, m, k, k2) {
  5003. if (k2 === undefined) k2 = k;
  5004. o[k2] = m[k];
  5005. }));
  5006. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  5007. Object.defineProperty(o, "default", { enumerable: true, value: v });
  5008. }) : function(o, v) {
  5009. o["default"] = v;
  5010. });
  5011. var __importStar = (this && this.__importStar) || function (mod) {
  5012. if (mod && mod.__esModule) return mod;
  5013. var result = {};
  5014. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  5015. __setModuleDefault(result, mod);
  5016. return result;
  5017. };
  5018. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  5019. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  5020. return new (P || (P = Promise))(function (resolve, reject) {
  5021. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  5022. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  5023. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  5024. step((generator = generator.apply(thisArg, _arguments || [])).next());
  5025. });
  5026. };
  5027. Object.defineProperty(exports, "__esModule", ({ value: true }));
  5028. exports.getApiBaseUrl = exports.getProxyFetch = exports.getProxyAgentDispatcher = exports.getProxyAgent = exports.getAuthString = void 0;
  5029. const httpClient = __importStar(__nccwpck_require__(6255));
  5030. const undici_1 = __nccwpck_require__(1773);
  5031. function getAuthString(token, options) {
  5032. if (!token && !options.auth) {
  5033. throw new Error('Parameter token or opts.auth is required');
  5034. }
  5035. else if (token && options.auth) {
  5036. throw new Error('Parameters token and opts.auth may not both be specified');
  5037. }
  5038. return typeof options.auth === 'string' ? options.auth : `token ${token}`;
  5039. }
  5040. exports.getAuthString = getAuthString;
  5041. function getProxyAgent(destinationUrl) {
  5042. const hc = new httpClient.HttpClient();
  5043. return hc.getAgent(destinationUrl);
  5044. }
  5045. exports.getProxyAgent = getProxyAgent;
  5046. function getProxyAgentDispatcher(destinationUrl) {
  5047. const hc = new httpClient.HttpClient();
  5048. return hc.getAgentDispatcher(destinationUrl);
  5049. }
  5050. exports.getProxyAgentDispatcher = getProxyAgentDispatcher;
  5051. function getProxyFetch(destinationUrl) {
  5052. const httpDispatcher = getProxyAgentDispatcher(destinationUrl);
  5053. const proxyFetch = (url, opts) => __awaiter(this, void 0, void 0, function* () {
  5054. return (0, undici_1.fetch)(url, Object.assign(Object.assign({}, opts), { dispatcher: httpDispatcher }));
  5055. });
  5056. return proxyFetch;
  5057. }
  5058. exports.getProxyFetch = getProxyFetch;
  5059. function getApiBaseUrl() {
  5060. return process.env['GITHUB_API_URL'] || 'https://api.github.com';
  5061. }
  5062. exports.getApiBaseUrl = getApiBaseUrl;
  5063. //# sourceMappingURL=utils.js.map
  5064. /***/ }),
  5065. /***/ 3030:
  5066. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  5067. "use strict";
  5068. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  5069. if (k2 === undefined) k2 = k;
  5070. var desc = Object.getOwnPropertyDescriptor(m, k);
  5071. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  5072. desc = { enumerable: true, get: function() { return m[k]; } };
  5073. }
  5074. Object.defineProperty(o, k2, desc);
  5075. }) : (function(o, m, k, k2) {
  5076. if (k2 === undefined) k2 = k;
  5077. o[k2] = m[k];
  5078. }));
  5079. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  5080. Object.defineProperty(o, "default", { enumerable: true, value: v });
  5081. }) : function(o, v) {
  5082. o["default"] = v;
  5083. });
  5084. var __importStar = (this && this.__importStar) || function (mod) {
  5085. if (mod && mod.__esModule) return mod;
  5086. var result = {};
  5087. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  5088. __setModuleDefault(result, mod);
  5089. return result;
  5090. };
  5091. Object.defineProperty(exports, "__esModule", ({ value: true }));
  5092. exports.getOctokitOptions = exports.GitHub = exports.defaults = exports.context = void 0;
  5093. const Context = __importStar(__nccwpck_require__(4087));
  5094. const Utils = __importStar(__nccwpck_require__(7914));
  5095. // octokit + plugins
  5096. const core_1 = __nccwpck_require__(6762);
  5097. const plugin_rest_endpoint_methods_1 = __nccwpck_require__(3044);
  5098. const plugin_paginate_rest_1 = __nccwpck_require__(4193);
  5099. exports.context = new Context.Context();
  5100. const baseUrl = Utils.getApiBaseUrl();
  5101. exports.defaults = {
  5102. baseUrl,
  5103. request: {
  5104. agent: Utils.getProxyAgent(baseUrl),
  5105. fetch: Utils.getProxyFetch(baseUrl)
  5106. }
  5107. };
  5108. exports.GitHub = core_1.Octokit.plugin(plugin_rest_endpoint_methods_1.restEndpointMethods, plugin_paginate_rest_1.paginateRest).defaults(exports.defaults);
  5109. /**
  5110. * Convience function to correctly format Octokit Options to pass into the constructor.
  5111. *
  5112. * @param token the repo PAT or GITHUB_TOKEN
  5113. * @param options other options to set
  5114. */
  5115. function getOctokitOptions(token, options) {
  5116. const opts = Object.assign({}, options || {}); // Shallow clone - don't mutate the object provided by the caller
  5117. // Auth
  5118. const auth = Utils.getAuthString(token, opts);
  5119. if (auth) {
  5120. opts.auth = auth;
  5121. }
  5122. return opts;
  5123. }
  5124. exports.getOctokitOptions = getOctokitOptions;
  5125. //# sourceMappingURL=utils.js.map
  5126. /***/ }),
  5127. /***/ 5526:
  5128. /***/ (function(__unused_webpack_module, exports) {
  5129. "use strict";
  5130. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  5131. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  5132. return new (P || (P = Promise))(function (resolve, reject) {
  5133. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  5134. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  5135. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  5136. step((generator = generator.apply(thisArg, _arguments || [])).next());
  5137. });
  5138. };
  5139. Object.defineProperty(exports, "__esModule", ({ value: true }));
  5140. exports.PersonalAccessTokenCredentialHandler = exports.BearerCredentialHandler = exports.BasicCredentialHandler = void 0;
  5141. class BasicCredentialHandler {
  5142. constructor(username, password) {
  5143. this.username = username;
  5144. this.password = password;
  5145. }
  5146. prepareRequest(options) {
  5147. if (!options.headers) {
  5148. throw Error('The request has no headers');
  5149. }
  5150. options.headers['Authorization'] = `Basic ${Buffer.from(`${this.username}:${this.password}`).toString('base64')}`;
  5151. }
  5152. // This handler cannot handle 401
  5153. canHandleAuthentication() {
  5154. return false;
  5155. }
  5156. handleAuthentication() {
  5157. return __awaiter(this, void 0, void 0, function* () {
  5158. throw new Error('not implemented');
  5159. });
  5160. }
  5161. }
  5162. exports.BasicCredentialHandler = BasicCredentialHandler;
  5163. class BearerCredentialHandler {
  5164. constructor(token) {
  5165. this.token = token;
  5166. }
  5167. // currently implements pre-authorization
  5168. // TODO: support preAuth = false where it hooks on 401
  5169. prepareRequest(options) {
  5170. if (!options.headers) {
  5171. throw Error('The request has no headers');
  5172. }
  5173. options.headers['Authorization'] = `Bearer ${this.token}`;
  5174. }
  5175. // This handler cannot handle 401
  5176. canHandleAuthentication() {
  5177. return false;
  5178. }
  5179. handleAuthentication() {
  5180. return __awaiter(this, void 0, void 0, function* () {
  5181. throw new Error('not implemented');
  5182. });
  5183. }
  5184. }
  5185. exports.BearerCredentialHandler = BearerCredentialHandler;
  5186. class PersonalAccessTokenCredentialHandler {
  5187. constructor(token) {
  5188. this.token = token;
  5189. }
  5190. // currently implements pre-authorization
  5191. // TODO: support preAuth = false where it hooks on 401
  5192. prepareRequest(options) {
  5193. if (!options.headers) {
  5194. throw Error('The request has no headers');
  5195. }
  5196. options.headers['Authorization'] = `Basic ${Buffer.from(`PAT:${this.token}`).toString('base64')}`;
  5197. }
  5198. // This handler cannot handle 401
  5199. canHandleAuthentication() {
  5200. return false;
  5201. }
  5202. handleAuthentication() {
  5203. return __awaiter(this, void 0, void 0, function* () {
  5204. throw new Error('not implemented');
  5205. });
  5206. }
  5207. }
  5208. exports.PersonalAccessTokenCredentialHandler = PersonalAccessTokenCredentialHandler;
  5209. //# sourceMappingURL=auth.js.map
  5210. /***/ }),
  5211. /***/ 6255:
  5212. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  5213. "use strict";
  5214. /* eslint-disable @typescript-eslint/no-explicit-any */
  5215. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  5216. if (k2 === undefined) k2 = k;
  5217. var desc = Object.getOwnPropertyDescriptor(m, k);
  5218. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  5219. desc = { enumerable: true, get: function() { return m[k]; } };
  5220. }
  5221. Object.defineProperty(o, k2, desc);
  5222. }) : (function(o, m, k, k2) {
  5223. if (k2 === undefined) k2 = k;
  5224. o[k2] = m[k];
  5225. }));
  5226. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  5227. Object.defineProperty(o, "default", { enumerable: true, value: v });
  5228. }) : function(o, v) {
  5229. o["default"] = v;
  5230. });
  5231. var __importStar = (this && this.__importStar) || function (mod) {
  5232. if (mod && mod.__esModule) return mod;
  5233. var result = {};
  5234. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  5235. __setModuleDefault(result, mod);
  5236. return result;
  5237. };
  5238. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  5239. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  5240. return new (P || (P = Promise))(function (resolve, reject) {
  5241. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  5242. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  5243. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  5244. step((generator = generator.apply(thisArg, _arguments || [])).next());
  5245. });
  5246. };
  5247. Object.defineProperty(exports, "__esModule", ({ value: true }));
  5248. exports.HttpClient = exports.isHttps = exports.HttpClientResponse = exports.HttpClientError = exports.getProxyUrl = exports.MediaTypes = exports.Headers = exports.HttpCodes = void 0;
  5249. const http = __importStar(__nccwpck_require__(3685));
  5250. const https = __importStar(__nccwpck_require__(5687));
  5251. const pm = __importStar(__nccwpck_require__(9835));
  5252. const tunnel = __importStar(__nccwpck_require__(4294));
  5253. const undici_1 = __nccwpck_require__(1773);
  5254. var HttpCodes;
  5255. (function (HttpCodes) {
  5256. HttpCodes[HttpCodes["OK"] = 200] = "OK";
  5257. HttpCodes[HttpCodes["MultipleChoices"] = 300] = "MultipleChoices";
  5258. HttpCodes[HttpCodes["MovedPermanently"] = 301] = "MovedPermanently";
  5259. HttpCodes[HttpCodes["ResourceMoved"] = 302] = "ResourceMoved";
  5260. HttpCodes[HttpCodes["SeeOther"] = 303] = "SeeOther";
  5261. HttpCodes[HttpCodes["NotModified"] = 304] = "NotModified";
  5262. HttpCodes[HttpCodes["UseProxy"] = 305] = "UseProxy";
  5263. HttpCodes[HttpCodes["SwitchProxy"] = 306] = "SwitchProxy";
  5264. HttpCodes[HttpCodes["TemporaryRedirect"] = 307] = "TemporaryRedirect";
  5265. HttpCodes[HttpCodes["PermanentRedirect"] = 308] = "PermanentRedirect";
  5266. HttpCodes[HttpCodes["BadRequest"] = 400] = "BadRequest";
  5267. HttpCodes[HttpCodes["Unauthorized"] = 401] = "Unauthorized";
  5268. HttpCodes[HttpCodes["PaymentRequired"] = 402] = "PaymentRequired";
  5269. HttpCodes[HttpCodes["Forbidden"] = 403] = "Forbidden";
  5270. HttpCodes[HttpCodes["NotFound"] = 404] = "NotFound";
  5271. HttpCodes[HttpCodes["MethodNotAllowed"] = 405] = "MethodNotAllowed";
  5272. HttpCodes[HttpCodes["NotAcceptable"] = 406] = "NotAcceptable";
  5273. HttpCodes[HttpCodes["ProxyAuthenticationRequired"] = 407] = "ProxyAuthenticationRequired";
  5274. HttpCodes[HttpCodes["RequestTimeout"] = 408] = "RequestTimeout";
  5275. HttpCodes[HttpCodes["Conflict"] = 409] = "Conflict";
  5276. HttpCodes[HttpCodes["Gone"] = 410] = "Gone";
  5277. HttpCodes[HttpCodes["TooManyRequests"] = 429] = "TooManyRequests";
  5278. HttpCodes[HttpCodes["InternalServerError"] = 500] = "InternalServerError";
  5279. HttpCodes[HttpCodes["NotImplemented"] = 501] = "NotImplemented";
  5280. HttpCodes[HttpCodes["BadGateway"] = 502] = "BadGateway";
  5281. HttpCodes[HttpCodes["ServiceUnavailable"] = 503] = "ServiceUnavailable";
  5282. HttpCodes[HttpCodes["GatewayTimeout"] = 504] = "GatewayTimeout";
  5283. })(HttpCodes || (exports.HttpCodes = HttpCodes = {}));
  5284. var Headers;
  5285. (function (Headers) {
  5286. Headers["Accept"] = "accept";
  5287. Headers["ContentType"] = "content-type";
  5288. })(Headers || (exports.Headers = Headers = {}));
  5289. var MediaTypes;
  5290. (function (MediaTypes) {
  5291. MediaTypes["ApplicationJson"] = "application/json";
  5292. })(MediaTypes || (exports.MediaTypes = MediaTypes = {}));
  5293. /**
  5294. * Returns the proxy URL, depending upon the supplied url and proxy environment variables.
  5295. * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com
  5296. */
  5297. function getProxyUrl(serverUrl) {
  5298. const proxyUrl = pm.getProxyUrl(new URL(serverUrl));
  5299. return proxyUrl ? proxyUrl.href : '';
  5300. }
  5301. exports.getProxyUrl = getProxyUrl;
  5302. const HttpRedirectCodes = [
  5303. HttpCodes.MovedPermanently,
  5304. HttpCodes.ResourceMoved,
  5305. HttpCodes.SeeOther,
  5306. HttpCodes.TemporaryRedirect,
  5307. HttpCodes.PermanentRedirect
  5308. ];
  5309. const HttpResponseRetryCodes = [
  5310. HttpCodes.BadGateway,
  5311. HttpCodes.ServiceUnavailable,
  5312. HttpCodes.GatewayTimeout
  5313. ];
  5314. const RetryableHttpVerbs = ['OPTIONS', 'GET', 'DELETE', 'HEAD'];
  5315. const ExponentialBackoffCeiling = 10;
  5316. const ExponentialBackoffTimeSlice = 5;
  5317. class HttpClientError extends Error {
  5318. constructor(message, statusCode) {
  5319. super(message);
  5320. this.name = 'HttpClientError';
  5321. this.statusCode = statusCode;
  5322. Object.setPrototypeOf(this, HttpClientError.prototype);
  5323. }
  5324. }
  5325. exports.HttpClientError = HttpClientError;
  5326. class HttpClientResponse {
  5327. constructor(message) {
  5328. this.message = message;
  5329. }
  5330. readBody() {
  5331. return __awaiter(this, void 0, void 0, function* () {
  5332. return new Promise((resolve) => __awaiter(this, void 0, void 0, function* () {
  5333. let output = Buffer.alloc(0);
  5334. this.message.on('data', (chunk) => {
  5335. output = Buffer.concat([output, chunk]);
  5336. });
  5337. this.message.on('end', () => {
  5338. resolve(output.toString());
  5339. });
  5340. }));
  5341. });
  5342. }
  5343. readBodyBuffer() {
  5344. return __awaiter(this, void 0, void 0, function* () {
  5345. return new Promise((resolve) => __awaiter(this, void 0, void 0, function* () {
  5346. const chunks = [];
  5347. this.message.on('data', (chunk) => {
  5348. chunks.push(chunk);
  5349. });
  5350. this.message.on('end', () => {
  5351. resolve(Buffer.concat(chunks));
  5352. });
  5353. }));
  5354. });
  5355. }
  5356. }
  5357. exports.HttpClientResponse = HttpClientResponse;
  5358. function isHttps(requestUrl) {
  5359. const parsedUrl = new URL(requestUrl);
  5360. return parsedUrl.protocol === 'https:';
  5361. }
  5362. exports.isHttps = isHttps;
  5363. class HttpClient {
  5364. constructor(userAgent, handlers, requestOptions) {
  5365. this._ignoreSslError = false;
  5366. this._allowRedirects = true;
  5367. this._allowRedirectDowngrade = false;
  5368. this._maxRedirects = 50;
  5369. this._allowRetries = false;
  5370. this._maxRetries = 1;
  5371. this._keepAlive = false;
  5372. this._disposed = false;
  5373. this.userAgent = userAgent;
  5374. this.handlers = handlers || [];
  5375. this.requestOptions = requestOptions;
  5376. if (requestOptions) {
  5377. if (requestOptions.ignoreSslError != null) {
  5378. this._ignoreSslError = requestOptions.ignoreSslError;
  5379. }
  5380. this._socketTimeout = requestOptions.socketTimeout;
  5381. if (requestOptions.allowRedirects != null) {
  5382. this._allowRedirects = requestOptions.allowRedirects;
  5383. }
  5384. if (requestOptions.allowRedirectDowngrade != null) {
  5385. this._allowRedirectDowngrade = requestOptions.allowRedirectDowngrade;
  5386. }
  5387. if (requestOptions.maxRedirects != null) {
  5388. this._maxRedirects = Math.max(requestOptions.maxRedirects, 0);
  5389. }
  5390. if (requestOptions.keepAlive != null) {
  5391. this._keepAlive = requestOptions.keepAlive;
  5392. }
  5393. if (requestOptions.allowRetries != null) {
  5394. this._allowRetries = requestOptions.allowRetries;
  5395. }
  5396. if (requestOptions.maxRetries != null) {
  5397. this._maxRetries = requestOptions.maxRetries;
  5398. }
  5399. }
  5400. }
  5401. options(requestUrl, additionalHeaders) {
  5402. return __awaiter(this, void 0, void 0, function* () {
  5403. return this.request('OPTIONS', requestUrl, null, additionalHeaders || {});
  5404. });
  5405. }
  5406. get(requestUrl, additionalHeaders) {
  5407. return __awaiter(this, void 0, void 0, function* () {
  5408. return this.request('GET', requestUrl, null, additionalHeaders || {});
  5409. });
  5410. }
  5411. del(requestUrl, additionalHeaders) {
  5412. return __awaiter(this, void 0, void 0, function* () {
  5413. return this.request('DELETE', requestUrl, null, additionalHeaders || {});
  5414. });
  5415. }
  5416. post(requestUrl, data, additionalHeaders) {
  5417. return __awaiter(this, void 0, void 0, function* () {
  5418. return this.request('POST', requestUrl, data, additionalHeaders || {});
  5419. });
  5420. }
  5421. patch(requestUrl, data, additionalHeaders) {
  5422. return __awaiter(this, void 0, void 0, function* () {
  5423. return this.request('PATCH', requestUrl, data, additionalHeaders || {});
  5424. });
  5425. }
  5426. put(requestUrl, data, additionalHeaders) {
  5427. return __awaiter(this, void 0, void 0, function* () {
  5428. return this.request('PUT', requestUrl, data, additionalHeaders || {});
  5429. });
  5430. }
  5431. head(requestUrl, additionalHeaders) {
  5432. return __awaiter(this, void 0, void 0, function* () {
  5433. return this.request('HEAD', requestUrl, null, additionalHeaders || {});
  5434. });
  5435. }
  5436. sendStream(verb, requestUrl, stream, additionalHeaders) {
  5437. return __awaiter(this, void 0, void 0, function* () {
  5438. return this.request(verb, requestUrl, stream, additionalHeaders);
  5439. });
  5440. }
  5441. /**
  5442. * Gets a typed object from an endpoint
  5443. * Be aware that not found returns a null. Other errors (4xx, 5xx) reject the promise
  5444. */
  5445. getJson(requestUrl, additionalHeaders = {}) {
  5446. return __awaiter(this, void 0, void 0, function* () {
  5447. additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
  5448. const res = yield this.get(requestUrl, additionalHeaders);
  5449. return this._processResponse(res, this.requestOptions);
  5450. });
  5451. }
  5452. postJson(requestUrl, obj, additionalHeaders = {}) {
  5453. return __awaiter(this, void 0, void 0, function* () {
  5454. const data = JSON.stringify(obj, null, 2);
  5455. additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
  5456. additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);
  5457. const res = yield this.post(requestUrl, data, additionalHeaders);
  5458. return this._processResponse(res, this.requestOptions);
  5459. });
  5460. }
  5461. putJson(requestUrl, obj, additionalHeaders = {}) {
  5462. return __awaiter(this, void 0, void 0, function* () {
  5463. const data = JSON.stringify(obj, null, 2);
  5464. additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
  5465. additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);
  5466. const res = yield this.put(requestUrl, data, additionalHeaders);
  5467. return this._processResponse(res, this.requestOptions);
  5468. });
  5469. }
  5470. patchJson(requestUrl, obj, additionalHeaders = {}) {
  5471. return __awaiter(this, void 0, void 0, function* () {
  5472. const data = JSON.stringify(obj, null, 2);
  5473. additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
  5474. additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);
  5475. const res = yield this.patch(requestUrl, data, additionalHeaders);
  5476. return this._processResponse(res, this.requestOptions);
  5477. });
  5478. }
  5479. /**
  5480. * Makes a raw http request.
  5481. * All other methods such as get, post, patch, and request ultimately call this.
  5482. * Prefer get, del, post and patch
  5483. */
  5484. request(verb, requestUrl, data, headers) {
  5485. return __awaiter(this, void 0, void 0, function* () {
  5486. if (this._disposed) {
  5487. throw new Error('Client has already been disposed.');
  5488. }
  5489. const parsedUrl = new URL(requestUrl);
  5490. let info = this._prepareRequest(verb, parsedUrl, headers);
  5491. // Only perform retries on reads since writes may not be idempotent.
  5492. const maxTries = this._allowRetries && RetryableHttpVerbs.includes(verb)
  5493. ? this._maxRetries + 1
  5494. : 1;
  5495. let numTries = 0;
  5496. let response;
  5497. do {
  5498. response = yield this.requestRaw(info, data);
  5499. // Check if it's an authentication challenge
  5500. if (response &&
  5501. response.message &&
  5502. response.message.statusCode === HttpCodes.Unauthorized) {
  5503. let authenticationHandler;
  5504. for (const handler of this.handlers) {
  5505. if (handler.canHandleAuthentication(response)) {
  5506. authenticationHandler = handler;
  5507. break;
  5508. }
  5509. }
  5510. if (authenticationHandler) {
  5511. return authenticationHandler.handleAuthentication(this, info, data);
  5512. }
  5513. else {
  5514. // We have received an unauthorized response but have no handlers to handle it.
  5515. // Let the response return to the caller.
  5516. return response;
  5517. }
  5518. }
  5519. let redirectsRemaining = this._maxRedirects;
  5520. while (response.message.statusCode &&
  5521. HttpRedirectCodes.includes(response.message.statusCode) &&
  5522. this._allowRedirects &&
  5523. redirectsRemaining > 0) {
  5524. const redirectUrl = response.message.headers['location'];
  5525. if (!redirectUrl) {
  5526. // if there's no location to redirect to, we won't
  5527. break;
  5528. }
  5529. const parsedRedirectUrl = new URL(redirectUrl);
  5530. if (parsedUrl.protocol === 'https:' &&
  5531. parsedUrl.protocol !== parsedRedirectUrl.protocol &&
  5532. !this._allowRedirectDowngrade) {
  5533. 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.');
  5534. }
  5535. // we need to finish reading the response before reassigning response
  5536. // which will leak the open socket.
  5537. yield response.readBody();
  5538. // strip authorization header if redirected to a different hostname
  5539. if (parsedRedirectUrl.hostname !== parsedUrl.hostname) {
  5540. for (const header in headers) {
  5541. // header names are case insensitive
  5542. if (header.toLowerCase() === 'authorization') {
  5543. delete headers[header];
  5544. }
  5545. }
  5546. }
  5547. // let's make the request with the new redirectUrl
  5548. info = this._prepareRequest(verb, parsedRedirectUrl, headers);
  5549. response = yield this.requestRaw(info, data);
  5550. redirectsRemaining--;
  5551. }
  5552. if (!response.message.statusCode ||
  5553. !HttpResponseRetryCodes.includes(response.message.statusCode)) {
  5554. // If not a retry code, return immediately instead of retrying
  5555. return response;
  5556. }
  5557. numTries += 1;
  5558. if (numTries < maxTries) {
  5559. yield response.readBody();
  5560. yield this._performExponentialBackoff(numTries);
  5561. }
  5562. } while (numTries < maxTries);
  5563. return response;
  5564. });
  5565. }
  5566. /**
  5567. * Needs to be called if keepAlive is set to true in request options.
  5568. */
  5569. dispose() {
  5570. if (this._agent) {
  5571. this._agent.destroy();
  5572. }
  5573. this._disposed = true;
  5574. }
  5575. /**
  5576. * Raw request.
  5577. * @param info
  5578. * @param data
  5579. */
  5580. requestRaw(info, data) {
  5581. return __awaiter(this, void 0, void 0, function* () {
  5582. return new Promise((resolve, reject) => {
  5583. function callbackForResult(err, res) {
  5584. if (err) {
  5585. reject(err);
  5586. }
  5587. else if (!res) {
  5588. // If `err` is not passed, then `res` must be passed.
  5589. reject(new Error('Unknown error'));
  5590. }
  5591. else {
  5592. resolve(res);
  5593. }
  5594. }
  5595. this.requestRawWithCallback(info, data, callbackForResult);
  5596. });
  5597. });
  5598. }
  5599. /**
  5600. * Raw request with callback.
  5601. * @param info
  5602. * @param data
  5603. * @param onResult
  5604. */
  5605. requestRawWithCallback(info, data, onResult) {
  5606. if (typeof data === 'string') {
  5607. if (!info.options.headers) {
  5608. info.options.headers = {};
  5609. }
  5610. info.options.headers['Content-Length'] = Buffer.byteLength(data, 'utf8');
  5611. }
  5612. let callbackCalled = false;
  5613. function handleResult(err, res) {
  5614. if (!callbackCalled) {
  5615. callbackCalled = true;
  5616. onResult(err, res);
  5617. }
  5618. }
  5619. const req = info.httpModule.request(info.options, (msg) => {
  5620. const res = new HttpClientResponse(msg);
  5621. handleResult(undefined, res);
  5622. });
  5623. let socket;
  5624. req.on('socket', sock => {
  5625. socket = sock;
  5626. });
  5627. // If we ever get disconnected, we want the socket to timeout eventually
  5628. req.setTimeout(this._socketTimeout || 3 * 60000, () => {
  5629. if (socket) {
  5630. socket.end();
  5631. }
  5632. handleResult(new Error(`Request timeout: ${info.options.path}`));
  5633. });
  5634. req.on('error', function (err) {
  5635. // err has statusCode property
  5636. // res should have headers
  5637. handleResult(err);
  5638. });
  5639. if (data && typeof data === 'string') {
  5640. req.write(data, 'utf8');
  5641. }
  5642. if (data && typeof data !== 'string') {
  5643. data.on('close', function () {
  5644. req.end();
  5645. });
  5646. data.pipe(req);
  5647. }
  5648. else {
  5649. req.end();
  5650. }
  5651. }
  5652. /**
  5653. * Gets an http agent. This function is useful when you need an http agent that handles
  5654. * routing through a proxy server - depending upon the url and proxy environment variables.
  5655. * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com
  5656. */
  5657. getAgent(serverUrl) {
  5658. const parsedUrl = new URL(serverUrl);
  5659. return this._getAgent(parsedUrl);
  5660. }
  5661. getAgentDispatcher(serverUrl) {
  5662. const parsedUrl = new URL(serverUrl);
  5663. const proxyUrl = pm.getProxyUrl(parsedUrl);
  5664. const useProxy = proxyUrl && proxyUrl.hostname;
  5665. if (!useProxy) {
  5666. return;
  5667. }
  5668. return this._getProxyAgentDispatcher(parsedUrl, proxyUrl);
  5669. }
  5670. _prepareRequest(method, requestUrl, headers) {
  5671. const info = {};
  5672. info.parsedUrl = requestUrl;
  5673. const usingSsl = info.parsedUrl.protocol === 'https:';
  5674. info.httpModule = usingSsl ? https : http;
  5675. const defaultPort = usingSsl ? 443 : 80;
  5676. info.options = {};
  5677. info.options.host = info.parsedUrl.hostname;
  5678. info.options.port = info.parsedUrl.port
  5679. ? parseInt(info.parsedUrl.port)
  5680. : defaultPort;
  5681. info.options.path =
  5682. (info.parsedUrl.pathname || '') + (info.parsedUrl.search || '');
  5683. info.options.method = method;
  5684. info.options.headers = this._mergeHeaders(headers);
  5685. if (this.userAgent != null) {
  5686. info.options.headers['user-agent'] = this.userAgent;
  5687. }
  5688. info.options.agent = this._getAgent(info.parsedUrl);
  5689. // gives handlers an opportunity to participate
  5690. if (this.handlers) {
  5691. for (const handler of this.handlers) {
  5692. handler.prepareRequest(info.options);
  5693. }
  5694. }
  5695. return info;
  5696. }
  5697. _mergeHeaders(headers) {
  5698. if (this.requestOptions && this.requestOptions.headers) {
  5699. return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers || {}));
  5700. }
  5701. return lowercaseKeys(headers || {});
  5702. }
  5703. _getExistingOrDefaultHeader(additionalHeaders, header, _default) {
  5704. let clientHeader;
  5705. if (this.requestOptions && this.requestOptions.headers) {
  5706. clientHeader = lowercaseKeys(this.requestOptions.headers)[header];
  5707. }
  5708. return additionalHeaders[header] || clientHeader || _default;
  5709. }
  5710. _getAgent(parsedUrl) {
  5711. let agent;
  5712. const proxyUrl = pm.getProxyUrl(parsedUrl);
  5713. const useProxy = proxyUrl && proxyUrl.hostname;
  5714. if (this._keepAlive && useProxy) {
  5715. agent = this._proxyAgent;
  5716. }
  5717. if (!useProxy) {
  5718. agent = this._agent;
  5719. }
  5720. // if agent is already assigned use that agent.
  5721. if (agent) {
  5722. return agent;
  5723. }
  5724. const usingSsl = parsedUrl.protocol === 'https:';
  5725. let maxSockets = 100;
  5726. if (this.requestOptions) {
  5727. maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets;
  5728. }
  5729. // This is `useProxy` again, but we need to check `proxyURl` directly for TypeScripts's flow analysis.
  5730. if (proxyUrl && proxyUrl.hostname) {
  5731. const agentOptions = {
  5732. maxSockets,
  5733. keepAlive: this._keepAlive,
  5734. proxy: Object.assign(Object.assign({}, ((proxyUrl.username || proxyUrl.password) && {
  5735. proxyAuth: `${proxyUrl.username}:${proxyUrl.password}`
  5736. })), { host: proxyUrl.hostname, port: proxyUrl.port })
  5737. };
  5738. let tunnelAgent;
  5739. const overHttps = proxyUrl.protocol === 'https:';
  5740. if (usingSsl) {
  5741. tunnelAgent = overHttps ? tunnel.httpsOverHttps : tunnel.httpsOverHttp;
  5742. }
  5743. else {
  5744. tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp;
  5745. }
  5746. agent = tunnelAgent(agentOptions);
  5747. this._proxyAgent = agent;
  5748. }
  5749. // if tunneling agent isn't assigned create a new agent
  5750. if (!agent) {
  5751. const options = { keepAlive: this._keepAlive, maxSockets };
  5752. agent = usingSsl ? new https.Agent(options) : new http.Agent(options);
  5753. this._agent = agent;
  5754. }
  5755. if (usingSsl && this._ignoreSslError) {
  5756. // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process
  5757. // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options
  5758. // we have to cast it to any and change it directly
  5759. agent.options = Object.assign(agent.options || {}, {
  5760. rejectUnauthorized: false
  5761. });
  5762. }
  5763. return agent;
  5764. }
  5765. _getProxyAgentDispatcher(parsedUrl, proxyUrl) {
  5766. let proxyAgent;
  5767. if (this._keepAlive) {
  5768. proxyAgent = this._proxyAgentDispatcher;
  5769. }
  5770. // if agent is already assigned use that agent.
  5771. if (proxyAgent) {
  5772. return proxyAgent;
  5773. }
  5774. const usingSsl = parsedUrl.protocol === 'https:';
  5775. proxyAgent = new undici_1.ProxyAgent(Object.assign({ uri: proxyUrl.href, pipelining: !this._keepAlive ? 0 : 1 }, ((proxyUrl.username || proxyUrl.password) && {
  5776. token: `${proxyUrl.username}:${proxyUrl.password}`
  5777. })));
  5778. this._proxyAgentDispatcher = proxyAgent;
  5779. if (usingSsl && this._ignoreSslError) {
  5780. // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process
  5781. // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options
  5782. // we have to cast it to any and change it directly
  5783. proxyAgent.options = Object.assign(proxyAgent.options.requestTls || {}, {
  5784. rejectUnauthorized: false
  5785. });
  5786. }
  5787. return proxyAgent;
  5788. }
  5789. _performExponentialBackoff(retryNumber) {
  5790. return __awaiter(this, void 0, void 0, function* () {
  5791. retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber);
  5792. const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber);
  5793. return new Promise(resolve => setTimeout(() => resolve(), ms));
  5794. });
  5795. }
  5796. _processResponse(res, options) {
  5797. return __awaiter(this, void 0, void 0, function* () {
  5798. return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
  5799. const statusCode = res.message.statusCode || 0;
  5800. const response = {
  5801. statusCode,
  5802. result: null,
  5803. headers: {}
  5804. };
  5805. // not found leads to null obj returned
  5806. if (statusCode === HttpCodes.NotFound) {
  5807. resolve(response);
  5808. }
  5809. // get the result from the body
  5810. function dateTimeDeserializer(key, value) {
  5811. if (typeof value === 'string') {
  5812. const a = new Date(value);
  5813. if (!isNaN(a.valueOf())) {
  5814. return a;
  5815. }
  5816. }
  5817. return value;
  5818. }
  5819. let obj;
  5820. let contents;
  5821. try {
  5822. contents = yield res.readBody();
  5823. if (contents && contents.length > 0) {
  5824. if (options && options.deserializeDates) {
  5825. obj = JSON.parse(contents, dateTimeDeserializer);
  5826. }
  5827. else {
  5828. obj = JSON.parse(contents);
  5829. }
  5830. response.result = obj;
  5831. }
  5832. response.headers = res.message.headers;
  5833. }
  5834. catch (err) {
  5835. // Invalid resource (contents not json); leaving result obj null
  5836. }
  5837. // note that 3xx redirects are handled by the http layer.
  5838. if (statusCode > 299) {
  5839. let msg;
  5840. // if exception/error in body, attempt to get better error
  5841. if (obj && obj.message) {
  5842. msg = obj.message;
  5843. }
  5844. else if (contents && contents.length > 0) {
  5845. // it may be the case that the exception is in the body message as string
  5846. msg = contents;
  5847. }
  5848. else {
  5849. msg = `Failed request: (${statusCode})`;
  5850. }
  5851. const err = new HttpClientError(msg, statusCode);
  5852. err.result = response.result;
  5853. reject(err);
  5854. }
  5855. else {
  5856. resolve(response);
  5857. }
  5858. }));
  5859. });
  5860. }
  5861. }
  5862. exports.HttpClient = HttpClient;
  5863. const lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCase()] = obj[k]), c), {});
  5864. //# sourceMappingURL=index.js.map
  5865. /***/ }),
  5866. /***/ 9835:
  5867. /***/ ((__unused_webpack_module, exports) => {
  5868. "use strict";
  5869. Object.defineProperty(exports, "__esModule", ({ value: true }));
  5870. exports.checkBypass = exports.getProxyUrl = void 0;
  5871. function getProxyUrl(reqUrl) {
  5872. const usingSsl = reqUrl.protocol === 'https:';
  5873. if (checkBypass(reqUrl)) {
  5874. return undefined;
  5875. }
  5876. const proxyVar = (() => {
  5877. if (usingSsl) {
  5878. return process.env['https_proxy'] || process.env['HTTPS_PROXY'];
  5879. }
  5880. else {
  5881. return process.env['http_proxy'] || process.env['HTTP_PROXY'];
  5882. }
  5883. })();
  5884. if (proxyVar) {
  5885. try {
  5886. return new URL(proxyVar);
  5887. }
  5888. catch (_a) {
  5889. if (!proxyVar.startsWith('http://') && !proxyVar.startsWith('https://'))
  5890. return new URL(`http://${proxyVar}`);
  5891. }
  5892. }
  5893. else {
  5894. return undefined;
  5895. }
  5896. }
  5897. exports.getProxyUrl = getProxyUrl;
  5898. function checkBypass(reqUrl) {
  5899. if (!reqUrl.hostname) {
  5900. return false;
  5901. }
  5902. const reqHost = reqUrl.hostname;
  5903. if (isLoopbackAddress(reqHost)) {
  5904. return true;
  5905. }
  5906. const noProxy = process.env['no_proxy'] || process.env['NO_PROXY'] || '';
  5907. if (!noProxy) {
  5908. return false;
  5909. }
  5910. // Determine the request port
  5911. let reqPort;
  5912. if (reqUrl.port) {
  5913. reqPort = Number(reqUrl.port);
  5914. }
  5915. else if (reqUrl.protocol === 'http:') {
  5916. reqPort = 80;
  5917. }
  5918. else if (reqUrl.protocol === 'https:') {
  5919. reqPort = 443;
  5920. }
  5921. // Format the request hostname and hostname with port
  5922. const upperReqHosts = [reqUrl.hostname.toUpperCase()];
  5923. if (typeof reqPort === 'number') {
  5924. upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`);
  5925. }
  5926. // Compare request host against noproxy
  5927. for (const upperNoProxyItem of noProxy
  5928. .split(',')
  5929. .map(x => x.trim().toUpperCase())
  5930. .filter(x => x)) {
  5931. if (upperNoProxyItem === '*' ||
  5932. upperReqHosts.some(x => x === upperNoProxyItem ||
  5933. x.endsWith(`.${upperNoProxyItem}`) ||
  5934. (upperNoProxyItem.startsWith('.') &&
  5935. x.endsWith(`${upperNoProxyItem}`)))) {
  5936. return true;
  5937. }
  5938. }
  5939. return false;
  5940. }
  5941. exports.checkBypass = checkBypass;
  5942. function isLoopbackAddress(host) {
  5943. const hostLower = host.toLowerCase();
  5944. return (hostLower === 'localhost' ||
  5945. hostLower.startsWith('127.') ||
  5946. hostLower.startsWith('[::1]') ||
  5947. hostLower.startsWith('[0:0:0:0:0:0:0:1]'));
  5948. }
  5949. //# sourceMappingURL=proxy.js.map
  5950. /***/ }),
  5951. /***/ 1962:
  5952. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  5953. "use strict";
  5954. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  5955. if (k2 === undefined) k2 = k;
  5956. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  5957. }) : (function(o, m, k, k2) {
  5958. if (k2 === undefined) k2 = k;
  5959. o[k2] = m[k];
  5960. }));
  5961. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  5962. Object.defineProperty(o, "default", { enumerable: true, value: v });
  5963. }) : function(o, v) {
  5964. o["default"] = v;
  5965. });
  5966. var __importStar = (this && this.__importStar) || function (mod) {
  5967. if (mod && mod.__esModule) return mod;
  5968. var result = {};
  5969. if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  5970. __setModuleDefault(result, mod);
  5971. return result;
  5972. };
  5973. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  5974. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  5975. return new (P || (P = Promise))(function (resolve, reject) {
  5976. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  5977. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  5978. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  5979. step((generator = generator.apply(thisArg, _arguments || [])).next());
  5980. });
  5981. };
  5982. var _a;
  5983. Object.defineProperty(exports, "__esModule", ({ value: true }));
  5984. 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;
  5985. const fs = __importStar(__nccwpck_require__(7147));
  5986. const path = __importStar(__nccwpck_require__(1017));
  5987. _a = fs.promises
  5988. // export const {open} = 'fs'
  5989. , 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;
  5990. // export const {open} = 'fs'
  5991. exports.IS_WINDOWS = process.platform === 'win32';
  5992. // See https://github.com/nodejs/node/blob/d0153aee367422d0858105abec186da4dff0a0c5/deps/uv/include/uv/win.h#L691
  5993. exports.UV_FS_O_EXLOCK = 0x10000000;
  5994. exports.READONLY = fs.constants.O_RDONLY;
  5995. function exists(fsPath) {
  5996. return __awaiter(this, void 0, void 0, function* () {
  5997. try {
  5998. yield exports.stat(fsPath);
  5999. }
  6000. catch (err) {
  6001. if (err.code === 'ENOENT') {
  6002. return false;
  6003. }
  6004. throw err;
  6005. }
  6006. return true;
  6007. });
  6008. }
  6009. exports.exists = exists;
  6010. function isDirectory(fsPath, useStat = false) {
  6011. return __awaiter(this, void 0, void 0, function* () {
  6012. const stats = useStat ? yield exports.stat(fsPath) : yield exports.lstat(fsPath);
  6013. return stats.isDirectory();
  6014. });
  6015. }
  6016. exports.isDirectory = isDirectory;
  6017. /**
  6018. * On OSX/Linux, true if path starts with '/'. On Windows, true for paths like:
  6019. * \, \hello, \\hello\share, C:, and C:\hello (and corresponding alternate separator cases).
  6020. */
  6021. function isRooted(p) {
  6022. p = normalizeSeparators(p);
  6023. if (!p) {
  6024. throw new Error('isRooted() parameter "p" cannot be empty');
  6025. }
  6026. if (exports.IS_WINDOWS) {
  6027. return (p.startsWith('\\') || /^[A-Z]:/i.test(p) // e.g. \ or \hello or \\hello
  6028. ); // e.g. C: or C:\hello
  6029. }
  6030. return p.startsWith('/');
  6031. }
  6032. exports.isRooted = isRooted;
  6033. /**
  6034. * Best effort attempt to determine whether a file exists and is executable.
  6035. * @param filePath file path to check
  6036. * @param extensions additional file extensions to try
  6037. * @return if file exists and is executable, returns the file path. otherwise empty string.
  6038. */
  6039. function tryGetExecutablePath(filePath, extensions) {
  6040. return __awaiter(this, void 0, void 0, function* () {
  6041. let stats = undefined;
  6042. try {
  6043. // test file exists
  6044. stats = yield exports.stat(filePath);
  6045. }
  6046. catch (err) {
  6047. if (err.code !== 'ENOENT') {
  6048. // eslint-disable-next-line no-console
  6049. console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`);
  6050. }
  6051. }
  6052. if (stats && stats.isFile()) {
  6053. if (exports.IS_WINDOWS) {
  6054. // on Windows, test for valid extension
  6055. const upperExt = path.extname(filePath).toUpperCase();
  6056. if (extensions.some(validExt => validExt.toUpperCase() === upperExt)) {
  6057. return filePath;
  6058. }
  6059. }
  6060. else {
  6061. if (isUnixExecutable(stats)) {
  6062. return filePath;
  6063. }
  6064. }
  6065. }
  6066. // try each extension
  6067. const originalFilePath = filePath;
  6068. for (const extension of extensions) {
  6069. filePath = originalFilePath + extension;
  6070. stats = undefined;
  6071. try {
  6072. stats = yield exports.stat(filePath);
  6073. }
  6074. catch (err) {
  6075. if (err.code !== 'ENOENT') {
  6076. // eslint-disable-next-line no-console
  6077. console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`);
  6078. }
  6079. }
  6080. if (stats && stats.isFile()) {
  6081. if (exports.IS_WINDOWS) {
  6082. // preserve the case of the actual file (since an extension was appended)
  6083. try {
  6084. const directory = path.dirname(filePath);
  6085. const upperName = path.basename(filePath).toUpperCase();
  6086. for (const actualName of yield exports.readdir(directory)) {
  6087. if (upperName === actualName.toUpperCase()) {
  6088. filePath = path.join(directory, actualName);
  6089. break;
  6090. }
  6091. }
  6092. }
  6093. catch (err) {
  6094. // eslint-disable-next-line no-console
  6095. console.log(`Unexpected error attempting to determine the actual case of the file '${filePath}': ${err}`);
  6096. }
  6097. return filePath;
  6098. }
  6099. else {
  6100. if (isUnixExecutable(stats)) {
  6101. return filePath;
  6102. }
  6103. }
  6104. }
  6105. }
  6106. return '';
  6107. });
  6108. }
  6109. exports.tryGetExecutablePath = tryGetExecutablePath;
  6110. function normalizeSeparators(p) {
  6111. p = p || '';
  6112. if (exports.IS_WINDOWS) {
  6113. // convert slashes on Windows
  6114. p = p.replace(/\//g, '\\');
  6115. // remove redundant slashes
  6116. return p.replace(/\\\\+/g, '\\');
  6117. }
  6118. // remove redundant slashes
  6119. return p.replace(/\/\/+/g, '/');
  6120. }
  6121. // on Mac/Linux, test the execute bit
  6122. // R W X R W X R W X
  6123. // 256 128 64 32 16 8 4 2 1
  6124. function isUnixExecutable(stats) {
  6125. return ((stats.mode & 1) > 0 ||
  6126. ((stats.mode & 8) > 0 && stats.gid === process.getgid()) ||
  6127. ((stats.mode & 64) > 0 && stats.uid === process.getuid()));
  6128. }
  6129. // Get the path of cmd.exe in windows
  6130. function getCmdPath() {
  6131. var _a;
  6132. return (_a = process.env['COMSPEC']) !== null && _a !== void 0 ? _a : `cmd.exe`;
  6133. }
  6134. exports.getCmdPath = getCmdPath;
  6135. //# sourceMappingURL=io-util.js.map
  6136. /***/ }),
  6137. /***/ 7436:
  6138. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  6139. "use strict";
  6140. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  6141. if (k2 === undefined) k2 = k;
  6142. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  6143. }) : (function(o, m, k, k2) {
  6144. if (k2 === undefined) k2 = k;
  6145. o[k2] = m[k];
  6146. }));
  6147. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  6148. Object.defineProperty(o, "default", { enumerable: true, value: v });
  6149. }) : function(o, v) {
  6150. o["default"] = v;
  6151. });
  6152. var __importStar = (this && this.__importStar) || function (mod) {
  6153. if (mod && mod.__esModule) return mod;
  6154. var result = {};
  6155. if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  6156. __setModuleDefault(result, mod);
  6157. return result;
  6158. };
  6159. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  6160. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  6161. return new (P || (P = Promise))(function (resolve, reject) {
  6162. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  6163. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  6164. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  6165. step((generator = generator.apply(thisArg, _arguments || [])).next());
  6166. });
  6167. };
  6168. Object.defineProperty(exports, "__esModule", ({ value: true }));
  6169. exports.findInPath = exports.which = exports.mkdirP = exports.rmRF = exports.mv = exports.cp = void 0;
  6170. const assert_1 = __nccwpck_require__(9491);
  6171. const path = __importStar(__nccwpck_require__(1017));
  6172. const ioUtil = __importStar(__nccwpck_require__(1962));
  6173. /**
  6174. * Copies a file or folder.
  6175. * Based off of shelljs - https://github.com/shelljs/shelljs/blob/9237f66c52e5daa40458f94f9565e18e8132f5a6/src/cp.js
  6176. *
  6177. * @param source source path
  6178. * @param dest destination path
  6179. * @param options optional. See CopyOptions.
  6180. */
  6181. function cp(source, dest, options = {}) {
  6182. return __awaiter(this, void 0, void 0, function* () {
  6183. const { force, recursive, copySourceDirectory } = readCopyOptions(options);
  6184. const destStat = (yield ioUtil.exists(dest)) ? yield ioUtil.stat(dest) : null;
  6185. // Dest is an existing file, but not forcing
  6186. if (destStat && destStat.isFile() && !force) {
  6187. return;
  6188. }
  6189. // If dest is an existing directory, should copy inside.
  6190. const newDest = destStat && destStat.isDirectory() && copySourceDirectory
  6191. ? path.join(dest, path.basename(source))
  6192. : dest;
  6193. if (!(yield ioUtil.exists(source))) {
  6194. throw new Error(`no such file or directory: ${source}`);
  6195. }
  6196. const sourceStat = yield ioUtil.stat(source);
  6197. if (sourceStat.isDirectory()) {
  6198. if (!recursive) {
  6199. throw new Error(`Failed to copy. ${source} is a directory, but tried to copy without recursive flag.`);
  6200. }
  6201. else {
  6202. yield cpDirRecursive(source, newDest, 0, force);
  6203. }
  6204. }
  6205. else {
  6206. if (path.relative(source, newDest) === '') {
  6207. // a file cannot be copied to itself
  6208. throw new Error(`'${newDest}' and '${source}' are the same file`);
  6209. }
  6210. yield copyFile(source, newDest, force);
  6211. }
  6212. });
  6213. }
  6214. exports.cp = cp;
  6215. /**
  6216. * Moves a path.
  6217. *
  6218. * @param source source path
  6219. * @param dest destination path
  6220. * @param options optional. See MoveOptions.
  6221. */
  6222. function mv(source, dest, options = {}) {
  6223. return __awaiter(this, void 0, void 0, function* () {
  6224. if (yield ioUtil.exists(dest)) {
  6225. let destExists = true;
  6226. if (yield ioUtil.isDirectory(dest)) {
  6227. // If dest is directory copy src into dest
  6228. dest = path.join(dest, path.basename(source));
  6229. destExists = yield ioUtil.exists(dest);
  6230. }
  6231. if (destExists) {
  6232. if (options.force == null || options.force) {
  6233. yield rmRF(dest);
  6234. }
  6235. else {
  6236. throw new Error('Destination already exists');
  6237. }
  6238. }
  6239. }
  6240. yield mkdirP(path.dirname(dest));
  6241. yield ioUtil.rename(source, dest);
  6242. });
  6243. }
  6244. exports.mv = mv;
  6245. /**
  6246. * Remove a path recursively with force
  6247. *
  6248. * @param inputPath path to remove
  6249. */
  6250. function rmRF(inputPath) {
  6251. return __awaiter(this, void 0, void 0, function* () {
  6252. if (ioUtil.IS_WINDOWS) {
  6253. // Check for invalid characters
  6254. // https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file
  6255. if (/[*"<>|]/.test(inputPath)) {
  6256. throw new Error('File path must not contain `*`, `"`, `<`, `>` or `|` on Windows');
  6257. }
  6258. }
  6259. try {
  6260. // note if path does not exist, error is silent
  6261. yield ioUtil.rm(inputPath, {
  6262. force: true,
  6263. maxRetries: 3,
  6264. recursive: true,
  6265. retryDelay: 300
  6266. });
  6267. }
  6268. catch (err) {
  6269. throw new Error(`File was unable to be removed ${err}`);
  6270. }
  6271. });
  6272. }
  6273. exports.rmRF = rmRF;
  6274. /**
  6275. * Make a directory. Creates the full path with folders in between
  6276. * Will throw if it fails
  6277. *
  6278. * @param fsPath path to create
  6279. * @returns Promise<void>
  6280. */
  6281. function mkdirP(fsPath) {
  6282. return __awaiter(this, void 0, void 0, function* () {
  6283. assert_1.ok(fsPath, 'a path argument must be provided');
  6284. yield ioUtil.mkdir(fsPath, { recursive: true });
  6285. });
  6286. }
  6287. exports.mkdirP = mkdirP;
  6288. /**
  6289. * Returns path of a tool had the tool actually been invoked. Resolves via paths.
  6290. * If you check and the tool does not exist, it will throw.
  6291. *
  6292. * @param tool name of the tool
  6293. * @param check whether to check if tool exists
  6294. * @returns Promise<string> path to tool
  6295. */
  6296. function which(tool, check) {
  6297. return __awaiter(this, void 0, void 0, function* () {
  6298. if (!tool) {
  6299. throw new Error("parameter 'tool' is required");
  6300. }
  6301. // recursive when check=true
  6302. if (check) {
  6303. const result = yield which(tool, false);
  6304. if (!result) {
  6305. if (ioUtil.IS_WINDOWS) {
  6306. 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.`);
  6307. }
  6308. else {
  6309. 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.`);
  6310. }
  6311. }
  6312. return result;
  6313. }
  6314. const matches = yield findInPath(tool);
  6315. if (matches && matches.length > 0) {
  6316. return matches[0];
  6317. }
  6318. return '';
  6319. });
  6320. }
  6321. exports.which = which;
  6322. /**
  6323. * Returns a list of all occurrences of the given tool on the system path.
  6324. *
  6325. * @returns Promise<string[]> the paths of the tool
  6326. */
  6327. function findInPath(tool) {
  6328. return __awaiter(this, void 0, void 0, function* () {
  6329. if (!tool) {
  6330. throw new Error("parameter 'tool' is required");
  6331. }
  6332. // build the list of extensions to try
  6333. const extensions = [];
  6334. if (ioUtil.IS_WINDOWS && process.env['PATHEXT']) {
  6335. for (const extension of process.env['PATHEXT'].split(path.delimiter)) {
  6336. if (extension) {
  6337. extensions.push(extension);
  6338. }
  6339. }
  6340. }
  6341. // if it's rooted, return it if exists. otherwise return empty.
  6342. if (ioUtil.isRooted(tool)) {
  6343. const filePath = yield ioUtil.tryGetExecutablePath(tool, extensions);
  6344. if (filePath) {
  6345. return [filePath];
  6346. }
  6347. return [];
  6348. }
  6349. // if any path separators, return empty
  6350. if (tool.includes(path.sep)) {
  6351. return [];
  6352. }
  6353. // build the list of directories
  6354. //
  6355. // Note, technically "where" checks the current directory on Windows. From a toolkit perspective,
  6356. // it feels like we should not do this. Checking the current directory seems like more of a use
  6357. // case of a shell, and the which() function exposed by the toolkit should strive for consistency
  6358. // across platforms.
  6359. const directories = [];
  6360. if (process.env.PATH) {
  6361. for (const p of process.env.PATH.split(path.delimiter)) {
  6362. if (p) {
  6363. directories.push(p);
  6364. }
  6365. }
  6366. }
  6367. // find all matches
  6368. const matches = [];
  6369. for (const directory of directories) {
  6370. const filePath = yield ioUtil.tryGetExecutablePath(path.join(directory, tool), extensions);
  6371. if (filePath) {
  6372. matches.push(filePath);
  6373. }
  6374. }
  6375. return matches;
  6376. });
  6377. }
  6378. exports.findInPath = findInPath;
  6379. function readCopyOptions(options) {
  6380. const force = options.force == null ? true : options.force;
  6381. const recursive = Boolean(options.recursive);
  6382. const copySourceDirectory = options.copySourceDirectory == null
  6383. ? true
  6384. : Boolean(options.copySourceDirectory);
  6385. return { force, recursive, copySourceDirectory };
  6386. }
  6387. function cpDirRecursive(sourceDir, destDir, currentDepth, force) {
  6388. return __awaiter(this, void 0, void 0, function* () {
  6389. // Ensure there is not a run away recursive copy
  6390. if (currentDepth >= 255)
  6391. return;
  6392. currentDepth++;
  6393. yield mkdirP(destDir);
  6394. const files = yield ioUtil.readdir(sourceDir);
  6395. for (const fileName of files) {
  6396. const srcFile = `${sourceDir}/${fileName}`;
  6397. const destFile = `${destDir}/${fileName}`;
  6398. const srcFileStat = yield ioUtil.lstat(srcFile);
  6399. if (srcFileStat.isDirectory()) {
  6400. // Recurse
  6401. yield cpDirRecursive(srcFile, destFile, currentDepth, force);
  6402. }
  6403. else {
  6404. yield copyFile(srcFile, destFile, force);
  6405. }
  6406. }
  6407. // Change the mode for the newly created directory
  6408. yield ioUtil.chmod(destDir, (yield ioUtil.stat(sourceDir)).mode);
  6409. });
  6410. }
  6411. // Buffered file copy
  6412. function copyFile(srcFile, destFile, force) {
  6413. return __awaiter(this, void 0, void 0, function* () {
  6414. if ((yield ioUtil.lstat(srcFile)).isSymbolicLink()) {
  6415. // unlink/re-link it
  6416. try {
  6417. yield ioUtil.lstat(destFile);
  6418. yield ioUtil.unlink(destFile);
  6419. }
  6420. catch (e) {
  6421. // Try to override file permission
  6422. if (e.code === 'EPERM') {
  6423. yield ioUtil.chmod(destFile, '0666');
  6424. yield ioUtil.unlink(destFile);
  6425. }
  6426. // other errors = it doesn't exist, no work to do
  6427. }
  6428. // Copy over symlink
  6429. const symlinkFull = yield ioUtil.readlink(srcFile);
  6430. yield ioUtil.symlink(symlinkFull, destFile, ioUtil.IS_WINDOWS ? 'junction' : null);
  6431. }
  6432. else if (!(yield ioUtil.exists(destFile)) || force) {
  6433. yield ioUtil.copyFile(srcFile, destFile);
  6434. }
  6435. });
  6436. }
  6437. //# sourceMappingURL=io.js.map
  6438. /***/ }),
  6439. /***/ 2473:
  6440. /***/ (function(module, exports, __nccwpck_require__) {
  6441. "use strict";
  6442. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  6443. if (k2 === undefined) k2 = k;
  6444. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  6445. }) : (function(o, m, k, k2) {
  6446. if (k2 === undefined) k2 = k;
  6447. o[k2] = m[k];
  6448. }));
  6449. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  6450. Object.defineProperty(o, "default", { enumerable: true, value: v });
  6451. }) : function(o, v) {
  6452. o["default"] = v;
  6453. });
  6454. var __importStar = (this && this.__importStar) || function (mod) {
  6455. if (mod && mod.__esModule) return mod;
  6456. var result = {};
  6457. if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  6458. __setModuleDefault(result, mod);
  6459. return result;
  6460. };
  6461. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  6462. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  6463. return new (P || (P = Promise))(function (resolve, reject) {
  6464. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  6465. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  6466. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  6467. step((generator = generator.apply(thisArg, _arguments || [])).next());
  6468. });
  6469. };
  6470. Object.defineProperty(exports, "__esModule", ({ value: true }));
  6471. exports._readLinuxVersionFile = exports._getOsVersion = exports._findMatch = void 0;
  6472. const semver = __importStar(__nccwpck_require__(5911));
  6473. const core_1 = __nccwpck_require__(2186);
  6474. // needs to be require for core node modules to be mocked
  6475. /* eslint @typescript-eslint/no-require-imports: 0 */
  6476. const os = __nccwpck_require__(2037);
  6477. const cp = __nccwpck_require__(2081);
  6478. const fs = __nccwpck_require__(7147);
  6479. function _findMatch(versionSpec, stable, candidates, archFilter) {
  6480. return __awaiter(this, void 0, void 0, function* () {
  6481. const platFilter = os.platform();
  6482. let result;
  6483. let match;
  6484. let file;
  6485. for (const candidate of candidates) {
  6486. const version = candidate.version;
  6487. core_1.debug(`check ${version} satisfies ${versionSpec}`);
  6488. if (semver.satisfies(version, versionSpec) &&
  6489. (!stable || candidate.stable === stable)) {
  6490. file = candidate.files.find(item => {
  6491. core_1.debug(`${item.arch}===${archFilter} && ${item.platform}===${platFilter}`);
  6492. let chk = item.arch === archFilter && item.platform === platFilter;
  6493. if (chk && item.platform_version) {
  6494. const osVersion = module.exports._getOsVersion();
  6495. if (osVersion === item.platform_version) {
  6496. chk = true;
  6497. }
  6498. else {
  6499. chk = semver.satisfies(osVersion, item.platform_version);
  6500. }
  6501. }
  6502. return chk;
  6503. });
  6504. if (file) {
  6505. core_1.debug(`matched ${candidate.version}`);
  6506. match = candidate;
  6507. break;
  6508. }
  6509. }
  6510. }
  6511. if (match && file) {
  6512. // clone since we're mutating the file list to be only the file that matches
  6513. result = Object.assign({}, match);
  6514. result.files = [file];
  6515. }
  6516. return result;
  6517. });
  6518. }
  6519. exports._findMatch = _findMatch;
  6520. function _getOsVersion() {
  6521. // TODO: add windows and other linux, arm variants
  6522. // right now filtering on version is only an ubuntu and macos scenario for tools we build for hosted (python)
  6523. const plat = os.platform();
  6524. let version = '';
  6525. if (plat === 'darwin') {
  6526. version = cp.execSync('sw_vers -productVersion').toString();
  6527. }
  6528. else if (plat === 'linux') {
  6529. // lsb_release process not in some containers, readfile
  6530. // Run cat /etc/lsb-release
  6531. // DISTRIB_ID=Ubuntu
  6532. // DISTRIB_RELEASE=18.04
  6533. // DISTRIB_CODENAME=bionic
  6534. // DISTRIB_DESCRIPTION="Ubuntu 18.04.4 LTS"
  6535. const lsbContents = module.exports._readLinuxVersionFile();
  6536. if (lsbContents) {
  6537. const lines = lsbContents.split('\n');
  6538. for (const line of lines) {
  6539. const parts = line.split('=');
  6540. if (parts.length === 2 &&
  6541. (parts[0].trim() === 'VERSION_ID' ||
  6542. parts[0].trim() === 'DISTRIB_RELEASE')) {
  6543. version = parts[1]
  6544. .trim()
  6545. .replace(/^"/, '')
  6546. .replace(/"$/, '');
  6547. break;
  6548. }
  6549. }
  6550. }
  6551. }
  6552. return version;
  6553. }
  6554. exports._getOsVersion = _getOsVersion;
  6555. function _readLinuxVersionFile() {
  6556. const lsbReleaseFile = '/etc/lsb-release';
  6557. const osReleaseFile = '/etc/os-release';
  6558. let contents = '';
  6559. if (fs.existsSync(lsbReleaseFile)) {
  6560. contents = fs.readFileSync(lsbReleaseFile).toString();
  6561. }
  6562. else if (fs.existsSync(osReleaseFile)) {
  6563. contents = fs.readFileSync(osReleaseFile).toString();
  6564. }
  6565. return contents;
  6566. }
  6567. exports._readLinuxVersionFile = _readLinuxVersionFile;
  6568. //# sourceMappingURL=manifest.js.map
  6569. /***/ }),
  6570. /***/ 8279:
  6571. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  6572. "use strict";
  6573. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  6574. if (k2 === undefined) k2 = k;
  6575. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  6576. }) : (function(o, m, k, k2) {
  6577. if (k2 === undefined) k2 = k;
  6578. o[k2] = m[k];
  6579. }));
  6580. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  6581. Object.defineProperty(o, "default", { enumerable: true, value: v });
  6582. }) : function(o, v) {
  6583. o["default"] = v;
  6584. });
  6585. var __importStar = (this && this.__importStar) || function (mod) {
  6586. if (mod && mod.__esModule) return mod;
  6587. var result = {};
  6588. if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  6589. __setModuleDefault(result, mod);
  6590. return result;
  6591. };
  6592. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  6593. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  6594. return new (P || (P = Promise))(function (resolve, reject) {
  6595. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  6596. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  6597. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  6598. step((generator = generator.apply(thisArg, _arguments || [])).next());
  6599. });
  6600. };
  6601. Object.defineProperty(exports, "__esModule", ({ value: true }));
  6602. exports.RetryHelper = void 0;
  6603. const core = __importStar(__nccwpck_require__(2186));
  6604. /**
  6605. * Internal class for retries
  6606. */
  6607. class RetryHelper {
  6608. constructor(maxAttempts, minSeconds, maxSeconds) {
  6609. if (maxAttempts < 1) {
  6610. throw new Error('max attempts should be greater than or equal to 1');
  6611. }
  6612. this.maxAttempts = maxAttempts;
  6613. this.minSeconds = Math.floor(minSeconds);
  6614. this.maxSeconds = Math.floor(maxSeconds);
  6615. if (this.minSeconds > this.maxSeconds) {
  6616. throw new Error('min seconds should be less than or equal to max seconds');
  6617. }
  6618. }
  6619. execute(action, isRetryable) {
  6620. return __awaiter(this, void 0, void 0, function* () {
  6621. let attempt = 1;
  6622. while (attempt < this.maxAttempts) {
  6623. // Try
  6624. try {
  6625. return yield action();
  6626. }
  6627. catch (err) {
  6628. if (isRetryable && !isRetryable(err)) {
  6629. throw err;
  6630. }
  6631. core.info(err.message);
  6632. }
  6633. // Sleep
  6634. const seconds = this.getSleepAmount();
  6635. core.info(`Waiting ${seconds} seconds before trying again`);
  6636. yield this.sleep(seconds);
  6637. attempt++;
  6638. }
  6639. // Last attempt
  6640. return yield action();
  6641. });
  6642. }
  6643. getSleepAmount() {
  6644. return (Math.floor(Math.random() * (this.maxSeconds - this.minSeconds + 1)) +
  6645. this.minSeconds);
  6646. }
  6647. sleep(seconds) {
  6648. return __awaiter(this, void 0, void 0, function* () {
  6649. return new Promise(resolve => setTimeout(resolve, seconds * 1000));
  6650. });
  6651. }
  6652. }
  6653. exports.RetryHelper = RetryHelper;
  6654. //# sourceMappingURL=retry-helper.js.map
  6655. /***/ }),
  6656. /***/ 7784:
  6657. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  6658. "use strict";
  6659. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  6660. if (k2 === undefined) k2 = k;
  6661. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  6662. }) : (function(o, m, k, k2) {
  6663. if (k2 === undefined) k2 = k;
  6664. o[k2] = m[k];
  6665. }));
  6666. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  6667. Object.defineProperty(o, "default", { enumerable: true, value: v });
  6668. }) : function(o, v) {
  6669. o["default"] = v;
  6670. });
  6671. var __importStar = (this && this.__importStar) || function (mod) {
  6672. if (mod && mod.__esModule) return mod;
  6673. var result = {};
  6674. if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  6675. __setModuleDefault(result, mod);
  6676. return result;
  6677. };
  6678. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  6679. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  6680. return new (P || (P = Promise))(function (resolve, reject) {
  6681. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  6682. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  6683. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  6684. step((generator = generator.apply(thisArg, _arguments || [])).next());
  6685. });
  6686. };
  6687. var __importDefault = (this && this.__importDefault) || function (mod) {
  6688. return (mod && mod.__esModule) ? mod : { "default": mod };
  6689. };
  6690. Object.defineProperty(exports, "__esModule", ({ value: true }));
  6691. 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;
  6692. const core = __importStar(__nccwpck_require__(2186));
  6693. const io = __importStar(__nccwpck_require__(7436));
  6694. const fs = __importStar(__nccwpck_require__(7147));
  6695. const mm = __importStar(__nccwpck_require__(2473));
  6696. const os = __importStar(__nccwpck_require__(2037));
  6697. const path = __importStar(__nccwpck_require__(1017));
  6698. const httpm = __importStar(__nccwpck_require__(6255));
  6699. const semver = __importStar(__nccwpck_require__(5911));
  6700. const stream = __importStar(__nccwpck_require__(2781));
  6701. const util = __importStar(__nccwpck_require__(3837));
  6702. const assert_1 = __nccwpck_require__(9491);
  6703. const v4_1 = __importDefault(__nccwpck_require__(7468));
  6704. const exec_1 = __nccwpck_require__(1514);
  6705. const retry_helper_1 = __nccwpck_require__(8279);
  6706. class HTTPError extends Error {
  6707. constructor(httpStatusCode) {
  6708. super(`Unexpected HTTP response: ${httpStatusCode}`);
  6709. this.httpStatusCode = httpStatusCode;
  6710. Object.setPrototypeOf(this, new.target.prototype);
  6711. }
  6712. }
  6713. exports.HTTPError = HTTPError;
  6714. const IS_WINDOWS = process.platform === 'win32';
  6715. const IS_MAC = process.platform === 'darwin';
  6716. const userAgent = 'actions/tool-cache';
  6717. /**
  6718. * Download a tool from an url and stream it into a file
  6719. *
  6720. * @param url url of tool to download
  6721. * @param dest path to download tool
  6722. * @param auth authorization header
  6723. * @param headers other headers
  6724. * @returns path to downloaded tool
  6725. */
  6726. function downloadTool(url, dest, auth, headers) {
  6727. return __awaiter(this, void 0, void 0, function* () {
  6728. dest = dest || path.join(_getTempDirectory(), v4_1.default());
  6729. yield io.mkdirP(path.dirname(dest));
  6730. core.debug(`Downloading ${url}`);
  6731. core.debug(`Destination ${dest}`);
  6732. const maxAttempts = 3;
  6733. const minSeconds = _getGlobal('TEST_DOWNLOAD_TOOL_RETRY_MIN_SECONDS', 10);
  6734. const maxSeconds = _getGlobal('TEST_DOWNLOAD_TOOL_RETRY_MAX_SECONDS', 20);
  6735. const retryHelper = new retry_helper_1.RetryHelper(maxAttempts, minSeconds, maxSeconds);
  6736. return yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  6737. return yield downloadToolAttempt(url, dest || '', auth, headers);
  6738. }), (err) => {
  6739. if (err instanceof HTTPError && err.httpStatusCode) {
  6740. // Don't retry anything less than 500, except 408 Request Timeout and 429 Too Many Requests
  6741. if (err.httpStatusCode < 500 &&
  6742. err.httpStatusCode !== 408 &&
  6743. err.httpStatusCode !== 429) {
  6744. return false;
  6745. }
  6746. }
  6747. // Otherwise retry
  6748. return true;
  6749. });
  6750. });
  6751. }
  6752. exports.downloadTool = downloadTool;
  6753. function downloadToolAttempt(url, dest, auth, headers) {
  6754. return __awaiter(this, void 0, void 0, function* () {
  6755. if (fs.existsSync(dest)) {
  6756. throw new Error(`Destination file path ${dest} already exists`);
  6757. }
  6758. // Get the response headers
  6759. const http = new httpm.HttpClient(userAgent, [], {
  6760. allowRetries: false
  6761. });
  6762. if (auth) {
  6763. core.debug('set auth');
  6764. if (headers === undefined) {
  6765. headers = {};
  6766. }
  6767. headers.authorization = auth;
  6768. }
  6769. const response = yield http.get(url, headers);
  6770. if (response.message.statusCode !== 200) {
  6771. const err = new HTTPError(response.message.statusCode);
  6772. core.debug(`Failed to download from "${url}". Code(${response.message.statusCode}) Message(${response.message.statusMessage})`);
  6773. throw err;
  6774. }
  6775. // Download the response body
  6776. const pipeline = util.promisify(stream.pipeline);
  6777. const responseMessageFactory = _getGlobal('TEST_DOWNLOAD_TOOL_RESPONSE_MESSAGE_FACTORY', () => response.message);
  6778. const readStream = responseMessageFactory();
  6779. let succeeded = false;
  6780. try {
  6781. yield pipeline(readStream, fs.createWriteStream(dest));
  6782. core.debug('download complete');
  6783. succeeded = true;
  6784. return dest;
  6785. }
  6786. finally {
  6787. // Error, delete dest before retry
  6788. if (!succeeded) {
  6789. core.debug('download failed');
  6790. try {
  6791. yield io.rmRF(dest);
  6792. }
  6793. catch (err) {
  6794. core.debug(`Failed to delete '${dest}'. ${err.message}`);
  6795. }
  6796. }
  6797. }
  6798. });
  6799. }
  6800. /**
  6801. * Extract a .7z file
  6802. *
  6803. * @param file path to the .7z file
  6804. * @param dest destination directory. Optional.
  6805. * @param _7zPath path to 7zr.exe. Optional, for long path support. Most .7z archives do not have this
  6806. * problem. If your .7z archive contains very long paths, you can pass the path to 7zr.exe which will
  6807. * gracefully handle long paths. By default 7zdec.exe is used because it is a very small program and is
  6808. * bundled with the tool lib. However it does not support long paths. 7zr.exe is the reduced command line
  6809. * interface, it is smaller than the full command line interface, and it does support long paths. At the
  6810. * time of this writing, it is freely available from the LZMA SDK that is available on the 7zip website.
  6811. * Be sure to check the current license agreement. If 7zr.exe is bundled with your action, then the path
  6812. * to 7zr.exe can be pass to this function.
  6813. * @returns path to the destination directory
  6814. */
  6815. function extract7z(file, dest, _7zPath) {
  6816. return __awaiter(this, void 0, void 0, function* () {
  6817. assert_1.ok(IS_WINDOWS, 'extract7z() not supported on current OS');
  6818. assert_1.ok(file, 'parameter "file" is required');
  6819. dest = yield _createExtractFolder(dest);
  6820. const originalCwd = process.cwd();
  6821. process.chdir(dest);
  6822. if (_7zPath) {
  6823. try {
  6824. const logLevel = core.isDebug() ? '-bb1' : '-bb0';
  6825. const args = [
  6826. 'x',
  6827. logLevel,
  6828. '-bd',
  6829. '-sccUTF-8',
  6830. file
  6831. ];
  6832. const options = {
  6833. silent: true
  6834. };
  6835. yield exec_1.exec(`"${_7zPath}"`, args, options);
  6836. }
  6837. finally {
  6838. process.chdir(originalCwd);
  6839. }
  6840. }
  6841. else {
  6842. const escapedScript = path
  6843. .join(__dirname, '..', 'scripts', 'Invoke-7zdec.ps1')
  6844. .replace(/'/g, "''")
  6845. .replace(/"|\n|\r/g, ''); // double-up single quotes, remove double quotes and newlines
  6846. const escapedFile = file.replace(/'/g, "''").replace(/"|\n|\r/g, '');
  6847. const escapedTarget = dest.replace(/'/g, "''").replace(/"|\n|\r/g, '');
  6848. const command = `& '${escapedScript}' -Source '${escapedFile}' -Target '${escapedTarget}'`;
  6849. const args = [
  6850. '-NoLogo',
  6851. '-Sta',
  6852. '-NoProfile',
  6853. '-NonInteractive',
  6854. '-ExecutionPolicy',
  6855. 'Unrestricted',
  6856. '-Command',
  6857. command
  6858. ];
  6859. const options = {
  6860. silent: true
  6861. };
  6862. try {
  6863. const powershellPath = yield io.which('powershell', true);
  6864. yield exec_1.exec(`"${powershellPath}"`, args, options);
  6865. }
  6866. finally {
  6867. process.chdir(originalCwd);
  6868. }
  6869. }
  6870. return dest;
  6871. });
  6872. }
  6873. exports.extract7z = extract7z;
  6874. /**
  6875. * Extract a compressed tar archive
  6876. *
  6877. * @param file path to the tar
  6878. * @param dest destination directory. Optional.
  6879. * @param flags flags for the tar command to use for extraction. Defaults to 'xz' (extracting gzipped tars). Optional.
  6880. * @returns path to the destination directory
  6881. */
  6882. function extractTar(file, dest, flags = 'xz') {
  6883. return __awaiter(this, void 0, void 0, function* () {
  6884. if (!file) {
  6885. throw new Error("parameter 'file' is required");
  6886. }
  6887. // Create dest
  6888. dest = yield _createExtractFolder(dest);
  6889. // Determine whether GNU tar
  6890. core.debug('Checking tar --version');
  6891. let versionOutput = '';
  6892. yield exec_1.exec('tar --version', [], {
  6893. ignoreReturnCode: true,
  6894. silent: true,
  6895. listeners: {
  6896. stdout: (data) => (versionOutput += data.toString()),
  6897. stderr: (data) => (versionOutput += data.toString())
  6898. }
  6899. });
  6900. core.debug(versionOutput.trim());
  6901. const isGnuTar = versionOutput.toUpperCase().includes('GNU TAR');
  6902. // Initialize args
  6903. let args;
  6904. if (flags instanceof Array) {
  6905. args = flags;
  6906. }
  6907. else {
  6908. args = [flags];
  6909. }
  6910. if (core.isDebug() && !flags.includes('v')) {
  6911. args.push('-v');
  6912. }
  6913. let destArg = dest;
  6914. let fileArg = file;
  6915. if (IS_WINDOWS && isGnuTar) {
  6916. args.push('--force-local');
  6917. destArg = dest.replace(/\\/g, '/');
  6918. // Technically only the dest needs to have `/` but for aesthetic consistency
  6919. // convert slashes in the file arg too.
  6920. fileArg = file.replace(/\\/g, '/');
  6921. }
  6922. if (isGnuTar) {
  6923. // Suppress warnings when using GNU tar to extract archives created by BSD tar
  6924. args.push('--warning=no-unknown-keyword');
  6925. args.push('--overwrite');
  6926. }
  6927. args.push('-C', destArg, '-f', fileArg);
  6928. yield exec_1.exec(`tar`, args);
  6929. return dest;
  6930. });
  6931. }
  6932. exports.extractTar = extractTar;
  6933. /**
  6934. * Extract a xar compatible archive
  6935. *
  6936. * @param file path to the archive
  6937. * @param dest destination directory. Optional.
  6938. * @param flags flags for the xar. Optional.
  6939. * @returns path to the destination directory
  6940. */
  6941. function extractXar(file, dest, flags = []) {
  6942. return __awaiter(this, void 0, void 0, function* () {
  6943. assert_1.ok(IS_MAC, 'extractXar() not supported on current OS');
  6944. assert_1.ok(file, 'parameter "file" is required');
  6945. dest = yield _createExtractFolder(dest);
  6946. let args;
  6947. if (flags instanceof Array) {
  6948. args = flags;
  6949. }
  6950. else {
  6951. args = [flags];
  6952. }
  6953. args.push('-x', '-C', dest, '-f', file);
  6954. if (core.isDebug()) {
  6955. args.push('-v');
  6956. }
  6957. const xarPath = yield io.which('xar', true);
  6958. yield exec_1.exec(`"${xarPath}"`, _unique(args));
  6959. return dest;
  6960. });
  6961. }
  6962. exports.extractXar = extractXar;
  6963. /**
  6964. * Extract a zip
  6965. *
  6966. * @param file path to the zip
  6967. * @param dest destination directory. Optional.
  6968. * @returns path to the destination directory
  6969. */
  6970. function extractZip(file, dest) {
  6971. return __awaiter(this, void 0, void 0, function* () {
  6972. if (!file) {
  6973. throw new Error("parameter 'file' is required");
  6974. }
  6975. dest = yield _createExtractFolder(dest);
  6976. if (IS_WINDOWS) {
  6977. yield extractZipWin(file, dest);
  6978. }
  6979. else {
  6980. yield extractZipNix(file, dest);
  6981. }
  6982. return dest;
  6983. });
  6984. }
  6985. exports.extractZip = extractZip;
  6986. function extractZipWin(file, dest) {
  6987. return __awaiter(this, void 0, void 0, function* () {
  6988. // build the powershell command
  6989. const escapedFile = file.replace(/'/g, "''").replace(/"|\n|\r/g, ''); // double-up single quotes, remove double quotes and newlines
  6990. const escapedDest = dest.replace(/'/g, "''").replace(/"|\n|\r/g, '');
  6991. const pwshPath = yield io.which('pwsh', false);
  6992. //To match the file overwrite behavior on nix systems, we use the overwrite = true flag for ExtractToDirectory
  6993. //and the -Force flag for Expand-Archive as a fallback
  6994. if (pwshPath) {
  6995. //attempt to use pwsh with ExtractToDirectory, if this fails attempt Expand-Archive
  6996. const pwshCommand = [
  6997. `$ErrorActionPreference = 'Stop' ;`,
  6998. `try { Add-Type -AssemblyName System.IO.Compression.ZipFile } catch { } ;`,
  6999. `try { [System.IO.Compression.ZipFile]::ExtractToDirectory('${escapedFile}', '${escapedDest}', $true) }`,
  7000. `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 $_ } } ;`
  7001. ].join(' ');
  7002. const args = [
  7003. '-NoLogo',
  7004. '-NoProfile',
  7005. '-NonInteractive',
  7006. '-ExecutionPolicy',
  7007. 'Unrestricted',
  7008. '-Command',
  7009. pwshCommand
  7010. ];
  7011. core.debug(`Using pwsh at path: ${pwshPath}`);
  7012. yield exec_1.exec(`"${pwshPath}"`, args);
  7013. }
  7014. else {
  7015. const powershellCommand = [
  7016. `$ErrorActionPreference = 'Stop' ;`,
  7017. `try { Add-Type -AssemblyName System.IO.Compression.FileSystem } catch { } ;`,
  7018. `if ((Get-Command -Name Expand-Archive -Module Microsoft.PowerShell.Archive -ErrorAction Ignore)) { Expand-Archive -LiteralPath '${escapedFile}' -DestinationPath '${escapedDest}' -Force }`,
  7019. `else {[System.IO.Compression.ZipFile]::ExtractToDirectory('${escapedFile}', '${escapedDest}', $true) }`
  7020. ].join(' ');
  7021. const args = [
  7022. '-NoLogo',
  7023. '-Sta',
  7024. '-NoProfile',
  7025. '-NonInteractive',
  7026. '-ExecutionPolicy',
  7027. 'Unrestricted',
  7028. '-Command',
  7029. powershellCommand
  7030. ];
  7031. const powershellPath = yield io.which('powershell', true);
  7032. core.debug(`Using powershell at path: ${powershellPath}`);
  7033. yield exec_1.exec(`"${powershellPath}"`, args);
  7034. }
  7035. });
  7036. }
  7037. function extractZipNix(file, dest) {
  7038. return __awaiter(this, void 0, void 0, function* () {
  7039. const unzipPath = yield io.which('unzip', true);
  7040. const args = [file];
  7041. if (!core.isDebug()) {
  7042. args.unshift('-q');
  7043. }
  7044. args.unshift('-o'); //overwrite with -o, otherwise a prompt is shown which freezes the run
  7045. yield exec_1.exec(`"${unzipPath}"`, args, { cwd: dest });
  7046. });
  7047. }
  7048. /**
  7049. * Caches a directory and installs it into the tool cacheDir
  7050. *
  7051. * @param sourceDir the directory to cache into tools
  7052. * @param tool tool name
  7053. * @param version version of the tool. semver format
  7054. * @param arch architecture of the tool. Optional. Defaults to machine architecture
  7055. */
  7056. function cacheDir(sourceDir, tool, version, arch) {
  7057. return __awaiter(this, void 0, void 0, function* () {
  7058. version = semver.clean(version) || version;
  7059. arch = arch || os.arch();
  7060. core.debug(`Caching tool ${tool} ${version} ${arch}`);
  7061. core.debug(`source dir: ${sourceDir}`);
  7062. if (!fs.statSync(sourceDir).isDirectory()) {
  7063. throw new Error('sourceDir is not a directory');
  7064. }
  7065. // Create the tool dir
  7066. const destPath = yield _createToolPath(tool, version, arch);
  7067. // copy each child item. do not move. move can fail on Windows
  7068. // due to anti-virus software having an open handle on a file.
  7069. for (const itemName of fs.readdirSync(sourceDir)) {
  7070. const s = path.join(sourceDir, itemName);
  7071. yield io.cp(s, destPath, { recursive: true });
  7072. }
  7073. // write .complete
  7074. _completeToolPath(tool, version, arch);
  7075. return destPath;
  7076. });
  7077. }
  7078. exports.cacheDir = cacheDir;
  7079. /**
  7080. * Caches a downloaded file (GUID) and installs it
  7081. * into the tool cache with a given targetName
  7082. *
  7083. * @param sourceFile the file to cache into tools. Typically a result of downloadTool which is a guid.
  7084. * @param targetFile the name of the file name in the tools directory
  7085. * @param tool tool name
  7086. * @param version version of the tool. semver format
  7087. * @param arch architecture of the tool. Optional. Defaults to machine architecture
  7088. */
  7089. function cacheFile(sourceFile, targetFile, tool, version, arch) {
  7090. return __awaiter(this, void 0, void 0, function* () {
  7091. version = semver.clean(version) || version;
  7092. arch = arch || os.arch();
  7093. core.debug(`Caching tool ${tool} ${version} ${arch}`);
  7094. core.debug(`source file: ${sourceFile}`);
  7095. if (!fs.statSync(sourceFile).isFile()) {
  7096. throw new Error('sourceFile is not a file');
  7097. }
  7098. // create the tool dir
  7099. const destFolder = yield _createToolPath(tool, version, arch);
  7100. // copy instead of move. move can fail on Windows due to
  7101. // anti-virus software having an open handle on a file.
  7102. const destPath = path.join(destFolder, targetFile);
  7103. core.debug(`destination file ${destPath}`);
  7104. yield io.cp(sourceFile, destPath);
  7105. // write .complete
  7106. _completeToolPath(tool, version, arch);
  7107. return destFolder;
  7108. });
  7109. }
  7110. exports.cacheFile = cacheFile;
  7111. /**
  7112. * Finds the path to a tool version in the local installed tool cache
  7113. *
  7114. * @param toolName name of the tool
  7115. * @param versionSpec version of the tool
  7116. * @param arch optional arch. defaults to arch of computer
  7117. */
  7118. function find(toolName, versionSpec, arch) {
  7119. if (!toolName) {
  7120. throw new Error('toolName parameter is required');
  7121. }
  7122. if (!versionSpec) {
  7123. throw new Error('versionSpec parameter is required');
  7124. }
  7125. arch = arch || os.arch();
  7126. // attempt to resolve an explicit version
  7127. if (!isExplicitVersion(versionSpec)) {
  7128. const localVersions = findAllVersions(toolName, arch);
  7129. const match = evaluateVersions(localVersions, versionSpec);
  7130. versionSpec = match;
  7131. }
  7132. // check for the explicit version in the cache
  7133. let toolPath = '';
  7134. if (versionSpec) {
  7135. versionSpec = semver.clean(versionSpec) || '';
  7136. const cachePath = path.join(_getCacheDirectory(), toolName, versionSpec, arch);
  7137. core.debug(`checking cache: ${cachePath}`);
  7138. if (fs.existsSync(cachePath) && fs.existsSync(`${cachePath}.complete`)) {
  7139. core.debug(`Found tool in cache ${toolName} ${versionSpec} ${arch}`);
  7140. toolPath = cachePath;
  7141. }
  7142. else {
  7143. core.debug('not found');
  7144. }
  7145. }
  7146. return toolPath;
  7147. }
  7148. exports.find = find;
  7149. /**
  7150. * Finds the paths to all versions of a tool that are installed in the local tool cache
  7151. *
  7152. * @param toolName name of the tool
  7153. * @param arch optional arch. defaults to arch of computer
  7154. */
  7155. function findAllVersions(toolName, arch) {
  7156. const versions = [];
  7157. arch = arch || os.arch();
  7158. const toolPath = path.join(_getCacheDirectory(), toolName);
  7159. if (fs.existsSync(toolPath)) {
  7160. const children = fs.readdirSync(toolPath);
  7161. for (const child of children) {
  7162. if (isExplicitVersion(child)) {
  7163. const fullPath = path.join(toolPath, child, arch || '');
  7164. if (fs.existsSync(fullPath) && fs.existsSync(`${fullPath}.complete`)) {
  7165. versions.push(child);
  7166. }
  7167. }
  7168. }
  7169. }
  7170. return versions;
  7171. }
  7172. exports.findAllVersions = findAllVersions;
  7173. function getManifestFromRepo(owner, repo, auth, branch = 'master') {
  7174. return __awaiter(this, void 0, void 0, function* () {
  7175. let releases = [];
  7176. const treeUrl = `https://api.github.com/repos/${owner}/${repo}/git/trees/${branch}`;
  7177. const http = new httpm.HttpClient('tool-cache');
  7178. const headers = {};
  7179. if (auth) {
  7180. core.debug('set auth');
  7181. headers.authorization = auth;
  7182. }
  7183. const response = yield http.getJson(treeUrl, headers);
  7184. if (!response.result) {
  7185. return releases;
  7186. }
  7187. let manifestUrl = '';
  7188. for (const item of response.result.tree) {
  7189. if (item.path === 'versions-manifest.json') {
  7190. manifestUrl = item.url;
  7191. break;
  7192. }
  7193. }
  7194. headers['accept'] = 'application/vnd.github.VERSION.raw';
  7195. let versionsRaw = yield (yield http.get(manifestUrl, headers)).readBody();
  7196. if (versionsRaw) {
  7197. // shouldn't be needed but protects against invalid json saved with BOM
  7198. versionsRaw = versionsRaw.replace(/^\uFEFF/, '');
  7199. try {
  7200. releases = JSON.parse(versionsRaw);
  7201. }
  7202. catch (_a) {
  7203. core.debug('Invalid json');
  7204. }
  7205. }
  7206. return releases;
  7207. });
  7208. }
  7209. exports.getManifestFromRepo = getManifestFromRepo;
  7210. function findFromManifest(versionSpec, stable, manifest, archFilter = os.arch()) {
  7211. return __awaiter(this, void 0, void 0, function* () {
  7212. // wrap the internal impl
  7213. const match = yield mm._findMatch(versionSpec, stable, manifest, archFilter);
  7214. return match;
  7215. });
  7216. }
  7217. exports.findFromManifest = findFromManifest;
  7218. function _createExtractFolder(dest) {
  7219. return __awaiter(this, void 0, void 0, function* () {
  7220. if (!dest) {
  7221. // create a temp dir
  7222. dest = path.join(_getTempDirectory(), v4_1.default());
  7223. }
  7224. yield io.mkdirP(dest);
  7225. return dest;
  7226. });
  7227. }
  7228. function _createToolPath(tool, version, arch) {
  7229. return __awaiter(this, void 0, void 0, function* () {
  7230. const folderPath = path.join(_getCacheDirectory(), tool, semver.clean(version) || version, arch || '');
  7231. core.debug(`destination ${folderPath}`);
  7232. const markerPath = `${folderPath}.complete`;
  7233. yield io.rmRF(folderPath);
  7234. yield io.rmRF(markerPath);
  7235. yield io.mkdirP(folderPath);
  7236. return folderPath;
  7237. });
  7238. }
  7239. function _completeToolPath(tool, version, arch) {
  7240. const folderPath = path.join(_getCacheDirectory(), tool, semver.clean(version) || version, arch || '');
  7241. const markerPath = `${folderPath}.complete`;
  7242. fs.writeFileSync(markerPath, '');
  7243. core.debug('finished caching tool');
  7244. }
  7245. /**
  7246. * Check if version string is explicit
  7247. *
  7248. * @param versionSpec version string to check
  7249. */
  7250. function isExplicitVersion(versionSpec) {
  7251. const c = semver.clean(versionSpec) || '';
  7252. core.debug(`isExplicit: ${c}`);
  7253. const valid = semver.valid(c) != null;
  7254. core.debug(`explicit? ${valid}`);
  7255. return valid;
  7256. }
  7257. exports.isExplicitVersion = isExplicitVersion;
  7258. /**
  7259. * Get the highest satisfiying semantic version in `versions` which satisfies `versionSpec`
  7260. *
  7261. * @param versions array of versions to evaluate
  7262. * @param versionSpec semantic version spec to satisfy
  7263. */
  7264. function evaluateVersions(versions, versionSpec) {
  7265. let version = '';
  7266. core.debug(`evaluating ${versions.length} versions`);
  7267. versions = versions.sort((a, b) => {
  7268. if (semver.gt(a, b)) {
  7269. return 1;
  7270. }
  7271. return -1;
  7272. });
  7273. for (let i = versions.length - 1; i >= 0; i--) {
  7274. const potential = versions[i];
  7275. const satisfied = semver.satisfies(potential, versionSpec);
  7276. if (satisfied) {
  7277. version = potential;
  7278. break;
  7279. }
  7280. }
  7281. if (version) {
  7282. core.debug(`matched: ${version}`);
  7283. }
  7284. else {
  7285. core.debug('match not found');
  7286. }
  7287. return version;
  7288. }
  7289. exports.evaluateVersions = evaluateVersions;
  7290. /**
  7291. * Gets RUNNER_TOOL_CACHE
  7292. */
  7293. function _getCacheDirectory() {
  7294. const cacheDirectory = process.env['RUNNER_TOOL_CACHE'] || '';
  7295. assert_1.ok(cacheDirectory, 'Expected RUNNER_TOOL_CACHE to be defined');
  7296. return cacheDirectory;
  7297. }
  7298. /**
  7299. * Gets RUNNER_TEMP
  7300. */
  7301. function _getTempDirectory() {
  7302. const tempDirectory = process.env['RUNNER_TEMP'] || '';
  7303. assert_1.ok(tempDirectory, 'Expected RUNNER_TEMP to be defined');
  7304. return tempDirectory;
  7305. }
  7306. /**
  7307. * Gets a global variable
  7308. */
  7309. function _getGlobal(key, defaultValue) {
  7310. /* eslint-disable @typescript-eslint/no-explicit-any */
  7311. const value = global[key];
  7312. /* eslint-enable @typescript-eslint/no-explicit-any */
  7313. return value !== undefined ? value : defaultValue;
  7314. }
  7315. /**
  7316. * Returns an array of unique values.
  7317. * @param values Values to make unique.
  7318. */
  7319. function _unique(values) {
  7320. return Array.from(new Set(values));
  7321. }
  7322. //# sourceMappingURL=tool-cache.js.map
  7323. /***/ }),
  7324. /***/ 7701:
  7325. /***/ ((module) => {
  7326. /**
  7327. * Convert array of 16 byte values to UUID string format of the form:
  7328. * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
  7329. */
  7330. var byteToHex = [];
  7331. for (var i = 0; i < 256; ++i) {
  7332. byteToHex[i] = (i + 0x100).toString(16).substr(1);
  7333. }
  7334. function bytesToUuid(buf, offset) {
  7335. var i = offset || 0;
  7336. var bth = byteToHex;
  7337. // join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4
  7338. return ([
  7339. bth[buf[i++]], bth[buf[i++]],
  7340. bth[buf[i++]], bth[buf[i++]], '-',
  7341. bth[buf[i++]], bth[buf[i++]], '-',
  7342. bth[buf[i++]], bth[buf[i++]], '-',
  7343. bth[buf[i++]], bth[buf[i++]], '-',
  7344. bth[buf[i++]], bth[buf[i++]],
  7345. bth[buf[i++]], bth[buf[i++]],
  7346. bth[buf[i++]], bth[buf[i++]]
  7347. ]).join('');
  7348. }
  7349. module.exports = bytesToUuid;
  7350. /***/ }),
  7351. /***/ 7269:
  7352. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  7353. // Unique ID creation requires a high quality random # generator. In node.js
  7354. // this is pretty straight-forward - we use the crypto API.
  7355. var crypto = __nccwpck_require__(6113);
  7356. module.exports = function nodeRNG() {
  7357. return crypto.randomBytes(16);
  7358. };
  7359. /***/ }),
  7360. /***/ 7468:
  7361. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  7362. var rng = __nccwpck_require__(7269);
  7363. var bytesToUuid = __nccwpck_require__(7701);
  7364. function v4(options, buf, offset) {
  7365. var i = buf && offset || 0;
  7366. if (typeof(options) == 'string') {
  7367. buf = options === 'binary' ? new Array(16) : null;
  7368. options = null;
  7369. }
  7370. options = options || {};
  7371. var rnds = options.random || (options.rng || rng)();
  7372. // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
  7373. rnds[6] = (rnds[6] & 0x0f) | 0x40;
  7374. rnds[8] = (rnds[8] & 0x3f) | 0x80;
  7375. // Copy bytes to buffer, if provided
  7376. if (buf) {
  7377. for (var ii = 0; ii < 16; ++ii) {
  7378. buf[i + ii] = rnds[ii];
  7379. }
  7380. }
  7381. return buf || bytesToUuid(rnds);
  7382. }
  7383. module.exports = v4;
  7384. /***/ }),
  7385. /***/ 334:
  7386. /***/ ((module) => {
  7387. "use strict";
  7388. var __defProp = Object.defineProperty;
  7389. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  7390. var __getOwnPropNames = Object.getOwnPropertyNames;
  7391. var __hasOwnProp = Object.prototype.hasOwnProperty;
  7392. var __export = (target, all) => {
  7393. for (var name in all)
  7394. __defProp(target, name, { get: all[name], enumerable: true });
  7395. };
  7396. var __copyProps = (to, from, except, desc) => {
  7397. if (from && typeof from === "object" || typeof from === "function") {
  7398. for (let key of __getOwnPropNames(from))
  7399. if (!__hasOwnProp.call(to, key) && key !== except)
  7400. __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  7401. }
  7402. return to;
  7403. };
  7404. var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
  7405. // pkg/dist-src/index.js
  7406. var dist_src_exports = {};
  7407. __export(dist_src_exports, {
  7408. createTokenAuth: () => createTokenAuth
  7409. });
  7410. module.exports = __toCommonJS(dist_src_exports);
  7411. // pkg/dist-src/auth.js
  7412. var REGEX_IS_INSTALLATION_LEGACY = /^v1\./;
  7413. var REGEX_IS_INSTALLATION = /^ghs_/;
  7414. var REGEX_IS_USER_TO_SERVER = /^ghu_/;
  7415. async function auth(token) {
  7416. const isApp = token.split(/\./).length === 3;
  7417. const isInstallation = REGEX_IS_INSTALLATION_LEGACY.test(token) || REGEX_IS_INSTALLATION.test(token);
  7418. const isUserToServer = REGEX_IS_USER_TO_SERVER.test(token);
  7419. const tokenType = isApp ? "app" : isInstallation ? "installation" : isUserToServer ? "user-to-server" : "oauth";
  7420. return {
  7421. type: "token",
  7422. token,
  7423. tokenType
  7424. };
  7425. }
  7426. // pkg/dist-src/with-authorization-prefix.js
  7427. function withAuthorizationPrefix(token) {
  7428. if (token.split(/\./).length === 3) {
  7429. return `bearer ${token}`;
  7430. }
  7431. return `token ${token}`;
  7432. }
  7433. // pkg/dist-src/hook.js
  7434. async function hook(token, request, route, parameters) {
  7435. const endpoint = request.endpoint.merge(
  7436. route,
  7437. parameters
  7438. );
  7439. endpoint.headers.authorization = withAuthorizationPrefix(token);
  7440. return request(endpoint);
  7441. }
  7442. // pkg/dist-src/index.js
  7443. var createTokenAuth = function createTokenAuth2(token) {
  7444. if (!token) {
  7445. throw new Error("[@octokit/auth-token] No token passed to createTokenAuth");
  7446. }
  7447. if (typeof token !== "string") {
  7448. throw new Error(
  7449. "[@octokit/auth-token] Token passed to createTokenAuth is not a string"
  7450. );
  7451. }
  7452. token = token.replace(/^(token|bearer) +/i, "");
  7453. return Object.assign(auth.bind(null, token), {
  7454. hook: hook.bind(null, token)
  7455. });
  7456. };
  7457. // Annotate the CommonJS export names for ESM import in node:
  7458. 0 && (0);
  7459. /***/ }),
  7460. /***/ 6762:
  7461. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  7462. "use strict";
  7463. var __defProp = Object.defineProperty;
  7464. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  7465. var __getOwnPropNames = Object.getOwnPropertyNames;
  7466. var __hasOwnProp = Object.prototype.hasOwnProperty;
  7467. var __export = (target, all) => {
  7468. for (var name in all)
  7469. __defProp(target, name, { get: all[name], enumerable: true });
  7470. };
  7471. var __copyProps = (to, from, except, desc) => {
  7472. if (from && typeof from === "object" || typeof from === "function") {
  7473. for (let key of __getOwnPropNames(from))
  7474. if (!__hasOwnProp.call(to, key) && key !== except)
  7475. __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  7476. }
  7477. return to;
  7478. };
  7479. var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
  7480. // pkg/dist-src/index.js
  7481. var dist_src_exports = {};
  7482. __export(dist_src_exports, {
  7483. Octokit: () => Octokit
  7484. });
  7485. module.exports = __toCommonJS(dist_src_exports);
  7486. var import_universal_user_agent = __nccwpck_require__(5030);
  7487. var import_before_after_hook = __nccwpck_require__(3682);
  7488. var import_request = __nccwpck_require__(6234);
  7489. var import_graphql = __nccwpck_require__(8467);
  7490. var import_auth_token = __nccwpck_require__(334);
  7491. // pkg/dist-src/version.js
  7492. var VERSION = "5.2.0";
  7493. // pkg/dist-src/index.js
  7494. var noop = () => {
  7495. };
  7496. var consoleWarn = console.warn.bind(console);
  7497. var consoleError = console.error.bind(console);
  7498. var userAgentTrail = `octokit-core.js/${VERSION} ${(0, import_universal_user_agent.getUserAgent)()}`;
  7499. var Octokit = class {
  7500. static {
  7501. this.VERSION = VERSION;
  7502. }
  7503. static defaults(defaults) {
  7504. const OctokitWithDefaults = class extends this {
  7505. constructor(...args) {
  7506. const options = args[0] || {};
  7507. if (typeof defaults === "function") {
  7508. super(defaults(options));
  7509. return;
  7510. }
  7511. super(
  7512. Object.assign(
  7513. {},
  7514. defaults,
  7515. options,
  7516. options.userAgent && defaults.userAgent ? {
  7517. userAgent: `${options.userAgent} ${defaults.userAgent}`
  7518. } : null
  7519. )
  7520. );
  7521. }
  7522. };
  7523. return OctokitWithDefaults;
  7524. }
  7525. static {
  7526. this.plugins = [];
  7527. }
  7528. /**
  7529. * Attach a plugin (or many) to your Octokit instance.
  7530. *
  7531. * @example
  7532. * const API = Octokit.plugin(plugin1, plugin2, plugin3, ...)
  7533. */
  7534. static plugin(...newPlugins) {
  7535. const currentPlugins = this.plugins;
  7536. const NewOctokit = class extends this {
  7537. static {
  7538. this.plugins = currentPlugins.concat(
  7539. newPlugins.filter((plugin) => !currentPlugins.includes(plugin))
  7540. );
  7541. }
  7542. };
  7543. return NewOctokit;
  7544. }
  7545. constructor(options = {}) {
  7546. const hook = new import_before_after_hook.Collection();
  7547. const requestDefaults = {
  7548. baseUrl: import_request.request.endpoint.DEFAULTS.baseUrl,
  7549. headers: {},
  7550. request: Object.assign({}, options.request, {
  7551. // @ts-ignore internal usage only, no need to type
  7552. hook: hook.bind(null, "request")
  7553. }),
  7554. mediaType: {
  7555. previews: [],
  7556. format: ""
  7557. }
  7558. };
  7559. requestDefaults.headers["user-agent"] = options.userAgent ? `${options.userAgent} ${userAgentTrail}` : userAgentTrail;
  7560. if (options.baseUrl) {
  7561. requestDefaults.baseUrl = options.baseUrl;
  7562. }
  7563. if (options.previews) {
  7564. requestDefaults.mediaType.previews = options.previews;
  7565. }
  7566. if (options.timeZone) {
  7567. requestDefaults.headers["time-zone"] = options.timeZone;
  7568. }
  7569. this.request = import_request.request.defaults(requestDefaults);
  7570. this.graphql = (0, import_graphql.withCustomRequest)(this.request).defaults(requestDefaults);
  7571. this.log = Object.assign(
  7572. {
  7573. debug: noop,
  7574. info: noop,
  7575. warn: consoleWarn,
  7576. error: consoleError
  7577. },
  7578. options.log
  7579. );
  7580. this.hook = hook;
  7581. if (!options.authStrategy) {
  7582. if (!options.auth) {
  7583. this.auth = async () => ({
  7584. type: "unauthenticated"
  7585. });
  7586. } else {
  7587. const auth = (0, import_auth_token.createTokenAuth)(options.auth);
  7588. hook.wrap("request", auth.hook);
  7589. this.auth = auth;
  7590. }
  7591. } else {
  7592. const { authStrategy, ...otherOptions } = options;
  7593. const auth = authStrategy(
  7594. Object.assign(
  7595. {
  7596. request: this.request,
  7597. log: this.log,
  7598. // we pass the current octokit instance as well as its constructor options
  7599. // to allow for authentication strategies that return a new octokit instance
  7600. // that shares the same internal state as the current one. The original
  7601. // requirement for this was the "event-octokit" authentication strategy
  7602. // of https://github.com/probot/octokit-auth-probot.
  7603. octokit: this,
  7604. octokitOptions: otherOptions
  7605. },
  7606. options.auth
  7607. )
  7608. );
  7609. hook.wrap("request", auth.hook);
  7610. this.auth = auth;
  7611. }
  7612. const classConstructor = this.constructor;
  7613. for (let i = 0; i < classConstructor.plugins.length; ++i) {
  7614. Object.assign(this, classConstructor.plugins[i](this, options));
  7615. }
  7616. }
  7617. };
  7618. // Annotate the CommonJS export names for ESM import in node:
  7619. 0 && (0);
  7620. /***/ }),
  7621. /***/ 9440:
  7622. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  7623. "use strict";
  7624. var __defProp = Object.defineProperty;
  7625. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  7626. var __getOwnPropNames = Object.getOwnPropertyNames;
  7627. var __hasOwnProp = Object.prototype.hasOwnProperty;
  7628. var __export = (target, all) => {
  7629. for (var name in all)
  7630. __defProp(target, name, { get: all[name], enumerable: true });
  7631. };
  7632. var __copyProps = (to, from, except, desc) => {
  7633. if (from && typeof from === "object" || typeof from === "function") {
  7634. for (let key of __getOwnPropNames(from))
  7635. if (!__hasOwnProp.call(to, key) && key !== except)
  7636. __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  7637. }
  7638. return to;
  7639. };
  7640. var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
  7641. // pkg/dist-src/index.js
  7642. var dist_src_exports = {};
  7643. __export(dist_src_exports, {
  7644. endpoint: () => endpoint
  7645. });
  7646. module.exports = __toCommonJS(dist_src_exports);
  7647. // pkg/dist-src/defaults.js
  7648. var import_universal_user_agent = __nccwpck_require__(5030);
  7649. // pkg/dist-src/version.js
  7650. var VERSION = "9.0.6";
  7651. // pkg/dist-src/defaults.js
  7652. var userAgent = `octokit-endpoint.js/${VERSION} ${(0, import_universal_user_agent.getUserAgent)()}`;
  7653. var DEFAULTS = {
  7654. method: "GET",
  7655. baseUrl: "https://api.github.com",
  7656. headers: {
  7657. accept: "application/vnd.github.v3+json",
  7658. "user-agent": userAgent
  7659. },
  7660. mediaType: {
  7661. format: ""
  7662. }
  7663. };
  7664. // pkg/dist-src/util/lowercase-keys.js
  7665. function lowercaseKeys(object) {
  7666. if (!object) {
  7667. return {};
  7668. }
  7669. return Object.keys(object).reduce((newObj, key) => {
  7670. newObj[key.toLowerCase()] = object[key];
  7671. return newObj;
  7672. }, {});
  7673. }
  7674. // pkg/dist-src/util/is-plain-object.js
  7675. function isPlainObject(value) {
  7676. if (typeof value !== "object" || value === null)
  7677. return false;
  7678. if (Object.prototype.toString.call(value) !== "[object Object]")
  7679. return false;
  7680. const proto = Object.getPrototypeOf(value);
  7681. if (proto === null)
  7682. return true;
  7683. const Ctor = Object.prototype.hasOwnProperty.call(proto, "constructor") && proto.constructor;
  7684. return typeof Ctor === "function" && Ctor instanceof Ctor && Function.prototype.call(Ctor) === Function.prototype.call(value);
  7685. }
  7686. // pkg/dist-src/util/merge-deep.js
  7687. function mergeDeep(defaults, options) {
  7688. const result = Object.assign({}, defaults);
  7689. Object.keys(options).forEach((key) => {
  7690. if (isPlainObject(options[key])) {
  7691. if (!(key in defaults))
  7692. Object.assign(result, { [key]: options[key] });
  7693. else
  7694. result[key] = mergeDeep(defaults[key], options[key]);
  7695. } else {
  7696. Object.assign(result, { [key]: options[key] });
  7697. }
  7698. });
  7699. return result;
  7700. }
  7701. // pkg/dist-src/util/remove-undefined-properties.js
  7702. function removeUndefinedProperties(obj) {
  7703. for (const key in obj) {
  7704. if (obj[key] === void 0) {
  7705. delete obj[key];
  7706. }
  7707. }
  7708. return obj;
  7709. }
  7710. // pkg/dist-src/merge.js
  7711. function merge(defaults, route, options) {
  7712. if (typeof route === "string") {
  7713. let [method, url] = route.split(" ");
  7714. options = Object.assign(url ? { method, url } : { url: method }, options);
  7715. } else {
  7716. options = Object.assign({}, route);
  7717. }
  7718. options.headers = lowercaseKeys(options.headers);
  7719. removeUndefinedProperties(options);
  7720. removeUndefinedProperties(options.headers);
  7721. const mergedOptions = mergeDeep(defaults || {}, options);
  7722. if (options.url === "/graphql") {
  7723. if (defaults && defaults.mediaType.previews?.length) {
  7724. mergedOptions.mediaType.previews = defaults.mediaType.previews.filter(
  7725. (preview) => !mergedOptions.mediaType.previews.includes(preview)
  7726. ).concat(mergedOptions.mediaType.previews);
  7727. }
  7728. mergedOptions.mediaType.previews = (mergedOptions.mediaType.previews || []).map((preview) => preview.replace(/-preview/, ""));
  7729. }
  7730. return mergedOptions;
  7731. }
  7732. // pkg/dist-src/util/add-query-parameters.js
  7733. function addQueryParameters(url, parameters) {
  7734. const separator = /\?/.test(url) ? "&" : "?";
  7735. const names = Object.keys(parameters);
  7736. if (names.length === 0) {
  7737. return url;
  7738. }
  7739. return url + separator + names.map((name) => {
  7740. if (name === "q") {
  7741. return "q=" + parameters.q.split("+").map(encodeURIComponent).join("+");
  7742. }
  7743. return `${name}=${encodeURIComponent(parameters[name])}`;
  7744. }).join("&");
  7745. }
  7746. // pkg/dist-src/util/extract-url-variable-names.js
  7747. var urlVariableRegex = /\{[^{}}]+\}/g;
  7748. function removeNonChars(variableName) {
  7749. return variableName.replace(/(?:^\W+)|(?:(?<!\W)\W+$)/g, "").split(/,/);
  7750. }
  7751. function extractUrlVariableNames(url) {
  7752. const matches = url.match(urlVariableRegex);
  7753. if (!matches) {
  7754. return [];
  7755. }
  7756. return matches.map(removeNonChars).reduce((a, b) => a.concat(b), []);
  7757. }
  7758. // pkg/dist-src/util/omit.js
  7759. function omit(object, keysToOmit) {
  7760. const result = { __proto__: null };
  7761. for (const key of Object.keys(object)) {
  7762. if (keysToOmit.indexOf(key) === -1) {
  7763. result[key] = object[key];
  7764. }
  7765. }
  7766. return result;
  7767. }
  7768. // pkg/dist-src/util/url-template.js
  7769. function encodeReserved(str) {
  7770. return str.split(/(%[0-9A-Fa-f]{2})/g).map(function(part) {
  7771. if (!/%[0-9A-Fa-f]/.test(part)) {
  7772. part = encodeURI(part).replace(/%5B/g, "[").replace(/%5D/g, "]");
  7773. }
  7774. return part;
  7775. }).join("");
  7776. }
  7777. function encodeUnreserved(str) {
  7778. return encodeURIComponent(str).replace(/[!'()*]/g, function(c) {
  7779. return "%" + c.charCodeAt(0).toString(16).toUpperCase();
  7780. });
  7781. }
  7782. function encodeValue(operator, value, key) {
  7783. value = operator === "+" || operator === "#" ? encodeReserved(value) : encodeUnreserved(value);
  7784. if (key) {
  7785. return encodeUnreserved(key) + "=" + value;
  7786. } else {
  7787. return value;
  7788. }
  7789. }
  7790. function isDefined(value) {
  7791. return value !== void 0 && value !== null;
  7792. }
  7793. function isKeyOperator(operator) {
  7794. return operator === ";" || operator === "&" || operator === "?";
  7795. }
  7796. function getValues(context, operator, key, modifier) {
  7797. var value = context[key], result = [];
  7798. if (isDefined(value) && value !== "") {
  7799. if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
  7800. value = value.toString();
  7801. if (modifier && modifier !== "*") {
  7802. value = value.substring(0, parseInt(modifier, 10));
  7803. }
  7804. result.push(
  7805. encodeValue(operator, value, isKeyOperator(operator) ? key : "")
  7806. );
  7807. } else {
  7808. if (modifier === "*") {
  7809. if (Array.isArray(value)) {
  7810. value.filter(isDefined).forEach(function(value2) {
  7811. result.push(
  7812. encodeValue(operator, value2, isKeyOperator(operator) ? key : "")
  7813. );
  7814. });
  7815. } else {
  7816. Object.keys(value).forEach(function(k) {
  7817. if (isDefined(value[k])) {
  7818. result.push(encodeValue(operator, value[k], k));
  7819. }
  7820. });
  7821. }
  7822. } else {
  7823. const tmp = [];
  7824. if (Array.isArray(value)) {
  7825. value.filter(isDefined).forEach(function(value2) {
  7826. tmp.push(encodeValue(operator, value2));
  7827. });
  7828. } else {
  7829. Object.keys(value).forEach(function(k) {
  7830. if (isDefined(value[k])) {
  7831. tmp.push(encodeUnreserved(k));
  7832. tmp.push(encodeValue(operator, value[k].toString()));
  7833. }
  7834. });
  7835. }
  7836. if (isKeyOperator(operator)) {
  7837. result.push(encodeUnreserved(key) + "=" + tmp.join(","));
  7838. } else if (tmp.length !== 0) {
  7839. result.push(tmp.join(","));
  7840. }
  7841. }
  7842. }
  7843. } else {
  7844. if (operator === ";") {
  7845. if (isDefined(value)) {
  7846. result.push(encodeUnreserved(key));
  7847. }
  7848. } else if (value === "" && (operator === "&" || operator === "?")) {
  7849. result.push(encodeUnreserved(key) + "=");
  7850. } else if (value === "") {
  7851. result.push("");
  7852. }
  7853. }
  7854. return result;
  7855. }
  7856. function parseUrl(template) {
  7857. return {
  7858. expand: expand.bind(null, template)
  7859. };
  7860. }
  7861. function expand(template, context) {
  7862. var operators = ["+", "#", ".", "/", ";", "?", "&"];
  7863. template = template.replace(
  7864. /\{([^\{\}]+)\}|([^\{\}]+)/g,
  7865. function(_, expression, literal) {
  7866. if (expression) {
  7867. let operator = "";
  7868. const values = [];
  7869. if (operators.indexOf(expression.charAt(0)) !== -1) {
  7870. operator = expression.charAt(0);
  7871. expression = expression.substr(1);
  7872. }
  7873. expression.split(/,/g).forEach(function(variable) {
  7874. var tmp = /([^:\*]*)(?::(\d+)|(\*))?/.exec(variable);
  7875. values.push(getValues(context, operator, tmp[1], tmp[2] || tmp[3]));
  7876. });
  7877. if (operator && operator !== "+") {
  7878. var separator = ",";
  7879. if (operator === "?") {
  7880. separator = "&";
  7881. } else if (operator !== "#") {
  7882. separator = operator;
  7883. }
  7884. return (values.length !== 0 ? operator : "") + values.join(separator);
  7885. } else {
  7886. return values.join(",");
  7887. }
  7888. } else {
  7889. return encodeReserved(literal);
  7890. }
  7891. }
  7892. );
  7893. if (template === "/") {
  7894. return template;
  7895. } else {
  7896. return template.replace(/\/$/, "");
  7897. }
  7898. }
  7899. // pkg/dist-src/parse.js
  7900. function parse(options) {
  7901. let method = options.method.toUpperCase();
  7902. let url = (options.url || "/").replace(/:([a-z]\w+)/g, "{$1}");
  7903. let headers = Object.assign({}, options.headers);
  7904. let body;
  7905. let parameters = omit(options, [
  7906. "method",
  7907. "baseUrl",
  7908. "url",
  7909. "headers",
  7910. "request",
  7911. "mediaType"
  7912. ]);
  7913. const urlVariableNames = extractUrlVariableNames(url);
  7914. url = parseUrl(url).expand(parameters);
  7915. if (!/^http/.test(url)) {
  7916. url = options.baseUrl + url;
  7917. }
  7918. const omittedParameters = Object.keys(options).filter((option) => urlVariableNames.includes(option)).concat("baseUrl");
  7919. const remainingParameters = omit(parameters, omittedParameters);
  7920. const isBinaryRequest = /application\/octet-stream/i.test(headers.accept);
  7921. if (!isBinaryRequest) {
  7922. if (options.mediaType.format) {
  7923. headers.accept = headers.accept.split(/,/).map(
  7924. (format) => format.replace(
  7925. /application\/vnd(\.\w+)(\.v3)?(\.\w+)?(\+json)?$/,
  7926. `application/vnd$1$2.${options.mediaType.format}`
  7927. )
  7928. ).join(",");
  7929. }
  7930. if (url.endsWith("/graphql")) {
  7931. if (options.mediaType.previews?.length) {
  7932. const previewsFromAcceptHeader = headers.accept.match(/(?<![\w-])[\w-]+(?=-preview)/g) || [];
  7933. headers.accept = previewsFromAcceptHeader.concat(options.mediaType.previews).map((preview) => {
  7934. const format = options.mediaType.format ? `.${options.mediaType.format}` : "+json";
  7935. return `application/vnd.github.${preview}-preview${format}`;
  7936. }).join(",");
  7937. }
  7938. }
  7939. }
  7940. if (["GET", "HEAD"].includes(method)) {
  7941. url = addQueryParameters(url, remainingParameters);
  7942. } else {
  7943. if ("data" in remainingParameters) {
  7944. body = remainingParameters.data;
  7945. } else {
  7946. if (Object.keys(remainingParameters).length) {
  7947. body = remainingParameters;
  7948. }
  7949. }
  7950. }
  7951. if (!headers["content-type"] && typeof body !== "undefined") {
  7952. headers["content-type"] = "application/json; charset=utf-8";
  7953. }
  7954. if (["PATCH", "PUT"].includes(method) && typeof body === "undefined") {
  7955. body = "";
  7956. }
  7957. return Object.assign(
  7958. { method, url, headers },
  7959. typeof body !== "undefined" ? { body } : null,
  7960. options.request ? { request: options.request } : null
  7961. );
  7962. }
  7963. // pkg/dist-src/endpoint-with-defaults.js
  7964. function endpointWithDefaults(defaults, route, options) {
  7965. return parse(merge(defaults, route, options));
  7966. }
  7967. // pkg/dist-src/with-defaults.js
  7968. function withDefaults(oldDefaults, newDefaults) {
  7969. const DEFAULTS2 = merge(oldDefaults, newDefaults);
  7970. const endpoint2 = endpointWithDefaults.bind(null, DEFAULTS2);
  7971. return Object.assign(endpoint2, {
  7972. DEFAULTS: DEFAULTS2,
  7973. defaults: withDefaults.bind(null, DEFAULTS2),
  7974. merge: merge.bind(null, DEFAULTS2),
  7975. parse
  7976. });
  7977. }
  7978. // pkg/dist-src/index.js
  7979. var endpoint = withDefaults(null, DEFAULTS);
  7980. // Annotate the CommonJS export names for ESM import in node:
  7981. 0 && (0);
  7982. /***/ }),
  7983. /***/ 8467:
  7984. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  7985. "use strict";
  7986. var __defProp = Object.defineProperty;
  7987. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  7988. var __getOwnPropNames = Object.getOwnPropertyNames;
  7989. var __hasOwnProp = Object.prototype.hasOwnProperty;
  7990. var __export = (target, all) => {
  7991. for (var name in all)
  7992. __defProp(target, name, { get: all[name], enumerable: true });
  7993. };
  7994. var __copyProps = (to, from, except, desc) => {
  7995. if (from && typeof from === "object" || typeof from === "function") {
  7996. for (let key of __getOwnPropNames(from))
  7997. if (!__hasOwnProp.call(to, key) && key !== except)
  7998. __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  7999. }
  8000. return to;
  8001. };
  8002. var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
  8003. // pkg/dist-src/index.js
  8004. var dist_src_exports = {};
  8005. __export(dist_src_exports, {
  8006. GraphqlResponseError: () => GraphqlResponseError,
  8007. graphql: () => graphql2,
  8008. withCustomRequest: () => withCustomRequest
  8009. });
  8010. module.exports = __toCommonJS(dist_src_exports);
  8011. var import_request3 = __nccwpck_require__(6234);
  8012. var import_universal_user_agent = __nccwpck_require__(5030);
  8013. // pkg/dist-src/version.js
  8014. var VERSION = "7.1.0";
  8015. // pkg/dist-src/with-defaults.js
  8016. var import_request2 = __nccwpck_require__(6234);
  8017. // pkg/dist-src/graphql.js
  8018. var import_request = __nccwpck_require__(6234);
  8019. // pkg/dist-src/error.js
  8020. function _buildMessageForResponseErrors(data) {
  8021. return `Request failed due to following response errors:
  8022. ` + data.errors.map((e) => ` - ${e.message}`).join("\n");
  8023. }
  8024. var GraphqlResponseError = class extends Error {
  8025. constructor(request2, headers, response) {
  8026. super(_buildMessageForResponseErrors(response));
  8027. this.request = request2;
  8028. this.headers = headers;
  8029. this.response = response;
  8030. this.name = "GraphqlResponseError";
  8031. this.errors = response.errors;
  8032. this.data = response.data;
  8033. if (Error.captureStackTrace) {
  8034. Error.captureStackTrace(this, this.constructor);
  8035. }
  8036. }
  8037. };
  8038. // pkg/dist-src/graphql.js
  8039. var NON_VARIABLE_OPTIONS = [
  8040. "method",
  8041. "baseUrl",
  8042. "url",
  8043. "headers",
  8044. "request",
  8045. "query",
  8046. "mediaType"
  8047. ];
  8048. var FORBIDDEN_VARIABLE_OPTIONS = ["query", "method", "url"];
  8049. var GHES_V3_SUFFIX_REGEX = /\/api\/v3\/?$/;
  8050. function graphql(request2, query, options) {
  8051. if (options) {
  8052. if (typeof query === "string" && "query" in options) {
  8053. return Promise.reject(
  8054. new Error(`[@octokit/graphql] "query" cannot be used as variable name`)
  8055. );
  8056. }
  8057. for (const key in options) {
  8058. if (!FORBIDDEN_VARIABLE_OPTIONS.includes(key))
  8059. continue;
  8060. return Promise.reject(
  8061. new Error(
  8062. `[@octokit/graphql] "${key}" cannot be used as variable name`
  8063. )
  8064. );
  8065. }
  8066. }
  8067. const parsedOptions = typeof query === "string" ? Object.assign({ query }, options) : query;
  8068. const requestOptions = Object.keys(
  8069. parsedOptions
  8070. ).reduce((result, key) => {
  8071. if (NON_VARIABLE_OPTIONS.includes(key)) {
  8072. result[key] = parsedOptions[key];
  8073. return result;
  8074. }
  8075. if (!result.variables) {
  8076. result.variables = {};
  8077. }
  8078. result.variables[key] = parsedOptions[key];
  8079. return result;
  8080. }, {});
  8081. const baseUrl = parsedOptions.baseUrl || request2.endpoint.DEFAULTS.baseUrl;
  8082. if (GHES_V3_SUFFIX_REGEX.test(baseUrl)) {
  8083. requestOptions.url = baseUrl.replace(GHES_V3_SUFFIX_REGEX, "/api/graphql");
  8084. }
  8085. return request2(requestOptions).then((response) => {
  8086. if (response.data.errors) {
  8087. const headers = {};
  8088. for (const key of Object.keys(response.headers)) {
  8089. headers[key] = response.headers[key];
  8090. }
  8091. throw new GraphqlResponseError(
  8092. requestOptions,
  8093. headers,
  8094. response.data
  8095. );
  8096. }
  8097. return response.data.data;
  8098. });
  8099. }
  8100. // pkg/dist-src/with-defaults.js
  8101. function withDefaults(request2, newDefaults) {
  8102. const newRequest = request2.defaults(newDefaults);
  8103. const newApi = (query, options) => {
  8104. return graphql(newRequest, query, options);
  8105. };
  8106. return Object.assign(newApi, {
  8107. defaults: withDefaults.bind(null, newRequest),
  8108. endpoint: newRequest.endpoint
  8109. });
  8110. }
  8111. // pkg/dist-src/index.js
  8112. var graphql2 = withDefaults(import_request3.request, {
  8113. headers: {
  8114. "user-agent": `octokit-graphql.js/${VERSION} ${(0, import_universal_user_agent.getUserAgent)()}`
  8115. },
  8116. method: "POST",
  8117. url: "/graphql"
  8118. });
  8119. function withCustomRequest(customRequest) {
  8120. return withDefaults(customRequest, {
  8121. method: "POST",
  8122. url: "/graphql"
  8123. });
  8124. }
  8125. // Annotate the CommonJS export names for ESM import in node:
  8126. 0 && (0);
  8127. /***/ }),
  8128. /***/ 4193:
  8129. /***/ ((module) => {
  8130. "use strict";
  8131. var __defProp = Object.defineProperty;
  8132. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  8133. var __getOwnPropNames = Object.getOwnPropertyNames;
  8134. var __hasOwnProp = Object.prototype.hasOwnProperty;
  8135. var __export = (target, all) => {
  8136. for (var name in all)
  8137. __defProp(target, name, { get: all[name], enumerable: true });
  8138. };
  8139. var __copyProps = (to, from, except, desc) => {
  8140. if (from && typeof from === "object" || typeof from === "function") {
  8141. for (let key of __getOwnPropNames(from))
  8142. if (!__hasOwnProp.call(to, key) && key !== except)
  8143. __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  8144. }
  8145. return to;
  8146. };
  8147. var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
  8148. // pkg/dist-src/index.js
  8149. var dist_src_exports = {};
  8150. __export(dist_src_exports, {
  8151. composePaginateRest: () => composePaginateRest,
  8152. isPaginatingEndpoint: () => isPaginatingEndpoint,
  8153. paginateRest: () => paginateRest,
  8154. paginatingEndpoints: () => paginatingEndpoints
  8155. });
  8156. module.exports = __toCommonJS(dist_src_exports);
  8157. // pkg/dist-src/version.js
  8158. var VERSION = "9.2.2";
  8159. // pkg/dist-src/normalize-paginated-list-response.js
  8160. function normalizePaginatedListResponse(response) {
  8161. if (!response.data) {
  8162. return {
  8163. ...response,
  8164. data: []
  8165. };
  8166. }
  8167. const responseNeedsNormalization = "total_count" in response.data && !("url" in response.data);
  8168. if (!responseNeedsNormalization)
  8169. return response;
  8170. const incompleteResults = response.data.incomplete_results;
  8171. const repositorySelection = response.data.repository_selection;
  8172. const totalCount = response.data.total_count;
  8173. delete response.data.incomplete_results;
  8174. delete response.data.repository_selection;
  8175. delete response.data.total_count;
  8176. const namespaceKey = Object.keys(response.data)[0];
  8177. const data = response.data[namespaceKey];
  8178. response.data = data;
  8179. if (typeof incompleteResults !== "undefined") {
  8180. response.data.incomplete_results = incompleteResults;
  8181. }
  8182. if (typeof repositorySelection !== "undefined") {
  8183. response.data.repository_selection = repositorySelection;
  8184. }
  8185. response.data.total_count = totalCount;
  8186. return response;
  8187. }
  8188. // pkg/dist-src/iterator.js
  8189. function iterator(octokit, route, parameters) {
  8190. const options = typeof route === "function" ? route.endpoint(parameters) : octokit.request.endpoint(route, parameters);
  8191. const requestMethod = typeof route === "function" ? route : octokit.request;
  8192. const method = options.method;
  8193. const headers = options.headers;
  8194. let url = options.url;
  8195. return {
  8196. [Symbol.asyncIterator]: () => ({
  8197. async next() {
  8198. if (!url)
  8199. return { done: true };
  8200. try {
  8201. const response = await requestMethod({ method, url, headers });
  8202. const normalizedResponse = normalizePaginatedListResponse(response);
  8203. url = ((normalizedResponse.headers.link || "").match(
  8204. /<([^<>]+)>;\s*rel="next"/
  8205. ) || [])[1];
  8206. return { value: normalizedResponse };
  8207. } catch (error) {
  8208. if (error.status !== 409)
  8209. throw error;
  8210. url = "";
  8211. return {
  8212. value: {
  8213. status: 200,
  8214. headers: {},
  8215. data: []
  8216. }
  8217. };
  8218. }
  8219. }
  8220. })
  8221. };
  8222. }
  8223. // pkg/dist-src/paginate.js
  8224. function paginate(octokit, route, parameters, mapFn) {
  8225. if (typeof parameters === "function") {
  8226. mapFn = parameters;
  8227. parameters = void 0;
  8228. }
  8229. return gather(
  8230. octokit,
  8231. [],
  8232. iterator(octokit, route, parameters)[Symbol.asyncIterator](),
  8233. mapFn
  8234. );
  8235. }
  8236. function gather(octokit, results, iterator2, mapFn) {
  8237. return iterator2.next().then((result) => {
  8238. if (result.done) {
  8239. return results;
  8240. }
  8241. let earlyExit = false;
  8242. function done() {
  8243. earlyExit = true;
  8244. }
  8245. results = results.concat(
  8246. mapFn ? mapFn(result.value, done) : result.value.data
  8247. );
  8248. if (earlyExit) {
  8249. return results;
  8250. }
  8251. return gather(octokit, results, iterator2, mapFn);
  8252. });
  8253. }
  8254. // pkg/dist-src/compose-paginate.js
  8255. var composePaginateRest = Object.assign(paginate, {
  8256. iterator
  8257. });
  8258. // pkg/dist-src/generated/paginating-endpoints.js
  8259. var paginatingEndpoints = [
  8260. "GET /advisories",
  8261. "GET /app/hook/deliveries",
  8262. "GET /app/installation-requests",
  8263. "GET /app/installations",
  8264. "GET /assignments/{assignment_id}/accepted_assignments",
  8265. "GET /classrooms",
  8266. "GET /classrooms/{classroom_id}/assignments",
  8267. "GET /enterprises/{enterprise}/dependabot/alerts",
  8268. "GET /enterprises/{enterprise}/secret-scanning/alerts",
  8269. "GET /events",
  8270. "GET /gists",
  8271. "GET /gists/public",
  8272. "GET /gists/starred",
  8273. "GET /gists/{gist_id}/comments",
  8274. "GET /gists/{gist_id}/commits",
  8275. "GET /gists/{gist_id}/forks",
  8276. "GET /installation/repositories",
  8277. "GET /issues",
  8278. "GET /licenses",
  8279. "GET /marketplace_listing/plans",
  8280. "GET /marketplace_listing/plans/{plan_id}/accounts",
  8281. "GET /marketplace_listing/stubbed/plans",
  8282. "GET /marketplace_listing/stubbed/plans/{plan_id}/accounts",
  8283. "GET /networks/{owner}/{repo}/events",
  8284. "GET /notifications",
  8285. "GET /organizations",
  8286. "GET /orgs/{org}/actions/cache/usage-by-repository",
  8287. "GET /orgs/{org}/actions/permissions/repositories",
  8288. "GET /orgs/{org}/actions/runners",
  8289. "GET /orgs/{org}/actions/secrets",
  8290. "GET /orgs/{org}/actions/secrets/{secret_name}/repositories",
  8291. "GET /orgs/{org}/actions/variables",
  8292. "GET /orgs/{org}/actions/variables/{name}/repositories",
  8293. "GET /orgs/{org}/blocks",
  8294. "GET /orgs/{org}/code-scanning/alerts",
  8295. "GET /orgs/{org}/codespaces",
  8296. "GET /orgs/{org}/codespaces/secrets",
  8297. "GET /orgs/{org}/codespaces/secrets/{secret_name}/repositories",
  8298. "GET /orgs/{org}/copilot/billing/seats",
  8299. "GET /orgs/{org}/dependabot/alerts",
  8300. "GET /orgs/{org}/dependabot/secrets",
  8301. "GET /orgs/{org}/dependabot/secrets/{secret_name}/repositories",
  8302. "GET /orgs/{org}/events",
  8303. "GET /orgs/{org}/failed_invitations",
  8304. "GET /orgs/{org}/hooks",
  8305. "GET /orgs/{org}/hooks/{hook_id}/deliveries",
  8306. "GET /orgs/{org}/installations",
  8307. "GET /orgs/{org}/invitations",
  8308. "GET /orgs/{org}/invitations/{invitation_id}/teams",
  8309. "GET /orgs/{org}/issues",
  8310. "GET /orgs/{org}/members",
  8311. "GET /orgs/{org}/members/{username}/codespaces",
  8312. "GET /orgs/{org}/migrations",
  8313. "GET /orgs/{org}/migrations/{migration_id}/repositories",
  8314. "GET /orgs/{org}/organization-roles/{role_id}/teams",
  8315. "GET /orgs/{org}/organization-roles/{role_id}/users",
  8316. "GET /orgs/{org}/outside_collaborators",
  8317. "GET /orgs/{org}/packages",
  8318. "GET /orgs/{org}/packages/{package_type}/{package_name}/versions",
  8319. "GET /orgs/{org}/personal-access-token-requests",
  8320. "GET /orgs/{org}/personal-access-token-requests/{pat_request_id}/repositories",
  8321. "GET /orgs/{org}/personal-access-tokens",
  8322. "GET /orgs/{org}/personal-access-tokens/{pat_id}/repositories",
  8323. "GET /orgs/{org}/projects",
  8324. "GET /orgs/{org}/properties/values",
  8325. "GET /orgs/{org}/public_members",
  8326. "GET /orgs/{org}/repos",
  8327. "GET /orgs/{org}/rulesets",
  8328. "GET /orgs/{org}/rulesets/rule-suites",
  8329. "GET /orgs/{org}/secret-scanning/alerts",
  8330. "GET /orgs/{org}/security-advisories",
  8331. "GET /orgs/{org}/teams",
  8332. "GET /orgs/{org}/teams/{team_slug}/discussions",
  8333. "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments",
  8334. "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions",
  8335. "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions",
  8336. "GET /orgs/{org}/teams/{team_slug}/invitations",
  8337. "GET /orgs/{org}/teams/{team_slug}/members",
  8338. "GET /orgs/{org}/teams/{team_slug}/projects",
  8339. "GET /orgs/{org}/teams/{team_slug}/repos",
  8340. "GET /orgs/{org}/teams/{team_slug}/teams",
  8341. "GET /projects/columns/{column_id}/cards",
  8342. "GET /projects/{project_id}/collaborators",
  8343. "GET /projects/{project_id}/columns",
  8344. "GET /repos/{owner}/{repo}/actions/artifacts",
  8345. "GET /repos/{owner}/{repo}/actions/caches",
  8346. "GET /repos/{owner}/{repo}/actions/organization-secrets",
  8347. "GET /repos/{owner}/{repo}/actions/organization-variables",
  8348. "GET /repos/{owner}/{repo}/actions/runners",
  8349. "GET /repos/{owner}/{repo}/actions/runs",
  8350. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts",
  8351. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/jobs",
  8352. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs",
  8353. "GET /repos/{owner}/{repo}/actions/secrets",
  8354. "GET /repos/{owner}/{repo}/actions/variables",
  8355. "GET /repos/{owner}/{repo}/actions/workflows",
  8356. "GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs",
  8357. "GET /repos/{owner}/{repo}/activity",
  8358. "GET /repos/{owner}/{repo}/assignees",
  8359. "GET /repos/{owner}/{repo}/branches",
  8360. "GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations",
  8361. "GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs",
  8362. "GET /repos/{owner}/{repo}/code-scanning/alerts",
  8363. "GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances",
  8364. "GET /repos/{owner}/{repo}/code-scanning/analyses",
  8365. "GET /repos/{owner}/{repo}/codespaces",
  8366. "GET /repos/{owner}/{repo}/codespaces/devcontainers",
  8367. "GET /repos/{owner}/{repo}/codespaces/secrets",
  8368. "GET /repos/{owner}/{repo}/collaborators",
  8369. "GET /repos/{owner}/{repo}/comments",
  8370. "GET /repos/{owner}/{repo}/comments/{comment_id}/reactions",
  8371. "GET /repos/{owner}/{repo}/commits",
  8372. "GET /repos/{owner}/{repo}/commits/{commit_sha}/comments",
  8373. "GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls",
  8374. "GET /repos/{owner}/{repo}/commits/{ref}/check-runs",
  8375. "GET /repos/{owner}/{repo}/commits/{ref}/check-suites",
  8376. "GET /repos/{owner}/{repo}/commits/{ref}/status",
  8377. "GET /repos/{owner}/{repo}/commits/{ref}/statuses",
  8378. "GET /repos/{owner}/{repo}/contributors",
  8379. "GET /repos/{owner}/{repo}/dependabot/alerts",
  8380. "GET /repos/{owner}/{repo}/dependabot/secrets",
  8381. "GET /repos/{owner}/{repo}/deployments",
  8382. "GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses",
  8383. "GET /repos/{owner}/{repo}/environments",
  8384. "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies",
  8385. "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/apps",
  8386. "GET /repos/{owner}/{repo}/events",
  8387. "GET /repos/{owner}/{repo}/forks",
  8388. "GET /repos/{owner}/{repo}/hooks",
  8389. "GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries",
  8390. "GET /repos/{owner}/{repo}/invitations",
  8391. "GET /repos/{owner}/{repo}/issues",
  8392. "GET /repos/{owner}/{repo}/issues/comments",
  8393. "GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions",
  8394. "GET /repos/{owner}/{repo}/issues/events",
  8395. "GET /repos/{owner}/{repo}/issues/{issue_number}/comments",
  8396. "GET /repos/{owner}/{repo}/issues/{issue_number}/events",
  8397. "GET /repos/{owner}/{repo}/issues/{issue_number}/labels",
  8398. "GET /repos/{owner}/{repo}/issues/{issue_number}/reactions",
  8399. "GET /repos/{owner}/{repo}/issues/{issue_number}/timeline",
  8400. "GET /repos/{owner}/{repo}/keys",
  8401. "GET /repos/{owner}/{repo}/labels",
  8402. "GET /repos/{owner}/{repo}/milestones",
  8403. "GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels",
  8404. "GET /repos/{owner}/{repo}/notifications",
  8405. "GET /repos/{owner}/{repo}/pages/builds",
  8406. "GET /repos/{owner}/{repo}/projects",
  8407. "GET /repos/{owner}/{repo}/pulls",
  8408. "GET /repos/{owner}/{repo}/pulls/comments",
  8409. "GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions",
  8410. "GET /repos/{owner}/{repo}/pulls/{pull_number}/comments",
  8411. "GET /repos/{owner}/{repo}/pulls/{pull_number}/commits",
  8412. "GET /repos/{owner}/{repo}/pulls/{pull_number}/files",
  8413. "GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews",
  8414. "GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments",
  8415. "GET /repos/{owner}/{repo}/releases",
  8416. "GET /repos/{owner}/{repo}/releases/{release_id}/assets",
  8417. "GET /repos/{owner}/{repo}/releases/{release_id}/reactions",
  8418. "GET /repos/{owner}/{repo}/rules/branches/{branch}",
  8419. "GET /repos/{owner}/{repo}/rulesets",
  8420. "GET /repos/{owner}/{repo}/rulesets/rule-suites",
  8421. "GET /repos/{owner}/{repo}/secret-scanning/alerts",
  8422. "GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations",
  8423. "GET /repos/{owner}/{repo}/security-advisories",
  8424. "GET /repos/{owner}/{repo}/stargazers",
  8425. "GET /repos/{owner}/{repo}/subscribers",
  8426. "GET /repos/{owner}/{repo}/tags",
  8427. "GET /repos/{owner}/{repo}/teams",
  8428. "GET /repos/{owner}/{repo}/topics",
  8429. "GET /repositories",
  8430. "GET /repositories/{repository_id}/environments/{environment_name}/secrets",
  8431. "GET /repositories/{repository_id}/environments/{environment_name}/variables",
  8432. "GET /search/code",
  8433. "GET /search/commits",
  8434. "GET /search/issues",
  8435. "GET /search/labels",
  8436. "GET /search/repositories",
  8437. "GET /search/topics",
  8438. "GET /search/users",
  8439. "GET /teams/{team_id}/discussions",
  8440. "GET /teams/{team_id}/discussions/{discussion_number}/comments",
  8441. "GET /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions",
  8442. "GET /teams/{team_id}/discussions/{discussion_number}/reactions",
  8443. "GET /teams/{team_id}/invitations",
  8444. "GET /teams/{team_id}/members",
  8445. "GET /teams/{team_id}/projects",
  8446. "GET /teams/{team_id}/repos",
  8447. "GET /teams/{team_id}/teams",
  8448. "GET /user/blocks",
  8449. "GET /user/codespaces",
  8450. "GET /user/codespaces/secrets",
  8451. "GET /user/emails",
  8452. "GET /user/followers",
  8453. "GET /user/following",
  8454. "GET /user/gpg_keys",
  8455. "GET /user/installations",
  8456. "GET /user/installations/{installation_id}/repositories",
  8457. "GET /user/issues",
  8458. "GET /user/keys",
  8459. "GET /user/marketplace_purchases",
  8460. "GET /user/marketplace_purchases/stubbed",
  8461. "GET /user/memberships/orgs",
  8462. "GET /user/migrations",
  8463. "GET /user/migrations/{migration_id}/repositories",
  8464. "GET /user/orgs",
  8465. "GET /user/packages",
  8466. "GET /user/packages/{package_type}/{package_name}/versions",
  8467. "GET /user/public_emails",
  8468. "GET /user/repos",
  8469. "GET /user/repository_invitations",
  8470. "GET /user/social_accounts",
  8471. "GET /user/ssh_signing_keys",
  8472. "GET /user/starred",
  8473. "GET /user/subscriptions",
  8474. "GET /user/teams",
  8475. "GET /users",
  8476. "GET /users/{username}/events",
  8477. "GET /users/{username}/events/orgs/{org}",
  8478. "GET /users/{username}/events/public",
  8479. "GET /users/{username}/followers",
  8480. "GET /users/{username}/following",
  8481. "GET /users/{username}/gists",
  8482. "GET /users/{username}/gpg_keys",
  8483. "GET /users/{username}/keys",
  8484. "GET /users/{username}/orgs",
  8485. "GET /users/{username}/packages",
  8486. "GET /users/{username}/projects",
  8487. "GET /users/{username}/received_events",
  8488. "GET /users/{username}/received_events/public",
  8489. "GET /users/{username}/repos",
  8490. "GET /users/{username}/social_accounts",
  8491. "GET /users/{username}/ssh_signing_keys",
  8492. "GET /users/{username}/starred",
  8493. "GET /users/{username}/subscriptions"
  8494. ];
  8495. // pkg/dist-src/paginating-endpoints.js
  8496. function isPaginatingEndpoint(arg) {
  8497. if (typeof arg === "string") {
  8498. return paginatingEndpoints.includes(arg);
  8499. } else {
  8500. return false;
  8501. }
  8502. }
  8503. // pkg/dist-src/index.js
  8504. function paginateRest(octokit) {
  8505. return {
  8506. paginate: Object.assign(paginate.bind(null, octokit), {
  8507. iterator: iterator.bind(null, octokit)
  8508. })
  8509. };
  8510. }
  8511. paginateRest.VERSION = VERSION;
  8512. // Annotate the CommonJS export names for ESM import in node:
  8513. 0 && (0);
  8514. /***/ }),
  8515. /***/ 3044:
  8516. /***/ ((module) => {
  8517. "use strict";
  8518. var __defProp = Object.defineProperty;
  8519. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  8520. var __getOwnPropNames = Object.getOwnPropertyNames;
  8521. var __hasOwnProp = Object.prototype.hasOwnProperty;
  8522. var __export = (target, all) => {
  8523. for (var name in all)
  8524. __defProp(target, name, { get: all[name], enumerable: true });
  8525. };
  8526. var __copyProps = (to, from, except, desc) => {
  8527. if (from && typeof from === "object" || typeof from === "function") {
  8528. for (let key of __getOwnPropNames(from))
  8529. if (!__hasOwnProp.call(to, key) && key !== except)
  8530. __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  8531. }
  8532. return to;
  8533. };
  8534. var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
  8535. // pkg/dist-src/index.js
  8536. var dist_src_exports = {};
  8537. __export(dist_src_exports, {
  8538. legacyRestEndpointMethods: () => legacyRestEndpointMethods,
  8539. restEndpointMethods: () => restEndpointMethods
  8540. });
  8541. module.exports = __toCommonJS(dist_src_exports);
  8542. // pkg/dist-src/version.js
  8543. var VERSION = "10.4.1";
  8544. // pkg/dist-src/generated/endpoints.js
  8545. var Endpoints = {
  8546. actions: {
  8547. addCustomLabelsToSelfHostedRunnerForOrg: [
  8548. "POST /orgs/{org}/actions/runners/{runner_id}/labels"
  8549. ],
  8550. addCustomLabelsToSelfHostedRunnerForRepo: [
  8551. "POST /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"
  8552. ],
  8553. addSelectedRepoToOrgSecret: [
  8554. "PUT /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}"
  8555. ],
  8556. addSelectedRepoToOrgVariable: [
  8557. "PUT /orgs/{org}/actions/variables/{name}/repositories/{repository_id}"
  8558. ],
  8559. approveWorkflowRun: [
  8560. "POST /repos/{owner}/{repo}/actions/runs/{run_id}/approve"
  8561. ],
  8562. cancelWorkflowRun: [
  8563. "POST /repos/{owner}/{repo}/actions/runs/{run_id}/cancel"
  8564. ],
  8565. createEnvironmentVariable: [
  8566. "POST /repositories/{repository_id}/environments/{environment_name}/variables"
  8567. ],
  8568. createOrUpdateEnvironmentSecret: [
  8569. "PUT /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}"
  8570. ],
  8571. createOrUpdateOrgSecret: ["PUT /orgs/{org}/actions/secrets/{secret_name}"],
  8572. createOrUpdateRepoSecret: [
  8573. "PUT /repos/{owner}/{repo}/actions/secrets/{secret_name}"
  8574. ],
  8575. createOrgVariable: ["POST /orgs/{org}/actions/variables"],
  8576. createRegistrationTokenForOrg: [
  8577. "POST /orgs/{org}/actions/runners/registration-token"
  8578. ],
  8579. createRegistrationTokenForRepo: [
  8580. "POST /repos/{owner}/{repo}/actions/runners/registration-token"
  8581. ],
  8582. createRemoveTokenForOrg: ["POST /orgs/{org}/actions/runners/remove-token"],
  8583. createRemoveTokenForRepo: [
  8584. "POST /repos/{owner}/{repo}/actions/runners/remove-token"
  8585. ],
  8586. createRepoVariable: ["POST /repos/{owner}/{repo}/actions/variables"],
  8587. createWorkflowDispatch: [
  8588. "POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches"
  8589. ],
  8590. deleteActionsCacheById: [
  8591. "DELETE /repos/{owner}/{repo}/actions/caches/{cache_id}"
  8592. ],
  8593. deleteActionsCacheByKey: [
  8594. "DELETE /repos/{owner}/{repo}/actions/caches{?key,ref}"
  8595. ],
  8596. deleteArtifact: [
  8597. "DELETE /repos/{owner}/{repo}/actions/artifacts/{artifact_id}"
  8598. ],
  8599. deleteEnvironmentSecret: [
  8600. "DELETE /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}"
  8601. ],
  8602. deleteEnvironmentVariable: [
  8603. "DELETE /repositories/{repository_id}/environments/{environment_name}/variables/{name}"
  8604. ],
  8605. deleteOrgSecret: ["DELETE /orgs/{org}/actions/secrets/{secret_name}"],
  8606. deleteOrgVariable: ["DELETE /orgs/{org}/actions/variables/{name}"],
  8607. deleteRepoSecret: [
  8608. "DELETE /repos/{owner}/{repo}/actions/secrets/{secret_name}"
  8609. ],
  8610. deleteRepoVariable: [
  8611. "DELETE /repos/{owner}/{repo}/actions/variables/{name}"
  8612. ],
  8613. deleteSelfHostedRunnerFromOrg: [
  8614. "DELETE /orgs/{org}/actions/runners/{runner_id}"
  8615. ],
  8616. deleteSelfHostedRunnerFromRepo: [
  8617. "DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}"
  8618. ],
  8619. deleteWorkflowRun: ["DELETE /repos/{owner}/{repo}/actions/runs/{run_id}"],
  8620. deleteWorkflowRunLogs: [
  8621. "DELETE /repos/{owner}/{repo}/actions/runs/{run_id}/logs"
  8622. ],
  8623. disableSelectedRepositoryGithubActionsOrganization: [
  8624. "DELETE /orgs/{org}/actions/permissions/repositories/{repository_id}"
  8625. ],
  8626. disableWorkflow: [
  8627. "PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/disable"
  8628. ],
  8629. downloadArtifact: [
  8630. "GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}"
  8631. ],
  8632. downloadJobLogsForWorkflowRun: [
  8633. "GET /repos/{owner}/{repo}/actions/jobs/{job_id}/logs"
  8634. ],
  8635. downloadWorkflowRunAttemptLogs: [
  8636. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/logs"
  8637. ],
  8638. downloadWorkflowRunLogs: [
  8639. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/logs"
  8640. ],
  8641. enableSelectedRepositoryGithubActionsOrganization: [
  8642. "PUT /orgs/{org}/actions/permissions/repositories/{repository_id}"
  8643. ],
  8644. enableWorkflow: [
  8645. "PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/enable"
  8646. ],
  8647. forceCancelWorkflowRun: [
  8648. "POST /repos/{owner}/{repo}/actions/runs/{run_id}/force-cancel"
  8649. ],
  8650. generateRunnerJitconfigForOrg: [
  8651. "POST /orgs/{org}/actions/runners/generate-jitconfig"
  8652. ],
  8653. generateRunnerJitconfigForRepo: [
  8654. "POST /repos/{owner}/{repo}/actions/runners/generate-jitconfig"
  8655. ],
  8656. getActionsCacheList: ["GET /repos/{owner}/{repo}/actions/caches"],
  8657. getActionsCacheUsage: ["GET /repos/{owner}/{repo}/actions/cache/usage"],
  8658. getActionsCacheUsageByRepoForOrg: [
  8659. "GET /orgs/{org}/actions/cache/usage-by-repository"
  8660. ],
  8661. getActionsCacheUsageForOrg: ["GET /orgs/{org}/actions/cache/usage"],
  8662. getAllowedActionsOrganization: [
  8663. "GET /orgs/{org}/actions/permissions/selected-actions"
  8664. ],
  8665. getAllowedActionsRepository: [
  8666. "GET /repos/{owner}/{repo}/actions/permissions/selected-actions"
  8667. ],
  8668. getArtifact: ["GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}"],
  8669. getCustomOidcSubClaimForRepo: [
  8670. "GET /repos/{owner}/{repo}/actions/oidc/customization/sub"
  8671. ],
  8672. getEnvironmentPublicKey: [
  8673. "GET /repositories/{repository_id}/environments/{environment_name}/secrets/public-key"
  8674. ],
  8675. getEnvironmentSecret: [
  8676. "GET /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}"
  8677. ],
  8678. getEnvironmentVariable: [
  8679. "GET /repositories/{repository_id}/environments/{environment_name}/variables/{name}"
  8680. ],
  8681. getGithubActionsDefaultWorkflowPermissionsOrganization: [
  8682. "GET /orgs/{org}/actions/permissions/workflow"
  8683. ],
  8684. getGithubActionsDefaultWorkflowPermissionsRepository: [
  8685. "GET /repos/{owner}/{repo}/actions/permissions/workflow"
  8686. ],
  8687. getGithubActionsPermissionsOrganization: [
  8688. "GET /orgs/{org}/actions/permissions"
  8689. ],
  8690. getGithubActionsPermissionsRepository: [
  8691. "GET /repos/{owner}/{repo}/actions/permissions"
  8692. ],
  8693. getJobForWorkflowRun: ["GET /repos/{owner}/{repo}/actions/jobs/{job_id}"],
  8694. getOrgPublicKey: ["GET /orgs/{org}/actions/secrets/public-key"],
  8695. getOrgSecret: ["GET /orgs/{org}/actions/secrets/{secret_name}"],
  8696. getOrgVariable: ["GET /orgs/{org}/actions/variables/{name}"],
  8697. getPendingDeploymentsForRun: [
  8698. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments"
  8699. ],
  8700. getRepoPermissions: [
  8701. "GET /repos/{owner}/{repo}/actions/permissions",
  8702. {},
  8703. { renamed: ["actions", "getGithubActionsPermissionsRepository"] }
  8704. ],
  8705. getRepoPublicKey: ["GET /repos/{owner}/{repo}/actions/secrets/public-key"],
  8706. getRepoSecret: ["GET /repos/{owner}/{repo}/actions/secrets/{secret_name}"],
  8707. getRepoVariable: ["GET /repos/{owner}/{repo}/actions/variables/{name}"],
  8708. getReviewsForRun: [
  8709. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/approvals"
  8710. ],
  8711. getSelfHostedRunnerForOrg: ["GET /orgs/{org}/actions/runners/{runner_id}"],
  8712. getSelfHostedRunnerForRepo: [
  8713. "GET /repos/{owner}/{repo}/actions/runners/{runner_id}"
  8714. ],
  8715. getWorkflow: ["GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}"],
  8716. getWorkflowAccessToRepository: [
  8717. "GET /repos/{owner}/{repo}/actions/permissions/access"
  8718. ],
  8719. getWorkflowRun: ["GET /repos/{owner}/{repo}/actions/runs/{run_id}"],
  8720. getWorkflowRunAttempt: [
  8721. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}"
  8722. ],
  8723. getWorkflowRunUsage: [
  8724. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/timing"
  8725. ],
  8726. getWorkflowUsage: [
  8727. "GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/timing"
  8728. ],
  8729. listArtifactsForRepo: ["GET /repos/{owner}/{repo}/actions/artifacts"],
  8730. listEnvironmentSecrets: [
  8731. "GET /repositories/{repository_id}/environments/{environment_name}/secrets"
  8732. ],
  8733. listEnvironmentVariables: [
  8734. "GET /repositories/{repository_id}/environments/{environment_name}/variables"
  8735. ],
  8736. listJobsForWorkflowRun: [
  8737. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs"
  8738. ],
  8739. listJobsForWorkflowRunAttempt: [
  8740. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/jobs"
  8741. ],
  8742. listLabelsForSelfHostedRunnerForOrg: [
  8743. "GET /orgs/{org}/actions/runners/{runner_id}/labels"
  8744. ],
  8745. listLabelsForSelfHostedRunnerForRepo: [
  8746. "GET /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"
  8747. ],
  8748. listOrgSecrets: ["GET /orgs/{org}/actions/secrets"],
  8749. listOrgVariables: ["GET /orgs/{org}/actions/variables"],
  8750. listRepoOrganizationSecrets: [
  8751. "GET /repos/{owner}/{repo}/actions/organization-secrets"
  8752. ],
  8753. listRepoOrganizationVariables: [
  8754. "GET /repos/{owner}/{repo}/actions/organization-variables"
  8755. ],
  8756. listRepoSecrets: ["GET /repos/{owner}/{repo}/actions/secrets"],
  8757. listRepoVariables: ["GET /repos/{owner}/{repo}/actions/variables"],
  8758. listRepoWorkflows: ["GET /repos/{owner}/{repo}/actions/workflows"],
  8759. listRunnerApplicationsForOrg: ["GET /orgs/{org}/actions/runners/downloads"],
  8760. listRunnerApplicationsForRepo: [
  8761. "GET /repos/{owner}/{repo}/actions/runners/downloads"
  8762. ],
  8763. listSelectedReposForOrgSecret: [
  8764. "GET /orgs/{org}/actions/secrets/{secret_name}/repositories"
  8765. ],
  8766. listSelectedReposForOrgVariable: [
  8767. "GET /orgs/{org}/actions/variables/{name}/repositories"
  8768. ],
  8769. listSelectedRepositoriesEnabledGithubActionsOrganization: [
  8770. "GET /orgs/{org}/actions/permissions/repositories"
  8771. ],
  8772. listSelfHostedRunnersForOrg: ["GET /orgs/{org}/actions/runners"],
  8773. listSelfHostedRunnersForRepo: ["GET /repos/{owner}/{repo}/actions/runners"],
  8774. listWorkflowRunArtifacts: [
  8775. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts"
  8776. ],
  8777. listWorkflowRuns: [
  8778. "GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs"
  8779. ],
  8780. listWorkflowRunsForRepo: ["GET /repos/{owner}/{repo}/actions/runs"],
  8781. reRunJobForWorkflowRun: [
  8782. "POST /repos/{owner}/{repo}/actions/jobs/{job_id}/rerun"
  8783. ],
  8784. reRunWorkflow: ["POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun"],
  8785. reRunWorkflowFailedJobs: [
  8786. "POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun-failed-jobs"
  8787. ],
  8788. removeAllCustomLabelsFromSelfHostedRunnerForOrg: [
  8789. "DELETE /orgs/{org}/actions/runners/{runner_id}/labels"
  8790. ],
  8791. removeAllCustomLabelsFromSelfHostedRunnerForRepo: [
  8792. "DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"
  8793. ],
  8794. removeCustomLabelFromSelfHostedRunnerForOrg: [
  8795. "DELETE /orgs/{org}/actions/runners/{runner_id}/labels/{name}"
  8796. ],
  8797. removeCustomLabelFromSelfHostedRunnerForRepo: [
  8798. "DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}/labels/{name}"
  8799. ],
  8800. removeSelectedRepoFromOrgSecret: [
  8801. "DELETE /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}"
  8802. ],
  8803. removeSelectedRepoFromOrgVariable: [
  8804. "DELETE /orgs/{org}/actions/variables/{name}/repositories/{repository_id}"
  8805. ],
  8806. reviewCustomGatesForRun: [
  8807. "POST /repos/{owner}/{repo}/actions/runs/{run_id}/deployment_protection_rule"
  8808. ],
  8809. reviewPendingDeploymentsForRun: [
  8810. "POST /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments"
  8811. ],
  8812. setAllowedActionsOrganization: [
  8813. "PUT /orgs/{org}/actions/permissions/selected-actions"
  8814. ],
  8815. setAllowedActionsRepository: [
  8816. "PUT /repos/{owner}/{repo}/actions/permissions/selected-actions"
  8817. ],
  8818. setCustomLabelsForSelfHostedRunnerForOrg: [
  8819. "PUT /orgs/{org}/actions/runners/{runner_id}/labels"
  8820. ],
  8821. setCustomLabelsForSelfHostedRunnerForRepo: [
  8822. "PUT /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"
  8823. ],
  8824. setCustomOidcSubClaimForRepo: [
  8825. "PUT /repos/{owner}/{repo}/actions/oidc/customization/sub"
  8826. ],
  8827. setGithubActionsDefaultWorkflowPermissionsOrganization: [
  8828. "PUT /orgs/{org}/actions/permissions/workflow"
  8829. ],
  8830. setGithubActionsDefaultWorkflowPermissionsRepository: [
  8831. "PUT /repos/{owner}/{repo}/actions/permissions/workflow"
  8832. ],
  8833. setGithubActionsPermissionsOrganization: [
  8834. "PUT /orgs/{org}/actions/permissions"
  8835. ],
  8836. setGithubActionsPermissionsRepository: [
  8837. "PUT /repos/{owner}/{repo}/actions/permissions"
  8838. ],
  8839. setSelectedReposForOrgSecret: [
  8840. "PUT /orgs/{org}/actions/secrets/{secret_name}/repositories"
  8841. ],
  8842. setSelectedReposForOrgVariable: [
  8843. "PUT /orgs/{org}/actions/variables/{name}/repositories"
  8844. ],
  8845. setSelectedRepositoriesEnabledGithubActionsOrganization: [
  8846. "PUT /orgs/{org}/actions/permissions/repositories"
  8847. ],
  8848. setWorkflowAccessToRepository: [
  8849. "PUT /repos/{owner}/{repo}/actions/permissions/access"
  8850. ],
  8851. updateEnvironmentVariable: [
  8852. "PATCH /repositories/{repository_id}/environments/{environment_name}/variables/{name}"
  8853. ],
  8854. updateOrgVariable: ["PATCH /orgs/{org}/actions/variables/{name}"],
  8855. updateRepoVariable: [
  8856. "PATCH /repos/{owner}/{repo}/actions/variables/{name}"
  8857. ]
  8858. },
  8859. activity: {
  8860. checkRepoIsStarredByAuthenticatedUser: ["GET /user/starred/{owner}/{repo}"],
  8861. deleteRepoSubscription: ["DELETE /repos/{owner}/{repo}/subscription"],
  8862. deleteThreadSubscription: [
  8863. "DELETE /notifications/threads/{thread_id}/subscription"
  8864. ],
  8865. getFeeds: ["GET /feeds"],
  8866. getRepoSubscription: ["GET /repos/{owner}/{repo}/subscription"],
  8867. getThread: ["GET /notifications/threads/{thread_id}"],
  8868. getThreadSubscriptionForAuthenticatedUser: [
  8869. "GET /notifications/threads/{thread_id}/subscription"
  8870. ],
  8871. listEventsForAuthenticatedUser: ["GET /users/{username}/events"],
  8872. listNotificationsForAuthenticatedUser: ["GET /notifications"],
  8873. listOrgEventsForAuthenticatedUser: [
  8874. "GET /users/{username}/events/orgs/{org}"
  8875. ],
  8876. listPublicEvents: ["GET /events"],
  8877. listPublicEventsForRepoNetwork: ["GET /networks/{owner}/{repo}/events"],
  8878. listPublicEventsForUser: ["GET /users/{username}/events/public"],
  8879. listPublicOrgEvents: ["GET /orgs/{org}/events"],
  8880. listReceivedEventsForUser: ["GET /users/{username}/received_events"],
  8881. listReceivedPublicEventsForUser: [
  8882. "GET /users/{username}/received_events/public"
  8883. ],
  8884. listRepoEvents: ["GET /repos/{owner}/{repo}/events"],
  8885. listRepoNotificationsForAuthenticatedUser: [
  8886. "GET /repos/{owner}/{repo}/notifications"
  8887. ],
  8888. listReposStarredByAuthenticatedUser: ["GET /user/starred"],
  8889. listReposStarredByUser: ["GET /users/{username}/starred"],
  8890. listReposWatchedByUser: ["GET /users/{username}/subscriptions"],
  8891. listStargazersForRepo: ["GET /repos/{owner}/{repo}/stargazers"],
  8892. listWatchedReposForAuthenticatedUser: ["GET /user/subscriptions"],
  8893. listWatchersForRepo: ["GET /repos/{owner}/{repo}/subscribers"],
  8894. markNotificationsAsRead: ["PUT /notifications"],
  8895. markRepoNotificationsAsRead: ["PUT /repos/{owner}/{repo}/notifications"],
  8896. markThreadAsDone: ["DELETE /notifications/threads/{thread_id}"],
  8897. markThreadAsRead: ["PATCH /notifications/threads/{thread_id}"],
  8898. setRepoSubscription: ["PUT /repos/{owner}/{repo}/subscription"],
  8899. setThreadSubscription: [
  8900. "PUT /notifications/threads/{thread_id}/subscription"
  8901. ],
  8902. starRepoForAuthenticatedUser: ["PUT /user/starred/{owner}/{repo}"],
  8903. unstarRepoForAuthenticatedUser: ["DELETE /user/starred/{owner}/{repo}"]
  8904. },
  8905. apps: {
  8906. addRepoToInstallation: [
  8907. "PUT /user/installations/{installation_id}/repositories/{repository_id}",
  8908. {},
  8909. { renamed: ["apps", "addRepoToInstallationForAuthenticatedUser"] }
  8910. ],
  8911. addRepoToInstallationForAuthenticatedUser: [
  8912. "PUT /user/installations/{installation_id}/repositories/{repository_id}"
  8913. ],
  8914. checkToken: ["POST /applications/{client_id}/token"],
  8915. createFromManifest: ["POST /app-manifests/{code}/conversions"],
  8916. createInstallationAccessToken: [
  8917. "POST /app/installations/{installation_id}/access_tokens"
  8918. ],
  8919. deleteAuthorization: ["DELETE /applications/{client_id}/grant"],
  8920. deleteInstallation: ["DELETE /app/installations/{installation_id}"],
  8921. deleteToken: ["DELETE /applications/{client_id}/token"],
  8922. getAuthenticated: ["GET /app"],
  8923. getBySlug: ["GET /apps/{app_slug}"],
  8924. getInstallation: ["GET /app/installations/{installation_id}"],
  8925. getOrgInstallation: ["GET /orgs/{org}/installation"],
  8926. getRepoInstallation: ["GET /repos/{owner}/{repo}/installation"],
  8927. getSubscriptionPlanForAccount: [
  8928. "GET /marketplace_listing/accounts/{account_id}"
  8929. ],
  8930. getSubscriptionPlanForAccountStubbed: [
  8931. "GET /marketplace_listing/stubbed/accounts/{account_id}"
  8932. ],
  8933. getUserInstallation: ["GET /users/{username}/installation"],
  8934. getWebhookConfigForApp: ["GET /app/hook/config"],
  8935. getWebhookDelivery: ["GET /app/hook/deliveries/{delivery_id}"],
  8936. listAccountsForPlan: ["GET /marketplace_listing/plans/{plan_id}/accounts"],
  8937. listAccountsForPlanStubbed: [
  8938. "GET /marketplace_listing/stubbed/plans/{plan_id}/accounts"
  8939. ],
  8940. listInstallationReposForAuthenticatedUser: [
  8941. "GET /user/installations/{installation_id}/repositories"
  8942. ],
  8943. listInstallationRequestsForAuthenticatedApp: [
  8944. "GET /app/installation-requests"
  8945. ],
  8946. listInstallations: ["GET /app/installations"],
  8947. listInstallationsForAuthenticatedUser: ["GET /user/installations"],
  8948. listPlans: ["GET /marketplace_listing/plans"],
  8949. listPlansStubbed: ["GET /marketplace_listing/stubbed/plans"],
  8950. listReposAccessibleToInstallation: ["GET /installation/repositories"],
  8951. listSubscriptionsForAuthenticatedUser: ["GET /user/marketplace_purchases"],
  8952. listSubscriptionsForAuthenticatedUserStubbed: [
  8953. "GET /user/marketplace_purchases/stubbed"
  8954. ],
  8955. listWebhookDeliveries: ["GET /app/hook/deliveries"],
  8956. redeliverWebhookDelivery: [
  8957. "POST /app/hook/deliveries/{delivery_id}/attempts"
  8958. ],
  8959. removeRepoFromInstallation: [
  8960. "DELETE /user/installations/{installation_id}/repositories/{repository_id}",
  8961. {},
  8962. { renamed: ["apps", "removeRepoFromInstallationForAuthenticatedUser"] }
  8963. ],
  8964. removeRepoFromInstallationForAuthenticatedUser: [
  8965. "DELETE /user/installations/{installation_id}/repositories/{repository_id}"
  8966. ],
  8967. resetToken: ["PATCH /applications/{client_id}/token"],
  8968. revokeInstallationAccessToken: ["DELETE /installation/token"],
  8969. scopeToken: ["POST /applications/{client_id}/token/scoped"],
  8970. suspendInstallation: ["PUT /app/installations/{installation_id}/suspended"],
  8971. unsuspendInstallation: [
  8972. "DELETE /app/installations/{installation_id}/suspended"
  8973. ],
  8974. updateWebhookConfigForApp: ["PATCH /app/hook/config"]
  8975. },
  8976. billing: {
  8977. getGithubActionsBillingOrg: ["GET /orgs/{org}/settings/billing/actions"],
  8978. getGithubActionsBillingUser: [
  8979. "GET /users/{username}/settings/billing/actions"
  8980. ],
  8981. getGithubPackagesBillingOrg: ["GET /orgs/{org}/settings/billing/packages"],
  8982. getGithubPackagesBillingUser: [
  8983. "GET /users/{username}/settings/billing/packages"
  8984. ],
  8985. getSharedStorageBillingOrg: [
  8986. "GET /orgs/{org}/settings/billing/shared-storage"
  8987. ],
  8988. getSharedStorageBillingUser: [
  8989. "GET /users/{username}/settings/billing/shared-storage"
  8990. ]
  8991. },
  8992. checks: {
  8993. create: ["POST /repos/{owner}/{repo}/check-runs"],
  8994. createSuite: ["POST /repos/{owner}/{repo}/check-suites"],
  8995. get: ["GET /repos/{owner}/{repo}/check-runs/{check_run_id}"],
  8996. getSuite: ["GET /repos/{owner}/{repo}/check-suites/{check_suite_id}"],
  8997. listAnnotations: [
  8998. "GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations"
  8999. ],
  9000. listForRef: ["GET /repos/{owner}/{repo}/commits/{ref}/check-runs"],
  9001. listForSuite: [
  9002. "GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs"
  9003. ],
  9004. listSuitesForRef: ["GET /repos/{owner}/{repo}/commits/{ref}/check-suites"],
  9005. rerequestRun: [
  9006. "POST /repos/{owner}/{repo}/check-runs/{check_run_id}/rerequest"
  9007. ],
  9008. rerequestSuite: [
  9009. "POST /repos/{owner}/{repo}/check-suites/{check_suite_id}/rerequest"
  9010. ],
  9011. setSuitesPreferences: [
  9012. "PATCH /repos/{owner}/{repo}/check-suites/preferences"
  9013. ],
  9014. update: ["PATCH /repos/{owner}/{repo}/check-runs/{check_run_id}"]
  9015. },
  9016. codeScanning: {
  9017. deleteAnalysis: [
  9018. "DELETE /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}{?confirm_delete}"
  9019. ],
  9020. getAlert: [
  9021. "GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}",
  9022. {},
  9023. { renamedParameters: { alert_id: "alert_number" } }
  9024. ],
  9025. getAnalysis: [
  9026. "GET /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}"
  9027. ],
  9028. getCodeqlDatabase: [
  9029. "GET /repos/{owner}/{repo}/code-scanning/codeql/databases/{language}"
  9030. ],
  9031. getDefaultSetup: ["GET /repos/{owner}/{repo}/code-scanning/default-setup"],
  9032. getSarif: ["GET /repos/{owner}/{repo}/code-scanning/sarifs/{sarif_id}"],
  9033. listAlertInstances: [
  9034. "GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances"
  9035. ],
  9036. listAlertsForOrg: ["GET /orgs/{org}/code-scanning/alerts"],
  9037. listAlertsForRepo: ["GET /repos/{owner}/{repo}/code-scanning/alerts"],
  9038. listAlertsInstances: [
  9039. "GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances",
  9040. {},
  9041. { renamed: ["codeScanning", "listAlertInstances"] }
  9042. ],
  9043. listCodeqlDatabases: [
  9044. "GET /repos/{owner}/{repo}/code-scanning/codeql/databases"
  9045. ],
  9046. listRecentAnalyses: ["GET /repos/{owner}/{repo}/code-scanning/analyses"],
  9047. updateAlert: [
  9048. "PATCH /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}"
  9049. ],
  9050. updateDefaultSetup: [
  9051. "PATCH /repos/{owner}/{repo}/code-scanning/default-setup"
  9052. ],
  9053. uploadSarif: ["POST /repos/{owner}/{repo}/code-scanning/sarifs"]
  9054. },
  9055. codesOfConduct: {
  9056. getAllCodesOfConduct: ["GET /codes_of_conduct"],
  9057. getConductCode: ["GET /codes_of_conduct/{key}"]
  9058. },
  9059. codespaces: {
  9060. addRepositoryForSecretForAuthenticatedUser: [
  9061. "PUT /user/codespaces/secrets/{secret_name}/repositories/{repository_id}"
  9062. ],
  9063. addSelectedRepoToOrgSecret: [
  9064. "PUT /orgs/{org}/codespaces/secrets/{secret_name}/repositories/{repository_id}"
  9065. ],
  9066. checkPermissionsForDevcontainer: [
  9067. "GET /repos/{owner}/{repo}/codespaces/permissions_check"
  9068. ],
  9069. codespaceMachinesForAuthenticatedUser: [
  9070. "GET /user/codespaces/{codespace_name}/machines"
  9071. ],
  9072. createForAuthenticatedUser: ["POST /user/codespaces"],
  9073. createOrUpdateOrgSecret: [
  9074. "PUT /orgs/{org}/codespaces/secrets/{secret_name}"
  9075. ],
  9076. createOrUpdateRepoSecret: [
  9077. "PUT /repos/{owner}/{repo}/codespaces/secrets/{secret_name}"
  9078. ],
  9079. createOrUpdateSecretForAuthenticatedUser: [
  9080. "PUT /user/codespaces/secrets/{secret_name}"
  9081. ],
  9082. createWithPrForAuthenticatedUser: [
  9083. "POST /repos/{owner}/{repo}/pulls/{pull_number}/codespaces"
  9084. ],
  9085. createWithRepoForAuthenticatedUser: [
  9086. "POST /repos/{owner}/{repo}/codespaces"
  9087. ],
  9088. deleteForAuthenticatedUser: ["DELETE /user/codespaces/{codespace_name}"],
  9089. deleteFromOrganization: [
  9090. "DELETE /orgs/{org}/members/{username}/codespaces/{codespace_name}"
  9091. ],
  9092. deleteOrgSecret: ["DELETE /orgs/{org}/codespaces/secrets/{secret_name}"],
  9093. deleteRepoSecret: [
  9094. "DELETE /repos/{owner}/{repo}/codespaces/secrets/{secret_name}"
  9095. ],
  9096. deleteSecretForAuthenticatedUser: [
  9097. "DELETE /user/codespaces/secrets/{secret_name}"
  9098. ],
  9099. exportForAuthenticatedUser: [
  9100. "POST /user/codespaces/{codespace_name}/exports"
  9101. ],
  9102. getCodespacesForUserInOrg: [
  9103. "GET /orgs/{org}/members/{username}/codespaces"
  9104. ],
  9105. getExportDetailsForAuthenticatedUser: [
  9106. "GET /user/codespaces/{codespace_name}/exports/{export_id}"
  9107. ],
  9108. getForAuthenticatedUser: ["GET /user/codespaces/{codespace_name}"],
  9109. getOrgPublicKey: ["GET /orgs/{org}/codespaces/secrets/public-key"],
  9110. getOrgSecret: ["GET /orgs/{org}/codespaces/secrets/{secret_name}"],
  9111. getPublicKeyForAuthenticatedUser: [
  9112. "GET /user/codespaces/secrets/public-key"
  9113. ],
  9114. getRepoPublicKey: [
  9115. "GET /repos/{owner}/{repo}/codespaces/secrets/public-key"
  9116. ],
  9117. getRepoSecret: [
  9118. "GET /repos/{owner}/{repo}/codespaces/secrets/{secret_name}"
  9119. ],
  9120. getSecretForAuthenticatedUser: [
  9121. "GET /user/codespaces/secrets/{secret_name}"
  9122. ],
  9123. listDevcontainersInRepositoryForAuthenticatedUser: [
  9124. "GET /repos/{owner}/{repo}/codespaces/devcontainers"
  9125. ],
  9126. listForAuthenticatedUser: ["GET /user/codespaces"],
  9127. listInOrganization: [
  9128. "GET /orgs/{org}/codespaces",
  9129. {},
  9130. { renamedParameters: { org_id: "org" } }
  9131. ],
  9132. listInRepositoryForAuthenticatedUser: [
  9133. "GET /repos/{owner}/{repo}/codespaces"
  9134. ],
  9135. listOrgSecrets: ["GET /orgs/{org}/codespaces/secrets"],
  9136. listRepoSecrets: ["GET /repos/{owner}/{repo}/codespaces/secrets"],
  9137. listRepositoriesForSecretForAuthenticatedUser: [
  9138. "GET /user/codespaces/secrets/{secret_name}/repositories"
  9139. ],
  9140. listSecretsForAuthenticatedUser: ["GET /user/codespaces/secrets"],
  9141. listSelectedReposForOrgSecret: [
  9142. "GET /orgs/{org}/codespaces/secrets/{secret_name}/repositories"
  9143. ],
  9144. preFlightWithRepoForAuthenticatedUser: [
  9145. "GET /repos/{owner}/{repo}/codespaces/new"
  9146. ],
  9147. publishForAuthenticatedUser: [
  9148. "POST /user/codespaces/{codespace_name}/publish"
  9149. ],
  9150. removeRepositoryForSecretForAuthenticatedUser: [
  9151. "DELETE /user/codespaces/secrets/{secret_name}/repositories/{repository_id}"
  9152. ],
  9153. removeSelectedRepoFromOrgSecret: [
  9154. "DELETE /orgs/{org}/codespaces/secrets/{secret_name}/repositories/{repository_id}"
  9155. ],
  9156. repoMachinesForAuthenticatedUser: [
  9157. "GET /repos/{owner}/{repo}/codespaces/machines"
  9158. ],
  9159. setRepositoriesForSecretForAuthenticatedUser: [
  9160. "PUT /user/codespaces/secrets/{secret_name}/repositories"
  9161. ],
  9162. setSelectedReposForOrgSecret: [
  9163. "PUT /orgs/{org}/codespaces/secrets/{secret_name}/repositories"
  9164. ],
  9165. startForAuthenticatedUser: ["POST /user/codespaces/{codespace_name}/start"],
  9166. stopForAuthenticatedUser: ["POST /user/codespaces/{codespace_name}/stop"],
  9167. stopInOrganization: [
  9168. "POST /orgs/{org}/members/{username}/codespaces/{codespace_name}/stop"
  9169. ],
  9170. updateForAuthenticatedUser: ["PATCH /user/codespaces/{codespace_name}"]
  9171. },
  9172. copilot: {
  9173. addCopilotSeatsForTeams: [
  9174. "POST /orgs/{org}/copilot/billing/selected_teams"
  9175. ],
  9176. addCopilotSeatsForUsers: [
  9177. "POST /orgs/{org}/copilot/billing/selected_users"
  9178. ],
  9179. cancelCopilotSeatAssignmentForTeams: [
  9180. "DELETE /orgs/{org}/copilot/billing/selected_teams"
  9181. ],
  9182. cancelCopilotSeatAssignmentForUsers: [
  9183. "DELETE /orgs/{org}/copilot/billing/selected_users"
  9184. ],
  9185. getCopilotOrganizationDetails: ["GET /orgs/{org}/copilot/billing"],
  9186. getCopilotSeatDetailsForUser: [
  9187. "GET /orgs/{org}/members/{username}/copilot"
  9188. ],
  9189. listCopilotSeats: ["GET /orgs/{org}/copilot/billing/seats"]
  9190. },
  9191. dependabot: {
  9192. addSelectedRepoToOrgSecret: [
  9193. "PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id}"
  9194. ],
  9195. createOrUpdateOrgSecret: [
  9196. "PUT /orgs/{org}/dependabot/secrets/{secret_name}"
  9197. ],
  9198. createOrUpdateRepoSecret: [
  9199. "PUT /repos/{owner}/{repo}/dependabot/secrets/{secret_name}"
  9200. ],
  9201. deleteOrgSecret: ["DELETE /orgs/{org}/dependabot/secrets/{secret_name}"],
  9202. deleteRepoSecret: [
  9203. "DELETE /repos/{owner}/{repo}/dependabot/secrets/{secret_name}"
  9204. ],
  9205. getAlert: ["GET /repos/{owner}/{repo}/dependabot/alerts/{alert_number}"],
  9206. getOrgPublicKey: ["GET /orgs/{org}/dependabot/secrets/public-key"],
  9207. getOrgSecret: ["GET /orgs/{org}/dependabot/secrets/{secret_name}"],
  9208. getRepoPublicKey: [
  9209. "GET /repos/{owner}/{repo}/dependabot/secrets/public-key"
  9210. ],
  9211. getRepoSecret: [
  9212. "GET /repos/{owner}/{repo}/dependabot/secrets/{secret_name}"
  9213. ],
  9214. listAlertsForEnterprise: [
  9215. "GET /enterprises/{enterprise}/dependabot/alerts"
  9216. ],
  9217. listAlertsForOrg: ["GET /orgs/{org}/dependabot/alerts"],
  9218. listAlertsForRepo: ["GET /repos/{owner}/{repo}/dependabot/alerts"],
  9219. listOrgSecrets: ["GET /orgs/{org}/dependabot/secrets"],
  9220. listRepoSecrets: ["GET /repos/{owner}/{repo}/dependabot/secrets"],
  9221. listSelectedReposForOrgSecret: [
  9222. "GET /orgs/{org}/dependabot/secrets/{secret_name}/repositories"
  9223. ],
  9224. removeSelectedRepoFromOrgSecret: [
  9225. "DELETE /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id}"
  9226. ],
  9227. setSelectedReposForOrgSecret: [
  9228. "PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories"
  9229. ],
  9230. updateAlert: [
  9231. "PATCH /repos/{owner}/{repo}/dependabot/alerts/{alert_number}"
  9232. ]
  9233. },
  9234. dependencyGraph: {
  9235. createRepositorySnapshot: [
  9236. "POST /repos/{owner}/{repo}/dependency-graph/snapshots"
  9237. ],
  9238. diffRange: [
  9239. "GET /repos/{owner}/{repo}/dependency-graph/compare/{basehead}"
  9240. ],
  9241. exportSbom: ["GET /repos/{owner}/{repo}/dependency-graph/sbom"]
  9242. },
  9243. emojis: { get: ["GET /emojis"] },
  9244. gists: {
  9245. checkIsStarred: ["GET /gists/{gist_id}/star"],
  9246. create: ["POST /gists"],
  9247. createComment: ["POST /gists/{gist_id}/comments"],
  9248. delete: ["DELETE /gists/{gist_id}"],
  9249. deleteComment: ["DELETE /gists/{gist_id}/comments/{comment_id}"],
  9250. fork: ["POST /gists/{gist_id}/forks"],
  9251. get: ["GET /gists/{gist_id}"],
  9252. getComment: ["GET /gists/{gist_id}/comments/{comment_id}"],
  9253. getRevision: ["GET /gists/{gist_id}/{sha}"],
  9254. list: ["GET /gists"],
  9255. listComments: ["GET /gists/{gist_id}/comments"],
  9256. listCommits: ["GET /gists/{gist_id}/commits"],
  9257. listForUser: ["GET /users/{username}/gists"],
  9258. listForks: ["GET /gists/{gist_id}/forks"],
  9259. listPublic: ["GET /gists/public"],
  9260. listStarred: ["GET /gists/starred"],
  9261. star: ["PUT /gists/{gist_id}/star"],
  9262. unstar: ["DELETE /gists/{gist_id}/star"],
  9263. update: ["PATCH /gists/{gist_id}"],
  9264. updateComment: ["PATCH /gists/{gist_id}/comments/{comment_id}"]
  9265. },
  9266. git: {
  9267. createBlob: ["POST /repos/{owner}/{repo}/git/blobs"],
  9268. createCommit: ["POST /repos/{owner}/{repo}/git/commits"],
  9269. createRef: ["POST /repos/{owner}/{repo}/git/refs"],
  9270. createTag: ["POST /repos/{owner}/{repo}/git/tags"],
  9271. createTree: ["POST /repos/{owner}/{repo}/git/trees"],
  9272. deleteRef: ["DELETE /repos/{owner}/{repo}/git/refs/{ref}"],
  9273. getBlob: ["GET /repos/{owner}/{repo}/git/blobs/{file_sha}"],
  9274. getCommit: ["GET /repos/{owner}/{repo}/git/commits/{commit_sha}"],
  9275. getRef: ["GET /repos/{owner}/{repo}/git/ref/{ref}"],
  9276. getTag: ["GET /repos/{owner}/{repo}/git/tags/{tag_sha}"],
  9277. getTree: ["GET /repos/{owner}/{repo}/git/trees/{tree_sha}"],
  9278. listMatchingRefs: ["GET /repos/{owner}/{repo}/git/matching-refs/{ref}"],
  9279. updateRef: ["PATCH /repos/{owner}/{repo}/git/refs/{ref}"]
  9280. },
  9281. gitignore: {
  9282. getAllTemplates: ["GET /gitignore/templates"],
  9283. getTemplate: ["GET /gitignore/templates/{name}"]
  9284. },
  9285. interactions: {
  9286. getRestrictionsForAuthenticatedUser: ["GET /user/interaction-limits"],
  9287. getRestrictionsForOrg: ["GET /orgs/{org}/interaction-limits"],
  9288. getRestrictionsForRepo: ["GET /repos/{owner}/{repo}/interaction-limits"],
  9289. getRestrictionsForYourPublicRepos: [
  9290. "GET /user/interaction-limits",
  9291. {},
  9292. { renamed: ["interactions", "getRestrictionsForAuthenticatedUser"] }
  9293. ],
  9294. removeRestrictionsForAuthenticatedUser: ["DELETE /user/interaction-limits"],
  9295. removeRestrictionsForOrg: ["DELETE /orgs/{org}/interaction-limits"],
  9296. removeRestrictionsForRepo: [
  9297. "DELETE /repos/{owner}/{repo}/interaction-limits"
  9298. ],
  9299. removeRestrictionsForYourPublicRepos: [
  9300. "DELETE /user/interaction-limits",
  9301. {},
  9302. { renamed: ["interactions", "removeRestrictionsForAuthenticatedUser"] }
  9303. ],
  9304. setRestrictionsForAuthenticatedUser: ["PUT /user/interaction-limits"],
  9305. setRestrictionsForOrg: ["PUT /orgs/{org}/interaction-limits"],
  9306. setRestrictionsForRepo: ["PUT /repos/{owner}/{repo}/interaction-limits"],
  9307. setRestrictionsForYourPublicRepos: [
  9308. "PUT /user/interaction-limits",
  9309. {},
  9310. { renamed: ["interactions", "setRestrictionsForAuthenticatedUser"] }
  9311. ]
  9312. },
  9313. issues: {
  9314. addAssignees: [
  9315. "POST /repos/{owner}/{repo}/issues/{issue_number}/assignees"
  9316. ],
  9317. addLabels: ["POST /repos/{owner}/{repo}/issues/{issue_number}/labels"],
  9318. checkUserCanBeAssigned: ["GET /repos/{owner}/{repo}/assignees/{assignee}"],
  9319. checkUserCanBeAssignedToIssue: [
  9320. "GET /repos/{owner}/{repo}/issues/{issue_number}/assignees/{assignee}"
  9321. ],
  9322. create: ["POST /repos/{owner}/{repo}/issues"],
  9323. createComment: [
  9324. "POST /repos/{owner}/{repo}/issues/{issue_number}/comments"
  9325. ],
  9326. createLabel: ["POST /repos/{owner}/{repo}/labels"],
  9327. createMilestone: ["POST /repos/{owner}/{repo}/milestones"],
  9328. deleteComment: [
  9329. "DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}"
  9330. ],
  9331. deleteLabel: ["DELETE /repos/{owner}/{repo}/labels/{name}"],
  9332. deleteMilestone: [
  9333. "DELETE /repos/{owner}/{repo}/milestones/{milestone_number}"
  9334. ],
  9335. get: ["GET /repos/{owner}/{repo}/issues/{issue_number}"],
  9336. getComment: ["GET /repos/{owner}/{repo}/issues/comments/{comment_id}"],
  9337. getEvent: ["GET /repos/{owner}/{repo}/issues/events/{event_id}"],
  9338. getLabel: ["GET /repos/{owner}/{repo}/labels/{name}"],
  9339. getMilestone: ["GET /repos/{owner}/{repo}/milestones/{milestone_number}"],
  9340. list: ["GET /issues"],
  9341. listAssignees: ["GET /repos/{owner}/{repo}/assignees"],
  9342. listComments: ["GET /repos/{owner}/{repo}/issues/{issue_number}/comments"],
  9343. listCommentsForRepo: ["GET /repos/{owner}/{repo}/issues/comments"],
  9344. listEvents: ["GET /repos/{owner}/{repo}/issues/{issue_number}/events"],
  9345. listEventsForRepo: ["GET /repos/{owner}/{repo}/issues/events"],
  9346. listEventsForTimeline: [
  9347. "GET /repos/{owner}/{repo}/issues/{issue_number}/timeline"
  9348. ],
  9349. listForAuthenticatedUser: ["GET /user/issues"],
  9350. listForOrg: ["GET /orgs/{org}/issues"],
  9351. listForRepo: ["GET /repos/{owner}/{repo}/issues"],
  9352. listLabelsForMilestone: [
  9353. "GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels"
  9354. ],
  9355. listLabelsForRepo: ["GET /repos/{owner}/{repo}/labels"],
  9356. listLabelsOnIssue: [
  9357. "GET /repos/{owner}/{repo}/issues/{issue_number}/labels"
  9358. ],
  9359. listMilestones: ["GET /repos/{owner}/{repo}/milestones"],
  9360. lock: ["PUT /repos/{owner}/{repo}/issues/{issue_number}/lock"],
  9361. removeAllLabels: [
  9362. "DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels"
  9363. ],
  9364. removeAssignees: [
  9365. "DELETE /repos/{owner}/{repo}/issues/{issue_number}/assignees"
  9366. ],
  9367. removeLabel: [
  9368. "DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels/{name}"
  9369. ],
  9370. setLabels: ["PUT /repos/{owner}/{repo}/issues/{issue_number}/labels"],
  9371. unlock: ["DELETE /repos/{owner}/{repo}/issues/{issue_number}/lock"],
  9372. update: ["PATCH /repos/{owner}/{repo}/issues/{issue_number}"],
  9373. updateComment: ["PATCH /repos/{owner}/{repo}/issues/comments/{comment_id}"],
  9374. updateLabel: ["PATCH /repos/{owner}/{repo}/labels/{name}"],
  9375. updateMilestone: [
  9376. "PATCH /repos/{owner}/{repo}/milestones/{milestone_number}"
  9377. ]
  9378. },
  9379. licenses: {
  9380. get: ["GET /licenses/{license}"],
  9381. getAllCommonlyUsed: ["GET /licenses"],
  9382. getForRepo: ["GET /repos/{owner}/{repo}/license"]
  9383. },
  9384. markdown: {
  9385. render: ["POST /markdown"],
  9386. renderRaw: [
  9387. "POST /markdown/raw",
  9388. { headers: { "content-type": "text/plain; charset=utf-8" } }
  9389. ]
  9390. },
  9391. meta: {
  9392. get: ["GET /meta"],
  9393. getAllVersions: ["GET /versions"],
  9394. getOctocat: ["GET /octocat"],
  9395. getZen: ["GET /zen"],
  9396. root: ["GET /"]
  9397. },
  9398. migrations: {
  9399. cancelImport: [
  9400. "DELETE /repos/{owner}/{repo}/import",
  9401. {},
  9402. {
  9403. deprecated: "octokit.rest.migrations.cancelImport() is deprecated, see https://docs.github.com/rest/migrations/source-imports#cancel-an-import"
  9404. }
  9405. ],
  9406. deleteArchiveForAuthenticatedUser: [
  9407. "DELETE /user/migrations/{migration_id}/archive"
  9408. ],
  9409. deleteArchiveForOrg: [
  9410. "DELETE /orgs/{org}/migrations/{migration_id}/archive"
  9411. ],
  9412. downloadArchiveForOrg: [
  9413. "GET /orgs/{org}/migrations/{migration_id}/archive"
  9414. ],
  9415. getArchiveForAuthenticatedUser: [
  9416. "GET /user/migrations/{migration_id}/archive"
  9417. ],
  9418. getCommitAuthors: [
  9419. "GET /repos/{owner}/{repo}/import/authors",
  9420. {},
  9421. {
  9422. deprecated: "octokit.rest.migrations.getCommitAuthors() is deprecated, see https://docs.github.com/rest/migrations/source-imports#get-commit-authors"
  9423. }
  9424. ],
  9425. getImportStatus: [
  9426. "GET /repos/{owner}/{repo}/import",
  9427. {},
  9428. {
  9429. deprecated: "octokit.rest.migrations.getImportStatus() is deprecated, see https://docs.github.com/rest/migrations/source-imports#get-an-import-status"
  9430. }
  9431. ],
  9432. getLargeFiles: [
  9433. "GET /repos/{owner}/{repo}/import/large_files",
  9434. {},
  9435. {
  9436. deprecated: "octokit.rest.migrations.getLargeFiles() is deprecated, see https://docs.github.com/rest/migrations/source-imports#get-large-files"
  9437. }
  9438. ],
  9439. getStatusForAuthenticatedUser: ["GET /user/migrations/{migration_id}"],
  9440. getStatusForOrg: ["GET /orgs/{org}/migrations/{migration_id}"],
  9441. listForAuthenticatedUser: ["GET /user/migrations"],
  9442. listForOrg: ["GET /orgs/{org}/migrations"],
  9443. listReposForAuthenticatedUser: [
  9444. "GET /user/migrations/{migration_id}/repositories"
  9445. ],
  9446. listReposForOrg: ["GET /orgs/{org}/migrations/{migration_id}/repositories"],
  9447. listReposForUser: [
  9448. "GET /user/migrations/{migration_id}/repositories",
  9449. {},
  9450. { renamed: ["migrations", "listReposForAuthenticatedUser"] }
  9451. ],
  9452. mapCommitAuthor: [
  9453. "PATCH /repos/{owner}/{repo}/import/authors/{author_id}",
  9454. {},
  9455. {
  9456. deprecated: "octokit.rest.migrations.mapCommitAuthor() is deprecated, see https://docs.github.com/rest/migrations/source-imports#map-a-commit-author"
  9457. }
  9458. ],
  9459. setLfsPreference: [
  9460. "PATCH /repos/{owner}/{repo}/import/lfs",
  9461. {},
  9462. {
  9463. deprecated: "octokit.rest.migrations.setLfsPreference() is deprecated, see https://docs.github.com/rest/migrations/source-imports#update-git-lfs-preference"
  9464. }
  9465. ],
  9466. startForAuthenticatedUser: ["POST /user/migrations"],
  9467. startForOrg: ["POST /orgs/{org}/migrations"],
  9468. startImport: [
  9469. "PUT /repos/{owner}/{repo}/import",
  9470. {},
  9471. {
  9472. deprecated: "octokit.rest.migrations.startImport() is deprecated, see https://docs.github.com/rest/migrations/source-imports#start-an-import"
  9473. }
  9474. ],
  9475. unlockRepoForAuthenticatedUser: [
  9476. "DELETE /user/migrations/{migration_id}/repos/{repo_name}/lock"
  9477. ],
  9478. unlockRepoForOrg: [
  9479. "DELETE /orgs/{org}/migrations/{migration_id}/repos/{repo_name}/lock"
  9480. ],
  9481. updateImport: [
  9482. "PATCH /repos/{owner}/{repo}/import",
  9483. {},
  9484. {
  9485. deprecated: "octokit.rest.migrations.updateImport() is deprecated, see https://docs.github.com/rest/migrations/source-imports#update-an-import"
  9486. }
  9487. ]
  9488. },
  9489. oidc: {
  9490. getOidcCustomSubTemplateForOrg: [
  9491. "GET /orgs/{org}/actions/oidc/customization/sub"
  9492. ],
  9493. updateOidcCustomSubTemplateForOrg: [
  9494. "PUT /orgs/{org}/actions/oidc/customization/sub"
  9495. ]
  9496. },
  9497. orgs: {
  9498. addSecurityManagerTeam: [
  9499. "PUT /orgs/{org}/security-managers/teams/{team_slug}"
  9500. ],
  9501. assignTeamToOrgRole: [
  9502. "PUT /orgs/{org}/organization-roles/teams/{team_slug}/{role_id}"
  9503. ],
  9504. assignUserToOrgRole: [
  9505. "PUT /orgs/{org}/organization-roles/users/{username}/{role_id}"
  9506. ],
  9507. blockUser: ["PUT /orgs/{org}/blocks/{username}"],
  9508. cancelInvitation: ["DELETE /orgs/{org}/invitations/{invitation_id}"],
  9509. checkBlockedUser: ["GET /orgs/{org}/blocks/{username}"],
  9510. checkMembershipForUser: ["GET /orgs/{org}/members/{username}"],
  9511. checkPublicMembershipForUser: ["GET /orgs/{org}/public_members/{username}"],
  9512. convertMemberToOutsideCollaborator: [
  9513. "PUT /orgs/{org}/outside_collaborators/{username}"
  9514. ],
  9515. createCustomOrganizationRole: ["POST /orgs/{org}/organization-roles"],
  9516. createInvitation: ["POST /orgs/{org}/invitations"],
  9517. createOrUpdateCustomProperties: ["PATCH /orgs/{org}/properties/schema"],
  9518. createOrUpdateCustomPropertiesValuesForRepos: [
  9519. "PATCH /orgs/{org}/properties/values"
  9520. ],
  9521. createOrUpdateCustomProperty: [
  9522. "PUT /orgs/{org}/properties/schema/{custom_property_name}"
  9523. ],
  9524. createWebhook: ["POST /orgs/{org}/hooks"],
  9525. delete: ["DELETE /orgs/{org}"],
  9526. deleteCustomOrganizationRole: [
  9527. "DELETE /orgs/{org}/organization-roles/{role_id}"
  9528. ],
  9529. deleteWebhook: ["DELETE /orgs/{org}/hooks/{hook_id}"],
  9530. enableOrDisableSecurityProductOnAllOrgRepos: [
  9531. "POST /orgs/{org}/{security_product}/{enablement}"
  9532. ],
  9533. get: ["GET /orgs/{org}"],
  9534. getAllCustomProperties: ["GET /orgs/{org}/properties/schema"],
  9535. getCustomProperty: [
  9536. "GET /orgs/{org}/properties/schema/{custom_property_name}"
  9537. ],
  9538. getMembershipForAuthenticatedUser: ["GET /user/memberships/orgs/{org}"],
  9539. getMembershipForUser: ["GET /orgs/{org}/memberships/{username}"],
  9540. getOrgRole: ["GET /orgs/{org}/organization-roles/{role_id}"],
  9541. getWebhook: ["GET /orgs/{org}/hooks/{hook_id}"],
  9542. getWebhookConfigForOrg: ["GET /orgs/{org}/hooks/{hook_id}/config"],
  9543. getWebhookDelivery: [
  9544. "GET /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}"
  9545. ],
  9546. list: ["GET /organizations"],
  9547. listAppInstallations: ["GET /orgs/{org}/installations"],
  9548. listBlockedUsers: ["GET /orgs/{org}/blocks"],
  9549. listCustomPropertiesValuesForRepos: ["GET /orgs/{org}/properties/values"],
  9550. listFailedInvitations: ["GET /orgs/{org}/failed_invitations"],
  9551. listForAuthenticatedUser: ["GET /user/orgs"],
  9552. listForUser: ["GET /users/{username}/orgs"],
  9553. listInvitationTeams: ["GET /orgs/{org}/invitations/{invitation_id}/teams"],
  9554. listMembers: ["GET /orgs/{org}/members"],
  9555. listMembershipsForAuthenticatedUser: ["GET /user/memberships/orgs"],
  9556. listOrgRoleTeams: ["GET /orgs/{org}/organization-roles/{role_id}/teams"],
  9557. listOrgRoleUsers: ["GET /orgs/{org}/organization-roles/{role_id}/users"],
  9558. listOrgRoles: ["GET /orgs/{org}/organization-roles"],
  9559. listOrganizationFineGrainedPermissions: [
  9560. "GET /orgs/{org}/organization-fine-grained-permissions"
  9561. ],
  9562. listOutsideCollaborators: ["GET /orgs/{org}/outside_collaborators"],
  9563. listPatGrantRepositories: [
  9564. "GET /orgs/{org}/personal-access-tokens/{pat_id}/repositories"
  9565. ],
  9566. listPatGrantRequestRepositories: [
  9567. "GET /orgs/{org}/personal-access-token-requests/{pat_request_id}/repositories"
  9568. ],
  9569. listPatGrantRequests: ["GET /orgs/{org}/personal-access-token-requests"],
  9570. listPatGrants: ["GET /orgs/{org}/personal-access-tokens"],
  9571. listPendingInvitations: ["GET /orgs/{org}/invitations"],
  9572. listPublicMembers: ["GET /orgs/{org}/public_members"],
  9573. listSecurityManagerTeams: ["GET /orgs/{org}/security-managers"],
  9574. listWebhookDeliveries: ["GET /orgs/{org}/hooks/{hook_id}/deliveries"],
  9575. listWebhooks: ["GET /orgs/{org}/hooks"],
  9576. patchCustomOrganizationRole: [
  9577. "PATCH /orgs/{org}/organization-roles/{role_id}"
  9578. ],
  9579. pingWebhook: ["POST /orgs/{org}/hooks/{hook_id}/pings"],
  9580. redeliverWebhookDelivery: [
  9581. "POST /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts"
  9582. ],
  9583. removeCustomProperty: [
  9584. "DELETE /orgs/{org}/properties/schema/{custom_property_name}"
  9585. ],
  9586. removeMember: ["DELETE /orgs/{org}/members/{username}"],
  9587. removeMembershipForUser: ["DELETE /orgs/{org}/memberships/{username}"],
  9588. removeOutsideCollaborator: [
  9589. "DELETE /orgs/{org}/outside_collaborators/{username}"
  9590. ],
  9591. removePublicMembershipForAuthenticatedUser: [
  9592. "DELETE /orgs/{org}/public_members/{username}"
  9593. ],
  9594. removeSecurityManagerTeam: [
  9595. "DELETE /orgs/{org}/security-managers/teams/{team_slug}"
  9596. ],
  9597. reviewPatGrantRequest: [
  9598. "POST /orgs/{org}/personal-access-token-requests/{pat_request_id}"
  9599. ],
  9600. reviewPatGrantRequestsInBulk: [
  9601. "POST /orgs/{org}/personal-access-token-requests"
  9602. ],
  9603. revokeAllOrgRolesTeam: [
  9604. "DELETE /orgs/{org}/organization-roles/teams/{team_slug}"
  9605. ],
  9606. revokeAllOrgRolesUser: [
  9607. "DELETE /orgs/{org}/organization-roles/users/{username}"
  9608. ],
  9609. revokeOrgRoleTeam: [
  9610. "DELETE /orgs/{org}/organization-roles/teams/{team_slug}/{role_id}"
  9611. ],
  9612. revokeOrgRoleUser: [
  9613. "DELETE /orgs/{org}/organization-roles/users/{username}/{role_id}"
  9614. ],
  9615. setMembershipForUser: ["PUT /orgs/{org}/memberships/{username}"],
  9616. setPublicMembershipForAuthenticatedUser: [
  9617. "PUT /orgs/{org}/public_members/{username}"
  9618. ],
  9619. unblockUser: ["DELETE /orgs/{org}/blocks/{username}"],
  9620. update: ["PATCH /orgs/{org}"],
  9621. updateMembershipForAuthenticatedUser: [
  9622. "PATCH /user/memberships/orgs/{org}"
  9623. ],
  9624. updatePatAccess: ["POST /orgs/{org}/personal-access-tokens/{pat_id}"],
  9625. updatePatAccesses: ["POST /orgs/{org}/personal-access-tokens"],
  9626. updateWebhook: ["PATCH /orgs/{org}/hooks/{hook_id}"],
  9627. updateWebhookConfigForOrg: ["PATCH /orgs/{org}/hooks/{hook_id}/config"]
  9628. },
  9629. packages: {
  9630. deletePackageForAuthenticatedUser: [
  9631. "DELETE /user/packages/{package_type}/{package_name}"
  9632. ],
  9633. deletePackageForOrg: [
  9634. "DELETE /orgs/{org}/packages/{package_type}/{package_name}"
  9635. ],
  9636. deletePackageForUser: [
  9637. "DELETE /users/{username}/packages/{package_type}/{package_name}"
  9638. ],
  9639. deletePackageVersionForAuthenticatedUser: [
  9640. "DELETE /user/packages/{package_type}/{package_name}/versions/{package_version_id}"
  9641. ],
  9642. deletePackageVersionForOrg: [
  9643. "DELETE /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}"
  9644. ],
  9645. deletePackageVersionForUser: [
  9646. "DELETE /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}"
  9647. ],
  9648. getAllPackageVersionsForAPackageOwnedByAnOrg: [
  9649. "GET /orgs/{org}/packages/{package_type}/{package_name}/versions",
  9650. {},
  9651. { renamed: ["packages", "getAllPackageVersionsForPackageOwnedByOrg"] }
  9652. ],
  9653. getAllPackageVersionsForAPackageOwnedByTheAuthenticatedUser: [
  9654. "GET /user/packages/{package_type}/{package_name}/versions",
  9655. {},
  9656. {
  9657. renamed: [
  9658. "packages",
  9659. "getAllPackageVersionsForPackageOwnedByAuthenticatedUser"
  9660. ]
  9661. }
  9662. ],
  9663. getAllPackageVersionsForPackageOwnedByAuthenticatedUser: [
  9664. "GET /user/packages/{package_type}/{package_name}/versions"
  9665. ],
  9666. getAllPackageVersionsForPackageOwnedByOrg: [
  9667. "GET /orgs/{org}/packages/{package_type}/{package_name}/versions"
  9668. ],
  9669. getAllPackageVersionsForPackageOwnedByUser: [
  9670. "GET /users/{username}/packages/{package_type}/{package_name}/versions"
  9671. ],
  9672. getPackageForAuthenticatedUser: [
  9673. "GET /user/packages/{package_type}/{package_name}"
  9674. ],
  9675. getPackageForOrganization: [
  9676. "GET /orgs/{org}/packages/{package_type}/{package_name}"
  9677. ],
  9678. getPackageForUser: [
  9679. "GET /users/{username}/packages/{package_type}/{package_name}"
  9680. ],
  9681. getPackageVersionForAuthenticatedUser: [
  9682. "GET /user/packages/{package_type}/{package_name}/versions/{package_version_id}"
  9683. ],
  9684. getPackageVersionForOrganization: [
  9685. "GET /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}"
  9686. ],
  9687. getPackageVersionForUser: [
  9688. "GET /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}"
  9689. ],
  9690. listDockerMigrationConflictingPackagesForAuthenticatedUser: [
  9691. "GET /user/docker/conflicts"
  9692. ],
  9693. listDockerMigrationConflictingPackagesForOrganization: [
  9694. "GET /orgs/{org}/docker/conflicts"
  9695. ],
  9696. listDockerMigrationConflictingPackagesForUser: [
  9697. "GET /users/{username}/docker/conflicts"
  9698. ],
  9699. listPackagesForAuthenticatedUser: ["GET /user/packages"],
  9700. listPackagesForOrganization: ["GET /orgs/{org}/packages"],
  9701. listPackagesForUser: ["GET /users/{username}/packages"],
  9702. restorePackageForAuthenticatedUser: [
  9703. "POST /user/packages/{package_type}/{package_name}/restore{?token}"
  9704. ],
  9705. restorePackageForOrg: [
  9706. "POST /orgs/{org}/packages/{package_type}/{package_name}/restore{?token}"
  9707. ],
  9708. restorePackageForUser: [
  9709. "POST /users/{username}/packages/{package_type}/{package_name}/restore{?token}"
  9710. ],
  9711. restorePackageVersionForAuthenticatedUser: [
  9712. "POST /user/packages/{package_type}/{package_name}/versions/{package_version_id}/restore"
  9713. ],
  9714. restorePackageVersionForOrg: [
  9715. "POST /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore"
  9716. ],
  9717. restorePackageVersionForUser: [
  9718. "POST /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore"
  9719. ]
  9720. },
  9721. projects: {
  9722. addCollaborator: ["PUT /projects/{project_id}/collaborators/{username}"],
  9723. createCard: ["POST /projects/columns/{column_id}/cards"],
  9724. createColumn: ["POST /projects/{project_id}/columns"],
  9725. createForAuthenticatedUser: ["POST /user/projects"],
  9726. createForOrg: ["POST /orgs/{org}/projects"],
  9727. createForRepo: ["POST /repos/{owner}/{repo}/projects"],
  9728. delete: ["DELETE /projects/{project_id}"],
  9729. deleteCard: ["DELETE /projects/columns/cards/{card_id}"],
  9730. deleteColumn: ["DELETE /projects/columns/{column_id}"],
  9731. get: ["GET /projects/{project_id}"],
  9732. getCard: ["GET /projects/columns/cards/{card_id}"],
  9733. getColumn: ["GET /projects/columns/{column_id}"],
  9734. getPermissionForUser: [
  9735. "GET /projects/{project_id}/collaborators/{username}/permission"
  9736. ],
  9737. listCards: ["GET /projects/columns/{column_id}/cards"],
  9738. listCollaborators: ["GET /projects/{project_id}/collaborators"],
  9739. listColumns: ["GET /projects/{project_id}/columns"],
  9740. listForOrg: ["GET /orgs/{org}/projects"],
  9741. listForRepo: ["GET /repos/{owner}/{repo}/projects"],
  9742. listForUser: ["GET /users/{username}/projects"],
  9743. moveCard: ["POST /projects/columns/cards/{card_id}/moves"],
  9744. moveColumn: ["POST /projects/columns/{column_id}/moves"],
  9745. removeCollaborator: [
  9746. "DELETE /projects/{project_id}/collaborators/{username}"
  9747. ],
  9748. update: ["PATCH /projects/{project_id}"],
  9749. updateCard: ["PATCH /projects/columns/cards/{card_id}"],
  9750. updateColumn: ["PATCH /projects/columns/{column_id}"]
  9751. },
  9752. pulls: {
  9753. checkIfMerged: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/merge"],
  9754. create: ["POST /repos/{owner}/{repo}/pulls"],
  9755. createReplyForReviewComment: [
  9756. "POST /repos/{owner}/{repo}/pulls/{pull_number}/comments/{comment_id}/replies"
  9757. ],
  9758. createReview: ["POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews"],
  9759. createReviewComment: [
  9760. "POST /repos/{owner}/{repo}/pulls/{pull_number}/comments"
  9761. ],
  9762. deletePendingReview: [
  9763. "DELETE /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}"
  9764. ],
  9765. deleteReviewComment: [
  9766. "DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}"
  9767. ],
  9768. dismissReview: [
  9769. "PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/dismissals"
  9770. ],
  9771. get: ["GET /repos/{owner}/{repo}/pulls/{pull_number}"],
  9772. getReview: [
  9773. "GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}"
  9774. ],
  9775. getReviewComment: ["GET /repos/{owner}/{repo}/pulls/comments/{comment_id}"],
  9776. list: ["GET /repos/{owner}/{repo}/pulls"],
  9777. listCommentsForReview: [
  9778. "GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments"
  9779. ],
  9780. listCommits: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/commits"],
  9781. listFiles: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/files"],
  9782. listRequestedReviewers: [
  9783. "GET /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers"
  9784. ],
  9785. listReviewComments: [
  9786. "GET /repos/{owner}/{repo}/pulls/{pull_number}/comments"
  9787. ],
  9788. listReviewCommentsForRepo: ["GET /repos/{owner}/{repo}/pulls/comments"],
  9789. listReviews: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews"],
  9790. merge: ["PUT /repos/{owner}/{repo}/pulls/{pull_number}/merge"],
  9791. removeRequestedReviewers: [
  9792. "DELETE /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers"
  9793. ],
  9794. requestReviewers: [
  9795. "POST /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers"
  9796. ],
  9797. submitReview: [
  9798. "POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/events"
  9799. ],
  9800. update: ["PATCH /repos/{owner}/{repo}/pulls/{pull_number}"],
  9801. updateBranch: [
  9802. "PUT /repos/{owner}/{repo}/pulls/{pull_number}/update-branch"
  9803. ],
  9804. updateReview: [
  9805. "PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}"
  9806. ],
  9807. updateReviewComment: [
  9808. "PATCH /repos/{owner}/{repo}/pulls/comments/{comment_id}"
  9809. ]
  9810. },
  9811. rateLimit: { get: ["GET /rate_limit"] },
  9812. reactions: {
  9813. createForCommitComment: [
  9814. "POST /repos/{owner}/{repo}/comments/{comment_id}/reactions"
  9815. ],
  9816. createForIssue: [
  9817. "POST /repos/{owner}/{repo}/issues/{issue_number}/reactions"
  9818. ],
  9819. createForIssueComment: [
  9820. "POST /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions"
  9821. ],
  9822. createForPullRequestReviewComment: [
  9823. "POST /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions"
  9824. ],
  9825. createForRelease: [
  9826. "POST /repos/{owner}/{repo}/releases/{release_id}/reactions"
  9827. ],
  9828. createForTeamDiscussionCommentInOrg: [
  9829. "POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions"
  9830. ],
  9831. createForTeamDiscussionInOrg: [
  9832. "POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions"
  9833. ],
  9834. deleteForCommitComment: [
  9835. "DELETE /repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id}"
  9836. ],
  9837. deleteForIssue: [
  9838. "DELETE /repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id}"
  9839. ],
  9840. deleteForIssueComment: [
  9841. "DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/{reaction_id}"
  9842. ],
  9843. deleteForPullRequestComment: [
  9844. "DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/{reaction_id}"
  9845. ],
  9846. deleteForRelease: [
  9847. "DELETE /repos/{owner}/{repo}/releases/{release_id}/reactions/{reaction_id}"
  9848. ],
  9849. deleteForTeamDiscussion: [
  9850. "DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/{reaction_id}"
  9851. ],
  9852. deleteForTeamDiscussionComment: [
  9853. "DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/{reaction_id}"
  9854. ],
  9855. listForCommitComment: [
  9856. "GET /repos/{owner}/{repo}/comments/{comment_id}/reactions"
  9857. ],
  9858. listForIssue: ["GET /repos/{owner}/{repo}/issues/{issue_number}/reactions"],
  9859. listForIssueComment: [
  9860. "GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions"
  9861. ],
  9862. listForPullRequestReviewComment: [
  9863. "GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions"
  9864. ],
  9865. listForRelease: [
  9866. "GET /repos/{owner}/{repo}/releases/{release_id}/reactions"
  9867. ],
  9868. listForTeamDiscussionCommentInOrg: [
  9869. "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions"
  9870. ],
  9871. listForTeamDiscussionInOrg: [
  9872. "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions"
  9873. ]
  9874. },
  9875. repos: {
  9876. acceptInvitation: [
  9877. "PATCH /user/repository_invitations/{invitation_id}",
  9878. {},
  9879. { renamed: ["repos", "acceptInvitationForAuthenticatedUser"] }
  9880. ],
  9881. acceptInvitationForAuthenticatedUser: [
  9882. "PATCH /user/repository_invitations/{invitation_id}"
  9883. ],
  9884. addAppAccessRestrictions: [
  9885. "POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps",
  9886. {},
  9887. { mapToData: "apps" }
  9888. ],
  9889. addCollaborator: ["PUT /repos/{owner}/{repo}/collaborators/{username}"],
  9890. addStatusCheckContexts: [
  9891. "POST /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts",
  9892. {},
  9893. { mapToData: "contexts" }
  9894. ],
  9895. addTeamAccessRestrictions: [
  9896. "POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams",
  9897. {},
  9898. { mapToData: "teams" }
  9899. ],
  9900. addUserAccessRestrictions: [
  9901. "POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users",
  9902. {},
  9903. { mapToData: "users" }
  9904. ],
  9905. cancelPagesDeployment: [
  9906. "POST /repos/{owner}/{repo}/pages/deployments/{pages_deployment_id}/cancel"
  9907. ],
  9908. checkAutomatedSecurityFixes: [
  9909. "GET /repos/{owner}/{repo}/automated-security-fixes"
  9910. ],
  9911. checkCollaborator: ["GET /repos/{owner}/{repo}/collaborators/{username}"],
  9912. checkVulnerabilityAlerts: [
  9913. "GET /repos/{owner}/{repo}/vulnerability-alerts"
  9914. ],
  9915. codeownersErrors: ["GET /repos/{owner}/{repo}/codeowners/errors"],
  9916. compareCommits: ["GET /repos/{owner}/{repo}/compare/{base}...{head}"],
  9917. compareCommitsWithBasehead: [
  9918. "GET /repos/{owner}/{repo}/compare/{basehead}"
  9919. ],
  9920. createAutolink: ["POST /repos/{owner}/{repo}/autolinks"],
  9921. createCommitComment: [
  9922. "POST /repos/{owner}/{repo}/commits/{commit_sha}/comments"
  9923. ],
  9924. createCommitSignatureProtection: [
  9925. "POST /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures"
  9926. ],
  9927. createCommitStatus: ["POST /repos/{owner}/{repo}/statuses/{sha}"],
  9928. createDeployKey: ["POST /repos/{owner}/{repo}/keys"],
  9929. createDeployment: ["POST /repos/{owner}/{repo}/deployments"],
  9930. createDeploymentBranchPolicy: [
  9931. "POST /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies"
  9932. ],
  9933. createDeploymentProtectionRule: [
  9934. "POST /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules"
  9935. ],
  9936. createDeploymentStatus: [
  9937. "POST /repos/{owner}/{repo}/deployments/{deployment_id}/statuses"
  9938. ],
  9939. createDispatchEvent: ["POST /repos/{owner}/{repo}/dispatches"],
  9940. createForAuthenticatedUser: ["POST /user/repos"],
  9941. createFork: ["POST /repos/{owner}/{repo}/forks"],
  9942. createInOrg: ["POST /orgs/{org}/repos"],
  9943. createOrUpdateCustomPropertiesValues: [
  9944. "PATCH /repos/{owner}/{repo}/properties/values"
  9945. ],
  9946. createOrUpdateEnvironment: [
  9947. "PUT /repos/{owner}/{repo}/environments/{environment_name}"
  9948. ],
  9949. createOrUpdateFileContents: ["PUT /repos/{owner}/{repo}/contents/{path}"],
  9950. createOrgRuleset: ["POST /orgs/{org}/rulesets"],
  9951. createPagesDeployment: ["POST /repos/{owner}/{repo}/pages/deployments"],
  9952. createPagesSite: ["POST /repos/{owner}/{repo}/pages"],
  9953. createRelease: ["POST /repos/{owner}/{repo}/releases"],
  9954. createRepoRuleset: ["POST /repos/{owner}/{repo}/rulesets"],
  9955. createTagProtection: ["POST /repos/{owner}/{repo}/tags/protection"],
  9956. createUsingTemplate: [
  9957. "POST /repos/{template_owner}/{template_repo}/generate"
  9958. ],
  9959. createWebhook: ["POST /repos/{owner}/{repo}/hooks"],
  9960. declineInvitation: [
  9961. "DELETE /user/repository_invitations/{invitation_id}",
  9962. {},
  9963. { renamed: ["repos", "declineInvitationForAuthenticatedUser"] }
  9964. ],
  9965. declineInvitationForAuthenticatedUser: [
  9966. "DELETE /user/repository_invitations/{invitation_id}"
  9967. ],
  9968. delete: ["DELETE /repos/{owner}/{repo}"],
  9969. deleteAccessRestrictions: [
  9970. "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions"
  9971. ],
  9972. deleteAdminBranchProtection: [
  9973. "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins"
  9974. ],
  9975. deleteAnEnvironment: [
  9976. "DELETE /repos/{owner}/{repo}/environments/{environment_name}"
  9977. ],
  9978. deleteAutolink: ["DELETE /repos/{owner}/{repo}/autolinks/{autolink_id}"],
  9979. deleteBranchProtection: [
  9980. "DELETE /repos/{owner}/{repo}/branches/{branch}/protection"
  9981. ],
  9982. deleteCommitComment: ["DELETE /repos/{owner}/{repo}/comments/{comment_id}"],
  9983. deleteCommitSignatureProtection: [
  9984. "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures"
  9985. ],
  9986. deleteDeployKey: ["DELETE /repos/{owner}/{repo}/keys/{key_id}"],
  9987. deleteDeployment: [
  9988. "DELETE /repos/{owner}/{repo}/deployments/{deployment_id}"
  9989. ],
  9990. deleteDeploymentBranchPolicy: [
  9991. "DELETE /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}"
  9992. ],
  9993. deleteFile: ["DELETE /repos/{owner}/{repo}/contents/{path}"],
  9994. deleteInvitation: [
  9995. "DELETE /repos/{owner}/{repo}/invitations/{invitation_id}"
  9996. ],
  9997. deleteOrgRuleset: ["DELETE /orgs/{org}/rulesets/{ruleset_id}"],
  9998. deletePagesSite: ["DELETE /repos/{owner}/{repo}/pages"],
  9999. deletePullRequestReviewProtection: [
  10000. "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews"
  10001. ],
  10002. deleteRelease: ["DELETE /repos/{owner}/{repo}/releases/{release_id}"],
  10003. deleteReleaseAsset: [
  10004. "DELETE /repos/{owner}/{repo}/releases/assets/{asset_id}"
  10005. ],
  10006. deleteRepoRuleset: ["DELETE /repos/{owner}/{repo}/rulesets/{ruleset_id}"],
  10007. deleteTagProtection: [
  10008. "DELETE /repos/{owner}/{repo}/tags/protection/{tag_protection_id}"
  10009. ],
  10010. deleteWebhook: ["DELETE /repos/{owner}/{repo}/hooks/{hook_id}"],
  10011. disableAutomatedSecurityFixes: [
  10012. "DELETE /repos/{owner}/{repo}/automated-security-fixes"
  10013. ],
  10014. disableDeploymentProtectionRule: [
  10015. "DELETE /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/{protection_rule_id}"
  10016. ],
  10017. disablePrivateVulnerabilityReporting: [
  10018. "DELETE /repos/{owner}/{repo}/private-vulnerability-reporting"
  10019. ],
  10020. disableVulnerabilityAlerts: [
  10021. "DELETE /repos/{owner}/{repo}/vulnerability-alerts"
  10022. ],
  10023. downloadArchive: [
  10024. "GET /repos/{owner}/{repo}/zipball/{ref}",
  10025. {},
  10026. { renamed: ["repos", "downloadZipballArchive"] }
  10027. ],
  10028. downloadTarballArchive: ["GET /repos/{owner}/{repo}/tarball/{ref}"],
  10029. downloadZipballArchive: ["GET /repos/{owner}/{repo}/zipball/{ref}"],
  10030. enableAutomatedSecurityFixes: [
  10031. "PUT /repos/{owner}/{repo}/automated-security-fixes"
  10032. ],
  10033. enablePrivateVulnerabilityReporting: [
  10034. "PUT /repos/{owner}/{repo}/private-vulnerability-reporting"
  10035. ],
  10036. enableVulnerabilityAlerts: [
  10037. "PUT /repos/{owner}/{repo}/vulnerability-alerts"
  10038. ],
  10039. generateReleaseNotes: [
  10040. "POST /repos/{owner}/{repo}/releases/generate-notes"
  10041. ],
  10042. get: ["GET /repos/{owner}/{repo}"],
  10043. getAccessRestrictions: [
  10044. "GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions"
  10045. ],
  10046. getAdminBranchProtection: [
  10047. "GET /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins"
  10048. ],
  10049. getAllDeploymentProtectionRules: [
  10050. "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules"
  10051. ],
  10052. getAllEnvironments: ["GET /repos/{owner}/{repo}/environments"],
  10053. getAllStatusCheckContexts: [
  10054. "GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts"
  10055. ],
  10056. getAllTopics: ["GET /repos/{owner}/{repo}/topics"],
  10057. getAppsWithAccessToProtectedBranch: [
  10058. "GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps"
  10059. ],
  10060. getAutolink: ["GET /repos/{owner}/{repo}/autolinks/{autolink_id}"],
  10061. getBranch: ["GET /repos/{owner}/{repo}/branches/{branch}"],
  10062. getBranchProtection: [
  10063. "GET /repos/{owner}/{repo}/branches/{branch}/protection"
  10064. ],
  10065. getBranchRules: ["GET /repos/{owner}/{repo}/rules/branches/{branch}"],
  10066. getClones: ["GET /repos/{owner}/{repo}/traffic/clones"],
  10067. getCodeFrequencyStats: ["GET /repos/{owner}/{repo}/stats/code_frequency"],
  10068. getCollaboratorPermissionLevel: [
  10069. "GET /repos/{owner}/{repo}/collaborators/{username}/permission"
  10070. ],
  10071. getCombinedStatusForRef: ["GET /repos/{owner}/{repo}/commits/{ref}/status"],
  10072. getCommit: ["GET /repos/{owner}/{repo}/commits/{ref}"],
  10073. getCommitActivityStats: ["GET /repos/{owner}/{repo}/stats/commit_activity"],
  10074. getCommitComment: ["GET /repos/{owner}/{repo}/comments/{comment_id}"],
  10075. getCommitSignatureProtection: [
  10076. "GET /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures"
  10077. ],
  10078. getCommunityProfileMetrics: ["GET /repos/{owner}/{repo}/community/profile"],
  10079. getContent: ["GET /repos/{owner}/{repo}/contents/{path}"],
  10080. getContributorsStats: ["GET /repos/{owner}/{repo}/stats/contributors"],
  10081. getCustomDeploymentProtectionRule: [
  10082. "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/{protection_rule_id}"
  10083. ],
  10084. getCustomPropertiesValues: ["GET /repos/{owner}/{repo}/properties/values"],
  10085. getDeployKey: ["GET /repos/{owner}/{repo}/keys/{key_id}"],
  10086. getDeployment: ["GET /repos/{owner}/{repo}/deployments/{deployment_id}"],
  10087. getDeploymentBranchPolicy: [
  10088. "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}"
  10089. ],
  10090. getDeploymentStatus: [
  10091. "GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses/{status_id}"
  10092. ],
  10093. getEnvironment: [
  10094. "GET /repos/{owner}/{repo}/environments/{environment_name}"
  10095. ],
  10096. getLatestPagesBuild: ["GET /repos/{owner}/{repo}/pages/builds/latest"],
  10097. getLatestRelease: ["GET /repos/{owner}/{repo}/releases/latest"],
  10098. getOrgRuleSuite: ["GET /orgs/{org}/rulesets/rule-suites/{rule_suite_id}"],
  10099. getOrgRuleSuites: ["GET /orgs/{org}/rulesets/rule-suites"],
  10100. getOrgRuleset: ["GET /orgs/{org}/rulesets/{ruleset_id}"],
  10101. getOrgRulesets: ["GET /orgs/{org}/rulesets"],
  10102. getPages: ["GET /repos/{owner}/{repo}/pages"],
  10103. getPagesBuild: ["GET /repos/{owner}/{repo}/pages/builds/{build_id}"],
  10104. getPagesDeployment: [
  10105. "GET /repos/{owner}/{repo}/pages/deployments/{pages_deployment_id}"
  10106. ],
  10107. getPagesHealthCheck: ["GET /repos/{owner}/{repo}/pages/health"],
  10108. getParticipationStats: ["GET /repos/{owner}/{repo}/stats/participation"],
  10109. getPullRequestReviewProtection: [
  10110. "GET /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews"
  10111. ],
  10112. getPunchCardStats: ["GET /repos/{owner}/{repo}/stats/punch_card"],
  10113. getReadme: ["GET /repos/{owner}/{repo}/readme"],
  10114. getReadmeInDirectory: ["GET /repos/{owner}/{repo}/readme/{dir}"],
  10115. getRelease: ["GET /repos/{owner}/{repo}/releases/{release_id}"],
  10116. getReleaseAsset: ["GET /repos/{owner}/{repo}/releases/assets/{asset_id}"],
  10117. getReleaseByTag: ["GET /repos/{owner}/{repo}/releases/tags/{tag}"],
  10118. getRepoRuleSuite: [
  10119. "GET /repos/{owner}/{repo}/rulesets/rule-suites/{rule_suite_id}"
  10120. ],
  10121. getRepoRuleSuites: ["GET /repos/{owner}/{repo}/rulesets/rule-suites"],
  10122. getRepoRuleset: ["GET /repos/{owner}/{repo}/rulesets/{ruleset_id}"],
  10123. getRepoRulesets: ["GET /repos/{owner}/{repo}/rulesets"],
  10124. getStatusChecksProtection: [
  10125. "GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks"
  10126. ],
  10127. getTeamsWithAccessToProtectedBranch: [
  10128. "GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams"
  10129. ],
  10130. getTopPaths: ["GET /repos/{owner}/{repo}/traffic/popular/paths"],
  10131. getTopReferrers: ["GET /repos/{owner}/{repo}/traffic/popular/referrers"],
  10132. getUsersWithAccessToProtectedBranch: [
  10133. "GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users"
  10134. ],
  10135. getViews: ["GET /repos/{owner}/{repo}/traffic/views"],
  10136. getWebhook: ["GET /repos/{owner}/{repo}/hooks/{hook_id}"],
  10137. getWebhookConfigForRepo: [
  10138. "GET /repos/{owner}/{repo}/hooks/{hook_id}/config"
  10139. ],
  10140. getWebhookDelivery: [
  10141. "GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}"
  10142. ],
  10143. listActivities: ["GET /repos/{owner}/{repo}/activity"],
  10144. listAutolinks: ["GET /repos/{owner}/{repo}/autolinks"],
  10145. listBranches: ["GET /repos/{owner}/{repo}/branches"],
  10146. listBranchesForHeadCommit: [
  10147. "GET /repos/{owner}/{repo}/commits/{commit_sha}/branches-where-head"
  10148. ],
  10149. listCollaborators: ["GET /repos/{owner}/{repo}/collaborators"],
  10150. listCommentsForCommit: [
  10151. "GET /repos/{owner}/{repo}/commits/{commit_sha}/comments"
  10152. ],
  10153. listCommitCommentsForRepo: ["GET /repos/{owner}/{repo}/comments"],
  10154. listCommitStatusesForRef: [
  10155. "GET /repos/{owner}/{repo}/commits/{ref}/statuses"
  10156. ],
  10157. listCommits: ["GET /repos/{owner}/{repo}/commits"],
  10158. listContributors: ["GET /repos/{owner}/{repo}/contributors"],
  10159. listCustomDeploymentRuleIntegrations: [
  10160. "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/apps"
  10161. ],
  10162. listDeployKeys: ["GET /repos/{owner}/{repo}/keys"],
  10163. listDeploymentBranchPolicies: [
  10164. "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies"
  10165. ],
  10166. listDeploymentStatuses: [
  10167. "GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses"
  10168. ],
  10169. listDeployments: ["GET /repos/{owner}/{repo}/deployments"],
  10170. listForAuthenticatedUser: ["GET /user/repos"],
  10171. listForOrg: ["GET /orgs/{org}/repos"],
  10172. listForUser: ["GET /users/{username}/repos"],
  10173. listForks: ["GET /repos/{owner}/{repo}/forks"],
  10174. listInvitations: ["GET /repos/{owner}/{repo}/invitations"],
  10175. listInvitationsForAuthenticatedUser: ["GET /user/repository_invitations"],
  10176. listLanguages: ["GET /repos/{owner}/{repo}/languages"],
  10177. listPagesBuilds: ["GET /repos/{owner}/{repo}/pages/builds"],
  10178. listPublic: ["GET /repositories"],
  10179. listPullRequestsAssociatedWithCommit: [
  10180. "GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls"
  10181. ],
  10182. listReleaseAssets: [
  10183. "GET /repos/{owner}/{repo}/releases/{release_id}/assets"
  10184. ],
  10185. listReleases: ["GET /repos/{owner}/{repo}/releases"],
  10186. listTagProtection: ["GET /repos/{owner}/{repo}/tags/protection"],
  10187. listTags: ["GET /repos/{owner}/{repo}/tags"],
  10188. listTeams: ["GET /repos/{owner}/{repo}/teams"],
  10189. listWebhookDeliveries: [
  10190. "GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries"
  10191. ],
  10192. listWebhooks: ["GET /repos/{owner}/{repo}/hooks"],
  10193. merge: ["POST /repos/{owner}/{repo}/merges"],
  10194. mergeUpstream: ["POST /repos/{owner}/{repo}/merge-upstream"],
  10195. pingWebhook: ["POST /repos/{owner}/{repo}/hooks/{hook_id}/pings"],
  10196. redeliverWebhookDelivery: [
  10197. "POST /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}/attempts"
  10198. ],
  10199. removeAppAccessRestrictions: [
  10200. "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps",
  10201. {},
  10202. { mapToData: "apps" }
  10203. ],
  10204. removeCollaborator: [
  10205. "DELETE /repos/{owner}/{repo}/collaborators/{username}"
  10206. ],
  10207. removeStatusCheckContexts: [
  10208. "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts",
  10209. {},
  10210. { mapToData: "contexts" }
  10211. ],
  10212. removeStatusCheckProtection: [
  10213. "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks"
  10214. ],
  10215. removeTeamAccessRestrictions: [
  10216. "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams",
  10217. {},
  10218. { mapToData: "teams" }
  10219. ],
  10220. removeUserAccessRestrictions: [
  10221. "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users",
  10222. {},
  10223. { mapToData: "users" }
  10224. ],
  10225. renameBranch: ["POST /repos/{owner}/{repo}/branches/{branch}/rename"],
  10226. replaceAllTopics: ["PUT /repos/{owner}/{repo}/topics"],
  10227. requestPagesBuild: ["POST /repos/{owner}/{repo}/pages/builds"],
  10228. setAdminBranchProtection: [
  10229. "POST /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins"
  10230. ],
  10231. setAppAccessRestrictions: [
  10232. "PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps",
  10233. {},
  10234. { mapToData: "apps" }
  10235. ],
  10236. setStatusCheckContexts: [
  10237. "PUT /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts",
  10238. {},
  10239. { mapToData: "contexts" }
  10240. ],
  10241. setTeamAccessRestrictions: [
  10242. "PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams",
  10243. {},
  10244. { mapToData: "teams" }
  10245. ],
  10246. setUserAccessRestrictions: [
  10247. "PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users",
  10248. {},
  10249. { mapToData: "users" }
  10250. ],
  10251. testPushWebhook: ["POST /repos/{owner}/{repo}/hooks/{hook_id}/tests"],
  10252. transfer: ["POST /repos/{owner}/{repo}/transfer"],
  10253. update: ["PATCH /repos/{owner}/{repo}"],
  10254. updateBranchProtection: [
  10255. "PUT /repos/{owner}/{repo}/branches/{branch}/protection"
  10256. ],
  10257. updateCommitComment: ["PATCH /repos/{owner}/{repo}/comments/{comment_id}"],
  10258. updateDeploymentBranchPolicy: [
  10259. "PUT /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}"
  10260. ],
  10261. updateInformationAboutPagesSite: ["PUT /repos/{owner}/{repo}/pages"],
  10262. updateInvitation: [
  10263. "PATCH /repos/{owner}/{repo}/invitations/{invitation_id}"
  10264. ],
  10265. updateOrgRuleset: ["PUT /orgs/{org}/rulesets/{ruleset_id}"],
  10266. updatePullRequestReviewProtection: [
  10267. "PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews"
  10268. ],
  10269. updateRelease: ["PATCH /repos/{owner}/{repo}/releases/{release_id}"],
  10270. updateReleaseAsset: [
  10271. "PATCH /repos/{owner}/{repo}/releases/assets/{asset_id}"
  10272. ],
  10273. updateRepoRuleset: ["PUT /repos/{owner}/{repo}/rulesets/{ruleset_id}"],
  10274. updateStatusCheckPotection: [
  10275. "PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks",
  10276. {},
  10277. { renamed: ["repos", "updateStatusCheckProtection"] }
  10278. ],
  10279. updateStatusCheckProtection: [
  10280. "PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks"
  10281. ],
  10282. updateWebhook: ["PATCH /repos/{owner}/{repo}/hooks/{hook_id}"],
  10283. updateWebhookConfigForRepo: [
  10284. "PATCH /repos/{owner}/{repo}/hooks/{hook_id}/config"
  10285. ],
  10286. uploadReleaseAsset: [
  10287. "POST /repos/{owner}/{repo}/releases/{release_id}/assets{?name,label}",
  10288. { baseUrl: "https://uploads.github.com" }
  10289. ]
  10290. },
  10291. search: {
  10292. code: ["GET /search/code"],
  10293. commits: ["GET /search/commits"],
  10294. issuesAndPullRequests: ["GET /search/issues"],
  10295. labels: ["GET /search/labels"],
  10296. repos: ["GET /search/repositories"],
  10297. topics: ["GET /search/topics"],
  10298. users: ["GET /search/users"]
  10299. },
  10300. secretScanning: {
  10301. getAlert: [
  10302. "GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}"
  10303. ],
  10304. listAlertsForEnterprise: [
  10305. "GET /enterprises/{enterprise}/secret-scanning/alerts"
  10306. ],
  10307. listAlertsForOrg: ["GET /orgs/{org}/secret-scanning/alerts"],
  10308. listAlertsForRepo: ["GET /repos/{owner}/{repo}/secret-scanning/alerts"],
  10309. listLocationsForAlert: [
  10310. "GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations"
  10311. ],
  10312. updateAlert: [
  10313. "PATCH /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}"
  10314. ]
  10315. },
  10316. securityAdvisories: {
  10317. createFork: [
  10318. "POST /repos/{owner}/{repo}/security-advisories/{ghsa_id}/forks"
  10319. ],
  10320. createPrivateVulnerabilityReport: [
  10321. "POST /repos/{owner}/{repo}/security-advisories/reports"
  10322. ],
  10323. createRepositoryAdvisory: [
  10324. "POST /repos/{owner}/{repo}/security-advisories"
  10325. ],
  10326. createRepositoryAdvisoryCveRequest: [
  10327. "POST /repos/{owner}/{repo}/security-advisories/{ghsa_id}/cve"
  10328. ],
  10329. getGlobalAdvisory: ["GET /advisories/{ghsa_id}"],
  10330. getRepositoryAdvisory: [
  10331. "GET /repos/{owner}/{repo}/security-advisories/{ghsa_id}"
  10332. ],
  10333. listGlobalAdvisories: ["GET /advisories"],
  10334. listOrgRepositoryAdvisories: ["GET /orgs/{org}/security-advisories"],
  10335. listRepositoryAdvisories: ["GET /repos/{owner}/{repo}/security-advisories"],
  10336. updateRepositoryAdvisory: [
  10337. "PATCH /repos/{owner}/{repo}/security-advisories/{ghsa_id}"
  10338. ]
  10339. },
  10340. teams: {
  10341. addOrUpdateMembershipForUserInOrg: [
  10342. "PUT /orgs/{org}/teams/{team_slug}/memberships/{username}"
  10343. ],
  10344. addOrUpdateProjectPermissionsInOrg: [
  10345. "PUT /orgs/{org}/teams/{team_slug}/projects/{project_id}"
  10346. ],
  10347. addOrUpdateRepoPermissionsInOrg: [
  10348. "PUT /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"
  10349. ],
  10350. checkPermissionsForProjectInOrg: [
  10351. "GET /orgs/{org}/teams/{team_slug}/projects/{project_id}"
  10352. ],
  10353. checkPermissionsForRepoInOrg: [
  10354. "GET /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"
  10355. ],
  10356. create: ["POST /orgs/{org}/teams"],
  10357. createDiscussionCommentInOrg: [
  10358. "POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments"
  10359. ],
  10360. createDiscussionInOrg: ["POST /orgs/{org}/teams/{team_slug}/discussions"],
  10361. deleteDiscussionCommentInOrg: [
  10362. "DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}"
  10363. ],
  10364. deleteDiscussionInOrg: [
  10365. "DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}"
  10366. ],
  10367. deleteInOrg: ["DELETE /orgs/{org}/teams/{team_slug}"],
  10368. getByName: ["GET /orgs/{org}/teams/{team_slug}"],
  10369. getDiscussionCommentInOrg: [
  10370. "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}"
  10371. ],
  10372. getDiscussionInOrg: [
  10373. "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}"
  10374. ],
  10375. getMembershipForUserInOrg: [
  10376. "GET /orgs/{org}/teams/{team_slug}/memberships/{username}"
  10377. ],
  10378. list: ["GET /orgs/{org}/teams"],
  10379. listChildInOrg: ["GET /orgs/{org}/teams/{team_slug}/teams"],
  10380. listDiscussionCommentsInOrg: [
  10381. "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments"
  10382. ],
  10383. listDiscussionsInOrg: ["GET /orgs/{org}/teams/{team_slug}/discussions"],
  10384. listForAuthenticatedUser: ["GET /user/teams"],
  10385. listMembersInOrg: ["GET /orgs/{org}/teams/{team_slug}/members"],
  10386. listPendingInvitationsInOrg: [
  10387. "GET /orgs/{org}/teams/{team_slug}/invitations"
  10388. ],
  10389. listProjectsInOrg: ["GET /orgs/{org}/teams/{team_slug}/projects"],
  10390. listReposInOrg: ["GET /orgs/{org}/teams/{team_slug}/repos"],
  10391. removeMembershipForUserInOrg: [
  10392. "DELETE /orgs/{org}/teams/{team_slug}/memberships/{username}"
  10393. ],
  10394. removeProjectInOrg: [
  10395. "DELETE /orgs/{org}/teams/{team_slug}/projects/{project_id}"
  10396. ],
  10397. removeRepoInOrg: [
  10398. "DELETE /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"
  10399. ],
  10400. updateDiscussionCommentInOrg: [
  10401. "PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}"
  10402. ],
  10403. updateDiscussionInOrg: [
  10404. "PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}"
  10405. ],
  10406. updateInOrg: ["PATCH /orgs/{org}/teams/{team_slug}"]
  10407. },
  10408. users: {
  10409. addEmailForAuthenticated: [
  10410. "POST /user/emails",
  10411. {},
  10412. { renamed: ["users", "addEmailForAuthenticatedUser"] }
  10413. ],
  10414. addEmailForAuthenticatedUser: ["POST /user/emails"],
  10415. addSocialAccountForAuthenticatedUser: ["POST /user/social_accounts"],
  10416. block: ["PUT /user/blocks/{username}"],
  10417. checkBlocked: ["GET /user/blocks/{username}"],
  10418. checkFollowingForUser: ["GET /users/{username}/following/{target_user}"],
  10419. checkPersonIsFollowedByAuthenticated: ["GET /user/following/{username}"],
  10420. createGpgKeyForAuthenticated: [
  10421. "POST /user/gpg_keys",
  10422. {},
  10423. { renamed: ["users", "createGpgKeyForAuthenticatedUser"] }
  10424. ],
  10425. createGpgKeyForAuthenticatedUser: ["POST /user/gpg_keys"],
  10426. createPublicSshKeyForAuthenticated: [
  10427. "POST /user/keys",
  10428. {},
  10429. { renamed: ["users", "createPublicSshKeyForAuthenticatedUser"] }
  10430. ],
  10431. createPublicSshKeyForAuthenticatedUser: ["POST /user/keys"],
  10432. createSshSigningKeyForAuthenticatedUser: ["POST /user/ssh_signing_keys"],
  10433. deleteEmailForAuthenticated: [
  10434. "DELETE /user/emails",
  10435. {},
  10436. { renamed: ["users", "deleteEmailForAuthenticatedUser"] }
  10437. ],
  10438. deleteEmailForAuthenticatedUser: ["DELETE /user/emails"],
  10439. deleteGpgKeyForAuthenticated: [
  10440. "DELETE /user/gpg_keys/{gpg_key_id}",
  10441. {},
  10442. { renamed: ["users", "deleteGpgKeyForAuthenticatedUser"] }
  10443. ],
  10444. deleteGpgKeyForAuthenticatedUser: ["DELETE /user/gpg_keys/{gpg_key_id}"],
  10445. deletePublicSshKeyForAuthenticated: [
  10446. "DELETE /user/keys/{key_id}",
  10447. {},
  10448. { renamed: ["users", "deletePublicSshKeyForAuthenticatedUser"] }
  10449. ],
  10450. deletePublicSshKeyForAuthenticatedUser: ["DELETE /user/keys/{key_id}"],
  10451. deleteSocialAccountForAuthenticatedUser: ["DELETE /user/social_accounts"],
  10452. deleteSshSigningKeyForAuthenticatedUser: [
  10453. "DELETE /user/ssh_signing_keys/{ssh_signing_key_id}"
  10454. ],
  10455. follow: ["PUT /user/following/{username}"],
  10456. getAuthenticated: ["GET /user"],
  10457. getByUsername: ["GET /users/{username}"],
  10458. getContextForUser: ["GET /users/{username}/hovercard"],
  10459. getGpgKeyForAuthenticated: [
  10460. "GET /user/gpg_keys/{gpg_key_id}",
  10461. {},
  10462. { renamed: ["users", "getGpgKeyForAuthenticatedUser"] }
  10463. ],
  10464. getGpgKeyForAuthenticatedUser: ["GET /user/gpg_keys/{gpg_key_id}"],
  10465. getPublicSshKeyForAuthenticated: [
  10466. "GET /user/keys/{key_id}",
  10467. {},
  10468. { renamed: ["users", "getPublicSshKeyForAuthenticatedUser"] }
  10469. ],
  10470. getPublicSshKeyForAuthenticatedUser: ["GET /user/keys/{key_id}"],
  10471. getSshSigningKeyForAuthenticatedUser: [
  10472. "GET /user/ssh_signing_keys/{ssh_signing_key_id}"
  10473. ],
  10474. list: ["GET /users"],
  10475. listBlockedByAuthenticated: [
  10476. "GET /user/blocks",
  10477. {},
  10478. { renamed: ["users", "listBlockedByAuthenticatedUser"] }
  10479. ],
  10480. listBlockedByAuthenticatedUser: ["GET /user/blocks"],
  10481. listEmailsForAuthenticated: [
  10482. "GET /user/emails",
  10483. {},
  10484. { renamed: ["users", "listEmailsForAuthenticatedUser"] }
  10485. ],
  10486. listEmailsForAuthenticatedUser: ["GET /user/emails"],
  10487. listFollowedByAuthenticated: [
  10488. "GET /user/following",
  10489. {},
  10490. { renamed: ["users", "listFollowedByAuthenticatedUser"] }
  10491. ],
  10492. listFollowedByAuthenticatedUser: ["GET /user/following"],
  10493. listFollowersForAuthenticatedUser: ["GET /user/followers"],
  10494. listFollowersForUser: ["GET /users/{username}/followers"],
  10495. listFollowingForUser: ["GET /users/{username}/following"],
  10496. listGpgKeysForAuthenticated: [
  10497. "GET /user/gpg_keys",
  10498. {},
  10499. { renamed: ["users", "listGpgKeysForAuthenticatedUser"] }
  10500. ],
  10501. listGpgKeysForAuthenticatedUser: ["GET /user/gpg_keys"],
  10502. listGpgKeysForUser: ["GET /users/{username}/gpg_keys"],
  10503. listPublicEmailsForAuthenticated: [
  10504. "GET /user/public_emails",
  10505. {},
  10506. { renamed: ["users", "listPublicEmailsForAuthenticatedUser"] }
  10507. ],
  10508. listPublicEmailsForAuthenticatedUser: ["GET /user/public_emails"],
  10509. listPublicKeysForUser: ["GET /users/{username}/keys"],
  10510. listPublicSshKeysForAuthenticated: [
  10511. "GET /user/keys",
  10512. {},
  10513. { renamed: ["users", "listPublicSshKeysForAuthenticatedUser"] }
  10514. ],
  10515. listPublicSshKeysForAuthenticatedUser: ["GET /user/keys"],
  10516. listSocialAccountsForAuthenticatedUser: ["GET /user/social_accounts"],
  10517. listSocialAccountsForUser: ["GET /users/{username}/social_accounts"],
  10518. listSshSigningKeysForAuthenticatedUser: ["GET /user/ssh_signing_keys"],
  10519. listSshSigningKeysForUser: ["GET /users/{username}/ssh_signing_keys"],
  10520. setPrimaryEmailVisibilityForAuthenticated: [
  10521. "PATCH /user/email/visibility",
  10522. {},
  10523. { renamed: ["users", "setPrimaryEmailVisibilityForAuthenticatedUser"] }
  10524. ],
  10525. setPrimaryEmailVisibilityForAuthenticatedUser: [
  10526. "PATCH /user/email/visibility"
  10527. ],
  10528. unblock: ["DELETE /user/blocks/{username}"],
  10529. unfollow: ["DELETE /user/following/{username}"],
  10530. updateAuthenticated: ["PATCH /user"]
  10531. }
  10532. };
  10533. var endpoints_default = Endpoints;
  10534. // pkg/dist-src/endpoints-to-methods.js
  10535. var endpointMethodsMap = /* @__PURE__ */ new Map();
  10536. for (const [scope, endpoints] of Object.entries(endpoints_default)) {
  10537. for (const [methodName, endpoint] of Object.entries(endpoints)) {
  10538. const [route, defaults, decorations] = endpoint;
  10539. const [method, url] = route.split(/ /);
  10540. const endpointDefaults = Object.assign(
  10541. {
  10542. method,
  10543. url
  10544. },
  10545. defaults
  10546. );
  10547. if (!endpointMethodsMap.has(scope)) {
  10548. endpointMethodsMap.set(scope, /* @__PURE__ */ new Map());
  10549. }
  10550. endpointMethodsMap.get(scope).set(methodName, {
  10551. scope,
  10552. methodName,
  10553. endpointDefaults,
  10554. decorations
  10555. });
  10556. }
  10557. }
  10558. var handler = {
  10559. has({ scope }, methodName) {
  10560. return endpointMethodsMap.get(scope).has(methodName);
  10561. },
  10562. getOwnPropertyDescriptor(target, methodName) {
  10563. return {
  10564. value: this.get(target, methodName),
  10565. // ensures method is in the cache
  10566. configurable: true,
  10567. writable: true,
  10568. enumerable: true
  10569. };
  10570. },
  10571. defineProperty(target, methodName, descriptor) {
  10572. Object.defineProperty(target.cache, methodName, descriptor);
  10573. return true;
  10574. },
  10575. deleteProperty(target, methodName) {
  10576. delete target.cache[methodName];
  10577. return true;
  10578. },
  10579. ownKeys({ scope }) {
  10580. return [...endpointMethodsMap.get(scope).keys()];
  10581. },
  10582. set(target, methodName, value) {
  10583. return target.cache[methodName] = value;
  10584. },
  10585. get({ octokit, scope, cache }, methodName) {
  10586. if (cache[methodName]) {
  10587. return cache[methodName];
  10588. }
  10589. const method = endpointMethodsMap.get(scope).get(methodName);
  10590. if (!method) {
  10591. return void 0;
  10592. }
  10593. const { endpointDefaults, decorations } = method;
  10594. if (decorations) {
  10595. cache[methodName] = decorate(
  10596. octokit,
  10597. scope,
  10598. methodName,
  10599. endpointDefaults,
  10600. decorations
  10601. );
  10602. } else {
  10603. cache[methodName] = octokit.request.defaults(endpointDefaults);
  10604. }
  10605. return cache[methodName];
  10606. }
  10607. };
  10608. function endpointsToMethods(octokit) {
  10609. const newMethods = {};
  10610. for (const scope of endpointMethodsMap.keys()) {
  10611. newMethods[scope] = new Proxy({ octokit, scope, cache: {} }, handler);
  10612. }
  10613. return newMethods;
  10614. }
  10615. function decorate(octokit, scope, methodName, defaults, decorations) {
  10616. const requestWithDefaults = octokit.request.defaults(defaults);
  10617. function withDecorations(...args) {
  10618. let options = requestWithDefaults.endpoint.merge(...args);
  10619. if (decorations.mapToData) {
  10620. options = Object.assign({}, options, {
  10621. data: options[decorations.mapToData],
  10622. [decorations.mapToData]: void 0
  10623. });
  10624. return requestWithDefaults(options);
  10625. }
  10626. if (decorations.renamed) {
  10627. const [newScope, newMethodName] = decorations.renamed;
  10628. octokit.log.warn(
  10629. `octokit.${scope}.${methodName}() has been renamed to octokit.${newScope}.${newMethodName}()`
  10630. );
  10631. }
  10632. if (decorations.deprecated) {
  10633. octokit.log.warn(decorations.deprecated);
  10634. }
  10635. if (decorations.renamedParameters) {
  10636. const options2 = requestWithDefaults.endpoint.merge(...args);
  10637. for (const [name, alias] of Object.entries(
  10638. decorations.renamedParameters
  10639. )) {
  10640. if (name in options2) {
  10641. octokit.log.warn(
  10642. `"${name}" parameter is deprecated for "octokit.${scope}.${methodName}()". Use "${alias}" instead`
  10643. );
  10644. if (!(alias in options2)) {
  10645. options2[alias] = options2[name];
  10646. }
  10647. delete options2[name];
  10648. }
  10649. }
  10650. return requestWithDefaults(options2);
  10651. }
  10652. return requestWithDefaults(...args);
  10653. }
  10654. return Object.assign(withDecorations, requestWithDefaults);
  10655. }
  10656. // pkg/dist-src/index.js
  10657. function restEndpointMethods(octokit) {
  10658. const api = endpointsToMethods(octokit);
  10659. return {
  10660. rest: api
  10661. };
  10662. }
  10663. restEndpointMethods.VERSION = VERSION;
  10664. function legacyRestEndpointMethods(octokit) {
  10665. const api = endpointsToMethods(octokit);
  10666. return {
  10667. ...api,
  10668. rest: api
  10669. };
  10670. }
  10671. legacyRestEndpointMethods.VERSION = VERSION;
  10672. // Annotate the CommonJS export names for ESM import in node:
  10673. 0 && (0);
  10674. /***/ }),
  10675. /***/ 537:
  10676. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  10677. "use strict";
  10678. var __create = Object.create;
  10679. var __defProp = Object.defineProperty;
  10680. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  10681. var __getOwnPropNames = Object.getOwnPropertyNames;
  10682. var __getProtoOf = Object.getPrototypeOf;
  10683. var __hasOwnProp = Object.prototype.hasOwnProperty;
  10684. var __export = (target, all) => {
  10685. for (var name in all)
  10686. __defProp(target, name, { get: all[name], enumerable: true });
  10687. };
  10688. var __copyProps = (to, from, except, desc) => {
  10689. if (from && typeof from === "object" || typeof from === "function") {
  10690. for (let key of __getOwnPropNames(from))
  10691. if (!__hasOwnProp.call(to, key) && key !== except)
  10692. __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  10693. }
  10694. return to;
  10695. };
  10696. var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
  10697. // If the importer is in node compatibility mode or this is not an ESM
  10698. // file that has been converted to a CommonJS file using a Babel-
  10699. // compatible transform (i.e. "__esModule" has not been set), then set
  10700. // "default" to the CommonJS "module.exports" for node compatibility.
  10701. isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
  10702. mod
  10703. ));
  10704. var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
  10705. // pkg/dist-src/index.js
  10706. var dist_src_exports = {};
  10707. __export(dist_src_exports, {
  10708. RequestError: () => RequestError
  10709. });
  10710. module.exports = __toCommonJS(dist_src_exports);
  10711. var import_deprecation = __nccwpck_require__(8932);
  10712. var import_once = __toESM(__nccwpck_require__(1223));
  10713. var logOnceCode = (0, import_once.default)((deprecation) => console.warn(deprecation));
  10714. var logOnceHeaders = (0, import_once.default)((deprecation) => console.warn(deprecation));
  10715. var RequestError = class extends Error {
  10716. constructor(message, statusCode, options) {
  10717. super(message);
  10718. if (Error.captureStackTrace) {
  10719. Error.captureStackTrace(this, this.constructor);
  10720. }
  10721. this.name = "HttpError";
  10722. this.status = statusCode;
  10723. let headers;
  10724. if ("headers" in options && typeof options.headers !== "undefined") {
  10725. headers = options.headers;
  10726. }
  10727. if ("response" in options) {
  10728. this.response = options.response;
  10729. headers = options.response.headers;
  10730. }
  10731. const requestCopy = Object.assign({}, options.request);
  10732. if (options.request.headers.authorization) {
  10733. requestCopy.headers = Object.assign({}, options.request.headers, {
  10734. authorization: options.request.headers.authorization.replace(
  10735. /(?<! ) .*$/,
  10736. " [REDACTED]"
  10737. )
  10738. });
  10739. }
  10740. requestCopy.url = requestCopy.url.replace(/\bclient_secret=\w+/g, "client_secret=[REDACTED]").replace(/\baccess_token=\w+/g, "access_token=[REDACTED]");
  10741. this.request = requestCopy;
  10742. Object.defineProperty(this, "code", {
  10743. get() {
  10744. logOnceCode(
  10745. new import_deprecation.Deprecation(
  10746. "[@octokit/request-error] `error.code` is deprecated, use `error.status`."
  10747. )
  10748. );
  10749. return statusCode;
  10750. }
  10751. });
  10752. Object.defineProperty(this, "headers", {
  10753. get() {
  10754. logOnceHeaders(
  10755. new import_deprecation.Deprecation(
  10756. "[@octokit/request-error] `error.headers` is deprecated, use `error.response.headers`."
  10757. )
  10758. );
  10759. return headers || {};
  10760. }
  10761. });
  10762. }
  10763. };
  10764. // Annotate the CommonJS export names for ESM import in node:
  10765. 0 && (0);
  10766. /***/ }),
  10767. /***/ 6234:
  10768. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  10769. "use strict";
  10770. var __defProp = Object.defineProperty;
  10771. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  10772. var __getOwnPropNames = Object.getOwnPropertyNames;
  10773. var __hasOwnProp = Object.prototype.hasOwnProperty;
  10774. var __export = (target, all) => {
  10775. for (var name in all)
  10776. __defProp(target, name, { get: all[name], enumerable: true });
  10777. };
  10778. var __copyProps = (to, from, except, desc) => {
  10779. if (from && typeof from === "object" || typeof from === "function") {
  10780. for (let key of __getOwnPropNames(from))
  10781. if (!__hasOwnProp.call(to, key) && key !== except)
  10782. __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  10783. }
  10784. return to;
  10785. };
  10786. var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
  10787. // pkg/dist-src/index.js
  10788. var dist_src_exports = {};
  10789. __export(dist_src_exports, {
  10790. request: () => request
  10791. });
  10792. module.exports = __toCommonJS(dist_src_exports);
  10793. var import_endpoint = __nccwpck_require__(9440);
  10794. var import_universal_user_agent = __nccwpck_require__(5030);
  10795. // pkg/dist-src/version.js
  10796. var VERSION = "8.4.1";
  10797. // pkg/dist-src/is-plain-object.js
  10798. function isPlainObject(value) {
  10799. if (typeof value !== "object" || value === null)
  10800. return false;
  10801. if (Object.prototype.toString.call(value) !== "[object Object]")
  10802. return false;
  10803. const proto = Object.getPrototypeOf(value);
  10804. if (proto === null)
  10805. return true;
  10806. const Ctor = Object.prototype.hasOwnProperty.call(proto, "constructor") && proto.constructor;
  10807. return typeof Ctor === "function" && Ctor instanceof Ctor && Function.prototype.call(Ctor) === Function.prototype.call(value);
  10808. }
  10809. // pkg/dist-src/fetch-wrapper.js
  10810. var import_request_error = __nccwpck_require__(537);
  10811. // pkg/dist-src/get-buffer-response.js
  10812. function getBufferResponse(response) {
  10813. return response.arrayBuffer();
  10814. }
  10815. // pkg/dist-src/fetch-wrapper.js
  10816. function fetchWrapper(requestOptions) {
  10817. var _a, _b, _c, _d;
  10818. const log = requestOptions.request && requestOptions.request.log ? requestOptions.request.log : console;
  10819. const parseSuccessResponseBody = ((_a = requestOptions.request) == null ? void 0 : _a.parseSuccessResponseBody) !== false;
  10820. if (isPlainObject(requestOptions.body) || Array.isArray(requestOptions.body)) {
  10821. requestOptions.body = JSON.stringify(requestOptions.body);
  10822. }
  10823. let headers = {};
  10824. let status;
  10825. let url;
  10826. let { fetch } = globalThis;
  10827. if ((_b = requestOptions.request) == null ? void 0 : _b.fetch) {
  10828. fetch = requestOptions.request.fetch;
  10829. }
  10830. if (!fetch) {
  10831. throw new Error(
  10832. "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"
  10833. );
  10834. }
  10835. return fetch(requestOptions.url, {
  10836. method: requestOptions.method,
  10837. body: requestOptions.body,
  10838. redirect: (_c = requestOptions.request) == null ? void 0 : _c.redirect,
  10839. headers: requestOptions.headers,
  10840. signal: (_d = requestOptions.request) == null ? void 0 : _d.signal,
  10841. // duplex must be set if request.body is ReadableStream or Async Iterables.
  10842. // See https://fetch.spec.whatwg.org/#dom-requestinit-duplex.
  10843. ...requestOptions.body && { duplex: "half" }
  10844. }).then(async (response) => {
  10845. url = response.url;
  10846. status = response.status;
  10847. for (const keyAndValue of response.headers) {
  10848. headers[keyAndValue[0]] = keyAndValue[1];
  10849. }
  10850. if ("deprecation" in headers) {
  10851. const matches = headers.link && headers.link.match(/<([^<>]+)>; rel="deprecation"/);
  10852. const deprecationLink = matches && matches.pop();
  10853. log.warn(
  10854. `[@octokit/request] "${requestOptions.method} ${requestOptions.url}" is deprecated. It is scheduled to be removed on ${headers.sunset}${deprecationLink ? `. See ${deprecationLink}` : ""}`
  10855. );
  10856. }
  10857. if (status === 204 || status === 205) {
  10858. return;
  10859. }
  10860. if (requestOptions.method === "HEAD") {
  10861. if (status < 400) {
  10862. return;
  10863. }
  10864. throw new import_request_error.RequestError(response.statusText, status, {
  10865. response: {
  10866. url,
  10867. status,
  10868. headers,
  10869. data: void 0
  10870. },
  10871. request: requestOptions
  10872. });
  10873. }
  10874. if (status === 304) {
  10875. throw new import_request_error.RequestError("Not modified", status, {
  10876. response: {
  10877. url,
  10878. status,
  10879. headers,
  10880. data: await getResponseData(response)
  10881. },
  10882. request: requestOptions
  10883. });
  10884. }
  10885. if (status >= 400) {
  10886. const data = await getResponseData(response);
  10887. const error = new import_request_error.RequestError(toErrorMessage(data), status, {
  10888. response: {
  10889. url,
  10890. status,
  10891. headers,
  10892. data
  10893. },
  10894. request: requestOptions
  10895. });
  10896. throw error;
  10897. }
  10898. return parseSuccessResponseBody ? await getResponseData(response) : response.body;
  10899. }).then((data) => {
  10900. return {
  10901. status,
  10902. url,
  10903. headers,
  10904. data
  10905. };
  10906. }).catch((error) => {
  10907. if (error instanceof import_request_error.RequestError)
  10908. throw error;
  10909. else if (error.name === "AbortError")
  10910. throw error;
  10911. let message = error.message;
  10912. if (error.name === "TypeError" && "cause" in error) {
  10913. if (error.cause instanceof Error) {
  10914. message = error.cause.message;
  10915. } else if (typeof error.cause === "string") {
  10916. message = error.cause;
  10917. }
  10918. }
  10919. throw new import_request_error.RequestError(message, 500, {
  10920. request: requestOptions
  10921. });
  10922. });
  10923. }
  10924. async function getResponseData(response) {
  10925. const contentType = response.headers.get("content-type");
  10926. if (/application\/json/.test(contentType)) {
  10927. return response.json().catch(() => response.text()).catch(() => "");
  10928. }
  10929. if (!contentType || /^text\/|charset=utf-8$/.test(contentType)) {
  10930. return response.text();
  10931. }
  10932. return getBufferResponse(response);
  10933. }
  10934. function toErrorMessage(data) {
  10935. if (typeof data === "string")
  10936. return data;
  10937. let suffix;
  10938. if ("documentation_url" in data) {
  10939. suffix = ` - ${data.documentation_url}`;
  10940. } else {
  10941. suffix = "";
  10942. }
  10943. if ("message" in data) {
  10944. if (Array.isArray(data.errors)) {
  10945. return `${data.message}: ${data.errors.map(JSON.stringify).join(", ")}${suffix}`;
  10946. }
  10947. return `${data.message}${suffix}`;
  10948. }
  10949. return `Unknown error: ${JSON.stringify(data)}`;
  10950. }
  10951. // pkg/dist-src/with-defaults.js
  10952. function withDefaults(oldEndpoint, newDefaults) {
  10953. const endpoint2 = oldEndpoint.defaults(newDefaults);
  10954. const newApi = function(route, parameters) {
  10955. const endpointOptions = endpoint2.merge(route, parameters);
  10956. if (!endpointOptions.request || !endpointOptions.request.hook) {
  10957. return fetchWrapper(endpoint2.parse(endpointOptions));
  10958. }
  10959. const request2 = (route2, parameters2) => {
  10960. return fetchWrapper(
  10961. endpoint2.parse(endpoint2.merge(route2, parameters2))
  10962. );
  10963. };
  10964. Object.assign(request2, {
  10965. endpoint: endpoint2,
  10966. defaults: withDefaults.bind(null, endpoint2)
  10967. });
  10968. return endpointOptions.request.hook(request2, endpointOptions);
  10969. };
  10970. return Object.assign(newApi, {
  10971. endpoint: endpoint2,
  10972. defaults: withDefaults.bind(null, endpoint2)
  10973. });
  10974. }
  10975. // pkg/dist-src/index.js
  10976. var request = withDefaults(import_endpoint.endpoint, {
  10977. headers: {
  10978. "user-agent": `octokit-request.js/${VERSION} ${(0, import_universal_user_agent.getUserAgent)()}`
  10979. }
  10980. });
  10981. // Annotate the CommonJS export names for ESM import in node:
  10982. 0 && (0);
  10983. /***/ }),
  10984. /***/ 3682:
  10985. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  10986. var register = __nccwpck_require__(4670);
  10987. var addHook = __nccwpck_require__(5549);
  10988. var removeHook = __nccwpck_require__(6819);
  10989. // bind with array of arguments: https://stackoverflow.com/a/21792913
  10990. var bind = Function.bind;
  10991. var bindable = bind.bind(bind);
  10992. function bindApi(hook, state, name) {
  10993. var removeHookRef = bindable(removeHook, null).apply(
  10994. null,
  10995. name ? [state, name] : [state]
  10996. );
  10997. hook.api = { remove: removeHookRef };
  10998. hook.remove = removeHookRef;
  10999. ["before", "error", "after", "wrap"].forEach(function (kind) {
  11000. var args = name ? [state, kind, name] : [state, kind];
  11001. hook[kind] = hook.api[kind] = bindable(addHook, null).apply(null, args);
  11002. });
  11003. }
  11004. function HookSingular() {
  11005. var singularHookName = "h";
  11006. var singularHookState = {
  11007. registry: {},
  11008. };
  11009. var singularHook = register.bind(null, singularHookState, singularHookName);
  11010. bindApi(singularHook, singularHookState, singularHookName);
  11011. return singularHook;
  11012. }
  11013. function HookCollection() {
  11014. var state = {
  11015. registry: {},
  11016. };
  11017. var hook = register.bind(null, state);
  11018. bindApi(hook, state);
  11019. return hook;
  11020. }
  11021. var collectionHookDeprecationMessageDisplayed = false;
  11022. function Hook() {
  11023. if (!collectionHookDeprecationMessageDisplayed) {
  11024. console.warn(
  11025. '[before-after-hook]: "Hook()" repurposing warning, use "Hook.Collection()". Read more: https://git.io/upgrade-before-after-hook-to-1.4'
  11026. );
  11027. collectionHookDeprecationMessageDisplayed = true;
  11028. }
  11029. return HookCollection();
  11030. }
  11031. Hook.Singular = HookSingular.bind();
  11032. Hook.Collection = HookCollection.bind();
  11033. module.exports = Hook;
  11034. // expose constructors as a named property for TypeScript
  11035. module.exports.Hook = Hook;
  11036. module.exports.Singular = Hook.Singular;
  11037. module.exports.Collection = Hook.Collection;
  11038. /***/ }),
  11039. /***/ 5549:
  11040. /***/ ((module) => {
  11041. module.exports = addHook;
  11042. function addHook(state, kind, name, hook) {
  11043. var orig = hook;
  11044. if (!state.registry[name]) {
  11045. state.registry[name] = [];
  11046. }
  11047. if (kind === "before") {
  11048. hook = function (method, options) {
  11049. return Promise.resolve()
  11050. .then(orig.bind(null, options))
  11051. .then(method.bind(null, options));
  11052. };
  11053. }
  11054. if (kind === "after") {
  11055. hook = function (method, options) {
  11056. var result;
  11057. return Promise.resolve()
  11058. .then(method.bind(null, options))
  11059. .then(function (result_) {
  11060. result = result_;
  11061. return orig(result, options);
  11062. })
  11063. .then(function () {
  11064. return result;
  11065. });
  11066. };
  11067. }
  11068. if (kind === "error") {
  11069. hook = function (method, options) {
  11070. return Promise.resolve()
  11071. .then(method.bind(null, options))
  11072. .catch(function (error) {
  11073. return orig(error, options);
  11074. });
  11075. };
  11076. }
  11077. state.registry[name].push({
  11078. hook: hook,
  11079. orig: orig,
  11080. });
  11081. }
  11082. /***/ }),
  11083. /***/ 4670:
  11084. /***/ ((module) => {
  11085. module.exports = register;
  11086. function register(state, name, method, options) {
  11087. if (typeof method !== "function") {
  11088. throw new Error("method for before hook must be a function");
  11089. }
  11090. if (!options) {
  11091. options = {};
  11092. }
  11093. if (Array.isArray(name)) {
  11094. return name.reverse().reduce(function (callback, name) {
  11095. return register.bind(null, state, name, callback, options);
  11096. }, method)();
  11097. }
  11098. return Promise.resolve().then(function () {
  11099. if (!state.registry[name]) {
  11100. return method(options);
  11101. }
  11102. return state.registry[name].reduce(function (method, registered) {
  11103. return registered.hook.bind(null, method, options);
  11104. }, method)();
  11105. });
  11106. }
  11107. /***/ }),
  11108. /***/ 6819:
  11109. /***/ ((module) => {
  11110. module.exports = removeHook;
  11111. function removeHook(state, name, method) {
  11112. if (!state.registry[name]) {
  11113. return;
  11114. }
  11115. var index = state.registry[name]
  11116. .map(function (registered) {
  11117. return registered.orig;
  11118. })
  11119. .indexOf(method);
  11120. if (index === -1) {
  11121. return;
  11122. }
  11123. state.registry[name].splice(index, 1);
  11124. }
  11125. /***/ }),
  11126. /***/ 8932:
  11127. /***/ ((__unused_webpack_module, exports) => {
  11128. "use strict";
  11129. Object.defineProperty(exports, "__esModule", ({ value: true }));
  11130. class Deprecation extends Error {
  11131. constructor(message) {
  11132. super(message); // Maintains proper stack trace (only available on V8)
  11133. /* istanbul ignore next */
  11134. if (Error.captureStackTrace) {
  11135. Error.captureStackTrace(this, this.constructor);
  11136. }
  11137. this.name = 'Deprecation';
  11138. }
  11139. }
  11140. exports.Deprecation = Deprecation;
  11141. /***/ }),
  11142. /***/ 1223:
  11143. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  11144. var wrappy = __nccwpck_require__(2940)
  11145. module.exports = wrappy(once)
  11146. module.exports.strict = wrappy(onceStrict)
  11147. once.proto = once(function () {
  11148. Object.defineProperty(Function.prototype, 'once', {
  11149. value: function () {
  11150. return once(this)
  11151. },
  11152. configurable: true
  11153. })
  11154. Object.defineProperty(Function.prototype, 'onceStrict', {
  11155. value: function () {
  11156. return onceStrict(this)
  11157. },
  11158. configurable: true
  11159. })
  11160. })
  11161. function once (fn) {
  11162. var f = function () {
  11163. if (f.called) return f.value
  11164. f.called = true
  11165. return f.value = fn.apply(this, arguments)
  11166. }
  11167. f.called = false
  11168. return f
  11169. }
  11170. function onceStrict (fn) {
  11171. var f = function () {
  11172. if (f.called)
  11173. throw new Error(f.onceError)
  11174. f.called = true
  11175. return f.value = fn.apply(this, arguments)
  11176. }
  11177. var name = fn.name || 'Function wrapped with `once`'
  11178. f.onceError = name + " shouldn't be called more than once"
  11179. f.called = false
  11180. return f
  11181. }
  11182. /***/ }),
  11183. /***/ 5911:
  11184. /***/ ((module, exports) => {
  11185. exports = module.exports = SemVer
  11186. var debug
  11187. /* istanbul ignore next */
  11188. if (typeof process === 'object' &&
  11189. process.env &&
  11190. process.env.NODE_DEBUG &&
  11191. /\bsemver\b/i.test(process.env.NODE_DEBUG)) {
  11192. debug = function () {
  11193. var args = Array.prototype.slice.call(arguments, 0)
  11194. args.unshift('SEMVER')
  11195. console.log.apply(console, args)
  11196. }
  11197. } else {
  11198. debug = function () {}
  11199. }
  11200. // Note: this is the semver.org version of the spec that it implements
  11201. // Not necessarily the package version of this code.
  11202. exports.SEMVER_SPEC_VERSION = '2.0.0'
  11203. var MAX_LENGTH = 256
  11204. var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER ||
  11205. /* istanbul ignore next */ 9007199254740991
  11206. // Max safe segment length for coercion.
  11207. var MAX_SAFE_COMPONENT_LENGTH = 16
  11208. var MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6
  11209. // The actual regexps go on exports.re
  11210. var re = exports.re = []
  11211. var safeRe = exports.safeRe = []
  11212. var src = exports.src = []
  11213. var t = exports.tokens = {}
  11214. var R = 0
  11215. function tok (n) {
  11216. t[n] = R++
  11217. }
  11218. var LETTERDASHNUMBER = '[a-zA-Z0-9-]'
  11219. // Replace some greedy regex tokens to prevent regex dos issues. These regex are
  11220. // used internally via the safeRe object since all inputs in this library get
  11221. // normalized first to trim and collapse all extra whitespace. The original
  11222. // regexes are exported for userland consumption and lower level usage. A
  11223. // future breaking change could export the safer regex only with a note that
  11224. // all input should have extra whitespace removed.
  11225. var safeRegexReplacements = [
  11226. ['\\s', 1],
  11227. ['\\d', MAX_LENGTH],
  11228. [LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH],
  11229. ]
  11230. function makeSafeRe (value) {
  11231. for (var i = 0; i < safeRegexReplacements.length; i++) {
  11232. var token = safeRegexReplacements[i][0]
  11233. var max = safeRegexReplacements[i][1]
  11234. value = value
  11235. .split(token + '*').join(token + '{0,' + max + '}')
  11236. .split(token + '+').join(token + '{1,' + max + '}')
  11237. }
  11238. return value
  11239. }
  11240. // The following Regular Expressions can be used for tokenizing,
  11241. // validating, and parsing SemVer version strings.
  11242. // ## Numeric Identifier
  11243. // A single `0`, or a non-zero digit followed by zero or more digits.
  11244. tok('NUMERICIDENTIFIER')
  11245. src[t.NUMERICIDENTIFIER] = '0|[1-9]\\d*'
  11246. tok('NUMERICIDENTIFIERLOOSE')
  11247. src[t.NUMERICIDENTIFIERLOOSE] = '\\d+'
  11248. // ## Non-numeric Identifier
  11249. // Zero or more digits, followed by a letter or hyphen, and then zero or
  11250. // more letters, digits, or hyphens.
  11251. tok('NONNUMERICIDENTIFIER')
  11252. src[t.NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-]' + LETTERDASHNUMBER + '*'
  11253. // ## Main Version
  11254. // Three dot-separated numeric identifiers.
  11255. tok('MAINVERSION')
  11256. src[t.MAINVERSION] = '(' + src[t.NUMERICIDENTIFIER] + ')\\.' +
  11257. '(' + src[t.NUMERICIDENTIFIER] + ')\\.' +
  11258. '(' + src[t.NUMERICIDENTIFIER] + ')'
  11259. tok('MAINVERSIONLOOSE')
  11260. src[t.MAINVERSIONLOOSE] = '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')\\.' +
  11261. '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')\\.' +
  11262. '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')'
  11263. // ## Pre-release Version Identifier
  11264. // A numeric identifier, or a non-numeric identifier.
  11265. tok('PRERELEASEIDENTIFIER')
  11266. src[t.PRERELEASEIDENTIFIER] = '(?:' + src[t.NUMERICIDENTIFIER] +
  11267. '|' + src[t.NONNUMERICIDENTIFIER] + ')'
  11268. tok('PRERELEASEIDENTIFIERLOOSE')
  11269. src[t.PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[t.NUMERICIDENTIFIERLOOSE] +
  11270. '|' + src[t.NONNUMERICIDENTIFIER] + ')'
  11271. // ## Pre-release Version
  11272. // Hyphen, followed by one or more dot-separated pre-release version
  11273. // identifiers.
  11274. tok('PRERELEASE')
  11275. src[t.PRERELEASE] = '(?:-(' + src[t.PRERELEASEIDENTIFIER] +
  11276. '(?:\\.' + src[t.PRERELEASEIDENTIFIER] + ')*))'
  11277. tok('PRERELEASELOOSE')
  11278. src[t.PRERELEASELOOSE] = '(?:-?(' + src[t.PRERELEASEIDENTIFIERLOOSE] +
  11279. '(?:\\.' + src[t.PRERELEASEIDENTIFIERLOOSE] + ')*))'
  11280. // ## Build Metadata Identifier
  11281. // Any combination of digits, letters, or hyphens.
  11282. tok('BUILDIDENTIFIER')
  11283. src[t.BUILDIDENTIFIER] = LETTERDASHNUMBER + '+'
  11284. // ## Build Metadata
  11285. // Plus sign, followed by one or more period-separated build metadata
  11286. // identifiers.
  11287. tok('BUILD')
  11288. src[t.BUILD] = '(?:\\+(' + src[t.BUILDIDENTIFIER] +
  11289. '(?:\\.' + src[t.BUILDIDENTIFIER] + ')*))'
  11290. // ## Full Version String
  11291. // A main version, followed optionally by a pre-release version and
  11292. // build metadata.
  11293. // Note that the only major, minor, patch, and pre-release sections of
  11294. // the version string are capturing groups. The build metadata is not a
  11295. // capturing group, because it should not ever be used in version
  11296. // comparison.
  11297. tok('FULL')
  11298. tok('FULLPLAIN')
  11299. src[t.FULLPLAIN] = 'v?' + src[t.MAINVERSION] +
  11300. src[t.PRERELEASE] + '?' +
  11301. src[t.BUILD] + '?'
  11302. src[t.FULL] = '^' + src[t.FULLPLAIN] + '$'
  11303. // like full, but allows v1.2.3 and =1.2.3, which people do sometimes.
  11304. // also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty
  11305. // common in the npm registry.
  11306. tok('LOOSEPLAIN')
  11307. src[t.LOOSEPLAIN] = '[v=\\s]*' + src[t.MAINVERSIONLOOSE] +
  11308. src[t.PRERELEASELOOSE] + '?' +
  11309. src[t.BUILD] + '?'
  11310. tok('LOOSE')
  11311. src[t.LOOSE] = '^' + src[t.LOOSEPLAIN] + '$'
  11312. tok('GTLT')
  11313. src[t.GTLT] = '((?:<|>)?=?)'
  11314. // Something like "2.*" or "1.2.x".
  11315. // Note that "x.x" is a valid xRange identifer, meaning "any version"
  11316. // Only the first item is strictly required.
  11317. tok('XRANGEIDENTIFIERLOOSE')
  11318. src[t.XRANGEIDENTIFIERLOOSE] = src[t.NUMERICIDENTIFIERLOOSE] + '|x|X|\\*'
  11319. tok('XRANGEIDENTIFIER')
  11320. src[t.XRANGEIDENTIFIER] = src[t.NUMERICIDENTIFIER] + '|x|X|\\*'
  11321. tok('XRANGEPLAIN')
  11322. src[t.XRANGEPLAIN] = '[v=\\s]*(' + src[t.XRANGEIDENTIFIER] + ')' +
  11323. '(?:\\.(' + src[t.XRANGEIDENTIFIER] + ')' +
  11324. '(?:\\.(' + src[t.XRANGEIDENTIFIER] + ')' +
  11325. '(?:' + src[t.PRERELEASE] + ')?' +
  11326. src[t.BUILD] + '?' +
  11327. ')?)?'
  11328. tok('XRANGEPLAINLOOSE')
  11329. src[t.XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +
  11330. '(?:\\.(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +
  11331. '(?:\\.(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +
  11332. '(?:' + src[t.PRERELEASELOOSE] + ')?' +
  11333. src[t.BUILD] + '?' +
  11334. ')?)?'
  11335. tok('XRANGE')
  11336. src[t.XRANGE] = '^' + src[t.GTLT] + '\\s*' + src[t.XRANGEPLAIN] + '$'
  11337. tok('XRANGELOOSE')
  11338. src[t.XRANGELOOSE] = '^' + src[t.GTLT] + '\\s*' + src[t.XRANGEPLAINLOOSE] + '$'
  11339. // Coercion.
  11340. // Extract anything that could conceivably be a part of a valid semver
  11341. tok('COERCE')
  11342. src[t.COERCE] = '(^|[^\\d])' +
  11343. '(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '})' +
  11344. '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
  11345. '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
  11346. '(?:$|[^\\d])'
  11347. tok('COERCERTL')
  11348. re[t.COERCERTL] = new RegExp(src[t.COERCE], 'g')
  11349. safeRe[t.COERCERTL] = new RegExp(makeSafeRe(src[t.COERCE]), 'g')
  11350. // Tilde ranges.
  11351. // Meaning is "reasonably at or greater than"
  11352. tok('LONETILDE')
  11353. src[t.LONETILDE] = '(?:~>?)'
  11354. tok('TILDETRIM')
  11355. src[t.TILDETRIM] = '(\\s*)' + src[t.LONETILDE] + '\\s+'
  11356. re[t.TILDETRIM] = new RegExp(src[t.TILDETRIM], 'g')
  11357. safeRe[t.TILDETRIM] = new RegExp(makeSafeRe(src[t.TILDETRIM]), 'g')
  11358. var tildeTrimReplace = '$1~'
  11359. tok('TILDE')
  11360. src[t.TILDE] = '^' + src[t.LONETILDE] + src[t.XRANGEPLAIN] + '$'
  11361. tok('TILDELOOSE')
  11362. src[t.TILDELOOSE] = '^' + src[t.LONETILDE] + src[t.XRANGEPLAINLOOSE] + '$'
  11363. // Caret ranges.
  11364. // Meaning is "at least and backwards compatible with"
  11365. tok('LONECARET')
  11366. src[t.LONECARET] = '(?:\\^)'
  11367. tok('CARETTRIM')
  11368. src[t.CARETTRIM] = '(\\s*)' + src[t.LONECARET] + '\\s+'
  11369. re[t.CARETTRIM] = new RegExp(src[t.CARETTRIM], 'g')
  11370. safeRe[t.CARETTRIM] = new RegExp(makeSafeRe(src[t.CARETTRIM]), 'g')
  11371. var caretTrimReplace = '$1^'
  11372. tok('CARET')
  11373. src[t.CARET] = '^' + src[t.LONECARET] + src[t.XRANGEPLAIN] + '$'
  11374. tok('CARETLOOSE')
  11375. src[t.CARETLOOSE] = '^' + src[t.LONECARET] + src[t.XRANGEPLAINLOOSE] + '$'
  11376. // A simple gt/lt/eq thing, or just "" to indicate "any version"
  11377. tok('COMPARATORLOOSE')
  11378. src[t.COMPARATORLOOSE] = '^' + src[t.GTLT] + '\\s*(' + src[t.LOOSEPLAIN] + ')$|^$'
  11379. tok('COMPARATOR')
  11380. src[t.COMPARATOR] = '^' + src[t.GTLT] + '\\s*(' + src[t.FULLPLAIN] + ')$|^$'
  11381. // An expression to strip any whitespace between the gtlt and the thing
  11382. // it modifies, so that `> 1.2.3` ==> `>1.2.3`
  11383. tok('COMPARATORTRIM')
  11384. src[t.COMPARATORTRIM] = '(\\s*)' + src[t.GTLT] +
  11385. '\\s*(' + src[t.LOOSEPLAIN] + '|' + src[t.XRANGEPLAIN] + ')'
  11386. // this one has to use the /g flag
  11387. re[t.COMPARATORTRIM] = new RegExp(src[t.COMPARATORTRIM], 'g')
  11388. safeRe[t.COMPARATORTRIM] = new RegExp(makeSafeRe(src[t.COMPARATORTRIM]), 'g')
  11389. var comparatorTrimReplace = '$1$2$3'
  11390. // Something like `1.2.3 - 1.2.4`
  11391. // Note that these all use the loose form, because they'll be
  11392. // checked against either the strict or loose comparator form
  11393. // later.
  11394. tok('HYPHENRANGE')
  11395. src[t.HYPHENRANGE] = '^\\s*(' + src[t.XRANGEPLAIN] + ')' +
  11396. '\\s+-\\s+' +
  11397. '(' + src[t.XRANGEPLAIN] + ')' +
  11398. '\\s*$'
  11399. tok('HYPHENRANGELOOSE')
  11400. src[t.HYPHENRANGELOOSE] = '^\\s*(' + src[t.XRANGEPLAINLOOSE] + ')' +
  11401. '\\s+-\\s+' +
  11402. '(' + src[t.XRANGEPLAINLOOSE] + ')' +
  11403. '\\s*$'
  11404. // Star ranges basically just allow anything at all.
  11405. tok('STAR')
  11406. src[t.STAR] = '(<|>)?=?\\s*\\*'
  11407. // Compile to actual regexp objects.
  11408. // All are flag-free, unless they were created above with a flag.
  11409. for (var i = 0; i < R; i++) {
  11410. debug(i, src[i])
  11411. if (!re[i]) {
  11412. re[i] = new RegExp(src[i])
  11413. // Replace all greedy whitespace to prevent regex dos issues. These regex are
  11414. // used internally via the safeRe object since all inputs in this library get
  11415. // normalized first to trim and collapse all extra whitespace. The original
  11416. // regexes are exported for userland consumption and lower level usage. A
  11417. // future breaking change could export the safer regex only with a note that
  11418. // all input should have extra whitespace removed.
  11419. safeRe[i] = new RegExp(makeSafeRe(src[i]))
  11420. }
  11421. }
  11422. exports.parse = parse
  11423. function parse (version, options) {
  11424. if (!options || typeof options !== 'object') {
  11425. options = {
  11426. loose: !!options,
  11427. includePrerelease: false
  11428. }
  11429. }
  11430. if (version instanceof SemVer) {
  11431. return version
  11432. }
  11433. if (typeof version !== 'string') {
  11434. return null
  11435. }
  11436. if (version.length > MAX_LENGTH) {
  11437. return null
  11438. }
  11439. var r = options.loose ? safeRe[t.LOOSE] : safeRe[t.FULL]
  11440. if (!r.test(version)) {
  11441. return null
  11442. }
  11443. try {
  11444. return new SemVer(version, options)
  11445. } catch (er) {
  11446. return null
  11447. }
  11448. }
  11449. exports.valid = valid
  11450. function valid (version, options) {
  11451. var v = parse(version, options)
  11452. return v ? v.version : null
  11453. }
  11454. exports.clean = clean
  11455. function clean (version, options) {
  11456. var s = parse(version.trim().replace(/^[=v]+/, ''), options)
  11457. return s ? s.version : null
  11458. }
  11459. exports.SemVer = SemVer
  11460. function SemVer (version, options) {
  11461. if (!options || typeof options !== 'object') {
  11462. options = {
  11463. loose: !!options,
  11464. includePrerelease: false
  11465. }
  11466. }
  11467. if (version instanceof SemVer) {
  11468. if (version.loose === options.loose) {
  11469. return version
  11470. } else {
  11471. version = version.version
  11472. }
  11473. } else if (typeof version !== 'string') {
  11474. throw new TypeError('Invalid Version: ' + version)
  11475. }
  11476. if (version.length > MAX_LENGTH) {
  11477. throw new TypeError('version is longer than ' + MAX_LENGTH + ' characters')
  11478. }
  11479. if (!(this instanceof SemVer)) {
  11480. return new SemVer(version, options)
  11481. }
  11482. debug('SemVer', version, options)
  11483. this.options = options
  11484. this.loose = !!options.loose
  11485. var m = version.trim().match(options.loose ? safeRe[t.LOOSE] : safeRe[t.FULL])
  11486. if (!m) {
  11487. throw new TypeError('Invalid Version: ' + version)
  11488. }
  11489. this.raw = version
  11490. // these are actually numbers
  11491. this.major = +m[1]
  11492. this.minor = +m[2]
  11493. this.patch = +m[3]
  11494. if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
  11495. throw new TypeError('Invalid major version')
  11496. }
  11497. if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
  11498. throw new TypeError('Invalid minor version')
  11499. }
  11500. if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
  11501. throw new TypeError('Invalid patch version')
  11502. }
  11503. // numberify any prerelease numeric ids
  11504. if (!m[4]) {
  11505. this.prerelease = []
  11506. } else {
  11507. this.prerelease = m[4].split('.').map(function (id) {
  11508. if (/^[0-9]+$/.test(id)) {
  11509. var num = +id
  11510. if (num >= 0 && num < MAX_SAFE_INTEGER) {
  11511. return num
  11512. }
  11513. }
  11514. return id
  11515. })
  11516. }
  11517. this.build = m[5] ? m[5].split('.') : []
  11518. this.format()
  11519. }
  11520. SemVer.prototype.format = function () {
  11521. this.version = this.major + '.' + this.minor + '.' + this.patch
  11522. if (this.prerelease.length) {
  11523. this.version += '-' + this.prerelease.join('.')
  11524. }
  11525. return this.version
  11526. }
  11527. SemVer.prototype.toString = function () {
  11528. return this.version
  11529. }
  11530. SemVer.prototype.compare = function (other) {
  11531. debug('SemVer.compare', this.version, this.options, other)
  11532. if (!(other instanceof SemVer)) {
  11533. other = new SemVer(other, this.options)
  11534. }
  11535. return this.compareMain(other) || this.comparePre(other)
  11536. }
  11537. SemVer.prototype.compareMain = function (other) {
  11538. if (!(other instanceof SemVer)) {
  11539. other = new SemVer(other, this.options)
  11540. }
  11541. return compareIdentifiers(this.major, other.major) ||
  11542. compareIdentifiers(this.minor, other.minor) ||
  11543. compareIdentifiers(this.patch, other.patch)
  11544. }
  11545. SemVer.prototype.comparePre = function (other) {
  11546. if (!(other instanceof SemVer)) {
  11547. other = new SemVer(other, this.options)
  11548. }
  11549. // NOT having a prerelease is > having one
  11550. if (this.prerelease.length && !other.prerelease.length) {
  11551. return -1
  11552. } else if (!this.prerelease.length && other.prerelease.length) {
  11553. return 1
  11554. } else if (!this.prerelease.length && !other.prerelease.length) {
  11555. return 0
  11556. }
  11557. var i = 0
  11558. do {
  11559. var a = this.prerelease[i]
  11560. var b = other.prerelease[i]
  11561. debug('prerelease compare', i, a, b)
  11562. if (a === undefined && b === undefined) {
  11563. return 0
  11564. } else if (b === undefined) {
  11565. return 1
  11566. } else if (a === undefined) {
  11567. return -1
  11568. } else if (a === b) {
  11569. continue
  11570. } else {
  11571. return compareIdentifiers(a, b)
  11572. }
  11573. } while (++i)
  11574. }
  11575. SemVer.prototype.compareBuild = function (other) {
  11576. if (!(other instanceof SemVer)) {
  11577. other = new SemVer(other, this.options)
  11578. }
  11579. var i = 0
  11580. do {
  11581. var a = this.build[i]
  11582. var b = other.build[i]
  11583. debug('prerelease compare', i, a, b)
  11584. if (a === undefined && b === undefined) {
  11585. return 0
  11586. } else if (b === undefined) {
  11587. return 1
  11588. } else if (a === undefined) {
  11589. return -1
  11590. } else if (a === b) {
  11591. continue
  11592. } else {
  11593. return compareIdentifiers(a, b)
  11594. }
  11595. } while (++i)
  11596. }
  11597. // preminor will bump the version up to the next minor release, and immediately
  11598. // down to pre-release. premajor and prepatch work the same way.
  11599. SemVer.prototype.inc = function (release, identifier) {
  11600. switch (release) {
  11601. case 'premajor':
  11602. this.prerelease.length = 0
  11603. this.patch = 0
  11604. this.minor = 0
  11605. this.major++
  11606. this.inc('pre', identifier)
  11607. break
  11608. case 'preminor':
  11609. this.prerelease.length = 0
  11610. this.patch = 0
  11611. this.minor++
  11612. this.inc('pre', identifier)
  11613. break
  11614. case 'prepatch':
  11615. // If this is already a prerelease, it will bump to the next version
  11616. // drop any prereleases that might already exist, since they are not
  11617. // relevant at this point.
  11618. this.prerelease.length = 0
  11619. this.inc('patch', identifier)
  11620. this.inc('pre', identifier)
  11621. break
  11622. // If the input is a non-prerelease version, this acts the same as
  11623. // prepatch.
  11624. case 'prerelease':
  11625. if (this.prerelease.length === 0) {
  11626. this.inc('patch', identifier)
  11627. }
  11628. this.inc('pre', identifier)
  11629. break
  11630. case 'major':
  11631. // If this is a pre-major version, bump up to the same major version.
  11632. // Otherwise increment major.
  11633. // 1.0.0-5 bumps to 1.0.0
  11634. // 1.1.0 bumps to 2.0.0
  11635. if (this.minor !== 0 ||
  11636. this.patch !== 0 ||
  11637. this.prerelease.length === 0) {
  11638. this.major++
  11639. }
  11640. this.minor = 0
  11641. this.patch = 0
  11642. this.prerelease = []
  11643. break
  11644. case 'minor':
  11645. // If this is a pre-minor version, bump up to the same minor version.
  11646. // Otherwise increment minor.
  11647. // 1.2.0-5 bumps to 1.2.0
  11648. // 1.2.1 bumps to 1.3.0
  11649. if (this.patch !== 0 || this.prerelease.length === 0) {
  11650. this.minor++
  11651. }
  11652. this.patch = 0
  11653. this.prerelease = []
  11654. break
  11655. case 'patch':
  11656. // If this is not a pre-release version, it will increment the patch.
  11657. // If it is a pre-release it will bump up to the same patch version.
  11658. // 1.2.0-5 patches to 1.2.0
  11659. // 1.2.0 patches to 1.2.1
  11660. if (this.prerelease.length === 0) {
  11661. this.patch++
  11662. }
  11663. this.prerelease = []
  11664. break
  11665. // This probably shouldn't be used publicly.
  11666. // 1.0.0 "pre" would become 1.0.0-0 which is the wrong direction.
  11667. case 'pre':
  11668. if (this.prerelease.length === 0) {
  11669. this.prerelease = [0]
  11670. } else {
  11671. var i = this.prerelease.length
  11672. while (--i >= 0) {
  11673. if (typeof this.prerelease[i] === 'number') {
  11674. this.prerelease[i]++
  11675. i = -2
  11676. }
  11677. }
  11678. if (i === -1) {
  11679. // didn't increment anything
  11680. this.prerelease.push(0)
  11681. }
  11682. }
  11683. if (identifier) {
  11684. // 1.2.0-beta.1 bumps to 1.2.0-beta.2,
  11685. // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0
  11686. if (this.prerelease[0] === identifier) {
  11687. if (isNaN(this.prerelease[1])) {
  11688. this.prerelease = [identifier, 0]
  11689. }
  11690. } else {
  11691. this.prerelease = [identifier, 0]
  11692. }
  11693. }
  11694. break
  11695. default:
  11696. throw new Error('invalid increment argument: ' + release)
  11697. }
  11698. this.format()
  11699. this.raw = this.version
  11700. return this
  11701. }
  11702. exports.inc = inc
  11703. function inc (version, release, loose, identifier) {
  11704. if (typeof (loose) === 'string') {
  11705. identifier = loose
  11706. loose = undefined
  11707. }
  11708. try {
  11709. return new SemVer(version, loose).inc(release, identifier).version
  11710. } catch (er) {
  11711. return null
  11712. }
  11713. }
  11714. exports.diff = diff
  11715. function diff (version1, version2) {
  11716. if (eq(version1, version2)) {
  11717. return null
  11718. } else {
  11719. var v1 = parse(version1)
  11720. var v2 = parse(version2)
  11721. var prefix = ''
  11722. if (v1.prerelease.length || v2.prerelease.length) {
  11723. prefix = 'pre'
  11724. var defaultResult = 'prerelease'
  11725. }
  11726. for (var key in v1) {
  11727. if (key === 'major' || key === 'minor' || key === 'patch') {
  11728. if (v1[key] !== v2[key]) {
  11729. return prefix + key
  11730. }
  11731. }
  11732. }
  11733. return defaultResult // may be undefined
  11734. }
  11735. }
  11736. exports.compareIdentifiers = compareIdentifiers
  11737. var numeric = /^[0-9]+$/
  11738. function compareIdentifiers (a, b) {
  11739. var anum = numeric.test(a)
  11740. var bnum = numeric.test(b)
  11741. if (anum && bnum) {
  11742. a = +a
  11743. b = +b
  11744. }
  11745. return a === b ? 0
  11746. : (anum && !bnum) ? -1
  11747. : (bnum && !anum) ? 1
  11748. : a < b ? -1
  11749. : 1
  11750. }
  11751. exports.rcompareIdentifiers = rcompareIdentifiers
  11752. function rcompareIdentifiers (a, b) {
  11753. return compareIdentifiers(b, a)
  11754. }
  11755. exports.major = major
  11756. function major (a, loose) {
  11757. return new SemVer(a, loose).major
  11758. }
  11759. exports.minor = minor
  11760. function minor (a, loose) {
  11761. return new SemVer(a, loose).minor
  11762. }
  11763. exports.patch = patch
  11764. function patch (a, loose) {
  11765. return new SemVer(a, loose).patch
  11766. }
  11767. exports.compare = compare
  11768. function compare (a, b, loose) {
  11769. return new SemVer(a, loose).compare(new SemVer(b, loose))
  11770. }
  11771. exports.compareLoose = compareLoose
  11772. function compareLoose (a, b) {
  11773. return compare(a, b, true)
  11774. }
  11775. exports.compareBuild = compareBuild
  11776. function compareBuild (a, b, loose) {
  11777. var versionA = new SemVer(a, loose)
  11778. var versionB = new SemVer(b, loose)
  11779. return versionA.compare(versionB) || versionA.compareBuild(versionB)
  11780. }
  11781. exports.rcompare = rcompare
  11782. function rcompare (a, b, loose) {
  11783. return compare(b, a, loose)
  11784. }
  11785. exports.sort = sort
  11786. function sort (list, loose) {
  11787. return list.sort(function (a, b) {
  11788. return exports.compareBuild(a, b, loose)
  11789. })
  11790. }
  11791. exports.rsort = rsort
  11792. function rsort (list, loose) {
  11793. return list.sort(function (a, b) {
  11794. return exports.compareBuild(b, a, loose)
  11795. })
  11796. }
  11797. exports.gt = gt
  11798. function gt (a, b, loose) {
  11799. return compare(a, b, loose) > 0
  11800. }
  11801. exports.lt = lt
  11802. function lt (a, b, loose) {
  11803. return compare(a, b, loose) < 0
  11804. }
  11805. exports.eq = eq
  11806. function eq (a, b, loose) {
  11807. return compare(a, b, loose) === 0
  11808. }
  11809. exports.neq = neq
  11810. function neq (a, b, loose) {
  11811. return compare(a, b, loose) !== 0
  11812. }
  11813. exports.gte = gte
  11814. function gte (a, b, loose) {
  11815. return compare(a, b, loose) >= 0
  11816. }
  11817. exports.lte = lte
  11818. function lte (a, b, loose) {
  11819. return compare(a, b, loose) <= 0
  11820. }
  11821. exports.cmp = cmp
  11822. function cmp (a, op, b, loose) {
  11823. switch (op) {
  11824. case '===':
  11825. if (typeof a === 'object')
  11826. a = a.version
  11827. if (typeof b === 'object')
  11828. b = b.version
  11829. return a === b
  11830. case '!==':
  11831. if (typeof a === 'object')
  11832. a = a.version
  11833. if (typeof b === 'object')
  11834. b = b.version
  11835. return a !== b
  11836. case '':
  11837. case '=':
  11838. case '==':
  11839. return eq(a, b, loose)
  11840. case '!=':
  11841. return neq(a, b, loose)
  11842. case '>':
  11843. return gt(a, b, loose)
  11844. case '>=':
  11845. return gte(a, b, loose)
  11846. case '<':
  11847. return lt(a, b, loose)
  11848. case '<=':
  11849. return lte(a, b, loose)
  11850. default:
  11851. throw new TypeError('Invalid operator: ' + op)
  11852. }
  11853. }
  11854. exports.Comparator = Comparator
  11855. function Comparator (comp, options) {
  11856. if (!options || typeof options !== 'object') {
  11857. options = {
  11858. loose: !!options,
  11859. includePrerelease: false
  11860. }
  11861. }
  11862. if (comp instanceof Comparator) {
  11863. if (comp.loose === !!options.loose) {
  11864. return comp
  11865. } else {
  11866. comp = comp.value
  11867. }
  11868. }
  11869. if (!(this instanceof Comparator)) {
  11870. return new Comparator(comp, options)
  11871. }
  11872. comp = comp.trim().split(/\s+/).join(' ')
  11873. debug('comparator', comp, options)
  11874. this.options = options
  11875. this.loose = !!options.loose
  11876. this.parse(comp)
  11877. if (this.semver === ANY) {
  11878. this.value = ''
  11879. } else {
  11880. this.value = this.operator + this.semver.version
  11881. }
  11882. debug('comp', this)
  11883. }
  11884. var ANY = {}
  11885. Comparator.prototype.parse = function (comp) {
  11886. var r = this.options.loose ? safeRe[t.COMPARATORLOOSE] : safeRe[t.COMPARATOR]
  11887. var m = comp.match(r)
  11888. if (!m) {
  11889. throw new TypeError('Invalid comparator: ' + comp)
  11890. }
  11891. this.operator = m[1] !== undefined ? m[1] : ''
  11892. if (this.operator === '=') {
  11893. this.operator = ''
  11894. }
  11895. // if it literally is just '>' or '' then allow anything.
  11896. if (!m[2]) {
  11897. this.semver = ANY
  11898. } else {
  11899. this.semver = new SemVer(m[2], this.options.loose)
  11900. }
  11901. }
  11902. Comparator.prototype.toString = function () {
  11903. return this.value
  11904. }
  11905. Comparator.prototype.test = function (version) {
  11906. debug('Comparator.test', version, this.options.loose)
  11907. if (this.semver === ANY || version === ANY) {
  11908. return true
  11909. }
  11910. if (typeof version === 'string') {
  11911. try {
  11912. version = new SemVer(version, this.options)
  11913. } catch (er) {
  11914. return false
  11915. }
  11916. }
  11917. return cmp(version, this.operator, this.semver, this.options)
  11918. }
  11919. Comparator.prototype.intersects = function (comp, options) {
  11920. if (!(comp instanceof Comparator)) {
  11921. throw new TypeError('a Comparator is required')
  11922. }
  11923. if (!options || typeof options !== 'object') {
  11924. options = {
  11925. loose: !!options,
  11926. includePrerelease: false
  11927. }
  11928. }
  11929. var rangeTmp
  11930. if (this.operator === '') {
  11931. if (this.value === '') {
  11932. return true
  11933. }
  11934. rangeTmp = new Range(comp.value, options)
  11935. return satisfies(this.value, rangeTmp, options)
  11936. } else if (comp.operator === '') {
  11937. if (comp.value === '') {
  11938. return true
  11939. }
  11940. rangeTmp = new Range(this.value, options)
  11941. return satisfies(comp.semver, rangeTmp, options)
  11942. }
  11943. var sameDirectionIncreasing =
  11944. (this.operator === '>=' || this.operator === '>') &&
  11945. (comp.operator === '>=' || comp.operator === '>')
  11946. var sameDirectionDecreasing =
  11947. (this.operator === '<=' || this.operator === '<') &&
  11948. (comp.operator === '<=' || comp.operator === '<')
  11949. var sameSemVer = this.semver.version === comp.semver.version
  11950. var differentDirectionsInclusive =
  11951. (this.operator === '>=' || this.operator === '<=') &&
  11952. (comp.operator === '>=' || comp.operator === '<=')
  11953. var oppositeDirectionsLessThan =
  11954. cmp(this.semver, '<', comp.semver, options) &&
  11955. ((this.operator === '>=' || this.operator === '>') &&
  11956. (comp.operator === '<=' || comp.operator === '<'))
  11957. var oppositeDirectionsGreaterThan =
  11958. cmp(this.semver, '>', comp.semver, options) &&
  11959. ((this.operator === '<=' || this.operator === '<') &&
  11960. (comp.operator === '>=' || comp.operator === '>'))
  11961. return sameDirectionIncreasing || sameDirectionDecreasing ||
  11962. (sameSemVer && differentDirectionsInclusive) ||
  11963. oppositeDirectionsLessThan || oppositeDirectionsGreaterThan
  11964. }
  11965. exports.Range = Range
  11966. function Range (range, options) {
  11967. if (!options || typeof options !== 'object') {
  11968. options = {
  11969. loose: !!options,
  11970. includePrerelease: false
  11971. }
  11972. }
  11973. if (range instanceof Range) {
  11974. if (range.loose === !!options.loose &&
  11975. range.includePrerelease === !!options.includePrerelease) {
  11976. return range
  11977. } else {
  11978. return new Range(range.raw, options)
  11979. }
  11980. }
  11981. if (range instanceof Comparator) {
  11982. return new Range(range.value, options)
  11983. }
  11984. if (!(this instanceof Range)) {
  11985. return new Range(range, options)
  11986. }
  11987. this.options = options
  11988. this.loose = !!options.loose
  11989. this.includePrerelease = !!options.includePrerelease
  11990. // First reduce all whitespace as much as possible so we do not have to rely
  11991. // on potentially slow regexes like \s*. This is then stored and used for
  11992. // future error messages as well.
  11993. this.raw = range
  11994. .trim()
  11995. .split(/\s+/)
  11996. .join(' ')
  11997. // First, split based on boolean or ||
  11998. this.set = this.raw.split('||').map(function (range) {
  11999. return this.parseRange(range.trim())
  12000. }, this).filter(function (c) {
  12001. // throw out any that are not relevant for whatever reason
  12002. return c.length
  12003. })
  12004. if (!this.set.length) {
  12005. throw new TypeError('Invalid SemVer Range: ' + this.raw)
  12006. }
  12007. this.format()
  12008. }
  12009. Range.prototype.format = function () {
  12010. this.range = this.set.map(function (comps) {
  12011. return comps.join(' ').trim()
  12012. }).join('||').trim()
  12013. return this.range
  12014. }
  12015. Range.prototype.toString = function () {
  12016. return this.range
  12017. }
  12018. Range.prototype.parseRange = function (range) {
  12019. var loose = this.options.loose
  12020. // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`
  12021. var hr = loose ? safeRe[t.HYPHENRANGELOOSE] : safeRe[t.HYPHENRANGE]
  12022. range = range.replace(hr, hyphenReplace)
  12023. debug('hyphen replace', range)
  12024. // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`
  12025. range = range.replace(safeRe[t.COMPARATORTRIM], comparatorTrimReplace)
  12026. debug('comparator trim', range, safeRe[t.COMPARATORTRIM])
  12027. // `~ 1.2.3` => `~1.2.3`
  12028. range = range.replace(safeRe[t.TILDETRIM], tildeTrimReplace)
  12029. // `^ 1.2.3` => `^1.2.3`
  12030. range = range.replace(safeRe[t.CARETTRIM], caretTrimReplace)
  12031. // normalize spaces
  12032. range = range.split(/\s+/).join(' ')
  12033. // At this point, the range is completely trimmed and
  12034. // ready to be split into comparators.
  12035. var compRe = loose ? safeRe[t.COMPARATORLOOSE] : safeRe[t.COMPARATOR]
  12036. var set = range.split(' ').map(function (comp) {
  12037. return parseComparator(comp, this.options)
  12038. }, this).join(' ').split(/\s+/)
  12039. if (this.options.loose) {
  12040. // in loose mode, throw out any that are not valid comparators
  12041. set = set.filter(function (comp) {
  12042. return !!comp.match(compRe)
  12043. })
  12044. }
  12045. set = set.map(function (comp) {
  12046. return new Comparator(comp, this.options)
  12047. }, this)
  12048. return set
  12049. }
  12050. Range.prototype.intersects = function (range, options) {
  12051. if (!(range instanceof Range)) {
  12052. throw new TypeError('a Range is required')
  12053. }
  12054. return this.set.some(function (thisComparators) {
  12055. return (
  12056. isSatisfiable(thisComparators, options) &&
  12057. range.set.some(function (rangeComparators) {
  12058. return (
  12059. isSatisfiable(rangeComparators, options) &&
  12060. thisComparators.every(function (thisComparator) {
  12061. return rangeComparators.every(function (rangeComparator) {
  12062. return thisComparator.intersects(rangeComparator, options)
  12063. })
  12064. })
  12065. )
  12066. })
  12067. )
  12068. })
  12069. }
  12070. // take a set of comparators and determine whether there
  12071. // exists a version which can satisfy it
  12072. function isSatisfiable (comparators, options) {
  12073. var result = true
  12074. var remainingComparators = comparators.slice()
  12075. var testComparator = remainingComparators.pop()
  12076. while (result && remainingComparators.length) {
  12077. result = remainingComparators.every(function (otherComparator) {
  12078. return testComparator.intersects(otherComparator, options)
  12079. })
  12080. testComparator = remainingComparators.pop()
  12081. }
  12082. return result
  12083. }
  12084. // Mostly just for testing and legacy API reasons
  12085. exports.toComparators = toComparators
  12086. function toComparators (range, options) {
  12087. return new Range(range, options).set.map(function (comp) {
  12088. return comp.map(function (c) {
  12089. return c.value
  12090. }).join(' ').trim().split(' ')
  12091. })
  12092. }
  12093. // comprised of xranges, tildes, stars, and gtlt's at this point.
  12094. // already replaced the hyphen ranges
  12095. // turn into a set of JUST comparators.
  12096. function parseComparator (comp, options) {
  12097. debug('comp', comp, options)
  12098. comp = replaceCarets(comp, options)
  12099. debug('caret', comp)
  12100. comp = replaceTildes(comp, options)
  12101. debug('tildes', comp)
  12102. comp = replaceXRanges(comp, options)
  12103. debug('xrange', comp)
  12104. comp = replaceStars(comp, options)
  12105. debug('stars', comp)
  12106. return comp
  12107. }
  12108. function isX (id) {
  12109. return !id || id.toLowerCase() === 'x' || id === '*'
  12110. }
  12111. // ~, ~> --> * (any, kinda silly)
  12112. // ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0
  12113. // ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0
  12114. // ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0
  12115. // ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0
  12116. // ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0
  12117. function replaceTildes (comp, options) {
  12118. return comp.trim().split(/\s+/).map(function (comp) {
  12119. return replaceTilde(comp, options)
  12120. }).join(' ')
  12121. }
  12122. function replaceTilde (comp, options) {
  12123. var r = options.loose ? safeRe[t.TILDELOOSE] : safeRe[t.TILDE]
  12124. return comp.replace(r, function (_, M, m, p, pr) {
  12125. debug('tilde', comp, _, M, m, p, pr)
  12126. var ret
  12127. if (isX(M)) {
  12128. ret = ''
  12129. } else if (isX(m)) {
  12130. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  12131. } else if (isX(p)) {
  12132. // ~1.2 == >=1.2.0 <1.3.0
  12133. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  12134. } else if (pr) {
  12135. debug('replaceTilde pr', pr)
  12136. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  12137. ' <' + M + '.' + (+m + 1) + '.0'
  12138. } else {
  12139. // ~1.2.3 == >=1.2.3 <1.3.0
  12140. ret = '>=' + M + '.' + m + '.' + p +
  12141. ' <' + M + '.' + (+m + 1) + '.0'
  12142. }
  12143. debug('tilde return', ret)
  12144. return ret
  12145. })
  12146. }
  12147. // ^ --> * (any, kinda silly)
  12148. // ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0
  12149. // ^2.0, ^2.0.x --> >=2.0.0 <3.0.0
  12150. // ^1.2, ^1.2.x --> >=1.2.0 <2.0.0
  12151. // ^1.2.3 --> >=1.2.3 <2.0.0
  12152. // ^1.2.0 --> >=1.2.0 <2.0.0
  12153. function replaceCarets (comp, options) {
  12154. return comp.trim().split(/\s+/).map(function (comp) {
  12155. return replaceCaret(comp, options)
  12156. }).join(' ')
  12157. }
  12158. function replaceCaret (comp, options) {
  12159. debug('caret', comp, options)
  12160. var r = options.loose ? safeRe[t.CARETLOOSE] : safeRe[t.CARET]
  12161. return comp.replace(r, function (_, M, m, p, pr) {
  12162. debug('caret', comp, _, M, m, p, pr)
  12163. var ret
  12164. if (isX(M)) {
  12165. ret = ''
  12166. } else if (isX(m)) {
  12167. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  12168. } else if (isX(p)) {
  12169. if (M === '0') {
  12170. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  12171. } else {
  12172. ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0'
  12173. }
  12174. } else if (pr) {
  12175. debug('replaceCaret pr', pr)
  12176. if (M === '0') {
  12177. if (m === '0') {
  12178. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  12179. ' <' + M + '.' + m + '.' + (+p + 1)
  12180. } else {
  12181. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  12182. ' <' + M + '.' + (+m + 1) + '.0'
  12183. }
  12184. } else {
  12185. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  12186. ' <' + (+M + 1) + '.0.0'
  12187. }
  12188. } else {
  12189. debug('no pr')
  12190. if (M === '0') {
  12191. if (m === '0') {
  12192. ret = '>=' + M + '.' + m + '.' + p +
  12193. ' <' + M + '.' + m + '.' + (+p + 1)
  12194. } else {
  12195. ret = '>=' + M + '.' + m + '.' + p +
  12196. ' <' + M + '.' + (+m + 1) + '.0'
  12197. }
  12198. } else {
  12199. ret = '>=' + M + '.' + m + '.' + p +
  12200. ' <' + (+M + 1) + '.0.0'
  12201. }
  12202. }
  12203. debug('caret return', ret)
  12204. return ret
  12205. })
  12206. }
  12207. function replaceXRanges (comp, options) {
  12208. debug('replaceXRanges', comp, options)
  12209. return comp.split(/\s+/).map(function (comp) {
  12210. return replaceXRange(comp, options)
  12211. }).join(' ')
  12212. }
  12213. function replaceXRange (comp, options) {
  12214. comp = comp.trim()
  12215. var r = options.loose ? safeRe[t.XRANGELOOSE] : safeRe[t.XRANGE]
  12216. return comp.replace(r, function (ret, gtlt, M, m, p, pr) {
  12217. debug('xRange', comp, ret, gtlt, M, m, p, pr)
  12218. var xM = isX(M)
  12219. var xm = xM || isX(m)
  12220. var xp = xm || isX(p)
  12221. var anyX = xp
  12222. if (gtlt === '=' && anyX) {
  12223. gtlt = ''
  12224. }
  12225. // if we're including prereleases in the match, then we need
  12226. // to fix this to -0, the lowest possible prerelease value
  12227. pr = options.includePrerelease ? '-0' : ''
  12228. if (xM) {
  12229. if (gtlt === '>' || gtlt === '<') {
  12230. // nothing is allowed
  12231. ret = '<0.0.0-0'
  12232. } else {
  12233. // nothing is forbidden
  12234. ret = '*'
  12235. }
  12236. } else if (gtlt && anyX) {
  12237. // we know patch is an x, because we have any x at all.
  12238. // replace X with 0
  12239. if (xm) {
  12240. m = 0
  12241. }
  12242. p = 0
  12243. if (gtlt === '>') {
  12244. // >1 => >=2.0.0
  12245. // >1.2 => >=1.3.0
  12246. // >1.2.3 => >= 1.2.4
  12247. gtlt = '>='
  12248. if (xm) {
  12249. M = +M + 1
  12250. m = 0
  12251. p = 0
  12252. } else {
  12253. m = +m + 1
  12254. p = 0
  12255. }
  12256. } else if (gtlt === '<=') {
  12257. // <=0.7.x is actually <0.8.0, since any 0.7.x should
  12258. // pass. Similarly, <=7.x is actually <8.0.0, etc.
  12259. gtlt = '<'
  12260. if (xm) {
  12261. M = +M + 1
  12262. } else {
  12263. m = +m + 1
  12264. }
  12265. }
  12266. ret = gtlt + M + '.' + m + '.' + p + pr
  12267. } else if (xm) {
  12268. ret = '>=' + M + '.0.0' + pr + ' <' + (+M + 1) + '.0.0' + pr
  12269. } else if (xp) {
  12270. ret = '>=' + M + '.' + m + '.0' + pr +
  12271. ' <' + M + '.' + (+m + 1) + '.0' + pr
  12272. }
  12273. debug('xRange return', ret)
  12274. return ret
  12275. })
  12276. }
  12277. // Because * is AND-ed with everything else in the comparator,
  12278. // and '' means "any version", just remove the *s entirely.
  12279. function replaceStars (comp, options) {
  12280. debug('replaceStars', comp, options)
  12281. // Looseness is ignored here. star is always as loose as it gets!
  12282. return comp.trim().replace(safeRe[t.STAR], '')
  12283. }
  12284. // This function is passed to string.replace(re[t.HYPHENRANGE])
  12285. // M, m, patch, prerelease, build
  12286. // 1.2 - 3.4.5 => >=1.2.0 <=3.4.5
  12287. // 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do
  12288. // 1.2 - 3.4 => >=1.2.0 <3.5.0
  12289. function hyphenReplace ($0,
  12290. from, fM, fm, fp, fpr, fb,
  12291. to, tM, tm, tp, tpr, tb) {
  12292. if (isX(fM)) {
  12293. from = ''
  12294. } else if (isX(fm)) {
  12295. from = '>=' + fM + '.0.0'
  12296. } else if (isX(fp)) {
  12297. from = '>=' + fM + '.' + fm + '.0'
  12298. } else {
  12299. from = '>=' + from
  12300. }
  12301. if (isX(tM)) {
  12302. to = ''
  12303. } else if (isX(tm)) {
  12304. to = '<' + (+tM + 1) + '.0.0'
  12305. } else if (isX(tp)) {
  12306. to = '<' + tM + '.' + (+tm + 1) + '.0'
  12307. } else if (tpr) {
  12308. to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr
  12309. } else {
  12310. to = '<=' + to
  12311. }
  12312. return (from + ' ' + to).trim()
  12313. }
  12314. // if ANY of the sets match ALL of its comparators, then pass
  12315. Range.prototype.test = function (version) {
  12316. if (!version) {
  12317. return false
  12318. }
  12319. if (typeof version === 'string') {
  12320. try {
  12321. version = new SemVer(version, this.options)
  12322. } catch (er) {
  12323. return false
  12324. }
  12325. }
  12326. for (var i = 0; i < this.set.length; i++) {
  12327. if (testSet(this.set[i], version, this.options)) {
  12328. return true
  12329. }
  12330. }
  12331. return false
  12332. }
  12333. function testSet (set, version, options) {
  12334. for (var i = 0; i < set.length; i++) {
  12335. if (!set[i].test(version)) {
  12336. return false
  12337. }
  12338. }
  12339. if (version.prerelease.length && !options.includePrerelease) {
  12340. // Find the set of versions that are allowed to have prereleases
  12341. // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0
  12342. // That should allow `1.2.3-pr.2` to pass.
  12343. // However, `1.2.4-alpha.notready` should NOT be allowed,
  12344. // even though it's within the range set by the comparators.
  12345. for (i = 0; i < set.length; i++) {
  12346. debug(set[i].semver)
  12347. if (set[i].semver === ANY) {
  12348. continue
  12349. }
  12350. if (set[i].semver.prerelease.length > 0) {
  12351. var allowed = set[i].semver
  12352. if (allowed.major === version.major &&
  12353. allowed.minor === version.minor &&
  12354. allowed.patch === version.patch) {
  12355. return true
  12356. }
  12357. }
  12358. }
  12359. // Version has a -pre, but it's not one of the ones we like.
  12360. return false
  12361. }
  12362. return true
  12363. }
  12364. exports.satisfies = satisfies
  12365. function satisfies (version, range, options) {
  12366. try {
  12367. range = new Range(range, options)
  12368. } catch (er) {
  12369. return false
  12370. }
  12371. return range.test(version)
  12372. }
  12373. exports.maxSatisfying = maxSatisfying
  12374. function maxSatisfying (versions, range, options) {
  12375. var max = null
  12376. var maxSV = null
  12377. try {
  12378. var rangeObj = new Range(range, options)
  12379. } catch (er) {
  12380. return null
  12381. }
  12382. versions.forEach(function (v) {
  12383. if (rangeObj.test(v)) {
  12384. // satisfies(v, range, options)
  12385. if (!max || maxSV.compare(v) === -1) {
  12386. // compare(max, v, true)
  12387. max = v
  12388. maxSV = new SemVer(max, options)
  12389. }
  12390. }
  12391. })
  12392. return max
  12393. }
  12394. exports.minSatisfying = minSatisfying
  12395. function minSatisfying (versions, range, options) {
  12396. var min = null
  12397. var minSV = null
  12398. try {
  12399. var rangeObj = new Range(range, options)
  12400. } catch (er) {
  12401. return null
  12402. }
  12403. versions.forEach(function (v) {
  12404. if (rangeObj.test(v)) {
  12405. // satisfies(v, range, options)
  12406. if (!min || minSV.compare(v) === 1) {
  12407. // compare(min, v, true)
  12408. min = v
  12409. minSV = new SemVer(min, options)
  12410. }
  12411. }
  12412. })
  12413. return min
  12414. }
  12415. exports.minVersion = minVersion
  12416. function minVersion (range, loose) {
  12417. range = new Range(range, loose)
  12418. var minver = new SemVer('0.0.0')
  12419. if (range.test(minver)) {
  12420. return minver
  12421. }
  12422. minver = new SemVer('0.0.0-0')
  12423. if (range.test(minver)) {
  12424. return minver
  12425. }
  12426. minver = null
  12427. for (var i = 0; i < range.set.length; ++i) {
  12428. var comparators = range.set[i]
  12429. comparators.forEach(function (comparator) {
  12430. // Clone to avoid manipulating the comparator's semver object.
  12431. var compver = new SemVer(comparator.semver.version)
  12432. switch (comparator.operator) {
  12433. case '>':
  12434. if (compver.prerelease.length === 0) {
  12435. compver.patch++
  12436. } else {
  12437. compver.prerelease.push(0)
  12438. }
  12439. compver.raw = compver.format()
  12440. /* fallthrough */
  12441. case '':
  12442. case '>=':
  12443. if (!minver || gt(minver, compver)) {
  12444. minver = compver
  12445. }
  12446. break
  12447. case '<':
  12448. case '<=':
  12449. /* Ignore maximum versions */
  12450. break
  12451. /* istanbul ignore next */
  12452. default:
  12453. throw new Error('Unexpected operation: ' + comparator.operator)
  12454. }
  12455. })
  12456. }
  12457. if (minver && range.test(minver)) {
  12458. return minver
  12459. }
  12460. return null
  12461. }
  12462. exports.validRange = validRange
  12463. function validRange (range, options) {
  12464. try {
  12465. // Return '*' instead of '' so that truthiness works.
  12466. // This will throw if it's invalid anyway
  12467. return new Range(range, options).range || '*'
  12468. } catch (er) {
  12469. return null
  12470. }
  12471. }
  12472. // Determine if version is less than all the versions possible in the range
  12473. exports.ltr = ltr
  12474. function ltr (version, range, options) {
  12475. return outside(version, range, '<', options)
  12476. }
  12477. // Determine if version is greater than all the versions possible in the range.
  12478. exports.gtr = gtr
  12479. function gtr (version, range, options) {
  12480. return outside(version, range, '>', options)
  12481. }
  12482. exports.outside = outside
  12483. function outside (version, range, hilo, options) {
  12484. version = new SemVer(version, options)
  12485. range = new Range(range, options)
  12486. var gtfn, ltefn, ltfn, comp, ecomp
  12487. switch (hilo) {
  12488. case '>':
  12489. gtfn = gt
  12490. ltefn = lte
  12491. ltfn = lt
  12492. comp = '>'
  12493. ecomp = '>='
  12494. break
  12495. case '<':
  12496. gtfn = lt
  12497. ltefn = gte
  12498. ltfn = gt
  12499. comp = '<'
  12500. ecomp = '<='
  12501. break
  12502. default:
  12503. throw new TypeError('Must provide a hilo val of "<" or ">"')
  12504. }
  12505. // If it satisifes the range it is not outside
  12506. if (satisfies(version, range, options)) {
  12507. return false
  12508. }
  12509. // From now on, variable terms are as if we're in "gtr" mode.
  12510. // but note that everything is flipped for the "ltr" function.
  12511. for (var i = 0; i < range.set.length; ++i) {
  12512. var comparators = range.set[i]
  12513. var high = null
  12514. var low = null
  12515. comparators.forEach(function (comparator) {
  12516. if (comparator.semver === ANY) {
  12517. comparator = new Comparator('>=0.0.0')
  12518. }
  12519. high = high || comparator
  12520. low = low || comparator
  12521. if (gtfn(comparator.semver, high.semver, options)) {
  12522. high = comparator
  12523. } else if (ltfn(comparator.semver, low.semver, options)) {
  12524. low = comparator
  12525. }
  12526. })
  12527. // If the edge version comparator has a operator then our version
  12528. // isn't outside it
  12529. if (high.operator === comp || high.operator === ecomp) {
  12530. return false
  12531. }
  12532. // If the lowest version comparator has an operator and our version
  12533. // is less than it then it isn't higher than the range
  12534. if ((!low.operator || low.operator === comp) &&
  12535. ltefn(version, low.semver)) {
  12536. return false
  12537. } else if (low.operator === ecomp && ltfn(version, low.semver)) {
  12538. return false
  12539. }
  12540. }
  12541. return true
  12542. }
  12543. exports.prerelease = prerelease
  12544. function prerelease (version, options) {
  12545. var parsed = parse(version, options)
  12546. return (parsed && parsed.prerelease.length) ? parsed.prerelease : null
  12547. }
  12548. exports.intersects = intersects
  12549. function intersects (r1, r2, options) {
  12550. r1 = new Range(r1, options)
  12551. r2 = new Range(r2, options)
  12552. return r1.intersects(r2)
  12553. }
  12554. exports.coerce = coerce
  12555. function coerce (version, options) {
  12556. if (version instanceof SemVer) {
  12557. return version
  12558. }
  12559. if (typeof version === 'number') {
  12560. version = String(version)
  12561. }
  12562. if (typeof version !== 'string') {
  12563. return null
  12564. }
  12565. options = options || {}
  12566. var match = null
  12567. if (!options.rtl) {
  12568. match = version.match(safeRe[t.COERCE])
  12569. } else {
  12570. // Find the right-most coercible string that does not share
  12571. // a terminus with a more left-ward coercible string.
  12572. // Eg, '1.2.3.4' wants to coerce '2.3.4', not '3.4' or '4'
  12573. //
  12574. // Walk through the string checking with a /g regexp
  12575. // Manually set the index so as to pick up overlapping matches.
  12576. // Stop when we get a match that ends at the string end, since no
  12577. // coercible string can be more right-ward without the same terminus.
  12578. var next
  12579. while ((next = safeRe[t.COERCERTL].exec(version)) &&
  12580. (!match || match.index + match[0].length !== version.length)
  12581. ) {
  12582. if (!match ||
  12583. next.index + next[0].length !== match.index + match[0].length) {
  12584. match = next
  12585. }
  12586. safeRe[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length
  12587. }
  12588. // leave it in a clean state
  12589. safeRe[t.COERCERTL].lastIndex = -1
  12590. }
  12591. if (match === null) {
  12592. return null
  12593. }
  12594. return parse(match[2] +
  12595. '.' + (match[3] || '0') +
  12596. '.' + (match[4] || '0'), options)
  12597. }
  12598. /***/ }),
  12599. /***/ 4294:
  12600. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  12601. module.exports = __nccwpck_require__(4219);
  12602. /***/ }),
  12603. /***/ 4219:
  12604. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  12605. "use strict";
  12606. var net = __nccwpck_require__(1808);
  12607. var tls = __nccwpck_require__(4404);
  12608. var http = __nccwpck_require__(3685);
  12609. var https = __nccwpck_require__(5687);
  12610. var events = __nccwpck_require__(2361);
  12611. var assert = __nccwpck_require__(9491);
  12612. var util = __nccwpck_require__(3837);
  12613. exports.httpOverHttp = httpOverHttp;
  12614. exports.httpsOverHttp = httpsOverHttp;
  12615. exports.httpOverHttps = httpOverHttps;
  12616. exports.httpsOverHttps = httpsOverHttps;
  12617. function httpOverHttp(options) {
  12618. var agent = new TunnelingAgent(options);
  12619. agent.request = http.request;
  12620. return agent;
  12621. }
  12622. function httpsOverHttp(options) {
  12623. var agent = new TunnelingAgent(options);
  12624. agent.request = http.request;
  12625. agent.createSocket = createSecureSocket;
  12626. agent.defaultPort = 443;
  12627. return agent;
  12628. }
  12629. function httpOverHttps(options) {
  12630. var agent = new TunnelingAgent(options);
  12631. agent.request = https.request;
  12632. return agent;
  12633. }
  12634. function httpsOverHttps(options) {
  12635. var agent = new TunnelingAgent(options);
  12636. agent.request = https.request;
  12637. agent.createSocket = createSecureSocket;
  12638. agent.defaultPort = 443;
  12639. return agent;
  12640. }
  12641. function TunnelingAgent(options) {
  12642. var self = this;
  12643. self.options = options || {};
  12644. self.proxyOptions = self.options.proxy || {};
  12645. self.maxSockets = self.options.maxSockets || http.Agent.defaultMaxSockets;
  12646. self.requests = [];
  12647. self.sockets = [];
  12648. self.on('free', function onFree(socket, host, port, localAddress) {
  12649. var options = toOptions(host, port, localAddress);
  12650. for (var i = 0, len = self.requests.length; i < len; ++i) {
  12651. var pending = self.requests[i];
  12652. if (pending.host === options.host && pending.port === options.port) {
  12653. // Detect the request to connect same origin server,
  12654. // reuse the connection.
  12655. self.requests.splice(i, 1);
  12656. pending.request.onSocket(socket);
  12657. return;
  12658. }
  12659. }
  12660. socket.destroy();
  12661. self.removeSocket(socket);
  12662. });
  12663. }
  12664. util.inherits(TunnelingAgent, events.EventEmitter);
  12665. TunnelingAgent.prototype.addRequest = function addRequest(req, host, port, localAddress) {
  12666. var self = this;
  12667. var options = mergeOptions({request: req}, self.options, toOptions(host, port, localAddress));
  12668. if (self.sockets.length >= this.maxSockets) {
  12669. // We are over limit so we'll add it to the queue.
  12670. self.requests.push(options);
  12671. return;
  12672. }
  12673. // If we are under maxSockets create a new one.
  12674. self.createSocket(options, function(socket) {
  12675. socket.on('free', onFree);
  12676. socket.on('close', onCloseOrRemove);
  12677. socket.on('agentRemove', onCloseOrRemove);
  12678. req.onSocket(socket);
  12679. function onFree() {
  12680. self.emit('free', socket, options);
  12681. }
  12682. function onCloseOrRemove(err) {
  12683. self.removeSocket(socket);
  12684. socket.removeListener('free', onFree);
  12685. socket.removeListener('close', onCloseOrRemove);
  12686. socket.removeListener('agentRemove', onCloseOrRemove);
  12687. }
  12688. });
  12689. };
  12690. TunnelingAgent.prototype.createSocket = function createSocket(options, cb) {
  12691. var self = this;
  12692. var placeholder = {};
  12693. self.sockets.push(placeholder);
  12694. var connectOptions = mergeOptions({}, self.proxyOptions, {
  12695. method: 'CONNECT',
  12696. path: options.host + ':' + options.port,
  12697. agent: false,
  12698. headers: {
  12699. host: options.host + ':' + options.port
  12700. }
  12701. });
  12702. if (options.localAddress) {
  12703. connectOptions.localAddress = options.localAddress;
  12704. }
  12705. if (connectOptions.proxyAuth) {
  12706. connectOptions.headers = connectOptions.headers || {};
  12707. connectOptions.headers['Proxy-Authorization'] = 'Basic ' +
  12708. new Buffer(connectOptions.proxyAuth).toString('base64');
  12709. }
  12710. debug('making CONNECT request');
  12711. var connectReq = self.request(connectOptions);
  12712. connectReq.useChunkedEncodingByDefault = false; // for v0.6
  12713. connectReq.once('response', onResponse); // for v0.6
  12714. connectReq.once('upgrade', onUpgrade); // for v0.6
  12715. connectReq.once('connect', onConnect); // for v0.7 or later
  12716. connectReq.once('error', onError);
  12717. connectReq.end();
  12718. function onResponse(res) {
  12719. // Very hacky. This is necessary to avoid http-parser leaks.
  12720. res.upgrade = true;
  12721. }
  12722. function onUpgrade(res, socket, head) {
  12723. // Hacky.
  12724. process.nextTick(function() {
  12725. onConnect(res, socket, head);
  12726. });
  12727. }
  12728. function onConnect(res, socket, head) {
  12729. connectReq.removeAllListeners();
  12730. socket.removeAllListeners();
  12731. if (res.statusCode !== 200) {
  12732. debug('tunneling socket could not be established, statusCode=%d',
  12733. res.statusCode);
  12734. socket.destroy();
  12735. var error = new Error('tunneling socket could not be established, ' +
  12736. 'statusCode=' + res.statusCode);
  12737. error.code = 'ECONNRESET';
  12738. options.request.emit('error', error);
  12739. self.removeSocket(placeholder);
  12740. return;
  12741. }
  12742. if (head.length > 0) {
  12743. debug('got illegal response body from proxy');
  12744. socket.destroy();
  12745. var error = new Error('got illegal response body from proxy');
  12746. error.code = 'ECONNRESET';
  12747. options.request.emit('error', error);
  12748. self.removeSocket(placeholder);
  12749. return;
  12750. }
  12751. debug('tunneling connection has established');
  12752. self.sockets[self.sockets.indexOf(placeholder)] = socket;
  12753. return cb(socket);
  12754. }
  12755. function onError(cause) {
  12756. connectReq.removeAllListeners();
  12757. debug('tunneling socket could not be established, cause=%s\n',
  12758. cause.message, cause.stack);
  12759. var error = new Error('tunneling socket could not be established, ' +
  12760. 'cause=' + cause.message);
  12761. error.code = 'ECONNRESET';
  12762. options.request.emit('error', error);
  12763. self.removeSocket(placeholder);
  12764. }
  12765. };
  12766. TunnelingAgent.prototype.removeSocket = function removeSocket(socket) {
  12767. var pos = this.sockets.indexOf(socket)
  12768. if (pos === -1) {
  12769. return;
  12770. }
  12771. this.sockets.splice(pos, 1);
  12772. var pending = this.requests.shift();
  12773. if (pending) {
  12774. // If we have pending requests and a socket gets closed a new one
  12775. // needs to be created to take over in the pool for the one that closed.
  12776. this.createSocket(pending, function(socket) {
  12777. pending.request.onSocket(socket);
  12778. });
  12779. }
  12780. };
  12781. function createSecureSocket(options, cb) {
  12782. var self = this;
  12783. TunnelingAgent.prototype.createSocket.call(self, options, function(socket) {
  12784. var hostHeader = options.request.getHeader('host');
  12785. var tlsOptions = mergeOptions({}, self.options, {
  12786. socket: socket,
  12787. servername: hostHeader ? hostHeader.replace(/:.*$/, '') : options.host
  12788. });
  12789. // 0 is dummy port for v0.6
  12790. var secureSocket = tls.connect(0, tlsOptions);
  12791. self.sockets[self.sockets.indexOf(socket)] = secureSocket;
  12792. cb(secureSocket);
  12793. });
  12794. }
  12795. function toOptions(host, port, localAddress) {
  12796. if (typeof host === 'string') { // since v0.10
  12797. return {
  12798. host: host,
  12799. port: port,
  12800. localAddress: localAddress
  12801. };
  12802. }
  12803. return host; // for v0.11 or later
  12804. }
  12805. function mergeOptions(target) {
  12806. for (var i = 1, len = arguments.length; i < len; ++i) {
  12807. var overrides = arguments[i];
  12808. if (typeof overrides === 'object') {
  12809. var keys = Object.keys(overrides);
  12810. for (var j = 0, keyLen = keys.length; j < keyLen; ++j) {
  12811. var k = keys[j];
  12812. if (overrides[k] !== undefined) {
  12813. target[k] = overrides[k];
  12814. }
  12815. }
  12816. }
  12817. }
  12818. return target;
  12819. }
  12820. var debug;
  12821. if (process.env.NODE_DEBUG && /\btunnel\b/.test(process.env.NODE_DEBUG)) {
  12822. debug = function() {
  12823. var args = Array.prototype.slice.call(arguments);
  12824. if (typeof args[0] === 'string') {
  12825. args[0] = 'TUNNEL: ' + args[0];
  12826. } else {
  12827. args.unshift('TUNNEL:');
  12828. }
  12829. console.error.apply(console, args);
  12830. }
  12831. } else {
  12832. debug = function() {};
  12833. }
  12834. exports.debug = debug; // for test
  12835. /***/ }),
  12836. /***/ 1773:
  12837. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  12838. "use strict";
  12839. const Client = __nccwpck_require__(3598)
  12840. const Dispatcher = __nccwpck_require__(412)
  12841. const errors = __nccwpck_require__(8045)
  12842. const Pool = __nccwpck_require__(4634)
  12843. const BalancedPool = __nccwpck_require__(7931)
  12844. const Agent = __nccwpck_require__(7890)
  12845. const util = __nccwpck_require__(3983)
  12846. const { InvalidArgumentError } = errors
  12847. const api = __nccwpck_require__(4059)
  12848. const buildConnector = __nccwpck_require__(2067)
  12849. const MockClient = __nccwpck_require__(8687)
  12850. const MockAgent = __nccwpck_require__(6771)
  12851. const MockPool = __nccwpck_require__(6193)
  12852. const mockErrors = __nccwpck_require__(888)
  12853. const ProxyAgent = __nccwpck_require__(7858)
  12854. const RetryHandler = __nccwpck_require__(2286)
  12855. const { getGlobalDispatcher, setGlobalDispatcher } = __nccwpck_require__(1892)
  12856. const DecoratorHandler = __nccwpck_require__(6930)
  12857. const RedirectHandler = __nccwpck_require__(2860)
  12858. const createRedirectInterceptor = __nccwpck_require__(8861)
  12859. let hasCrypto
  12860. try {
  12861. __nccwpck_require__(6113)
  12862. hasCrypto = true
  12863. } catch {
  12864. hasCrypto = false
  12865. }
  12866. Object.assign(Dispatcher.prototype, api)
  12867. module.exports.Dispatcher = Dispatcher
  12868. module.exports.Client = Client
  12869. module.exports.Pool = Pool
  12870. module.exports.BalancedPool = BalancedPool
  12871. module.exports.Agent = Agent
  12872. module.exports.ProxyAgent = ProxyAgent
  12873. module.exports.RetryHandler = RetryHandler
  12874. module.exports.DecoratorHandler = DecoratorHandler
  12875. module.exports.RedirectHandler = RedirectHandler
  12876. module.exports.createRedirectInterceptor = createRedirectInterceptor
  12877. module.exports.buildConnector = buildConnector
  12878. module.exports.errors = errors
  12879. function makeDispatcher (fn) {
  12880. return (url, opts, handler) => {
  12881. if (typeof opts === 'function') {
  12882. handler = opts
  12883. opts = null
  12884. }
  12885. if (!url || (typeof url !== 'string' && typeof url !== 'object' && !(url instanceof URL))) {
  12886. throw new InvalidArgumentError('invalid url')
  12887. }
  12888. if (opts != null && typeof opts !== 'object') {
  12889. throw new InvalidArgumentError('invalid opts')
  12890. }
  12891. if (opts && opts.path != null) {
  12892. if (typeof opts.path !== 'string') {
  12893. throw new InvalidArgumentError('invalid opts.path')
  12894. }
  12895. let path = opts.path
  12896. if (!opts.path.startsWith('/')) {
  12897. path = `/${path}`
  12898. }
  12899. url = new URL(util.parseOrigin(url).origin + path)
  12900. } else {
  12901. if (!opts) {
  12902. opts = typeof url === 'object' ? url : {}
  12903. }
  12904. url = util.parseURL(url)
  12905. }
  12906. const { agent, dispatcher = getGlobalDispatcher() } = opts
  12907. if (agent) {
  12908. throw new InvalidArgumentError('unsupported opts.agent. Did you mean opts.client?')
  12909. }
  12910. return fn.call(dispatcher, {
  12911. ...opts,
  12912. origin: url.origin,
  12913. path: url.search ? `${url.pathname}${url.search}` : url.pathname,
  12914. method: opts.method || (opts.body ? 'PUT' : 'GET')
  12915. }, handler)
  12916. }
  12917. }
  12918. module.exports.setGlobalDispatcher = setGlobalDispatcher
  12919. module.exports.getGlobalDispatcher = getGlobalDispatcher
  12920. if (util.nodeMajor > 16 || (util.nodeMajor === 16 && util.nodeMinor >= 8)) {
  12921. let fetchImpl = null
  12922. module.exports.fetch = async function fetch (resource) {
  12923. if (!fetchImpl) {
  12924. fetchImpl = (__nccwpck_require__(4881).fetch)
  12925. }
  12926. try {
  12927. return await fetchImpl(...arguments)
  12928. } catch (err) {
  12929. if (typeof err === 'object') {
  12930. Error.captureStackTrace(err, this)
  12931. }
  12932. throw err
  12933. }
  12934. }
  12935. module.exports.Headers = __nccwpck_require__(554).Headers
  12936. module.exports.Response = __nccwpck_require__(7823).Response
  12937. module.exports.Request = __nccwpck_require__(8359).Request
  12938. module.exports.FormData = __nccwpck_require__(2015).FormData
  12939. module.exports.File = __nccwpck_require__(8511).File
  12940. module.exports.FileReader = __nccwpck_require__(1446).FileReader
  12941. const { setGlobalOrigin, getGlobalOrigin } = __nccwpck_require__(1246)
  12942. module.exports.setGlobalOrigin = setGlobalOrigin
  12943. module.exports.getGlobalOrigin = getGlobalOrigin
  12944. const { CacheStorage } = __nccwpck_require__(7907)
  12945. const { kConstruct } = __nccwpck_require__(9174)
  12946. // Cache & CacheStorage are tightly coupled with fetch. Even if it may run
  12947. // in an older version of Node, it doesn't have any use without fetch.
  12948. module.exports.caches = new CacheStorage(kConstruct)
  12949. }
  12950. if (util.nodeMajor >= 16) {
  12951. const { deleteCookie, getCookies, getSetCookies, setCookie } = __nccwpck_require__(1724)
  12952. module.exports.deleteCookie = deleteCookie
  12953. module.exports.getCookies = getCookies
  12954. module.exports.getSetCookies = getSetCookies
  12955. module.exports.setCookie = setCookie
  12956. const { parseMIMEType, serializeAMimeType } = __nccwpck_require__(685)
  12957. module.exports.parseMIMEType = parseMIMEType
  12958. module.exports.serializeAMimeType = serializeAMimeType
  12959. }
  12960. if (util.nodeMajor >= 18 && hasCrypto) {
  12961. const { WebSocket } = __nccwpck_require__(4284)
  12962. module.exports.WebSocket = WebSocket
  12963. }
  12964. module.exports.request = makeDispatcher(api.request)
  12965. module.exports.stream = makeDispatcher(api.stream)
  12966. module.exports.pipeline = makeDispatcher(api.pipeline)
  12967. module.exports.connect = makeDispatcher(api.connect)
  12968. module.exports.upgrade = makeDispatcher(api.upgrade)
  12969. module.exports.MockClient = MockClient
  12970. module.exports.MockPool = MockPool
  12971. module.exports.MockAgent = MockAgent
  12972. module.exports.mockErrors = mockErrors
  12973. /***/ }),
  12974. /***/ 7890:
  12975. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  12976. "use strict";
  12977. const { InvalidArgumentError } = __nccwpck_require__(8045)
  12978. const { kClients, kRunning, kClose, kDestroy, kDispatch, kInterceptors } = __nccwpck_require__(2785)
  12979. const DispatcherBase = __nccwpck_require__(4839)
  12980. const Pool = __nccwpck_require__(4634)
  12981. const Client = __nccwpck_require__(3598)
  12982. const util = __nccwpck_require__(3983)
  12983. const createRedirectInterceptor = __nccwpck_require__(8861)
  12984. const { WeakRef, FinalizationRegistry } = __nccwpck_require__(6436)()
  12985. const kOnConnect = Symbol('onConnect')
  12986. const kOnDisconnect = Symbol('onDisconnect')
  12987. const kOnConnectionError = Symbol('onConnectionError')
  12988. const kMaxRedirections = Symbol('maxRedirections')
  12989. const kOnDrain = Symbol('onDrain')
  12990. const kFactory = Symbol('factory')
  12991. const kFinalizer = Symbol('finalizer')
  12992. const kOptions = Symbol('options')
  12993. function defaultFactory (origin, opts) {
  12994. return opts && opts.connections === 1
  12995. ? new Client(origin, opts)
  12996. : new Pool(origin, opts)
  12997. }
  12998. class Agent extends DispatcherBase {
  12999. constructor ({ factory = defaultFactory, maxRedirections = 0, connect, ...options } = {}) {
  13000. super()
  13001. if (typeof factory !== 'function') {
  13002. throw new InvalidArgumentError('factory must be a function.')
  13003. }
  13004. if (connect != null && typeof connect !== 'function' && typeof connect !== 'object') {
  13005. throw new InvalidArgumentError('connect must be a function or an object')
  13006. }
  13007. if (!Number.isInteger(maxRedirections) || maxRedirections < 0) {
  13008. throw new InvalidArgumentError('maxRedirections must be a positive number')
  13009. }
  13010. if (connect && typeof connect !== 'function') {
  13011. connect = { ...connect }
  13012. }
  13013. this[kInterceptors] = options.interceptors && options.interceptors.Agent && Array.isArray(options.interceptors.Agent)
  13014. ? options.interceptors.Agent
  13015. : [createRedirectInterceptor({ maxRedirections })]
  13016. this[kOptions] = { ...util.deepClone(options), connect }
  13017. this[kOptions].interceptors = options.interceptors
  13018. ? { ...options.interceptors }
  13019. : undefined
  13020. this[kMaxRedirections] = maxRedirections
  13021. this[kFactory] = factory
  13022. this[kClients] = new Map()
  13023. this[kFinalizer] = new FinalizationRegistry(/* istanbul ignore next: gc is undeterministic */ key => {
  13024. const ref = this[kClients].get(key)
  13025. if (ref !== undefined && ref.deref() === undefined) {
  13026. this[kClients].delete(key)
  13027. }
  13028. })
  13029. const agent = this
  13030. this[kOnDrain] = (origin, targets) => {
  13031. agent.emit('drain', origin, [agent, ...targets])
  13032. }
  13033. this[kOnConnect] = (origin, targets) => {
  13034. agent.emit('connect', origin, [agent, ...targets])
  13035. }
  13036. this[kOnDisconnect] = (origin, targets, err) => {
  13037. agent.emit('disconnect', origin, [agent, ...targets], err)
  13038. }
  13039. this[kOnConnectionError] = (origin, targets, err) => {
  13040. agent.emit('connectionError', origin, [agent, ...targets], err)
  13041. }
  13042. }
  13043. get [kRunning] () {
  13044. let ret = 0
  13045. for (const ref of this[kClients].values()) {
  13046. const client = ref.deref()
  13047. /* istanbul ignore next: gc is undeterministic */
  13048. if (client) {
  13049. ret += client[kRunning]
  13050. }
  13051. }
  13052. return ret
  13053. }
  13054. [kDispatch] (opts, handler) {
  13055. let key
  13056. if (opts.origin && (typeof opts.origin === 'string' || opts.origin instanceof URL)) {
  13057. key = String(opts.origin)
  13058. } else {
  13059. throw new InvalidArgumentError('opts.origin must be a non-empty string or URL.')
  13060. }
  13061. const ref = this[kClients].get(key)
  13062. let dispatcher = ref ? ref.deref() : null
  13063. if (!dispatcher) {
  13064. dispatcher = this[kFactory](opts.origin, this[kOptions])
  13065. .on('drain', this[kOnDrain])
  13066. .on('connect', this[kOnConnect])
  13067. .on('disconnect', this[kOnDisconnect])
  13068. .on('connectionError', this[kOnConnectionError])
  13069. this[kClients].set(key, new WeakRef(dispatcher))
  13070. this[kFinalizer].register(dispatcher, key)
  13071. }
  13072. return dispatcher.dispatch(opts, handler)
  13073. }
  13074. async [kClose] () {
  13075. const closePromises = []
  13076. for (const ref of this[kClients].values()) {
  13077. const client = ref.deref()
  13078. /* istanbul ignore else: gc is undeterministic */
  13079. if (client) {
  13080. closePromises.push(client.close())
  13081. }
  13082. }
  13083. await Promise.all(closePromises)
  13084. }
  13085. async [kDestroy] (err) {
  13086. const destroyPromises = []
  13087. for (const ref of this[kClients].values()) {
  13088. const client = ref.deref()
  13089. /* istanbul ignore else: gc is undeterministic */
  13090. if (client) {
  13091. destroyPromises.push(client.destroy(err))
  13092. }
  13093. }
  13094. await Promise.all(destroyPromises)
  13095. }
  13096. }
  13097. module.exports = Agent
  13098. /***/ }),
  13099. /***/ 7032:
  13100. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  13101. const { addAbortListener } = __nccwpck_require__(3983)
  13102. const { RequestAbortedError } = __nccwpck_require__(8045)
  13103. const kListener = Symbol('kListener')
  13104. const kSignal = Symbol('kSignal')
  13105. function abort (self) {
  13106. if (self.abort) {
  13107. self.abort()
  13108. } else {
  13109. self.onError(new RequestAbortedError())
  13110. }
  13111. }
  13112. function addSignal (self, signal) {
  13113. self[kSignal] = null
  13114. self[kListener] = null
  13115. if (!signal) {
  13116. return
  13117. }
  13118. if (signal.aborted) {
  13119. abort(self)
  13120. return
  13121. }
  13122. self[kSignal] = signal
  13123. self[kListener] = () => {
  13124. abort(self)
  13125. }
  13126. addAbortListener(self[kSignal], self[kListener])
  13127. }
  13128. function removeSignal (self) {
  13129. if (!self[kSignal]) {
  13130. return
  13131. }
  13132. if ('removeEventListener' in self[kSignal]) {
  13133. self[kSignal].removeEventListener('abort', self[kListener])
  13134. } else {
  13135. self[kSignal].removeListener('abort', self[kListener])
  13136. }
  13137. self[kSignal] = null
  13138. self[kListener] = null
  13139. }
  13140. module.exports = {
  13141. addSignal,
  13142. removeSignal
  13143. }
  13144. /***/ }),
  13145. /***/ 9744:
  13146. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  13147. "use strict";
  13148. const { AsyncResource } = __nccwpck_require__(852)
  13149. const { InvalidArgumentError, RequestAbortedError, SocketError } = __nccwpck_require__(8045)
  13150. const util = __nccwpck_require__(3983)
  13151. const { addSignal, removeSignal } = __nccwpck_require__(7032)
  13152. class ConnectHandler extends AsyncResource {
  13153. constructor (opts, callback) {
  13154. if (!opts || typeof opts !== 'object') {
  13155. throw new InvalidArgumentError('invalid opts')
  13156. }
  13157. if (typeof callback !== 'function') {
  13158. throw new InvalidArgumentError('invalid callback')
  13159. }
  13160. const { signal, opaque, responseHeaders } = opts
  13161. if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') {
  13162. throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget')
  13163. }
  13164. super('UNDICI_CONNECT')
  13165. this.opaque = opaque || null
  13166. this.responseHeaders = responseHeaders || null
  13167. this.callback = callback
  13168. this.abort = null
  13169. addSignal(this, signal)
  13170. }
  13171. onConnect (abort, context) {
  13172. if (!this.callback) {
  13173. throw new RequestAbortedError()
  13174. }
  13175. this.abort = abort
  13176. this.context = context
  13177. }
  13178. onHeaders () {
  13179. throw new SocketError('bad connect', null)
  13180. }
  13181. onUpgrade (statusCode, rawHeaders, socket) {
  13182. const { callback, opaque, context } = this
  13183. removeSignal(this)
  13184. this.callback = null
  13185. let headers = rawHeaders
  13186. // Indicates is an HTTP2Session
  13187. if (headers != null) {
  13188. headers = this.responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)
  13189. }
  13190. this.runInAsyncScope(callback, null, null, {
  13191. statusCode,
  13192. headers,
  13193. socket,
  13194. opaque,
  13195. context
  13196. })
  13197. }
  13198. onError (err) {
  13199. const { callback, opaque } = this
  13200. removeSignal(this)
  13201. if (callback) {
  13202. this.callback = null
  13203. queueMicrotask(() => {
  13204. this.runInAsyncScope(callback, null, err, { opaque })
  13205. })
  13206. }
  13207. }
  13208. }
  13209. function connect (opts, callback) {
  13210. if (callback === undefined) {
  13211. return new Promise((resolve, reject) => {
  13212. connect.call(this, opts, (err, data) => {
  13213. return err ? reject(err) : resolve(data)
  13214. })
  13215. })
  13216. }
  13217. try {
  13218. const connectHandler = new ConnectHandler(opts, callback)
  13219. this.dispatch({ ...opts, method: 'CONNECT' }, connectHandler)
  13220. } catch (err) {
  13221. if (typeof callback !== 'function') {
  13222. throw err
  13223. }
  13224. const opaque = opts && opts.opaque
  13225. queueMicrotask(() => callback(err, { opaque }))
  13226. }
  13227. }
  13228. module.exports = connect
  13229. /***/ }),
  13230. /***/ 8752:
  13231. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  13232. "use strict";
  13233. const {
  13234. Readable,
  13235. Duplex,
  13236. PassThrough
  13237. } = __nccwpck_require__(2781)
  13238. const {
  13239. InvalidArgumentError,
  13240. InvalidReturnValueError,
  13241. RequestAbortedError
  13242. } = __nccwpck_require__(8045)
  13243. const util = __nccwpck_require__(3983)
  13244. const { AsyncResource } = __nccwpck_require__(852)
  13245. const { addSignal, removeSignal } = __nccwpck_require__(7032)
  13246. const assert = __nccwpck_require__(9491)
  13247. const kResume = Symbol('resume')
  13248. class PipelineRequest extends Readable {
  13249. constructor () {
  13250. super({ autoDestroy: true })
  13251. this[kResume] = null
  13252. }
  13253. _read () {
  13254. const { [kResume]: resume } = this
  13255. if (resume) {
  13256. this[kResume] = null
  13257. resume()
  13258. }
  13259. }
  13260. _destroy (err, callback) {
  13261. this._read()
  13262. callback(err)
  13263. }
  13264. }
  13265. class PipelineResponse extends Readable {
  13266. constructor (resume) {
  13267. super({ autoDestroy: true })
  13268. this[kResume] = resume
  13269. }
  13270. _read () {
  13271. this[kResume]()
  13272. }
  13273. _destroy (err, callback) {
  13274. if (!err && !this._readableState.endEmitted) {
  13275. err = new RequestAbortedError()
  13276. }
  13277. callback(err)
  13278. }
  13279. }
  13280. class PipelineHandler extends AsyncResource {
  13281. constructor (opts, handler) {
  13282. if (!opts || typeof opts !== 'object') {
  13283. throw new InvalidArgumentError('invalid opts')
  13284. }
  13285. if (typeof handler !== 'function') {
  13286. throw new InvalidArgumentError('invalid handler')
  13287. }
  13288. const { signal, method, opaque, onInfo, responseHeaders } = opts
  13289. if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') {
  13290. throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget')
  13291. }
  13292. if (method === 'CONNECT') {
  13293. throw new InvalidArgumentError('invalid method')
  13294. }
  13295. if (onInfo && typeof onInfo !== 'function') {
  13296. throw new InvalidArgumentError('invalid onInfo callback')
  13297. }
  13298. super('UNDICI_PIPELINE')
  13299. this.opaque = opaque || null
  13300. this.responseHeaders = responseHeaders || null
  13301. this.handler = handler
  13302. this.abort = null
  13303. this.context = null
  13304. this.onInfo = onInfo || null
  13305. this.req = new PipelineRequest().on('error', util.nop)
  13306. this.ret = new Duplex({
  13307. readableObjectMode: opts.objectMode,
  13308. autoDestroy: true,
  13309. read: () => {
  13310. const { body } = this
  13311. if (body && body.resume) {
  13312. body.resume()
  13313. }
  13314. },
  13315. write: (chunk, encoding, callback) => {
  13316. const { req } = this
  13317. if (req.push(chunk, encoding) || req._readableState.destroyed) {
  13318. callback()
  13319. } else {
  13320. req[kResume] = callback
  13321. }
  13322. },
  13323. destroy: (err, callback) => {
  13324. const { body, req, res, ret, abort } = this
  13325. if (!err && !ret._readableState.endEmitted) {
  13326. err = new RequestAbortedError()
  13327. }
  13328. if (abort && err) {
  13329. abort()
  13330. }
  13331. util.destroy(body, err)
  13332. util.destroy(req, err)
  13333. util.destroy(res, err)
  13334. removeSignal(this)
  13335. callback(err)
  13336. }
  13337. }).on('prefinish', () => {
  13338. const { req } = this
  13339. // Node < 15 does not call _final in same tick.
  13340. req.push(null)
  13341. })
  13342. this.res = null
  13343. addSignal(this, signal)
  13344. }
  13345. onConnect (abort, context) {
  13346. const { ret, res } = this
  13347. assert(!res, 'pipeline cannot be retried')
  13348. if (ret.destroyed) {
  13349. throw new RequestAbortedError()
  13350. }
  13351. this.abort = abort
  13352. this.context = context
  13353. }
  13354. onHeaders (statusCode, rawHeaders, resume) {
  13355. const { opaque, handler, context } = this
  13356. if (statusCode < 200) {
  13357. if (this.onInfo) {
  13358. const headers = this.responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)
  13359. this.onInfo({ statusCode, headers })
  13360. }
  13361. return
  13362. }
  13363. this.res = new PipelineResponse(resume)
  13364. let body
  13365. try {
  13366. this.handler = null
  13367. const headers = this.responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)
  13368. body = this.runInAsyncScope(handler, null, {
  13369. statusCode,
  13370. headers,
  13371. opaque,
  13372. body: this.res,
  13373. context
  13374. })
  13375. } catch (err) {
  13376. this.res.on('error', util.nop)
  13377. throw err
  13378. }
  13379. if (!body || typeof body.on !== 'function') {
  13380. throw new InvalidReturnValueError('expected Readable')
  13381. }
  13382. body
  13383. .on('data', (chunk) => {
  13384. const { ret, body } = this
  13385. if (!ret.push(chunk) && body.pause) {
  13386. body.pause()
  13387. }
  13388. })
  13389. .on('error', (err) => {
  13390. const { ret } = this
  13391. util.destroy(ret, err)
  13392. })
  13393. .on('end', () => {
  13394. const { ret } = this
  13395. ret.push(null)
  13396. })
  13397. .on('close', () => {
  13398. const { ret } = this
  13399. if (!ret._readableState.ended) {
  13400. util.destroy(ret, new RequestAbortedError())
  13401. }
  13402. })
  13403. this.body = body
  13404. }
  13405. onData (chunk) {
  13406. const { res } = this
  13407. return res.push(chunk)
  13408. }
  13409. onComplete (trailers) {
  13410. const { res } = this
  13411. res.push(null)
  13412. }
  13413. onError (err) {
  13414. const { ret } = this
  13415. this.handler = null
  13416. util.destroy(ret, err)
  13417. }
  13418. }
  13419. function pipeline (opts, handler) {
  13420. try {
  13421. const pipelineHandler = new PipelineHandler(opts, handler)
  13422. this.dispatch({ ...opts, body: pipelineHandler.req }, pipelineHandler)
  13423. return pipelineHandler.ret
  13424. } catch (err) {
  13425. return new PassThrough().destroy(err)
  13426. }
  13427. }
  13428. module.exports = pipeline
  13429. /***/ }),
  13430. /***/ 5448:
  13431. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  13432. "use strict";
  13433. const Readable = __nccwpck_require__(3858)
  13434. const {
  13435. InvalidArgumentError,
  13436. RequestAbortedError
  13437. } = __nccwpck_require__(8045)
  13438. const util = __nccwpck_require__(3983)
  13439. const { getResolveErrorBodyCallback } = __nccwpck_require__(7474)
  13440. const { AsyncResource } = __nccwpck_require__(852)
  13441. const { addSignal, removeSignal } = __nccwpck_require__(7032)
  13442. class RequestHandler extends AsyncResource {
  13443. constructor (opts, callback) {
  13444. if (!opts || typeof opts !== 'object') {
  13445. throw new InvalidArgumentError('invalid opts')
  13446. }
  13447. const { signal, method, opaque, body, onInfo, responseHeaders, throwOnError, highWaterMark } = opts
  13448. try {
  13449. if (typeof callback !== 'function') {
  13450. throw new InvalidArgumentError('invalid callback')
  13451. }
  13452. if (highWaterMark && (typeof highWaterMark !== 'number' || highWaterMark < 0)) {
  13453. throw new InvalidArgumentError('invalid highWaterMark')
  13454. }
  13455. if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') {
  13456. throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget')
  13457. }
  13458. if (method === 'CONNECT') {
  13459. throw new InvalidArgumentError('invalid method')
  13460. }
  13461. if (onInfo && typeof onInfo !== 'function') {
  13462. throw new InvalidArgumentError('invalid onInfo callback')
  13463. }
  13464. super('UNDICI_REQUEST')
  13465. } catch (err) {
  13466. if (util.isStream(body)) {
  13467. util.destroy(body.on('error', util.nop), err)
  13468. }
  13469. throw err
  13470. }
  13471. this.responseHeaders = responseHeaders || null
  13472. this.opaque = opaque || null
  13473. this.callback = callback
  13474. this.res = null
  13475. this.abort = null
  13476. this.body = body
  13477. this.trailers = {}
  13478. this.context = null
  13479. this.onInfo = onInfo || null
  13480. this.throwOnError = throwOnError
  13481. this.highWaterMark = highWaterMark
  13482. if (util.isStream(body)) {
  13483. body.on('error', (err) => {
  13484. this.onError(err)
  13485. })
  13486. }
  13487. addSignal(this, signal)
  13488. }
  13489. onConnect (abort, context) {
  13490. if (!this.callback) {
  13491. throw new RequestAbortedError()
  13492. }
  13493. this.abort = abort
  13494. this.context = context
  13495. }
  13496. onHeaders (statusCode, rawHeaders, resume, statusMessage) {
  13497. const { callback, opaque, abort, context, responseHeaders, highWaterMark } = this
  13498. const headers = responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)
  13499. if (statusCode < 200) {
  13500. if (this.onInfo) {
  13501. this.onInfo({ statusCode, headers })
  13502. }
  13503. return
  13504. }
  13505. const parsedHeaders = responseHeaders === 'raw' ? util.parseHeaders(rawHeaders) : headers
  13506. const contentType = parsedHeaders['content-type']
  13507. const body = new Readable({ resume, abort, contentType, highWaterMark })
  13508. this.callback = null
  13509. this.res = body
  13510. if (callback !== null) {
  13511. if (this.throwOnError && statusCode >= 400) {
  13512. this.runInAsyncScope(getResolveErrorBodyCallback, null,
  13513. { callback, body, contentType, statusCode, statusMessage, headers }
  13514. )
  13515. } else {
  13516. this.runInAsyncScope(callback, null, null, {
  13517. statusCode,
  13518. headers,
  13519. trailers: this.trailers,
  13520. opaque,
  13521. body,
  13522. context
  13523. })
  13524. }
  13525. }
  13526. }
  13527. onData (chunk) {
  13528. const { res } = this
  13529. return res.push(chunk)
  13530. }
  13531. onComplete (trailers) {
  13532. const { res } = this
  13533. removeSignal(this)
  13534. util.parseHeaders(trailers, this.trailers)
  13535. res.push(null)
  13536. }
  13537. onError (err) {
  13538. const { res, callback, body, opaque } = this
  13539. removeSignal(this)
  13540. if (callback) {
  13541. // TODO: Does this need queueMicrotask?
  13542. this.callback = null
  13543. queueMicrotask(() => {
  13544. this.runInAsyncScope(callback, null, err, { opaque })
  13545. })
  13546. }
  13547. if (res) {
  13548. this.res = null
  13549. // Ensure all queued handlers are invoked before destroying res.
  13550. queueMicrotask(() => {
  13551. util.destroy(res, err)
  13552. })
  13553. }
  13554. if (body) {
  13555. this.body = null
  13556. util.destroy(body, err)
  13557. }
  13558. }
  13559. }
  13560. function request (opts, callback) {
  13561. if (callback === undefined) {
  13562. return new Promise((resolve, reject) => {
  13563. request.call(this, opts, (err, data) => {
  13564. return err ? reject(err) : resolve(data)
  13565. })
  13566. })
  13567. }
  13568. try {
  13569. this.dispatch(opts, new RequestHandler(opts, callback))
  13570. } catch (err) {
  13571. if (typeof callback !== 'function') {
  13572. throw err
  13573. }
  13574. const opaque = opts && opts.opaque
  13575. queueMicrotask(() => callback(err, { opaque }))
  13576. }
  13577. }
  13578. module.exports = request
  13579. module.exports.RequestHandler = RequestHandler
  13580. /***/ }),
  13581. /***/ 5395:
  13582. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  13583. "use strict";
  13584. const { finished, PassThrough } = __nccwpck_require__(2781)
  13585. const {
  13586. InvalidArgumentError,
  13587. InvalidReturnValueError,
  13588. RequestAbortedError
  13589. } = __nccwpck_require__(8045)
  13590. const util = __nccwpck_require__(3983)
  13591. const { getResolveErrorBodyCallback } = __nccwpck_require__(7474)
  13592. const { AsyncResource } = __nccwpck_require__(852)
  13593. const { addSignal, removeSignal } = __nccwpck_require__(7032)
  13594. class StreamHandler extends AsyncResource {
  13595. constructor (opts, factory, callback) {
  13596. if (!opts || typeof opts !== 'object') {
  13597. throw new InvalidArgumentError('invalid opts')
  13598. }
  13599. const { signal, method, opaque, body, onInfo, responseHeaders, throwOnError } = opts
  13600. try {
  13601. if (typeof callback !== 'function') {
  13602. throw new InvalidArgumentError('invalid callback')
  13603. }
  13604. if (typeof factory !== 'function') {
  13605. throw new InvalidArgumentError('invalid factory')
  13606. }
  13607. if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') {
  13608. throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget')
  13609. }
  13610. if (method === 'CONNECT') {
  13611. throw new InvalidArgumentError('invalid method')
  13612. }
  13613. if (onInfo && typeof onInfo !== 'function') {
  13614. throw new InvalidArgumentError('invalid onInfo callback')
  13615. }
  13616. super('UNDICI_STREAM')
  13617. } catch (err) {
  13618. if (util.isStream(body)) {
  13619. util.destroy(body.on('error', util.nop), err)
  13620. }
  13621. throw err
  13622. }
  13623. this.responseHeaders = responseHeaders || null
  13624. this.opaque = opaque || null
  13625. this.factory = factory
  13626. this.callback = callback
  13627. this.res = null
  13628. this.abort = null
  13629. this.context = null
  13630. this.trailers = null
  13631. this.body = body
  13632. this.onInfo = onInfo || null
  13633. this.throwOnError = throwOnError || false
  13634. if (util.isStream(body)) {
  13635. body.on('error', (err) => {
  13636. this.onError(err)
  13637. })
  13638. }
  13639. addSignal(this, signal)
  13640. }
  13641. onConnect (abort, context) {
  13642. if (!this.callback) {
  13643. throw new RequestAbortedError()
  13644. }
  13645. this.abort = abort
  13646. this.context = context
  13647. }
  13648. onHeaders (statusCode, rawHeaders, resume, statusMessage) {
  13649. const { factory, opaque, context, callback, responseHeaders } = this
  13650. const headers = responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)
  13651. if (statusCode < 200) {
  13652. if (this.onInfo) {
  13653. this.onInfo({ statusCode, headers })
  13654. }
  13655. return
  13656. }
  13657. this.factory = null
  13658. let res
  13659. if (this.throwOnError && statusCode >= 400) {
  13660. const parsedHeaders = responseHeaders === 'raw' ? util.parseHeaders(rawHeaders) : headers
  13661. const contentType = parsedHeaders['content-type']
  13662. res = new PassThrough()
  13663. this.callback = null
  13664. this.runInAsyncScope(getResolveErrorBodyCallback, null,
  13665. { callback, body: res, contentType, statusCode, statusMessage, headers }
  13666. )
  13667. } else {
  13668. if (factory === null) {
  13669. return
  13670. }
  13671. res = this.runInAsyncScope(factory, null, {
  13672. statusCode,
  13673. headers,
  13674. opaque,
  13675. context
  13676. })
  13677. if (
  13678. !res ||
  13679. typeof res.write !== 'function' ||
  13680. typeof res.end !== 'function' ||
  13681. typeof res.on !== 'function'
  13682. ) {
  13683. throw new InvalidReturnValueError('expected Writable')
  13684. }
  13685. // TODO: Avoid finished. It registers an unnecessary amount of listeners.
  13686. finished(res, { readable: false }, (err) => {
  13687. const { callback, res, opaque, trailers, abort } = this
  13688. this.res = null
  13689. if (err || !res.readable) {
  13690. util.destroy(res, err)
  13691. }
  13692. this.callback = null
  13693. this.runInAsyncScope(callback, null, err || null, { opaque, trailers })
  13694. if (err) {
  13695. abort()
  13696. }
  13697. })
  13698. }
  13699. res.on('drain', resume)
  13700. this.res = res
  13701. const needDrain = res.writableNeedDrain !== undefined
  13702. ? res.writableNeedDrain
  13703. : res._writableState && res._writableState.needDrain
  13704. return needDrain !== true
  13705. }
  13706. onData (chunk) {
  13707. const { res } = this
  13708. return res ? res.write(chunk) : true
  13709. }
  13710. onComplete (trailers) {
  13711. const { res } = this
  13712. removeSignal(this)
  13713. if (!res) {
  13714. return
  13715. }
  13716. this.trailers = util.parseHeaders(trailers)
  13717. res.end()
  13718. }
  13719. onError (err) {
  13720. const { res, callback, opaque, body } = this
  13721. removeSignal(this)
  13722. this.factory = null
  13723. if (res) {
  13724. this.res = null
  13725. util.destroy(res, err)
  13726. } else if (callback) {
  13727. this.callback = null
  13728. queueMicrotask(() => {
  13729. this.runInAsyncScope(callback, null, err, { opaque })
  13730. })
  13731. }
  13732. if (body) {
  13733. this.body = null
  13734. util.destroy(body, err)
  13735. }
  13736. }
  13737. }
  13738. function stream (opts, factory, callback) {
  13739. if (callback === undefined) {
  13740. return new Promise((resolve, reject) => {
  13741. stream.call(this, opts, factory, (err, data) => {
  13742. return err ? reject(err) : resolve(data)
  13743. })
  13744. })
  13745. }
  13746. try {
  13747. this.dispatch(opts, new StreamHandler(opts, factory, callback))
  13748. } catch (err) {
  13749. if (typeof callback !== 'function') {
  13750. throw err
  13751. }
  13752. const opaque = opts && opts.opaque
  13753. queueMicrotask(() => callback(err, { opaque }))
  13754. }
  13755. }
  13756. module.exports = stream
  13757. /***/ }),
  13758. /***/ 6923:
  13759. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  13760. "use strict";
  13761. const { InvalidArgumentError, RequestAbortedError, SocketError } = __nccwpck_require__(8045)
  13762. const { AsyncResource } = __nccwpck_require__(852)
  13763. const util = __nccwpck_require__(3983)
  13764. const { addSignal, removeSignal } = __nccwpck_require__(7032)
  13765. const assert = __nccwpck_require__(9491)
  13766. class UpgradeHandler extends AsyncResource {
  13767. constructor (opts, callback) {
  13768. if (!opts || typeof opts !== 'object') {
  13769. throw new InvalidArgumentError('invalid opts')
  13770. }
  13771. if (typeof callback !== 'function') {
  13772. throw new InvalidArgumentError('invalid callback')
  13773. }
  13774. const { signal, opaque, responseHeaders } = opts
  13775. if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') {
  13776. throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget')
  13777. }
  13778. super('UNDICI_UPGRADE')
  13779. this.responseHeaders = responseHeaders || null
  13780. this.opaque = opaque || null
  13781. this.callback = callback
  13782. this.abort = null
  13783. this.context = null
  13784. addSignal(this, signal)
  13785. }
  13786. onConnect (abort, context) {
  13787. if (!this.callback) {
  13788. throw new RequestAbortedError()
  13789. }
  13790. this.abort = abort
  13791. this.context = null
  13792. }
  13793. onHeaders () {
  13794. throw new SocketError('bad upgrade', null)
  13795. }
  13796. onUpgrade (statusCode, rawHeaders, socket) {
  13797. const { callback, opaque, context } = this
  13798. assert.strictEqual(statusCode, 101)
  13799. removeSignal(this)
  13800. this.callback = null
  13801. const headers = this.responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)
  13802. this.runInAsyncScope(callback, null, null, {
  13803. headers,
  13804. socket,
  13805. opaque,
  13806. context
  13807. })
  13808. }
  13809. onError (err) {
  13810. const { callback, opaque } = this
  13811. removeSignal(this)
  13812. if (callback) {
  13813. this.callback = null
  13814. queueMicrotask(() => {
  13815. this.runInAsyncScope(callback, null, err, { opaque })
  13816. })
  13817. }
  13818. }
  13819. }
  13820. function upgrade (opts, callback) {
  13821. if (callback === undefined) {
  13822. return new Promise((resolve, reject) => {
  13823. upgrade.call(this, opts, (err, data) => {
  13824. return err ? reject(err) : resolve(data)
  13825. })
  13826. })
  13827. }
  13828. try {
  13829. const upgradeHandler = new UpgradeHandler(opts, callback)
  13830. this.dispatch({
  13831. ...opts,
  13832. method: opts.method || 'GET',
  13833. upgrade: opts.protocol || 'Websocket'
  13834. }, upgradeHandler)
  13835. } catch (err) {
  13836. if (typeof callback !== 'function') {
  13837. throw err
  13838. }
  13839. const opaque = opts && opts.opaque
  13840. queueMicrotask(() => callback(err, { opaque }))
  13841. }
  13842. }
  13843. module.exports = upgrade
  13844. /***/ }),
  13845. /***/ 4059:
  13846. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  13847. "use strict";
  13848. module.exports.request = __nccwpck_require__(5448)
  13849. module.exports.stream = __nccwpck_require__(5395)
  13850. module.exports.pipeline = __nccwpck_require__(8752)
  13851. module.exports.upgrade = __nccwpck_require__(6923)
  13852. module.exports.connect = __nccwpck_require__(9744)
  13853. /***/ }),
  13854. /***/ 3858:
  13855. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  13856. "use strict";
  13857. // Ported from https://github.com/nodejs/undici/pull/907
  13858. const assert = __nccwpck_require__(9491)
  13859. const { Readable } = __nccwpck_require__(2781)
  13860. const { RequestAbortedError, NotSupportedError, InvalidArgumentError } = __nccwpck_require__(8045)
  13861. const util = __nccwpck_require__(3983)
  13862. const { ReadableStreamFrom, toUSVString } = __nccwpck_require__(3983)
  13863. let Blob
  13864. const kConsume = Symbol('kConsume')
  13865. const kReading = Symbol('kReading')
  13866. const kBody = Symbol('kBody')
  13867. const kAbort = Symbol('abort')
  13868. const kContentType = Symbol('kContentType')
  13869. const noop = () => {}
  13870. module.exports = class BodyReadable extends Readable {
  13871. constructor ({
  13872. resume,
  13873. abort,
  13874. contentType = '',
  13875. highWaterMark = 64 * 1024 // Same as nodejs fs streams.
  13876. }) {
  13877. super({
  13878. autoDestroy: true,
  13879. read: resume,
  13880. highWaterMark
  13881. })
  13882. this._readableState.dataEmitted = false
  13883. this[kAbort] = abort
  13884. this[kConsume] = null
  13885. this[kBody] = null
  13886. this[kContentType] = contentType
  13887. // Is stream being consumed through Readable API?
  13888. // This is an optimization so that we avoid checking
  13889. // for 'data' and 'readable' listeners in the hot path
  13890. // inside push().
  13891. this[kReading] = false
  13892. }
  13893. destroy (err) {
  13894. if (this.destroyed) {
  13895. // Node < 16
  13896. return this
  13897. }
  13898. if (!err && !this._readableState.endEmitted) {
  13899. err = new RequestAbortedError()
  13900. }
  13901. if (err) {
  13902. this[kAbort]()
  13903. }
  13904. return super.destroy(err)
  13905. }
  13906. emit (ev, ...args) {
  13907. if (ev === 'data') {
  13908. // Node < 16.7
  13909. this._readableState.dataEmitted = true
  13910. } else if (ev === 'error') {
  13911. // Node < 16
  13912. this._readableState.errorEmitted = true
  13913. }
  13914. return super.emit(ev, ...args)
  13915. }
  13916. on (ev, ...args) {
  13917. if (ev === 'data' || ev === 'readable') {
  13918. this[kReading] = true
  13919. }
  13920. return super.on(ev, ...args)
  13921. }
  13922. addListener (ev, ...args) {
  13923. return this.on(ev, ...args)
  13924. }
  13925. off (ev, ...args) {
  13926. const ret = super.off(ev, ...args)
  13927. if (ev === 'data' || ev === 'readable') {
  13928. this[kReading] = (
  13929. this.listenerCount('data') > 0 ||
  13930. this.listenerCount('readable') > 0
  13931. )
  13932. }
  13933. return ret
  13934. }
  13935. removeListener (ev, ...args) {
  13936. return this.off(ev, ...args)
  13937. }
  13938. push (chunk) {
  13939. if (this[kConsume] && chunk !== null && this.readableLength === 0) {
  13940. consumePush(this[kConsume], chunk)
  13941. return this[kReading] ? super.push(chunk) : true
  13942. }
  13943. return super.push(chunk)
  13944. }
  13945. // https://fetch.spec.whatwg.org/#dom-body-text
  13946. async text () {
  13947. return consume(this, 'text')
  13948. }
  13949. // https://fetch.spec.whatwg.org/#dom-body-json
  13950. async json () {
  13951. return consume(this, 'json')
  13952. }
  13953. // https://fetch.spec.whatwg.org/#dom-body-blob
  13954. async blob () {
  13955. return consume(this, 'blob')
  13956. }
  13957. // https://fetch.spec.whatwg.org/#dom-body-arraybuffer
  13958. async arrayBuffer () {
  13959. return consume(this, 'arrayBuffer')
  13960. }
  13961. // https://fetch.spec.whatwg.org/#dom-body-formdata
  13962. async formData () {
  13963. // TODO: Implement.
  13964. throw new NotSupportedError()
  13965. }
  13966. // https://fetch.spec.whatwg.org/#dom-body-bodyused
  13967. get bodyUsed () {
  13968. return util.isDisturbed(this)
  13969. }
  13970. // https://fetch.spec.whatwg.org/#dom-body-body
  13971. get body () {
  13972. if (!this[kBody]) {
  13973. this[kBody] = ReadableStreamFrom(this)
  13974. if (this[kConsume]) {
  13975. // TODO: Is this the best way to force a lock?
  13976. this[kBody].getReader() // Ensure stream is locked.
  13977. assert(this[kBody].locked)
  13978. }
  13979. }
  13980. return this[kBody]
  13981. }
  13982. dump (opts) {
  13983. let limit = opts && Number.isFinite(opts.limit) ? opts.limit : 262144
  13984. const signal = opts && opts.signal
  13985. if (signal) {
  13986. try {
  13987. if (typeof signal !== 'object' || !('aborted' in signal)) {
  13988. throw new InvalidArgumentError('signal must be an AbortSignal')
  13989. }
  13990. util.throwIfAborted(signal)
  13991. } catch (err) {
  13992. return Promise.reject(err)
  13993. }
  13994. }
  13995. if (this.closed) {
  13996. return Promise.resolve(null)
  13997. }
  13998. return new Promise((resolve, reject) => {
  13999. const signalListenerCleanup = signal
  14000. ? util.addAbortListener(signal, () => {
  14001. this.destroy()
  14002. })
  14003. : noop
  14004. this
  14005. .on('close', function () {
  14006. signalListenerCleanup()
  14007. if (signal && signal.aborted) {
  14008. reject(signal.reason || Object.assign(new Error('The operation was aborted'), { name: 'AbortError' }))
  14009. } else {
  14010. resolve(null)
  14011. }
  14012. })
  14013. .on('error', noop)
  14014. .on('data', function (chunk) {
  14015. limit -= chunk.length
  14016. if (limit <= 0) {
  14017. this.destroy()
  14018. }
  14019. })
  14020. .resume()
  14021. })
  14022. }
  14023. }
  14024. // https://streams.spec.whatwg.org/#readablestream-locked
  14025. function isLocked (self) {
  14026. // Consume is an implicit lock.
  14027. return (self[kBody] && self[kBody].locked === true) || self[kConsume]
  14028. }
  14029. // https://fetch.spec.whatwg.org/#body-unusable
  14030. function isUnusable (self) {
  14031. return util.isDisturbed(self) || isLocked(self)
  14032. }
  14033. async function consume (stream, type) {
  14034. if (isUnusable(stream)) {
  14035. throw new TypeError('unusable')
  14036. }
  14037. assert(!stream[kConsume])
  14038. return new Promise((resolve, reject) => {
  14039. stream[kConsume] = {
  14040. type,
  14041. stream,
  14042. resolve,
  14043. reject,
  14044. length: 0,
  14045. body: []
  14046. }
  14047. stream
  14048. .on('error', function (err) {
  14049. consumeFinish(this[kConsume], err)
  14050. })
  14051. .on('close', function () {
  14052. if (this[kConsume].body !== null) {
  14053. consumeFinish(this[kConsume], new RequestAbortedError())
  14054. }
  14055. })
  14056. process.nextTick(consumeStart, stream[kConsume])
  14057. })
  14058. }
  14059. function consumeStart (consume) {
  14060. if (consume.body === null) {
  14061. return
  14062. }
  14063. const { _readableState: state } = consume.stream
  14064. for (const chunk of state.buffer) {
  14065. consumePush(consume, chunk)
  14066. }
  14067. if (state.endEmitted) {
  14068. consumeEnd(this[kConsume])
  14069. } else {
  14070. consume.stream.on('end', function () {
  14071. consumeEnd(this[kConsume])
  14072. })
  14073. }
  14074. consume.stream.resume()
  14075. while (consume.stream.read() != null) {
  14076. // Loop
  14077. }
  14078. }
  14079. function consumeEnd (consume) {
  14080. const { type, body, resolve, stream, length } = consume
  14081. try {
  14082. if (type === 'text') {
  14083. resolve(toUSVString(Buffer.concat(body)))
  14084. } else if (type === 'json') {
  14085. resolve(JSON.parse(Buffer.concat(body)))
  14086. } else if (type === 'arrayBuffer') {
  14087. const dst = new Uint8Array(length)
  14088. let pos = 0
  14089. for (const buf of body) {
  14090. dst.set(buf, pos)
  14091. pos += buf.byteLength
  14092. }
  14093. resolve(dst.buffer)
  14094. } else if (type === 'blob') {
  14095. if (!Blob) {
  14096. Blob = (__nccwpck_require__(4300).Blob)
  14097. }
  14098. resolve(new Blob(body, { type: stream[kContentType] }))
  14099. }
  14100. consumeFinish(consume)
  14101. } catch (err) {
  14102. stream.destroy(err)
  14103. }
  14104. }
  14105. function consumePush (consume, chunk) {
  14106. consume.length += chunk.length
  14107. consume.body.push(chunk)
  14108. }
  14109. function consumeFinish (consume, err) {
  14110. if (consume.body === null) {
  14111. return
  14112. }
  14113. if (err) {
  14114. consume.reject(err)
  14115. } else {
  14116. consume.resolve()
  14117. }
  14118. consume.type = null
  14119. consume.stream = null
  14120. consume.resolve = null
  14121. consume.reject = null
  14122. consume.length = 0
  14123. consume.body = null
  14124. }
  14125. /***/ }),
  14126. /***/ 7474:
  14127. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  14128. const assert = __nccwpck_require__(9491)
  14129. const {
  14130. ResponseStatusCodeError
  14131. } = __nccwpck_require__(8045)
  14132. const { toUSVString } = __nccwpck_require__(3983)
  14133. async function getResolveErrorBodyCallback ({ callback, body, contentType, statusCode, statusMessage, headers }) {
  14134. assert(body)
  14135. let chunks = []
  14136. let limit = 0
  14137. for await (const chunk of body) {
  14138. chunks.push(chunk)
  14139. limit += chunk.length
  14140. if (limit > 128 * 1024) {
  14141. chunks = null
  14142. break
  14143. }
  14144. }
  14145. if (statusCode === 204 || !contentType || !chunks) {
  14146. process.nextTick(callback, new ResponseStatusCodeError(`Response status code ${statusCode}${statusMessage ? `: ${statusMessage}` : ''}`, statusCode, headers))
  14147. return
  14148. }
  14149. try {
  14150. if (contentType.startsWith('application/json')) {
  14151. const payload = JSON.parse(toUSVString(Buffer.concat(chunks)))
  14152. process.nextTick(callback, new ResponseStatusCodeError(`Response status code ${statusCode}${statusMessage ? `: ${statusMessage}` : ''}`, statusCode, headers, payload))
  14153. return
  14154. }
  14155. if (contentType.startsWith('text/')) {
  14156. const payload = toUSVString(Buffer.concat(chunks))
  14157. process.nextTick(callback, new ResponseStatusCodeError(`Response status code ${statusCode}${statusMessage ? `: ${statusMessage}` : ''}`, statusCode, headers, payload))
  14158. return
  14159. }
  14160. } catch (err) {
  14161. // Process in a fallback if error
  14162. }
  14163. process.nextTick(callback, new ResponseStatusCodeError(`Response status code ${statusCode}${statusMessage ? `: ${statusMessage}` : ''}`, statusCode, headers))
  14164. }
  14165. module.exports = { getResolveErrorBodyCallback }
  14166. /***/ }),
  14167. /***/ 7931:
  14168. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  14169. "use strict";
  14170. const {
  14171. BalancedPoolMissingUpstreamError,
  14172. InvalidArgumentError
  14173. } = __nccwpck_require__(8045)
  14174. const {
  14175. PoolBase,
  14176. kClients,
  14177. kNeedDrain,
  14178. kAddClient,
  14179. kRemoveClient,
  14180. kGetDispatcher
  14181. } = __nccwpck_require__(3198)
  14182. const Pool = __nccwpck_require__(4634)
  14183. const { kUrl, kInterceptors } = __nccwpck_require__(2785)
  14184. const { parseOrigin } = __nccwpck_require__(3983)
  14185. const kFactory = Symbol('factory')
  14186. const kOptions = Symbol('options')
  14187. const kGreatestCommonDivisor = Symbol('kGreatestCommonDivisor')
  14188. const kCurrentWeight = Symbol('kCurrentWeight')
  14189. const kIndex = Symbol('kIndex')
  14190. const kWeight = Symbol('kWeight')
  14191. const kMaxWeightPerServer = Symbol('kMaxWeightPerServer')
  14192. const kErrorPenalty = Symbol('kErrorPenalty')
  14193. function getGreatestCommonDivisor (a, b) {
  14194. if (b === 0) return a
  14195. return getGreatestCommonDivisor(b, a % b)
  14196. }
  14197. function defaultFactory (origin, opts) {
  14198. return new Pool(origin, opts)
  14199. }
  14200. class BalancedPool extends PoolBase {
  14201. constructor (upstreams = [], { factory = defaultFactory, ...opts } = {}) {
  14202. super()
  14203. this[kOptions] = opts
  14204. this[kIndex] = -1
  14205. this[kCurrentWeight] = 0
  14206. this[kMaxWeightPerServer] = this[kOptions].maxWeightPerServer || 100
  14207. this[kErrorPenalty] = this[kOptions].errorPenalty || 15
  14208. if (!Array.isArray(upstreams)) {
  14209. upstreams = [upstreams]
  14210. }
  14211. if (typeof factory !== 'function') {
  14212. throw new InvalidArgumentError('factory must be a function.')
  14213. }
  14214. this[kInterceptors] = opts.interceptors && opts.interceptors.BalancedPool && Array.isArray(opts.interceptors.BalancedPool)
  14215. ? opts.interceptors.BalancedPool
  14216. : []
  14217. this[kFactory] = factory
  14218. for (const upstream of upstreams) {
  14219. this.addUpstream(upstream)
  14220. }
  14221. this._updateBalancedPoolStats()
  14222. }
  14223. addUpstream (upstream) {
  14224. const upstreamOrigin = parseOrigin(upstream).origin
  14225. if (this[kClients].find((pool) => (
  14226. pool[kUrl].origin === upstreamOrigin &&
  14227. pool.closed !== true &&
  14228. pool.destroyed !== true
  14229. ))) {
  14230. return this
  14231. }
  14232. const pool = this[kFactory](upstreamOrigin, Object.assign({}, this[kOptions]))
  14233. this[kAddClient](pool)
  14234. pool.on('connect', () => {
  14235. pool[kWeight] = Math.min(this[kMaxWeightPerServer], pool[kWeight] + this[kErrorPenalty])
  14236. })
  14237. pool.on('connectionError', () => {
  14238. pool[kWeight] = Math.max(1, pool[kWeight] - this[kErrorPenalty])
  14239. this._updateBalancedPoolStats()
  14240. })
  14241. pool.on('disconnect', (...args) => {
  14242. const err = args[2]
  14243. if (err && err.code === 'UND_ERR_SOCKET') {
  14244. // decrease the weight of the pool.
  14245. pool[kWeight] = Math.max(1, pool[kWeight] - this[kErrorPenalty])
  14246. this._updateBalancedPoolStats()
  14247. }
  14248. })
  14249. for (const client of this[kClients]) {
  14250. client[kWeight] = this[kMaxWeightPerServer]
  14251. }
  14252. this._updateBalancedPoolStats()
  14253. return this
  14254. }
  14255. _updateBalancedPoolStats () {
  14256. this[kGreatestCommonDivisor] = this[kClients].map(p => p[kWeight]).reduce(getGreatestCommonDivisor, 0)
  14257. }
  14258. removeUpstream (upstream) {
  14259. const upstreamOrigin = parseOrigin(upstream).origin
  14260. const pool = this[kClients].find((pool) => (
  14261. pool[kUrl].origin === upstreamOrigin &&
  14262. pool.closed !== true &&
  14263. pool.destroyed !== true
  14264. ))
  14265. if (pool) {
  14266. this[kRemoveClient](pool)
  14267. }
  14268. return this
  14269. }
  14270. get upstreams () {
  14271. return this[kClients]
  14272. .filter(dispatcher => dispatcher.closed !== true && dispatcher.destroyed !== true)
  14273. .map((p) => p[kUrl].origin)
  14274. }
  14275. [kGetDispatcher] () {
  14276. // We validate that pools is greater than 0,
  14277. // otherwise we would have to wait until an upstream
  14278. // is added, which might never happen.
  14279. if (this[kClients].length === 0) {
  14280. throw new BalancedPoolMissingUpstreamError()
  14281. }
  14282. const dispatcher = this[kClients].find(dispatcher => (
  14283. !dispatcher[kNeedDrain] &&
  14284. dispatcher.closed !== true &&
  14285. dispatcher.destroyed !== true
  14286. ))
  14287. if (!dispatcher) {
  14288. return
  14289. }
  14290. const allClientsBusy = this[kClients].map(pool => pool[kNeedDrain]).reduce((a, b) => a && b, true)
  14291. if (allClientsBusy) {
  14292. return
  14293. }
  14294. let counter = 0
  14295. let maxWeightIndex = this[kClients].findIndex(pool => !pool[kNeedDrain])
  14296. while (counter++ < this[kClients].length) {
  14297. this[kIndex] = (this[kIndex] + 1) % this[kClients].length
  14298. const pool = this[kClients][this[kIndex]]
  14299. // find pool index with the largest weight
  14300. if (pool[kWeight] > this[kClients][maxWeightIndex][kWeight] && !pool[kNeedDrain]) {
  14301. maxWeightIndex = this[kIndex]
  14302. }
  14303. // decrease the current weight every `this[kClients].length`.
  14304. if (this[kIndex] === 0) {
  14305. // Set the current weight to the next lower weight.
  14306. this[kCurrentWeight] = this[kCurrentWeight] - this[kGreatestCommonDivisor]
  14307. if (this[kCurrentWeight] <= 0) {
  14308. this[kCurrentWeight] = this[kMaxWeightPerServer]
  14309. }
  14310. }
  14311. if (pool[kWeight] >= this[kCurrentWeight] && (!pool[kNeedDrain])) {
  14312. return pool
  14313. }
  14314. }
  14315. this[kCurrentWeight] = this[kClients][maxWeightIndex][kWeight]
  14316. this[kIndex] = maxWeightIndex
  14317. return this[kClients][maxWeightIndex]
  14318. }
  14319. }
  14320. module.exports = BalancedPool
  14321. /***/ }),
  14322. /***/ 6101:
  14323. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  14324. "use strict";
  14325. const { kConstruct } = __nccwpck_require__(9174)
  14326. const { urlEquals, fieldValues: getFieldValues } = __nccwpck_require__(2396)
  14327. const { kEnumerableProperty, isDisturbed } = __nccwpck_require__(3983)
  14328. const { kHeadersList } = __nccwpck_require__(2785)
  14329. const { webidl } = __nccwpck_require__(1744)
  14330. const { Response, cloneResponse } = __nccwpck_require__(7823)
  14331. const { Request } = __nccwpck_require__(8359)
  14332. const { kState, kHeaders, kGuard, kRealm } = __nccwpck_require__(5861)
  14333. const { fetching } = __nccwpck_require__(4881)
  14334. const { urlIsHttpHttpsScheme, createDeferredPromise, readAllBytes } = __nccwpck_require__(2538)
  14335. const assert = __nccwpck_require__(9491)
  14336. const { getGlobalDispatcher } = __nccwpck_require__(1892)
  14337. /**
  14338. * @see https://w3c.github.io/ServiceWorker/#dfn-cache-batch-operation
  14339. * @typedef {Object} CacheBatchOperation
  14340. * @property {'delete' | 'put'} type
  14341. * @property {any} request
  14342. * @property {any} response
  14343. * @property {import('../../types/cache').CacheQueryOptions} options
  14344. */
  14345. /**
  14346. * @see https://w3c.github.io/ServiceWorker/#dfn-request-response-list
  14347. * @typedef {[any, any][]} requestResponseList
  14348. */
  14349. class Cache {
  14350. /**
  14351. * @see https://w3c.github.io/ServiceWorker/#dfn-relevant-request-response-list
  14352. * @type {requestResponseList}
  14353. */
  14354. #relevantRequestResponseList
  14355. constructor () {
  14356. if (arguments[0] !== kConstruct) {
  14357. webidl.illegalConstructor()
  14358. }
  14359. this.#relevantRequestResponseList = arguments[1]
  14360. }
  14361. async match (request, options = {}) {
  14362. webidl.brandCheck(this, Cache)
  14363. webidl.argumentLengthCheck(arguments, 1, { header: 'Cache.match' })
  14364. request = webidl.converters.RequestInfo(request)
  14365. options = webidl.converters.CacheQueryOptions(options)
  14366. const p = await this.matchAll(request, options)
  14367. if (p.length === 0) {
  14368. return
  14369. }
  14370. return p[0]
  14371. }
  14372. async matchAll (request = undefined, options = {}) {
  14373. webidl.brandCheck(this, Cache)
  14374. if (request !== undefined) request = webidl.converters.RequestInfo(request)
  14375. options = webidl.converters.CacheQueryOptions(options)
  14376. // 1.
  14377. let r = null
  14378. // 2.
  14379. if (request !== undefined) {
  14380. if (request instanceof Request) {
  14381. // 2.1.1
  14382. r = request[kState]
  14383. // 2.1.2
  14384. if (r.method !== 'GET' && !options.ignoreMethod) {
  14385. return []
  14386. }
  14387. } else if (typeof request === 'string') {
  14388. // 2.2.1
  14389. r = new Request(request)[kState]
  14390. }
  14391. }
  14392. // 5.
  14393. // 5.1
  14394. const responses = []
  14395. // 5.2
  14396. if (request === undefined) {
  14397. // 5.2.1
  14398. for (const requestResponse of this.#relevantRequestResponseList) {
  14399. responses.push(requestResponse[1])
  14400. }
  14401. } else { // 5.3
  14402. // 5.3.1
  14403. const requestResponses = this.#queryCache(r, options)
  14404. // 5.3.2
  14405. for (const requestResponse of requestResponses) {
  14406. responses.push(requestResponse[1])
  14407. }
  14408. }
  14409. // 5.4
  14410. // We don't implement CORs so we don't need to loop over the responses, yay!
  14411. // 5.5.1
  14412. const responseList = []
  14413. // 5.5.2
  14414. for (const response of responses) {
  14415. // 5.5.2.1
  14416. const responseObject = new Response(response.body?.source ?? null)
  14417. const body = responseObject[kState].body
  14418. responseObject[kState] = response
  14419. responseObject[kState].body = body
  14420. responseObject[kHeaders][kHeadersList] = response.headersList
  14421. responseObject[kHeaders][kGuard] = 'immutable'
  14422. responseList.push(responseObject)
  14423. }
  14424. // 6.
  14425. return Object.freeze(responseList)
  14426. }
  14427. async add (request) {
  14428. webidl.brandCheck(this, Cache)
  14429. webidl.argumentLengthCheck(arguments, 1, { header: 'Cache.add' })
  14430. request = webidl.converters.RequestInfo(request)
  14431. // 1.
  14432. const requests = [request]
  14433. // 2.
  14434. const responseArrayPromise = this.addAll(requests)
  14435. // 3.
  14436. return await responseArrayPromise
  14437. }
  14438. async addAll (requests) {
  14439. webidl.brandCheck(this, Cache)
  14440. webidl.argumentLengthCheck(arguments, 1, { header: 'Cache.addAll' })
  14441. requests = webidl.converters['sequence<RequestInfo>'](requests)
  14442. // 1.
  14443. const responsePromises = []
  14444. // 2.
  14445. const requestList = []
  14446. // 3.
  14447. for (const request of requests) {
  14448. if (typeof request === 'string') {
  14449. continue
  14450. }
  14451. // 3.1
  14452. const r = request[kState]
  14453. // 3.2
  14454. if (!urlIsHttpHttpsScheme(r.url) || r.method !== 'GET') {
  14455. throw webidl.errors.exception({
  14456. header: 'Cache.addAll',
  14457. message: 'Expected http/s scheme when method is not GET.'
  14458. })
  14459. }
  14460. }
  14461. // 4.
  14462. /** @type {ReturnType<typeof fetching>[]} */
  14463. const fetchControllers = []
  14464. // 5.
  14465. for (const request of requests) {
  14466. // 5.1
  14467. const r = new Request(request)[kState]
  14468. // 5.2
  14469. if (!urlIsHttpHttpsScheme(r.url)) {
  14470. throw webidl.errors.exception({
  14471. header: 'Cache.addAll',
  14472. message: 'Expected http/s scheme.'
  14473. })
  14474. }
  14475. // 5.4
  14476. r.initiator = 'fetch'
  14477. r.destination = 'subresource'
  14478. // 5.5
  14479. requestList.push(r)
  14480. // 5.6
  14481. const responsePromise = createDeferredPromise()
  14482. // 5.7
  14483. fetchControllers.push(fetching({
  14484. request: r,
  14485. dispatcher: getGlobalDispatcher(),
  14486. processResponse (response) {
  14487. // 1.
  14488. if (response.type === 'error' || response.status === 206 || response.status < 200 || response.status > 299) {
  14489. responsePromise.reject(webidl.errors.exception({
  14490. header: 'Cache.addAll',
  14491. message: 'Received an invalid status code or the request failed.'
  14492. }))
  14493. } else if (response.headersList.contains('vary')) { // 2.
  14494. // 2.1
  14495. const fieldValues = getFieldValues(response.headersList.get('vary'))
  14496. // 2.2
  14497. for (const fieldValue of fieldValues) {
  14498. // 2.2.1
  14499. if (fieldValue === '*') {
  14500. responsePromise.reject(webidl.errors.exception({
  14501. header: 'Cache.addAll',
  14502. message: 'invalid vary field value'
  14503. }))
  14504. for (const controller of fetchControllers) {
  14505. controller.abort()
  14506. }
  14507. return
  14508. }
  14509. }
  14510. }
  14511. },
  14512. processResponseEndOfBody (response) {
  14513. // 1.
  14514. if (response.aborted) {
  14515. responsePromise.reject(new DOMException('aborted', 'AbortError'))
  14516. return
  14517. }
  14518. // 2.
  14519. responsePromise.resolve(response)
  14520. }
  14521. }))
  14522. // 5.8
  14523. responsePromises.push(responsePromise.promise)
  14524. }
  14525. // 6.
  14526. const p = Promise.all(responsePromises)
  14527. // 7.
  14528. const responses = await p
  14529. // 7.1
  14530. const operations = []
  14531. // 7.2
  14532. let index = 0
  14533. // 7.3
  14534. for (const response of responses) {
  14535. // 7.3.1
  14536. /** @type {CacheBatchOperation} */
  14537. const operation = {
  14538. type: 'put', // 7.3.2
  14539. request: requestList[index], // 7.3.3
  14540. response // 7.3.4
  14541. }
  14542. operations.push(operation) // 7.3.5
  14543. index++ // 7.3.6
  14544. }
  14545. // 7.5
  14546. const cacheJobPromise = createDeferredPromise()
  14547. // 7.6.1
  14548. let errorData = null
  14549. // 7.6.2
  14550. try {
  14551. this.#batchCacheOperations(operations)
  14552. } catch (e) {
  14553. errorData = e
  14554. }
  14555. // 7.6.3
  14556. queueMicrotask(() => {
  14557. // 7.6.3.1
  14558. if (errorData === null) {
  14559. cacheJobPromise.resolve(undefined)
  14560. } else {
  14561. // 7.6.3.2
  14562. cacheJobPromise.reject(errorData)
  14563. }
  14564. })
  14565. // 7.7
  14566. return cacheJobPromise.promise
  14567. }
  14568. async put (request, response) {
  14569. webidl.brandCheck(this, Cache)
  14570. webidl.argumentLengthCheck(arguments, 2, { header: 'Cache.put' })
  14571. request = webidl.converters.RequestInfo(request)
  14572. response = webidl.converters.Response(response)
  14573. // 1.
  14574. let innerRequest = null
  14575. // 2.
  14576. if (request instanceof Request) {
  14577. innerRequest = request[kState]
  14578. } else { // 3.
  14579. innerRequest = new Request(request)[kState]
  14580. }
  14581. // 4.
  14582. if (!urlIsHttpHttpsScheme(innerRequest.url) || innerRequest.method !== 'GET') {
  14583. throw webidl.errors.exception({
  14584. header: 'Cache.put',
  14585. message: 'Expected an http/s scheme when method is not GET'
  14586. })
  14587. }
  14588. // 5.
  14589. const innerResponse = response[kState]
  14590. // 6.
  14591. if (innerResponse.status === 206) {
  14592. throw webidl.errors.exception({
  14593. header: 'Cache.put',
  14594. message: 'Got 206 status'
  14595. })
  14596. }
  14597. // 7.
  14598. if (innerResponse.headersList.contains('vary')) {
  14599. // 7.1.
  14600. const fieldValues = getFieldValues(innerResponse.headersList.get('vary'))
  14601. // 7.2.
  14602. for (const fieldValue of fieldValues) {
  14603. // 7.2.1
  14604. if (fieldValue === '*') {
  14605. throw webidl.errors.exception({
  14606. header: 'Cache.put',
  14607. message: 'Got * vary field value'
  14608. })
  14609. }
  14610. }
  14611. }
  14612. // 8.
  14613. if (innerResponse.body && (isDisturbed(innerResponse.body.stream) || innerResponse.body.stream.locked)) {
  14614. throw webidl.errors.exception({
  14615. header: 'Cache.put',
  14616. message: 'Response body is locked or disturbed'
  14617. })
  14618. }
  14619. // 9.
  14620. const clonedResponse = cloneResponse(innerResponse)
  14621. // 10.
  14622. const bodyReadPromise = createDeferredPromise()
  14623. // 11.
  14624. if (innerResponse.body != null) {
  14625. // 11.1
  14626. const stream = innerResponse.body.stream
  14627. // 11.2
  14628. const reader = stream.getReader()
  14629. // 11.3
  14630. readAllBytes(reader).then(bodyReadPromise.resolve, bodyReadPromise.reject)
  14631. } else {
  14632. bodyReadPromise.resolve(undefined)
  14633. }
  14634. // 12.
  14635. /** @type {CacheBatchOperation[]} */
  14636. const operations = []
  14637. // 13.
  14638. /** @type {CacheBatchOperation} */
  14639. const operation = {
  14640. type: 'put', // 14.
  14641. request: innerRequest, // 15.
  14642. response: clonedResponse // 16.
  14643. }
  14644. // 17.
  14645. operations.push(operation)
  14646. // 19.
  14647. const bytes = await bodyReadPromise.promise
  14648. if (clonedResponse.body != null) {
  14649. clonedResponse.body.source = bytes
  14650. }
  14651. // 19.1
  14652. const cacheJobPromise = createDeferredPromise()
  14653. // 19.2.1
  14654. let errorData = null
  14655. // 19.2.2
  14656. try {
  14657. this.#batchCacheOperations(operations)
  14658. } catch (e) {
  14659. errorData = e
  14660. }
  14661. // 19.2.3
  14662. queueMicrotask(() => {
  14663. // 19.2.3.1
  14664. if (errorData === null) {
  14665. cacheJobPromise.resolve()
  14666. } else { // 19.2.3.2
  14667. cacheJobPromise.reject(errorData)
  14668. }
  14669. })
  14670. return cacheJobPromise.promise
  14671. }
  14672. async delete (request, options = {}) {
  14673. webidl.brandCheck(this, Cache)
  14674. webidl.argumentLengthCheck(arguments, 1, { header: 'Cache.delete' })
  14675. request = webidl.converters.RequestInfo(request)
  14676. options = webidl.converters.CacheQueryOptions(options)
  14677. /**
  14678. * @type {Request}
  14679. */
  14680. let r = null
  14681. if (request instanceof Request) {
  14682. r = request[kState]
  14683. if (r.method !== 'GET' && !options.ignoreMethod) {
  14684. return false
  14685. }
  14686. } else {
  14687. assert(typeof request === 'string')
  14688. r = new Request(request)[kState]
  14689. }
  14690. /** @type {CacheBatchOperation[]} */
  14691. const operations = []
  14692. /** @type {CacheBatchOperation} */
  14693. const operation = {
  14694. type: 'delete',
  14695. request: r,
  14696. options
  14697. }
  14698. operations.push(operation)
  14699. const cacheJobPromise = createDeferredPromise()
  14700. let errorData = null
  14701. let requestResponses
  14702. try {
  14703. requestResponses = this.#batchCacheOperations(operations)
  14704. } catch (e) {
  14705. errorData = e
  14706. }
  14707. queueMicrotask(() => {
  14708. if (errorData === null) {
  14709. cacheJobPromise.resolve(!!requestResponses?.length)
  14710. } else {
  14711. cacheJobPromise.reject(errorData)
  14712. }
  14713. })
  14714. return cacheJobPromise.promise
  14715. }
  14716. /**
  14717. * @see https://w3c.github.io/ServiceWorker/#dom-cache-keys
  14718. * @param {any} request
  14719. * @param {import('../../types/cache').CacheQueryOptions} options
  14720. * @returns {readonly Request[]}
  14721. */
  14722. async keys (request = undefined, options = {}) {
  14723. webidl.brandCheck(this, Cache)
  14724. if (request !== undefined) request = webidl.converters.RequestInfo(request)
  14725. options = webidl.converters.CacheQueryOptions(options)
  14726. // 1.
  14727. let r = null
  14728. // 2.
  14729. if (request !== undefined) {
  14730. // 2.1
  14731. if (request instanceof Request) {
  14732. // 2.1.1
  14733. r = request[kState]
  14734. // 2.1.2
  14735. if (r.method !== 'GET' && !options.ignoreMethod) {
  14736. return []
  14737. }
  14738. } else if (typeof request === 'string') { // 2.2
  14739. r = new Request(request)[kState]
  14740. }
  14741. }
  14742. // 4.
  14743. const promise = createDeferredPromise()
  14744. // 5.
  14745. // 5.1
  14746. const requests = []
  14747. // 5.2
  14748. if (request === undefined) {
  14749. // 5.2.1
  14750. for (const requestResponse of this.#relevantRequestResponseList) {
  14751. // 5.2.1.1
  14752. requests.push(requestResponse[0])
  14753. }
  14754. } else { // 5.3
  14755. // 5.3.1
  14756. const requestResponses = this.#queryCache(r, options)
  14757. // 5.3.2
  14758. for (const requestResponse of requestResponses) {
  14759. // 5.3.2.1
  14760. requests.push(requestResponse[0])
  14761. }
  14762. }
  14763. // 5.4
  14764. queueMicrotask(() => {
  14765. // 5.4.1
  14766. const requestList = []
  14767. // 5.4.2
  14768. for (const request of requests) {
  14769. const requestObject = new Request('https://a')
  14770. requestObject[kState] = request
  14771. requestObject[kHeaders][kHeadersList] = request.headersList
  14772. requestObject[kHeaders][kGuard] = 'immutable'
  14773. requestObject[kRealm] = request.client
  14774. // 5.4.2.1
  14775. requestList.push(requestObject)
  14776. }
  14777. // 5.4.3
  14778. promise.resolve(Object.freeze(requestList))
  14779. })
  14780. return promise.promise
  14781. }
  14782. /**
  14783. * @see https://w3c.github.io/ServiceWorker/#batch-cache-operations-algorithm
  14784. * @param {CacheBatchOperation[]} operations
  14785. * @returns {requestResponseList}
  14786. */
  14787. #batchCacheOperations (operations) {
  14788. // 1.
  14789. const cache = this.#relevantRequestResponseList
  14790. // 2.
  14791. const backupCache = [...cache]
  14792. // 3.
  14793. const addedItems = []
  14794. // 4.1
  14795. const resultList = []
  14796. try {
  14797. // 4.2
  14798. for (const operation of operations) {
  14799. // 4.2.1
  14800. if (operation.type !== 'delete' && operation.type !== 'put') {
  14801. throw webidl.errors.exception({
  14802. header: 'Cache.#batchCacheOperations',
  14803. message: 'operation type does not match "delete" or "put"'
  14804. })
  14805. }
  14806. // 4.2.2
  14807. if (operation.type === 'delete' && operation.response != null) {
  14808. throw webidl.errors.exception({
  14809. header: 'Cache.#batchCacheOperations',
  14810. message: 'delete operation should not have an associated response'
  14811. })
  14812. }
  14813. // 4.2.3
  14814. if (this.#queryCache(operation.request, operation.options, addedItems).length) {
  14815. throw new DOMException('???', 'InvalidStateError')
  14816. }
  14817. // 4.2.4
  14818. let requestResponses
  14819. // 4.2.5
  14820. if (operation.type === 'delete') {
  14821. // 4.2.5.1
  14822. requestResponses = this.#queryCache(operation.request, operation.options)
  14823. // TODO: the spec is wrong, this is needed to pass WPTs
  14824. if (requestResponses.length === 0) {
  14825. return []
  14826. }
  14827. // 4.2.5.2
  14828. for (const requestResponse of requestResponses) {
  14829. const idx = cache.indexOf(requestResponse)
  14830. assert(idx !== -1)
  14831. // 4.2.5.2.1
  14832. cache.splice(idx, 1)
  14833. }
  14834. } else if (operation.type === 'put') { // 4.2.6
  14835. // 4.2.6.1
  14836. if (operation.response == null) {
  14837. throw webidl.errors.exception({
  14838. header: 'Cache.#batchCacheOperations',
  14839. message: 'put operation should have an associated response'
  14840. })
  14841. }
  14842. // 4.2.6.2
  14843. const r = operation.request
  14844. // 4.2.6.3
  14845. if (!urlIsHttpHttpsScheme(r.url)) {
  14846. throw webidl.errors.exception({
  14847. header: 'Cache.#batchCacheOperations',
  14848. message: 'expected http or https scheme'
  14849. })
  14850. }
  14851. // 4.2.6.4
  14852. if (r.method !== 'GET') {
  14853. throw webidl.errors.exception({
  14854. header: 'Cache.#batchCacheOperations',
  14855. message: 'not get method'
  14856. })
  14857. }
  14858. // 4.2.6.5
  14859. if (operation.options != null) {
  14860. throw webidl.errors.exception({
  14861. header: 'Cache.#batchCacheOperations',
  14862. message: 'options must not be defined'
  14863. })
  14864. }
  14865. // 4.2.6.6
  14866. requestResponses = this.#queryCache(operation.request)
  14867. // 4.2.6.7
  14868. for (const requestResponse of requestResponses) {
  14869. const idx = cache.indexOf(requestResponse)
  14870. assert(idx !== -1)
  14871. // 4.2.6.7.1
  14872. cache.splice(idx, 1)
  14873. }
  14874. // 4.2.6.8
  14875. cache.push([operation.request, operation.response])
  14876. // 4.2.6.10
  14877. addedItems.push([operation.request, operation.response])
  14878. }
  14879. // 4.2.7
  14880. resultList.push([operation.request, operation.response])
  14881. }
  14882. // 4.3
  14883. return resultList
  14884. } catch (e) { // 5.
  14885. // 5.1
  14886. this.#relevantRequestResponseList.length = 0
  14887. // 5.2
  14888. this.#relevantRequestResponseList = backupCache
  14889. // 5.3
  14890. throw e
  14891. }
  14892. }
  14893. /**
  14894. * @see https://w3c.github.io/ServiceWorker/#query-cache
  14895. * @param {any} requestQuery
  14896. * @param {import('../../types/cache').CacheQueryOptions} options
  14897. * @param {requestResponseList} targetStorage
  14898. * @returns {requestResponseList}
  14899. */
  14900. #queryCache (requestQuery, options, targetStorage) {
  14901. /** @type {requestResponseList} */
  14902. const resultList = []
  14903. const storage = targetStorage ?? this.#relevantRequestResponseList
  14904. for (const requestResponse of storage) {
  14905. const [cachedRequest, cachedResponse] = requestResponse
  14906. if (this.#requestMatchesCachedItem(requestQuery, cachedRequest, cachedResponse, options)) {
  14907. resultList.push(requestResponse)
  14908. }
  14909. }
  14910. return resultList
  14911. }
  14912. /**
  14913. * @see https://w3c.github.io/ServiceWorker/#request-matches-cached-item-algorithm
  14914. * @param {any} requestQuery
  14915. * @param {any} request
  14916. * @param {any | null} response
  14917. * @param {import('../../types/cache').CacheQueryOptions | undefined} options
  14918. * @returns {boolean}
  14919. */
  14920. #requestMatchesCachedItem (requestQuery, request, response = null, options) {
  14921. // if (options?.ignoreMethod === false && request.method === 'GET') {
  14922. // return false
  14923. // }
  14924. const queryURL = new URL(requestQuery.url)
  14925. const cachedURL = new URL(request.url)
  14926. if (options?.ignoreSearch) {
  14927. cachedURL.search = ''
  14928. queryURL.search = ''
  14929. }
  14930. if (!urlEquals(queryURL, cachedURL, true)) {
  14931. return false
  14932. }
  14933. if (
  14934. response == null ||
  14935. options?.ignoreVary ||
  14936. !response.headersList.contains('vary')
  14937. ) {
  14938. return true
  14939. }
  14940. const fieldValues = getFieldValues(response.headersList.get('vary'))
  14941. for (const fieldValue of fieldValues) {
  14942. if (fieldValue === '*') {
  14943. return false
  14944. }
  14945. const requestValue = request.headersList.get(fieldValue)
  14946. const queryValue = requestQuery.headersList.get(fieldValue)
  14947. // If one has the header and the other doesn't, or one has
  14948. // a different value than the other, return false
  14949. if (requestValue !== queryValue) {
  14950. return false
  14951. }
  14952. }
  14953. return true
  14954. }
  14955. }
  14956. Object.defineProperties(Cache.prototype, {
  14957. [Symbol.toStringTag]: {
  14958. value: 'Cache',
  14959. configurable: true
  14960. },
  14961. match: kEnumerableProperty,
  14962. matchAll: kEnumerableProperty,
  14963. add: kEnumerableProperty,
  14964. addAll: kEnumerableProperty,
  14965. put: kEnumerableProperty,
  14966. delete: kEnumerableProperty,
  14967. keys: kEnumerableProperty
  14968. })
  14969. const cacheQueryOptionConverters = [
  14970. {
  14971. key: 'ignoreSearch',
  14972. converter: webidl.converters.boolean,
  14973. defaultValue: false
  14974. },
  14975. {
  14976. key: 'ignoreMethod',
  14977. converter: webidl.converters.boolean,
  14978. defaultValue: false
  14979. },
  14980. {
  14981. key: 'ignoreVary',
  14982. converter: webidl.converters.boolean,
  14983. defaultValue: false
  14984. }
  14985. ]
  14986. webidl.converters.CacheQueryOptions = webidl.dictionaryConverter(cacheQueryOptionConverters)
  14987. webidl.converters.MultiCacheQueryOptions = webidl.dictionaryConverter([
  14988. ...cacheQueryOptionConverters,
  14989. {
  14990. key: 'cacheName',
  14991. converter: webidl.converters.DOMString
  14992. }
  14993. ])
  14994. webidl.converters.Response = webidl.interfaceConverter(Response)
  14995. webidl.converters['sequence<RequestInfo>'] = webidl.sequenceConverter(
  14996. webidl.converters.RequestInfo
  14997. )
  14998. module.exports = {
  14999. Cache
  15000. }
  15001. /***/ }),
  15002. /***/ 7907:
  15003. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  15004. "use strict";
  15005. const { kConstruct } = __nccwpck_require__(9174)
  15006. const { Cache } = __nccwpck_require__(6101)
  15007. const { webidl } = __nccwpck_require__(1744)
  15008. const { kEnumerableProperty } = __nccwpck_require__(3983)
  15009. class CacheStorage {
  15010. /**
  15011. * @see https://w3c.github.io/ServiceWorker/#dfn-relevant-name-to-cache-map
  15012. * @type {Map<string, import('./cache').requestResponseList}
  15013. */
  15014. #caches = new Map()
  15015. constructor () {
  15016. if (arguments[0] !== kConstruct) {
  15017. webidl.illegalConstructor()
  15018. }
  15019. }
  15020. async match (request, options = {}) {
  15021. webidl.brandCheck(this, CacheStorage)
  15022. webidl.argumentLengthCheck(arguments, 1, { header: 'CacheStorage.match' })
  15023. request = webidl.converters.RequestInfo(request)
  15024. options = webidl.converters.MultiCacheQueryOptions(options)
  15025. // 1.
  15026. if (options.cacheName != null) {
  15027. // 1.1.1.1
  15028. if (this.#caches.has(options.cacheName)) {
  15029. // 1.1.1.1.1
  15030. const cacheList = this.#caches.get(options.cacheName)
  15031. const cache = new Cache(kConstruct, cacheList)
  15032. return await cache.match(request, options)
  15033. }
  15034. } else { // 2.
  15035. // 2.2
  15036. for (const cacheList of this.#caches.values()) {
  15037. const cache = new Cache(kConstruct, cacheList)
  15038. // 2.2.1.2
  15039. const response = await cache.match(request, options)
  15040. if (response !== undefined) {
  15041. return response
  15042. }
  15043. }
  15044. }
  15045. }
  15046. /**
  15047. * @see https://w3c.github.io/ServiceWorker/#cache-storage-has
  15048. * @param {string} cacheName
  15049. * @returns {Promise<boolean>}
  15050. */
  15051. async has (cacheName) {
  15052. webidl.brandCheck(this, CacheStorage)
  15053. webidl.argumentLengthCheck(arguments, 1, { header: 'CacheStorage.has' })
  15054. cacheName = webidl.converters.DOMString(cacheName)
  15055. // 2.1.1
  15056. // 2.2
  15057. return this.#caches.has(cacheName)
  15058. }
  15059. /**
  15060. * @see https://w3c.github.io/ServiceWorker/#dom-cachestorage-open
  15061. * @param {string} cacheName
  15062. * @returns {Promise<Cache>}
  15063. */
  15064. async open (cacheName) {
  15065. webidl.brandCheck(this, CacheStorage)
  15066. webidl.argumentLengthCheck(arguments, 1, { header: 'CacheStorage.open' })
  15067. cacheName = webidl.converters.DOMString(cacheName)
  15068. // 2.1
  15069. if (this.#caches.has(cacheName)) {
  15070. // await caches.open('v1') !== await caches.open('v1')
  15071. // 2.1.1
  15072. const cache = this.#caches.get(cacheName)
  15073. // 2.1.1.1
  15074. return new Cache(kConstruct, cache)
  15075. }
  15076. // 2.2
  15077. const cache = []
  15078. // 2.3
  15079. this.#caches.set(cacheName, cache)
  15080. // 2.4
  15081. return new Cache(kConstruct, cache)
  15082. }
  15083. /**
  15084. * @see https://w3c.github.io/ServiceWorker/#cache-storage-delete
  15085. * @param {string} cacheName
  15086. * @returns {Promise<boolean>}
  15087. */
  15088. async delete (cacheName) {
  15089. webidl.brandCheck(this, CacheStorage)
  15090. webidl.argumentLengthCheck(arguments, 1, { header: 'CacheStorage.delete' })
  15091. cacheName = webidl.converters.DOMString(cacheName)
  15092. return this.#caches.delete(cacheName)
  15093. }
  15094. /**
  15095. * @see https://w3c.github.io/ServiceWorker/#cache-storage-keys
  15096. * @returns {string[]}
  15097. */
  15098. async keys () {
  15099. webidl.brandCheck(this, CacheStorage)
  15100. // 2.1
  15101. const keys = this.#caches.keys()
  15102. // 2.2
  15103. return [...keys]
  15104. }
  15105. }
  15106. Object.defineProperties(CacheStorage.prototype, {
  15107. [Symbol.toStringTag]: {
  15108. value: 'CacheStorage',
  15109. configurable: true
  15110. },
  15111. match: kEnumerableProperty,
  15112. has: kEnumerableProperty,
  15113. open: kEnumerableProperty,
  15114. delete: kEnumerableProperty,
  15115. keys: kEnumerableProperty
  15116. })
  15117. module.exports = {
  15118. CacheStorage
  15119. }
  15120. /***/ }),
  15121. /***/ 9174:
  15122. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  15123. "use strict";
  15124. module.exports = {
  15125. kConstruct: (__nccwpck_require__(2785).kConstruct)
  15126. }
  15127. /***/ }),
  15128. /***/ 2396:
  15129. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  15130. "use strict";
  15131. const assert = __nccwpck_require__(9491)
  15132. const { URLSerializer } = __nccwpck_require__(685)
  15133. const { isValidHeaderName } = __nccwpck_require__(2538)
  15134. /**
  15135. * @see https://url.spec.whatwg.org/#concept-url-equals
  15136. * @param {URL} A
  15137. * @param {URL} B
  15138. * @param {boolean | undefined} excludeFragment
  15139. * @returns {boolean}
  15140. */
  15141. function urlEquals (A, B, excludeFragment = false) {
  15142. const serializedA = URLSerializer(A, excludeFragment)
  15143. const serializedB = URLSerializer(B, excludeFragment)
  15144. return serializedA === serializedB
  15145. }
  15146. /**
  15147. * @see https://github.com/chromium/chromium/blob/694d20d134cb553d8d89e5500b9148012b1ba299/content/browser/cache_storage/cache_storage_cache.cc#L260-L262
  15148. * @param {string} header
  15149. */
  15150. function fieldValues (header) {
  15151. assert(header !== null)
  15152. const values = []
  15153. for (let value of header.split(',')) {
  15154. value = value.trim()
  15155. if (!value.length) {
  15156. continue
  15157. } else if (!isValidHeaderName(value)) {
  15158. continue
  15159. }
  15160. values.push(value)
  15161. }
  15162. return values
  15163. }
  15164. module.exports = {
  15165. urlEquals,
  15166. fieldValues
  15167. }
  15168. /***/ }),
  15169. /***/ 3598:
  15170. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  15171. "use strict";
  15172. // @ts-check
  15173. /* global WebAssembly */
  15174. const assert = __nccwpck_require__(9491)
  15175. const net = __nccwpck_require__(1808)
  15176. const http = __nccwpck_require__(3685)
  15177. const { pipeline } = __nccwpck_require__(2781)
  15178. const util = __nccwpck_require__(3983)
  15179. const timers = __nccwpck_require__(9459)
  15180. const Request = __nccwpck_require__(2905)
  15181. const DispatcherBase = __nccwpck_require__(4839)
  15182. const {
  15183. RequestContentLengthMismatchError,
  15184. ResponseContentLengthMismatchError,
  15185. InvalidArgumentError,
  15186. RequestAbortedError,
  15187. HeadersTimeoutError,
  15188. HeadersOverflowError,
  15189. SocketError,
  15190. InformationalError,
  15191. BodyTimeoutError,
  15192. HTTPParserError,
  15193. ResponseExceededMaxSizeError,
  15194. ClientDestroyedError
  15195. } = __nccwpck_require__(8045)
  15196. const buildConnector = __nccwpck_require__(2067)
  15197. const {
  15198. kUrl,
  15199. kReset,
  15200. kServerName,
  15201. kClient,
  15202. kBusy,
  15203. kParser,
  15204. kConnect,
  15205. kBlocking,
  15206. kResuming,
  15207. kRunning,
  15208. kPending,
  15209. kSize,
  15210. kWriting,
  15211. kQueue,
  15212. kConnected,
  15213. kConnecting,
  15214. kNeedDrain,
  15215. kNoRef,
  15216. kKeepAliveDefaultTimeout,
  15217. kHostHeader,
  15218. kPendingIdx,
  15219. kRunningIdx,
  15220. kError,
  15221. kPipelining,
  15222. kSocket,
  15223. kKeepAliveTimeoutValue,
  15224. kMaxHeadersSize,
  15225. kKeepAliveMaxTimeout,
  15226. kKeepAliveTimeoutThreshold,
  15227. kHeadersTimeout,
  15228. kBodyTimeout,
  15229. kStrictContentLength,
  15230. kConnector,
  15231. kMaxRedirections,
  15232. kMaxRequests,
  15233. kCounter,
  15234. kClose,
  15235. kDestroy,
  15236. kDispatch,
  15237. kInterceptors,
  15238. kLocalAddress,
  15239. kMaxResponseSize,
  15240. kHTTPConnVersion,
  15241. // HTTP2
  15242. kHost,
  15243. kHTTP2Session,
  15244. kHTTP2SessionState,
  15245. kHTTP2BuildRequest,
  15246. kHTTP2CopyHeaders,
  15247. kHTTP1BuildRequest
  15248. } = __nccwpck_require__(2785)
  15249. /** @type {import('http2')} */
  15250. let http2
  15251. try {
  15252. http2 = __nccwpck_require__(5158)
  15253. } catch {
  15254. // @ts-ignore
  15255. http2 = { constants: {} }
  15256. }
  15257. const {
  15258. constants: {
  15259. HTTP2_HEADER_AUTHORITY,
  15260. HTTP2_HEADER_METHOD,
  15261. HTTP2_HEADER_PATH,
  15262. HTTP2_HEADER_SCHEME,
  15263. HTTP2_HEADER_CONTENT_LENGTH,
  15264. HTTP2_HEADER_EXPECT,
  15265. HTTP2_HEADER_STATUS
  15266. }
  15267. } = http2
  15268. // Experimental
  15269. let h2ExperimentalWarned = false
  15270. const FastBuffer = Buffer[Symbol.species]
  15271. const kClosedResolve = Symbol('kClosedResolve')
  15272. const channels = {}
  15273. try {
  15274. const diagnosticsChannel = __nccwpck_require__(7643)
  15275. channels.sendHeaders = diagnosticsChannel.channel('undici:client:sendHeaders')
  15276. channels.beforeConnect = diagnosticsChannel.channel('undici:client:beforeConnect')
  15277. channels.connectError = diagnosticsChannel.channel('undici:client:connectError')
  15278. channels.connected = diagnosticsChannel.channel('undici:client:connected')
  15279. } catch {
  15280. channels.sendHeaders = { hasSubscribers: false }
  15281. channels.beforeConnect = { hasSubscribers: false }
  15282. channels.connectError = { hasSubscribers: false }
  15283. channels.connected = { hasSubscribers: false }
  15284. }
  15285. /**
  15286. * @type {import('../types/client').default}
  15287. */
  15288. class Client extends DispatcherBase {
  15289. /**
  15290. *
  15291. * @param {string|URL} url
  15292. * @param {import('../types/client').Client.Options} options
  15293. */
  15294. constructor (url, {
  15295. interceptors,
  15296. maxHeaderSize,
  15297. headersTimeout,
  15298. socketTimeout,
  15299. requestTimeout,
  15300. connectTimeout,
  15301. bodyTimeout,
  15302. idleTimeout,
  15303. keepAlive,
  15304. keepAliveTimeout,
  15305. maxKeepAliveTimeout,
  15306. keepAliveMaxTimeout,
  15307. keepAliveTimeoutThreshold,
  15308. socketPath,
  15309. pipelining,
  15310. tls,
  15311. strictContentLength,
  15312. maxCachedSessions,
  15313. maxRedirections,
  15314. connect,
  15315. maxRequestsPerClient,
  15316. localAddress,
  15317. maxResponseSize,
  15318. autoSelectFamily,
  15319. autoSelectFamilyAttemptTimeout,
  15320. // h2
  15321. allowH2,
  15322. maxConcurrentStreams
  15323. } = {}) {
  15324. super()
  15325. if (keepAlive !== undefined) {
  15326. throw new InvalidArgumentError('unsupported keepAlive, use pipelining=0 instead')
  15327. }
  15328. if (socketTimeout !== undefined) {
  15329. throw new InvalidArgumentError('unsupported socketTimeout, use headersTimeout & bodyTimeout instead')
  15330. }
  15331. if (requestTimeout !== undefined) {
  15332. throw new InvalidArgumentError('unsupported requestTimeout, use headersTimeout & bodyTimeout instead')
  15333. }
  15334. if (idleTimeout !== undefined) {
  15335. throw new InvalidArgumentError('unsupported idleTimeout, use keepAliveTimeout instead')
  15336. }
  15337. if (maxKeepAliveTimeout !== undefined) {
  15338. throw new InvalidArgumentError('unsupported maxKeepAliveTimeout, use keepAliveMaxTimeout instead')
  15339. }
  15340. if (maxHeaderSize != null && !Number.isFinite(maxHeaderSize)) {
  15341. throw new InvalidArgumentError('invalid maxHeaderSize')
  15342. }
  15343. if (socketPath != null && typeof socketPath !== 'string') {
  15344. throw new InvalidArgumentError('invalid socketPath')
  15345. }
  15346. if (connectTimeout != null && (!Number.isFinite(connectTimeout) || connectTimeout < 0)) {
  15347. throw new InvalidArgumentError('invalid connectTimeout')
  15348. }
  15349. if (keepAliveTimeout != null && (!Number.isFinite(keepAliveTimeout) || keepAliveTimeout <= 0)) {
  15350. throw new InvalidArgumentError('invalid keepAliveTimeout')
  15351. }
  15352. if (keepAliveMaxTimeout != null && (!Number.isFinite(keepAliveMaxTimeout) || keepAliveMaxTimeout <= 0)) {
  15353. throw new InvalidArgumentError('invalid keepAliveMaxTimeout')
  15354. }
  15355. if (keepAliveTimeoutThreshold != null && !Number.isFinite(keepAliveTimeoutThreshold)) {
  15356. throw new InvalidArgumentError('invalid keepAliveTimeoutThreshold')
  15357. }
  15358. if (headersTimeout != null && (!Number.isInteger(headersTimeout) || headersTimeout < 0)) {
  15359. throw new InvalidArgumentError('headersTimeout must be a positive integer or zero')
  15360. }
  15361. if (bodyTimeout != null && (!Number.isInteger(bodyTimeout) || bodyTimeout < 0)) {
  15362. throw new InvalidArgumentError('bodyTimeout must be a positive integer or zero')
  15363. }
  15364. if (connect != null && typeof connect !== 'function' && typeof connect !== 'object') {
  15365. throw new InvalidArgumentError('connect must be a function or an object')
  15366. }
  15367. if (maxRedirections != null && (!Number.isInteger(maxRedirections) || maxRedirections < 0)) {
  15368. throw new InvalidArgumentError('maxRedirections must be a positive number')
  15369. }
  15370. if (maxRequestsPerClient != null && (!Number.isInteger(maxRequestsPerClient) || maxRequestsPerClient < 0)) {
  15371. throw new InvalidArgumentError('maxRequestsPerClient must be a positive number')
  15372. }
  15373. if (localAddress != null && (typeof localAddress !== 'string' || net.isIP(localAddress) === 0)) {
  15374. throw new InvalidArgumentError('localAddress must be valid string IP address')
  15375. }
  15376. if (maxResponseSize != null && (!Number.isInteger(maxResponseSize) || maxResponseSize < -1)) {
  15377. throw new InvalidArgumentError('maxResponseSize must be a positive number')
  15378. }
  15379. if (
  15380. autoSelectFamilyAttemptTimeout != null &&
  15381. (!Number.isInteger(autoSelectFamilyAttemptTimeout) || autoSelectFamilyAttemptTimeout < -1)
  15382. ) {
  15383. throw new InvalidArgumentError('autoSelectFamilyAttemptTimeout must be a positive number')
  15384. }
  15385. // h2
  15386. if (allowH2 != null && typeof allowH2 !== 'boolean') {
  15387. throw new InvalidArgumentError('allowH2 must be a valid boolean value')
  15388. }
  15389. if (maxConcurrentStreams != null && (typeof maxConcurrentStreams !== 'number' || maxConcurrentStreams < 1)) {
  15390. throw new InvalidArgumentError('maxConcurrentStreams must be a possitive integer, greater than 0')
  15391. }
  15392. if (typeof connect !== 'function') {
  15393. connect = buildConnector({
  15394. ...tls,
  15395. maxCachedSessions,
  15396. allowH2,
  15397. socketPath,
  15398. timeout: connectTimeout,
  15399. ...(util.nodeHasAutoSelectFamily && autoSelectFamily ? { autoSelectFamily, autoSelectFamilyAttemptTimeout } : undefined),
  15400. ...connect
  15401. })
  15402. }
  15403. this[kInterceptors] = interceptors && interceptors.Client && Array.isArray(interceptors.Client)
  15404. ? interceptors.Client
  15405. : [createRedirectInterceptor({ maxRedirections })]
  15406. this[kUrl] = util.parseOrigin(url)
  15407. this[kConnector] = connect
  15408. this[kSocket] = null
  15409. this[kPipelining] = pipelining != null ? pipelining : 1
  15410. this[kMaxHeadersSize] = maxHeaderSize || http.maxHeaderSize
  15411. this[kKeepAliveDefaultTimeout] = keepAliveTimeout == null ? 4e3 : keepAliveTimeout
  15412. this[kKeepAliveMaxTimeout] = keepAliveMaxTimeout == null ? 600e3 : keepAliveMaxTimeout
  15413. this[kKeepAliveTimeoutThreshold] = keepAliveTimeoutThreshold == null ? 1e3 : keepAliveTimeoutThreshold
  15414. this[kKeepAliveTimeoutValue] = this[kKeepAliveDefaultTimeout]
  15415. this[kServerName] = null
  15416. this[kLocalAddress] = localAddress != null ? localAddress : null
  15417. this[kResuming] = 0 // 0, idle, 1, scheduled, 2 resuming
  15418. this[kNeedDrain] = 0 // 0, idle, 1, scheduled, 2 resuming
  15419. this[kHostHeader] = `host: ${this[kUrl].hostname}${this[kUrl].port ? `:${this[kUrl].port}` : ''}\r\n`
  15420. this[kBodyTimeout] = bodyTimeout != null ? bodyTimeout : 300e3
  15421. this[kHeadersTimeout] = headersTimeout != null ? headersTimeout : 300e3
  15422. this[kStrictContentLength] = strictContentLength == null ? true : strictContentLength
  15423. this[kMaxRedirections] = maxRedirections
  15424. this[kMaxRequests] = maxRequestsPerClient
  15425. this[kClosedResolve] = null
  15426. this[kMaxResponseSize] = maxResponseSize > -1 ? maxResponseSize : -1
  15427. this[kHTTPConnVersion] = 'h1'
  15428. // HTTP/2
  15429. this[kHTTP2Session] = null
  15430. this[kHTTP2SessionState] = !allowH2
  15431. ? null
  15432. : {
  15433. // streams: null, // Fixed queue of streams - For future support of `push`
  15434. openStreams: 0, // Keep track of them to decide wether or not unref the session
  15435. maxConcurrentStreams: maxConcurrentStreams != null ? maxConcurrentStreams : 100 // Max peerConcurrentStreams for a Node h2 server
  15436. }
  15437. this[kHost] = `${this[kUrl].hostname}${this[kUrl].port ? `:${this[kUrl].port}` : ''}`
  15438. // kQueue is built up of 3 sections separated by
  15439. // the kRunningIdx and kPendingIdx indices.
  15440. // | complete | running | pending |
  15441. // ^ kRunningIdx ^ kPendingIdx ^ kQueue.length
  15442. // kRunningIdx points to the first running element.
  15443. // kPendingIdx points to the first pending element.
  15444. // This implements a fast queue with an amortized
  15445. // time of O(1).
  15446. this[kQueue] = []
  15447. this[kRunningIdx] = 0
  15448. this[kPendingIdx] = 0
  15449. }
  15450. get pipelining () {
  15451. return this[kPipelining]
  15452. }
  15453. set pipelining (value) {
  15454. this[kPipelining] = value
  15455. resume(this, true)
  15456. }
  15457. get [kPending] () {
  15458. return this[kQueue].length - this[kPendingIdx]
  15459. }
  15460. get [kRunning] () {
  15461. return this[kPendingIdx] - this[kRunningIdx]
  15462. }
  15463. get [kSize] () {
  15464. return this[kQueue].length - this[kRunningIdx]
  15465. }
  15466. get [kConnected] () {
  15467. return !!this[kSocket] && !this[kConnecting] && !this[kSocket].destroyed
  15468. }
  15469. get [kBusy] () {
  15470. const socket = this[kSocket]
  15471. return (
  15472. (socket && (socket[kReset] || socket[kWriting] || socket[kBlocking])) ||
  15473. (this[kSize] >= (this[kPipelining] || 1)) ||
  15474. this[kPending] > 0
  15475. )
  15476. }
  15477. /* istanbul ignore: only used for test */
  15478. [kConnect] (cb) {
  15479. connect(this)
  15480. this.once('connect', cb)
  15481. }
  15482. [kDispatch] (opts, handler) {
  15483. const origin = opts.origin || this[kUrl].origin
  15484. const request = this[kHTTPConnVersion] === 'h2'
  15485. ? Request[kHTTP2BuildRequest](origin, opts, handler)
  15486. : Request[kHTTP1BuildRequest](origin, opts, handler)
  15487. this[kQueue].push(request)
  15488. if (this[kResuming]) {
  15489. // Do nothing.
  15490. } else if (util.bodyLength(request.body) == null && util.isIterable(request.body)) {
  15491. // Wait a tick in case stream/iterator is ended in the same tick.
  15492. this[kResuming] = 1
  15493. process.nextTick(resume, this)
  15494. } else {
  15495. resume(this, true)
  15496. }
  15497. if (this[kResuming] && this[kNeedDrain] !== 2 && this[kBusy]) {
  15498. this[kNeedDrain] = 2
  15499. }
  15500. return this[kNeedDrain] < 2
  15501. }
  15502. async [kClose] () {
  15503. // TODO: for H2 we need to gracefully flush the remaining enqueued
  15504. // request and close each stream.
  15505. return new Promise((resolve) => {
  15506. if (!this[kSize]) {
  15507. resolve(null)
  15508. } else {
  15509. this[kClosedResolve] = resolve
  15510. }
  15511. })
  15512. }
  15513. async [kDestroy] (err) {
  15514. return new Promise((resolve) => {
  15515. const requests = this[kQueue].splice(this[kPendingIdx])
  15516. for (let i = 0; i < requests.length; i++) {
  15517. const request = requests[i]
  15518. errorRequest(this, request, err)
  15519. }
  15520. const callback = () => {
  15521. if (this[kClosedResolve]) {
  15522. // TODO (fix): Should we error here with ClientDestroyedError?
  15523. this[kClosedResolve]()
  15524. this[kClosedResolve] = null
  15525. }
  15526. resolve()
  15527. }
  15528. if (this[kHTTP2Session] != null) {
  15529. util.destroy(this[kHTTP2Session], err)
  15530. this[kHTTP2Session] = null
  15531. this[kHTTP2SessionState] = null
  15532. }
  15533. if (!this[kSocket]) {
  15534. queueMicrotask(callback)
  15535. } else {
  15536. util.destroy(this[kSocket].on('close', callback), err)
  15537. }
  15538. resume(this)
  15539. })
  15540. }
  15541. }
  15542. function onHttp2SessionError (err) {
  15543. assert(err.code !== 'ERR_TLS_CERT_ALTNAME_INVALID')
  15544. this[kSocket][kError] = err
  15545. onError(this[kClient], err)
  15546. }
  15547. function onHttp2FrameError (type, code, id) {
  15548. const err = new InformationalError(`HTTP/2: "frameError" received - type ${type}, code ${code}`)
  15549. if (id === 0) {
  15550. this[kSocket][kError] = err
  15551. onError(this[kClient], err)
  15552. }
  15553. }
  15554. function onHttp2SessionEnd () {
  15555. util.destroy(this, new SocketError('other side closed'))
  15556. util.destroy(this[kSocket], new SocketError('other side closed'))
  15557. }
  15558. function onHTTP2GoAway (code) {
  15559. const client = this[kClient]
  15560. const err = new InformationalError(`HTTP/2: "GOAWAY" frame received with code ${code}`)
  15561. client[kSocket] = null
  15562. client[kHTTP2Session] = null
  15563. if (client.destroyed) {
  15564. assert(this[kPending] === 0)
  15565. // Fail entire queue.
  15566. const requests = client[kQueue].splice(client[kRunningIdx])
  15567. for (let i = 0; i < requests.length; i++) {
  15568. const request = requests[i]
  15569. errorRequest(this, request, err)
  15570. }
  15571. } else if (client[kRunning] > 0) {
  15572. // Fail head of pipeline.
  15573. const request = client[kQueue][client[kRunningIdx]]
  15574. client[kQueue][client[kRunningIdx]++] = null
  15575. errorRequest(client, request, err)
  15576. }
  15577. client[kPendingIdx] = client[kRunningIdx]
  15578. assert(client[kRunning] === 0)
  15579. client.emit('disconnect',
  15580. client[kUrl],
  15581. [client],
  15582. err
  15583. )
  15584. resume(client)
  15585. }
  15586. const constants = __nccwpck_require__(953)
  15587. const createRedirectInterceptor = __nccwpck_require__(8861)
  15588. const EMPTY_BUF = Buffer.alloc(0)
  15589. async function lazyllhttp () {
  15590. const llhttpWasmData = process.env.JEST_WORKER_ID ? __nccwpck_require__(1145) : undefined
  15591. let mod
  15592. try {
  15593. mod = await WebAssembly.compile(Buffer.from(__nccwpck_require__(5627), 'base64'))
  15594. } catch (e) {
  15595. /* istanbul ignore next */
  15596. // We could check if the error was caused by the simd option not
  15597. // being enabled, but the occurring of this other error
  15598. // * https://github.com/emscripten-core/emscripten/issues/11495
  15599. // got me to remove that check to avoid breaking Node 12.
  15600. mod = await WebAssembly.compile(Buffer.from(llhttpWasmData || __nccwpck_require__(1145), 'base64'))
  15601. }
  15602. return await WebAssembly.instantiate(mod, {
  15603. env: {
  15604. /* eslint-disable camelcase */
  15605. wasm_on_url: (p, at, len) => {
  15606. /* istanbul ignore next */
  15607. return 0
  15608. },
  15609. wasm_on_status: (p, at, len) => {
  15610. assert.strictEqual(currentParser.ptr, p)
  15611. const start = at - currentBufferPtr + currentBufferRef.byteOffset
  15612. return currentParser.onStatus(new FastBuffer(currentBufferRef.buffer, start, len)) || 0
  15613. },
  15614. wasm_on_message_begin: (p) => {
  15615. assert.strictEqual(currentParser.ptr, p)
  15616. return currentParser.onMessageBegin() || 0
  15617. },
  15618. wasm_on_header_field: (p, at, len) => {
  15619. assert.strictEqual(currentParser.ptr, p)
  15620. const start = at - currentBufferPtr + currentBufferRef.byteOffset
  15621. return currentParser.onHeaderField(new FastBuffer(currentBufferRef.buffer, start, len)) || 0
  15622. },
  15623. wasm_on_header_value: (p, at, len) => {
  15624. assert.strictEqual(currentParser.ptr, p)
  15625. const start = at - currentBufferPtr + currentBufferRef.byteOffset
  15626. return currentParser.onHeaderValue(new FastBuffer(currentBufferRef.buffer, start, len)) || 0
  15627. },
  15628. wasm_on_headers_complete: (p, statusCode, upgrade, shouldKeepAlive) => {
  15629. assert.strictEqual(currentParser.ptr, p)
  15630. return currentParser.onHeadersComplete(statusCode, Boolean(upgrade), Boolean(shouldKeepAlive)) || 0
  15631. },
  15632. wasm_on_body: (p, at, len) => {
  15633. assert.strictEqual(currentParser.ptr, p)
  15634. const start = at - currentBufferPtr + currentBufferRef.byteOffset
  15635. return currentParser.onBody(new FastBuffer(currentBufferRef.buffer, start, len)) || 0
  15636. },
  15637. wasm_on_message_complete: (p) => {
  15638. assert.strictEqual(currentParser.ptr, p)
  15639. return currentParser.onMessageComplete() || 0
  15640. }
  15641. /* eslint-enable camelcase */
  15642. }
  15643. })
  15644. }
  15645. let llhttpInstance = null
  15646. let llhttpPromise = lazyllhttp()
  15647. llhttpPromise.catch()
  15648. let currentParser = null
  15649. let currentBufferRef = null
  15650. let currentBufferSize = 0
  15651. let currentBufferPtr = null
  15652. const TIMEOUT_HEADERS = 1
  15653. const TIMEOUT_BODY = 2
  15654. const TIMEOUT_IDLE = 3
  15655. class Parser {
  15656. constructor (client, socket, { exports }) {
  15657. assert(Number.isFinite(client[kMaxHeadersSize]) && client[kMaxHeadersSize] > 0)
  15658. this.llhttp = exports
  15659. this.ptr = this.llhttp.llhttp_alloc(constants.TYPE.RESPONSE)
  15660. this.client = client
  15661. this.socket = socket
  15662. this.timeout = null
  15663. this.timeoutValue = null
  15664. this.timeoutType = null
  15665. this.statusCode = null
  15666. this.statusText = ''
  15667. this.upgrade = false
  15668. this.headers = []
  15669. this.headersSize = 0
  15670. this.headersMaxSize = client[kMaxHeadersSize]
  15671. this.shouldKeepAlive = false
  15672. this.paused = false
  15673. this.resume = this.resume.bind(this)
  15674. this.bytesRead = 0
  15675. this.keepAlive = ''
  15676. this.contentLength = ''
  15677. this.connection = ''
  15678. this.maxResponseSize = client[kMaxResponseSize]
  15679. }
  15680. setTimeout (value, type) {
  15681. this.timeoutType = type
  15682. if (value !== this.timeoutValue) {
  15683. timers.clearTimeout(this.timeout)
  15684. if (value) {
  15685. this.timeout = timers.setTimeout(onParserTimeout, value, this)
  15686. // istanbul ignore else: only for jest
  15687. if (this.timeout.unref) {
  15688. this.timeout.unref()
  15689. }
  15690. } else {
  15691. this.timeout = null
  15692. }
  15693. this.timeoutValue = value
  15694. } else if (this.timeout) {
  15695. // istanbul ignore else: only for jest
  15696. if (this.timeout.refresh) {
  15697. this.timeout.refresh()
  15698. }
  15699. }
  15700. }
  15701. resume () {
  15702. if (this.socket.destroyed || !this.paused) {
  15703. return
  15704. }
  15705. assert(this.ptr != null)
  15706. assert(currentParser == null)
  15707. this.llhttp.llhttp_resume(this.ptr)
  15708. assert(this.timeoutType === TIMEOUT_BODY)
  15709. if (this.timeout) {
  15710. // istanbul ignore else: only for jest
  15711. if (this.timeout.refresh) {
  15712. this.timeout.refresh()
  15713. }
  15714. }
  15715. this.paused = false
  15716. this.execute(this.socket.read() || EMPTY_BUF) // Flush parser.
  15717. this.readMore()
  15718. }
  15719. readMore () {
  15720. while (!this.paused && this.ptr) {
  15721. const chunk = this.socket.read()
  15722. if (chunk === null) {
  15723. break
  15724. }
  15725. this.execute(chunk)
  15726. }
  15727. }
  15728. execute (data) {
  15729. assert(this.ptr != null)
  15730. assert(currentParser == null)
  15731. assert(!this.paused)
  15732. const { socket, llhttp } = this
  15733. if (data.length > currentBufferSize) {
  15734. if (currentBufferPtr) {
  15735. llhttp.free(currentBufferPtr)
  15736. }
  15737. currentBufferSize = Math.ceil(data.length / 4096) * 4096
  15738. currentBufferPtr = llhttp.malloc(currentBufferSize)
  15739. }
  15740. new Uint8Array(llhttp.memory.buffer, currentBufferPtr, currentBufferSize).set(data)
  15741. // Call `execute` on the wasm parser.
  15742. // We pass the `llhttp_parser` pointer address, the pointer address of buffer view data,
  15743. // and finally the length of bytes to parse.
  15744. // The return value is an error code or `constants.ERROR.OK`.
  15745. try {
  15746. let ret
  15747. try {
  15748. currentBufferRef = data
  15749. currentParser = this
  15750. ret = llhttp.llhttp_execute(this.ptr, currentBufferPtr, data.length)
  15751. /* eslint-disable-next-line no-useless-catch */
  15752. } catch (err) {
  15753. /* istanbul ignore next: difficult to make a test case for */
  15754. throw err
  15755. } finally {
  15756. currentParser = null
  15757. currentBufferRef = null
  15758. }
  15759. const offset = llhttp.llhttp_get_error_pos(this.ptr) - currentBufferPtr
  15760. if (ret === constants.ERROR.PAUSED_UPGRADE) {
  15761. this.onUpgrade(data.slice(offset))
  15762. } else if (ret === constants.ERROR.PAUSED) {
  15763. this.paused = true
  15764. socket.unshift(data.slice(offset))
  15765. } else if (ret !== constants.ERROR.OK) {
  15766. const ptr = llhttp.llhttp_get_error_reason(this.ptr)
  15767. let message = ''
  15768. /* istanbul ignore else: difficult to make a test case for */
  15769. if (ptr) {
  15770. const len = new Uint8Array(llhttp.memory.buffer, ptr).indexOf(0)
  15771. message =
  15772. 'Response does not match the HTTP/1.1 protocol (' +
  15773. Buffer.from(llhttp.memory.buffer, ptr, len).toString() +
  15774. ')'
  15775. }
  15776. throw new HTTPParserError(message, constants.ERROR[ret], data.slice(offset))
  15777. }
  15778. } catch (err) {
  15779. util.destroy(socket, err)
  15780. }
  15781. }
  15782. destroy () {
  15783. assert(this.ptr != null)
  15784. assert(currentParser == null)
  15785. this.llhttp.llhttp_free(this.ptr)
  15786. this.ptr = null
  15787. timers.clearTimeout(this.timeout)
  15788. this.timeout = null
  15789. this.timeoutValue = null
  15790. this.timeoutType = null
  15791. this.paused = false
  15792. }
  15793. onStatus (buf) {
  15794. this.statusText = buf.toString()
  15795. }
  15796. onMessageBegin () {
  15797. const { socket, client } = this
  15798. /* istanbul ignore next: difficult to make a test case for */
  15799. if (socket.destroyed) {
  15800. return -1
  15801. }
  15802. const request = client[kQueue][client[kRunningIdx]]
  15803. if (!request) {
  15804. return -1
  15805. }
  15806. }
  15807. onHeaderField (buf) {
  15808. const len = this.headers.length
  15809. if ((len & 1) === 0) {
  15810. this.headers.push(buf)
  15811. } else {
  15812. this.headers[len - 1] = Buffer.concat([this.headers[len - 1], buf])
  15813. }
  15814. this.trackHeader(buf.length)
  15815. }
  15816. onHeaderValue (buf) {
  15817. let len = this.headers.length
  15818. if ((len & 1) === 1) {
  15819. this.headers.push(buf)
  15820. len += 1
  15821. } else {
  15822. this.headers[len - 1] = Buffer.concat([this.headers[len - 1], buf])
  15823. }
  15824. const key = this.headers[len - 2]
  15825. if (key.length === 10 && key.toString().toLowerCase() === 'keep-alive') {
  15826. this.keepAlive += buf.toString()
  15827. } else if (key.length === 10 && key.toString().toLowerCase() === 'connection') {
  15828. this.connection += buf.toString()
  15829. } else if (key.length === 14 && key.toString().toLowerCase() === 'content-length') {
  15830. this.contentLength += buf.toString()
  15831. }
  15832. this.trackHeader(buf.length)
  15833. }
  15834. trackHeader (len) {
  15835. this.headersSize += len
  15836. if (this.headersSize >= this.headersMaxSize) {
  15837. util.destroy(this.socket, new HeadersOverflowError())
  15838. }
  15839. }
  15840. onUpgrade (head) {
  15841. const { upgrade, client, socket, headers, statusCode } = this
  15842. assert(upgrade)
  15843. const request = client[kQueue][client[kRunningIdx]]
  15844. assert(request)
  15845. assert(!socket.destroyed)
  15846. assert(socket === client[kSocket])
  15847. assert(!this.paused)
  15848. assert(request.upgrade || request.method === 'CONNECT')
  15849. this.statusCode = null
  15850. this.statusText = ''
  15851. this.shouldKeepAlive = null
  15852. assert(this.headers.length % 2 === 0)
  15853. this.headers = []
  15854. this.headersSize = 0
  15855. socket.unshift(head)
  15856. socket[kParser].destroy()
  15857. socket[kParser] = null
  15858. socket[kClient] = null
  15859. socket[kError] = null
  15860. socket
  15861. .removeListener('error', onSocketError)
  15862. .removeListener('readable', onSocketReadable)
  15863. .removeListener('end', onSocketEnd)
  15864. .removeListener('close', onSocketClose)
  15865. client[kSocket] = null
  15866. client[kQueue][client[kRunningIdx]++] = null
  15867. client.emit('disconnect', client[kUrl], [client], new InformationalError('upgrade'))
  15868. try {
  15869. request.onUpgrade(statusCode, headers, socket)
  15870. } catch (err) {
  15871. util.destroy(socket, err)
  15872. }
  15873. resume(client)
  15874. }
  15875. onHeadersComplete (statusCode, upgrade, shouldKeepAlive) {
  15876. const { client, socket, headers, statusText } = this
  15877. /* istanbul ignore next: difficult to make a test case for */
  15878. if (socket.destroyed) {
  15879. return -1
  15880. }
  15881. const request = client[kQueue][client[kRunningIdx]]
  15882. /* istanbul ignore next: difficult to make a test case for */
  15883. if (!request) {
  15884. return -1
  15885. }
  15886. assert(!this.upgrade)
  15887. assert(this.statusCode < 200)
  15888. if (statusCode === 100) {
  15889. util.destroy(socket, new SocketError('bad response', util.getSocketInfo(socket)))
  15890. return -1
  15891. }
  15892. /* this can only happen if server is misbehaving */
  15893. if (upgrade && !request.upgrade) {
  15894. util.destroy(socket, new SocketError('bad upgrade', util.getSocketInfo(socket)))
  15895. return -1
  15896. }
  15897. assert.strictEqual(this.timeoutType, TIMEOUT_HEADERS)
  15898. this.statusCode = statusCode
  15899. this.shouldKeepAlive = (
  15900. shouldKeepAlive ||
  15901. // Override llhttp value which does not allow keepAlive for HEAD.
  15902. (request.method === 'HEAD' && !socket[kReset] && this.connection.toLowerCase() === 'keep-alive')
  15903. )
  15904. if (this.statusCode >= 200) {
  15905. const bodyTimeout = request.bodyTimeout != null
  15906. ? request.bodyTimeout
  15907. : client[kBodyTimeout]
  15908. this.setTimeout(bodyTimeout, TIMEOUT_BODY)
  15909. } else if (this.timeout) {
  15910. // istanbul ignore else: only for jest
  15911. if (this.timeout.refresh) {
  15912. this.timeout.refresh()
  15913. }
  15914. }
  15915. if (request.method === 'CONNECT') {
  15916. assert(client[kRunning] === 1)
  15917. this.upgrade = true
  15918. return 2
  15919. }
  15920. if (upgrade) {
  15921. assert(client[kRunning] === 1)
  15922. this.upgrade = true
  15923. return 2
  15924. }
  15925. assert(this.headers.length % 2 === 0)
  15926. this.headers = []
  15927. this.headersSize = 0
  15928. if (this.shouldKeepAlive && client[kPipelining]) {
  15929. const keepAliveTimeout = this.keepAlive ? util.parseKeepAliveTimeout(this.keepAlive) : null
  15930. if (keepAliveTimeout != null) {
  15931. const timeout = Math.min(
  15932. keepAliveTimeout - client[kKeepAliveTimeoutThreshold],
  15933. client[kKeepAliveMaxTimeout]
  15934. )
  15935. if (timeout <= 0) {
  15936. socket[kReset] = true
  15937. } else {
  15938. client[kKeepAliveTimeoutValue] = timeout
  15939. }
  15940. } else {
  15941. client[kKeepAliveTimeoutValue] = client[kKeepAliveDefaultTimeout]
  15942. }
  15943. } else {
  15944. // Stop more requests from being dispatched.
  15945. socket[kReset] = true
  15946. }
  15947. const pause = request.onHeaders(statusCode, headers, this.resume, statusText) === false
  15948. if (request.aborted) {
  15949. return -1
  15950. }
  15951. if (request.method === 'HEAD') {
  15952. return 1
  15953. }
  15954. if (statusCode < 200) {
  15955. return 1
  15956. }
  15957. if (socket[kBlocking]) {
  15958. socket[kBlocking] = false
  15959. resume(client)
  15960. }
  15961. return pause ? constants.ERROR.PAUSED : 0
  15962. }
  15963. onBody (buf) {
  15964. const { client, socket, statusCode, maxResponseSize } = this
  15965. if (socket.destroyed) {
  15966. return -1
  15967. }
  15968. const request = client[kQueue][client[kRunningIdx]]
  15969. assert(request)
  15970. assert.strictEqual(this.timeoutType, TIMEOUT_BODY)
  15971. if (this.timeout) {
  15972. // istanbul ignore else: only for jest
  15973. if (this.timeout.refresh) {
  15974. this.timeout.refresh()
  15975. }
  15976. }
  15977. assert(statusCode >= 200)
  15978. if (maxResponseSize > -1 && this.bytesRead + buf.length > maxResponseSize) {
  15979. util.destroy(socket, new ResponseExceededMaxSizeError())
  15980. return -1
  15981. }
  15982. this.bytesRead += buf.length
  15983. if (request.onData(buf) === false) {
  15984. return constants.ERROR.PAUSED
  15985. }
  15986. }
  15987. onMessageComplete () {
  15988. const { client, socket, statusCode, upgrade, headers, contentLength, bytesRead, shouldKeepAlive } = this
  15989. if (socket.destroyed && (!statusCode || shouldKeepAlive)) {
  15990. return -1
  15991. }
  15992. if (upgrade) {
  15993. return
  15994. }
  15995. const request = client[kQueue][client[kRunningIdx]]
  15996. assert(request)
  15997. assert(statusCode >= 100)
  15998. this.statusCode = null
  15999. this.statusText = ''
  16000. this.bytesRead = 0
  16001. this.contentLength = ''
  16002. this.keepAlive = ''
  16003. this.connection = ''
  16004. assert(this.headers.length % 2 === 0)
  16005. this.headers = []
  16006. this.headersSize = 0
  16007. if (statusCode < 200) {
  16008. return
  16009. }
  16010. /* istanbul ignore next: should be handled by llhttp? */
  16011. if (request.method !== 'HEAD' && contentLength && bytesRead !== parseInt(contentLength, 10)) {
  16012. util.destroy(socket, new ResponseContentLengthMismatchError())
  16013. return -1
  16014. }
  16015. request.onComplete(headers)
  16016. client[kQueue][client[kRunningIdx]++] = null
  16017. if (socket[kWriting]) {
  16018. assert.strictEqual(client[kRunning], 0)
  16019. // Response completed before request.
  16020. util.destroy(socket, new InformationalError('reset'))
  16021. return constants.ERROR.PAUSED
  16022. } else if (!shouldKeepAlive) {
  16023. util.destroy(socket, new InformationalError('reset'))
  16024. return constants.ERROR.PAUSED
  16025. } else if (socket[kReset] && client[kRunning] === 0) {
  16026. // Destroy socket once all requests have completed.
  16027. // The request at the tail of the pipeline is the one
  16028. // that requested reset and no further requests should
  16029. // have been queued since then.
  16030. util.destroy(socket, new InformationalError('reset'))
  16031. return constants.ERROR.PAUSED
  16032. } else if (client[kPipelining] === 1) {
  16033. // We must wait a full event loop cycle to reuse this socket to make sure
  16034. // that non-spec compliant servers are not closing the connection even if they
  16035. // said they won't.
  16036. setImmediate(resume, client)
  16037. } else {
  16038. resume(client)
  16039. }
  16040. }
  16041. }
  16042. function onParserTimeout (parser) {
  16043. const { socket, timeoutType, client } = parser
  16044. /* istanbul ignore else */
  16045. if (timeoutType === TIMEOUT_HEADERS) {
  16046. if (!socket[kWriting] || socket.writableNeedDrain || client[kRunning] > 1) {
  16047. assert(!parser.paused, 'cannot be paused while waiting for headers')
  16048. util.destroy(socket, new HeadersTimeoutError())
  16049. }
  16050. } else if (timeoutType === TIMEOUT_BODY) {
  16051. if (!parser.paused) {
  16052. util.destroy(socket, new BodyTimeoutError())
  16053. }
  16054. } else if (timeoutType === TIMEOUT_IDLE) {
  16055. assert(client[kRunning] === 0 && client[kKeepAliveTimeoutValue])
  16056. util.destroy(socket, new InformationalError('socket idle timeout'))
  16057. }
  16058. }
  16059. function onSocketReadable () {
  16060. const { [kParser]: parser } = this
  16061. if (parser) {
  16062. parser.readMore()
  16063. }
  16064. }
  16065. function onSocketError (err) {
  16066. const { [kClient]: client, [kParser]: parser } = this
  16067. assert(err.code !== 'ERR_TLS_CERT_ALTNAME_INVALID')
  16068. if (client[kHTTPConnVersion] !== 'h2') {
  16069. // On Mac OS, we get an ECONNRESET even if there is a full body to be forwarded
  16070. // to the user.
  16071. if (err.code === 'ECONNRESET' && parser.statusCode && !parser.shouldKeepAlive) {
  16072. // We treat all incoming data so for as a valid response.
  16073. parser.onMessageComplete()
  16074. return
  16075. }
  16076. }
  16077. this[kError] = err
  16078. onError(this[kClient], err)
  16079. }
  16080. function onError (client, err) {
  16081. if (
  16082. client[kRunning] === 0 &&
  16083. err.code !== 'UND_ERR_INFO' &&
  16084. err.code !== 'UND_ERR_SOCKET'
  16085. ) {
  16086. // Error is not caused by running request and not a recoverable
  16087. // socket error.
  16088. assert(client[kPendingIdx] === client[kRunningIdx])
  16089. const requests = client[kQueue].splice(client[kRunningIdx])
  16090. for (let i = 0; i < requests.length; i++) {
  16091. const request = requests[i]
  16092. errorRequest(client, request, err)
  16093. }
  16094. assert(client[kSize] === 0)
  16095. }
  16096. }
  16097. function onSocketEnd () {
  16098. const { [kParser]: parser, [kClient]: client } = this
  16099. if (client[kHTTPConnVersion] !== 'h2') {
  16100. if (parser.statusCode && !parser.shouldKeepAlive) {
  16101. // We treat all incoming data so far as a valid response.
  16102. parser.onMessageComplete()
  16103. return
  16104. }
  16105. }
  16106. util.destroy(this, new SocketError('other side closed', util.getSocketInfo(this)))
  16107. }
  16108. function onSocketClose () {
  16109. const { [kClient]: client, [kParser]: parser } = this
  16110. if (client[kHTTPConnVersion] === 'h1' && parser) {
  16111. if (!this[kError] && parser.statusCode && !parser.shouldKeepAlive) {
  16112. // We treat all incoming data so far as a valid response.
  16113. parser.onMessageComplete()
  16114. }
  16115. this[kParser].destroy()
  16116. this[kParser] = null
  16117. }
  16118. const err = this[kError] || new SocketError('closed', util.getSocketInfo(this))
  16119. client[kSocket] = null
  16120. if (client.destroyed) {
  16121. assert(client[kPending] === 0)
  16122. // Fail entire queue.
  16123. const requests = client[kQueue].splice(client[kRunningIdx])
  16124. for (let i = 0; i < requests.length; i++) {
  16125. const request = requests[i]
  16126. errorRequest(client, request, err)
  16127. }
  16128. } else if (client[kRunning] > 0 && err.code !== 'UND_ERR_INFO') {
  16129. // Fail head of pipeline.
  16130. const request = client[kQueue][client[kRunningIdx]]
  16131. client[kQueue][client[kRunningIdx]++] = null
  16132. errorRequest(client, request, err)
  16133. }
  16134. client[kPendingIdx] = client[kRunningIdx]
  16135. assert(client[kRunning] === 0)
  16136. client.emit('disconnect', client[kUrl], [client], err)
  16137. resume(client)
  16138. }
  16139. async function connect (client) {
  16140. assert(!client[kConnecting])
  16141. assert(!client[kSocket])
  16142. let { host, hostname, protocol, port } = client[kUrl]
  16143. // Resolve ipv6
  16144. if (hostname[0] === '[') {
  16145. const idx = hostname.indexOf(']')
  16146. assert(idx !== -1)
  16147. const ip = hostname.substring(1, idx)
  16148. assert(net.isIP(ip))
  16149. hostname = ip
  16150. }
  16151. client[kConnecting] = true
  16152. if (channels.beforeConnect.hasSubscribers) {
  16153. channels.beforeConnect.publish({
  16154. connectParams: {
  16155. host,
  16156. hostname,
  16157. protocol,
  16158. port,
  16159. servername: client[kServerName],
  16160. localAddress: client[kLocalAddress]
  16161. },
  16162. connector: client[kConnector]
  16163. })
  16164. }
  16165. try {
  16166. const socket = await new Promise((resolve, reject) => {
  16167. client[kConnector]({
  16168. host,
  16169. hostname,
  16170. protocol,
  16171. port,
  16172. servername: client[kServerName],
  16173. localAddress: client[kLocalAddress]
  16174. }, (err, socket) => {
  16175. if (err) {
  16176. reject(err)
  16177. } else {
  16178. resolve(socket)
  16179. }
  16180. })
  16181. })
  16182. if (client.destroyed) {
  16183. util.destroy(socket.on('error', () => {}), new ClientDestroyedError())
  16184. return
  16185. }
  16186. client[kConnecting] = false
  16187. assert(socket)
  16188. const isH2 = socket.alpnProtocol === 'h2'
  16189. if (isH2) {
  16190. if (!h2ExperimentalWarned) {
  16191. h2ExperimentalWarned = true
  16192. process.emitWarning('H2 support is experimental, expect them to change at any time.', {
  16193. code: 'UNDICI-H2'
  16194. })
  16195. }
  16196. const session = http2.connect(client[kUrl], {
  16197. createConnection: () => socket,
  16198. peerMaxConcurrentStreams: client[kHTTP2SessionState].maxConcurrentStreams
  16199. })
  16200. client[kHTTPConnVersion] = 'h2'
  16201. session[kClient] = client
  16202. session[kSocket] = socket
  16203. session.on('error', onHttp2SessionError)
  16204. session.on('frameError', onHttp2FrameError)
  16205. session.on('end', onHttp2SessionEnd)
  16206. session.on('goaway', onHTTP2GoAway)
  16207. session.on('close', onSocketClose)
  16208. session.unref()
  16209. client[kHTTP2Session] = session
  16210. socket[kHTTP2Session] = session
  16211. } else {
  16212. if (!llhttpInstance) {
  16213. llhttpInstance = await llhttpPromise
  16214. llhttpPromise = null
  16215. }
  16216. socket[kNoRef] = false
  16217. socket[kWriting] = false
  16218. socket[kReset] = false
  16219. socket[kBlocking] = false
  16220. socket[kParser] = new Parser(client, socket, llhttpInstance)
  16221. }
  16222. socket[kCounter] = 0
  16223. socket[kMaxRequests] = client[kMaxRequests]
  16224. socket[kClient] = client
  16225. socket[kError] = null
  16226. socket
  16227. .on('error', onSocketError)
  16228. .on('readable', onSocketReadable)
  16229. .on('end', onSocketEnd)
  16230. .on('close', onSocketClose)
  16231. client[kSocket] = socket
  16232. if (channels.connected.hasSubscribers) {
  16233. channels.connected.publish({
  16234. connectParams: {
  16235. host,
  16236. hostname,
  16237. protocol,
  16238. port,
  16239. servername: client[kServerName],
  16240. localAddress: client[kLocalAddress]
  16241. },
  16242. connector: client[kConnector],
  16243. socket
  16244. })
  16245. }
  16246. client.emit('connect', client[kUrl], [client])
  16247. } catch (err) {
  16248. if (client.destroyed) {
  16249. return
  16250. }
  16251. client[kConnecting] = false
  16252. if (channels.connectError.hasSubscribers) {
  16253. channels.connectError.publish({
  16254. connectParams: {
  16255. host,
  16256. hostname,
  16257. protocol,
  16258. port,
  16259. servername: client[kServerName],
  16260. localAddress: client[kLocalAddress]
  16261. },
  16262. connector: client[kConnector],
  16263. error: err
  16264. })
  16265. }
  16266. if (err.code === 'ERR_TLS_CERT_ALTNAME_INVALID') {
  16267. assert(client[kRunning] === 0)
  16268. while (client[kPending] > 0 && client[kQueue][client[kPendingIdx]].servername === client[kServerName]) {
  16269. const request = client[kQueue][client[kPendingIdx]++]
  16270. errorRequest(client, request, err)
  16271. }
  16272. } else {
  16273. onError(client, err)
  16274. }
  16275. client.emit('connectionError', client[kUrl], [client], err)
  16276. }
  16277. resume(client)
  16278. }
  16279. function emitDrain (client) {
  16280. client[kNeedDrain] = 0
  16281. client.emit('drain', client[kUrl], [client])
  16282. }
  16283. function resume (client, sync) {
  16284. if (client[kResuming] === 2) {
  16285. return
  16286. }
  16287. client[kResuming] = 2
  16288. _resume(client, sync)
  16289. client[kResuming] = 0
  16290. if (client[kRunningIdx] > 256) {
  16291. client[kQueue].splice(0, client[kRunningIdx])
  16292. client[kPendingIdx] -= client[kRunningIdx]
  16293. client[kRunningIdx] = 0
  16294. }
  16295. }
  16296. function _resume (client, sync) {
  16297. while (true) {
  16298. if (client.destroyed) {
  16299. assert(client[kPending] === 0)
  16300. return
  16301. }
  16302. if (client[kClosedResolve] && !client[kSize]) {
  16303. client[kClosedResolve]()
  16304. client[kClosedResolve] = null
  16305. return
  16306. }
  16307. const socket = client[kSocket]
  16308. if (socket && !socket.destroyed && socket.alpnProtocol !== 'h2') {
  16309. if (client[kSize] === 0) {
  16310. if (!socket[kNoRef] && socket.unref) {
  16311. socket.unref()
  16312. socket[kNoRef] = true
  16313. }
  16314. } else if (socket[kNoRef] && socket.ref) {
  16315. socket.ref()
  16316. socket[kNoRef] = false
  16317. }
  16318. if (client[kSize] === 0) {
  16319. if (socket[kParser].timeoutType !== TIMEOUT_IDLE) {
  16320. socket[kParser].setTimeout(client[kKeepAliveTimeoutValue], TIMEOUT_IDLE)
  16321. }
  16322. } else if (client[kRunning] > 0 && socket[kParser].statusCode < 200) {
  16323. if (socket[kParser].timeoutType !== TIMEOUT_HEADERS) {
  16324. const request = client[kQueue][client[kRunningIdx]]
  16325. const headersTimeout = request.headersTimeout != null
  16326. ? request.headersTimeout
  16327. : client[kHeadersTimeout]
  16328. socket[kParser].setTimeout(headersTimeout, TIMEOUT_HEADERS)
  16329. }
  16330. }
  16331. }
  16332. if (client[kBusy]) {
  16333. client[kNeedDrain] = 2
  16334. } else if (client[kNeedDrain] === 2) {
  16335. if (sync) {
  16336. client[kNeedDrain] = 1
  16337. process.nextTick(emitDrain, client)
  16338. } else {
  16339. emitDrain(client)
  16340. }
  16341. continue
  16342. }
  16343. if (client[kPending] === 0) {
  16344. return
  16345. }
  16346. if (client[kRunning] >= (client[kPipelining] || 1)) {
  16347. return
  16348. }
  16349. const request = client[kQueue][client[kPendingIdx]]
  16350. if (client[kUrl].protocol === 'https:' && client[kServerName] !== request.servername) {
  16351. if (client[kRunning] > 0) {
  16352. return
  16353. }
  16354. client[kServerName] = request.servername
  16355. if (socket && socket.servername !== request.servername) {
  16356. util.destroy(socket, new InformationalError('servername changed'))
  16357. return
  16358. }
  16359. }
  16360. if (client[kConnecting]) {
  16361. return
  16362. }
  16363. if (!socket && !client[kHTTP2Session]) {
  16364. connect(client)
  16365. return
  16366. }
  16367. if (socket.destroyed || socket[kWriting] || socket[kReset] || socket[kBlocking]) {
  16368. return
  16369. }
  16370. if (client[kRunning] > 0 && !request.idempotent) {
  16371. // Non-idempotent request cannot be retried.
  16372. // Ensure that no other requests are inflight and
  16373. // could cause failure.
  16374. return
  16375. }
  16376. if (client[kRunning] > 0 && (request.upgrade || request.method === 'CONNECT')) {
  16377. // Don't dispatch an upgrade until all preceding requests have completed.
  16378. // A misbehaving server might upgrade the connection before all pipelined
  16379. // request has completed.
  16380. return
  16381. }
  16382. if (client[kRunning] > 0 && util.bodyLength(request.body) !== 0 &&
  16383. (util.isStream(request.body) || util.isAsyncIterable(request.body))) {
  16384. // Request with stream or iterator body can error while other requests
  16385. // are inflight and indirectly error those as well.
  16386. // Ensure this doesn't happen by waiting for inflight
  16387. // to complete before dispatching.
  16388. // Request with stream or iterator body cannot be retried.
  16389. // Ensure that no other requests are inflight and
  16390. // could cause failure.
  16391. return
  16392. }
  16393. if (!request.aborted && write(client, request)) {
  16394. client[kPendingIdx]++
  16395. } else {
  16396. client[kQueue].splice(client[kPendingIdx], 1)
  16397. }
  16398. }
  16399. }
  16400. // https://www.rfc-editor.org/rfc/rfc7230#section-3.3.2
  16401. function shouldSendContentLength (method) {
  16402. return method !== 'GET' && method !== 'HEAD' && method !== 'OPTIONS' && method !== 'TRACE' && method !== 'CONNECT'
  16403. }
  16404. function write (client, request) {
  16405. if (client[kHTTPConnVersion] === 'h2') {
  16406. writeH2(client, client[kHTTP2Session], request)
  16407. return
  16408. }
  16409. const { body, method, path, host, upgrade, headers, blocking, reset } = request
  16410. // https://tools.ietf.org/html/rfc7231#section-4.3.1
  16411. // https://tools.ietf.org/html/rfc7231#section-4.3.2
  16412. // https://tools.ietf.org/html/rfc7231#section-4.3.5
  16413. // Sending a payload body on a request that does not
  16414. // expect it can cause undefined behavior on some
  16415. // servers and corrupt connection state. Do not
  16416. // re-use the connection for further requests.
  16417. const expectsPayload = (
  16418. method === 'PUT' ||
  16419. method === 'POST' ||
  16420. method === 'PATCH'
  16421. )
  16422. if (body && typeof body.read === 'function') {
  16423. // Try to read EOF in order to get length.
  16424. body.read(0)
  16425. }
  16426. const bodyLength = util.bodyLength(body)
  16427. let contentLength = bodyLength
  16428. if (contentLength === null) {
  16429. contentLength = request.contentLength
  16430. }
  16431. if (contentLength === 0 && !expectsPayload) {
  16432. // https://tools.ietf.org/html/rfc7230#section-3.3.2
  16433. // A user agent SHOULD NOT send a Content-Length header field when
  16434. // the request message does not contain a payload body and the method
  16435. // semantics do not anticipate such a body.
  16436. contentLength = null
  16437. }
  16438. // https://github.com/nodejs/undici/issues/2046
  16439. // A user agent may send a Content-Length header with 0 value, this should be allowed.
  16440. if (shouldSendContentLength(method) && contentLength > 0 && request.contentLength !== null && request.contentLength !== contentLength) {
  16441. if (client[kStrictContentLength]) {
  16442. errorRequest(client, request, new RequestContentLengthMismatchError())
  16443. return false
  16444. }
  16445. process.emitWarning(new RequestContentLengthMismatchError())
  16446. }
  16447. const socket = client[kSocket]
  16448. try {
  16449. request.onConnect((err) => {
  16450. if (request.aborted || request.completed) {
  16451. return
  16452. }
  16453. errorRequest(client, request, err || new RequestAbortedError())
  16454. util.destroy(socket, new InformationalError('aborted'))
  16455. })
  16456. } catch (err) {
  16457. errorRequest(client, request, err)
  16458. }
  16459. if (request.aborted) {
  16460. return false
  16461. }
  16462. if (method === 'HEAD') {
  16463. // https://github.com/mcollina/undici/issues/258
  16464. // Close after a HEAD request to interop with misbehaving servers
  16465. // that may send a body in the response.
  16466. socket[kReset] = true
  16467. }
  16468. if (upgrade || method === 'CONNECT') {
  16469. // On CONNECT or upgrade, block pipeline from dispatching further
  16470. // requests on this connection.
  16471. socket[kReset] = true
  16472. }
  16473. if (reset != null) {
  16474. socket[kReset] = reset
  16475. }
  16476. if (client[kMaxRequests] && socket[kCounter]++ >= client[kMaxRequests]) {
  16477. socket[kReset] = true
  16478. }
  16479. if (blocking) {
  16480. socket[kBlocking] = true
  16481. }
  16482. let header = `${method} ${path} HTTP/1.1\r\n`
  16483. if (typeof host === 'string') {
  16484. header += `host: ${host}\r\n`
  16485. } else {
  16486. header += client[kHostHeader]
  16487. }
  16488. if (upgrade) {
  16489. header += `connection: upgrade\r\nupgrade: ${upgrade}\r\n`
  16490. } else if (client[kPipelining] && !socket[kReset]) {
  16491. header += 'connection: keep-alive\r\n'
  16492. } else {
  16493. header += 'connection: close\r\n'
  16494. }
  16495. if (headers) {
  16496. header += headers
  16497. }
  16498. if (channels.sendHeaders.hasSubscribers) {
  16499. channels.sendHeaders.publish({ request, headers: header, socket })
  16500. }
  16501. /* istanbul ignore else: assertion */
  16502. if (!body || bodyLength === 0) {
  16503. if (contentLength === 0) {
  16504. socket.write(`${header}content-length: 0\r\n\r\n`, 'latin1')
  16505. } else {
  16506. assert(contentLength === null, 'no body must not have content length')
  16507. socket.write(`${header}\r\n`, 'latin1')
  16508. }
  16509. request.onRequestSent()
  16510. } else if (util.isBuffer(body)) {
  16511. assert(contentLength === body.byteLength, 'buffer body must have content length')
  16512. socket.cork()
  16513. socket.write(`${header}content-length: ${contentLength}\r\n\r\n`, 'latin1')
  16514. socket.write(body)
  16515. socket.uncork()
  16516. request.onBodySent(body)
  16517. request.onRequestSent()
  16518. if (!expectsPayload) {
  16519. socket[kReset] = true
  16520. }
  16521. } else if (util.isBlobLike(body)) {
  16522. if (typeof body.stream === 'function') {
  16523. writeIterable({ body: body.stream(), client, request, socket, contentLength, header, expectsPayload })
  16524. } else {
  16525. writeBlob({ body, client, request, socket, contentLength, header, expectsPayload })
  16526. }
  16527. } else if (util.isStream(body)) {
  16528. writeStream({ body, client, request, socket, contentLength, header, expectsPayload })
  16529. } else if (util.isIterable(body)) {
  16530. writeIterable({ body, client, request, socket, contentLength, header, expectsPayload })
  16531. } else {
  16532. assert(false)
  16533. }
  16534. return true
  16535. }
  16536. function writeH2 (client, session, request) {
  16537. const { body, method, path, host, upgrade, expectContinue, signal, headers: reqHeaders } = request
  16538. let headers
  16539. if (typeof reqHeaders === 'string') headers = Request[kHTTP2CopyHeaders](reqHeaders.trim())
  16540. else headers = reqHeaders
  16541. if (upgrade) {
  16542. errorRequest(client, request, new Error('Upgrade not supported for H2'))
  16543. return false
  16544. }
  16545. try {
  16546. // TODO(HTTP/2): Should we call onConnect immediately or on stream ready event?
  16547. request.onConnect((err) => {
  16548. if (request.aborted || request.completed) {
  16549. return
  16550. }
  16551. errorRequest(client, request, err || new RequestAbortedError())
  16552. })
  16553. } catch (err) {
  16554. errorRequest(client, request, err)
  16555. }
  16556. if (request.aborted) {
  16557. return false
  16558. }
  16559. /** @type {import('node:http2').ClientHttp2Stream} */
  16560. let stream
  16561. const h2State = client[kHTTP2SessionState]
  16562. headers[HTTP2_HEADER_AUTHORITY] = host || client[kHost]
  16563. headers[HTTP2_HEADER_METHOD] = method
  16564. if (method === 'CONNECT') {
  16565. session.ref()
  16566. // we are already connected, streams are pending, first request
  16567. // will create a new stream. We trigger a request to create the stream and wait until
  16568. // `ready` event is triggered
  16569. // We disabled endStream to allow the user to write to the stream
  16570. stream = session.request(headers, { endStream: false, signal })
  16571. if (stream.id && !stream.pending) {
  16572. request.onUpgrade(null, null, stream)
  16573. ++h2State.openStreams
  16574. } else {
  16575. stream.once('ready', () => {
  16576. request.onUpgrade(null, null, stream)
  16577. ++h2State.openStreams
  16578. })
  16579. }
  16580. stream.once('close', () => {
  16581. h2State.openStreams -= 1
  16582. // TODO(HTTP/2): unref only if current streams count is 0
  16583. if (h2State.openStreams === 0) session.unref()
  16584. })
  16585. return true
  16586. }
  16587. // https://tools.ietf.org/html/rfc7540#section-8.3
  16588. // :path and :scheme headers must be omited when sending CONNECT
  16589. headers[HTTP2_HEADER_PATH] = path
  16590. headers[HTTP2_HEADER_SCHEME] = 'https'
  16591. // https://tools.ietf.org/html/rfc7231#section-4.3.1
  16592. // https://tools.ietf.org/html/rfc7231#section-4.3.2
  16593. // https://tools.ietf.org/html/rfc7231#section-4.3.5
  16594. // Sending a payload body on a request that does not
  16595. // expect it can cause undefined behavior on some
  16596. // servers and corrupt connection state. Do not
  16597. // re-use the connection for further requests.
  16598. const expectsPayload = (
  16599. method === 'PUT' ||
  16600. method === 'POST' ||
  16601. method === 'PATCH'
  16602. )
  16603. if (body && typeof body.read === 'function') {
  16604. // Try to read EOF in order to get length.
  16605. body.read(0)
  16606. }
  16607. let contentLength = util.bodyLength(body)
  16608. if (contentLength == null) {
  16609. contentLength = request.contentLength
  16610. }
  16611. if (contentLength === 0 || !expectsPayload) {
  16612. // https://tools.ietf.org/html/rfc7230#section-3.3.2
  16613. // A user agent SHOULD NOT send a Content-Length header field when
  16614. // the request message does not contain a payload body and the method
  16615. // semantics do not anticipate such a body.
  16616. contentLength = null
  16617. }
  16618. // https://github.com/nodejs/undici/issues/2046
  16619. // A user agent may send a Content-Length header with 0 value, this should be allowed.
  16620. if (shouldSendContentLength(method) && contentLength > 0 && request.contentLength != null && request.contentLength !== contentLength) {
  16621. if (client[kStrictContentLength]) {
  16622. errorRequest(client, request, new RequestContentLengthMismatchError())
  16623. return false
  16624. }
  16625. process.emitWarning(new RequestContentLengthMismatchError())
  16626. }
  16627. if (contentLength != null) {
  16628. assert(body, 'no body must not have content length')
  16629. headers[HTTP2_HEADER_CONTENT_LENGTH] = `${contentLength}`
  16630. }
  16631. session.ref()
  16632. const shouldEndStream = method === 'GET' || method === 'HEAD'
  16633. if (expectContinue) {
  16634. headers[HTTP2_HEADER_EXPECT] = '100-continue'
  16635. stream = session.request(headers, { endStream: shouldEndStream, signal })
  16636. stream.once('continue', writeBodyH2)
  16637. } else {
  16638. stream = session.request(headers, {
  16639. endStream: shouldEndStream,
  16640. signal
  16641. })
  16642. writeBodyH2()
  16643. }
  16644. // Increment counter as we have new several streams open
  16645. ++h2State.openStreams
  16646. stream.once('response', headers => {
  16647. const { [HTTP2_HEADER_STATUS]: statusCode, ...realHeaders } = headers
  16648. if (request.onHeaders(Number(statusCode), realHeaders, stream.resume.bind(stream), '') === false) {
  16649. stream.pause()
  16650. }
  16651. })
  16652. stream.once('end', () => {
  16653. request.onComplete([])
  16654. })
  16655. stream.on('data', (chunk) => {
  16656. if (request.onData(chunk) === false) {
  16657. stream.pause()
  16658. }
  16659. })
  16660. stream.once('close', () => {
  16661. h2State.openStreams -= 1
  16662. // TODO(HTTP/2): unref only if current streams count is 0
  16663. if (h2State.openStreams === 0) {
  16664. session.unref()
  16665. }
  16666. })
  16667. stream.once('error', function (err) {
  16668. if (client[kHTTP2Session] && !client[kHTTP2Session].destroyed && !this.closed && !this.destroyed) {
  16669. h2State.streams -= 1
  16670. util.destroy(stream, err)
  16671. }
  16672. })
  16673. stream.once('frameError', (type, code) => {
  16674. const err = new InformationalError(`HTTP/2: "frameError" received - type ${type}, code ${code}`)
  16675. errorRequest(client, request, err)
  16676. if (client[kHTTP2Session] && !client[kHTTP2Session].destroyed && !this.closed && !this.destroyed) {
  16677. h2State.streams -= 1
  16678. util.destroy(stream, err)
  16679. }
  16680. })
  16681. // stream.on('aborted', () => {
  16682. // // TODO(HTTP/2): Support aborted
  16683. // })
  16684. // stream.on('timeout', () => {
  16685. // // TODO(HTTP/2): Support timeout
  16686. // })
  16687. // stream.on('push', headers => {
  16688. // // TODO(HTTP/2): Suppor push
  16689. // })
  16690. // stream.on('trailers', headers => {
  16691. // // TODO(HTTP/2): Support trailers
  16692. // })
  16693. return true
  16694. function writeBodyH2 () {
  16695. /* istanbul ignore else: assertion */
  16696. if (!body) {
  16697. request.onRequestSent()
  16698. } else if (util.isBuffer(body)) {
  16699. assert(contentLength === body.byteLength, 'buffer body must have content length')
  16700. stream.cork()
  16701. stream.write(body)
  16702. stream.uncork()
  16703. stream.end()
  16704. request.onBodySent(body)
  16705. request.onRequestSent()
  16706. } else if (util.isBlobLike(body)) {
  16707. if (typeof body.stream === 'function') {
  16708. writeIterable({
  16709. client,
  16710. request,
  16711. contentLength,
  16712. h2stream: stream,
  16713. expectsPayload,
  16714. body: body.stream(),
  16715. socket: client[kSocket],
  16716. header: ''
  16717. })
  16718. } else {
  16719. writeBlob({
  16720. body,
  16721. client,
  16722. request,
  16723. contentLength,
  16724. expectsPayload,
  16725. h2stream: stream,
  16726. header: '',
  16727. socket: client[kSocket]
  16728. })
  16729. }
  16730. } else if (util.isStream(body)) {
  16731. writeStream({
  16732. body,
  16733. client,
  16734. request,
  16735. contentLength,
  16736. expectsPayload,
  16737. socket: client[kSocket],
  16738. h2stream: stream,
  16739. header: ''
  16740. })
  16741. } else if (util.isIterable(body)) {
  16742. writeIterable({
  16743. body,
  16744. client,
  16745. request,
  16746. contentLength,
  16747. expectsPayload,
  16748. header: '',
  16749. h2stream: stream,
  16750. socket: client[kSocket]
  16751. })
  16752. } else {
  16753. assert(false)
  16754. }
  16755. }
  16756. }
  16757. function writeStream ({ h2stream, body, client, request, socket, contentLength, header, expectsPayload }) {
  16758. assert(contentLength !== 0 || client[kRunning] === 0, 'stream body cannot be pipelined')
  16759. if (client[kHTTPConnVersion] === 'h2') {
  16760. // For HTTP/2, is enough to pipe the stream
  16761. const pipe = pipeline(
  16762. body,
  16763. h2stream,
  16764. (err) => {
  16765. if (err) {
  16766. util.destroy(body, err)
  16767. util.destroy(h2stream, err)
  16768. } else {
  16769. request.onRequestSent()
  16770. }
  16771. }
  16772. )
  16773. pipe.on('data', onPipeData)
  16774. pipe.once('end', () => {
  16775. pipe.removeListener('data', onPipeData)
  16776. util.destroy(pipe)
  16777. })
  16778. function onPipeData (chunk) {
  16779. request.onBodySent(chunk)
  16780. }
  16781. return
  16782. }
  16783. let finished = false
  16784. const writer = new AsyncWriter({ socket, request, contentLength, client, expectsPayload, header })
  16785. const onData = function (chunk) {
  16786. if (finished) {
  16787. return
  16788. }
  16789. try {
  16790. if (!writer.write(chunk) && this.pause) {
  16791. this.pause()
  16792. }
  16793. } catch (err) {
  16794. util.destroy(this, err)
  16795. }
  16796. }
  16797. const onDrain = function () {
  16798. if (finished) {
  16799. return
  16800. }
  16801. if (body.resume) {
  16802. body.resume()
  16803. }
  16804. }
  16805. const onAbort = function () {
  16806. if (finished) {
  16807. return
  16808. }
  16809. const err = new RequestAbortedError()
  16810. queueMicrotask(() => onFinished(err))
  16811. }
  16812. const onFinished = function (err) {
  16813. if (finished) {
  16814. return
  16815. }
  16816. finished = true
  16817. assert(socket.destroyed || (socket[kWriting] && client[kRunning] <= 1))
  16818. socket
  16819. .off('drain', onDrain)
  16820. .off('error', onFinished)
  16821. body
  16822. .removeListener('data', onData)
  16823. .removeListener('end', onFinished)
  16824. .removeListener('error', onFinished)
  16825. .removeListener('close', onAbort)
  16826. if (!err) {
  16827. try {
  16828. writer.end()
  16829. } catch (er) {
  16830. err = er
  16831. }
  16832. }
  16833. writer.destroy(err)
  16834. if (err && (err.code !== 'UND_ERR_INFO' || err.message !== 'reset')) {
  16835. util.destroy(body, err)
  16836. } else {
  16837. util.destroy(body)
  16838. }
  16839. }
  16840. body
  16841. .on('data', onData)
  16842. .on('end', onFinished)
  16843. .on('error', onFinished)
  16844. .on('close', onAbort)
  16845. if (body.resume) {
  16846. body.resume()
  16847. }
  16848. socket
  16849. .on('drain', onDrain)
  16850. .on('error', onFinished)
  16851. }
  16852. async function writeBlob ({ h2stream, body, client, request, socket, contentLength, header, expectsPayload }) {
  16853. assert(contentLength === body.size, 'blob body must have content length')
  16854. const isH2 = client[kHTTPConnVersion] === 'h2'
  16855. try {
  16856. if (contentLength != null && contentLength !== body.size) {
  16857. throw new RequestContentLengthMismatchError()
  16858. }
  16859. const buffer = Buffer.from(await body.arrayBuffer())
  16860. if (isH2) {
  16861. h2stream.cork()
  16862. h2stream.write(buffer)
  16863. h2stream.uncork()
  16864. } else {
  16865. socket.cork()
  16866. socket.write(`${header}content-length: ${contentLength}\r\n\r\n`, 'latin1')
  16867. socket.write(buffer)
  16868. socket.uncork()
  16869. }
  16870. request.onBodySent(buffer)
  16871. request.onRequestSent()
  16872. if (!expectsPayload) {
  16873. socket[kReset] = true
  16874. }
  16875. resume(client)
  16876. } catch (err) {
  16877. util.destroy(isH2 ? h2stream : socket, err)
  16878. }
  16879. }
  16880. async function writeIterable ({ h2stream, body, client, request, socket, contentLength, header, expectsPayload }) {
  16881. assert(contentLength !== 0 || client[kRunning] === 0, 'iterator body cannot be pipelined')
  16882. let callback = null
  16883. function onDrain () {
  16884. if (callback) {
  16885. const cb = callback
  16886. callback = null
  16887. cb()
  16888. }
  16889. }
  16890. const waitForDrain = () => new Promise((resolve, reject) => {
  16891. assert(callback === null)
  16892. if (socket[kError]) {
  16893. reject(socket[kError])
  16894. } else {
  16895. callback = resolve
  16896. }
  16897. })
  16898. if (client[kHTTPConnVersion] === 'h2') {
  16899. h2stream
  16900. .on('close', onDrain)
  16901. .on('drain', onDrain)
  16902. try {
  16903. // It's up to the user to somehow abort the async iterable.
  16904. for await (const chunk of body) {
  16905. if (socket[kError]) {
  16906. throw socket[kError]
  16907. }
  16908. const res = h2stream.write(chunk)
  16909. request.onBodySent(chunk)
  16910. if (!res) {
  16911. await waitForDrain()
  16912. }
  16913. }
  16914. } catch (err) {
  16915. h2stream.destroy(err)
  16916. } finally {
  16917. request.onRequestSent()
  16918. h2stream.end()
  16919. h2stream
  16920. .off('close', onDrain)
  16921. .off('drain', onDrain)
  16922. }
  16923. return
  16924. }
  16925. socket
  16926. .on('close', onDrain)
  16927. .on('drain', onDrain)
  16928. const writer = new AsyncWriter({ socket, request, contentLength, client, expectsPayload, header })
  16929. try {
  16930. // It's up to the user to somehow abort the async iterable.
  16931. for await (const chunk of body) {
  16932. if (socket[kError]) {
  16933. throw socket[kError]
  16934. }
  16935. if (!writer.write(chunk)) {
  16936. await waitForDrain()
  16937. }
  16938. }
  16939. writer.end()
  16940. } catch (err) {
  16941. writer.destroy(err)
  16942. } finally {
  16943. socket
  16944. .off('close', onDrain)
  16945. .off('drain', onDrain)
  16946. }
  16947. }
  16948. class AsyncWriter {
  16949. constructor ({ socket, request, contentLength, client, expectsPayload, header }) {
  16950. this.socket = socket
  16951. this.request = request
  16952. this.contentLength = contentLength
  16953. this.client = client
  16954. this.bytesWritten = 0
  16955. this.expectsPayload = expectsPayload
  16956. this.header = header
  16957. socket[kWriting] = true
  16958. }
  16959. write (chunk) {
  16960. const { socket, request, contentLength, client, bytesWritten, expectsPayload, header } = this
  16961. if (socket[kError]) {
  16962. throw socket[kError]
  16963. }
  16964. if (socket.destroyed) {
  16965. return false
  16966. }
  16967. const len = Buffer.byteLength(chunk)
  16968. if (!len) {
  16969. return true
  16970. }
  16971. // We should defer writing chunks.
  16972. if (contentLength !== null && bytesWritten + len > contentLength) {
  16973. if (client[kStrictContentLength]) {
  16974. throw new RequestContentLengthMismatchError()
  16975. }
  16976. process.emitWarning(new RequestContentLengthMismatchError())
  16977. }
  16978. socket.cork()
  16979. if (bytesWritten === 0) {
  16980. if (!expectsPayload) {
  16981. socket[kReset] = true
  16982. }
  16983. if (contentLength === null) {
  16984. socket.write(`${header}transfer-encoding: chunked\r\n`, 'latin1')
  16985. } else {
  16986. socket.write(`${header}content-length: ${contentLength}\r\n\r\n`, 'latin1')
  16987. }
  16988. }
  16989. if (contentLength === null) {
  16990. socket.write(`\r\n${len.toString(16)}\r\n`, 'latin1')
  16991. }
  16992. this.bytesWritten += len
  16993. const ret = socket.write(chunk)
  16994. socket.uncork()
  16995. request.onBodySent(chunk)
  16996. if (!ret) {
  16997. if (socket[kParser].timeout && socket[kParser].timeoutType === TIMEOUT_HEADERS) {
  16998. // istanbul ignore else: only for jest
  16999. if (socket[kParser].timeout.refresh) {
  17000. socket[kParser].timeout.refresh()
  17001. }
  17002. }
  17003. }
  17004. return ret
  17005. }
  17006. end () {
  17007. const { socket, contentLength, client, bytesWritten, expectsPayload, header, request } = this
  17008. request.onRequestSent()
  17009. socket[kWriting] = false
  17010. if (socket[kError]) {
  17011. throw socket[kError]
  17012. }
  17013. if (socket.destroyed) {
  17014. return
  17015. }
  17016. if (bytesWritten === 0) {
  17017. if (expectsPayload) {
  17018. // https://tools.ietf.org/html/rfc7230#section-3.3.2
  17019. // A user agent SHOULD send a Content-Length in a request message when
  17020. // no Transfer-Encoding is sent and the request method defines a meaning
  17021. // for an enclosed payload body.
  17022. socket.write(`${header}content-length: 0\r\n\r\n`, 'latin1')
  17023. } else {
  17024. socket.write(`${header}\r\n`, 'latin1')
  17025. }
  17026. } else if (contentLength === null) {
  17027. socket.write('\r\n0\r\n\r\n', 'latin1')
  17028. }
  17029. if (contentLength !== null && bytesWritten !== contentLength) {
  17030. if (client[kStrictContentLength]) {
  17031. throw new RequestContentLengthMismatchError()
  17032. } else {
  17033. process.emitWarning(new RequestContentLengthMismatchError())
  17034. }
  17035. }
  17036. if (socket[kParser].timeout && socket[kParser].timeoutType === TIMEOUT_HEADERS) {
  17037. // istanbul ignore else: only for jest
  17038. if (socket[kParser].timeout.refresh) {
  17039. socket[kParser].timeout.refresh()
  17040. }
  17041. }
  17042. resume(client)
  17043. }
  17044. destroy (err) {
  17045. const { socket, client } = this
  17046. socket[kWriting] = false
  17047. if (err) {
  17048. assert(client[kRunning] <= 1, 'pipeline should only contain this request')
  17049. util.destroy(socket, err)
  17050. }
  17051. }
  17052. }
  17053. function errorRequest (client, request, err) {
  17054. try {
  17055. request.onError(err)
  17056. assert(request.aborted)
  17057. } catch (err) {
  17058. client.emit('error', err)
  17059. }
  17060. }
  17061. module.exports = Client
  17062. /***/ }),
  17063. /***/ 6436:
  17064. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  17065. "use strict";
  17066. /* istanbul ignore file: only for Node 12 */
  17067. const { kConnected, kSize } = __nccwpck_require__(2785)
  17068. class CompatWeakRef {
  17069. constructor (value) {
  17070. this.value = value
  17071. }
  17072. deref () {
  17073. return this.value[kConnected] === 0 && this.value[kSize] === 0
  17074. ? undefined
  17075. : this.value
  17076. }
  17077. }
  17078. class CompatFinalizer {
  17079. constructor (finalizer) {
  17080. this.finalizer = finalizer
  17081. }
  17082. register (dispatcher, key) {
  17083. if (dispatcher.on) {
  17084. dispatcher.on('disconnect', () => {
  17085. if (dispatcher[kConnected] === 0 && dispatcher[kSize] === 0) {
  17086. this.finalizer(key)
  17087. }
  17088. })
  17089. }
  17090. }
  17091. }
  17092. module.exports = function () {
  17093. // FIXME: remove workaround when the Node bug is fixed
  17094. // https://github.com/nodejs/node/issues/49344#issuecomment-1741776308
  17095. if (process.env.NODE_V8_COVERAGE) {
  17096. return {
  17097. WeakRef: CompatWeakRef,
  17098. FinalizationRegistry: CompatFinalizer
  17099. }
  17100. }
  17101. return {
  17102. WeakRef: global.WeakRef || CompatWeakRef,
  17103. FinalizationRegistry: global.FinalizationRegistry || CompatFinalizer
  17104. }
  17105. }
  17106. /***/ }),
  17107. /***/ 663:
  17108. /***/ ((module) => {
  17109. "use strict";
  17110. // https://wicg.github.io/cookie-store/#cookie-maximum-attribute-value-size
  17111. const maxAttributeValueSize = 1024
  17112. // https://wicg.github.io/cookie-store/#cookie-maximum-name-value-pair-size
  17113. const maxNameValuePairSize = 4096
  17114. module.exports = {
  17115. maxAttributeValueSize,
  17116. maxNameValuePairSize
  17117. }
  17118. /***/ }),
  17119. /***/ 1724:
  17120. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  17121. "use strict";
  17122. const { parseSetCookie } = __nccwpck_require__(4408)
  17123. const { stringify } = __nccwpck_require__(3121)
  17124. const { webidl } = __nccwpck_require__(1744)
  17125. const { Headers } = __nccwpck_require__(554)
  17126. /**
  17127. * @typedef {Object} Cookie
  17128. * @property {string} name
  17129. * @property {string} value
  17130. * @property {Date|number|undefined} expires
  17131. * @property {number|undefined} maxAge
  17132. * @property {string|undefined} domain
  17133. * @property {string|undefined} path
  17134. * @property {boolean|undefined} secure
  17135. * @property {boolean|undefined} httpOnly
  17136. * @property {'Strict'|'Lax'|'None'} sameSite
  17137. * @property {string[]} unparsed
  17138. */
  17139. /**
  17140. * @param {Headers} headers
  17141. * @returns {Record<string, string>}
  17142. */
  17143. function getCookies (headers) {
  17144. webidl.argumentLengthCheck(arguments, 1, { header: 'getCookies' })
  17145. webidl.brandCheck(headers, Headers, { strict: false })
  17146. const cookie = headers.get('cookie')
  17147. const out = {}
  17148. if (!cookie) {
  17149. return out
  17150. }
  17151. for (const piece of cookie.split(';')) {
  17152. const [name, ...value] = piece.split('=')
  17153. out[name.trim()] = value.join('=')
  17154. }
  17155. return out
  17156. }
  17157. /**
  17158. * @param {Headers} headers
  17159. * @param {string} name
  17160. * @param {{ path?: string, domain?: string }|undefined} attributes
  17161. * @returns {void}
  17162. */
  17163. function deleteCookie (headers, name, attributes) {
  17164. webidl.argumentLengthCheck(arguments, 2, { header: 'deleteCookie' })
  17165. webidl.brandCheck(headers, Headers, { strict: false })
  17166. name = webidl.converters.DOMString(name)
  17167. attributes = webidl.converters.DeleteCookieAttributes(attributes)
  17168. // Matches behavior of
  17169. // https://github.com/denoland/deno_std/blob/63827b16330b82489a04614027c33b7904e08be5/http/cookie.ts#L278
  17170. setCookie(headers, {
  17171. name,
  17172. value: '',
  17173. expires: new Date(0),
  17174. ...attributes
  17175. })
  17176. }
  17177. /**
  17178. * @param {Headers} headers
  17179. * @returns {Cookie[]}
  17180. */
  17181. function getSetCookies (headers) {
  17182. webidl.argumentLengthCheck(arguments, 1, { header: 'getSetCookies' })
  17183. webidl.brandCheck(headers, Headers, { strict: false })
  17184. const cookies = headers.getSetCookie()
  17185. if (!cookies) {
  17186. return []
  17187. }
  17188. return cookies.map((pair) => parseSetCookie(pair))
  17189. }
  17190. /**
  17191. * @param {Headers} headers
  17192. * @param {Cookie} cookie
  17193. * @returns {void}
  17194. */
  17195. function setCookie (headers, cookie) {
  17196. webidl.argumentLengthCheck(arguments, 2, { header: 'setCookie' })
  17197. webidl.brandCheck(headers, Headers, { strict: false })
  17198. cookie = webidl.converters.Cookie(cookie)
  17199. const str = stringify(cookie)
  17200. if (str) {
  17201. headers.append('Set-Cookie', stringify(cookie))
  17202. }
  17203. }
  17204. webidl.converters.DeleteCookieAttributes = webidl.dictionaryConverter([
  17205. {
  17206. converter: webidl.nullableConverter(webidl.converters.DOMString),
  17207. key: 'path',
  17208. defaultValue: null
  17209. },
  17210. {
  17211. converter: webidl.nullableConverter(webidl.converters.DOMString),
  17212. key: 'domain',
  17213. defaultValue: null
  17214. }
  17215. ])
  17216. webidl.converters.Cookie = webidl.dictionaryConverter([
  17217. {
  17218. converter: webidl.converters.DOMString,
  17219. key: 'name'
  17220. },
  17221. {
  17222. converter: webidl.converters.DOMString,
  17223. key: 'value'
  17224. },
  17225. {
  17226. converter: webidl.nullableConverter((value) => {
  17227. if (typeof value === 'number') {
  17228. return webidl.converters['unsigned long long'](value)
  17229. }
  17230. return new Date(value)
  17231. }),
  17232. key: 'expires',
  17233. defaultValue: null
  17234. },
  17235. {
  17236. converter: webidl.nullableConverter(webidl.converters['long long']),
  17237. key: 'maxAge',
  17238. defaultValue: null
  17239. },
  17240. {
  17241. converter: webidl.nullableConverter(webidl.converters.DOMString),
  17242. key: 'domain',
  17243. defaultValue: null
  17244. },
  17245. {
  17246. converter: webidl.nullableConverter(webidl.converters.DOMString),
  17247. key: 'path',
  17248. defaultValue: null
  17249. },
  17250. {
  17251. converter: webidl.nullableConverter(webidl.converters.boolean),
  17252. key: 'secure',
  17253. defaultValue: null
  17254. },
  17255. {
  17256. converter: webidl.nullableConverter(webidl.converters.boolean),
  17257. key: 'httpOnly',
  17258. defaultValue: null
  17259. },
  17260. {
  17261. converter: webidl.converters.USVString,
  17262. key: 'sameSite',
  17263. allowedValues: ['Strict', 'Lax', 'None']
  17264. },
  17265. {
  17266. converter: webidl.sequenceConverter(webidl.converters.DOMString),
  17267. key: 'unparsed',
  17268. defaultValue: []
  17269. }
  17270. ])
  17271. module.exports = {
  17272. getCookies,
  17273. deleteCookie,
  17274. getSetCookies,
  17275. setCookie
  17276. }
  17277. /***/ }),
  17278. /***/ 4408:
  17279. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  17280. "use strict";
  17281. const { maxNameValuePairSize, maxAttributeValueSize } = __nccwpck_require__(663)
  17282. const { isCTLExcludingHtab } = __nccwpck_require__(3121)
  17283. const { collectASequenceOfCodePointsFast } = __nccwpck_require__(685)
  17284. const assert = __nccwpck_require__(9491)
  17285. /**
  17286. * @description Parses the field-value attributes of a set-cookie header string.
  17287. * @see https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4
  17288. * @param {string} header
  17289. * @returns if the header is invalid, null will be returned
  17290. */
  17291. function parseSetCookie (header) {
  17292. // 1. If the set-cookie-string contains a %x00-08 / %x0A-1F / %x7F
  17293. // character (CTL characters excluding HTAB): Abort these steps and
  17294. // ignore the set-cookie-string entirely.
  17295. if (isCTLExcludingHtab(header)) {
  17296. return null
  17297. }
  17298. let nameValuePair = ''
  17299. let unparsedAttributes = ''
  17300. let name = ''
  17301. let value = ''
  17302. // 2. If the set-cookie-string contains a %x3B (";") character:
  17303. if (header.includes(';')) {
  17304. // 1. The name-value-pair string consists of the characters up to,
  17305. // but not including, the first %x3B (";"), and the unparsed-
  17306. // attributes consist of the remainder of the set-cookie-string
  17307. // (including the %x3B (";") in question).
  17308. const position = { position: 0 }
  17309. nameValuePair = collectASequenceOfCodePointsFast(';', header, position)
  17310. unparsedAttributes = header.slice(position.position)
  17311. } else {
  17312. // Otherwise:
  17313. // 1. The name-value-pair string consists of all the characters
  17314. // contained in the set-cookie-string, and the unparsed-
  17315. // attributes is the empty string.
  17316. nameValuePair = header
  17317. }
  17318. // 3. If the name-value-pair string lacks a %x3D ("=") character, then
  17319. // the name string is empty, and the value string is the value of
  17320. // name-value-pair.
  17321. if (!nameValuePair.includes('=')) {
  17322. value = nameValuePair
  17323. } else {
  17324. // Otherwise, the name string consists of the characters up to, but
  17325. // not including, the first %x3D ("=") character, and the (possibly
  17326. // empty) value string consists of the characters after the first
  17327. // %x3D ("=") character.
  17328. const position = { position: 0 }
  17329. name = collectASequenceOfCodePointsFast(
  17330. '=',
  17331. nameValuePair,
  17332. position
  17333. )
  17334. value = nameValuePair.slice(position.position + 1)
  17335. }
  17336. // 4. Remove any leading or trailing WSP characters from the name
  17337. // string and the value string.
  17338. name = name.trim()
  17339. value = value.trim()
  17340. // 5. If the sum of the lengths of the name string and the value string
  17341. // is more than 4096 octets, abort these steps and ignore the set-
  17342. // cookie-string entirely.
  17343. if (name.length + value.length > maxNameValuePairSize) {
  17344. return null
  17345. }
  17346. // 6. The cookie-name is the name string, and the cookie-value is the
  17347. // value string.
  17348. return {
  17349. name, value, ...parseUnparsedAttributes(unparsedAttributes)
  17350. }
  17351. }
  17352. /**
  17353. * Parses the remaining attributes of a set-cookie header
  17354. * @see https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4
  17355. * @param {string} unparsedAttributes
  17356. * @param {[Object.<string, unknown>]={}} cookieAttributeList
  17357. */
  17358. function parseUnparsedAttributes (unparsedAttributes, cookieAttributeList = {}) {
  17359. // 1. If the unparsed-attributes string is empty, skip the rest of
  17360. // these steps.
  17361. if (unparsedAttributes.length === 0) {
  17362. return cookieAttributeList
  17363. }
  17364. // 2. Discard the first character of the unparsed-attributes (which
  17365. // will be a %x3B (";") character).
  17366. assert(unparsedAttributes[0] === ';')
  17367. unparsedAttributes = unparsedAttributes.slice(1)
  17368. let cookieAv = ''
  17369. // 3. If the remaining unparsed-attributes contains a %x3B (";")
  17370. // character:
  17371. if (unparsedAttributes.includes(';')) {
  17372. // 1. Consume the characters of the unparsed-attributes up to, but
  17373. // not including, the first %x3B (";") character.
  17374. cookieAv = collectASequenceOfCodePointsFast(
  17375. ';',
  17376. unparsedAttributes,
  17377. { position: 0 }
  17378. )
  17379. unparsedAttributes = unparsedAttributes.slice(cookieAv.length)
  17380. } else {
  17381. // Otherwise:
  17382. // 1. Consume the remainder of the unparsed-attributes.
  17383. cookieAv = unparsedAttributes
  17384. unparsedAttributes = ''
  17385. }
  17386. // Let the cookie-av string be the characters consumed in this step.
  17387. let attributeName = ''
  17388. let attributeValue = ''
  17389. // 4. If the cookie-av string contains a %x3D ("=") character:
  17390. if (cookieAv.includes('=')) {
  17391. // 1. The (possibly empty) attribute-name string consists of the
  17392. // characters up to, but not including, the first %x3D ("=")
  17393. // character, and the (possibly empty) attribute-value string
  17394. // consists of the characters after the first %x3D ("=")
  17395. // character.
  17396. const position = { position: 0 }
  17397. attributeName = collectASequenceOfCodePointsFast(
  17398. '=',
  17399. cookieAv,
  17400. position
  17401. )
  17402. attributeValue = cookieAv.slice(position.position + 1)
  17403. } else {
  17404. // Otherwise:
  17405. // 1. The attribute-name string consists of the entire cookie-av
  17406. // string, and the attribute-value string is empty.
  17407. attributeName = cookieAv
  17408. }
  17409. // 5. Remove any leading or trailing WSP characters from the attribute-
  17410. // name string and the attribute-value string.
  17411. attributeName = attributeName.trim()
  17412. attributeValue = attributeValue.trim()
  17413. // 6. If the attribute-value is longer than 1024 octets, ignore the
  17414. // cookie-av string and return to Step 1 of this algorithm.
  17415. if (attributeValue.length > maxAttributeValueSize) {
  17416. return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList)
  17417. }
  17418. // 7. Process the attribute-name and attribute-value according to the
  17419. // requirements in the following subsections. (Notice that
  17420. // attributes with unrecognized attribute-names are ignored.)
  17421. const attributeNameLowercase = attributeName.toLowerCase()
  17422. // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.1
  17423. // If the attribute-name case-insensitively matches the string
  17424. // "Expires", the user agent MUST process the cookie-av as follows.
  17425. if (attributeNameLowercase === 'expires') {
  17426. // 1. Let the expiry-time be the result of parsing the attribute-value
  17427. // as cookie-date (see Section 5.1.1).
  17428. const expiryTime = new Date(attributeValue)
  17429. // 2. If the attribute-value failed to parse as a cookie date, ignore
  17430. // the cookie-av.
  17431. cookieAttributeList.expires = expiryTime
  17432. } else if (attributeNameLowercase === 'max-age') {
  17433. // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.2
  17434. // If the attribute-name case-insensitively matches the string "Max-
  17435. // Age", the user agent MUST process the cookie-av as follows.
  17436. // 1. If the first character of the attribute-value is not a DIGIT or a
  17437. // "-" character, ignore the cookie-av.
  17438. const charCode = attributeValue.charCodeAt(0)
  17439. if ((charCode < 48 || charCode > 57) && attributeValue[0] !== '-') {
  17440. return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList)
  17441. }
  17442. // 2. If the remainder of attribute-value contains a non-DIGIT
  17443. // character, ignore the cookie-av.
  17444. if (!/^\d+$/.test(attributeValue)) {
  17445. return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList)
  17446. }
  17447. // 3. Let delta-seconds be the attribute-value converted to an integer.
  17448. const deltaSeconds = Number(attributeValue)
  17449. // 4. Let cookie-age-limit be the maximum age of the cookie (which
  17450. // SHOULD be 400 days or less, see Section 4.1.2.2).
  17451. // 5. Set delta-seconds to the smaller of its present value and cookie-
  17452. // age-limit.
  17453. // deltaSeconds = Math.min(deltaSeconds * 1000, maxExpiresMs)
  17454. // 6. If delta-seconds is less than or equal to zero (0), let expiry-
  17455. // time be the earliest representable date and time. Otherwise, let
  17456. // the expiry-time be the current date and time plus delta-seconds
  17457. // seconds.
  17458. // const expiryTime = deltaSeconds <= 0 ? Date.now() : Date.now() + deltaSeconds
  17459. // 7. Append an attribute to the cookie-attribute-list with an
  17460. // attribute-name of Max-Age and an attribute-value of expiry-time.
  17461. cookieAttributeList.maxAge = deltaSeconds
  17462. } else if (attributeNameLowercase === 'domain') {
  17463. // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.3
  17464. // If the attribute-name case-insensitively matches the string "Domain",
  17465. // the user agent MUST process the cookie-av as follows.
  17466. // 1. Let cookie-domain be the attribute-value.
  17467. let cookieDomain = attributeValue
  17468. // 2. If cookie-domain starts with %x2E ("."), let cookie-domain be
  17469. // cookie-domain without its leading %x2E (".").
  17470. if (cookieDomain[0] === '.') {
  17471. cookieDomain = cookieDomain.slice(1)
  17472. }
  17473. // 3. Convert the cookie-domain to lower case.
  17474. cookieDomain = cookieDomain.toLowerCase()
  17475. // 4. Append an attribute to the cookie-attribute-list with an
  17476. // attribute-name of Domain and an attribute-value of cookie-domain.
  17477. cookieAttributeList.domain = cookieDomain
  17478. } else if (attributeNameLowercase === 'path') {
  17479. // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.4
  17480. // If the attribute-name case-insensitively matches the string "Path",
  17481. // the user agent MUST process the cookie-av as follows.
  17482. // 1. If the attribute-value is empty or if the first character of the
  17483. // attribute-value is not %x2F ("/"):
  17484. let cookiePath = ''
  17485. if (attributeValue.length === 0 || attributeValue[0] !== '/') {
  17486. // 1. Let cookie-path be the default-path.
  17487. cookiePath = '/'
  17488. } else {
  17489. // Otherwise:
  17490. // 1. Let cookie-path be the attribute-value.
  17491. cookiePath = attributeValue
  17492. }
  17493. // 2. Append an attribute to the cookie-attribute-list with an
  17494. // attribute-name of Path and an attribute-value of cookie-path.
  17495. cookieAttributeList.path = cookiePath
  17496. } else if (attributeNameLowercase === 'secure') {
  17497. // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.5
  17498. // If the attribute-name case-insensitively matches the string "Secure",
  17499. // the user agent MUST append an attribute to the cookie-attribute-list
  17500. // with an attribute-name of Secure and an empty attribute-value.
  17501. cookieAttributeList.secure = true
  17502. } else if (attributeNameLowercase === 'httponly') {
  17503. // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.6
  17504. // If the attribute-name case-insensitively matches the string
  17505. // "HttpOnly", the user agent MUST append an attribute to the cookie-
  17506. // attribute-list with an attribute-name of HttpOnly and an empty
  17507. // attribute-value.
  17508. cookieAttributeList.httpOnly = true
  17509. } else if (attributeNameLowercase === 'samesite') {
  17510. // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.7
  17511. // If the attribute-name case-insensitively matches the string
  17512. // "SameSite", the user agent MUST process the cookie-av as follows:
  17513. // 1. Let enforcement be "Default".
  17514. let enforcement = 'Default'
  17515. const attributeValueLowercase = attributeValue.toLowerCase()
  17516. // 2. If cookie-av's attribute-value is a case-insensitive match for
  17517. // "None", set enforcement to "None".
  17518. if (attributeValueLowercase.includes('none')) {
  17519. enforcement = 'None'
  17520. }
  17521. // 3. If cookie-av's attribute-value is a case-insensitive match for
  17522. // "Strict", set enforcement to "Strict".
  17523. if (attributeValueLowercase.includes('strict')) {
  17524. enforcement = 'Strict'
  17525. }
  17526. // 4. If cookie-av's attribute-value is a case-insensitive match for
  17527. // "Lax", set enforcement to "Lax".
  17528. if (attributeValueLowercase.includes('lax')) {
  17529. enforcement = 'Lax'
  17530. }
  17531. // 5. Append an attribute to the cookie-attribute-list with an
  17532. // attribute-name of "SameSite" and an attribute-value of
  17533. // enforcement.
  17534. cookieAttributeList.sameSite = enforcement
  17535. } else {
  17536. cookieAttributeList.unparsed ??= []
  17537. cookieAttributeList.unparsed.push(`${attributeName}=${attributeValue}`)
  17538. }
  17539. // 8. Return to Step 1 of this algorithm.
  17540. return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList)
  17541. }
  17542. module.exports = {
  17543. parseSetCookie,
  17544. parseUnparsedAttributes
  17545. }
  17546. /***/ }),
  17547. /***/ 3121:
  17548. /***/ ((module) => {
  17549. "use strict";
  17550. /**
  17551. * @param {string} value
  17552. * @returns {boolean}
  17553. */
  17554. function isCTLExcludingHtab (value) {
  17555. if (value.length === 0) {
  17556. return false
  17557. }
  17558. for (const char of value) {
  17559. const code = char.charCodeAt(0)
  17560. if (
  17561. (code >= 0x00 || code <= 0x08) ||
  17562. (code >= 0x0A || code <= 0x1F) ||
  17563. code === 0x7F
  17564. ) {
  17565. return false
  17566. }
  17567. }
  17568. }
  17569. /**
  17570. CHAR = <any US-ASCII character (octets 0 - 127)>
  17571. token = 1*<any CHAR except CTLs or separators>
  17572. separators = "(" | ")" | "<" | ">" | "@"
  17573. | "," | ";" | ":" | "\" | <">
  17574. | "/" | "[" | "]" | "?" | "="
  17575. | "{" | "}" | SP | HT
  17576. * @param {string} name
  17577. */
  17578. function validateCookieName (name) {
  17579. for (const char of name) {
  17580. const code = char.charCodeAt(0)
  17581. if (
  17582. (code <= 0x20 || code > 0x7F) ||
  17583. char === '(' ||
  17584. char === ')' ||
  17585. char === '>' ||
  17586. char === '<' ||
  17587. char === '@' ||
  17588. char === ',' ||
  17589. char === ';' ||
  17590. char === ':' ||
  17591. char === '\\' ||
  17592. char === '"' ||
  17593. char === '/' ||
  17594. char === '[' ||
  17595. char === ']' ||
  17596. char === '?' ||
  17597. char === '=' ||
  17598. char === '{' ||
  17599. char === '}'
  17600. ) {
  17601. throw new Error('Invalid cookie name')
  17602. }
  17603. }
  17604. }
  17605. /**
  17606. cookie-value = *cookie-octet / ( DQUOTE *cookie-octet DQUOTE )
  17607. cookie-octet = %x21 / %x23-2B / %x2D-3A / %x3C-5B / %x5D-7E
  17608. ; US-ASCII characters excluding CTLs,
  17609. ; whitespace DQUOTE, comma, semicolon,
  17610. ; and backslash
  17611. * @param {string} value
  17612. */
  17613. function validateCookieValue (value) {
  17614. for (const char of value) {
  17615. const code = char.charCodeAt(0)
  17616. if (
  17617. code < 0x21 || // exclude CTLs (0-31)
  17618. code === 0x22 ||
  17619. code === 0x2C ||
  17620. code === 0x3B ||
  17621. code === 0x5C ||
  17622. code > 0x7E // non-ascii
  17623. ) {
  17624. throw new Error('Invalid header value')
  17625. }
  17626. }
  17627. }
  17628. /**
  17629. * path-value = <any CHAR except CTLs or ";">
  17630. * @param {string} path
  17631. */
  17632. function validateCookiePath (path) {
  17633. for (const char of path) {
  17634. const code = char.charCodeAt(0)
  17635. if (code < 0x21 || char === ';') {
  17636. throw new Error('Invalid cookie path')
  17637. }
  17638. }
  17639. }
  17640. /**
  17641. * I have no idea why these values aren't allowed to be honest,
  17642. * but Deno tests these. - Khafra
  17643. * @param {string} domain
  17644. */
  17645. function validateCookieDomain (domain) {
  17646. if (
  17647. domain.startsWith('-') ||
  17648. domain.endsWith('.') ||
  17649. domain.endsWith('-')
  17650. ) {
  17651. throw new Error('Invalid cookie domain')
  17652. }
  17653. }
  17654. /**
  17655. * @see https://www.rfc-editor.org/rfc/rfc7231#section-7.1.1.1
  17656. * @param {number|Date} date
  17657. IMF-fixdate = day-name "," SP date1 SP time-of-day SP GMT
  17658. ; fixed length/zone/capitalization subset of the format
  17659. ; see Section 3.3 of [RFC5322]
  17660. day-name = %x4D.6F.6E ; "Mon", case-sensitive
  17661. / %x54.75.65 ; "Tue", case-sensitive
  17662. / %x57.65.64 ; "Wed", case-sensitive
  17663. / %x54.68.75 ; "Thu", case-sensitive
  17664. / %x46.72.69 ; "Fri", case-sensitive
  17665. / %x53.61.74 ; "Sat", case-sensitive
  17666. / %x53.75.6E ; "Sun", case-sensitive
  17667. date1 = day SP month SP year
  17668. ; e.g., 02 Jun 1982
  17669. day = 2DIGIT
  17670. month = %x4A.61.6E ; "Jan", case-sensitive
  17671. / %x46.65.62 ; "Feb", case-sensitive
  17672. / %x4D.61.72 ; "Mar", case-sensitive
  17673. / %x41.70.72 ; "Apr", case-sensitive
  17674. / %x4D.61.79 ; "May", case-sensitive
  17675. / %x4A.75.6E ; "Jun", case-sensitive
  17676. / %x4A.75.6C ; "Jul", case-sensitive
  17677. / %x41.75.67 ; "Aug", case-sensitive
  17678. / %x53.65.70 ; "Sep", case-sensitive
  17679. / %x4F.63.74 ; "Oct", case-sensitive
  17680. / %x4E.6F.76 ; "Nov", case-sensitive
  17681. / %x44.65.63 ; "Dec", case-sensitive
  17682. year = 4DIGIT
  17683. GMT = %x47.4D.54 ; "GMT", case-sensitive
  17684. time-of-day = hour ":" minute ":" second
  17685. ; 00:00:00 - 23:59:60 (leap second)
  17686. hour = 2DIGIT
  17687. minute = 2DIGIT
  17688. second = 2DIGIT
  17689. */
  17690. function toIMFDate (date) {
  17691. if (typeof date === 'number') {
  17692. date = new Date(date)
  17693. }
  17694. const days = [
  17695. 'Sun', 'Mon', 'Tue', 'Wed',
  17696. 'Thu', 'Fri', 'Sat'
  17697. ]
  17698. const months = [
  17699. 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
  17700. 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'
  17701. ]
  17702. const dayName = days[date.getUTCDay()]
  17703. const day = date.getUTCDate().toString().padStart(2, '0')
  17704. const month = months[date.getUTCMonth()]
  17705. const year = date.getUTCFullYear()
  17706. const hour = date.getUTCHours().toString().padStart(2, '0')
  17707. const minute = date.getUTCMinutes().toString().padStart(2, '0')
  17708. const second = date.getUTCSeconds().toString().padStart(2, '0')
  17709. return `${dayName}, ${day} ${month} ${year} ${hour}:${minute}:${second} GMT`
  17710. }
  17711. /**
  17712. max-age-av = "Max-Age=" non-zero-digit *DIGIT
  17713. ; In practice, both expires-av and max-age-av
  17714. ; are limited to dates representable by the
  17715. ; user agent.
  17716. * @param {number} maxAge
  17717. */
  17718. function validateCookieMaxAge (maxAge) {
  17719. if (maxAge < 0) {
  17720. throw new Error('Invalid cookie max-age')
  17721. }
  17722. }
  17723. /**
  17724. * @see https://www.rfc-editor.org/rfc/rfc6265#section-4.1.1
  17725. * @param {import('./index').Cookie} cookie
  17726. */
  17727. function stringify (cookie) {
  17728. if (cookie.name.length === 0) {
  17729. return null
  17730. }
  17731. validateCookieName(cookie.name)
  17732. validateCookieValue(cookie.value)
  17733. const out = [`${cookie.name}=${cookie.value}`]
  17734. // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-cookie-prefixes-00#section-3.1
  17735. // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-cookie-prefixes-00#section-3.2
  17736. if (cookie.name.startsWith('__Secure-')) {
  17737. cookie.secure = true
  17738. }
  17739. if (cookie.name.startsWith('__Host-')) {
  17740. cookie.secure = true
  17741. cookie.domain = null
  17742. cookie.path = '/'
  17743. }
  17744. if (cookie.secure) {
  17745. out.push('Secure')
  17746. }
  17747. if (cookie.httpOnly) {
  17748. out.push('HttpOnly')
  17749. }
  17750. if (typeof cookie.maxAge === 'number') {
  17751. validateCookieMaxAge(cookie.maxAge)
  17752. out.push(`Max-Age=${cookie.maxAge}`)
  17753. }
  17754. if (cookie.domain) {
  17755. validateCookieDomain(cookie.domain)
  17756. out.push(`Domain=${cookie.domain}`)
  17757. }
  17758. if (cookie.path) {
  17759. validateCookiePath(cookie.path)
  17760. out.push(`Path=${cookie.path}`)
  17761. }
  17762. if (cookie.expires && cookie.expires.toString() !== 'Invalid Date') {
  17763. out.push(`Expires=${toIMFDate(cookie.expires)}`)
  17764. }
  17765. if (cookie.sameSite) {
  17766. out.push(`SameSite=${cookie.sameSite}`)
  17767. }
  17768. for (const part of cookie.unparsed) {
  17769. if (!part.includes('=')) {
  17770. throw new Error('Invalid unparsed')
  17771. }
  17772. const [key, ...value] = part.split('=')
  17773. out.push(`${key.trim()}=${value.join('=')}`)
  17774. }
  17775. return out.join('; ')
  17776. }
  17777. module.exports = {
  17778. isCTLExcludingHtab,
  17779. validateCookieName,
  17780. validateCookiePath,
  17781. validateCookieValue,
  17782. toIMFDate,
  17783. stringify
  17784. }
  17785. /***/ }),
  17786. /***/ 2067:
  17787. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  17788. "use strict";
  17789. const net = __nccwpck_require__(1808)
  17790. const assert = __nccwpck_require__(9491)
  17791. const util = __nccwpck_require__(3983)
  17792. const { InvalidArgumentError, ConnectTimeoutError } = __nccwpck_require__(8045)
  17793. let tls // include tls conditionally since it is not always available
  17794. // TODO: session re-use does not wait for the first
  17795. // connection to resolve the session and might therefore
  17796. // resolve the same servername multiple times even when
  17797. // re-use is enabled.
  17798. let SessionCache
  17799. // FIXME: remove workaround when the Node bug is fixed
  17800. // https://github.com/nodejs/node/issues/49344#issuecomment-1741776308
  17801. if (global.FinalizationRegistry && !process.env.NODE_V8_COVERAGE) {
  17802. SessionCache = class WeakSessionCache {
  17803. constructor (maxCachedSessions) {
  17804. this._maxCachedSessions = maxCachedSessions
  17805. this._sessionCache = new Map()
  17806. this._sessionRegistry = new global.FinalizationRegistry((key) => {
  17807. if (this._sessionCache.size < this._maxCachedSessions) {
  17808. return
  17809. }
  17810. const ref = this._sessionCache.get(key)
  17811. if (ref !== undefined && ref.deref() === undefined) {
  17812. this._sessionCache.delete(key)
  17813. }
  17814. })
  17815. }
  17816. get (sessionKey) {
  17817. const ref = this._sessionCache.get(sessionKey)
  17818. return ref ? ref.deref() : null
  17819. }
  17820. set (sessionKey, session) {
  17821. if (this._maxCachedSessions === 0) {
  17822. return
  17823. }
  17824. this._sessionCache.set(sessionKey, new WeakRef(session))
  17825. this._sessionRegistry.register(session, sessionKey)
  17826. }
  17827. }
  17828. } else {
  17829. SessionCache = class SimpleSessionCache {
  17830. constructor (maxCachedSessions) {
  17831. this._maxCachedSessions = maxCachedSessions
  17832. this._sessionCache = new Map()
  17833. }
  17834. get (sessionKey) {
  17835. return this._sessionCache.get(sessionKey)
  17836. }
  17837. set (sessionKey, session) {
  17838. if (this._maxCachedSessions === 0) {
  17839. return
  17840. }
  17841. if (this._sessionCache.size >= this._maxCachedSessions) {
  17842. // remove the oldest session
  17843. const { value: oldestKey } = this._sessionCache.keys().next()
  17844. this._sessionCache.delete(oldestKey)
  17845. }
  17846. this._sessionCache.set(sessionKey, session)
  17847. }
  17848. }
  17849. }
  17850. function buildConnector ({ allowH2, maxCachedSessions, socketPath, timeout, ...opts }) {
  17851. if (maxCachedSessions != null && (!Number.isInteger(maxCachedSessions) || maxCachedSessions < 0)) {
  17852. throw new InvalidArgumentError('maxCachedSessions must be a positive integer or zero')
  17853. }
  17854. const options = { path: socketPath, ...opts }
  17855. const sessionCache = new SessionCache(maxCachedSessions == null ? 100 : maxCachedSessions)
  17856. timeout = timeout == null ? 10e3 : timeout
  17857. allowH2 = allowH2 != null ? allowH2 : false
  17858. return function connect ({ hostname, host, protocol, port, servername, localAddress, httpSocket }, callback) {
  17859. let socket
  17860. if (protocol === 'https:') {
  17861. if (!tls) {
  17862. tls = __nccwpck_require__(4404)
  17863. }
  17864. servername = servername || options.servername || util.getServerName(host) || null
  17865. const sessionKey = servername || hostname
  17866. const session = sessionCache.get(sessionKey) || null
  17867. assert(sessionKey)
  17868. socket = tls.connect({
  17869. highWaterMark: 16384, // TLS in node can't have bigger HWM anyway...
  17870. ...options,
  17871. servername,
  17872. session,
  17873. localAddress,
  17874. // TODO(HTTP/2): Add support for h2c
  17875. ALPNProtocols: allowH2 ? ['http/1.1', 'h2'] : ['http/1.1'],
  17876. socket: httpSocket, // upgrade socket connection
  17877. port: port || 443,
  17878. host: hostname
  17879. })
  17880. socket
  17881. .on('session', function (session) {
  17882. // TODO (fix): Can a session become invalid once established? Don't think so?
  17883. sessionCache.set(sessionKey, session)
  17884. })
  17885. } else {
  17886. assert(!httpSocket, 'httpSocket can only be sent on TLS update')
  17887. socket = net.connect({
  17888. highWaterMark: 64 * 1024, // Same as nodejs fs streams.
  17889. ...options,
  17890. localAddress,
  17891. port: port || 80,
  17892. host: hostname
  17893. })
  17894. }
  17895. // Set TCP keep alive options on the socket here instead of in connect() for the case of assigning the socket
  17896. if (options.keepAlive == null || options.keepAlive) {
  17897. const keepAliveInitialDelay = options.keepAliveInitialDelay === undefined ? 60e3 : options.keepAliveInitialDelay
  17898. socket.setKeepAlive(true, keepAliveInitialDelay)
  17899. }
  17900. const cancelTimeout = setupTimeout(() => onConnectTimeout(socket), timeout)
  17901. socket
  17902. .setNoDelay(true)
  17903. .once(protocol === 'https:' ? 'secureConnect' : 'connect', function () {
  17904. cancelTimeout()
  17905. if (callback) {
  17906. const cb = callback
  17907. callback = null
  17908. cb(null, this)
  17909. }
  17910. })
  17911. .on('error', function (err) {
  17912. cancelTimeout()
  17913. if (callback) {
  17914. const cb = callback
  17915. callback = null
  17916. cb(err)
  17917. }
  17918. })
  17919. return socket
  17920. }
  17921. }
  17922. function setupTimeout (onConnectTimeout, timeout) {
  17923. if (!timeout) {
  17924. return () => {}
  17925. }
  17926. let s1 = null
  17927. let s2 = null
  17928. const timeoutId = setTimeout(() => {
  17929. // setImmediate is added to make sure that we priotorise socket error events over timeouts
  17930. s1 = setImmediate(() => {
  17931. if (process.platform === 'win32') {
  17932. // Windows needs an extra setImmediate probably due to implementation differences in the socket logic
  17933. s2 = setImmediate(() => onConnectTimeout())
  17934. } else {
  17935. onConnectTimeout()
  17936. }
  17937. })
  17938. }, timeout)
  17939. return () => {
  17940. clearTimeout(timeoutId)
  17941. clearImmediate(s1)
  17942. clearImmediate(s2)
  17943. }
  17944. }
  17945. function onConnectTimeout (socket) {
  17946. util.destroy(socket, new ConnectTimeoutError())
  17947. }
  17948. module.exports = buildConnector
  17949. /***/ }),
  17950. /***/ 4462:
  17951. /***/ ((module) => {
  17952. "use strict";
  17953. /** @type {Record<string, string | undefined>} */
  17954. const headerNameLowerCasedRecord = {}
  17955. // https://developer.mozilla.org/docs/Web/HTTP/Headers
  17956. const wellknownHeaderNames = [
  17957. 'Accept',
  17958. 'Accept-Encoding',
  17959. 'Accept-Language',
  17960. 'Accept-Ranges',
  17961. 'Access-Control-Allow-Credentials',
  17962. 'Access-Control-Allow-Headers',
  17963. 'Access-Control-Allow-Methods',
  17964. 'Access-Control-Allow-Origin',
  17965. 'Access-Control-Expose-Headers',
  17966. 'Access-Control-Max-Age',
  17967. 'Access-Control-Request-Headers',
  17968. 'Access-Control-Request-Method',
  17969. 'Age',
  17970. 'Allow',
  17971. 'Alt-Svc',
  17972. 'Alt-Used',
  17973. 'Authorization',
  17974. 'Cache-Control',
  17975. 'Clear-Site-Data',
  17976. 'Connection',
  17977. 'Content-Disposition',
  17978. 'Content-Encoding',
  17979. 'Content-Language',
  17980. 'Content-Length',
  17981. 'Content-Location',
  17982. 'Content-Range',
  17983. 'Content-Security-Policy',
  17984. 'Content-Security-Policy-Report-Only',
  17985. 'Content-Type',
  17986. 'Cookie',
  17987. 'Cross-Origin-Embedder-Policy',
  17988. 'Cross-Origin-Opener-Policy',
  17989. 'Cross-Origin-Resource-Policy',
  17990. 'Date',
  17991. 'Device-Memory',
  17992. 'Downlink',
  17993. 'ECT',
  17994. 'ETag',
  17995. 'Expect',
  17996. 'Expect-CT',
  17997. 'Expires',
  17998. 'Forwarded',
  17999. 'From',
  18000. 'Host',
  18001. 'If-Match',
  18002. 'If-Modified-Since',
  18003. 'If-None-Match',
  18004. 'If-Range',
  18005. 'If-Unmodified-Since',
  18006. 'Keep-Alive',
  18007. 'Last-Modified',
  18008. 'Link',
  18009. 'Location',
  18010. 'Max-Forwards',
  18011. 'Origin',
  18012. 'Permissions-Policy',
  18013. 'Pragma',
  18014. 'Proxy-Authenticate',
  18015. 'Proxy-Authorization',
  18016. 'RTT',
  18017. 'Range',
  18018. 'Referer',
  18019. 'Referrer-Policy',
  18020. 'Refresh',
  18021. 'Retry-After',
  18022. 'Sec-WebSocket-Accept',
  18023. 'Sec-WebSocket-Extensions',
  18024. 'Sec-WebSocket-Key',
  18025. 'Sec-WebSocket-Protocol',
  18026. 'Sec-WebSocket-Version',
  18027. 'Server',
  18028. 'Server-Timing',
  18029. 'Service-Worker-Allowed',
  18030. 'Service-Worker-Navigation-Preload',
  18031. 'Set-Cookie',
  18032. 'SourceMap',
  18033. 'Strict-Transport-Security',
  18034. 'Supports-Loading-Mode',
  18035. 'TE',
  18036. 'Timing-Allow-Origin',
  18037. 'Trailer',
  18038. 'Transfer-Encoding',
  18039. 'Upgrade',
  18040. 'Upgrade-Insecure-Requests',
  18041. 'User-Agent',
  18042. 'Vary',
  18043. 'Via',
  18044. 'WWW-Authenticate',
  18045. 'X-Content-Type-Options',
  18046. 'X-DNS-Prefetch-Control',
  18047. 'X-Frame-Options',
  18048. 'X-Permitted-Cross-Domain-Policies',
  18049. 'X-Powered-By',
  18050. 'X-Requested-With',
  18051. 'X-XSS-Protection'
  18052. ]
  18053. for (let i = 0; i < wellknownHeaderNames.length; ++i) {
  18054. const key = wellknownHeaderNames[i]
  18055. const lowerCasedKey = key.toLowerCase()
  18056. headerNameLowerCasedRecord[key] = headerNameLowerCasedRecord[lowerCasedKey] =
  18057. lowerCasedKey
  18058. }
  18059. // Note: object prototypes should not be able to be referenced. e.g. `Object#hasOwnProperty`.
  18060. Object.setPrototypeOf(headerNameLowerCasedRecord, null)
  18061. module.exports = {
  18062. wellknownHeaderNames,
  18063. headerNameLowerCasedRecord
  18064. }
  18065. /***/ }),
  18066. /***/ 8045:
  18067. /***/ ((module) => {
  18068. "use strict";
  18069. class UndiciError extends Error {
  18070. constructor (message) {
  18071. super(message)
  18072. this.name = 'UndiciError'
  18073. this.code = 'UND_ERR'
  18074. }
  18075. }
  18076. class ConnectTimeoutError extends UndiciError {
  18077. constructor (message) {
  18078. super(message)
  18079. Error.captureStackTrace(this, ConnectTimeoutError)
  18080. this.name = 'ConnectTimeoutError'
  18081. this.message = message || 'Connect Timeout Error'
  18082. this.code = 'UND_ERR_CONNECT_TIMEOUT'
  18083. }
  18084. }
  18085. class HeadersTimeoutError extends UndiciError {
  18086. constructor (message) {
  18087. super(message)
  18088. Error.captureStackTrace(this, HeadersTimeoutError)
  18089. this.name = 'HeadersTimeoutError'
  18090. this.message = message || 'Headers Timeout Error'
  18091. this.code = 'UND_ERR_HEADERS_TIMEOUT'
  18092. }
  18093. }
  18094. class HeadersOverflowError extends UndiciError {
  18095. constructor (message) {
  18096. super(message)
  18097. Error.captureStackTrace(this, HeadersOverflowError)
  18098. this.name = 'HeadersOverflowError'
  18099. this.message = message || 'Headers Overflow Error'
  18100. this.code = 'UND_ERR_HEADERS_OVERFLOW'
  18101. }
  18102. }
  18103. class BodyTimeoutError extends UndiciError {
  18104. constructor (message) {
  18105. super(message)
  18106. Error.captureStackTrace(this, BodyTimeoutError)
  18107. this.name = 'BodyTimeoutError'
  18108. this.message = message || 'Body Timeout Error'
  18109. this.code = 'UND_ERR_BODY_TIMEOUT'
  18110. }
  18111. }
  18112. class ResponseStatusCodeError extends UndiciError {
  18113. constructor (message, statusCode, headers, body) {
  18114. super(message)
  18115. Error.captureStackTrace(this, ResponseStatusCodeError)
  18116. this.name = 'ResponseStatusCodeError'
  18117. this.message = message || 'Response Status Code Error'
  18118. this.code = 'UND_ERR_RESPONSE_STATUS_CODE'
  18119. this.body = body
  18120. this.status = statusCode
  18121. this.statusCode = statusCode
  18122. this.headers = headers
  18123. }
  18124. }
  18125. class InvalidArgumentError extends UndiciError {
  18126. constructor (message) {
  18127. super(message)
  18128. Error.captureStackTrace(this, InvalidArgumentError)
  18129. this.name = 'InvalidArgumentError'
  18130. this.message = message || 'Invalid Argument Error'
  18131. this.code = 'UND_ERR_INVALID_ARG'
  18132. }
  18133. }
  18134. class InvalidReturnValueError extends UndiciError {
  18135. constructor (message) {
  18136. super(message)
  18137. Error.captureStackTrace(this, InvalidReturnValueError)
  18138. this.name = 'InvalidReturnValueError'
  18139. this.message = message || 'Invalid Return Value Error'
  18140. this.code = 'UND_ERR_INVALID_RETURN_VALUE'
  18141. }
  18142. }
  18143. class RequestAbortedError extends UndiciError {
  18144. constructor (message) {
  18145. super(message)
  18146. Error.captureStackTrace(this, RequestAbortedError)
  18147. this.name = 'AbortError'
  18148. this.message = message || 'Request aborted'
  18149. this.code = 'UND_ERR_ABORTED'
  18150. }
  18151. }
  18152. class InformationalError extends UndiciError {
  18153. constructor (message) {
  18154. super(message)
  18155. Error.captureStackTrace(this, InformationalError)
  18156. this.name = 'InformationalError'
  18157. this.message = message || 'Request information'
  18158. this.code = 'UND_ERR_INFO'
  18159. }
  18160. }
  18161. class RequestContentLengthMismatchError extends UndiciError {
  18162. constructor (message) {
  18163. super(message)
  18164. Error.captureStackTrace(this, RequestContentLengthMismatchError)
  18165. this.name = 'RequestContentLengthMismatchError'
  18166. this.message = message || 'Request body length does not match content-length header'
  18167. this.code = 'UND_ERR_REQ_CONTENT_LENGTH_MISMATCH'
  18168. }
  18169. }
  18170. class ResponseContentLengthMismatchError extends UndiciError {
  18171. constructor (message) {
  18172. super(message)
  18173. Error.captureStackTrace(this, ResponseContentLengthMismatchError)
  18174. this.name = 'ResponseContentLengthMismatchError'
  18175. this.message = message || 'Response body length does not match content-length header'
  18176. this.code = 'UND_ERR_RES_CONTENT_LENGTH_MISMATCH'
  18177. }
  18178. }
  18179. class ClientDestroyedError extends UndiciError {
  18180. constructor (message) {
  18181. super(message)
  18182. Error.captureStackTrace(this, ClientDestroyedError)
  18183. this.name = 'ClientDestroyedError'
  18184. this.message = message || 'The client is destroyed'
  18185. this.code = 'UND_ERR_DESTROYED'
  18186. }
  18187. }
  18188. class ClientClosedError extends UndiciError {
  18189. constructor (message) {
  18190. super(message)
  18191. Error.captureStackTrace(this, ClientClosedError)
  18192. this.name = 'ClientClosedError'
  18193. this.message = message || 'The client is closed'
  18194. this.code = 'UND_ERR_CLOSED'
  18195. }
  18196. }
  18197. class SocketError extends UndiciError {
  18198. constructor (message, socket) {
  18199. super(message)
  18200. Error.captureStackTrace(this, SocketError)
  18201. this.name = 'SocketError'
  18202. this.message = message || 'Socket error'
  18203. this.code = 'UND_ERR_SOCKET'
  18204. this.socket = socket
  18205. }
  18206. }
  18207. class NotSupportedError extends UndiciError {
  18208. constructor (message) {
  18209. super(message)
  18210. Error.captureStackTrace(this, NotSupportedError)
  18211. this.name = 'NotSupportedError'
  18212. this.message = message || 'Not supported error'
  18213. this.code = 'UND_ERR_NOT_SUPPORTED'
  18214. }
  18215. }
  18216. class BalancedPoolMissingUpstreamError extends UndiciError {
  18217. constructor (message) {
  18218. super(message)
  18219. Error.captureStackTrace(this, NotSupportedError)
  18220. this.name = 'MissingUpstreamError'
  18221. this.message = message || 'No upstream has been added to the BalancedPool'
  18222. this.code = 'UND_ERR_BPL_MISSING_UPSTREAM'
  18223. }
  18224. }
  18225. class HTTPParserError extends Error {
  18226. constructor (message, code, data) {
  18227. super(message)
  18228. Error.captureStackTrace(this, HTTPParserError)
  18229. this.name = 'HTTPParserError'
  18230. this.code = code ? `HPE_${code}` : undefined
  18231. this.data = data ? data.toString() : undefined
  18232. }
  18233. }
  18234. class ResponseExceededMaxSizeError extends UndiciError {
  18235. constructor (message) {
  18236. super(message)
  18237. Error.captureStackTrace(this, ResponseExceededMaxSizeError)
  18238. this.name = 'ResponseExceededMaxSizeError'
  18239. this.message = message || 'Response content exceeded max size'
  18240. this.code = 'UND_ERR_RES_EXCEEDED_MAX_SIZE'
  18241. }
  18242. }
  18243. class RequestRetryError extends UndiciError {
  18244. constructor (message, code, { headers, data }) {
  18245. super(message)
  18246. Error.captureStackTrace(this, RequestRetryError)
  18247. this.name = 'RequestRetryError'
  18248. this.message = message || 'Request retry error'
  18249. this.code = 'UND_ERR_REQ_RETRY'
  18250. this.statusCode = code
  18251. this.data = data
  18252. this.headers = headers
  18253. }
  18254. }
  18255. module.exports = {
  18256. HTTPParserError,
  18257. UndiciError,
  18258. HeadersTimeoutError,
  18259. HeadersOverflowError,
  18260. BodyTimeoutError,
  18261. RequestContentLengthMismatchError,
  18262. ConnectTimeoutError,
  18263. ResponseStatusCodeError,
  18264. InvalidArgumentError,
  18265. InvalidReturnValueError,
  18266. RequestAbortedError,
  18267. ClientDestroyedError,
  18268. ClientClosedError,
  18269. InformationalError,
  18270. SocketError,
  18271. NotSupportedError,
  18272. ResponseContentLengthMismatchError,
  18273. BalancedPoolMissingUpstreamError,
  18274. ResponseExceededMaxSizeError,
  18275. RequestRetryError
  18276. }
  18277. /***/ }),
  18278. /***/ 2905:
  18279. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  18280. "use strict";
  18281. const {
  18282. InvalidArgumentError,
  18283. NotSupportedError
  18284. } = __nccwpck_require__(8045)
  18285. const assert = __nccwpck_require__(9491)
  18286. const { kHTTP2BuildRequest, kHTTP2CopyHeaders, kHTTP1BuildRequest } = __nccwpck_require__(2785)
  18287. const util = __nccwpck_require__(3983)
  18288. // tokenRegExp and headerCharRegex have been lifted from
  18289. // https://github.com/nodejs/node/blob/main/lib/_http_common.js
  18290. /**
  18291. * Verifies that the given val is a valid HTTP token
  18292. * per the rules defined in RFC 7230
  18293. * See https://tools.ietf.org/html/rfc7230#section-3.2.6
  18294. */
  18295. const tokenRegExp = /^[\^_`a-zA-Z\-0-9!#$%&'*+.|~]+$/
  18296. /**
  18297. * Matches if val contains an invalid field-vchar
  18298. * field-value = *( field-content / obs-fold )
  18299. * field-content = field-vchar [ 1*( SP / HTAB ) field-vchar ]
  18300. * field-vchar = VCHAR / obs-text
  18301. */
  18302. const headerCharRegex = /[^\t\x20-\x7e\x80-\xff]/
  18303. // Verifies that a given path is valid does not contain control chars \x00 to \x20
  18304. const invalidPathRegex = /[^\u0021-\u00ff]/
  18305. const kHandler = Symbol('handler')
  18306. const channels = {}
  18307. let extractBody
  18308. try {
  18309. const diagnosticsChannel = __nccwpck_require__(7643)
  18310. channels.create = diagnosticsChannel.channel('undici:request:create')
  18311. channels.bodySent = diagnosticsChannel.channel('undici:request:bodySent')
  18312. channels.headers = diagnosticsChannel.channel('undici:request:headers')
  18313. channels.trailers = diagnosticsChannel.channel('undici:request:trailers')
  18314. channels.error = diagnosticsChannel.channel('undici:request:error')
  18315. } catch {
  18316. channels.create = { hasSubscribers: false }
  18317. channels.bodySent = { hasSubscribers: false }
  18318. channels.headers = { hasSubscribers: false }
  18319. channels.trailers = { hasSubscribers: false }
  18320. channels.error = { hasSubscribers: false }
  18321. }
  18322. class Request {
  18323. constructor (origin, {
  18324. path,
  18325. method,
  18326. body,
  18327. headers,
  18328. query,
  18329. idempotent,
  18330. blocking,
  18331. upgrade,
  18332. headersTimeout,
  18333. bodyTimeout,
  18334. reset,
  18335. throwOnError,
  18336. expectContinue
  18337. }, handler) {
  18338. if (typeof path !== 'string') {
  18339. throw new InvalidArgumentError('path must be a string')
  18340. } else if (
  18341. path[0] !== '/' &&
  18342. !(path.startsWith('http://') || path.startsWith('https://')) &&
  18343. method !== 'CONNECT'
  18344. ) {
  18345. throw new InvalidArgumentError('path must be an absolute URL or start with a slash')
  18346. } else if (invalidPathRegex.exec(path) !== null) {
  18347. throw new InvalidArgumentError('invalid request path')
  18348. }
  18349. if (typeof method !== 'string') {
  18350. throw new InvalidArgumentError('method must be a string')
  18351. } else if (tokenRegExp.exec(method) === null) {
  18352. throw new InvalidArgumentError('invalid request method')
  18353. }
  18354. if (upgrade && typeof upgrade !== 'string') {
  18355. throw new InvalidArgumentError('upgrade must be a string')
  18356. }
  18357. if (headersTimeout != null && (!Number.isFinite(headersTimeout) || headersTimeout < 0)) {
  18358. throw new InvalidArgumentError('invalid headersTimeout')
  18359. }
  18360. if (bodyTimeout != null && (!Number.isFinite(bodyTimeout) || bodyTimeout < 0)) {
  18361. throw new InvalidArgumentError('invalid bodyTimeout')
  18362. }
  18363. if (reset != null && typeof reset !== 'boolean') {
  18364. throw new InvalidArgumentError('invalid reset')
  18365. }
  18366. if (expectContinue != null && typeof expectContinue !== 'boolean') {
  18367. throw new InvalidArgumentError('invalid expectContinue')
  18368. }
  18369. this.headersTimeout = headersTimeout
  18370. this.bodyTimeout = bodyTimeout
  18371. this.throwOnError = throwOnError === true
  18372. this.method = method
  18373. this.abort = null
  18374. if (body == null) {
  18375. this.body = null
  18376. } else if (util.isStream(body)) {
  18377. this.body = body
  18378. const rState = this.body._readableState
  18379. if (!rState || !rState.autoDestroy) {
  18380. this.endHandler = function autoDestroy () {
  18381. util.destroy(this)
  18382. }
  18383. this.body.on('end', this.endHandler)
  18384. }
  18385. this.errorHandler = err => {
  18386. if (this.abort) {
  18387. this.abort(err)
  18388. } else {
  18389. this.error = err
  18390. }
  18391. }
  18392. this.body.on('error', this.errorHandler)
  18393. } else if (util.isBuffer(body)) {
  18394. this.body = body.byteLength ? body : null
  18395. } else if (ArrayBuffer.isView(body)) {
  18396. this.body = body.buffer.byteLength ? Buffer.from(body.buffer, body.byteOffset, body.byteLength) : null
  18397. } else if (body instanceof ArrayBuffer) {
  18398. this.body = body.byteLength ? Buffer.from(body) : null
  18399. } else if (typeof body === 'string') {
  18400. this.body = body.length ? Buffer.from(body) : null
  18401. } else if (util.isFormDataLike(body) || util.isIterable(body) || util.isBlobLike(body)) {
  18402. this.body = body
  18403. } else {
  18404. throw new InvalidArgumentError('body must be a string, a Buffer, a Readable stream, an iterable, or an async iterable')
  18405. }
  18406. this.completed = false
  18407. this.aborted = false
  18408. this.upgrade = upgrade || null
  18409. this.path = query ? util.buildURL(path, query) : path
  18410. this.origin = origin
  18411. this.idempotent = idempotent == null
  18412. ? method === 'HEAD' || method === 'GET'
  18413. : idempotent
  18414. this.blocking = blocking == null ? false : blocking
  18415. this.reset = reset == null ? null : reset
  18416. this.host = null
  18417. this.contentLength = null
  18418. this.contentType = null
  18419. this.headers = ''
  18420. // Only for H2
  18421. this.expectContinue = expectContinue != null ? expectContinue : false
  18422. if (Array.isArray(headers)) {
  18423. if (headers.length % 2 !== 0) {
  18424. throw new InvalidArgumentError('headers array must be even')
  18425. }
  18426. for (let i = 0; i < headers.length; i += 2) {
  18427. processHeader(this, headers[i], headers[i + 1])
  18428. }
  18429. } else if (headers && typeof headers === 'object') {
  18430. const keys = Object.keys(headers)
  18431. for (let i = 0; i < keys.length; i++) {
  18432. const key = keys[i]
  18433. processHeader(this, key, headers[key])
  18434. }
  18435. } else if (headers != null) {
  18436. throw new InvalidArgumentError('headers must be an object or an array')
  18437. }
  18438. if (util.isFormDataLike(this.body)) {
  18439. if (util.nodeMajor < 16 || (util.nodeMajor === 16 && util.nodeMinor < 8)) {
  18440. throw new InvalidArgumentError('Form-Data bodies are only supported in node v16.8 and newer.')
  18441. }
  18442. if (!extractBody) {
  18443. extractBody = (__nccwpck_require__(9990).extractBody)
  18444. }
  18445. const [bodyStream, contentType] = extractBody(body)
  18446. if (this.contentType == null) {
  18447. this.contentType = contentType
  18448. this.headers += `content-type: ${contentType}\r\n`
  18449. }
  18450. this.body = bodyStream.stream
  18451. this.contentLength = bodyStream.length
  18452. } else if (util.isBlobLike(body) && this.contentType == null && body.type) {
  18453. this.contentType = body.type
  18454. this.headers += `content-type: ${body.type}\r\n`
  18455. }
  18456. util.validateHandler(handler, method, upgrade)
  18457. this.servername = util.getServerName(this.host)
  18458. this[kHandler] = handler
  18459. if (channels.create.hasSubscribers) {
  18460. channels.create.publish({ request: this })
  18461. }
  18462. }
  18463. onBodySent (chunk) {
  18464. if (this[kHandler].onBodySent) {
  18465. try {
  18466. return this[kHandler].onBodySent(chunk)
  18467. } catch (err) {
  18468. this.abort(err)
  18469. }
  18470. }
  18471. }
  18472. onRequestSent () {
  18473. if (channels.bodySent.hasSubscribers) {
  18474. channels.bodySent.publish({ request: this })
  18475. }
  18476. if (this[kHandler].onRequestSent) {
  18477. try {
  18478. return this[kHandler].onRequestSent()
  18479. } catch (err) {
  18480. this.abort(err)
  18481. }
  18482. }
  18483. }
  18484. onConnect (abort) {
  18485. assert(!this.aborted)
  18486. assert(!this.completed)
  18487. if (this.error) {
  18488. abort(this.error)
  18489. } else {
  18490. this.abort = abort
  18491. return this[kHandler].onConnect(abort)
  18492. }
  18493. }
  18494. onHeaders (statusCode, headers, resume, statusText) {
  18495. assert(!this.aborted)
  18496. assert(!this.completed)
  18497. if (channels.headers.hasSubscribers) {
  18498. channels.headers.publish({ request: this, response: { statusCode, headers, statusText } })
  18499. }
  18500. try {
  18501. return this[kHandler].onHeaders(statusCode, headers, resume, statusText)
  18502. } catch (err) {
  18503. this.abort(err)
  18504. }
  18505. }
  18506. onData (chunk) {
  18507. assert(!this.aborted)
  18508. assert(!this.completed)
  18509. try {
  18510. return this[kHandler].onData(chunk)
  18511. } catch (err) {
  18512. this.abort(err)
  18513. return false
  18514. }
  18515. }
  18516. onUpgrade (statusCode, headers, socket) {
  18517. assert(!this.aborted)
  18518. assert(!this.completed)
  18519. return this[kHandler].onUpgrade(statusCode, headers, socket)
  18520. }
  18521. onComplete (trailers) {
  18522. this.onFinally()
  18523. assert(!this.aborted)
  18524. this.completed = true
  18525. if (channels.trailers.hasSubscribers) {
  18526. channels.trailers.publish({ request: this, trailers })
  18527. }
  18528. try {
  18529. return this[kHandler].onComplete(trailers)
  18530. } catch (err) {
  18531. // TODO (fix): This might be a bad idea?
  18532. this.onError(err)
  18533. }
  18534. }
  18535. onError (error) {
  18536. this.onFinally()
  18537. if (channels.error.hasSubscribers) {
  18538. channels.error.publish({ request: this, error })
  18539. }
  18540. if (this.aborted) {
  18541. return
  18542. }
  18543. this.aborted = true
  18544. return this[kHandler].onError(error)
  18545. }
  18546. onFinally () {
  18547. if (this.errorHandler) {
  18548. this.body.off('error', this.errorHandler)
  18549. this.errorHandler = null
  18550. }
  18551. if (this.endHandler) {
  18552. this.body.off('end', this.endHandler)
  18553. this.endHandler = null
  18554. }
  18555. }
  18556. // TODO: adjust to support H2
  18557. addHeader (key, value) {
  18558. processHeader(this, key, value)
  18559. return this
  18560. }
  18561. static [kHTTP1BuildRequest] (origin, opts, handler) {
  18562. // TODO: Migrate header parsing here, to make Requests
  18563. // HTTP agnostic
  18564. return new Request(origin, opts, handler)
  18565. }
  18566. static [kHTTP2BuildRequest] (origin, opts, handler) {
  18567. const headers = opts.headers
  18568. opts = { ...opts, headers: null }
  18569. const request = new Request(origin, opts, handler)
  18570. request.headers = {}
  18571. if (Array.isArray(headers)) {
  18572. if (headers.length % 2 !== 0) {
  18573. throw new InvalidArgumentError('headers array must be even')
  18574. }
  18575. for (let i = 0; i < headers.length; i += 2) {
  18576. processHeader(request, headers[i], headers[i + 1], true)
  18577. }
  18578. } else if (headers && typeof headers === 'object') {
  18579. const keys = Object.keys(headers)
  18580. for (let i = 0; i < keys.length; i++) {
  18581. const key = keys[i]
  18582. processHeader(request, key, headers[key], true)
  18583. }
  18584. } else if (headers != null) {
  18585. throw new InvalidArgumentError('headers must be an object or an array')
  18586. }
  18587. return request
  18588. }
  18589. static [kHTTP2CopyHeaders] (raw) {
  18590. const rawHeaders = raw.split('\r\n')
  18591. const headers = {}
  18592. for (const header of rawHeaders) {
  18593. const [key, value] = header.split(': ')
  18594. if (value == null || value.length === 0) continue
  18595. if (headers[key]) headers[key] += `,${value}`
  18596. else headers[key] = value
  18597. }
  18598. return headers
  18599. }
  18600. }
  18601. function processHeaderValue (key, val, skipAppend) {
  18602. if (val && typeof val === 'object') {
  18603. throw new InvalidArgumentError(`invalid ${key} header`)
  18604. }
  18605. val = val != null ? `${val}` : ''
  18606. if (headerCharRegex.exec(val) !== null) {
  18607. throw new InvalidArgumentError(`invalid ${key} header`)
  18608. }
  18609. return skipAppend ? val : `${key}: ${val}\r\n`
  18610. }
  18611. function processHeader (request, key, val, skipAppend = false) {
  18612. if (val && (typeof val === 'object' && !Array.isArray(val))) {
  18613. throw new InvalidArgumentError(`invalid ${key} header`)
  18614. } else if (val === undefined) {
  18615. return
  18616. }
  18617. if (
  18618. request.host === null &&
  18619. key.length === 4 &&
  18620. key.toLowerCase() === 'host'
  18621. ) {
  18622. if (headerCharRegex.exec(val) !== null) {
  18623. throw new InvalidArgumentError(`invalid ${key} header`)
  18624. }
  18625. // Consumed by Client
  18626. request.host = val
  18627. } else if (
  18628. request.contentLength === null &&
  18629. key.length === 14 &&
  18630. key.toLowerCase() === 'content-length'
  18631. ) {
  18632. request.contentLength = parseInt(val, 10)
  18633. if (!Number.isFinite(request.contentLength)) {
  18634. throw new InvalidArgumentError('invalid content-length header')
  18635. }
  18636. } else if (
  18637. request.contentType === null &&
  18638. key.length === 12 &&
  18639. key.toLowerCase() === 'content-type'
  18640. ) {
  18641. request.contentType = val
  18642. if (skipAppend) request.headers[key] = processHeaderValue(key, val, skipAppend)
  18643. else request.headers += processHeaderValue(key, val)
  18644. } else if (
  18645. key.length === 17 &&
  18646. key.toLowerCase() === 'transfer-encoding'
  18647. ) {
  18648. throw new InvalidArgumentError('invalid transfer-encoding header')
  18649. } else if (
  18650. key.length === 10 &&
  18651. key.toLowerCase() === 'connection'
  18652. ) {
  18653. const value = typeof val === 'string' ? val.toLowerCase() : null
  18654. if (value !== 'close' && value !== 'keep-alive') {
  18655. throw new InvalidArgumentError('invalid connection header')
  18656. } else if (value === 'close') {
  18657. request.reset = true
  18658. }
  18659. } else if (
  18660. key.length === 10 &&
  18661. key.toLowerCase() === 'keep-alive'
  18662. ) {
  18663. throw new InvalidArgumentError('invalid keep-alive header')
  18664. } else if (
  18665. key.length === 7 &&
  18666. key.toLowerCase() === 'upgrade'
  18667. ) {
  18668. throw new InvalidArgumentError('invalid upgrade header')
  18669. } else if (
  18670. key.length === 6 &&
  18671. key.toLowerCase() === 'expect'
  18672. ) {
  18673. throw new NotSupportedError('expect header not supported')
  18674. } else if (tokenRegExp.exec(key) === null) {
  18675. throw new InvalidArgumentError('invalid header key')
  18676. } else {
  18677. if (Array.isArray(val)) {
  18678. for (let i = 0; i < val.length; i++) {
  18679. if (skipAppend) {
  18680. if (request.headers[key]) request.headers[key] += `,${processHeaderValue(key, val[i], skipAppend)}`
  18681. else request.headers[key] = processHeaderValue(key, val[i], skipAppend)
  18682. } else {
  18683. request.headers += processHeaderValue(key, val[i])
  18684. }
  18685. }
  18686. } else {
  18687. if (skipAppend) request.headers[key] = processHeaderValue(key, val, skipAppend)
  18688. else request.headers += processHeaderValue(key, val)
  18689. }
  18690. }
  18691. }
  18692. module.exports = Request
  18693. /***/ }),
  18694. /***/ 2785:
  18695. /***/ ((module) => {
  18696. module.exports = {
  18697. kClose: Symbol('close'),
  18698. kDestroy: Symbol('destroy'),
  18699. kDispatch: Symbol('dispatch'),
  18700. kUrl: Symbol('url'),
  18701. kWriting: Symbol('writing'),
  18702. kResuming: Symbol('resuming'),
  18703. kQueue: Symbol('queue'),
  18704. kConnect: Symbol('connect'),
  18705. kConnecting: Symbol('connecting'),
  18706. kHeadersList: Symbol('headers list'),
  18707. kKeepAliveDefaultTimeout: Symbol('default keep alive timeout'),
  18708. kKeepAliveMaxTimeout: Symbol('max keep alive timeout'),
  18709. kKeepAliveTimeoutThreshold: Symbol('keep alive timeout threshold'),
  18710. kKeepAliveTimeoutValue: Symbol('keep alive timeout'),
  18711. kKeepAlive: Symbol('keep alive'),
  18712. kHeadersTimeout: Symbol('headers timeout'),
  18713. kBodyTimeout: Symbol('body timeout'),
  18714. kServerName: Symbol('server name'),
  18715. kLocalAddress: Symbol('local address'),
  18716. kHost: Symbol('host'),
  18717. kNoRef: Symbol('no ref'),
  18718. kBodyUsed: Symbol('used'),
  18719. kRunning: Symbol('running'),
  18720. kBlocking: Symbol('blocking'),
  18721. kPending: Symbol('pending'),
  18722. kSize: Symbol('size'),
  18723. kBusy: Symbol('busy'),
  18724. kQueued: Symbol('queued'),
  18725. kFree: Symbol('free'),
  18726. kConnected: Symbol('connected'),
  18727. kClosed: Symbol('closed'),
  18728. kNeedDrain: Symbol('need drain'),
  18729. kReset: Symbol('reset'),
  18730. kDestroyed: Symbol.for('nodejs.stream.destroyed'),
  18731. kMaxHeadersSize: Symbol('max headers size'),
  18732. kRunningIdx: Symbol('running index'),
  18733. kPendingIdx: Symbol('pending index'),
  18734. kError: Symbol('error'),
  18735. kClients: Symbol('clients'),
  18736. kClient: Symbol('client'),
  18737. kParser: Symbol('parser'),
  18738. kOnDestroyed: Symbol('destroy callbacks'),
  18739. kPipelining: Symbol('pipelining'),
  18740. kSocket: Symbol('socket'),
  18741. kHostHeader: Symbol('host header'),
  18742. kConnector: Symbol('connector'),
  18743. kStrictContentLength: Symbol('strict content length'),
  18744. kMaxRedirections: Symbol('maxRedirections'),
  18745. kMaxRequests: Symbol('maxRequestsPerClient'),
  18746. kProxy: Symbol('proxy agent options'),
  18747. kCounter: Symbol('socket request counter'),
  18748. kInterceptors: Symbol('dispatch interceptors'),
  18749. kMaxResponseSize: Symbol('max response size'),
  18750. kHTTP2Session: Symbol('http2Session'),
  18751. kHTTP2SessionState: Symbol('http2Session state'),
  18752. kHTTP2BuildRequest: Symbol('http2 build request'),
  18753. kHTTP1BuildRequest: Symbol('http1 build request'),
  18754. kHTTP2CopyHeaders: Symbol('http2 copy headers'),
  18755. kHTTPConnVersion: Symbol('http connection version'),
  18756. kRetryHandlerDefaultRetry: Symbol('retry agent default retry'),
  18757. kConstruct: Symbol('constructable')
  18758. }
  18759. /***/ }),
  18760. /***/ 3983:
  18761. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  18762. "use strict";
  18763. const assert = __nccwpck_require__(9491)
  18764. const { kDestroyed, kBodyUsed } = __nccwpck_require__(2785)
  18765. const { IncomingMessage } = __nccwpck_require__(3685)
  18766. const stream = __nccwpck_require__(2781)
  18767. const net = __nccwpck_require__(1808)
  18768. const { InvalidArgumentError } = __nccwpck_require__(8045)
  18769. const { Blob } = __nccwpck_require__(4300)
  18770. const nodeUtil = __nccwpck_require__(3837)
  18771. const { stringify } = __nccwpck_require__(3477)
  18772. const { headerNameLowerCasedRecord } = __nccwpck_require__(4462)
  18773. const [nodeMajor, nodeMinor] = process.versions.node.split('.').map(v => Number(v))
  18774. function nop () {}
  18775. function isStream (obj) {
  18776. return obj && typeof obj === 'object' && typeof obj.pipe === 'function' && typeof obj.on === 'function'
  18777. }
  18778. // based on https://github.com/node-fetch/fetch-blob/blob/8ab587d34080de94140b54f07168451e7d0b655e/index.js#L229-L241 (MIT License)
  18779. function isBlobLike (object) {
  18780. return (Blob && object instanceof Blob) || (
  18781. object &&
  18782. typeof object === 'object' &&
  18783. (typeof object.stream === 'function' ||
  18784. typeof object.arrayBuffer === 'function') &&
  18785. /^(Blob|File)$/.test(object[Symbol.toStringTag])
  18786. )
  18787. }
  18788. function buildURL (url, queryParams) {
  18789. if (url.includes('?') || url.includes('#')) {
  18790. throw new Error('Query params cannot be passed when url already contains "?" or "#".')
  18791. }
  18792. const stringified = stringify(queryParams)
  18793. if (stringified) {
  18794. url += '?' + stringified
  18795. }
  18796. return url
  18797. }
  18798. function parseURL (url) {
  18799. if (typeof url === 'string') {
  18800. url = new URL(url)
  18801. if (!/^https?:/.test(url.origin || url.protocol)) {
  18802. throw new InvalidArgumentError('Invalid URL protocol: the URL must start with `http:` or `https:`.')
  18803. }
  18804. return url
  18805. }
  18806. if (!url || typeof url !== 'object') {
  18807. throw new InvalidArgumentError('Invalid URL: The URL argument must be a non-null object.')
  18808. }
  18809. if (!/^https?:/.test(url.origin || url.protocol)) {
  18810. throw new InvalidArgumentError('Invalid URL protocol: the URL must start with `http:` or `https:`.')
  18811. }
  18812. if (!(url instanceof URL)) {
  18813. if (url.port != null && url.port !== '' && !Number.isFinite(parseInt(url.port))) {
  18814. throw new InvalidArgumentError('Invalid URL: port must be a valid integer or a string representation of an integer.')
  18815. }
  18816. if (url.path != null && typeof url.path !== 'string') {
  18817. throw new InvalidArgumentError('Invalid URL path: the path must be a string or null/undefined.')
  18818. }
  18819. if (url.pathname != null && typeof url.pathname !== 'string') {
  18820. throw new InvalidArgumentError('Invalid URL pathname: the pathname must be a string or null/undefined.')
  18821. }
  18822. if (url.hostname != null && typeof url.hostname !== 'string') {
  18823. throw new InvalidArgumentError('Invalid URL hostname: the hostname must be a string or null/undefined.')
  18824. }
  18825. if (url.origin != null && typeof url.origin !== 'string') {
  18826. throw new InvalidArgumentError('Invalid URL origin: the origin must be a string or null/undefined.')
  18827. }
  18828. const port = url.port != null
  18829. ? url.port
  18830. : (url.protocol === 'https:' ? 443 : 80)
  18831. let origin = url.origin != null
  18832. ? url.origin
  18833. : `${url.protocol}//${url.hostname}:${port}`
  18834. let path = url.path != null
  18835. ? url.path
  18836. : `${url.pathname || ''}${url.search || ''}`
  18837. if (origin.endsWith('/')) {
  18838. origin = origin.substring(0, origin.length - 1)
  18839. }
  18840. if (path && !path.startsWith('/')) {
  18841. path = `/${path}`
  18842. }
  18843. // new URL(path, origin) is unsafe when `path` contains an absolute URL
  18844. // From https://developer.mozilla.org/en-US/docs/Web/API/URL/URL:
  18845. // If first parameter is a relative URL, second param is required, and will be used as the base URL.
  18846. // If first parameter is an absolute URL, a given second param will be ignored.
  18847. url = new URL(origin + path)
  18848. }
  18849. return url
  18850. }
  18851. function parseOrigin (url) {
  18852. url = parseURL(url)
  18853. if (url.pathname !== '/' || url.search || url.hash) {
  18854. throw new InvalidArgumentError('invalid url')
  18855. }
  18856. return url
  18857. }
  18858. function getHostname (host) {
  18859. if (host[0] === '[') {
  18860. const idx = host.indexOf(']')
  18861. assert(idx !== -1)
  18862. return host.substring(1, idx)
  18863. }
  18864. const idx = host.indexOf(':')
  18865. if (idx === -1) return host
  18866. return host.substring(0, idx)
  18867. }
  18868. // IP addresses are not valid server names per RFC6066
  18869. // > Currently, the only server names supported are DNS hostnames
  18870. function getServerName (host) {
  18871. if (!host) {
  18872. return null
  18873. }
  18874. assert.strictEqual(typeof host, 'string')
  18875. const servername = getHostname(host)
  18876. if (net.isIP(servername)) {
  18877. return ''
  18878. }
  18879. return servername
  18880. }
  18881. function deepClone (obj) {
  18882. return JSON.parse(JSON.stringify(obj))
  18883. }
  18884. function isAsyncIterable (obj) {
  18885. return !!(obj != null && typeof obj[Symbol.asyncIterator] === 'function')
  18886. }
  18887. function isIterable (obj) {
  18888. return !!(obj != null && (typeof obj[Symbol.iterator] === 'function' || typeof obj[Symbol.asyncIterator] === 'function'))
  18889. }
  18890. function bodyLength (body) {
  18891. if (body == null) {
  18892. return 0
  18893. } else if (isStream(body)) {
  18894. const state = body._readableState
  18895. return state && state.objectMode === false && state.ended === true && Number.isFinite(state.length)
  18896. ? state.length
  18897. : null
  18898. } else if (isBlobLike(body)) {
  18899. return body.size != null ? body.size : null
  18900. } else if (isBuffer(body)) {
  18901. return body.byteLength
  18902. }
  18903. return null
  18904. }
  18905. function isDestroyed (stream) {
  18906. return !stream || !!(stream.destroyed || stream[kDestroyed])
  18907. }
  18908. function isReadableAborted (stream) {
  18909. const state = stream && stream._readableState
  18910. return isDestroyed(stream) && state && !state.endEmitted
  18911. }
  18912. function destroy (stream, err) {
  18913. if (stream == null || !isStream(stream) || isDestroyed(stream)) {
  18914. return
  18915. }
  18916. if (typeof stream.destroy === 'function') {
  18917. if (Object.getPrototypeOf(stream).constructor === IncomingMessage) {
  18918. // See: https://github.com/nodejs/node/pull/38505/files
  18919. stream.socket = null
  18920. }
  18921. stream.destroy(err)
  18922. } else if (err) {
  18923. process.nextTick((stream, err) => {
  18924. stream.emit('error', err)
  18925. }, stream, err)
  18926. }
  18927. if (stream.destroyed !== true) {
  18928. stream[kDestroyed] = true
  18929. }
  18930. }
  18931. const KEEPALIVE_TIMEOUT_EXPR = /timeout=(\d+)/
  18932. function parseKeepAliveTimeout (val) {
  18933. const m = val.toString().match(KEEPALIVE_TIMEOUT_EXPR)
  18934. return m ? parseInt(m[1], 10) * 1000 : null
  18935. }
  18936. /**
  18937. * Retrieves a header name and returns its lowercase value.
  18938. * @param {string | Buffer} value Header name
  18939. * @returns {string}
  18940. */
  18941. function headerNameToString (value) {
  18942. return headerNameLowerCasedRecord[value] || value.toLowerCase()
  18943. }
  18944. function parseHeaders (headers, obj = {}) {
  18945. // For H2 support
  18946. if (!Array.isArray(headers)) return headers
  18947. for (let i = 0; i < headers.length; i += 2) {
  18948. const key = headers[i].toString().toLowerCase()
  18949. let val = obj[key]
  18950. if (!val) {
  18951. if (Array.isArray(headers[i + 1])) {
  18952. obj[key] = headers[i + 1].map(x => x.toString('utf8'))
  18953. } else {
  18954. obj[key] = headers[i + 1].toString('utf8')
  18955. }
  18956. } else {
  18957. if (!Array.isArray(val)) {
  18958. val = [val]
  18959. obj[key] = val
  18960. }
  18961. val.push(headers[i + 1].toString('utf8'))
  18962. }
  18963. }
  18964. // See https://github.com/nodejs/node/pull/46528
  18965. if ('content-length' in obj && 'content-disposition' in obj) {
  18966. obj['content-disposition'] = Buffer.from(obj['content-disposition']).toString('latin1')
  18967. }
  18968. return obj
  18969. }
  18970. function parseRawHeaders (headers) {
  18971. const ret = []
  18972. let hasContentLength = false
  18973. let contentDispositionIdx = -1
  18974. for (let n = 0; n < headers.length; n += 2) {
  18975. const key = headers[n + 0].toString()
  18976. const val = headers[n + 1].toString('utf8')
  18977. if (key.length === 14 && (key === 'content-length' || key.toLowerCase() === 'content-length')) {
  18978. ret.push(key, val)
  18979. hasContentLength = true
  18980. } else if (key.length === 19 && (key === 'content-disposition' || key.toLowerCase() === 'content-disposition')) {
  18981. contentDispositionIdx = ret.push(key, val) - 1
  18982. } else {
  18983. ret.push(key, val)
  18984. }
  18985. }
  18986. // See https://github.com/nodejs/node/pull/46528
  18987. if (hasContentLength && contentDispositionIdx !== -1) {
  18988. ret[contentDispositionIdx] = Buffer.from(ret[contentDispositionIdx]).toString('latin1')
  18989. }
  18990. return ret
  18991. }
  18992. function isBuffer (buffer) {
  18993. // See, https://github.com/mcollina/undici/pull/319
  18994. return buffer instanceof Uint8Array || Buffer.isBuffer(buffer)
  18995. }
  18996. function validateHandler (handler, method, upgrade) {
  18997. if (!handler || typeof handler !== 'object') {
  18998. throw new InvalidArgumentError('handler must be an object')
  18999. }
  19000. if (typeof handler.onConnect !== 'function') {
  19001. throw new InvalidArgumentError('invalid onConnect method')
  19002. }
  19003. if (typeof handler.onError !== 'function') {
  19004. throw new InvalidArgumentError('invalid onError method')
  19005. }
  19006. if (typeof handler.onBodySent !== 'function' && handler.onBodySent !== undefined) {
  19007. throw new InvalidArgumentError('invalid onBodySent method')
  19008. }
  19009. if (upgrade || method === 'CONNECT') {
  19010. if (typeof handler.onUpgrade !== 'function') {
  19011. throw new InvalidArgumentError('invalid onUpgrade method')
  19012. }
  19013. } else {
  19014. if (typeof handler.onHeaders !== 'function') {
  19015. throw new InvalidArgumentError('invalid onHeaders method')
  19016. }
  19017. if (typeof handler.onData !== 'function') {
  19018. throw new InvalidArgumentError('invalid onData method')
  19019. }
  19020. if (typeof handler.onComplete !== 'function') {
  19021. throw new InvalidArgumentError('invalid onComplete method')
  19022. }
  19023. }
  19024. }
  19025. // A body is disturbed if it has been read from and it cannot
  19026. // be re-used without losing state or data.
  19027. function isDisturbed (body) {
  19028. return !!(body && (
  19029. stream.isDisturbed
  19030. ? stream.isDisturbed(body) || body[kBodyUsed] // TODO (fix): Why is body[kBodyUsed] needed?
  19031. : body[kBodyUsed] ||
  19032. body.readableDidRead ||
  19033. (body._readableState && body._readableState.dataEmitted) ||
  19034. isReadableAborted(body)
  19035. ))
  19036. }
  19037. function isErrored (body) {
  19038. return !!(body && (
  19039. stream.isErrored
  19040. ? stream.isErrored(body)
  19041. : /state: 'errored'/.test(nodeUtil.inspect(body)
  19042. )))
  19043. }
  19044. function isReadable (body) {
  19045. return !!(body && (
  19046. stream.isReadable
  19047. ? stream.isReadable(body)
  19048. : /state: 'readable'/.test(nodeUtil.inspect(body)
  19049. )))
  19050. }
  19051. function getSocketInfo (socket) {
  19052. return {
  19053. localAddress: socket.localAddress,
  19054. localPort: socket.localPort,
  19055. remoteAddress: socket.remoteAddress,
  19056. remotePort: socket.remotePort,
  19057. remoteFamily: socket.remoteFamily,
  19058. timeout: socket.timeout,
  19059. bytesWritten: socket.bytesWritten,
  19060. bytesRead: socket.bytesRead
  19061. }
  19062. }
  19063. async function * convertIterableToBuffer (iterable) {
  19064. for await (const chunk of iterable) {
  19065. yield Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk)
  19066. }
  19067. }
  19068. let ReadableStream
  19069. function ReadableStreamFrom (iterable) {
  19070. if (!ReadableStream) {
  19071. ReadableStream = (__nccwpck_require__(5356).ReadableStream)
  19072. }
  19073. if (ReadableStream.from) {
  19074. return ReadableStream.from(convertIterableToBuffer(iterable))
  19075. }
  19076. let iterator
  19077. return new ReadableStream(
  19078. {
  19079. async start () {
  19080. iterator = iterable[Symbol.asyncIterator]()
  19081. },
  19082. async pull (controller) {
  19083. const { done, value } = await iterator.next()
  19084. if (done) {
  19085. queueMicrotask(() => {
  19086. controller.close()
  19087. })
  19088. } else {
  19089. const buf = Buffer.isBuffer(value) ? value : Buffer.from(value)
  19090. controller.enqueue(new Uint8Array(buf))
  19091. }
  19092. return controller.desiredSize > 0
  19093. },
  19094. async cancel (reason) {
  19095. await iterator.return()
  19096. }
  19097. },
  19098. 0
  19099. )
  19100. }
  19101. // The chunk should be a FormData instance and contains
  19102. // all the required methods.
  19103. function isFormDataLike (object) {
  19104. return (
  19105. object &&
  19106. typeof object === 'object' &&
  19107. typeof object.append === 'function' &&
  19108. typeof object.delete === 'function' &&
  19109. typeof object.get === 'function' &&
  19110. typeof object.getAll === 'function' &&
  19111. typeof object.has === 'function' &&
  19112. typeof object.set === 'function' &&
  19113. object[Symbol.toStringTag] === 'FormData'
  19114. )
  19115. }
  19116. function throwIfAborted (signal) {
  19117. if (!signal) { return }
  19118. if (typeof signal.throwIfAborted === 'function') {
  19119. signal.throwIfAborted()
  19120. } else {
  19121. if (signal.aborted) {
  19122. // DOMException not available < v17.0.0
  19123. const err = new Error('The operation was aborted')
  19124. err.name = 'AbortError'
  19125. throw err
  19126. }
  19127. }
  19128. }
  19129. function addAbortListener (signal, listener) {
  19130. if ('addEventListener' in signal) {
  19131. signal.addEventListener('abort', listener, { once: true })
  19132. return () => signal.removeEventListener('abort', listener)
  19133. }
  19134. signal.addListener('abort', listener)
  19135. return () => signal.removeListener('abort', listener)
  19136. }
  19137. const hasToWellFormed = !!String.prototype.toWellFormed
  19138. /**
  19139. * @param {string} val
  19140. */
  19141. function toUSVString (val) {
  19142. if (hasToWellFormed) {
  19143. return `${val}`.toWellFormed()
  19144. } else if (nodeUtil.toUSVString) {
  19145. return nodeUtil.toUSVString(val)
  19146. }
  19147. return `${val}`
  19148. }
  19149. // Parsed accordingly to RFC 9110
  19150. // https://www.rfc-editor.org/rfc/rfc9110#field.content-range
  19151. function parseRangeHeader (range) {
  19152. if (range == null || range === '') return { start: 0, end: null, size: null }
  19153. const m = range ? range.match(/^bytes (\d+)-(\d+)\/(\d+)?$/) : null
  19154. return m
  19155. ? {
  19156. start: parseInt(m[1]),
  19157. end: m[2] ? parseInt(m[2]) : null,
  19158. size: m[3] ? parseInt(m[3]) : null
  19159. }
  19160. : null
  19161. }
  19162. const kEnumerableProperty = Object.create(null)
  19163. kEnumerableProperty.enumerable = true
  19164. module.exports = {
  19165. kEnumerableProperty,
  19166. nop,
  19167. isDisturbed,
  19168. isErrored,
  19169. isReadable,
  19170. toUSVString,
  19171. isReadableAborted,
  19172. isBlobLike,
  19173. parseOrigin,
  19174. parseURL,
  19175. getServerName,
  19176. isStream,
  19177. isIterable,
  19178. isAsyncIterable,
  19179. isDestroyed,
  19180. headerNameToString,
  19181. parseRawHeaders,
  19182. parseHeaders,
  19183. parseKeepAliveTimeout,
  19184. destroy,
  19185. bodyLength,
  19186. deepClone,
  19187. ReadableStreamFrom,
  19188. isBuffer,
  19189. validateHandler,
  19190. getSocketInfo,
  19191. isFormDataLike,
  19192. buildURL,
  19193. throwIfAborted,
  19194. addAbortListener,
  19195. parseRangeHeader,
  19196. nodeMajor,
  19197. nodeMinor,
  19198. nodeHasAutoSelectFamily: nodeMajor > 18 || (nodeMajor === 18 && nodeMinor >= 13),
  19199. safeHTTPMethods: ['GET', 'HEAD', 'OPTIONS', 'TRACE']
  19200. }
  19201. /***/ }),
  19202. /***/ 4839:
  19203. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  19204. "use strict";
  19205. const Dispatcher = __nccwpck_require__(412)
  19206. const {
  19207. ClientDestroyedError,
  19208. ClientClosedError,
  19209. InvalidArgumentError
  19210. } = __nccwpck_require__(8045)
  19211. const { kDestroy, kClose, kDispatch, kInterceptors } = __nccwpck_require__(2785)
  19212. const kDestroyed = Symbol('destroyed')
  19213. const kClosed = Symbol('closed')
  19214. const kOnDestroyed = Symbol('onDestroyed')
  19215. const kOnClosed = Symbol('onClosed')
  19216. const kInterceptedDispatch = Symbol('Intercepted Dispatch')
  19217. class DispatcherBase extends Dispatcher {
  19218. constructor () {
  19219. super()
  19220. this[kDestroyed] = false
  19221. this[kOnDestroyed] = null
  19222. this[kClosed] = false
  19223. this[kOnClosed] = []
  19224. }
  19225. get destroyed () {
  19226. return this[kDestroyed]
  19227. }
  19228. get closed () {
  19229. return this[kClosed]
  19230. }
  19231. get interceptors () {
  19232. return this[kInterceptors]
  19233. }
  19234. set interceptors (newInterceptors) {
  19235. if (newInterceptors) {
  19236. for (let i = newInterceptors.length - 1; i >= 0; i--) {
  19237. const interceptor = this[kInterceptors][i]
  19238. if (typeof interceptor !== 'function') {
  19239. throw new InvalidArgumentError('interceptor must be an function')
  19240. }
  19241. }
  19242. }
  19243. this[kInterceptors] = newInterceptors
  19244. }
  19245. close (callback) {
  19246. if (callback === undefined) {
  19247. return new Promise((resolve, reject) => {
  19248. this.close((err, data) => {
  19249. return err ? reject(err) : resolve(data)
  19250. })
  19251. })
  19252. }
  19253. if (typeof callback !== 'function') {
  19254. throw new InvalidArgumentError('invalid callback')
  19255. }
  19256. if (this[kDestroyed]) {
  19257. queueMicrotask(() => callback(new ClientDestroyedError(), null))
  19258. return
  19259. }
  19260. if (this[kClosed]) {
  19261. if (this[kOnClosed]) {
  19262. this[kOnClosed].push(callback)
  19263. } else {
  19264. queueMicrotask(() => callback(null, null))
  19265. }
  19266. return
  19267. }
  19268. this[kClosed] = true
  19269. this[kOnClosed].push(callback)
  19270. const onClosed = () => {
  19271. const callbacks = this[kOnClosed]
  19272. this[kOnClosed] = null
  19273. for (let i = 0; i < callbacks.length; i++) {
  19274. callbacks[i](null, null)
  19275. }
  19276. }
  19277. // Should not error.
  19278. this[kClose]()
  19279. .then(() => this.destroy())
  19280. .then(() => {
  19281. queueMicrotask(onClosed)
  19282. })
  19283. }
  19284. destroy (err, callback) {
  19285. if (typeof err === 'function') {
  19286. callback = err
  19287. err = null
  19288. }
  19289. if (callback === undefined) {
  19290. return new Promise((resolve, reject) => {
  19291. this.destroy(err, (err, data) => {
  19292. return err ? /* istanbul ignore next: should never error */ reject(err) : resolve(data)
  19293. })
  19294. })
  19295. }
  19296. if (typeof callback !== 'function') {
  19297. throw new InvalidArgumentError('invalid callback')
  19298. }
  19299. if (this[kDestroyed]) {
  19300. if (this[kOnDestroyed]) {
  19301. this[kOnDestroyed].push(callback)
  19302. } else {
  19303. queueMicrotask(() => callback(null, null))
  19304. }
  19305. return
  19306. }
  19307. if (!err) {
  19308. err = new ClientDestroyedError()
  19309. }
  19310. this[kDestroyed] = true
  19311. this[kOnDestroyed] = this[kOnDestroyed] || []
  19312. this[kOnDestroyed].push(callback)
  19313. const onDestroyed = () => {
  19314. const callbacks = this[kOnDestroyed]
  19315. this[kOnDestroyed] = null
  19316. for (let i = 0; i < callbacks.length; i++) {
  19317. callbacks[i](null, null)
  19318. }
  19319. }
  19320. // Should not error.
  19321. this[kDestroy](err).then(() => {
  19322. queueMicrotask(onDestroyed)
  19323. })
  19324. }
  19325. [kInterceptedDispatch] (opts, handler) {
  19326. if (!this[kInterceptors] || this[kInterceptors].length === 0) {
  19327. this[kInterceptedDispatch] = this[kDispatch]
  19328. return this[kDispatch](opts, handler)
  19329. }
  19330. let dispatch = this[kDispatch].bind(this)
  19331. for (let i = this[kInterceptors].length - 1; i >= 0; i--) {
  19332. dispatch = this[kInterceptors][i](dispatch)
  19333. }
  19334. this[kInterceptedDispatch] = dispatch
  19335. return dispatch(opts, handler)
  19336. }
  19337. dispatch (opts, handler) {
  19338. if (!handler || typeof handler !== 'object') {
  19339. throw new InvalidArgumentError('handler must be an object')
  19340. }
  19341. try {
  19342. if (!opts || typeof opts !== 'object') {
  19343. throw new InvalidArgumentError('opts must be an object.')
  19344. }
  19345. if (this[kDestroyed] || this[kOnDestroyed]) {
  19346. throw new ClientDestroyedError()
  19347. }
  19348. if (this[kClosed]) {
  19349. throw new ClientClosedError()
  19350. }
  19351. return this[kInterceptedDispatch](opts, handler)
  19352. } catch (err) {
  19353. if (typeof handler.onError !== 'function') {
  19354. throw new InvalidArgumentError('invalid onError method')
  19355. }
  19356. handler.onError(err)
  19357. return false
  19358. }
  19359. }
  19360. }
  19361. module.exports = DispatcherBase
  19362. /***/ }),
  19363. /***/ 412:
  19364. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  19365. "use strict";
  19366. const EventEmitter = __nccwpck_require__(2361)
  19367. class Dispatcher extends EventEmitter {
  19368. dispatch () {
  19369. throw new Error('not implemented')
  19370. }
  19371. close () {
  19372. throw new Error('not implemented')
  19373. }
  19374. destroy () {
  19375. throw new Error('not implemented')
  19376. }
  19377. }
  19378. module.exports = Dispatcher
  19379. /***/ }),
  19380. /***/ 9990:
  19381. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  19382. "use strict";
  19383. const Busboy = __nccwpck_require__(727)
  19384. const util = __nccwpck_require__(3983)
  19385. const {
  19386. ReadableStreamFrom,
  19387. isBlobLike,
  19388. isReadableStreamLike,
  19389. readableStreamClose,
  19390. createDeferredPromise,
  19391. fullyReadBody
  19392. } = __nccwpck_require__(2538)
  19393. const { FormData } = __nccwpck_require__(2015)
  19394. const { kState } = __nccwpck_require__(5861)
  19395. const { webidl } = __nccwpck_require__(1744)
  19396. const { DOMException, structuredClone } = __nccwpck_require__(1037)
  19397. const { Blob, File: NativeFile } = __nccwpck_require__(4300)
  19398. const { kBodyUsed } = __nccwpck_require__(2785)
  19399. const assert = __nccwpck_require__(9491)
  19400. const { isErrored } = __nccwpck_require__(3983)
  19401. const { isUint8Array, isArrayBuffer } = __nccwpck_require__(9830)
  19402. const { File: UndiciFile } = __nccwpck_require__(8511)
  19403. const { parseMIMEType, serializeAMimeType } = __nccwpck_require__(685)
  19404. let random
  19405. try {
  19406. const crypto = __nccwpck_require__(6005)
  19407. random = (max) => crypto.randomInt(0, max)
  19408. } catch {
  19409. random = (max) => Math.floor(Math.random(max))
  19410. }
  19411. let ReadableStream = globalThis.ReadableStream
  19412. /** @type {globalThis['File']} */
  19413. const File = NativeFile ?? UndiciFile
  19414. const textEncoder = new TextEncoder()
  19415. const textDecoder = new TextDecoder()
  19416. // https://fetch.spec.whatwg.org/#concept-bodyinit-extract
  19417. function extractBody (object, keepalive = false) {
  19418. if (!ReadableStream) {
  19419. ReadableStream = (__nccwpck_require__(5356).ReadableStream)
  19420. }
  19421. // 1. Let stream be null.
  19422. let stream = null
  19423. // 2. If object is a ReadableStream object, then set stream to object.
  19424. if (object instanceof ReadableStream) {
  19425. stream = object
  19426. } else if (isBlobLike(object)) {
  19427. // 3. Otherwise, if object is a Blob object, set stream to the
  19428. // result of running object’s get stream.
  19429. stream = object.stream()
  19430. } else {
  19431. // 4. Otherwise, set stream to a new ReadableStream object, and set
  19432. // up stream.
  19433. stream = new ReadableStream({
  19434. async pull (controller) {
  19435. controller.enqueue(
  19436. typeof source === 'string' ? textEncoder.encode(source) : source
  19437. )
  19438. queueMicrotask(() => readableStreamClose(controller))
  19439. },
  19440. start () {},
  19441. type: undefined
  19442. })
  19443. }
  19444. // 5. Assert: stream is a ReadableStream object.
  19445. assert(isReadableStreamLike(stream))
  19446. // 6. Let action be null.
  19447. let action = null
  19448. // 7. Let source be null.
  19449. let source = null
  19450. // 8. Let length be null.
  19451. let length = null
  19452. // 9. Let type be null.
  19453. let type = null
  19454. // 10. Switch on object:
  19455. if (typeof object === 'string') {
  19456. // Set source to the UTF-8 encoding of object.
  19457. // Note: setting source to a Uint8Array here breaks some mocking assumptions.
  19458. source = object
  19459. // Set type to `text/plain;charset=UTF-8`.
  19460. type = 'text/plain;charset=UTF-8'
  19461. } else if (object instanceof URLSearchParams) {
  19462. // URLSearchParams
  19463. // spec says to run application/x-www-form-urlencoded on body.list
  19464. // this is implemented in Node.js as apart of an URLSearchParams instance toString method
  19465. // See: https://github.com/nodejs/node/blob/e46c680bf2b211bbd52cf959ca17ee98c7f657f5/lib/internal/url.js#L490
  19466. // and https://github.com/nodejs/node/blob/e46c680bf2b211bbd52cf959ca17ee98c7f657f5/lib/internal/url.js#L1100
  19467. // Set source to the result of running the application/x-www-form-urlencoded serializer with object’s list.
  19468. source = object.toString()
  19469. // Set type to `application/x-www-form-urlencoded;charset=UTF-8`.
  19470. type = 'application/x-www-form-urlencoded;charset=UTF-8'
  19471. } else if (isArrayBuffer(object)) {
  19472. // BufferSource/ArrayBuffer
  19473. // Set source to a copy of the bytes held by object.
  19474. source = new Uint8Array(object.slice())
  19475. } else if (ArrayBuffer.isView(object)) {
  19476. // BufferSource/ArrayBufferView
  19477. // Set source to a copy of the bytes held by object.
  19478. source = new Uint8Array(object.buffer.slice(object.byteOffset, object.byteOffset + object.byteLength))
  19479. } else if (util.isFormDataLike(object)) {
  19480. const boundary = `----formdata-undici-0${`${random(1e11)}`.padStart(11, '0')}`
  19481. const prefix = `--${boundary}\r\nContent-Disposition: form-data`
  19482. /*! formdata-polyfill. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> */
  19483. const escape = (str) =>
  19484. str.replace(/\n/g, '%0A').replace(/\r/g, '%0D').replace(/"/g, '%22')
  19485. const normalizeLinefeeds = (value) => value.replace(/\r?\n|\r/g, '\r\n')
  19486. // Set action to this step: run the multipart/form-data
  19487. // encoding algorithm, with object’s entry list and UTF-8.
  19488. // - This ensures that the body is immutable and can't be changed afterwords
  19489. // - That the content-length is calculated in advance.
  19490. // - And that all parts are pre-encoded and ready to be sent.
  19491. const blobParts = []
  19492. const rn = new Uint8Array([13, 10]) // '\r\n'
  19493. length = 0
  19494. let hasUnknownSizeValue = false
  19495. for (const [name, value] of object) {
  19496. if (typeof value === 'string') {
  19497. const chunk = textEncoder.encode(prefix +
  19498. `; name="${escape(normalizeLinefeeds(name))}"` +
  19499. `\r\n\r\n${normalizeLinefeeds(value)}\r\n`)
  19500. blobParts.push(chunk)
  19501. length += chunk.byteLength
  19502. } else {
  19503. const chunk = textEncoder.encode(`${prefix}; name="${escape(normalizeLinefeeds(name))}"` +
  19504. (value.name ? `; filename="${escape(value.name)}"` : '') + '\r\n' +
  19505. `Content-Type: ${
  19506. value.type || 'application/octet-stream'
  19507. }\r\n\r\n`)
  19508. blobParts.push(chunk, value, rn)
  19509. if (typeof value.size === 'number') {
  19510. length += chunk.byteLength + value.size + rn.byteLength
  19511. } else {
  19512. hasUnknownSizeValue = true
  19513. }
  19514. }
  19515. }
  19516. const chunk = textEncoder.encode(`--${boundary}--`)
  19517. blobParts.push(chunk)
  19518. length += chunk.byteLength
  19519. if (hasUnknownSizeValue) {
  19520. length = null
  19521. }
  19522. // Set source to object.
  19523. source = object
  19524. action = async function * () {
  19525. for (const part of blobParts) {
  19526. if (part.stream) {
  19527. yield * part.stream()
  19528. } else {
  19529. yield part
  19530. }
  19531. }
  19532. }
  19533. // Set type to `multipart/form-data; boundary=`,
  19534. // followed by the multipart/form-data boundary string generated
  19535. // by the multipart/form-data encoding algorithm.
  19536. type = 'multipart/form-data; boundary=' + boundary
  19537. } else if (isBlobLike(object)) {
  19538. // Blob
  19539. // Set source to object.
  19540. source = object
  19541. // Set length to object’s size.
  19542. length = object.size
  19543. // If object’s type attribute is not the empty byte sequence, set
  19544. // type to its value.
  19545. if (object.type) {
  19546. type = object.type
  19547. }
  19548. } else if (typeof object[Symbol.asyncIterator] === 'function') {
  19549. // If keepalive is true, then throw a TypeError.
  19550. if (keepalive) {
  19551. throw new TypeError('keepalive')
  19552. }
  19553. // If object is disturbed or locked, then throw a TypeError.
  19554. if (util.isDisturbed(object) || object.locked) {
  19555. throw new TypeError(
  19556. 'Response body object should not be disturbed or locked'
  19557. )
  19558. }
  19559. stream =
  19560. object instanceof ReadableStream ? object : ReadableStreamFrom(object)
  19561. }
  19562. // 11. If source is a byte sequence, then set action to a
  19563. // step that returns source and length to source’s length.
  19564. if (typeof source === 'string' || util.isBuffer(source)) {
  19565. length = Buffer.byteLength(source)
  19566. }
  19567. // 12. If action is non-null, then run these steps in in parallel:
  19568. if (action != null) {
  19569. // Run action.
  19570. let iterator
  19571. stream = new ReadableStream({
  19572. async start () {
  19573. iterator = action(object)[Symbol.asyncIterator]()
  19574. },
  19575. async pull (controller) {
  19576. const { value, done } = await iterator.next()
  19577. if (done) {
  19578. // When running action is done, close stream.
  19579. queueMicrotask(() => {
  19580. controller.close()
  19581. })
  19582. } else {
  19583. // Whenever one or more bytes are available and stream is not errored,
  19584. // enqueue a Uint8Array wrapping an ArrayBuffer containing the available
  19585. // bytes into stream.
  19586. if (!isErrored(stream)) {
  19587. controller.enqueue(new Uint8Array(value))
  19588. }
  19589. }
  19590. return controller.desiredSize > 0
  19591. },
  19592. async cancel (reason) {
  19593. await iterator.return()
  19594. },
  19595. type: undefined
  19596. })
  19597. }
  19598. // 13. Let body be a body whose stream is stream, source is source,
  19599. // and length is length.
  19600. const body = { stream, source, length }
  19601. // 14. Return (body, type).
  19602. return [body, type]
  19603. }
  19604. // https://fetch.spec.whatwg.org/#bodyinit-safely-extract
  19605. function safelyExtractBody (object, keepalive = false) {
  19606. if (!ReadableStream) {
  19607. // istanbul ignore next
  19608. ReadableStream = (__nccwpck_require__(5356).ReadableStream)
  19609. }
  19610. // To safely extract a body and a `Content-Type` value from
  19611. // a byte sequence or BodyInit object object, run these steps:
  19612. // 1. If object is a ReadableStream object, then:
  19613. if (object instanceof ReadableStream) {
  19614. // Assert: object is neither disturbed nor locked.
  19615. // istanbul ignore next
  19616. assert(!util.isDisturbed(object), 'The body has already been consumed.')
  19617. // istanbul ignore next
  19618. assert(!object.locked, 'The stream is locked.')
  19619. }
  19620. // 2. Return the results of extracting object.
  19621. return extractBody(object, keepalive)
  19622. }
  19623. function cloneBody (body) {
  19624. // To clone a body body, run these steps:
  19625. // https://fetch.spec.whatwg.org/#concept-body-clone
  19626. // 1. Let « out1, out2 » be the result of teeing body’s stream.
  19627. const [out1, out2] = body.stream.tee()
  19628. const out2Clone = structuredClone(out2, { transfer: [out2] })
  19629. // This, for whatever reasons, unrefs out2Clone which allows
  19630. // the process to exit by itself.
  19631. const [, finalClone] = out2Clone.tee()
  19632. // 2. Set body’s stream to out1.
  19633. body.stream = out1
  19634. // 3. Return a body whose stream is out2 and other members are copied from body.
  19635. return {
  19636. stream: finalClone,
  19637. length: body.length,
  19638. source: body.source
  19639. }
  19640. }
  19641. async function * consumeBody (body) {
  19642. if (body) {
  19643. if (isUint8Array(body)) {
  19644. yield body
  19645. } else {
  19646. const stream = body.stream
  19647. if (util.isDisturbed(stream)) {
  19648. throw new TypeError('The body has already been consumed.')
  19649. }
  19650. if (stream.locked) {
  19651. throw new TypeError('The stream is locked.')
  19652. }
  19653. // Compat.
  19654. stream[kBodyUsed] = true
  19655. yield * stream
  19656. }
  19657. }
  19658. }
  19659. function throwIfAborted (state) {
  19660. if (state.aborted) {
  19661. throw new DOMException('The operation was aborted.', 'AbortError')
  19662. }
  19663. }
  19664. function bodyMixinMethods (instance) {
  19665. const methods = {
  19666. blob () {
  19667. // The blob() method steps are to return the result of
  19668. // running consume body with this and the following step
  19669. // given a byte sequence bytes: return a Blob whose
  19670. // contents are bytes and whose type attribute is this’s
  19671. // MIME type.
  19672. return specConsumeBody(this, (bytes) => {
  19673. let mimeType = bodyMimeType(this)
  19674. if (mimeType === 'failure') {
  19675. mimeType = ''
  19676. } else if (mimeType) {
  19677. mimeType = serializeAMimeType(mimeType)
  19678. }
  19679. // Return a Blob whose contents are bytes and type attribute
  19680. // is mimeType.
  19681. return new Blob([bytes], { type: mimeType })
  19682. }, instance)
  19683. },
  19684. arrayBuffer () {
  19685. // The arrayBuffer() method steps are to return the result
  19686. // of running consume body with this and the following step
  19687. // given a byte sequence bytes: return a new ArrayBuffer
  19688. // whose contents are bytes.
  19689. return specConsumeBody(this, (bytes) => {
  19690. return new Uint8Array(bytes).buffer
  19691. }, instance)
  19692. },
  19693. text () {
  19694. // The text() method steps are to return the result of running
  19695. // consume body with this and UTF-8 decode.
  19696. return specConsumeBody(this, utf8DecodeBytes, instance)
  19697. },
  19698. json () {
  19699. // The json() method steps are to return the result of running
  19700. // consume body with this and parse JSON from bytes.
  19701. return specConsumeBody(this, parseJSONFromBytes, instance)
  19702. },
  19703. async formData () {
  19704. webidl.brandCheck(this, instance)
  19705. throwIfAborted(this[kState])
  19706. const contentType = this.headers.get('Content-Type')
  19707. // If mimeType’s essence is "multipart/form-data", then:
  19708. if (/multipart\/form-data/.test(contentType)) {
  19709. const headers = {}
  19710. for (const [key, value] of this.headers) headers[key.toLowerCase()] = value
  19711. const responseFormData = new FormData()
  19712. let busboy
  19713. try {
  19714. busboy = new Busboy({
  19715. headers,
  19716. preservePath: true
  19717. })
  19718. } catch (err) {
  19719. throw new DOMException(`${err}`, 'AbortError')
  19720. }
  19721. busboy.on('field', (name, value) => {
  19722. responseFormData.append(name, value)
  19723. })
  19724. busboy.on('file', (name, value, filename, encoding, mimeType) => {
  19725. const chunks = []
  19726. if (encoding === 'base64' || encoding.toLowerCase() === 'base64') {
  19727. let base64chunk = ''
  19728. value.on('data', (chunk) => {
  19729. base64chunk += chunk.toString().replace(/[\r\n]/gm, '')
  19730. const end = base64chunk.length - base64chunk.length % 4
  19731. chunks.push(Buffer.from(base64chunk.slice(0, end), 'base64'))
  19732. base64chunk = base64chunk.slice(end)
  19733. })
  19734. value.on('end', () => {
  19735. chunks.push(Buffer.from(base64chunk, 'base64'))
  19736. responseFormData.append(name, new File(chunks, filename, { type: mimeType }))
  19737. })
  19738. } else {
  19739. value.on('data', (chunk) => {
  19740. chunks.push(chunk)
  19741. })
  19742. value.on('end', () => {
  19743. responseFormData.append(name, new File(chunks, filename, { type: mimeType }))
  19744. })
  19745. }
  19746. })
  19747. const busboyResolve = new Promise((resolve, reject) => {
  19748. busboy.on('finish', resolve)
  19749. busboy.on('error', (err) => reject(new TypeError(err)))
  19750. })
  19751. if (this.body !== null) for await (const chunk of consumeBody(this[kState].body)) busboy.write(chunk)
  19752. busboy.end()
  19753. await busboyResolve
  19754. return responseFormData
  19755. } else if (/application\/x-www-form-urlencoded/.test(contentType)) {
  19756. // Otherwise, if mimeType’s essence is "application/x-www-form-urlencoded", then:
  19757. // 1. Let entries be the result of parsing bytes.
  19758. let entries
  19759. try {
  19760. let text = ''
  19761. // application/x-www-form-urlencoded parser will keep the BOM.
  19762. // https://url.spec.whatwg.org/#concept-urlencoded-parser
  19763. // Note that streaming decoder is stateful and cannot be reused
  19764. const streamingDecoder = new TextDecoder('utf-8', { ignoreBOM: true })
  19765. for await (const chunk of consumeBody(this[kState].body)) {
  19766. if (!isUint8Array(chunk)) {
  19767. throw new TypeError('Expected Uint8Array chunk')
  19768. }
  19769. text += streamingDecoder.decode(chunk, { stream: true })
  19770. }
  19771. text += streamingDecoder.decode()
  19772. entries = new URLSearchParams(text)
  19773. } catch (err) {
  19774. // istanbul ignore next: Unclear when new URLSearchParams can fail on a string.
  19775. // 2. If entries is failure, then throw a TypeError.
  19776. throw Object.assign(new TypeError(), { cause: err })
  19777. }
  19778. // 3. Return a new FormData object whose entries are entries.
  19779. const formData = new FormData()
  19780. for (const [name, value] of entries) {
  19781. formData.append(name, value)
  19782. }
  19783. return formData
  19784. } else {
  19785. // Wait a tick before checking if the request has been aborted.
  19786. // Otherwise, a TypeError can be thrown when an AbortError should.
  19787. await Promise.resolve()
  19788. throwIfAborted(this[kState])
  19789. // Otherwise, throw a TypeError.
  19790. throw webidl.errors.exception({
  19791. header: `${instance.name}.formData`,
  19792. message: 'Could not parse content as FormData.'
  19793. })
  19794. }
  19795. }
  19796. }
  19797. return methods
  19798. }
  19799. function mixinBody (prototype) {
  19800. Object.assign(prototype.prototype, bodyMixinMethods(prototype))
  19801. }
  19802. /**
  19803. * @see https://fetch.spec.whatwg.org/#concept-body-consume-body
  19804. * @param {Response|Request} object
  19805. * @param {(value: unknown) => unknown} convertBytesToJSValue
  19806. * @param {Response|Request} instance
  19807. */
  19808. async function specConsumeBody (object, convertBytesToJSValue, instance) {
  19809. webidl.brandCheck(object, instance)
  19810. throwIfAborted(object[kState])
  19811. // 1. If object is unusable, then return a promise rejected
  19812. // with a TypeError.
  19813. if (bodyUnusable(object[kState].body)) {
  19814. throw new TypeError('Body is unusable')
  19815. }
  19816. // 2. Let promise be a new promise.
  19817. const promise = createDeferredPromise()
  19818. // 3. Let errorSteps given error be to reject promise with error.
  19819. const errorSteps = (error) => promise.reject(error)
  19820. // 4. Let successSteps given a byte sequence data be to resolve
  19821. // promise with the result of running convertBytesToJSValue
  19822. // with data. If that threw an exception, then run errorSteps
  19823. // with that exception.
  19824. const successSteps = (data) => {
  19825. try {
  19826. promise.resolve(convertBytesToJSValue(data))
  19827. } catch (e) {
  19828. errorSteps(e)
  19829. }
  19830. }
  19831. // 5. If object’s body is null, then run successSteps with an
  19832. // empty byte sequence.
  19833. if (object[kState].body == null) {
  19834. successSteps(new Uint8Array())
  19835. return promise.promise
  19836. }
  19837. // 6. Otherwise, fully read object’s body given successSteps,
  19838. // errorSteps, and object’s relevant global object.
  19839. await fullyReadBody(object[kState].body, successSteps, errorSteps)
  19840. // 7. Return promise.
  19841. return promise.promise
  19842. }
  19843. // https://fetch.spec.whatwg.org/#body-unusable
  19844. function bodyUnusable (body) {
  19845. // An object including the Body interface mixin is
  19846. // said to be unusable if its body is non-null and
  19847. // its body’s stream is disturbed or locked.
  19848. return body != null && (body.stream.locked || util.isDisturbed(body.stream))
  19849. }
  19850. /**
  19851. * @see https://encoding.spec.whatwg.org/#utf-8-decode
  19852. * @param {Buffer} buffer
  19853. */
  19854. function utf8DecodeBytes (buffer) {
  19855. if (buffer.length === 0) {
  19856. return ''
  19857. }
  19858. // 1. Let buffer be the result of peeking three bytes from
  19859. // ioQueue, converted to a byte sequence.
  19860. // 2. If buffer is 0xEF 0xBB 0xBF, then read three
  19861. // bytes from ioQueue. (Do nothing with those bytes.)
  19862. if (buffer[0] === 0xEF && buffer[1] === 0xBB && buffer[2] === 0xBF) {
  19863. buffer = buffer.subarray(3)
  19864. }
  19865. // 3. Process a queue with an instance of UTF-8’s
  19866. // decoder, ioQueue, output, and "replacement".
  19867. const output = textDecoder.decode(buffer)
  19868. // 4. Return output.
  19869. return output
  19870. }
  19871. /**
  19872. * @see https://infra.spec.whatwg.org/#parse-json-bytes-to-a-javascript-value
  19873. * @param {Uint8Array} bytes
  19874. */
  19875. function parseJSONFromBytes (bytes) {
  19876. return JSON.parse(utf8DecodeBytes(bytes))
  19877. }
  19878. /**
  19879. * @see https://fetch.spec.whatwg.org/#concept-body-mime-type
  19880. * @param {import('./response').Response|import('./request').Request} object
  19881. */
  19882. function bodyMimeType (object) {
  19883. const { headersList } = object[kState]
  19884. const contentType = headersList.get('content-type')
  19885. if (contentType === null) {
  19886. return 'failure'
  19887. }
  19888. return parseMIMEType(contentType)
  19889. }
  19890. module.exports = {
  19891. extractBody,
  19892. safelyExtractBody,
  19893. cloneBody,
  19894. mixinBody
  19895. }
  19896. /***/ }),
  19897. /***/ 1037:
  19898. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  19899. "use strict";
  19900. const { MessageChannel, receiveMessageOnPort } = __nccwpck_require__(1267)
  19901. const corsSafeListedMethods = ['GET', 'HEAD', 'POST']
  19902. const corsSafeListedMethodsSet = new Set(corsSafeListedMethods)
  19903. const nullBodyStatus = [101, 204, 205, 304]
  19904. const redirectStatus = [301, 302, 303, 307, 308]
  19905. const redirectStatusSet = new Set(redirectStatus)
  19906. // https://fetch.spec.whatwg.org/#block-bad-port
  19907. const badPorts = [
  19908. '1', '7', '9', '11', '13', '15', '17', '19', '20', '21', '22', '23', '25', '37', '42', '43', '53', '69', '77', '79',
  19909. '87', '95', '101', '102', '103', '104', '109', '110', '111', '113', '115', '117', '119', '123', '135', '137',
  19910. '139', '143', '161', '179', '389', '427', '465', '512', '513', '514', '515', '526', '530', '531', '532',
  19911. '540', '548', '554', '556', '563', '587', '601', '636', '989', '990', '993', '995', '1719', '1720', '1723',
  19912. '2049', '3659', '4045', '5060', '5061', '6000', '6566', '6665', '6666', '6667', '6668', '6669', '6697',
  19913. '10080'
  19914. ]
  19915. const badPortsSet = new Set(badPorts)
  19916. // https://w3c.github.io/webappsec-referrer-policy/#referrer-policies
  19917. const referrerPolicy = [
  19918. '',
  19919. 'no-referrer',
  19920. 'no-referrer-when-downgrade',
  19921. 'same-origin',
  19922. 'origin',
  19923. 'strict-origin',
  19924. 'origin-when-cross-origin',
  19925. 'strict-origin-when-cross-origin',
  19926. 'unsafe-url'
  19927. ]
  19928. const referrerPolicySet = new Set(referrerPolicy)
  19929. const requestRedirect = ['follow', 'manual', 'error']
  19930. const safeMethods = ['GET', 'HEAD', 'OPTIONS', 'TRACE']
  19931. const safeMethodsSet = new Set(safeMethods)
  19932. const requestMode = ['navigate', 'same-origin', 'no-cors', 'cors']
  19933. const requestCredentials = ['omit', 'same-origin', 'include']
  19934. const requestCache = [
  19935. 'default',
  19936. 'no-store',
  19937. 'reload',
  19938. 'no-cache',
  19939. 'force-cache',
  19940. 'only-if-cached'
  19941. ]
  19942. // https://fetch.spec.whatwg.org/#request-body-header-name
  19943. const requestBodyHeader = [
  19944. 'content-encoding',
  19945. 'content-language',
  19946. 'content-location',
  19947. 'content-type',
  19948. // See https://github.com/nodejs/undici/issues/2021
  19949. // 'Content-Length' is a forbidden header name, which is typically
  19950. // removed in the Headers implementation. However, undici doesn't
  19951. // filter out headers, so we add it here.
  19952. 'content-length'
  19953. ]
  19954. // https://fetch.spec.whatwg.org/#enumdef-requestduplex
  19955. const requestDuplex = [
  19956. 'half'
  19957. ]
  19958. // http://fetch.spec.whatwg.org/#forbidden-method
  19959. const forbiddenMethods = ['CONNECT', 'TRACE', 'TRACK']
  19960. const forbiddenMethodsSet = new Set(forbiddenMethods)
  19961. const subresource = [
  19962. 'audio',
  19963. 'audioworklet',
  19964. 'font',
  19965. 'image',
  19966. 'manifest',
  19967. 'paintworklet',
  19968. 'script',
  19969. 'style',
  19970. 'track',
  19971. 'video',
  19972. 'xslt',
  19973. ''
  19974. ]
  19975. const subresourceSet = new Set(subresource)
  19976. /** @type {globalThis['DOMException']} */
  19977. const DOMException = globalThis.DOMException ?? (() => {
  19978. // DOMException was only made a global in Node v17.0.0,
  19979. // but fetch supports >= v16.8.
  19980. try {
  19981. atob('~')
  19982. } catch (err) {
  19983. return Object.getPrototypeOf(err).constructor
  19984. }
  19985. })()
  19986. let channel
  19987. /** @type {globalThis['structuredClone']} */
  19988. const structuredClone =
  19989. globalThis.structuredClone ??
  19990. // https://github.com/nodejs/node/blob/b27ae24dcc4251bad726d9d84baf678d1f707fed/lib/internal/structured_clone.js
  19991. // structuredClone was added in v17.0.0, but fetch supports v16.8
  19992. function structuredClone (value, options = undefined) {
  19993. if (arguments.length === 0) {
  19994. throw new TypeError('missing argument')
  19995. }
  19996. if (!channel) {
  19997. channel = new MessageChannel()
  19998. }
  19999. channel.port1.unref()
  20000. channel.port2.unref()
  20001. channel.port1.postMessage(value, options?.transfer)
  20002. return receiveMessageOnPort(channel.port2).message
  20003. }
  20004. module.exports = {
  20005. DOMException,
  20006. structuredClone,
  20007. subresource,
  20008. forbiddenMethods,
  20009. requestBodyHeader,
  20010. referrerPolicy,
  20011. requestRedirect,
  20012. requestMode,
  20013. requestCredentials,
  20014. requestCache,
  20015. redirectStatus,
  20016. corsSafeListedMethods,
  20017. nullBodyStatus,
  20018. safeMethods,
  20019. badPorts,
  20020. requestDuplex,
  20021. subresourceSet,
  20022. badPortsSet,
  20023. redirectStatusSet,
  20024. corsSafeListedMethodsSet,
  20025. safeMethodsSet,
  20026. forbiddenMethodsSet,
  20027. referrerPolicySet
  20028. }
  20029. /***/ }),
  20030. /***/ 685:
  20031. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  20032. const assert = __nccwpck_require__(9491)
  20033. const { atob } = __nccwpck_require__(4300)
  20034. const { isomorphicDecode } = __nccwpck_require__(2538)
  20035. const encoder = new TextEncoder()
  20036. /**
  20037. * @see https://mimesniff.spec.whatwg.org/#http-token-code-point
  20038. */
  20039. const HTTP_TOKEN_CODEPOINTS = /^[!#$%&'*+-.^_|~A-Za-z0-9]+$/
  20040. const HTTP_WHITESPACE_REGEX = /(\u000A|\u000D|\u0009|\u0020)/ // eslint-disable-line
  20041. /**
  20042. * @see https://mimesniff.spec.whatwg.org/#http-quoted-string-token-code-point
  20043. */
  20044. const HTTP_QUOTED_STRING_TOKENS = /[\u0009|\u0020-\u007E|\u0080-\u00FF]/ // eslint-disable-line
  20045. // https://fetch.spec.whatwg.org/#data-url-processor
  20046. /** @param {URL} dataURL */
  20047. function dataURLProcessor (dataURL) {
  20048. // 1. Assert: dataURL’s scheme is "data".
  20049. assert(dataURL.protocol === 'data:')
  20050. // 2. Let input be the result of running the URL
  20051. // serializer on dataURL with exclude fragment
  20052. // set to true.
  20053. let input = URLSerializer(dataURL, true)
  20054. // 3. Remove the leading "data:" string from input.
  20055. input = input.slice(5)
  20056. // 4. Let position point at the start of input.
  20057. const position = { position: 0 }
  20058. // 5. Let mimeType be the result of collecting a
  20059. // sequence of code points that are not equal
  20060. // to U+002C (,), given position.
  20061. let mimeType = collectASequenceOfCodePointsFast(
  20062. ',',
  20063. input,
  20064. position
  20065. )
  20066. // 6. Strip leading and trailing ASCII whitespace
  20067. // from mimeType.
  20068. // Undici implementation note: we need to store the
  20069. // length because if the mimetype has spaces removed,
  20070. // the wrong amount will be sliced from the input in
  20071. // step #9
  20072. const mimeTypeLength = mimeType.length
  20073. mimeType = removeASCIIWhitespace(mimeType, true, true)
  20074. // 7. If position is past the end of input, then
  20075. // return failure
  20076. if (position.position >= input.length) {
  20077. return 'failure'
  20078. }
  20079. // 8. Advance position by 1.
  20080. position.position++
  20081. // 9. Let encodedBody be the remainder of input.
  20082. const encodedBody = input.slice(mimeTypeLength + 1)
  20083. // 10. Let body be the percent-decoding of encodedBody.
  20084. let body = stringPercentDecode(encodedBody)
  20085. // 11. If mimeType ends with U+003B (;), followed by
  20086. // zero or more U+0020 SPACE, followed by an ASCII
  20087. // case-insensitive match for "base64", then:
  20088. if (/;(\u0020){0,}base64$/i.test(mimeType)) {
  20089. // 1. Let stringBody be the isomorphic decode of body.
  20090. const stringBody = isomorphicDecode(body)
  20091. // 2. Set body to the forgiving-base64 decode of
  20092. // stringBody.
  20093. body = forgivingBase64(stringBody)
  20094. // 3. If body is failure, then return failure.
  20095. if (body === 'failure') {
  20096. return 'failure'
  20097. }
  20098. // 4. Remove the last 6 code points from mimeType.
  20099. mimeType = mimeType.slice(0, -6)
  20100. // 5. Remove trailing U+0020 SPACE code points from mimeType,
  20101. // if any.
  20102. mimeType = mimeType.replace(/(\u0020)+$/, '')
  20103. // 6. Remove the last U+003B (;) code point from mimeType.
  20104. mimeType = mimeType.slice(0, -1)
  20105. }
  20106. // 12. If mimeType starts with U+003B (;), then prepend
  20107. // "text/plain" to mimeType.
  20108. if (mimeType.startsWith(';')) {
  20109. mimeType = 'text/plain' + mimeType
  20110. }
  20111. // 13. Let mimeTypeRecord be the result of parsing
  20112. // mimeType.
  20113. let mimeTypeRecord = parseMIMEType(mimeType)
  20114. // 14. If mimeTypeRecord is failure, then set
  20115. // mimeTypeRecord to text/plain;charset=US-ASCII.
  20116. if (mimeTypeRecord === 'failure') {
  20117. mimeTypeRecord = parseMIMEType('text/plain;charset=US-ASCII')
  20118. }
  20119. // 15. Return a new data: URL struct whose MIME
  20120. // type is mimeTypeRecord and body is body.
  20121. // https://fetch.spec.whatwg.org/#data-url-struct
  20122. return { mimeType: mimeTypeRecord, body }
  20123. }
  20124. // https://url.spec.whatwg.org/#concept-url-serializer
  20125. /**
  20126. * @param {URL} url
  20127. * @param {boolean} excludeFragment
  20128. */
  20129. function URLSerializer (url, excludeFragment = false) {
  20130. if (!excludeFragment) {
  20131. return url.href
  20132. }
  20133. const href = url.href
  20134. const hashLength = url.hash.length
  20135. return hashLength === 0 ? href : href.substring(0, href.length - hashLength)
  20136. }
  20137. // https://infra.spec.whatwg.org/#collect-a-sequence-of-code-points
  20138. /**
  20139. * @param {(char: string) => boolean} condition
  20140. * @param {string} input
  20141. * @param {{ position: number }} position
  20142. */
  20143. function collectASequenceOfCodePoints (condition, input, position) {
  20144. // 1. Let result be the empty string.
  20145. let result = ''
  20146. // 2. While position doesn’t point past the end of input and the
  20147. // code point at position within input meets the condition condition:
  20148. while (position.position < input.length && condition(input[position.position])) {
  20149. // 1. Append that code point to the end of result.
  20150. result += input[position.position]
  20151. // 2. Advance position by 1.
  20152. position.position++
  20153. }
  20154. // 3. Return result.
  20155. return result
  20156. }
  20157. /**
  20158. * A faster collectASequenceOfCodePoints that only works when comparing a single character.
  20159. * @param {string} char
  20160. * @param {string} input
  20161. * @param {{ position: number }} position
  20162. */
  20163. function collectASequenceOfCodePointsFast (char, input, position) {
  20164. const idx = input.indexOf(char, position.position)
  20165. const start = position.position
  20166. if (idx === -1) {
  20167. position.position = input.length
  20168. return input.slice(start)
  20169. }
  20170. position.position = idx
  20171. return input.slice(start, position.position)
  20172. }
  20173. // https://url.spec.whatwg.org/#string-percent-decode
  20174. /** @param {string} input */
  20175. function stringPercentDecode (input) {
  20176. // 1. Let bytes be the UTF-8 encoding of input.
  20177. const bytes = encoder.encode(input)
  20178. // 2. Return the percent-decoding of bytes.
  20179. return percentDecode(bytes)
  20180. }
  20181. // https://url.spec.whatwg.org/#percent-decode
  20182. /** @param {Uint8Array} input */
  20183. function percentDecode (input) {
  20184. // 1. Let output be an empty byte sequence.
  20185. /** @type {number[]} */
  20186. const output = []
  20187. // 2. For each byte byte in input:
  20188. for (let i = 0; i < input.length; i++) {
  20189. const byte = input[i]
  20190. // 1. If byte is not 0x25 (%), then append byte to output.
  20191. if (byte !== 0x25) {
  20192. output.push(byte)
  20193. // 2. Otherwise, if byte is 0x25 (%) and the next two bytes
  20194. // after byte in input are not in the ranges
  20195. // 0x30 (0) to 0x39 (9), 0x41 (A) to 0x46 (F),
  20196. // and 0x61 (a) to 0x66 (f), all inclusive, append byte
  20197. // to output.
  20198. } else if (
  20199. byte === 0x25 &&
  20200. !/^[0-9A-Fa-f]{2}$/i.test(String.fromCharCode(input[i + 1], input[i + 2]))
  20201. ) {
  20202. output.push(0x25)
  20203. // 3. Otherwise:
  20204. } else {
  20205. // 1. Let bytePoint be the two bytes after byte in input,
  20206. // decoded, and then interpreted as hexadecimal number.
  20207. const nextTwoBytes = String.fromCharCode(input[i + 1], input[i + 2])
  20208. const bytePoint = Number.parseInt(nextTwoBytes, 16)
  20209. // 2. Append a byte whose value is bytePoint to output.
  20210. output.push(bytePoint)
  20211. // 3. Skip the next two bytes in input.
  20212. i += 2
  20213. }
  20214. }
  20215. // 3. Return output.
  20216. return Uint8Array.from(output)
  20217. }
  20218. // https://mimesniff.spec.whatwg.org/#parse-a-mime-type
  20219. /** @param {string} input */
  20220. function parseMIMEType (input) {
  20221. // 1. Remove any leading and trailing HTTP whitespace
  20222. // from input.
  20223. input = removeHTTPWhitespace(input, true, true)
  20224. // 2. Let position be a position variable for input,
  20225. // initially pointing at the start of input.
  20226. const position = { position: 0 }
  20227. // 3. Let type be the result of collecting a sequence
  20228. // of code points that are not U+002F (/) from
  20229. // input, given position.
  20230. const type = collectASequenceOfCodePointsFast(
  20231. '/',
  20232. input,
  20233. position
  20234. )
  20235. // 4. If type is the empty string or does not solely
  20236. // contain HTTP token code points, then return failure.
  20237. // https://mimesniff.spec.whatwg.org/#http-token-code-point
  20238. if (type.length === 0 || !HTTP_TOKEN_CODEPOINTS.test(type)) {
  20239. return 'failure'
  20240. }
  20241. // 5. If position is past the end of input, then return
  20242. // failure
  20243. if (position.position > input.length) {
  20244. return 'failure'
  20245. }
  20246. // 6. Advance position by 1. (This skips past U+002F (/).)
  20247. position.position++
  20248. // 7. Let subtype be the result of collecting a sequence of
  20249. // code points that are not U+003B (;) from input, given
  20250. // position.
  20251. let subtype = collectASequenceOfCodePointsFast(
  20252. ';',
  20253. input,
  20254. position
  20255. )
  20256. // 8. Remove any trailing HTTP whitespace from subtype.
  20257. subtype = removeHTTPWhitespace(subtype, false, true)
  20258. // 9. If subtype is the empty string or does not solely
  20259. // contain HTTP token code points, then return failure.
  20260. if (subtype.length === 0 || !HTTP_TOKEN_CODEPOINTS.test(subtype)) {
  20261. return 'failure'
  20262. }
  20263. const typeLowercase = type.toLowerCase()
  20264. const subtypeLowercase = subtype.toLowerCase()
  20265. // 10. Let mimeType be a new MIME type record whose type
  20266. // is type, in ASCII lowercase, and subtype is subtype,
  20267. // in ASCII lowercase.
  20268. // https://mimesniff.spec.whatwg.org/#mime-type
  20269. const mimeType = {
  20270. type: typeLowercase,
  20271. subtype: subtypeLowercase,
  20272. /** @type {Map<string, string>} */
  20273. parameters: new Map(),
  20274. // https://mimesniff.spec.whatwg.org/#mime-type-essence
  20275. essence: `${typeLowercase}/${subtypeLowercase}`
  20276. }
  20277. // 11. While position is not past the end of input:
  20278. while (position.position < input.length) {
  20279. // 1. Advance position by 1. (This skips past U+003B (;).)
  20280. position.position++
  20281. // 2. Collect a sequence of code points that are HTTP
  20282. // whitespace from input given position.
  20283. collectASequenceOfCodePoints(
  20284. // https://fetch.spec.whatwg.org/#http-whitespace
  20285. char => HTTP_WHITESPACE_REGEX.test(char),
  20286. input,
  20287. position
  20288. )
  20289. // 3. Let parameterName be the result of collecting a
  20290. // sequence of code points that are not U+003B (;)
  20291. // or U+003D (=) from input, given position.
  20292. let parameterName = collectASequenceOfCodePoints(
  20293. (char) => char !== ';' && char !== '=',
  20294. input,
  20295. position
  20296. )
  20297. // 4. Set parameterName to parameterName, in ASCII
  20298. // lowercase.
  20299. parameterName = parameterName.toLowerCase()
  20300. // 5. If position is not past the end of input, then:
  20301. if (position.position < input.length) {
  20302. // 1. If the code point at position within input is
  20303. // U+003B (;), then continue.
  20304. if (input[position.position] === ';') {
  20305. continue
  20306. }
  20307. // 2. Advance position by 1. (This skips past U+003D (=).)
  20308. position.position++
  20309. }
  20310. // 6. If position is past the end of input, then break.
  20311. if (position.position > input.length) {
  20312. break
  20313. }
  20314. // 7. Let parameterValue be null.
  20315. let parameterValue = null
  20316. // 8. If the code point at position within input is
  20317. // U+0022 ("), then:
  20318. if (input[position.position] === '"') {
  20319. // 1. Set parameterValue to the result of collecting
  20320. // an HTTP quoted string from input, given position
  20321. // and the extract-value flag.
  20322. parameterValue = collectAnHTTPQuotedString(input, position, true)
  20323. // 2. Collect a sequence of code points that are not
  20324. // U+003B (;) from input, given position.
  20325. collectASequenceOfCodePointsFast(
  20326. ';',
  20327. input,
  20328. position
  20329. )
  20330. // 9. Otherwise:
  20331. } else {
  20332. // 1. Set parameterValue to the result of collecting
  20333. // a sequence of code points that are not U+003B (;)
  20334. // from input, given position.
  20335. parameterValue = collectASequenceOfCodePointsFast(
  20336. ';',
  20337. input,
  20338. position
  20339. )
  20340. // 2. Remove any trailing HTTP whitespace from parameterValue.
  20341. parameterValue = removeHTTPWhitespace(parameterValue, false, true)
  20342. // 3. If parameterValue is the empty string, then continue.
  20343. if (parameterValue.length === 0) {
  20344. continue
  20345. }
  20346. }
  20347. // 10. If all of the following are true
  20348. // - parameterName is not the empty string
  20349. // - parameterName solely contains HTTP token code points
  20350. // - parameterValue solely contains HTTP quoted-string token code points
  20351. // - mimeType’s parameters[parameterName] does not exist
  20352. // then set mimeType’s parameters[parameterName] to parameterValue.
  20353. if (
  20354. parameterName.length !== 0 &&
  20355. HTTP_TOKEN_CODEPOINTS.test(parameterName) &&
  20356. (parameterValue.length === 0 || HTTP_QUOTED_STRING_TOKENS.test(parameterValue)) &&
  20357. !mimeType.parameters.has(parameterName)
  20358. ) {
  20359. mimeType.parameters.set(parameterName, parameterValue)
  20360. }
  20361. }
  20362. // 12. Return mimeType.
  20363. return mimeType
  20364. }
  20365. // https://infra.spec.whatwg.org/#forgiving-base64-decode
  20366. /** @param {string} data */
  20367. function forgivingBase64 (data) {
  20368. // 1. Remove all ASCII whitespace from data.
  20369. data = data.replace(/[\u0009\u000A\u000C\u000D\u0020]/g, '') // eslint-disable-line
  20370. // 2. If data’s code point length divides by 4 leaving
  20371. // no remainder, then:
  20372. if (data.length % 4 === 0) {
  20373. // 1. If data ends with one or two U+003D (=) code points,
  20374. // then remove them from data.
  20375. data = data.replace(/=?=$/, '')
  20376. }
  20377. // 3. If data’s code point length divides by 4 leaving
  20378. // a remainder of 1, then return failure.
  20379. if (data.length % 4 === 1) {
  20380. return 'failure'
  20381. }
  20382. // 4. If data contains a code point that is not one of
  20383. // U+002B (+)
  20384. // U+002F (/)
  20385. // ASCII alphanumeric
  20386. // then return failure.
  20387. if (/[^+/0-9A-Za-z]/.test(data)) {
  20388. return 'failure'
  20389. }
  20390. const binary = atob(data)
  20391. const bytes = new Uint8Array(binary.length)
  20392. for (let byte = 0; byte < binary.length; byte++) {
  20393. bytes[byte] = binary.charCodeAt(byte)
  20394. }
  20395. return bytes
  20396. }
  20397. // https://fetch.spec.whatwg.org/#collect-an-http-quoted-string
  20398. // tests: https://fetch.spec.whatwg.org/#example-http-quoted-string
  20399. /**
  20400. * @param {string} input
  20401. * @param {{ position: number }} position
  20402. * @param {boolean?} extractValue
  20403. */
  20404. function collectAnHTTPQuotedString (input, position, extractValue) {
  20405. // 1. Let positionStart be position.
  20406. const positionStart = position.position
  20407. // 2. Let value be the empty string.
  20408. let value = ''
  20409. // 3. Assert: the code point at position within input
  20410. // is U+0022 (").
  20411. assert(input[position.position] === '"')
  20412. // 4. Advance position by 1.
  20413. position.position++
  20414. // 5. While true:
  20415. while (true) {
  20416. // 1. Append the result of collecting a sequence of code points
  20417. // that are not U+0022 (") or U+005C (\) from input, given
  20418. // position, to value.
  20419. value += collectASequenceOfCodePoints(
  20420. (char) => char !== '"' && char !== '\\',
  20421. input,
  20422. position
  20423. )
  20424. // 2. If position is past the end of input, then break.
  20425. if (position.position >= input.length) {
  20426. break
  20427. }
  20428. // 3. Let quoteOrBackslash be the code point at position within
  20429. // input.
  20430. const quoteOrBackslash = input[position.position]
  20431. // 4. Advance position by 1.
  20432. position.position++
  20433. // 5. If quoteOrBackslash is U+005C (\), then:
  20434. if (quoteOrBackslash === '\\') {
  20435. // 1. If position is past the end of input, then append
  20436. // U+005C (\) to value and break.
  20437. if (position.position >= input.length) {
  20438. value += '\\'
  20439. break
  20440. }
  20441. // 2. Append the code point at position within input to value.
  20442. value += input[position.position]
  20443. // 3. Advance position by 1.
  20444. position.position++
  20445. // 6. Otherwise:
  20446. } else {
  20447. // 1. Assert: quoteOrBackslash is U+0022 (").
  20448. assert(quoteOrBackslash === '"')
  20449. // 2. Break.
  20450. break
  20451. }
  20452. }
  20453. // 6. If the extract-value flag is set, then return value.
  20454. if (extractValue) {
  20455. return value
  20456. }
  20457. // 7. Return the code points from positionStart to position,
  20458. // inclusive, within input.
  20459. return input.slice(positionStart, position.position)
  20460. }
  20461. /**
  20462. * @see https://mimesniff.spec.whatwg.org/#serialize-a-mime-type
  20463. */
  20464. function serializeAMimeType (mimeType) {
  20465. assert(mimeType !== 'failure')
  20466. const { parameters, essence } = mimeType
  20467. // 1. Let serialization be the concatenation of mimeType’s
  20468. // type, U+002F (/), and mimeType’s subtype.
  20469. let serialization = essence
  20470. // 2. For each name → value of mimeType’s parameters:
  20471. for (let [name, value] of parameters.entries()) {
  20472. // 1. Append U+003B (;) to serialization.
  20473. serialization += ';'
  20474. // 2. Append name to serialization.
  20475. serialization += name
  20476. // 3. Append U+003D (=) to serialization.
  20477. serialization += '='
  20478. // 4. If value does not solely contain HTTP token code
  20479. // points or value is the empty string, then:
  20480. if (!HTTP_TOKEN_CODEPOINTS.test(value)) {
  20481. // 1. Precede each occurence of U+0022 (") or
  20482. // U+005C (\) in value with U+005C (\).
  20483. value = value.replace(/(\\|")/g, '\\$1')
  20484. // 2. Prepend U+0022 (") to value.
  20485. value = '"' + value
  20486. // 3. Append U+0022 (") to value.
  20487. value += '"'
  20488. }
  20489. // 5. Append value to serialization.
  20490. serialization += value
  20491. }
  20492. // 3. Return serialization.
  20493. return serialization
  20494. }
  20495. /**
  20496. * @see https://fetch.spec.whatwg.org/#http-whitespace
  20497. * @param {string} char
  20498. */
  20499. function isHTTPWhiteSpace (char) {
  20500. return char === '\r' || char === '\n' || char === '\t' || char === ' '
  20501. }
  20502. /**
  20503. * @see https://fetch.spec.whatwg.org/#http-whitespace
  20504. * @param {string} str
  20505. */
  20506. function removeHTTPWhitespace (str, leading = true, trailing = true) {
  20507. let lead = 0
  20508. let trail = str.length - 1
  20509. if (leading) {
  20510. for (; lead < str.length && isHTTPWhiteSpace(str[lead]); lead++);
  20511. }
  20512. if (trailing) {
  20513. for (; trail > 0 && isHTTPWhiteSpace(str[trail]); trail--);
  20514. }
  20515. return str.slice(lead, trail + 1)
  20516. }
  20517. /**
  20518. * @see https://infra.spec.whatwg.org/#ascii-whitespace
  20519. * @param {string} char
  20520. */
  20521. function isASCIIWhitespace (char) {
  20522. return char === '\r' || char === '\n' || char === '\t' || char === '\f' || char === ' '
  20523. }
  20524. /**
  20525. * @see https://infra.spec.whatwg.org/#strip-leading-and-trailing-ascii-whitespace
  20526. */
  20527. function removeASCIIWhitespace (str, leading = true, trailing = true) {
  20528. let lead = 0
  20529. let trail = str.length - 1
  20530. if (leading) {
  20531. for (; lead < str.length && isASCIIWhitespace(str[lead]); lead++);
  20532. }
  20533. if (trailing) {
  20534. for (; trail > 0 && isASCIIWhitespace(str[trail]); trail--);
  20535. }
  20536. return str.slice(lead, trail + 1)
  20537. }
  20538. module.exports = {
  20539. dataURLProcessor,
  20540. URLSerializer,
  20541. collectASequenceOfCodePoints,
  20542. collectASequenceOfCodePointsFast,
  20543. stringPercentDecode,
  20544. parseMIMEType,
  20545. collectAnHTTPQuotedString,
  20546. serializeAMimeType
  20547. }
  20548. /***/ }),
  20549. /***/ 8511:
  20550. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  20551. "use strict";
  20552. const { Blob, File: NativeFile } = __nccwpck_require__(4300)
  20553. const { types } = __nccwpck_require__(3837)
  20554. const { kState } = __nccwpck_require__(5861)
  20555. const { isBlobLike } = __nccwpck_require__(2538)
  20556. const { webidl } = __nccwpck_require__(1744)
  20557. const { parseMIMEType, serializeAMimeType } = __nccwpck_require__(685)
  20558. const { kEnumerableProperty } = __nccwpck_require__(3983)
  20559. const encoder = new TextEncoder()
  20560. class File extends Blob {
  20561. constructor (fileBits, fileName, options = {}) {
  20562. // The File constructor is invoked with two or three parameters, depending
  20563. // on whether the optional dictionary parameter is used. When the File()
  20564. // constructor is invoked, user agents must run the following steps:
  20565. webidl.argumentLengthCheck(arguments, 2, { header: 'File constructor' })
  20566. fileBits = webidl.converters['sequence<BlobPart>'](fileBits)
  20567. fileName = webidl.converters.USVString(fileName)
  20568. options = webidl.converters.FilePropertyBag(options)
  20569. // 1. Let bytes be the result of processing blob parts given fileBits and
  20570. // options.
  20571. // Note: Blob handles this for us
  20572. // 2. Let n be the fileName argument to the constructor.
  20573. const n = fileName
  20574. // 3. Process FilePropertyBag dictionary argument by running the following
  20575. // substeps:
  20576. // 1. If the type member is provided and is not the empty string, let t
  20577. // be set to the type dictionary member. If t contains any characters
  20578. // outside the range U+0020 to U+007E, then set t to the empty string
  20579. // and return from these substeps.
  20580. // 2. Convert every character in t to ASCII lowercase.
  20581. let t = options.type
  20582. let d
  20583. // eslint-disable-next-line no-labels
  20584. substep: {
  20585. if (t) {
  20586. t = parseMIMEType(t)
  20587. if (t === 'failure') {
  20588. t = ''
  20589. // eslint-disable-next-line no-labels
  20590. break substep
  20591. }
  20592. t = serializeAMimeType(t).toLowerCase()
  20593. }
  20594. // 3. If the lastModified member is provided, let d be set to the
  20595. // lastModified dictionary member. If it is not provided, set d to the
  20596. // current date and time represented as the number of milliseconds since
  20597. // the Unix Epoch (which is the equivalent of Date.now() [ECMA-262]).
  20598. d = options.lastModified
  20599. }
  20600. // 4. Return a new File object F such that:
  20601. // F refers to the bytes byte sequence.
  20602. // F.size is set to the number of total bytes in bytes.
  20603. // F.name is set to n.
  20604. // F.type is set to t.
  20605. // F.lastModified is set to d.
  20606. super(processBlobParts(fileBits, options), { type: t })
  20607. this[kState] = {
  20608. name: n,
  20609. lastModified: d,
  20610. type: t
  20611. }
  20612. }
  20613. get name () {
  20614. webidl.brandCheck(this, File)
  20615. return this[kState].name
  20616. }
  20617. get lastModified () {
  20618. webidl.brandCheck(this, File)
  20619. return this[kState].lastModified
  20620. }
  20621. get type () {
  20622. webidl.brandCheck(this, File)
  20623. return this[kState].type
  20624. }
  20625. }
  20626. class FileLike {
  20627. constructor (blobLike, fileName, options = {}) {
  20628. // TODO: argument idl type check
  20629. // The File constructor is invoked with two or three parameters, depending
  20630. // on whether the optional dictionary parameter is used. When the File()
  20631. // constructor is invoked, user agents must run the following steps:
  20632. // 1. Let bytes be the result of processing blob parts given fileBits and
  20633. // options.
  20634. // 2. Let n be the fileName argument to the constructor.
  20635. const n = fileName
  20636. // 3. Process FilePropertyBag dictionary argument by running the following
  20637. // substeps:
  20638. // 1. If the type member is provided and is not the empty string, let t
  20639. // be set to the type dictionary member. If t contains any characters
  20640. // outside the range U+0020 to U+007E, then set t to the empty string
  20641. // and return from these substeps.
  20642. // TODO
  20643. const t = options.type
  20644. // 2. Convert every character in t to ASCII lowercase.
  20645. // TODO
  20646. // 3. If the lastModified member is provided, let d be set to the
  20647. // lastModified dictionary member. If it is not provided, set d to the
  20648. // current date and time represented as the number of milliseconds since
  20649. // the Unix Epoch (which is the equivalent of Date.now() [ECMA-262]).
  20650. const d = options.lastModified ?? Date.now()
  20651. // 4. Return a new File object F such that:
  20652. // F refers to the bytes byte sequence.
  20653. // F.size is set to the number of total bytes in bytes.
  20654. // F.name is set to n.
  20655. // F.type is set to t.
  20656. // F.lastModified is set to d.
  20657. this[kState] = {
  20658. blobLike,
  20659. name: n,
  20660. type: t,
  20661. lastModified: d
  20662. }
  20663. }
  20664. stream (...args) {
  20665. webidl.brandCheck(this, FileLike)
  20666. return this[kState].blobLike.stream(...args)
  20667. }
  20668. arrayBuffer (...args) {
  20669. webidl.brandCheck(this, FileLike)
  20670. return this[kState].blobLike.arrayBuffer(...args)
  20671. }
  20672. slice (...args) {
  20673. webidl.brandCheck(this, FileLike)
  20674. return this[kState].blobLike.slice(...args)
  20675. }
  20676. text (...args) {
  20677. webidl.brandCheck(this, FileLike)
  20678. return this[kState].blobLike.text(...args)
  20679. }
  20680. get size () {
  20681. webidl.brandCheck(this, FileLike)
  20682. return this[kState].blobLike.size
  20683. }
  20684. get type () {
  20685. webidl.brandCheck(this, FileLike)
  20686. return this[kState].blobLike.type
  20687. }
  20688. get name () {
  20689. webidl.brandCheck(this, FileLike)
  20690. return this[kState].name
  20691. }
  20692. get lastModified () {
  20693. webidl.brandCheck(this, FileLike)
  20694. return this[kState].lastModified
  20695. }
  20696. get [Symbol.toStringTag] () {
  20697. return 'File'
  20698. }
  20699. }
  20700. Object.defineProperties(File.prototype, {
  20701. [Symbol.toStringTag]: {
  20702. value: 'File',
  20703. configurable: true
  20704. },
  20705. name: kEnumerableProperty,
  20706. lastModified: kEnumerableProperty
  20707. })
  20708. webidl.converters.Blob = webidl.interfaceConverter(Blob)
  20709. webidl.converters.BlobPart = function (V, opts) {
  20710. if (webidl.util.Type(V) === 'Object') {
  20711. if (isBlobLike(V)) {
  20712. return webidl.converters.Blob(V, { strict: false })
  20713. }
  20714. if (
  20715. ArrayBuffer.isView(V) ||
  20716. types.isAnyArrayBuffer(V)
  20717. ) {
  20718. return webidl.converters.BufferSource(V, opts)
  20719. }
  20720. }
  20721. return webidl.converters.USVString(V, opts)
  20722. }
  20723. webidl.converters['sequence<BlobPart>'] = webidl.sequenceConverter(
  20724. webidl.converters.BlobPart
  20725. )
  20726. // https://www.w3.org/TR/FileAPI/#dfn-FilePropertyBag
  20727. webidl.converters.FilePropertyBag = webidl.dictionaryConverter([
  20728. {
  20729. key: 'lastModified',
  20730. converter: webidl.converters['long long'],
  20731. get defaultValue () {
  20732. return Date.now()
  20733. }
  20734. },
  20735. {
  20736. key: 'type',
  20737. converter: webidl.converters.DOMString,
  20738. defaultValue: ''
  20739. },
  20740. {
  20741. key: 'endings',
  20742. converter: (value) => {
  20743. value = webidl.converters.DOMString(value)
  20744. value = value.toLowerCase()
  20745. if (value !== 'native') {
  20746. value = 'transparent'
  20747. }
  20748. return value
  20749. },
  20750. defaultValue: 'transparent'
  20751. }
  20752. ])
  20753. /**
  20754. * @see https://www.w3.org/TR/FileAPI/#process-blob-parts
  20755. * @param {(NodeJS.TypedArray|Blob|string)[]} parts
  20756. * @param {{ type: string, endings: string }} options
  20757. */
  20758. function processBlobParts (parts, options) {
  20759. // 1. Let bytes be an empty sequence of bytes.
  20760. /** @type {NodeJS.TypedArray[]} */
  20761. const bytes = []
  20762. // 2. For each element in parts:
  20763. for (const element of parts) {
  20764. // 1. If element is a USVString, run the following substeps:
  20765. if (typeof element === 'string') {
  20766. // 1. Let s be element.
  20767. let s = element
  20768. // 2. If the endings member of options is "native", set s
  20769. // to the result of converting line endings to native
  20770. // of element.
  20771. if (options.endings === 'native') {
  20772. s = convertLineEndingsNative(s)
  20773. }
  20774. // 3. Append the result of UTF-8 encoding s to bytes.
  20775. bytes.push(encoder.encode(s))
  20776. } else if (
  20777. types.isAnyArrayBuffer(element) ||
  20778. types.isTypedArray(element)
  20779. ) {
  20780. // 2. If element is a BufferSource, get a copy of the
  20781. // bytes held by the buffer source, and append those
  20782. // bytes to bytes.
  20783. if (!element.buffer) { // ArrayBuffer
  20784. bytes.push(new Uint8Array(element))
  20785. } else {
  20786. bytes.push(
  20787. new Uint8Array(element.buffer, element.byteOffset, element.byteLength)
  20788. )
  20789. }
  20790. } else if (isBlobLike(element)) {
  20791. // 3. If element is a Blob, append the bytes it represents
  20792. // to bytes.
  20793. bytes.push(element)
  20794. }
  20795. }
  20796. // 3. Return bytes.
  20797. return bytes
  20798. }
  20799. /**
  20800. * @see https://www.w3.org/TR/FileAPI/#convert-line-endings-to-native
  20801. * @param {string} s
  20802. */
  20803. function convertLineEndingsNative (s) {
  20804. // 1. Let native line ending be be the code point U+000A LF.
  20805. let nativeLineEnding = '\n'
  20806. // 2. If the underlying platform’s conventions are to
  20807. // represent newlines as a carriage return and line feed
  20808. // sequence, set native line ending to the code point
  20809. // U+000D CR followed by the code point U+000A LF.
  20810. if (process.platform === 'win32') {
  20811. nativeLineEnding = '\r\n'
  20812. }
  20813. return s.replace(/\r?\n/g, nativeLineEnding)
  20814. }
  20815. // If this function is moved to ./util.js, some tools (such as
  20816. // rollup) will warn about circular dependencies. See:
  20817. // https://github.com/nodejs/undici/issues/1629
  20818. function isFileLike (object) {
  20819. return (
  20820. (NativeFile && object instanceof NativeFile) ||
  20821. object instanceof File || (
  20822. object &&
  20823. (typeof object.stream === 'function' ||
  20824. typeof object.arrayBuffer === 'function') &&
  20825. object[Symbol.toStringTag] === 'File'
  20826. )
  20827. )
  20828. }
  20829. module.exports = { File, FileLike, isFileLike }
  20830. /***/ }),
  20831. /***/ 2015:
  20832. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  20833. "use strict";
  20834. const { isBlobLike, toUSVString, makeIterator } = __nccwpck_require__(2538)
  20835. const { kState } = __nccwpck_require__(5861)
  20836. const { File: UndiciFile, FileLike, isFileLike } = __nccwpck_require__(8511)
  20837. const { webidl } = __nccwpck_require__(1744)
  20838. const { Blob, File: NativeFile } = __nccwpck_require__(4300)
  20839. /** @type {globalThis['File']} */
  20840. const File = NativeFile ?? UndiciFile
  20841. // https://xhr.spec.whatwg.org/#formdata
  20842. class FormData {
  20843. constructor (form) {
  20844. if (form !== undefined) {
  20845. throw webidl.errors.conversionFailed({
  20846. prefix: 'FormData constructor',
  20847. argument: 'Argument 1',
  20848. types: ['undefined']
  20849. })
  20850. }
  20851. this[kState] = []
  20852. }
  20853. append (name, value, filename = undefined) {
  20854. webidl.brandCheck(this, FormData)
  20855. webidl.argumentLengthCheck(arguments, 2, { header: 'FormData.append' })
  20856. if (arguments.length === 3 && !isBlobLike(value)) {
  20857. throw new TypeError(
  20858. "Failed to execute 'append' on 'FormData': parameter 2 is not of type 'Blob'"
  20859. )
  20860. }
  20861. // 1. Let value be value if given; otherwise blobValue.
  20862. name = webidl.converters.USVString(name)
  20863. value = isBlobLike(value)
  20864. ? webidl.converters.Blob(value, { strict: false })
  20865. : webidl.converters.USVString(value)
  20866. filename = arguments.length === 3
  20867. ? webidl.converters.USVString(filename)
  20868. : undefined
  20869. // 2. Let entry be the result of creating an entry with
  20870. // name, value, and filename if given.
  20871. const entry = makeEntry(name, value, filename)
  20872. // 3. Append entry to this’s entry list.
  20873. this[kState].push(entry)
  20874. }
  20875. delete (name) {
  20876. webidl.brandCheck(this, FormData)
  20877. webidl.argumentLengthCheck(arguments, 1, { header: 'FormData.delete' })
  20878. name = webidl.converters.USVString(name)
  20879. // The delete(name) method steps are to remove all entries whose name
  20880. // is name from this’s entry list.
  20881. this[kState] = this[kState].filter(entry => entry.name !== name)
  20882. }
  20883. get (name) {
  20884. webidl.brandCheck(this, FormData)
  20885. webidl.argumentLengthCheck(arguments, 1, { header: 'FormData.get' })
  20886. name = webidl.converters.USVString(name)
  20887. // 1. If there is no entry whose name is name in this’s entry list,
  20888. // then return null.
  20889. const idx = this[kState].findIndex((entry) => entry.name === name)
  20890. if (idx === -1) {
  20891. return null
  20892. }
  20893. // 2. Return the value of the first entry whose name is name from
  20894. // this’s entry list.
  20895. return this[kState][idx].value
  20896. }
  20897. getAll (name) {
  20898. webidl.brandCheck(this, FormData)
  20899. webidl.argumentLengthCheck(arguments, 1, { header: 'FormData.getAll' })
  20900. name = webidl.converters.USVString(name)
  20901. // 1. If there is no entry whose name is name in this’s entry list,
  20902. // then return the empty list.
  20903. // 2. Return the values of all entries whose name is name, in order,
  20904. // from this’s entry list.
  20905. return this[kState]
  20906. .filter((entry) => entry.name === name)
  20907. .map((entry) => entry.value)
  20908. }
  20909. has (name) {
  20910. webidl.brandCheck(this, FormData)
  20911. webidl.argumentLengthCheck(arguments, 1, { header: 'FormData.has' })
  20912. name = webidl.converters.USVString(name)
  20913. // The has(name) method steps are to return true if there is an entry
  20914. // whose name is name in this’s entry list; otherwise false.
  20915. return this[kState].findIndex((entry) => entry.name === name) !== -1
  20916. }
  20917. set (name, value, filename = undefined) {
  20918. webidl.brandCheck(this, FormData)
  20919. webidl.argumentLengthCheck(arguments, 2, { header: 'FormData.set' })
  20920. if (arguments.length === 3 && !isBlobLike(value)) {
  20921. throw new TypeError(
  20922. "Failed to execute 'set' on 'FormData': parameter 2 is not of type 'Blob'"
  20923. )
  20924. }
  20925. // The set(name, value) and set(name, blobValue, filename) method steps
  20926. // are:
  20927. // 1. Let value be value if given; otherwise blobValue.
  20928. name = webidl.converters.USVString(name)
  20929. value = isBlobLike(value)
  20930. ? webidl.converters.Blob(value, { strict: false })
  20931. : webidl.converters.USVString(value)
  20932. filename = arguments.length === 3
  20933. ? toUSVString(filename)
  20934. : undefined
  20935. // 2. Let entry be the result of creating an entry with name, value, and
  20936. // filename if given.
  20937. const entry = makeEntry(name, value, filename)
  20938. // 3. If there are entries in this’s entry list whose name is name, then
  20939. // replace the first such entry with entry and remove the others.
  20940. const idx = this[kState].findIndex((entry) => entry.name === name)
  20941. if (idx !== -1) {
  20942. this[kState] = [
  20943. ...this[kState].slice(0, idx),
  20944. entry,
  20945. ...this[kState].slice(idx + 1).filter((entry) => entry.name !== name)
  20946. ]
  20947. } else {
  20948. // 4. Otherwise, append entry to this’s entry list.
  20949. this[kState].push(entry)
  20950. }
  20951. }
  20952. entries () {
  20953. webidl.brandCheck(this, FormData)
  20954. return makeIterator(
  20955. () => this[kState].map(pair => [pair.name, pair.value]),
  20956. 'FormData',
  20957. 'key+value'
  20958. )
  20959. }
  20960. keys () {
  20961. webidl.brandCheck(this, FormData)
  20962. return makeIterator(
  20963. () => this[kState].map(pair => [pair.name, pair.value]),
  20964. 'FormData',
  20965. 'key'
  20966. )
  20967. }
  20968. values () {
  20969. webidl.brandCheck(this, FormData)
  20970. return makeIterator(
  20971. () => this[kState].map(pair => [pair.name, pair.value]),
  20972. 'FormData',
  20973. 'value'
  20974. )
  20975. }
  20976. /**
  20977. * @param {(value: string, key: string, self: FormData) => void} callbackFn
  20978. * @param {unknown} thisArg
  20979. */
  20980. forEach (callbackFn, thisArg = globalThis) {
  20981. webidl.brandCheck(this, FormData)
  20982. webidl.argumentLengthCheck(arguments, 1, { header: 'FormData.forEach' })
  20983. if (typeof callbackFn !== 'function') {
  20984. throw new TypeError(
  20985. "Failed to execute 'forEach' on 'FormData': parameter 1 is not of type 'Function'."
  20986. )
  20987. }
  20988. for (const [key, value] of this) {
  20989. callbackFn.apply(thisArg, [value, key, this])
  20990. }
  20991. }
  20992. }
  20993. FormData.prototype[Symbol.iterator] = FormData.prototype.entries
  20994. Object.defineProperties(FormData.prototype, {
  20995. [Symbol.toStringTag]: {
  20996. value: 'FormData',
  20997. configurable: true
  20998. }
  20999. })
  21000. /**
  21001. * @see https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#create-an-entry
  21002. * @param {string} name
  21003. * @param {string|Blob} value
  21004. * @param {?string} filename
  21005. * @returns
  21006. */
  21007. function makeEntry (name, value, filename) {
  21008. // 1. Set name to the result of converting name into a scalar value string.
  21009. // "To convert a string into a scalar value string, replace any surrogates
  21010. // with U+FFFD."
  21011. // see: https://nodejs.org/dist/latest-v18.x/docs/api/buffer.html#buftostringencoding-start-end
  21012. name = Buffer.from(name).toString('utf8')
  21013. // 2. If value is a string, then set value to the result of converting
  21014. // value into a scalar value string.
  21015. if (typeof value === 'string') {
  21016. value = Buffer.from(value).toString('utf8')
  21017. } else {
  21018. // 3. Otherwise:
  21019. // 1. If value is not a File object, then set value to a new File object,
  21020. // representing the same bytes, whose name attribute value is "blob"
  21021. if (!isFileLike(value)) {
  21022. value = value instanceof Blob
  21023. ? new File([value], 'blob', { type: value.type })
  21024. : new FileLike(value, 'blob', { type: value.type })
  21025. }
  21026. // 2. If filename is given, then set value to a new File object,
  21027. // representing the same bytes, whose name attribute is filename.
  21028. if (filename !== undefined) {
  21029. /** @type {FilePropertyBag} */
  21030. const options = {
  21031. type: value.type,
  21032. lastModified: value.lastModified
  21033. }
  21034. value = (NativeFile && value instanceof NativeFile) || value instanceof UndiciFile
  21035. ? new File([value], filename, options)
  21036. : new FileLike(value, filename, options)
  21037. }
  21038. }
  21039. // 4. Return an entry whose name is name and whose value is value.
  21040. return { name, value }
  21041. }
  21042. module.exports = { FormData }
  21043. /***/ }),
  21044. /***/ 1246:
  21045. /***/ ((module) => {
  21046. "use strict";
  21047. // In case of breaking changes, increase the version
  21048. // number to avoid conflicts.
  21049. const globalOrigin = Symbol.for('undici.globalOrigin.1')
  21050. function getGlobalOrigin () {
  21051. return globalThis[globalOrigin]
  21052. }
  21053. function setGlobalOrigin (newOrigin) {
  21054. if (newOrigin === undefined) {
  21055. Object.defineProperty(globalThis, globalOrigin, {
  21056. value: undefined,
  21057. writable: true,
  21058. enumerable: false,
  21059. configurable: false
  21060. })
  21061. return
  21062. }
  21063. const parsedURL = new URL(newOrigin)
  21064. if (parsedURL.protocol !== 'http:' && parsedURL.protocol !== 'https:') {
  21065. throw new TypeError(`Only http & https urls are allowed, received ${parsedURL.protocol}`)
  21066. }
  21067. Object.defineProperty(globalThis, globalOrigin, {
  21068. value: parsedURL,
  21069. writable: true,
  21070. enumerable: false,
  21071. configurable: false
  21072. })
  21073. }
  21074. module.exports = {
  21075. getGlobalOrigin,
  21076. setGlobalOrigin
  21077. }
  21078. /***/ }),
  21079. /***/ 554:
  21080. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  21081. "use strict";
  21082. // https://github.com/Ethan-Arrowood/undici-fetch
  21083. const { kHeadersList, kConstruct } = __nccwpck_require__(2785)
  21084. const { kGuard } = __nccwpck_require__(5861)
  21085. const { kEnumerableProperty } = __nccwpck_require__(3983)
  21086. const {
  21087. makeIterator,
  21088. isValidHeaderName,
  21089. isValidHeaderValue
  21090. } = __nccwpck_require__(2538)
  21091. const util = __nccwpck_require__(3837)
  21092. const { webidl } = __nccwpck_require__(1744)
  21093. const assert = __nccwpck_require__(9491)
  21094. const kHeadersMap = Symbol('headers map')
  21095. const kHeadersSortedMap = Symbol('headers map sorted')
  21096. /**
  21097. * @param {number} code
  21098. */
  21099. function isHTTPWhiteSpaceCharCode (code) {
  21100. return code === 0x00a || code === 0x00d || code === 0x009 || code === 0x020
  21101. }
  21102. /**
  21103. * @see https://fetch.spec.whatwg.org/#concept-header-value-normalize
  21104. * @param {string} potentialValue
  21105. */
  21106. function headerValueNormalize (potentialValue) {
  21107. // To normalize a byte sequence potentialValue, remove
  21108. // any leading and trailing HTTP whitespace bytes from
  21109. // potentialValue.
  21110. let i = 0; let j = potentialValue.length
  21111. while (j > i && isHTTPWhiteSpaceCharCode(potentialValue.charCodeAt(j - 1))) --j
  21112. while (j > i && isHTTPWhiteSpaceCharCode(potentialValue.charCodeAt(i))) ++i
  21113. return i === 0 && j === potentialValue.length ? potentialValue : potentialValue.substring(i, j)
  21114. }
  21115. function fill (headers, object) {
  21116. // To fill a Headers object headers with a given object object, run these steps:
  21117. // 1. If object is a sequence, then for each header in object:
  21118. // Note: webidl conversion to array has already been done.
  21119. if (Array.isArray(object)) {
  21120. for (let i = 0; i < object.length; ++i) {
  21121. const header = object[i]
  21122. // 1. If header does not contain exactly two items, then throw a TypeError.
  21123. if (header.length !== 2) {
  21124. throw webidl.errors.exception({
  21125. header: 'Headers constructor',
  21126. message: `expected name/value pair to be length 2, found ${header.length}.`
  21127. })
  21128. }
  21129. // 2. Append (header’s first item, header’s second item) to headers.
  21130. appendHeader(headers, header[0], header[1])
  21131. }
  21132. } else if (typeof object === 'object' && object !== null) {
  21133. // Note: null should throw
  21134. // 2. Otherwise, object is a record, then for each key → value in object,
  21135. // append (key, value) to headers
  21136. const keys = Object.keys(object)
  21137. for (let i = 0; i < keys.length; ++i) {
  21138. appendHeader(headers, keys[i], object[keys[i]])
  21139. }
  21140. } else {
  21141. throw webidl.errors.conversionFailed({
  21142. prefix: 'Headers constructor',
  21143. argument: 'Argument 1',
  21144. types: ['sequence<sequence<ByteString>>', 'record<ByteString, ByteString>']
  21145. })
  21146. }
  21147. }
  21148. /**
  21149. * @see https://fetch.spec.whatwg.org/#concept-headers-append
  21150. */
  21151. function appendHeader (headers, name, value) {
  21152. // 1. Normalize value.
  21153. value = headerValueNormalize(value)
  21154. // 2. If name is not a header name or value is not a
  21155. // header value, then throw a TypeError.
  21156. if (!isValidHeaderName(name)) {
  21157. throw webidl.errors.invalidArgument({
  21158. prefix: 'Headers.append',
  21159. value: name,
  21160. type: 'header name'
  21161. })
  21162. } else if (!isValidHeaderValue(value)) {
  21163. throw webidl.errors.invalidArgument({
  21164. prefix: 'Headers.append',
  21165. value,
  21166. type: 'header value'
  21167. })
  21168. }
  21169. // 3. If headers’s guard is "immutable", then throw a TypeError.
  21170. // 4. Otherwise, if headers’s guard is "request" and name is a
  21171. // forbidden header name, return.
  21172. // Note: undici does not implement forbidden header names
  21173. if (headers[kGuard] === 'immutable') {
  21174. throw new TypeError('immutable')
  21175. } else if (headers[kGuard] === 'request-no-cors') {
  21176. // 5. Otherwise, if headers’s guard is "request-no-cors":
  21177. // TODO
  21178. }
  21179. // 6. Otherwise, if headers’s guard is "response" and name is a
  21180. // forbidden response-header name, return.
  21181. // 7. Append (name, value) to headers’s header list.
  21182. return headers[kHeadersList].append(name, value)
  21183. // 8. If headers’s guard is "request-no-cors", then remove
  21184. // privileged no-CORS request headers from headers
  21185. }
  21186. class HeadersList {
  21187. /** @type {[string, string][]|null} */
  21188. cookies = null
  21189. constructor (init) {
  21190. if (init instanceof HeadersList) {
  21191. this[kHeadersMap] = new Map(init[kHeadersMap])
  21192. this[kHeadersSortedMap] = init[kHeadersSortedMap]
  21193. this.cookies = init.cookies === null ? null : [...init.cookies]
  21194. } else {
  21195. this[kHeadersMap] = new Map(init)
  21196. this[kHeadersSortedMap] = null
  21197. }
  21198. }
  21199. // https://fetch.spec.whatwg.org/#header-list-contains
  21200. contains (name) {
  21201. // A header list list contains a header name name if list
  21202. // contains a header whose name is a byte-case-insensitive
  21203. // match for name.
  21204. name = name.toLowerCase()
  21205. return this[kHeadersMap].has(name)
  21206. }
  21207. clear () {
  21208. this[kHeadersMap].clear()
  21209. this[kHeadersSortedMap] = null
  21210. this.cookies = null
  21211. }
  21212. // https://fetch.spec.whatwg.org/#concept-header-list-append
  21213. append (name, value) {
  21214. this[kHeadersSortedMap] = null
  21215. // 1. If list contains name, then set name to the first such
  21216. // header’s name.
  21217. const lowercaseName = name.toLowerCase()
  21218. const exists = this[kHeadersMap].get(lowercaseName)
  21219. // 2. Append (name, value) to list.
  21220. if (exists) {
  21221. const delimiter = lowercaseName === 'cookie' ? '; ' : ', '
  21222. this[kHeadersMap].set(lowercaseName, {
  21223. name: exists.name,
  21224. value: `${exists.value}${delimiter}${value}`
  21225. })
  21226. } else {
  21227. this[kHeadersMap].set(lowercaseName, { name, value })
  21228. }
  21229. if (lowercaseName === 'set-cookie') {
  21230. this.cookies ??= []
  21231. this.cookies.push(value)
  21232. }
  21233. }
  21234. // https://fetch.spec.whatwg.org/#concept-header-list-set
  21235. set (name, value) {
  21236. this[kHeadersSortedMap] = null
  21237. const lowercaseName = name.toLowerCase()
  21238. if (lowercaseName === 'set-cookie') {
  21239. this.cookies = [value]
  21240. }
  21241. // 1. If list contains name, then set the value of
  21242. // the first such header to value and remove the
  21243. // others.
  21244. // 2. Otherwise, append header (name, value) to list.
  21245. this[kHeadersMap].set(lowercaseName, { name, value })
  21246. }
  21247. // https://fetch.spec.whatwg.org/#concept-header-list-delete
  21248. delete (name) {
  21249. this[kHeadersSortedMap] = null
  21250. name = name.toLowerCase()
  21251. if (name === 'set-cookie') {
  21252. this.cookies = null
  21253. }
  21254. this[kHeadersMap].delete(name)
  21255. }
  21256. // https://fetch.spec.whatwg.org/#concept-header-list-get
  21257. get (name) {
  21258. const value = this[kHeadersMap].get(name.toLowerCase())
  21259. // 1. If list does not contain name, then return null.
  21260. // 2. Return the values of all headers in list whose name
  21261. // is a byte-case-insensitive match for name,
  21262. // separated from each other by 0x2C 0x20, in order.
  21263. return value === undefined ? null : value.value
  21264. }
  21265. * [Symbol.iterator] () {
  21266. // use the lowercased name
  21267. for (const [name, { value }] of this[kHeadersMap]) {
  21268. yield [name, value]
  21269. }
  21270. }
  21271. get entries () {
  21272. const headers = {}
  21273. if (this[kHeadersMap].size) {
  21274. for (const { name, value } of this[kHeadersMap].values()) {
  21275. headers[name] = value
  21276. }
  21277. }
  21278. return headers
  21279. }
  21280. }
  21281. // https://fetch.spec.whatwg.org/#headers-class
  21282. class Headers {
  21283. constructor (init = undefined) {
  21284. if (init === kConstruct) {
  21285. return
  21286. }
  21287. this[kHeadersList] = new HeadersList()
  21288. // The new Headers(init) constructor steps are:
  21289. // 1. Set this’s guard to "none".
  21290. this[kGuard] = 'none'
  21291. // 2. If init is given, then fill this with init.
  21292. if (init !== undefined) {
  21293. init = webidl.converters.HeadersInit(init)
  21294. fill(this, init)
  21295. }
  21296. }
  21297. // https://fetch.spec.whatwg.org/#dom-headers-append
  21298. append (name, value) {
  21299. webidl.brandCheck(this, Headers)
  21300. webidl.argumentLengthCheck(arguments, 2, { header: 'Headers.append' })
  21301. name = webidl.converters.ByteString(name)
  21302. value = webidl.converters.ByteString(value)
  21303. return appendHeader(this, name, value)
  21304. }
  21305. // https://fetch.spec.whatwg.org/#dom-headers-delete
  21306. delete (name) {
  21307. webidl.brandCheck(this, Headers)
  21308. webidl.argumentLengthCheck(arguments, 1, { header: 'Headers.delete' })
  21309. name = webidl.converters.ByteString(name)
  21310. // 1. If name is not a header name, then throw a TypeError.
  21311. if (!isValidHeaderName(name)) {
  21312. throw webidl.errors.invalidArgument({
  21313. prefix: 'Headers.delete',
  21314. value: name,
  21315. type: 'header name'
  21316. })
  21317. }
  21318. // 2. If this’s guard is "immutable", then throw a TypeError.
  21319. // 3. Otherwise, if this’s guard is "request" and name is a
  21320. // forbidden header name, return.
  21321. // 4. Otherwise, if this’s guard is "request-no-cors", name
  21322. // is not a no-CORS-safelisted request-header name, and
  21323. // name is not a privileged no-CORS request-header name,
  21324. // return.
  21325. // 5. Otherwise, if this’s guard is "response" and name is
  21326. // a forbidden response-header name, return.
  21327. // Note: undici does not implement forbidden header names
  21328. if (this[kGuard] === 'immutable') {
  21329. throw new TypeError('immutable')
  21330. } else if (this[kGuard] === 'request-no-cors') {
  21331. // TODO
  21332. }
  21333. // 6. If this’s header list does not contain name, then
  21334. // return.
  21335. if (!this[kHeadersList].contains(name)) {
  21336. return
  21337. }
  21338. // 7. Delete name from this’s header list.
  21339. // 8. If this’s guard is "request-no-cors", then remove
  21340. // privileged no-CORS request headers from this.
  21341. this[kHeadersList].delete(name)
  21342. }
  21343. // https://fetch.spec.whatwg.org/#dom-headers-get
  21344. get (name) {
  21345. webidl.brandCheck(this, Headers)
  21346. webidl.argumentLengthCheck(arguments, 1, { header: 'Headers.get' })
  21347. name = webidl.converters.ByteString(name)
  21348. // 1. If name is not a header name, then throw a TypeError.
  21349. if (!isValidHeaderName(name)) {
  21350. throw webidl.errors.invalidArgument({
  21351. prefix: 'Headers.get',
  21352. value: name,
  21353. type: 'header name'
  21354. })
  21355. }
  21356. // 2. Return the result of getting name from this’s header
  21357. // list.
  21358. return this[kHeadersList].get(name)
  21359. }
  21360. // https://fetch.spec.whatwg.org/#dom-headers-has
  21361. has (name) {
  21362. webidl.brandCheck(this, Headers)
  21363. webidl.argumentLengthCheck(arguments, 1, { header: 'Headers.has' })
  21364. name = webidl.converters.ByteString(name)
  21365. // 1. If name is not a header name, then throw a TypeError.
  21366. if (!isValidHeaderName(name)) {
  21367. throw webidl.errors.invalidArgument({
  21368. prefix: 'Headers.has',
  21369. value: name,
  21370. type: 'header name'
  21371. })
  21372. }
  21373. // 2. Return true if this’s header list contains name;
  21374. // otherwise false.
  21375. return this[kHeadersList].contains(name)
  21376. }
  21377. // https://fetch.spec.whatwg.org/#dom-headers-set
  21378. set (name, value) {
  21379. webidl.brandCheck(this, Headers)
  21380. webidl.argumentLengthCheck(arguments, 2, { header: 'Headers.set' })
  21381. name = webidl.converters.ByteString(name)
  21382. value = webidl.converters.ByteString(value)
  21383. // 1. Normalize value.
  21384. value = headerValueNormalize(value)
  21385. // 2. If name is not a header name or value is not a
  21386. // header value, then throw a TypeError.
  21387. if (!isValidHeaderName(name)) {
  21388. throw webidl.errors.invalidArgument({
  21389. prefix: 'Headers.set',
  21390. value: name,
  21391. type: 'header name'
  21392. })
  21393. } else if (!isValidHeaderValue(value)) {
  21394. throw webidl.errors.invalidArgument({
  21395. prefix: 'Headers.set',
  21396. value,
  21397. type: 'header value'
  21398. })
  21399. }
  21400. // 3. If this’s guard is "immutable", then throw a TypeError.
  21401. // 4. Otherwise, if this’s guard is "request" and name is a
  21402. // forbidden header name, return.
  21403. // 5. Otherwise, if this’s guard is "request-no-cors" and
  21404. // name/value is not a no-CORS-safelisted request-header,
  21405. // return.
  21406. // 6. Otherwise, if this’s guard is "response" and name is a
  21407. // forbidden response-header name, return.
  21408. // Note: undici does not implement forbidden header names
  21409. if (this[kGuard] === 'immutable') {
  21410. throw new TypeError('immutable')
  21411. } else if (this[kGuard] === 'request-no-cors') {
  21412. // TODO
  21413. }
  21414. // 7. Set (name, value) in this’s header list.
  21415. // 8. If this’s guard is "request-no-cors", then remove
  21416. // privileged no-CORS request headers from this
  21417. this[kHeadersList].set(name, value)
  21418. }
  21419. // https://fetch.spec.whatwg.org/#dom-headers-getsetcookie
  21420. getSetCookie () {
  21421. webidl.brandCheck(this, Headers)
  21422. // 1. If this’s header list does not contain `Set-Cookie`, then return « ».
  21423. // 2. Return the values of all headers in this’s header list whose name is
  21424. // a byte-case-insensitive match for `Set-Cookie`, in order.
  21425. const list = this[kHeadersList].cookies
  21426. if (list) {
  21427. return [...list]
  21428. }
  21429. return []
  21430. }
  21431. // https://fetch.spec.whatwg.org/#concept-header-list-sort-and-combine
  21432. get [kHeadersSortedMap] () {
  21433. if (this[kHeadersList][kHeadersSortedMap]) {
  21434. return this[kHeadersList][kHeadersSortedMap]
  21435. }
  21436. // 1. Let headers be an empty list of headers with the key being the name
  21437. // and value the value.
  21438. const headers = []
  21439. // 2. Let names be the result of convert header names to a sorted-lowercase
  21440. // set with all the names of the headers in list.
  21441. const names = [...this[kHeadersList]].sort((a, b) => a[0] < b[0] ? -1 : 1)
  21442. const cookies = this[kHeadersList].cookies
  21443. // 3. For each name of names:
  21444. for (let i = 0; i < names.length; ++i) {
  21445. const [name, value] = names[i]
  21446. // 1. If name is `set-cookie`, then:
  21447. if (name === 'set-cookie') {
  21448. // 1. Let values be a list of all values of headers in list whose name
  21449. // is a byte-case-insensitive match for name, in order.
  21450. // 2. For each value of values:
  21451. // 1. Append (name, value) to headers.
  21452. for (let j = 0; j < cookies.length; ++j) {
  21453. headers.push([name, cookies[j]])
  21454. }
  21455. } else {
  21456. // 2. Otherwise:
  21457. // 1. Let value be the result of getting name from list.
  21458. // 2. Assert: value is non-null.
  21459. assert(value !== null)
  21460. // 3. Append (name, value) to headers.
  21461. headers.push([name, value])
  21462. }
  21463. }
  21464. this[kHeadersList][kHeadersSortedMap] = headers
  21465. // 4. Return headers.
  21466. return headers
  21467. }
  21468. keys () {
  21469. webidl.brandCheck(this, Headers)
  21470. if (this[kGuard] === 'immutable') {
  21471. const value = this[kHeadersSortedMap]
  21472. return makeIterator(() => value, 'Headers',
  21473. 'key')
  21474. }
  21475. return makeIterator(
  21476. () => [...this[kHeadersSortedMap].values()],
  21477. 'Headers',
  21478. 'key'
  21479. )
  21480. }
  21481. values () {
  21482. webidl.brandCheck(this, Headers)
  21483. if (this[kGuard] === 'immutable') {
  21484. const value = this[kHeadersSortedMap]
  21485. return makeIterator(() => value, 'Headers',
  21486. 'value')
  21487. }
  21488. return makeIterator(
  21489. () => [...this[kHeadersSortedMap].values()],
  21490. 'Headers',
  21491. 'value'
  21492. )
  21493. }
  21494. entries () {
  21495. webidl.brandCheck(this, Headers)
  21496. if (this[kGuard] === 'immutable') {
  21497. const value = this[kHeadersSortedMap]
  21498. return makeIterator(() => value, 'Headers',
  21499. 'key+value')
  21500. }
  21501. return makeIterator(
  21502. () => [...this[kHeadersSortedMap].values()],
  21503. 'Headers',
  21504. 'key+value'
  21505. )
  21506. }
  21507. /**
  21508. * @param {(value: string, key: string, self: Headers) => void} callbackFn
  21509. * @param {unknown} thisArg
  21510. */
  21511. forEach (callbackFn, thisArg = globalThis) {
  21512. webidl.brandCheck(this, Headers)
  21513. webidl.argumentLengthCheck(arguments, 1, { header: 'Headers.forEach' })
  21514. if (typeof callbackFn !== 'function') {
  21515. throw new TypeError(
  21516. "Failed to execute 'forEach' on 'Headers': parameter 1 is not of type 'Function'."
  21517. )
  21518. }
  21519. for (const [key, value] of this) {
  21520. callbackFn.apply(thisArg, [value, key, this])
  21521. }
  21522. }
  21523. [Symbol.for('nodejs.util.inspect.custom')] () {
  21524. webidl.brandCheck(this, Headers)
  21525. return this[kHeadersList]
  21526. }
  21527. }
  21528. Headers.prototype[Symbol.iterator] = Headers.prototype.entries
  21529. Object.defineProperties(Headers.prototype, {
  21530. append: kEnumerableProperty,
  21531. delete: kEnumerableProperty,
  21532. get: kEnumerableProperty,
  21533. has: kEnumerableProperty,
  21534. set: kEnumerableProperty,
  21535. getSetCookie: kEnumerableProperty,
  21536. keys: kEnumerableProperty,
  21537. values: kEnumerableProperty,
  21538. entries: kEnumerableProperty,
  21539. forEach: kEnumerableProperty,
  21540. [Symbol.iterator]: { enumerable: false },
  21541. [Symbol.toStringTag]: {
  21542. value: 'Headers',
  21543. configurable: true
  21544. },
  21545. [util.inspect.custom]: {
  21546. enumerable: false
  21547. }
  21548. })
  21549. webidl.converters.HeadersInit = function (V) {
  21550. if (webidl.util.Type(V) === 'Object') {
  21551. if (V[Symbol.iterator]) {
  21552. return webidl.converters['sequence<sequence<ByteString>>'](V)
  21553. }
  21554. return webidl.converters['record<ByteString, ByteString>'](V)
  21555. }
  21556. throw webidl.errors.conversionFailed({
  21557. prefix: 'Headers constructor',
  21558. argument: 'Argument 1',
  21559. types: ['sequence<sequence<ByteString>>', 'record<ByteString, ByteString>']
  21560. })
  21561. }
  21562. module.exports = {
  21563. fill,
  21564. Headers,
  21565. HeadersList
  21566. }
  21567. /***/ }),
  21568. /***/ 4881:
  21569. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  21570. "use strict";
  21571. // https://github.com/Ethan-Arrowood/undici-fetch
  21572. const {
  21573. Response,
  21574. makeNetworkError,
  21575. makeAppropriateNetworkError,
  21576. filterResponse,
  21577. makeResponse
  21578. } = __nccwpck_require__(7823)
  21579. const { Headers } = __nccwpck_require__(554)
  21580. const { Request, makeRequest } = __nccwpck_require__(8359)
  21581. const zlib = __nccwpck_require__(9796)
  21582. const {
  21583. bytesMatch,
  21584. makePolicyContainer,
  21585. clonePolicyContainer,
  21586. requestBadPort,
  21587. TAOCheck,
  21588. appendRequestOriginHeader,
  21589. responseLocationURL,
  21590. requestCurrentURL,
  21591. setRequestReferrerPolicyOnRedirect,
  21592. tryUpgradeRequestToAPotentiallyTrustworthyURL,
  21593. createOpaqueTimingInfo,
  21594. appendFetchMetadata,
  21595. corsCheck,
  21596. crossOriginResourcePolicyCheck,
  21597. determineRequestsReferrer,
  21598. coarsenedSharedCurrentTime,
  21599. createDeferredPromise,
  21600. isBlobLike,
  21601. sameOrigin,
  21602. isCancelled,
  21603. isAborted,
  21604. isErrorLike,
  21605. fullyReadBody,
  21606. readableStreamClose,
  21607. isomorphicEncode,
  21608. urlIsLocal,
  21609. urlIsHttpHttpsScheme,
  21610. urlHasHttpsScheme
  21611. } = __nccwpck_require__(2538)
  21612. const { kState, kHeaders, kGuard, kRealm } = __nccwpck_require__(5861)
  21613. const assert = __nccwpck_require__(9491)
  21614. const { safelyExtractBody } = __nccwpck_require__(9990)
  21615. const {
  21616. redirectStatusSet,
  21617. nullBodyStatus,
  21618. safeMethodsSet,
  21619. requestBodyHeader,
  21620. subresourceSet,
  21621. DOMException
  21622. } = __nccwpck_require__(1037)
  21623. const { kHeadersList } = __nccwpck_require__(2785)
  21624. const EE = __nccwpck_require__(2361)
  21625. const { Readable, pipeline } = __nccwpck_require__(2781)
  21626. const { addAbortListener, isErrored, isReadable, nodeMajor, nodeMinor } = __nccwpck_require__(3983)
  21627. const { dataURLProcessor, serializeAMimeType } = __nccwpck_require__(685)
  21628. const { TransformStream } = __nccwpck_require__(5356)
  21629. const { getGlobalDispatcher } = __nccwpck_require__(1892)
  21630. const { webidl } = __nccwpck_require__(1744)
  21631. const { STATUS_CODES } = __nccwpck_require__(3685)
  21632. const GET_OR_HEAD = ['GET', 'HEAD']
  21633. /** @type {import('buffer').resolveObjectURL} */
  21634. let resolveObjectURL
  21635. let ReadableStream = globalThis.ReadableStream
  21636. class Fetch extends EE {
  21637. constructor (dispatcher) {
  21638. super()
  21639. this.dispatcher = dispatcher
  21640. this.connection = null
  21641. this.dump = false
  21642. this.state = 'ongoing'
  21643. // 2 terminated listeners get added per request,
  21644. // but only 1 gets removed. If there are 20 redirects,
  21645. // 21 listeners will be added.
  21646. // See https://github.com/nodejs/undici/issues/1711
  21647. // TODO (fix): Find and fix root cause for leaked listener.
  21648. this.setMaxListeners(21)
  21649. }
  21650. terminate (reason) {
  21651. if (this.state !== 'ongoing') {
  21652. return
  21653. }
  21654. this.state = 'terminated'
  21655. this.connection?.destroy(reason)
  21656. this.emit('terminated', reason)
  21657. }
  21658. // https://fetch.spec.whatwg.org/#fetch-controller-abort
  21659. abort (error) {
  21660. if (this.state !== 'ongoing') {
  21661. return
  21662. }
  21663. // 1. Set controller’s state to "aborted".
  21664. this.state = 'aborted'
  21665. // 2. Let fallbackError be an "AbortError" DOMException.
  21666. // 3. Set error to fallbackError if it is not given.
  21667. if (!error) {
  21668. error = new DOMException('The operation was aborted.', 'AbortError')
  21669. }
  21670. // 4. Let serializedError be StructuredSerialize(error).
  21671. // If that threw an exception, catch it, and let
  21672. // serializedError be StructuredSerialize(fallbackError).
  21673. // 5. Set controller’s serialized abort reason to serializedError.
  21674. this.serializedAbortReason = error
  21675. this.connection?.destroy(error)
  21676. this.emit('terminated', error)
  21677. }
  21678. }
  21679. // https://fetch.spec.whatwg.org/#fetch-method
  21680. function fetch (input, init = {}) {
  21681. webidl.argumentLengthCheck(arguments, 1, { header: 'globalThis.fetch' })
  21682. // 1. Let p be a new promise.
  21683. const p = createDeferredPromise()
  21684. // 2. Let requestObject be the result of invoking the initial value of
  21685. // Request as constructor with input and init as arguments. If this throws
  21686. // an exception, reject p with it and return p.
  21687. let requestObject
  21688. try {
  21689. requestObject = new Request(input, init)
  21690. } catch (e) {
  21691. p.reject(e)
  21692. return p.promise
  21693. }
  21694. // 3. Let request be requestObject’s request.
  21695. const request = requestObject[kState]
  21696. // 4. If requestObject’s signal’s aborted flag is set, then:
  21697. if (requestObject.signal.aborted) {
  21698. // 1. Abort the fetch() call with p, request, null, and
  21699. // requestObject’s signal’s abort reason.
  21700. abortFetch(p, request, null, requestObject.signal.reason)
  21701. // 2. Return p.
  21702. return p.promise
  21703. }
  21704. // 5. Let globalObject be request’s client’s global object.
  21705. const globalObject = request.client.globalObject
  21706. // 6. If globalObject is a ServiceWorkerGlobalScope object, then set
  21707. // request’s service-workers mode to "none".
  21708. if (globalObject?.constructor?.name === 'ServiceWorkerGlobalScope') {
  21709. request.serviceWorkers = 'none'
  21710. }
  21711. // 7. Let responseObject be null.
  21712. let responseObject = null
  21713. // 8. Let relevantRealm be this’s relevant Realm.
  21714. const relevantRealm = null
  21715. // 9. Let locallyAborted be false.
  21716. let locallyAborted = false
  21717. // 10. Let controller be null.
  21718. let controller = null
  21719. // 11. Add the following abort steps to requestObject’s signal:
  21720. addAbortListener(
  21721. requestObject.signal,
  21722. () => {
  21723. // 1. Set locallyAborted to true.
  21724. locallyAborted = true
  21725. // 2. Assert: controller is non-null.
  21726. assert(controller != null)
  21727. // 3. Abort controller with requestObject’s signal’s abort reason.
  21728. controller.abort(requestObject.signal.reason)
  21729. // 4. Abort the fetch() call with p, request, responseObject,
  21730. // and requestObject’s signal’s abort reason.
  21731. abortFetch(p, request, responseObject, requestObject.signal.reason)
  21732. }
  21733. )
  21734. // 12. Let handleFetchDone given response response be to finalize and
  21735. // report timing with response, globalObject, and "fetch".
  21736. const handleFetchDone = (response) =>
  21737. finalizeAndReportTiming(response, 'fetch')
  21738. // 13. Set controller to the result of calling fetch given request,
  21739. // with processResponseEndOfBody set to handleFetchDone, and processResponse
  21740. // given response being these substeps:
  21741. const processResponse = (response) => {
  21742. // 1. If locallyAborted is true, terminate these substeps.
  21743. if (locallyAborted) {
  21744. return Promise.resolve()
  21745. }
  21746. // 2. If response’s aborted flag is set, then:
  21747. if (response.aborted) {
  21748. // 1. Let deserializedError be the result of deserialize a serialized
  21749. // abort reason given controller’s serialized abort reason and
  21750. // relevantRealm.
  21751. // 2. Abort the fetch() call with p, request, responseObject, and
  21752. // deserializedError.
  21753. abortFetch(p, request, responseObject, controller.serializedAbortReason)
  21754. return Promise.resolve()
  21755. }
  21756. // 3. If response is a network error, then reject p with a TypeError
  21757. // and terminate these substeps.
  21758. if (response.type === 'error') {
  21759. p.reject(
  21760. Object.assign(new TypeError('fetch failed'), { cause: response.error })
  21761. )
  21762. return Promise.resolve()
  21763. }
  21764. // 4. Set responseObject to the result of creating a Response object,
  21765. // given response, "immutable", and relevantRealm.
  21766. responseObject = new Response()
  21767. responseObject[kState] = response
  21768. responseObject[kRealm] = relevantRealm
  21769. responseObject[kHeaders][kHeadersList] = response.headersList
  21770. responseObject[kHeaders][kGuard] = 'immutable'
  21771. responseObject[kHeaders][kRealm] = relevantRealm
  21772. // 5. Resolve p with responseObject.
  21773. p.resolve(responseObject)
  21774. }
  21775. controller = fetching({
  21776. request,
  21777. processResponseEndOfBody: handleFetchDone,
  21778. processResponse,
  21779. dispatcher: init.dispatcher ?? getGlobalDispatcher() // undici
  21780. })
  21781. // 14. Return p.
  21782. return p.promise
  21783. }
  21784. // https://fetch.spec.whatwg.org/#finalize-and-report-timing
  21785. function finalizeAndReportTiming (response, initiatorType = 'other') {
  21786. // 1. If response is an aborted network error, then return.
  21787. if (response.type === 'error' && response.aborted) {
  21788. return
  21789. }
  21790. // 2. If response’s URL list is null or empty, then return.
  21791. if (!response.urlList?.length) {
  21792. return
  21793. }
  21794. // 3. Let originalURL be response’s URL list[0].
  21795. const originalURL = response.urlList[0]
  21796. // 4. Let timingInfo be response’s timing info.
  21797. let timingInfo = response.timingInfo
  21798. // 5. Let cacheState be response’s cache state.
  21799. let cacheState = response.cacheState
  21800. // 6. If originalURL’s scheme is not an HTTP(S) scheme, then return.
  21801. if (!urlIsHttpHttpsScheme(originalURL)) {
  21802. return
  21803. }
  21804. // 7. If timingInfo is null, then return.
  21805. if (timingInfo === null) {
  21806. return
  21807. }
  21808. // 8. If response’s timing allow passed flag is not set, then:
  21809. if (!response.timingAllowPassed) {
  21810. // 1. Set timingInfo to a the result of creating an opaque timing info for timingInfo.
  21811. timingInfo = createOpaqueTimingInfo({
  21812. startTime: timingInfo.startTime
  21813. })
  21814. // 2. Set cacheState to the empty string.
  21815. cacheState = ''
  21816. }
  21817. // 9. Set timingInfo’s end time to the coarsened shared current time
  21818. // given global’s relevant settings object’s cross-origin isolated
  21819. // capability.
  21820. // TODO: given global’s relevant settings object’s cross-origin isolated
  21821. // capability?
  21822. timingInfo.endTime = coarsenedSharedCurrentTime()
  21823. // 10. Set response’s timing info to timingInfo.
  21824. response.timingInfo = timingInfo
  21825. // 11. Mark resource timing for timingInfo, originalURL, initiatorType,
  21826. // global, and cacheState.
  21827. markResourceTiming(
  21828. timingInfo,
  21829. originalURL,
  21830. initiatorType,
  21831. globalThis,
  21832. cacheState
  21833. )
  21834. }
  21835. // https://w3c.github.io/resource-timing/#dfn-mark-resource-timing
  21836. function markResourceTiming (timingInfo, originalURL, initiatorType, globalThis, cacheState) {
  21837. if (nodeMajor > 18 || (nodeMajor === 18 && nodeMinor >= 2)) {
  21838. performance.markResourceTiming(timingInfo, originalURL.href, initiatorType, globalThis, cacheState)
  21839. }
  21840. }
  21841. // https://fetch.spec.whatwg.org/#abort-fetch
  21842. function abortFetch (p, request, responseObject, error) {
  21843. // Note: AbortSignal.reason was added in node v17.2.0
  21844. // which would give us an undefined error to reject with.
  21845. // Remove this once node v16 is no longer supported.
  21846. if (!error) {
  21847. error = new DOMException('The operation was aborted.', 'AbortError')
  21848. }
  21849. // 1. Reject promise with error.
  21850. p.reject(error)
  21851. // 2. If request’s body is not null and is readable, then cancel request’s
  21852. // body with error.
  21853. if (request.body != null && isReadable(request.body?.stream)) {
  21854. request.body.stream.cancel(error).catch((err) => {
  21855. if (err.code === 'ERR_INVALID_STATE') {
  21856. // Node bug?
  21857. return
  21858. }
  21859. throw err
  21860. })
  21861. }
  21862. // 3. If responseObject is null, then return.
  21863. if (responseObject == null) {
  21864. return
  21865. }
  21866. // 4. Let response be responseObject’s response.
  21867. const response = responseObject[kState]
  21868. // 5. If response’s body is not null and is readable, then error response’s
  21869. // body with error.
  21870. if (response.body != null && isReadable(response.body?.stream)) {
  21871. response.body.stream.cancel(error).catch((err) => {
  21872. if (err.code === 'ERR_INVALID_STATE') {
  21873. // Node bug?
  21874. return
  21875. }
  21876. throw err
  21877. })
  21878. }
  21879. }
  21880. // https://fetch.spec.whatwg.org/#fetching
  21881. function fetching ({
  21882. request,
  21883. processRequestBodyChunkLength,
  21884. processRequestEndOfBody,
  21885. processResponse,
  21886. processResponseEndOfBody,
  21887. processResponseConsumeBody,
  21888. useParallelQueue = false,
  21889. dispatcher // undici
  21890. }) {
  21891. // 1. Let taskDestination be null.
  21892. let taskDestination = null
  21893. // 2. Let crossOriginIsolatedCapability be false.
  21894. let crossOriginIsolatedCapability = false
  21895. // 3. If request’s client is non-null, then:
  21896. if (request.client != null) {
  21897. // 1. Set taskDestination to request’s client’s global object.
  21898. taskDestination = request.client.globalObject
  21899. // 2. Set crossOriginIsolatedCapability to request’s client’s cross-origin
  21900. // isolated capability.
  21901. crossOriginIsolatedCapability =
  21902. request.client.crossOriginIsolatedCapability
  21903. }
  21904. // 4. If useParallelQueue is true, then set taskDestination to the result of
  21905. // starting a new parallel queue.
  21906. // TODO
  21907. // 5. Let timingInfo be a new fetch timing info whose start time and
  21908. // post-redirect start time are the coarsened shared current time given
  21909. // crossOriginIsolatedCapability.
  21910. const currenTime = coarsenedSharedCurrentTime(crossOriginIsolatedCapability)
  21911. const timingInfo = createOpaqueTimingInfo({
  21912. startTime: currenTime
  21913. })
  21914. // 6. Let fetchParams be a new fetch params whose
  21915. // request is request,
  21916. // timing info is timingInfo,
  21917. // process request body chunk length is processRequestBodyChunkLength,
  21918. // process request end-of-body is processRequestEndOfBody,
  21919. // process response is processResponse,
  21920. // process response consume body is processResponseConsumeBody,
  21921. // process response end-of-body is processResponseEndOfBody,
  21922. // task destination is taskDestination,
  21923. // and cross-origin isolated capability is crossOriginIsolatedCapability.
  21924. const fetchParams = {
  21925. controller: new Fetch(dispatcher),
  21926. request,
  21927. timingInfo,
  21928. processRequestBodyChunkLength,
  21929. processRequestEndOfBody,
  21930. processResponse,
  21931. processResponseConsumeBody,
  21932. processResponseEndOfBody,
  21933. taskDestination,
  21934. crossOriginIsolatedCapability
  21935. }
  21936. // 7. If request’s body is a byte sequence, then set request’s body to
  21937. // request’s body as a body.
  21938. // NOTE: Since fetching is only called from fetch, body should already be
  21939. // extracted.
  21940. assert(!request.body || request.body.stream)
  21941. // 8. If request’s window is "client", then set request’s window to request’s
  21942. // client, if request’s client’s global object is a Window object; otherwise
  21943. // "no-window".
  21944. if (request.window === 'client') {
  21945. // TODO: What if request.client is null?
  21946. request.window =
  21947. request.client?.globalObject?.constructor?.name === 'Window'
  21948. ? request.client
  21949. : 'no-window'
  21950. }
  21951. // 9. If request’s origin is "client", then set request’s origin to request’s
  21952. // client’s origin.
  21953. if (request.origin === 'client') {
  21954. // TODO: What if request.client is null?
  21955. request.origin = request.client?.origin
  21956. }
  21957. // 10. If all of the following conditions are true:
  21958. // TODO
  21959. // 11. If request’s policy container is "client", then:
  21960. if (request.policyContainer === 'client') {
  21961. // 1. If request’s client is non-null, then set request’s policy
  21962. // container to a clone of request’s client’s policy container. [HTML]
  21963. if (request.client != null) {
  21964. request.policyContainer = clonePolicyContainer(
  21965. request.client.policyContainer
  21966. )
  21967. } else {
  21968. // 2. Otherwise, set request’s policy container to a new policy
  21969. // container.
  21970. request.policyContainer = makePolicyContainer()
  21971. }
  21972. }
  21973. // 12. If request’s header list does not contain `Accept`, then:
  21974. if (!request.headersList.contains('accept')) {
  21975. // 1. Let value be `*/*`.
  21976. const value = '*/*'
  21977. // 2. A user agent should set value to the first matching statement, if
  21978. // any, switching on request’s destination:
  21979. // "document"
  21980. // "frame"
  21981. // "iframe"
  21982. // `text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8`
  21983. // "image"
  21984. // `image/png,image/svg+xml,image/*;q=0.8,*/*;q=0.5`
  21985. // "style"
  21986. // `text/css,*/*;q=0.1`
  21987. // TODO
  21988. // 3. Append `Accept`/value to request’s header list.
  21989. request.headersList.append('accept', value)
  21990. }
  21991. // 13. If request’s header list does not contain `Accept-Language`, then
  21992. // user agents should append `Accept-Language`/an appropriate value to
  21993. // request’s header list.
  21994. if (!request.headersList.contains('accept-language')) {
  21995. request.headersList.append('accept-language', '*')
  21996. }
  21997. // 14. If request’s priority is null, then use request’s initiator and
  21998. // destination appropriately in setting request’s priority to a
  21999. // user-agent-defined object.
  22000. if (request.priority === null) {
  22001. // TODO
  22002. }
  22003. // 15. If request is a subresource request, then:
  22004. if (subresourceSet.has(request.destination)) {
  22005. // TODO
  22006. }
  22007. // 16. Run main fetch given fetchParams.
  22008. mainFetch(fetchParams)
  22009. .catch(err => {
  22010. fetchParams.controller.terminate(err)
  22011. })
  22012. // 17. Return fetchParam's controller
  22013. return fetchParams.controller
  22014. }
  22015. // https://fetch.spec.whatwg.org/#concept-main-fetch
  22016. async function mainFetch (fetchParams, recursive = false) {
  22017. // 1. Let request be fetchParams’s request.
  22018. const request = fetchParams.request
  22019. // 2. Let response be null.
  22020. let response = null
  22021. // 3. If request’s local-URLs-only flag is set and request’s current URL is
  22022. // not local, then set response to a network error.
  22023. if (request.localURLsOnly && !urlIsLocal(requestCurrentURL(request))) {
  22024. response = makeNetworkError('local URLs only')
  22025. }
  22026. // 4. Run report Content Security Policy violations for request.
  22027. // TODO
  22028. // 5. Upgrade request to a potentially trustworthy URL, if appropriate.
  22029. tryUpgradeRequestToAPotentiallyTrustworthyURL(request)
  22030. // 6. If should request be blocked due to a bad port, should fetching request
  22031. // be blocked as mixed content, or should request be blocked by Content
  22032. // Security Policy returns blocked, then set response to a network error.
  22033. if (requestBadPort(request) === 'blocked') {
  22034. response = makeNetworkError('bad port')
  22035. }
  22036. // TODO: should fetching request be blocked as mixed content?
  22037. // TODO: should request be blocked by Content Security Policy?
  22038. // 7. If request’s referrer policy is the empty string, then set request’s
  22039. // referrer policy to request’s policy container’s referrer policy.
  22040. if (request.referrerPolicy === '') {
  22041. request.referrerPolicy = request.policyContainer.referrerPolicy
  22042. }
  22043. // 8. If request’s referrer is not "no-referrer", then set request’s
  22044. // referrer to the result of invoking determine request’s referrer.
  22045. if (request.referrer !== 'no-referrer') {
  22046. request.referrer = determineRequestsReferrer(request)
  22047. }
  22048. // 9. Set request’s current URL’s scheme to "https" if all of the following
  22049. // conditions are true:
  22050. // - request’s current URL’s scheme is "http"
  22051. // - request’s current URL’s host is a domain
  22052. // - Matching request’s current URL’s host per Known HSTS Host Domain Name
  22053. // Matching results in either a superdomain match with an asserted
  22054. // includeSubDomains directive or a congruent match (with or without an
  22055. // asserted includeSubDomains directive). [HSTS]
  22056. // TODO
  22057. // 10. If recursive is false, then run the remaining steps in parallel.
  22058. // TODO
  22059. // 11. If response is null, then set response to the result of running
  22060. // the steps corresponding to the first matching statement:
  22061. if (response === null) {
  22062. response = await (async () => {
  22063. const currentURL = requestCurrentURL(request)
  22064. if (
  22065. // - request’s current URL’s origin is same origin with request’s origin,
  22066. // and request’s response tainting is "basic"
  22067. (sameOrigin(currentURL, request.url) && request.responseTainting === 'basic') ||
  22068. // request’s current URL’s scheme is "data"
  22069. (currentURL.protocol === 'data:') ||
  22070. // - request’s mode is "navigate" or "websocket"
  22071. (request.mode === 'navigate' || request.mode === 'websocket')
  22072. ) {
  22073. // 1. Set request’s response tainting to "basic".
  22074. request.responseTainting = 'basic'
  22075. // 2. Return the result of running scheme fetch given fetchParams.
  22076. return await schemeFetch(fetchParams)
  22077. }
  22078. // request’s mode is "same-origin"
  22079. if (request.mode === 'same-origin') {
  22080. // 1. Return a network error.
  22081. return makeNetworkError('request mode cannot be "same-origin"')
  22082. }
  22083. // request’s mode is "no-cors"
  22084. if (request.mode === 'no-cors') {
  22085. // 1. If request’s redirect mode is not "follow", then return a network
  22086. // error.
  22087. if (request.redirect !== 'follow') {
  22088. return makeNetworkError(
  22089. 'redirect mode cannot be "follow" for "no-cors" request'
  22090. )
  22091. }
  22092. // 2. Set request’s response tainting to "opaque".
  22093. request.responseTainting = 'opaque'
  22094. // 3. Return the result of running scheme fetch given fetchParams.
  22095. return await schemeFetch(fetchParams)
  22096. }
  22097. // request’s current URL’s scheme is not an HTTP(S) scheme
  22098. if (!urlIsHttpHttpsScheme(requestCurrentURL(request))) {
  22099. // Return a network error.
  22100. return makeNetworkError('URL scheme must be a HTTP(S) scheme')
  22101. }
  22102. // - request’s use-CORS-preflight flag is set
  22103. // - request’s unsafe-request flag is set and either request’s method is
  22104. // not a CORS-safelisted method or CORS-unsafe request-header names with
  22105. // request’s header list is not empty
  22106. // 1. Set request’s response tainting to "cors".
  22107. // 2. Let corsWithPreflightResponse be the result of running HTTP fetch
  22108. // given fetchParams and true.
  22109. // 3. If corsWithPreflightResponse is a network error, then clear cache
  22110. // entries using request.
  22111. // 4. Return corsWithPreflightResponse.
  22112. // TODO
  22113. // Otherwise
  22114. // 1. Set request’s response tainting to "cors".
  22115. request.responseTainting = 'cors'
  22116. // 2. Return the result of running HTTP fetch given fetchParams.
  22117. return await httpFetch(fetchParams)
  22118. })()
  22119. }
  22120. // 12. If recursive is true, then return response.
  22121. if (recursive) {
  22122. return response
  22123. }
  22124. // 13. If response is not a network error and response is not a filtered
  22125. // response, then:
  22126. if (response.status !== 0 && !response.internalResponse) {
  22127. // If request’s response tainting is "cors", then:
  22128. if (request.responseTainting === 'cors') {
  22129. // 1. Let headerNames be the result of extracting header list values
  22130. // given `Access-Control-Expose-Headers` and response’s header list.
  22131. // TODO
  22132. // 2. If request’s credentials mode is not "include" and headerNames
  22133. // contains `*`, then set response’s CORS-exposed header-name list to
  22134. // all unique header names in response’s header list.
  22135. // TODO
  22136. // 3. Otherwise, if headerNames is not null or failure, then set
  22137. // response’s CORS-exposed header-name list to headerNames.
  22138. // TODO
  22139. }
  22140. // Set response to the following filtered response with response as its
  22141. // internal response, depending on request’s response tainting:
  22142. if (request.responseTainting === 'basic') {
  22143. response = filterResponse(response, 'basic')
  22144. } else if (request.responseTainting === 'cors') {
  22145. response = filterResponse(response, 'cors')
  22146. } else if (request.responseTainting === 'opaque') {
  22147. response = filterResponse(response, 'opaque')
  22148. } else {
  22149. assert(false)
  22150. }
  22151. }
  22152. // 14. Let internalResponse be response, if response is a network error,
  22153. // and response’s internal response otherwise.
  22154. let internalResponse =
  22155. response.status === 0 ? response : response.internalResponse
  22156. // 15. If internalResponse’s URL list is empty, then set it to a clone of
  22157. // request’s URL list.
  22158. if (internalResponse.urlList.length === 0) {
  22159. internalResponse.urlList.push(...request.urlList)
  22160. }
  22161. // 16. If request’s timing allow failed flag is unset, then set
  22162. // internalResponse’s timing allow passed flag.
  22163. if (!request.timingAllowFailed) {
  22164. response.timingAllowPassed = true
  22165. }
  22166. // 17. If response is not a network error and any of the following returns
  22167. // blocked
  22168. // - should internalResponse to request be blocked as mixed content
  22169. // - should internalResponse to request be blocked by Content Security Policy
  22170. // - should internalResponse to request be blocked due to its MIME type
  22171. // - should internalResponse to request be blocked due to nosniff
  22172. // TODO
  22173. // 18. If response’s type is "opaque", internalResponse’s status is 206,
  22174. // internalResponse’s range-requested flag is set, and request’s header
  22175. // list does not contain `Range`, then set response and internalResponse
  22176. // to a network error.
  22177. if (
  22178. response.type === 'opaque' &&
  22179. internalResponse.status === 206 &&
  22180. internalResponse.rangeRequested &&
  22181. !request.headers.contains('range')
  22182. ) {
  22183. response = internalResponse = makeNetworkError()
  22184. }
  22185. // 19. If response is not a network error and either request’s method is
  22186. // `HEAD` or `CONNECT`, or internalResponse’s status is a null body status,
  22187. // set internalResponse’s body to null and disregard any enqueuing toward
  22188. // it (if any).
  22189. if (
  22190. response.status !== 0 &&
  22191. (request.method === 'HEAD' ||
  22192. request.method === 'CONNECT' ||
  22193. nullBodyStatus.includes(internalResponse.status))
  22194. ) {
  22195. internalResponse.body = null
  22196. fetchParams.controller.dump = true
  22197. }
  22198. // 20. If request’s integrity metadata is not the empty string, then:
  22199. if (request.integrity) {
  22200. // 1. Let processBodyError be this step: run fetch finale given fetchParams
  22201. // and a network error.
  22202. const processBodyError = (reason) =>
  22203. fetchFinale(fetchParams, makeNetworkError(reason))
  22204. // 2. If request’s response tainting is "opaque", or response’s body is null,
  22205. // then run processBodyError and abort these steps.
  22206. if (request.responseTainting === 'opaque' || response.body == null) {
  22207. processBodyError(response.error)
  22208. return
  22209. }
  22210. // 3. Let processBody given bytes be these steps:
  22211. const processBody = (bytes) => {
  22212. // 1. If bytes do not match request’s integrity metadata,
  22213. // then run processBodyError and abort these steps. [SRI]
  22214. if (!bytesMatch(bytes, request.integrity)) {
  22215. processBodyError('integrity mismatch')
  22216. return
  22217. }
  22218. // 2. Set response’s body to bytes as a body.
  22219. response.body = safelyExtractBody(bytes)[0]
  22220. // 3. Run fetch finale given fetchParams and response.
  22221. fetchFinale(fetchParams, response)
  22222. }
  22223. // 4. Fully read response’s body given processBody and processBodyError.
  22224. await fullyReadBody(response.body, processBody, processBodyError)
  22225. } else {
  22226. // 21. Otherwise, run fetch finale given fetchParams and response.
  22227. fetchFinale(fetchParams, response)
  22228. }
  22229. }
  22230. // https://fetch.spec.whatwg.org/#concept-scheme-fetch
  22231. // given a fetch params fetchParams
  22232. function schemeFetch (fetchParams) {
  22233. // Note: since the connection is destroyed on redirect, which sets fetchParams to a
  22234. // cancelled state, we do not want this condition to trigger *unless* there have been
  22235. // no redirects. See https://github.com/nodejs/undici/issues/1776
  22236. // 1. If fetchParams is canceled, then return the appropriate network error for fetchParams.
  22237. if (isCancelled(fetchParams) && fetchParams.request.redirectCount === 0) {
  22238. return Promise.resolve(makeAppropriateNetworkError(fetchParams))
  22239. }
  22240. // 2. Let request be fetchParams’s request.
  22241. const { request } = fetchParams
  22242. const { protocol: scheme } = requestCurrentURL(request)
  22243. // 3. Switch on request’s current URL’s scheme and run the associated steps:
  22244. switch (scheme) {
  22245. case 'about:': {
  22246. // If request’s current URL’s path is the string "blank", then return a new response
  22247. // whose status message is `OK`, header list is « (`Content-Type`, `text/html;charset=utf-8`) »,
  22248. // and body is the empty byte sequence as a body.
  22249. // Otherwise, return a network error.
  22250. return Promise.resolve(makeNetworkError('about scheme is not supported'))
  22251. }
  22252. case 'blob:': {
  22253. if (!resolveObjectURL) {
  22254. resolveObjectURL = (__nccwpck_require__(4300).resolveObjectURL)
  22255. }
  22256. // 1. Let blobURLEntry be request’s current URL’s blob URL entry.
  22257. const blobURLEntry = requestCurrentURL(request)
  22258. // https://github.com/web-platform-tests/wpt/blob/7b0ebaccc62b566a1965396e5be7bb2bc06f841f/FileAPI/url/resources/fetch-tests.js#L52-L56
  22259. // Buffer.resolveObjectURL does not ignore URL queries.
  22260. if (blobURLEntry.search.length !== 0) {
  22261. return Promise.resolve(makeNetworkError('NetworkError when attempting to fetch resource.'))
  22262. }
  22263. const blobURLEntryObject = resolveObjectURL(blobURLEntry.toString())
  22264. // 2. If request’s method is not `GET`, blobURLEntry is null, or blobURLEntry’s
  22265. // object is not a Blob object, then return a network error.
  22266. if (request.method !== 'GET' || !isBlobLike(blobURLEntryObject)) {
  22267. return Promise.resolve(makeNetworkError('invalid method'))
  22268. }
  22269. // 3. Let bodyWithType be the result of safely extracting blobURLEntry’s object.
  22270. const bodyWithType = safelyExtractBody(blobURLEntryObject)
  22271. // 4. Let body be bodyWithType’s body.
  22272. const body = bodyWithType[0]
  22273. // 5. Let length be body’s length, serialized and isomorphic encoded.
  22274. const length = isomorphicEncode(`${body.length}`)
  22275. // 6. Let type be bodyWithType’s type if it is non-null; otherwise the empty byte sequence.
  22276. const type = bodyWithType[1] ?? ''
  22277. // 7. Return a new response whose status message is `OK`, header list is
  22278. // « (`Content-Length`, length), (`Content-Type`, type) », and body is body.
  22279. const response = makeResponse({
  22280. statusText: 'OK',
  22281. headersList: [
  22282. ['content-length', { name: 'Content-Length', value: length }],
  22283. ['content-type', { name: 'Content-Type', value: type }]
  22284. ]
  22285. })
  22286. response.body = body
  22287. return Promise.resolve(response)
  22288. }
  22289. case 'data:': {
  22290. // 1. Let dataURLStruct be the result of running the
  22291. // data: URL processor on request’s current URL.
  22292. const currentURL = requestCurrentURL(request)
  22293. const dataURLStruct = dataURLProcessor(currentURL)
  22294. // 2. If dataURLStruct is failure, then return a
  22295. // network error.
  22296. if (dataURLStruct === 'failure') {
  22297. return Promise.resolve(makeNetworkError('failed to fetch the data URL'))
  22298. }
  22299. // 3. Let mimeType be dataURLStruct’s MIME type, serialized.
  22300. const mimeType = serializeAMimeType(dataURLStruct.mimeType)
  22301. // 4. Return a response whose status message is `OK`,
  22302. // header list is « (`Content-Type`, mimeType) »,
  22303. // and body is dataURLStruct’s body as a body.
  22304. return Promise.resolve(makeResponse({
  22305. statusText: 'OK',
  22306. headersList: [
  22307. ['content-type', { name: 'Content-Type', value: mimeType }]
  22308. ],
  22309. body: safelyExtractBody(dataURLStruct.body)[0]
  22310. }))
  22311. }
  22312. case 'file:': {
  22313. // For now, unfortunate as it is, file URLs are left as an exercise for the reader.
  22314. // When in doubt, return a network error.
  22315. return Promise.resolve(makeNetworkError('not implemented... yet...'))
  22316. }
  22317. case 'http:':
  22318. case 'https:': {
  22319. // Return the result of running HTTP fetch given fetchParams.
  22320. return httpFetch(fetchParams)
  22321. .catch((err) => makeNetworkError(err))
  22322. }
  22323. default: {
  22324. return Promise.resolve(makeNetworkError('unknown scheme'))
  22325. }
  22326. }
  22327. }
  22328. // https://fetch.spec.whatwg.org/#finalize-response
  22329. function finalizeResponse (fetchParams, response) {
  22330. // 1. Set fetchParams’s request’s done flag.
  22331. fetchParams.request.done = true
  22332. // 2, If fetchParams’s process response done is not null, then queue a fetch
  22333. // task to run fetchParams’s process response done given response, with
  22334. // fetchParams’s task destination.
  22335. if (fetchParams.processResponseDone != null) {
  22336. queueMicrotask(() => fetchParams.processResponseDone(response))
  22337. }
  22338. }
  22339. // https://fetch.spec.whatwg.org/#fetch-finale
  22340. function fetchFinale (fetchParams, response) {
  22341. // 1. If response is a network error, then:
  22342. if (response.type === 'error') {
  22343. // 1. Set response’s URL list to « fetchParams’s request’s URL list[0] ».
  22344. response.urlList = [fetchParams.request.urlList[0]]
  22345. // 2. Set response’s timing info to the result of creating an opaque timing
  22346. // info for fetchParams’s timing info.
  22347. response.timingInfo = createOpaqueTimingInfo({
  22348. startTime: fetchParams.timingInfo.startTime
  22349. })
  22350. }
  22351. // 2. Let processResponseEndOfBody be the following steps:
  22352. const processResponseEndOfBody = () => {
  22353. // 1. Set fetchParams’s request’s done flag.
  22354. fetchParams.request.done = true
  22355. // If fetchParams’s process response end-of-body is not null,
  22356. // then queue a fetch task to run fetchParams’s process response
  22357. // end-of-body given response with fetchParams’s task destination.
  22358. if (fetchParams.processResponseEndOfBody != null) {
  22359. queueMicrotask(() => fetchParams.processResponseEndOfBody(response))
  22360. }
  22361. }
  22362. // 3. If fetchParams’s process response is non-null, then queue a fetch task
  22363. // to run fetchParams’s process response given response, with fetchParams’s
  22364. // task destination.
  22365. if (fetchParams.processResponse != null) {
  22366. queueMicrotask(() => fetchParams.processResponse(response))
  22367. }
  22368. // 4. If response’s body is null, then run processResponseEndOfBody.
  22369. if (response.body == null) {
  22370. processResponseEndOfBody()
  22371. } else {
  22372. // 5. Otherwise:
  22373. // 1. Let transformStream be a new a TransformStream.
  22374. // 2. Let identityTransformAlgorithm be an algorithm which, given chunk,
  22375. // enqueues chunk in transformStream.
  22376. const identityTransformAlgorithm = (chunk, controller) => {
  22377. controller.enqueue(chunk)
  22378. }
  22379. // 3. Set up transformStream with transformAlgorithm set to identityTransformAlgorithm
  22380. // and flushAlgorithm set to processResponseEndOfBody.
  22381. const transformStream = new TransformStream({
  22382. start () {},
  22383. transform: identityTransformAlgorithm,
  22384. flush: processResponseEndOfBody
  22385. }, {
  22386. size () {
  22387. return 1
  22388. }
  22389. }, {
  22390. size () {
  22391. return 1
  22392. }
  22393. })
  22394. // 4. Set response’s body to the result of piping response’s body through transformStream.
  22395. response.body = { stream: response.body.stream.pipeThrough(transformStream) }
  22396. }
  22397. // 6. If fetchParams’s process response consume body is non-null, then:
  22398. if (fetchParams.processResponseConsumeBody != null) {
  22399. // 1. Let processBody given nullOrBytes be this step: run fetchParams’s
  22400. // process response consume body given response and nullOrBytes.
  22401. const processBody = (nullOrBytes) => fetchParams.processResponseConsumeBody(response, nullOrBytes)
  22402. // 2. Let processBodyError be this step: run fetchParams’s process
  22403. // response consume body given response and failure.
  22404. const processBodyError = (failure) => fetchParams.processResponseConsumeBody(response, failure)
  22405. // 3. If response’s body is null, then queue a fetch task to run processBody
  22406. // given null, with fetchParams’s task destination.
  22407. if (response.body == null) {
  22408. queueMicrotask(() => processBody(null))
  22409. } else {
  22410. // 4. Otherwise, fully read response’s body given processBody, processBodyError,
  22411. // and fetchParams’s task destination.
  22412. return fullyReadBody(response.body, processBody, processBodyError)
  22413. }
  22414. return Promise.resolve()
  22415. }
  22416. }
  22417. // https://fetch.spec.whatwg.org/#http-fetch
  22418. async function httpFetch (fetchParams) {
  22419. // 1. Let request be fetchParams’s request.
  22420. const request = fetchParams.request
  22421. // 2. Let response be null.
  22422. let response = null
  22423. // 3. Let actualResponse be null.
  22424. let actualResponse = null
  22425. // 4. Let timingInfo be fetchParams’s timing info.
  22426. const timingInfo = fetchParams.timingInfo
  22427. // 5. If request’s service-workers mode is "all", then:
  22428. if (request.serviceWorkers === 'all') {
  22429. // TODO
  22430. }
  22431. // 6. If response is null, then:
  22432. if (response === null) {
  22433. // 1. If makeCORSPreflight is true and one of these conditions is true:
  22434. // TODO
  22435. // 2. If request’s redirect mode is "follow", then set request’s
  22436. // service-workers mode to "none".
  22437. if (request.redirect === 'follow') {
  22438. request.serviceWorkers = 'none'
  22439. }
  22440. // 3. Set response and actualResponse to the result of running
  22441. // HTTP-network-or-cache fetch given fetchParams.
  22442. actualResponse = response = await httpNetworkOrCacheFetch(fetchParams)
  22443. // 4. If request’s response tainting is "cors" and a CORS check
  22444. // for request and response returns failure, then return a network error.
  22445. if (
  22446. request.responseTainting === 'cors' &&
  22447. corsCheck(request, response) === 'failure'
  22448. ) {
  22449. return makeNetworkError('cors failure')
  22450. }
  22451. // 5. If the TAO check for request and response returns failure, then set
  22452. // request’s timing allow failed flag.
  22453. if (TAOCheck(request, response) === 'failure') {
  22454. request.timingAllowFailed = true
  22455. }
  22456. }
  22457. // 7. If either request’s response tainting or response’s type
  22458. // is "opaque", and the cross-origin resource policy check with
  22459. // request’s origin, request’s client, request’s destination,
  22460. // and actualResponse returns blocked, then return a network error.
  22461. if (
  22462. (request.responseTainting === 'opaque' || response.type === 'opaque') &&
  22463. crossOriginResourcePolicyCheck(
  22464. request.origin,
  22465. request.client,
  22466. request.destination,
  22467. actualResponse
  22468. ) === 'blocked'
  22469. ) {
  22470. return makeNetworkError('blocked')
  22471. }
  22472. // 8. If actualResponse’s status is a redirect status, then:
  22473. if (redirectStatusSet.has(actualResponse.status)) {
  22474. // 1. If actualResponse’s status is not 303, request’s body is not null,
  22475. // and the connection uses HTTP/2, then user agents may, and are even
  22476. // encouraged to, transmit an RST_STREAM frame.
  22477. // See, https://github.com/whatwg/fetch/issues/1288
  22478. if (request.redirect !== 'manual') {
  22479. fetchParams.controller.connection.destroy()
  22480. }
  22481. // 2. Switch on request’s redirect mode:
  22482. if (request.redirect === 'error') {
  22483. // Set response to a network error.
  22484. response = makeNetworkError('unexpected redirect')
  22485. } else if (request.redirect === 'manual') {
  22486. // Set response to an opaque-redirect filtered response whose internal
  22487. // response is actualResponse.
  22488. // NOTE(spec): On the web this would return an `opaqueredirect` response,
  22489. // but that doesn't make sense server side.
  22490. // See https://github.com/nodejs/undici/issues/1193.
  22491. response = actualResponse
  22492. } else if (request.redirect === 'follow') {
  22493. // Set response to the result of running HTTP-redirect fetch given
  22494. // fetchParams and response.
  22495. response = await httpRedirectFetch(fetchParams, response)
  22496. } else {
  22497. assert(false)
  22498. }
  22499. }
  22500. // 9. Set response’s timing info to timingInfo.
  22501. response.timingInfo = timingInfo
  22502. // 10. Return response.
  22503. return response
  22504. }
  22505. // https://fetch.spec.whatwg.org/#http-redirect-fetch
  22506. function httpRedirectFetch (fetchParams, response) {
  22507. // 1. Let request be fetchParams’s request.
  22508. const request = fetchParams.request
  22509. // 2. Let actualResponse be response, if response is not a filtered response,
  22510. // and response’s internal response otherwise.
  22511. const actualResponse = response.internalResponse
  22512. ? response.internalResponse
  22513. : response
  22514. // 3. Let locationURL be actualResponse’s location URL given request’s current
  22515. // URL’s fragment.
  22516. let locationURL
  22517. try {
  22518. locationURL = responseLocationURL(
  22519. actualResponse,
  22520. requestCurrentURL(request).hash
  22521. )
  22522. // 4. If locationURL is null, then return response.
  22523. if (locationURL == null) {
  22524. return response
  22525. }
  22526. } catch (err) {
  22527. // 5. If locationURL is failure, then return a network error.
  22528. return Promise.resolve(makeNetworkError(err))
  22529. }
  22530. // 6. If locationURL’s scheme is not an HTTP(S) scheme, then return a network
  22531. // error.
  22532. if (!urlIsHttpHttpsScheme(locationURL)) {
  22533. return Promise.resolve(makeNetworkError('URL scheme must be a HTTP(S) scheme'))
  22534. }
  22535. // 7. If request’s redirect count is 20, then return a network error.
  22536. if (request.redirectCount === 20) {
  22537. return Promise.resolve(makeNetworkError('redirect count exceeded'))
  22538. }
  22539. // 8. Increase request’s redirect count by 1.
  22540. request.redirectCount += 1
  22541. // 9. If request’s mode is "cors", locationURL includes credentials, and
  22542. // request’s origin is not same origin with locationURL’s origin, then return
  22543. // a network error.
  22544. if (
  22545. request.mode === 'cors' &&
  22546. (locationURL.username || locationURL.password) &&
  22547. !sameOrigin(request, locationURL)
  22548. ) {
  22549. return Promise.resolve(makeNetworkError('cross origin not allowed for request mode "cors"'))
  22550. }
  22551. // 10. If request’s response tainting is "cors" and locationURL includes
  22552. // credentials, then return a network error.
  22553. if (
  22554. request.responseTainting === 'cors' &&
  22555. (locationURL.username || locationURL.password)
  22556. ) {
  22557. return Promise.resolve(makeNetworkError(
  22558. 'URL cannot contain credentials for request mode "cors"'
  22559. ))
  22560. }
  22561. // 11. If actualResponse’s status is not 303, request’s body is non-null,
  22562. // and request’s body’s source is null, then return a network error.
  22563. if (
  22564. actualResponse.status !== 303 &&
  22565. request.body != null &&
  22566. request.body.source == null
  22567. ) {
  22568. return Promise.resolve(makeNetworkError())
  22569. }
  22570. // 12. If one of the following is true
  22571. // - actualResponse’s status is 301 or 302 and request’s method is `POST`
  22572. // - actualResponse’s status is 303 and request’s method is not `GET` or `HEAD`
  22573. if (
  22574. ([301, 302].includes(actualResponse.status) && request.method === 'POST') ||
  22575. (actualResponse.status === 303 &&
  22576. !GET_OR_HEAD.includes(request.method))
  22577. ) {
  22578. // then:
  22579. // 1. Set request’s method to `GET` and request’s body to null.
  22580. request.method = 'GET'
  22581. request.body = null
  22582. // 2. For each headerName of request-body-header name, delete headerName from
  22583. // request’s header list.
  22584. for (const headerName of requestBodyHeader) {
  22585. request.headersList.delete(headerName)
  22586. }
  22587. }
  22588. // 13. If request’s current URL’s origin is not same origin with locationURL’s
  22589. // origin, then for each headerName of CORS non-wildcard request-header name,
  22590. // delete headerName from request’s header list.
  22591. if (!sameOrigin(requestCurrentURL(request), locationURL)) {
  22592. // https://fetch.spec.whatwg.org/#cors-non-wildcard-request-header-name
  22593. request.headersList.delete('authorization')
  22594. // https://fetch.spec.whatwg.org/#authentication-entries
  22595. request.headersList.delete('proxy-authorization', true)
  22596. // "Cookie" and "Host" are forbidden request-headers, which undici doesn't implement.
  22597. request.headersList.delete('cookie')
  22598. request.headersList.delete('host')
  22599. }
  22600. // 14. If request’s body is non-null, then set request’s body to the first return
  22601. // value of safely extracting request’s body’s source.
  22602. if (request.body != null) {
  22603. assert(request.body.source != null)
  22604. request.body = safelyExtractBody(request.body.source)[0]
  22605. }
  22606. // 15. Let timingInfo be fetchParams’s timing info.
  22607. const timingInfo = fetchParams.timingInfo
  22608. // 16. Set timingInfo’s redirect end time and post-redirect start time to the
  22609. // coarsened shared current time given fetchParams’s cross-origin isolated
  22610. // capability.
  22611. timingInfo.redirectEndTime = timingInfo.postRedirectStartTime =
  22612. coarsenedSharedCurrentTime(fetchParams.crossOriginIsolatedCapability)
  22613. // 17. If timingInfo’s redirect start time is 0, then set timingInfo’s
  22614. // redirect start time to timingInfo’s start time.
  22615. if (timingInfo.redirectStartTime === 0) {
  22616. timingInfo.redirectStartTime = timingInfo.startTime
  22617. }
  22618. // 18. Append locationURL to request’s URL list.
  22619. request.urlList.push(locationURL)
  22620. // 19. Invoke set request’s referrer policy on redirect on request and
  22621. // actualResponse.
  22622. setRequestReferrerPolicyOnRedirect(request, actualResponse)
  22623. // 20. Return the result of running main fetch given fetchParams and true.
  22624. return mainFetch(fetchParams, true)
  22625. }
  22626. // https://fetch.spec.whatwg.org/#http-network-or-cache-fetch
  22627. async function httpNetworkOrCacheFetch (
  22628. fetchParams,
  22629. isAuthenticationFetch = false,
  22630. isNewConnectionFetch = false
  22631. ) {
  22632. // 1. Let request be fetchParams’s request.
  22633. const request = fetchParams.request
  22634. // 2. Let httpFetchParams be null.
  22635. let httpFetchParams = null
  22636. // 3. Let httpRequest be null.
  22637. let httpRequest = null
  22638. // 4. Let response be null.
  22639. let response = null
  22640. // 5. Let storedResponse be null.
  22641. // TODO: cache
  22642. // 6. Let httpCache be null.
  22643. const httpCache = null
  22644. // 7. Let the revalidatingFlag be unset.
  22645. const revalidatingFlag = false
  22646. // 8. Run these steps, but abort when the ongoing fetch is terminated:
  22647. // 1. If request’s window is "no-window" and request’s redirect mode is
  22648. // "error", then set httpFetchParams to fetchParams and httpRequest to
  22649. // request.
  22650. if (request.window === 'no-window' && request.redirect === 'error') {
  22651. httpFetchParams = fetchParams
  22652. httpRequest = request
  22653. } else {
  22654. // Otherwise:
  22655. // 1. Set httpRequest to a clone of request.
  22656. httpRequest = makeRequest(request)
  22657. // 2. Set httpFetchParams to a copy of fetchParams.
  22658. httpFetchParams = { ...fetchParams }
  22659. // 3. Set httpFetchParams’s request to httpRequest.
  22660. httpFetchParams.request = httpRequest
  22661. }
  22662. // 3. Let includeCredentials be true if one of
  22663. const includeCredentials =
  22664. request.credentials === 'include' ||
  22665. (request.credentials === 'same-origin' &&
  22666. request.responseTainting === 'basic')
  22667. // 4. Let contentLength be httpRequest’s body’s length, if httpRequest’s
  22668. // body is non-null; otherwise null.
  22669. const contentLength = httpRequest.body ? httpRequest.body.length : null
  22670. // 5. Let contentLengthHeaderValue be null.
  22671. let contentLengthHeaderValue = null
  22672. // 6. If httpRequest’s body is null and httpRequest’s method is `POST` or
  22673. // `PUT`, then set contentLengthHeaderValue to `0`.
  22674. if (
  22675. httpRequest.body == null &&
  22676. ['POST', 'PUT'].includes(httpRequest.method)
  22677. ) {
  22678. contentLengthHeaderValue = '0'
  22679. }
  22680. // 7. If contentLength is non-null, then set contentLengthHeaderValue to
  22681. // contentLength, serialized and isomorphic encoded.
  22682. if (contentLength != null) {
  22683. contentLengthHeaderValue = isomorphicEncode(`${contentLength}`)
  22684. }
  22685. // 8. If contentLengthHeaderValue is non-null, then append
  22686. // `Content-Length`/contentLengthHeaderValue to httpRequest’s header
  22687. // list.
  22688. if (contentLengthHeaderValue != null) {
  22689. httpRequest.headersList.append('content-length', contentLengthHeaderValue)
  22690. }
  22691. // 9. If contentLengthHeaderValue is non-null, then append (`Content-Length`,
  22692. // contentLengthHeaderValue) to httpRequest’s header list.
  22693. // 10. If contentLength is non-null and httpRequest’s keepalive is true,
  22694. // then:
  22695. if (contentLength != null && httpRequest.keepalive) {
  22696. // NOTE: keepalive is a noop outside of browser context.
  22697. }
  22698. // 11. If httpRequest’s referrer is a URL, then append
  22699. // `Referer`/httpRequest’s referrer, serialized and isomorphic encoded,
  22700. // to httpRequest’s header list.
  22701. if (httpRequest.referrer instanceof URL) {
  22702. httpRequest.headersList.append('referer', isomorphicEncode(httpRequest.referrer.href))
  22703. }
  22704. // 12. Append a request `Origin` header for httpRequest.
  22705. appendRequestOriginHeader(httpRequest)
  22706. // 13. Append the Fetch metadata headers for httpRequest. [FETCH-METADATA]
  22707. appendFetchMetadata(httpRequest)
  22708. // 14. If httpRequest’s header list does not contain `User-Agent`, then
  22709. // user agents should append `User-Agent`/default `User-Agent` value to
  22710. // httpRequest’s header list.
  22711. if (!httpRequest.headersList.contains('user-agent')) {
  22712. httpRequest.headersList.append('user-agent', typeof esbuildDetection === 'undefined' ? 'undici' : 'node')
  22713. }
  22714. // 15. If httpRequest’s cache mode is "default" and httpRequest’s header
  22715. // list contains `If-Modified-Since`, `If-None-Match`,
  22716. // `If-Unmodified-Since`, `If-Match`, or `If-Range`, then set
  22717. // httpRequest’s cache mode to "no-store".
  22718. if (
  22719. httpRequest.cache === 'default' &&
  22720. (httpRequest.headersList.contains('if-modified-since') ||
  22721. httpRequest.headersList.contains('if-none-match') ||
  22722. httpRequest.headersList.contains('if-unmodified-since') ||
  22723. httpRequest.headersList.contains('if-match') ||
  22724. httpRequest.headersList.contains('if-range'))
  22725. ) {
  22726. httpRequest.cache = 'no-store'
  22727. }
  22728. // 16. If httpRequest’s cache mode is "no-cache", httpRequest’s prevent
  22729. // no-cache cache-control header modification flag is unset, and
  22730. // httpRequest’s header list does not contain `Cache-Control`, then append
  22731. // `Cache-Control`/`max-age=0` to httpRequest’s header list.
  22732. if (
  22733. httpRequest.cache === 'no-cache' &&
  22734. !httpRequest.preventNoCacheCacheControlHeaderModification &&
  22735. !httpRequest.headersList.contains('cache-control')
  22736. ) {
  22737. httpRequest.headersList.append('cache-control', 'max-age=0')
  22738. }
  22739. // 17. If httpRequest’s cache mode is "no-store" or "reload", then:
  22740. if (httpRequest.cache === 'no-store' || httpRequest.cache === 'reload') {
  22741. // 1. If httpRequest’s header list does not contain `Pragma`, then append
  22742. // `Pragma`/`no-cache` to httpRequest’s header list.
  22743. if (!httpRequest.headersList.contains('pragma')) {
  22744. httpRequest.headersList.append('pragma', 'no-cache')
  22745. }
  22746. // 2. If httpRequest’s header list does not contain `Cache-Control`,
  22747. // then append `Cache-Control`/`no-cache` to httpRequest’s header list.
  22748. if (!httpRequest.headersList.contains('cache-control')) {
  22749. httpRequest.headersList.append('cache-control', 'no-cache')
  22750. }
  22751. }
  22752. // 18. If httpRequest’s header list contains `Range`, then append
  22753. // `Accept-Encoding`/`identity` to httpRequest’s header list.
  22754. if (httpRequest.headersList.contains('range')) {
  22755. httpRequest.headersList.append('accept-encoding', 'identity')
  22756. }
  22757. // 19. Modify httpRequest’s header list per HTTP. Do not append a given
  22758. // header if httpRequest’s header list contains that header’s name.
  22759. // TODO: https://github.com/whatwg/fetch/issues/1285#issuecomment-896560129
  22760. if (!httpRequest.headersList.contains('accept-encoding')) {
  22761. if (urlHasHttpsScheme(requestCurrentURL(httpRequest))) {
  22762. httpRequest.headersList.append('accept-encoding', 'br, gzip, deflate')
  22763. } else {
  22764. httpRequest.headersList.append('accept-encoding', 'gzip, deflate')
  22765. }
  22766. }
  22767. httpRequest.headersList.delete('host')
  22768. // 20. If includeCredentials is true, then:
  22769. if (includeCredentials) {
  22770. // 1. If the user agent is not configured to block cookies for httpRequest
  22771. // (see section 7 of [COOKIES]), then:
  22772. // TODO: credentials
  22773. // 2. If httpRequest’s header list does not contain `Authorization`, then:
  22774. // TODO: credentials
  22775. }
  22776. // 21. If there’s a proxy-authentication entry, use it as appropriate.
  22777. // TODO: proxy-authentication
  22778. // 22. Set httpCache to the result of determining the HTTP cache
  22779. // partition, given httpRequest.
  22780. // TODO: cache
  22781. // 23. If httpCache is null, then set httpRequest’s cache mode to
  22782. // "no-store".
  22783. if (httpCache == null) {
  22784. httpRequest.cache = 'no-store'
  22785. }
  22786. // 24. If httpRequest’s cache mode is neither "no-store" nor "reload",
  22787. // then:
  22788. if (httpRequest.mode !== 'no-store' && httpRequest.mode !== 'reload') {
  22789. // TODO: cache
  22790. }
  22791. // 9. If aborted, then return the appropriate network error for fetchParams.
  22792. // TODO
  22793. // 10. If response is null, then:
  22794. if (response == null) {
  22795. // 1. If httpRequest’s cache mode is "only-if-cached", then return a
  22796. // network error.
  22797. if (httpRequest.mode === 'only-if-cached') {
  22798. return makeNetworkError('only if cached')
  22799. }
  22800. // 2. Let forwardResponse be the result of running HTTP-network fetch
  22801. // given httpFetchParams, includeCredentials, and isNewConnectionFetch.
  22802. const forwardResponse = await httpNetworkFetch(
  22803. httpFetchParams,
  22804. includeCredentials,
  22805. isNewConnectionFetch
  22806. )
  22807. // 3. If httpRequest’s method is unsafe and forwardResponse’s status is
  22808. // in the range 200 to 399, inclusive, invalidate appropriate stored
  22809. // responses in httpCache, as per the "Invalidation" chapter of HTTP
  22810. // Caching, and set storedResponse to null. [HTTP-CACHING]
  22811. if (
  22812. !safeMethodsSet.has(httpRequest.method) &&
  22813. forwardResponse.status >= 200 &&
  22814. forwardResponse.status <= 399
  22815. ) {
  22816. // TODO: cache
  22817. }
  22818. // 4. If the revalidatingFlag is set and forwardResponse’s status is 304,
  22819. // then:
  22820. if (revalidatingFlag && forwardResponse.status === 304) {
  22821. // TODO: cache
  22822. }
  22823. // 5. If response is null, then:
  22824. if (response == null) {
  22825. // 1. Set response to forwardResponse.
  22826. response = forwardResponse
  22827. // 2. Store httpRequest and forwardResponse in httpCache, as per the
  22828. // "Storing Responses in Caches" chapter of HTTP Caching. [HTTP-CACHING]
  22829. // TODO: cache
  22830. }
  22831. }
  22832. // 11. Set response’s URL list to a clone of httpRequest’s URL list.
  22833. response.urlList = [...httpRequest.urlList]
  22834. // 12. If httpRequest’s header list contains `Range`, then set response’s
  22835. // range-requested flag.
  22836. if (httpRequest.headersList.contains('range')) {
  22837. response.rangeRequested = true
  22838. }
  22839. // 13. Set response’s request-includes-credentials to includeCredentials.
  22840. response.requestIncludesCredentials = includeCredentials
  22841. // 14. If response’s status is 401, httpRequest’s response tainting is not
  22842. // "cors", includeCredentials is true, and request’s window is an environment
  22843. // settings object, then:
  22844. // TODO
  22845. // 15. If response’s status is 407, then:
  22846. if (response.status === 407) {
  22847. // 1. If request’s window is "no-window", then return a network error.
  22848. if (request.window === 'no-window') {
  22849. return makeNetworkError()
  22850. }
  22851. // 2. ???
  22852. // 3. If fetchParams is canceled, then return the appropriate network error for fetchParams.
  22853. if (isCancelled(fetchParams)) {
  22854. return makeAppropriateNetworkError(fetchParams)
  22855. }
  22856. // 4. Prompt the end user as appropriate in request’s window and store
  22857. // the result as a proxy-authentication entry. [HTTP-AUTH]
  22858. // TODO: Invoke some kind of callback?
  22859. // 5. Set response to the result of running HTTP-network-or-cache fetch given
  22860. // fetchParams.
  22861. // TODO
  22862. return makeNetworkError('proxy authentication required')
  22863. }
  22864. // 16. If all of the following are true
  22865. if (
  22866. // response’s status is 421
  22867. response.status === 421 &&
  22868. // isNewConnectionFetch is false
  22869. !isNewConnectionFetch &&
  22870. // request’s body is null, or request’s body is non-null and request’s body’s source is non-null
  22871. (request.body == null || request.body.source != null)
  22872. ) {
  22873. // then:
  22874. // 1. If fetchParams is canceled, then return the appropriate network error for fetchParams.
  22875. if (isCancelled(fetchParams)) {
  22876. return makeAppropriateNetworkError(fetchParams)
  22877. }
  22878. // 2. Set response to the result of running HTTP-network-or-cache
  22879. // fetch given fetchParams, isAuthenticationFetch, and true.
  22880. // TODO (spec): The spec doesn't specify this but we need to cancel
  22881. // the active response before we can start a new one.
  22882. // https://github.com/whatwg/fetch/issues/1293
  22883. fetchParams.controller.connection.destroy()
  22884. response = await httpNetworkOrCacheFetch(
  22885. fetchParams,
  22886. isAuthenticationFetch,
  22887. true
  22888. )
  22889. }
  22890. // 17. If isAuthenticationFetch is true, then create an authentication entry
  22891. if (isAuthenticationFetch) {
  22892. // TODO
  22893. }
  22894. // 18. Return response.
  22895. return response
  22896. }
  22897. // https://fetch.spec.whatwg.org/#http-network-fetch
  22898. async function httpNetworkFetch (
  22899. fetchParams,
  22900. includeCredentials = false,
  22901. forceNewConnection = false
  22902. ) {
  22903. assert(!fetchParams.controller.connection || fetchParams.controller.connection.destroyed)
  22904. fetchParams.controller.connection = {
  22905. abort: null,
  22906. destroyed: false,
  22907. destroy (err) {
  22908. if (!this.destroyed) {
  22909. this.destroyed = true
  22910. this.abort?.(err ?? new DOMException('The operation was aborted.', 'AbortError'))
  22911. }
  22912. }
  22913. }
  22914. // 1. Let request be fetchParams’s request.
  22915. const request = fetchParams.request
  22916. // 2. Let response be null.
  22917. let response = null
  22918. // 3. Let timingInfo be fetchParams’s timing info.
  22919. const timingInfo = fetchParams.timingInfo
  22920. // 4. Let httpCache be the result of determining the HTTP cache partition,
  22921. // given request.
  22922. // TODO: cache
  22923. const httpCache = null
  22924. // 5. If httpCache is null, then set request’s cache mode to "no-store".
  22925. if (httpCache == null) {
  22926. request.cache = 'no-store'
  22927. }
  22928. // 6. Let networkPartitionKey be the result of determining the network
  22929. // partition key given request.
  22930. // TODO
  22931. // 7. Let newConnection be "yes" if forceNewConnection is true; otherwise
  22932. // "no".
  22933. const newConnection = forceNewConnection ? 'yes' : 'no' // eslint-disable-line no-unused-vars
  22934. // 8. Switch on request’s mode:
  22935. if (request.mode === 'websocket') {
  22936. // Let connection be the result of obtaining a WebSocket connection,
  22937. // given request’s current URL.
  22938. // TODO
  22939. } else {
  22940. // Let connection be the result of obtaining a connection, given
  22941. // networkPartitionKey, request’s current URL’s origin,
  22942. // includeCredentials, and forceNewConnection.
  22943. // TODO
  22944. }
  22945. // 9. Run these steps, but abort when the ongoing fetch is terminated:
  22946. // 1. If connection is failure, then return a network error.
  22947. // 2. Set timingInfo’s final connection timing info to the result of
  22948. // calling clamp and coarsen connection timing info with connection’s
  22949. // timing info, timingInfo’s post-redirect start time, and fetchParams’s
  22950. // cross-origin isolated capability.
  22951. // 3. If connection is not an HTTP/2 connection, request’s body is non-null,
  22952. // and request’s body’s source is null, then append (`Transfer-Encoding`,
  22953. // `chunked`) to request’s header list.
  22954. // 4. Set timingInfo’s final network-request start time to the coarsened
  22955. // shared current time given fetchParams’s cross-origin isolated
  22956. // capability.
  22957. // 5. Set response to the result of making an HTTP request over connection
  22958. // using request with the following caveats:
  22959. // - Follow the relevant requirements from HTTP. [HTTP] [HTTP-SEMANTICS]
  22960. // [HTTP-COND] [HTTP-CACHING] [HTTP-AUTH]
  22961. // - If request’s body is non-null, and request’s body’s source is null,
  22962. // then the user agent may have a buffer of up to 64 kibibytes and store
  22963. // a part of request’s body in that buffer. If the user agent reads from
  22964. // request’s body beyond that buffer’s size and the user agent needs to
  22965. // resend request, then instead return a network error.
  22966. // - Set timingInfo’s final network-response start time to the coarsened
  22967. // shared current time given fetchParams’s cross-origin isolated capability,
  22968. // immediately after the user agent’s HTTP parser receives the first byte
  22969. // of the response (e.g., frame header bytes for HTTP/2 or response status
  22970. // line for HTTP/1.x).
  22971. // - Wait until all the headers are transmitted.
  22972. // - Any responses whose status is in the range 100 to 199, inclusive,
  22973. // and is not 101, are to be ignored, except for the purposes of setting
  22974. // timingInfo’s final network-response start time above.
  22975. // - If request’s header list contains `Transfer-Encoding`/`chunked` and
  22976. // response is transferred via HTTP/1.0 or older, then return a network
  22977. // error.
  22978. // - If the HTTP request results in a TLS client certificate dialog, then:
  22979. // 1. If request’s window is an environment settings object, make the
  22980. // dialog available in request’s window.
  22981. // 2. Otherwise, return a network error.
  22982. // To transmit request’s body body, run these steps:
  22983. let requestBody = null
  22984. // 1. If body is null and fetchParams’s process request end-of-body is
  22985. // non-null, then queue a fetch task given fetchParams’s process request
  22986. // end-of-body and fetchParams’s task destination.
  22987. if (request.body == null && fetchParams.processRequestEndOfBody) {
  22988. queueMicrotask(() => fetchParams.processRequestEndOfBody())
  22989. } else if (request.body != null) {
  22990. // 2. Otherwise, if body is non-null:
  22991. // 1. Let processBodyChunk given bytes be these steps:
  22992. const processBodyChunk = async function * (bytes) {
  22993. // 1. If the ongoing fetch is terminated, then abort these steps.
  22994. if (isCancelled(fetchParams)) {
  22995. return
  22996. }
  22997. // 2. Run this step in parallel: transmit bytes.
  22998. yield bytes
  22999. // 3. If fetchParams’s process request body is non-null, then run
  23000. // fetchParams’s process request body given bytes’s length.
  23001. fetchParams.processRequestBodyChunkLength?.(bytes.byteLength)
  23002. }
  23003. // 2. Let processEndOfBody be these steps:
  23004. const processEndOfBody = () => {
  23005. // 1. If fetchParams is canceled, then abort these steps.
  23006. if (isCancelled(fetchParams)) {
  23007. return
  23008. }
  23009. // 2. If fetchParams’s process request end-of-body is non-null,
  23010. // then run fetchParams’s process request end-of-body.
  23011. if (fetchParams.processRequestEndOfBody) {
  23012. fetchParams.processRequestEndOfBody()
  23013. }
  23014. }
  23015. // 3. Let processBodyError given e be these steps:
  23016. const processBodyError = (e) => {
  23017. // 1. If fetchParams is canceled, then abort these steps.
  23018. if (isCancelled(fetchParams)) {
  23019. return
  23020. }
  23021. // 2. If e is an "AbortError" DOMException, then abort fetchParams’s controller.
  23022. if (e.name === 'AbortError') {
  23023. fetchParams.controller.abort()
  23024. } else {
  23025. fetchParams.controller.terminate(e)
  23026. }
  23027. }
  23028. // 4. Incrementally read request’s body given processBodyChunk, processEndOfBody,
  23029. // processBodyError, and fetchParams’s task destination.
  23030. requestBody = (async function * () {
  23031. try {
  23032. for await (const bytes of request.body.stream) {
  23033. yield * processBodyChunk(bytes)
  23034. }
  23035. processEndOfBody()
  23036. } catch (err) {
  23037. processBodyError(err)
  23038. }
  23039. })()
  23040. }
  23041. try {
  23042. // socket is only provided for websockets
  23043. const { body, status, statusText, headersList, socket } = await dispatch({ body: requestBody })
  23044. if (socket) {
  23045. response = makeResponse({ status, statusText, headersList, socket })
  23046. } else {
  23047. const iterator = body[Symbol.asyncIterator]()
  23048. fetchParams.controller.next = () => iterator.next()
  23049. response = makeResponse({ status, statusText, headersList })
  23050. }
  23051. } catch (err) {
  23052. // 10. If aborted, then:
  23053. if (err.name === 'AbortError') {
  23054. // 1. If connection uses HTTP/2, then transmit an RST_STREAM frame.
  23055. fetchParams.controller.connection.destroy()
  23056. // 2. Return the appropriate network error for fetchParams.
  23057. return makeAppropriateNetworkError(fetchParams, err)
  23058. }
  23059. return makeNetworkError(err)
  23060. }
  23061. // 11. Let pullAlgorithm be an action that resumes the ongoing fetch
  23062. // if it is suspended.
  23063. const pullAlgorithm = () => {
  23064. fetchParams.controller.resume()
  23065. }
  23066. // 12. Let cancelAlgorithm be an algorithm that aborts fetchParams’s
  23067. // controller with reason, given reason.
  23068. const cancelAlgorithm = (reason) => {
  23069. fetchParams.controller.abort(reason)
  23070. }
  23071. // 13. Let highWaterMark be a non-negative, non-NaN number, chosen by
  23072. // the user agent.
  23073. // TODO
  23074. // 14. Let sizeAlgorithm be an algorithm that accepts a chunk object
  23075. // and returns a non-negative, non-NaN, non-infinite number, chosen by the user agent.
  23076. // TODO
  23077. // 15. Let stream be a new ReadableStream.
  23078. // 16. Set up stream with pullAlgorithm set to pullAlgorithm,
  23079. // cancelAlgorithm set to cancelAlgorithm, highWaterMark set to
  23080. // highWaterMark, and sizeAlgorithm set to sizeAlgorithm.
  23081. if (!ReadableStream) {
  23082. ReadableStream = (__nccwpck_require__(5356).ReadableStream)
  23083. }
  23084. const stream = new ReadableStream(
  23085. {
  23086. async start (controller) {
  23087. fetchParams.controller.controller = controller
  23088. },
  23089. async pull (controller) {
  23090. await pullAlgorithm(controller)
  23091. },
  23092. async cancel (reason) {
  23093. await cancelAlgorithm(reason)
  23094. }
  23095. },
  23096. {
  23097. highWaterMark: 0,
  23098. size () {
  23099. return 1
  23100. }
  23101. }
  23102. )
  23103. // 17. Run these steps, but abort when the ongoing fetch is terminated:
  23104. // 1. Set response’s body to a new body whose stream is stream.
  23105. response.body = { stream }
  23106. // 2. If response is not a network error and request’s cache mode is
  23107. // not "no-store", then update response in httpCache for request.
  23108. // TODO
  23109. // 3. If includeCredentials is true and the user agent is not configured
  23110. // to block cookies for request (see section 7 of [COOKIES]), then run the
  23111. // "set-cookie-string" parsing algorithm (see section 5.2 of [COOKIES]) on
  23112. // the value of each header whose name is a byte-case-insensitive match for
  23113. // `Set-Cookie` in response’s header list, if any, and request’s current URL.
  23114. // TODO
  23115. // 18. If aborted, then:
  23116. // TODO
  23117. // 19. Run these steps in parallel:
  23118. // 1. Run these steps, but abort when fetchParams is canceled:
  23119. fetchParams.controller.on('terminated', onAborted)
  23120. fetchParams.controller.resume = async () => {
  23121. // 1. While true
  23122. while (true) {
  23123. // 1-3. See onData...
  23124. // 4. Set bytes to the result of handling content codings given
  23125. // codings and bytes.
  23126. let bytes
  23127. let isFailure
  23128. try {
  23129. const { done, value } = await fetchParams.controller.next()
  23130. if (isAborted(fetchParams)) {
  23131. break
  23132. }
  23133. bytes = done ? undefined : value
  23134. } catch (err) {
  23135. if (fetchParams.controller.ended && !timingInfo.encodedBodySize) {
  23136. // zlib doesn't like empty streams.
  23137. bytes = undefined
  23138. } else {
  23139. bytes = err
  23140. // err may be propagated from the result of calling readablestream.cancel,
  23141. // which might not be an error. https://github.com/nodejs/undici/issues/2009
  23142. isFailure = true
  23143. }
  23144. }
  23145. if (bytes === undefined) {
  23146. // 2. Otherwise, if the bytes transmission for response’s message
  23147. // body is done normally and stream is readable, then close
  23148. // stream, finalize response for fetchParams and response, and
  23149. // abort these in-parallel steps.
  23150. readableStreamClose(fetchParams.controller.controller)
  23151. finalizeResponse(fetchParams, response)
  23152. return
  23153. }
  23154. // 5. Increase timingInfo’s decoded body size by bytes’s length.
  23155. timingInfo.decodedBodySize += bytes?.byteLength ?? 0
  23156. // 6. If bytes is failure, then terminate fetchParams’s controller.
  23157. if (isFailure) {
  23158. fetchParams.controller.terminate(bytes)
  23159. return
  23160. }
  23161. // 7. Enqueue a Uint8Array wrapping an ArrayBuffer containing bytes
  23162. // into stream.
  23163. fetchParams.controller.controller.enqueue(new Uint8Array(bytes))
  23164. // 8. If stream is errored, then terminate the ongoing fetch.
  23165. if (isErrored(stream)) {
  23166. fetchParams.controller.terminate()
  23167. return
  23168. }
  23169. // 9. If stream doesn’t need more data ask the user agent to suspend
  23170. // the ongoing fetch.
  23171. if (!fetchParams.controller.controller.desiredSize) {
  23172. return
  23173. }
  23174. }
  23175. }
  23176. // 2. If aborted, then:
  23177. function onAborted (reason) {
  23178. // 2. If fetchParams is aborted, then:
  23179. if (isAborted(fetchParams)) {
  23180. // 1. Set response’s aborted flag.
  23181. response.aborted = true
  23182. // 2. If stream is readable, then error stream with the result of
  23183. // deserialize a serialized abort reason given fetchParams’s
  23184. // controller’s serialized abort reason and an
  23185. // implementation-defined realm.
  23186. if (isReadable(stream)) {
  23187. fetchParams.controller.controller.error(
  23188. fetchParams.controller.serializedAbortReason
  23189. )
  23190. }
  23191. } else {
  23192. // 3. Otherwise, if stream is readable, error stream with a TypeError.
  23193. if (isReadable(stream)) {
  23194. fetchParams.controller.controller.error(new TypeError('terminated', {
  23195. cause: isErrorLike(reason) ? reason : undefined
  23196. }))
  23197. }
  23198. }
  23199. // 4. If connection uses HTTP/2, then transmit an RST_STREAM frame.
  23200. // 5. Otherwise, the user agent should close connection unless it would be bad for performance to do so.
  23201. fetchParams.controller.connection.destroy()
  23202. }
  23203. // 20. Return response.
  23204. return response
  23205. async function dispatch ({ body }) {
  23206. const url = requestCurrentURL(request)
  23207. /** @type {import('../..').Agent} */
  23208. const agent = fetchParams.controller.dispatcher
  23209. return new Promise((resolve, reject) => agent.dispatch(
  23210. {
  23211. path: url.pathname + url.search,
  23212. origin: url.origin,
  23213. method: request.method,
  23214. body: fetchParams.controller.dispatcher.isMockActive ? request.body && (request.body.source || request.body.stream) : body,
  23215. headers: request.headersList.entries,
  23216. maxRedirections: 0,
  23217. upgrade: request.mode === 'websocket' ? 'websocket' : undefined
  23218. },
  23219. {
  23220. body: null,
  23221. abort: null,
  23222. onConnect (abort) {
  23223. // TODO (fix): Do we need connection here?
  23224. const { connection } = fetchParams.controller
  23225. if (connection.destroyed) {
  23226. abort(new DOMException('The operation was aborted.', 'AbortError'))
  23227. } else {
  23228. fetchParams.controller.on('terminated', abort)
  23229. this.abort = connection.abort = abort
  23230. }
  23231. },
  23232. onHeaders (status, headersList, resume, statusText) {
  23233. if (status < 200) {
  23234. return
  23235. }
  23236. let codings = []
  23237. let location = ''
  23238. const headers = new Headers()
  23239. // For H2, the headers are a plain JS object
  23240. // We distinguish between them and iterate accordingly
  23241. if (Array.isArray(headersList)) {
  23242. for (let n = 0; n < headersList.length; n += 2) {
  23243. const key = headersList[n + 0].toString('latin1')
  23244. const val = headersList[n + 1].toString('latin1')
  23245. if (key.toLowerCase() === 'content-encoding') {
  23246. // https://www.rfc-editor.org/rfc/rfc7231#section-3.1.2.1
  23247. // "All content-coding values are case-insensitive..."
  23248. codings = val.toLowerCase().split(',').map((x) => x.trim())
  23249. } else if (key.toLowerCase() === 'location') {
  23250. location = val
  23251. }
  23252. headers[kHeadersList].append(key, val)
  23253. }
  23254. } else {
  23255. const keys = Object.keys(headersList)
  23256. for (const key of keys) {
  23257. const val = headersList[key]
  23258. if (key.toLowerCase() === 'content-encoding') {
  23259. // https://www.rfc-editor.org/rfc/rfc7231#section-3.1.2.1
  23260. // "All content-coding values are case-insensitive..."
  23261. codings = val.toLowerCase().split(',').map((x) => x.trim()).reverse()
  23262. } else if (key.toLowerCase() === 'location') {
  23263. location = val
  23264. }
  23265. headers[kHeadersList].append(key, val)
  23266. }
  23267. }
  23268. this.body = new Readable({ read: resume })
  23269. const decoders = []
  23270. const willFollow = request.redirect === 'follow' &&
  23271. location &&
  23272. redirectStatusSet.has(status)
  23273. // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Encoding
  23274. if (request.method !== 'HEAD' && request.method !== 'CONNECT' && !nullBodyStatus.includes(status) && !willFollow) {
  23275. for (const coding of codings) {
  23276. // https://www.rfc-editor.org/rfc/rfc9112.html#section-7.2
  23277. if (coding === 'x-gzip' || coding === 'gzip') {
  23278. decoders.push(zlib.createGunzip({
  23279. // Be less strict when decoding compressed responses, since sometimes
  23280. // servers send slightly invalid responses that are still accepted
  23281. // by common browsers.
  23282. // Always using Z_SYNC_FLUSH is what cURL does.
  23283. flush: zlib.constants.Z_SYNC_FLUSH,
  23284. finishFlush: zlib.constants.Z_SYNC_FLUSH
  23285. }))
  23286. } else if (coding === 'deflate') {
  23287. decoders.push(zlib.createInflate())
  23288. } else if (coding === 'br') {
  23289. decoders.push(zlib.createBrotliDecompress())
  23290. } else {
  23291. decoders.length = 0
  23292. break
  23293. }
  23294. }
  23295. }
  23296. resolve({
  23297. status,
  23298. statusText,
  23299. headersList: headers[kHeadersList],
  23300. body: decoders.length
  23301. ? pipeline(this.body, ...decoders, () => { })
  23302. : this.body.on('error', () => {})
  23303. })
  23304. return true
  23305. },
  23306. onData (chunk) {
  23307. if (fetchParams.controller.dump) {
  23308. return
  23309. }
  23310. // 1. If one or more bytes have been transmitted from response’s
  23311. // message body, then:
  23312. // 1. Let bytes be the transmitted bytes.
  23313. const bytes = chunk
  23314. // 2. Let codings be the result of extracting header list values
  23315. // given `Content-Encoding` and response’s header list.
  23316. // See pullAlgorithm.
  23317. // 3. Increase timingInfo’s encoded body size by bytes’s length.
  23318. timingInfo.encodedBodySize += bytes.byteLength
  23319. // 4. See pullAlgorithm...
  23320. return this.body.push(bytes)
  23321. },
  23322. onComplete () {
  23323. if (this.abort) {
  23324. fetchParams.controller.off('terminated', this.abort)
  23325. }
  23326. fetchParams.controller.ended = true
  23327. this.body.push(null)
  23328. },
  23329. onError (error) {
  23330. if (this.abort) {
  23331. fetchParams.controller.off('terminated', this.abort)
  23332. }
  23333. this.body?.destroy(error)
  23334. fetchParams.controller.terminate(error)
  23335. reject(error)
  23336. },
  23337. onUpgrade (status, headersList, socket) {
  23338. if (status !== 101) {
  23339. return
  23340. }
  23341. const headers = new Headers()
  23342. for (let n = 0; n < headersList.length; n += 2) {
  23343. const key = headersList[n + 0].toString('latin1')
  23344. const val = headersList[n + 1].toString('latin1')
  23345. headers[kHeadersList].append(key, val)
  23346. }
  23347. resolve({
  23348. status,
  23349. statusText: STATUS_CODES[status],
  23350. headersList: headers[kHeadersList],
  23351. socket
  23352. })
  23353. return true
  23354. }
  23355. }
  23356. ))
  23357. }
  23358. }
  23359. module.exports = {
  23360. fetch,
  23361. Fetch,
  23362. fetching,
  23363. finalizeAndReportTiming
  23364. }
  23365. /***/ }),
  23366. /***/ 8359:
  23367. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  23368. "use strict";
  23369. /* globals AbortController */
  23370. const { extractBody, mixinBody, cloneBody } = __nccwpck_require__(9990)
  23371. const { Headers, fill: fillHeaders, HeadersList } = __nccwpck_require__(554)
  23372. const { FinalizationRegistry } = __nccwpck_require__(6436)()
  23373. const util = __nccwpck_require__(3983)
  23374. const {
  23375. isValidHTTPToken,
  23376. sameOrigin,
  23377. normalizeMethod,
  23378. makePolicyContainer,
  23379. normalizeMethodRecord
  23380. } = __nccwpck_require__(2538)
  23381. const {
  23382. forbiddenMethodsSet,
  23383. corsSafeListedMethodsSet,
  23384. referrerPolicy,
  23385. requestRedirect,
  23386. requestMode,
  23387. requestCredentials,
  23388. requestCache,
  23389. requestDuplex
  23390. } = __nccwpck_require__(1037)
  23391. const { kEnumerableProperty } = util
  23392. const { kHeaders, kSignal, kState, kGuard, kRealm } = __nccwpck_require__(5861)
  23393. const { webidl } = __nccwpck_require__(1744)
  23394. const { getGlobalOrigin } = __nccwpck_require__(1246)
  23395. const { URLSerializer } = __nccwpck_require__(685)
  23396. const { kHeadersList, kConstruct } = __nccwpck_require__(2785)
  23397. const assert = __nccwpck_require__(9491)
  23398. const { getMaxListeners, setMaxListeners, getEventListeners, defaultMaxListeners } = __nccwpck_require__(2361)
  23399. let TransformStream = globalThis.TransformStream
  23400. const kAbortController = Symbol('abortController')
  23401. const requestFinalizer = new FinalizationRegistry(({ signal, abort }) => {
  23402. signal.removeEventListener('abort', abort)
  23403. })
  23404. // https://fetch.spec.whatwg.org/#request-class
  23405. class Request {
  23406. // https://fetch.spec.whatwg.org/#dom-request
  23407. constructor (input, init = {}) {
  23408. if (input === kConstruct) {
  23409. return
  23410. }
  23411. webidl.argumentLengthCheck(arguments, 1, { header: 'Request constructor' })
  23412. input = webidl.converters.RequestInfo(input)
  23413. init = webidl.converters.RequestInit(init)
  23414. // https://html.spec.whatwg.org/multipage/webappapis.html#environment-settings-object
  23415. this[kRealm] = {
  23416. settingsObject: {
  23417. baseUrl: getGlobalOrigin(),
  23418. get origin () {
  23419. return this.baseUrl?.origin
  23420. },
  23421. policyContainer: makePolicyContainer()
  23422. }
  23423. }
  23424. // 1. Let request be null.
  23425. let request = null
  23426. // 2. Let fallbackMode be null.
  23427. let fallbackMode = null
  23428. // 3. Let baseURL be this’s relevant settings object’s API base URL.
  23429. const baseUrl = this[kRealm].settingsObject.baseUrl
  23430. // 4. Let signal be null.
  23431. let signal = null
  23432. // 5. If input is a string, then:
  23433. if (typeof input === 'string') {
  23434. // 1. Let parsedURL be the result of parsing input with baseURL.
  23435. // 2. If parsedURL is failure, then throw a TypeError.
  23436. let parsedURL
  23437. try {
  23438. parsedURL = new URL(input, baseUrl)
  23439. } catch (err) {
  23440. throw new TypeError('Failed to parse URL from ' + input, { cause: err })
  23441. }
  23442. // 3. If parsedURL includes credentials, then throw a TypeError.
  23443. if (parsedURL.username || parsedURL.password) {
  23444. throw new TypeError(
  23445. 'Request cannot be constructed from a URL that includes credentials: ' +
  23446. input
  23447. )
  23448. }
  23449. // 4. Set request to a new request whose URL is parsedURL.
  23450. request = makeRequest({ urlList: [parsedURL] })
  23451. // 5. Set fallbackMode to "cors".
  23452. fallbackMode = 'cors'
  23453. } else {
  23454. // 6. Otherwise:
  23455. // 7. Assert: input is a Request object.
  23456. assert(input instanceof Request)
  23457. // 8. Set request to input’s request.
  23458. request = input[kState]
  23459. // 9. Set signal to input’s signal.
  23460. signal = input[kSignal]
  23461. }
  23462. // 7. Let origin be this’s relevant settings object’s origin.
  23463. const origin = this[kRealm].settingsObject.origin
  23464. // 8. Let window be "client".
  23465. let window = 'client'
  23466. // 9. If request’s window is an environment settings object and its origin
  23467. // is same origin with origin, then set window to request’s window.
  23468. if (
  23469. request.window?.constructor?.name === 'EnvironmentSettingsObject' &&
  23470. sameOrigin(request.window, origin)
  23471. ) {
  23472. window = request.window
  23473. }
  23474. // 10. If init["window"] exists and is non-null, then throw a TypeError.
  23475. if (init.window != null) {
  23476. throw new TypeError(`'window' option '${window}' must be null`)
  23477. }
  23478. // 11. If init["window"] exists, then set window to "no-window".
  23479. if ('window' in init) {
  23480. window = 'no-window'
  23481. }
  23482. // 12. Set request to a new request with the following properties:
  23483. request = makeRequest({
  23484. // URL request’s URL.
  23485. // undici implementation note: this is set as the first item in request's urlList in makeRequest
  23486. // method request’s method.
  23487. method: request.method,
  23488. // header list A copy of request’s header list.
  23489. // undici implementation note: headersList is cloned in makeRequest
  23490. headersList: request.headersList,
  23491. // unsafe-request flag Set.
  23492. unsafeRequest: request.unsafeRequest,
  23493. // client This’s relevant settings object.
  23494. client: this[kRealm].settingsObject,
  23495. // window window.
  23496. window,
  23497. // priority request’s priority.
  23498. priority: request.priority,
  23499. // origin request’s origin. The propagation of the origin is only significant for navigation requests
  23500. // being handled by a service worker. In this scenario a request can have an origin that is different
  23501. // from the current client.
  23502. origin: request.origin,
  23503. // referrer request’s referrer.
  23504. referrer: request.referrer,
  23505. // referrer policy request’s referrer policy.
  23506. referrerPolicy: request.referrerPolicy,
  23507. // mode request’s mode.
  23508. mode: request.mode,
  23509. // credentials mode request’s credentials mode.
  23510. credentials: request.credentials,
  23511. // cache mode request’s cache mode.
  23512. cache: request.cache,
  23513. // redirect mode request’s redirect mode.
  23514. redirect: request.redirect,
  23515. // integrity metadata request’s integrity metadata.
  23516. integrity: request.integrity,
  23517. // keepalive request’s keepalive.
  23518. keepalive: request.keepalive,
  23519. // reload-navigation flag request’s reload-navigation flag.
  23520. reloadNavigation: request.reloadNavigation,
  23521. // history-navigation flag request’s history-navigation flag.
  23522. historyNavigation: request.historyNavigation,
  23523. // URL list A clone of request’s URL list.
  23524. urlList: [...request.urlList]
  23525. })
  23526. const initHasKey = Object.keys(init).length !== 0
  23527. // 13. If init is not empty, then:
  23528. if (initHasKey) {
  23529. // 1. If request’s mode is "navigate", then set it to "same-origin".
  23530. if (request.mode === 'navigate') {
  23531. request.mode = 'same-origin'
  23532. }
  23533. // 2. Unset request’s reload-navigation flag.
  23534. request.reloadNavigation = false
  23535. // 3. Unset request’s history-navigation flag.
  23536. request.historyNavigation = false
  23537. // 4. Set request’s origin to "client".
  23538. request.origin = 'client'
  23539. // 5. Set request’s referrer to "client"
  23540. request.referrer = 'client'
  23541. // 6. Set request’s referrer policy to the empty string.
  23542. request.referrerPolicy = ''
  23543. // 7. Set request’s URL to request’s current URL.
  23544. request.url = request.urlList[request.urlList.length - 1]
  23545. // 8. Set request’s URL list to « request’s URL ».
  23546. request.urlList = [request.url]
  23547. }
  23548. // 14. If init["referrer"] exists, then:
  23549. if (init.referrer !== undefined) {
  23550. // 1. Let referrer be init["referrer"].
  23551. const referrer = init.referrer
  23552. // 2. If referrer is the empty string, then set request’s referrer to "no-referrer".
  23553. if (referrer === '') {
  23554. request.referrer = 'no-referrer'
  23555. } else {
  23556. // 1. Let parsedReferrer be the result of parsing referrer with
  23557. // baseURL.
  23558. // 2. If parsedReferrer is failure, then throw a TypeError.
  23559. let parsedReferrer
  23560. try {
  23561. parsedReferrer = new URL(referrer, baseUrl)
  23562. } catch (err) {
  23563. throw new TypeError(`Referrer "${referrer}" is not a valid URL.`, { cause: err })
  23564. }
  23565. // 3. If one of the following is true
  23566. // - parsedReferrer’s scheme is "about" and path is the string "client"
  23567. // - parsedReferrer’s origin is not same origin with origin
  23568. // then set request’s referrer to "client".
  23569. if (
  23570. (parsedReferrer.protocol === 'about:' && parsedReferrer.hostname === 'client') ||
  23571. (origin && !sameOrigin(parsedReferrer, this[kRealm].settingsObject.baseUrl))
  23572. ) {
  23573. request.referrer = 'client'
  23574. } else {
  23575. // 4. Otherwise, set request’s referrer to parsedReferrer.
  23576. request.referrer = parsedReferrer
  23577. }
  23578. }
  23579. }
  23580. // 15. If init["referrerPolicy"] exists, then set request’s referrer policy
  23581. // to it.
  23582. if (init.referrerPolicy !== undefined) {
  23583. request.referrerPolicy = init.referrerPolicy
  23584. }
  23585. // 16. Let mode be init["mode"] if it exists, and fallbackMode otherwise.
  23586. let mode
  23587. if (init.mode !== undefined) {
  23588. mode = init.mode
  23589. } else {
  23590. mode = fallbackMode
  23591. }
  23592. // 17. If mode is "navigate", then throw a TypeError.
  23593. if (mode === 'navigate') {
  23594. throw webidl.errors.exception({
  23595. header: 'Request constructor',
  23596. message: 'invalid request mode navigate.'
  23597. })
  23598. }
  23599. // 18. If mode is non-null, set request’s mode to mode.
  23600. if (mode != null) {
  23601. request.mode = mode
  23602. }
  23603. // 19. If init["credentials"] exists, then set request’s credentials mode
  23604. // to it.
  23605. if (init.credentials !== undefined) {
  23606. request.credentials = init.credentials
  23607. }
  23608. // 18. If init["cache"] exists, then set request’s cache mode to it.
  23609. if (init.cache !== undefined) {
  23610. request.cache = init.cache
  23611. }
  23612. // 21. If request’s cache mode is "only-if-cached" and request’s mode is
  23613. // not "same-origin", then throw a TypeError.
  23614. if (request.cache === 'only-if-cached' && request.mode !== 'same-origin') {
  23615. throw new TypeError(
  23616. "'only-if-cached' can be set only with 'same-origin' mode"
  23617. )
  23618. }
  23619. // 22. If init["redirect"] exists, then set request’s redirect mode to it.
  23620. if (init.redirect !== undefined) {
  23621. request.redirect = init.redirect
  23622. }
  23623. // 23. If init["integrity"] exists, then set request’s integrity metadata to it.
  23624. if (init.integrity != null) {
  23625. request.integrity = String(init.integrity)
  23626. }
  23627. // 24. If init["keepalive"] exists, then set request’s keepalive to it.
  23628. if (init.keepalive !== undefined) {
  23629. request.keepalive = Boolean(init.keepalive)
  23630. }
  23631. // 25. If init["method"] exists, then:
  23632. if (init.method !== undefined) {
  23633. // 1. Let method be init["method"].
  23634. let method = init.method
  23635. // 2. If method is not a method or method is a forbidden method, then
  23636. // throw a TypeError.
  23637. if (!isValidHTTPToken(method)) {
  23638. throw new TypeError(`'${method}' is not a valid HTTP method.`)
  23639. }
  23640. if (forbiddenMethodsSet.has(method.toUpperCase())) {
  23641. throw new TypeError(`'${method}' HTTP method is unsupported.`)
  23642. }
  23643. // 3. Normalize method.
  23644. method = normalizeMethodRecord[method] ?? normalizeMethod(method)
  23645. // 4. Set request’s method to method.
  23646. request.method = method
  23647. }
  23648. // 26. If init["signal"] exists, then set signal to it.
  23649. if (init.signal !== undefined) {
  23650. signal = init.signal
  23651. }
  23652. // 27. Set this’s request to request.
  23653. this[kState] = request
  23654. // 28. Set this’s signal to a new AbortSignal object with this’s relevant
  23655. // Realm.
  23656. // TODO: could this be simplified with AbortSignal.any
  23657. // (https://dom.spec.whatwg.org/#dom-abortsignal-any)
  23658. const ac = new AbortController()
  23659. this[kSignal] = ac.signal
  23660. this[kSignal][kRealm] = this[kRealm]
  23661. // 29. If signal is not null, then make this’s signal follow signal.
  23662. if (signal != null) {
  23663. if (
  23664. !signal ||
  23665. typeof signal.aborted !== 'boolean' ||
  23666. typeof signal.addEventListener !== 'function'
  23667. ) {
  23668. throw new TypeError(
  23669. "Failed to construct 'Request': member signal is not of type AbortSignal."
  23670. )
  23671. }
  23672. if (signal.aborted) {
  23673. ac.abort(signal.reason)
  23674. } else {
  23675. // Keep a strong ref to ac while request object
  23676. // is alive. This is needed to prevent AbortController
  23677. // from being prematurely garbage collected.
  23678. // See, https://github.com/nodejs/undici/issues/1926.
  23679. this[kAbortController] = ac
  23680. const acRef = new WeakRef(ac)
  23681. const abort = function () {
  23682. const ac = acRef.deref()
  23683. if (ac !== undefined) {
  23684. ac.abort(this.reason)
  23685. }
  23686. }
  23687. // Third-party AbortControllers may not work with these.
  23688. // See, https://github.com/nodejs/undici/pull/1910#issuecomment-1464495619.
  23689. try {
  23690. // If the max amount of listeners is equal to the default, increase it
  23691. // This is only available in node >= v19.9.0
  23692. if (typeof getMaxListeners === 'function' && getMaxListeners(signal) === defaultMaxListeners) {
  23693. setMaxListeners(100, signal)
  23694. } else if (getEventListeners(signal, 'abort').length >= defaultMaxListeners) {
  23695. setMaxListeners(100, signal)
  23696. }
  23697. } catch {}
  23698. util.addAbortListener(signal, abort)
  23699. requestFinalizer.register(ac, { signal, abort })
  23700. }
  23701. }
  23702. // 30. Set this’s headers to a new Headers object with this’s relevant
  23703. // Realm, whose header list is request’s header list and guard is
  23704. // "request".
  23705. this[kHeaders] = new Headers(kConstruct)
  23706. this[kHeaders][kHeadersList] = request.headersList
  23707. this[kHeaders][kGuard] = 'request'
  23708. this[kHeaders][kRealm] = this[kRealm]
  23709. // 31. If this’s request’s mode is "no-cors", then:
  23710. if (mode === 'no-cors') {
  23711. // 1. If this’s request’s method is not a CORS-safelisted method,
  23712. // then throw a TypeError.
  23713. if (!corsSafeListedMethodsSet.has(request.method)) {
  23714. throw new TypeError(
  23715. `'${request.method} is unsupported in no-cors mode.`
  23716. )
  23717. }
  23718. // 2. Set this’s headers’s guard to "request-no-cors".
  23719. this[kHeaders][kGuard] = 'request-no-cors'
  23720. }
  23721. // 32. If init is not empty, then:
  23722. if (initHasKey) {
  23723. /** @type {HeadersList} */
  23724. const headersList = this[kHeaders][kHeadersList]
  23725. // 1. Let headers be a copy of this’s headers and its associated header
  23726. // list.
  23727. // 2. If init["headers"] exists, then set headers to init["headers"].
  23728. const headers = init.headers !== undefined ? init.headers : new HeadersList(headersList)
  23729. // 3. Empty this’s headers’s header list.
  23730. headersList.clear()
  23731. // 4. If headers is a Headers object, then for each header in its header
  23732. // list, append header’s name/header’s value to this’s headers.
  23733. if (headers instanceof HeadersList) {
  23734. for (const [key, val] of headers) {
  23735. headersList.append(key, val)
  23736. }
  23737. // Note: Copy the `set-cookie` meta-data.
  23738. headersList.cookies = headers.cookies
  23739. } else {
  23740. // 5. Otherwise, fill this’s headers with headers.
  23741. fillHeaders(this[kHeaders], headers)
  23742. }
  23743. }
  23744. // 33. Let inputBody be input’s request’s body if input is a Request
  23745. // object; otherwise null.
  23746. const inputBody = input instanceof Request ? input[kState].body : null
  23747. // 34. If either init["body"] exists and is non-null or inputBody is
  23748. // non-null, and request’s method is `GET` or `HEAD`, then throw a
  23749. // TypeError.
  23750. if (
  23751. (init.body != null || inputBody != null) &&
  23752. (request.method === 'GET' || request.method === 'HEAD')
  23753. ) {
  23754. throw new TypeError('Request with GET/HEAD method cannot have body.')
  23755. }
  23756. // 35. Let initBody be null.
  23757. let initBody = null
  23758. // 36. If init["body"] exists and is non-null, then:
  23759. if (init.body != null) {
  23760. // 1. Let Content-Type be null.
  23761. // 2. Set initBody and Content-Type to the result of extracting
  23762. // init["body"], with keepalive set to request’s keepalive.
  23763. const [extractedBody, contentType] = extractBody(
  23764. init.body,
  23765. request.keepalive
  23766. )
  23767. initBody = extractedBody
  23768. // 3, If Content-Type is non-null and this’s headers’s header list does
  23769. // not contain `Content-Type`, then append `Content-Type`/Content-Type to
  23770. // this’s headers.
  23771. if (contentType && !this[kHeaders][kHeadersList].contains('content-type')) {
  23772. this[kHeaders].append('content-type', contentType)
  23773. }
  23774. }
  23775. // 37. Let inputOrInitBody be initBody if it is non-null; otherwise
  23776. // inputBody.
  23777. const inputOrInitBody = initBody ?? inputBody
  23778. // 38. If inputOrInitBody is non-null and inputOrInitBody’s source is
  23779. // null, then:
  23780. if (inputOrInitBody != null && inputOrInitBody.source == null) {
  23781. // 1. If initBody is non-null and init["duplex"] does not exist,
  23782. // then throw a TypeError.
  23783. if (initBody != null && init.duplex == null) {
  23784. throw new TypeError('RequestInit: duplex option is required when sending a body.')
  23785. }
  23786. // 2. If this’s request’s mode is neither "same-origin" nor "cors",
  23787. // then throw a TypeError.
  23788. if (request.mode !== 'same-origin' && request.mode !== 'cors') {
  23789. throw new TypeError(
  23790. 'If request is made from ReadableStream, mode should be "same-origin" or "cors"'
  23791. )
  23792. }
  23793. // 3. Set this’s request’s use-CORS-preflight flag.
  23794. request.useCORSPreflightFlag = true
  23795. }
  23796. // 39. Let finalBody be inputOrInitBody.
  23797. let finalBody = inputOrInitBody
  23798. // 40. If initBody is null and inputBody is non-null, then:
  23799. if (initBody == null && inputBody != null) {
  23800. // 1. If input is unusable, then throw a TypeError.
  23801. if (util.isDisturbed(inputBody.stream) || inputBody.stream.locked) {
  23802. throw new TypeError(
  23803. 'Cannot construct a Request with a Request object that has already been used.'
  23804. )
  23805. }
  23806. // 2. Set finalBody to the result of creating a proxy for inputBody.
  23807. if (!TransformStream) {
  23808. TransformStream = (__nccwpck_require__(5356).TransformStream)
  23809. }
  23810. // https://streams.spec.whatwg.org/#readablestream-create-a-proxy
  23811. const identityTransform = new TransformStream()
  23812. inputBody.stream.pipeThrough(identityTransform)
  23813. finalBody = {
  23814. source: inputBody.source,
  23815. length: inputBody.length,
  23816. stream: identityTransform.readable
  23817. }
  23818. }
  23819. // 41. Set this’s request’s body to finalBody.
  23820. this[kState].body = finalBody
  23821. }
  23822. // Returns request’s HTTP method, which is "GET" by default.
  23823. get method () {
  23824. webidl.brandCheck(this, Request)
  23825. // The method getter steps are to return this’s request’s method.
  23826. return this[kState].method
  23827. }
  23828. // Returns the URL of request as a string.
  23829. get url () {
  23830. webidl.brandCheck(this, Request)
  23831. // The url getter steps are to return this’s request’s URL, serialized.
  23832. return URLSerializer(this[kState].url)
  23833. }
  23834. // Returns a Headers object consisting of the headers associated with request.
  23835. // Note that headers added in the network layer by the user agent will not
  23836. // be accounted for in this object, e.g., the "Host" header.
  23837. get headers () {
  23838. webidl.brandCheck(this, Request)
  23839. // The headers getter steps are to return this’s headers.
  23840. return this[kHeaders]
  23841. }
  23842. // Returns the kind of resource requested by request, e.g., "document"
  23843. // or "script".
  23844. get destination () {
  23845. webidl.brandCheck(this, Request)
  23846. // The destination getter are to return this’s request’s destination.
  23847. return this[kState].destination
  23848. }
  23849. // Returns the referrer of request. Its value can be a same-origin URL if
  23850. // explicitly set in init, the empty string to indicate no referrer, and
  23851. // "about:client" when defaulting to the global’s default. This is used
  23852. // during fetching to determine the value of the `Referer` header of the
  23853. // request being made.
  23854. get referrer () {
  23855. webidl.brandCheck(this, Request)
  23856. // 1. If this’s request’s referrer is "no-referrer", then return the
  23857. // empty string.
  23858. if (this[kState].referrer === 'no-referrer') {
  23859. return ''
  23860. }
  23861. // 2. If this’s request’s referrer is "client", then return
  23862. // "about:client".
  23863. if (this[kState].referrer === 'client') {
  23864. return 'about:client'
  23865. }
  23866. // Return this’s request’s referrer, serialized.
  23867. return this[kState].referrer.toString()
  23868. }
  23869. // Returns the referrer policy associated with request.
  23870. // This is used during fetching to compute the value of the request’s
  23871. // referrer.
  23872. get referrerPolicy () {
  23873. webidl.brandCheck(this, Request)
  23874. // The referrerPolicy getter steps are to return this’s request’s referrer policy.
  23875. return this[kState].referrerPolicy
  23876. }
  23877. // Returns the mode associated with request, which is a string indicating
  23878. // whether the request will use CORS, or will be restricted to same-origin
  23879. // URLs.
  23880. get mode () {
  23881. webidl.brandCheck(this, Request)
  23882. // The mode getter steps are to return this’s request’s mode.
  23883. return this[kState].mode
  23884. }
  23885. // Returns the credentials mode associated with request,
  23886. // which is a string indicating whether credentials will be sent with the
  23887. // request always, never, or only when sent to a same-origin URL.
  23888. get credentials () {
  23889. // The credentials getter steps are to return this’s request’s credentials mode.
  23890. return this[kState].credentials
  23891. }
  23892. // Returns the cache mode associated with request,
  23893. // which is a string indicating how the request will
  23894. // interact with the browser’s cache when fetching.
  23895. get cache () {
  23896. webidl.brandCheck(this, Request)
  23897. // The cache getter steps are to return this’s request’s cache mode.
  23898. return this[kState].cache
  23899. }
  23900. // Returns the redirect mode associated with request,
  23901. // which is a string indicating how redirects for the
  23902. // request will be handled during fetching. A request
  23903. // will follow redirects by default.
  23904. get redirect () {
  23905. webidl.brandCheck(this, Request)
  23906. // The redirect getter steps are to return this’s request’s redirect mode.
  23907. return this[kState].redirect
  23908. }
  23909. // Returns request’s subresource integrity metadata, which is a
  23910. // cryptographic hash of the resource being fetched. Its value
  23911. // consists of multiple hashes separated by whitespace. [SRI]
  23912. get integrity () {
  23913. webidl.brandCheck(this, Request)
  23914. // The integrity getter steps are to return this’s request’s integrity
  23915. // metadata.
  23916. return this[kState].integrity
  23917. }
  23918. // Returns a boolean indicating whether or not request can outlive the
  23919. // global in which it was created.
  23920. get keepalive () {
  23921. webidl.brandCheck(this, Request)
  23922. // The keepalive getter steps are to return this’s request’s keepalive.
  23923. return this[kState].keepalive
  23924. }
  23925. // Returns a boolean indicating whether or not request is for a reload
  23926. // navigation.
  23927. get isReloadNavigation () {
  23928. webidl.brandCheck(this, Request)
  23929. // The isReloadNavigation getter steps are to return true if this’s
  23930. // request’s reload-navigation flag is set; otherwise false.
  23931. return this[kState].reloadNavigation
  23932. }
  23933. // Returns a boolean indicating whether or not request is for a history
  23934. // navigation (a.k.a. back-foward navigation).
  23935. get isHistoryNavigation () {
  23936. webidl.brandCheck(this, Request)
  23937. // The isHistoryNavigation getter steps are to return true if this’s request’s
  23938. // history-navigation flag is set; otherwise false.
  23939. return this[kState].historyNavigation
  23940. }
  23941. // Returns the signal associated with request, which is an AbortSignal
  23942. // object indicating whether or not request has been aborted, and its
  23943. // abort event handler.
  23944. get signal () {
  23945. webidl.brandCheck(this, Request)
  23946. // The signal getter steps are to return this’s signal.
  23947. return this[kSignal]
  23948. }
  23949. get body () {
  23950. webidl.brandCheck(this, Request)
  23951. return this[kState].body ? this[kState].body.stream : null
  23952. }
  23953. get bodyUsed () {
  23954. webidl.brandCheck(this, Request)
  23955. return !!this[kState].body && util.isDisturbed(this[kState].body.stream)
  23956. }
  23957. get duplex () {
  23958. webidl.brandCheck(this, Request)
  23959. return 'half'
  23960. }
  23961. // Returns a clone of request.
  23962. clone () {
  23963. webidl.brandCheck(this, Request)
  23964. // 1. If this is unusable, then throw a TypeError.
  23965. if (this.bodyUsed || this.body?.locked) {
  23966. throw new TypeError('unusable')
  23967. }
  23968. // 2. Let clonedRequest be the result of cloning this’s request.
  23969. const clonedRequest = cloneRequest(this[kState])
  23970. // 3. Let clonedRequestObject be the result of creating a Request object,
  23971. // given clonedRequest, this’s headers’s guard, and this’s relevant Realm.
  23972. const clonedRequestObject = new Request(kConstruct)
  23973. clonedRequestObject[kState] = clonedRequest
  23974. clonedRequestObject[kRealm] = this[kRealm]
  23975. clonedRequestObject[kHeaders] = new Headers(kConstruct)
  23976. clonedRequestObject[kHeaders][kHeadersList] = clonedRequest.headersList
  23977. clonedRequestObject[kHeaders][kGuard] = this[kHeaders][kGuard]
  23978. clonedRequestObject[kHeaders][kRealm] = this[kHeaders][kRealm]
  23979. // 4. Make clonedRequestObject’s signal follow this’s signal.
  23980. const ac = new AbortController()
  23981. if (this.signal.aborted) {
  23982. ac.abort(this.signal.reason)
  23983. } else {
  23984. util.addAbortListener(
  23985. this.signal,
  23986. () => {
  23987. ac.abort(this.signal.reason)
  23988. }
  23989. )
  23990. }
  23991. clonedRequestObject[kSignal] = ac.signal
  23992. // 4. Return clonedRequestObject.
  23993. return clonedRequestObject
  23994. }
  23995. }
  23996. mixinBody(Request)
  23997. function makeRequest (init) {
  23998. // https://fetch.spec.whatwg.org/#requests
  23999. const request = {
  24000. method: 'GET',
  24001. localURLsOnly: false,
  24002. unsafeRequest: false,
  24003. body: null,
  24004. client: null,
  24005. reservedClient: null,
  24006. replacesClientId: '',
  24007. window: 'client',
  24008. keepalive: false,
  24009. serviceWorkers: 'all',
  24010. initiator: '',
  24011. destination: '',
  24012. priority: null,
  24013. origin: 'client',
  24014. policyContainer: 'client',
  24015. referrer: 'client',
  24016. referrerPolicy: '',
  24017. mode: 'no-cors',
  24018. useCORSPreflightFlag: false,
  24019. credentials: 'same-origin',
  24020. useCredentials: false,
  24021. cache: 'default',
  24022. redirect: 'follow',
  24023. integrity: '',
  24024. cryptoGraphicsNonceMetadata: '',
  24025. parserMetadata: '',
  24026. reloadNavigation: false,
  24027. historyNavigation: false,
  24028. userActivation: false,
  24029. taintedOrigin: false,
  24030. redirectCount: 0,
  24031. responseTainting: 'basic',
  24032. preventNoCacheCacheControlHeaderModification: false,
  24033. done: false,
  24034. timingAllowFailed: false,
  24035. ...init,
  24036. headersList: init.headersList
  24037. ? new HeadersList(init.headersList)
  24038. : new HeadersList()
  24039. }
  24040. request.url = request.urlList[0]
  24041. return request
  24042. }
  24043. // https://fetch.spec.whatwg.org/#concept-request-clone
  24044. function cloneRequest (request) {
  24045. // To clone a request request, run these steps:
  24046. // 1. Let newRequest be a copy of request, except for its body.
  24047. const newRequest = makeRequest({ ...request, body: null })
  24048. // 2. If request’s body is non-null, set newRequest’s body to the
  24049. // result of cloning request’s body.
  24050. if (request.body != null) {
  24051. newRequest.body = cloneBody(request.body)
  24052. }
  24053. // 3. Return newRequest.
  24054. return newRequest
  24055. }
  24056. Object.defineProperties(Request.prototype, {
  24057. method: kEnumerableProperty,
  24058. url: kEnumerableProperty,
  24059. headers: kEnumerableProperty,
  24060. redirect: kEnumerableProperty,
  24061. clone: kEnumerableProperty,
  24062. signal: kEnumerableProperty,
  24063. duplex: kEnumerableProperty,
  24064. destination: kEnumerableProperty,
  24065. body: kEnumerableProperty,
  24066. bodyUsed: kEnumerableProperty,
  24067. isHistoryNavigation: kEnumerableProperty,
  24068. isReloadNavigation: kEnumerableProperty,
  24069. keepalive: kEnumerableProperty,
  24070. integrity: kEnumerableProperty,
  24071. cache: kEnumerableProperty,
  24072. credentials: kEnumerableProperty,
  24073. attribute: kEnumerableProperty,
  24074. referrerPolicy: kEnumerableProperty,
  24075. referrer: kEnumerableProperty,
  24076. mode: kEnumerableProperty,
  24077. [Symbol.toStringTag]: {
  24078. value: 'Request',
  24079. configurable: true
  24080. }
  24081. })
  24082. webidl.converters.Request = webidl.interfaceConverter(
  24083. Request
  24084. )
  24085. // https://fetch.spec.whatwg.org/#requestinfo
  24086. webidl.converters.RequestInfo = function (V) {
  24087. if (typeof V === 'string') {
  24088. return webidl.converters.USVString(V)
  24089. }
  24090. if (V instanceof Request) {
  24091. return webidl.converters.Request(V)
  24092. }
  24093. return webidl.converters.USVString(V)
  24094. }
  24095. webidl.converters.AbortSignal = webidl.interfaceConverter(
  24096. AbortSignal
  24097. )
  24098. // https://fetch.spec.whatwg.org/#requestinit
  24099. webidl.converters.RequestInit = webidl.dictionaryConverter([
  24100. {
  24101. key: 'method',
  24102. converter: webidl.converters.ByteString
  24103. },
  24104. {
  24105. key: 'headers',
  24106. converter: webidl.converters.HeadersInit
  24107. },
  24108. {
  24109. key: 'body',
  24110. converter: webidl.nullableConverter(
  24111. webidl.converters.BodyInit
  24112. )
  24113. },
  24114. {
  24115. key: 'referrer',
  24116. converter: webidl.converters.USVString
  24117. },
  24118. {
  24119. key: 'referrerPolicy',
  24120. converter: webidl.converters.DOMString,
  24121. // https://w3c.github.io/webappsec-referrer-policy/#referrer-policy
  24122. allowedValues: referrerPolicy
  24123. },
  24124. {
  24125. key: 'mode',
  24126. converter: webidl.converters.DOMString,
  24127. // https://fetch.spec.whatwg.org/#concept-request-mode
  24128. allowedValues: requestMode
  24129. },
  24130. {
  24131. key: 'credentials',
  24132. converter: webidl.converters.DOMString,
  24133. // https://fetch.spec.whatwg.org/#requestcredentials
  24134. allowedValues: requestCredentials
  24135. },
  24136. {
  24137. key: 'cache',
  24138. converter: webidl.converters.DOMString,
  24139. // https://fetch.spec.whatwg.org/#requestcache
  24140. allowedValues: requestCache
  24141. },
  24142. {
  24143. key: 'redirect',
  24144. converter: webidl.converters.DOMString,
  24145. // https://fetch.spec.whatwg.org/#requestredirect
  24146. allowedValues: requestRedirect
  24147. },
  24148. {
  24149. key: 'integrity',
  24150. converter: webidl.converters.DOMString
  24151. },
  24152. {
  24153. key: 'keepalive',
  24154. converter: webidl.converters.boolean
  24155. },
  24156. {
  24157. key: 'signal',
  24158. converter: webidl.nullableConverter(
  24159. (signal) => webidl.converters.AbortSignal(
  24160. signal,
  24161. { strict: false }
  24162. )
  24163. )
  24164. },
  24165. {
  24166. key: 'window',
  24167. converter: webidl.converters.any
  24168. },
  24169. {
  24170. key: 'duplex',
  24171. converter: webidl.converters.DOMString,
  24172. allowedValues: requestDuplex
  24173. }
  24174. ])
  24175. module.exports = { Request, makeRequest }
  24176. /***/ }),
  24177. /***/ 7823:
  24178. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  24179. "use strict";
  24180. const { Headers, HeadersList, fill } = __nccwpck_require__(554)
  24181. const { extractBody, cloneBody, mixinBody } = __nccwpck_require__(9990)
  24182. const util = __nccwpck_require__(3983)
  24183. const { kEnumerableProperty } = util
  24184. const {
  24185. isValidReasonPhrase,
  24186. isCancelled,
  24187. isAborted,
  24188. isBlobLike,
  24189. serializeJavascriptValueToJSONString,
  24190. isErrorLike,
  24191. isomorphicEncode
  24192. } = __nccwpck_require__(2538)
  24193. const {
  24194. redirectStatusSet,
  24195. nullBodyStatus,
  24196. DOMException
  24197. } = __nccwpck_require__(1037)
  24198. const { kState, kHeaders, kGuard, kRealm } = __nccwpck_require__(5861)
  24199. const { webidl } = __nccwpck_require__(1744)
  24200. const { FormData } = __nccwpck_require__(2015)
  24201. const { getGlobalOrigin } = __nccwpck_require__(1246)
  24202. const { URLSerializer } = __nccwpck_require__(685)
  24203. const { kHeadersList, kConstruct } = __nccwpck_require__(2785)
  24204. const assert = __nccwpck_require__(9491)
  24205. const { types } = __nccwpck_require__(3837)
  24206. const ReadableStream = globalThis.ReadableStream || (__nccwpck_require__(5356).ReadableStream)
  24207. const textEncoder = new TextEncoder('utf-8')
  24208. // https://fetch.spec.whatwg.org/#response-class
  24209. class Response {
  24210. // Creates network error Response.
  24211. static error () {
  24212. // TODO
  24213. const relevantRealm = { settingsObject: {} }
  24214. // The static error() method steps are to return the result of creating a
  24215. // Response object, given a new network error, "immutable", and this’s
  24216. // relevant Realm.
  24217. const responseObject = new Response()
  24218. responseObject[kState] = makeNetworkError()
  24219. responseObject[kRealm] = relevantRealm
  24220. responseObject[kHeaders][kHeadersList] = responseObject[kState].headersList
  24221. responseObject[kHeaders][kGuard] = 'immutable'
  24222. responseObject[kHeaders][kRealm] = relevantRealm
  24223. return responseObject
  24224. }
  24225. // https://fetch.spec.whatwg.org/#dom-response-json
  24226. static json (data, init = {}) {
  24227. webidl.argumentLengthCheck(arguments, 1, { header: 'Response.json' })
  24228. if (init !== null) {
  24229. init = webidl.converters.ResponseInit(init)
  24230. }
  24231. // 1. Let bytes the result of running serialize a JavaScript value to JSON bytes on data.
  24232. const bytes = textEncoder.encode(
  24233. serializeJavascriptValueToJSONString(data)
  24234. )
  24235. // 2. Let body be the result of extracting bytes.
  24236. const body = extractBody(bytes)
  24237. // 3. Let responseObject be the result of creating a Response object, given a new response,
  24238. // "response", and this’s relevant Realm.
  24239. const relevantRealm = { settingsObject: {} }
  24240. const responseObject = new Response()
  24241. responseObject[kRealm] = relevantRealm
  24242. responseObject[kHeaders][kGuard] = 'response'
  24243. responseObject[kHeaders][kRealm] = relevantRealm
  24244. // 4. Perform initialize a response given responseObject, init, and (body, "application/json").
  24245. initializeResponse(responseObject, init, { body: body[0], type: 'application/json' })
  24246. // 5. Return responseObject.
  24247. return responseObject
  24248. }
  24249. // Creates a redirect Response that redirects to url with status status.
  24250. static redirect (url, status = 302) {
  24251. const relevantRealm = { settingsObject: {} }
  24252. webidl.argumentLengthCheck(arguments, 1, { header: 'Response.redirect' })
  24253. url = webidl.converters.USVString(url)
  24254. status = webidl.converters['unsigned short'](status)
  24255. // 1. Let parsedURL be the result of parsing url with current settings
  24256. // object’s API base URL.
  24257. // 2. If parsedURL is failure, then throw a TypeError.
  24258. // TODO: base-URL?
  24259. let parsedURL
  24260. try {
  24261. parsedURL = new URL(url, getGlobalOrigin())
  24262. } catch (err) {
  24263. throw Object.assign(new TypeError('Failed to parse URL from ' + url), {
  24264. cause: err
  24265. })
  24266. }
  24267. // 3. If status is not a redirect status, then throw a RangeError.
  24268. if (!redirectStatusSet.has(status)) {
  24269. throw new RangeError('Invalid status code ' + status)
  24270. }
  24271. // 4. Let responseObject be the result of creating a Response object,
  24272. // given a new response, "immutable", and this’s relevant Realm.
  24273. const responseObject = new Response()
  24274. responseObject[kRealm] = relevantRealm
  24275. responseObject[kHeaders][kGuard] = 'immutable'
  24276. responseObject[kHeaders][kRealm] = relevantRealm
  24277. // 5. Set responseObject’s response’s status to status.
  24278. responseObject[kState].status = status
  24279. // 6. Let value be parsedURL, serialized and isomorphic encoded.
  24280. const value = isomorphicEncode(URLSerializer(parsedURL))
  24281. // 7. Append `Location`/value to responseObject’s response’s header list.
  24282. responseObject[kState].headersList.append('location', value)
  24283. // 8. Return responseObject.
  24284. return responseObject
  24285. }
  24286. // https://fetch.spec.whatwg.org/#dom-response
  24287. constructor (body = null, init = {}) {
  24288. if (body !== null) {
  24289. body = webidl.converters.BodyInit(body)
  24290. }
  24291. init = webidl.converters.ResponseInit(init)
  24292. // TODO
  24293. this[kRealm] = { settingsObject: {} }
  24294. // 1. Set this’s response to a new response.
  24295. this[kState] = makeResponse({})
  24296. // 2. Set this’s headers to a new Headers object with this’s relevant
  24297. // Realm, whose header list is this’s response’s header list and guard
  24298. // is "response".
  24299. this[kHeaders] = new Headers(kConstruct)
  24300. this[kHeaders][kGuard] = 'response'
  24301. this[kHeaders][kHeadersList] = this[kState].headersList
  24302. this[kHeaders][kRealm] = this[kRealm]
  24303. // 3. Let bodyWithType be null.
  24304. let bodyWithType = null
  24305. // 4. If body is non-null, then set bodyWithType to the result of extracting body.
  24306. if (body != null) {
  24307. const [extractedBody, type] = extractBody(body)
  24308. bodyWithType = { body: extractedBody, type }
  24309. }
  24310. // 5. Perform initialize a response given this, init, and bodyWithType.
  24311. initializeResponse(this, init, bodyWithType)
  24312. }
  24313. // Returns response’s type, e.g., "cors".
  24314. get type () {
  24315. webidl.brandCheck(this, Response)
  24316. // The type getter steps are to return this’s response’s type.
  24317. return this[kState].type
  24318. }
  24319. // Returns response’s URL, if it has one; otherwise the empty string.
  24320. get url () {
  24321. webidl.brandCheck(this, Response)
  24322. const urlList = this[kState].urlList
  24323. // The url getter steps are to return the empty string if this’s
  24324. // response’s URL is null; otherwise this’s response’s URL,
  24325. // serialized with exclude fragment set to true.
  24326. const url = urlList[urlList.length - 1] ?? null
  24327. if (url === null) {
  24328. return ''
  24329. }
  24330. return URLSerializer(url, true)
  24331. }
  24332. // Returns whether response was obtained through a redirect.
  24333. get redirected () {
  24334. webidl.brandCheck(this, Response)
  24335. // The redirected getter steps are to return true if this’s response’s URL
  24336. // list has more than one item; otherwise false.
  24337. return this[kState].urlList.length > 1
  24338. }
  24339. // Returns response’s status.
  24340. get status () {
  24341. webidl.brandCheck(this, Response)
  24342. // The status getter steps are to return this’s response’s status.
  24343. return this[kState].status
  24344. }
  24345. // Returns whether response’s status is an ok status.
  24346. get ok () {
  24347. webidl.brandCheck(this, Response)
  24348. // The ok getter steps are to return true if this’s response’s status is an
  24349. // ok status; otherwise false.
  24350. return this[kState].status >= 200 && this[kState].status <= 299
  24351. }
  24352. // Returns response’s status message.
  24353. get statusText () {
  24354. webidl.brandCheck(this, Response)
  24355. // The statusText getter steps are to return this’s response’s status
  24356. // message.
  24357. return this[kState].statusText
  24358. }
  24359. // Returns response’s headers as Headers.
  24360. get headers () {
  24361. webidl.brandCheck(this, Response)
  24362. // The headers getter steps are to return this’s headers.
  24363. return this[kHeaders]
  24364. }
  24365. get body () {
  24366. webidl.brandCheck(this, Response)
  24367. return this[kState].body ? this[kState].body.stream : null
  24368. }
  24369. get bodyUsed () {
  24370. webidl.brandCheck(this, Response)
  24371. return !!this[kState].body && util.isDisturbed(this[kState].body.stream)
  24372. }
  24373. // Returns a clone of response.
  24374. clone () {
  24375. webidl.brandCheck(this, Response)
  24376. // 1. If this is unusable, then throw a TypeError.
  24377. if (this.bodyUsed || (this.body && this.body.locked)) {
  24378. throw webidl.errors.exception({
  24379. header: 'Response.clone',
  24380. message: 'Body has already been consumed.'
  24381. })
  24382. }
  24383. // 2. Let clonedResponse be the result of cloning this’s response.
  24384. const clonedResponse = cloneResponse(this[kState])
  24385. // 3. Return the result of creating a Response object, given
  24386. // clonedResponse, this’s headers’s guard, and this’s relevant Realm.
  24387. const clonedResponseObject = new Response()
  24388. clonedResponseObject[kState] = clonedResponse
  24389. clonedResponseObject[kRealm] = this[kRealm]
  24390. clonedResponseObject[kHeaders][kHeadersList] = clonedResponse.headersList
  24391. clonedResponseObject[kHeaders][kGuard] = this[kHeaders][kGuard]
  24392. clonedResponseObject[kHeaders][kRealm] = this[kHeaders][kRealm]
  24393. return clonedResponseObject
  24394. }
  24395. }
  24396. mixinBody(Response)
  24397. Object.defineProperties(Response.prototype, {
  24398. type: kEnumerableProperty,
  24399. url: kEnumerableProperty,
  24400. status: kEnumerableProperty,
  24401. ok: kEnumerableProperty,
  24402. redirected: kEnumerableProperty,
  24403. statusText: kEnumerableProperty,
  24404. headers: kEnumerableProperty,
  24405. clone: kEnumerableProperty,
  24406. body: kEnumerableProperty,
  24407. bodyUsed: kEnumerableProperty,
  24408. [Symbol.toStringTag]: {
  24409. value: 'Response',
  24410. configurable: true
  24411. }
  24412. })
  24413. Object.defineProperties(Response, {
  24414. json: kEnumerableProperty,
  24415. redirect: kEnumerableProperty,
  24416. error: kEnumerableProperty
  24417. })
  24418. // https://fetch.spec.whatwg.org/#concept-response-clone
  24419. function cloneResponse (response) {
  24420. // To clone a response response, run these steps:
  24421. // 1. If response is a filtered response, then return a new identical
  24422. // filtered response whose internal response is a clone of response’s
  24423. // internal response.
  24424. if (response.internalResponse) {
  24425. return filterResponse(
  24426. cloneResponse(response.internalResponse),
  24427. response.type
  24428. )
  24429. }
  24430. // 2. Let newResponse be a copy of response, except for its body.
  24431. const newResponse = makeResponse({ ...response, body: null })
  24432. // 3. If response’s body is non-null, then set newResponse’s body to the
  24433. // result of cloning response’s body.
  24434. if (response.body != null) {
  24435. newResponse.body = cloneBody(response.body)
  24436. }
  24437. // 4. Return newResponse.
  24438. return newResponse
  24439. }
  24440. function makeResponse (init) {
  24441. return {
  24442. aborted: false,
  24443. rangeRequested: false,
  24444. timingAllowPassed: false,
  24445. requestIncludesCredentials: false,
  24446. type: 'default',
  24447. status: 200,
  24448. timingInfo: null,
  24449. cacheState: '',
  24450. statusText: '',
  24451. ...init,
  24452. headersList: init.headersList
  24453. ? new HeadersList(init.headersList)
  24454. : new HeadersList(),
  24455. urlList: init.urlList ? [...init.urlList] : []
  24456. }
  24457. }
  24458. function makeNetworkError (reason) {
  24459. const isError = isErrorLike(reason)
  24460. return makeResponse({
  24461. type: 'error',
  24462. status: 0,
  24463. error: isError
  24464. ? reason
  24465. : new Error(reason ? String(reason) : reason),
  24466. aborted: reason && reason.name === 'AbortError'
  24467. })
  24468. }
  24469. function makeFilteredResponse (response, state) {
  24470. state = {
  24471. internalResponse: response,
  24472. ...state
  24473. }
  24474. return new Proxy(response, {
  24475. get (target, p) {
  24476. return p in state ? state[p] : target[p]
  24477. },
  24478. set (target, p, value) {
  24479. assert(!(p in state))
  24480. target[p] = value
  24481. return true
  24482. }
  24483. })
  24484. }
  24485. // https://fetch.spec.whatwg.org/#concept-filtered-response
  24486. function filterResponse (response, type) {
  24487. // Set response to the following filtered response with response as its
  24488. // internal response, depending on request’s response tainting:
  24489. if (type === 'basic') {
  24490. // A basic filtered response is a filtered response whose type is "basic"
  24491. // and header list excludes any headers in internal response’s header list
  24492. // whose name is a forbidden response-header name.
  24493. // Note: undici does not implement forbidden response-header names
  24494. return makeFilteredResponse(response, {
  24495. type: 'basic',
  24496. headersList: response.headersList
  24497. })
  24498. } else if (type === 'cors') {
  24499. // A CORS filtered response is a filtered response whose type is "cors"
  24500. // and header list excludes any headers in internal response’s header
  24501. // list whose name is not a CORS-safelisted response-header name, given
  24502. // internal response’s CORS-exposed header-name list.
  24503. // Note: undici does not implement CORS-safelisted response-header names
  24504. return makeFilteredResponse(response, {
  24505. type: 'cors',
  24506. headersList: response.headersList
  24507. })
  24508. } else if (type === 'opaque') {
  24509. // An opaque filtered response is a filtered response whose type is
  24510. // "opaque", URL list is the empty list, status is 0, status message
  24511. // is the empty byte sequence, header list is empty, and body is null.
  24512. return makeFilteredResponse(response, {
  24513. type: 'opaque',
  24514. urlList: Object.freeze([]),
  24515. status: 0,
  24516. statusText: '',
  24517. body: null
  24518. })
  24519. } else if (type === 'opaqueredirect') {
  24520. // An opaque-redirect filtered response is a filtered response whose type
  24521. // is "opaqueredirect", status is 0, status message is the empty byte
  24522. // sequence, header list is empty, and body is null.
  24523. return makeFilteredResponse(response, {
  24524. type: 'opaqueredirect',
  24525. status: 0,
  24526. statusText: '',
  24527. headersList: [],
  24528. body: null
  24529. })
  24530. } else {
  24531. assert(false)
  24532. }
  24533. }
  24534. // https://fetch.spec.whatwg.org/#appropriate-network-error
  24535. function makeAppropriateNetworkError (fetchParams, err = null) {
  24536. // 1. Assert: fetchParams is canceled.
  24537. assert(isCancelled(fetchParams))
  24538. // 2. Return an aborted network error if fetchParams is aborted;
  24539. // otherwise return a network error.
  24540. return isAborted(fetchParams)
  24541. ? makeNetworkError(Object.assign(new DOMException('The operation was aborted.', 'AbortError'), { cause: err }))
  24542. : makeNetworkError(Object.assign(new DOMException('Request was cancelled.'), { cause: err }))
  24543. }
  24544. // https://whatpr.org/fetch/1392.html#initialize-a-response
  24545. function initializeResponse (response, init, body) {
  24546. // 1. If init["status"] is not in the range 200 to 599, inclusive, then
  24547. // throw a RangeError.
  24548. if (init.status !== null && (init.status < 200 || init.status > 599)) {
  24549. throw new RangeError('init["status"] must be in the range of 200 to 599, inclusive.')
  24550. }
  24551. // 2. If init["statusText"] does not match the reason-phrase token production,
  24552. // then throw a TypeError.
  24553. if ('statusText' in init && init.statusText != null) {
  24554. // See, https://datatracker.ietf.org/doc/html/rfc7230#section-3.1.2:
  24555. // reason-phrase = *( HTAB / SP / VCHAR / obs-text )
  24556. if (!isValidReasonPhrase(String(init.statusText))) {
  24557. throw new TypeError('Invalid statusText')
  24558. }
  24559. }
  24560. // 3. Set response’s response’s status to init["status"].
  24561. if ('status' in init && init.status != null) {
  24562. response[kState].status = init.status
  24563. }
  24564. // 4. Set response’s response’s status message to init["statusText"].
  24565. if ('statusText' in init && init.statusText != null) {
  24566. response[kState].statusText = init.statusText
  24567. }
  24568. // 5. If init["headers"] exists, then fill response’s headers with init["headers"].
  24569. if ('headers' in init && init.headers != null) {
  24570. fill(response[kHeaders], init.headers)
  24571. }
  24572. // 6. If body was given, then:
  24573. if (body) {
  24574. // 1. If response's status is a null body status, then throw a TypeError.
  24575. if (nullBodyStatus.includes(response.status)) {
  24576. throw webidl.errors.exception({
  24577. header: 'Response constructor',
  24578. message: 'Invalid response status code ' + response.status
  24579. })
  24580. }
  24581. // 2. Set response's body to body's body.
  24582. response[kState].body = body.body
  24583. // 3. If body's type is non-null and response's header list does not contain
  24584. // `Content-Type`, then append (`Content-Type`, body's type) to response's header list.
  24585. if (body.type != null && !response[kState].headersList.contains('Content-Type')) {
  24586. response[kState].headersList.append('content-type', body.type)
  24587. }
  24588. }
  24589. }
  24590. webidl.converters.ReadableStream = webidl.interfaceConverter(
  24591. ReadableStream
  24592. )
  24593. webidl.converters.FormData = webidl.interfaceConverter(
  24594. FormData
  24595. )
  24596. webidl.converters.URLSearchParams = webidl.interfaceConverter(
  24597. URLSearchParams
  24598. )
  24599. // https://fetch.spec.whatwg.org/#typedefdef-xmlhttprequestbodyinit
  24600. webidl.converters.XMLHttpRequestBodyInit = function (V) {
  24601. if (typeof V === 'string') {
  24602. return webidl.converters.USVString(V)
  24603. }
  24604. if (isBlobLike(V)) {
  24605. return webidl.converters.Blob(V, { strict: false })
  24606. }
  24607. if (types.isArrayBuffer(V) || types.isTypedArray(V) || types.isDataView(V)) {
  24608. return webidl.converters.BufferSource(V)
  24609. }
  24610. if (util.isFormDataLike(V)) {
  24611. return webidl.converters.FormData(V, { strict: false })
  24612. }
  24613. if (V instanceof URLSearchParams) {
  24614. return webidl.converters.URLSearchParams(V)
  24615. }
  24616. return webidl.converters.DOMString(V)
  24617. }
  24618. // https://fetch.spec.whatwg.org/#bodyinit
  24619. webidl.converters.BodyInit = function (V) {
  24620. if (V instanceof ReadableStream) {
  24621. return webidl.converters.ReadableStream(V)
  24622. }
  24623. // Note: the spec doesn't include async iterables,
  24624. // this is an undici extension.
  24625. if (V?.[Symbol.asyncIterator]) {
  24626. return V
  24627. }
  24628. return webidl.converters.XMLHttpRequestBodyInit(V)
  24629. }
  24630. webidl.converters.ResponseInit = webidl.dictionaryConverter([
  24631. {
  24632. key: 'status',
  24633. converter: webidl.converters['unsigned short'],
  24634. defaultValue: 200
  24635. },
  24636. {
  24637. key: 'statusText',
  24638. converter: webidl.converters.ByteString,
  24639. defaultValue: ''
  24640. },
  24641. {
  24642. key: 'headers',
  24643. converter: webidl.converters.HeadersInit
  24644. }
  24645. ])
  24646. module.exports = {
  24647. makeNetworkError,
  24648. makeResponse,
  24649. makeAppropriateNetworkError,
  24650. filterResponse,
  24651. Response,
  24652. cloneResponse
  24653. }
  24654. /***/ }),
  24655. /***/ 5861:
  24656. /***/ ((module) => {
  24657. "use strict";
  24658. module.exports = {
  24659. kUrl: Symbol('url'),
  24660. kHeaders: Symbol('headers'),
  24661. kSignal: Symbol('signal'),
  24662. kState: Symbol('state'),
  24663. kGuard: Symbol('guard'),
  24664. kRealm: Symbol('realm')
  24665. }
  24666. /***/ }),
  24667. /***/ 2538:
  24668. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  24669. "use strict";
  24670. const { redirectStatusSet, referrerPolicySet: referrerPolicyTokens, badPortsSet } = __nccwpck_require__(1037)
  24671. const { getGlobalOrigin } = __nccwpck_require__(1246)
  24672. const { performance } = __nccwpck_require__(4074)
  24673. const { isBlobLike, toUSVString, ReadableStreamFrom } = __nccwpck_require__(3983)
  24674. const assert = __nccwpck_require__(9491)
  24675. const { isUint8Array } = __nccwpck_require__(9830)
  24676. let supportedHashes = []
  24677. // https://nodejs.org/api/crypto.html#determining-if-crypto-support-is-unavailable
  24678. /** @type {import('crypto')|undefined} */
  24679. let crypto
  24680. try {
  24681. crypto = __nccwpck_require__(6113)
  24682. const possibleRelevantHashes = ['sha256', 'sha384', 'sha512']
  24683. supportedHashes = crypto.getHashes().filter((hash) => possibleRelevantHashes.includes(hash))
  24684. /* c8 ignore next 3 */
  24685. } catch {
  24686. }
  24687. function responseURL (response) {
  24688. // https://fetch.spec.whatwg.org/#responses
  24689. // A response has an associated URL. It is a pointer to the last URL
  24690. // in response’s URL list and null if response’s URL list is empty.
  24691. const urlList = response.urlList
  24692. const length = urlList.length
  24693. return length === 0 ? null : urlList[length - 1].toString()
  24694. }
  24695. // https://fetch.spec.whatwg.org/#concept-response-location-url
  24696. function responseLocationURL (response, requestFragment) {
  24697. // 1. If response’s status is not a redirect status, then return null.
  24698. if (!redirectStatusSet.has(response.status)) {
  24699. return null
  24700. }
  24701. // 2. Let location be the result of extracting header list values given
  24702. // `Location` and response’s header list.
  24703. let location = response.headersList.get('location')
  24704. // 3. If location is a header value, then set location to the result of
  24705. // parsing location with response’s URL.
  24706. if (location !== null && isValidHeaderValue(location)) {
  24707. location = new URL(location, responseURL(response))
  24708. }
  24709. // 4. If location is a URL whose fragment is null, then set location’s
  24710. // fragment to requestFragment.
  24711. if (location && !location.hash) {
  24712. location.hash = requestFragment
  24713. }
  24714. // 5. Return location.
  24715. return location
  24716. }
  24717. /** @returns {URL} */
  24718. function requestCurrentURL (request) {
  24719. return request.urlList[request.urlList.length - 1]
  24720. }
  24721. function requestBadPort (request) {
  24722. // 1. Let url be request’s current URL.
  24723. const url = requestCurrentURL(request)
  24724. // 2. If url’s scheme is an HTTP(S) scheme and url’s port is a bad port,
  24725. // then return blocked.
  24726. if (urlIsHttpHttpsScheme(url) && badPortsSet.has(url.port)) {
  24727. return 'blocked'
  24728. }
  24729. // 3. Return allowed.
  24730. return 'allowed'
  24731. }
  24732. function isErrorLike (object) {
  24733. return object instanceof Error || (
  24734. object?.constructor?.name === 'Error' ||
  24735. object?.constructor?.name === 'DOMException'
  24736. )
  24737. }
  24738. // Check whether |statusText| is a ByteString and
  24739. // matches the Reason-Phrase token production.
  24740. // RFC 2616: https://tools.ietf.org/html/rfc2616
  24741. // RFC 7230: https://tools.ietf.org/html/rfc7230
  24742. // "reason-phrase = *( HTAB / SP / VCHAR / obs-text )"
  24743. // https://github.com/chromium/chromium/blob/94.0.4604.1/third_party/blink/renderer/core/fetch/response.cc#L116
  24744. function isValidReasonPhrase (statusText) {
  24745. for (let i = 0; i < statusText.length; ++i) {
  24746. const c = statusText.charCodeAt(i)
  24747. if (
  24748. !(
  24749. (
  24750. c === 0x09 || // HTAB
  24751. (c >= 0x20 && c <= 0x7e) || // SP / VCHAR
  24752. (c >= 0x80 && c <= 0xff)
  24753. ) // obs-text
  24754. )
  24755. ) {
  24756. return false
  24757. }
  24758. }
  24759. return true
  24760. }
  24761. /**
  24762. * @see https://tools.ietf.org/html/rfc7230#section-3.2.6
  24763. * @param {number} c
  24764. */
  24765. function isTokenCharCode (c) {
  24766. switch (c) {
  24767. case 0x22:
  24768. case 0x28:
  24769. case 0x29:
  24770. case 0x2c:
  24771. case 0x2f:
  24772. case 0x3a:
  24773. case 0x3b:
  24774. case 0x3c:
  24775. case 0x3d:
  24776. case 0x3e:
  24777. case 0x3f:
  24778. case 0x40:
  24779. case 0x5b:
  24780. case 0x5c:
  24781. case 0x5d:
  24782. case 0x7b:
  24783. case 0x7d:
  24784. // DQUOTE and "(),/:;<=>?@[\]{}"
  24785. return false
  24786. default:
  24787. // VCHAR %x21-7E
  24788. return c >= 0x21 && c <= 0x7e
  24789. }
  24790. }
  24791. /**
  24792. * @param {string} characters
  24793. */
  24794. function isValidHTTPToken (characters) {
  24795. if (characters.length === 0) {
  24796. return false
  24797. }
  24798. for (let i = 0; i < characters.length; ++i) {
  24799. if (!isTokenCharCode(characters.charCodeAt(i))) {
  24800. return false
  24801. }
  24802. }
  24803. return true
  24804. }
  24805. /**
  24806. * @see https://fetch.spec.whatwg.org/#header-name
  24807. * @param {string} potentialValue
  24808. */
  24809. function isValidHeaderName (potentialValue) {
  24810. return isValidHTTPToken(potentialValue)
  24811. }
  24812. /**
  24813. * @see https://fetch.spec.whatwg.org/#header-value
  24814. * @param {string} potentialValue
  24815. */
  24816. function isValidHeaderValue (potentialValue) {
  24817. // - Has no leading or trailing HTTP tab or space bytes.
  24818. // - Contains no 0x00 (NUL) or HTTP newline bytes.
  24819. if (
  24820. potentialValue.startsWith('\t') ||
  24821. potentialValue.startsWith(' ') ||
  24822. potentialValue.endsWith('\t') ||
  24823. potentialValue.endsWith(' ')
  24824. ) {
  24825. return false
  24826. }
  24827. if (
  24828. potentialValue.includes('\0') ||
  24829. potentialValue.includes('\r') ||
  24830. potentialValue.includes('\n')
  24831. ) {
  24832. return false
  24833. }
  24834. return true
  24835. }
  24836. // https://w3c.github.io/webappsec-referrer-policy/#set-requests-referrer-policy-on-redirect
  24837. function setRequestReferrerPolicyOnRedirect (request, actualResponse) {
  24838. // Given a request request and a response actualResponse, this algorithm
  24839. // updates request’s referrer policy according to the Referrer-Policy
  24840. // header (if any) in actualResponse.
  24841. // 1. Let policy be the result of executing § 8.1 Parse a referrer policy
  24842. // from a Referrer-Policy header on actualResponse.
  24843. // 8.1 Parse a referrer policy from a Referrer-Policy header
  24844. // 1. Let policy-tokens be the result of extracting header list values given `Referrer-Policy` and response’s header list.
  24845. const { headersList } = actualResponse
  24846. // 2. Let policy be the empty string.
  24847. // 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.
  24848. // 4. Return policy.
  24849. const policyHeader = (headersList.get('referrer-policy') ?? '').split(',')
  24850. // Note: As the referrer-policy can contain multiple policies
  24851. // separated by comma, we need to loop through all of them
  24852. // and pick the first valid one.
  24853. // Ref: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Referrer-Policy#specify_a_fallback_policy
  24854. let policy = ''
  24855. if (policyHeader.length > 0) {
  24856. // The right-most policy takes precedence.
  24857. // The left-most policy is the fallback.
  24858. for (let i = policyHeader.length; i !== 0; i--) {
  24859. const token = policyHeader[i - 1].trim()
  24860. if (referrerPolicyTokens.has(token)) {
  24861. policy = token
  24862. break
  24863. }
  24864. }
  24865. }
  24866. // 2. If policy is not the empty string, then set request’s referrer policy to policy.
  24867. if (policy !== '') {
  24868. request.referrerPolicy = policy
  24869. }
  24870. }
  24871. // https://fetch.spec.whatwg.org/#cross-origin-resource-policy-check
  24872. function crossOriginResourcePolicyCheck () {
  24873. // TODO
  24874. return 'allowed'
  24875. }
  24876. // https://fetch.spec.whatwg.org/#concept-cors-check
  24877. function corsCheck () {
  24878. // TODO
  24879. return 'success'
  24880. }
  24881. // https://fetch.spec.whatwg.org/#concept-tao-check
  24882. function TAOCheck () {
  24883. // TODO
  24884. return 'success'
  24885. }
  24886. function appendFetchMetadata (httpRequest) {
  24887. // https://w3c.github.io/webappsec-fetch-metadata/#sec-fetch-dest-header
  24888. // TODO
  24889. // https://w3c.github.io/webappsec-fetch-metadata/#sec-fetch-mode-header
  24890. // 1. Assert: r’s url is a potentially trustworthy URL.
  24891. // TODO
  24892. // 2. Let header be a Structured Header whose value is a token.
  24893. let header = null
  24894. // 3. Set header’s value to r’s mode.
  24895. header = httpRequest.mode
  24896. // 4. Set a structured field value `Sec-Fetch-Mode`/header in r’s header list.
  24897. httpRequest.headersList.set('sec-fetch-mode', header)
  24898. // https://w3c.github.io/webappsec-fetch-metadata/#sec-fetch-site-header
  24899. // TODO
  24900. // https://w3c.github.io/webappsec-fetch-metadata/#sec-fetch-user-header
  24901. // TODO
  24902. }
  24903. // https://fetch.spec.whatwg.org/#append-a-request-origin-header
  24904. function appendRequestOriginHeader (request) {
  24905. // 1. Let serializedOrigin be the result of byte-serializing a request origin with request.
  24906. let serializedOrigin = request.origin
  24907. // 2. If request’s response tainting is "cors" or request’s mode is "websocket", then append (`Origin`, serializedOrigin) to request’s header list.
  24908. if (request.responseTainting === 'cors' || request.mode === 'websocket') {
  24909. if (serializedOrigin) {
  24910. request.headersList.append('origin', serializedOrigin)
  24911. }
  24912. // 3. Otherwise, if request’s method is neither `GET` nor `HEAD`, then:
  24913. } else if (request.method !== 'GET' && request.method !== 'HEAD') {
  24914. // 1. Switch on request’s referrer policy:
  24915. switch (request.referrerPolicy) {
  24916. case 'no-referrer':
  24917. // Set serializedOrigin to `null`.
  24918. serializedOrigin = null
  24919. break
  24920. case 'no-referrer-when-downgrade':
  24921. case 'strict-origin':
  24922. case 'strict-origin-when-cross-origin':
  24923. // 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`.
  24924. if (request.origin && urlHasHttpsScheme(request.origin) && !urlHasHttpsScheme(requestCurrentURL(request))) {
  24925. serializedOrigin = null
  24926. }
  24927. break
  24928. case 'same-origin':
  24929. // If request’s origin is not same origin with request’s current URL’s origin, then set serializedOrigin to `null`.
  24930. if (!sameOrigin(request, requestCurrentURL(request))) {
  24931. serializedOrigin = null
  24932. }
  24933. break
  24934. default:
  24935. // Do nothing.
  24936. }
  24937. if (serializedOrigin) {
  24938. // 2. Append (`Origin`, serializedOrigin) to request’s header list.
  24939. request.headersList.append('origin', serializedOrigin)
  24940. }
  24941. }
  24942. }
  24943. function coarsenedSharedCurrentTime (crossOriginIsolatedCapability) {
  24944. // TODO
  24945. return performance.now()
  24946. }
  24947. // https://fetch.spec.whatwg.org/#create-an-opaque-timing-info
  24948. function createOpaqueTimingInfo (timingInfo) {
  24949. return {
  24950. startTime: timingInfo.startTime ?? 0,
  24951. redirectStartTime: 0,
  24952. redirectEndTime: 0,
  24953. postRedirectStartTime: timingInfo.startTime ?? 0,
  24954. finalServiceWorkerStartTime: 0,
  24955. finalNetworkResponseStartTime: 0,
  24956. finalNetworkRequestStartTime: 0,
  24957. endTime: 0,
  24958. encodedBodySize: 0,
  24959. decodedBodySize: 0,
  24960. finalConnectionTimingInfo: null
  24961. }
  24962. }
  24963. // https://html.spec.whatwg.org/multipage/origin.html#policy-container
  24964. function makePolicyContainer () {
  24965. // Note: the fetch spec doesn't make use of embedder policy or CSP list
  24966. return {
  24967. referrerPolicy: 'strict-origin-when-cross-origin'
  24968. }
  24969. }
  24970. // https://html.spec.whatwg.org/multipage/origin.html#clone-a-policy-container
  24971. function clonePolicyContainer (policyContainer) {
  24972. return {
  24973. referrerPolicy: policyContainer.referrerPolicy
  24974. }
  24975. }
  24976. // https://w3c.github.io/webappsec-referrer-policy/#determine-requests-referrer
  24977. function determineRequestsReferrer (request) {
  24978. // 1. Let policy be request's referrer policy.
  24979. const policy = request.referrerPolicy
  24980. // Note: policy cannot (shouldn't) be null or an empty string.
  24981. assert(policy)
  24982. // 2. Let environment be request’s client.
  24983. let referrerSource = null
  24984. // 3. Switch on request’s referrer:
  24985. if (request.referrer === 'client') {
  24986. // Note: node isn't a browser and doesn't implement document/iframes,
  24987. // so we bypass this step and replace it with our own.
  24988. const globalOrigin = getGlobalOrigin()
  24989. if (!globalOrigin || globalOrigin.origin === 'null') {
  24990. return 'no-referrer'
  24991. }
  24992. // note: we need to clone it as it's mutated
  24993. referrerSource = new URL(globalOrigin)
  24994. } else if (request.referrer instanceof URL) {
  24995. // Let referrerSource be request’s referrer.
  24996. referrerSource = request.referrer
  24997. }
  24998. // 4. Let request’s referrerURL be the result of stripping referrerSource for
  24999. // use as a referrer.
  25000. let referrerURL = stripURLForReferrer(referrerSource)
  25001. // 5. Let referrerOrigin be the result of stripping referrerSource for use as
  25002. // a referrer, with the origin-only flag set to true.
  25003. const referrerOrigin = stripURLForReferrer(referrerSource, true)
  25004. // 6. If the result of serializing referrerURL is a string whose length is
  25005. // greater than 4096, set referrerURL to referrerOrigin.
  25006. if (referrerURL.toString().length > 4096) {
  25007. referrerURL = referrerOrigin
  25008. }
  25009. const areSameOrigin = sameOrigin(request, referrerURL)
  25010. const isNonPotentiallyTrustWorthy = isURLPotentiallyTrustworthy(referrerURL) &&
  25011. !isURLPotentiallyTrustworthy(request.url)
  25012. // 8. Execute the switch statements corresponding to the value of policy:
  25013. switch (policy) {
  25014. case 'origin': return referrerOrigin != null ? referrerOrigin : stripURLForReferrer(referrerSource, true)
  25015. case 'unsafe-url': return referrerURL
  25016. case 'same-origin':
  25017. return areSameOrigin ? referrerOrigin : 'no-referrer'
  25018. case 'origin-when-cross-origin':
  25019. return areSameOrigin ? referrerURL : referrerOrigin
  25020. case 'strict-origin-when-cross-origin': {
  25021. const currentURL = requestCurrentURL(request)
  25022. // 1. If the origin of referrerURL and the origin of request’s current
  25023. // URL are the same, then return referrerURL.
  25024. if (sameOrigin(referrerURL, currentURL)) {
  25025. return referrerURL
  25026. }
  25027. // 2. If referrerURL is a potentially trustworthy URL and request’s
  25028. // current URL is not a potentially trustworthy URL, then return no
  25029. // referrer.
  25030. if (isURLPotentiallyTrustworthy(referrerURL) && !isURLPotentiallyTrustworthy(currentURL)) {
  25031. return 'no-referrer'
  25032. }
  25033. // 3. Return referrerOrigin.
  25034. return referrerOrigin
  25035. }
  25036. case 'strict-origin': // eslint-disable-line
  25037. /**
  25038. * 1. If referrerURL is a potentially trustworthy URL and
  25039. * request’s current URL is not a potentially trustworthy URL,
  25040. * then return no referrer.
  25041. * 2. Return referrerOrigin
  25042. */
  25043. case 'no-referrer-when-downgrade': // eslint-disable-line
  25044. /**
  25045. * 1. If referrerURL is a potentially trustworthy URL and
  25046. * request’s current URL is not a potentially trustworthy URL,
  25047. * then return no referrer.
  25048. * 2. Return referrerOrigin
  25049. */
  25050. default: // eslint-disable-line
  25051. return isNonPotentiallyTrustWorthy ? 'no-referrer' : referrerOrigin
  25052. }
  25053. }
  25054. /**
  25055. * @see https://w3c.github.io/webappsec-referrer-policy/#strip-url
  25056. * @param {URL} url
  25057. * @param {boolean|undefined} originOnly
  25058. */
  25059. function stripURLForReferrer (url, originOnly) {
  25060. // 1. Assert: url is a URL.
  25061. assert(url instanceof URL)
  25062. // 2. If url’s scheme is a local scheme, then return no referrer.
  25063. if (url.protocol === 'file:' || url.protocol === 'about:' || url.protocol === 'blank:') {
  25064. return 'no-referrer'
  25065. }
  25066. // 3. Set url’s username to the empty string.
  25067. url.username = ''
  25068. // 4. Set url’s password to the empty string.
  25069. url.password = ''
  25070. // 5. Set url’s fragment to null.
  25071. url.hash = ''
  25072. // 6. If the origin-only flag is true, then:
  25073. if (originOnly) {
  25074. // 1. Set url’s path to « the empty string ».
  25075. url.pathname = ''
  25076. // 2. Set url’s query to null.
  25077. url.search = ''
  25078. }
  25079. // 7. Return url.
  25080. return url
  25081. }
  25082. function isURLPotentiallyTrustworthy (url) {
  25083. if (!(url instanceof URL)) {
  25084. return false
  25085. }
  25086. // If child of about, return true
  25087. if (url.href === 'about:blank' || url.href === 'about:srcdoc') {
  25088. return true
  25089. }
  25090. // If scheme is data, return true
  25091. if (url.protocol === 'data:') return true
  25092. // If file, return true
  25093. if (url.protocol === 'file:') return true
  25094. return isOriginPotentiallyTrustworthy(url.origin)
  25095. function isOriginPotentiallyTrustworthy (origin) {
  25096. // If origin is explicitly null, return false
  25097. if (origin == null || origin === 'null') return false
  25098. const originAsURL = new URL(origin)
  25099. // If secure, return true
  25100. if (originAsURL.protocol === 'https:' || originAsURL.protocol === 'wss:') {
  25101. return true
  25102. }
  25103. // If localhost or variants, return true
  25104. if (/^127(?:\.[0-9]+){0,2}\.[0-9]+$|^\[(?:0*:)*?:?0*1\]$/.test(originAsURL.hostname) ||
  25105. (originAsURL.hostname === 'localhost' || originAsURL.hostname.includes('localhost.')) ||
  25106. (originAsURL.hostname.endsWith('.localhost'))) {
  25107. return true
  25108. }
  25109. // If any other, return false
  25110. return false
  25111. }
  25112. }
  25113. /**
  25114. * @see https://w3c.github.io/webappsec-subresource-integrity/#does-response-match-metadatalist
  25115. * @param {Uint8Array} bytes
  25116. * @param {string} metadataList
  25117. */
  25118. function bytesMatch (bytes, metadataList) {
  25119. // If node is not built with OpenSSL support, we cannot check
  25120. // a request's integrity, so allow it by default (the spec will
  25121. // allow requests if an invalid hash is given, as precedence).
  25122. /* istanbul ignore if: only if node is built with --without-ssl */
  25123. if (crypto === undefined) {
  25124. return true
  25125. }
  25126. // 1. Let parsedMetadata be the result of parsing metadataList.
  25127. const parsedMetadata = parseMetadata(metadataList)
  25128. // 2. If parsedMetadata is no metadata, return true.
  25129. if (parsedMetadata === 'no metadata') {
  25130. return true
  25131. }
  25132. // 3. If response is not eligible for integrity validation, return false.
  25133. // TODO
  25134. // 4. If parsedMetadata is the empty set, return true.
  25135. if (parsedMetadata.length === 0) {
  25136. return true
  25137. }
  25138. // 5. Let metadata be the result of getting the strongest
  25139. // metadata from parsedMetadata.
  25140. const strongest = getStrongestMetadata(parsedMetadata)
  25141. const metadata = filterMetadataListByAlgorithm(parsedMetadata, strongest)
  25142. // 6. For each item in metadata:
  25143. for (const item of metadata) {
  25144. // 1. Let algorithm be the alg component of item.
  25145. const algorithm = item.algo
  25146. // 2. Let expectedValue be the val component of item.
  25147. const expectedValue = item.hash
  25148. // See https://github.com/web-platform-tests/wpt/commit/e4c5cc7a5e48093220528dfdd1c4012dc3837a0e
  25149. // "be liberal with padding". This is annoying, and it's not even in the spec.
  25150. // 3. Let actualValue be the result of applying algorithm to bytes.
  25151. let actualValue = crypto.createHash(algorithm).update(bytes).digest('base64')
  25152. if (actualValue[actualValue.length - 1] === '=') {
  25153. if (actualValue[actualValue.length - 2] === '=') {
  25154. actualValue = actualValue.slice(0, -2)
  25155. } else {
  25156. actualValue = actualValue.slice(0, -1)
  25157. }
  25158. }
  25159. // 4. If actualValue is a case-sensitive match for expectedValue,
  25160. // return true.
  25161. if (compareBase64Mixed(actualValue, expectedValue)) {
  25162. return true
  25163. }
  25164. }
  25165. // 7. Return false.
  25166. return false
  25167. }
  25168. // https://w3c.github.io/webappsec-subresource-integrity/#grammardef-hash-with-options
  25169. // https://www.w3.org/TR/CSP2/#source-list-syntax
  25170. // https://www.rfc-editor.org/rfc/rfc5234#appendix-B.1
  25171. const parseHashWithOptions = /(?<algo>sha256|sha384|sha512)-((?<hash>[A-Za-z0-9+/]+|[A-Za-z0-9_-]+)={0,2}(?:\s|$)( +[!-~]*)?)?/i
  25172. /**
  25173. * @see https://w3c.github.io/webappsec-subresource-integrity/#parse-metadata
  25174. * @param {string} metadata
  25175. */
  25176. function parseMetadata (metadata) {
  25177. // 1. Let result be the empty set.
  25178. /** @type {{ algo: string, hash: string }[]} */
  25179. const result = []
  25180. // 2. Let empty be equal to true.
  25181. let empty = true
  25182. // 3. For each token returned by splitting metadata on spaces:
  25183. for (const token of metadata.split(' ')) {
  25184. // 1. Set empty to false.
  25185. empty = false
  25186. // 2. Parse token as a hash-with-options.
  25187. const parsedToken = parseHashWithOptions.exec(token)
  25188. // 3. If token does not parse, continue to the next token.
  25189. if (
  25190. parsedToken === null ||
  25191. parsedToken.groups === undefined ||
  25192. parsedToken.groups.algo === undefined
  25193. ) {
  25194. // Note: Chromium blocks the request at this point, but Firefox
  25195. // gives a warning that an invalid integrity was given. The
  25196. // correct behavior is to ignore these, and subsequently not
  25197. // check the integrity of the resource.
  25198. continue
  25199. }
  25200. // 4. Let algorithm be the hash-algo component of token.
  25201. const algorithm = parsedToken.groups.algo.toLowerCase()
  25202. // 5. If algorithm is a hash function recognized by the user
  25203. // agent, add the parsed token to result.
  25204. if (supportedHashes.includes(algorithm)) {
  25205. result.push(parsedToken.groups)
  25206. }
  25207. }
  25208. // 4. Return no metadata if empty is true, otherwise return result.
  25209. if (empty === true) {
  25210. return 'no metadata'
  25211. }
  25212. return result
  25213. }
  25214. /**
  25215. * @param {{ algo: 'sha256' | 'sha384' | 'sha512' }[]} metadataList
  25216. */
  25217. function getStrongestMetadata (metadataList) {
  25218. // Let algorithm be the algo component of the first item in metadataList.
  25219. // Can be sha256
  25220. let algorithm = metadataList[0].algo
  25221. // If the algorithm is sha512, then it is the strongest
  25222. // and we can return immediately
  25223. if (algorithm[3] === '5') {
  25224. return algorithm
  25225. }
  25226. for (let i = 1; i < metadataList.length; ++i) {
  25227. const metadata = metadataList[i]
  25228. // If the algorithm is sha512, then it is the strongest
  25229. // and we can break the loop immediately
  25230. if (metadata.algo[3] === '5') {
  25231. algorithm = 'sha512'
  25232. break
  25233. // If the algorithm is sha384, then a potential sha256 or sha384 is ignored
  25234. } else if (algorithm[3] === '3') {
  25235. continue
  25236. // algorithm is sha256, check if algorithm is sha384 and if so, set it as
  25237. // the strongest
  25238. } else if (metadata.algo[3] === '3') {
  25239. algorithm = 'sha384'
  25240. }
  25241. }
  25242. return algorithm
  25243. }
  25244. function filterMetadataListByAlgorithm (metadataList, algorithm) {
  25245. if (metadataList.length === 1) {
  25246. return metadataList
  25247. }
  25248. let pos = 0
  25249. for (let i = 0; i < metadataList.length; ++i) {
  25250. if (metadataList[i].algo === algorithm) {
  25251. metadataList[pos++] = metadataList[i]
  25252. }
  25253. }
  25254. metadataList.length = pos
  25255. return metadataList
  25256. }
  25257. /**
  25258. * Compares two base64 strings, allowing for base64url
  25259. * in the second string.
  25260. *
  25261. * @param {string} actualValue always base64
  25262. * @param {string} expectedValue base64 or base64url
  25263. * @returns {boolean}
  25264. */
  25265. function compareBase64Mixed (actualValue, expectedValue) {
  25266. if (actualValue.length !== expectedValue.length) {
  25267. return false
  25268. }
  25269. for (let i = 0; i < actualValue.length; ++i) {
  25270. if (actualValue[i] !== expectedValue[i]) {
  25271. if (
  25272. (actualValue[i] === '+' && expectedValue[i] === '-') ||
  25273. (actualValue[i] === '/' && expectedValue[i] === '_')
  25274. ) {
  25275. continue
  25276. }
  25277. return false
  25278. }
  25279. }
  25280. return true
  25281. }
  25282. // https://w3c.github.io/webappsec-upgrade-insecure-requests/#upgrade-request
  25283. function tryUpgradeRequestToAPotentiallyTrustworthyURL (request) {
  25284. // TODO
  25285. }
  25286. /**
  25287. * @link {https://html.spec.whatwg.org/multipage/origin.html#same-origin}
  25288. * @param {URL} A
  25289. * @param {URL} B
  25290. */
  25291. function sameOrigin (A, B) {
  25292. // 1. If A and B are the same opaque origin, then return true.
  25293. if (A.origin === B.origin && A.origin === 'null') {
  25294. return true
  25295. }
  25296. // 2. If A and B are both tuple origins and their schemes,
  25297. // hosts, and port are identical, then return true.
  25298. if (A.protocol === B.protocol && A.hostname === B.hostname && A.port === B.port) {
  25299. return true
  25300. }
  25301. // 3. Return false.
  25302. return false
  25303. }
  25304. function createDeferredPromise () {
  25305. let res
  25306. let rej
  25307. const promise = new Promise((resolve, reject) => {
  25308. res = resolve
  25309. rej = reject
  25310. })
  25311. return { promise, resolve: res, reject: rej }
  25312. }
  25313. function isAborted (fetchParams) {
  25314. return fetchParams.controller.state === 'aborted'
  25315. }
  25316. function isCancelled (fetchParams) {
  25317. return fetchParams.controller.state === 'aborted' ||
  25318. fetchParams.controller.state === 'terminated'
  25319. }
  25320. const normalizeMethodRecord = {
  25321. delete: 'DELETE',
  25322. DELETE: 'DELETE',
  25323. get: 'GET',
  25324. GET: 'GET',
  25325. head: 'HEAD',
  25326. HEAD: 'HEAD',
  25327. options: 'OPTIONS',
  25328. OPTIONS: 'OPTIONS',
  25329. post: 'POST',
  25330. POST: 'POST',
  25331. put: 'PUT',
  25332. PUT: 'PUT'
  25333. }
  25334. // Note: object prototypes should not be able to be referenced. e.g. `Object#hasOwnProperty`.
  25335. Object.setPrototypeOf(normalizeMethodRecord, null)
  25336. /**
  25337. * @see https://fetch.spec.whatwg.org/#concept-method-normalize
  25338. * @param {string} method
  25339. */
  25340. function normalizeMethod (method) {
  25341. return normalizeMethodRecord[method.toLowerCase()] ?? method
  25342. }
  25343. // https://infra.spec.whatwg.org/#serialize-a-javascript-value-to-a-json-string
  25344. function serializeJavascriptValueToJSONString (value) {
  25345. // 1. Let result be ? Call(%JSON.stringify%, undefined, « value »).
  25346. const result = JSON.stringify(value)
  25347. // 2. If result is undefined, then throw a TypeError.
  25348. if (result === undefined) {
  25349. throw new TypeError('Value is not JSON serializable')
  25350. }
  25351. // 3. Assert: result is a string.
  25352. assert(typeof result === 'string')
  25353. // 4. Return result.
  25354. return result
  25355. }
  25356. // https://tc39.es/ecma262/#sec-%25iteratorprototype%25-object
  25357. const esIteratorPrototype = Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]()))
  25358. /**
  25359. * @see https://webidl.spec.whatwg.org/#dfn-iterator-prototype-object
  25360. * @param {() => unknown[]} iterator
  25361. * @param {string} name name of the instance
  25362. * @param {'key'|'value'|'key+value'} kind
  25363. */
  25364. function makeIterator (iterator, name, kind) {
  25365. const object = {
  25366. index: 0,
  25367. kind,
  25368. target: iterator
  25369. }
  25370. const i = {
  25371. next () {
  25372. // 1. Let interface be the interface for which the iterator prototype object exists.
  25373. // 2. Let thisValue be the this value.
  25374. // 3. Let object be ? ToObject(thisValue).
  25375. // 4. If object is a platform object, then perform a security
  25376. // check, passing:
  25377. // 5. If object is not a default iterator object for interface,
  25378. // then throw a TypeError.
  25379. if (Object.getPrototypeOf(this) !== i) {
  25380. throw new TypeError(
  25381. `'next' called on an object that does not implement interface ${name} Iterator.`
  25382. )
  25383. }
  25384. // 6. Let index be object’s index.
  25385. // 7. Let kind be object’s kind.
  25386. // 8. Let values be object’s target's value pairs to iterate over.
  25387. const { index, kind, target } = object
  25388. const values = target()
  25389. // 9. Let len be the length of values.
  25390. const len = values.length
  25391. // 10. If index is greater than or equal to len, then return
  25392. // CreateIterResultObject(undefined, true).
  25393. if (index >= len) {
  25394. return { value: undefined, done: true }
  25395. }
  25396. // 11. Let pair be the entry in values at index index.
  25397. const pair = values[index]
  25398. // 12. Set object’s index to index + 1.
  25399. object.index = index + 1
  25400. // 13. Return the iterator result for pair and kind.
  25401. return iteratorResult(pair, kind)
  25402. },
  25403. // The class string of an iterator prototype object for a given interface is the
  25404. // result of concatenating the identifier of the interface and the string " Iterator".
  25405. [Symbol.toStringTag]: `${name} Iterator`
  25406. }
  25407. // The [[Prototype]] internal slot of an iterator prototype object must be %IteratorPrototype%.
  25408. Object.setPrototypeOf(i, esIteratorPrototype)
  25409. // esIteratorPrototype needs to be the prototype of i
  25410. // which is the prototype of an empty object. Yes, it's confusing.
  25411. return Object.setPrototypeOf({}, i)
  25412. }
  25413. // https://webidl.spec.whatwg.org/#iterator-result
  25414. function iteratorResult (pair, kind) {
  25415. let result
  25416. // 1. Let result be a value determined by the value of kind:
  25417. switch (kind) {
  25418. case 'key': {
  25419. // 1. Let idlKey be pair’s key.
  25420. // 2. Let key be the result of converting idlKey to an
  25421. // ECMAScript value.
  25422. // 3. result is key.
  25423. result = pair[0]
  25424. break
  25425. }
  25426. case 'value': {
  25427. // 1. Let idlValue be pair’s value.
  25428. // 2. Let value be the result of converting idlValue to
  25429. // an ECMAScript value.
  25430. // 3. result is value.
  25431. result = pair[1]
  25432. break
  25433. }
  25434. case 'key+value': {
  25435. // 1. Let idlKey be pair’s key.
  25436. // 2. Let idlValue be pair’s value.
  25437. // 3. Let key be the result of converting idlKey to an
  25438. // ECMAScript value.
  25439. // 4. Let value be the result of converting idlValue to
  25440. // an ECMAScript value.
  25441. // 5. Let array be ! ArrayCreate(2).
  25442. // 6. Call ! CreateDataProperty(array, "0", key).
  25443. // 7. Call ! CreateDataProperty(array, "1", value).
  25444. // 8. result is array.
  25445. result = pair
  25446. break
  25447. }
  25448. }
  25449. // 2. Return CreateIterResultObject(result, false).
  25450. return { value: result, done: false }
  25451. }
  25452. /**
  25453. * @see https://fetch.spec.whatwg.org/#body-fully-read
  25454. */
  25455. async function fullyReadBody (body, processBody, processBodyError) {
  25456. // 1. If taskDestination is null, then set taskDestination to
  25457. // the result of starting a new parallel queue.
  25458. // 2. Let successSteps given a byte sequence bytes be to queue a
  25459. // fetch task to run processBody given bytes, with taskDestination.
  25460. const successSteps = processBody
  25461. // 3. Let errorSteps be to queue a fetch task to run processBodyError,
  25462. // with taskDestination.
  25463. const errorSteps = processBodyError
  25464. // 4. Let reader be the result of getting a reader for body’s stream.
  25465. // If that threw an exception, then run errorSteps with that
  25466. // exception and return.
  25467. let reader
  25468. try {
  25469. reader = body.stream.getReader()
  25470. } catch (e) {
  25471. errorSteps(e)
  25472. return
  25473. }
  25474. // 5. Read all bytes from reader, given successSteps and errorSteps.
  25475. try {
  25476. const result = await readAllBytes(reader)
  25477. successSteps(result)
  25478. } catch (e) {
  25479. errorSteps(e)
  25480. }
  25481. }
  25482. /** @type {ReadableStream} */
  25483. let ReadableStream = globalThis.ReadableStream
  25484. function isReadableStreamLike (stream) {
  25485. if (!ReadableStream) {
  25486. ReadableStream = (__nccwpck_require__(5356).ReadableStream)
  25487. }
  25488. return stream instanceof ReadableStream || (
  25489. stream[Symbol.toStringTag] === 'ReadableStream' &&
  25490. typeof stream.tee === 'function'
  25491. )
  25492. }
  25493. const MAXIMUM_ARGUMENT_LENGTH = 65535
  25494. /**
  25495. * @see https://infra.spec.whatwg.org/#isomorphic-decode
  25496. * @param {number[]|Uint8Array} input
  25497. */
  25498. function isomorphicDecode (input) {
  25499. // 1. To isomorphic decode a byte sequence input, return a string whose code point
  25500. // length is equal to input’s length and whose code points have the same values
  25501. // as the values of input’s bytes, in the same order.
  25502. if (input.length < MAXIMUM_ARGUMENT_LENGTH) {
  25503. return String.fromCharCode(...input)
  25504. }
  25505. return input.reduce((previous, current) => previous + String.fromCharCode(current), '')
  25506. }
  25507. /**
  25508. * @param {ReadableStreamController<Uint8Array>} controller
  25509. */
  25510. function readableStreamClose (controller) {
  25511. try {
  25512. controller.close()
  25513. } catch (err) {
  25514. // TODO: add comment explaining why this error occurs.
  25515. if (!err.message.includes('Controller is already closed')) {
  25516. throw err
  25517. }
  25518. }
  25519. }
  25520. /**
  25521. * @see https://infra.spec.whatwg.org/#isomorphic-encode
  25522. * @param {string} input
  25523. */
  25524. function isomorphicEncode (input) {
  25525. // 1. Assert: input contains no code points greater than U+00FF.
  25526. for (let i = 0; i < input.length; i++) {
  25527. assert(input.charCodeAt(i) <= 0xFF)
  25528. }
  25529. // 2. Return a byte sequence whose length is equal to input’s code
  25530. // point length and whose bytes have the same values as the
  25531. // values of input’s code points, in the same order
  25532. return input
  25533. }
  25534. /**
  25535. * @see https://streams.spec.whatwg.org/#readablestreamdefaultreader-read-all-bytes
  25536. * @see https://streams.spec.whatwg.org/#read-loop
  25537. * @param {ReadableStreamDefaultReader} reader
  25538. */
  25539. async function readAllBytes (reader) {
  25540. const bytes = []
  25541. let byteLength = 0
  25542. while (true) {
  25543. const { done, value: chunk } = await reader.read()
  25544. if (done) {
  25545. // 1. Call successSteps with bytes.
  25546. return Buffer.concat(bytes, byteLength)
  25547. }
  25548. // 1. If chunk is not a Uint8Array object, call failureSteps
  25549. // with a TypeError and abort these steps.
  25550. if (!isUint8Array(chunk)) {
  25551. throw new TypeError('Received non-Uint8Array chunk')
  25552. }
  25553. // 2. Append the bytes represented by chunk to bytes.
  25554. bytes.push(chunk)
  25555. byteLength += chunk.length
  25556. // 3. Read-loop given reader, bytes, successSteps, and failureSteps.
  25557. }
  25558. }
  25559. /**
  25560. * @see https://fetch.spec.whatwg.org/#is-local
  25561. * @param {URL} url
  25562. */
  25563. function urlIsLocal (url) {
  25564. assert('protocol' in url) // ensure it's a url object
  25565. const protocol = url.protocol
  25566. return protocol === 'about:' || protocol === 'blob:' || protocol === 'data:'
  25567. }
  25568. /**
  25569. * @param {string|URL} url
  25570. */
  25571. function urlHasHttpsScheme (url) {
  25572. if (typeof url === 'string') {
  25573. return url.startsWith('https:')
  25574. }
  25575. return url.protocol === 'https:'
  25576. }
  25577. /**
  25578. * @see https://fetch.spec.whatwg.org/#http-scheme
  25579. * @param {URL} url
  25580. */
  25581. function urlIsHttpHttpsScheme (url) {
  25582. assert('protocol' in url) // ensure it's a url object
  25583. const protocol = url.protocol
  25584. return protocol === 'http:' || protocol === 'https:'
  25585. }
  25586. /**
  25587. * Fetch supports node >= 16.8.0, but Object.hasOwn was added in v16.9.0.
  25588. */
  25589. const hasOwn = Object.hasOwn || ((dict, key) => Object.prototype.hasOwnProperty.call(dict, key))
  25590. module.exports = {
  25591. isAborted,
  25592. isCancelled,
  25593. createDeferredPromise,
  25594. ReadableStreamFrom,
  25595. toUSVString,
  25596. tryUpgradeRequestToAPotentiallyTrustworthyURL,
  25597. coarsenedSharedCurrentTime,
  25598. determineRequestsReferrer,
  25599. makePolicyContainer,
  25600. clonePolicyContainer,
  25601. appendFetchMetadata,
  25602. appendRequestOriginHeader,
  25603. TAOCheck,
  25604. corsCheck,
  25605. crossOriginResourcePolicyCheck,
  25606. createOpaqueTimingInfo,
  25607. setRequestReferrerPolicyOnRedirect,
  25608. isValidHTTPToken,
  25609. requestBadPort,
  25610. requestCurrentURL,
  25611. responseURL,
  25612. responseLocationURL,
  25613. isBlobLike,
  25614. isURLPotentiallyTrustworthy,
  25615. isValidReasonPhrase,
  25616. sameOrigin,
  25617. normalizeMethod,
  25618. serializeJavascriptValueToJSONString,
  25619. makeIterator,
  25620. isValidHeaderName,
  25621. isValidHeaderValue,
  25622. hasOwn,
  25623. isErrorLike,
  25624. fullyReadBody,
  25625. bytesMatch,
  25626. isReadableStreamLike,
  25627. readableStreamClose,
  25628. isomorphicEncode,
  25629. isomorphicDecode,
  25630. urlIsLocal,
  25631. urlHasHttpsScheme,
  25632. urlIsHttpHttpsScheme,
  25633. readAllBytes,
  25634. normalizeMethodRecord,
  25635. parseMetadata
  25636. }
  25637. /***/ }),
  25638. /***/ 1744:
  25639. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  25640. "use strict";
  25641. const { types } = __nccwpck_require__(3837)
  25642. const { hasOwn, toUSVString } = __nccwpck_require__(2538)
  25643. /** @type {import('../../types/webidl').Webidl} */
  25644. const webidl = {}
  25645. webidl.converters = {}
  25646. webidl.util = {}
  25647. webidl.errors = {}
  25648. webidl.errors.exception = function (message) {
  25649. return new TypeError(`${message.header}: ${message.message}`)
  25650. }
  25651. webidl.errors.conversionFailed = function (context) {
  25652. const plural = context.types.length === 1 ? '' : ' one of'
  25653. const message =
  25654. `${context.argument} could not be converted to` +
  25655. `${plural}: ${context.types.join(', ')}.`
  25656. return webidl.errors.exception({
  25657. header: context.prefix,
  25658. message
  25659. })
  25660. }
  25661. webidl.errors.invalidArgument = function (context) {
  25662. return webidl.errors.exception({
  25663. header: context.prefix,
  25664. message: `"${context.value}" is an invalid ${context.type}.`
  25665. })
  25666. }
  25667. // https://webidl.spec.whatwg.org/#implements
  25668. webidl.brandCheck = function (V, I, opts = undefined) {
  25669. if (opts?.strict !== false && !(V instanceof I)) {
  25670. throw new TypeError('Illegal invocation')
  25671. } else {
  25672. return V?.[Symbol.toStringTag] === I.prototype[Symbol.toStringTag]
  25673. }
  25674. }
  25675. webidl.argumentLengthCheck = function ({ length }, min, ctx) {
  25676. if (length < min) {
  25677. throw webidl.errors.exception({
  25678. message: `${min} argument${min !== 1 ? 's' : ''} required, ` +
  25679. `but${length ? ' only' : ''} ${length} found.`,
  25680. ...ctx
  25681. })
  25682. }
  25683. }
  25684. webidl.illegalConstructor = function () {
  25685. throw webidl.errors.exception({
  25686. header: 'TypeError',
  25687. message: 'Illegal constructor'
  25688. })
  25689. }
  25690. // https://tc39.es/ecma262/#sec-ecmascript-data-types-and-values
  25691. webidl.util.Type = function (V) {
  25692. switch (typeof V) {
  25693. case 'undefined': return 'Undefined'
  25694. case 'boolean': return 'Boolean'
  25695. case 'string': return 'String'
  25696. case 'symbol': return 'Symbol'
  25697. case 'number': return 'Number'
  25698. case 'bigint': return 'BigInt'
  25699. case 'function':
  25700. case 'object': {
  25701. if (V === null) {
  25702. return 'Null'
  25703. }
  25704. return 'Object'
  25705. }
  25706. }
  25707. }
  25708. // https://webidl.spec.whatwg.org/#abstract-opdef-converttoint
  25709. webidl.util.ConvertToInt = function (V, bitLength, signedness, opts = {}) {
  25710. let upperBound
  25711. let lowerBound
  25712. // 1. If bitLength is 64, then:
  25713. if (bitLength === 64) {
  25714. // 1. Let upperBound be 2^53 − 1.
  25715. upperBound = Math.pow(2, 53) - 1
  25716. // 2. If signedness is "unsigned", then let lowerBound be 0.
  25717. if (signedness === 'unsigned') {
  25718. lowerBound = 0
  25719. } else {
  25720. // 3. Otherwise let lowerBound be −2^53 + 1.
  25721. lowerBound = Math.pow(-2, 53) + 1
  25722. }
  25723. } else if (signedness === 'unsigned') {
  25724. // 2. Otherwise, if signedness is "unsigned", then:
  25725. // 1. Let lowerBound be 0.
  25726. lowerBound = 0
  25727. // 2. Let upperBound be 2^bitLength − 1.
  25728. upperBound = Math.pow(2, bitLength) - 1
  25729. } else {
  25730. // 3. Otherwise:
  25731. // 1. Let lowerBound be -2^bitLength − 1.
  25732. lowerBound = Math.pow(-2, bitLength) - 1
  25733. // 2. Let upperBound be 2^bitLength − 1 − 1.
  25734. upperBound = Math.pow(2, bitLength - 1) - 1
  25735. }
  25736. // 4. Let x be ? ToNumber(V).
  25737. let x = Number(V)
  25738. // 5. If x is −0, then set x to +0.
  25739. if (x === 0) {
  25740. x = 0
  25741. }
  25742. // 6. If the conversion is to an IDL type associated
  25743. // with the [EnforceRange] extended attribute, then:
  25744. if (opts.enforceRange === true) {
  25745. // 1. If x is NaN, +∞, or −∞, then throw a TypeError.
  25746. if (
  25747. Number.isNaN(x) ||
  25748. x === Number.POSITIVE_INFINITY ||
  25749. x === Number.NEGATIVE_INFINITY
  25750. ) {
  25751. throw webidl.errors.exception({
  25752. header: 'Integer conversion',
  25753. message: `Could not convert ${V} to an integer.`
  25754. })
  25755. }
  25756. // 2. Set x to IntegerPart(x).
  25757. x = webidl.util.IntegerPart(x)
  25758. // 3. If x < lowerBound or x > upperBound, then
  25759. // throw a TypeError.
  25760. if (x < lowerBound || x > upperBound) {
  25761. throw webidl.errors.exception({
  25762. header: 'Integer conversion',
  25763. message: `Value must be between ${lowerBound}-${upperBound}, got ${x}.`
  25764. })
  25765. }
  25766. // 4. Return x.
  25767. return x
  25768. }
  25769. // 7. If x is not NaN and the conversion is to an IDL
  25770. // type associated with the [Clamp] extended
  25771. // attribute, then:
  25772. if (!Number.isNaN(x) && opts.clamp === true) {
  25773. // 1. Set x to min(max(x, lowerBound), upperBound).
  25774. x = Math.min(Math.max(x, lowerBound), upperBound)
  25775. // 2. Round x to the nearest integer, choosing the
  25776. // even integer if it lies halfway between two,
  25777. // and choosing +0 rather than −0.
  25778. if (Math.floor(x) % 2 === 0) {
  25779. x = Math.floor(x)
  25780. } else {
  25781. x = Math.ceil(x)
  25782. }
  25783. // 3. Return x.
  25784. return x
  25785. }
  25786. // 8. If x is NaN, +0, +∞, or −∞, then return +0.
  25787. if (
  25788. Number.isNaN(x) ||
  25789. (x === 0 && Object.is(0, x)) ||
  25790. x === Number.POSITIVE_INFINITY ||
  25791. x === Number.NEGATIVE_INFINITY
  25792. ) {
  25793. return 0
  25794. }
  25795. // 9. Set x to IntegerPart(x).
  25796. x = webidl.util.IntegerPart(x)
  25797. // 10. Set x to x modulo 2^bitLength.
  25798. x = x % Math.pow(2, bitLength)
  25799. // 11. If signedness is "signed" and x ≥ 2^bitLength − 1,
  25800. // then return x − 2^bitLength.
  25801. if (signedness === 'signed' && x >= Math.pow(2, bitLength) - 1) {
  25802. return x - Math.pow(2, bitLength)
  25803. }
  25804. // 12. Otherwise, return x.
  25805. return x
  25806. }
  25807. // https://webidl.spec.whatwg.org/#abstract-opdef-integerpart
  25808. webidl.util.IntegerPart = function (n) {
  25809. // 1. Let r be floor(abs(n)).
  25810. const r = Math.floor(Math.abs(n))
  25811. // 2. If n < 0, then return -1 × r.
  25812. if (n < 0) {
  25813. return -1 * r
  25814. }
  25815. // 3. Otherwise, return r.
  25816. return r
  25817. }
  25818. // https://webidl.spec.whatwg.org/#es-sequence
  25819. webidl.sequenceConverter = function (converter) {
  25820. return (V) => {
  25821. // 1. If Type(V) is not Object, throw a TypeError.
  25822. if (webidl.util.Type(V) !== 'Object') {
  25823. throw webidl.errors.exception({
  25824. header: 'Sequence',
  25825. message: `Value of type ${webidl.util.Type(V)} is not an Object.`
  25826. })
  25827. }
  25828. // 2. Let method be ? GetMethod(V, @@iterator).
  25829. /** @type {Generator} */
  25830. const method = V?.[Symbol.iterator]?.()
  25831. const seq = []
  25832. // 3. If method is undefined, throw a TypeError.
  25833. if (
  25834. method === undefined ||
  25835. typeof method.next !== 'function'
  25836. ) {
  25837. throw webidl.errors.exception({
  25838. header: 'Sequence',
  25839. message: 'Object is not an iterator.'
  25840. })
  25841. }
  25842. // https://webidl.spec.whatwg.org/#create-sequence-from-iterable
  25843. while (true) {
  25844. const { done, value } = method.next()
  25845. if (done) {
  25846. break
  25847. }
  25848. seq.push(converter(value))
  25849. }
  25850. return seq
  25851. }
  25852. }
  25853. // https://webidl.spec.whatwg.org/#es-to-record
  25854. webidl.recordConverter = function (keyConverter, valueConverter) {
  25855. return (O) => {
  25856. // 1. If Type(O) is not Object, throw a TypeError.
  25857. if (webidl.util.Type(O) !== 'Object') {
  25858. throw webidl.errors.exception({
  25859. header: 'Record',
  25860. message: `Value of type ${webidl.util.Type(O)} is not an Object.`
  25861. })
  25862. }
  25863. // 2. Let result be a new empty instance of record<K, V>.
  25864. const result = {}
  25865. if (!types.isProxy(O)) {
  25866. // Object.keys only returns enumerable properties
  25867. const keys = Object.keys(O)
  25868. for (const key of keys) {
  25869. // 1. Let typedKey be key converted to an IDL value of type K.
  25870. const typedKey = keyConverter(key)
  25871. // 2. Let value be ? Get(O, key).
  25872. // 3. Let typedValue be value converted to an IDL value of type V.
  25873. const typedValue = valueConverter(O[key])
  25874. // 4. Set result[typedKey] to typedValue.
  25875. result[typedKey] = typedValue
  25876. }
  25877. // 5. Return result.
  25878. return result
  25879. }
  25880. // 3. Let keys be ? O.[[OwnPropertyKeys]]().
  25881. const keys = Reflect.ownKeys(O)
  25882. // 4. For each key of keys.
  25883. for (const key of keys) {
  25884. // 1. Let desc be ? O.[[GetOwnProperty]](key).
  25885. const desc = Reflect.getOwnPropertyDescriptor(O, key)
  25886. // 2. If desc is not undefined and desc.[[Enumerable]] is true:
  25887. if (desc?.enumerable) {
  25888. // 1. Let typedKey be key converted to an IDL value of type K.
  25889. const typedKey = keyConverter(key)
  25890. // 2. Let value be ? Get(O, key).
  25891. // 3. Let typedValue be value converted to an IDL value of type V.
  25892. const typedValue = valueConverter(O[key])
  25893. // 4. Set result[typedKey] to typedValue.
  25894. result[typedKey] = typedValue
  25895. }
  25896. }
  25897. // 5. Return result.
  25898. return result
  25899. }
  25900. }
  25901. webidl.interfaceConverter = function (i) {
  25902. return (V, opts = {}) => {
  25903. if (opts.strict !== false && !(V instanceof i)) {
  25904. throw webidl.errors.exception({
  25905. header: i.name,
  25906. message: `Expected ${V} to be an instance of ${i.name}.`
  25907. })
  25908. }
  25909. return V
  25910. }
  25911. }
  25912. webidl.dictionaryConverter = function (converters) {
  25913. return (dictionary) => {
  25914. const type = webidl.util.Type(dictionary)
  25915. const dict = {}
  25916. if (type === 'Null' || type === 'Undefined') {
  25917. return dict
  25918. } else if (type !== 'Object') {
  25919. throw webidl.errors.exception({
  25920. header: 'Dictionary',
  25921. message: `Expected ${dictionary} to be one of: Null, Undefined, Object.`
  25922. })
  25923. }
  25924. for (const options of converters) {
  25925. const { key, defaultValue, required, converter } = options
  25926. if (required === true) {
  25927. if (!hasOwn(dictionary, key)) {
  25928. throw webidl.errors.exception({
  25929. header: 'Dictionary',
  25930. message: `Missing required key "${key}".`
  25931. })
  25932. }
  25933. }
  25934. let value = dictionary[key]
  25935. const hasDefault = hasOwn(options, 'defaultValue')
  25936. // Only use defaultValue if value is undefined and
  25937. // a defaultValue options was provided.
  25938. if (hasDefault && value !== null) {
  25939. value = value ?? defaultValue
  25940. }
  25941. // A key can be optional and have no default value.
  25942. // When this happens, do not perform a conversion,
  25943. // and do not assign the key a value.
  25944. if (required || hasDefault || value !== undefined) {
  25945. value = converter(value)
  25946. if (
  25947. options.allowedValues &&
  25948. !options.allowedValues.includes(value)
  25949. ) {
  25950. throw webidl.errors.exception({
  25951. header: 'Dictionary',
  25952. message: `${value} is not an accepted type. Expected one of ${options.allowedValues.join(', ')}.`
  25953. })
  25954. }
  25955. dict[key] = value
  25956. }
  25957. }
  25958. return dict
  25959. }
  25960. }
  25961. webidl.nullableConverter = function (converter) {
  25962. return (V) => {
  25963. if (V === null) {
  25964. return V
  25965. }
  25966. return converter(V)
  25967. }
  25968. }
  25969. // https://webidl.spec.whatwg.org/#es-DOMString
  25970. webidl.converters.DOMString = function (V, opts = {}) {
  25971. // 1. If V is null and the conversion is to an IDL type
  25972. // associated with the [LegacyNullToEmptyString]
  25973. // extended attribute, then return the DOMString value
  25974. // that represents the empty string.
  25975. if (V === null && opts.legacyNullToEmptyString) {
  25976. return ''
  25977. }
  25978. // 2. Let x be ? ToString(V).
  25979. if (typeof V === 'symbol') {
  25980. throw new TypeError('Could not convert argument of type symbol to string.')
  25981. }
  25982. // 3. Return the IDL DOMString value that represents the
  25983. // same sequence of code units as the one the
  25984. // ECMAScript String value x represents.
  25985. return String(V)
  25986. }
  25987. // https://webidl.spec.whatwg.org/#es-ByteString
  25988. webidl.converters.ByteString = function (V) {
  25989. // 1. Let x be ? ToString(V).
  25990. // Note: DOMString converter perform ? ToString(V)
  25991. const x = webidl.converters.DOMString(V)
  25992. // 2. If the value of any element of x is greater than
  25993. // 255, then throw a TypeError.
  25994. for (let index = 0; index < x.length; index++) {
  25995. if (x.charCodeAt(index) > 255) {
  25996. throw new TypeError(
  25997. 'Cannot convert argument to a ByteString because the character at ' +
  25998. `index ${index} has a value of ${x.charCodeAt(index)} which is greater than 255.`
  25999. )
  26000. }
  26001. }
  26002. // 3. Return an IDL ByteString value whose length is the
  26003. // length of x, and where the value of each element is
  26004. // the value of the corresponding element of x.
  26005. return x
  26006. }
  26007. // https://webidl.spec.whatwg.org/#es-USVString
  26008. webidl.converters.USVString = toUSVString
  26009. // https://webidl.spec.whatwg.org/#es-boolean
  26010. webidl.converters.boolean = function (V) {
  26011. // 1. Let x be the result of computing ToBoolean(V).
  26012. const x = Boolean(V)
  26013. // 2. Return the IDL boolean value that is the one that represents
  26014. // the same truth value as the ECMAScript Boolean value x.
  26015. return x
  26016. }
  26017. // https://webidl.spec.whatwg.org/#es-any
  26018. webidl.converters.any = function (V) {
  26019. return V
  26020. }
  26021. // https://webidl.spec.whatwg.org/#es-long-long
  26022. webidl.converters['long long'] = function (V) {
  26023. // 1. Let x be ? ConvertToInt(V, 64, "signed").
  26024. const x = webidl.util.ConvertToInt(V, 64, 'signed')
  26025. // 2. Return the IDL long long value that represents
  26026. // the same numeric value as x.
  26027. return x
  26028. }
  26029. // https://webidl.spec.whatwg.org/#es-unsigned-long-long
  26030. webidl.converters['unsigned long long'] = function (V) {
  26031. // 1. Let x be ? ConvertToInt(V, 64, "unsigned").
  26032. const x = webidl.util.ConvertToInt(V, 64, 'unsigned')
  26033. // 2. Return the IDL unsigned long long value that
  26034. // represents the same numeric value as x.
  26035. return x
  26036. }
  26037. // https://webidl.spec.whatwg.org/#es-unsigned-long
  26038. webidl.converters['unsigned long'] = function (V) {
  26039. // 1. Let x be ? ConvertToInt(V, 32, "unsigned").
  26040. const x = webidl.util.ConvertToInt(V, 32, 'unsigned')
  26041. // 2. Return the IDL unsigned long value that
  26042. // represents the same numeric value as x.
  26043. return x
  26044. }
  26045. // https://webidl.spec.whatwg.org/#es-unsigned-short
  26046. webidl.converters['unsigned short'] = function (V, opts) {
  26047. // 1. Let x be ? ConvertToInt(V, 16, "unsigned").
  26048. const x = webidl.util.ConvertToInt(V, 16, 'unsigned', opts)
  26049. // 2. Return the IDL unsigned short value that represents
  26050. // the same numeric value as x.
  26051. return x
  26052. }
  26053. // https://webidl.spec.whatwg.org/#idl-ArrayBuffer
  26054. webidl.converters.ArrayBuffer = function (V, opts = {}) {
  26055. // 1. If Type(V) is not Object, or V does not have an
  26056. // [[ArrayBufferData]] internal slot, then throw a
  26057. // TypeError.
  26058. // see: https://tc39.es/ecma262/#sec-properties-of-the-arraybuffer-instances
  26059. // see: https://tc39.es/ecma262/#sec-properties-of-the-sharedarraybuffer-instances
  26060. if (
  26061. webidl.util.Type(V) !== 'Object' ||
  26062. !types.isAnyArrayBuffer(V)
  26063. ) {
  26064. throw webidl.errors.conversionFailed({
  26065. prefix: `${V}`,
  26066. argument: `${V}`,
  26067. types: ['ArrayBuffer']
  26068. })
  26069. }
  26070. // 2. If the conversion is not to an IDL type associated
  26071. // with the [AllowShared] extended attribute, and
  26072. // IsSharedArrayBuffer(V) is true, then throw a
  26073. // TypeError.
  26074. if (opts.allowShared === false && types.isSharedArrayBuffer(V)) {
  26075. throw webidl.errors.exception({
  26076. header: 'ArrayBuffer',
  26077. message: 'SharedArrayBuffer is not allowed.'
  26078. })
  26079. }
  26080. // 3. If the conversion is not to an IDL type associated
  26081. // with the [AllowResizable] extended attribute, and
  26082. // IsResizableArrayBuffer(V) is true, then throw a
  26083. // TypeError.
  26084. // Note: resizable ArrayBuffers are currently a proposal.
  26085. // 4. Return the IDL ArrayBuffer value that is a
  26086. // reference to the same object as V.
  26087. return V
  26088. }
  26089. webidl.converters.TypedArray = function (V, T, opts = {}) {
  26090. // 1. Let T be the IDL type V is being converted to.
  26091. // 2. If Type(V) is not Object, or V does not have a
  26092. // [[TypedArrayName]] internal slot with a value
  26093. // equal to T’s name, then throw a TypeError.
  26094. if (
  26095. webidl.util.Type(V) !== 'Object' ||
  26096. !types.isTypedArray(V) ||
  26097. V.constructor.name !== T.name
  26098. ) {
  26099. throw webidl.errors.conversionFailed({
  26100. prefix: `${T.name}`,
  26101. argument: `${V}`,
  26102. types: [T.name]
  26103. })
  26104. }
  26105. // 3. If the conversion is not to an IDL type associated
  26106. // with the [AllowShared] extended attribute, and
  26107. // IsSharedArrayBuffer(V.[[ViewedArrayBuffer]]) is
  26108. // true, then throw a TypeError.
  26109. if (opts.allowShared === false && types.isSharedArrayBuffer(V.buffer)) {
  26110. throw webidl.errors.exception({
  26111. header: 'ArrayBuffer',
  26112. message: 'SharedArrayBuffer is not allowed.'
  26113. })
  26114. }
  26115. // 4. If the conversion is not to an IDL type associated
  26116. // with the [AllowResizable] extended attribute, and
  26117. // IsResizableArrayBuffer(V.[[ViewedArrayBuffer]]) is
  26118. // true, then throw a TypeError.
  26119. // Note: resizable array buffers are currently a proposal
  26120. // 5. Return the IDL value of type T that is a reference
  26121. // to the same object as V.
  26122. return V
  26123. }
  26124. webidl.converters.DataView = function (V, opts = {}) {
  26125. // 1. If Type(V) is not Object, or V does not have a
  26126. // [[DataView]] internal slot, then throw a TypeError.
  26127. if (webidl.util.Type(V) !== 'Object' || !types.isDataView(V)) {
  26128. throw webidl.errors.exception({
  26129. header: 'DataView',
  26130. message: 'Object is not a DataView.'
  26131. })
  26132. }
  26133. // 2. If the conversion is not to an IDL type associated
  26134. // with the [AllowShared] extended attribute, and
  26135. // IsSharedArrayBuffer(V.[[ViewedArrayBuffer]]) is true,
  26136. // then throw a TypeError.
  26137. if (opts.allowShared === false && types.isSharedArrayBuffer(V.buffer)) {
  26138. throw webidl.errors.exception({
  26139. header: 'ArrayBuffer',
  26140. message: 'SharedArrayBuffer is not allowed.'
  26141. })
  26142. }
  26143. // 3. If the conversion is not to an IDL type associated
  26144. // with the [AllowResizable] extended attribute, and
  26145. // IsResizableArrayBuffer(V.[[ViewedArrayBuffer]]) is
  26146. // true, then throw a TypeError.
  26147. // Note: resizable ArrayBuffers are currently a proposal
  26148. // 4. Return the IDL DataView value that is a reference
  26149. // to the same object as V.
  26150. return V
  26151. }
  26152. // https://webidl.spec.whatwg.org/#BufferSource
  26153. webidl.converters.BufferSource = function (V, opts = {}) {
  26154. if (types.isAnyArrayBuffer(V)) {
  26155. return webidl.converters.ArrayBuffer(V, opts)
  26156. }
  26157. if (types.isTypedArray(V)) {
  26158. return webidl.converters.TypedArray(V, V.constructor)
  26159. }
  26160. if (types.isDataView(V)) {
  26161. return webidl.converters.DataView(V, opts)
  26162. }
  26163. throw new TypeError(`Could not convert ${V} to a BufferSource.`)
  26164. }
  26165. webidl.converters['sequence<ByteString>'] = webidl.sequenceConverter(
  26166. webidl.converters.ByteString
  26167. )
  26168. webidl.converters['sequence<sequence<ByteString>>'] = webidl.sequenceConverter(
  26169. webidl.converters['sequence<ByteString>']
  26170. )
  26171. webidl.converters['record<ByteString, ByteString>'] = webidl.recordConverter(
  26172. webidl.converters.ByteString,
  26173. webidl.converters.ByteString
  26174. )
  26175. module.exports = {
  26176. webidl
  26177. }
  26178. /***/ }),
  26179. /***/ 4854:
  26180. /***/ ((module) => {
  26181. "use strict";
  26182. /**
  26183. * @see https://encoding.spec.whatwg.org/#concept-encoding-get
  26184. * @param {string|undefined} label
  26185. */
  26186. function getEncoding (label) {
  26187. if (!label) {
  26188. return 'failure'
  26189. }
  26190. // 1. Remove any leading and trailing ASCII whitespace from label.
  26191. // 2. If label is an ASCII case-insensitive match for any of the
  26192. // labels listed in the table below, then return the
  26193. // corresponding encoding; otherwise return failure.
  26194. switch (label.trim().toLowerCase()) {
  26195. case 'unicode-1-1-utf-8':
  26196. case 'unicode11utf8':
  26197. case 'unicode20utf8':
  26198. case 'utf-8':
  26199. case 'utf8':
  26200. case 'x-unicode20utf8':
  26201. return 'UTF-8'
  26202. case '866':
  26203. case 'cp866':
  26204. case 'csibm866':
  26205. case 'ibm866':
  26206. return 'IBM866'
  26207. case 'csisolatin2':
  26208. case 'iso-8859-2':
  26209. case 'iso-ir-101':
  26210. case 'iso8859-2':
  26211. case 'iso88592':
  26212. case 'iso_8859-2':
  26213. case 'iso_8859-2:1987':
  26214. case 'l2':
  26215. case 'latin2':
  26216. return 'ISO-8859-2'
  26217. case 'csisolatin3':
  26218. case 'iso-8859-3':
  26219. case 'iso-ir-109':
  26220. case 'iso8859-3':
  26221. case 'iso88593':
  26222. case 'iso_8859-3':
  26223. case 'iso_8859-3:1988':
  26224. case 'l3':
  26225. case 'latin3':
  26226. return 'ISO-8859-3'
  26227. case 'csisolatin4':
  26228. case 'iso-8859-4':
  26229. case 'iso-ir-110':
  26230. case 'iso8859-4':
  26231. case 'iso88594':
  26232. case 'iso_8859-4':
  26233. case 'iso_8859-4:1988':
  26234. case 'l4':
  26235. case 'latin4':
  26236. return 'ISO-8859-4'
  26237. case 'csisolatincyrillic':
  26238. case 'cyrillic':
  26239. case 'iso-8859-5':
  26240. case 'iso-ir-144':
  26241. case 'iso8859-5':
  26242. case 'iso88595':
  26243. case 'iso_8859-5':
  26244. case 'iso_8859-5:1988':
  26245. return 'ISO-8859-5'
  26246. case 'arabic':
  26247. case 'asmo-708':
  26248. case 'csiso88596e':
  26249. case 'csiso88596i':
  26250. case 'csisolatinarabic':
  26251. case 'ecma-114':
  26252. case 'iso-8859-6':
  26253. case 'iso-8859-6-e':
  26254. case 'iso-8859-6-i':
  26255. case 'iso-ir-127':
  26256. case 'iso8859-6':
  26257. case 'iso88596':
  26258. case 'iso_8859-6':
  26259. case 'iso_8859-6:1987':
  26260. return 'ISO-8859-6'
  26261. case 'csisolatingreek':
  26262. case 'ecma-118':
  26263. case 'elot_928':
  26264. case 'greek':
  26265. case 'greek8':
  26266. case 'iso-8859-7':
  26267. case 'iso-ir-126':
  26268. case 'iso8859-7':
  26269. case 'iso88597':
  26270. case 'iso_8859-7':
  26271. case 'iso_8859-7:1987':
  26272. case 'sun_eu_greek':
  26273. return 'ISO-8859-7'
  26274. case 'csiso88598e':
  26275. case 'csisolatinhebrew':
  26276. case 'hebrew':
  26277. case 'iso-8859-8':
  26278. case 'iso-8859-8-e':
  26279. case 'iso-ir-138':
  26280. case 'iso8859-8':
  26281. case 'iso88598':
  26282. case 'iso_8859-8':
  26283. case 'iso_8859-8:1988':
  26284. case 'visual':
  26285. return 'ISO-8859-8'
  26286. case 'csiso88598i':
  26287. case 'iso-8859-8-i':
  26288. case 'logical':
  26289. return 'ISO-8859-8-I'
  26290. case 'csisolatin6':
  26291. case 'iso-8859-10':
  26292. case 'iso-ir-157':
  26293. case 'iso8859-10':
  26294. case 'iso885910':
  26295. case 'l6':
  26296. case 'latin6':
  26297. return 'ISO-8859-10'
  26298. case 'iso-8859-13':
  26299. case 'iso8859-13':
  26300. case 'iso885913':
  26301. return 'ISO-8859-13'
  26302. case 'iso-8859-14':
  26303. case 'iso8859-14':
  26304. case 'iso885914':
  26305. return 'ISO-8859-14'
  26306. case 'csisolatin9':
  26307. case 'iso-8859-15':
  26308. case 'iso8859-15':
  26309. case 'iso885915':
  26310. case 'iso_8859-15':
  26311. case 'l9':
  26312. return 'ISO-8859-15'
  26313. case 'iso-8859-16':
  26314. return 'ISO-8859-16'
  26315. case 'cskoi8r':
  26316. case 'koi':
  26317. case 'koi8':
  26318. case 'koi8-r':
  26319. case 'koi8_r':
  26320. return 'KOI8-R'
  26321. case 'koi8-ru':
  26322. case 'koi8-u':
  26323. return 'KOI8-U'
  26324. case 'csmacintosh':
  26325. case 'mac':
  26326. case 'macintosh':
  26327. case 'x-mac-roman':
  26328. return 'macintosh'
  26329. case 'iso-8859-11':
  26330. case 'iso8859-11':
  26331. case 'iso885911':
  26332. case 'tis-620':
  26333. case 'windows-874':
  26334. return 'windows-874'
  26335. case 'cp1250':
  26336. case 'windows-1250':
  26337. case 'x-cp1250':
  26338. return 'windows-1250'
  26339. case 'cp1251':
  26340. case 'windows-1251':
  26341. case 'x-cp1251':
  26342. return 'windows-1251'
  26343. case 'ansi_x3.4-1968':
  26344. case 'ascii':
  26345. case 'cp1252':
  26346. case 'cp819':
  26347. case 'csisolatin1':
  26348. case 'ibm819':
  26349. case 'iso-8859-1':
  26350. case 'iso-ir-100':
  26351. case 'iso8859-1':
  26352. case 'iso88591':
  26353. case 'iso_8859-1':
  26354. case 'iso_8859-1:1987':
  26355. case 'l1':
  26356. case 'latin1':
  26357. case 'us-ascii':
  26358. case 'windows-1252':
  26359. case 'x-cp1252':
  26360. return 'windows-1252'
  26361. case 'cp1253':
  26362. case 'windows-1253':
  26363. case 'x-cp1253':
  26364. return 'windows-1253'
  26365. case 'cp1254':
  26366. case 'csisolatin5':
  26367. case 'iso-8859-9':
  26368. case 'iso-ir-148':
  26369. case 'iso8859-9':
  26370. case 'iso88599':
  26371. case 'iso_8859-9':
  26372. case 'iso_8859-9:1989':
  26373. case 'l5':
  26374. case 'latin5':
  26375. case 'windows-1254':
  26376. case 'x-cp1254':
  26377. return 'windows-1254'
  26378. case 'cp1255':
  26379. case 'windows-1255':
  26380. case 'x-cp1255':
  26381. return 'windows-1255'
  26382. case 'cp1256':
  26383. case 'windows-1256':
  26384. case 'x-cp1256':
  26385. return 'windows-1256'
  26386. case 'cp1257':
  26387. case 'windows-1257':
  26388. case 'x-cp1257':
  26389. return 'windows-1257'
  26390. case 'cp1258':
  26391. case 'windows-1258':
  26392. case 'x-cp1258':
  26393. return 'windows-1258'
  26394. case 'x-mac-cyrillic':
  26395. case 'x-mac-ukrainian':
  26396. return 'x-mac-cyrillic'
  26397. case 'chinese':
  26398. case 'csgb2312':
  26399. case 'csiso58gb231280':
  26400. case 'gb2312':
  26401. case 'gb_2312':
  26402. case 'gb_2312-80':
  26403. case 'gbk':
  26404. case 'iso-ir-58':
  26405. case 'x-gbk':
  26406. return 'GBK'
  26407. case 'gb18030':
  26408. return 'gb18030'
  26409. case 'big5':
  26410. case 'big5-hkscs':
  26411. case 'cn-big5':
  26412. case 'csbig5':
  26413. case 'x-x-big5':
  26414. return 'Big5'
  26415. case 'cseucpkdfmtjapanese':
  26416. case 'euc-jp':
  26417. case 'x-euc-jp':
  26418. return 'EUC-JP'
  26419. case 'csiso2022jp':
  26420. case 'iso-2022-jp':
  26421. return 'ISO-2022-JP'
  26422. case 'csshiftjis':
  26423. case 'ms932':
  26424. case 'ms_kanji':
  26425. case 'shift-jis':
  26426. case 'shift_jis':
  26427. case 'sjis':
  26428. case 'windows-31j':
  26429. case 'x-sjis':
  26430. return 'Shift_JIS'
  26431. case 'cseuckr':
  26432. case 'csksc56011987':
  26433. case 'euc-kr':
  26434. case 'iso-ir-149':
  26435. case 'korean':
  26436. case 'ks_c_5601-1987':
  26437. case 'ks_c_5601-1989':
  26438. case 'ksc5601':
  26439. case 'ksc_5601':
  26440. case 'windows-949':
  26441. return 'EUC-KR'
  26442. case 'csiso2022kr':
  26443. case 'hz-gb-2312':
  26444. case 'iso-2022-cn':
  26445. case 'iso-2022-cn-ext':
  26446. case 'iso-2022-kr':
  26447. case 'replacement':
  26448. return 'replacement'
  26449. case 'unicodefffe':
  26450. case 'utf-16be':
  26451. return 'UTF-16BE'
  26452. case 'csunicode':
  26453. case 'iso-10646-ucs-2':
  26454. case 'ucs-2':
  26455. case 'unicode':
  26456. case 'unicodefeff':
  26457. case 'utf-16':
  26458. case 'utf-16le':
  26459. return 'UTF-16LE'
  26460. case 'x-user-defined':
  26461. return 'x-user-defined'
  26462. default: return 'failure'
  26463. }
  26464. }
  26465. module.exports = {
  26466. getEncoding
  26467. }
  26468. /***/ }),
  26469. /***/ 1446:
  26470. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  26471. "use strict";
  26472. const {
  26473. staticPropertyDescriptors,
  26474. readOperation,
  26475. fireAProgressEvent
  26476. } = __nccwpck_require__(7530)
  26477. const {
  26478. kState,
  26479. kError,
  26480. kResult,
  26481. kEvents,
  26482. kAborted
  26483. } = __nccwpck_require__(9054)
  26484. const { webidl } = __nccwpck_require__(1744)
  26485. const { kEnumerableProperty } = __nccwpck_require__(3983)
  26486. class FileReader extends EventTarget {
  26487. constructor () {
  26488. super()
  26489. this[kState] = 'empty'
  26490. this[kResult] = null
  26491. this[kError] = null
  26492. this[kEvents] = {
  26493. loadend: null,
  26494. error: null,
  26495. abort: null,
  26496. load: null,
  26497. progress: null,
  26498. loadstart: null
  26499. }
  26500. }
  26501. /**
  26502. * @see https://w3c.github.io/FileAPI/#dfn-readAsArrayBuffer
  26503. * @param {import('buffer').Blob} blob
  26504. */
  26505. readAsArrayBuffer (blob) {
  26506. webidl.brandCheck(this, FileReader)
  26507. webidl.argumentLengthCheck(arguments, 1, { header: 'FileReader.readAsArrayBuffer' })
  26508. blob = webidl.converters.Blob(blob, { strict: false })
  26509. // The readAsArrayBuffer(blob) method, when invoked,
  26510. // must initiate a read operation for blob with ArrayBuffer.
  26511. readOperation(this, blob, 'ArrayBuffer')
  26512. }
  26513. /**
  26514. * @see https://w3c.github.io/FileAPI/#readAsBinaryString
  26515. * @param {import('buffer').Blob} blob
  26516. */
  26517. readAsBinaryString (blob) {
  26518. webidl.brandCheck(this, FileReader)
  26519. webidl.argumentLengthCheck(arguments, 1, { header: 'FileReader.readAsBinaryString' })
  26520. blob = webidl.converters.Blob(blob, { strict: false })
  26521. // The readAsBinaryString(blob) method, when invoked,
  26522. // must initiate a read operation for blob with BinaryString.
  26523. readOperation(this, blob, 'BinaryString')
  26524. }
  26525. /**
  26526. * @see https://w3c.github.io/FileAPI/#readAsDataText
  26527. * @param {import('buffer').Blob} blob
  26528. * @param {string?} encoding
  26529. */
  26530. readAsText (blob, encoding = undefined) {
  26531. webidl.brandCheck(this, FileReader)
  26532. webidl.argumentLengthCheck(arguments, 1, { header: 'FileReader.readAsText' })
  26533. blob = webidl.converters.Blob(blob, { strict: false })
  26534. if (encoding !== undefined) {
  26535. encoding = webidl.converters.DOMString(encoding)
  26536. }
  26537. // The readAsText(blob, encoding) method, when invoked,
  26538. // must initiate a read operation for blob with Text and encoding.
  26539. readOperation(this, blob, 'Text', encoding)
  26540. }
  26541. /**
  26542. * @see https://w3c.github.io/FileAPI/#dfn-readAsDataURL
  26543. * @param {import('buffer').Blob} blob
  26544. */
  26545. readAsDataURL (blob) {
  26546. webidl.brandCheck(this, FileReader)
  26547. webidl.argumentLengthCheck(arguments, 1, { header: 'FileReader.readAsDataURL' })
  26548. blob = webidl.converters.Blob(blob, { strict: false })
  26549. // The readAsDataURL(blob) method, when invoked, must
  26550. // initiate a read operation for blob with DataURL.
  26551. readOperation(this, blob, 'DataURL')
  26552. }
  26553. /**
  26554. * @see https://w3c.github.io/FileAPI/#dfn-abort
  26555. */
  26556. abort () {
  26557. // 1. If this's state is "empty" or if this's state is
  26558. // "done" set this's result to null and terminate
  26559. // this algorithm.
  26560. if (this[kState] === 'empty' || this[kState] === 'done') {
  26561. this[kResult] = null
  26562. return
  26563. }
  26564. // 2. If this's state is "loading" set this's state to
  26565. // "done" and set this's result to null.
  26566. if (this[kState] === 'loading') {
  26567. this[kState] = 'done'
  26568. this[kResult] = null
  26569. }
  26570. // 3. If there are any tasks from this on the file reading
  26571. // task source in an affiliated task queue, then remove
  26572. // those tasks from that task queue.
  26573. this[kAborted] = true
  26574. // 4. Terminate the algorithm for the read method being processed.
  26575. // TODO
  26576. // 5. Fire a progress event called abort at this.
  26577. fireAProgressEvent('abort', this)
  26578. // 6. If this's state is not "loading", fire a progress
  26579. // event called loadend at this.
  26580. if (this[kState] !== 'loading') {
  26581. fireAProgressEvent('loadend', this)
  26582. }
  26583. }
  26584. /**
  26585. * @see https://w3c.github.io/FileAPI/#dom-filereader-readystate
  26586. */
  26587. get readyState () {
  26588. webidl.brandCheck(this, FileReader)
  26589. switch (this[kState]) {
  26590. case 'empty': return this.EMPTY
  26591. case 'loading': return this.LOADING
  26592. case 'done': return this.DONE
  26593. }
  26594. }
  26595. /**
  26596. * @see https://w3c.github.io/FileAPI/#dom-filereader-result
  26597. */
  26598. get result () {
  26599. webidl.brandCheck(this, FileReader)
  26600. // The result attribute’s getter, when invoked, must return
  26601. // this's result.
  26602. return this[kResult]
  26603. }
  26604. /**
  26605. * @see https://w3c.github.io/FileAPI/#dom-filereader-error
  26606. */
  26607. get error () {
  26608. webidl.brandCheck(this, FileReader)
  26609. // The error attribute’s getter, when invoked, must return
  26610. // this's error.
  26611. return this[kError]
  26612. }
  26613. get onloadend () {
  26614. webidl.brandCheck(this, FileReader)
  26615. return this[kEvents].loadend
  26616. }
  26617. set onloadend (fn) {
  26618. webidl.brandCheck(this, FileReader)
  26619. if (this[kEvents].loadend) {
  26620. this.removeEventListener('loadend', this[kEvents].loadend)
  26621. }
  26622. if (typeof fn === 'function') {
  26623. this[kEvents].loadend = fn
  26624. this.addEventListener('loadend', fn)
  26625. } else {
  26626. this[kEvents].loadend = null
  26627. }
  26628. }
  26629. get onerror () {
  26630. webidl.brandCheck(this, FileReader)
  26631. return this[kEvents].error
  26632. }
  26633. set onerror (fn) {
  26634. webidl.brandCheck(this, FileReader)
  26635. if (this[kEvents].error) {
  26636. this.removeEventListener('error', this[kEvents].error)
  26637. }
  26638. if (typeof fn === 'function') {
  26639. this[kEvents].error = fn
  26640. this.addEventListener('error', fn)
  26641. } else {
  26642. this[kEvents].error = null
  26643. }
  26644. }
  26645. get onloadstart () {
  26646. webidl.brandCheck(this, FileReader)
  26647. return this[kEvents].loadstart
  26648. }
  26649. set onloadstart (fn) {
  26650. webidl.brandCheck(this, FileReader)
  26651. if (this[kEvents].loadstart) {
  26652. this.removeEventListener('loadstart', this[kEvents].loadstart)
  26653. }
  26654. if (typeof fn === 'function') {
  26655. this[kEvents].loadstart = fn
  26656. this.addEventListener('loadstart', fn)
  26657. } else {
  26658. this[kEvents].loadstart = null
  26659. }
  26660. }
  26661. get onprogress () {
  26662. webidl.brandCheck(this, FileReader)
  26663. return this[kEvents].progress
  26664. }
  26665. set onprogress (fn) {
  26666. webidl.brandCheck(this, FileReader)
  26667. if (this[kEvents].progress) {
  26668. this.removeEventListener('progress', this[kEvents].progress)
  26669. }
  26670. if (typeof fn === 'function') {
  26671. this[kEvents].progress = fn
  26672. this.addEventListener('progress', fn)
  26673. } else {
  26674. this[kEvents].progress = null
  26675. }
  26676. }
  26677. get onload () {
  26678. webidl.brandCheck(this, FileReader)
  26679. return this[kEvents].load
  26680. }
  26681. set onload (fn) {
  26682. webidl.brandCheck(this, FileReader)
  26683. if (this[kEvents].load) {
  26684. this.removeEventListener('load', this[kEvents].load)
  26685. }
  26686. if (typeof fn === 'function') {
  26687. this[kEvents].load = fn
  26688. this.addEventListener('load', fn)
  26689. } else {
  26690. this[kEvents].load = null
  26691. }
  26692. }
  26693. get onabort () {
  26694. webidl.brandCheck(this, FileReader)
  26695. return this[kEvents].abort
  26696. }
  26697. set onabort (fn) {
  26698. webidl.brandCheck(this, FileReader)
  26699. if (this[kEvents].abort) {
  26700. this.removeEventListener('abort', this[kEvents].abort)
  26701. }
  26702. if (typeof fn === 'function') {
  26703. this[kEvents].abort = fn
  26704. this.addEventListener('abort', fn)
  26705. } else {
  26706. this[kEvents].abort = null
  26707. }
  26708. }
  26709. }
  26710. // https://w3c.github.io/FileAPI/#dom-filereader-empty
  26711. FileReader.EMPTY = FileReader.prototype.EMPTY = 0
  26712. // https://w3c.github.io/FileAPI/#dom-filereader-loading
  26713. FileReader.LOADING = FileReader.prototype.LOADING = 1
  26714. // https://w3c.github.io/FileAPI/#dom-filereader-done
  26715. FileReader.DONE = FileReader.prototype.DONE = 2
  26716. Object.defineProperties(FileReader.prototype, {
  26717. EMPTY: staticPropertyDescriptors,
  26718. LOADING: staticPropertyDescriptors,
  26719. DONE: staticPropertyDescriptors,
  26720. readAsArrayBuffer: kEnumerableProperty,
  26721. readAsBinaryString: kEnumerableProperty,
  26722. readAsText: kEnumerableProperty,
  26723. readAsDataURL: kEnumerableProperty,
  26724. abort: kEnumerableProperty,
  26725. readyState: kEnumerableProperty,
  26726. result: kEnumerableProperty,
  26727. error: kEnumerableProperty,
  26728. onloadstart: kEnumerableProperty,
  26729. onprogress: kEnumerableProperty,
  26730. onload: kEnumerableProperty,
  26731. onabort: kEnumerableProperty,
  26732. onerror: kEnumerableProperty,
  26733. onloadend: kEnumerableProperty,
  26734. [Symbol.toStringTag]: {
  26735. value: 'FileReader',
  26736. writable: false,
  26737. enumerable: false,
  26738. configurable: true
  26739. }
  26740. })
  26741. Object.defineProperties(FileReader, {
  26742. EMPTY: staticPropertyDescriptors,
  26743. LOADING: staticPropertyDescriptors,
  26744. DONE: staticPropertyDescriptors
  26745. })
  26746. module.exports = {
  26747. FileReader
  26748. }
  26749. /***/ }),
  26750. /***/ 5504:
  26751. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  26752. "use strict";
  26753. const { webidl } = __nccwpck_require__(1744)
  26754. const kState = Symbol('ProgressEvent state')
  26755. /**
  26756. * @see https://xhr.spec.whatwg.org/#progressevent
  26757. */
  26758. class ProgressEvent extends Event {
  26759. constructor (type, eventInitDict = {}) {
  26760. type = webidl.converters.DOMString(type)
  26761. eventInitDict = webidl.converters.ProgressEventInit(eventInitDict ?? {})
  26762. super(type, eventInitDict)
  26763. this[kState] = {
  26764. lengthComputable: eventInitDict.lengthComputable,
  26765. loaded: eventInitDict.loaded,
  26766. total: eventInitDict.total
  26767. }
  26768. }
  26769. get lengthComputable () {
  26770. webidl.brandCheck(this, ProgressEvent)
  26771. return this[kState].lengthComputable
  26772. }
  26773. get loaded () {
  26774. webidl.brandCheck(this, ProgressEvent)
  26775. return this[kState].loaded
  26776. }
  26777. get total () {
  26778. webidl.brandCheck(this, ProgressEvent)
  26779. return this[kState].total
  26780. }
  26781. }
  26782. webidl.converters.ProgressEventInit = webidl.dictionaryConverter([
  26783. {
  26784. key: 'lengthComputable',
  26785. converter: webidl.converters.boolean,
  26786. defaultValue: false
  26787. },
  26788. {
  26789. key: 'loaded',
  26790. converter: webidl.converters['unsigned long long'],
  26791. defaultValue: 0
  26792. },
  26793. {
  26794. key: 'total',
  26795. converter: webidl.converters['unsigned long long'],
  26796. defaultValue: 0
  26797. },
  26798. {
  26799. key: 'bubbles',
  26800. converter: webidl.converters.boolean,
  26801. defaultValue: false
  26802. },
  26803. {
  26804. key: 'cancelable',
  26805. converter: webidl.converters.boolean,
  26806. defaultValue: false
  26807. },
  26808. {
  26809. key: 'composed',
  26810. converter: webidl.converters.boolean,
  26811. defaultValue: false
  26812. }
  26813. ])
  26814. module.exports = {
  26815. ProgressEvent
  26816. }
  26817. /***/ }),
  26818. /***/ 9054:
  26819. /***/ ((module) => {
  26820. "use strict";
  26821. module.exports = {
  26822. kState: Symbol('FileReader state'),
  26823. kResult: Symbol('FileReader result'),
  26824. kError: Symbol('FileReader error'),
  26825. kLastProgressEventFired: Symbol('FileReader last progress event fired timestamp'),
  26826. kEvents: Symbol('FileReader events'),
  26827. kAborted: Symbol('FileReader aborted')
  26828. }
  26829. /***/ }),
  26830. /***/ 7530:
  26831. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  26832. "use strict";
  26833. const {
  26834. kState,
  26835. kError,
  26836. kResult,
  26837. kAborted,
  26838. kLastProgressEventFired
  26839. } = __nccwpck_require__(9054)
  26840. const { ProgressEvent } = __nccwpck_require__(5504)
  26841. const { getEncoding } = __nccwpck_require__(4854)
  26842. const { DOMException } = __nccwpck_require__(1037)
  26843. const { serializeAMimeType, parseMIMEType } = __nccwpck_require__(685)
  26844. const { types } = __nccwpck_require__(3837)
  26845. const { StringDecoder } = __nccwpck_require__(1576)
  26846. const { btoa } = __nccwpck_require__(4300)
  26847. /** @type {PropertyDescriptor} */
  26848. const staticPropertyDescriptors = {
  26849. enumerable: true,
  26850. writable: false,
  26851. configurable: false
  26852. }
  26853. /**
  26854. * @see https://w3c.github.io/FileAPI/#readOperation
  26855. * @param {import('./filereader').FileReader} fr
  26856. * @param {import('buffer').Blob} blob
  26857. * @param {string} type
  26858. * @param {string?} encodingName
  26859. */
  26860. function readOperation (fr, blob, type, encodingName) {
  26861. // 1. If fr’s state is "loading", throw an InvalidStateError
  26862. // DOMException.
  26863. if (fr[kState] === 'loading') {
  26864. throw new DOMException('Invalid state', 'InvalidStateError')
  26865. }
  26866. // 2. Set fr’s state to "loading".
  26867. fr[kState] = 'loading'
  26868. // 3. Set fr’s result to null.
  26869. fr[kResult] = null
  26870. // 4. Set fr’s error to null.
  26871. fr[kError] = null
  26872. // 5. Let stream be the result of calling get stream on blob.
  26873. /** @type {import('stream/web').ReadableStream} */
  26874. const stream = blob.stream()
  26875. // 6. Let reader be the result of getting a reader from stream.
  26876. const reader = stream.getReader()
  26877. // 7. Let bytes be an empty byte sequence.
  26878. /** @type {Uint8Array[]} */
  26879. const bytes = []
  26880. // 8. Let chunkPromise be the result of reading a chunk from
  26881. // stream with reader.
  26882. let chunkPromise = reader.read()
  26883. // 9. Let isFirstChunk be true.
  26884. let isFirstChunk = true
  26885. // 10. In parallel, while true:
  26886. // Note: "In parallel" just means non-blocking
  26887. // Note 2: readOperation itself cannot be async as double
  26888. // reading the body would then reject the promise, instead
  26889. // of throwing an error.
  26890. ;(async () => {
  26891. while (!fr[kAborted]) {
  26892. // 1. Wait for chunkPromise to be fulfilled or rejected.
  26893. try {
  26894. const { done, value } = await chunkPromise
  26895. // 2. If chunkPromise is fulfilled, and isFirstChunk is
  26896. // true, queue a task to fire a progress event called
  26897. // loadstart at fr.
  26898. if (isFirstChunk && !fr[kAborted]) {
  26899. queueMicrotask(() => {
  26900. fireAProgressEvent('loadstart', fr)
  26901. })
  26902. }
  26903. // 3. Set isFirstChunk to false.
  26904. isFirstChunk = false
  26905. // 4. If chunkPromise is fulfilled with an object whose
  26906. // done property is false and whose value property is
  26907. // a Uint8Array object, run these steps:
  26908. if (!done && types.isUint8Array(value)) {
  26909. // 1. Let bs be the byte sequence represented by the
  26910. // Uint8Array object.
  26911. // 2. Append bs to bytes.
  26912. bytes.push(value)
  26913. // 3. If roughly 50ms have passed since these steps
  26914. // were last invoked, queue a task to fire a
  26915. // progress event called progress at fr.
  26916. if (
  26917. (
  26918. fr[kLastProgressEventFired] === undefined ||
  26919. Date.now() - fr[kLastProgressEventFired] >= 50
  26920. ) &&
  26921. !fr[kAborted]
  26922. ) {
  26923. fr[kLastProgressEventFired] = Date.now()
  26924. queueMicrotask(() => {
  26925. fireAProgressEvent('progress', fr)
  26926. })
  26927. }
  26928. // 4. Set chunkPromise to the result of reading a
  26929. // chunk from stream with reader.
  26930. chunkPromise = reader.read()
  26931. } else if (done) {
  26932. // 5. Otherwise, if chunkPromise is fulfilled with an
  26933. // object whose done property is true, queue a task
  26934. // to run the following steps and abort this algorithm:
  26935. queueMicrotask(() => {
  26936. // 1. Set fr’s state to "done".
  26937. fr[kState] = 'done'
  26938. // 2. Let result be the result of package data given
  26939. // bytes, type, blob’s type, and encodingName.
  26940. try {
  26941. const result = packageData(bytes, type, blob.type, encodingName)
  26942. // 4. Else:
  26943. if (fr[kAborted]) {
  26944. return
  26945. }
  26946. // 1. Set fr’s result to result.
  26947. fr[kResult] = result
  26948. // 2. Fire a progress event called load at the fr.
  26949. fireAProgressEvent('load', fr)
  26950. } catch (error) {
  26951. // 3. If package data threw an exception error:
  26952. // 1. Set fr’s error to error.
  26953. fr[kError] = error
  26954. // 2. Fire a progress event called error at fr.
  26955. fireAProgressEvent('error', fr)
  26956. }
  26957. // 5. If fr’s state is not "loading", fire a progress
  26958. // event called loadend at the fr.
  26959. if (fr[kState] !== 'loading') {
  26960. fireAProgressEvent('loadend', fr)
  26961. }
  26962. })
  26963. break
  26964. }
  26965. } catch (error) {
  26966. if (fr[kAborted]) {
  26967. return
  26968. }
  26969. // 6. Otherwise, if chunkPromise is rejected with an
  26970. // error error, queue a task to run the following
  26971. // steps and abort this algorithm:
  26972. queueMicrotask(() => {
  26973. // 1. Set fr’s state to "done".
  26974. fr[kState] = 'done'
  26975. // 2. Set fr’s error to error.
  26976. fr[kError] = error
  26977. // 3. Fire a progress event called error at fr.
  26978. fireAProgressEvent('error', fr)
  26979. // 4. If fr’s state is not "loading", fire a progress
  26980. // event called loadend at fr.
  26981. if (fr[kState] !== 'loading') {
  26982. fireAProgressEvent('loadend', fr)
  26983. }
  26984. })
  26985. break
  26986. }
  26987. }
  26988. })()
  26989. }
  26990. /**
  26991. * @see https://w3c.github.io/FileAPI/#fire-a-progress-event
  26992. * @see https://dom.spec.whatwg.org/#concept-event-fire
  26993. * @param {string} e The name of the event
  26994. * @param {import('./filereader').FileReader} reader
  26995. */
  26996. function fireAProgressEvent (e, reader) {
  26997. // The progress event e does not bubble. e.bubbles must be false
  26998. // The progress event e is NOT cancelable. e.cancelable must be false
  26999. const event = new ProgressEvent(e, {
  27000. bubbles: false,
  27001. cancelable: false
  27002. })
  27003. reader.dispatchEvent(event)
  27004. }
  27005. /**
  27006. * @see https://w3c.github.io/FileAPI/#blob-package-data
  27007. * @param {Uint8Array[]} bytes
  27008. * @param {string} type
  27009. * @param {string?} mimeType
  27010. * @param {string?} encodingName
  27011. */
  27012. function packageData (bytes, type, mimeType, encodingName) {
  27013. // 1. A Blob has an associated package data algorithm, given
  27014. // bytes, a type, a optional mimeType, and a optional
  27015. // encodingName, which switches on type and runs the
  27016. // associated steps:
  27017. switch (type) {
  27018. case 'DataURL': {
  27019. // 1. Return bytes as a DataURL [RFC2397] subject to
  27020. // the considerations below:
  27021. // * Use mimeType as part of the Data URL if it is
  27022. // available in keeping with the Data URL
  27023. // specification [RFC2397].
  27024. // * If mimeType is not available return a Data URL
  27025. // without a media-type. [RFC2397].
  27026. // https://datatracker.ietf.org/doc/html/rfc2397#section-3
  27027. // dataurl := "data:" [ mediatype ] [ ";base64" ] "," data
  27028. // mediatype := [ type "/" subtype ] *( ";" parameter )
  27029. // data := *urlchar
  27030. // parameter := attribute "=" value
  27031. let dataURL = 'data:'
  27032. const parsed = parseMIMEType(mimeType || 'application/octet-stream')
  27033. if (parsed !== 'failure') {
  27034. dataURL += serializeAMimeType(parsed)
  27035. }
  27036. dataURL += ';base64,'
  27037. const decoder = new StringDecoder('latin1')
  27038. for (const chunk of bytes) {
  27039. dataURL += btoa(decoder.write(chunk))
  27040. }
  27041. dataURL += btoa(decoder.end())
  27042. return dataURL
  27043. }
  27044. case 'Text': {
  27045. // 1. Let encoding be failure
  27046. let encoding = 'failure'
  27047. // 2. If the encodingName is present, set encoding to the
  27048. // result of getting an encoding from encodingName.
  27049. if (encodingName) {
  27050. encoding = getEncoding(encodingName)
  27051. }
  27052. // 3. If encoding is failure, and mimeType is present:
  27053. if (encoding === 'failure' && mimeType) {
  27054. // 1. Let type be the result of parse a MIME type
  27055. // given mimeType.
  27056. const type = parseMIMEType(mimeType)
  27057. // 2. If type is not failure, set encoding to the result
  27058. // of getting an encoding from type’s parameters["charset"].
  27059. if (type !== 'failure') {
  27060. encoding = getEncoding(type.parameters.get('charset'))
  27061. }
  27062. }
  27063. // 4. If encoding is failure, then set encoding to UTF-8.
  27064. if (encoding === 'failure') {
  27065. encoding = 'UTF-8'
  27066. }
  27067. // 5. Decode bytes using fallback encoding encoding, and
  27068. // return the result.
  27069. return decode(bytes, encoding)
  27070. }
  27071. case 'ArrayBuffer': {
  27072. // Return a new ArrayBuffer whose contents are bytes.
  27073. const sequence = combineByteSequences(bytes)
  27074. return sequence.buffer
  27075. }
  27076. case 'BinaryString': {
  27077. // Return bytes as a binary string, in which every byte
  27078. // is represented by a code unit of equal value [0..255].
  27079. let binaryString = ''
  27080. const decoder = new StringDecoder('latin1')
  27081. for (const chunk of bytes) {
  27082. binaryString += decoder.write(chunk)
  27083. }
  27084. binaryString += decoder.end()
  27085. return binaryString
  27086. }
  27087. }
  27088. }
  27089. /**
  27090. * @see https://encoding.spec.whatwg.org/#decode
  27091. * @param {Uint8Array[]} ioQueue
  27092. * @param {string} encoding
  27093. */
  27094. function decode (ioQueue, encoding) {
  27095. const bytes = combineByteSequences(ioQueue)
  27096. // 1. Let BOMEncoding be the result of BOM sniffing ioQueue.
  27097. const BOMEncoding = BOMSniffing(bytes)
  27098. let slice = 0
  27099. // 2. If BOMEncoding is non-null:
  27100. if (BOMEncoding !== null) {
  27101. // 1. Set encoding to BOMEncoding.
  27102. encoding = BOMEncoding
  27103. // 2. Read three bytes from ioQueue, if BOMEncoding is
  27104. // UTF-8; otherwise read two bytes.
  27105. // (Do nothing with those bytes.)
  27106. slice = BOMEncoding === 'UTF-8' ? 3 : 2
  27107. }
  27108. // 3. Process a queue with an instance of encoding’s
  27109. // decoder, ioQueue, output, and "replacement".
  27110. // 4. Return output.
  27111. const sliced = bytes.slice(slice)
  27112. return new TextDecoder(encoding).decode(sliced)
  27113. }
  27114. /**
  27115. * @see https://encoding.spec.whatwg.org/#bom-sniff
  27116. * @param {Uint8Array} ioQueue
  27117. */
  27118. function BOMSniffing (ioQueue) {
  27119. // 1. Let BOM be the result of peeking 3 bytes from ioQueue,
  27120. // converted to a byte sequence.
  27121. const [a, b, c] = ioQueue
  27122. // 2. For each of the rows in the table below, starting with
  27123. // the first one and going down, if BOM starts with the
  27124. // bytes given in the first column, then return the
  27125. // encoding given in the cell in the second column of that
  27126. // row. Otherwise, return null.
  27127. if (a === 0xEF && b === 0xBB && c === 0xBF) {
  27128. return 'UTF-8'
  27129. } else if (a === 0xFE && b === 0xFF) {
  27130. return 'UTF-16BE'
  27131. } else if (a === 0xFF && b === 0xFE) {
  27132. return 'UTF-16LE'
  27133. }
  27134. return null
  27135. }
  27136. /**
  27137. * @param {Uint8Array[]} sequences
  27138. */
  27139. function combineByteSequences (sequences) {
  27140. const size = sequences.reduce((a, b) => {
  27141. return a + b.byteLength
  27142. }, 0)
  27143. let offset = 0
  27144. return sequences.reduce((a, b) => {
  27145. a.set(b, offset)
  27146. offset += b.byteLength
  27147. return a
  27148. }, new Uint8Array(size))
  27149. }
  27150. module.exports = {
  27151. staticPropertyDescriptors,
  27152. readOperation,
  27153. fireAProgressEvent
  27154. }
  27155. /***/ }),
  27156. /***/ 1892:
  27157. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  27158. "use strict";
  27159. // We include a version number for the Dispatcher API. In case of breaking changes,
  27160. // this version number must be increased to avoid conflicts.
  27161. const globalDispatcher = Symbol.for('undici.globalDispatcher.1')
  27162. const { InvalidArgumentError } = __nccwpck_require__(8045)
  27163. const Agent = __nccwpck_require__(7890)
  27164. if (getGlobalDispatcher() === undefined) {
  27165. setGlobalDispatcher(new Agent())
  27166. }
  27167. function setGlobalDispatcher (agent) {
  27168. if (!agent || typeof agent.dispatch !== 'function') {
  27169. throw new InvalidArgumentError('Argument agent must implement Agent')
  27170. }
  27171. Object.defineProperty(globalThis, globalDispatcher, {
  27172. value: agent,
  27173. writable: true,
  27174. enumerable: false,
  27175. configurable: false
  27176. })
  27177. }
  27178. function getGlobalDispatcher () {
  27179. return globalThis[globalDispatcher]
  27180. }
  27181. module.exports = {
  27182. setGlobalDispatcher,
  27183. getGlobalDispatcher
  27184. }
  27185. /***/ }),
  27186. /***/ 6930:
  27187. /***/ ((module) => {
  27188. "use strict";
  27189. module.exports = class DecoratorHandler {
  27190. constructor (handler) {
  27191. this.handler = handler
  27192. }
  27193. onConnect (...args) {
  27194. return this.handler.onConnect(...args)
  27195. }
  27196. onError (...args) {
  27197. return this.handler.onError(...args)
  27198. }
  27199. onUpgrade (...args) {
  27200. return this.handler.onUpgrade(...args)
  27201. }
  27202. onHeaders (...args) {
  27203. return this.handler.onHeaders(...args)
  27204. }
  27205. onData (...args) {
  27206. return this.handler.onData(...args)
  27207. }
  27208. onComplete (...args) {
  27209. return this.handler.onComplete(...args)
  27210. }
  27211. onBodySent (...args) {
  27212. return this.handler.onBodySent(...args)
  27213. }
  27214. }
  27215. /***/ }),
  27216. /***/ 2860:
  27217. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  27218. "use strict";
  27219. const util = __nccwpck_require__(3983)
  27220. const { kBodyUsed } = __nccwpck_require__(2785)
  27221. const assert = __nccwpck_require__(9491)
  27222. const { InvalidArgumentError } = __nccwpck_require__(8045)
  27223. const EE = __nccwpck_require__(2361)
  27224. const redirectableStatusCodes = [300, 301, 302, 303, 307, 308]
  27225. const kBody = Symbol('body')
  27226. class BodyAsyncIterable {
  27227. constructor (body) {
  27228. this[kBody] = body
  27229. this[kBodyUsed] = false
  27230. }
  27231. async * [Symbol.asyncIterator] () {
  27232. assert(!this[kBodyUsed], 'disturbed')
  27233. this[kBodyUsed] = true
  27234. yield * this[kBody]
  27235. }
  27236. }
  27237. class RedirectHandler {
  27238. constructor (dispatch, maxRedirections, opts, handler) {
  27239. if (maxRedirections != null && (!Number.isInteger(maxRedirections) || maxRedirections < 0)) {
  27240. throw new InvalidArgumentError('maxRedirections must be a positive number')
  27241. }
  27242. util.validateHandler(handler, opts.method, opts.upgrade)
  27243. this.dispatch = dispatch
  27244. this.location = null
  27245. this.abort = null
  27246. this.opts = { ...opts, maxRedirections: 0 } // opts must be a copy
  27247. this.maxRedirections = maxRedirections
  27248. this.handler = handler
  27249. this.history = []
  27250. if (util.isStream(this.opts.body)) {
  27251. // TODO (fix): Provide some way for the user to cache the file to e.g. /tmp
  27252. // so that it can be dispatched again?
  27253. // TODO (fix): Do we need 100-expect support to provide a way to do this properly?
  27254. if (util.bodyLength(this.opts.body) === 0) {
  27255. this.opts.body
  27256. .on('data', function () {
  27257. assert(false)
  27258. })
  27259. }
  27260. if (typeof this.opts.body.readableDidRead !== 'boolean') {
  27261. this.opts.body[kBodyUsed] = false
  27262. EE.prototype.on.call(this.opts.body, 'data', function () {
  27263. this[kBodyUsed] = true
  27264. })
  27265. }
  27266. } else if (this.opts.body && typeof this.opts.body.pipeTo === 'function') {
  27267. // TODO (fix): We can't access ReadableStream internal state
  27268. // to determine whether or not it has been disturbed. This is just
  27269. // a workaround.
  27270. this.opts.body = new BodyAsyncIterable(this.opts.body)
  27271. } else if (
  27272. this.opts.body &&
  27273. typeof this.opts.body !== 'string' &&
  27274. !ArrayBuffer.isView(this.opts.body) &&
  27275. util.isIterable(this.opts.body)
  27276. ) {
  27277. // TODO: Should we allow re-using iterable if !this.opts.idempotent
  27278. // or through some other flag?
  27279. this.opts.body = new BodyAsyncIterable(this.opts.body)
  27280. }
  27281. }
  27282. onConnect (abort) {
  27283. this.abort = abort
  27284. this.handler.onConnect(abort, { history: this.history })
  27285. }
  27286. onUpgrade (statusCode, headers, socket) {
  27287. this.handler.onUpgrade(statusCode, headers, socket)
  27288. }
  27289. onError (error) {
  27290. this.handler.onError(error)
  27291. }
  27292. onHeaders (statusCode, headers, resume, statusText) {
  27293. this.location = this.history.length >= this.maxRedirections || util.isDisturbed(this.opts.body)
  27294. ? null
  27295. : parseLocation(statusCode, headers)
  27296. if (this.opts.origin) {
  27297. this.history.push(new URL(this.opts.path, this.opts.origin))
  27298. }
  27299. if (!this.location) {
  27300. return this.handler.onHeaders(statusCode, headers, resume, statusText)
  27301. }
  27302. const { origin, pathname, search } = util.parseURL(new URL(this.location, this.opts.origin && new URL(this.opts.path, this.opts.origin)))
  27303. const path = search ? `${pathname}${search}` : pathname
  27304. // Remove headers referring to the original URL.
  27305. // By default it is Host only, unless it's a 303 (see below), which removes also all Content-* headers.
  27306. // https://tools.ietf.org/html/rfc7231#section-6.4
  27307. this.opts.headers = cleanRequestHeaders(this.opts.headers, statusCode === 303, this.opts.origin !== origin)
  27308. this.opts.path = path
  27309. this.opts.origin = origin
  27310. this.opts.maxRedirections = 0
  27311. this.opts.query = null
  27312. // https://tools.ietf.org/html/rfc7231#section-6.4.4
  27313. // In case of HTTP 303, always replace method to be either HEAD or GET
  27314. if (statusCode === 303 && this.opts.method !== 'HEAD') {
  27315. this.opts.method = 'GET'
  27316. this.opts.body = null
  27317. }
  27318. }
  27319. onData (chunk) {
  27320. if (this.location) {
  27321. /*
  27322. https://tools.ietf.org/html/rfc7231#section-6.4
  27323. TLDR: undici always ignores 3xx response bodies.
  27324. Redirection is used to serve the requested resource from another URL, so it is assumes that
  27325. no body is generated (and thus can be ignored). Even though generating a body is not prohibited.
  27326. For status 301, 302, 303, 307 and 308 (the latter from RFC 7238), the specs mention that the body usually
  27327. (which means it's optional and not mandated) contain just an hyperlink to the value of
  27328. the Location response header, so the body can be ignored safely.
  27329. For status 300, which is "Multiple Choices", the spec mentions both generating a Location
  27330. response header AND a response body with the other possible location to follow.
  27331. Since the spec explicitily chooses not to specify a format for such body and leave it to
  27332. servers and browsers implementors, we ignore the body as there is no specified way to eventually parse it.
  27333. */
  27334. } else {
  27335. return this.handler.onData(chunk)
  27336. }
  27337. }
  27338. onComplete (trailers) {
  27339. if (this.location) {
  27340. /*
  27341. https://tools.ietf.org/html/rfc7231#section-6.4
  27342. TLDR: undici always ignores 3xx response trailers as they are not expected in case of redirections
  27343. and neither are useful if present.
  27344. See comment on onData method above for more detailed informations.
  27345. */
  27346. this.location = null
  27347. this.abort = null
  27348. this.dispatch(this.opts, this)
  27349. } else {
  27350. this.handler.onComplete(trailers)
  27351. }
  27352. }
  27353. onBodySent (chunk) {
  27354. if (this.handler.onBodySent) {
  27355. this.handler.onBodySent(chunk)
  27356. }
  27357. }
  27358. }
  27359. function parseLocation (statusCode, headers) {
  27360. if (redirectableStatusCodes.indexOf(statusCode) === -1) {
  27361. return null
  27362. }
  27363. for (let i = 0; i < headers.length; i += 2) {
  27364. if (headers[i].toString().toLowerCase() === 'location') {
  27365. return headers[i + 1]
  27366. }
  27367. }
  27368. }
  27369. // https://tools.ietf.org/html/rfc7231#section-6.4.4
  27370. function shouldRemoveHeader (header, removeContent, unknownOrigin) {
  27371. if (header.length === 4) {
  27372. return util.headerNameToString(header) === 'host'
  27373. }
  27374. if (removeContent && util.headerNameToString(header).startsWith('content-')) {
  27375. return true
  27376. }
  27377. if (unknownOrigin && (header.length === 13 || header.length === 6 || header.length === 19)) {
  27378. const name = util.headerNameToString(header)
  27379. return name === 'authorization' || name === 'cookie' || name === 'proxy-authorization'
  27380. }
  27381. return false
  27382. }
  27383. // https://tools.ietf.org/html/rfc7231#section-6.4
  27384. function cleanRequestHeaders (headers, removeContent, unknownOrigin) {
  27385. const ret = []
  27386. if (Array.isArray(headers)) {
  27387. for (let i = 0; i < headers.length; i += 2) {
  27388. if (!shouldRemoveHeader(headers[i], removeContent, unknownOrigin)) {
  27389. ret.push(headers[i], headers[i + 1])
  27390. }
  27391. }
  27392. } else if (headers && typeof headers === 'object') {
  27393. for (const key of Object.keys(headers)) {
  27394. if (!shouldRemoveHeader(key, removeContent, unknownOrigin)) {
  27395. ret.push(key, headers[key])
  27396. }
  27397. }
  27398. } else {
  27399. assert(headers == null, 'headers must be an object or an array')
  27400. }
  27401. return ret
  27402. }
  27403. module.exports = RedirectHandler
  27404. /***/ }),
  27405. /***/ 2286:
  27406. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  27407. const assert = __nccwpck_require__(9491)
  27408. const { kRetryHandlerDefaultRetry } = __nccwpck_require__(2785)
  27409. const { RequestRetryError } = __nccwpck_require__(8045)
  27410. const { isDisturbed, parseHeaders, parseRangeHeader } = __nccwpck_require__(3983)
  27411. function calculateRetryAfterHeader (retryAfter) {
  27412. const current = Date.now()
  27413. const diff = new Date(retryAfter).getTime() - current
  27414. return diff
  27415. }
  27416. class RetryHandler {
  27417. constructor (opts, handlers) {
  27418. const { retryOptions, ...dispatchOpts } = opts
  27419. const {
  27420. // Retry scoped
  27421. retry: retryFn,
  27422. maxRetries,
  27423. maxTimeout,
  27424. minTimeout,
  27425. timeoutFactor,
  27426. // Response scoped
  27427. methods,
  27428. errorCodes,
  27429. retryAfter,
  27430. statusCodes
  27431. } = retryOptions ?? {}
  27432. this.dispatch = handlers.dispatch
  27433. this.handler = handlers.handler
  27434. this.opts = dispatchOpts
  27435. this.abort = null
  27436. this.aborted = false
  27437. this.retryOpts = {
  27438. retry: retryFn ?? RetryHandler[kRetryHandlerDefaultRetry],
  27439. retryAfter: retryAfter ?? true,
  27440. maxTimeout: maxTimeout ?? 30 * 1000, // 30s,
  27441. timeout: minTimeout ?? 500, // .5s
  27442. timeoutFactor: timeoutFactor ?? 2,
  27443. maxRetries: maxRetries ?? 5,
  27444. // What errors we should retry
  27445. methods: methods ?? ['GET', 'HEAD', 'OPTIONS', 'PUT', 'DELETE', 'TRACE'],
  27446. // Indicates which errors to retry
  27447. statusCodes: statusCodes ?? [500, 502, 503, 504, 429],
  27448. // List of errors to retry
  27449. errorCodes: errorCodes ?? [
  27450. 'ECONNRESET',
  27451. 'ECONNREFUSED',
  27452. 'ENOTFOUND',
  27453. 'ENETDOWN',
  27454. 'ENETUNREACH',
  27455. 'EHOSTDOWN',
  27456. 'EHOSTUNREACH',
  27457. 'EPIPE'
  27458. ]
  27459. }
  27460. this.retryCount = 0
  27461. this.start = 0
  27462. this.end = null
  27463. this.etag = null
  27464. this.resume = null
  27465. // Handle possible onConnect duplication
  27466. this.handler.onConnect(reason => {
  27467. this.aborted = true
  27468. if (this.abort) {
  27469. this.abort(reason)
  27470. } else {
  27471. this.reason = reason
  27472. }
  27473. })
  27474. }
  27475. onRequestSent () {
  27476. if (this.handler.onRequestSent) {
  27477. this.handler.onRequestSent()
  27478. }
  27479. }
  27480. onUpgrade (statusCode, headers, socket) {
  27481. if (this.handler.onUpgrade) {
  27482. this.handler.onUpgrade(statusCode, headers, socket)
  27483. }
  27484. }
  27485. onConnect (abort) {
  27486. if (this.aborted) {
  27487. abort(this.reason)
  27488. } else {
  27489. this.abort = abort
  27490. }
  27491. }
  27492. onBodySent (chunk) {
  27493. if (this.handler.onBodySent) return this.handler.onBodySent(chunk)
  27494. }
  27495. static [kRetryHandlerDefaultRetry] (err, { state, opts }, cb) {
  27496. const { statusCode, code, headers } = err
  27497. const { method, retryOptions } = opts
  27498. const {
  27499. maxRetries,
  27500. timeout,
  27501. maxTimeout,
  27502. timeoutFactor,
  27503. statusCodes,
  27504. errorCodes,
  27505. methods
  27506. } = retryOptions
  27507. let { counter, currentTimeout } = state
  27508. currentTimeout =
  27509. currentTimeout != null && currentTimeout > 0 ? currentTimeout : timeout
  27510. // Any code that is not a Undici's originated and allowed to retry
  27511. if (
  27512. code &&
  27513. code !== 'UND_ERR_REQ_RETRY' &&
  27514. code !== 'UND_ERR_SOCKET' &&
  27515. !errorCodes.includes(code)
  27516. ) {
  27517. cb(err)
  27518. return
  27519. }
  27520. // If a set of method are provided and the current method is not in the list
  27521. if (Array.isArray(methods) && !methods.includes(method)) {
  27522. cb(err)
  27523. return
  27524. }
  27525. // If a set of status code are provided and the current status code is not in the list
  27526. if (
  27527. statusCode != null &&
  27528. Array.isArray(statusCodes) &&
  27529. !statusCodes.includes(statusCode)
  27530. ) {
  27531. cb(err)
  27532. return
  27533. }
  27534. // If we reached the max number of retries
  27535. if (counter > maxRetries) {
  27536. cb(err)
  27537. return
  27538. }
  27539. let retryAfterHeader = headers != null && headers['retry-after']
  27540. if (retryAfterHeader) {
  27541. retryAfterHeader = Number(retryAfterHeader)
  27542. retryAfterHeader = isNaN(retryAfterHeader)
  27543. ? calculateRetryAfterHeader(retryAfterHeader)
  27544. : retryAfterHeader * 1e3 // Retry-After is in seconds
  27545. }
  27546. const retryTimeout =
  27547. retryAfterHeader > 0
  27548. ? Math.min(retryAfterHeader, maxTimeout)
  27549. : Math.min(currentTimeout * timeoutFactor ** counter, maxTimeout)
  27550. state.currentTimeout = retryTimeout
  27551. setTimeout(() => cb(null), retryTimeout)
  27552. }
  27553. onHeaders (statusCode, rawHeaders, resume, statusMessage) {
  27554. const headers = parseHeaders(rawHeaders)
  27555. this.retryCount += 1
  27556. if (statusCode >= 300) {
  27557. this.abort(
  27558. new RequestRetryError('Request failed', statusCode, {
  27559. headers,
  27560. count: this.retryCount
  27561. })
  27562. )
  27563. return false
  27564. }
  27565. // Checkpoint for resume from where we left it
  27566. if (this.resume != null) {
  27567. this.resume = null
  27568. if (statusCode !== 206) {
  27569. return true
  27570. }
  27571. const contentRange = parseRangeHeader(headers['content-range'])
  27572. // If no content range
  27573. if (!contentRange) {
  27574. this.abort(
  27575. new RequestRetryError('Content-Range mismatch', statusCode, {
  27576. headers,
  27577. count: this.retryCount
  27578. })
  27579. )
  27580. return false
  27581. }
  27582. // Let's start with a weak etag check
  27583. if (this.etag != null && this.etag !== headers.etag) {
  27584. this.abort(
  27585. new RequestRetryError('ETag mismatch', statusCode, {
  27586. headers,
  27587. count: this.retryCount
  27588. })
  27589. )
  27590. return false
  27591. }
  27592. const { start, size, end = size } = contentRange
  27593. assert(this.start === start, 'content-range mismatch')
  27594. assert(this.end == null || this.end === end, 'content-range mismatch')
  27595. this.resume = resume
  27596. return true
  27597. }
  27598. if (this.end == null) {
  27599. if (statusCode === 206) {
  27600. // First time we receive 206
  27601. const range = parseRangeHeader(headers['content-range'])
  27602. if (range == null) {
  27603. return this.handler.onHeaders(
  27604. statusCode,
  27605. rawHeaders,
  27606. resume,
  27607. statusMessage
  27608. )
  27609. }
  27610. const { start, size, end = size } = range
  27611. assert(
  27612. start != null && Number.isFinite(start) && this.start !== start,
  27613. 'content-range mismatch'
  27614. )
  27615. assert(Number.isFinite(start))
  27616. assert(
  27617. end != null && Number.isFinite(end) && this.end !== end,
  27618. 'invalid content-length'
  27619. )
  27620. this.start = start
  27621. this.end = end
  27622. }
  27623. // We make our best to checkpoint the body for further range headers
  27624. if (this.end == null) {
  27625. const contentLength = headers['content-length']
  27626. this.end = contentLength != null ? Number(contentLength) : null
  27627. }
  27628. assert(Number.isFinite(this.start))
  27629. assert(
  27630. this.end == null || Number.isFinite(this.end),
  27631. 'invalid content-length'
  27632. )
  27633. this.resume = resume
  27634. this.etag = headers.etag != null ? headers.etag : null
  27635. return this.handler.onHeaders(
  27636. statusCode,
  27637. rawHeaders,
  27638. resume,
  27639. statusMessage
  27640. )
  27641. }
  27642. const err = new RequestRetryError('Request failed', statusCode, {
  27643. headers,
  27644. count: this.retryCount
  27645. })
  27646. this.abort(err)
  27647. return false
  27648. }
  27649. onData (chunk) {
  27650. this.start += chunk.length
  27651. return this.handler.onData(chunk)
  27652. }
  27653. onComplete (rawTrailers) {
  27654. this.retryCount = 0
  27655. return this.handler.onComplete(rawTrailers)
  27656. }
  27657. onError (err) {
  27658. if (this.aborted || isDisturbed(this.opts.body)) {
  27659. return this.handler.onError(err)
  27660. }
  27661. this.retryOpts.retry(
  27662. err,
  27663. {
  27664. state: { counter: this.retryCount++, currentTimeout: this.retryAfter },
  27665. opts: { retryOptions: this.retryOpts, ...this.opts }
  27666. },
  27667. onRetry.bind(this)
  27668. )
  27669. function onRetry (err) {
  27670. if (err != null || this.aborted || isDisturbed(this.opts.body)) {
  27671. return this.handler.onError(err)
  27672. }
  27673. if (this.start !== 0) {
  27674. this.opts = {
  27675. ...this.opts,
  27676. headers: {
  27677. ...this.opts.headers,
  27678. range: `bytes=${this.start}-${this.end ?? ''}`
  27679. }
  27680. }
  27681. }
  27682. try {
  27683. this.dispatch(this.opts, this)
  27684. } catch (err) {
  27685. this.handler.onError(err)
  27686. }
  27687. }
  27688. }
  27689. }
  27690. module.exports = RetryHandler
  27691. /***/ }),
  27692. /***/ 8861:
  27693. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  27694. "use strict";
  27695. const RedirectHandler = __nccwpck_require__(2860)
  27696. function createRedirectInterceptor ({ maxRedirections: defaultMaxRedirections }) {
  27697. return (dispatch) => {
  27698. return function Intercept (opts, handler) {
  27699. const { maxRedirections = defaultMaxRedirections } = opts
  27700. if (!maxRedirections) {
  27701. return dispatch(opts, handler)
  27702. }
  27703. const redirectHandler = new RedirectHandler(dispatch, maxRedirections, opts, handler)
  27704. opts = { ...opts, maxRedirections: 0 } // Stop sub dispatcher from also redirecting.
  27705. return dispatch(opts, redirectHandler)
  27706. }
  27707. }
  27708. }
  27709. module.exports = createRedirectInterceptor
  27710. /***/ }),
  27711. /***/ 953:
  27712. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  27713. "use strict";
  27714. Object.defineProperty(exports, "__esModule", ({ value: true }));
  27715. 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;
  27716. const utils_1 = __nccwpck_require__(1891);
  27717. // C headers
  27718. var ERROR;
  27719. (function (ERROR) {
  27720. ERROR[ERROR["OK"] = 0] = "OK";
  27721. ERROR[ERROR["INTERNAL"] = 1] = "INTERNAL";
  27722. ERROR[ERROR["STRICT"] = 2] = "STRICT";
  27723. ERROR[ERROR["LF_EXPECTED"] = 3] = "LF_EXPECTED";
  27724. ERROR[ERROR["UNEXPECTED_CONTENT_LENGTH"] = 4] = "UNEXPECTED_CONTENT_LENGTH";
  27725. ERROR[ERROR["CLOSED_CONNECTION"] = 5] = "CLOSED_CONNECTION";
  27726. ERROR[ERROR["INVALID_METHOD"] = 6] = "INVALID_METHOD";
  27727. ERROR[ERROR["INVALID_URL"] = 7] = "INVALID_URL";
  27728. ERROR[ERROR["INVALID_CONSTANT"] = 8] = "INVALID_CONSTANT";
  27729. ERROR[ERROR["INVALID_VERSION"] = 9] = "INVALID_VERSION";
  27730. ERROR[ERROR["INVALID_HEADER_TOKEN"] = 10] = "INVALID_HEADER_TOKEN";
  27731. ERROR[ERROR["INVALID_CONTENT_LENGTH"] = 11] = "INVALID_CONTENT_LENGTH";
  27732. ERROR[ERROR["INVALID_CHUNK_SIZE"] = 12] = "INVALID_CHUNK_SIZE";
  27733. ERROR[ERROR["INVALID_STATUS"] = 13] = "INVALID_STATUS";
  27734. ERROR[ERROR["INVALID_EOF_STATE"] = 14] = "INVALID_EOF_STATE";
  27735. ERROR[ERROR["INVALID_TRANSFER_ENCODING"] = 15] = "INVALID_TRANSFER_ENCODING";
  27736. ERROR[ERROR["CB_MESSAGE_BEGIN"] = 16] = "CB_MESSAGE_BEGIN";
  27737. ERROR[ERROR["CB_HEADERS_COMPLETE"] = 17] = "CB_HEADERS_COMPLETE";
  27738. ERROR[ERROR["CB_MESSAGE_COMPLETE"] = 18] = "CB_MESSAGE_COMPLETE";
  27739. ERROR[ERROR["CB_CHUNK_HEADER"] = 19] = "CB_CHUNK_HEADER";
  27740. ERROR[ERROR["CB_CHUNK_COMPLETE"] = 20] = "CB_CHUNK_COMPLETE";
  27741. ERROR[ERROR["PAUSED"] = 21] = "PAUSED";
  27742. ERROR[ERROR["PAUSED_UPGRADE"] = 22] = "PAUSED_UPGRADE";
  27743. ERROR[ERROR["PAUSED_H2_UPGRADE"] = 23] = "PAUSED_H2_UPGRADE";
  27744. ERROR[ERROR["USER"] = 24] = "USER";
  27745. })(ERROR = exports.ERROR || (exports.ERROR = {}));
  27746. var TYPE;
  27747. (function (TYPE) {
  27748. TYPE[TYPE["BOTH"] = 0] = "BOTH";
  27749. TYPE[TYPE["REQUEST"] = 1] = "REQUEST";
  27750. TYPE[TYPE["RESPONSE"] = 2] = "RESPONSE";
  27751. })(TYPE = exports.TYPE || (exports.TYPE = {}));
  27752. var FLAGS;
  27753. (function (FLAGS) {
  27754. FLAGS[FLAGS["CONNECTION_KEEP_ALIVE"] = 1] = "CONNECTION_KEEP_ALIVE";
  27755. FLAGS[FLAGS["CONNECTION_CLOSE"] = 2] = "CONNECTION_CLOSE";
  27756. FLAGS[FLAGS["CONNECTION_UPGRADE"] = 4] = "CONNECTION_UPGRADE";
  27757. FLAGS[FLAGS["CHUNKED"] = 8] = "CHUNKED";
  27758. FLAGS[FLAGS["UPGRADE"] = 16] = "UPGRADE";
  27759. FLAGS[FLAGS["CONTENT_LENGTH"] = 32] = "CONTENT_LENGTH";
  27760. FLAGS[FLAGS["SKIPBODY"] = 64] = "SKIPBODY";
  27761. FLAGS[FLAGS["TRAILING"] = 128] = "TRAILING";
  27762. // 1 << 8 is unused
  27763. FLAGS[FLAGS["TRANSFER_ENCODING"] = 512] = "TRANSFER_ENCODING";
  27764. })(FLAGS = exports.FLAGS || (exports.FLAGS = {}));
  27765. var LENIENT_FLAGS;
  27766. (function (LENIENT_FLAGS) {
  27767. LENIENT_FLAGS[LENIENT_FLAGS["HEADERS"] = 1] = "HEADERS";
  27768. LENIENT_FLAGS[LENIENT_FLAGS["CHUNKED_LENGTH"] = 2] = "CHUNKED_LENGTH";
  27769. LENIENT_FLAGS[LENIENT_FLAGS["KEEP_ALIVE"] = 4] = "KEEP_ALIVE";
  27770. })(LENIENT_FLAGS = exports.LENIENT_FLAGS || (exports.LENIENT_FLAGS = {}));
  27771. var METHODS;
  27772. (function (METHODS) {
  27773. METHODS[METHODS["DELETE"] = 0] = "DELETE";
  27774. METHODS[METHODS["GET"] = 1] = "GET";
  27775. METHODS[METHODS["HEAD"] = 2] = "HEAD";
  27776. METHODS[METHODS["POST"] = 3] = "POST";
  27777. METHODS[METHODS["PUT"] = 4] = "PUT";
  27778. /* pathological */
  27779. METHODS[METHODS["CONNECT"] = 5] = "CONNECT";
  27780. METHODS[METHODS["OPTIONS"] = 6] = "OPTIONS";
  27781. METHODS[METHODS["TRACE"] = 7] = "TRACE";
  27782. /* WebDAV */
  27783. METHODS[METHODS["COPY"] = 8] = "COPY";
  27784. METHODS[METHODS["LOCK"] = 9] = "LOCK";
  27785. METHODS[METHODS["MKCOL"] = 10] = "MKCOL";
  27786. METHODS[METHODS["MOVE"] = 11] = "MOVE";
  27787. METHODS[METHODS["PROPFIND"] = 12] = "PROPFIND";
  27788. METHODS[METHODS["PROPPATCH"] = 13] = "PROPPATCH";
  27789. METHODS[METHODS["SEARCH"] = 14] = "SEARCH";
  27790. METHODS[METHODS["UNLOCK"] = 15] = "UNLOCK";
  27791. METHODS[METHODS["BIND"] = 16] = "BIND";
  27792. METHODS[METHODS["REBIND"] = 17] = "REBIND";
  27793. METHODS[METHODS["UNBIND"] = 18] = "UNBIND";
  27794. METHODS[METHODS["ACL"] = 19] = "ACL";
  27795. /* subversion */
  27796. METHODS[METHODS["REPORT"] = 20] = "REPORT";
  27797. METHODS[METHODS["MKACTIVITY"] = 21] = "MKACTIVITY";
  27798. METHODS[METHODS["CHECKOUT"] = 22] = "CHECKOUT";
  27799. METHODS[METHODS["MERGE"] = 23] = "MERGE";
  27800. /* upnp */
  27801. METHODS[METHODS["M-SEARCH"] = 24] = "M-SEARCH";
  27802. METHODS[METHODS["NOTIFY"] = 25] = "NOTIFY";
  27803. METHODS[METHODS["SUBSCRIBE"] = 26] = "SUBSCRIBE";
  27804. METHODS[METHODS["UNSUBSCRIBE"] = 27] = "UNSUBSCRIBE";
  27805. /* RFC-5789 */
  27806. METHODS[METHODS["PATCH"] = 28] = "PATCH";
  27807. METHODS[METHODS["PURGE"] = 29] = "PURGE";
  27808. /* CalDAV */
  27809. METHODS[METHODS["MKCALENDAR"] = 30] = "MKCALENDAR";
  27810. /* RFC-2068, section 19.6.1.2 */
  27811. METHODS[METHODS["LINK"] = 31] = "LINK";
  27812. METHODS[METHODS["UNLINK"] = 32] = "UNLINK";
  27813. /* icecast */
  27814. METHODS[METHODS["SOURCE"] = 33] = "SOURCE";
  27815. /* RFC-7540, section 11.6 */
  27816. METHODS[METHODS["PRI"] = 34] = "PRI";
  27817. /* RFC-2326 RTSP */
  27818. METHODS[METHODS["DESCRIBE"] = 35] = "DESCRIBE";
  27819. METHODS[METHODS["ANNOUNCE"] = 36] = "ANNOUNCE";
  27820. METHODS[METHODS["SETUP"] = 37] = "SETUP";
  27821. METHODS[METHODS["PLAY"] = 38] = "PLAY";
  27822. METHODS[METHODS["PAUSE"] = 39] = "PAUSE";
  27823. METHODS[METHODS["TEARDOWN"] = 40] = "TEARDOWN";
  27824. METHODS[METHODS["GET_PARAMETER"] = 41] = "GET_PARAMETER";
  27825. METHODS[METHODS["SET_PARAMETER"] = 42] = "SET_PARAMETER";
  27826. METHODS[METHODS["REDIRECT"] = 43] = "REDIRECT";
  27827. METHODS[METHODS["RECORD"] = 44] = "RECORD";
  27828. /* RAOP */
  27829. METHODS[METHODS["FLUSH"] = 45] = "FLUSH";
  27830. })(METHODS = exports.METHODS || (exports.METHODS = {}));
  27831. exports.METHODS_HTTP = [
  27832. METHODS.DELETE,
  27833. METHODS.GET,
  27834. METHODS.HEAD,
  27835. METHODS.POST,
  27836. METHODS.PUT,
  27837. METHODS.CONNECT,
  27838. METHODS.OPTIONS,
  27839. METHODS.TRACE,
  27840. METHODS.COPY,
  27841. METHODS.LOCK,
  27842. METHODS.MKCOL,
  27843. METHODS.MOVE,
  27844. METHODS.PROPFIND,
  27845. METHODS.PROPPATCH,
  27846. METHODS.SEARCH,
  27847. METHODS.UNLOCK,
  27848. METHODS.BIND,
  27849. METHODS.REBIND,
  27850. METHODS.UNBIND,
  27851. METHODS.ACL,
  27852. METHODS.REPORT,
  27853. METHODS.MKACTIVITY,
  27854. METHODS.CHECKOUT,
  27855. METHODS.MERGE,
  27856. METHODS['M-SEARCH'],
  27857. METHODS.NOTIFY,
  27858. METHODS.SUBSCRIBE,
  27859. METHODS.UNSUBSCRIBE,
  27860. METHODS.PATCH,
  27861. METHODS.PURGE,
  27862. METHODS.MKCALENDAR,
  27863. METHODS.LINK,
  27864. METHODS.UNLINK,
  27865. METHODS.PRI,
  27866. // TODO(indutny): should we allow it with HTTP?
  27867. METHODS.SOURCE,
  27868. ];
  27869. exports.METHODS_ICE = [
  27870. METHODS.SOURCE,
  27871. ];
  27872. exports.METHODS_RTSP = [
  27873. METHODS.OPTIONS,
  27874. METHODS.DESCRIBE,
  27875. METHODS.ANNOUNCE,
  27876. METHODS.SETUP,
  27877. METHODS.PLAY,
  27878. METHODS.PAUSE,
  27879. METHODS.TEARDOWN,
  27880. METHODS.GET_PARAMETER,
  27881. METHODS.SET_PARAMETER,
  27882. METHODS.REDIRECT,
  27883. METHODS.RECORD,
  27884. METHODS.FLUSH,
  27885. // For AirPlay
  27886. METHODS.GET,
  27887. METHODS.POST,
  27888. ];
  27889. exports.METHOD_MAP = utils_1.enumToMap(METHODS);
  27890. exports.H_METHOD_MAP = {};
  27891. Object.keys(exports.METHOD_MAP).forEach((key) => {
  27892. if (/^H/.test(key)) {
  27893. exports.H_METHOD_MAP[key] = exports.METHOD_MAP[key];
  27894. }
  27895. });
  27896. var FINISH;
  27897. (function (FINISH) {
  27898. FINISH[FINISH["SAFE"] = 0] = "SAFE";
  27899. FINISH[FINISH["SAFE_WITH_CB"] = 1] = "SAFE_WITH_CB";
  27900. FINISH[FINISH["UNSAFE"] = 2] = "UNSAFE";
  27901. })(FINISH = exports.FINISH || (exports.FINISH = {}));
  27902. exports.ALPHA = [];
  27903. for (let i = 'A'.charCodeAt(0); i <= 'Z'.charCodeAt(0); i++) {
  27904. // Upper case
  27905. exports.ALPHA.push(String.fromCharCode(i));
  27906. // Lower case
  27907. exports.ALPHA.push(String.fromCharCode(i + 0x20));
  27908. }
  27909. exports.NUM_MAP = {
  27910. 0: 0, 1: 1, 2: 2, 3: 3, 4: 4,
  27911. 5: 5, 6: 6, 7: 7, 8: 8, 9: 9,
  27912. };
  27913. exports.HEX_MAP = {
  27914. 0: 0, 1: 1, 2: 2, 3: 3, 4: 4,
  27915. 5: 5, 6: 6, 7: 7, 8: 8, 9: 9,
  27916. A: 0XA, B: 0XB, C: 0XC, D: 0XD, E: 0XE, F: 0XF,
  27917. a: 0xa, b: 0xb, c: 0xc, d: 0xd, e: 0xe, f: 0xf,
  27918. };
  27919. exports.NUM = [
  27920. '0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
  27921. ];
  27922. exports.ALPHANUM = exports.ALPHA.concat(exports.NUM);
  27923. exports.MARK = ['-', '_', '.', '!', '~', '*', '\'', '(', ')'];
  27924. exports.USERINFO_CHARS = exports.ALPHANUM
  27925. .concat(exports.MARK)
  27926. .concat(['%', ';', ':', '&', '=', '+', '$', ',']);
  27927. // TODO(indutny): use RFC
  27928. exports.STRICT_URL_CHAR = [
  27929. '!', '"', '$', '%', '&', '\'',
  27930. '(', ')', '*', '+', ',', '-', '.', '/',
  27931. ':', ';', '<', '=', '>',
  27932. '@', '[', '\\', ']', '^', '_',
  27933. '`',
  27934. '{', '|', '}', '~',
  27935. ].concat(exports.ALPHANUM);
  27936. exports.URL_CHAR = exports.STRICT_URL_CHAR
  27937. .concat(['\t', '\f']);
  27938. // All characters with 0x80 bit set to 1
  27939. for (let i = 0x80; i <= 0xff; i++) {
  27940. exports.URL_CHAR.push(i);
  27941. }
  27942. exports.HEX = exports.NUM.concat(['a', 'b', 'c', 'd', 'e', 'f', 'A', 'B', 'C', 'D', 'E', 'F']);
  27943. /* Tokens as defined by rfc 2616. Also lowercases them.
  27944. * token = 1*<any CHAR except CTLs or separators>
  27945. * separators = "(" | ")" | "<" | ">" | "@"
  27946. * | "," | ";" | ":" | "\" | <">
  27947. * | "/" | "[" | "]" | "?" | "="
  27948. * | "{" | "}" | SP | HT
  27949. */
  27950. exports.STRICT_TOKEN = [
  27951. '!', '#', '$', '%', '&', '\'',
  27952. '*', '+', '-', '.',
  27953. '^', '_', '`',
  27954. '|', '~',
  27955. ].concat(exports.ALPHANUM);
  27956. exports.TOKEN = exports.STRICT_TOKEN.concat([' ']);
  27957. /*
  27958. * Verify that a char is a valid visible (printable) US-ASCII
  27959. * character or %x80-FF
  27960. */
  27961. exports.HEADER_CHARS = ['\t'];
  27962. for (let i = 32; i <= 255; i++) {
  27963. if (i !== 127) {
  27964. exports.HEADER_CHARS.push(i);
  27965. }
  27966. }
  27967. // ',' = \x44
  27968. exports.CONNECTION_TOKEN_CHARS = exports.HEADER_CHARS.filter((c) => c !== 44);
  27969. exports.MAJOR = exports.NUM_MAP;
  27970. exports.MINOR = exports.MAJOR;
  27971. var HEADER_STATE;
  27972. (function (HEADER_STATE) {
  27973. HEADER_STATE[HEADER_STATE["GENERAL"] = 0] = "GENERAL";
  27974. HEADER_STATE[HEADER_STATE["CONNECTION"] = 1] = "CONNECTION";
  27975. HEADER_STATE[HEADER_STATE["CONTENT_LENGTH"] = 2] = "CONTENT_LENGTH";
  27976. HEADER_STATE[HEADER_STATE["TRANSFER_ENCODING"] = 3] = "TRANSFER_ENCODING";
  27977. HEADER_STATE[HEADER_STATE["UPGRADE"] = 4] = "UPGRADE";
  27978. HEADER_STATE[HEADER_STATE["CONNECTION_KEEP_ALIVE"] = 5] = "CONNECTION_KEEP_ALIVE";
  27979. HEADER_STATE[HEADER_STATE["CONNECTION_CLOSE"] = 6] = "CONNECTION_CLOSE";
  27980. HEADER_STATE[HEADER_STATE["CONNECTION_UPGRADE"] = 7] = "CONNECTION_UPGRADE";
  27981. HEADER_STATE[HEADER_STATE["TRANSFER_ENCODING_CHUNKED"] = 8] = "TRANSFER_ENCODING_CHUNKED";
  27982. })(HEADER_STATE = exports.HEADER_STATE || (exports.HEADER_STATE = {}));
  27983. exports.SPECIAL_HEADERS = {
  27984. 'connection': HEADER_STATE.CONNECTION,
  27985. 'content-length': HEADER_STATE.CONTENT_LENGTH,
  27986. 'proxy-connection': HEADER_STATE.CONNECTION,
  27987. 'transfer-encoding': HEADER_STATE.TRANSFER_ENCODING,
  27988. 'upgrade': HEADER_STATE.UPGRADE,
  27989. };
  27990. //# sourceMappingURL=constants.js.map
  27991. /***/ }),
  27992. /***/ 1145:
  27993. /***/ ((module) => {
  27994. module.exports = 'AGFzbQEAAAABMAhgAX8Bf2ADf39/AX9gBH9/f38Bf2AAAGADf39/AGABfwBgAn9/AGAGf39/f39/AALLAQgDZW52GHdhc21fb25faGVhZGVyc19jb21wbGV0ZQACA2VudhV3YXNtX29uX21lc3NhZ2VfYmVnaW4AAANlbnYLd2FzbV9vbl91cmwAAQNlbnYOd2FzbV9vbl9zdGF0dXMAAQNlbnYUd2FzbV9vbl9oZWFkZXJfZmllbGQAAQNlbnYUd2FzbV9vbl9oZWFkZXJfdmFsdWUAAQNlbnYMd2FzbV9vbl9ib2R5AAEDZW52GHdhc21fb25fbWVzc2FnZV9jb21wbGV0ZQAAA0ZFAwMEAAAFAAAAAAAABQEFAAUFBQAABgAAAAAGBgYGAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAAABAQcAAAUFAwABBAUBcAESEgUDAQACBggBfwFBgNQECwfRBSIGbWVtb3J5AgALX2luaXRpYWxpemUACRlfX2luZGlyZWN0X2Z1bmN0aW9uX3RhYmxlAQALbGxodHRwX2luaXQAChhsbGh0dHBfc2hvdWxkX2tlZXB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HAAHENAEEAIQEgAkGIBHFBgARGDQAgAkEocUEARyEBCyABC1kAIABBGGpCADcDACAAQgA3AwAgAEE4akIANwMAIABBMGpCADcDACAAQShqQgA3AwAgAEEgakIANwMAIABBEGpCADcDACAAQQhqQgA3AwAgAEHdATYCHEEAC3sBAX8CQCAAKAIMIgMNAAJAIAAoAgRFDQAgACABNgIECwJAIAAgASACEMSAgIAAIgMNACAAKAIMDwsgACADNgIcQQAhAyAAKAIEIgFFDQAgACABIAIgACgCCBGBgICAAAAiAUUNACAAIAI2AhQgACABNgIMIAEhAwsgAwvk8wEDDn8DfgR/I4CAgIAAQRBrIgMkgICAgAAgASEEIAEhBSABIQYgASEHIAEhCCABIQkgASEKIAEhCyABIQwgASENIAEhDiABIQ8CQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgACgCHCIQQX9qDt0B2gEB2QECAwQFBgcICQoLDA0O2AEPENcBERLWARMUFRYXGBkaG+AB3wEcHR7VAR8gISIjJCXUASYnKCkqKyzTAdIBLS7RAdABLzAxM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DB4LQacBIRAMHQtBqAEhEAwcC0GpASEQDBsLQaoBIRAMGgtBqwEhEAwZC0GsASEQDBgLQa0BIRAMFwtBrgEhEAwWC0EBIRAMFQtBrwEhEAwUC0GwASEQDBMLQbEBIRAMEgtBswEhEAwRC0GyASEQDBALQbQBIRAMDwtBtQEhEAwOC0G2ASEQDA0LQbcBIRAMDAtBuAEhEAwLC0G5ASEQDAoLQboBIRAMCQtBuwEhEAwIC0HGASEQDAcLQbwBIRAMBgtBvQEhEAwFC0G+ASEQDAQLQb8BIRAMAwtBwAEhEAwCC0HCASEQDAELQcEBIRALA0ACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAA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CAAIAE2AhQgACAQNgIMQQAhEAytAQsgACgCBCEQIABBADYCBAJAIAAgECABEKeAgIAAIhANACABIQEMTQsgAEHlADYCHCAAIAE2AhQgACAQNgIMQQAhEAysAQsgAEEANgIcIAAgATYCFCAAQdyIgIAANgIQIABBBzYCDEEAIRAMqwELIBBBP0cNASABQQFqIQELQQUhEAyQAQtBACEQIABBADYCHCAAIAE2AhQgAEH9koCAADYCECAAQQc2AgwMqAELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDEILIABB0gA2AhwgACABNgIUIAAgEDYCDEEAIRAMpwELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDEILIABB0wA2AhwgACABNgIUIAAgEDYCDEEAIRAMpgELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDEYLIABB5QA2AhwgACABNgIUIAAgEDYCDEEAIRAMpQELIAAoAgQhASAAQQA2AgQCQCAAIAEgFBCngICAACIBDQAgFCEBDD8LIABB0gA2AhwgACAUNgIUIAAgATYCDEEAIRAMpAELIAAoAgQhASAAQQA2AgQCQCAAIAEgFBCngICAACIBDQAgFCEBDD8LIABB0wA2AhwgACAUNgIUIAAgATYCDEEAIRAMowELIAAoAgQhASAAQQA2AgQCQCAAIAEgFBCngICAACIBDQAgFCEBDEMLIABB5QA2AhwgACAUNgIUIAAgATYCDEEAIRAMogELIABBADYCHCAAIBQ2AhQgAEHDj4CAADYCECAAQQc2AgxBACEQDKEBCyAAQQA2AhwgACABNgIUIABBw4+AgAA2AhAgAEEHNgIMQQAhEAygAQtBACEQIABBADYCHCAAIBQ2AhQgAEGMnICAADYCECAAQQc2AgwMnwELIABBADYCHCAAIBQ2AhQgAEGMnICAADYCECAAQQc2AgxBACEQDJ4BCyAAQQA2AhwgACAUNgIUIABB/pGAgAA2AhAgAEEHNgIMQQAhEAydAQsgAEEANgIcIAAgATYCFCAAQY6bgIAANgIQIABBBjYCDEEAIRAMnAELIBBBF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ACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQ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gIcIAAgATYCFCAAQbmNgIAANgIQIABBGjYCDEEAIRAMtAELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDFQLIABB5QA2AhwgACABNgIUIAAgEDYCDEEAIRAMswELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDE0LIABB0gA2AhwgACABNgIUIAAgEDYCDEEAIRAMsgELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDE0LIABB0wA2AhwgACABNgIUIAAgEDYCDEEAIRAMsQELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDFELIABB5QA2AhwgACABNgIUIAAgEDYCDEEAIRAMsAELIABBADYCHCAAIAE2AhQgAEHGioCAADYCECAAQQc2AgxBACEQDK8BCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQp4CAgAAiEA0AIAEhAQxJCyAAQdIANgIcIAAgATYCFCAAIBA2AgxBACEQDK4BCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQp4CAgAAiEA0AIAEhAQxJCyAAQdMANgIcIAAgATYCFCAAIBA2AgxBACEQDK0BCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQp4CAgAAiEA0AIAEhAQxNCyAAQeUANgIcIAAgATYCFCAAIBA2AgxBACEQDKwBCyAAQQA2AhwgACABNgIUIABB3IiAgAA2AhAgAEEHNgIMQQAhEAyrAQsgEEE/Rw0BIAFBAWohAQtBBSEQDJABC0EAIRAgAEEANgIcIAAgATYCFCAAQf2SgIAANgIQIABBBzYCDAyoAQsgACgCBCEQIABBADYCBAJAIAAgECABEKeAgIAAIhANACABIQEMQgsgAEHSADYCHCAAIAE2AhQgACAQNgIMQQAhEAynAQsgACgCBCEQIABBADYCBAJAIAAgECABEKeAgIAAIhANACABIQEMQgsgAEHTADYCHCAAIAE2AhQgACAQNgIMQQAhEAymAQsgACgCBCEQIABBADYCBAJAIAAgECABEKeAgIAAIhANACABIQEMRgsgAEHlADYCHCA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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAEAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAgAAAAACAAAAAAAAAAAAAAAAAAAAAAADAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwAAAAAAAAMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAE5PVU5DRUVDS09VVE5FQ1RFVEVDUklCRUxVU0hFVEVBRFNFQVJDSFJHRUNUSVZJVFlMRU5EQVJWRU9USUZZUFRJT05TQ0hTRUFZU1RBVENIR0VPUkRJUkVDVE9SVFJDSFBBUkFNRVRFUlVSQ0VCU0NSSUJFQVJET1dOQUNFSU5ETktDS1VCU0NSSUJFSFRUUC9BRFRQLw=='
  27999. /***/ }),
  28000. /***/ 1891:
  28001. /***/ ((__unused_webpack_module, exports) => {
  28002. "use strict";
  28003. Object.defineProperty(exports, "__esModule", ({ value: true }));
  28004. exports.enumToMap = void 0;
  28005. function enumToMap(obj) {
  28006. const res = {};
  28007. Object.keys(obj).forEach((key) => {
  28008. const value = obj[key];
  28009. if (typeof value === 'number') {
  28010. res[key] = value;
  28011. }
  28012. });
  28013. return res;
  28014. }
  28015. exports.enumToMap = enumToMap;
  28016. //# sourceMappingURL=utils.js.map
  28017. /***/ }),
  28018. /***/ 6771:
  28019. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  28020. "use strict";
  28021. const { kClients } = __nccwpck_require__(2785)
  28022. const Agent = __nccwpck_require__(7890)
  28023. const {
  28024. kAgent,
  28025. kMockAgentSet,
  28026. kMockAgentGet,
  28027. kDispatches,
  28028. kIsMockActive,
  28029. kNetConnect,
  28030. kGetNetConnect,
  28031. kOptions,
  28032. kFactory
  28033. } = __nccwpck_require__(4347)
  28034. const MockClient = __nccwpck_require__(8687)
  28035. const MockPool = __nccwpck_require__(6193)
  28036. const { matchValue, buildMockOptions } = __nccwpck_require__(9323)
  28037. const { InvalidArgumentError, UndiciError } = __nccwpck_require__(8045)
  28038. const Dispatcher = __nccwpck_require__(412)
  28039. const Pluralizer = __nccwpck_require__(8891)
  28040. const PendingInterceptorsFormatter = __nccwpck_require__(6823)
  28041. class FakeWeakRef {
  28042. constructor (value) {
  28043. this.value = value
  28044. }
  28045. deref () {
  28046. return this.value
  28047. }
  28048. }
  28049. class MockAgent extends Dispatcher {
  28050. constructor (opts) {
  28051. super(opts)
  28052. this[kNetConnect] = true
  28053. this[kIsMockActive] = true
  28054. // Instantiate Agent and encapsulate
  28055. if ((opts && opts.agent && typeof opts.agent.dispatch !== 'function')) {
  28056. throw new InvalidArgumentError('Argument opts.agent must implement Agent')
  28057. }
  28058. const agent = opts && opts.agent ? opts.agent : new Agent(opts)
  28059. this[kAgent] = agent
  28060. this[kClients] = agent[kClients]
  28061. this[kOptions] = buildMockOptions(opts)
  28062. }
  28063. get (origin) {
  28064. let dispatcher = this[kMockAgentGet](origin)
  28065. if (!dispatcher) {
  28066. dispatcher = this[kFactory](origin)
  28067. this[kMockAgentSet](origin, dispatcher)
  28068. }
  28069. return dispatcher
  28070. }
  28071. dispatch (opts, handler) {
  28072. // Call MockAgent.get to perform additional setup before dispatching as normal
  28073. this.get(opts.origin)
  28074. return this[kAgent].dispatch(opts, handler)
  28075. }
  28076. async close () {
  28077. await this[kAgent].close()
  28078. this[kClients].clear()
  28079. }
  28080. deactivate () {
  28081. this[kIsMockActive] = false
  28082. }
  28083. activate () {
  28084. this[kIsMockActive] = true
  28085. }
  28086. enableNetConnect (matcher) {
  28087. if (typeof matcher === 'string' || typeof matcher === 'function' || matcher instanceof RegExp) {
  28088. if (Array.isArray(this[kNetConnect])) {
  28089. this[kNetConnect].push(matcher)
  28090. } else {
  28091. this[kNetConnect] = [matcher]
  28092. }
  28093. } else if (typeof matcher === 'undefined') {
  28094. this[kNetConnect] = true
  28095. } else {
  28096. throw new InvalidArgumentError('Unsupported matcher. Must be one of String|Function|RegExp.')
  28097. }
  28098. }
  28099. disableNetConnect () {
  28100. this[kNetConnect] = false
  28101. }
  28102. // This is required to bypass issues caused by using global symbols - see:
  28103. // https://github.com/nodejs/undici/issues/1447
  28104. get isMockActive () {
  28105. return this[kIsMockActive]
  28106. }
  28107. [kMockAgentSet] (origin, dispatcher) {
  28108. this[kClients].set(origin, new FakeWeakRef(dispatcher))
  28109. }
  28110. [kFactory] (origin) {
  28111. const mockOptions = Object.assign({ agent: this }, this[kOptions])
  28112. return this[kOptions] && this[kOptions].connections === 1
  28113. ? new MockClient(origin, mockOptions)
  28114. : new MockPool(origin, mockOptions)
  28115. }
  28116. [kMockAgentGet] (origin) {
  28117. // First check if we can immediately find it
  28118. const ref = this[kClients].get(origin)
  28119. if (ref) {
  28120. return ref.deref()
  28121. }
  28122. // If the origin is not a string create a dummy parent pool and return to user
  28123. if (typeof origin !== 'string') {
  28124. const dispatcher = this[kFactory]('http://localhost:9999')
  28125. this[kMockAgentSet](origin, dispatcher)
  28126. return dispatcher
  28127. }
  28128. // If we match, create a pool and assign the same dispatches
  28129. for (const [keyMatcher, nonExplicitRef] of Array.from(this[kClients])) {
  28130. const nonExplicitDispatcher = nonExplicitRef.deref()
  28131. if (nonExplicitDispatcher && typeof keyMatcher !== 'string' && matchValue(keyMatcher, origin)) {
  28132. const dispatcher = this[kFactory](origin)
  28133. this[kMockAgentSet](origin, dispatcher)
  28134. dispatcher[kDispatches] = nonExplicitDispatcher[kDispatches]
  28135. return dispatcher
  28136. }
  28137. }
  28138. }
  28139. [kGetNetConnect] () {
  28140. return this[kNetConnect]
  28141. }
  28142. pendingInterceptors () {
  28143. const mockAgentClients = this[kClients]
  28144. return Array.from(mockAgentClients.entries())
  28145. .flatMap(([origin, scope]) => scope.deref()[kDispatches].map(dispatch => ({ ...dispatch, origin })))
  28146. .filter(({ pending }) => pending)
  28147. }
  28148. assertNoPendingInterceptors ({ pendingInterceptorsFormatter = new PendingInterceptorsFormatter() } = {}) {
  28149. const pending = this.pendingInterceptors()
  28150. if (pending.length === 0) {
  28151. return
  28152. }
  28153. const pluralizer = new Pluralizer('interceptor', 'interceptors').pluralize(pending.length)
  28154. throw new UndiciError(`
  28155. ${pluralizer.count} ${pluralizer.noun} ${pluralizer.is} pending:
  28156. ${pendingInterceptorsFormatter.format(pending)}
  28157. `.trim())
  28158. }
  28159. }
  28160. module.exports = MockAgent
  28161. /***/ }),
  28162. /***/ 8687:
  28163. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  28164. "use strict";
  28165. const { promisify } = __nccwpck_require__(3837)
  28166. const Client = __nccwpck_require__(3598)
  28167. const { buildMockDispatch } = __nccwpck_require__(9323)
  28168. const {
  28169. kDispatches,
  28170. kMockAgent,
  28171. kClose,
  28172. kOriginalClose,
  28173. kOrigin,
  28174. kOriginalDispatch,
  28175. kConnected
  28176. } = __nccwpck_require__(4347)
  28177. const { MockInterceptor } = __nccwpck_require__(410)
  28178. const Symbols = __nccwpck_require__(2785)
  28179. const { InvalidArgumentError } = __nccwpck_require__(8045)
  28180. /**
  28181. * MockClient provides an API that extends the Client to influence the mockDispatches.
  28182. */
  28183. class MockClient extends Client {
  28184. constructor (origin, opts) {
  28185. super(origin, opts)
  28186. if (!opts || !opts.agent || typeof opts.agent.dispatch !== 'function') {
  28187. throw new InvalidArgumentError('Argument opts.agent must implement Agent')
  28188. }
  28189. this[kMockAgent] = opts.agent
  28190. this[kOrigin] = origin
  28191. this[kDispatches] = []
  28192. this[kConnected] = 1
  28193. this[kOriginalDispatch] = this.dispatch
  28194. this[kOriginalClose] = this.close.bind(this)
  28195. this.dispatch = buildMockDispatch.call(this)
  28196. this.close = this[kClose]
  28197. }
  28198. get [Symbols.kConnected] () {
  28199. return this[kConnected]
  28200. }
  28201. /**
  28202. * Sets up the base interceptor for mocking replies from undici.
  28203. */
  28204. intercept (opts) {
  28205. return new MockInterceptor(opts, this[kDispatches])
  28206. }
  28207. async [kClose] () {
  28208. await promisify(this[kOriginalClose])()
  28209. this[kConnected] = 0
  28210. this[kMockAgent][Symbols.kClients].delete(this[kOrigin])
  28211. }
  28212. }
  28213. module.exports = MockClient
  28214. /***/ }),
  28215. /***/ 888:
  28216. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  28217. "use strict";
  28218. const { UndiciError } = __nccwpck_require__(8045)
  28219. class MockNotMatchedError extends UndiciError {
  28220. constructor (message) {
  28221. super(message)
  28222. Error.captureStackTrace(this, MockNotMatchedError)
  28223. this.name = 'MockNotMatchedError'
  28224. this.message = message || 'The request does not match any registered mock dispatches'
  28225. this.code = 'UND_MOCK_ERR_MOCK_NOT_MATCHED'
  28226. }
  28227. }
  28228. module.exports = {
  28229. MockNotMatchedError
  28230. }
  28231. /***/ }),
  28232. /***/ 410:
  28233. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  28234. "use strict";
  28235. const { getResponseData, buildKey, addMockDispatch } = __nccwpck_require__(9323)
  28236. const {
  28237. kDispatches,
  28238. kDispatchKey,
  28239. kDefaultHeaders,
  28240. kDefaultTrailers,
  28241. kContentLength,
  28242. kMockDispatch
  28243. } = __nccwpck_require__(4347)
  28244. const { InvalidArgumentError } = __nccwpck_require__(8045)
  28245. const { buildURL } = __nccwpck_require__(3983)
  28246. /**
  28247. * Defines the scope API for an interceptor reply
  28248. */
  28249. class MockScope {
  28250. constructor (mockDispatch) {
  28251. this[kMockDispatch] = mockDispatch
  28252. }
  28253. /**
  28254. * Delay a reply by a set amount in ms.
  28255. */
  28256. delay (waitInMs) {
  28257. if (typeof waitInMs !== 'number' || !Number.isInteger(waitInMs) || waitInMs <= 0) {
  28258. throw new InvalidArgumentError('waitInMs must be a valid integer > 0')
  28259. }
  28260. this[kMockDispatch].delay = waitInMs
  28261. return this
  28262. }
  28263. /**
  28264. * For a defined reply, never mark as consumed.
  28265. */
  28266. persist () {
  28267. this[kMockDispatch].persist = true
  28268. return this
  28269. }
  28270. /**
  28271. * Allow one to define a reply for a set amount of matching requests.
  28272. */
  28273. times (repeatTimes) {
  28274. if (typeof repeatTimes !== 'number' || !Number.isInteger(repeatTimes) || repeatTimes <= 0) {
  28275. throw new InvalidArgumentError('repeatTimes must be a valid integer > 0')
  28276. }
  28277. this[kMockDispatch].times = repeatTimes
  28278. return this
  28279. }
  28280. }
  28281. /**
  28282. * Defines an interceptor for a Mock
  28283. */
  28284. class MockInterceptor {
  28285. constructor (opts, mockDispatches) {
  28286. if (typeof opts !== 'object') {
  28287. throw new InvalidArgumentError('opts must be an object')
  28288. }
  28289. if (typeof opts.path === 'undefined') {
  28290. throw new InvalidArgumentError('opts.path must be defined')
  28291. }
  28292. if (typeof opts.method === 'undefined') {
  28293. opts.method = 'GET'
  28294. }
  28295. // See https://github.com/nodejs/undici/issues/1245
  28296. // As per RFC 3986, clients are not supposed to send URI
  28297. // fragments to servers when they retrieve a document,
  28298. if (typeof opts.path === 'string') {
  28299. if (opts.query) {
  28300. opts.path = buildURL(opts.path, opts.query)
  28301. } else {
  28302. // Matches https://github.com/nodejs/undici/blob/main/lib/fetch/index.js#L1811
  28303. const parsedURL = new URL(opts.path, 'data://')
  28304. opts.path = parsedURL.pathname + parsedURL.search
  28305. }
  28306. }
  28307. if (typeof opts.method === 'string') {
  28308. opts.method = opts.method.toUpperCase()
  28309. }
  28310. this[kDispatchKey] = buildKey(opts)
  28311. this[kDispatches] = mockDispatches
  28312. this[kDefaultHeaders] = {}
  28313. this[kDefaultTrailers] = {}
  28314. this[kContentLength] = false
  28315. }
  28316. createMockScopeDispatchData (statusCode, data, responseOptions = {}) {
  28317. const responseData = getResponseData(data)
  28318. const contentLength = this[kContentLength] ? { 'content-length': responseData.length } : {}
  28319. const headers = { ...this[kDefaultHeaders], ...contentLength, ...responseOptions.headers }
  28320. const trailers = { ...this[kDefaultTrailers], ...responseOptions.trailers }
  28321. return { statusCode, data, headers, trailers }
  28322. }
  28323. validateReplyParameters (statusCode, data, responseOptions) {
  28324. if (typeof statusCode === 'undefined') {
  28325. throw new InvalidArgumentError('statusCode must be defined')
  28326. }
  28327. if (typeof data === 'undefined') {
  28328. throw new InvalidArgumentError('data must be defined')
  28329. }
  28330. if (typeof responseOptions !== 'object') {
  28331. throw new InvalidArgumentError('responseOptions must be an object')
  28332. }
  28333. }
  28334. /**
  28335. * Mock an undici request with a defined reply.
  28336. */
  28337. reply (replyData) {
  28338. // Values of reply aren't available right now as they
  28339. // can only be available when the reply callback is invoked.
  28340. if (typeof replyData === 'function') {
  28341. // We'll first wrap the provided callback in another function,
  28342. // this function will properly resolve the data from the callback
  28343. // when invoked.
  28344. const wrappedDefaultsCallback = (opts) => {
  28345. // Our reply options callback contains the parameter for statusCode, data and options.
  28346. const resolvedData = replyData(opts)
  28347. // Check if it is in the right format
  28348. if (typeof resolvedData !== 'object') {
  28349. throw new InvalidArgumentError('reply options callback must return an object')
  28350. }
  28351. const { statusCode, data = '', responseOptions = {} } = resolvedData
  28352. this.validateReplyParameters(statusCode, data, responseOptions)
  28353. // Since the values can be obtained immediately we return them
  28354. // from this higher order function that will be resolved later.
  28355. return {
  28356. ...this.createMockScopeDispatchData(statusCode, data, responseOptions)
  28357. }
  28358. }
  28359. // Add usual dispatch data, but this time set the data parameter to function that will eventually provide data.
  28360. const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], wrappedDefaultsCallback)
  28361. return new MockScope(newMockDispatch)
  28362. }
  28363. // We can have either one or three parameters, if we get here,
  28364. // we should have 1-3 parameters. So we spread the arguments of
  28365. // this function to obtain the parameters, since replyData will always
  28366. // just be the statusCode.
  28367. const [statusCode, data = '', responseOptions = {}] = [...arguments]
  28368. this.validateReplyParameters(statusCode, data, responseOptions)
  28369. // Send in-already provided data like usual
  28370. const dispatchData = this.createMockScopeDispatchData(statusCode, data, responseOptions)
  28371. const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], dispatchData)
  28372. return new MockScope(newMockDispatch)
  28373. }
  28374. /**
  28375. * Mock an undici request with a defined error.
  28376. */
  28377. replyWithError (error) {
  28378. if (typeof error === 'undefined') {
  28379. throw new InvalidArgumentError('error must be defined')
  28380. }
  28381. const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], { error })
  28382. return new MockScope(newMockDispatch)
  28383. }
  28384. /**
  28385. * Set default reply headers on the interceptor for subsequent replies
  28386. */
  28387. defaultReplyHeaders (headers) {
  28388. if (typeof headers === 'undefined') {
  28389. throw new InvalidArgumentError('headers must be defined')
  28390. }
  28391. this[kDefaultHeaders] = headers
  28392. return this
  28393. }
  28394. /**
  28395. * Set default reply trailers on the interceptor for subsequent replies
  28396. */
  28397. defaultReplyTrailers (trailers) {
  28398. if (typeof trailers === 'undefined') {
  28399. throw new InvalidArgumentError('trailers must be defined')
  28400. }
  28401. this[kDefaultTrailers] = trailers
  28402. return this
  28403. }
  28404. /**
  28405. * Set reply content length header for replies on the interceptor
  28406. */
  28407. replyContentLength () {
  28408. this[kContentLength] = true
  28409. return this
  28410. }
  28411. }
  28412. module.exports.MockInterceptor = MockInterceptor
  28413. module.exports.MockScope = MockScope
  28414. /***/ }),
  28415. /***/ 6193:
  28416. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  28417. "use strict";
  28418. const { promisify } = __nccwpck_require__(3837)
  28419. const Pool = __nccwpck_require__(4634)
  28420. const { buildMockDispatch } = __nccwpck_require__(9323)
  28421. const {
  28422. kDispatches,
  28423. kMockAgent,
  28424. kClose,
  28425. kOriginalClose,
  28426. kOrigin,
  28427. kOriginalDispatch,
  28428. kConnected
  28429. } = __nccwpck_require__(4347)
  28430. const { MockInterceptor } = __nccwpck_require__(410)
  28431. const Symbols = __nccwpck_require__(2785)
  28432. const { InvalidArgumentError } = __nccwpck_require__(8045)
  28433. /**
  28434. * MockPool provides an API that extends the Pool to influence the mockDispatches.
  28435. */
  28436. class MockPool extends Pool {
  28437. constructor (origin, opts) {
  28438. super(origin, opts)
  28439. if (!opts || !opts.agent || typeof opts.agent.dispatch !== 'function') {
  28440. throw new InvalidArgumentError('Argument opts.agent must implement Agent')
  28441. }
  28442. this[kMockAgent] = opts.agent
  28443. this[kOrigin] = origin
  28444. this[kDispatches] = []
  28445. this[kConnected] = 1
  28446. this[kOriginalDispatch] = this.dispatch
  28447. this[kOriginalClose] = this.close.bind(this)
  28448. this.dispatch = buildMockDispatch.call(this)
  28449. this.close = this[kClose]
  28450. }
  28451. get [Symbols.kConnected] () {
  28452. return this[kConnected]
  28453. }
  28454. /**
  28455. * Sets up the base interceptor for mocking replies from undici.
  28456. */
  28457. intercept (opts) {
  28458. return new MockInterceptor(opts, this[kDispatches])
  28459. }
  28460. async [kClose] () {
  28461. await promisify(this[kOriginalClose])()
  28462. this[kConnected] = 0
  28463. this[kMockAgent][Symbols.kClients].delete(this[kOrigin])
  28464. }
  28465. }
  28466. module.exports = MockPool
  28467. /***/ }),
  28468. /***/ 4347:
  28469. /***/ ((module) => {
  28470. "use strict";
  28471. module.exports = {
  28472. kAgent: Symbol('agent'),
  28473. kOptions: Symbol('options'),
  28474. kFactory: Symbol('factory'),
  28475. kDispatches: Symbol('dispatches'),
  28476. kDispatchKey: Symbol('dispatch key'),
  28477. kDefaultHeaders: Symbol('default headers'),
  28478. kDefaultTrailers: Symbol('default trailers'),
  28479. kContentLength: Symbol('content length'),
  28480. kMockAgent: Symbol('mock agent'),
  28481. kMockAgentSet: Symbol('mock agent set'),
  28482. kMockAgentGet: Symbol('mock agent get'),
  28483. kMockDispatch: Symbol('mock dispatch'),
  28484. kClose: Symbol('close'),
  28485. kOriginalClose: Symbol('original agent close'),
  28486. kOrigin: Symbol('origin'),
  28487. kIsMockActive: Symbol('is mock active'),
  28488. kNetConnect: Symbol('net connect'),
  28489. kGetNetConnect: Symbol('get net connect'),
  28490. kConnected: Symbol('connected')
  28491. }
  28492. /***/ }),
  28493. /***/ 9323:
  28494. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  28495. "use strict";
  28496. const { MockNotMatchedError } = __nccwpck_require__(888)
  28497. const {
  28498. kDispatches,
  28499. kMockAgent,
  28500. kOriginalDispatch,
  28501. kOrigin,
  28502. kGetNetConnect
  28503. } = __nccwpck_require__(4347)
  28504. const { buildURL, nop } = __nccwpck_require__(3983)
  28505. const { STATUS_CODES } = __nccwpck_require__(3685)
  28506. const {
  28507. types: {
  28508. isPromise
  28509. }
  28510. } = __nccwpck_require__(3837)
  28511. function matchValue (match, value) {
  28512. if (typeof match === 'string') {
  28513. return match === value
  28514. }
  28515. if (match instanceof RegExp) {
  28516. return match.test(value)
  28517. }
  28518. if (typeof match === 'function') {
  28519. return match(value) === true
  28520. }
  28521. return false
  28522. }
  28523. function lowerCaseEntries (headers) {
  28524. return Object.fromEntries(
  28525. Object.entries(headers).map(([headerName, headerValue]) => {
  28526. return [headerName.toLocaleLowerCase(), headerValue]
  28527. })
  28528. )
  28529. }
  28530. /**
  28531. * @param {import('../../index').Headers|string[]|Record<string, string>} headers
  28532. * @param {string} key
  28533. */
  28534. function getHeaderByName (headers, key) {
  28535. if (Array.isArray(headers)) {
  28536. for (let i = 0; i < headers.length; i += 2) {
  28537. if (headers[i].toLocaleLowerCase() === key.toLocaleLowerCase()) {
  28538. return headers[i + 1]
  28539. }
  28540. }
  28541. return undefined
  28542. } else if (typeof headers.get === 'function') {
  28543. return headers.get(key)
  28544. } else {
  28545. return lowerCaseEntries(headers)[key.toLocaleLowerCase()]
  28546. }
  28547. }
  28548. /** @param {string[]} headers */
  28549. function buildHeadersFromArray (headers) { // fetch HeadersList
  28550. const clone = headers.slice()
  28551. const entries = []
  28552. for (let index = 0; index < clone.length; index += 2) {
  28553. entries.push([clone[index], clone[index + 1]])
  28554. }
  28555. return Object.fromEntries(entries)
  28556. }
  28557. function matchHeaders (mockDispatch, headers) {
  28558. if (typeof mockDispatch.headers === 'function') {
  28559. if (Array.isArray(headers)) { // fetch HeadersList
  28560. headers = buildHeadersFromArray(headers)
  28561. }
  28562. return mockDispatch.headers(headers ? lowerCaseEntries(headers) : {})
  28563. }
  28564. if (typeof mockDispatch.headers === 'undefined') {
  28565. return true
  28566. }
  28567. if (typeof headers !== 'object' || typeof mockDispatch.headers !== 'object') {
  28568. return false
  28569. }
  28570. for (const [matchHeaderName, matchHeaderValue] of Object.entries(mockDispatch.headers)) {
  28571. const headerValue = getHeaderByName(headers, matchHeaderName)
  28572. if (!matchValue(matchHeaderValue, headerValue)) {
  28573. return false
  28574. }
  28575. }
  28576. return true
  28577. }
  28578. function safeUrl (path) {
  28579. if (typeof path !== 'string') {
  28580. return path
  28581. }
  28582. const pathSegments = path.split('?')
  28583. if (pathSegments.length !== 2) {
  28584. return path
  28585. }
  28586. const qp = new URLSearchParams(pathSegments.pop())
  28587. qp.sort()
  28588. return [...pathSegments, qp.toString()].join('?')
  28589. }
  28590. function matchKey (mockDispatch, { path, method, body, headers }) {
  28591. const pathMatch = matchValue(mockDispatch.path, path)
  28592. const methodMatch = matchValue(mockDispatch.method, method)
  28593. const bodyMatch = typeof mockDispatch.body !== 'undefined' ? matchValue(mockDispatch.body, body) : true
  28594. const headersMatch = matchHeaders(mockDispatch, headers)
  28595. return pathMatch && methodMatch && bodyMatch && headersMatch
  28596. }
  28597. function getResponseData (data) {
  28598. if (Buffer.isBuffer(data)) {
  28599. return data
  28600. } else if (typeof data === 'object') {
  28601. return JSON.stringify(data)
  28602. } else {
  28603. return data.toString()
  28604. }
  28605. }
  28606. function getMockDispatch (mockDispatches, key) {
  28607. const basePath = key.query ? buildURL(key.path, key.query) : key.path
  28608. const resolvedPath = typeof basePath === 'string' ? safeUrl(basePath) : basePath
  28609. // Match path
  28610. let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path }) => matchValue(safeUrl(path), resolvedPath))
  28611. if (matchedMockDispatches.length === 0) {
  28612. throw new MockNotMatchedError(`Mock dispatch not matched for path '${resolvedPath}'`)
  28613. }
  28614. // Match method
  28615. matchedMockDispatches = matchedMockDispatches.filter(({ method }) => matchValue(method, key.method))
  28616. if (matchedMockDispatches.length === 0) {
  28617. throw new MockNotMatchedError(`Mock dispatch not matched for method '${key.method}'`)
  28618. }
  28619. // Match body
  28620. matchedMockDispatches = matchedMockDispatches.filter(({ body }) => typeof body !== 'undefined' ? matchValue(body, key.body) : true)
  28621. if (matchedMockDispatches.length === 0) {
  28622. throw new MockNotMatchedError(`Mock dispatch not matched for body '${key.body}'`)
  28623. }
  28624. // Match headers
  28625. matchedMockDispatches = matchedMockDispatches.filter((mockDispatch) => matchHeaders(mockDispatch, key.headers))
  28626. if (matchedMockDispatches.length === 0) {
  28627. throw new MockNotMatchedError(`Mock dispatch not matched for headers '${typeof key.headers === 'object' ? JSON.stringify(key.headers) : key.headers}'`)
  28628. }
  28629. return matchedMockDispatches[0]
  28630. }
  28631. function addMockDispatch (mockDispatches, key, data) {
  28632. const baseData = { timesInvoked: 0, times: 1, persist: false, consumed: false }
  28633. const replyData = typeof data === 'function' ? { callback: data } : { ...data }
  28634. const newMockDispatch = { ...baseData, ...key, pending: true, data: { error: null, ...replyData } }
  28635. mockDispatches.push(newMockDispatch)
  28636. return newMockDispatch
  28637. }
  28638. function deleteMockDispatch (mockDispatches, key) {
  28639. const index = mockDispatches.findIndex(dispatch => {
  28640. if (!dispatch.consumed) {
  28641. return false
  28642. }
  28643. return matchKey(dispatch, key)
  28644. })
  28645. if (index !== -1) {
  28646. mockDispatches.splice(index, 1)
  28647. }
  28648. }
  28649. function buildKey (opts) {
  28650. const { path, method, body, headers, query } = opts
  28651. return {
  28652. path,
  28653. method,
  28654. body,
  28655. headers,
  28656. query
  28657. }
  28658. }
  28659. function generateKeyValues (data) {
  28660. return Object.entries(data).reduce((keyValuePairs, [key, value]) => [
  28661. ...keyValuePairs,
  28662. Buffer.from(`${key}`),
  28663. Array.isArray(value) ? value.map(x => Buffer.from(`${x}`)) : Buffer.from(`${value}`)
  28664. ], [])
  28665. }
  28666. /**
  28667. * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Status
  28668. * @param {number} statusCode
  28669. */
  28670. function getStatusText (statusCode) {
  28671. return STATUS_CODES[statusCode] || 'unknown'
  28672. }
  28673. async function getResponse (body) {
  28674. const buffers = []
  28675. for await (const data of body) {
  28676. buffers.push(data)
  28677. }
  28678. return Buffer.concat(buffers).toString('utf8')
  28679. }
  28680. /**
  28681. * Mock dispatch function used to simulate undici dispatches
  28682. */
  28683. function mockDispatch (opts, handler) {
  28684. // Get mock dispatch from built key
  28685. const key = buildKey(opts)
  28686. const mockDispatch = getMockDispatch(this[kDispatches], key)
  28687. mockDispatch.timesInvoked++
  28688. // Here's where we resolve a callback if a callback is present for the dispatch data.
  28689. if (mockDispatch.data.callback) {
  28690. mockDispatch.data = { ...mockDispatch.data, ...mockDispatch.data.callback(opts) }
  28691. }
  28692. // Parse mockDispatch data
  28693. const { data: { statusCode, data, headers, trailers, error }, delay, persist } = mockDispatch
  28694. const { timesInvoked, times } = mockDispatch
  28695. // If it's used up and not persistent, mark as consumed
  28696. mockDispatch.consumed = !persist && timesInvoked >= times
  28697. mockDispatch.pending = timesInvoked < times
  28698. // If specified, trigger dispatch error
  28699. if (error !== null) {
  28700. deleteMockDispatch(this[kDispatches], key)
  28701. handler.onError(error)
  28702. return true
  28703. }
  28704. // Handle the request with a delay if necessary
  28705. if (typeof delay === 'number' && delay > 0) {
  28706. setTimeout(() => {
  28707. handleReply(this[kDispatches])
  28708. }, delay)
  28709. } else {
  28710. handleReply(this[kDispatches])
  28711. }
  28712. function handleReply (mockDispatches, _data = data) {
  28713. // fetch's HeadersList is a 1D string array
  28714. const optsHeaders = Array.isArray(opts.headers)
  28715. ? buildHeadersFromArray(opts.headers)
  28716. : opts.headers
  28717. const body = typeof _data === 'function'
  28718. ? _data({ ...opts, headers: optsHeaders })
  28719. : _data
  28720. // util.types.isPromise is likely needed for jest.
  28721. if (isPromise(body)) {
  28722. // If handleReply is asynchronous, throwing an error
  28723. // in the callback will reject the promise, rather than
  28724. // synchronously throw the error, which breaks some tests.
  28725. // Rather, we wait for the callback to resolve if it is a
  28726. // promise, and then re-run handleReply with the new body.
  28727. body.then((newData) => handleReply(mockDispatches, newData))
  28728. return
  28729. }
  28730. const responseData = getResponseData(body)
  28731. const responseHeaders = generateKeyValues(headers)
  28732. const responseTrailers = generateKeyValues(trailers)
  28733. handler.abort = nop
  28734. handler.onHeaders(statusCode, responseHeaders, resume, getStatusText(statusCode))
  28735. handler.onData(Buffer.from(responseData))
  28736. handler.onComplete(responseTrailers)
  28737. deleteMockDispatch(mockDispatches, key)
  28738. }
  28739. function resume () {}
  28740. return true
  28741. }
  28742. function buildMockDispatch () {
  28743. const agent = this[kMockAgent]
  28744. const origin = this[kOrigin]
  28745. const originalDispatch = this[kOriginalDispatch]
  28746. return function dispatch (opts, handler) {
  28747. if (agent.isMockActive) {
  28748. try {
  28749. mockDispatch.call(this, opts, handler)
  28750. } catch (error) {
  28751. if (error instanceof MockNotMatchedError) {
  28752. const netConnect = agent[kGetNetConnect]()
  28753. if (netConnect === false) {
  28754. throw new MockNotMatchedError(`${error.message}: subsequent request to origin ${origin} was not allowed (net.connect disabled)`)
  28755. }
  28756. if (checkNetConnect(netConnect, origin)) {
  28757. originalDispatch.call(this, opts, handler)
  28758. } else {
  28759. throw new MockNotMatchedError(`${error.message}: subsequent request to origin ${origin} was not allowed (net.connect is not enabled for this origin)`)
  28760. }
  28761. } else {
  28762. throw error
  28763. }
  28764. }
  28765. } else {
  28766. originalDispatch.call(this, opts, handler)
  28767. }
  28768. }
  28769. }
  28770. function checkNetConnect (netConnect, origin) {
  28771. const url = new URL(origin)
  28772. if (netConnect === true) {
  28773. return true
  28774. } else if (Array.isArray(netConnect) && netConnect.some((matcher) => matchValue(matcher, url.host))) {
  28775. return true
  28776. }
  28777. return false
  28778. }
  28779. function buildMockOptions (opts) {
  28780. if (opts) {
  28781. const { agent, ...mockOptions } = opts
  28782. return mockOptions
  28783. }
  28784. }
  28785. module.exports = {
  28786. getResponseData,
  28787. getMockDispatch,
  28788. addMockDispatch,
  28789. deleteMockDispatch,
  28790. buildKey,
  28791. generateKeyValues,
  28792. matchValue,
  28793. getResponse,
  28794. getStatusText,
  28795. mockDispatch,
  28796. buildMockDispatch,
  28797. checkNetConnect,
  28798. buildMockOptions,
  28799. getHeaderByName
  28800. }
  28801. /***/ }),
  28802. /***/ 6823:
  28803. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  28804. "use strict";
  28805. const { Transform } = __nccwpck_require__(2781)
  28806. const { Console } = __nccwpck_require__(6206)
  28807. /**
  28808. * Gets the output of `console.table(…)` as a string.
  28809. */
  28810. module.exports = class PendingInterceptorsFormatter {
  28811. constructor ({ disableColors } = {}) {
  28812. this.transform = new Transform({
  28813. transform (chunk, _enc, cb) {
  28814. cb(null, chunk)
  28815. }
  28816. })
  28817. this.logger = new Console({
  28818. stdout: this.transform,
  28819. inspectOptions: {
  28820. colors: !disableColors && !process.env.CI
  28821. }
  28822. })
  28823. }
  28824. format (pendingInterceptors) {
  28825. const withPrettyHeaders = pendingInterceptors.map(
  28826. ({ method, path, data: { statusCode }, persist, times, timesInvoked, origin }) => ({
  28827. Method: method,
  28828. Origin: origin,
  28829. Path: path,
  28830. 'Status code': statusCode,
  28831. Persistent: persist ? '✅' : '❌',
  28832. Invocations: timesInvoked,
  28833. Remaining: persist ? Infinity : times - timesInvoked
  28834. }))
  28835. this.logger.table(withPrettyHeaders)
  28836. return this.transform.read().toString()
  28837. }
  28838. }
  28839. /***/ }),
  28840. /***/ 8891:
  28841. /***/ ((module) => {
  28842. "use strict";
  28843. const singulars = {
  28844. pronoun: 'it',
  28845. is: 'is',
  28846. was: 'was',
  28847. this: 'this'
  28848. }
  28849. const plurals = {
  28850. pronoun: 'they',
  28851. is: 'are',
  28852. was: 'were',
  28853. this: 'these'
  28854. }
  28855. module.exports = class Pluralizer {
  28856. constructor (singular, plural) {
  28857. this.singular = singular
  28858. this.plural = plural
  28859. }
  28860. pluralize (count) {
  28861. const one = count === 1
  28862. const keys = one ? singulars : plurals
  28863. const noun = one ? this.singular : this.plural
  28864. return { ...keys, count, noun }
  28865. }
  28866. }
  28867. /***/ }),
  28868. /***/ 8266:
  28869. /***/ ((module) => {
  28870. "use strict";
  28871. /* eslint-disable */
  28872. // Extracted from node/lib/internal/fixed_queue.js
  28873. // Currently optimal queue size, tested on V8 6.0 - 6.6. Must be power of two.
  28874. const kSize = 2048;
  28875. const kMask = kSize - 1;
  28876. // The FixedQueue is implemented as a singly-linked list of fixed-size
  28877. // circular buffers. It looks something like this:
  28878. //
  28879. // head tail
  28880. // | |
  28881. // v v
  28882. // +-----------+ <-----\ +-----------+ <------\ +-----------+
  28883. // | [null] | \----- | next | \------- | next |
  28884. // +-----------+ +-----------+ +-----------+
  28885. // | item | <-- bottom | item | <-- bottom | [empty] |
  28886. // | item | | item | | [empty] |
  28887. // | item | | item | | [empty] |
  28888. // | item | | item | | [empty] |
  28889. // | item | | item | bottom --> | item |
  28890. // | item | | item | | item |
  28891. // | ... | | ... | | ... |
  28892. // | item | | item | | item |
  28893. // | item | | item | | item |
  28894. // | [empty] | <-- top | item | | item |
  28895. // | [empty] | | item | | item |
  28896. // | [empty] | | [empty] | <-- top top --> | [empty] |
  28897. // +-----------+ +-----------+ +-----------+
  28898. //
  28899. // Or, if there is only one circular buffer, it looks something
  28900. // like either of these:
  28901. //
  28902. // head tail head tail
  28903. // | | | |
  28904. // v v v v
  28905. // +-----------+ +-----------+
  28906. // | [null] | | [null] |
  28907. // +-----------+ +-----------+
  28908. // | [empty] | | item |
  28909. // | [empty] | | item |
  28910. // | item | <-- bottom top --> | [empty] |
  28911. // | item | | [empty] |
  28912. // | [empty] | <-- top bottom --> | item |
  28913. // | [empty] | | item |
  28914. // +-----------+ +-----------+
  28915. //
  28916. // Adding a value means moving `top` forward by one, removing means
  28917. // moving `bottom` forward by one. After reaching the end, the queue
  28918. // wraps around.
  28919. //
  28920. // When `top === bottom` the current queue is empty and when
  28921. // `top + 1 === bottom` it's full. This wastes a single space of storage
  28922. // but allows much quicker checks.
  28923. class FixedCircularBuffer {
  28924. constructor() {
  28925. this.bottom = 0;
  28926. this.top = 0;
  28927. this.list = new Array(kSize);
  28928. this.next = null;
  28929. }
  28930. isEmpty() {
  28931. return this.top === this.bottom;
  28932. }
  28933. isFull() {
  28934. return ((this.top + 1) & kMask) === this.bottom;
  28935. }
  28936. push(data) {
  28937. this.list[this.top] = data;
  28938. this.top = (this.top + 1) & kMask;
  28939. }
  28940. shift() {
  28941. const nextItem = this.list[this.bottom];
  28942. if (nextItem === undefined)
  28943. return null;
  28944. this.list[this.bottom] = undefined;
  28945. this.bottom = (this.bottom + 1) & kMask;
  28946. return nextItem;
  28947. }
  28948. }
  28949. module.exports = class FixedQueue {
  28950. constructor() {
  28951. this.head = this.tail = new FixedCircularBuffer();
  28952. }
  28953. isEmpty() {
  28954. return this.head.isEmpty();
  28955. }
  28956. push(data) {
  28957. if (this.head.isFull()) {
  28958. // Head is full: Creates a new queue, sets the old queue's `.next` to it,
  28959. // and sets it as the new main queue.
  28960. this.head = this.head.next = new FixedCircularBuffer();
  28961. }
  28962. this.head.push(data);
  28963. }
  28964. shift() {
  28965. const tail = this.tail;
  28966. const next = tail.shift();
  28967. if (tail.isEmpty() && tail.next !== null) {
  28968. // If there is another queue, it forms the new tail.
  28969. this.tail = tail.next;
  28970. }
  28971. return next;
  28972. }
  28973. };
  28974. /***/ }),
  28975. /***/ 3198:
  28976. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  28977. "use strict";
  28978. const DispatcherBase = __nccwpck_require__(4839)
  28979. const FixedQueue = __nccwpck_require__(8266)
  28980. const { kConnected, kSize, kRunning, kPending, kQueued, kBusy, kFree, kUrl, kClose, kDestroy, kDispatch } = __nccwpck_require__(2785)
  28981. const PoolStats = __nccwpck_require__(9689)
  28982. const kClients = Symbol('clients')
  28983. const kNeedDrain = Symbol('needDrain')
  28984. const kQueue = Symbol('queue')
  28985. const kClosedResolve = Symbol('closed resolve')
  28986. const kOnDrain = Symbol('onDrain')
  28987. const kOnConnect = Symbol('onConnect')
  28988. const kOnDisconnect = Symbol('onDisconnect')
  28989. const kOnConnectionError = Symbol('onConnectionError')
  28990. const kGetDispatcher = Symbol('get dispatcher')
  28991. const kAddClient = Symbol('add client')
  28992. const kRemoveClient = Symbol('remove client')
  28993. const kStats = Symbol('stats')
  28994. class PoolBase extends DispatcherBase {
  28995. constructor () {
  28996. super()
  28997. this[kQueue] = new FixedQueue()
  28998. this[kClients] = []
  28999. this[kQueued] = 0
  29000. const pool = this
  29001. this[kOnDrain] = function onDrain (origin, targets) {
  29002. const queue = pool[kQueue]
  29003. let needDrain = false
  29004. while (!needDrain) {
  29005. const item = queue.shift()
  29006. if (!item) {
  29007. break
  29008. }
  29009. pool[kQueued]--
  29010. needDrain = !this.dispatch(item.opts, item.handler)
  29011. }
  29012. this[kNeedDrain] = needDrain
  29013. if (!this[kNeedDrain] && pool[kNeedDrain]) {
  29014. pool[kNeedDrain] = false
  29015. pool.emit('drain', origin, [pool, ...targets])
  29016. }
  29017. if (pool[kClosedResolve] && queue.isEmpty()) {
  29018. Promise
  29019. .all(pool[kClients].map(c => c.close()))
  29020. .then(pool[kClosedResolve])
  29021. }
  29022. }
  29023. this[kOnConnect] = (origin, targets) => {
  29024. pool.emit('connect', origin, [pool, ...targets])
  29025. }
  29026. this[kOnDisconnect] = (origin, targets, err) => {
  29027. pool.emit('disconnect', origin, [pool, ...targets], err)
  29028. }
  29029. this[kOnConnectionError] = (origin, targets, err) => {
  29030. pool.emit('connectionError', origin, [pool, ...targets], err)
  29031. }
  29032. this[kStats] = new PoolStats(this)
  29033. }
  29034. get [kBusy] () {
  29035. return this[kNeedDrain]
  29036. }
  29037. get [kConnected] () {
  29038. return this[kClients].filter(client => client[kConnected]).length
  29039. }
  29040. get [kFree] () {
  29041. return this[kClients].filter(client => client[kConnected] && !client[kNeedDrain]).length
  29042. }
  29043. get [kPending] () {
  29044. let ret = this[kQueued]
  29045. for (const { [kPending]: pending } of this[kClients]) {
  29046. ret += pending
  29047. }
  29048. return ret
  29049. }
  29050. get [kRunning] () {
  29051. let ret = 0
  29052. for (const { [kRunning]: running } of this[kClients]) {
  29053. ret += running
  29054. }
  29055. return ret
  29056. }
  29057. get [kSize] () {
  29058. let ret = this[kQueued]
  29059. for (const { [kSize]: size } of this[kClients]) {
  29060. ret += size
  29061. }
  29062. return ret
  29063. }
  29064. get stats () {
  29065. return this[kStats]
  29066. }
  29067. async [kClose] () {
  29068. if (this[kQueue].isEmpty()) {
  29069. return Promise.all(this[kClients].map(c => c.close()))
  29070. } else {
  29071. return new Promise((resolve) => {
  29072. this[kClosedResolve] = resolve
  29073. })
  29074. }
  29075. }
  29076. async [kDestroy] (err) {
  29077. while (true) {
  29078. const item = this[kQueue].shift()
  29079. if (!item) {
  29080. break
  29081. }
  29082. item.handler.onError(err)
  29083. }
  29084. return Promise.all(this[kClients].map(c => c.destroy(err)))
  29085. }
  29086. [kDispatch] (opts, handler) {
  29087. const dispatcher = this[kGetDispatcher]()
  29088. if (!dispatcher) {
  29089. this[kNeedDrain] = true
  29090. this[kQueue].push({ opts, handler })
  29091. this[kQueued]++
  29092. } else if (!dispatcher.dispatch(opts, handler)) {
  29093. dispatcher[kNeedDrain] = true
  29094. this[kNeedDrain] = !this[kGetDispatcher]()
  29095. }
  29096. return !this[kNeedDrain]
  29097. }
  29098. [kAddClient] (client) {
  29099. client
  29100. .on('drain', this[kOnDrain])
  29101. .on('connect', this[kOnConnect])
  29102. .on('disconnect', this[kOnDisconnect])
  29103. .on('connectionError', this[kOnConnectionError])
  29104. this[kClients].push(client)
  29105. if (this[kNeedDrain]) {
  29106. process.nextTick(() => {
  29107. if (this[kNeedDrain]) {
  29108. this[kOnDrain](client[kUrl], [this, client])
  29109. }
  29110. })
  29111. }
  29112. return this
  29113. }
  29114. [kRemoveClient] (client) {
  29115. client.close(() => {
  29116. const idx = this[kClients].indexOf(client)
  29117. if (idx !== -1) {
  29118. this[kClients].splice(idx, 1)
  29119. }
  29120. })
  29121. this[kNeedDrain] = this[kClients].some(dispatcher => (
  29122. !dispatcher[kNeedDrain] &&
  29123. dispatcher.closed !== true &&
  29124. dispatcher.destroyed !== true
  29125. ))
  29126. }
  29127. }
  29128. module.exports = {
  29129. PoolBase,
  29130. kClients,
  29131. kNeedDrain,
  29132. kAddClient,
  29133. kRemoveClient,
  29134. kGetDispatcher
  29135. }
  29136. /***/ }),
  29137. /***/ 9689:
  29138. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  29139. const { kFree, kConnected, kPending, kQueued, kRunning, kSize } = __nccwpck_require__(2785)
  29140. const kPool = Symbol('pool')
  29141. class PoolStats {
  29142. constructor (pool) {
  29143. this[kPool] = pool
  29144. }
  29145. get connected () {
  29146. return this[kPool][kConnected]
  29147. }
  29148. get free () {
  29149. return this[kPool][kFree]
  29150. }
  29151. get pending () {
  29152. return this[kPool][kPending]
  29153. }
  29154. get queued () {
  29155. return this[kPool][kQueued]
  29156. }
  29157. get running () {
  29158. return this[kPool][kRunning]
  29159. }
  29160. get size () {
  29161. return this[kPool][kSize]
  29162. }
  29163. }
  29164. module.exports = PoolStats
  29165. /***/ }),
  29166. /***/ 4634:
  29167. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  29168. "use strict";
  29169. const {
  29170. PoolBase,
  29171. kClients,
  29172. kNeedDrain,
  29173. kAddClient,
  29174. kGetDispatcher
  29175. } = __nccwpck_require__(3198)
  29176. const Client = __nccwpck_require__(3598)
  29177. const {
  29178. InvalidArgumentError
  29179. } = __nccwpck_require__(8045)
  29180. const util = __nccwpck_require__(3983)
  29181. const { kUrl, kInterceptors } = __nccwpck_require__(2785)
  29182. const buildConnector = __nccwpck_require__(2067)
  29183. const kOptions = Symbol('options')
  29184. const kConnections = Symbol('connections')
  29185. const kFactory = Symbol('factory')
  29186. function defaultFactory (origin, opts) {
  29187. return new Client(origin, opts)
  29188. }
  29189. class Pool extends PoolBase {
  29190. constructor (origin, {
  29191. connections,
  29192. factory = defaultFactory,
  29193. connect,
  29194. connectTimeout,
  29195. tls,
  29196. maxCachedSessions,
  29197. socketPath,
  29198. autoSelectFamily,
  29199. autoSelectFamilyAttemptTimeout,
  29200. allowH2,
  29201. ...options
  29202. } = {}) {
  29203. super()
  29204. if (connections != null && (!Number.isFinite(connections) || connections < 0)) {
  29205. throw new InvalidArgumentError('invalid connections')
  29206. }
  29207. if (typeof factory !== 'function') {
  29208. throw new InvalidArgumentError('factory must be a function.')
  29209. }
  29210. if (connect != null && typeof connect !== 'function' && typeof connect !== 'object') {
  29211. throw new InvalidArgumentError('connect must be a function or an object')
  29212. }
  29213. if (typeof connect !== 'function') {
  29214. connect = buildConnector({
  29215. ...tls,
  29216. maxCachedSessions,
  29217. allowH2,
  29218. socketPath,
  29219. timeout: connectTimeout,
  29220. ...(util.nodeHasAutoSelectFamily && autoSelectFamily ? { autoSelectFamily, autoSelectFamilyAttemptTimeout } : undefined),
  29221. ...connect
  29222. })
  29223. }
  29224. this[kInterceptors] = options.interceptors && options.interceptors.Pool && Array.isArray(options.interceptors.Pool)
  29225. ? options.interceptors.Pool
  29226. : []
  29227. this[kConnections] = connections || null
  29228. this[kUrl] = util.parseOrigin(origin)
  29229. this[kOptions] = { ...util.deepClone(options), connect, allowH2 }
  29230. this[kOptions].interceptors = options.interceptors
  29231. ? { ...options.interceptors }
  29232. : undefined
  29233. this[kFactory] = factory
  29234. this.on('connectionError', (origin, targets, error) => {
  29235. // If a connection error occurs, we remove the client from the pool,
  29236. // and emit a connectionError event. They will not be re-used.
  29237. // Fixes https://github.com/nodejs/undici/issues/3895
  29238. for (const target of targets) {
  29239. // Do not use kRemoveClient here, as it will close the client,
  29240. // but the client cannot be closed in this state.
  29241. const idx = this[kClients].indexOf(target)
  29242. if (idx !== -1) {
  29243. this[kClients].splice(idx, 1)
  29244. }
  29245. }
  29246. })
  29247. }
  29248. [kGetDispatcher] () {
  29249. let dispatcher = this[kClients].find(dispatcher => !dispatcher[kNeedDrain])
  29250. if (dispatcher) {
  29251. return dispatcher
  29252. }
  29253. if (!this[kConnections] || this[kClients].length < this[kConnections]) {
  29254. dispatcher = this[kFactory](this[kUrl], this[kOptions])
  29255. this[kAddClient](dispatcher)
  29256. }
  29257. return dispatcher
  29258. }
  29259. }
  29260. module.exports = Pool
  29261. /***/ }),
  29262. /***/ 7858:
  29263. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  29264. "use strict";
  29265. const { kProxy, kClose, kDestroy, kInterceptors } = __nccwpck_require__(2785)
  29266. const { URL } = __nccwpck_require__(7310)
  29267. const Agent = __nccwpck_require__(7890)
  29268. const Pool = __nccwpck_require__(4634)
  29269. const DispatcherBase = __nccwpck_require__(4839)
  29270. const { InvalidArgumentError, RequestAbortedError } = __nccwpck_require__(8045)
  29271. const buildConnector = __nccwpck_require__(2067)
  29272. const kAgent = Symbol('proxy agent')
  29273. const kClient = Symbol('proxy client')
  29274. const kProxyHeaders = Symbol('proxy headers')
  29275. const kRequestTls = Symbol('request tls settings')
  29276. const kProxyTls = Symbol('proxy tls settings')
  29277. const kConnectEndpoint = Symbol('connect endpoint function')
  29278. function defaultProtocolPort (protocol) {
  29279. return protocol === 'https:' ? 443 : 80
  29280. }
  29281. function buildProxyOptions (opts) {
  29282. if (typeof opts === 'string') {
  29283. opts = { uri: opts }
  29284. }
  29285. if (!opts || !opts.uri) {
  29286. throw new InvalidArgumentError('Proxy opts.uri is mandatory')
  29287. }
  29288. return {
  29289. uri: opts.uri,
  29290. protocol: opts.protocol || 'https'
  29291. }
  29292. }
  29293. function defaultFactory (origin, opts) {
  29294. return new Pool(origin, opts)
  29295. }
  29296. class ProxyAgent extends DispatcherBase {
  29297. constructor (opts) {
  29298. super(opts)
  29299. this[kProxy] = buildProxyOptions(opts)
  29300. this[kAgent] = new Agent(opts)
  29301. this[kInterceptors] = opts.interceptors && opts.interceptors.ProxyAgent && Array.isArray(opts.interceptors.ProxyAgent)
  29302. ? opts.interceptors.ProxyAgent
  29303. : []
  29304. if (typeof opts === 'string') {
  29305. opts = { uri: opts }
  29306. }
  29307. if (!opts || !opts.uri) {
  29308. throw new InvalidArgumentError('Proxy opts.uri is mandatory')
  29309. }
  29310. const { clientFactory = defaultFactory } = opts
  29311. if (typeof clientFactory !== 'function') {
  29312. throw new InvalidArgumentError('Proxy opts.clientFactory must be a function.')
  29313. }
  29314. this[kRequestTls] = opts.requestTls
  29315. this[kProxyTls] = opts.proxyTls
  29316. this[kProxyHeaders] = opts.headers || {}
  29317. const resolvedUrl = new URL(opts.uri)
  29318. const { origin, port, host, username, password } = resolvedUrl
  29319. if (opts.auth && opts.token) {
  29320. throw new InvalidArgumentError('opts.auth cannot be used in combination with opts.token')
  29321. } else if (opts.auth) {
  29322. /* @deprecated in favour of opts.token */
  29323. this[kProxyHeaders]['proxy-authorization'] = `Basic ${opts.auth}`
  29324. } else if (opts.token) {
  29325. this[kProxyHeaders]['proxy-authorization'] = opts.token
  29326. } else if (username && password) {
  29327. this[kProxyHeaders]['proxy-authorization'] = `Basic ${Buffer.from(`${decodeURIComponent(username)}:${decodeURIComponent(password)}`).toString('base64')}`
  29328. }
  29329. const connect = buildConnector({ ...opts.proxyTls })
  29330. this[kConnectEndpoint] = buildConnector({ ...opts.requestTls })
  29331. this[kClient] = clientFactory(resolvedUrl, { connect })
  29332. this[kAgent] = new Agent({
  29333. ...opts,
  29334. connect: async (opts, callback) => {
  29335. let requestedHost = opts.host
  29336. if (!opts.port) {
  29337. requestedHost += `:${defaultProtocolPort(opts.protocol)}`
  29338. }
  29339. try {
  29340. const { socket, statusCode } = await this[kClient].connect({
  29341. origin,
  29342. port,
  29343. path: requestedHost,
  29344. signal: opts.signal,
  29345. headers: {
  29346. ...this[kProxyHeaders],
  29347. host
  29348. }
  29349. })
  29350. if (statusCode !== 200) {
  29351. socket.on('error', () => {}).destroy()
  29352. callback(new RequestAbortedError(`Proxy response (${statusCode}) !== 200 when HTTP Tunneling`))
  29353. }
  29354. if (opts.protocol !== 'https:') {
  29355. callback(null, socket)
  29356. return
  29357. }
  29358. let servername
  29359. if (this[kRequestTls]) {
  29360. servername = this[kRequestTls].servername
  29361. } else {
  29362. servername = opts.servername
  29363. }
  29364. this[kConnectEndpoint]({ ...opts, servername, httpSocket: socket }, callback)
  29365. } catch (err) {
  29366. callback(err)
  29367. }
  29368. }
  29369. })
  29370. }
  29371. dispatch (opts, handler) {
  29372. const { host } = new URL(opts.origin)
  29373. const headers = buildHeaders(opts.headers)
  29374. throwIfProxyAuthIsSent(headers)
  29375. return this[kAgent].dispatch(
  29376. {
  29377. ...opts,
  29378. headers: {
  29379. ...headers,
  29380. host
  29381. }
  29382. },
  29383. handler
  29384. )
  29385. }
  29386. async [kClose] () {
  29387. await this[kAgent].close()
  29388. await this[kClient].close()
  29389. }
  29390. async [kDestroy] () {
  29391. await this[kAgent].destroy()
  29392. await this[kClient].destroy()
  29393. }
  29394. }
  29395. /**
  29396. * @param {string[] | Record<string, string>} headers
  29397. * @returns {Record<string, string>}
  29398. */
  29399. function buildHeaders (headers) {
  29400. // When using undici.fetch, the headers list is stored
  29401. // as an array.
  29402. if (Array.isArray(headers)) {
  29403. /** @type {Record<string, string>} */
  29404. const headersPair = {}
  29405. for (let i = 0; i < headers.length; i += 2) {
  29406. headersPair[headers[i]] = headers[i + 1]
  29407. }
  29408. return headersPair
  29409. }
  29410. return headers
  29411. }
  29412. /**
  29413. * @param {Record<string, string>} headers
  29414. *
  29415. * Previous versions of ProxyAgent suggests the Proxy-Authorization in request headers
  29416. * Nevertheless, it was changed and to avoid a security vulnerability by end users
  29417. * this check was created.
  29418. * It should be removed in the next major version for performance reasons
  29419. */
  29420. function throwIfProxyAuthIsSent (headers) {
  29421. const existProxyAuth = headers && Object.keys(headers)
  29422. .find((key) => key.toLowerCase() === 'proxy-authorization')
  29423. if (existProxyAuth) {
  29424. throw new InvalidArgumentError('Proxy-Authorization should be sent in ProxyAgent constructor')
  29425. }
  29426. }
  29427. module.exports = ProxyAgent
  29428. /***/ }),
  29429. /***/ 9459:
  29430. /***/ ((module) => {
  29431. "use strict";
  29432. let fastNow = Date.now()
  29433. let fastNowTimeout
  29434. const fastTimers = []
  29435. function onTimeout () {
  29436. fastNow = Date.now()
  29437. let len = fastTimers.length
  29438. let idx = 0
  29439. while (idx < len) {
  29440. const timer = fastTimers[idx]
  29441. if (timer.state === 0) {
  29442. timer.state = fastNow + timer.delay
  29443. } else if (timer.state > 0 && fastNow >= timer.state) {
  29444. timer.state = -1
  29445. timer.callback(timer.opaque)
  29446. }
  29447. if (timer.state === -1) {
  29448. timer.state = -2
  29449. if (idx !== len - 1) {
  29450. fastTimers[idx] = fastTimers.pop()
  29451. } else {
  29452. fastTimers.pop()
  29453. }
  29454. len -= 1
  29455. } else {
  29456. idx += 1
  29457. }
  29458. }
  29459. if (fastTimers.length > 0) {
  29460. refreshTimeout()
  29461. }
  29462. }
  29463. function refreshTimeout () {
  29464. if (fastNowTimeout && fastNowTimeout.refresh) {
  29465. fastNowTimeout.refresh()
  29466. } else {
  29467. clearTimeout(fastNowTimeout)
  29468. fastNowTimeout = setTimeout(onTimeout, 1e3)
  29469. if (fastNowTimeout.unref) {
  29470. fastNowTimeout.unref()
  29471. }
  29472. }
  29473. }
  29474. class Timeout {
  29475. constructor (callback, delay, opaque) {
  29476. this.callback = callback
  29477. this.delay = delay
  29478. this.opaque = opaque
  29479. // -2 not in timer list
  29480. // -1 in timer list but inactive
  29481. // 0 in timer list waiting for time
  29482. // > 0 in timer list waiting for time to expire
  29483. this.state = -2
  29484. this.refresh()
  29485. }
  29486. refresh () {
  29487. if (this.state === -2) {
  29488. fastTimers.push(this)
  29489. if (!fastNowTimeout || fastTimers.length === 1) {
  29490. refreshTimeout()
  29491. }
  29492. }
  29493. this.state = 0
  29494. }
  29495. clear () {
  29496. this.state = -1
  29497. }
  29498. }
  29499. module.exports = {
  29500. setTimeout (callback, delay, opaque) {
  29501. return delay < 1e3
  29502. ? setTimeout(callback, delay, opaque)
  29503. : new Timeout(callback, delay, opaque)
  29504. },
  29505. clearTimeout (timeout) {
  29506. if (timeout instanceof Timeout) {
  29507. timeout.clear()
  29508. } else {
  29509. clearTimeout(timeout)
  29510. }
  29511. }
  29512. }
  29513. /***/ }),
  29514. /***/ 5354:
  29515. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  29516. "use strict";
  29517. const diagnosticsChannel = __nccwpck_require__(7643)
  29518. const { uid, states } = __nccwpck_require__(9188)
  29519. const {
  29520. kReadyState,
  29521. kSentClose,
  29522. kByteParser,
  29523. kReceivedClose
  29524. } = __nccwpck_require__(7578)
  29525. const { fireEvent, failWebsocketConnection } = __nccwpck_require__(5515)
  29526. const { CloseEvent } = __nccwpck_require__(2611)
  29527. const { makeRequest } = __nccwpck_require__(8359)
  29528. const { fetching } = __nccwpck_require__(4881)
  29529. const { Headers } = __nccwpck_require__(554)
  29530. const { getGlobalDispatcher } = __nccwpck_require__(1892)
  29531. const { kHeadersList } = __nccwpck_require__(2785)
  29532. const channels = {}
  29533. channels.open = diagnosticsChannel.channel('undici:websocket:open')
  29534. channels.close = diagnosticsChannel.channel('undici:websocket:close')
  29535. channels.socketError = diagnosticsChannel.channel('undici:websocket:socket_error')
  29536. /** @type {import('crypto')} */
  29537. let crypto
  29538. try {
  29539. crypto = __nccwpck_require__(6113)
  29540. } catch {
  29541. }
  29542. /**
  29543. * @see https://websockets.spec.whatwg.org/#concept-websocket-establish
  29544. * @param {URL} url
  29545. * @param {string|string[]} protocols
  29546. * @param {import('./websocket').WebSocket} ws
  29547. * @param {(response: any) => void} onEstablish
  29548. * @param {Partial<import('../../types/websocket').WebSocketInit>} options
  29549. */
  29550. function establishWebSocketConnection (url, protocols, ws, onEstablish, options) {
  29551. // 1. Let requestURL be a copy of url, with its scheme set to "http", if url’s
  29552. // scheme is "ws", and to "https" otherwise.
  29553. const requestURL = url
  29554. requestURL.protocol = url.protocol === 'ws:' ? 'http:' : 'https:'
  29555. // 2. Let request be a new request, whose URL is requestURL, client is client,
  29556. // service-workers mode is "none", referrer is "no-referrer", mode is
  29557. // "websocket", credentials mode is "include", cache mode is "no-store" ,
  29558. // and redirect mode is "error".
  29559. const request = makeRequest({
  29560. urlList: [requestURL],
  29561. serviceWorkers: 'none',
  29562. referrer: 'no-referrer',
  29563. mode: 'websocket',
  29564. credentials: 'include',
  29565. cache: 'no-store',
  29566. redirect: 'error'
  29567. })
  29568. // Note: undici extension, allow setting custom headers.
  29569. if (options.headers) {
  29570. const headersList = new Headers(options.headers)[kHeadersList]
  29571. request.headersList = headersList
  29572. }
  29573. // 3. Append (`Upgrade`, `websocket`) to request’s header list.
  29574. // 4. Append (`Connection`, `Upgrade`) to request’s header list.
  29575. // Note: both of these are handled by undici currently.
  29576. // https://github.com/nodejs/undici/blob/68c269c4144c446f3f1220951338daef4a6b5ec4/lib/client.js#L1397
  29577. // 5. Let keyValue be a nonce consisting of a randomly selected
  29578. // 16-byte value that has been forgiving-base64-encoded and
  29579. // isomorphic encoded.
  29580. const keyValue = crypto.randomBytes(16).toString('base64')
  29581. // 6. Append (`Sec-WebSocket-Key`, keyValue) to request’s
  29582. // header list.
  29583. request.headersList.append('sec-websocket-key', keyValue)
  29584. // 7. Append (`Sec-WebSocket-Version`, `13`) to request’s
  29585. // header list.
  29586. request.headersList.append('sec-websocket-version', '13')
  29587. // 8. For each protocol in protocols, combine
  29588. // (`Sec-WebSocket-Protocol`, protocol) in request’s header
  29589. // list.
  29590. for (const protocol of protocols) {
  29591. request.headersList.append('sec-websocket-protocol', protocol)
  29592. }
  29593. // 9. Let permessageDeflate be a user-agent defined
  29594. // "permessage-deflate" extension header value.
  29595. // https://github.com/mozilla/gecko-dev/blob/ce78234f5e653a5d3916813ff990f053510227bc/netwerk/protocol/websocket/WebSocketChannel.cpp#L2673
  29596. // TODO: enable once permessage-deflate is supported
  29597. const permessageDeflate = '' // 'permessage-deflate; 15'
  29598. // 10. Append (`Sec-WebSocket-Extensions`, permessageDeflate) to
  29599. // request’s header list.
  29600. // request.headersList.append('sec-websocket-extensions', permessageDeflate)
  29601. // 11. Fetch request with useParallelQueue set to true, and
  29602. // processResponse given response being these steps:
  29603. const controller = fetching({
  29604. request,
  29605. useParallelQueue: true,
  29606. dispatcher: options.dispatcher ?? getGlobalDispatcher(),
  29607. processResponse (response) {
  29608. // 1. If response is a network error or its status is not 101,
  29609. // fail the WebSocket connection.
  29610. if (response.type === 'error' || response.status !== 101) {
  29611. failWebsocketConnection(ws, 'Received network error or non-101 status code.')
  29612. return
  29613. }
  29614. // 2. If protocols is not the empty list and extracting header
  29615. // list values given `Sec-WebSocket-Protocol` and response’s
  29616. // header list results in null, failure, or the empty byte
  29617. // sequence, then fail the WebSocket connection.
  29618. if (protocols.length !== 0 && !response.headersList.get('Sec-WebSocket-Protocol')) {
  29619. failWebsocketConnection(ws, 'Server did not respond with sent protocols.')
  29620. return
  29621. }
  29622. // 3. Follow the requirements stated step 2 to step 6, inclusive,
  29623. // of the last set of steps in section 4.1 of The WebSocket
  29624. // Protocol to validate response. This either results in fail
  29625. // the WebSocket connection or the WebSocket connection is
  29626. // established.
  29627. // 2. If the response lacks an |Upgrade| header field or the |Upgrade|
  29628. // header field contains a value that is not an ASCII case-
  29629. // insensitive match for the value "websocket", the client MUST
  29630. // _Fail the WebSocket Connection_.
  29631. if (response.headersList.get('Upgrade')?.toLowerCase() !== 'websocket') {
  29632. failWebsocketConnection(ws, 'Server did not set Upgrade header to "websocket".')
  29633. return
  29634. }
  29635. // 3. If the response lacks a |Connection| header field or the
  29636. // |Connection| header field doesn't contain a token that is an
  29637. // ASCII case-insensitive match for the value "Upgrade", the client
  29638. // MUST _Fail the WebSocket Connection_.
  29639. if (response.headersList.get('Connection')?.toLowerCase() !== 'upgrade') {
  29640. failWebsocketConnection(ws, 'Server did not set Connection header to "upgrade".')
  29641. return
  29642. }
  29643. // 4. If the response lacks a |Sec-WebSocket-Accept| header field or
  29644. // the |Sec-WebSocket-Accept| contains a value other than the
  29645. // base64-encoded SHA-1 of the concatenation of the |Sec-WebSocket-
  29646. // Key| (as a string, not base64-decoded) with the string "258EAFA5-
  29647. // E914-47DA-95CA-C5AB0DC85B11" but ignoring any leading and
  29648. // trailing whitespace, the client MUST _Fail the WebSocket
  29649. // Connection_.
  29650. const secWSAccept = response.headersList.get('Sec-WebSocket-Accept')
  29651. const digest = crypto.createHash('sha1').update(keyValue + uid).digest('base64')
  29652. if (secWSAccept !== digest) {
  29653. failWebsocketConnection(ws, 'Incorrect hash received in Sec-WebSocket-Accept header.')
  29654. return
  29655. }
  29656. // 5. If the response includes a |Sec-WebSocket-Extensions| header
  29657. // field and this header field indicates the use of an extension
  29658. // that was not present in the client's handshake (the server has
  29659. // indicated an extension not requested by the client), the client
  29660. // MUST _Fail the WebSocket Connection_. (The parsing of this
  29661. // header field to determine which extensions are requested is
  29662. // discussed in Section 9.1.)
  29663. const secExtension = response.headersList.get('Sec-WebSocket-Extensions')
  29664. if (secExtension !== null && secExtension !== permessageDeflate) {
  29665. failWebsocketConnection(ws, 'Received different permessage-deflate than the one set.')
  29666. return
  29667. }
  29668. // 6. If the response includes a |Sec-WebSocket-Protocol| header field
  29669. // and this header field indicates the use of a subprotocol that was
  29670. // not present in the client's handshake (the server has indicated a
  29671. // subprotocol not requested by the client), the client MUST _Fail
  29672. // the WebSocket Connection_.
  29673. const secProtocol = response.headersList.get('Sec-WebSocket-Protocol')
  29674. if (secProtocol !== null && secProtocol !== request.headersList.get('Sec-WebSocket-Protocol')) {
  29675. failWebsocketConnection(ws, 'Protocol was not set in the opening handshake.')
  29676. return
  29677. }
  29678. response.socket.on('data', onSocketData)
  29679. response.socket.on('close', onSocketClose)
  29680. response.socket.on('error', onSocketError)
  29681. if (channels.open.hasSubscribers) {
  29682. channels.open.publish({
  29683. address: response.socket.address(),
  29684. protocol: secProtocol,
  29685. extensions: secExtension
  29686. })
  29687. }
  29688. onEstablish(response)
  29689. }
  29690. })
  29691. return controller
  29692. }
  29693. /**
  29694. * @param {Buffer} chunk
  29695. */
  29696. function onSocketData (chunk) {
  29697. if (!this.ws[kByteParser].write(chunk)) {
  29698. this.pause()
  29699. }
  29700. }
  29701. /**
  29702. * @see https://websockets.spec.whatwg.org/#feedback-from-the-protocol
  29703. * @see https://datatracker.ietf.org/doc/html/rfc6455#section-7.1.4
  29704. */
  29705. function onSocketClose () {
  29706. const { ws } = this
  29707. // If the TCP connection was closed after the
  29708. // WebSocket closing handshake was completed, the WebSocket connection
  29709. // is said to have been closed _cleanly_.
  29710. const wasClean = ws[kSentClose] && ws[kReceivedClose]
  29711. let code = 1005
  29712. let reason = ''
  29713. const result = ws[kByteParser].closingInfo
  29714. if (result) {
  29715. code = result.code ?? 1005
  29716. reason = result.reason
  29717. } else if (!ws[kSentClose]) {
  29718. // If _The WebSocket
  29719. // Connection is Closed_ and no Close control frame was received by the
  29720. // endpoint (such as could occur if the underlying transport connection
  29721. // is lost), _The WebSocket Connection Close Code_ is considered to be
  29722. // 1006.
  29723. code = 1006
  29724. }
  29725. // 1. Change the ready state to CLOSED (3).
  29726. ws[kReadyState] = states.CLOSED
  29727. // 2. If the user agent was required to fail the WebSocket
  29728. // connection, or if the WebSocket connection was closed
  29729. // after being flagged as full, fire an event named error
  29730. // at the WebSocket object.
  29731. // TODO
  29732. // 3. Fire an event named close at the WebSocket object,
  29733. // using CloseEvent, with the wasClean attribute
  29734. // initialized to true if the connection closed cleanly
  29735. // and false otherwise, the code attribute initialized to
  29736. // the WebSocket connection close code, and the reason
  29737. // attribute initialized to the result of applying UTF-8
  29738. // decode without BOM to the WebSocket connection close
  29739. // reason.
  29740. fireEvent('close', ws, CloseEvent, {
  29741. wasClean, code, reason
  29742. })
  29743. if (channels.close.hasSubscribers) {
  29744. channels.close.publish({
  29745. websocket: ws,
  29746. code,
  29747. reason
  29748. })
  29749. }
  29750. }
  29751. function onSocketError (error) {
  29752. const { ws } = this
  29753. ws[kReadyState] = states.CLOSING
  29754. if (channels.socketError.hasSubscribers) {
  29755. channels.socketError.publish(error)
  29756. }
  29757. this.destroy()
  29758. }
  29759. module.exports = {
  29760. establishWebSocketConnection
  29761. }
  29762. /***/ }),
  29763. /***/ 9188:
  29764. /***/ ((module) => {
  29765. "use strict";
  29766. // This is a Globally Unique Identifier unique used
  29767. // to validate that the endpoint accepts websocket
  29768. // connections.
  29769. // See https://www.rfc-editor.org/rfc/rfc6455.html#section-1.3
  29770. const uid = '258EAFA5-E914-47DA-95CA-C5AB0DC85B11'
  29771. /** @type {PropertyDescriptor} */
  29772. const staticPropertyDescriptors = {
  29773. enumerable: true,
  29774. writable: false,
  29775. configurable: false
  29776. }
  29777. const states = {
  29778. CONNECTING: 0,
  29779. OPEN: 1,
  29780. CLOSING: 2,
  29781. CLOSED: 3
  29782. }
  29783. const opcodes = {
  29784. CONTINUATION: 0x0,
  29785. TEXT: 0x1,
  29786. BINARY: 0x2,
  29787. CLOSE: 0x8,
  29788. PING: 0x9,
  29789. PONG: 0xA
  29790. }
  29791. const maxUnsigned16Bit = 2 ** 16 - 1 // 65535
  29792. const parserStates = {
  29793. INFO: 0,
  29794. PAYLOADLENGTH_16: 2,
  29795. PAYLOADLENGTH_64: 3,
  29796. READ_DATA: 4
  29797. }
  29798. const emptyBuffer = Buffer.allocUnsafe(0)
  29799. module.exports = {
  29800. uid,
  29801. staticPropertyDescriptors,
  29802. states,
  29803. opcodes,
  29804. maxUnsigned16Bit,
  29805. parserStates,
  29806. emptyBuffer
  29807. }
  29808. /***/ }),
  29809. /***/ 2611:
  29810. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  29811. "use strict";
  29812. const { webidl } = __nccwpck_require__(1744)
  29813. const { kEnumerableProperty } = __nccwpck_require__(3983)
  29814. const { MessagePort } = __nccwpck_require__(1267)
  29815. /**
  29816. * @see https://html.spec.whatwg.org/multipage/comms.html#messageevent
  29817. */
  29818. class MessageEvent extends Event {
  29819. #eventInit
  29820. constructor (type, eventInitDict = {}) {
  29821. webidl.argumentLengthCheck(arguments, 1, { header: 'MessageEvent constructor' })
  29822. type = webidl.converters.DOMString(type)
  29823. eventInitDict = webidl.converters.MessageEventInit(eventInitDict)
  29824. super(type, eventInitDict)
  29825. this.#eventInit = eventInitDict
  29826. }
  29827. get data () {
  29828. webidl.brandCheck(this, MessageEvent)
  29829. return this.#eventInit.data
  29830. }
  29831. get origin () {
  29832. webidl.brandCheck(this, MessageEvent)
  29833. return this.#eventInit.origin
  29834. }
  29835. get lastEventId () {
  29836. webidl.brandCheck(this, MessageEvent)
  29837. return this.#eventInit.lastEventId
  29838. }
  29839. get source () {
  29840. webidl.brandCheck(this, MessageEvent)
  29841. return this.#eventInit.source
  29842. }
  29843. get ports () {
  29844. webidl.brandCheck(this, MessageEvent)
  29845. if (!Object.isFrozen(this.#eventInit.ports)) {
  29846. Object.freeze(this.#eventInit.ports)
  29847. }
  29848. return this.#eventInit.ports
  29849. }
  29850. initMessageEvent (
  29851. type,
  29852. bubbles = false,
  29853. cancelable = false,
  29854. data = null,
  29855. origin = '',
  29856. lastEventId = '',
  29857. source = null,
  29858. ports = []
  29859. ) {
  29860. webidl.brandCheck(this, MessageEvent)
  29861. webidl.argumentLengthCheck(arguments, 1, { header: 'MessageEvent.initMessageEvent' })
  29862. return new MessageEvent(type, {
  29863. bubbles, cancelable, data, origin, lastEventId, source, ports
  29864. })
  29865. }
  29866. }
  29867. /**
  29868. * @see https://websockets.spec.whatwg.org/#the-closeevent-interface
  29869. */
  29870. class CloseEvent extends Event {
  29871. #eventInit
  29872. constructor (type, eventInitDict = {}) {
  29873. webidl.argumentLengthCheck(arguments, 1, { header: 'CloseEvent constructor' })
  29874. type = webidl.converters.DOMString(type)
  29875. eventInitDict = webidl.converters.CloseEventInit(eventInitDict)
  29876. super(type, eventInitDict)
  29877. this.#eventInit = eventInitDict
  29878. }
  29879. get wasClean () {
  29880. webidl.brandCheck(this, CloseEvent)
  29881. return this.#eventInit.wasClean
  29882. }
  29883. get code () {
  29884. webidl.brandCheck(this, CloseEvent)
  29885. return this.#eventInit.code
  29886. }
  29887. get reason () {
  29888. webidl.brandCheck(this, CloseEvent)
  29889. return this.#eventInit.reason
  29890. }
  29891. }
  29892. // https://html.spec.whatwg.org/multipage/webappapis.html#the-errorevent-interface
  29893. class ErrorEvent extends Event {
  29894. #eventInit
  29895. constructor (type, eventInitDict) {
  29896. webidl.argumentLengthCheck(arguments, 1, { header: 'ErrorEvent constructor' })
  29897. super(type, eventInitDict)
  29898. type = webidl.converters.DOMString(type)
  29899. eventInitDict = webidl.converters.ErrorEventInit(eventInitDict ?? {})
  29900. this.#eventInit = eventInitDict
  29901. }
  29902. get message () {
  29903. webidl.brandCheck(this, ErrorEvent)
  29904. return this.#eventInit.message
  29905. }
  29906. get filename () {
  29907. webidl.brandCheck(this, ErrorEvent)
  29908. return this.#eventInit.filename
  29909. }
  29910. get lineno () {
  29911. webidl.brandCheck(this, ErrorEvent)
  29912. return this.#eventInit.lineno
  29913. }
  29914. get colno () {
  29915. webidl.brandCheck(this, ErrorEvent)
  29916. return this.#eventInit.colno
  29917. }
  29918. get error () {
  29919. webidl.brandCheck(this, ErrorEvent)
  29920. return this.#eventInit.error
  29921. }
  29922. }
  29923. Object.defineProperties(MessageEvent.prototype, {
  29924. [Symbol.toStringTag]: {
  29925. value: 'MessageEvent',
  29926. configurable: true
  29927. },
  29928. data: kEnumerableProperty,
  29929. origin: kEnumerableProperty,
  29930. lastEventId: kEnumerableProperty,
  29931. source: kEnumerableProperty,
  29932. ports: kEnumerableProperty,
  29933. initMessageEvent: kEnumerableProperty
  29934. })
  29935. Object.defineProperties(CloseEvent.prototype, {
  29936. [Symbol.toStringTag]: {
  29937. value: 'CloseEvent',
  29938. configurable: true
  29939. },
  29940. reason: kEnumerableProperty,
  29941. code: kEnumerableProperty,
  29942. wasClean: kEnumerableProperty
  29943. })
  29944. Object.defineProperties(ErrorEvent.prototype, {
  29945. [Symbol.toStringTag]: {
  29946. value: 'ErrorEvent',
  29947. configurable: true
  29948. },
  29949. message: kEnumerableProperty,
  29950. filename: kEnumerableProperty,
  29951. lineno: kEnumerableProperty,
  29952. colno: kEnumerableProperty,
  29953. error: kEnumerableProperty
  29954. })
  29955. webidl.converters.MessagePort = webidl.interfaceConverter(MessagePort)
  29956. webidl.converters['sequence<MessagePort>'] = webidl.sequenceConverter(
  29957. webidl.converters.MessagePort
  29958. )
  29959. const eventInit = [
  29960. {
  29961. key: 'bubbles',
  29962. converter: webidl.converters.boolean,
  29963. defaultValue: false
  29964. },
  29965. {
  29966. key: 'cancelable',
  29967. converter: webidl.converters.boolean,
  29968. defaultValue: false
  29969. },
  29970. {
  29971. key: 'composed',
  29972. converter: webidl.converters.boolean,
  29973. defaultValue: false
  29974. }
  29975. ]
  29976. webidl.converters.MessageEventInit = webidl.dictionaryConverter([
  29977. ...eventInit,
  29978. {
  29979. key: 'data',
  29980. converter: webidl.converters.any,
  29981. defaultValue: null
  29982. },
  29983. {
  29984. key: 'origin',
  29985. converter: webidl.converters.USVString,
  29986. defaultValue: ''
  29987. },
  29988. {
  29989. key: 'lastEventId',
  29990. converter: webidl.converters.DOMString,
  29991. defaultValue: ''
  29992. },
  29993. {
  29994. key: 'source',
  29995. // Node doesn't implement WindowProxy or ServiceWorker, so the only
  29996. // valid value for source is a MessagePort.
  29997. converter: webidl.nullableConverter(webidl.converters.MessagePort),
  29998. defaultValue: null
  29999. },
  30000. {
  30001. key: 'ports',
  30002. converter: webidl.converters['sequence<MessagePort>'],
  30003. get defaultValue () {
  30004. return []
  30005. }
  30006. }
  30007. ])
  30008. webidl.converters.CloseEventInit = webidl.dictionaryConverter([
  30009. ...eventInit,
  30010. {
  30011. key: 'wasClean',
  30012. converter: webidl.converters.boolean,
  30013. defaultValue: false
  30014. },
  30015. {
  30016. key: 'code',
  30017. converter: webidl.converters['unsigned short'],
  30018. defaultValue: 0
  30019. },
  30020. {
  30021. key: 'reason',
  30022. converter: webidl.converters.USVString,
  30023. defaultValue: ''
  30024. }
  30025. ])
  30026. webidl.converters.ErrorEventInit = webidl.dictionaryConverter([
  30027. ...eventInit,
  30028. {
  30029. key: 'message',
  30030. converter: webidl.converters.DOMString,
  30031. defaultValue: ''
  30032. },
  30033. {
  30034. key: 'filename',
  30035. converter: webidl.converters.USVString,
  30036. defaultValue: ''
  30037. },
  30038. {
  30039. key: 'lineno',
  30040. converter: webidl.converters['unsigned long'],
  30041. defaultValue: 0
  30042. },
  30043. {
  30044. key: 'colno',
  30045. converter: webidl.converters['unsigned long'],
  30046. defaultValue: 0
  30047. },
  30048. {
  30049. key: 'error',
  30050. converter: webidl.converters.any
  30051. }
  30052. ])
  30053. module.exports = {
  30054. MessageEvent,
  30055. CloseEvent,
  30056. ErrorEvent
  30057. }
  30058. /***/ }),
  30059. /***/ 5444:
  30060. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  30061. "use strict";
  30062. const { maxUnsigned16Bit } = __nccwpck_require__(9188)
  30063. /** @type {import('crypto')} */
  30064. let crypto
  30065. try {
  30066. crypto = __nccwpck_require__(6113)
  30067. } catch {
  30068. }
  30069. class WebsocketFrameSend {
  30070. /**
  30071. * @param {Buffer|undefined} data
  30072. */
  30073. constructor (data) {
  30074. this.frameData = data
  30075. this.maskKey = crypto.randomBytes(4)
  30076. }
  30077. createFrame (opcode) {
  30078. const bodyLength = this.frameData?.byteLength ?? 0
  30079. /** @type {number} */
  30080. let payloadLength = bodyLength // 0-125
  30081. let offset = 6
  30082. if (bodyLength > maxUnsigned16Bit) {
  30083. offset += 8 // payload length is next 8 bytes
  30084. payloadLength = 127
  30085. } else if (bodyLength > 125) {
  30086. offset += 2 // payload length is next 2 bytes
  30087. payloadLength = 126
  30088. }
  30089. const buffer = Buffer.allocUnsafe(bodyLength + offset)
  30090. // Clear first 2 bytes, everything else is overwritten
  30091. buffer[0] = buffer[1] = 0
  30092. buffer[0] |= 0x80 // FIN
  30093. buffer[0] = (buffer[0] & 0xF0) + opcode // opcode
  30094. /*! ws. MIT License. Einar Otto Stangvik <einaros@gmail.com> */
  30095. buffer[offset - 4] = this.maskKey[0]
  30096. buffer[offset - 3] = this.maskKey[1]
  30097. buffer[offset - 2] = this.maskKey[2]
  30098. buffer[offset - 1] = this.maskKey[3]
  30099. buffer[1] = payloadLength
  30100. if (payloadLength === 126) {
  30101. buffer.writeUInt16BE(bodyLength, 2)
  30102. } else if (payloadLength === 127) {
  30103. // Clear extended payload length
  30104. buffer[2] = buffer[3] = 0
  30105. buffer.writeUIntBE(bodyLength, 4, 6)
  30106. }
  30107. buffer[1] |= 0x80 // MASK
  30108. // mask body
  30109. for (let i = 0; i < bodyLength; i++) {
  30110. buffer[offset + i] = this.frameData[i] ^ this.maskKey[i % 4]
  30111. }
  30112. return buffer
  30113. }
  30114. }
  30115. module.exports = {
  30116. WebsocketFrameSend
  30117. }
  30118. /***/ }),
  30119. /***/ 1688:
  30120. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  30121. "use strict";
  30122. const { Writable } = __nccwpck_require__(2781)
  30123. const diagnosticsChannel = __nccwpck_require__(7643)
  30124. const { parserStates, opcodes, states, emptyBuffer } = __nccwpck_require__(9188)
  30125. const { kReadyState, kSentClose, kResponse, kReceivedClose } = __nccwpck_require__(7578)
  30126. const { isValidStatusCode, failWebsocketConnection, websocketMessageReceived } = __nccwpck_require__(5515)
  30127. const { WebsocketFrameSend } = __nccwpck_require__(5444)
  30128. // This code was influenced by ws released under the MIT license.
  30129. // Copyright (c) 2011 Einar Otto Stangvik <einaros@gmail.com>
  30130. // Copyright (c) 2013 Arnout Kazemier and contributors
  30131. // Copyright (c) 2016 Luigi Pinca and contributors
  30132. const channels = {}
  30133. channels.ping = diagnosticsChannel.channel('undici:websocket:ping')
  30134. channels.pong = diagnosticsChannel.channel('undici:websocket:pong')
  30135. class ByteParser extends Writable {
  30136. #buffers = []
  30137. #byteOffset = 0
  30138. #state = parserStates.INFO
  30139. #info = {}
  30140. #fragments = []
  30141. constructor (ws) {
  30142. super()
  30143. this.ws = ws
  30144. }
  30145. /**
  30146. * @param {Buffer} chunk
  30147. * @param {() => void} callback
  30148. */
  30149. _write (chunk, _, callback) {
  30150. this.#buffers.push(chunk)
  30151. this.#byteOffset += chunk.length
  30152. this.run(callback)
  30153. }
  30154. /**
  30155. * Runs whenever a new chunk is received.
  30156. * Callback is called whenever there are no more chunks buffering,
  30157. * or not enough bytes are buffered to parse.
  30158. */
  30159. run (callback) {
  30160. while (true) {
  30161. if (this.#state === parserStates.INFO) {
  30162. // If there aren't enough bytes to parse the payload length, etc.
  30163. if (this.#byteOffset < 2) {
  30164. return callback()
  30165. }
  30166. const buffer = this.consume(2)
  30167. this.#info.fin = (buffer[0] & 0x80) !== 0
  30168. this.#info.opcode = buffer[0] & 0x0F
  30169. // If we receive a fragmented message, we use the type of the first
  30170. // frame to parse the full message as binary/text, when it's terminated
  30171. this.#info.originalOpcode ??= this.#info.opcode
  30172. this.#info.fragmented = !this.#info.fin && this.#info.opcode !== opcodes.CONTINUATION
  30173. if (this.#info.fragmented && this.#info.opcode !== opcodes.BINARY && this.#info.opcode !== opcodes.TEXT) {
  30174. // Only text and binary frames can be fragmented
  30175. failWebsocketConnection(this.ws, 'Invalid frame type was fragmented.')
  30176. return
  30177. }
  30178. const payloadLength = buffer[1] & 0x7F
  30179. if (payloadLength <= 125) {
  30180. this.#info.payloadLength = payloadLength
  30181. this.#state = parserStates.READ_DATA
  30182. } else if (payloadLength === 126) {
  30183. this.#state = parserStates.PAYLOADLENGTH_16
  30184. } else if (payloadLength === 127) {
  30185. this.#state = parserStates.PAYLOADLENGTH_64
  30186. }
  30187. if (this.#info.fragmented && payloadLength > 125) {
  30188. // A fragmented frame can't be fragmented itself
  30189. failWebsocketConnection(this.ws, 'Fragmented frame exceeded 125 bytes.')
  30190. return
  30191. } else if (
  30192. (this.#info.opcode === opcodes.PING ||
  30193. this.#info.opcode === opcodes.PONG ||
  30194. this.#info.opcode === opcodes.CLOSE) &&
  30195. payloadLength > 125
  30196. ) {
  30197. // Control frames can have a payload length of 125 bytes MAX
  30198. failWebsocketConnection(this.ws, 'Payload length for control frame exceeded 125 bytes.')
  30199. return
  30200. } else if (this.#info.opcode === opcodes.CLOSE) {
  30201. if (payloadLength === 1) {
  30202. failWebsocketConnection(this.ws, 'Received close frame with a 1-byte body.')
  30203. return
  30204. }
  30205. const body = this.consume(payloadLength)
  30206. this.#info.closeInfo = this.parseCloseBody(false, body)
  30207. if (!this.ws[kSentClose]) {
  30208. // If an endpoint receives a Close frame and did not previously send a
  30209. // Close frame, the endpoint MUST send a Close frame in response. (When
  30210. // sending a Close frame in response, the endpoint typically echos the
  30211. // status code it received.)
  30212. const body = Buffer.allocUnsafe(2)
  30213. body.writeUInt16BE(this.#info.closeInfo.code, 0)
  30214. const closeFrame = new WebsocketFrameSend(body)
  30215. this.ws[kResponse].socket.write(
  30216. closeFrame.createFrame(opcodes.CLOSE),
  30217. (err) => {
  30218. if (!err) {
  30219. this.ws[kSentClose] = true
  30220. }
  30221. }
  30222. )
  30223. }
  30224. // Upon either sending or receiving a Close control frame, it is said
  30225. // that _The WebSocket Closing Handshake is Started_ and that the
  30226. // WebSocket connection is in the CLOSING state.
  30227. this.ws[kReadyState] = states.CLOSING
  30228. this.ws[kReceivedClose] = true
  30229. this.end()
  30230. return
  30231. } else if (this.#info.opcode === opcodes.PING) {
  30232. // Upon receipt of a Ping frame, an endpoint MUST send a Pong frame in
  30233. // response, unless it already received a Close frame.
  30234. // A Pong frame sent in response to a Ping frame must have identical
  30235. // "Application data"
  30236. const body = this.consume(payloadLength)
  30237. if (!this.ws[kReceivedClose]) {
  30238. const frame = new WebsocketFrameSend(body)
  30239. this.ws[kResponse].socket.write(frame.createFrame(opcodes.PONG))
  30240. if (channels.ping.hasSubscribers) {
  30241. channels.ping.publish({
  30242. payload: body
  30243. })
  30244. }
  30245. }
  30246. this.#state = parserStates.INFO
  30247. if (this.#byteOffset > 0) {
  30248. continue
  30249. } else {
  30250. callback()
  30251. return
  30252. }
  30253. } else if (this.#info.opcode === opcodes.PONG) {
  30254. // A Pong frame MAY be sent unsolicited. This serves as a
  30255. // unidirectional heartbeat. A response to an unsolicited Pong frame is
  30256. // not expected.
  30257. const body = this.consume(payloadLength)
  30258. if (channels.pong.hasSubscribers) {
  30259. channels.pong.publish({
  30260. payload: body
  30261. })
  30262. }
  30263. if (this.#byteOffset > 0) {
  30264. continue
  30265. } else {
  30266. callback()
  30267. return
  30268. }
  30269. }
  30270. } else if (this.#state === parserStates.PAYLOADLENGTH_16) {
  30271. if (this.#byteOffset < 2) {
  30272. return callback()
  30273. }
  30274. const buffer = this.consume(2)
  30275. this.#info.payloadLength = buffer.readUInt16BE(0)
  30276. this.#state = parserStates.READ_DATA
  30277. } else if (this.#state === parserStates.PAYLOADLENGTH_64) {
  30278. if (this.#byteOffset < 8) {
  30279. return callback()
  30280. }
  30281. const buffer = this.consume(8)
  30282. const upper = buffer.readUInt32BE(0)
  30283. // 2^31 is the maxinimum bytes an arraybuffer can contain
  30284. // on 32-bit systems. Although, on 64-bit systems, this is
  30285. // 2^53-1 bytes.
  30286. // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Invalid_array_length
  30287. // https://source.chromium.org/chromium/chromium/src/+/main:v8/src/common/globals.h;drc=1946212ac0100668f14eb9e2843bdd846e510a1e;bpv=1;bpt=1;l=1275
  30288. // https://source.chromium.org/chromium/chromium/src/+/main:v8/src/objects/js-array-buffer.h;l=34;drc=1946212ac0100668f14eb9e2843bdd846e510a1e
  30289. if (upper > 2 ** 31 - 1) {
  30290. failWebsocketConnection(this.ws, 'Received payload length > 2^31 bytes.')
  30291. return
  30292. }
  30293. const lower = buffer.readUInt32BE(4)
  30294. this.#info.payloadLength = (upper << 8) + lower
  30295. this.#state = parserStates.READ_DATA
  30296. } else if (this.#state === parserStates.READ_DATA) {
  30297. if (this.#byteOffset < this.#info.payloadLength) {
  30298. // If there is still more data in this chunk that needs to be read
  30299. return callback()
  30300. } else if (this.#byteOffset >= this.#info.payloadLength) {
  30301. // If the server sent multiple frames in a single chunk
  30302. const body = this.consume(this.#info.payloadLength)
  30303. this.#fragments.push(body)
  30304. // If the frame is unfragmented, or a fragmented frame was terminated,
  30305. // a message was received
  30306. if (!this.#info.fragmented || (this.#info.fin && this.#info.opcode === opcodes.CONTINUATION)) {
  30307. const fullMessage = Buffer.concat(this.#fragments)
  30308. websocketMessageReceived(this.ws, this.#info.originalOpcode, fullMessage)
  30309. this.#info = {}
  30310. this.#fragments.length = 0
  30311. }
  30312. this.#state = parserStates.INFO
  30313. }
  30314. }
  30315. if (this.#byteOffset > 0) {
  30316. continue
  30317. } else {
  30318. callback()
  30319. break
  30320. }
  30321. }
  30322. }
  30323. /**
  30324. * Take n bytes from the buffered Buffers
  30325. * @param {number} n
  30326. * @returns {Buffer|null}
  30327. */
  30328. consume (n) {
  30329. if (n > this.#byteOffset) {
  30330. return null
  30331. } else if (n === 0) {
  30332. return emptyBuffer
  30333. }
  30334. if (this.#buffers[0].length === n) {
  30335. this.#byteOffset -= this.#buffers[0].length
  30336. return this.#buffers.shift()
  30337. }
  30338. const buffer = Buffer.allocUnsafe(n)
  30339. let offset = 0
  30340. while (offset !== n) {
  30341. const next = this.#buffers[0]
  30342. const { length } = next
  30343. if (length + offset === n) {
  30344. buffer.set(this.#buffers.shift(), offset)
  30345. break
  30346. } else if (length + offset > n) {
  30347. buffer.set(next.subarray(0, n - offset), offset)
  30348. this.#buffers[0] = next.subarray(n - offset)
  30349. break
  30350. } else {
  30351. buffer.set(this.#buffers.shift(), offset)
  30352. offset += next.length
  30353. }
  30354. }
  30355. this.#byteOffset -= n
  30356. return buffer
  30357. }
  30358. parseCloseBody (onlyCode, data) {
  30359. // https://datatracker.ietf.org/doc/html/rfc6455#section-7.1.5
  30360. /** @type {number|undefined} */
  30361. let code
  30362. if (data.length >= 2) {
  30363. // _The WebSocket Connection Close Code_ is
  30364. // defined as the status code (Section 7.4) contained in the first Close
  30365. // control frame received by the application
  30366. code = data.readUInt16BE(0)
  30367. }
  30368. if (onlyCode) {
  30369. if (!isValidStatusCode(code)) {
  30370. return null
  30371. }
  30372. return { code }
  30373. }
  30374. // https://datatracker.ietf.org/doc/html/rfc6455#section-7.1.6
  30375. /** @type {Buffer} */
  30376. let reason = data.subarray(2)
  30377. // Remove BOM
  30378. if (reason[0] === 0xEF && reason[1] === 0xBB && reason[2] === 0xBF) {
  30379. reason = reason.subarray(3)
  30380. }
  30381. if (code !== undefined && !isValidStatusCode(code)) {
  30382. return null
  30383. }
  30384. try {
  30385. // TODO: optimize this
  30386. reason = new TextDecoder('utf-8', { fatal: true }).decode(reason)
  30387. } catch {
  30388. return null
  30389. }
  30390. return { code, reason }
  30391. }
  30392. get closingInfo () {
  30393. return this.#info.closeInfo
  30394. }
  30395. }
  30396. module.exports = {
  30397. ByteParser
  30398. }
  30399. /***/ }),
  30400. /***/ 7578:
  30401. /***/ ((module) => {
  30402. "use strict";
  30403. module.exports = {
  30404. kWebSocketURL: Symbol('url'),
  30405. kReadyState: Symbol('ready state'),
  30406. kController: Symbol('controller'),
  30407. kResponse: Symbol('response'),
  30408. kBinaryType: Symbol('binary type'),
  30409. kSentClose: Symbol('sent close'),
  30410. kReceivedClose: Symbol('received close'),
  30411. kByteParser: Symbol('byte parser')
  30412. }
  30413. /***/ }),
  30414. /***/ 5515:
  30415. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  30416. "use strict";
  30417. const { kReadyState, kController, kResponse, kBinaryType, kWebSocketURL } = __nccwpck_require__(7578)
  30418. const { states, opcodes } = __nccwpck_require__(9188)
  30419. const { MessageEvent, ErrorEvent } = __nccwpck_require__(2611)
  30420. /* globals Blob */
  30421. /**
  30422. * @param {import('./websocket').WebSocket} ws
  30423. */
  30424. function isEstablished (ws) {
  30425. // If the server's response is validated as provided for above, it is
  30426. // said that _The WebSocket Connection is Established_ and that the
  30427. // WebSocket Connection is in the OPEN state.
  30428. return ws[kReadyState] === states.OPEN
  30429. }
  30430. /**
  30431. * @param {import('./websocket').WebSocket} ws
  30432. */
  30433. function isClosing (ws) {
  30434. // Upon either sending or receiving a Close control frame, it is said
  30435. // that _The WebSocket Closing Handshake is Started_ and that the
  30436. // WebSocket connection is in the CLOSING state.
  30437. return ws[kReadyState] === states.CLOSING
  30438. }
  30439. /**
  30440. * @param {import('./websocket').WebSocket} ws
  30441. */
  30442. function isClosed (ws) {
  30443. return ws[kReadyState] === states.CLOSED
  30444. }
  30445. /**
  30446. * @see https://dom.spec.whatwg.org/#concept-event-fire
  30447. * @param {string} e
  30448. * @param {EventTarget} target
  30449. * @param {EventInit | undefined} eventInitDict
  30450. */
  30451. function fireEvent (e, target, eventConstructor = Event, eventInitDict) {
  30452. // 1. If eventConstructor is not given, then let eventConstructor be Event.
  30453. // 2. Let event be the result of creating an event given eventConstructor,
  30454. // in the relevant realm of target.
  30455. // 3. Initialize event’s type attribute to e.
  30456. const event = new eventConstructor(e, eventInitDict) // eslint-disable-line new-cap
  30457. // 4. Initialize any other IDL attributes of event as described in the
  30458. // invocation of this algorithm.
  30459. // 5. Return the result of dispatching event at target, with legacy target
  30460. // override flag set if set.
  30461. target.dispatchEvent(event)
  30462. }
  30463. /**
  30464. * @see https://websockets.spec.whatwg.org/#feedback-from-the-protocol
  30465. * @param {import('./websocket').WebSocket} ws
  30466. * @param {number} type Opcode
  30467. * @param {Buffer} data application data
  30468. */
  30469. function websocketMessageReceived (ws, type, data) {
  30470. // 1. If ready state is not OPEN (1), then return.
  30471. if (ws[kReadyState] !== states.OPEN) {
  30472. return
  30473. }
  30474. // 2. Let dataForEvent be determined by switching on type and binary type:
  30475. let dataForEvent
  30476. if (type === opcodes.TEXT) {
  30477. // -> type indicates that the data is Text
  30478. // a new DOMString containing data
  30479. try {
  30480. dataForEvent = new TextDecoder('utf-8', { fatal: true }).decode(data)
  30481. } catch {
  30482. failWebsocketConnection(ws, 'Received invalid UTF-8 in text frame.')
  30483. return
  30484. }
  30485. } else if (type === opcodes.BINARY) {
  30486. if (ws[kBinaryType] === 'blob') {
  30487. // -> type indicates that the data is Binary and binary type is "blob"
  30488. // a new Blob object, created in the relevant Realm of the WebSocket
  30489. // object, that represents data as its raw data
  30490. dataForEvent = new Blob([data])
  30491. } else {
  30492. // -> type indicates that the data is Binary and binary type is "arraybuffer"
  30493. // a new ArrayBuffer object, created in the relevant Realm of the
  30494. // WebSocket object, whose contents are data
  30495. dataForEvent = new Uint8Array(data).buffer
  30496. }
  30497. }
  30498. // 3. Fire an event named message at the WebSocket object, using MessageEvent,
  30499. // with the origin attribute initialized to the serialization of the WebSocket
  30500. // object’s url's origin, and the data attribute initialized to dataForEvent.
  30501. fireEvent('message', ws, MessageEvent, {
  30502. origin: ws[kWebSocketURL].origin,
  30503. data: dataForEvent
  30504. })
  30505. }
  30506. /**
  30507. * @see https://datatracker.ietf.org/doc/html/rfc6455
  30508. * @see https://datatracker.ietf.org/doc/html/rfc2616
  30509. * @see https://bugs.chromium.org/p/chromium/issues/detail?id=398407
  30510. * @param {string} protocol
  30511. */
  30512. function isValidSubprotocol (protocol) {
  30513. // If present, this value indicates one
  30514. // or more comma-separated subprotocol the client wishes to speak,
  30515. // ordered by preference. The elements that comprise this value
  30516. // MUST be non-empty strings with characters in the range U+0021 to
  30517. // U+007E not including separator characters as defined in
  30518. // [RFC2616] and MUST all be unique strings.
  30519. if (protocol.length === 0) {
  30520. return false
  30521. }
  30522. for (const char of protocol) {
  30523. const code = char.charCodeAt(0)
  30524. if (
  30525. code < 0x21 ||
  30526. code > 0x7E ||
  30527. char === '(' ||
  30528. char === ')' ||
  30529. char === '<' ||
  30530. char === '>' ||
  30531. char === '@' ||
  30532. char === ',' ||
  30533. char === ';' ||
  30534. char === ':' ||
  30535. char === '\\' ||
  30536. char === '"' ||
  30537. char === '/' ||
  30538. char === '[' ||
  30539. char === ']' ||
  30540. char === '?' ||
  30541. char === '=' ||
  30542. char === '{' ||
  30543. char === '}' ||
  30544. code === 32 || // SP
  30545. code === 9 // HT
  30546. ) {
  30547. return false
  30548. }
  30549. }
  30550. return true
  30551. }
  30552. /**
  30553. * @see https://datatracker.ietf.org/doc/html/rfc6455#section-7-4
  30554. * @param {number} code
  30555. */
  30556. function isValidStatusCode (code) {
  30557. if (code >= 1000 && code < 1015) {
  30558. return (
  30559. code !== 1004 && // reserved
  30560. code !== 1005 && // "MUST NOT be set as a status code"
  30561. code !== 1006 // "MUST NOT be set as a status code"
  30562. )
  30563. }
  30564. return code >= 3000 && code <= 4999
  30565. }
  30566. /**
  30567. * @param {import('./websocket').WebSocket} ws
  30568. * @param {string|undefined} reason
  30569. */
  30570. function failWebsocketConnection (ws, reason) {
  30571. const { [kController]: controller, [kResponse]: response } = ws
  30572. controller.abort()
  30573. if (response?.socket && !response.socket.destroyed) {
  30574. response.socket.destroy()
  30575. }
  30576. if (reason) {
  30577. fireEvent('error', ws, ErrorEvent, {
  30578. error: new Error(reason)
  30579. })
  30580. }
  30581. }
  30582. module.exports = {
  30583. isEstablished,
  30584. isClosing,
  30585. isClosed,
  30586. fireEvent,
  30587. isValidSubprotocol,
  30588. isValidStatusCode,
  30589. failWebsocketConnection,
  30590. websocketMessageReceived
  30591. }
  30592. /***/ }),
  30593. /***/ 4284:
  30594. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  30595. "use strict";
  30596. const { webidl } = __nccwpck_require__(1744)
  30597. const { DOMException } = __nccwpck_require__(1037)
  30598. const { URLSerializer } = __nccwpck_require__(685)
  30599. const { getGlobalOrigin } = __nccwpck_require__(1246)
  30600. const { staticPropertyDescriptors, states, opcodes, emptyBuffer } = __nccwpck_require__(9188)
  30601. const {
  30602. kWebSocketURL,
  30603. kReadyState,
  30604. kController,
  30605. kBinaryType,
  30606. kResponse,
  30607. kSentClose,
  30608. kByteParser
  30609. } = __nccwpck_require__(7578)
  30610. const { isEstablished, isClosing, isValidSubprotocol, failWebsocketConnection, fireEvent } = __nccwpck_require__(5515)
  30611. const { establishWebSocketConnection } = __nccwpck_require__(5354)
  30612. const { WebsocketFrameSend } = __nccwpck_require__(5444)
  30613. const { ByteParser } = __nccwpck_require__(1688)
  30614. const { kEnumerableProperty, isBlobLike } = __nccwpck_require__(3983)
  30615. const { getGlobalDispatcher } = __nccwpck_require__(1892)
  30616. const { types } = __nccwpck_require__(3837)
  30617. let experimentalWarned = false
  30618. // https://websockets.spec.whatwg.org/#interface-definition
  30619. class WebSocket extends EventTarget {
  30620. #events = {
  30621. open: null,
  30622. error: null,
  30623. close: null,
  30624. message: null
  30625. }
  30626. #bufferedAmount = 0
  30627. #protocol = ''
  30628. #extensions = ''
  30629. /**
  30630. * @param {string} url
  30631. * @param {string|string[]} protocols
  30632. */
  30633. constructor (url, protocols = []) {
  30634. super()
  30635. webidl.argumentLengthCheck(arguments, 1, { header: 'WebSocket constructor' })
  30636. if (!experimentalWarned) {
  30637. experimentalWarned = true
  30638. process.emitWarning('WebSockets are experimental, expect them to change at any time.', {
  30639. code: 'UNDICI-WS'
  30640. })
  30641. }
  30642. const options = webidl.converters['DOMString or sequence<DOMString> or WebSocketInit'](protocols)
  30643. url = webidl.converters.USVString(url)
  30644. protocols = options.protocols
  30645. // 1. Let baseURL be this's relevant settings object's API base URL.
  30646. const baseURL = getGlobalOrigin()
  30647. // 1. Let urlRecord be the result of applying the URL parser to url with baseURL.
  30648. let urlRecord
  30649. try {
  30650. urlRecord = new URL(url, baseURL)
  30651. } catch (e) {
  30652. // 3. If urlRecord is failure, then throw a "SyntaxError" DOMException.
  30653. throw new DOMException(e, 'SyntaxError')
  30654. }
  30655. // 4. If urlRecord’s scheme is "http", then set urlRecord’s scheme to "ws".
  30656. if (urlRecord.protocol === 'http:') {
  30657. urlRecord.protocol = 'ws:'
  30658. } else if (urlRecord.protocol === 'https:') {
  30659. // 5. Otherwise, if urlRecord’s scheme is "https", set urlRecord’s scheme to "wss".
  30660. urlRecord.protocol = 'wss:'
  30661. }
  30662. // 6. If urlRecord’s scheme is not "ws" or "wss", then throw a "SyntaxError" DOMException.
  30663. if (urlRecord.protocol !== 'ws:' && urlRecord.protocol !== 'wss:') {
  30664. throw new DOMException(
  30665. `Expected a ws: or wss: protocol, got ${urlRecord.protocol}`,
  30666. 'SyntaxError'
  30667. )
  30668. }
  30669. // 7. If urlRecord’s fragment is non-null, then throw a "SyntaxError"
  30670. // DOMException.
  30671. if (urlRecord.hash || urlRecord.href.endsWith('#')) {
  30672. throw new DOMException('Got fragment', 'SyntaxError')
  30673. }
  30674. // 8. If protocols is a string, set protocols to a sequence consisting
  30675. // of just that string.
  30676. if (typeof protocols === 'string') {
  30677. protocols = [protocols]
  30678. }
  30679. // 9. If any of the values in protocols occur more than once or otherwise
  30680. // fail to match the requirements for elements that comprise the value
  30681. // of `Sec-WebSocket-Protocol` fields as defined by The WebSocket
  30682. // protocol, then throw a "SyntaxError" DOMException.
  30683. if (protocols.length !== new Set(protocols.map(p => p.toLowerCase())).size) {
  30684. throw new DOMException('Invalid Sec-WebSocket-Protocol value', 'SyntaxError')
  30685. }
  30686. if (protocols.length > 0 && !protocols.every(p => isValidSubprotocol(p))) {
  30687. throw new DOMException('Invalid Sec-WebSocket-Protocol value', 'SyntaxError')
  30688. }
  30689. // 10. Set this's url to urlRecord.
  30690. this[kWebSocketURL] = new URL(urlRecord.href)
  30691. // 11. Let client be this's relevant settings object.
  30692. // 12. Run this step in parallel:
  30693. // 1. Establish a WebSocket connection given urlRecord, protocols,
  30694. // and client.
  30695. this[kController] = establishWebSocketConnection(
  30696. urlRecord,
  30697. protocols,
  30698. this,
  30699. (response) => this.#onConnectionEstablished(response),
  30700. options
  30701. )
  30702. // Each WebSocket object has an associated ready state, which is a
  30703. // number representing the state of the connection. Initially it must
  30704. // be CONNECTING (0).
  30705. this[kReadyState] = WebSocket.CONNECTING
  30706. // The extensions attribute must initially return the empty string.
  30707. // The protocol attribute must initially return the empty string.
  30708. // Each WebSocket object has an associated binary type, which is a
  30709. // BinaryType. Initially it must be "blob".
  30710. this[kBinaryType] = 'blob'
  30711. }
  30712. /**
  30713. * @see https://websockets.spec.whatwg.org/#dom-websocket-close
  30714. * @param {number|undefined} code
  30715. * @param {string|undefined} reason
  30716. */
  30717. close (code = undefined, reason = undefined) {
  30718. webidl.brandCheck(this, WebSocket)
  30719. if (code !== undefined) {
  30720. code = webidl.converters['unsigned short'](code, { clamp: true })
  30721. }
  30722. if (reason !== undefined) {
  30723. reason = webidl.converters.USVString(reason)
  30724. }
  30725. // 1. If code is present, but is neither an integer equal to 1000 nor an
  30726. // integer in the range 3000 to 4999, inclusive, throw an
  30727. // "InvalidAccessError" DOMException.
  30728. if (code !== undefined) {
  30729. if (code !== 1000 && (code < 3000 || code > 4999)) {
  30730. throw new DOMException('invalid code', 'InvalidAccessError')
  30731. }
  30732. }
  30733. let reasonByteLength = 0
  30734. // 2. If reason is present, then run these substeps:
  30735. if (reason !== undefined) {
  30736. // 1. Let reasonBytes be the result of encoding reason.
  30737. // 2. If reasonBytes is longer than 123 bytes, then throw a
  30738. // "SyntaxError" DOMException.
  30739. reasonByteLength = Buffer.byteLength(reason)
  30740. if (reasonByteLength > 123) {
  30741. throw new DOMException(
  30742. `Reason must be less than 123 bytes; received ${reasonByteLength}`,
  30743. 'SyntaxError'
  30744. )
  30745. }
  30746. }
  30747. // 3. Run the first matching steps from the following list:
  30748. if (this[kReadyState] === WebSocket.CLOSING || this[kReadyState] === WebSocket.CLOSED) {
  30749. // If this's ready state is CLOSING (2) or CLOSED (3)
  30750. // Do nothing.
  30751. } else if (!isEstablished(this)) {
  30752. // If the WebSocket connection is not yet established
  30753. // Fail the WebSocket connection and set this's ready state
  30754. // to CLOSING (2).
  30755. failWebsocketConnection(this, 'Connection was closed before it was established.')
  30756. this[kReadyState] = WebSocket.CLOSING
  30757. } else if (!isClosing(this)) {
  30758. // If the WebSocket closing handshake has not yet been started
  30759. // Start the WebSocket closing handshake and set this's ready
  30760. // state to CLOSING (2).
  30761. // - If neither code nor reason is present, the WebSocket Close
  30762. // message must not have a body.
  30763. // - If code is present, then the status code to use in the
  30764. // WebSocket Close message must be the integer given by code.
  30765. // - If reason is also present, then reasonBytes must be
  30766. // provided in the Close message after the status code.
  30767. const frame = new WebsocketFrameSend()
  30768. // If neither code nor reason is present, the WebSocket Close
  30769. // message must not have a body.
  30770. // If code is present, then the status code to use in the
  30771. // WebSocket Close message must be the integer given by code.
  30772. if (code !== undefined && reason === undefined) {
  30773. frame.frameData = Buffer.allocUnsafe(2)
  30774. frame.frameData.writeUInt16BE(code, 0)
  30775. } else if (code !== undefined && reason !== undefined) {
  30776. // If reason is also present, then reasonBytes must be
  30777. // provided in the Close message after the status code.
  30778. frame.frameData = Buffer.allocUnsafe(2 + reasonByteLength)
  30779. frame.frameData.writeUInt16BE(code, 0)
  30780. // the body MAY contain UTF-8-encoded data with value /reason/
  30781. frame.frameData.write(reason, 2, 'utf-8')
  30782. } else {
  30783. frame.frameData = emptyBuffer
  30784. }
  30785. /** @type {import('stream').Duplex} */
  30786. const socket = this[kResponse].socket
  30787. socket.write(frame.createFrame(opcodes.CLOSE), (err) => {
  30788. if (!err) {
  30789. this[kSentClose] = true
  30790. }
  30791. })
  30792. // Upon either sending or receiving a Close control frame, it is said
  30793. // that _The WebSocket Closing Handshake is Started_ and that the
  30794. // WebSocket connection is in the CLOSING state.
  30795. this[kReadyState] = states.CLOSING
  30796. } else {
  30797. // Otherwise
  30798. // Set this's ready state to CLOSING (2).
  30799. this[kReadyState] = WebSocket.CLOSING
  30800. }
  30801. }
  30802. /**
  30803. * @see https://websockets.spec.whatwg.org/#dom-websocket-send
  30804. * @param {NodeJS.TypedArray|ArrayBuffer|Blob|string} data
  30805. */
  30806. send (data) {
  30807. webidl.brandCheck(this, WebSocket)
  30808. webidl.argumentLengthCheck(arguments, 1, { header: 'WebSocket.send' })
  30809. data = webidl.converters.WebSocketSendData(data)
  30810. // 1. If this's ready state is CONNECTING, then throw an
  30811. // "InvalidStateError" DOMException.
  30812. if (this[kReadyState] === WebSocket.CONNECTING) {
  30813. throw new DOMException('Sent before connected.', 'InvalidStateError')
  30814. }
  30815. // 2. Run the appropriate set of steps from the following list:
  30816. // https://datatracker.ietf.org/doc/html/rfc6455#section-6.1
  30817. // https://datatracker.ietf.org/doc/html/rfc6455#section-5.2
  30818. if (!isEstablished(this) || isClosing(this)) {
  30819. return
  30820. }
  30821. /** @type {import('stream').Duplex} */
  30822. const socket = this[kResponse].socket
  30823. // If data is a string
  30824. if (typeof data === 'string') {
  30825. // If the WebSocket connection is established and the WebSocket
  30826. // closing handshake has not yet started, then the user agent
  30827. // must send a WebSocket Message comprised of the data argument
  30828. // using a text frame opcode; if the data cannot be sent, e.g.
  30829. // because it would need to be buffered but the buffer is full,
  30830. // the user agent must flag the WebSocket as full and then close
  30831. // the WebSocket connection. Any invocation of this method with a
  30832. // string argument that does not throw an exception must increase
  30833. // the bufferedAmount attribute by the number of bytes needed to
  30834. // express the argument as UTF-8.
  30835. const value = Buffer.from(data)
  30836. const frame = new WebsocketFrameSend(value)
  30837. const buffer = frame.createFrame(opcodes.TEXT)
  30838. this.#bufferedAmount += value.byteLength
  30839. socket.write(buffer, () => {
  30840. this.#bufferedAmount -= value.byteLength
  30841. })
  30842. } else if (types.isArrayBuffer(data)) {
  30843. // If the WebSocket connection is established, and the WebSocket
  30844. // closing handshake has not yet started, then the user agent must
  30845. // send a WebSocket Message comprised of data using a binary frame
  30846. // opcode; if the data cannot be sent, e.g. because it would need
  30847. // to be buffered but the buffer is full, the user agent must flag
  30848. // the WebSocket as full and then close the WebSocket connection.
  30849. // The data to be sent is the data stored in the buffer described
  30850. // by the ArrayBuffer object. Any invocation of this method with an
  30851. // ArrayBuffer argument that does not throw an exception must
  30852. // increase the bufferedAmount attribute by the length of the
  30853. // ArrayBuffer in bytes.
  30854. const value = Buffer.from(data)
  30855. const frame = new WebsocketFrameSend(value)
  30856. const buffer = frame.createFrame(opcodes.BINARY)
  30857. this.#bufferedAmount += value.byteLength
  30858. socket.write(buffer, () => {
  30859. this.#bufferedAmount -= value.byteLength
  30860. })
  30861. } else if (ArrayBuffer.isView(data)) {
  30862. // If the WebSocket connection is established, and the WebSocket
  30863. // closing handshake has not yet started, then the user agent must
  30864. // send a WebSocket Message comprised of data using a binary frame
  30865. // opcode; if the data cannot be sent, e.g. because it would need to
  30866. // be buffered but the buffer is full, the user agent must flag the
  30867. // WebSocket as full and then close the WebSocket connection. The
  30868. // data to be sent is the data stored in the section of the buffer
  30869. // described by the ArrayBuffer object that data references. Any
  30870. // invocation of this method with this kind of argument that does
  30871. // not throw an exception must increase the bufferedAmount attribute
  30872. // by the length of data’s buffer in bytes.
  30873. const ab = Buffer.from(data, data.byteOffset, data.byteLength)
  30874. const frame = new WebsocketFrameSend(ab)
  30875. const buffer = frame.createFrame(opcodes.BINARY)
  30876. this.#bufferedAmount += ab.byteLength
  30877. socket.write(buffer, () => {
  30878. this.#bufferedAmount -= ab.byteLength
  30879. })
  30880. } else if (isBlobLike(data)) {
  30881. // If the WebSocket connection is established, and the WebSocket
  30882. // closing handshake has not yet started, then the user agent must
  30883. // send a WebSocket Message comprised of data using a binary frame
  30884. // opcode; if the data cannot be sent, e.g. because it would need to
  30885. // be buffered but the buffer is full, the user agent must flag the
  30886. // WebSocket as full and then close the WebSocket connection. The data
  30887. // to be sent is the raw data represented by the Blob object. Any
  30888. // invocation of this method with a Blob argument that does not throw
  30889. // an exception must increase the bufferedAmount attribute by the size
  30890. // of the Blob object’s raw data, in bytes.
  30891. const frame = new WebsocketFrameSend()
  30892. data.arrayBuffer().then((ab) => {
  30893. const value = Buffer.from(ab)
  30894. frame.frameData = value
  30895. const buffer = frame.createFrame(opcodes.BINARY)
  30896. this.#bufferedAmount += value.byteLength
  30897. socket.write(buffer, () => {
  30898. this.#bufferedAmount -= value.byteLength
  30899. })
  30900. })
  30901. }
  30902. }
  30903. get readyState () {
  30904. webidl.brandCheck(this, WebSocket)
  30905. // The readyState getter steps are to return this's ready state.
  30906. return this[kReadyState]
  30907. }
  30908. get bufferedAmount () {
  30909. webidl.brandCheck(this, WebSocket)
  30910. return this.#bufferedAmount
  30911. }
  30912. get url () {
  30913. webidl.brandCheck(this, WebSocket)
  30914. // The url getter steps are to return this's url, serialized.
  30915. return URLSerializer(this[kWebSocketURL])
  30916. }
  30917. get extensions () {
  30918. webidl.brandCheck(this, WebSocket)
  30919. return this.#extensions
  30920. }
  30921. get protocol () {
  30922. webidl.brandCheck(this, WebSocket)
  30923. return this.#protocol
  30924. }
  30925. get onopen () {
  30926. webidl.brandCheck(this, WebSocket)
  30927. return this.#events.open
  30928. }
  30929. set onopen (fn) {
  30930. webidl.brandCheck(this, WebSocket)
  30931. if (this.#events.open) {
  30932. this.removeEventListener('open', this.#events.open)
  30933. }
  30934. if (typeof fn === 'function') {
  30935. this.#events.open = fn
  30936. this.addEventListener('open', fn)
  30937. } else {
  30938. this.#events.open = null
  30939. }
  30940. }
  30941. get onerror () {
  30942. webidl.brandCheck(this, WebSocket)
  30943. return this.#events.error
  30944. }
  30945. set onerror (fn) {
  30946. webidl.brandCheck(this, WebSocket)
  30947. if (this.#events.error) {
  30948. this.removeEventListener('error', this.#events.error)
  30949. }
  30950. if (typeof fn === 'function') {
  30951. this.#events.error = fn
  30952. this.addEventListener('error', fn)
  30953. } else {
  30954. this.#events.error = null
  30955. }
  30956. }
  30957. get onclose () {
  30958. webidl.brandCheck(this, WebSocket)
  30959. return this.#events.close
  30960. }
  30961. set onclose (fn) {
  30962. webidl.brandCheck(this, WebSocket)
  30963. if (this.#events.close) {
  30964. this.removeEventListener('close', this.#events.close)
  30965. }
  30966. if (typeof fn === 'function') {
  30967. this.#events.close = fn
  30968. this.addEventListener('close', fn)
  30969. } else {
  30970. this.#events.close = null
  30971. }
  30972. }
  30973. get onmessage () {
  30974. webidl.brandCheck(this, WebSocket)
  30975. return this.#events.message
  30976. }
  30977. set onmessage (fn) {
  30978. webidl.brandCheck(this, WebSocket)
  30979. if (this.#events.message) {
  30980. this.removeEventListener('message', this.#events.message)
  30981. }
  30982. if (typeof fn === 'function') {
  30983. this.#events.message = fn
  30984. this.addEventListener('message', fn)
  30985. } else {
  30986. this.#events.message = null
  30987. }
  30988. }
  30989. get binaryType () {
  30990. webidl.brandCheck(this, WebSocket)
  30991. return this[kBinaryType]
  30992. }
  30993. set binaryType (type) {
  30994. webidl.brandCheck(this, WebSocket)
  30995. if (type !== 'blob' && type !== 'arraybuffer') {
  30996. this[kBinaryType] = 'blob'
  30997. } else {
  30998. this[kBinaryType] = type
  30999. }
  31000. }
  31001. /**
  31002. * @see https://websockets.spec.whatwg.org/#feedback-from-the-protocol
  31003. */
  31004. #onConnectionEstablished (response) {
  31005. // processResponse is called when the "response’s header list has been received and initialized."
  31006. // once this happens, the connection is open
  31007. this[kResponse] = response
  31008. const parser = new ByteParser(this)
  31009. parser.on('drain', function onParserDrain () {
  31010. this.ws[kResponse].socket.resume()
  31011. })
  31012. response.socket.ws = this
  31013. this[kByteParser] = parser
  31014. // 1. Change the ready state to OPEN (1).
  31015. this[kReadyState] = states.OPEN
  31016. // 2. Change the extensions attribute’s value to the extensions in use, if
  31017. // it is not the null value.
  31018. // https://datatracker.ietf.org/doc/html/rfc6455#section-9.1
  31019. const extensions = response.headersList.get('sec-websocket-extensions')
  31020. if (extensions !== null) {
  31021. this.#extensions = extensions
  31022. }
  31023. // 3. Change the protocol attribute’s value to the subprotocol in use, if
  31024. // it is not the null value.
  31025. // https://datatracker.ietf.org/doc/html/rfc6455#section-1.9
  31026. const protocol = response.headersList.get('sec-websocket-protocol')
  31027. if (protocol !== null) {
  31028. this.#protocol = protocol
  31029. }
  31030. // 4. Fire an event named open at the WebSocket object.
  31031. fireEvent('open', this)
  31032. }
  31033. }
  31034. // https://websockets.spec.whatwg.org/#dom-websocket-connecting
  31035. WebSocket.CONNECTING = WebSocket.prototype.CONNECTING = states.CONNECTING
  31036. // https://websockets.spec.whatwg.org/#dom-websocket-open
  31037. WebSocket.OPEN = WebSocket.prototype.OPEN = states.OPEN
  31038. // https://websockets.spec.whatwg.org/#dom-websocket-closing
  31039. WebSocket.CLOSING = WebSocket.prototype.CLOSING = states.CLOSING
  31040. // https://websockets.spec.whatwg.org/#dom-websocket-closed
  31041. WebSocket.CLOSED = WebSocket.prototype.CLOSED = states.CLOSED
  31042. Object.defineProperties(WebSocket.prototype, {
  31043. CONNECTING: staticPropertyDescriptors,
  31044. OPEN: staticPropertyDescriptors,
  31045. CLOSING: staticPropertyDescriptors,
  31046. CLOSED: staticPropertyDescriptors,
  31047. url: kEnumerableProperty,
  31048. readyState: kEnumerableProperty,
  31049. bufferedAmount: kEnumerableProperty,
  31050. onopen: kEnumerableProperty,
  31051. onerror: kEnumerableProperty,
  31052. onclose: kEnumerableProperty,
  31053. close: kEnumerableProperty,
  31054. onmessage: kEnumerableProperty,
  31055. binaryType: kEnumerableProperty,
  31056. send: kEnumerableProperty,
  31057. extensions: kEnumerableProperty,
  31058. protocol: kEnumerableProperty,
  31059. [Symbol.toStringTag]: {
  31060. value: 'WebSocket',
  31061. writable: false,
  31062. enumerable: false,
  31063. configurable: true
  31064. }
  31065. })
  31066. Object.defineProperties(WebSocket, {
  31067. CONNECTING: staticPropertyDescriptors,
  31068. OPEN: staticPropertyDescriptors,
  31069. CLOSING: staticPropertyDescriptors,
  31070. CLOSED: staticPropertyDescriptors
  31071. })
  31072. webidl.converters['sequence<DOMString>'] = webidl.sequenceConverter(
  31073. webidl.converters.DOMString
  31074. )
  31075. webidl.converters['DOMString or sequence<DOMString>'] = function (V) {
  31076. if (webidl.util.Type(V) === 'Object' && Symbol.iterator in V) {
  31077. return webidl.converters['sequence<DOMString>'](V)
  31078. }
  31079. return webidl.converters.DOMString(V)
  31080. }
  31081. // This implements the propsal made in https://github.com/whatwg/websockets/issues/42
  31082. webidl.converters.WebSocketInit = webidl.dictionaryConverter([
  31083. {
  31084. key: 'protocols',
  31085. converter: webidl.converters['DOMString or sequence<DOMString>'],
  31086. get defaultValue () {
  31087. return []
  31088. }
  31089. },
  31090. {
  31091. key: 'dispatcher',
  31092. converter: (V) => V,
  31093. get defaultValue () {
  31094. return getGlobalDispatcher()
  31095. }
  31096. },
  31097. {
  31098. key: 'headers',
  31099. converter: webidl.nullableConverter(webidl.converters.HeadersInit)
  31100. }
  31101. ])
  31102. webidl.converters['DOMString or sequence<DOMString> or WebSocketInit'] = function (V) {
  31103. if (webidl.util.Type(V) === 'Object' && !(Symbol.iterator in V)) {
  31104. return webidl.converters.WebSocketInit(V)
  31105. }
  31106. return { protocols: webidl.converters['DOMString or sequence<DOMString>'](V) }
  31107. }
  31108. webidl.converters.WebSocketSendData = function (V) {
  31109. if (webidl.util.Type(V) === 'Object') {
  31110. if (isBlobLike(V)) {
  31111. return webidl.converters.Blob(V, { strict: false })
  31112. }
  31113. if (ArrayBuffer.isView(V) || types.isAnyArrayBuffer(V)) {
  31114. return webidl.converters.BufferSource(V)
  31115. }
  31116. }
  31117. return webidl.converters.USVString(V)
  31118. }
  31119. module.exports = {
  31120. WebSocket
  31121. }
  31122. /***/ }),
  31123. /***/ 5030:
  31124. /***/ ((__unused_webpack_module, exports) => {
  31125. "use strict";
  31126. Object.defineProperty(exports, "__esModule", ({ value: true }));
  31127. function getUserAgent() {
  31128. if (typeof navigator === "object" && "userAgent" in navigator) {
  31129. return navigator.userAgent;
  31130. }
  31131. if (typeof process === "object" && process.version !== undefined) {
  31132. return `Node.js/${process.version.substr(1)} (${process.platform}; ${process.arch})`;
  31133. }
  31134. return "<environment undetectable>";
  31135. }
  31136. exports.getUserAgent = getUserAgent;
  31137. //# sourceMappingURL=index.js.map
  31138. /***/ }),
  31139. /***/ 5840:
  31140. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31141. "use strict";
  31142. Object.defineProperty(exports, "__esModule", ({
  31143. value: true
  31144. }));
  31145. Object.defineProperty(exports, "NIL", ({
  31146. enumerable: true,
  31147. get: function () {
  31148. return _nil.default;
  31149. }
  31150. }));
  31151. Object.defineProperty(exports, "parse", ({
  31152. enumerable: true,
  31153. get: function () {
  31154. return _parse.default;
  31155. }
  31156. }));
  31157. Object.defineProperty(exports, "stringify", ({
  31158. enumerable: true,
  31159. get: function () {
  31160. return _stringify.default;
  31161. }
  31162. }));
  31163. Object.defineProperty(exports, "v1", ({
  31164. enumerable: true,
  31165. get: function () {
  31166. return _v.default;
  31167. }
  31168. }));
  31169. Object.defineProperty(exports, "v3", ({
  31170. enumerable: true,
  31171. get: function () {
  31172. return _v2.default;
  31173. }
  31174. }));
  31175. Object.defineProperty(exports, "v4", ({
  31176. enumerable: true,
  31177. get: function () {
  31178. return _v3.default;
  31179. }
  31180. }));
  31181. Object.defineProperty(exports, "v5", ({
  31182. enumerable: true,
  31183. get: function () {
  31184. return _v4.default;
  31185. }
  31186. }));
  31187. Object.defineProperty(exports, "validate", ({
  31188. enumerable: true,
  31189. get: function () {
  31190. return _validate.default;
  31191. }
  31192. }));
  31193. Object.defineProperty(exports, "version", ({
  31194. enumerable: true,
  31195. get: function () {
  31196. return _version.default;
  31197. }
  31198. }));
  31199. var _v = _interopRequireDefault(__nccwpck_require__(8628));
  31200. var _v2 = _interopRequireDefault(__nccwpck_require__(6409));
  31201. var _v3 = _interopRequireDefault(__nccwpck_require__(5122));
  31202. var _v4 = _interopRequireDefault(__nccwpck_require__(9120));
  31203. var _nil = _interopRequireDefault(__nccwpck_require__(5332));
  31204. var _version = _interopRequireDefault(__nccwpck_require__(2414));
  31205. var _validate = _interopRequireDefault(__nccwpck_require__(6900));
  31206. var _stringify = _interopRequireDefault(__nccwpck_require__(8950));
  31207. var _parse = _interopRequireDefault(__nccwpck_require__(2746));
  31208. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31209. /***/ }),
  31210. /***/ 4569:
  31211. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31212. "use strict";
  31213. Object.defineProperty(exports, "__esModule", ({
  31214. value: true
  31215. }));
  31216. exports["default"] = void 0;
  31217. var _crypto = _interopRequireDefault(__nccwpck_require__(6113));
  31218. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31219. function md5(bytes) {
  31220. if (Array.isArray(bytes)) {
  31221. bytes = Buffer.from(bytes);
  31222. } else if (typeof bytes === 'string') {
  31223. bytes = Buffer.from(bytes, 'utf8');
  31224. }
  31225. return _crypto.default.createHash('md5').update(bytes).digest();
  31226. }
  31227. var _default = md5;
  31228. exports["default"] = _default;
  31229. /***/ }),
  31230. /***/ 2054:
  31231. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31232. "use strict";
  31233. Object.defineProperty(exports, "__esModule", ({
  31234. value: true
  31235. }));
  31236. exports["default"] = void 0;
  31237. var _crypto = _interopRequireDefault(__nccwpck_require__(6113));
  31238. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31239. var _default = {
  31240. randomUUID: _crypto.default.randomUUID
  31241. };
  31242. exports["default"] = _default;
  31243. /***/ }),
  31244. /***/ 5332:
  31245. /***/ ((__unused_webpack_module, exports) => {
  31246. "use strict";
  31247. Object.defineProperty(exports, "__esModule", ({
  31248. value: true
  31249. }));
  31250. exports["default"] = void 0;
  31251. var _default = '00000000-0000-0000-0000-000000000000';
  31252. exports["default"] = _default;
  31253. /***/ }),
  31254. /***/ 2746:
  31255. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31256. "use strict";
  31257. Object.defineProperty(exports, "__esModule", ({
  31258. value: true
  31259. }));
  31260. exports["default"] = void 0;
  31261. var _validate = _interopRequireDefault(__nccwpck_require__(6900));
  31262. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31263. function parse(uuid) {
  31264. if (!(0, _validate.default)(uuid)) {
  31265. throw TypeError('Invalid UUID');
  31266. }
  31267. let v;
  31268. const arr = new Uint8Array(16); // Parse ########-....-....-....-............
  31269. arr[0] = (v = parseInt(uuid.slice(0, 8), 16)) >>> 24;
  31270. arr[1] = v >>> 16 & 0xff;
  31271. arr[2] = v >>> 8 & 0xff;
  31272. arr[3] = v & 0xff; // Parse ........-####-....-....-............
  31273. arr[4] = (v = parseInt(uuid.slice(9, 13), 16)) >>> 8;
  31274. arr[5] = v & 0xff; // Parse ........-....-####-....-............
  31275. arr[6] = (v = parseInt(uuid.slice(14, 18), 16)) >>> 8;
  31276. arr[7] = v & 0xff; // Parse ........-....-....-####-............
  31277. arr[8] = (v = parseInt(uuid.slice(19, 23), 16)) >>> 8;
  31278. arr[9] = v & 0xff; // Parse ........-....-....-....-############
  31279. // (Use "/" to avoid 32-bit truncation when bit-shifting high-order bytes)
  31280. arr[10] = (v = parseInt(uuid.slice(24, 36), 16)) / 0x10000000000 & 0xff;
  31281. arr[11] = v / 0x100000000 & 0xff;
  31282. arr[12] = v >>> 24 & 0xff;
  31283. arr[13] = v >>> 16 & 0xff;
  31284. arr[14] = v >>> 8 & 0xff;
  31285. arr[15] = v & 0xff;
  31286. return arr;
  31287. }
  31288. var _default = parse;
  31289. exports["default"] = _default;
  31290. /***/ }),
  31291. /***/ 814:
  31292. /***/ ((__unused_webpack_module, exports) => {
  31293. "use strict";
  31294. Object.defineProperty(exports, "__esModule", ({
  31295. value: true
  31296. }));
  31297. exports["default"] = void 0;
  31298. 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;
  31299. exports["default"] = _default;
  31300. /***/ }),
  31301. /***/ 807:
  31302. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31303. "use strict";
  31304. Object.defineProperty(exports, "__esModule", ({
  31305. value: true
  31306. }));
  31307. exports["default"] = rng;
  31308. var _crypto = _interopRequireDefault(__nccwpck_require__(6113));
  31309. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31310. const rnds8Pool = new Uint8Array(256); // # of random values to pre-allocate
  31311. let poolPtr = rnds8Pool.length;
  31312. function rng() {
  31313. if (poolPtr > rnds8Pool.length - 16) {
  31314. _crypto.default.randomFillSync(rnds8Pool);
  31315. poolPtr = 0;
  31316. }
  31317. return rnds8Pool.slice(poolPtr, poolPtr += 16);
  31318. }
  31319. /***/ }),
  31320. /***/ 5274:
  31321. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31322. "use strict";
  31323. Object.defineProperty(exports, "__esModule", ({
  31324. value: true
  31325. }));
  31326. exports["default"] = void 0;
  31327. var _crypto = _interopRequireDefault(__nccwpck_require__(6113));
  31328. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31329. function sha1(bytes) {
  31330. if (Array.isArray(bytes)) {
  31331. bytes = Buffer.from(bytes);
  31332. } else if (typeof bytes === 'string') {
  31333. bytes = Buffer.from(bytes, 'utf8');
  31334. }
  31335. return _crypto.default.createHash('sha1').update(bytes).digest();
  31336. }
  31337. var _default = sha1;
  31338. exports["default"] = _default;
  31339. /***/ }),
  31340. /***/ 8950:
  31341. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31342. "use strict";
  31343. Object.defineProperty(exports, "__esModule", ({
  31344. value: true
  31345. }));
  31346. exports["default"] = void 0;
  31347. exports.unsafeStringify = unsafeStringify;
  31348. var _validate = _interopRequireDefault(__nccwpck_require__(6900));
  31349. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31350. /**
  31351. * Convert array of 16 byte values to UUID string format of the form:
  31352. * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
  31353. */
  31354. const byteToHex = [];
  31355. for (let i = 0; i < 256; ++i) {
  31356. byteToHex.push((i + 0x100).toString(16).slice(1));
  31357. }
  31358. function unsafeStringify(arr, offset = 0) {
  31359. // Note: Be careful editing this code! It's been tuned for performance
  31360. // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
  31361. 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]];
  31362. }
  31363. function stringify(arr, offset = 0) {
  31364. const uuid = unsafeStringify(arr, offset); // Consistency check for valid UUID. If this throws, it's likely due to one
  31365. // of the following:
  31366. // - One or more input array values don't map to a hex octet (leading to
  31367. // "undefined" in the uuid)
  31368. // - Invalid input values for the RFC `version` or `variant` fields
  31369. if (!(0, _validate.default)(uuid)) {
  31370. throw TypeError('Stringified UUID is invalid');
  31371. }
  31372. return uuid;
  31373. }
  31374. var _default = stringify;
  31375. exports["default"] = _default;
  31376. /***/ }),
  31377. /***/ 8628:
  31378. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31379. "use strict";
  31380. Object.defineProperty(exports, "__esModule", ({
  31381. value: true
  31382. }));
  31383. exports["default"] = void 0;
  31384. var _rng = _interopRequireDefault(__nccwpck_require__(807));
  31385. var _stringify = __nccwpck_require__(8950);
  31386. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31387. // **`v1()` - Generate time-based UUID**
  31388. //
  31389. // Inspired by https://github.com/LiosK/UUID.js
  31390. // and http://docs.python.org/library/uuid.html
  31391. let _nodeId;
  31392. let _clockseq; // Previous uuid creation time
  31393. let _lastMSecs = 0;
  31394. let _lastNSecs = 0; // See https://github.com/uuidjs/uuid for API details
  31395. function v1(options, buf, offset) {
  31396. let i = buf && offset || 0;
  31397. const b = buf || new Array(16);
  31398. options = options || {};
  31399. let node = options.node || _nodeId;
  31400. let clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq; // node and clockseq need to be initialized to random values if they're not
  31401. // specified. We do this lazily to minimize issues related to insufficient
  31402. // system entropy. See #189
  31403. if (node == null || clockseq == null) {
  31404. const seedBytes = options.random || (options.rng || _rng.default)();
  31405. if (node == null) {
  31406. // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1)
  31407. node = _nodeId = [seedBytes[0] | 0x01, seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]];
  31408. }
  31409. if (clockseq == null) {
  31410. // Per 4.2.2, randomize (14 bit) clockseq
  31411. clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff;
  31412. }
  31413. } // UUID timestamps are 100 nano-second units since the Gregorian epoch,
  31414. // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so
  31415. // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs'
  31416. // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00.
  31417. let msecs = options.msecs !== undefined ? options.msecs : Date.now(); // Per 4.2.1.2, use count of uuid's generated during the current clock
  31418. // cycle to simulate higher resolution clock
  31419. let nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1; // Time since last uuid creation (in msecs)
  31420. const dt = msecs - _lastMSecs + (nsecs - _lastNSecs) / 10000; // Per 4.2.1.2, Bump clockseq on clock regression
  31421. if (dt < 0 && options.clockseq === undefined) {
  31422. clockseq = clockseq + 1 & 0x3fff;
  31423. } // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new
  31424. // time interval
  31425. if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) {
  31426. nsecs = 0;
  31427. } // Per 4.2.1.2 Throw error if too many uuids are requested
  31428. if (nsecs >= 10000) {
  31429. throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");
  31430. }
  31431. _lastMSecs = msecs;
  31432. _lastNSecs = nsecs;
  31433. _clockseq = clockseq; // Per 4.1.4 - Convert from unix epoch to Gregorian epoch
  31434. msecs += 12219292800000; // `time_low`
  31435. const tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000;
  31436. b[i++] = tl >>> 24 & 0xff;
  31437. b[i++] = tl >>> 16 & 0xff;
  31438. b[i++] = tl >>> 8 & 0xff;
  31439. b[i++] = tl & 0xff; // `time_mid`
  31440. const tmh = msecs / 0x100000000 * 10000 & 0xfffffff;
  31441. b[i++] = tmh >>> 8 & 0xff;
  31442. b[i++] = tmh & 0xff; // `time_high_and_version`
  31443. b[i++] = tmh >>> 24 & 0xf | 0x10; // include version
  31444. b[i++] = tmh >>> 16 & 0xff; // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant)
  31445. b[i++] = clockseq >>> 8 | 0x80; // `clock_seq_low`
  31446. b[i++] = clockseq & 0xff; // `node`
  31447. for (let n = 0; n < 6; ++n) {
  31448. b[i + n] = node[n];
  31449. }
  31450. return buf || (0, _stringify.unsafeStringify)(b);
  31451. }
  31452. var _default = v1;
  31453. exports["default"] = _default;
  31454. /***/ }),
  31455. /***/ 6409:
  31456. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31457. "use strict";
  31458. Object.defineProperty(exports, "__esModule", ({
  31459. value: true
  31460. }));
  31461. exports["default"] = void 0;
  31462. var _v = _interopRequireDefault(__nccwpck_require__(5998));
  31463. var _md = _interopRequireDefault(__nccwpck_require__(4569));
  31464. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31465. const v3 = (0, _v.default)('v3', 0x30, _md.default);
  31466. var _default = v3;
  31467. exports["default"] = _default;
  31468. /***/ }),
  31469. /***/ 5998:
  31470. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31471. "use strict";
  31472. Object.defineProperty(exports, "__esModule", ({
  31473. value: true
  31474. }));
  31475. exports.URL = exports.DNS = void 0;
  31476. exports["default"] = v35;
  31477. var _stringify = __nccwpck_require__(8950);
  31478. var _parse = _interopRequireDefault(__nccwpck_require__(2746));
  31479. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31480. function stringToBytes(str) {
  31481. str = unescape(encodeURIComponent(str)); // UTF8 escape
  31482. const bytes = [];
  31483. for (let i = 0; i < str.length; ++i) {
  31484. bytes.push(str.charCodeAt(i));
  31485. }
  31486. return bytes;
  31487. }
  31488. const DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8';
  31489. exports.DNS = DNS;
  31490. const URL = '6ba7b811-9dad-11d1-80b4-00c04fd430c8';
  31491. exports.URL = URL;
  31492. function v35(name, version, hashfunc) {
  31493. function generateUUID(value, namespace, buf, offset) {
  31494. var _namespace;
  31495. if (typeof value === 'string') {
  31496. value = stringToBytes(value);
  31497. }
  31498. if (typeof namespace === 'string') {
  31499. namespace = (0, _parse.default)(namespace);
  31500. }
  31501. if (((_namespace = namespace) === null || _namespace === void 0 ? void 0 : _namespace.length) !== 16) {
  31502. throw TypeError('Namespace must be array-like (16 iterable integer values, 0-255)');
  31503. } // Compute hash of namespace and value, Per 4.3
  31504. // Future: Use spread syntax when supported on all platforms, e.g. `bytes =
  31505. // hashfunc([...namespace, ... value])`
  31506. let bytes = new Uint8Array(16 + value.length);
  31507. bytes.set(namespace);
  31508. bytes.set(value, namespace.length);
  31509. bytes = hashfunc(bytes);
  31510. bytes[6] = bytes[6] & 0x0f | version;
  31511. bytes[8] = bytes[8] & 0x3f | 0x80;
  31512. if (buf) {
  31513. offset = offset || 0;
  31514. for (let i = 0; i < 16; ++i) {
  31515. buf[offset + i] = bytes[i];
  31516. }
  31517. return buf;
  31518. }
  31519. return (0, _stringify.unsafeStringify)(bytes);
  31520. } // Function#name is not settable on some platforms (#270)
  31521. try {
  31522. generateUUID.name = name; // eslint-disable-next-line no-empty
  31523. } catch (err) {} // For CommonJS default export support
  31524. generateUUID.DNS = DNS;
  31525. generateUUID.URL = URL;
  31526. return generateUUID;
  31527. }
  31528. /***/ }),
  31529. /***/ 5122:
  31530. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31531. "use strict";
  31532. Object.defineProperty(exports, "__esModule", ({
  31533. value: true
  31534. }));
  31535. exports["default"] = void 0;
  31536. var _native = _interopRequireDefault(__nccwpck_require__(2054));
  31537. var _rng = _interopRequireDefault(__nccwpck_require__(807));
  31538. var _stringify = __nccwpck_require__(8950);
  31539. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31540. function v4(options, buf, offset) {
  31541. if (_native.default.randomUUID && !buf && !options) {
  31542. return _native.default.randomUUID();
  31543. }
  31544. options = options || {};
  31545. const rnds = options.random || (options.rng || _rng.default)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
  31546. rnds[6] = rnds[6] & 0x0f | 0x40;
  31547. rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided
  31548. if (buf) {
  31549. offset = offset || 0;
  31550. for (let i = 0; i < 16; ++i) {
  31551. buf[offset + i] = rnds[i];
  31552. }
  31553. return buf;
  31554. }
  31555. return (0, _stringify.unsafeStringify)(rnds);
  31556. }
  31557. var _default = v4;
  31558. exports["default"] = _default;
  31559. /***/ }),
  31560. /***/ 9120:
  31561. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31562. "use strict";
  31563. Object.defineProperty(exports, "__esModule", ({
  31564. value: true
  31565. }));
  31566. exports["default"] = void 0;
  31567. var _v = _interopRequireDefault(__nccwpck_require__(5998));
  31568. var _sha = _interopRequireDefault(__nccwpck_require__(5274));
  31569. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31570. const v5 = (0, _v.default)('v5', 0x50, _sha.default);
  31571. var _default = v5;
  31572. exports["default"] = _default;
  31573. /***/ }),
  31574. /***/ 6900:
  31575. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31576. "use strict";
  31577. Object.defineProperty(exports, "__esModule", ({
  31578. value: true
  31579. }));
  31580. exports["default"] = void 0;
  31581. var _regex = _interopRequireDefault(__nccwpck_require__(814));
  31582. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31583. function validate(uuid) {
  31584. return typeof uuid === 'string' && _regex.default.test(uuid);
  31585. }
  31586. var _default = validate;
  31587. exports["default"] = _default;
  31588. /***/ }),
  31589. /***/ 2414:
  31590. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31591. "use strict";
  31592. Object.defineProperty(exports, "__esModule", ({
  31593. value: true
  31594. }));
  31595. exports["default"] = void 0;
  31596. var _validate = _interopRequireDefault(__nccwpck_require__(6900));
  31597. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31598. function version(uuid) {
  31599. if (!(0, _validate.default)(uuid)) {
  31600. throw TypeError('Invalid UUID');
  31601. }
  31602. return parseInt(uuid.slice(14, 15), 16);
  31603. }
  31604. var _default = version;
  31605. exports["default"] = _default;
  31606. /***/ }),
  31607. /***/ 2940:
  31608. /***/ ((module) => {
  31609. // Returns a wrapper function that returns a wrapped callback
  31610. // The wrapper function should do some stuff, and return a
  31611. // presumably different callback function.
  31612. // This makes sure that own properties are retained, so that
  31613. // decorations and such are not lost along the way.
  31614. module.exports = wrappy
  31615. function wrappy (fn, cb) {
  31616. if (fn && cb) return wrappy(fn)(cb)
  31617. if (typeof fn !== 'function')
  31618. throw new TypeError('need wrapper function')
  31619. Object.keys(fn).forEach(function (k) {
  31620. wrapper[k] = fn[k]
  31621. })
  31622. return wrapper
  31623. function wrapper() {
  31624. var args = new Array(arguments.length)
  31625. for (var i = 0; i < args.length; i++) {
  31626. args[i] = arguments[i]
  31627. }
  31628. var ret = fn.apply(this, args)
  31629. var cb = args[args.length-1]
  31630. if (typeof ret === 'function' && ret !== cb) {
  31631. Object.keys(cb).forEach(function (k) {
  31632. ret[k] = cb[k]
  31633. })
  31634. }
  31635. return ret
  31636. }
  31637. }
  31638. /***/ }),
  31639. /***/ 9491:
  31640. /***/ ((module) => {
  31641. "use strict";
  31642. module.exports = require("assert");
  31643. /***/ }),
  31644. /***/ 852:
  31645. /***/ ((module) => {
  31646. "use strict";
  31647. module.exports = require("async_hooks");
  31648. /***/ }),
  31649. /***/ 4300:
  31650. /***/ ((module) => {
  31651. "use strict";
  31652. module.exports = require("buffer");
  31653. /***/ }),
  31654. /***/ 2081:
  31655. /***/ ((module) => {
  31656. "use strict";
  31657. module.exports = require("child_process");
  31658. /***/ }),
  31659. /***/ 6206:
  31660. /***/ ((module) => {
  31661. "use strict";
  31662. module.exports = require("console");
  31663. /***/ }),
  31664. /***/ 6113:
  31665. /***/ ((module) => {
  31666. "use strict";
  31667. module.exports = require("crypto");
  31668. /***/ }),
  31669. /***/ 7643:
  31670. /***/ ((module) => {
  31671. "use strict";
  31672. module.exports = require("diagnostics_channel");
  31673. /***/ }),
  31674. /***/ 2361:
  31675. /***/ ((module) => {
  31676. "use strict";
  31677. module.exports = require("events");
  31678. /***/ }),
  31679. /***/ 7147:
  31680. /***/ ((module) => {
  31681. "use strict";
  31682. module.exports = require("fs");
  31683. /***/ }),
  31684. /***/ 3685:
  31685. /***/ ((module) => {
  31686. "use strict";
  31687. module.exports = require("http");
  31688. /***/ }),
  31689. /***/ 5158:
  31690. /***/ ((module) => {
  31691. "use strict";
  31692. module.exports = require("http2");
  31693. /***/ }),
  31694. /***/ 5687:
  31695. /***/ ((module) => {
  31696. "use strict";
  31697. module.exports = require("https");
  31698. /***/ }),
  31699. /***/ 1808:
  31700. /***/ ((module) => {
  31701. "use strict";
  31702. module.exports = require("net");
  31703. /***/ }),
  31704. /***/ 6005:
  31705. /***/ ((module) => {
  31706. "use strict";
  31707. module.exports = require("node:crypto");
  31708. /***/ }),
  31709. /***/ 5673:
  31710. /***/ ((module) => {
  31711. "use strict";
  31712. module.exports = require("node:events");
  31713. /***/ }),
  31714. /***/ 4492:
  31715. /***/ ((module) => {
  31716. "use strict";
  31717. module.exports = require("node:stream");
  31718. /***/ }),
  31719. /***/ 7261:
  31720. /***/ ((module) => {
  31721. "use strict";
  31722. module.exports = require("node:util");
  31723. /***/ }),
  31724. /***/ 2037:
  31725. /***/ ((module) => {
  31726. "use strict";
  31727. module.exports = require("os");
  31728. /***/ }),
  31729. /***/ 1017:
  31730. /***/ ((module) => {
  31731. "use strict";
  31732. module.exports = require("path");
  31733. /***/ }),
  31734. /***/ 4074:
  31735. /***/ ((module) => {
  31736. "use strict";
  31737. module.exports = require("perf_hooks");
  31738. /***/ }),
  31739. /***/ 3477:
  31740. /***/ ((module) => {
  31741. "use strict";
  31742. module.exports = require("querystring");
  31743. /***/ }),
  31744. /***/ 2781:
  31745. /***/ ((module) => {
  31746. "use strict";
  31747. module.exports = require("stream");
  31748. /***/ }),
  31749. /***/ 5356:
  31750. /***/ ((module) => {
  31751. "use strict";
  31752. module.exports = require("stream/web");
  31753. /***/ }),
  31754. /***/ 1576:
  31755. /***/ ((module) => {
  31756. "use strict";
  31757. module.exports = require("string_decoder");
  31758. /***/ }),
  31759. /***/ 9512:
  31760. /***/ ((module) => {
  31761. "use strict";
  31762. module.exports = require("timers");
  31763. /***/ }),
  31764. /***/ 4404:
  31765. /***/ ((module) => {
  31766. "use strict";
  31767. module.exports = require("tls");
  31768. /***/ }),
  31769. /***/ 7310:
  31770. /***/ ((module) => {
  31771. "use strict";
  31772. module.exports = require("url");
  31773. /***/ }),
  31774. /***/ 3837:
  31775. /***/ ((module) => {
  31776. "use strict";
  31777. module.exports = require("util");
  31778. /***/ }),
  31779. /***/ 9830:
  31780. /***/ ((module) => {
  31781. "use strict";
  31782. module.exports = require("util/types");
  31783. /***/ }),
  31784. /***/ 1267:
  31785. /***/ ((module) => {
  31786. "use strict";
  31787. module.exports = require("worker_threads");
  31788. /***/ }),
  31789. /***/ 9796:
  31790. /***/ ((module) => {
  31791. "use strict";
  31792. module.exports = require("zlib");
  31793. /***/ }),
  31794. /***/ 2960:
  31795. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  31796. "use strict";
  31797. const WritableStream = (__nccwpck_require__(4492).Writable)
  31798. const inherits = (__nccwpck_require__(7261).inherits)
  31799. const StreamSearch = __nccwpck_require__(1142)
  31800. const PartStream = __nccwpck_require__(1620)
  31801. const HeaderParser = __nccwpck_require__(2032)
  31802. const DASH = 45
  31803. const B_ONEDASH = Buffer.from('-')
  31804. const B_CRLF = Buffer.from('\r\n')
  31805. const EMPTY_FN = function () {}
  31806. function Dicer (cfg) {
  31807. if (!(this instanceof Dicer)) { return new Dicer(cfg) }
  31808. WritableStream.call(this, cfg)
  31809. if (!cfg || (!cfg.headerFirst && typeof cfg.boundary !== 'string')) { throw new TypeError('Boundary required') }
  31810. if (typeof cfg.boundary === 'string') { this.setBoundary(cfg.boundary) } else { this._bparser = undefined }
  31811. this._headerFirst = cfg.headerFirst
  31812. this._dashes = 0
  31813. this._parts = 0
  31814. this._finished = false
  31815. this._realFinish = false
  31816. this._isPreamble = true
  31817. this._justMatched = false
  31818. this._firstWrite = true
  31819. this._inHeader = true
  31820. this._part = undefined
  31821. this._cb = undefined
  31822. this._ignoreData = false
  31823. this._partOpts = { highWaterMark: cfg.partHwm }
  31824. this._pause = false
  31825. const self = this
  31826. this._hparser = new HeaderParser(cfg)
  31827. this._hparser.on('header', function (header) {
  31828. self._inHeader = false
  31829. self._part.emit('header', header)
  31830. })
  31831. }
  31832. inherits(Dicer, WritableStream)
  31833. Dicer.prototype.emit = function (ev) {
  31834. if (ev === 'finish' && !this._realFinish) {
  31835. if (!this._finished) {
  31836. const self = this
  31837. process.nextTick(function () {
  31838. self.emit('error', new Error('Unexpected end of multipart data'))
  31839. if (self._part && !self._ignoreData) {
  31840. const type = (self._isPreamble ? 'Preamble' : 'Part')
  31841. self._part.emit('error', new Error(type + ' terminated early due to unexpected end of multipart data'))
  31842. self._part.push(null)
  31843. process.nextTick(function () {
  31844. self._realFinish = true
  31845. self.emit('finish')
  31846. self._realFinish = false
  31847. })
  31848. return
  31849. }
  31850. self._realFinish = true
  31851. self.emit('finish')
  31852. self._realFinish = false
  31853. })
  31854. }
  31855. } else { WritableStream.prototype.emit.apply(this, arguments) }
  31856. }
  31857. Dicer.prototype._write = function (data, encoding, cb) {
  31858. // ignore unexpected data (e.g. extra trailer data after finished)
  31859. if (!this._hparser && !this._bparser) { return cb() }
  31860. if (this._headerFirst && this._isPreamble) {
  31861. if (!this._part) {
  31862. this._part = new PartStream(this._partOpts)
  31863. if (this.listenerCount('preamble') !== 0) { this.emit('preamble', this._part) } else { this._ignore() }
  31864. }
  31865. const r = this._hparser.push(data)
  31866. if (!this._inHeader && r !== undefined && r < data.length) { data = data.slice(r) } else { return cb() }
  31867. }
  31868. // allows for "easier" testing
  31869. if (this._firstWrite) {
  31870. this._bparser.push(B_CRLF)
  31871. this._firstWrite = false
  31872. }
  31873. this._bparser.push(data)
  31874. if (this._pause) { this._cb = cb } else { cb() }
  31875. }
  31876. Dicer.prototype.reset = function () {
  31877. this._part = undefined
  31878. this._bparser = undefined
  31879. this._hparser = undefined
  31880. }
  31881. Dicer.prototype.setBoundary = function (boundary) {
  31882. const self = this
  31883. this._bparser = new StreamSearch('\r\n--' + boundary)
  31884. this._bparser.on('info', function (isMatch, data, start, end) {
  31885. self._oninfo(isMatch, data, start, end)
  31886. })
  31887. }
  31888. Dicer.prototype._ignore = function () {
  31889. if (this._part && !this._ignoreData) {
  31890. this._ignoreData = true
  31891. this._part.on('error', EMPTY_FN)
  31892. // we must perform some kind of read on the stream even though we are
  31893. // ignoring the data, otherwise node's Readable stream will not emit 'end'
  31894. // after pushing null to the stream
  31895. this._part.resume()
  31896. }
  31897. }
  31898. Dicer.prototype._oninfo = function (isMatch, data, start, end) {
  31899. let buf; const self = this; let i = 0; let r; let shouldWriteMore = true
  31900. if (!this._part && this._justMatched && data) {
  31901. while (this._dashes < 2 && (start + i) < end) {
  31902. if (data[start + i] === DASH) {
  31903. ++i
  31904. ++this._dashes
  31905. } else {
  31906. if (this._dashes) { buf = B_ONEDASH }
  31907. this._dashes = 0
  31908. break
  31909. }
  31910. }
  31911. if (this._dashes === 2) {
  31912. if ((start + i) < end && this.listenerCount('trailer') !== 0) { this.emit('trailer', data.slice(start + i, end)) }
  31913. this.reset()
  31914. this._finished = true
  31915. // no more parts will be added
  31916. if (self._parts === 0) {
  31917. self._realFinish = true
  31918. self.emit('finish')
  31919. self._realFinish = false
  31920. }
  31921. }
  31922. if (this._dashes) { return }
  31923. }
  31924. if (this._justMatched) { this._justMatched = false }
  31925. if (!this._part) {
  31926. this._part = new PartStream(this._partOpts)
  31927. this._part._read = function (n) {
  31928. self._unpause()
  31929. }
  31930. if (this._isPreamble && this.listenerCount('preamble') !== 0) {
  31931. this.emit('preamble', this._part)
  31932. } else if (this._isPreamble !== true && this.listenerCount('part') !== 0) {
  31933. this.emit('part', this._part)
  31934. } else {
  31935. this._ignore()
  31936. }
  31937. if (!this._isPreamble) { this._inHeader = true }
  31938. }
  31939. if (data && start < end && !this._ignoreData) {
  31940. if (this._isPreamble || !this._inHeader) {
  31941. if (buf) { shouldWriteMore = this._part.push(buf) }
  31942. shouldWriteMore = this._part.push(data.slice(start, end))
  31943. if (!shouldWriteMore) { this._pause = true }
  31944. } else if (!this._isPreamble && this._inHeader) {
  31945. if (buf) { this._hparser.push(buf) }
  31946. r = this._hparser.push(data.slice(start, end))
  31947. if (!this._inHeader && r !== undefined && r < end) { this._oninfo(false, data, start + r, end) }
  31948. }
  31949. }
  31950. if (isMatch) {
  31951. this._hparser.reset()
  31952. if (this._isPreamble) { this._isPreamble = false } else {
  31953. if (start !== end) {
  31954. ++this._parts
  31955. this._part.on('end', function () {
  31956. if (--self._parts === 0) {
  31957. if (self._finished) {
  31958. self._realFinish = true
  31959. self.emit('finish')
  31960. self._realFinish = false
  31961. } else {
  31962. self._unpause()
  31963. }
  31964. }
  31965. })
  31966. }
  31967. }
  31968. this._part.push(null)
  31969. this._part = undefined
  31970. this._ignoreData = false
  31971. this._justMatched = true
  31972. this._dashes = 0
  31973. }
  31974. }
  31975. Dicer.prototype._unpause = function () {
  31976. if (!this._pause) { return }
  31977. this._pause = false
  31978. if (this._cb) {
  31979. const cb = this._cb
  31980. this._cb = undefined
  31981. cb()
  31982. }
  31983. }
  31984. module.exports = Dicer
  31985. /***/ }),
  31986. /***/ 2032:
  31987. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  31988. "use strict";
  31989. const EventEmitter = (__nccwpck_require__(5673).EventEmitter)
  31990. const inherits = (__nccwpck_require__(7261).inherits)
  31991. const getLimit = __nccwpck_require__(1467)
  31992. const StreamSearch = __nccwpck_require__(1142)
  31993. const B_DCRLF = Buffer.from('\r\n\r\n')
  31994. const RE_CRLF = /\r\n/g
  31995. const RE_HDR = /^([^:]+):[ \t]?([\x00-\xFF]+)?$/ // eslint-disable-line no-control-regex
  31996. function HeaderParser (cfg) {
  31997. EventEmitter.call(this)
  31998. cfg = cfg || {}
  31999. const self = this
  32000. this.nread = 0
  32001. this.maxed = false
  32002. this.npairs = 0
  32003. this.maxHeaderPairs = getLimit(cfg, 'maxHeaderPairs', 2000)
  32004. this.maxHeaderSize = getLimit(cfg, 'maxHeaderSize', 80 * 1024)
  32005. this.buffer = ''
  32006. this.header = {}
  32007. this.finished = false
  32008. this.ss = new StreamSearch(B_DCRLF)
  32009. this.ss.on('info', function (isMatch, data, start, end) {
  32010. if (data && !self.maxed) {
  32011. if (self.nread + end - start >= self.maxHeaderSize) {
  32012. end = self.maxHeaderSize - self.nread + start
  32013. self.nread = self.maxHeaderSize
  32014. self.maxed = true
  32015. } else { self.nread += (end - start) }
  32016. self.buffer += data.toString('binary', start, end)
  32017. }
  32018. if (isMatch) { self._finish() }
  32019. })
  32020. }
  32021. inherits(HeaderParser, EventEmitter)
  32022. HeaderParser.prototype.push = function (data) {
  32023. const r = this.ss.push(data)
  32024. if (this.finished) { return r }
  32025. }
  32026. HeaderParser.prototype.reset = function () {
  32027. this.finished = false
  32028. this.buffer = ''
  32029. this.header = {}
  32030. this.ss.reset()
  32031. }
  32032. HeaderParser.prototype._finish = function () {
  32033. if (this.buffer) { this._parseHeader() }
  32034. this.ss.matches = this.ss.maxMatches
  32035. const header = this.header
  32036. this.header = {}
  32037. this.buffer = ''
  32038. this.finished = true
  32039. this.nread = this.npairs = 0
  32040. this.maxed = false
  32041. this.emit('header', header)
  32042. }
  32043. HeaderParser.prototype._parseHeader = function () {
  32044. if (this.npairs === this.maxHeaderPairs) { return }
  32045. const lines = this.buffer.split(RE_CRLF)
  32046. const len = lines.length
  32047. let m, h
  32048. for (var i = 0; i < len; ++i) { // eslint-disable-line no-var
  32049. if (lines[i].length === 0) { continue }
  32050. if (lines[i][0] === '\t' || lines[i][0] === ' ') {
  32051. // folded header content
  32052. // RFC2822 says to just remove the CRLF and not the whitespace following
  32053. // it, so we follow the RFC and include the leading whitespace ...
  32054. if (h) {
  32055. this.header[h][this.header[h].length - 1] += lines[i]
  32056. continue
  32057. }
  32058. }
  32059. const posColon = lines[i].indexOf(':')
  32060. if (
  32061. posColon === -1 ||
  32062. posColon === 0
  32063. ) {
  32064. return
  32065. }
  32066. m = RE_HDR.exec(lines[i])
  32067. h = m[1].toLowerCase()
  32068. this.header[h] = this.header[h] || []
  32069. this.header[h].push((m[2] || ''))
  32070. if (++this.npairs === this.maxHeaderPairs) { break }
  32071. }
  32072. }
  32073. module.exports = HeaderParser
  32074. /***/ }),
  32075. /***/ 1620:
  32076. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  32077. "use strict";
  32078. const inherits = (__nccwpck_require__(7261).inherits)
  32079. const ReadableStream = (__nccwpck_require__(4492).Readable)
  32080. function PartStream (opts) {
  32081. ReadableStream.call(this, opts)
  32082. }
  32083. inherits(PartStream, ReadableStream)
  32084. PartStream.prototype._read = function (n) {}
  32085. module.exports = PartStream
  32086. /***/ }),
  32087. /***/ 1142:
  32088. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  32089. "use strict";
  32090. /**
  32091. * Copyright Brian White. All rights reserved.
  32092. *
  32093. * @see https://github.com/mscdex/streamsearch
  32094. *
  32095. * Permission is hereby granted, free of charge, to any person obtaining a copy
  32096. * of this software and associated documentation files (the "Software"), to
  32097. * deal in the Software without restriction, including without limitation the
  32098. * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
  32099. * sell copies of the Software, and to permit persons to whom the Software is
  32100. * furnished to do so, subject to the following conditions:
  32101. *
  32102. * The above copyright notice and this permission notice shall be included in
  32103. * all copies or substantial portions of the Software.
  32104. *
  32105. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  32106. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  32107. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  32108. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  32109. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  32110. * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
  32111. * IN THE SOFTWARE.
  32112. *
  32113. * Based heavily on the Streaming Boyer-Moore-Horspool C++ implementation
  32114. * by Hongli Lai at: https://github.com/FooBarWidget/boyer-moore-horspool
  32115. */
  32116. const EventEmitter = (__nccwpck_require__(5673).EventEmitter)
  32117. const inherits = (__nccwpck_require__(7261).inherits)
  32118. function SBMH (needle) {
  32119. if (typeof needle === 'string') {
  32120. needle = Buffer.from(needle)
  32121. }
  32122. if (!Buffer.isBuffer(needle)) {
  32123. throw new TypeError('The needle has to be a String or a Buffer.')
  32124. }
  32125. const needleLength = needle.length
  32126. if (needleLength === 0) {
  32127. throw new Error('The needle cannot be an empty String/Buffer.')
  32128. }
  32129. if (needleLength > 256) {
  32130. throw new Error('The needle cannot have a length bigger than 256.')
  32131. }
  32132. this.maxMatches = Infinity
  32133. this.matches = 0
  32134. this._occ = new Array(256)
  32135. .fill(needleLength) // Initialize occurrence table.
  32136. this._lookbehind_size = 0
  32137. this._needle = needle
  32138. this._bufpos = 0
  32139. this._lookbehind = Buffer.alloc(needleLength)
  32140. // Populate occurrence table with analysis of the needle,
  32141. // ignoring last letter.
  32142. for (var i = 0; i < needleLength - 1; ++i) { // eslint-disable-line no-var
  32143. this._occ[needle[i]] = needleLength - 1 - i
  32144. }
  32145. }
  32146. inherits(SBMH, EventEmitter)
  32147. SBMH.prototype.reset = function () {
  32148. this._lookbehind_size = 0
  32149. this.matches = 0
  32150. this._bufpos = 0
  32151. }
  32152. SBMH.prototype.push = function (chunk, pos) {
  32153. if (!Buffer.isBuffer(chunk)) {
  32154. chunk = Buffer.from(chunk, 'binary')
  32155. }
  32156. const chlen = chunk.length
  32157. this._bufpos = pos || 0
  32158. let r
  32159. while (r !== chlen && this.matches < this.maxMatches) { r = this._sbmh_feed(chunk) }
  32160. return r
  32161. }
  32162. SBMH.prototype._sbmh_feed = function (data) {
  32163. const len = data.length
  32164. const needle = this._needle
  32165. const needleLength = needle.length
  32166. const lastNeedleChar = needle[needleLength - 1]
  32167. // Positive: points to a position in `data`
  32168. // pos == 3 points to data[3]
  32169. // Negative: points to a position in the lookbehind buffer
  32170. // pos == -2 points to lookbehind[lookbehind_size - 2]
  32171. let pos = -this._lookbehind_size
  32172. let ch
  32173. if (pos < 0) {
  32174. // Lookbehind buffer is not empty. Perform Boyer-Moore-Horspool
  32175. // search with character lookup code that considers both the
  32176. // lookbehind buffer and the current round's haystack data.
  32177. //
  32178. // Loop until
  32179. // there is a match.
  32180. // or until
  32181. // we've moved past the position that requires the
  32182. // lookbehind buffer. In this case we switch to the
  32183. // optimized loop.
  32184. // or until
  32185. // the character to look at lies outside the haystack.
  32186. while (pos < 0 && pos <= len - needleLength) {
  32187. ch = this._sbmh_lookup_char(data, pos + needleLength - 1)
  32188. if (
  32189. ch === lastNeedleChar &&
  32190. this._sbmh_memcmp(data, pos, needleLength - 1)
  32191. ) {
  32192. this._lookbehind_size = 0
  32193. ++this.matches
  32194. this.emit('info', true)
  32195. return (this._bufpos = pos + needleLength)
  32196. }
  32197. pos += this._occ[ch]
  32198. }
  32199. // No match.
  32200. if (pos < 0) {
  32201. // There's too few data for Boyer-Moore-Horspool to run,
  32202. // so let's use a different algorithm to skip as much as
  32203. // we can.
  32204. // Forward pos until
  32205. // the trailing part of lookbehind + data
  32206. // looks like the beginning of the needle
  32207. // or until
  32208. // pos == 0
  32209. while (pos < 0 && !this._sbmh_memcmp(data, pos, len - pos)) { ++pos }
  32210. }
  32211. if (pos >= 0) {
  32212. // Discard lookbehind buffer.
  32213. this.emit('info', false, this._lookbehind, 0, this._lookbehind_size)
  32214. this._lookbehind_size = 0
  32215. } else {
  32216. // Cut off part of the lookbehind buffer that has
  32217. // been processed and append the entire haystack
  32218. // into it.
  32219. const bytesToCutOff = this._lookbehind_size + pos
  32220. if (bytesToCutOff > 0) {
  32221. // The cut off data is guaranteed not to contain the needle.
  32222. this.emit('info', false, this._lookbehind, 0, bytesToCutOff)
  32223. }
  32224. this._lookbehind.copy(this._lookbehind, 0, bytesToCutOff,
  32225. this._lookbehind_size - bytesToCutOff)
  32226. this._lookbehind_size -= bytesToCutOff
  32227. data.copy(this._lookbehind, this._lookbehind_size)
  32228. this._lookbehind_size += len
  32229. this._bufpos = len
  32230. return len
  32231. }
  32232. }
  32233. pos += (pos >= 0) * this._bufpos
  32234. // Lookbehind buffer is now empty. We only need to check if the
  32235. // needle is in the haystack.
  32236. if (data.indexOf(needle, pos) !== -1) {
  32237. pos = data.indexOf(needle, pos)
  32238. ++this.matches
  32239. if (pos > 0) { this.emit('info', true, data, this._bufpos, pos) } else { this.emit('info', true) }
  32240. return (this._bufpos = pos + needleLength)
  32241. } else {
  32242. pos = len - needleLength
  32243. }
  32244. // There was no match. If there's trailing haystack data that we cannot
  32245. // match yet using the Boyer-Moore-Horspool algorithm (because the trailing
  32246. // data is less than the needle size) then match using a modified
  32247. // algorithm that starts matching from the beginning instead of the end.
  32248. // Whatever trailing data is left after running this algorithm is added to
  32249. // the lookbehind buffer.
  32250. while (
  32251. pos < len &&
  32252. (
  32253. data[pos] !== needle[0] ||
  32254. (
  32255. (Buffer.compare(
  32256. data.subarray(pos, pos + len - pos),
  32257. needle.subarray(0, len - pos)
  32258. ) !== 0)
  32259. )
  32260. )
  32261. ) {
  32262. ++pos
  32263. }
  32264. if (pos < len) {
  32265. data.copy(this._lookbehind, 0, pos, pos + (len - pos))
  32266. this._lookbehind_size = len - pos
  32267. }
  32268. // Everything until pos is guaranteed not to contain needle data.
  32269. if (pos > 0) { this.emit('info', false, data, this._bufpos, pos < len ? pos : len) }
  32270. this._bufpos = len
  32271. return len
  32272. }
  32273. SBMH.prototype._sbmh_lookup_char = function (data, pos) {
  32274. return (pos < 0)
  32275. ? this._lookbehind[this._lookbehind_size + pos]
  32276. : data[pos]
  32277. }
  32278. SBMH.prototype._sbmh_memcmp = function (data, pos, len) {
  32279. for (var i = 0; i < len; ++i) { // eslint-disable-line no-var
  32280. if (this._sbmh_lookup_char(data, pos + i) !== this._needle[i]) { return false }
  32281. }
  32282. return true
  32283. }
  32284. module.exports = SBMH
  32285. /***/ }),
  32286. /***/ 727:
  32287. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  32288. "use strict";
  32289. const WritableStream = (__nccwpck_require__(4492).Writable)
  32290. const { inherits } = __nccwpck_require__(7261)
  32291. const Dicer = __nccwpck_require__(2960)
  32292. const MultipartParser = __nccwpck_require__(2183)
  32293. const UrlencodedParser = __nccwpck_require__(8306)
  32294. const parseParams = __nccwpck_require__(1854)
  32295. function Busboy (opts) {
  32296. if (!(this instanceof Busboy)) { return new Busboy(opts) }
  32297. if (typeof opts !== 'object') {
  32298. throw new TypeError('Busboy expected an options-Object.')
  32299. }
  32300. if (typeof opts.headers !== 'object') {
  32301. throw new TypeError('Busboy expected an options-Object with headers-attribute.')
  32302. }
  32303. if (typeof opts.headers['content-type'] !== 'string') {
  32304. throw new TypeError('Missing Content-Type-header.')
  32305. }
  32306. const {
  32307. headers,
  32308. ...streamOptions
  32309. } = opts
  32310. this.opts = {
  32311. autoDestroy: false,
  32312. ...streamOptions
  32313. }
  32314. WritableStream.call(this, this.opts)
  32315. this._done = false
  32316. this._parser = this.getParserByHeaders(headers)
  32317. this._finished = false
  32318. }
  32319. inherits(Busboy, WritableStream)
  32320. Busboy.prototype.emit = function (ev) {
  32321. if (ev === 'finish') {
  32322. if (!this._done) {
  32323. this._parser?.end()
  32324. return
  32325. } else if (this._finished) {
  32326. return
  32327. }
  32328. this._finished = true
  32329. }
  32330. WritableStream.prototype.emit.apply(this, arguments)
  32331. }
  32332. Busboy.prototype.getParserByHeaders = function (headers) {
  32333. const parsed = parseParams(headers['content-type'])
  32334. const cfg = {
  32335. defCharset: this.opts.defCharset,
  32336. fileHwm: this.opts.fileHwm,
  32337. headers,
  32338. highWaterMark: this.opts.highWaterMark,
  32339. isPartAFile: this.opts.isPartAFile,
  32340. limits: this.opts.limits,
  32341. parsedConType: parsed,
  32342. preservePath: this.opts.preservePath
  32343. }
  32344. if (MultipartParser.detect.test(parsed[0])) {
  32345. return new MultipartParser(this, cfg)
  32346. }
  32347. if (UrlencodedParser.detect.test(parsed[0])) {
  32348. return new UrlencodedParser(this, cfg)
  32349. }
  32350. throw new Error('Unsupported Content-Type.')
  32351. }
  32352. Busboy.prototype._write = function (chunk, encoding, cb) {
  32353. this._parser.write(chunk, cb)
  32354. }
  32355. module.exports = Busboy
  32356. module.exports["default"] = Busboy
  32357. module.exports.Busboy = Busboy
  32358. module.exports.Dicer = Dicer
  32359. /***/ }),
  32360. /***/ 2183:
  32361. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  32362. "use strict";
  32363. // TODO:
  32364. // * support 1 nested multipart level
  32365. // (see second multipart example here:
  32366. // http://www.w3.org/TR/html401/interact/forms.html#didx-multipartform-data)
  32367. // * support limits.fieldNameSize
  32368. // -- this will require modifications to utils.parseParams
  32369. const { Readable } = __nccwpck_require__(4492)
  32370. const { inherits } = __nccwpck_require__(7261)
  32371. const Dicer = __nccwpck_require__(2960)
  32372. const parseParams = __nccwpck_require__(1854)
  32373. const decodeText = __nccwpck_require__(4619)
  32374. const basename = __nccwpck_require__(8647)
  32375. const getLimit = __nccwpck_require__(1467)
  32376. const RE_BOUNDARY = /^boundary$/i
  32377. const RE_FIELD = /^form-data$/i
  32378. const RE_CHARSET = /^charset$/i
  32379. const RE_FILENAME = /^filename$/i
  32380. const RE_NAME = /^name$/i
  32381. Multipart.detect = /^multipart\/form-data/i
  32382. function Multipart (boy, cfg) {
  32383. let i
  32384. let len
  32385. const self = this
  32386. let boundary
  32387. const limits = cfg.limits
  32388. const isPartAFile = cfg.isPartAFile || ((fieldName, contentType, fileName) => (contentType === 'application/octet-stream' || fileName !== undefined))
  32389. const parsedConType = cfg.parsedConType || []
  32390. const defCharset = cfg.defCharset || 'utf8'
  32391. const preservePath = cfg.preservePath
  32392. const fileOpts = { highWaterMark: cfg.fileHwm }
  32393. for (i = 0, len = parsedConType.length; i < len; ++i) {
  32394. if (Array.isArray(parsedConType[i]) &&
  32395. RE_BOUNDARY.test(parsedConType[i][0])) {
  32396. boundary = parsedConType[i][1]
  32397. break
  32398. }
  32399. }
  32400. function checkFinished () {
  32401. if (nends === 0 && finished && !boy._done) {
  32402. finished = false
  32403. self.end()
  32404. }
  32405. }
  32406. if (typeof boundary !== 'string') { throw new Error('Multipart: Boundary not found') }
  32407. const fieldSizeLimit = getLimit(limits, 'fieldSize', 1 * 1024 * 1024)
  32408. const fileSizeLimit = getLimit(limits, 'fileSize', Infinity)
  32409. const filesLimit = getLimit(limits, 'files', Infinity)
  32410. const fieldsLimit = getLimit(limits, 'fields', Infinity)
  32411. const partsLimit = getLimit(limits, 'parts', Infinity)
  32412. const headerPairsLimit = getLimit(limits, 'headerPairs', 2000)
  32413. const headerSizeLimit = getLimit(limits, 'headerSize', 80 * 1024)
  32414. let nfiles = 0
  32415. let nfields = 0
  32416. let nends = 0
  32417. let curFile
  32418. let curField
  32419. let finished = false
  32420. this._needDrain = false
  32421. this._pause = false
  32422. this._cb = undefined
  32423. this._nparts = 0
  32424. this._boy = boy
  32425. const parserCfg = {
  32426. boundary,
  32427. maxHeaderPairs: headerPairsLimit,
  32428. maxHeaderSize: headerSizeLimit,
  32429. partHwm: fileOpts.highWaterMark,
  32430. highWaterMark: cfg.highWaterMark
  32431. }
  32432. this.parser = new Dicer(parserCfg)
  32433. this.parser.on('drain', function () {
  32434. self._needDrain = false
  32435. if (self._cb && !self._pause) {
  32436. const cb = self._cb
  32437. self._cb = undefined
  32438. cb()
  32439. }
  32440. }).on('part', function onPart (part) {
  32441. if (++self._nparts > partsLimit) {
  32442. self.parser.removeListener('part', onPart)
  32443. self.parser.on('part', skipPart)
  32444. boy.hitPartsLimit = true
  32445. boy.emit('partsLimit')
  32446. return skipPart(part)
  32447. }
  32448. // hack because streams2 _always_ doesn't emit 'end' until nextTick, so let
  32449. // us emit 'end' early since we know the part has ended if we are already
  32450. // seeing the next part
  32451. if (curField) {
  32452. const field = curField
  32453. field.emit('end')
  32454. field.removeAllListeners('end')
  32455. }
  32456. part.on('header', function (header) {
  32457. let contype
  32458. let fieldname
  32459. let parsed
  32460. let charset
  32461. let encoding
  32462. let filename
  32463. let nsize = 0
  32464. if (header['content-type']) {
  32465. parsed = parseParams(header['content-type'][0])
  32466. if (parsed[0]) {
  32467. contype = parsed[0].toLowerCase()
  32468. for (i = 0, len = parsed.length; i < len; ++i) {
  32469. if (RE_CHARSET.test(parsed[i][0])) {
  32470. charset = parsed[i][1].toLowerCase()
  32471. break
  32472. }
  32473. }
  32474. }
  32475. }
  32476. if (contype === undefined) { contype = 'text/plain' }
  32477. if (charset === undefined) { charset = defCharset }
  32478. if (header['content-disposition']) {
  32479. parsed = parseParams(header['content-disposition'][0])
  32480. if (!RE_FIELD.test(parsed[0])) { return skipPart(part) }
  32481. for (i = 0, len = parsed.length; i < len; ++i) {
  32482. if (RE_NAME.test(parsed[i][0])) {
  32483. fieldname = parsed[i][1]
  32484. } else if (RE_FILENAME.test(parsed[i][0])) {
  32485. filename = parsed[i][1]
  32486. if (!preservePath) { filename = basename(filename) }
  32487. }
  32488. }
  32489. } else { return skipPart(part) }
  32490. if (header['content-transfer-encoding']) { encoding = header['content-transfer-encoding'][0].toLowerCase() } else { encoding = '7bit' }
  32491. let onData,
  32492. onEnd
  32493. if (isPartAFile(fieldname, contype, filename)) {
  32494. // file/binary field
  32495. if (nfiles === filesLimit) {
  32496. if (!boy.hitFilesLimit) {
  32497. boy.hitFilesLimit = true
  32498. boy.emit('filesLimit')
  32499. }
  32500. return skipPart(part)
  32501. }
  32502. ++nfiles
  32503. if (boy.listenerCount('file') === 0) {
  32504. self.parser._ignore()
  32505. return
  32506. }
  32507. ++nends
  32508. const file = new FileStream(fileOpts)
  32509. curFile = file
  32510. file.on('end', function () {
  32511. --nends
  32512. self._pause = false
  32513. checkFinished()
  32514. if (self._cb && !self._needDrain) {
  32515. const cb = self._cb
  32516. self._cb = undefined
  32517. cb()
  32518. }
  32519. })
  32520. file._read = function (n) {
  32521. if (!self._pause) { return }
  32522. self._pause = false
  32523. if (self._cb && !self._needDrain) {
  32524. const cb = self._cb
  32525. self._cb = undefined
  32526. cb()
  32527. }
  32528. }
  32529. boy.emit('file', fieldname, file, filename, encoding, contype)
  32530. onData = function (data) {
  32531. if ((nsize += data.length) > fileSizeLimit) {
  32532. const extralen = fileSizeLimit - nsize + data.length
  32533. if (extralen > 0) { file.push(data.slice(0, extralen)) }
  32534. file.truncated = true
  32535. file.bytesRead = fileSizeLimit
  32536. part.removeAllListeners('data')
  32537. file.emit('limit')
  32538. return
  32539. } else if (!file.push(data)) { self._pause = true }
  32540. file.bytesRead = nsize
  32541. }
  32542. onEnd = function () {
  32543. curFile = undefined
  32544. file.push(null)
  32545. }
  32546. } else {
  32547. // non-file field
  32548. if (nfields === fieldsLimit) {
  32549. if (!boy.hitFieldsLimit) {
  32550. boy.hitFieldsLimit = true
  32551. boy.emit('fieldsLimit')
  32552. }
  32553. return skipPart(part)
  32554. }
  32555. ++nfields
  32556. ++nends
  32557. let buffer = ''
  32558. let truncated = false
  32559. curField = part
  32560. onData = function (data) {
  32561. if ((nsize += data.length) > fieldSizeLimit) {
  32562. const extralen = (fieldSizeLimit - (nsize - data.length))
  32563. buffer += data.toString('binary', 0, extralen)
  32564. truncated = true
  32565. part.removeAllListeners('data')
  32566. } else { buffer += data.toString('binary') }
  32567. }
  32568. onEnd = function () {
  32569. curField = undefined
  32570. if (buffer.length) { buffer = decodeText(buffer, 'binary', charset) }
  32571. boy.emit('field', fieldname, buffer, false, truncated, encoding, contype)
  32572. --nends
  32573. checkFinished()
  32574. }
  32575. }
  32576. /* As of node@2efe4ab761666 (v0.10.29+/v0.11.14+), busboy had become
  32577. broken. Streams2/streams3 is a huge black box of confusion, but
  32578. somehow overriding the sync state seems to fix things again (and still
  32579. seems to work for previous node versions).
  32580. */
  32581. part._readableState.sync = false
  32582. part.on('data', onData)
  32583. part.on('end', onEnd)
  32584. }).on('error', function (err) {
  32585. if (curFile) { curFile.emit('error', err) }
  32586. })
  32587. }).on('error', function (err) {
  32588. boy.emit('error', err)
  32589. }).on('finish', function () {
  32590. finished = true
  32591. checkFinished()
  32592. })
  32593. }
  32594. Multipart.prototype.write = function (chunk, cb) {
  32595. const r = this.parser.write(chunk)
  32596. if (r && !this._pause) {
  32597. cb()
  32598. } else {
  32599. this._needDrain = !r
  32600. this._cb = cb
  32601. }
  32602. }
  32603. Multipart.prototype.end = function () {
  32604. const self = this
  32605. if (self.parser.writable) {
  32606. self.parser.end()
  32607. } else if (!self._boy._done) {
  32608. process.nextTick(function () {
  32609. self._boy._done = true
  32610. self._boy.emit('finish')
  32611. })
  32612. }
  32613. }
  32614. function skipPart (part) {
  32615. part.resume()
  32616. }
  32617. function FileStream (opts) {
  32618. Readable.call(this, opts)
  32619. this.bytesRead = 0
  32620. this.truncated = false
  32621. }
  32622. inherits(FileStream, Readable)
  32623. FileStream.prototype._read = function (n) {}
  32624. module.exports = Multipart
  32625. /***/ }),
  32626. /***/ 8306:
  32627. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  32628. "use strict";
  32629. const Decoder = __nccwpck_require__(7100)
  32630. const decodeText = __nccwpck_require__(4619)
  32631. const getLimit = __nccwpck_require__(1467)
  32632. const RE_CHARSET = /^charset$/i
  32633. UrlEncoded.detect = /^application\/x-www-form-urlencoded/i
  32634. function UrlEncoded (boy, cfg) {
  32635. const limits = cfg.limits
  32636. const parsedConType = cfg.parsedConType
  32637. this.boy = boy
  32638. this.fieldSizeLimit = getLimit(limits, 'fieldSize', 1 * 1024 * 1024)
  32639. this.fieldNameSizeLimit = getLimit(limits, 'fieldNameSize', 100)
  32640. this.fieldsLimit = getLimit(limits, 'fields', Infinity)
  32641. let charset
  32642. for (var i = 0, len = parsedConType.length; i < len; ++i) { // eslint-disable-line no-var
  32643. if (Array.isArray(parsedConType[i]) &&
  32644. RE_CHARSET.test(parsedConType[i][0])) {
  32645. charset = parsedConType[i][1].toLowerCase()
  32646. break
  32647. }
  32648. }
  32649. if (charset === undefined) { charset = cfg.defCharset || 'utf8' }
  32650. this.decoder = new Decoder()
  32651. this.charset = charset
  32652. this._fields = 0
  32653. this._state = 'key'
  32654. this._checkingBytes = true
  32655. this._bytesKey = 0
  32656. this._bytesVal = 0
  32657. this._key = ''
  32658. this._val = ''
  32659. this._keyTrunc = false
  32660. this._valTrunc = false
  32661. this._hitLimit = false
  32662. }
  32663. UrlEncoded.prototype.write = function (data, cb) {
  32664. if (this._fields === this.fieldsLimit) {
  32665. if (!this.boy.hitFieldsLimit) {
  32666. this.boy.hitFieldsLimit = true
  32667. this.boy.emit('fieldsLimit')
  32668. }
  32669. return cb()
  32670. }
  32671. let idxeq; let idxamp; let i; let p = 0; const len = data.length
  32672. while (p < len) {
  32673. if (this._state === 'key') {
  32674. idxeq = idxamp = undefined
  32675. for (i = p; i < len; ++i) {
  32676. if (!this._checkingBytes) { ++p }
  32677. if (data[i] === 0x3D/* = */) {
  32678. idxeq = i
  32679. break
  32680. } else if (data[i] === 0x26/* & */) {
  32681. idxamp = i
  32682. break
  32683. }
  32684. if (this._checkingBytes && this._bytesKey === this.fieldNameSizeLimit) {
  32685. this._hitLimit = true
  32686. break
  32687. } else if (this._checkingBytes) { ++this._bytesKey }
  32688. }
  32689. if (idxeq !== undefined) {
  32690. // key with assignment
  32691. if (idxeq > p) { this._key += this.decoder.write(data.toString('binary', p, idxeq)) }
  32692. this._state = 'val'
  32693. this._hitLimit = false
  32694. this._checkingBytes = true
  32695. this._val = ''
  32696. this._bytesVal = 0
  32697. this._valTrunc = false
  32698. this.decoder.reset()
  32699. p = idxeq + 1
  32700. } else if (idxamp !== undefined) {
  32701. // key with no assignment
  32702. ++this._fields
  32703. let key; const keyTrunc = this._keyTrunc
  32704. if (idxamp > p) { key = (this._key += this.decoder.write(data.toString('binary', p, idxamp))) } else { key = this._key }
  32705. this._hitLimit = false
  32706. this._checkingBytes = true
  32707. this._key = ''
  32708. this._bytesKey = 0
  32709. this._keyTrunc = false
  32710. this.decoder.reset()
  32711. if (key.length) {
  32712. this.boy.emit('field', decodeText(key, 'binary', this.charset),
  32713. '',
  32714. keyTrunc,
  32715. false)
  32716. }
  32717. p = idxamp + 1
  32718. if (this._fields === this.fieldsLimit) { return cb() }
  32719. } else if (this._hitLimit) {
  32720. // we may not have hit the actual limit if there are encoded bytes...
  32721. if (i > p) { this._key += this.decoder.write(data.toString('binary', p, i)) }
  32722. p = i
  32723. if ((this._bytesKey = this._key.length) === this.fieldNameSizeLimit) {
  32724. // yep, we actually did hit the limit
  32725. this._checkingBytes = false
  32726. this._keyTrunc = true
  32727. }
  32728. } else {
  32729. if (p < len) { this._key += this.decoder.write(data.toString('binary', p)) }
  32730. p = len
  32731. }
  32732. } else {
  32733. idxamp = undefined
  32734. for (i = p; i < len; ++i) {
  32735. if (!this._checkingBytes) { ++p }
  32736. if (data[i] === 0x26/* & */) {
  32737. idxamp = i
  32738. break
  32739. }
  32740. if (this._checkingBytes && this._bytesVal === this.fieldSizeLimit) {
  32741. this._hitLimit = true
  32742. break
  32743. } else if (this._checkingBytes) { ++this._bytesVal }
  32744. }
  32745. if (idxamp !== undefined) {
  32746. ++this._fields
  32747. if (idxamp > p) { this._val += this.decoder.write(data.toString('binary', p, idxamp)) }
  32748. this.boy.emit('field', decodeText(this._key, 'binary', this.charset),
  32749. decodeText(this._val, 'binary', this.charset),
  32750. this._keyTrunc,
  32751. this._valTrunc)
  32752. this._state = 'key'
  32753. this._hitLimit = false
  32754. this._checkingBytes = true
  32755. this._key = ''
  32756. this._bytesKey = 0
  32757. this._keyTrunc = false
  32758. this.decoder.reset()
  32759. p = idxamp + 1
  32760. if (this._fields === this.fieldsLimit) { return cb() }
  32761. } else if (this._hitLimit) {
  32762. // we may not have hit the actual limit if there are encoded bytes...
  32763. if (i > p) { this._val += this.decoder.write(data.toString('binary', p, i)) }
  32764. p = i
  32765. if ((this._val === '' && this.fieldSizeLimit === 0) ||
  32766. (this._bytesVal = this._val.length) === this.fieldSizeLimit) {
  32767. // yep, we actually did hit the limit
  32768. this._checkingBytes = false
  32769. this._valTrunc = true
  32770. }
  32771. } else {
  32772. if (p < len) { this._val += this.decoder.write(data.toString('binary', p)) }
  32773. p = len
  32774. }
  32775. }
  32776. }
  32777. cb()
  32778. }
  32779. UrlEncoded.prototype.end = function () {
  32780. if (this.boy._done) { return }
  32781. if (this._state === 'key' && this._key.length > 0) {
  32782. this.boy.emit('field', decodeText(this._key, 'binary', this.charset),
  32783. '',
  32784. this._keyTrunc,
  32785. false)
  32786. } else if (this._state === 'val') {
  32787. this.boy.emit('field', decodeText(this._key, 'binary', this.charset),
  32788. decodeText(this._val, 'binary', this.charset),
  32789. this._keyTrunc,
  32790. this._valTrunc)
  32791. }
  32792. this.boy._done = true
  32793. this.boy.emit('finish')
  32794. }
  32795. module.exports = UrlEncoded
  32796. /***/ }),
  32797. /***/ 7100:
  32798. /***/ ((module) => {
  32799. "use strict";
  32800. const RE_PLUS = /\+/g
  32801. const HEX = [
  32802. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  32803. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  32804. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  32805. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0,
  32806. 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  32807. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  32808. 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  32809. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
  32810. ]
  32811. function Decoder () {
  32812. this.buffer = undefined
  32813. }
  32814. Decoder.prototype.write = function (str) {
  32815. // Replace '+' with ' ' before decoding
  32816. str = str.replace(RE_PLUS, ' ')
  32817. let res = ''
  32818. let i = 0; let p = 0; const len = str.length
  32819. for (; i < len; ++i) {
  32820. if (this.buffer !== undefined) {
  32821. if (!HEX[str.charCodeAt(i)]) {
  32822. res += '%' + this.buffer
  32823. this.buffer = undefined
  32824. --i // retry character
  32825. } else {
  32826. this.buffer += str[i]
  32827. ++p
  32828. if (this.buffer.length === 2) {
  32829. res += String.fromCharCode(parseInt(this.buffer, 16))
  32830. this.buffer = undefined
  32831. }
  32832. }
  32833. } else if (str[i] === '%') {
  32834. if (i > p) {
  32835. res += str.substring(p, i)
  32836. p = i
  32837. }
  32838. this.buffer = ''
  32839. ++p
  32840. }
  32841. }
  32842. if (p < len && this.buffer === undefined) { res += str.substring(p) }
  32843. return res
  32844. }
  32845. Decoder.prototype.reset = function () {
  32846. this.buffer = undefined
  32847. }
  32848. module.exports = Decoder
  32849. /***/ }),
  32850. /***/ 8647:
  32851. /***/ ((module) => {
  32852. "use strict";
  32853. module.exports = function basename (path) {
  32854. if (typeof path !== 'string') { return '' }
  32855. for (var i = path.length - 1; i >= 0; --i) { // eslint-disable-line no-var
  32856. switch (path.charCodeAt(i)) {
  32857. case 0x2F: // '/'
  32858. case 0x5C: // '\'
  32859. path = path.slice(i + 1)
  32860. return (path === '..' || path === '.' ? '' : path)
  32861. }
  32862. }
  32863. return (path === '..' || path === '.' ? '' : path)
  32864. }
  32865. /***/ }),
  32866. /***/ 4619:
  32867. /***/ (function(module) {
  32868. "use strict";
  32869. // Node has always utf-8
  32870. const utf8Decoder = new TextDecoder('utf-8')
  32871. const textDecoders = new Map([
  32872. ['utf-8', utf8Decoder],
  32873. ['utf8', utf8Decoder]
  32874. ])
  32875. function getDecoder (charset) {
  32876. let lc
  32877. while (true) {
  32878. switch (charset) {
  32879. case 'utf-8':
  32880. case 'utf8':
  32881. return decoders.utf8
  32882. case 'latin1':
  32883. case 'ascii': // TODO: Make these a separate, strict decoder?
  32884. case 'us-ascii':
  32885. case 'iso-8859-1':
  32886. case 'iso8859-1':
  32887. case 'iso88591':
  32888. case 'iso_8859-1':
  32889. case 'windows-1252':
  32890. case 'iso_8859-1:1987':
  32891. case 'cp1252':
  32892. case 'x-cp1252':
  32893. return decoders.latin1
  32894. case 'utf16le':
  32895. case 'utf-16le':
  32896. case 'ucs2':
  32897. case 'ucs-2':
  32898. return decoders.utf16le
  32899. case 'base64':
  32900. return decoders.base64
  32901. default:
  32902. if (lc === undefined) {
  32903. lc = true
  32904. charset = charset.toLowerCase()
  32905. continue
  32906. }
  32907. return decoders.other.bind(charset)
  32908. }
  32909. }
  32910. }
  32911. const decoders = {
  32912. utf8: (data, sourceEncoding) => {
  32913. if (data.length === 0) {
  32914. return ''
  32915. }
  32916. if (typeof data === 'string') {
  32917. data = Buffer.from(data, sourceEncoding)
  32918. }
  32919. return data.utf8Slice(0, data.length)
  32920. },
  32921. latin1: (data, sourceEncoding) => {
  32922. if (data.length === 0) {
  32923. return ''
  32924. }
  32925. if (typeof data === 'string') {
  32926. return data
  32927. }
  32928. return data.latin1Slice(0, data.length)
  32929. },
  32930. utf16le: (data, sourceEncoding) => {
  32931. if (data.length === 0) {
  32932. return ''
  32933. }
  32934. if (typeof data === 'string') {
  32935. data = Buffer.from(data, sourceEncoding)
  32936. }
  32937. return data.ucs2Slice(0, data.length)
  32938. },
  32939. base64: (data, sourceEncoding) => {
  32940. if (data.length === 0) {
  32941. return ''
  32942. }
  32943. if (typeof data === 'string') {
  32944. data = Buffer.from(data, sourceEncoding)
  32945. }
  32946. return data.base64Slice(0, data.length)
  32947. },
  32948. other: (data, sourceEncoding) => {
  32949. if (data.length === 0) {
  32950. return ''
  32951. }
  32952. if (typeof data === 'string') {
  32953. data = Buffer.from(data, sourceEncoding)
  32954. }
  32955. if (textDecoders.has(this.toString())) {
  32956. try {
  32957. return textDecoders.get(this).decode(data)
  32958. } catch {}
  32959. }
  32960. return typeof data === 'string'
  32961. ? data
  32962. : data.toString()
  32963. }
  32964. }
  32965. function decodeText (text, sourceEncoding, destEncoding) {
  32966. if (text) {
  32967. return getDecoder(destEncoding)(text, sourceEncoding)
  32968. }
  32969. return text
  32970. }
  32971. module.exports = decodeText
  32972. /***/ }),
  32973. /***/ 1467:
  32974. /***/ ((module) => {
  32975. "use strict";
  32976. module.exports = function getLimit (limits, name, defaultLimit) {
  32977. if (
  32978. !limits ||
  32979. limits[name] === undefined ||
  32980. limits[name] === null
  32981. ) { return defaultLimit }
  32982. if (
  32983. typeof limits[name] !== 'number' ||
  32984. isNaN(limits[name])
  32985. ) { throw new TypeError('Limit ' + name + ' is not a valid number') }
  32986. return limits[name]
  32987. }
  32988. /***/ }),
  32989. /***/ 1854:
  32990. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  32991. "use strict";
  32992. /* eslint-disable object-property-newline */
  32993. const decodeText = __nccwpck_require__(4619)
  32994. const RE_ENCODED = /%[a-fA-F0-9][a-fA-F0-9]/g
  32995. const EncodedLookup = {
  32996. '%00': '\x00', '%01': '\x01', '%02': '\x02', '%03': '\x03', '%04': '\x04',
  32997. '%05': '\x05', '%06': '\x06', '%07': '\x07', '%08': '\x08', '%09': '\x09',
  32998. '%0a': '\x0a', '%0A': '\x0a', '%0b': '\x0b', '%0B': '\x0b', '%0c': '\x0c',
  32999. '%0C': '\x0c', '%0d': '\x0d', '%0D': '\x0d', '%0e': '\x0e', '%0E': '\x0e',
  33000. '%0f': '\x0f', '%0F': '\x0f', '%10': '\x10', '%11': '\x11', '%12': '\x12',
  33001. '%13': '\x13', '%14': '\x14', '%15': '\x15', '%16': '\x16', '%17': '\x17',
  33002. '%18': '\x18', '%19': '\x19', '%1a': '\x1a', '%1A': '\x1a', '%1b': '\x1b',
  33003. '%1B': '\x1b', '%1c': '\x1c', '%1C': '\x1c', '%1d': '\x1d', '%1D': '\x1d',
  33004. '%1e': '\x1e', '%1E': '\x1e', '%1f': '\x1f', '%1F': '\x1f', '%20': '\x20',
  33005. '%21': '\x21', '%22': '\x22', '%23': '\x23', '%24': '\x24', '%25': '\x25',
  33006. '%26': '\x26', '%27': '\x27', '%28': '\x28', '%29': '\x29', '%2a': '\x2a',
  33007. '%2A': '\x2a', '%2b': '\x2b', '%2B': '\x2b', '%2c': '\x2c', '%2C': '\x2c',
  33008. '%2d': '\x2d', '%2D': '\x2d', '%2e': '\x2e', '%2E': '\x2e', '%2f': '\x2f',
  33009. '%2F': '\x2f', '%30': '\x30', '%31': '\x31', '%32': '\x32', '%33': '\x33',
  33010. '%34': '\x34', '%35': '\x35', '%36': '\x36', '%37': '\x37', '%38': '\x38',
  33011. '%39': '\x39', '%3a': '\x3a', '%3A': '\x3a', '%3b': '\x3b', '%3B': '\x3b',
  33012. '%3c': '\x3c', '%3C': '\x3c', '%3d': '\x3d', '%3D': '\x3d', '%3e': '\x3e',
  33013. '%3E': '\x3e', '%3f': '\x3f', '%3F': '\x3f', '%40': '\x40', '%41': '\x41',
  33014. '%42': '\x42', '%43': '\x43', '%44': '\x44', '%45': '\x45', '%46': '\x46',
  33015. '%47': '\x47', '%48': '\x48', '%49': '\x49', '%4a': '\x4a', '%4A': '\x4a',
  33016. '%4b': '\x4b', '%4B': '\x4b', '%4c': '\x4c', '%4C': '\x4c', '%4d': '\x4d',
  33017. '%4D': '\x4d', '%4e': '\x4e', '%4E': '\x4e', '%4f': '\x4f', '%4F': '\x4f',
  33018. '%50': '\x50', '%51': '\x51', '%52': '\x52', '%53': '\x53', '%54': '\x54',
  33019. '%55': '\x55', '%56': '\x56', '%57': '\x57', '%58': '\x58', '%59': '\x59',
  33020. '%5a': '\x5a', '%5A': '\x5a', '%5b': '\x5b', '%5B': '\x5b', '%5c': '\x5c',
  33021. '%5C': '\x5c', '%5d': '\x5d', '%5D': '\x5d', '%5e': '\x5e', '%5E': '\x5e',
  33022. '%5f': '\x5f', '%5F': '\x5f', '%60': '\x60', '%61': '\x61', '%62': '\x62',
  33023. '%63': '\x63', '%64': '\x64', '%65': '\x65', '%66': '\x66', '%67': '\x67',
  33024. '%68': '\x68', '%69': '\x69', '%6a': '\x6a', '%6A': '\x6a', '%6b': '\x6b',
  33025. '%6B': '\x6b', '%6c': '\x6c', '%6C': '\x6c', '%6d': '\x6d', '%6D': '\x6d',
  33026. '%6e': '\x6e', '%6E': '\x6e', '%6f': '\x6f', '%6F': '\x6f', '%70': '\x70',
  33027. '%71': '\x71', '%72': '\x72', '%73': '\x73', '%74': '\x74', '%75': '\x75',
  33028. '%76': '\x76', '%77': '\x77', '%78': '\x78', '%79': '\x79', '%7a': '\x7a',
  33029. '%7A': '\x7a', '%7b': '\x7b', '%7B': '\x7b', '%7c': '\x7c', '%7C': '\x7c',
  33030. '%7d': '\x7d', '%7D': '\x7d', '%7e': '\x7e', '%7E': '\x7e', '%7f': '\x7f',
  33031. '%7F': '\x7f', '%80': '\x80', '%81': '\x81', '%82': '\x82', '%83': '\x83',
  33032. '%84': '\x84', '%85': '\x85', '%86': '\x86', '%87': '\x87', '%88': '\x88',
  33033. '%89': '\x89', '%8a': '\x8a', '%8A': '\x8a', '%8b': '\x8b', '%8B': '\x8b',
  33034. '%8c': '\x8c', '%8C': '\x8c', '%8d': '\x8d', '%8D': '\x8d', '%8e': '\x8e',
  33035. '%8E': '\x8e', '%8f': '\x8f', '%8F': '\x8f', '%90': '\x90', '%91': '\x91',
  33036. '%92': '\x92', '%93': '\x93', '%94': '\x94', '%95': '\x95', '%96': '\x96',
  33037. '%97': '\x97', '%98': '\x98', '%99': '\x99', '%9a': '\x9a', '%9A': '\x9a',
  33038. '%9b': '\x9b', '%9B': '\x9b', '%9c': '\x9c', '%9C': '\x9c', '%9d': '\x9d',
  33039. '%9D': '\x9d', '%9e': '\x9e', '%9E': '\x9e', '%9f': '\x9f', '%9F': '\x9f',
  33040. '%a0': '\xa0', '%A0': '\xa0', '%a1': '\xa1', '%A1': '\xa1', '%a2': '\xa2',
  33041. '%A2': '\xa2', '%a3': '\xa3', '%A3': '\xa3', '%a4': '\xa4', '%A4': '\xa4',
  33042. '%a5': '\xa5', '%A5': '\xa5', '%a6': '\xa6', '%A6': '\xa6', '%a7': '\xa7',
  33043. '%A7': '\xa7', '%a8': '\xa8', '%A8': '\xa8', '%a9': '\xa9', '%A9': '\xa9',
  33044. '%aa': '\xaa', '%Aa': '\xaa', '%aA': '\xaa', '%AA': '\xaa', '%ab': '\xab',
  33045. '%Ab': '\xab', '%aB': '\xab', '%AB': '\xab', '%ac': '\xac', '%Ac': '\xac',
  33046. '%aC': '\xac', '%AC': '\xac', '%ad': '\xad', '%Ad': '\xad', '%aD': '\xad',
  33047. '%AD': '\xad', '%ae': '\xae', '%Ae': '\xae', '%aE': '\xae', '%AE': '\xae',
  33048. '%af': '\xaf', '%Af': '\xaf', '%aF': '\xaf', '%AF': '\xaf', '%b0': '\xb0',
  33049. '%B0': '\xb0', '%b1': '\xb1', '%B1': '\xb1', '%b2': '\xb2', '%B2': '\xb2',
  33050. '%b3': '\xb3', '%B3': '\xb3', '%b4': '\xb4', '%B4': '\xb4', '%b5': '\xb5',
  33051. '%B5': '\xb5', '%b6': '\xb6', '%B6': '\xb6', '%b7': '\xb7', '%B7': '\xb7',
  33052. '%b8': '\xb8', '%B8': '\xb8', '%b9': '\xb9', '%B9': '\xb9', '%ba': '\xba',
  33053. '%Ba': '\xba', '%bA': '\xba', '%BA': '\xba', '%bb': '\xbb', '%Bb': '\xbb',
  33054. '%bB': '\xbb', '%BB': '\xbb', '%bc': '\xbc', '%Bc': '\xbc', '%bC': '\xbc',
  33055. '%BC': '\xbc', '%bd': '\xbd', '%Bd': '\xbd', '%bD': '\xbd', '%BD': '\xbd',
  33056. '%be': '\xbe', '%Be': '\xbe', '%bE': '\xbe', '%BE': '\xbe', '%bf': '\xbf',
  33057. '%Bf': '\xbf', '%bF': '\xbf', '%BF': '\xbf', '%c0': '\xc0', '%C0': '\xc0',
  33058. '%c1': '\xc1', '%C1': '\xc1', '%c2': '\xc2', '%C2': '\xc2', '%c3': '\xc3',
  33059. '%C3': '\xc3', '%c4': '\xc4', '%C4': '\xc4', '%c5': '\xc5', '%C5': '\xc5',
  33060. '%c6': '\xc6', '%C6': '\xc6', '%c7': '\xc7', '%C7': '\xc7', '%c8': '\xc8',
  33061. '%C8': '\xc8', '%c9': '\xc9', '%C9': '\xc9', '%ca': '\xca', '%Ca': '\xca',
  33062. '%cA': '\xca', '%CA': '\xca', '%cb': '\xcb', '%Cb': '\xcb', '%cB': '\xcb',
  33063. '%CB': '\xcb', '%cc': '\xcc', '%Cc': '\xcc', '%cC': '\xcc', '%CC': '\xcc',
  33064. '%cd': '\xcd', '%Cd': '\xcd', '%cD': '\xcd', '%CD': '\xcd', '%ce': '\xce',
  33065. '%Ce': '\xce', '%cE': '\xce', '%CE': '\xce', '%cf': '\xcf', '%Cf': '\xcf',
  33066. '%cF': '\xcf', '%CF': '\xcf', '%d0': '\xd0', '%D0': '\xd0', '%d1': '\xd1',
  33067. '%D1': '\xd1', '%d2': '\xd2', '%D2': '\xd2', '%d3': '\xd3', '%D3': '\xd3',
  33068. '%d4': '\xd4', '%D4': '\xd4', '%d5': '\xd5', '%D5': '\xd5', '%d6': '\xd6',
  33069. '%D6': '\xd6', '%d7': '\xd7', '%D7': '\xd7', '%d8': '\xd8', '%D8': '\xd8',
  33070. '%d9': '\xd9', '%D9': '\xd9', '%da': '\xda', '%Da': '\xda', '%dA': '\xda',
  33071. '%DA': '\xda', '%db': '\xdb', '%Db': '\xdb', '%dB': '\xdb', '%DB': '\xdb',
  33072. '%dc': '\xdc', '%Dc': '\xdc', '%dC': '\xdc', '%DC': '\xdc', '%dd': '\xdd',
  33073. '%Dd': '\xdd', '%dD': '\xdd', '%DD': '\xdd', '%de': '\xde', '%De': '\xde',
  33074. '%dE': '\xde', '%DE': '\xde', '%df': '\xdf', '%Df': '\xdf', '%dF': '\xdf',
  33075. '%DF': '\xdf', '%e0': '\xe0', '%E0': '\xe0', '%e1': '\xe1', '%E1': '\xe1',
  33076. '%e2': '\xe2', '%E2': '\xe2', '%e3': '\xe3', '%E3': '\xe3', '%e4': '\xe4',
  33077. '%E4': '\xe4', '%e5': '\xe5', '%E5': '\xe5', '%e6': '\xe6', '%E6': '\xe6',
  33078. '%e7': '\xe7', '%E7': '\xe7', '%e8': '\xe8', '%E8': '\xe8', '%e9': '\xe9',
  33079. '%E9': '\xe9', '%ea': '\xea', '%Ea': '\xea', '%eA': '\xea', '%EA': '\xea',
  33080. '%eb': '\xeb', '%Eb': '\xeb', '%eB': '\xeb', '%EB': '\xeb', '%ec': '\xec',
  33081. '%Ec': '\xec', '%eC': '\xec', '%EC': '\xec', '%ed': '\xed', '%Ed': '\xed',
  33082. '%eD': '\xed', '%ED': '\xed', '%ee': '\xee', '%Ee': '\xee', '%eE': '\xee',
  33083. '%EE': '\xee', '%ef': '\xef', '%Ef': '\xef', '%eF': '\xef', '%EF': '\xef',
  33084. '%f0': '\xf0', '%F0': '\xf0', '%f1': '\xf1', '%F1': '\xf1', '%f2': '\xf2',
  33085. '%F2': '\xf2', '%f3': '\xf3', '%F3': '\xf3', '%f4': '\xf4', '%F4': '\xf4',
  33086. '%f5': '\xf5', '%F5': '\xf5', '%f6': '\xf6', '%F6': '\xf6', '%f7': '\xf7',
  33087. '%F7': '\xf7', '%f8': '\xf8', '%F8': '\xf8', '%f9': '\xf9', '%F9': '\xf9',
  33088. '%fa': '\xfa', '%Fa': '\xfa', '%fA': '\xfa', '%FA': '\xfa', '%fb': '\xfb',
  33089. '%Fb': '\xfb', '%fB': '\xfb', '%FB': '\xfb', '%fc': '\xfc', '%Fc': '\xfc',
  33090. '%fC': '\xfc', '%FC': '\xfc', '%fd': '\xfd', '%Fd': '\xfd', '%fD': '\xfd',
  33091. '%FD': '\xfd', '%fe': '\xfe', '%Fe': '\xfe', '%fE': '\xfe', '%FE': '\xfe',
  33092. '%ff': '\xff', '%Ff': '\xff', '%fF': '\xff', '%FF': '\xff'
  33093. }
  33094. function encodedReplacer (match) {
  33095. return EncodedLookup[match]
  33096. }
  33097. const STATE_KEY = 0
  33098. const STATE_VALUE = 1
  33099. const STATE_CHARSET = 2
  33100. const STATE_LANG = 3
  33101. function parseParams (str) {
  33102. const res = []
  33103. let state = STATE_KEY
  33104. let charset = ''
  33105. let inquote = false
  33106. let escaping = false
  33107. let p = 0
  33108. let tmp = ''
  33109. const len = str.length
  33110. for (var i = 0; i < len; ++i) { // eslint-disable-line no-var
  33111. const char = str[i]
  33112. if (char === '\\' && inquote) {
  33113. if (escaping) { escaping = false } else {
  33114. escaping = true
  33115. continue
  33116. }
  33117. } else if (char === '"') {
  33118. if (!escaping) {
  33119. if (inquote) {
  33120. inquote = false
  33121. state = STATE_KEY
  33122. } else { inquote = true }
  33123. continue
  33124. } else { escaping = false }
  33125. } else {
  33126. if (escaping && inquote) { tmp += '\\' }
  33127. escaping = false
  33128. if ((state === STATE_CHARSET || state === STATE_LANG) && char === "'") {
  33129. if (state === STATE_CHARSET) {
  33130. state = STATE_LANG
  33131. charset = tmp.substring(1)
  33132. } else { state = STATE_VALUE }
  33133. tmp = ''
  33134. continue
  33135. } else if (state === STATE_KEY &&
  33136. (char === '*' || char === '=') &&
  33137. res.length) {
  33138. state = char === '*'
  33139. ? STATE_CHARSET
  33140. : STATE_VALUE
  33141. res[p] = [tmp, undefined]
  33142. tmp = ''
  33143. continue
  33144. } else if (!inquote && char === ';') {
  33145. state = STATE_KEY
  33146. if (charset) {
  33147. if (tmp.length) {
  33148. tmp = decodeText(tmp.replace(RE_ENCODED, encodedReplacer),
  33149. 'binary',
  33150. charset)
  33151. }
  33152. charset = ''
  33153. } else if (tmp.length) {
  33154. tmp = decodeText(tmp, 'binary', 'utf8')
  33155. }
  33156. if (res[p] === undefined) { res[p] = tmp } else { res[p][1] = tmp }
  33157. tmp = ''
  33158. ++p
  33159. continue
  33160. } else if (!inquote && (char === ' ' || char === '\t')) { continue }
  33161. }
  33162. tmp += char
  33163. }
  33164. if (charset && tmp.length) {
  33165. tmp = decodeText(tmp.replace(RE_ENCODED, encodedReplacer),
  33166. 'binary',
  33167. charset)
  33168. } else if (tmp) {
  33169. tmp = decodeText(tmp, 'binary', 'utf8')
  33170. }
  33171. if (res[p] === undefined) {
  33172. if (tmp) { res[p] = tmp }
  33173. } else { res[p][1] = tmp }
  33174. return res
  33175. }
  33176. module.exports = parseParams
  33177. /***/ })
  33178. /******/ });
  33179. /************************************************************************/
  33180. /******/ // The module cache
  33181. /******/ var __webpack_module_cache__ = {};
  33182. /******/
  33183. /******/ // The require function
  33184. /******/ function __nccwpck_require__(moduleId) {
  33185. /******/ // Check if module is in cache
  33186. /******/ var cachedModule = __webpack_module_cache__[moduleId];
  33187. /******/ if (cachedModule !== undefined) {
  33188. /******/ return cachedModule.exports;
  33189. /******/ }
  33190. /******/ // Create a new module (and put it into the cache)
  33191. /******/ var module = __webpack_module_cache__[moduleId] = {
  33192. /******/ // no module.id needed
  33193. /******/ // no module.loaded needed
  33194. /******/ exports: {}
  33195. /******/ };
  33196. /******/
  33197. /******/ // Execute the module function
  33198. /******/ var threw = true;
  33199. /******/ try {
  33200. /******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __nccwpck_require__);
  33201. /******/ threw = false;
  33202. /******/ } finally {
  33203. /******/ if(threw) delete __webpack_module_cache__[moduleId];
  33204. /******/ }
  33205. /******/
  33206. /******/ // Return the exports of the module
  33207. /******/ return module.exports;
  33208. /******/ }
  33209. /******/
  33210. /************************************************************************/
  33211. /******/ /* webpack/runtime/compat */
  33212. /******/
  33213. /******/ if (typeof __nccwpck_require__ !== 'undefined') __nccwpck_require__.ab = __dirname + "/";
  33214. /******/
  33215. /************************************************************************/
  33216. /******/
  33217. /******/ // startup
  33218. /******/ // Load entry module and return exports
  33219. /******/ // This entry module is referenced by other modules so it can't be inlined
  33220. /******/ var __webpack_exports__ = __nccwpck_require__(3109);
  33221. /******/ module.exports = __webpack_exports__;
  33222. /******/
  33223. /******/ })()
  33224. ;