index.js 1.3 MB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391193921939319394193951939619397193981939919400194011940219403194041940519406194071940819409194101941119412194131941419415194161941719418194191942019421194221942319424194251942619427194281942919430194311943219433194341943519436194371943819439194401944119442194431944419445194461944719448194491945019451194521945319454194551945619457194581945919460194611946219463194641946519466194671946819469194701947119472194731947419475194761947719478194791948019481194821948319484194851948619487194881948919490194911949219493194941949519496194971949819499195001950119502195031950419505195061950719508195091951019511195121951319514195151951619517195181951919520195211952219523195241952519526195271952819529195301953119532195331953419535195361953719538195391954019541195421954319544195451954619547195481954919550195511955219553195541955519556195571955819559195601956119562195631956419565195661956719568195691957019571195721957319574195751957619577195781957919580195811958219583195841958519586195871958819589195901959119592195931959419595195961959719598195991960019601196021960319604196051960619607196081960919610196111961219613196141961519616196171961819619196201962119622196231962419625196261962719628196291963019631196321963319634196351963619637196381963919640196411964219643196441964519646196471964819649196501965119652196531965419655196561965719658196591966019661196621966319664196651966619667196681966919670196711967219673196741967519676196771967819679196801968119682196831968419685196861968719688196891969019691196921969319694196951969619697196981969919700197011970219703197041970519706197071970819709197101971119712197131971419715197161971719718197191972019721197221972319724197251972619727197281972919730197311973219733197341973519736197371973819739197401974119742197431974419745197461974719748197491975019751197521975319754197551975619757197581975919760197611976219763197641976519766197671976819769197701977119772197731977419775197761977719778197791978019781197821978319784197851978619787197881978919790197911979219793197941979519796197971979819799198001980119802198031980419805198061980719808198091981019811198121981319814198151981619817198181981919820198211982219823198241982519826198271982819829198301983119832198331983419835198361983719838198391984019841198421984319844198451984619847198481984919850198511985219853198541985519856198571985819859198601986119862198631986419865198661986719868198691987019871198721987319874198751987619877198781987919880198811988219883198841988519886198871988819889198901989119892198931989419895198961989719898198991990019901199021990319904199051990619907199081990919910199111991219913199141991519916199171991819919199201992119922199231992419925199261992719928199291993019931199321993319934199351993619937199381993919940199411994219943199441994519946199471994819949199501995119952199531995419955199561995719958199591996019961199621996319964199651996619967199681996919970199711997219973199741997519976199771997819979199801998119982199831998419985199861998719988199891999019991199921999319994199951999619997199981999920000200012000220003200042000520006200072000820009200102001120012200132001420015200162001720018200192002020021200222002320024200252002620027200282002920030200312003220033200342003520036200372003820039200402004120042200432004420045200462004720048200492005020051200522005320054200552005620057200582005920060200612006220063200642006520066200672006820069200702007120072200732007420075200762007720078200792008020081200822008320084200852008620087200882008920090200912009220093200942009520096200972009820099201002010120102201032010420105201062010720108201092011020111201122011320114201152011620117201182011920120201212012220123201242012520126201272012820129201302013120132201332013420135201362013720138201392014020141201422014320144201452014620147201482014920150201512015220153201542015520156201572015820159201602016120162201632016420165201662016720168201692017020171201722017320174201752017620177201782017920180201812018220183201842018520186201872018820189201902019120192201932019420195201962019720198201992020020201202022020320204202052020620207202082020920210202112021220213202142021520216202172021820219202202022120222202232022420225202262022720228202292023020231202322023320234202352023620237202382023920240202412024220243202442024520246202472024820249202502025120252202532025420255202562025720258202592026020261202622026320264202652026620267202682026920270202712027220273202742027520276202772027820279202802028120282202832028420285202862028720288202892029020291202922029320294202952029620297202982029920300203012030220303203042030520306203072030820309203102031120312203132031420315203162031720318203192032020321203222032320324203252032620327203282032920330203312033220333203342033520336203372033820339203402034120342203432034420345203462034720348203492035020351203522035320354203552035620357203582035920360203612036220363203642036520366203672036820369203702037120372203732037420375203762037720378203792038020381203822038320384203852038620387203882038920390203912039220393203942039520396203972039820399204002040120402204032040420405204062040720408204092041020411204122041320414204152041620417204182041920420204212042220423204242042520426204272042820429204302043120432204332043420435204362043720438204392044020441204422044320444204452044620447204482044920450204512045220453204542045520456204572045820459204602046120462204632046420465204662046720468204692047020471204722047320474204752047620477204782047920480204812048220483204842048520486204872048820489204902049120492204932049420495204962049720498204992050020501205022050320504205052050620507205082050920510205112051220513205142051520516205172051820519205202052120522205232052420525205262052720528205292053020531205322053320534205352053620537205382053920540205412054220543205442054520546205472054820549205502055120552205532055420555205562055720558205592056020561205622056320564205652056620567205682056920570205712057220573205742057520576205772057820579205802058120582205832058420585205862058720588205892059020591205922059320594205952059620597205982059920600206012060220603206042060520606206072060820609206102061120612206132061420615206162061720618206192062020621206222062320624206252062620627206282062920630206312063220633206342063520636206372063820639206402064120642206432064420645206462064720648206492065020651206522065320654206552065620657206582065920660206612066220663206642066520666206672066820669206702067120672206732067420675206762067720678206792068020681206822068320684206852068620687206882068920690206912069220693206942069520696206972069820699207002070120702207032070420705207062070720708207092071020711207122071320714207152071620717207182071920720207212072220723207242072520726207272072820729207302073120732207332073420735207362073720738207392074020741207422074320744207452074620747207482074920750207512075220753207542075520756207572075820759207602076120762207632076420765207662076720768207692077020771207722077320774207752077620777207782077920780207812078220783207842078520786207872078820789207902079120792207932079420795207962079720798207992080020801208022080320804208052080620807208082080920810208112081220813208142081520816208172081820819208202082120822208232082420825208262082720828208292083020831208322083320834208352083620837208382083920840208412084220843208442084520846208472084820849208502085120852208532085420855208562085720858208592086020861208622086320864208652086620867208682086920870208712087220873208742087520876208772087820879208802088120882208832088420885208862088720888208892089020891208922089320894208952089620897208982089920900209012090220903209042090520906209072090820909209102091120912209132091420915209162091720918209192092020921209222092320924209252092620927209282092920930209312093220933209342093520936209372093820939209402094120942209432094420945209462094720948209492095020951209522095320954209552095620957209582095920960209612096220963209642096520966209672096820969209702097120972209732097420975209762097720978209792098020981209822098320984209852098620987209882098920990209912099220993209942099520996209972099820999210002100121002210032100421005210062100721008210092101021011210122101321014210152101621017210182101921020210212102221023210242102521026210272102821029210302103121032210332103421035210362103721038210392104021041210422104321044210452104621047210482104921050210512105221053210542105521056210572105821059210602106121062210632106421065210662106721068210692107021071210722107321074210752107621077210782107921080210812108221083210842108521086210872108821089210902109121092210932109421095210962109721098210992110021101211022110321104211052110621107211082110921110211112111221113211142111521116211172111821119211202112121122211232112421125211262112721128211292113021131211322113321134211352113621137211382113921140211412114221143211442114521146211472114821149211502115121152211532115421155211562115721158211592116021161211622116321164211652116621167211682116921170211712117221173211742117521176211772117821179211802118121182211832118421185211862118721188211892119021191211922119321194211952119621197211982119921200212012120221203212042120521206212072120821209212102121121212212132121421215212162121721218212192122021221212222122321224212252122621227212282122921230212312123221233212342123521236212372123821239212402124121242212432124421245212462124721248212492125021251212522125321254212552125621257212582125921260212612126221263212642126521266212672126821269212702127121272212732127421275212762127721278212792128021281212822128321284212852128621287212882128921290212912129221293212942129521296212972129821299213002130121302213032130421305213062130721308213092131021311213122131321314213152131621317213182131921320213212132221323213242132521326213272132821329213302133121332213332133421335213362133721338213392134021341213422134321344213452134621347213482134921350213512135221353213542135521356213572135821359213602136121362213632136421365213662136721368213692137021371213722137321374213752137621377213782137921380213812138221383213842138521386213872138821389213902139121392213932139421395213962139721398213992140021401214022140321404214052140621407214082140921410214112141221413214142141521416214172141821419214202142121422214232142421425214262142721428214292143021431214322143321434214352143621437214382143921440214412144221443214442144521446214472144821449214502145121452214532145421455214562145721458214592146021461214622146321464214652146621467214682146921470214712147221473214742147521476214772147821479214802148121482214832148421485214862148721488214892149021491214922149321494214952149621497214982149921500215012150221503215042150521506215072150821509215102151121512215132151421515215162151721518215192152021521215222152321524215252152621527215282152921530215312153221533215342153521536215372153821539215402154121542215432154421545215462154721548215492155021551215522155321554215552155621557215582155921560215612156221563215642156521566215672156821569215702157121572215732157421575215762157721578215792158021581215822158321584215852158621587215882158921590215912159221593215942159521596215972159821599216002160121602216032160421605216062160721608216092161021611216122161321614216152161621617216182161921620216212162221623216242162521626216272162821629216302163121632216332163421635216362163721638216392164021641216422164321644216452164621647216482164921650216512165221653216542165521656216572165821659216602166121662216632166421665216662166721668216692167021671216722167321674216752167621677216782167921680216812168221683216842168521686216872168821689216902169121692216932169421695216962169721698216992170021701217022170321704217052170621707217082170921710217112171221713217142171521716217172171821719217202172121722217232172421725217262172721728217292173021731217322173321734217352173621737217382173921740217412174221743217442174521746217472174821749217502175121752217532175421755217562175721758217592176021761217622176321764217652176621767217682176921770217712177221773217742177521776217772177821779217802178121782217832178421785217862178721788217892179021791217922179321794217952179621797217982179921800218012180221803218042180521806218072180821809218102181121812218132181421815218162181721818218192182021821218222182321824218252182621827218282182921830218312183221833218342183521836218372183821839218402184121842218432184421845218462184721848218492185021851218522185321854218552185621857218582185921860218612186221863218642186521866218672186821869218702187121872218732187421875218762187721878218792188021881218822188321884218852188621887218882188921890218912189221893218942189521896218972189821899219002190121902219032190421905219062190721908219092191021911219122191321914219152191621917219182191921920219212192221923219242192521926219272192821929219302193121932219332193421935219362193721938219392194021941219422194321944219452194621947219482194921950219512195221953219542195521956219572195821959219602196121962219632196421965219662196721968219692197021971219722197321974219752197621977219782197921980219812198221983219842198521986219872198821989219902199121992219932199421995219962199721998219992200022001220022200322004220052200622007220082200922010220112201222013220142201522016220172201822019220202202122022220232202422025220262202722028220292203022031220322203322034220352203622037220382203922040220412204222043220442204522046220472204822049220502205122052220532205422055220562205722058220592206022061220622206322064220652206622067220682206922070220712207222073220742207522076220772207822079220802208122082220832208422085220862208722088220892209022091220922209322094220952209622097220982209922100221012210222103221042210522106221072210822109221102211122112221132211422115221162211722118221192212022121221222212322124221252212622127221282212922130221312213222133221342213522136221372213822139221402214122142221432214422145221462214722148221492215022151221522215322154221552215622157221582215922160221612216222163221642216522166221672216822169221702217122172221732217422175221762217722178221792218022181221822218322184221852218622187221882218922190221912219222193221942219522196221972219822199222002220122202222032220422205222062220722208222092221022211222122221322214222152221622217222182221922220222212222222223222242222522226222272222822229222302223122232222332223422235222362223722238222392224022241222422224322244222452224622247222482224922250222512225222253222542225522256222572225822259222602226122262222632226422265222662226722268222692227022271222722227322274222752227622277222782227922280222812228222283222842228522286222872228822289222902229122292222932229422295222962229722298222992230022301223022230322304223052230622307223082230922310223112231222313223142231522316223172231822319223202232122322223232232422325223262232722328223292233022331223322233322334223352233622337223382233922340223412234222343223442234522346223472234822349223502235122352223532235422355223562235722358223592236022361223622236322364223652236622367223682236922370223712237222373223742237522376223772237822379223802238122382223832238422385223862238722388223892239022391223922239322394223952239622397223982239922400224012240222403224042240522406224072240822409224102241122412224132241422415224162241722418224192242022421224222242322424224252242622427224282242922430224312243222433224342243522436224372243822439224402244122442224432244422445224462244722448224492245022451224522245322454224552245622457224582245922460224612246222463224642246522466224672246822469224702247122472224732247422475224762247722478224792248022481224822248322484224852248622487224882248922490224912249222493224942249522496224972249822499225002250122502225032250422505225062250722508225092251022511225122251322514225152251622517225182251922520225212252222523225242252522526225272252822529225302253122532225332253422535225362253722538225392254022541225422254322544225452254622547225482254922550225512255222553225542255522556225572255822559225602256122562225632256422565225662256722568225692257022571225722257322574225752257622577225782257922580225812258222583225842258522586225872258822589225902259122592225932259422595225962259722598225992260022601226022260322604226052260622607226082260922610226112261222613226142261522616226172261822619226202262122622226232262422625226262262722628226292263022631226322263322634226352263622637226382263922640226412264222643226442264522646226472264822649226502265122652226532265422655226562265722658226592266022661226622266322664226652266622667226682266922670226712267222673226742267522676226772267822679226802268122682226832268422685226862268722688226892269022691226922269322694226952269622697226982269922700227012270222703227042270522706227072270822709227102271122712227132271422715227162271722718227192272022721227222272322724227252272622727227282272922730227312273222733227342273522736227372273822739227402274122742227432274422745227462274722748227492275022751227522275322754227552275622757227582275922760227612276222763227642276522766227672276822769227702277122772227732277422775227762277722778227792278022781227822278322784227852278622787227882278922790227912279222793227942279522796227972279822799228002280122802228032280422805228062280722808228092281022811228122281322814228152281622817228182281922820228212282222823228242282522826228272282822829228302283122832228332283422835228362283722838228392284022841228422284322844228452284622847228482284922850228512285222853228542285522856228572285822859228602286122862228632286422865228662286722868228692287022871228722287322874228752287622877228782287922880228812288222883228842288522886228872288822889228902289122892228932289422895228962289722898228992290022901229022290322904229052290622907229082290922910229112291222913229142291522916229172291822919229202292122922229232292422925229262292722928229292293022931229322293322934229352293622937229382293922940229412294222943229442294522946229472294822949229502295122952229532295422955229562295722958229592296022961229622296322964229652296622967229682296922970229712297222973229742297522976229772297822979229802298122982229832298422985229862298722988229892299022991229922299322994229952299622997229982299923000230012300223003230042300523006230072300823009230102301123012230132301423015230162301723018230192302023021230222302323024230252302623027230282302923030230312303223033230342303523036230372303823039230402304123042230432304423045230462304723048230492305023051230522305323054230552305623057230582305923060230612306223063230642306523066230672306823069230702307123072230732307423075230762307723078230792308023081230822308323084230852308623087230882308923090230912309223093230942309523096230972309823099231002310123102231032310423105231062310723108231092311023111231122311323114231152311623117231182311923120231212312223123231242312523126231272312823129231302313123132231332313423135231362313723138231392314023141231422314323144231452314623147231482314923150231512315223153231542315523156231572315823159231602316123162231632316423165231662316723168231692317023171231722317323174231752317623177231782317923180231812318223183231842318523186231872318823189231902319123192231932319423195231962319723198231992320023201232022320323204232052320623207232082320923210232112321223213232142321523216232172321823219232202322123222232232322423225232262322723228232292323023231232322323323234232352323623237232382323923240232412324223243232442324523246232472324823249232502325123252232532325423255232562325723258232592326023261232622326323264232652326623267232682326923270232712327223273232742327523276232772327823279232802328123282232832328423285232862328723288232892329023291232922329323294232952329623297232982329923300233012330223303233042330523306233072330823309233102331123312233132331423315233162331723318233192332023321233222332323324233252332623327233282332923330233312333223333233342333523336233372333823339233402334123342233432334423345233462334723348233492335023351233522335323354233552335623357233582335923360233612336223363233642336523366233672336823369233702337123372233732337423375233762337723378233792338023381233822338323384233852338623387233882338923390233912339223393233942339523396233972339823399234002340123402234032340423405234062340723408234092341023411234122341323414234152341623417234182341923420234212342223423234242342523426234272342823429234302343123432234332343423435234362343723438234392344023441234422344323444234452344623447234482344923450234512345223453234542345523456234572345823459234602346123462234632346423465234662346723468234692347023471234722347323474234752347623477234782347923480234812348223483234842348523486234872348823489234902349123492234932349423495234962349723498234992350023501235022350323504235052350623507235082350923510235112351223513235142351523516235172351823519235202352123522235232352423525235262352723528235292353023531235322353323534235352353623537235382353923540235412354223543235442354523546235472354823549235502355123552235532355423555235562355723558235592356023561235622356323564235652356623567235682356923570235712357223573235742357523576235772357823579235802358123582235832358423585235862358723588235892359023591235922359323594235952359623597235982359923600236012360223603236042360523606236072360823609236102361123612236132361423615236162361723618236192362023621236222362323624236252362623627236282362923630236312363223633236342363523636236372363823639236402364123642236432364423645236462364723648236492365023651236522365323654236552365623657236582365923660236612366223663236642366523666236672366823669236702367123672236732367423675236762367723678236792368023681236822368323684236852368623687236882368923690236912369223693236942369523696236972369823699237002370123702237032370423705237062370723708237092371023711237122371323714237152371623717237182371923720237212372223723237242372523726237272372823729237302373123732237332373423735237362373723738237392374023741237422374323744237452374623747237482374923750237512375223753237542375523756237572375823759237602376123762237632376423765237662376723768237692377023771237722377323774237752377623777237782377923780237812378223783237842378523786237872378823789237902379123792237932379423795237962379723798237992380023801238022380323804238052380623807238082380923810238112381223813238142381523816238172381823819238202382123822238232382423825238262382723828238292383023831238322383323834238352383623837238382383923840238412384223843238442384523846238472384823849238502385123852238532385423855238562385723858238592386023861238622386323864238652386623867238682386923870238712387223873238742387523876238772387823879238802388123882238832388423885238862388723888238892389023891238922389323894238952389623897238982389923900239012390223903239042390523906239072390823909239102391123912239132391423915239162391723918239192392023921239222392323924239252392623927239282392923930239312393223933239342393523936239372393823939239402394123942239432394423945239462394723948239492395023951239522395323954239552395623957239582395923960239612396223963239642396523966239672396823969239702397123972239732397423975239762397723978239792398023981239822398323984239852398623987239882398923990239912399223993239942399523996239972399823999240002400124002240032400424005240062400724008240092401024011240122401324014240152401624017240182401924020240212402224023240242402524026240272402824029240302403124032240332403424035240362403724038240392404024041240422404324044240452404624047240482404924050240512405224053240542405524056240572405824059240602406124062240632406424065240662406724068240692407024071240722407324074240752407624077240782407924080240812408224083240842408524086240872408824089240902409124092240932409424095240962409724098240992410024101241022410324104241052410624107241082410924110241112411224113241142411524116241172411824119241202412124122241232412424125241262412724128241292413024131241322413324134241352413624137241382413924140241412414224143241442414524146241472414824149241502415124152241532415424155241562415724158241592416024161241622416324164241652416624167241682416924170241712417224173241742417524176241772417824179241802418124182241832418424185241862418724188241892419024191241922419324194241952419624197241982419924200242012420224203242042420524206242072420824209242102421124212242132421424215242162421724218242192422024221242222422324224242252422624227242282422924230242312423224233242342423524236242372423824239242402424124242242432424424245242462424724248242492425024251242522425324254242552425624257242582425924260242612426224263242642426524266242672426824269242702427124272242732427424275242762427724278242792428024281242822428324284242852428624287242882428924290242912429224293242942429524296242972429824299243002430124302243032430424305243062430724308243092431024311243122431324314243152431624317243182431924320243212432224323243242432524326243272432824329243302433124332243332433424335243362433724338243392434024341243422434324344243452434624347243482434924350243512435224353243542435524356243572435824359243602436124362243632436424365243662436724368243692437024371243722437324374243752437624377243782437924380243812438224383243842438524386243872438824389243902439124392243932439424395243962439724398243992440024401244022440324404244052440624407244082440924410244112441224413244142441524416244172441824419244202442124422244232442424425244262442724428244292443024431244322443324434244352443624437244382443924440244412444224443244442444524446244472444824449244502445124452244532445424455244562445724458244592446024461244622446324464244652446624467244682446924470244712447224473244742447524476244772447824479244802448124482244832448424485244862448724488244892449024491244922449324494244952449624497244982449924500245012450224503245042450524506245072450824509245102451124512245132451424515245162451724518245192452024521245222452324524245252452624527245282452924530245312453224533245342453524536245372453824539245402454124542245432454424545245462454724548245492455024551245522455324554245552455624557245582455924560245612456224563245642456524566245672456824569245702457124572245732457424575245762457724578245792458024581245822458324584245852458624587245882458924590245912459224593245942459524596245972459824599246002460124602246032460424605246062460724608246092461024611246122461324614246152461624617246182461924620246212462224623246242462524626246272462824629246302463124632246332463424635246362463724638246392464024641246422464324644246452464624647246482464924650246512465224653246542465524656246572465824659246602466124662246632466424665246662466724668246692467024671246722467324674246752467624677246782467924680246812468224683246842468524686246872468824689246902469124692246932469424695246962469724698246992470024701247022470324704247052470624707247082470924710247112471224713247142471524716247172471824719247202472124722247232472424725247262472724728247292473024731247322473324734247352473624737247382473924740247412474224743247442474524746247472474824749247502475124752247532475424755247562475724758247592476024761247622476324764247652476624767247682476924770247712477224773247742477524776247772477824779247802478124782247832478424785247862478724788247892479024791247922479324794247952479624797247982479924800248012480224803248042480524806248072480824809248102481124812248132481424815248162481724818248192482024821248222482324824248252482624827248282482924830248312483224833248342483524836248372483824839248402484124842248432484424845248462484724848248492485024851248522485324854248552485624857248582485924860248612486224863248642486524866248672486824869248702487124872248732487424875248762487724878248792488024881248822488324884248852488624887248882488924890248912489224893248942489524896248972489824899249002490124902249032490424905249062490724908249092491024911249122491324914249152491624917249182491924920249212492224923249242492524926249272492824929249302493124932249332493424935249362493724938249392494024941249422494324944249452494624947249482494924950249512495224953249542495524956249572495824959249602496124962249632496424965249662496724968249692497024971249722497324974249752497624977249782497924980249812498224983249842498524986249872498824989249902499124992249932499424995249962499724998249992500025001250022500325004250052500625007250082500925010250112501225013250142501525016250172501825019250202502125022250232502425025250262502725028250292503025031250322503325034250352503625037250382503925040250412504225043250442504525046250472504825049250502505125052250532505425055250562505725058250592506025061250622506325064250652506625067250682506925070250712507225073250742507525076250772507825079250802508125082250832508425085250862508725088250892509025091250922509325094250952509625097250982509925100251012510225103251042510525106251072510825109251102511125112251132511425115251162511725118251192512025121251222512325124251252512625127251282512925130251312513225133251342513525136251372513825139251402514125142251432514425145251462514725148251492515025151251522515325154251552515625157251582515925160251612516225163251642516525166251672516825169251702517125172251732517425175251762517725178251792518025181251822518325184251852518625187251882518925190251912519225193251942519525196251972519825199252002520125202252032520425205252062520725208252092521025211252122521325214252152521625217252182521925220252212522225223252242522525226252272522825229252302523125232252332523425235252362523725238252392524025241252422524325244252452524625247252482524925250252512525225253252542525525256252572525825259252602526125262252632526425265252662526725268252692527025271252722527325274252752527625277252782527925280252812528225283252842528525286252872528825289252902529125292252932529425295252962529725298252992530025301253022530325304253052530625307253082530925310253112531225313253142531525316253172531825319253202532125322253232532425325253262532725328253292533025331253322533325334253352533625337253382533925340253412534225343253442534525346253472534825349253502535125352253532535425355253562535725358253592536025361253622536325364253652536625367253682536925370253712537225373253742537525376253772537825379253802538125382253832538425385253862538725388253892539025391253922539325394253952539625397253982539925400254012540225403254042540525406254072540825409254102541125412254132541425415254162541725418254192542025421254222542325424254252542625427254282542925430254312543225433254342543525436254372543825439254402544125442254432544425445254462544725448254492545025451254522545325454254552545625457254582545925460254612546225463254642546525466254672546825469254702547125472254732547425475254762547725478254792548025481254822548325484254852548625487254882548925490254912549225493254942549525496254972549825499255002550125502255032550425505255062550725508255092551025511255122551325514255152551625517255182551925520255212552225523255242552525526255272552825529255302553125532255332553425535255362553725538255392554025541255422554325544255452554625547255482554925550255512555225553255542555525556255572555825559255602556125562255632556425565255662556725568255692557025571255722557325574255752557625577255782557925580255812558225583255842558525586255872558825589255902559125592255932559425595255962559725598255992560025601256022560325604256052560625607256082560925610256112561225613256142561525616256172561825619256202562125622256232562425625256262562725628256292563025631256322563325634256352563625637256382563925640256412564225643256442564525646256472564825649256502565125652256532565425655256562565725658256592566025661256622566325664256652566625667256682566925670256712567225673256742567525676256772567825679256802568125682256832568425685256862568725688256892569025691256922569325694256952569625697256982569925700257012570225703257042570525706257072570825709257102571125712257132571425715257162571725718257192572025721257222572325724257252572625727257282572925730257312573225733257342573525736257372573825739257402574125742257432574425745257462574725748257492575025751257522575325754257552575625757257582575925760257612576225763257642576525766257672576825769257702577125772257732577425775257762577725778257792578025781257822578325784257852578625787257882578925790257912579225793257942579525796257972579825799258002580125802258032580425805258062580725808258092581025811258122581325814258152581625817258182581925820258212582225823258242582525826258272582825829258302583125832258332583425835258362583725838258392584025841258422584325844258452584625847258482584925850258512585225853258542585525856258572585825859258602586125862258632586425865258662586725868258692587025871258722587325874258752587625877258782587925880258812588225883258842588525886258872588825889258902589125892258932589425895258962589725898258992590025901259022590325904259052590625907259082590925910259112591225913259142591525916259172591825919259202592125922259232592425925259262592725928259292593025931259322593325934259352593625937259382593925940259412594225943259442594525946259472594825949259502595125952259532595425955259562595725958259592596025961259622596325964259652596625967259682596925970259712597225973259742597525976259772597825979259802598125982259832598425985259862598725988259892599025991259922599325994259952599625997259982599926000260012600226003260042600526006260072600826009260102601126012260132601426015260162601726018260192602026021260222602326024260252602626027260282602926030260312603226033260342603526036260372603826039260402604126042260432604426045260462604726048260492605026051260522605326054260552605626057260582605926060260612606226063260642606526066260672606826069260702607126072260732607426075260762607726078260792608026081260822608326084260852608626087260882608926090260912609226093260942609526096260972609826099261002610126102261032610426105261062610726108261092611026111261122611326114261152611626117261182611926120261212612226123261242612526126261272612826129261302613126132261332613426135261362613726138261392614026141261422614326144261452614626147261482614926150261512615226153261542615526156261572615826159261602616126162261632616426165261662616726168261692617026171261722617326174261752617626177261782617926180261812618226183261842618526186261872618826189261902619126192261932619426195261962619726198261992620026201262022620326204262052620626207262082620926210262112621226213262142621526216262172621826219262202622126222262232622426225262262622726228262292623026231262322623326234262352623626237262382623926240262412624226243262442624526246262472624826249262502625126252262532625426255262562625726258262592626026261262622626326264262652626626267262682626926270262712627226273262742627526276262772627826279262802628126282262832628426285262862628726288262892629026291262922629326294262952629626297262982629926300263012630226303263042630526306263072630826309263102631126312263132631426315263162631726318263192632026321263222632326324263252632626327263282632926330263312633226333263342633526336263372633826339263402634126342263432634426345263462634726348263492635026351263522635326354263552635626357263582635926360263612636226363263642636526366263672636826369263702637126372263732637426375263762637726378263792638026381263822638326384263852638626387263882638926390263912639226393263942639526396263972639826399264002640126402264032640426405264062640726408264092641026411264122641326414264152641626417264182641926420264212642226423264242642526426264272642826429264302643126432264332643426435264362643726438264392644026441264422644326444264452644626447264482644926450264512645226453264542645526456264572645826459264602646126462264632646426465264662646726468264692647026471264722647326474264752647626477264782647926480264812648226483264842648526486264872648826489264902649126492264932649426495264962649726498264992650026501265022650326504265052650626507265082650926510265112651226513265142651526516265172651826519265202652126522265232652426525265262652726528265292653026531265322653326534265352653626537265382653926540265412654226543265442654526546265472654826549265502655126552265532655426555265562655726558265592656026561265622656326564265652656626567265682656926570265712657226573265742657526576265772657826579265802658126582265832658426585265862658726588265892659026591265922659326594265952659626597265982659926600266012660226603266042660526606266072660826609266102661126612266132661426615266162661726618266192662026621266222662326624266252662626627266282662926630266312663226633266342663526636266372663826639266402664126642266432664426645266462664726648266492665026651266522665326654266552665626657266582665926660266612666226663266642666526666266672666826669266702667126672266732667426675266762667726678266792668026681266822668326684266852668626687266882668926690266912669226693266942669526696266972669826699267002670126702267032670426705267062670726708267092671026711267122671326714267152671626717267182671926720267212672226723267242672526726267272672826729267302673126732267332673426735267362673726738267392674026741267422674326744267452674626747267482674926750267512675226753267542675526756267572675826759267602676126762267632676426765267662676726768267692677026771267722677326774267752677626777267782677926780267812678226783267842678526786267872678826789267902679126792267932679426795267962679726798267992680026801268022680326804268052680626807268082680926810268112681226813268142681526816268172681826819268202682126822268232682426825268262682726828268292683026831268322683326834268352683626837268382683926840268412684226843268442684526846268472684826849268502685126852268532685426855268562685726858268592686026861268622686326864268652686626867268682686926870268712687226873268742687526876268772687826879268802688126882268832688426885268862688726888268892689026891268922689326894268952689626897268982689926900269012690226903269042690526906269072690826909269102691126912269132691426915269162691726918269192692026921269222692326924269252692626927269282692926930269312693226933269342693526936269372693826939269402694126942269432694426945269462694726948269492695026951269522695326954269552695626957269582695926960269612696226963269642696526966269672696826969269702697126972269732697426975269762697726978269792698026981269822698326984269852698626987269882698926990269912699226993269942699526996269972699826999270002700127002270032700427005270062700727008270092701027011270122701327014270152701627017270182701927020270212702227023270242702527026270272702827029270302703127032270332703427035270362703727038270392704027041270422704327044270452704627047270482704927050270512705227053270542705527056270572705827059270602706127062270632706427065270662706727068270692707027071270722707327074270752707627077270782707927080270812708227083270842708527086270872708827089270902709127092270932709427095270962709727098270992710027101271022710327104271052710627107271082710927110271112711227113271142711527116271172711827119271202712127122271232712427125271262712727128271292713027131271322713327134271352713627137271382713927140271412714227143271442714527146271472714827149271502715127152271532715427155271562715727158271592716027161271622716327164271652716627167271682716927170271712717227173271742717527176271772717827179271802718127182271832718427185271862718727188271892719027191271922719327194271952719627197271982719927200272012720227203272042720527206272072720827209272102721127212272132721427215272162721727218272192722027221272222722327224272252722627227272282722927230272312723227233272342723527236272372723827239272402724127242272432724427245272462724727248272492725027251272522725327254272552725627257272582725927260272612726227263272642726527266272672726827269272702727127272272732727427275272762727727278272792728027281272822728327284272852728627287272882728927290272912729227293272942729527296272972729827299273002730127302273032730427305273062730727308273092731027311273122731327314273152731627317273182731927320273212732227323273242732527326273272732827329273302733127332273332733427335273362733727338273392734027341273422734327344273452734627347273482734927350273512735227353273542735527356273572735827359273602736127362273632736427365273662736727368273692737027371273722737327374273752737627377273782737927380273812738227383273842738527386273872738827389273902739127392273932739427395273962739727398273992740027401274022740327404274052740627407274082740927410274112741227413274142741527416274172741827419274202742127422274232742427425274262742727428274292743027431274322743327434274352743627437274382743927440274412744227443274442744527446274472744827449274502745127452274532745427455274562745727458274592746027461274622746327464274652746627467274682746927470274712747227473274742747527476274772747827479274802748127482274832748427485274862748727488274892749027491274922749327494274952749627497274982749927500275012750227503275042750527506275072750827509275102751127512275132751427515275162751727518275192752027521275222752327524275252752627527275282752927530275312753227533275342753527536275372753827539275402754127542275432754427545275462754727548275492755027551275522755327554275552755627557275582755927560275612756227563275642756527566275672756827569275702757127572275732757427575275762757727578275792758027581275822758327584275852758627587275882758927590275912759227593275942759527596275972759827599276002760127602276032760427605276062760727608276092761027611276122761327614276152761627617276182761927620276212762227623276242762527626276272762827629276302763127632276332763427635276362763727638276392764027641276422764327644276452764627647276482764927650276512765227653276542765527656276572765827659276602766127662276632766427665276662766727668276692767027671276722767327674276752767627677276782767927680276812768227683276842768527686276872768827689276902769127692276932769427695276962769727698276992770027701277022770327704277052770627707277082770927710277112771227713277142771527716277172771827719277202772127722277232772427725277262772727728277292773027731277322773327734277352773627737277382773927740277412774227743277442774527746277472774827749277502775127752277532775427755277562775727758277592776027761277622776327764277652776627767277682776927770277712777227773277742777527776277772777827779277802778127782277832778427785277862778727788277892779027791277922779327794277952779627797277982779927800278012780227803278042780527806278072780827809278102781127812278132781427815278162781727818278192782027821278222782327824278252782627827278282782927830278312783227833278342783527836278372783827839278402784127842278432784427845278462784727848278492785027851278522785327854278552785627857278582785927860278612786227863278642786527866278672786827869278702787127872278732787427875278762787727878278792788027881278822788327884278852788627887278882788927890278912789227893278942789527896278972789827899279002790127902279032790427905279062790727908279092791027911279122791327914279152791627917279182791927920279212792227923279242792527926279272792827929279302793127932279332793427935279362793727938279392794027941279422794327944279452794627947279482794927950279512795227953279542795527956279572795827959279602796127962279632796427965279662796727968279692797027971279722797327974279752797627977279782797927980279812798227983279842798527986279872798827989279902799127992279932799427995279962799727998279992800028001280022800328004280052800628007280082800928010280112801228013280142801528016280172801828019280202802128022280232802428025280262802728028280292803028031280322803328034280352803628037280382803928040280412804228043280442804528046280472804828049280502805128052280532805428055280562805728058280592806028061280622806328064280652806628067280682806928070280712807228073280742807528076280772807828079280802808128082280832808428085280862808728088280892809028091280922809328094280952809628097280982809928100281012810228103281042810528106281072810828109281102811128112281132811428115281162811728118281192812028121281222812328124281252812628127281282812928130281312813228133281342813528136281372813828139281402814128142281432814428145281462814728148281492815028151281522815328154281552815628157281582815928160281612816228163281642816528166281672816828169281702817128172281732817428175281762817728178281792818028181281822818328184281852818628187281882818928190281912819228193281942819528196281972819828199282002820128202282032820428205282062820728208282092821028211282122821328214282152821628217282182821928220282212822228223282242822528226282272822828229282302823128232282332823428235282362823728238282392824028241282422824328244282452824628247282482824928250282512825228253282542825528256282572825828259282602826128262282632826428265282662826728268282692827028271282722827328274282752827628277282782827928280282812828228283282842828528286282872828828289282902829128292282932829428295282962829728298282992830028301283022830328304283052830628307283082830928310283112831228313283142831528316283172831828319283202832128322283232832428325283262832728328283292833028331283322833328334283352833628337283382833928340283412834228343283442834528346283472834828349283502835128352283532835428355283562835728358283592836028361283622836328364283652836628367283682836928370283712837228373283742837528376283772837828379283802838128382283832838428385283862838728388283892839028391283922839328394283952839628397283982839928400284012840228403284042840528406284072840828409284102841128412284132841428415284162841728418284192842028421284222842328424284252842628427284282842928430284312843228433284342843528436284372843828439284402844128442284432844428445284462844728448284492845028451284522845328454284552845628457284582845928460284612846228463284642846528466284672846828469284702847128472284732847428475284762847728478284792848028481284822848328484284852848628487284882848928490284912849228493284942849528496284972849828499285002850128502285032850428505285062850728508285092851028511285122851328514285152851628517285182851928520285212852228523285242852528526285272852828529285302853128532285332853428535285362853728538285392854028541285422854328544285452854628547285482854928550285512855228553285542855528556285572855828559285602856128562285632856428565285662856728568285692857028571285722857328574285752857628577285782857928580285812858228583285842858528586285872858828589285902859128592285932859428595285962859728598285992860028601286022860328604286052860628607286082860928610286112861228613286142861528616286172861828619286202862128622286232862428625286262862728628286292863028631286322863328634286352863628637286382863928640286412864228643286442864528646286472864828649286502865128652286532865428655286562865728658286592866028661286622866328664286652866628667286682866928670286712867228673286742867528676286772867828679286802868128682286832868428685286862868728688286892869028691286922869328694286952869628697286982869928700287012870228703287042870528706287072870828709287102871128712287132871428715287162871728718287192872028721287222872328724287252872628727287282872928730287312873228733287342873528736287372873828739287402874128742287432874428745287462874728748287492875028751287522875328754287552875628757287582875928760287612876228763287642876528766287672876828769287702877128772287732877428775287762877728778287792878028781287822878328784287852878628787287882878928790287912879228793287942879528796287972879828799288002880128802288032880428805288062880728808288092881028811288122881328814288152881628817288182881928820288212882228823288242882528826288272882828829288302883128832288332883428835288362883728838288392884028841288422884328844288452884628847288482884928850288512885228853288542885528856288572885828859288602886128862288632886428865288662886728868288692887028871288722887328874288752887628877288782887928880288812888228883288842888528886288872888828889288902889128892288932889428895288962889728898288992890028901289022890328904289052890628907289082890928910289112891228913289142891528916289172891828919289202892128922289232892428925289262892728928289292893028931289322893328934289352893628937289382893928940289412894228943289442894528946289472894828949289502895128952289532895428955289562895728958289592896028961289622896328964289652896628967289682896928970289712897228973289742897528976289772897828979289802898128982289832898428985289862898728988289892899028991289922899328994289952899628997289982899929000290012900229003290042900529006290072900829009290102901129012290132901429015290162901729018290192902029021290222902329024290252902629027290282902929030290312903229033290342903529036290372903829039290402904129042290432904429045290462904729048290492905029051290522905329054290552905629057290582905929060290612906229063290642906529066290672906829069290702907129072290732907429075290762907729078290792908029081290822908329084290852908629087290882908929090290912909229093290942909529096290972909829099291002910129102291032910429105291062910729108291092911029111291122911329114291152911629117291182911929120291212912229123291242912529126291272912829129291302913129132291332913429135291362913729138291392914029141291422914329144291452914629147291482914929150291512915229153291542915529156291572915829159291602916129162291632916429165291662916729168291692917029171291722917329174291752917629177291782917929180291812918229183291842918529186291872918829189291902919129192291932919429195291962919729198291992920029201292022920329204292052920629207292082920929210292112921229213292142921529216292172921829219292202922129222292232922429225292262922729228292292923029231292322923329234292352923629237292382923929240292412924229243292442924529246292472924829249292502925129252292532925429255292562925729258292592926029261292622926329264292652926629267292682926929270292712927229273292742927529276292772927829279292802928129282292832928429285292862928729288292892929029291292922929329294292952929629297292982929929300293012930229303293042930529306293072930829309293102931129312293132931429315293162931729318293192932029321293222932329324293252932629327293282932929330293312933229333293342933529336293372933829339293402934129342293432934429345293462934729348293492935029351293522935329354293552935629357293582935929360293612936229363293642936529366293672936829369293702937129372293732937429375293762937729378293792938029381293822938329384293852938629387293882938929390293912939229393293942939529396293972939829399294002940129402294032940429405294062940729408294092941029411294122941329414294152941629417294182941929420294212942229423294242942529426294272942829429294302943129432294332943429435294362943729438294392944029441294422944329444294452944629447294482944929450294512945229453294542945529456294572945829459294602946129462294632946429465294662946729468294692947029471294722947329474294752947629477294782947929480294812948229483294842948529486294872948829489294902949129492294932949429495294962949729498294992950029501295022950329504295052950629507295082950929510295112951229513295142951529516295172951829519295202952129522295232952429525295262952729528295292953029531295322953329534295352953629537295382953929540295412954229543295442954529546295472954829549295502955129552295532955429555295562955729558295592956029561295622956329564295652956629567295682956929570295712957229573295742957529576295772957829579295802958129582295832958429585295862958729588295892959029591295922959329594295952959629597295982959929600296012960229603296042960529606296072960829609296102961129612296132961429615296162961729618296192962029621296222962329624296252962629627296282962929630296312963229633296342963529636296372963829639296402964129642296432964429645296462964729648296492965029651296522965329654296552965629657296582965929660296612966229663296642966529666296672966829669296702967129672296732967429675296762967729678296792968029681296822968329684296852968629687296882968929690296912969229693296942969529696296972969829699297002970129702297032970429705297062970729708297092971029711297122971329714297152971629717297182971929720297212972229723297242972529726297272972829729297302973129732297332973429735297362973729738297392974029741297422974329744297452974629747297482974929750297512975229753297542975529756297572975829759297602976129762297632976429765297662976729768297692977029771297722977329774297752977629777297782977929780297812978229783297842978529786297872978829789297902979129792297932979429795297962979729798297992980029801298022980329804298052980629807298082980929810298112981229813298142981529816298172981829819298202982129822298232982429825298262982729828298292983029831298322983329834298352983629837298382983929840298412984229843298442984529846298472984829849298502985129852298532985429855298562985729858298592986029861298622986329864298652986629867298682986929870298712987229873298742987529876298772987829879298802988129882298832988429885298862988729888298892989029891298922989329894298952989629897298982989929900299012990229903299042990529906299072990829909299102991129912299132991429915299162991729918299192992029921299222992329924299252992629927299282992929930299312993229933299342993529936299372993829939299402994129942299432994429945299462994729948299492995029951299522995329954299552995629957299582995929960299612996229963299642996529966299672996829969299702997129972299732997429975299762997729978299792998029981299822998329984299852998629987299882998929990299912999229993299942999529996299972999829999300003000130002300033000430005300063000730008300093001030011300123001330014300153001630017300183001930020300213002230023300243002530026300273002830029300303003130032300333003430035300363003730038300393004030041300423004330044300453004630047300483004930050300513005230053300543005530056300573005830059300603006130062300633006430065300663006730068300693007030071300723007330074300753007630077300783007930080300813008230083300843008530086300873008830089300903009130092300933009430095300963009730098300993010030101301023010330104301053010630107301083010930110301113011230113301143011530116301173011830119301203012130122301233012430125301263012730128301293013030131301323013330134301353013630137301383013930140301413014230143301443014530146301473014830149301503015130152301533015430155301563015730158301593016030161301623016330164301653016630167301683016930170301713017230173301743017530176301773017830179301803018130182301833018430185301863018730188301893019030191301923019330194301953019630197301983019930200302013020230203302043020530206302073020830209302103021130212302133021430215302163021730218302193022030221302223022330224302253022630227302283022930230302313023230233302343023530236302373023830239302403024130242302433024430245302463024730248302493025030251302523025330254302553025630257302583025930260302613026230263302643026530266302673026830269302703027130272302733027430275302763027730278302793028030281302823028330284302853028630287302883028930290302913029230293302943029530296302973029830299303003030130302303033030430305303063030730308303093031030311303123031330314303153031630317303183031930320303213032230323303243032530326303273032830329303303033130332303333033430335303363033730338303393034030341303423034330344303453034630347303483034930350303513035230353303543035530356303573035830359303603036130362303633036430365303663036730368303693037030371303723037330374303753037630377303783037930380303813038230383303843038530386303873038830389303903039130392303933039430395303963039730398303993040030401304023040330404304053040630407304083040930410304113041230413304143041530416304173041830419304203042130422304233042430425304263042730428304293043030431304323043330434304353043630437304383043930440304413044230443304443044530446304473044830449304503045130452304533045430455304563045730458304593046030461304623046330464304653046630467304683046930470304713047230473304743047530476304773047830479304803048130482304833048430485304863048730488304893049030491304923049330494304953049630497304983049930500305013050230503305043050530506305073050830509305103051130512305133051430515305163051730518305193052030521305223052330524305253052630527305283052930530305313053230533305343053530536305373053830539305403054130542305433054430545305463054730548305493055030551305523055330554305553055630557305583055930560305613056230563305643056530566305673056830569305703057130572305733057430575305763057730578305793058030581305823058330584305853058630587305883058930590305913059230593305943059530596305973059830599306003060130602306033060430605306063060730608306093061030611306123061330614306153061630617306183061930620306213062230623306243062530626306273062830629306303063130632306333063430635306363063730638306393064030641306423064330644306453064630647306483064930650306513065230653306543065530656306573065830659306603066130662306633066430665306663066730668306693067030671306723067330674306753067630677306783067930680306813068230683306843068530686306873068830689306903069130692306933069430695306963069730698306993070030701307023070330704307053070630707307083070930710307113071230713307143071530716307173071830719307203072130722307233072430725307263072730728307293073030731307323073330734307353073630737307383073930740307413074230743307443074530746307473074830749307503075130752307533075430755307563075730758307593076030761307623076330764307653076630767307683076930770307713077230773307743077530776307773077830779307803078130782307833078430785307863078730788307893079030791307923079330794307953079630797307983079930800308013080230803308043080530806308073080830809308103081130812308133081430815308163081730818308193082030821308223082330824308253082630827308283082930830308313083230833308343083530836308373083830839308403084130842308433084430845308463084730848308493085030851308523085330854308553085630857308583085930860308613086230863308643086530866308673086830869308703087130872308733087430875308763087730878308793088030881308823088330884308853088630887308883088930890308913089230893308943089530896308973089830899309003090130902309033090430905309063090730908309093091030911309123091330914309153091630917309183091930920309213092230923309243092530926309273092830929309303093130932309333093430935309363093730938309393094030941309423094330944309453094630947309483094930950309513095230953309543095530956309573095830959309603096130962309633096430965309663096730968309693097030971309723097330974309753097630977309783097930980309813098230983309843098530986309873098830989309903099130992309933099430995309963099730998309993100031001310023100331004310053100631007310083100931010310113101231013310143101531016310173101831019310203102131022310233102431025310263102731028310293103031031310323103331034310353103631037310383103931040310413104231043310443104531046310473104831049310503105131052310533105431055310563105731058310593106031061310623106331064310653106631067310683106931070310713107231073310743107531076310773107831079310803108131082310833108431085310863108731088310893109031091310923109331094310953109631097310983109931100311013110231103311043110531106311073110831109311103111131112311133111431115311163111731118311193112031121311223112331124311253112631127311283112931130311313113231133311343113531136311373113831139311403114131142311433114431145311463114731148311493115031151311523115331154311553115631157311583115931160311613116231163311643116531166311673116831169311703117131172311733117431175311763117731178311793118031181311823118331184311853118631187311883118931190311913119231193311943119531196311973119831199312003120131202312033120431205312063120731208312093121031211312123121331214312153121631217312183121931220312213122231223312243122531226312273122831229312303123131232312333123431235312363123731238312393124031241312423124331244312453124631247312483124931250312513125231253312543125531256312573125831259312603126131262312633126431265312663126731268312693127031271312723127331274312753127631277312783127931280312813128231283312843128531286312873128831289312903129131292312933129431295312963129731298312993130031301313023130331304313053130631307313083130931310313113131231313313143131531316313173131831319313203132131322313233132431325313263132731328313293133031331313323133331334313353133631337313383133931340313413134231343313443134531346313473134831349313503135131352313533135431355313563135731358313593136031361313623136331364313653136631367313683136931370313713137231373313743137531376313773137831379313803138131382313833138431385313863138731388313893139031391313923139331394313953139631397313983139931400314013140231403314043140531406314073140831409314103141131412314133141431415314163141731418314193142031421314223142331424314253142631427314283142931430314313143231433314343143531436314373143831439314403144131442314433144431445314463144731448314493145031451314523145331454314553145631457314583145931460314613146231463314643146531466314673146831469314703147131472314733147431475314763147731478314793148031481314823148331484314853148631487314883148931490314913149231493314943149531496314973149831499315003150131502315033150431505315063150731508315093151031511315123151331514315153151631517315183151931520315213152231523315243152531526315273152831529315303153131532315333153431535315363153731538315393154031541315423154331544315453154631547315483154931550315513155231553315543155531556315573155831559315603156131562315633156431565315663156731568315693157031571315723157331574315753157631577315783157931580315813158231583315843158531586315873158831589315903159131592315933159431595315963159731598315993160031601316023160331604316053160631607316083160931610316113161231613316143161531616316173161831619316203162131622316233162431625316263162731628316293163031631316323163331634316353163631637316383163931640316413164231643316443164531646316473164831649316503165131652316533165431655316563165731658316593166031661316623166331664316653166631667316683166931670316713167231673316743167531676316773167831679316803168131682316833168431685316863168731688316893169031691316923169331694316953169631697316983169931700317013170231703317043170531706317073170831709317103171131712317133171431715317163171731718317193172031721317223172331724317253172631727317283172931730317313173231733317343173531736317373173831739317403174131742317433174431745317463174731748317493175031751317523175331754317553175631757317583175931760317613176231763317643176531766317673176831769317703177131772317733177431775317763177731778317793178031781317823178331784317853178631787317883178931790317913179231793317943179531796317973179831799318003180131802318033180431805318063180731808318093181031811318123181331814318153181631817318183181931820318213182231823318243182531826318273182831829318303183131832318333183431835318363183731838318393184031841318423184331844318453184631847318483184931850318513185231853318543185531856318573185831859318603186131862318633186431865318663186731868318693187031871318723187331874318753187631877318783187931880318813188231883318843188531886318873188831889318903189131892318933189431895318963189731898318993190031901319023190331904319053190631907319083190931910319113191231913319143191531916319173191831919319203192131922319233192431925319263192731928319293193031931319323193331934319353193631937319383193931940319413194231943319443194531946319473194831949319503195131952319533195431955319563195731958319593196031961319623196331964319653196631967319683196931970319713197231973319743197531976319773197831979319803198131982319833198431985319863198731988319893199031991319923199331994319953199631997319983199932000320013200232003320043200532006320073200832009320103201132012320133201432015320163201732018320193202032021320223202332024320253202632027320283202932030320313203232033320343203532036320373203832039320403204132042320433204432045320463204732048320493205032051320523205332054320553205632057320583205932060320613206232063320643206532066320673206832069320703207132072320733207432075320763207732078320793208032081320823208332084320853208632087320883208932090320913209232093320943209532096320973209832099321003210132102321033210432105321063210732108321093211032111321123211332114321153211632117321183211932120321213212232123321243212532126321273212832129321303213132132321333213432135321363213732138321393214032141321423214332144321453214632147321483214932150321513215232153321543215532156321573215832159321603216132162321633216432165321663216732168321693217032171321723217332174321753217632177321783217932180321813218232183321843218532186321873218832189321903219132192321933219432195321963219732198321993220032201322023220332204322053220632207322083220932210322113221232213322143221532216322173221832219322203222132222322233222432225322263222732228322293223032231322323223332234322353223632237322383223932240322413224232243322443224532246322473224832249322503225132252322533225432255322563225732258322593226032261322623226332264322653226632267322683226932270322713227232273322743227532276322773227832279322803228132282322833228432285322863228732288322893229032291322923229332294322953229632297322983229932300323013230232303323043230532306323073230832309323103231132312323133231432315323163231732318323193232032321323223232332324323253232632327323283232932330323313233232333323343233532336323373233832339323403234132342323433234432345323463234732348323493235032351323523235332354323553235632357323583235932360323613236232363323643236532366323673236832369323703237132372323733237432375323763237732378323793238032381323823238332384323853238632387323883238932390323913239232393323943239532396323973239832399324003240132402324033240432405324063240732408324093241032411324123241332414324153241632417324183241932420324213242232423324243242532426324273242832429324303243132432324333243432435324363243732438324393244032441324423244332444324453244632447324483244932450324513245232453324543245532456324573245832459324603246132462324633246432465324663246732468324693247032471324723247332474324753247632477324783247932480324813248232483324843248532486324873248832489324903249132492324933249432495324963249732498324993250032501325023250332504325053250632507325083250932510325113251232513325143251532516325173251832519325203252132522325233252432525325263252732528325293253032531325323253332534325353253632537325383253932540325413254232543325443254532546325473254832549325503255132552325533255432555325563255732558325593256032561325623256332564325653256632567325683256932570325713257232573325743257532576325773257832579325803258132582325833258432585325863258732588325893259032591325923259332594325953259632597325983259932600326013260232603326043260532606326073260832609326103261132612326133261432615326163261732618326193262032621326223262332624326253262632627326283262932630326313263232633326343263532636326373263832639326403264132642326433264432645326463264732648326493265032651326523265332654326553265632657326583265932660326613266232663326643266532666326673266832669326703267132672326733267432675326763267732678326793268032681326823268332684326853268632687326883268932690326913269232693326943269532696326973269832699327003270132702327033270432705327063270732708327093271032711327123271332714327153271632717327183271932720327213272232723327243272532726327273272832729327303273132732327333273432735327363273732738327393274032741327423274332744327453274632747327483274932750327513275232753327543275532756327573275832759327603276132762327633276432765327663276732768327693277032771327723277332774327753277632777327783277932780327813278232783327843278532786327873278832789327903279132792327933279432795327963279732798327993280032801328023280332804328053280632807328083280932810328113281232813328143281532816328173281832819328203282132822328233282432825328263282732828328293283032831328323283332834328353283632837328383283932840328413284232843328443284532846328473284832849328503285132852328533285432855328563285732858328593286032861328623286332864328653286632867328683286932870328713287232873328743287532876328773287832879328803288132882328833288432885328863288732888328893289032891328923289332894328953289632897328983289932900329013290232903329043290532906329073290832909329103291132912329133291432915329163291732918329193292032921329223292332924329253292632927329283292932930329313293232933329343293532936329373293832939329403294132942329433294432945329463294732948329493295032951329523295332954329553295632957329583295932960329613296232963329643296532966329673296832969329703297132972329733297432975329763297732978329793298032981329823298332984329853298632987329883298932990329913299232993329943299532996329973299832999330003300133002330033300433005330063300733008330093301033011330123301333014330153301633017330183301933020330213302233023330243302533026330273302833029330303303133032330333303433035330363303733038330393304033041330423304333044330453304633047330483304933050330513305233053330543305533056330573305833059330603306133062330633306433065330663306733068330693307033071330723307333074330753307633077330783307933080330813308233083330843308533086330873308833089330903309133092330933309433095330963309733098330993310033101331023310333104331053310633107331083310933110331113311233113331143311533116331173311833119331203312133122331233312433125331263312733128331293313033131331323313333134331353313633137331383313933140331413314233143331443314533146331473314833149331503315133152331533315433155331563315733158331593316033161331623316333164331653316633167331683316933170331713317233173331743317533176331773317833179331803318133182331833318433185331863318733188331893319033191331923319333194331953319633197331983319933200332013320233203332043320533206332073320833209332103321133212332133321433215332163321733218332193322033221332223322333224332253322633227332283322933230332313323233233332343323533236332373323833239332403324133242332433324433245332463324733248332493325033251332523325333254332553325633257332583325933260332613326233263332643326533266332673326833269332703327133272332733327433275332763327733278332793328033281332823328333284332853328633287332883328933290332913329233293332943329533296332973329833299333003330133302333033330433305333063330733308333093331033311333123331333314333153331633317333183331933320333213332233323333243332533326333273332833329333303333133332333333333433335333363333733338333393334033341333423334333344333453334633347333483334933350333513335233353333543335533356333573335833359333603336133362333633336433365333663336733368333693337033371333723337333374333753337633377333783337933380333813338233383333843338533386333873338833389333903339133392333933339433395333963339733398333993340033401334023340333404334053340633407334083340933410334113341233413334143341533416334173341833419334203342133422334233342433425334263342733428334293343033431334323343333434334353343633437334383343933440334413344233443334443344533446334473344833449334503345133452334533345433455334563345733458334593346033461334623346333464334653346633467334683346933470334713347233473334743347533476334773347833479334803348133482334833348433485334863348733488334893349033491334923349333494334953349633497334983349933500335013350233503335043350533506335073350833509335103351133512335133351433515335163351733518335193352033521335223352333524335253352633527335283352933530335313353233533335343353533536335373353833539335403354133542335433354433545335463354733548335493355033551335523355333554335553355633557335583355933560335613356233563335643356533566335673356833569335703357133572335733357433575335763357733578335793358033581335823358333584335853358633587335883358933590335913359233593335943359533596335973359833599336003360133602336033360433605336063360733608336093361033611336123361333614336153361633617336183361933620336213362233623336243362533626336273362833629336303363133632336333363433635336363363733638336393364033641336423364333644336453364633647336483364933650336513365233653336543365533656336573365833659336603366133662336633366433665336663366733668336693367033671336723367333674336753367633677336783367933680336813368233683336843368533686336873368833689336903369133692336933369433695336963369733698336993370033701337023370333704337053370633707337083370933710337113371233713337143371533716337173371833719337203372133722337233372433725337263372733728337293373033731337323373333734337353373633737337383373933740337413374233743337443374533746337473374833749337503375133752337533375433755337563375733758337593376033761337623376333764337653376633767337683376933770337713377233773337743377533776337773377833779337803378133782337833378433785337863378733788337893379033791337923379333794337953379633797337983379933800338013380233803338043380533806338073380833809338103381133812338133381433815338163381733818338193382033821338223382333824338253382633827338283382933830338313383233833338343383533836338373383833839338403384133842338433384433845338463384733848338493385033851338523385333854338553385633857338583385933860338613386233863338643386533866338673386833869338703387133872338733387433875338763387733878338793388033881338823388333884338853388633887338883388933890338913389233893338943389533896338973389833899339003390133902339033390433905339063390733908339093391033911339123391333914339153391633917339183391933920339213392233923339243392533926339273392833929339303393133932339333393433935339363393733938339393394033941339423394333944339453394633947339483394933950339513395233953339543395533956339573395833959339603396133962339633396433965339663396733968339693397033971339723397333974339753397633977339783397933980339813398233983339843398533986339873398833989339903399133992339933399433995339963399733998339993400034001340023400334004340053400634007340083400934010340113401234013340143401534016340173401834019340203402134022340233402434025340263402734028340293403034031340323403334034340353403634037340383403934040340413404234043340443404534046340473404834049340503405134052340533405434055340563405734058340593406034061340623406334064340653406634067340683406934070340713407234073340743407534076340773407834079340803408134082340833408434085340863408734088340893409034091340923409334094340953409634097340983409934100341013410234103341043410534106341073410834109341103411134112341133411434115341163411734118341193412034121341223412334124341253412634127341283412934130341313413234133341343413534136341373413834139341403414134142341433414434145341463414734148341493415034151341523415334154341553415634157341583415934160341613416234163341643416534166341673416834169341703417134172341733417434175341763417734178341793418034181341823418334184341853418634187341883418934190341913419234193341943419534196341973419834199342003420134202342033420434205342063420734208342093421034211342123421334214342153421634217342183421934220342213422234223342243422534226342273422834229342303423134232342333423434235342363423734238342393424034241342423424334244342453424634247342483424934250342513425234253342543425534256342573425834259342603426134262342633426434265342663426734268342693427034271342723427334274342753427634277342783427934280342813428234283342843428534286342873428834289342903429134292342933429434295342963429734298342993430034301343023430334304343053430634307343083430934310343113431234313343143431534316343173431834319343203432134322343233432434325343263432734328343293433034331343323433334334343353433634337343383433934340343413434234343343443434534346343473434834349343503435134352343533435434355343563435734358343593436034361343623436334364343653436634367343683436934370343713437234373343743437534376343773437834379343803438134382343833438434385343863438734388343893439034391343923439334394343953439634397343983439934400344013440234403344043440534406344073440834409344103441134412344133441434415344163441734418344193442034421344223442334424344253442634427344283442934430344313443234433344343443534436344373443834439344403444134442344433444434445344463444734448344493445034451344523445334454344553445634457344583445934460344613446234463344643446534466344673446834469344703447134472344733447434475344763447734478344793448034481344823448334484344853448634487344883448934490344913449234493344943449534496344973449834499345003450134502345033450434505345063450734508345093451034511345123451334514345153451634517345183451934520345213452234523345243452534526345273452834529345303453134532345333453434535345363453734538345393454034541345423454334544345453454634547345483454934550345513455234553345543455534556345573455834559345603456134562345633456434565345663456734568345693457034571345723457334574345753457634577345783457934580345813458234583345843458534586345873458834589345903459134592345933459434595345963459734598345993460034601346023460334604346053460634607346083460934610346113461234613346143461534616346173461834619346203462134622346233462434625346263462734628346293463034631346323463334634346353463634637346383463934640346413464234643346443464534646346473464834649346503465134652346533465434655346563465734658346593466034661346623466334664346653466634667346683466934670346713467234673346743467534676346773467834679346803468134682346833468434685346863468734688346893469034691346923469334694346953469634697346983469934700347013470234703347043470534706347073470834709347103471134712347133471434715347163471734718347193472034721347223472334724347253472634727347283472934730347313473234733347343473534736347373473834739347403474134742347433474434745347463474734748347493475034751347523475334754347553475634757347583475934760347613476234763347643476534766347673476834769347703477134772347733477434775347763477734778347793478034781347823478334784347853478634787347883478934790347913479234793347943479534796347973479834799348003480134802348033480434805348063480734808348093481034811348123481334814348153481634817348183481934820348213482234823348243482534826348273482834829348303483134832348333483434835348363483734838348393484034841348423484334844348453484634847348483484934850348513485234853348543485534856348573485834859348603486134862348633486434865348663486734868348693487034871348723487334874348753487634877348783487934880348813488234883348843488534886348873488834889348903489134892348933489434895348963489734898348993490034901349023490334904349053490634907349083490934910349113491234913349143491534916349173491834919349203492134922349233492434925349263492734928349293493034931349323493334934349353493634937349383493934940349413494234943349443494534946349473494834949349503495134952349533495434955349563495734958349593496034961349623496334964349653496634967349683496934970349713497234973349743497534976349773497834979349803498134982349833498434985349863498734988349893499034991349923499334994349953499634997349983499935000350013500235003350043500535006350073500835009350103501135012350133501435015350163501735018350193502035021350223502335024350253502635027350283502935030350313503235033350343503535036350373503835039350403504135042350433504435045350463504735048350493505035051350523505335054350553505635057350583505935060350613506235063350643506535066350673506835069350703507135072350733507435075350763507735078350793508035081350823508335084350853508635087350883508935090350913509235093350943509535096350973509835099351003510135102351033510435105351063510735108351093511035111351123511335114351153511635117351183511935120351213512235123351243512535126351273512835129351303513135132351333513435135351363513735138351393514035141351423514335144351453514635147351483514935150351513515235153351543515535156351573515835159351603516135162351633516435165351663516735168351693517035171351723517335174351753517635177351783517935180351813518235183351843518535186351873518835189351903519135192351933519435195351963519735198351993520035201352023520335204352053520635207352083520935210352113521235213352143521535216352173521835219352203522135222352233522435225352263522735228352293523035231352323523335234352353523635237352383523935240352413524235243352443524535246352473524835249352503525135252352533525435255352563525735258352593526035261352623526335264352653526635267352683526935270352713527235273352743527535276352773527835279352803528135282352833528435285352863528735288352893529035291352923529335294352953529635297352983529935300353013530235303353043530535306353073530835309353103531135312353133531435315353163531735318353193532035321353223532335324353253532635327353283532935330353313533235333353343533535336353373533835339353403534135342353433534435345353463534735348353493535035351353523535335354353553535635357353583535935360353613536235363353643536535366353673536835369353703537135372353733537435375353763537735378353793538035381353823538335384353853538635387353883538935390353913539235393353943539535396353973539835399354003540135402354033540435405354063540735408354093541035411354123541335414354153541635417354183541935420354213542235423354243542535426354273542835429354303543135432354333543435435354363543735438354393544035441354423544335444354453544635447354483544935450354513545235453354543545535456354573545835459354603546135462354633546435465354663546735468354693547035471354723547335474354753547635477354783547935480354813548235483354843548535486354873548835489354903549135492354933549435495354963549735498354993550035501355023550335504355053550635507355083550935510355113551235513355143551535516355173551835519355203552135522355233552435525355263552735528355293553035531355323553335534355353553635537355383553935540355413554235543355443554535546355473554835549355503555135552355533555435555355563555735558355593556035561355623556335564355653556635567355683556935570355713557235573355743557535576355773557835579355803558135582355833558435585355863558735588355893559035591355923559335594355953559635597355983559935600356013560235603356043560535606356073560835609356103561135612356133561435615356163561735618356193562035621356223562335624356253562635627356283562935630356313563235633356343563535636356373563835639356403564135642356433564435645356463564735648356493565035651356523565335654356553565635657356583565935660356613566235663356643566535666356673566835669356703567135672356733567435675356763567735678356793568035681356823568335684356853568635687356883568935690356913569235693356943569535696356973569835699357003570135702357033570435705357063570735708357093571035711357123571335714357153571635717357183571935720357213572235723357243572535726357273572835729357303573135732357333573435735357363573735738357393574035741357423574335744357453574635747357483574935750357513575235753357543575535756357573575835759357603576135762357633576435765357663576735768357693577035771357723577335774357753577635777357783577935780357813578235783357843578535786357873578835789357903579135792357933579435795357963579735798357993580035801358023580335804358053580635807358083580935810358113581235813358143581535816358173581835819358203582135822358233582435825358263582735828358293583035831358323583335834358353583635837358383583935840358413584235843358443584535846358473584835849358503585135852358533585435855358563585735858358593586035861358623586335864358653586635867358683586935870358713587235873358743587535876358773587835879358803588135882358833588435885358863588735888358893589035891358923589335894358953589635897358983589935900359013590235903359043590535906359073590835909359103591135912359133591435915359163591735918359193592035921359223592335924359253592635927359283592935930359313593235933359343593535936359373593835939359403594135942359433594435945359463594735948359493595035951359523595335954359553595635957359583595935960359613596235963359643596535966359673596835969359703597135972359733597435975359763597735978359793598035981359823598335984359853598635987359883598935990359913599235993359943599535996359973599835999360003600136002360033600436005360063600736008360093601036011360123601336014360153601636017360183601936020360213602236023360243602536026360273602836029360303603136032360333603436035360363603736038360393604036041360423604336044360453604636047360483604936050360513605236053360543605536056360573605836059360603606136062360633606436065360663606736068360693607036071360723607336074360753607636077360783607936080360813608236083360843608536086360873608836089360903609136092360933609436095360963609736098360993610036101361023610336104361053610636107361083610936110361113611236113361143611536116361173611836119361203612136122361233612436125361263612736128361293613036131361323613336134361353613636137361383613936140361413614236143361443614536146361473614836149361503615136152361533615436155361563615736158361593616036161361623616336164361653616636167361683616936170361713617236173361743617536176361773617836179361803618136182361833618436185361863618736188361893619036191361923619336194361953619636197361983619936200362013620236203362043620536206362073620836209362103621136212362133621436215362163621736218362193622036221362223622336224362253622636227362283622936230362313623236233362343623536236362373623836239362403624136242362433624436245362463624736248362493625036251362523625336254362553625636257362583625936260362613626236263362643626536266362673626836269362703627136272362733627436275362763627736278362793628036281362823628336284362853628636287362883628936290362913629236293362943629536296362973629836299363003630136302363033630436305363063630736308363093631036311363123631336314363153631636317363183631936320363213632236323363243632536326363273632836329363303633136332363333633436335363363633736338363393634036341363423634336344363453634636347363483634936350363513635236353363543635536356363573635836359363603636136362363633636436365363663636736368363693637036371363723637336374363753637636377363783637936380363813638236383363843638536386363873638836389363903639136392363933639436395363963639736398363993640036401364023640336404364053640636407364083640936410364113641236413364143641536416364173641836419364203642136422364233642436425364263642736428364293643036431364323643336434364353643636437364383643936440364413644236443364443644536446364473644836449364503645136452364533645436455364563645736458364593646036461364623646336464364653646636467364683646936470364713647236473364743647536476364773647836479364803648136482364833648436485364863648736488364893649036491364923649336494364953649636497364983649936500365013650236503365043650536506365073650836509365103651136512365133651436515365163651736518365193652036521365223652336524365253652636527365283652936530365313653236533365343653536536365373653836539365403654136542365433654436545365463654736548365493655036551365523655336554365553655636557365583655936560365613656236563365643656536566365673656836569365703657136572365733657436575365763657736578365793658036581365823658336584365853658636587365883658936590365913659236593365943659536596365973659836599366003660136602366033660436605366063660736608366093661036611366123661336614366153661636617366183661936620366213662236623366243662536626366273662836629366303663136632366333663436635366363663736638366393664036641366423664336644366453664636647366483664936650366513665236653366543665536656366573665836659366603666136662366633666436665366663666736668366693667036671366723667336674366753667636677366783667936680366813668236683366843668536686366873668836689366903669136692366933669436695366963669736698366993670036701367023670336704367053670636707367083670936710367113671236713367143671536716367173671836719367203672136722367233672436725367263672736728367293673036731367323673336734367353673636737367383673936740367413674236743367443674536746367473674836749367503675136752367533675436755367563675736758367593676036761367623676336764367653676636767367683676936770367713677236773367743677536776367773677836779367803678136782367833678436785367863678736788367893679036791367923679336794367953679636797367983679936800368013680236803368043680536806368073680836809368103681136812368133681436815368163681736818368193682036821368223682336824368253682636827368283682936830368313683236833368343683536836368373683836839368403684136842368433684436845368463684736848368493685036851368523685336854368553685636857368583685936860368613686236863368643686536866368673686836869368703687136872368733687436875368763687736878368793688036881368823688336884368853688636887368883688936890368913689236893368943689536896368973689836899369003690136902369033690436905369063690736908369093691036911369123691336914369153691636917369183691936920369213692236923369243692536926369273692836929369303693136932369333693436935369363693736938369393694036941369423694336944369453694636947369483694936950369513695236953369543695536956369573695836959369603696136962369633696436965369663696736968369693697036971369723697336974369753697636977369783697936980369813698236983369843698536986369873698836989369903699136992369933699436995369963699736998369993700037001370023700337004370053700637007370083700937010370113701237013370143701537016370173701837019370203702137022370233702437025370263702737028370293703037031370323703337034370353703637037370383703937040370413704237043370443704537046370473704837049370503705137052370533705437055370563705737058370593706037061370623706337064370653706637067370683706937070370713707237073370743707537076370773707837079370803708137082370833708437085370863708737088370893709037091370923709337094370953709637097370983709937100371013710237103371043710537106371073710837109371103711137112371133711437115371163711737118371193712037121371223712337124371253712637127371283712937130371313713237133371343713537136371373713837139371403714137142371433714437145371463714737148371493715037151371523715337154371553715637157371583715937160371613716237163371643716537166371673716837169371703717137172371733717437175371763717737178371793718037181371823718337184371853718637187371883718937190371913719237193371943719537196371973719837199372003720137202372033720437205372063720737208372093721037211372123721337214372153721637217372183721937220372213722237223372243722537226372273722837229372303723137232372333723437235372363723737238372393724037241372423724337244372453724637247372483724937250372513725237253372543725537256372573725837259372603726137262372633726437265372663726737268372693727037271372723727337274372753727637277372783727937280372813728237283372843728537286372873728837289372903729137292372933729437295372963729737298372993730037301373023730337304373053730637307373083730937310373113731237313373143731537316373173731837319373203732137322373233732437325373263732737328373293733037331373323733337334373353733637337373383733937340373413734237343373443734537346373473734837349373503735137352373533735437355373563735737358373593736037361373623736337364373653736637367373683736937370373713737237373373743737537376373773737837379373803738137382373833738437385373863738737388373893739037391373923739337394373953739637397373983739937400374013740237403374043740537406374073740837409374103741137412374133741437415374163741737418374193742037421374223742337424374253742637427374283742937430374313743237433374343743537436374373743837439374403744137442374433744437445374463744737448374493745037451374523745337454374553745637457374583745937460374613746237463374643746537466374673746837469374703747137472374733747437475374763747737478374793748037481374823748337484374853748637487374883748937490374913749237493374943749537496374973749837499375003750137502375033750437505375063750737508375093751037511375123751337514375153751637517375183751937520375213752237523375243752537526375273752837529375303753137532375333753437535375363753737538375393754037541375423754337544375453754637547375483754937550375513755237553375543755537556375573755837559375603756137562375633756437565375663756737568375693757037571375723757337574375753757637577375783757937580375813758237583375843758537586375873758837589375903759137592375933759437595375963759737598375993760037601376023760337604376053760637607376083760937610376113761237613376143761537616376173761837619376203762137622376233762437625376263762737628376293763037631376323763337634376353763637637376383763937640376413764237643376443764537646376473764837649376503765137652376533765437655376563765737658376593766037661376623766337664376653766637667376683766937670376713767237673376743767537676376773767837679376803768137682376833768437685376863768737688376893769037691376923769337694376953769637697376983769937700377013770237703377043770537706377073770837709377103771137712377133771437715377163771737718377193772037721377223772337724377253772637727377283772937730377313773237733377343773537736377373773837739377403774137742377433774437745377463774737748377493775037751377523775337754377553775637757377583775937760377613776237763377643776537766377673776837769377703777137772377733777437775377763777737778377793778037781377823778337784377853778637787377883778937790377913779237793377943779537796377973779837799378003780137802378033780437805378063780737808378093781037811378123781337814378153781637817378183781937820378213782237823378243782537826378273782837829378303783137832378333783437835378363783737838378393784037841378423784337844378453784637847378483784937850378513785237853378543785537856378573785837859378603786137862378633786437865378663786737868378693787037871378723787337874378753787637877378783787937880378813788237883378843788537886378873788837889378903789137892378933789437895378963789737898378993790037901379023790337904379053790637907379083790937910379113791237913379143791537916379173791837919379203792137922379233792437925379263792737928379293793037931379323793337934379353793637937379383793937940379413794237943379443794537946379473794837949379503795137952379533795437955379563795737958379593796037961379623796337964379653796637967379683796937970379713797237973379743797537976379773797837979379803798137982379833798437985379863798737988379893799037991379923799337994379953799637997379983799938000380013800238003380043800538006380073800838009380103801138012380133801438015380163801738018380193802038021380223802338024380253802638027380283802938030380313803238033380343803538036380373803838039380403804138042380433804438045380463804738048380493805038051380523805338054380553805638057380583805938060380613806238063380643806538066380673806838069380703807138072380733807438075380763807738078380793808038081380823808338084380853808638087380883808938090380913809238093380943809538096380973809838099381003810138102381033810438105381063810738108381093811038111381123811338114381153811638117381183811938120381213812238123381243812538126381273812838129381303813138132381333813438135381363813738138381393814038141381423814338144381453814638147381483814938150381513815238153381543815538156381573815838159381603816138162381633816438165381663816738168381693817038171381723817338174381753817638177381783817938180381813818238183381843818538186381873818838189381903819138192381933819438195381963819738198381993820038201382023820338204382053820638207382083820938210382113821238213382143821538216382173821838219382203822138222382233822438225382263822738228382293823038231382323823338234382353823638237382383823938240382413824238243382443824538246382473824838249382503825138252382533825438255382563825738258382593826038261382623826338264382653826638267382683826938270382713827238273382743827538276382773827838279382803828138282382833828438285382863828738288382893829038291382923829338294382953829638297382983829938300383013830238303383043830538306383073830838309383103831138312383133831438315383163831738318383193832038321383223832338324383253832638327383283832938330383313833238333383343833538336383373833838339383403834138342383433834438345383463834738348383493835038351383523835338354383553835638357383583835938360383613836238363383643836538366383673836838369383703837138372383733837438375383763837738378383793838038381383823838338384383853838638387383883838938390383913839238393383943839538396383973839838399384003840138402384033840438405384063840738408384093841038411384123841338414384153841638417384183841938420384213842238423384243842538426384273842838429384303843138432384333843438435384363843738438384393844038441384423844338444384453844638447384483844938450384513845238453384543845538456384573845838459384603846138462384633846438465384663846738468384693847038471384723847338474384753847638477384783847938480384813848238483384843848538486384873848838489384903849138492384933849438495384963849738498384993850038501385023850338504385053850638507385083850938510385113851238513385143851538516385173851838519385203852138522385233852438525385263852738528385293853038531385323853338534385353853638537385383853938540385413854238543385443854538546385473854838549385503855138552385533855438555385563855738558385593856038561385623856338564385653856638567385683856938570385713857238573385743857538576385773857838579385803858138582385833858438585385863858738588385893859038591385923859338594385953859638597385983859938600386013860238603386043860538606386073860838609386103861138612386133861438615386163861738618386193862038621386223862338624386253862638627386283862938630386313863238633386343863538636386373863838639386403864138642386433864438645386463864738648386493865038651386523865338654386553865638657386583865938660386613866238663386643866538666386673866838669386703867138672386733867438675
  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 regexpHelper = __importStar(__nccwpck_require__(3120));
  644. const retryHelper = __importStar(__nccwpck_require__(2155));
  645. const git_version_1 = __nccwpck_require__(3142);
  646. // Auth header not supported before 2.9
  647. // Wire protocol v2 not supported before 2.18
  648. // sparse-checkout not [well-]supported before 2.28 (see https://github.com/actions/checkout/issues/1386)
  649. exports.MinimumGitVersion = new git_version_1.GitVersion('2.18');
  650. exports.MinimumGitSparseCheckoutVersion = new git_version_1.GitVersion('2.28');
  651. function createCommandManager(workingDirectory, lfs, doSparseCheckout) {
  652. return __awaiter(this, void 0, void 0, function* () {
  653. return yield GitCommandManager.createCommandManager(workingDirectory, lfs, doSparseCheckout);
  654. });
  655. }
  656. class GitCommandManager {
  657. // Private constructor; use createCommandManager()
  658. constructor() {
  659. this.gitEnv = {
  660. GIT_TERMINAL_PROMPT: '0', // Disable git prompt
  661. GCM_INTERACTIVE: 'Never' // Disable prompting for git credential manager
  662. };
  663. this.gitPath = '';
  664. this.lfs = false;
  665. this.doSparseCheckout = false;
  666. this.workingDirectory = '';
  667. this.gitVersion = new git_version_1.GitVersion();
  668. }
  669. branchDelete(remote, branch) {
  670. return __awaiter(this, void 0, void 0, function* () {
  671. const args = ['branch', '--delete', '--force'];
  672. if (remote) {
  673. args.push('--remote');
  674. }
  675. args.push(branch);
  676. yield this.execGit(args);
  677. });
  678. }
  679. branchExists(remote, pattern) {
  680. return __awaiter(this, void 0, void 0, function* () {
  681. const args = ['branch', '--list'];
  682. if (remote) {
  683. args.push('--remote');
  684. }
  685. args.push(pattern);
  686. const output = yield this.execGit(args);
  687. return !!output.stdout.trim();
  688. });
  689. }
  690. branchList(remote) {
  691. return __awaiter(this, void 0, void 0, function* () {
  692. const result = [];
  693. // Note, this implementation uses "rev-parse --symbolic-full-name" because the output from
  694. // "branch --list" is more difficult when in a detached HEAD state.
  695. // TODO(https://github.com/actions/checkout/issues/786): this implementation uses
  696. // "rev-parse --symbolic-full-name" because there is a bug
  697. // in Git 2.18 that causes "rev-parse --symbolic" to output symbolic full names. When
  698. // 2.18 is no longer supported, we can switch back to --symbolic.
  699. const args = ['rev-parse', '--symbolic-full-name'];
  700. if (remote) {
  701. args.push('--remotes=origin');
  702. }
  703. else {
  704. args.push('--branches');
  705. }
  706. const stderr = [];
  707. const errline = [];
  708. const stdout = [];
  709. const stdline = [];
  710. const listeners = {
  711. stderr: (data) => {
  712. stderr.push(data.toString());
  713. },
  714. errline: (data) => {
  715. errline.push(data.toString());
  716. },
  717. stdout: (data) => {
  718. stdout.push(data.toString());
  719. },
  720. stdline: (data) => {
  721. stdline.push(data.toString());
  722. }
  723. };
  724. // Suppress the output in order to avoid flooding annotations with innocuous errors.
  725. yield this.execGit(args, false, true, listeners);
  726. core.debug(`stderr callback is: ${stderr}`);
  727. core.debug(`errline callback is: ${errline}`);
  728. core.debug(`stdout callback is: ${stdout}`);
  729. core.debug(`stdline callback is: ${stdline}`);
  730. for (let branch of stdline) {
  731. branch = branch.trim();
  732. if (!branch) {
  733. continue;
  734. }
  735. if (branch.startsWith('refs/heads/')) {
  736. branch = branch.substring('refs/heads/'.length);
  737. }
  738. else if (branch.startsWith('refs/remotes/')) {
  739. branch = branch.substring('refs/remotes/'.length);
  740. }
  741. result.push(branch);
  742. }
  743. return result;
  744. });
  745. }
  746. disableSparseCheckout() {
  747. return __awaiter(this, void 0, void 0, function* () {
  748. yield this.execGit(['sparse-checkout', 'disable']);
  749. // Disabling 'sparse-checkout` leaves behind an undesirable side-effect in config (even in a pristine environment).
  750. yield this.tryConfigUnset('extensions.worktreeConfig', false);
  751. });
  752. }
  753. sparseCheckout(sparseCheckout) {
  754. return __awaiter(this, void 0, void 0, function* () {
  755. yield this.execGit(['sparse-checkout', 'set', ...sparseCheckout]);
  756. });
  757. }
  758. sparseCheckoutNonConeMode(sparseCheckout) {
  759. return __awaiter(this, void 0, void 0, function* () {
  760. yield this.execGit(['config', 'core.sparseCheckout', 'true']);
  761. const output = yield this.execGit([
  762. 'rev-parse',
  763. '--git-path',
  764. 'info/sparse-checkout'
  765. ]);
  766. const sparseCheckoutPath = path.join(this.workingDirectory, output.stdout.trimRight());
  767. yield fs.promises.appendFile(sparseCheckoutPath, `\n${sparseCheckout.join('\n')}\n`);
  768. });
  769. }
  770. checkout(ref, startPoint) {
  771. return __awaiter(this, void 0, void 0, function* () {
  772. const args = ['checkout', '--progress', '--force'];
  773. if (startPoint) {
  774. args.push('-B', ref, startPoint);
  775. }
  776. else {
  777. args.push(ref);
  778. }
  779. yield this.execGit(args);
  780. });
  781. }
  782. checkoutDetach() {
  783. return __awaiter(this, void 0, void 0, function* () {
  784. const args = ['checkout', '--detach'];
  785. yield this.execGit(args);
  786. });
  787. }
  788. config(configKey, configValue, globalConfig, add, configFile) {
  789. return __awaiter(this, void 0, void 0, function* () {
  790. const args = ['config'];
  791. if (configFile) {
  792. args.push('--file', configFile);
  793. }
  794. else {
  795. args.push(globalConfig ? '--global' : '--local');
  796. }
  797. if (add) {
  798. args.push('--add');
  799. }
  800. args.push(...[configKey, configValue]);
  801. yield this.execGit(args);
  802. });
  803. }
  804. configExists(configKey, globalConfig) {
  805. return __awaiter(this, void 0, void 0, function* () {
  806. const pattern = regexpHelper.escape(configKey);
  807. const output = yield this.execGit([
  808. 'config',
  809. globalConfig ? '--global' : '--local',
  810. '--name-only',
  811. '--get-regexp',
  812. pattern
  813. ], true);
  814. return output.exitCode === 0;
  815. });
  816. }
  817. fetch(refSpec, options) {
  818. return __awaiter(this, void 0, void 0, function* () {
  819. const args = ['-c', 'protocol.version=2', 'fetch'];
  820. // Always use --no-tags for explicit control over tag fetching
  821. // Tags are fetched explicitly via refspec when needed
  822. args.push('--no-tags');
  823. args.push('--prune', '--no-recurse-submodules');
  824. if (options.showProgress) {
  825. args.push('--progress');
  826. }
  827. if (options.filter) {
  828. args.push(`--filter=${options.filter}`);
  829. }
  830. if (options.fetchDepth && options.fetchDepth > 0) {
  831. args.push(`--depth=${options.fetchDepth}`);
  832. }
  833. else if (fshelper.fileExistsSync(path.join(this.workingDirectory, '.git', 'shallow'))) {
  834. args.push('--unshallow');
  835. }
  836. args.push('origin');
  837. for (const arg of refSpec) {
  838. args.push(arg);
  839. }
  840. const that = this;
  841. yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  842. yield that.execGit(args);
  843. }));
  844. });
  845. }
  846. getDefaultBranch(repositoryUrl) {
  847. return __awaiter(this, void 0, void 0, function* () {
  848. let output;
  849. yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  850. output = yield this.execGit([
  851. 'ls-remote',
  852. '--quiet',
  853. '--exit-code',
  854. '--symref',
  855. repositoryUrl,
  856. 'HEAD'
  857. ]);
  858. }));
  859. if (output) {
  860. // Satisfy compiler, will always be set
  861. for (let line of output.stdout.trim().split('\n')) {
  862. line = line.trim();
  863. if (line.startsWith('ref:') || line.endsWith('HEAD')) {
  864. return line
  865. .substr('ref:'.length, line.length - 'ref:'.length - 'HEAD'.length)
  866. .trim();
  867. }
  868. }
  869. }
  870. throw new Error('Unexpected output when retrieving default branch');
  871. });
  872. }
  873. getSubmoduleConfigPaths(recursive) {
  874. return __awaiter(this, void 0, void 0, function* () {
  875. // Get submodule config file paths.
  876. // Use `--show-origin` to get the config file path for each submodule.
  877. const output = yield this.submoduleForeach(`git config --local --show-origin --name-only --get-regexp remote.origin.url`, recursive);
  878. // Extract config file paths from the output (lines starting with "file:").
  879. const configPaths = output.match(/(?<=(^|\n)file:)[^\t]+(?=\tremote\.origin\.url)/g) || [];
  880. return configPaths;
  881. });
  882. }
  883. getWorkingDirectory() {
  884. return this.workingDirectory;
  885. }
  886. init(objectFormat) {
  887. return __awaiter(this, void 0, void 0, function* () {
  888. const args = ['init'];
  889. if (objectFormat === 'sha256') {
  890. args.push('--object-format=sha256');
  891. }
  892. args.push(this.workingDirectory);
  893. yield this.execGit(args);
  894. });
  895. }
  896. isDetached() {
  897. return __awaiter(this, void 0, void 0, function* () {
  898. // Note, "branch --show-current" would be simpler but isn't available until Git 2.22
  899. const output = yield this.execGit(['rev-parse', '--symbolic-full-name', '--verify', '--quiet', 'HEAD'], true);
  900. return !output.stdout.trim().startsWith('refs/heads/');
  901. });
  902. }
  903. lfsFetch(ref) {
  904. return __awaiter(this, void 0, void 0, function* () {
  905. const args = ['lfs', 'fetch', 'origin', ref];
  906. const that = this;
  907. yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  908. yield that.execGit(args);
  909. }));
  910. });
  911. }
  912. lfsInstall() {
  913. return __awaiter(this, void 0, void 0, function* () {
  914. yield this.execGit(['lfs', 'install', '--local']);
  915. });
  916. }
  917. log1(format) {
  918. return __awaiter(this, void 0, void 0, function* () {
  919. const args = format ? ['log', '-1', format] : ['log', '-1'];
  920. const silent = format ? false : true;
  921. const output = yield this.execGit(args, false, silent);
  922. return output.stdout;
  923. });
  924. }
  925. remoteAdd(remoteName, remoteUrl) {
  926. return __awaiter(this, void 0, void 0, function* () {
  927. yield this.execGit(['remote', 'add', remoteName, remoteUrl]);
  928. });
  929. }
  930. removeEnvironmentVariable(name) {
  931. delete this.gitEnv[name];
  932. }
  933. /**
  934. * Resolves a ref to a SHA. For a branch or lightweight tag, the commit SHA is returned.
  935. * For an annotated tag, the tag SHA is returned.
  936. * @param {string} ref For example: 'refs/heads/main' or '/refs/tags/v1'
  937. * @returns {Promise<string>}
  938. */
  939. revParse(ref) {
  940. return __awaiter(this, void 0, void 0, function* () {
  941. const output = yield this.execGit(['rev-parse', ref]);
  942. return output.stdout.trim();
  943. });
  944. }
  945. setEnvironmentVariable(name, value) {
  946. this.gitEnv[name] = value;
  947. }
  948. shaExists(sha) {
  949. return __awaiter(this, void 0, void 0, function* () {
  950. const args = ['rev-parse', '--verify', '--quiet', `${sha}^{object}`];
  951. const output = yield this.execGit(args, true);
  952. return output.exitCode === 0;
  953. });
  954. }
  955. submoduleForeach(command, recursive) {
  956. return __awaiter(this, void 0, void 0, function* () {
  957. const args = ['submodule', 'foreach'];
  958. if (recursive) {
  959. args.push('--recursive');
  960. }
  961. args.push(command);
  962. const output = yield this.execGit(args);
  963. return output.stdout;
  964. });
  965. }
  966. submoduleSync(recursive) {
  967. return __awaiter(this, void 0, void 0, function* () {
  968. const args = ['submodule', 'sync'];
  969. if (recursive) {
  970. args.push('--recursive');
  971. }
  972. yield this.execGit(args);
  973. });
  974. }
  975. submoduleUpdate(fetchDepth, recursive) {
  976. return __awaiter(this, void 0, void 0, function* () {
  977. const args = ['-c', 'protocol.version=2'];
  978. args.push('submodule', 'update', '--init', '--force');
  979. if (fetchDepth > 0) {
  980. args.push(`--depth=${fetchDepth}`);
  981. }
  982. if (recursive) {
  983. args.push('--recursive');
  984. }
  985. yield this.execGit(args);
  986. });
  987. }
  988. submoduleStatus() {
  989. return __awaiter(this, void 0, void 0, function* () {
  990. const output = yield this.execGit(['submodule', 'status'], true);
  991. core.debug(output.stdout);
  992. return output.exitCode === 0;
  993. });
  994. }
  995. tagExists(pattern) {
  996. return __awaiter(this, void 0, void 0, function* () {
  997. const output = yield this.execGit(['tag', '--list', pattern]);
  998. return !!output.stdout.trim();
  999. });
  1000. }
  1001. tryClean() {
  1002. return __awaiter(this, void 0, void 0, function* () {
  1003. const output = yield this.execGit(['clean', '-ffdx'], true);
  1004. return output.exitCode === 0;
  1005. });
  1006. }
  1007. tryConfigUnset(configKey, globalConfig) {
  1008. return __awaiter(this, void 0, void 0, function* () {
  1009. const output = yield this.execGit([
  1010. 'config',
  1011. globalConfig ? '--global' : '--local',
  1012. '--unset-all',
  1013. configKey
  1014. ], true);
  1015. return output.exitCode === 0;
  1016. });
  1017. }
  1018. tryConfigUnsetValue(configKey, configValue, globalConfig, configFile) {
  1019. return __awaiter(this, void 0, void 0, function* () {
  1020. const args = ['config'];
  1021. if (configFile) {
  1022. args.push('--file', configFile);
  1023. }
  1024. else {
  1025. args.push(globalConfig ? '--global' : '--local');
  1026. }
  1027. args.push('--unset', configKey, configValue);
  1028. const output = yield this.execGit(args, true);
  1029. return output.exitCode === 0;
  1030. });
  1031. }
  1032. tryDisableAutomaticGarbageCollection() {
  1033. return __awaiter(this, void 0, void 0, function* () {
  1034. const output = yield this.execGit(['config', '--local', 'gc.auto', '0'], true);
  1035. return output.exitCode === 0;
  1036. });
  1037. }
  1038. tryGetFetchUrl() {
  1039. return __awaiter(this, void 0, void 0, function* () {
  1040. const output = yield this.execGit(['config', '--local', '--get', 'remote.origin.url'], true);
  1041. if (output.exitCode !== 0) {
  1042. return '';
  1043. }
  1044. const stdout = output.stdout.trim();
  1045. if (stdout.includes('\n')) {
  1046. return '';
  1047. }
  1048. return stdout;
  1049. });
  1050. }
  1051. tryGetConfigValues(configKey, globalConfig, configFile) {
  1052. return __awaiter(this, void 0, void 0, function* () {
  1053. const args = ['config'];
  1054. if (configFile) {
  1055. args.push('--file', configFile);
  1056. }
  1057. else {
  1058. args.push(globalConfig ? '--global' : '--local');
  1059. }
  1060. args.push('--get-all', configKey);
  1061. const output = yield this.execGit(args, true);
  1062. if (output.exitCode !== 0) {
  1063. return [];
  1064. }
  1065. return output.stdout
  1066. .trim()
  1067. .split('\n')
  1068. .filter(value => value.trim());
  1069. });
  1070. }
  1071. tryGetConfigKeys(pattern, globalConfig, configFile) {
  1072. return __awaiter(this, void 0, void 0, function* () {
  1073. const args = ['config'];
  1074. if (configFile) {
  1075. args.push('--file', configFile);
  1076. }
  1077. else {
  1078. args.push(globalConfig ? '--global' : '--local');
  1079. }
  1080. args.push('--name-only', '--get-regexp', pattern);
  1081. const output = yield this.execGit(args, true);
  1082. if (output.exitCode !== 0) {
  1083. return [];
  1084. }
  1085. return output.stdout
  1086. .trim()
  1087. .split('\n')
  1088. .filter(key => key.trim());
  1089. });
  1090. }
  1091. tryReset() {
  1092. return __awaiter(this, void 0, void 0, function* () {
  1093. const output = yield this.execGit(['reset', '--hard', 'HEAD'], true);
  1094. return output.exitCode === 0;
  1095. });
  1096. }
  1097. version() {
  1098. return __awaiter(this, void 0, void 0, function* () {
  1099. return this.gitVersion;
  1100. });
  1101. }
  1102. static createCommandManager(workingDirectory, lfs, doSparseCheckout) {
  1103. return __awaiter(this, void 0, void 0, function* () {
  1104. const result = new GitCommandManager();
  1105. yield result.initializeCommandManager(workingDirectory, lfs, doSparseCheckout);
  1106. return result;
  1107. });
  1108. }
  1109. execGit(args_1) {
  1110. return __awaiter(this, arguments, void 0, function* (args, allowAllExitCodes = false, silent = false, customListeners = {}) {
  1111. fshelper.directoryExistsSync(this.workingDirectory, true);
  1112. const result = new GitOutput();
  1113. const env = {};
  1114. for (const key of Object.keys(process.env)) {
  1115. env[key] = process.env[key];
  1116. }
  1117. for (const key of Object.keys(this.gitEnv)) {
  1118. env[key] = this.gitEnv[key];
  1119. }
  1120. const defaultListener = {
  1121. stdout: (data) => {
  1122. stdout.push(data.toString());
  1123. }
  1124. };
  1125. const mergedListeners = Object.assign(Object.assign({}, defaultListener), customListeners);
  1126. const stdout = [];
  1127. const options = {
  1128. cwd: this.workingDirectory,
  1129. env,
  1130. silent,
  1131. ignoreReturnCode: allowAllExitCodes,
  1132. listeners: mergedListeners
  1133. };
  1134. result.exitCode = yield exec.exec(`"${this.gitPath}"`, args, options);
  1135. result.stdout = stdout.join('');
  1136. core.debug(result.exitCode.toString());
  1137. core.debug(result.stdout);
  1138. return result;
  1139. });
  1140. }
  1141. initializeCommandManager(workingDirectory, lfs, doSparseCheckout) {
  1142. return __awaiter(this, void 0, void 0, function* () {
  1143. this.workingDirectory = workingDirectory;
  1144. // Git-lfs will try to pull down assets if any of the local/user/system setting exist.
  1145. // If the user didn't enable `LFS` in their pipeline definition, disable LFS fetch/checkout.
  1146. this.lfs = lfs;
  1147. if (!this.lfs) {
  1148. this.gitEnv['GIT_LFS_SKIP_SMUDGE'] = '1';
  1149. }
  1150. this.gitPath = yield io.which('git', true);
  1151. // Git version
  1152. core.debug('Getting git version');
  1153. this.gitVersion = new git_version_1.GitVersion();
  1154. let gitOutput = yield this.execGit(['version']);
  1155. let stdout = gitOutput.stdout.trim();
  1156. if (!stdout.includes('\n')) {
  1157. const match = stdout.match(/\d+\.\d+(\.\d+)?/);
  1158. if (match) {
  1159. this.gitVersion = new git_version_1.GitVersion(match[0]);
  1160. }
  1161. }
  1162. if (!this.gitVersion.isValid()) {
  1163. throw new Error('Unable to determine git version');
  1164. }
  1165. // Minimum git version
  1166. if (!this.gitVersion.checkMinimum(exports.MinimumGitVersion)) {
  1167. throw new Error(`Minimum required git version is ${exports.MinimumGitVersion}. Your git ('${this.gitPath}') is ${this.gitVersion}`);
  1168. }
  1169. if (this.lfs) {
  1170. // Git-lfs version
  1171. core.debug('Getting git-lfs version');
  1172. let gitLfsVersion = new git_version_1.GitVersion();
  1173. const gitLfsPath = yield io.which('git-lfs', true);
  1174. gitOutput = yield this.execGit(['lfs', 'version']);
  1175. stdout = gitOutput.stdout.trim();
  1176. if (!stdout.includes('\n')) {
  1177. const match = stdout.match(/\d+\.\d+(\.\d+)?/);
  1178. if (match) {
  1179. gitLfsVersion = new git_version_1.GitVersion(match[0]);
  1180. }
  1181. }
  1182. if (!gitLfsVersion.isValid()) {
  1183. throw new Error('Unable to determine git-lfs version');
  1184. }
  1185. // Minimum git-lfs version
  1186. // Note:
  1187. // - Auth header not supported before 2.1
  1188. const minimumGitLfsVersion = new git_version_1.GitVersion('2.1');
  1189. if (!gitLfsVersion.checkMinimum(minimumGitLfsVersion)) {
  1190. throw new Error(`Minimum required git-lfs version is ${minimumGitLfsVersion}. Your git-lfs ('${gitLfsPath}') is ${gitLfsVersion}`);
  1191. }
  1192. }
  1193. this.doSparseCheckout = doSparseCheckout;
  1194. if (this.doSparseCheckout) {
  1195. if (!this.gitVersion.checkMinimum(exports.MinimumGitSparseCheckoutVersion)) {
  1196. throw new Error(`Minimum Git version required for sparse checkout is ${exports.MinimumGitSparseCheckoutVersion}. Your git ('${this.gitPath}') is ${this.gitVersion}`);
  1197. }
  1198. }
  1199. // Set the user agent
  1200. let gitHttpUserAgent = `git/${this.gitVersion} (github-actions-checkout)`;
  1201. // Append orchestration ID if set
  1202. const orchId = process.env['ACTIONS_ORCHESTRATION_ID'];
  1203. if (orchId) {
  1204. // Sanitize the orchestration ID to ensure it contains only valid characters
  1205. // Valid characters: 0-9, a-z, _, -, .
  1206. const sanitizedId = orchId.replace(/[^a-z0-9_.-]/gi, '_');
  1207. if (sanitizedId) {
  1208. gitHttpUserAgent = `${gitHttpUserAgent} actions_orchestration_id/${sanitizedId}`;
  1209. }
  1210. }
  1211. core.debug(`Set git useragent to: ${gitHttpUserAgent}`);
  1212. this.gitEnv['GIT_HTTP_USER_AGENT'] = gitHttpUserAgent;
  1213. });
  1214. }
  1215. }
  1216. class GitOutput {
  1217. constructor() {
  1218. this.stdout = '';
  1219. this.exitCode = 0;
  1220. }
  1221. }
  1222. /***/ }),
  1223. /***/ 8609:
  1224. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  1225. "use strict";
  1226. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  1227. if (k2 === undefined) k2 = k;
  1228. var desc = Object.getOwnPropertyDescriptor(m, k);
  1229. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  1230. desc = { enumerable: true, get: function() { return m[k]; } };
  1231. }
  1232. Object.defineProperty(o, k2, desc);
  1233. }) : (function(o, m, k, k2) {
  1234. if (k2 === undefined) k2 = k;
  1235. o[k2] = m[k];
  1236. }));
  1237. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  1238. Object.defineProperty(o, "default", { enumerable: true, value: v });
  1239. }) : function(o, v) {
  1240. o["default"] = v;
  1241. });
  1242. var __importStar = (this && this.__importStar) || function (mod) {
  1243. if (mod && mod.__esModule) return mod;
  1244. var result = {};
  1245. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  1246. __setModuleDefault(result, mod);
  1247. return result;
  1248. };
  1249. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  1250. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  1251. return new (P || (P = Promise))(function (resolve, reject) {
  1252. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  1253. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  1254. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  1255. step((generator = generator.apply(thisArg, _arguments || [])).next());
  1256. });
  1257. };
  1258. Object.defineProperty(exports, "__esModule", ({ value: true }));
  1259. exports.prepareExistingDirectory = prepareExistingDirectory;
  1260. const assert = __importStar(__nccwpck_require__(9491));
  1261. const core = __importStar(__nccwpck_require__(2186));
  1262. const fs = __importStar(__nccwpck_require__(7147));
  1263. const fsHelper = __importStar(__nccwpck_require__(7219));
  1264. const io = __importStar(__nccwpck_require__(7436));
  1265. const path = __importStar(__nccwpck_require__(1017));
  1266. function prepareExistingDirectory(git, repositoryPath, repositoryUrl, clean, ref) {
  1267. return __awaiter(this, void 0, void 0, function* () {
  1268. var _a;
  1269. assert.ok(repositoryPath, 'Expected repositoryPath to be defined');
  1270. assert.ok(repositoryUrl, 'Expected repositoryUrl to be defined');
  1271. // Indicates whether to delete the directory contents
  1272. let remove = false;
  1273. // Check whether using git or REST API
  1274. if (!git) {
  1275. remove = true;
  1276. }
  1277. // Fetch URL does not match
  1278. else if (!fsHelper.directoryExistsSync(path.join(repositoryPath, '.git')) ||
  1279. repositoryUrl !== (yield git.tryGetFetchUrl())) {
  1280. remove = true;
  1281. }
  1282. else {
  1283. // Delete any index.lock and shallow.lock left by a previously canceled run or crashed git process
  1284. const lockPaths = [
  1285. path.join(repositoryPath, '.git', 'index.lock'),
  1286. path.join(repositoryPath, '.git', 'shallow.lock')
  1287. ];
  1288. for (const lockPath of lockPaths) {
  1289. try {
  1290. yield io.rmRF(lockPath);
  1291. }
  1292. catch (error) {
  1293. core.debug(`Unable to delete '${lockPath}'. ${(_a = error === null || error === void 0 ? void 0 : error.message) !== null && _a !== void 0 ? _a : error}`);
  1294. }
  1295. }
  1296. try {
  1297. core.startGroup('Removing previously created refs, to avoid conflicts');
  1298. // Checkout detached HEAD
  1299. if (!(yield git.isDetached())) {
  1300. yield git.checkoutDetach();
  1301. }
  1302. // Remove all refs/heads/*
  1303. let branches = yield git.branchList(false);
  1304. for (const branch of branches) {
  1305. yield git.branchDelete(false, branch);
  1306. }
  1307. // Remove any conflicting refs/remotes/origin/*
  1308. // Example 1: Consider ref is refs/heads/foo and previously fetched refs/remotes/origin/foo/bar
  1309. // Example 2: Consider ref is refs/heads/foo/bar and previously fetched refs/remotes/origin/foo
  1310. if (ref) {
  1311. ref = ref.startsWith('refs/') ? ref : `refs/heads/${ref}`;
  1312. if (ref.startsWith('refs/heads/')) {
  1313. const upperName1 = ref.toUpperCase().substr('REFS/HEADS/'.length);
  1314. const upperName1Slash = `${upperName1}/`;
  1315. branches = yield git.branchList(true);
  1316. for (const branch of branches) {
  1317. const upperName2 = branch.substr('origin/'.length).toUpperCase();
  1318. const upperName2Slash = `${upperName2}/`;
  1319. if (upperName1.startsWith(upperName2Slash) ||
  1320. upperName2.startsWith(upperName1Slash)) {
  1321. yield git.branchDelete(true, branch);
  1322. }
  1323. }
  1324. }
  1325. }
  1326. core.endGroup();
  1327. // Check for submodules and delete any existing files if submodules are present
  1328. if (!(yield git.submoduleStatus())) {
  1329. remove = true;
  1330. core.info('Bad Submodules found, removing existing files');
  1331. }
  1332. // Clean
  1333. if (clean) {
  1334. core.startGroup('Cleaning the repository');
  1335. if (!(yield git.tryClean())) {
  1336. 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}'.`);
  1337. remove = true;
  1338. }
  1339. else if (!(yield git.tryReset())) {
  1340. remove = true;
  1341. }
  1342. core.endGroup();
  1343. if (remove) {
  1344. core.warning(`Unable to clean or reset the repository. The repository will be recreated instead.`);
  1345. }
  1346. }
  1347. }
  1348. catch (error) {
  1349. core.warning(`Unable to prepare the existing repository. The repository will be recreated instead.`);
  1350. remove = true;
  1351. }
  1352. }
  1353. if (remove) {
  1354. // Delete the contents of the directory. Don't delete the directory itself
  1355. // since it might be the current working directory.
  1356. core.info(`Deleting the contents of '${repositoryPath}'`);
  1357. for (const file of yield fs.promises.readdir(repositoryPath)) {
  1358. yield io.rmRF(path.join(repositoryPath, file));
  1359. }
  1360. }
  1361. });
  1362. }
  1363. /***/ }),
  1364. /***/ 9210:
  1365. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  1366. "use strict";
  1367. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  1368. if (k2 === undefined) k2 = k;
  1369. var desc = Object.getOwnPropertyDescriptor(m, k);
  1370. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  1371. desc = { enumerable: true, get: function() { return m[k]; } };
  1372. }
  1373. Object.defineProperty(o, k2, desc);
  1374. }) : (function(o, m, k, k2) {
  1375. if (k2 === undefined) k2 = k;
  1376. o[k2] = m[k];
  1377. }));
  1378. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  1379. Object.defineProperty(o, "default", { enumerable: true, value: v });
  1380. }) : function(o, v) {
  1381. o["default"] = v;
  1382. });
  1383. var __importStar = (this && this.__importStar) || function (mod) {
  1384. if (mod && mod.__esModule) return mod;
  1385. var result = {};
  1386. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  1387. __setModuleDefault(result, mod);
  1388. return result;
  1389. };
  1390. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  1391. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  1392. return new (P || (P = Promise))(function (resolve, reject) {
  1393. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  1394. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  1395. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  1396. step((generator = generator.apply(thisArg, _arguments || [])).next());
  1397. });
  1398. };
  1399. Object.defineProperty(exports, "__esModule", ({ value: true }));
  1400. exports.getSource = getSource;
  1401. exports.cleanup = cleanup;
  1402. const core = __importStar(__nccwpck_require__(2186));
  1403. const fsHelper = __importStar(__nccwpck_require__(7219));
  1404. const gitAuthHelper = __importStar(__nccwpck_require__(2565));
  1405. const gitCommandManager = __importStar(__nccwpck_require__(738));
  1406. const gitDirectoryHelper = __importStar(__nccwpck_require__(8609));
  1407. const githubApiHelper = __importStar(__nccwpck_require__(138));
  1408. const io = __importStar(__nccwpck_require__(7436));
  1409. const path = __importStar(__nccwpck_require__(1017));
  1410. const refHelper = __importStar(__nccwpck_require__(8601));
  1411. const stateHelper = __importStar(__nccwpck_require__(4866));
  1412. const urlHelper = __importStar(__nccwpck_require__(9437));
  1413. const git_command_manager_1 = __nccwpck_require__(738);
  1414. function getSource(settings) {
  1415. return __awaiter(this, void 0, void 0, function* () {
  1416. // Repository URL
  1417. core.info(`Syncing repository: ${settings.repositoryOwner}/${settings.repositoryName}`);
  1418. const repositoryUrl = urlHelper.getFetchUrl(settings);
  1419. // Remove conflicting file path
  1420. if (fsHelper.fileExistsSync(settings.repositoryPath)) {
  1421. yield io.rmRF(settings.repositoryPath);
  1422. }
  1423. // Create directory
  1424. let isExisting = true;
  1425. if (!fsHelper.directoryExistsSync(settings.repositoryPath)) {
  1426. isExisting = false;
  1427. yield io.mkdirP(settings.repositoryPath);
  1428. }
  1429. // Git command manager
  1430. core.startGroup('Getting Git version info');
  1431. const git = yield getGitCommandManager(settings);
  1432. core.endGroup();
  1433. let authHelper = null;
  1434. try {
  1435. if (git) {
  1436. authHelper = gitAuthHelper.createAuthHelper(git, settings);
  1437. if (settings.setSafeDirectory) {
  1438. // 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
  1439. // Otherwise all git commands we run in a container fail
  1440. yield authHelper.configureTempGlobalConfig();
  1441. core.info(`Adding repository directory to the temporary git global config as a safe directory`);
  1442. yield git
  1443. .config('safe.directory', settings.repositoryPath, true, true)
  1444. .catch(error => {
  1445. core.info(`Failed to initialize safe directory with error: ${error}`);
  1446. });
  1447. stateHelper.setSafeDirectory();
  1448. }
  1449. }
  1450. // Prepare existing directory, otherwise recreate
  1451. if (isExisting) {
  1452. yield gitDirectoryHelper.prepareExistingDirectory(git, settings.repositoryPath, repositoryUrl, settings.clean, settings.ref);
  1453. }
  1454. if (!git) {
  1455. // Downloading using REST API
  1456. core.info(`The repository will be downloaded using the GitHub REST API`);
  1457. core.info(`To create a local Git repository instead, add Git ${gitCommandManager.MinimumGitVersion} or higher to the PATH`);
  1458. if (settings.submodules) {
  1459. 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.`);
  1460. }
  1461. else if (settings.sshKey) {
  1462. 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.`);
  1463. }
  1464. yield githubApiHelper.downloadRepository(settings.authToken, settings.repositoryOwner, settings.repositoryName, settings.ref, settings.commit, settings.repositoryPath, settings.githubServerUrl);
  1465. return;
  1466. }
  1467. // Save state for POST action
  1468. stateHelper.setRepositoryPath(settings.repositoryPath);
  1469. // Initialize the repository
  1470. if (!fsHelper.directoryExistsSync(path.join(settings.repositoryPath, '.git'))) {
  1471. core.startGroup('Determining repository object format');
  1472. const objectFormatResult = yield githubApiHelper.tryGetRepositoryObjectFormat(settings.authToken, settings.repositoryOwner, settings.repositoryName, settings.githubServerUrl, settings.commit);
  1473. const objectFormat = objectFormatResult.succeeded
  1474. ? objectFormatResult.format
  1475. : '';
  1476. if (objectFormat === 'sha256') {
  1477. core.info('Detected SHA-256 repository object format');
  1478. }
  1479. core.endGroup();
  1480. core.startGroup('Initializing the repository');
  1481. yield git.init(objectFormat);
  1482. yield git.remoteAdd('origin', repositoryUrl);
  1483. core.endGroup();
  1484. }
  1485. // Disable automatic garbage collection
  1486. core.startGroup('Disabling automatic garbage collection');
  1487. if (!(yield git.tryDisableAutomaticGarbageCollection())) {
  1488. core.warning(`Unable to turn off git automatic garbage collection. The git fetch operation may trigger garbage collection and cause a delay.`);
  1489. }
  1490. core.endGroup();
  1491. // If we didn't initialize it above, do it now
  1492. if (!authHelper) {
  1493. authHelper = gitAuthHelper.createAuthHelper(git, settings);
  1494. }
  1495. // Configure auth
  1496. core.startGroup('Setting up auth');
  1497. yield authHelper.configureAuth();
  1498. core.endGroup();
  1499. // Determine the default branch
  1500. if (!settings.ref && !settings.commit) {
  1501. core.startGroup('Determining the default branch');
  1502. if (settings.sshKey) {
  1503. settings.ref = yield git.getDefaultBranch(repositoryUrl);
  1504. }
  1505. else {
  1506. settings.ref = yield githubApiHelper.getDefaultBranch(settings.authToken, settings.repositoryOwner, settings.repositoryName, settings.githubServerUrl);
  1507. }
  1508. core.endGroup();
  1509. }
  1510. // LFS install
  1511. if (settings.lfs) {
  1512. yield git.lfsInstall();
  1513. }
  1514. // Fetch
  1515. core.startGroup('Fetching the repository');
  1516. const fetchOptions = {};
  1517. if (settings.filter) {
  1518. fetchOptions.filter = settings.filter;
  1519. }
  1520. else if (settings.sparseCheckout) {
  1521. fetchOptions.filter = 'blob:none';
  1522. }
  1523. if (settings.fetchDepth <= 0) {
  1524. // Fetch all branches and tags
  1525. let refSpec = refHelper.getRefSpecForAllHistory(settings.ref, settings.commit);
  1526. yield git.fetch(refSpec, fetchOptions);
  1527. // When all history is fetched, the ref we're interested in may have moved to a different
  1528. // commit (push or force push). If so, fetch again with a targeted refspec.
  1529. if (!(yield refHelper.testRef(git, settings.ref, settings.commit))) {
  1530. refSpec = refHelper.getRefSpec(settings.ref, settings.commit);
  1531. yield git.fetch(refSpec, fetchOptions);
  1532. // Verify the ref now matches. For branches, the targeted fetch above brings
  1533. // in the specific commit. For tags (fetched by ref), this will fail if
  1534. // the tag was moved after the workflow was triggered.
  1535. if (!(yield refHelper.testRef(git, settings.ref, settings.commit))) {
  1536. throw new Error(`The ref '${settings.ref}' does not point to the expected commit '${settings.commit}'. ` +
  1537. `The ref may have been updated after the workflow was triggered.`);
  1538. }
  1539. }
  1540. }
  1541. else {
  1542. fetchOptions.fetchDepth = settings.fetchDepth;
  1543. const refSpec = refHelper.getRefSpec(settings.ref, settings.commit, settings.fetchTags);
  1544. yield git.fetch(refSpec, fetchOptions);
  1545. // For tags, verify the ref still points to the expected commit.
  1546. // Tags are fetched by ref (not commit), so if a tag was moved after the
  1547. // workflow was triggered, we would silently check out the wrong commit.
  1548. if (!(yield refHelper.testRef(git, settings.ref, settings.commit))) {
  1549. throw new Error(`The ref '${settings.ref}' does not point to the expected commit '${settings.commit}'. ` +
  1550. `The ref may have been updated after the workflow was triggered.`);
  1551. }
  1552. }
  1553. core.endGroup();
  1554. // Checkout info
  1555. core.startGroup('Determining the checkout info');
  1556. const checkoutInfo = yield refHelper.getCheckoutInfo(git, settings.ref, settings.commit);
  1557. core.endGroup();
  1558. // LFS fetch
  1559. // Explicit lfs-fetch to avoid slow checkout (fetches one lfs object at a time).
  1560. // Explicit lfs fetch will fetch lfs objects in parallel.
  1561. // For sparse checkouts, let `checkout` fetch the needed objects lazily.
  1562. if (settings.lfs && !settings.sparseCheckout) {
  1563. core.startGroup('Fetching LFS objects');
  1564. yield git.lfsFetch(checkoutInfo.startPoint || checkoutInfo.ref);
  1565. core.endGroup();
  1566. }
  1567. // Sparse checkout
  1568. if (!settings.sparseCheckout) {
  1569. let gitVersion = yield git.version();
  1570. // no need to disable sparse-checkout if the installed git runtime doesn't even support it.
  1571. if (gitVersion.checkMinimum(git_command_manager_1.MinimumGitSparseCheckoutVersion)) {
  1572. yield git.disableSparseCheckout();
  1573. }
  1574. }
  1575. else {
  1576. core.startGroup('Setting up sparse checkout');
  1577. if (settings.sparseCheckoutConeMode) {
  1578. yield git.sparseCheckout(settings.sparseCheckout);
  1579. }
  1580. else {
  1581. yield git.sparseCheckoutNonConeMode(settings.sparseCheckout);
  1582. }
  1583. core.endGroup();
  1584. }
  1585. // Checkout
  1586. core.startGroup('Checking out the ref');
  1587. yield git.checkout(checkoutInfo.ref, checkoutInfo.startPoint);
  1588. core.endGroup();
  1589. // Submodules
  1590. if (settings.submodules) {
  1591. // Temporarily override global config
  1592. core.startGroup('Setting up auth for fetching submodules');
  1593. yield authHelper.configureGlobalAuth();
  1594. core.endGroup();
  1595. // Checkout submodules
  1596. core.startGroup('Fetching submodules');
  1597. yield git.submoduleSync(settings.nestedSubmodules);
  1598. yield git.submoduleUpdate(settings.fetchDepth, settings.nestedSubmodules);
  1599. yield git.submoduleForeach('git config --local gc.auto 0', settings.nestedSubmodules);
  1600. core.endGroup();
  1601. // Persist credentials
  1602. if (settings.persistCredentials) {
  1603. core.startGroup('Persisting credentials for submodules');
  1604. yield authHelper.configureSubmoduleAuth();
  1605. core.endGroup();
  1606. }
  1607. }
  1608. // Get commit information
  1609. const commitInfo = yield git.log1();
  1610. // Log commit sha
  1611. const commitSHA = yield git.log1('--format=%H');
  1612. core.setOutput('commit', commitSHA.trim());
  1613. // Check for incorrect pull request merge commit
  1614. yield refHelper.checkCommitInfo(settings.authToken, commitInfo, settings.repositoryOwner, settings.repositoryName, settings.ref, settings.commit, settings.githubServerUrl);
  1615. }
  1616. finally {
  1617. // Remove auth
  1618. if (authHelper) {
  1619. if (!settings.persistCredentials) {
  1620. core.startGroup('Removing auth');
  1621. yield authHelper.removeAuth();
  1622. core.endGroup();
  1623. }
  1624. authHelper.removeGlobalConfig();
  1625. }
  1626. }
  1627. });
  1628. }
  1629. function cleanup(repositoryPath) {
  1630. return __awaiter(this, void 0, void 0, function* () {
  1631. // Repo exists?
  1632. if (!repositoryPath ||
  1633. !fsHelper.fileExistsSync(path.join(repositoryPath, '.git', 'config'))) {
  1634. return;
  1635. }
  1636. let git;
  1637. try {
  1638. git = yield gitCommandManager.createCommandManager(repositoryPath, false, false);
  1639. }
  1640. catch (_a) {
  1641. return;
  1642. }
  1643. // Remove auth
  1644. const authHelper = gitAuthHelper.createAuthHelper(git);
  1645. try {
  1646. if (stateHelper.PostSetSafeDirectory) {
  1647. // 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
  1648. // Otherwise all git commands we run in a container fail
  1649. yield authHelper.configureTempGlobalConfig();
  1650. core.info(`Adding repository directory to the temporary git global config as a safe directory`);
  1651. yield git
  1652. .config('safe.directory', repositoryPath, true, true)
  1653. .catch(error => {
  1654. core.info(`Failed to initialize safe directory with error: ${error}`);
  1655. });
  1656. }
  1657. yield authHelper.removeAuth();
  1658. }
  1659. finally {
  1660. yield authHelper.removeGlobalConfig();
  1661. }
  1662. });
  1663. }
  1664. function getGitCommandManager(settings) {
  1665. return __awaiter(this, void 0, void 0, function* () {
  1666. core.info(`Working directory is '${settings.repositoryPath}'`);
  1667. try {
  1668. return yield gitCommandManager.createCommandManager(settings.repositoryPath, settings.lfs, settings.sparseCheckout != null);
  1669. }
  1670. catch (err) {
  1671. // Git is required for LFS
  1672. if (settings.lfs) {
  1673. throw err;
  1674. }
  1675. // Otherwise fallback to REST API
  1676. return undefined;
  1677. }
  1678. });
  1679. }
  1680. /***/ }),
  1681. /***/ 3142:
  1682. /***/ ((__unused_webpack_module, exports) => {
  1683. "use strict";
  1684. Object.defineProperty(exports, "__esModule", ({ value: true }));
  1685. exports.GitVersion = void 0;
  1686. class GitVersion {
  1687. /**
  1688. * Used for comparing the version of git and git-lfs against the minimum required version
  1689. * @param version the version string, e.g. 1.2 or 1.2.3
  1690. */
  1691. constructor(version) {
  1692. this.major = NaN;
  1693. this.minor = NaN;
  1694. this.patch = NaN;
  1695. if (version) {
  1696. const match = version.match(/^(\d+)\.(\d+)(\.(\d+))?$/);
  1697. if (match) {
  1698. this.major = Number(match[1]);
  1699. this.minor = Number(match[2]);
  1700. if (match[4]) {
  1701. this.patch = Number(match[4]);
  1702. }
  1703. }
  1704. }
  1705. }
  1706. /**
  1707. * Compares the instance against a minimum required version
  1708. * @param minimum Minimum version
  1709. */
  1710. checkMinimum(minimum) {
  1711. if (!minimum.isValid()) {
  1712. throw new Error('Arg minimum is not a valid version');
  1713. }
  1714. // Major is insufficient
  1715. if (this.major < minimum.major) {
  1716. return false;
  1717. }
  1718. // Major is equal
  1719. if (this.major === minimum.major) {
  1720. // Minor is insufficient
  1721. if (this.minor < minimum.minor) {
  1722. return false;
  1723. }
  1724. // Minor is equal
  1725. if (this.minor === minimum.minor) {
  1726. // Patch is insufficient
  1727. if (this.patch && this.patch < (minimum.patch || 0)) {
  1728. return false;
  1729. }
  1730. }
  1731. }
  1732. return true;
  1733. }
  1734. /**
  1735. * Indicates whether the instance was constructed from a valid version string
  1736. */
  1737. isValid() {
  1738. return !isNaN(this.major);
  1739. }
  1740. /**
  1741. * Returns the version as a string, e.g. 1.2 or 1.2.3
  1742. */
  1743. toString() {
  1744. let result = '';
  1745. if (this.isValid()) {
  1746. result = `${this.major}.${this.minor}`;
  1747. if (!isNaN(this.patch)) {
  1748. result += `.${this.patch}`;
  1749. }
  1750. }
  1751. return result;
  1752. }
  1753. }
  1754. exports.GitVersion = GitVersion;
  1755. /***/ }),
  1756. /***/ 138:
  1757. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  1758. "use strict";
  1759. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  1760. if (k2 === undefined) k2 = k;
  1761. var desc = Object.getOwnPropertyDescriptor(m, k);
  1762. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  1763. desc = { enumerable: true, get: function() { return m[k]; } };
  1764. }
  1765. Object.defineProperty(o, k2, desc);
  1766. }) : (function(o, m, k, k2) {
  1767. if (k2 === undefined) k2 = k;
  1768. o[k2] = m[k];
  1769. }));
  1770. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  1771. Object.defineProperty(o, "default", { enumerable: true, value: v });
  1772. }) : function(o, v) {
  1773. o["default"] = v;
  1774. });
  1775. var __importStar = (this && this.__importStar) || function (mod) {
  1776. if (mod && mod.__esModule) return mod;
  1777. var result = {};
  1778. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  1779. __setModuleDefault(result, mod);
  1780. return result;
  1781. };
  1782. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  1783. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  1784. return new (P || (P = Promise))(function (resolve, reject) {
  1785. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  1786. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  1787. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  1788. step((generator = generator.apply(thisArg, _arguments || [])).next());
  1789. });
  1790. };
  1791. Object.defineProperty(exports, "__esModule", ({ value: true }));
  1792. exports.downloadRepository = downloadRepository;
  1793. exports.getDefaultBranch = getDefaultBranch;
  1794. exports.tryGetRepositoryObjectFormat = tryGetRepositoryObjectFormat;
  1795. const assert = __importStar(__nccwpck_require__(9491));
  1796. const core = __importStar(__nccwpck_require__(2186));
  1797. const fs = __importStar(__nccwpck_require__(7147));
  1798. const github = __importStar(__nccwpck_require__(5438));
  1799. const io = __importStar(__nccwpck_require__(7436));
  1800. const path = __importStar(__nccwpck_require__(1017));
  1801. const retryHelper = __importStar(__nccwpck_require__(2155));
  1802. const toolCache = __importStar(__nccwpck_require__(7784));
  1803. const uuid_1 = __nccwpck_require__(5840);
  1804. const url_helper_1 = __nccwpck_require__(9437);
  1805. const IS_WINDOWS = process.platform === 'win32';
  1806. function downloadRepository(authToken, owner, repo, ref, commit, repositoryPath, baseUrl) {
  1807. return __awaiter(this, void 0, void 0, function* () {
  1808. // Determine the default branch
  1809. if (!ref && !commit) {
  1810. core.info('Determining the default branch');
  1811. ref = yield getDefaultBranch(authToken, owner, repo, baseUrl);
  1812. }
  1813. // Download the archive
  1814. let archiveData = yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  1815. core.info('Downloading the archive');
  1816. return yield downloadArchive(authToken, owner, repo, ref, commit, baseUrl);
  1817. }));
  1818. // Write archive to disk
  1819. core.info('Writing archive to disk');
  1820. const uniqueId = (0, uuid_1.v4)();
  1821. const archivePath = IS_WINDOWS
  1822. ? path.join(repositoryPath, `${uniqueId}.zip`)
  1823. : path.join(repositoryPath, `${uniqueId}.tar.gz`);
  1824. yield fs.promises.writeFile(archivePath, archiveData);
  1825. archiveData = Buffer.from(''); // Free memory
  1826. // Extract archive
  1827. core.info('Extracting the archive');
  1828. const extractPath = path.join(repositoryPath, uniqueId);
  1829. yield io.mkdirP(extractPath);
  1830. if (IS_WINDOWS) {
  1831. yield toolCache.extractZip(archivePath, extractPath);
  1832. }
  1833. else {
  1834. yield toolCache.extractTar(archivePath, extractPath);
  1835. }
  1836. yield io.rmRF(archivePath);
  1837. // Determine the path of the repository content. The archive contains
  1838. // a top-level folder and the repository content is inside.
  1839. const archiveFileNames = yield fs.promises.readdir(extractPath);
  1840. assert.ok(archiveFileNames.length == 1, 'Expected exactly one directory inside archive');
  1841. const archiveVersion = archiveFileNames[0]; // The top-level folder name includes the short SHA
  1842. core.info(`Resolved version ${archiveVersion}`);
  1843. const tempRepositoryPath = path.join(extractPath, archiveVersion);
  1844. // Move the files
  1845. for (const fileName of yield fs.promises.readdir(tempRepositoryPath)) {
  1846. const sourcePath = path.join(tempRepositoryPath, fileName);
  1847. const targetPath = path.join(repositoryPath, fileName);
  1848. if (IS_WINDOWS) {
  1849. yield io.cp(sourcePath, targetPath, { recursive: true }); // Copy on Windows (Windows Defender may have a lock)
  1850. }
  1851. else {
  1852. yield io.mv(sourcePath, targetPath);
  1853. }
  1854. }
  1855. yield io.rmRF(extractPath);
  1856. });
  1857. }
  1858. /**
  1859. * Looks up the default branch name
  1860. */
  1861. function getDefaultBranch(authToken, owner, repo, baseUrl) {
  1862. return __awaiter(this, void 0, void 0, function* () {
  1863. return yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  1864. core.info('Retrieving the default branch name');
  1865. const octokit = github.getOctokit(authToken, {
  1866. baseUrl: (0, url_helper_1.getServerApiUrl)(baseUrl)
  1867. });
  1868. let result;
  1869. try {
  1870. // Get the default branch from the repo info
  1871. const response = yield octokit.rest.repos.get({ owner, repo });
  1872. result = response.data.default_branch;
  1873. assert.ok(result, 'default_branch cannot be empty');
  1874. }
  1875. catch (err) {
  1876. // Handle .wiki repo
  1877. if ((err === null || err === void 0 ? void 0 : err.status) === 404 &&
  1878. repo.toUpperCase().endsWith('.WIKI')) {
  1879. result = 'master';
  1880. }
  1881. // Otherwise error
  1882. else {
  1883. throw err;
  1884. }
  1885. }
  1886. // Print the default branch
  1887. core.info(`Default branch '${result}'`);
  1888. // Prefix with 'refs/heads'
  1889. if (!result.startsWith('refs/')) {
  1890. result = `refs/heads/${result}`;
  1891. }
  1892. return result;
  1893. }));
  1894. });
  1895. }
  1896. function tryGetRepositoryObjectFormat(authToken, owner, repo, baseUrl, commit) {
  1897. return __awaiter(this, void 0, void 0, function* () {
  1898. var _a;
  1899. const commitFormat = getObjectFormat(commit);
  1900. if (commitFormat) {
  1901. return { format: commitFormat, succeeded: true };
  1902. }
  1903. try {
  1904. const octokit = github.getOctokit(authToken, {
  1905. baseUrl: (0, url_helper_1.getServerApiUrl)(baseUrl)
  1906. });
  1907. const response = yield octokit.request('GET /repos/{owner}/{repo}/hash-algorithm', { owner, repo });
  1908. const hashAlgorithm = response.data.hash_algorithm;
  1909. if (hashAlgorithm === 'sha256' || hashAlgorithm === 'sha1') {
  1910. return { format: hashAlgorithm, succeeded: true };
  1911. }
  1912. core.debug('Unable to determine repository object format from hash-algorithm endpoint');
  1913. return { format: '', succeeded: false };
  1914. }
  1915. catch (err) {
  1916. core.debug(`Unable to determine repository object format from hash-algorithm endpoint: ${(_a = err === null || err === void 0 ? void 0 : err.message) !== null && _a !== void 0 ? _a : err}`);
  1917. return { format: '', succeeded: false };
  1918. }
  1919. });
  1920. }
  1921. function getObjectFormat(sha) {
  1922. if (/^[0-9a-fA-F]{64}$/.test(sha || '')) {
  1923. return 'sha256';
  1924. }
  1925. if (/^[0-9a-fA-F]{40}$/.test(sha || '')) {
  1926. return 'sha1';
  1927. }
  1928. return '';
  1929. }
  1930. function downloadArchive(authToken, owner, repo, ref, commit, baseUrl) {
  1931. return __awaiter(this, void 0, void 0, function* () {
  1932. const octokit = github.getOctokit(authToken, {
  1933. baseUrl: (0, url_helper_1.getServerApiUrl)(baseUrl)
  1934. });
  1935. const download = IS_WINDOWS
  1936. ? octokit.rest.repos.downloadZipballArchive
  1937. : octokit.rest.repos.downloadTarballArchive;
  1938. const response = yield download({
  1939. owner: owner,
  1940. repo: repo,
  1941. ref: commit || ref
  1942. });
  1943. return Buffer.from(response.data); // response.data is ArrayBuffer
  1944. });
  1945. }
  1946. /***/ }),
  1947. /***/ 5480:
  1948. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  1949. "use strict";
  1950. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  1951. if (k2 === undefined) k2 = k;
  1952. var desc = Object.getOwnPropertyDescriptor(m, k);
  1953. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  1954. desc = { enumerable: true, get: function() { return m[k]; } };
  1955. }
  1956. Object.defineProperty(o, k2, desc);
  1957. }) : (function(o, m, k, k2) {
  1958. if (k2 === undefined) k2 = k;
  1959. o[k2] = m[k];
  1960. }));
  1961. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  1962. Object.defineProperty(o, "default", { enumerable: true, value: v });
  1963. }) : function(o, v) {
  1964. o["default"] = v;
  1965. });
  1966. var __importStar = (this && this.__importStar) || function (mod) {
  1967. if (mod && mod.__esModule) return mod;
  1968. var result = {};
  1969. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  1970. __setModuleDefault(result, mod);
  1971. return result;
  1972. };
  1973. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  1974. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  1975. return new (P || (P = Promise))(function (resolve, reject) {
  1976. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  1977. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  1978. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  1979. step((generator = generator.apply(thisArg, _arguments || [])).next());
  1980. });
  1981. };
  1982. Object.defineProperty(exports, "__esModule", ({ value: true }));
  1983. exports.getInputs = getInputs;
  1984. const core = __importStar(__nccwpck_require__(2186));
  1985. const fsHelper = __importStar(__nccwpck_require__(7219));
  1986. const github = __importStar(__nccwpck_require__(5438));
  1987. const path = __importStar(__nccwpck_require__(1017));
  1988. const unsafePrCheckoutHelper = __importStar(__nccwpck_require__(843));
  1989. const workflowContextHelper = __importStar(__nccwpck_require__(9568));
  1990. function getInputs() {
  1991. return __awaiter(this, void 0, void 0, function* () {
  1992. const result = {};
  1993. // GitHub workspace
  1994. let githubWorkspacePath = process.env['GITHUB_WORKSPACE'];
  1995. if (!githubWorkspacePath) {
  1996. throw new Error('GITHUB_WORKSPACE not defined');
  1997. }
  1998. githubWorkspacePath = path.resolve(githubWorkspacePath);
  1999. core.debug(`GITHUB_WORKSPACE = '${githubWorkspacePath}'`);
  2000. fsHelper.directoryExistsSync(githubWorkspacePath, true);
  2001. // Qualified repository
  2002. const qualifiedRepository = core.getInput('repository') ||
  2003. `${github.context.repo.owner}/${github.context.repo.repo}`;
  2004. core.debug(`qualified repository = '${qualifiedRepository}'`);
  2005. const splitRepository = qualifiedRepository.split('/');
  2006. if (splitRepository.length !== 2 ||
  2007. !splitRepository[0] ||
  2008. !splitRepository[1]) {
  2009. throw new Error(`Invalid repository '${qualifiedRepository}'. Expected format {owner}/{repo}.`);
  2010. }
  2011. result.repositoryOwner = splitRepository[0];
  2012. result.repositoryName = splitRepository[1];
  2013. // Repository path
  2014. result.repositoryPath = core.getInput('path') || '.';
  2015. result.repositoryPath = path.resolve(githubWorkspacePath, result.repositoryPath);
  2016. if (!(result.repositoryPath + path.sep).startsWith(githubWorkspacePath + path.sep)) {
  2017. throw new Error(`Repository path '${result.repositoryPath}' is not under '${githubWorkspacePath}'`);
  2018. }
  2019. // Workflow repository?
  2020. const isWorkflowRepository = qualifiedRepository.toUpperCase() ===
  2021. `${github.context.repo.owner}/${github.context.repo.repo}`.toUpperCase();
  2022. // Source branch, source version
  2023. result.ref = core.getInput('ref');
  2024. if (!result.ref) {
  2025. if (isWorkflowRepository) {
  2026. result.ref = github.context.ref;
  2027. result.commit = github.context.sha;
  2028. // Some events have an unqualifed ref. For example when a PR is merged (pull_request closed event),
  2029. // the ref is unqualifed like "main" instead of "refs/heads/main".
  2030. if (result.commit && result.ref && !result.ref.startsWith('refs/')) {
  2031. result.ref = `refs/heads/${result.ref}`;
  2032. }
  2033. }
  2034. }
  2035. // SHA?
  2036. else if (result.ref.match(/^(?:[0-9a-fA-F]{40}|[0-9a-fA-F]{64})$/)) {
  2037. result.commit = result.ref;
  2038. result.ref = '';
  2039. }
  2040. core.debug(`ref = '${result.ref}'`);
  2041. core.debug(`commit = '${result.commit}'`);
  2042. // Clean
  2043. result.clean = (core.getInput('clean') || 'true').toUpperCase() === 'TRUE';
  2044. core.debug(`clean = ${result.clean}`);
  2045. // Filter
  2046. const filter = core.getInput('filter');
  2047. if (filter) {
  2048. result.filter = filter;
  2049. }
  2050. core.debug(`filter = ${result.filter}`);
  2051. // Sparse checkout
  2052. const sparseCheckout = core.getMultilineInput('sparse-checkout');
  2053. if (sparseCheckout.length) {
  2054. result.sparseCheckout = sparseCheckout;
  2055. core.debug(`sparse checkout = ${result.sparseCheckout}`);
  2056. }
  2057. result.sparseCheckoutConeMode =
  2058. (core.getInput('sparse-checkout-cone-mode') || 'true').toUpperCase() ===
  2059. 'TRUE';
  2060. // Fetch depth
  2061. result.fetchDepth = Math.floor(Number(core.getInput('fetch-depth') || '1'));
  2062. if (isNaN(result.fetchDepth) || result.fetchDepth < 0) {
  2063. result.fetchDepth = 0;
  2064. }
  2065. core.debug(`fetch depth = ${result.fetchDepth}`);
  2066. // Fetch tags
  2067. result.fetchTags =
  2068. (core.getInput('fetch-tags') || 'false').toUpperCase() === 'TRUE';
  2069. core.debug(`fetch tags = ${result.fetchTags}`);
  2070. // Show fetch progress
  2071. result.showProgress =
  2072. (core.getInput('show-progress') || 'true').toUpperCase() === 'TRUE';
  2073. core.debug(`show progress = ${result.showProgress}`);
  2074. // LFS
  2075. result.lfs = (core.getInput('lfs') || 'false').toUpperCase() === 'TRUE';
  2076. core.debug(`lfs = ${result.lfs}`);
  2077. // Submodules
  2078. result.submodules = false;
  2079. result.nestedSubmodules = false;
  2080. const submodulesString = (core.getInput('submodules') || '').toUpperCase();
  2081. if (submodulesString == 'RECURSIVE') {
  2082. result.submodules = true;
  2083. result.nestedSubmodules = true;
  2084. }
  2085. else if (submodulesString == 'TRUE') {
  2086. result.submodules = true;
  2087. }
  2088. core.debug(`submodules = ${result.submodules}`);
  2089. core.debug(`recursive submodules = ${result.nestedSubmodules}`);
  2090. // Auth token
  2091. result.authToken = core.getInput('token', { required: true });
  2092. // SSH
  2093. result.sshKey = core.getInput('ssh-key');
  2094. result.sshKnownHosts = core.getInput('ssh-known-hosts');
  2095. result.sshStrict =
  2096. (core.getInput('ssh-strict') || 'true').toUpperCase() === 'TRUE';
  2097. result.sshUser = core.getInput('ssh-user');
  2098. // Persist credentials
  2099. result.persistCredentials =
  2100. (core.getInput('persist-credentials') || 'false').toUpperCase() === 'TRUE';
  2101. // Workflow organization ID
  2102. result.workflowOrganizationId =
  2103. yield workflowContextHelper.getOrganizationId();
  2104. // Set safe.directory in git global config.
  2105. result.setSafeDirectory =
  2106. (core.getInput('set-safe-directory') || 'true').toUpperCase() === 'TRUE';
  2107. // Determine the GitHub URL that the repository is being hosted from
  2108. result.githubServerUrl = core.getInput('github-server-url');
  2109. core.debug(`GitHub Host URL = ${result.githubServerUrl}`);
  2110. // Allow unsafe PR checkout (opt-in for pull_request_target / workflow_run fork PRs)
  2111. result.allowUnsafePrCheckout =
  2112. (core.getInput('allow-unsafe-pr-checkout') || 'false').toUpperCase() ===
  2113. 'TRUE';
  2114. core.debug(`allow unsafe PR checkout = ${result.allowUnsafePrCheckout}`);
  2115. unsafePrCheckoutHelper.assertSafePrCheckout({
  2116. qualifiedRepository,
  2117. ref: result.ref,
  2118. commit: result.commit,
  2119. allowUnsafePrCheckout: result.allowUnsafePrCheckout
  2120. });
  2121. return result;
  2122. });
  2123. }
  2124. /***/ }),
  2125. /***/ 3109:
  2126. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  2127. "use strict";
  2128. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  2129. if (k2 === undefined) k2 = k;
  2130. var desc = Object.getOwnPropertyDescriptor(m, k);
  2131. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  2132. desc = { enumerable: true, get: function() { return m[k]; } };
  2133. }
  2134. Object.defineProperty(o, k2, desc);
  2135. }) : (function(o, m, k, k2) {
  2136. if (k2 === undefined) k2 = k;
  2137. o[k2] = m[k];
  2138. }));
  2139. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  2140. Object.defineProperty(o, "default", { enumerable: true, value: v });
  2141. }) : function(o, v) {
  2142. o["default"] = v;
  2143. });
  2144. var __importStar = (this && this.__importStar) || function (mod) {
  2145. if (mod && mod.__esModule) return mod;
  2146. var result = {};
  2147. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  2148. __setModuleDefault(result, mod);
  2149. return result;
  2150. };
  2151. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  2152. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  2153. return new (P || (P = Promise))(function (resolve, reject) {
  2154. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  2155. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  2156. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  2157. step((generator = generator.apply(thisArg, _arguments || [])).next());
  2158. });
  2159. };
  2160. Object.defineProperty(exports, "__esModule", ({ value: true }));
  2161. const core = __importStar(__nccwpck_require__(2186));
  2162. const coreCommand = __importStar(__nccwpck_require__(7351));
  2163. const gitSourceProvider = __importStar(__nccwpck_require__(9210));
  2164. const inputHelper = __importStar(__nccwpck_require__(5480));
  2165. const path = __importStar(__nccwpck_require__(1017));
  2166. const stateHelper = __importStar(__nccwpck_require__(4866));
  2167. function run() {
  2168. return __awaiter(this, void 0, void 0, function* () {
  2169. var _a;
  2170. try {
  2171. const sourceSettings = yield inputHelper.getInputs();
  2172. try {
  2173. // Register problem matcher
  2174. coreCommand.issueCommand('add-matcher', {}, path.join(__dirname, 'problem-matcher.json'));
  2175. // Get sources
  2176. yield gitSourceProvider.getSource(sourceSettings);
  2177. core.setOutput('ref', sourceSettings.ref);
  2178. }
  2179. finally {
  2180. // Unregister problem matcher
  2181. coreCommand.issueCommand('remove-matcher', { owner: 'checkout-git' }, '');
  2182. }
  2183. }
  2184. catch (error) {
  2185. core.setFailed(`${(_a = error === null || error === void 0 ? void 0 : error.message) !== null && _a !== void 0 ? _a : error}`);
  2186. }
  2187. });
  2188. }
  2189. function cleanup() {
  2190. return __awaiter(this, void 0, void 0, function* () {
  2191. var _a;
  2192. try {
  2193. yield gitSourceProvider.cleanup(stateHelper.RepositoryPath);
  2194. }
  2195. catch (error) {
  2196. core.warning(`${(_a = error === null || error === void 0 ? void 0 : error.message) !== null && _a !== void 0 ? _a : error}`);
  2197. }
  2198. });
  2199. }
  2200. // Main
  2201. if (!stateHelper.IsPost) {
  2202. run();
  2203. }
  2204. // Post
  2205. else {
  2206. cleanup();
  2207. }
  2208. /***/ }),
  2209. /***/ 8601:
  2210. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  2211. "use strict";
  2212. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  2213. if (k2 === undefined) k2 = k;
  2214. var desc = Object.getOwnPropertyDescriptor(m, k);
  2215. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  2216. desc = { enumerable: true, get: function() { return m[k]; } };
  2217. }
  2218. Object.defineProperty(o, k2, desc);
  2219. }) : (function(o, m, k, k2) {
  2220. if (k2 === undefined) k2 = k;
  2221. o[k2] = m[k];
  2222. }));
  2223. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  2224. Object.defineProperty(o, "default", { enumerable: true, value: v });
  2225. }) : function(o, v) {
  2226. o["default"] = v;
  2227. });
  2228. var __importStar = (this && this.__importStar) || function (mod) {
  2229. if (mod && mod.__esModule) return mod;
  2230. var result = {};
  2231. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  2232. __setModuleDefault(result, mod);
  2233. return result;
  2234. };
  2235. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  2236. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  2237. return new (P || (P = Promise))(function (resolve, reject) {
  2238. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  2239. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  2240. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  2241. step((generator = generator.apply(thisArg, _arguments || [])).next());
  2242. });
  2243. };
  2244. Object.defineProperty(exports, "__esModule", ({ value: true }));
  2245. exports.tagsRefSpec = void 0;
  2246. exports.getCheckoutInfo = getCheckoutInfo;
  2247. exports.getRefSpecForAllHistory = getRefSpecForAllHistory;
  2248. exports.getRefSpec = getRefSpec;
  2249. exports.testRef = testRef;
  2250. exports.checkCommitInfo = checkCommitInfo;
  2251. exports.fromPayload = fromPayload;
  2252. const core = __importStar(__nccwpck_require__(2186));
  2253. const github = __importStar(__nccwpck_require__(5438));
  2254. const url_helper_1 = __nccwpck_require__(9437);
  2255. exports.tagsRefSpec = '+refs/tags/*:refs/tags/*';
  2256. function getCheckoutInfo(git, ref, commit) {
  2257. return __awaiter(this, void 0, void 0, function* () {
  2258. if (!git) {
  2259. throw new Error('Arg git cannot be empty');
  2260. }
  2261. if (!ref && !commit) {
  2262. throw new Error('Args ref and commit cannot both be empty');
  2263. }
  2264. const result = {};
  2265. const upperRef = (ref || '').toUpperCase();
  2266. // SHA only
  2267. if (!ref) {
  2268. result.ref = commit;
  2269. }
  2270. // refs/heads/
  2271. else if (upperRef.startsWith('REFS/HEADS/')) {
  2272. const branch = ref.substring('refs/heads/'.length);
  2273. result.ref = branch;
  2274. result.startPoint = `refs/remotes/origin/${branch}`;
  2275. }
  2276. // refs/pull/
  2277. else if (upperRef.startsWith('REFS/PULL/')) {
  2278. const branch = ref.substring('refs/pull/'.length);
  2279. result.ref = `refs/remotes/pull/${branch}`;
  2280. }
  2281. // refs/tags/
  2282. else if (upperRef.startsWith('REFS/TAGS/')) {
  2283. result.ref = ref;
  2284. }
  2285. // refs/
  2286. else if (upperRef.startsWith('REFS/')) {
  2287. result.ref = commit ? commit : ref;
  2288. }
  2289. // Unqualified ref, check for a matching branch or tag
  2290. else {
  2291. if (yield git.branchExists(true, `origin/${ref}`)) {
  2292. result.ref = ref;
  2293. result.startPoint = `refs/remotes/origin/${ref}`;
  2294. }
  2295. else if (yield git.tagExists(`${ref}`)) {
  2296. result.ref = `refs/tags/${ref}`;
  2297. }
  2298. else {
  2299. throw new Error(`A branch or tag with the name '${ref}' could not be found`);
  2300. }
  2301. }
  2302. return result;
  2303. });
  2304. }
  2305. function getRefSpecForAllHistory(ref, commit) {
  2306. const result = ['+refs/heads/*:refs/remotes/origin/*', exports.tagsRefSpec];
  2307. if (ref && ref.toUpperCase().startsWith('REFS/PULL/')) {
  2308. const branch = ref.substring('refs/pull/'.length);
  2309. result.push(`+${commit || ref}:refs/remotes/pull/${branch}`);
  2310. }
  2311. return result;
  2312. }
  2313. function getRefSpec(ref, commit, fetchTags) {
  2314. if (!ref && !commit) {
  2315. throw new Error('Args ref and commit cannot both be empty');
  2316. }
  2317. const upperRef = (ref || '').toUpperCase();
  2318. const result = [];
  2319. // When fetchTags is true, always include the tags refspec
  2320. if (fetchTags) {
  2321. result.push(exports.tagsRefSpec);
  2322. }
  2323. // SHA
  2324. if (commit) {
  2325. // refs/heads
  2326. if (upperRef.startsWith('REFS/HEADS/')) {
  2327. const branch = ref.substring('refs/heads/'.length);
  2328. result.push(`+${commit}:refs/remotes/origin/${branch}`);
  2329. }
  2330. // refs/pull/
  2331. else if (upperRef.startsWith('REFS/PULL/')) {
  2332. const branch = ref.substring('refs/pull/'.length);
  2333. result.push(`+${commit}:refs/remotes/pull/${branch}`);
  2334. }
  2335. // refs/tags/
  2336. else if (upperRef.startsWith('REFS/TAGS/')) {
  2337. if (!fetchTags) {
  2338. result.push(`+${ref}:${ref}`);
  2339. }
  2340. }
  2341. // Otherwise no destination ref
  2342. else {
  2343. result.push(commit);
  2344. }
  2345. }
  2346. // Unqualified ref, check for a matching branch or tag
  2347. else if (!upperRef.startsWith('REFS/')) {
  2348. result.push(`+refs/heads/${ref}*:refs/remotes/origin/${ref}*`);
  2349. if (!fetchTags) {
  2350. result.push(`+refs/tags/${ref}*:refs/tags/${ref}*`);
  2351. }
  2352. }
  2353. // refs/heads/
  2354. else if (upperRef.startsWith('REFS/HEADS/')) {
  2355. const branch = ref.substring('refs/heads/'.length);
  2356. result.push(`+${ref}:refs/remotes/origin/${branch}`);
  2357. }
  2358. // refs/pull/
  2359. else if (upperRef.startsWith('REFS/PULL/')) {
  2360. const branch = ref.substring('refs/pull/'.length);
  2361. result.push(`+${ref}:refs/remotes/pull/${branch}`);
  2362. }
  2363. // refs/tags/
  2364. else if (upperRef.startsWith('REFS/TAGS/')) {
  2365. if (!fetchTags) {
  2366. result.push(`+${ref}:${ref}`);
  2367. }
  2368. }
  2369. // Other refs
  2370. else {
  2371. result.push(`+${ref}:${ref}`);
  2372. }
  2373. return result;
  2374. }
  2375. /**
  2376. * Tests whether the initial fetch created the ref at the expected commit
  2377. */
  2378. function testRef(git, ref, commit) {
  2379. return __awaiter(this, void 0, void 0, function* () {
  2380. if (!git) {
  2381. throw new Error('Arg git cannot be empty');
  2382. }
  2383. if (!ref && !commit) {
  2384. throw new Error('Args ref and commit cannot both be empty');
  2385. }
  2386. // No SHA? Nothing to test
  2387. if (!commit) {
  2388. return true;
  2389. }
  2390. // SHA only?
  2391. else if (!ref) {
  2392. return yield git.shaExists(commit);
  2393. }
  2394. const upperRef = ref.toUpperCase();
  2395. // refs/heads/
  2396. if (upperRef.startsWith('REFS/HEADS/')) {
  2397. const branch = ref.substring('refs/heads/'.length);
  2398. return ((yield git.branchExists(true, `origin/${branch}`)) &&
  2399. commit === (yield git.revParse(`refs/remotes/origin/${branch}`)));
  2400. }
  2401. // refs/pull/
  2402. else if (upperRef.startsWith('REFS/PULL/')) {
  2403. // Assume matches because fetched using the commit
  2404. return true;
  2405. }
  2406. // refs/tags/
  2407. else if (upperRef.startsWith('REFS/TAGS/')) {
  2408. const tagName = ref.substring('refs/tags/'.length);
  2409. // Use ^{commit} to dereference annotated tags to their underlying commit
  2410. return ((yield git.tagExists(tagName)) &&
  2411. commit === (yield git.revParse(`${ref}^{commit}`)));
  2412. }
  2413. // Unexpected
  2414. else {
  2415. core.debug(`Unexpected ref format '${ref}' when testing ref info`);
  2416. return true;
  2417. }
  2418. });
  2419. }
  2420. function checkCommitInfo(token, commitInfo, repositoryOwner, repositoryName, ref, commit, baseUrl) {
  2421. return __awaiter(this, void 0, void 0, function* () {
  2422. var _a;
  2423. try {
  2424. // GHES?
  2425. if ((0, url_helper_1.isGhes)(baseUrl)) {
  2426. return;
  2427. }
  2428. // Auth token?
  2429. if (!token) {
  2430. return;
  2431. }
  2432. // Public PR synchronize, for workflow repo?
  2433. if (fromPayload('repository.private') !== false ||
  2434. github.context.eventName !== 'pull_request' ||
  2435. fromPayload('action') !== 'synchronize' ||
  2436. repositoryOwner !== github.context.repo.owner ||
  2437. repositoryName !== github.context.repo.repo ||
  2438. ref !== github.context.ref ||
  2439. !ref.startsWith('refs/pull/') ||
  2440. commit !== github.context.sha) {
  2441. return;
  2442. }
  2443. // Head SHA
  2444. const expectedHeadSha = fromPayload('after');
  2445. if (!expectedHeadSha) {
  2446. core.debug('Unable to determine head sha');
  2447. return;
  2448. }
  2449. // Base SHA
  2450. const expectedBaseSha = fromPayload('pull_request.base.sha');
  2451. if (!expectedBaseSha) {
  2452. core.debug('Unable to determine base sha');
  2453. return;
  2454. }
  2455. // Expected message?
  2456. const expectedMessage = `Merge ${expectedHeadSha} into ${expectedBaseSha}`;
  2457. if (commitInfo.indexOf(expectedMessage) >= 0) {
  2458. return;
  2459. }
  2460. // Extract details from message
  2461. const match = commitInfo.match(/Merge ([0-9a-f]{40}|[0-9a-f]{64}) into ([0-9a-f]{40}|[0-9a-f]{64})/);
  2462. if (!match) {
  2463. core.debug('Unexpected message format');
  2464. return;
  2465. }
  2466. // Post telemetry
  2467. const actualHeadSha = match[1];
  2468. if (actualHeadSha !== expectedHeadSha) {
  2469. core.debug(`Expected head sha ${expectedHeadSha}; actual head sha ${actualHeadSha}`);
  2470. const octokit = github.getOctokit(token, {
  2471. baseUrl: (0, url_helper_1.getServerApiUrl)(baseUrl),
  2472. 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})`
  2473. });
  2474. yield octokit.rest.repos.get({
  2475. owner: repositoryOwner,
  2476. repo: repositoryName
  2477. });
  2478. }
  2479. }
  2480. catch (err) {
  2481. core.debug(`Error when validating commit info: ${(_a = err === null || err === void 0 ? void 0 : err.stack) !== null && _a !== void 0 ? _a : err}`);
  2482. }
  2483. });
  2484. }
  2485. function fromPayload(path) {
  2486. return select(github.context.payload, path);
  2487. }
  2488. function select(obj, path) {
  2489. if (!obj) {
  2490. return undefined;
  2491. }
  2492. const i = path.indexOf('.');
  2493. if (i < 0) {
  2494. return obj[path];
  2495. }
  2496. const key = path.substr(0, i);
  2497. return select(obj[key], path.substr(i + 1));
  2498. }
  2499. /***/ }),
  2500. /***/ 3120:
  2501. /***/ ((__unused_webpack_module, exports) => {
  2502. "use strict";
  2503. Object.defineProperty(exports, "__esModule", ({ value: true }));
  2504. exports.escape = escape;
  2505. function escape(value) {
  2506. return value.replace(/[^a-zA-Z0-9_]/g, x => {
  2507. return `\\${x}`;
  2508. });
  2509. }
  2510. /***/ }),
  2511. /***/ 2155:
  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. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  2538. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  2539. return new (P || (P = Promise))(function (resolve, reject) {
  2540. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  2541. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  2542. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  2543. step((generator = generator.apply(thisArg, _arguments || [])).next());
  2544. });
  2545. };
  2546. Object.defineProperty(exports, "__esModule", ({ value: true }));
  2547. exports.RetryHelper = void 0;
  2548. exports.execute = execute;
  2549. const core = __importStar(__nccwpck_require__(2186));
  2550. const defaultMaxAttempts = 3;
  2551. const defaultMinSeconds = 10;
  2552. const defaultMaxSeconds = 20;
  2553. class RetryHelper {
  2554. constructor(maxAttempts = defaultMaxAttempts, minSeconds = defaultMinSeconds, maxSeconds = defaultMaxSeconds) {
  2555. this.maxAttempts = maxAttempts;
  2556. this.minSeconds = Math.floor(minSeconds);
  2557. this.maxSeconds = Math.floor(maxSeconds);
  2558. if (this.minSeconds > this.maxSeconds) {
  2559. throw new Error('min seconds should be less than or equal to max seconds');
  2560. }
  2561. }
  2562. execute(action) {
  2563. return __awaiter(this, void 0, void 0, function* () {
  2564. let attempt = 1;
  2565. while (attempt < this.maxAttempts) {
  2566. // Try
  2567. try {
  2568. return yield action();
  2569. }
  2570. catch (err) {
  2571. core.info(err === null || err === void 0 ? void 0 : err.message);
  2572. }
  2573. // Sleep
  2574. const seconds = this.getSleepAmount();
  2575. core.info(`Waiting ${seconds} seconds before trying again`);
  2576. yield this.sleep(seconds);
  2577. attempt++;
  2578. }
  2579. // Last attempt
  2580. return yield action();
  2581. });
  2582. }
  2583. getSleepAmount() {
  2584. return (Math.floor(Math.random() * (this.maxSeconds - this.minSeconds + 1)) +
  2585. this.minSeconds);
  2586. }
  2587. sleep(seconds) {
  2588. return __awaiter(this, void 0, void 0, function* () {
  2589. return new Promise(resolve => setTimeout(resolve, seconds * 1000));
  2590. });
  2591. }
  2592. }
  2593. exports.RetryHelper = RetryHelper;
  2594. function execute(action) {
  2595. return __awaiter(this, void 0, void 0, function* () {
  2596. const retryHelper = new RetryHelper();
  2597. return yield retryHelper.execute(action);
  2598. });
  2599. }
  2600. /***/ }),
  2601. /***/ 4866:
  2602. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  2603. "use strict";
  2604. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  2605. if (k2 === undefined) k2 = k;
  2606. var desc = Object.getOwnPropertyDescriptor(m, k);
  2607. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  2608. desc = { enumerable: true, get: function() { return m[k]; } };
  2609. }
  2610. Object.defineProperty(o, k2, desc);
  2611. }) : (function(o, m, k, k2) {
  2612. if (k2 === undefined) k2 = k;
  2613. o[k2] = m[k];
  2614. }));
  2615. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  2616. Object.defineProperty(o, "default", { enumerable: true, value: v });
  2617. }) : function(o, v) {
  2618. o["default"] = v;
  2619. });
  2620. var __importStar = (this && this.__importStar) || function (mod) {
  2621. if (mod && mod.__esModule) return mod;
  2622. var result = {};
  2623. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  2624. __setModuleDefault(result, mod);
  2625. return result;
  2626. };
  2627. Object.defineProperty(exports, "__esModule", ({ value: true }));
  2628. exports.SshKnownHostsPath = exports.SshKeyPath = exports.PostSetSafeDirectory = exports.RepositoryPath = exports.IsPost = void 0;
  2629. exports.setRepositoryPath = setRepositoryPath;
  2630. exports.setSshKeyPath = setSshKeyPath;
  2631. exports.setSshKnownHostsPath = setSshKnownHostsPath;
  2632. exports.setSafeDirectory = setSafeDirectory;
  2633. const core = __importStar(__nccwpck_require__(2186));
  2634. /**
  2635. * Indicates whether the POST action is running
  2636. */
  2637. exports.IsPost = !!core.getState('isPost');
  2638. /**
  2639. * The repository path for the POST action. The value is empty during the MAIN action.
  2640. */
  2641. exports.RepositoryPath = core.getState('repositoryPath');
  2642. /**
  2643. * The set-safe-directory for the POST action. The value is set if input: 'safe-directory' is set during the MAIN action.
  2644. */
  2645. exports.PostSetSafeDirectory = core.getState('setSafeDirectory') === 'true';
  2646. /**
  2647. * The SSH key path for the POST action. The value is empty during the MAIN action.
  2648. */
  2649. exports.SshKeyPath = core.getState('sshKeyPath');
  2650. /**
  2651. * The SSH known hosts path for the POST action. The value is empty during the MAIN action.
  2652. */
  2653. exports.SshKnownHostsPath = core.getState('sshKnownHostsPath');
  2654. /**
  2655. * Save the repository path so the POST action can retrieve the value.
  2656. */
  2657. function setRepositoryPath(repositoryPath) {
  2658. core.saveState('repositoryPath', repositoryPath);
  2659. }
  2660. /**
  2661. * Save the SSH key path so the POST action can retrieve the value.
  2662. */
  2663. function setSshKeyPath(sshKeyPath) {
  2664. core.saveState('sshKeyPath', sshKeyPath);
  2665. }
  2666. /**
  2667. * Save the SSH known hosts path so the POST action can retrieve the value.
  2668. */
  2669. function setSshKnownHostsPath(sshKnownHostsPath) {
  2670. core.saveState('sshKnownHostsPath', sshKnownHostsPath);
  2671. }
  2672. /**
  2673. * Save the set-safe-directory input so the POST action can retrieve the value.
  2674. */
  2675. function setSafeDirectory() {
  2676. core.saveState('setSafeDirectory', 'true');
  2677. }
  2678. // Publish a variable so that when the POST action runs, it can determine it should run the cleanup logic.
  2679. // This is necessary since we don't have a separate entry point.
  2680. if (!exports.IsPost) {
  2681. core.saveState('isPost', 'true');
  2682. }
  2683. /***/ }),
  2684. /***/ 843:
  2685. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  2686. "use strict";
  2687. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  2688. if (k2 === undefined) k2 = k;
  2689. var desc = Object.getOwnPropertyDescriptor(m, k);
  2690. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  2691. desc = { enumerable: true, get: function() { return m[k]; } };
  2692. }
  2693. Object.defineProperty(o, k2, desc);
  2694. }) : (function(o, m, k, k2) {
  2695. if (k2 === undefined) k2 = k;
  2696. o[k2] = m[k];
  2697. }));
  2698. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  2699. Object.defineProperty(o, "default", { enumerable: true, value: v });
  2700. }) : function(o, v) {
  2701. o["default"] = v;
  2702. });
  2703. var __importStar = (this && this.__importStar) || function (mod) {
  2704. if (mod && mod.__esModule) return mod;
  2705. var result = {};
  2706. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  2707. __setModuleDefault(result, mod);
  2708. return result;
  2709. };
  2710. Object.defineProperty(exports, "__esModule", ({ value: true }));
  2711. exports.assertSafePrCheckout = assertSafePrCheckout;
  2712. const github = __importStar(__nccwpck_require__(5438));
  2713. const ref_helper_1 = __nccwpck_require__(8601);
  2714. const PR_REF_PATTERN = /^refs\/pull\/[0-9]+\/(?:head|merge)$/;
  2715. function assertSafePrCheckout(input) {
  2716. if (input.allowUnsafePrCheckout) {
  2717. return;
  2718. }
  2719. const eventName = github.context.eventName;
  2720. if (eventName !== 'pull_request_target' && eventName !== 'workflow_run') {
  2721. return;
  2722. }
  2723. const baseRepoId = (0, ref_helper_1.fromPayload)('repository.id');
  2724. if (typeof baseRepoId !== 'number') {
  2725. return;
  2726. }
  2727. let prHeadRepoId;
  2728. let prHeadRepoFullName;
  2729. const prShas = [];
  2730. if (eventName === 'pull_request_target') {
  2731. prHeadRepoId = (0, ref_helper_1.fromPayload)('pull_request.head.repo.id');
  2732. prHeadRepoFullName = (0, ref_helper_1.fromPayload)('pull_request.head.repo.full_name');
  2733. pushIfSha(prShas, (0, ref_helper_1.fromPayload)('pull_request.head.sha'));
  2734. pushIfSha(prShas, (0, ref_helper_1.fromPayload)('pull_request.merge_commit_sha'));
  2735. }
  2736. else {
  2737. const wrEvent = (0, ref_helper_1.fromPayload)('workflow_run.event');
  2738. if (typeof wrEvent !== 'string' || !wrEvent.startsWith('pull_request')) {
  2739. return;
  2740. }
  2741. prHeadRepoId = (0, ref_helper_1.fromPayload)('workflow_run.head_repository.id');
  2742. prHeadRepoFullName = (0, ref_helper_1.fromPayload)('workflow_run.head_repository.full_name');
  2743. pushIfSha(prShas, (0, ref_helper_1.fromPayload)('workflow_run.head_commit.id'));
  2744. // For `pull_request_target`-triggered workflow_run, `head_sha` is the base
  2745. // default branch SHA (not the PR head)
  2746. if (wrEvent !== 'pull_request_target') {
  2747. pushIfSha(prShas, (0, ref_helper_1.fromPayload)('workflow_run.head_sha'));
  2748. }
  2749. }
  2750. // (A) Fork PR?
  2751. if (typeof prHeadRepoId !== 'number' || prHeadRepoId === baseRepoId) {
  2752. return;
  2753. }
  2754. // (B) We cannot check for all fork PR refs so check to see
  2755. // if the resolved input points to the fork PR sha we have in the payload
  2756. const repositoryMatchesPrHead = typeof prHeadRepoFullName === 'string' &&
  2757. input.qualifiedRepository.toLowerCase() === prHeadRepoFullName.toLowerCase();
  2758. const refMatchesPullPattern = PR_REF_PATTERN.test(input.ref);
  2759. const commitMatchesPrHeadSha = !!input.commit && prShas.includes(input.commit.toLowerCase());
  2760. if (!repositoryMatchesPrHead &&
  2761. !refMatchesPullPattern &&
  2762. !commitMatchesPrHeadSha) {
  2763. return;
  2764. }
  2765. throw new Error(`Refusing to check out fork pull request code from a '${eventName}' workflow. ` +
  2766. `This workflow runs with the base repository's GITHUB_TOKEN, secrets, default-branch ` +
  2767. `cache scope, and runner access. Fetching and executing a fork's code in that trusted ` +
  2768. `context commonly leads to "pwn request" vulnerabilities. To opt in, review the risks ` +
  2769. `at https://gh.io/securely-using-pull_request_target and set 'allow-unsafe-pr-checkout: true' ` +
  2770. `on the actions/checkout step.`);
  2771. }
  2772. function pushIfSha(target, value) {
  2773. if (typeof value === 'string' && value.length > 0) {
  2774. target.push(value.toLowerCase());
  2775. }
  2776. }
  2777. /***/ }),
  2778. /***/ 9437:
  2779. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  2780. "use strict";
  2781. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  2782. if (k2 === undefined) k2 = k;
  2783. var desc = Object.getOwnPropertyDescriptor(m, k);
  2784. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  2785. desc = { enumerable: true, get: function() { return m[k]; } };
  2786. }
  2787. Object.defineProperty(o, k2, desc);
  2788. }) : (function(o, m, k, k2) {
  2789. if (k2 === undefined) k2 = k;
  2790. o[k2] = m[k];
  2791. }));
  2792. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  2793. Object.defineProperty(o, "default", { enumerable: true, value: v });
  2794. }) : function(o, v) {
  2795. o["default"] = v;
  2796. });
  2797. var __importStar = (this && this.__importStar) || function (mod) {
  2798. if (mod && mod.__esModule) return mod;
  2799. var result = {};
  2800. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  2801. __setModuleDefault(result, mod);
  2802. return result;
  2803. };
  2804. Object.defineProperty(exports, "__esModule", ({ value: true }));
  2805. exports.getFetchUrl = getFetchUrl;
  2806. exports.getServerUrl = getServerUrl;
  2807. exports.getServerApiUrl = getServerApiUrl;
  2808. exports.isGhes = isGhes;
  2809. const assert = __importStar(__nccwpck_require__(9491));
  2810. const url_1 = __nccwpck_require__(7310);
  2811. function getFetchUrl(settings) {
  2812. assert.ok(settings.repositoryOwner, 'settings.repositoryOwner must be defined');
  2813. assert.ok(settings.repositoryName, 'settings.repositoryName must be defined');
  2814. const serviceUrl = getServerUrl(settings.githubServerUrl);
  2815. const encodedOwner = encodeURIComponent(settings.repositoryOwner);
  2816. const encodedName = encodeURIComponent(settings.repositoryName);
  2817. if (settings.sshKey) {
  2818. const user = settings.sshUser.length > 0 ? settings.sshUser : 'git';
  2819. return `${user}@${serviceUrl.hostname}:${encodedOwner}/${encodedName}.git`;
  2820. }
  2821. // "origin" is SCHEME://HOSTNAME[:PORT]
  2822. return `${serviceUrl.origin}/${encodedOwner}/${encodedName}`;
  2823. }
  2824. function getServerUrl(url) {
  2825. let resolvedUrl = process.env['GITHUB_SERVER_URL'] || 'https://github.com';
  2826. if (hasContent(url, WhitespaceMode.Trim)) {
  2827. resolvedUrl = url;
  2828. }
  2829. return new url_1.URL(resolvedUrl);
  2830. }
  2831. function getServerApiUrl(url) {
  2832. if (hasContent(url, WhitespaceMode.Trim)) {
  2833. let serverUrl = getServerUrl(url);
  2834. if (isGhes(url)) {
  2835. serverUrl.pathname = 'api/v3';
  2836. }
  2837. else {
  2838. serverUrl.hostname = 'api.' + serverUrl.hostname;
  2839. }
  2840. return pruneSuffix(serverUrl.toString(), '/');
  2841. }
  2842. return process.env['GITHUB_API_URL'] || 'https://api.github.com';
  2843. }
  2844. function isGhes(url) {
  2845. const ghUrl = new url_1.URL(url || process.env['GITHUB_SERVER_URL'] || 'https://github.com');
  2846. const hostname = ghUrl.hostname.trimEnd().toUpperCase();
  2847. const isGitHubHost = hostname === 'GITHUB.COM';
  2848. const isGitHubEnterpriseCloudHost = hostname.endsWith('.GHE.COM');
  2849. const isLocalHost = hostname.endsWith('.LOCALHOST');
  2850. return !isGitHubHost && !isGitHubEnterpriseCloudHost && !isLocalHost;
  2851. }
  2852. function pruneSuffix(text, suffix) {
  2853. if (hasContent(suffix, WhitespaceMode.Preserve) && (text === null || text === void 0 ? void 0 : text.endsWith(suffix))) {
  2854. return text.substring(0, text.length - suffix.length);
  2855. }
  2856. return text;
  2857. }
  2858. var WhitespaceMode;
  2859. (function (WhitespaceMode) {
  2860. WhitespaceMode[WhitespaceMode["Trim"] = 0] = "Trim";
  2861. WhitespaceMode[WhitespaceMode["Preserve"] = 1] = "Preserve";
  2862. })(WhitespaceMode || (WhitespaceMode = {}));
  2863. function hasContent(text, whitespaceMode) {
  2864. let refinedText = text !== null && text !== void 0 ? text : '';
  2865. if (whitespaceMode == WhitespaceMode.Trim) {
  2866. refinedText = refinedText.trim();
  2867. }
  2868. return refinedText.length > 0;
  2869. }
  2870. /***/ }),
  2871. /***/ 9568:
  2872. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  2873. "use strict";
  2874. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  2875. if (k2 === undefined) k2 = k;
  2876. var desc = Object.getOwnPropertyDescriptor(m, k);
  2877. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  2878. desc = { enumerable: true, get: function() { return m[k]; } };
  2879. }
  2880. Object.defineProperty(o, k2, desc);
  2881. }) : (function(o, m, k, k2) {
  2882. if (k2 === undefined) k2 = k;
  2883. o[k2] = m[k];
  2884. }));
  2885. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  2886. Object.defineProperty(o, "default", { enumerable: true, value: v });
  2887. }) : function(o, v) {
  2888. o["default"] = v;
  2889. });
  2890. var __importStar = (this && this.__importStar) || function (mod) {
  2891. if (mod && mod.__esModule) return mod;
  2892. var result = {};
  2893. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  2894. __setModuleDefault(result, mod);
  2895. return result;
  2896. };
  2897. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  2898. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  2899. return new (P || (P = Promise))(function (resolve, reject) {
  2900. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  2901. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  2902. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  2903. step((generator = generator.apply(thisArg, _arguments || [])).next());
  2904. });
  2905. };
  2906. Object.defineProperty(exports, "__esModule", ({ value: true }));
  2907. exports.getOrganizationId = getOrganizationId;
  2908. const core = __importStar(__nccwpck_require__(2186));
  2909. const fs = __importStar(__nccwpck_require__(7147));
  2910. /**
  2911. * Gets the organization ID of the running workflow or undefined if the value cannot be loaded from the GITHUB_EVENT_PATH
  2912. */
  2913. function getOrganizationId() {
  2914. return __awaiter(this, void 0, void 0, function* () {
  2915. var _a, _b;
  2916. try {
  2917. const eventPath = process.env.GITHUB_EVENT_PATH;
  2918. if (!eventPath) {
  2919. core.debug(`GITHUB_EVENT_PATH is not defined`);
  2920. return;
  2921. }
  2922. const content = yield fs.promises.readFile(eventPath, { encoding: 'utf8' });
  2923. const event = JSON.parse(content);
  2924. 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;
  2925. if (typeof id !== 'number') {
  2926. core.debug('Repository owner ID not found within GITHUB event info');
  2927. return;
  2928. }
  2929. return id;
  2930. }
  2931. catch (err) {
  2932. core.debug(`Unable to load organization ID from GITHUB_EVENT_PATH: ${err.message || err}`);
  2933. }
  2934. });
  2935. }
  2936. /***/ }),
  2937. /***/ 7351:
  2938. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  2939. "use strict";
  2940. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  2941. if (k2 === undefined) k2 = k;
  2942. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  2943. }) : (function(o, m, k, k2) {
  2944. if (k2 === undefined) k2 = k;
  2945. o[k2] = m[k];
  2946. }));
  2947. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  2948. Object.defineProperty(o, "default", { enumerable: true, value: v });
  2949. }) : function(o, v) {
  2950. o["default"] = v;
  2951. });
  2952. var __importStar = (this && this.__importStar) || function (mod) {
  2953. if (mod && mod.__esModule) return mod;
  2954. var result = {};
  2955. if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  2956. __setModuleDefault(result, mod);
  2957. return result;
  2958. };
  2959. Object.defineProperty(exports, "__esModule", ({ value: true }));
  2960. exports.issue = exports.issueCommand = void 0;
  2961. const os = __importStar(__nccwpck_require__(2037));
  2962. const utils_1 = __nccwpck_require__(5278);
  2963. /**
  2964. * Commands
  2965. *
  2966. * Command Format:
  2967. * ::name key=value,key=value::message
  2968. *
  2969. * Examples:
  2970. * ::warning::This is the message
  2971. * ::set-env name=MY_VAR::some value
  2972. */
  2973. function issueCommand(command, properties, message) {
  2974. const cmd = new Command(command, properties, message);
  2975. process.stdout.write(cmd.toString() + os.EOL);
  2976. }
  2977. exports.issueCommand = issueCommand;
  2978. function issue(name, message = '') {
  2979. issueCommand(name, {}, message);
  2980. }
  2981. exports.issue = issue;
  2982. const CMD_STRING = '::';
  2983. class Command {
  2984. constructor(command, properties, message) {
  2985. if (!command) {
  2986. command = 'missing.command';
  2987. }
  2988. this.command = command;
  2989. this.properties = properties;
  2990. this.message = message;
  2991. }
  2992. toString() {
  2993. let cmdStr = CMD_STRING + this.command;
  2994. if (this.properties && Object.keys(this.properties).length > 0) {
  2995. cmdStr += ' ';
  2996. let first = true;
  2997. for (const key in this.properties) {
  2998. if (this.properties.hasOwnProperty(key)) {
  2999. const val = this.properties[key];
  3000. if (val) {
  3001. if (first) {
  3002. first = false;
  3003. }
  3004. else {
  3005. cmdStr += ',';
  3006. }
  3007. cmdStr += `${key}=${escapeProperty(val)}`;
  3008. }
  3009. }
  3010. }
  3011. }
  3012. cmdStr += `${CMD_STRING}${escapeData(this.message)}`;
  3013. return cmdStr;
  3014. }
  3015. }
  3016. function escapeData(s) {
  3017. return utils_1.toCommandValue(s)
  3018. .replace(/%/g, '%25')
  3019. .replace(/\r/g, '%0D')
  3020. .replace(/\n/g, '%0A');
  3021. }
  3022. function escapeProperty(s) {
  3023. return utils_1.toCommandValue(s)
  3024. .replace(/%/g, '%25')
  3025. .replace(/\r/g, '%0D')
  3026. .replace(/\n/g, '%0A')
  3027. .replace(/:/g, '%3A')
  3028. .replace(/,/g, '%2C');
  3029. }
  3030. //# sourceMappingURL=command.js.map
  3031. /***/ }),
  3032. /***/ 2186:
  3033. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  3034. "use strict";
  3035. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  3036. if (k2 === undefined) k2 = k;
  3037. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  3038. }) : (function(o, m, k, k2) {
  3039. if (k2 === undefined) k2 = k;
  3040. o[k2] = m[k];
  3041. }));
  3042. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  3043. Object.defineProperty(o, "default", { enumerable: true, value: v });
  3044. }) : function(o, v) {
  3045. o["default"] = v;
  3046. });
  3047. var __importStar = (this && this.__importStar) || function (mod) {
  3048. if (mod && mod.__esModule) return mod;
  3049. var result = {};
  3050. if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  3051. __setModuleDefault(result, mod);
  3052. return result;
  3053. };
  3054. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  3055. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  3056. return new (P || (P = Promise))(function (resolve, reject) {
  3057. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  3058. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  3059. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  3060. step((generator = generator.apply(thisArg, _arguments || [])).next());
  3061. });
  3062. };
  3063. Object.defineProperty(exports, "__esModule", ({ value: true }));
  3064. 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;
  3065. const command_1 = __nccwpck_require__(7351);
  3066. const file_command_1 = __nccwpck_require__(717);
  3067. const utils_1 = __nccwpck_require__(5278);
  3068. const os = __importStar(__nccwpck_require__(2037));
  3069. const path = __importStar(__nccwpck_require__(1017));
  3070. const oidc_utils_1 = __nccwpck_require__(8041);
  3071. /**
  3072. * The code to exit an action
  3073. */
  3074. var ExitCode;
  3075. (function (ExitCode) {
  3076. /**
  3077. * A code indicating that the action was successful
  3078. */
  3079. ExitCode[ExitCode["Success"] = 0] = "Success";
  3080. /**
  3081. * A code indicating that the action was a failure
  3082. */
  3083. ExitCode[ExitCode["Failure"] = 1] = "Failure";
  3084. })(ExitCode = exports.ExitCode || (exports.ExitCode = {}));
  3085. //-----------------------------------------------------------------------
  3086. // Variables
  3087. //-----------------------------------------------------------------------
  3088. /**
  3089. * Sets env variable for this action and future actions in the job
  3090. * @param name the name of the variable to set
  3091. * @param val the value of the variable. Non-string values will be converted to a string via JSON.stringify
  3092. */
  3093. // eslint-disable-next-line @typescript-eslint/no-explicit-any
  3094. function exportVariable(name, val) {
  3095. const convertedVal = utils_1.toCommandValue(val);
  3096. process.env[name] = convertedVal;
  3097. const filePath = process.env['GITHUB_ENV'] || '';
  3098. if (filePath) {
  3099. return file_command_1.issueFileCommand('ENV', file_command_1.prepareKeyValueMessage(name, val));
  3100. }
  3101. command_1.issueCommand('set-env', { name }, convertedVal);
  3102. }
  3103. exports.exportVariable = exportVariable;
  3104. /**
  3105. * Registers a secret which will get masked from logs
  3106. * @param secret value of the secret
  3107. */
  3108. function setSecret(secret) {
  3109. command_1.issueCommand('add-mask', {}, secret);
  3110. }
  3111. exports.setSecret = setSecret;
  3112. /**
  3113. * Prepends inputPath to the PATH (for this action and future actions)
  3114. * @param inputPath
  3115. */
  3116. function addPath(inputPath) {
  3117. const filePath = process.env['GITHUB_PATH'] || '';
  3118. if (filePath) {
  3119. file_command_1.issueFileCommand('PATH', inputPath);
  3120. }
  3121. else {
  3122. command_1.issueCommand('add-path', {}, inputPath);
  3123. }
  3124. process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`;
  3125. }
  3126. exports.addPath = addPath;
  3127. /**
  3128. * Gets the value of an input.
  3129. * Unless trimWhitespace is set to false in InputOptions, the value is also trimmed.
  3130. * Returns an empty string if the value is not defined.
  3131. *
  3132. * @param name name of the input to get
  3133. * @param options optional. See InputOptions.
  3134. * @returns string
  3135. */
  3136. function getInput(name, options) {
  3137. const val = process.env[`INPUT_${name.replace(/ /g, '_').toUpperCase()}`] || '';
  3138. if (options && options.required && !val) {
  3139. throw new Error(`Input required and not supplied: ${name}`);
  3140. }
  3141. if (options && options.trimWhitespace === false) {
  3142. return val;
  3143. }
  3144. return val.trim();
  3145. }
  3146. exports.getInput = getInput;
  3147. /**
  3148. * Gets the values of an multiline input. Each value is also trimmed.
  3149. *
  3150. * @param name name of the input to get
  3151. * @param options optional. See InputOptions.
  3152. * @returns string[]
  3153. *
  3154. */
  3155. function getMultilineInput(name, options) {
  3156. const inputs = getInput(name, options)
  3157. .split('\n')
  3158. .filter(x => x !== '');
  3159. if (options && options.trimWhitespace === false) {
  3160. return inputs;
  3161. }
  3162. return inputs.map(input => input.trim());
  3163. }
  3164. exports.getMultilineInput = getMultilineInput;
  3165. /**
  3166. * Gets the input value of the boolean type in the YAML 1.2 "core schema" specification.
  3167. * Support boolean input list: `true | True | TRUE | false | False | FALSE` .
  3168. * The return value is also in boolean type.
  3169. * ref: https://yaml.org/spec/1.2/spec.html#id2804923
  3170. *
  3171. * @param name name of the input to get
  3172. * @param options optional. See InputOptions.
  3173. * @returns boolean
  3174. */
  3175. function getBooleanInput(name, options) {
  3176. const trueValue = ['true', 'True', 'TRUE'];
  3177. const falseValue = ['false', 'False', 'FALSE'];
  3178. const val = getInput(name, options);
  3179. if (trueValue.includes(val))
  3180. return true;
  3181. if (falseValue.includes(val))
  3182. return false;
  3183. throw new TypeError(`Input does not meet YAML 1.2 "Core Schema" specification: ${name}\n` +
  3184. `Support boolean input list: \`true | True | TRUE | false | False | FALSE\``);
  3185. }
  3186. exports.getBooleanInput = getBooleanInput;
  3187. /**
  3188. * Sets the value of an output.
  3189. *
  3190. * @param name name of the output to set
  3191. * @param value value to store. Non-string values will be converted to a string via JSON.stringify
  3192. */
  3193. // eslint-disable-next-line @typescript-eslint/no-explicit-any
  3194. function setOutput(name, value) {
  3195. const filePath = process.env['GITHUB_OUTPUT'] || '';
  3196. if (filePath) {
  3197. return file_command_1.issueFileCommand('OUTPUT', file_command_1.prepareKeyValueMessage(name, value));
  3198. }
  3199. process.stdout.write(os.EOL);
  3200. command_1.issueCommand('set-output', { name }, utils_1.toCommandValue(value));
  3201. }
  3202. exports.setOutput = setOutput;
  3203. /**
  3204. * Enables or disables the echoing of commands into stdout for the rest of the step.
  3205. * Echoing is disabled by default if ACTIONS_STEP_DEBUG is not set.
  3206. *
  3207. */
  3208. function setCommandEcho(enabled) {
  3209. command_1.issue('echo', enabled ? 'on' : 'off');
  3210. }
  3211. exports.setCommandEcho = setCommandEcho;
  3212. //-----------------------------------------------------------------------
  3213. // Results
  3214. //-----------------------------------------------------------------------
  3215. /**
  3216. * Sets the action status to failed.
  3217. * When the action exits it will be with an exit code of 1
  3218. * @param message add error issue message
  3219. */
  3220. function setFailed(message) {
  3221. process.exitCode = ExitCode.Failure;
  3222. error(message);
  3223. }
  3224. exports.setFailed = setFailed;
  3225. //-----------------------------------------------------------------------
  3226. // Logging Commands
  3227. //-----------------------------------------------------------------------
  3228. /**
  3229. * Gets whether Actions Step Debug is on or not
  3230. */
  3231. function isDebug() {
  3232. return process.env['RUNNER_DEBUG'] === '1';
  3233. }
  3234. exports.isDebug = isDebug;
  3235. /**
  3236. * Writes debug message to user log
  3237. * @param message debug message
  3238. */
  3239. function debug(message) {
  3240. command_1.issueCommand('debug', {}, message);
  3241. }
  3242. exports.debug = debug;
  3243. /**
  3244. * Adds an error issue
  3245. * @param message error issue message. Errors will be converted to string via toString()
  3246. * @param properties optional properties to add to the annotation.
  3247. */
  3248. function error(message, properties = {}) {
  3249. command_1.issueCommand('error', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message);
  3250. }
  3251. exports.error = error;
  3252. /**
  3253. * Adds a warning issue
  3254. * @param message warning issue message. Errors will be converted to string via toString()
  3255. * @param properties optional properties to add to the annotation.
  3256. */
  3257. function warning(message, properties = {}) {
  3258. command_1.issueCommand('warning', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message);
  3259. }
  3260. exports.warning = warning;
  3261. /**
  3262. * Adds a notice issue
  3263. * @param message notice issue message. Errors will be converted to string via toString()
  3264. * @param properties optional properties to add to the annotation.
  3265. */
  3266. function notice(message, properties = {}) {
  3267. command_1.issueCommand('notice', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message);
  3268. }
  3269. exports.notice = notice;
  3270. /**
  3271. * Writes info to log with console.log.
  3272. * @param message info message
  3273. */
  3274. function info(message) {
  3275. process.stdout.write(message + os.EOL);
  3276. }
  3277. exports.info = info;
  3278. /**
  3279. * Begin an output group.
  3280. *
  3281. * Output until the next `groupEnd` will be foldable in this group
  3282. *
  3283. * @param name The name of the output group
  3284. */
  3285. function startGroup(name) {
  3286. command_1.issue('group', name);
  3287. }
  3288. exports.startGroup = startGroup;
  3289. /**
  3290. * End an output group.
  3291. */
  3292. function endGroup() {
  3293. command_1.issue('endgroup');
  3294. }
  3295. exports.endGroup = endGroup;
  3296. /**
  3297. * Wrap an asynchronous function call in a group.
  3298. *
  3299. * Returns the same type as the function itself.
  3300. *
  3301. * @param name The name of the group
  3302. * @param fn The function to wrap in the group
  3303. */
  3304. function group(name, fn) {
  3305. return __awaiter(this, void 0, void 0, function* () {
  3306. startGroup(name);
  3307. let result;
  3308. try {
  3309. result = yield fn();
  3310. }
  3311. finally {
  3312. endGroup();
  3313. }
  3314. return result;
  3315. });
  3316. }
  3317. exports.group = group;
  3318. //-----------------------------------------------------------------------
  3319. // Wrapper action state
  3320. //-----------------------------------------------------------------------
  3321. /**
  3322. * Saves state for current action, the state can only be retrieved by this action's post job execution.
  3323. *
  3324. * @param name name of the state to store
  3325. * @param value value to store. Non-string values will be converted to a string via JSON.stringify
  3326. */
  3327. // eslint-disable-next-line @typescript-eslint/no-explicit-any
  3328. function saveState(name, value) {
  3329. const filePath = process.env['GITHUB_STATE'] || '';
  3330. if (filePath) {
  3331. return file_command_1.issueFileCommand('STATE', file_command_1.prepareKeyValueMessage(name, value));
  3332. }
  3333. command_1.issueCommand('save-state', { name }, utils_1.toCommandValue(value));
  3334. }
  3335. exports.saveState = saveState;
  3336. /**
  3337. * Gets the value of an state set by this action's main execution.
  3338. *
  3339. * @param name name of the state to get
  3340. * @returns string
  3341. */
  3342. function getState(name) {
  3343. return process.env[`STATE_${name}`] || '';
  3344. }
  3345. exports.getState = getState;
  3346. function getIDToken(aud) {
  3347. return __awaiter(this, void 0, void 0, function* () {
  3348. return yield oidc_utils_1.OidcClient.getIDToken(aud);
  3349. });
  3350. }
  3351. exports.getIDToken = getIDToken;
  3352. /**
  3353. * Summary exports
  3354. */
  3355. var summary_1 = __nccwpck_require__(1327);
  3356. Object.defineProperty(exports, "summary", ({ enumerable: true, get: function () { return summary_1.summary; } }));
  3357. /**
  3358. * @deprecated use core.summary
  3359. */
  3360. var summary_2 = __nccwpck_require__(1327);
  3361. Object.defineProperty(exports, "markdownSummary", ({ enumerable: true, get: function () { return summary_2.markdownSummary; } }));
  3362. /**
  3363. * Path exports
  3364. */
  3365. var path_utils_1 = __nccwpck_require__(2981);
  3366. Object.defineProperty(exports, "toPosixPath", ({ enumerable: true, get: function () { return path_utils_1.toPosixPath; } }));
  3367. Object.defineProperty(exports, "toWin32Path", ({ enumerable: true, get: function () { return path_utils_1.toWin32Path; } }));
  3368. Object.defineProperty(exports, "toPlatformPath", ({ enumerable: true, get: function () { return path_utils_1.toPlatformPath; } }));
  3369. //# sourceMappingURL=core.js.map
  3370. /***/ }),
  3371. /***/ 717:
  3372. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  3373. "use strict";
  3374. // For internal use, subject to change.
  3375. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  3376. if (k2 === undefined) k2 = k;
  3377. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  3378. }) : (function(o, m, k, k2) {
  3379. if (k2 === undefined) k2 = k;
  3380. o[k2] = m[k];
  3381. }));
  3382. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  3383. Object.defineProperty(o, "default", { enumerable: true, value: v });
  3384. }) : function(o, v) {
  3385. o["default"] = v;
  3386. });
  3387. var __importStar = (this && this.__importStar) || function (mod) {
  3388. if (mod && mod.__esModule) return mod;
  3389. var result = {};
  3390. if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  3391. __setModuleDefault(result, mod);
  3392. return result;
  3393. };
  3394. Object.defineProperty(exports, "__esModule", ({ value: true }));
  3395. exports.prepareKeyValueMessage = exports.issueFileCommand = void 0;
  3396. // We use any as a valid input type
  3397. /* eslint-disable @typescript-eslint/no-explicit-any */
  3398. const fs = __importStar(__nccwpck_require__(7147));
  3399. const os = __importStar(__nccwpck_require__(2037));
  3400. const uuid_1 = __nccwpck_require__(8974);
  3401. const utils_1 = __nccwpck_require__(5278);
  3402. function issueFileCommand(command, message) {
  3403. const filePath = process.env[`GITHUB_${command}`];
  3404. if (!filePath) {
  3405. throw new Error(`Unable to find environment variable for file command ${command}`);
  3406. }
  3407. if (!fs.existsSync(filePath)) {
  3408. throw new Error(`Missing file at path: ${filePath}`);
  3409. }
  3410. fs.appendFileSync(filePath, `${utils_1.toCommandValue(message)}${os.EOL}`, {
  3411. encoding: 'utf8'
  3412. });
  3413. }
  3414. exports.issueFileCommand = issueFileCommand;
  3415. function prepareKeyValueMessage(key, value) {
  3416. const delimiter = `ghadelimiter_${uuid_1.v4()}`;
  3417. const convertedValue = utils_1.toCommandValue(value);
  3418. // These should realistically never happen, but just in case someone finds a
  3419. // way to exploit uuid generation let's not allow keys or values that contain
  3420. // the delimiter.
  3421. if (key.includes(delimiter)) {
  3422. throw new Error(`Unexpected input: name should not contain the delimiter "${delimiter}"`);
  3423. }
  3424. if (convertedValue.includes(delimiter)) {
  3425. throw new Error(`Unexpected input: value should not contain the delimiter "${delimiter}"`);
  3426. }
  3427. return `${key}<<${delimiter}${os.EOL}${convertedValue}${os.EOL}${delimiter}`;
  3428. }
  3429. exports.prepareKeyValueMessage = prepareKeyValueMessage;
  3430. //# sourceMappingURL=file-command.js.map
  3431. /***/ }),
  3432. /***/ 8041:
  3433. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  3434. "use strict";
  3435. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  3436. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  3437. return new (P || (P = Promise))(function (resolve, reject) {
  3438. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  3439. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  3440. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  3441. step((generator = generator.apply(thisArg, _arguments || [])).next());
  3442. });
  3443. };
  3444. Object.defineProperty(exports, "__esModule", ({ value: true }));
  3445. exports.OidcClient = void 0;
  3446. const http_client_1 = __nccwpck_require__(6255);
  3447. const auth_1 = __nccwpck_require__(5526);
  3448. const core_1 = __nccwpck_require__(2186);
  3449. class OidcClient {
  3450. static createHttpClient(allowRetry = true, maxRetry = 10) {
  3451. const requestOptions = {
  3452. allowRetries: allowRetry,
  3453. maxRetries: maxRetry
  3454. };
  3455. return new http_client_1.HttpClient('actions/oidc-client', [new auth_1.BearerCredentialHandler(OidcClient.getRequestToken())], requestOptions);
  3456. }
  3457. static getRequestToken() {
  3458. const token = process.env['ACTIONS_ID_TOKEN_REQUEST_TOKEN'];
  3459. if (!token) {
  3460. throw new Error('Unable to get ACTIONS_ID_TOKEN_REQUEST_TOKEN env variable');
  3461. }
  3462. return token;
  3463. }
  3464. static getIDTokenUrl() {
  3465. const runtimeUrl = process.env['ACTIONS_ID_TOKEN_REQUEST_URL'];
  3466. if (!runtimeUrl) {
  3467. throw new Error('Unable to get ACTIONS_ID_TOKEN_REQUEST_URL env variable');
  3468. }
  3469. return runtimeUrl;
  3470. }
  3471. static getCall(id_token_url) {
  3472. var _a;
  3473. return __awaiter(this, void 0, void 0, function* () {
  3474. const httpclient = OidcClient.createHttpClient();
  3475. const res = yield httpclient
  3476. .getJson(id_token_url)
  3477. .catch(error => {
  3478. throw new Error(`Failed to get ID Token. \n
  3479. Error Code : ${error.statusCode}\n
  3480. Error Message: ${error.message}`);
  3481. });
  3482. const id_token = (_a = res.result) === null || _a === void 0 ? void 0 : _a.value;
  3483. if (!id_token) {
  3484. throw new Error('Response json body do not have ID Token field');
  3485. }
  3486. return id_token;
  3487. });
  3488. }
  3489. static getIDToken(audience) {
  3490. return __awaiter(this, void 0, void 0, function* () {
  3491. try {
  3492. // New ID Token is requested from action service
  3493. let id_token_url = OidcClient.getIDTokenUrl();
  3494. if (audience) {
  3495. const encodedAudience = encodeURIComponent(audience);
  3496. id_token_url = `${id_token_url}&audience=${encodedAudience}`;
  3497. }
  3498. core_1.debug(`ID token url is ${id_token_url}`);
  3499. const id_token = yield OidcClient.getCall(id_token_url);
  3500. core_1.setSecret(id_token);
  3501. return id_token;
  3502. }
  3503. catch (error) {
  3504. throw new Error(`Error message: ${error.message}`);
  3505. }
  3506. });
  3507. }
  3508. }
  3509. exports.OidcClient = OidcClient;
  3510. //# sourceMappingURL=oidc-utils.js.map
  3511. /***/ }),
  3512. /***/ 2981:
  3513. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  3514. "use strict";
  3515. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  3516. if (k2 === undefined) k2 = k;
  3517. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  3518. }) : (function(o, m, k, k2) {
  3519. if (k2 === undefined) k2 = k;
  3520. o[k2] = m[k];
  3521. }));
  3522. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  3523. Object.defineProperty(o, "default", { enumerable: true, value: v });
  3524. }) : function(o, v) {
  3525. o["default"] = v;
  3526. });
  3527. var __importStar = (this && this.__importStar) || function (mod) {
  3528. if (mod && mod.__esModule) return mod;
  3529. var result = {};
  3530. if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  3531. __setModuleDefault(result, mod);
  3532. return result;
  3533. };
  3534. Object.defineProperty(exports, "__esModule", ({ value: true }));
  3535. exports.toPlatformPath = exports.toWin32Path = exports.toPosixPath = void 0;
  3536. const path = __importStar(__nccwpck_require__(1017));
  3537. /**
  3538. * toPosixPath converts the given path to the posix form. On Windows, \\ will be
  3539. * replaced with /.
  3540. *
  3541. * @param pth. Path to transform.
  3542. * @return string Posix path.
  3543. */
  3544. function toPosixPath(pth) {
  3545. return pth.replace(/[\\]/g, '/');
  3546. }
  3547. exports.toPosixPath = toPosixPath;
  3548. /**
  3549. * toWin32Path converts the given path to the win32 form. On Linux, / will be
  3550. * replaced with \\.
  3551. *
  3552. * @param pth. Path to transform.
  3553. * @return string Win32 path.
  3554. */
  3555. function toWin32Path(pth) {
  3556. return pth.replace(/[/]/g, '\\');
  3557. }
  3558. exports.toWin32Path = toWin32Path;
  3559. /**
  3560. * toPlatformPath converts the given path to a platform-specific path. It does
  3561. * this by replacing instances of / and \ with the platform-specific path
  3562. * separator.
  3563. *
  3564. * @param pth The path to platformize.
  3565. * @return string The platform-specific path.
  3566. */
  3567. function toPlatformPath(pth) {
  3568. return pth.replace(/[/\\]/g, path.sep);
  3569. }
  3570. exports.toPlatformPath = toPlatformPath;
  3571. //# sourceMappingURL=path-utils.js.map
  3572. /***/ }),
  3573. /***/ 1327:
  3574. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  3575. "use strict";
  3576. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  3577. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  3578. return new (P || (P = Promise))(function (resolve, reject) {
  3579. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  3580. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  3581. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  3582. step((generator = generator.apply(thisArg, _arguments || [])).next());
  3583. });
  3584. };
  3585. Object.defineProperty(exports, "__esModule", ({ value: true }));
  3586. exports.summary = exports.markdownSummary = exports.SUMMARY_DOCS_URL = exports.SUMMARY_ENV_VAR = void 0;
  3587. const os_1 = __nccwpck_require__(2037);
  3588. const fs_1 = __nccwpck_require__(7147);
  3589. const { access, appendFile, writeFile } = fs_1.promises;
  3590. exports.SUMMARY_ENV_VAR = 'GITHUB_STEP_SUMMARY';
  3591. exports.SUMMARY_DOCS_URL = 'https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#adding-a-job-summary';
  3592. class Summary {
  3593. constructor() {
  3594. this._buffer = '';
  3595. }
  3596. /**
  3597. * Finds the summary file path from the environment, rejects if env var is not found or file does not exist
  3598. * Also checks r/w permissions.
  3599. *
  3600. * @returns step summary file path
  3601. */
  3602. filePath() {
  3603. return __awaiter(this, void 0, void 0, function* () {
  3604. if (this._filePath) {
  3605. return this._filePath;
  3606. }
  3607. const pathFromEnv = process.env[exports.SUMMARY_ENV_VAR];
  3608. if (!pathFromEnv) {
  3609. throw new Error(`Unable to find environment variable for $${exports.SUMMARY_ENV_VAR}. Check if your runtime environment supports job summaries.`);
  3610. }
  3611. try {
  3612. yield access(pathFromEnv, fs_1.constants.R_OK | fs_1.constants.W_OK);
  3613. }
  3614. catch (_a) {
  3615. throw new Error(`Unable to access summary file: '${pathFromEnv}'. Check if the file has correct read/write permissions.`);
  3616. }
  3617. this._filePath = pathFromEnv;
  3618. return this._filePath;
  3619. });
  3620. }
  3621. /**
  3622. * Wraps content in an HTML tag, adding any HTML attributes
  3623. *
  3624. * @param {string} tag HTML tag to wrap
  3625. * @param {string | null} content content within the tag
  3626. * @param {[attribute: string]: string} attrs key-value list of HTML attributes to add
  3627. *
  3628. * @returns {string} content wrapped in HTML element
  3629. */
  3630. wrap(tag, content, attrs = {}) {
  3631. const htmlAttrs = Object.entries(attrs)
  3632. .map(([key, value]) => ` ${key}="${value}"`)
  3633. .join('');
  3634. if (!content) {
  3635. return `<${tag}${htmlAttrs}>`;
  3636. }
  3637. return `<${tag}${htmlAttrs}>${content}</${tag}>`;
  3638. }
  3639. /**
  3640. * Writes text in the buffer to the summary buffer file and empties buffer. Will append by default.
  3641. *
  3642. * @param {SummaryWriteOptions} [options] (optional) options for write operation
  3643. *
  3644. * @returns {Promise<Summary>} summary instance
  3645. */
  3646. write(options) {
  3647. return __awaiter(this, void 0, void 0, function* () {
  3648. const overwrite = !!(options === null || options === void 0 ? void 0 : options.overwrite);
  3649. const filePath = yield this.filePath();
  3650. const writeFunc = overwrite ? writeFile : appendFile;
  3651. yield writeFunc(filePath, this._buffer, { encoding: 'utf8' });
  3652. return this.emptyBuffer();
  3653. });
  3654. }
  3655. /**
  3656. * Clears the summary buffer and wipes the summary file
  3657. *
  3658. * @returns {Summary} summary instance
  3659. */
  3660. clear() {
  3661. return __awaiter(this, void 0, void 0, function* () {
  3662. return this.emptyBuffer().write({ overwrite: true });
  3663. });
  3664. }
  3665. /**
  3666. * Returns the current summary buffer as a string
  3667. *
  3668. * @returns {string} string of summary buffer
  3669. */
  3670. stringify() {
  3671. return this._buffer;
  3672. }
  3673. /**
  3674. * If the summary buffer is empty
  3675. *
  3676. * @returns {boolen} true if the buffer is empty
  3677. */
  3678. isEmptyBuffer() {
  3679. return this._buffer.length === 0;
  3680. }
  3681. /**
  3682. * Resets the summary buffer without writing to summary file
  3683. *
  3684. * @returns {Summary} summary instance
  3685. */
  3686. emptyBuffer() {
  3687. this._buffer = '';
  3688. return this;
  3689. }
  3690. /**
  3691. * Adds raw text to the summary buffer
  3692. *
  3693. * @param {string} text content to add
  3694. * @param {boolean} [addEOL=false] (optional) append an EOL to the raw text (default: false)
  3695. *
  3696. * @returns {Summary} summary instance
  3697. */
  3698. addRaw(text, addEOL = false) {
  3699. this._buffer += text;
  3700. return addEOL ? this.addEOL() : this;
  3701. }
  3702. /**
  3703. * Adds the operating system-specific end-of-line marker to the buffer
  3704. *
  3705. * @returns {Summary} summary instance
  3706. */
  3707. addEOL() {
  3708. return this.addRaw(os_1.EOL);
  3709. }
  3710. /**
  3711. * Adds an HTML codeblock to the summary buffer
  3712. *
  3713. * @param {string} code content to render within fenced code block
  3714. * @param {string} lang (optional) language to syntax highlight code
  3715. *
  3716. * @returns {Summary} summary instance
  3717. */
  3718. addCodeBlock(code, lang) {
  3719. const attrs = Object.assign({}, (lang && { lang }));
  3720. const element = this.wrap('pre', this.wrap('code', code), attrs);
  3721. return this.addRaw(element).addEOL();
  3722. }
  3723. /**
  3724. * Adds an HTML list to the summary buffer
  3725. *
  3726. * @param {string[]} items list of items to render
  3727. * @param {boolean} [ordered=false] (optional) if the rendered list should be ordered or not (default: false)
  3728. *
  3729. * @returns {Summary} summary instance
  3730. */
  3731. addList(items, ordered = false) {
  3732. const tag = ordered ? 'ol' : 'ul';
  3733. const listItems = items.map(item => this.wrap('li', item)).join('');
  3734. const element = this.wrap(tag, listItems);
  3735. return this.addRaw(element).addEOL();
  3736. }
  3737. /**
  3738. * Adds an HTML table to the summary buffer
  3739. *
  3740. * @param {SummaryTableCell[]} rows table rows
  3741. *
  3742. * @returns {Summary} summary instance
  3743. */
  3744. addTable(rows) {
  3745. const tableBody = rows
  3746. .map(row => {
  3747. const cells = row
  3748. .map(cell => {
  3749. if (typeof cell === 'string') {
  3750. return this.wrap('td', cell);
  3751. }
  3752. const { header, data, colspan, rowspan } = cell;
  3753. const tag = header ? 'th' : 'td';
  3754. const attrs = Object.assign(Object.assign({}, (colspan && { colspan })), (rowspan && { rowspan }));
  3755. return this.wrap(tag, data, attrs);
  3756. })
  3757. .join('');
  3758. return this.wrap('tr', cells);
  3759. })
  3760. .join('');
  3761. const element = this.wrap('table', tableBody);
  3762. return this.addRaw(element).addEOL();
  3763. }
  3764. /**
  3765. * Adds a collapsable HTML details element to the summary buffer
  3766. *
  3767. * @param {string} label text for the closed state
  3768. * @param {string} content collapsable content
  3769. *
  3770. * @returns {Summary} summary instance
  3771. */
  3772. addDetails(label, content) {
  3773. const element = this.wrap('details', this.wrap('summary', label) + content);
  3774. return this.addRaw(element).addEOL();
  3775. }
  3776. /**
  3777. * Adds an HTML image tag to the summary buffer
  3778. *
  3779. * @param {string} src path to the image you to embed
  3780. * @param {string} alt text description of the image
  3781. * @param {SummaryImageOptions} options (optional) addition image attributes
  3782. *
  3783. * @returns {Summary} summary instance
  3784. */
  3785. addImage(src, alt, options) {
  3786. const { width, height } = options || {};
  3787. const attrs = Object.assign(Object.assign({}, (width && { width })), (height && { height }));
  3788. const element = this.wrap('img', null, Object.assign({ src, alt }, attrs));
  3789. return this.addRaw(element).addEOL();
  3790. }
  3791. /**
  3792. * Adds an HTML section heading element
  3793. *
  3794. * @param {string} text heading text
  3795. * @param {number | string} [level=1] (optional) the heading level, default: 1
  3796. *
  3797. * @returns {Summary} summary instance
  3798. */
  3799. addHeading(text, level) {
  3800. const tag = `h${level}`;
  3801. const allowedTag = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'].includes(tag)
  3802. ? tag
  3803. : 'h1';
  3804. const element = this.wrap(allowedTag, text);
  3805. return this.addRaw(element).addEOL();
  3806. }
  3807. /**
  3808. * Adds an HTML thematic break (<hr>) to the summary buffer
  3809. *
  3810. * @returns {Summary} summary instance
  3811. */
  3812. addSeparator() {
  3813. const element = this.wrap('hr', null);
  3814. return this.addRaw(element).addEOL();
  3815. }
  3816. /**
  3817. * Adds an HTML line break (<br>) to the summary buffer
  3818. *
  3819. * @returns {Summary} summary instance
  3820. */
  3821. addBreak() {
  3822. const element = this.wrap('br', null);
  3823. return this.addRaw(element).addEOL();
  3824. }
  3825. /**
  3826. * Adds an HTML blockquote to the summary buffer
  3827. *
  3828. * @param {string} text quote text
  3829. * @param {string} cite (optional) citation url
  3830. *
  3831. * @returns {Summary} summary instance
  3832. */
  3833. addQuote(text, cite) {
  3834. const attrs = Object.assign({}, (cite && { cite }));
  3835. const element = this.wrap('blockquote', text, attrs);
  3836. return this.addRaw(element).addEOL();
  3837. }
  3838. /**
  3839. * Adds an HTML anchor tag to the summary buffer
  3840. *
  3841. * @param {string} text link text/content
  3842. * @param {string} href hyperlink
  3843. *
  3844. * @returns {Summary} summary instance
  3845. */
  3846. addLink(text, href) {
  3847. const element = this.wrap('a', text, { href });
  3848. return this.addRaw(element).addEOL();
  3849. }
  3850. }
  3851. const _summary = new Summary();
  3852. /**
  3853. * @deprecated use `core.summary`
  3854. */
  3855. exports.markdownSummary = _summary;
  3856. exports.summary = _summary;
  3857. //# sourceMappingURL=summary.js.map
  3858. /***/ }),
  3859. /***/ 5278:
  3860. /***/ ((__unused_webpack_module, exports) => {
  3861. "use strict";
  3862. // We use any as a valid input type
  3863. /* eslint-disable @typescript-eslint/no-explicit-any */
  3864. Object.defineProperty(exports, "__esModule", ({ value: true }));
  3865. exports.toCommandProperties = exports.toCommandValue = void 0;
  3866. /**
  3867. * Sanitizes an input into a string so it can be passed into issueCommand safely
  3868. * @param input input to sanitize into a string
  3869. */
  3870. function toCommandValue(input) {
  3871. if (input === null || input === undefined) {
  3872. return '';
  3873. }
  3874. else if (typeof input === 'string' || input instanceof String) {
  3875. return input;
  3876. }
  3877. return JSON.stringify(input);
  3878. }
  3879. exports.toCommandValue = toCommandValue;
  3880. /**
  3881. *
  3882. * @param annotationProperties
  3883. * @returns The command properties to send with the actual annotation command
  3884. * See IssueCommandProperties: https://github.com/actions/runner/blob/main/src/Runner.Worker/ActionCommandManager.cs#L646
  3885. */
  3886. function toCommandProperties(annotationProperties) {
  3887. if (!Object.keys(annotationProperties).length) {
  3888. return {};
  3889. }
  3890. return {
  3891. title: annotationProperties.title,
  3892. file: annotationProperties.file,
  3893. line: annotationProperties.startLine,
  3894. endLine: annotationProperties.endLine,
  3895. col: annotationProperties.startColumn,
  3896. endColumn: annotationProperties.endColumn
  3897. };
  3898. }
  3899. exports.toCommandProperties = toCommandProperties;
  3900. //# sourceMappingURL=utils.js.map
  3901. /***/ }),
  3902. /***/ 8974:
  3903. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  3904. "use strict";
  3905. Object.defineProperty(exports, "__esModule", ({
  3906. value: true
  3907. }));
  3908. Object.defineProperty(exports, "v1", ({
  3909. enumerable: true,
  3910. get: function () {
  3911. return _v.default;
  3912. }
  3913. }));
  3914. Object.defineProperty(exports, "v3", ({
  3915. enumerable: true,
  3916. get: function () {
  3917. return _v2.default;
  3918. }
  3919. }));
  3920. Object.defineProperty(exports, "v4", ({
  3921. enumerable: true,
  3922. get: function () {
  3923. return _v3.default;
  3924. }
  3925. }));
  3926. Object.defineProperty(exports, "v5", ({
  3927. enumerable: true,
  3928. get: function () {
  3929. return _v4.default;
  3930. }
  3931. }));
  3932. Object.defineProperty(exports, "NIL", ({
  3933. enumerable: true,
  3934. get: function () {
  3935. return _nil.default;
  3936. }
  3937. }));
  3938. Object.defineProperty(exports, "version", ({
  3939. enumerable: true,
  3940. get: function () {
  3941. return _version.default;
  3942. }
  3943. }));
  3944. Object.defineProperty(exports, "validate", ({
  3945. enumerable: true,
  3946. get: function () {
  3947. return _validate.default;
  3948. }
  3949. }));
  3950. Object.defineProperty(exports, "stringify", ({
  3951. enumerable: true,
  3952. get: function () {
  3953. return _stringify.default;
  3954. }
  3955. }));
  3956. Object.defineProperty(exports, "parse", ({
  3957. enumerable: true,
  3958. get: function () {
  3959. return _parse.default;
  3960. }
  3961. }));
  3962. var _v = _interopRequireDefault(__nccwpck_require__(1595));
  3963. var _v2 = _interopRequireDefault(__nccwpck_require__(6993));
  3964. var _v3 = _interopRequireDefault(__nccwpck_require__(1472));
  3965. var _v4 = _interopRequireDefault(__nccwpck_require__(6217));
  3966. var _nil = _interopRequireDefault(__nccwpck_require__(2381));
  3967. var _version = _interopRequireDefault(__nccwpck_require__(427));
  3968. var _validate = _interopRequireDefault(__nccwpck_require__(2609));
  3969. var _stringify = _interopRequireDefault(__nccwpck_require__(1458));
  3970. var _parse = _interopRequireDefault(__nccwpck_require__(6385));
  3971. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  3972. /***/ }),
  3973. /***/ 5842:
  3974. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  3975. "use strict";
  3976. Object.defineProperty(exports, "__esModule", ({
  3977. value: true
  3978. }));
  3979. exports["default"] = void 0;
  3980. var _crypto = _interopRequireDefault(__nccwpck_require__(6113));
  3981. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  3982. function md5(bytes) {
  3983. if (Array.isArray(bytes)) {
  3984. bytes = Buffer.from(bytes);
  3985. } else if (typeof bytes === 'string') {
  3986. bytes = Buffer.from(bytes, 'utf8');
  3987. }
  3988. return _crypto.default.createHash('md5').update(bytes).digest();
  3989. }
  3990. var _default = md5;
  3991. exports["default"] = _default;
  3992. /***/ }),
  3993. /***/ 2381:
  3994. /***/ ((__unused_webpack_module, exports) => {
  3995. "use strict";
  3996. Object.defineProperty(exports, "__esModule", ({
  3997. value: true
  3998. }));
  3999. exports["default"] = void 0;
  4000. var _default = '00000000-0000-0000-0000-000000000000';
  4001. exports["default"] = _default;
  4002. /***/ }),
  4003. /***/ 6385:
  4004. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  4005. "use strict";
  4006. Object.defineProperty(exports, "__esModule", ({
  4007. value: true
  4008. }));
  4009. exports["default"] = void 0;
  4010. var _validate = _interopRequireDefault(__nccwpck_require__(2609));
  4011. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  4012. function parse(uuid) {
  4013. if (!(0, _validate.default)(uuid)) {
  4014. throw TypeError('Invalid UUID');
  4015. }
  4016. let v;
  4017. const arr = new Uint8Array(16); // Parse ########-....-....-....-............
  4018. arr[0] = (v = parseInt(uuid.slice(0, 8), 16)) >>> 24;
  4019. arr[1] = v >>> 16 & 0xff;
  4020. arr[2] = v >>> 8 & 0xff;
  4021. arr[3] = v & 0xff; // Parse ........-####-....-....-............
  4022. arr[4] = (v = parseInt(uuid.slice(9, 13), 16)) >>> 8;
  4023. arr[5] = v & 0xff; // Parse ........-....-####-....-............
  4024. arr[6] = (v = parseInt(uuid.slice(14, 18), 16)) >>> 8;
  4025. arr[7] = v & 0xff; // Parse ........-....-....-####-............
  4026. arr[8] = (v = parseInt(uuid.slice(19, 23), 16)) >>> 8;
  4027. arr[9] = v & 0xff; // Parse ........-....-....-....-############
  4028. // (Use "/" to avoid 32-bit truncation when bit-shifting high-order bytes)
  4029. arr[10] = (v = parseInt(uuid.slice(24, 36), 16)) / 0x10000000000 & 0xff;
  4030. arr[11] = v / 0x100000000 & 0xff;
  4031. arr[12] = v >>> 24 & 0xff;
  4032. arr[13] = v >>> 16 & 0xff;
  4033. arr[14] = v >>> 8 & 0xff;
  4034. arr[15] = v & 0xff;
  4035. return arr;
  4036. }
  4037. var _default = parse;
  4038. exports["default"] = _default;
  4039. /***/ }),
  4040. /***/ 6230:
  4041. /***/ ((__unused_webpack_module, exports) => {
  4042. "use strict";
  4043. Object.defineProperty(exports, "__esModule", ({
  4044. value: true
  4045. }));
  4046. exports["default"] = void 0;
  4047. 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;
  4048. exports["default"] = _default;
  4049. /***/ }),
  4050. /***/ 9784:
  4051. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  4052. "use strict";
  4053. Object.defineProperty(exports, "__esModule", ({
  4054. value: true
  4055. }));
  4056. exports["default"] = rng;
  4057. var _crypto = _interopRequireDefault(__nccwpck_require__(6113));
  4058. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  4059. const rnds8Pool = new Uint8Array(256); // # of random values to pre-allocate
  4060. let poolPtr = rnds8Pool.length;
  4061. function rng() {
  4062. if (poolPtr > rnds8Pool.length - 16) {
  4063. _crypto.default.randomFillSync(rnds8Pool);
  4064. poolPtr = 0;
  4065. }
  4066. return rnds8Pool.slice(poolPtr, poolPtr += 16);
  4067. }
  4068. /***/ }),
  4069. /***/ 8844:
  4070. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  4071. "use strict";
  4072. Object.defineProperty(exports, "__esModule", ({
  4073. value: true
  4074. }));
  4075. exports["default"] = void 0;
  4076. var _crypto = _interopRequireDefault(__nccwpck_require__(6113));
  4077. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  4078. function sha1(bytes) {
  4079. if (Array.isArray(bytes)) {
  4080. bytes = Buffer.from(bytes);
  4081. } else if (typeof bytes === 'string') {
  4082. bytes = Buffer.from(bytes, 'utf8');
  4083. }
  4084. return _crypto.default.createHash('sha1').update(bytes).digest();
  4085. }
  4086. var _default = sha1;
  4087. exports["default"] = _default;
  4088. /***/ }),
  4089. /***/ 1458:
  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 _validate = _interopRequireDefault(__nccwpck_require__(2609));
  4097. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  4098. /**
  4099. * Convert array of 16 byte values to UUID string format of the form:
  4100. * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
  4101. */
  4102. const byteToHex = [];
  4103. for (let i = 0; i < 256; ++i) {
  4104. byteToHex.push((i + 0x100).toString(16).substr(1));
  4105. }
  4106. function stringify(arr, offset = 0) {
  4107. // Note: Be careful editing this code! It's been tuned for performance
  4108. // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
  4109. 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
  4110. // of the following:
  4111. // - One or more input array values don't map to a hex octet (leading to
  4112. // "undefined" in the uuid)
  4113. // - Invalid input values for the RFC `version` or `variant` fields
  4114. if (!(0, _validate.default)(uuid)) {
  4115. throw TypeError('Stringified UUID is invalid');
  4116. }
  4117. return uuid;
  4118. }
  4119. var _default = stringify;
  4120. exports["default"] = _default;
  4121. /***/ }),
  4122. /***/ 1595:
  4123. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  4124. "use strict";
  4125. Object.defineProperty(exports, "__esModule", ({
  4126. value: true
  4127. }));
  4128. exports["default"] = void 0;
  4129. var _rng = _interopRequireDefault(__nccwpck_require__(9784));
  4130. var _stringify = _interopRequireDefault(__nccwpck_require__(1458));
  4131. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  4132. // **`v1()` - Generate time-based UUID**
  4133. //
  4134. // Inspired by https://github.com/LiosK/UUID.js
  4135. // and http://docs.python.org/library/uuid.html
  4136. let _nodeId;
  4137. let _clockseq; // Previous uuid creation time
  4138. let _lastMSecs = 0;
  4139. let _lastNSecs = 0; // See https://github.com/uuidjs/uuid for API details
  4140. function v1(options, buf, offset) {
  4141. let i = buf && offset || 0;
  4142. const b = buf || new Array(16);
  4143. options = options || {};
  4144. let node = options.node || _nodeId;
  4145. let clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq; // node and clockseq need to be initialized to random values if they're not
  4146. // specified. We do this lazily to minimize issues related to insufficient
  4147. // system entropy. See #189
  4148. if (node == null || clockseq == null) {
  4149. const seedBytes = options.random || (options.rng || _rng.default)();
  4150. if (node == null) {
  4151. // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1)
  4152. node = _nodeId = [seedBytes[0] | 0x01, seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]];
  4153. }
  4154. if (clockseq == null) {
  4155. // Per 4.2.2, randomize (14 bit) clockseq
  4156. clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff;
  4157. }
  4158. } // UUID timestamps are 100 nano-second units since the Gregorian epoch,
  4159. // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so
  4160. // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs'
  4161. // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00.
  4162. let msecs = options.msecs !== undefined ? options.msecs : Date.now(); // Per 4.2.1.2, use count of uuid's generated during the current clock
  4163. // cycle to simulate higher resolution clock
  4164. let nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1; // Time since last uuid creation (in msecs)
  4165. const dt = msecs - _lastMSecs + (nsecs - _lastNSecs) / 10000; // Per 4.2.1.2, Bump clockseq on clock regression
  4166. if (dt < 0 && options.clockseq === undefined) {
  4167. clockseq = clockseq + 1 & 0x3fff;
  4168. } // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new
  4169. // time interval
  4170. if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) {
  4171. nsecs = 0;
  4172. } // Per 4.2.1.2 Throw error if too many uuids are requested
  4173. if (nsecs >= 10000) {
  4174. throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");
  4175. }
  4176. _lastMSecs = msecs;
  4177. _lastNSecs = nsecs;
  4178. _clockseq = clockseq; // Per 4.1.4 - Convert from unix epoch to Gregorian epoch
  4179. msecs += 12219292800000; // `time_low`
  4180. const tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000;
  4181. b[i++] = tl >>> 24 & 0xff;
  4182. b[i++] = tl >>> 16 & 0xff;
  4183. b[i++] = tl >>> 8 & 0xff;
  4184. b[i++] = tl & 0xff; // `time_mid`
  4185. const tmh = msecs / 0x100000000 * 10000 & 0xfffffff;
  4186. b[i++] = tmh >>> 8 & 0xff;
  4187. b[i++] = tmh & 0xff; // `time_high_and_version`
  4188. b[i++] = tmh >>> 24 & 0xf | 0x10; // include version
  4189. b[i++] = tmh >>> 16 & 0xff; // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant)
  4190. b[i++] = clockseq >>> 8 | 0x80; // `clock_seq_low`
  4191. b[i++] = clockseq & 0xff; // `node`
  4192. for (let n = 0; n < 6; ++n) {
  4193. b[i + n] = node[n];
  4194. }
  4195. return buf || (0, _stringify.default)(b);
  4196. }
  4197. var _default = v1;
  4198. exports["default"] = _default;
  4199. /***/ }),
  4200. /***/ 6993:
  4201. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  4202. "use strict";
  4203. Object.defineProperty(exports, "__esModule", ({
  4204. value: true
  4205. }));
  4206. exports["default"] = void 0;
  4207. var _v = _interopRequireDefault(__nccwpck_require__(5920));
  4208. var _md = _interopRequireDefault(__nccwpck_require__(5842));
  4209. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  4210. const v3 = (0, _v.default)('v3', 0x30, _md.default);
  4211. var _default = v3;
  4212. exports["default"] = _default;
  4213. /***/ }),
  4214. /***/ 5920:
  4215. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  4216. "use strict";
  4217. Object.defineProperty(exports, "__esModule", ({
  4218. value: true
  4219. }));
  4220. exports["default"] = _default;
  4221. exports.URL = exports.DNS = void 0;
  4222. var _stringify = _interopRequireDefault(__nccwpck_require__(1458));
  4223. var _parse = _interopRequireDefault(__nccwpck_require__(6385));
  4224. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  4225. function stringToBytes(str) {
  4226. str = unescape(encodeURIComponent(str)); // UTF8 escape
  4227. const bytes = [];
  4228. for (let i = 0; i < str.length; ++i) {
  4229. bytes.push(str.charCodeAt(i));
  4230. }
  4231. return bytes;
  4232. }
  4233. const DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8';
  4234. exports.DNS = DNS;
  4235. const URL = '6ba7b811-9dad-11d1-80b4-00c04fd430c8';
  4236. exports.URL = URL;
  4237. function _default(name, version, hashfunc) {
  4238. function generateUUID(value, namespace, buf, offset) {
  4239. if (typeof value === 'string') {
  4240. value = stringToBytes(value);
  4241. }
  4242. if (typeof namespace === 'string') {
  4243. namespace = (0, _parse.default)(namespace);
  4244. }
  4245. if (namespace.length !== 16) {
  4246. throw TypeError('Namespace must be array-like (16 iterable integer values, 0-255)');
  4247. } // Compute hash of namespace and value, Per 4.3
  4248. // Future: Use spread syntax when supported on all platforms, e.g. `bytes =
  4249. // hashfunc([...namespace, ... value])`
  4250. let bytes = new Uint8Array(16 + value.length);
  4251. bytes.set(namespace);
  4252. bytes.set(value, namespace.length);
  4253. bytes = hashfunc(bytes);
  4254. bytes[6] = bytes[6] & 0x0f | version;
  4255. bytes[8] = bytes[8] & 0x3f | 0x80;
  4256. if (buf) {
  4257. offset = offset || 0;
  4258. for (let i = 0; i < 16; ++i) {
  4259. buf[offset + i] = bytes[i];
  4260. }
  4261. return buf;
  4262. }
  4263. return (0, _stringify.default)(bytes);
  4264. } // Function#name is not settable on some platforms (#270)
  4265. try {
  4266. generateUUID.name = name; // eslint-disable-next-line no-empty
  4267. } catch (err) {} // For CommonJS default export support
  4268. generateUUID.DNS = DNS;
  4269. generateUUID.URL = URL;
  4270. return generateUUID;
  4271. }
  4272. /***/ }),
  4273. /***/ 1472:
  4274. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  4275. "use strict";
  4276. Object.defineProperty(exports, "__esModule", ({
  4277. value: true
  4278. }));
  4279. exports["default"] = void 0;
  4280. var _rng = _interopRequireDefault(__nccwpck_require__(9784));
  4281. var _stringify = _interopRequireDefault(__nccwpck_require__(1458));
  4282. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  4283. function v4(options, buf, offset) {
  4284. options = options || {};
  4285. const rnds = options.random || (options.rng || _rng.default)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
  4286. rnds[6] = rnds[6] & 0x0f | 0x40;
  4287. rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided
  4288. if (buf) {
  4289. offset = offset || 0;
  4290. for (let i = 0; i < 16; ++i) {
  4291. buf[offset + i] = rnds[i];
  4292. }
  4293. return buf;
  4294. }
  4295. return (0, _stringify.default)(rnds);
  4296. }
  4297. var _default = v4;
  4298. exports["default"] = _default;
  4299. /***/ }),
  4300. /***/ 6217:
  4301. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  4302. "use strict";
  4303. Object.defineProperty(exports, "__esModule", ({
  4304. value: true
  4305. }));
  4306. exports["default"] = void 0;
  4307. var _v = _interopRequireDefault(__nccwpck_require__(5920));
  4308. var _sha = _interopRequireDefault(__nccwpck_require__(8844));
  4309. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  4310. const v5 = (0, _v.default)('v5', 0x50, _sha.default);
  4311. var _default = v5;
  4312. exports["default"] = _default;
  4313. /***/ }),
  4314. /***/ 2609:
  4315. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  4316. "use strict";
  4317. Object.defineProperty(exports, "__esModule", ({
  4318. value: true
  4319. }));
  4320. exports["default"] = void 0;
  4321. var _regex = _interopRequireDefault(__nccwpck_require__(6230));
  4322. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  4323. function validate(uuid) {
  4324. return typeof uuid === 'string' && _regex.default.test(uuid);
  4325. }
  4326. var _default = validate;
  4327. exports["default"] = _default;
  4328. /***/ }),
  4329. /***/ 427:
  4330. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  4331. "use strict";
  4332. Object.defineProperty(exports, "__esModule", ({
  4333. value: true
  4334. }));
  4335. exports["default"] = void 0;
  4336. var _validate = _interopRequireDefault(__nccwpck_require__(2609));
  4337. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  4338. function version(uuid) {
  4339. if (!(0, _validate.default)(uuid)) {
  4340. throw TypeError('Invalid UUID');
  4341. }
  4342. return parseInt(uuid.substr(14, 1), 16);
  4343. }
  4344. var _default = version;
  4345. exports["default"] = _default;
  4346. /***/ }),
  4347. /***/ 1514:
  4348. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  4349. "use strict";
  4350. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  4351. if (k2 === undefined) k2 = k;
  4352. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  4353. }) : (function(o, m, k, k2) {
  4354. if (k2 === undefined) k2 = k;
  4355. o[k2] = m[k];
  4356. }));
  4357. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  4358. Object.defineProperty(o, "default", { enumerable: true, value: v });
  4359. }) : function(o, v) {
  4360. o["default"] = v;
  4361. });
  4362. var __importStar = (this && this.__importStar) || function (mod) {
  4363. if (mod && mod.__esModule) return mod;
  4364. var result = {};
  4365. if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  4366. __setModuleDefault(result, mod);
  4367. return result;
  4368. };
  4369. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  4370. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  4371. return new (P || (P = Promise))(function (resolve, reject) {
  4372. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  4373. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  4374. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  4375. step((generator = generator.apply(thisArg, _arguments || [])).next());
  4376. });
  4377. };
  4378. Object.defineProperty(exports, "__esModule", ({ value: true }));
  4379. exports.getExecOutput = exports.exec = void 0;
  4380. const string_decoder_1 = __nccwpck_require__(1576);
  4381. const tr = __importStar(__nccwpck_require__(8159));
  4382. /**
  4383. * Exec a command.
  4384. * Output will be streamed to the live console.
  4385. * Returns promise with return code
  4386. *
  4387. * @param commandLine command to execute (can include additional args). Must be correctly escaped.
  4388. * @param args optional arguments for tool. Escaping is handled by the lib.
  4389. * @param options optional exec options. See ExecOptions
  4390. * @returns Promise<number> exit code
  4391. */
  4392. function exec(commandLine, args, options) {
  4393. return __awaiter(this, void 0, void 0, function* () {
  4394. const commandArgs = tr.argStringToArray(commandLine);
  4395. if (commandArgs.length === 0) {
  4396. throw new Error(`Parameter 'commandLine' cannot be null or empty.`);
  4397. }
  4398. // Path to tool to execute should be first arg
  4399. const toolPath = commandArgs[0];
  4400. args = commandArgs.slice(1).concat(args || []);
  4401. const runner = new tr.ToolRunner(toolPath, args, options);
  4402. return runner.exec();
  4403. });
  4404. }
  4405. exports.exec = exec;
  4406. /**
  4407. * Exec a command and get the output.
  4408. * Output will be streamed to the live console.
  4409. * Returns promise with the exit code and collected stdout and stderr
  4410. *
  4411. * @param commandLine command to execute (can include additional args). Must be correctly escaped.
  4412. * @param args optional arguments for tool. Escaping is handled by the lib.
  4413. * @param options optional exec options. See ExecOptions
  4414. * @returns Promise<ExecOutput> exit code, stdout, and stderr
  4415. */
  4416. function getExecOutput(commandLine, args, options) {
  4417. var _a, _b;
  4418. return __awaiter(this, void 0, void 0, function* () {
  4419. let stdout = '';
  4420. let stderr = '';
  4421. //Using string decoder covers the case where a mult-byte character is split
  4422. const stdoutDecoder = new string_decoder_1.StringDecoder('utf8');
  4423. const stderrDecoder = new string_decoder_1.StringDecoder('utf8');
  4424. const originalStdoutListener = (_a = options === null || options === void 0 ? void 0 : options.listeners) === null || _a === void 0 ? void 0 : _a.stdout;
  4425. const originalStdErrListener = (_b = options === null || options === void 0 ? void 0 : options.listeners) === null || _b === void 0 ? void 0 : _b.stderr;
  4426. const stdErrListener = (data) => {
  4427. stderr += stderrDecoder.write(data);
  4428. if (originalStdErrListener) {
  4429. originalStdErrListener(data);
  4430. }
  4431. };
  4432. const stdOutListener = (data) => {
  4433. stdout += stdoutDecoder.write(data);
  4434. if (originalStdoutListener) {
  4435. originalStdoutListener(data);
  4436. }
  4437. };
  4438. const listeners = Object.assign(Object.assign({}, options === null || options === void 0 ? void 0 : options.listeners), { stdout: stdOutListener, stderr: stdErrListener });
  4439. const exitCode = yield exec(commandLine, args, Object.assign(Object.assign({}, options), { listeners }));
  4440. //flush any remaining characters
  4441. stdout += stdoutDecoder.end();
  4442. stderr += stderrDecoder.end();
  4443. return {
  4444. exitCode,
  4445. stdout,
  4446. stderr
  4447. };
  4448. });
  4449. }
  4450. exports.getExecOutput = getExecOutput;
  4451. //# sourceMappingURL=exec.js.map
  4452. /***/ }),
  4453. /***/ 8159:
  4454. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  4455. "use strict";
  4456. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  4457. if (k2 === undefined) k2 = k;
  4458. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  4459. }) : (function(o, m, k, k2) {
  4460. if (k2 === undefined) k2 = k;
  4461. o[k2] = m[k];
  4462. }));
  4463. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  4464. Object.defineProperty(o, "default", { enumerable: true, value: v });
  4465. }) : function(o, v) {
  4466. o["default"] = v;
  4467. });
  4468. var __importStar = (this && this.__importStar) || function (mod) {
  4469. if (mod && mod.__esModule) return mod;
  4470. var result = {};
  4471. if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  4472. __setModuleDefault(result, mod);
  4473. return result;
  4474. };
  4475. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  4476. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  4477. return new (P || (P = Promise))(function (resolve, reject) {
  4478. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  4479. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  4480. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  4481. step((generator = generator.apply(thisArg, _arguments || [])).next());
  4482. });
  4483. };
  4484. Object.defineProperty(exports, "__esModule", ({ value: true }));
  4485. exports.argStringToArray = exports.ToolRunner = void 0;
  4486. const os = __importStar(__nccwpck_require__(2037));
  4487. const events = __importStar(__nccwpck_require__(2361));
  4488. const child = __importStar(__nccwpck_require__(2081));
  4489. const path = __importStar(__nccwpck_require__(1017));
  4490. const io = __importStar(__nccwpck_require__(7436));
  4491. const ioUtil = __importStar(__nccwpck_require__(1962));
  4492. const timers_1 = __nccwpck_require__(9512);
  4493. /* eslint-disable @typescript-eslint/unbound-method */
  4494. const IS_WINDOWS = process.platform === 'win32';
  4495. /*
  4496. * Class for running command line tools. Handles quoting and arg parsing in a platform agnostic way.
  4497. */
  4498. class ToolRunner extends events.EventEmitter {
  4499. constructor(toolPath, args, options) {
  4500. super();
  4501. if (!toolPath) {
  4502. throw new Error("Parameter 'toolPath' cannot be null or empty.");
  4503. }
  4504. this.toolPath = toolPath;
  4505. this.args = args || [];
  4506. this.options = options || {};
  4507. }
  4508. _debug(message) {
  4509. if (this.options.listeners && this.options.listeners.debug) {
  4510. this.options.listeners.debug(message);
  4511. }
  4512. }
  4513. _getCommandString(options, noPrefix) {
  4514. const toolPath = this._getSpawnFileName();
  4515. const args = this._getSpawnArgs(options);
  4516. let cmd = noPrefix ? '' : '[command]'; // omit prefix when piped to a second tool
  4517. if (IS_WINDOWS) {
  4518. // Windows + cmd file
  4519. if (this._isCmdFile()) {
  4520. cmd += toolPath;
  4521. for (const a of args) {
  4522. cmd += ` ${a}`;
  4523. }
  4524. }
  4525. // Windows + verbatim
  4526. else if (options.windowsVerbatimArguments) {
  4527. cmd += `"${toolPath}"`;
  4528. for (const a of args) {
  4529. cmd += ` ${a}`;
  4530. }
  4531. }
  4532. // Windows (regular)
  4533. else {
  4534. cmd += this._windowsQuoteCmdArg(toolPath);
  4535. for (const a of args) {
  4536. cmd += ` ${this._windowsQuoteCmdArg(a)}`;
  4537. }
  4538. }
  4539. }
  4540. else {
  4541. // OSX/Linux - this can likely be improved with some form of quoting.
  4542. // creating processes on Unix is fundamentally different than Windows.
  4543. // on Unix, execvp() takes an arg array.
  4544. cmd += toolPath;
  4545. for (const a of args) {
  4546. cmd += ` ${a}`;
  4547. }
  4548. }
  4549. return cmd;
  4550. }
  4551. _processLineBuffer(data, strBuffer, onLine) {
  4552. try {
  4553. let s = strBuffer + data.toString();
  4554. let n = s.indexOf(os.EOL);
  4555. while (n > -1) {
  4556. const line = s.substring(0, n);
  4557. onLine(line);
  4558. // the rest of the string ...
  4559. s = s.substring(n + os.EOL.length);
  4560. n = s.indexOf(os.EOL);
  4561. }
  4562. return s;
  4563. }
  4564. catch (err) {
  4565. // streaming lines to console is best effort. Don't fail a build.
  4566. this._debug(`error processing line. Failed with error ${err}`);
  4567. return '';
  4568. }
  4569. }
  4570. _getSpawnFileName() {
  4571. if (IS_WINDOWS) {
  4572. if (this._isCmdFile()) {
  4573. return process.env['COMSPEC'] || 'cmd.exe';
  4574. }
  4575. }
  4576. return this.toolPath;
  4577. }
  4578. _getSpawnArgs(options) {
  4579. if (IS_WINDOWS) {
  4580. if (this._isCmdFile()) {
  4581. let argline = `/D /S /C "${this._windowsQuoteCmdArg(this.toolPath)}`;
  4582. for (const a of this.args) {
  4583. argline += ' ';
  4584. argline += options.windowsVerbatimArguments
  4585. ? a
  4586. : this._windowsQuoteCmdArg(a);
  4587. }
  4588. argline += '"';
  4589. return [argline];
  4590. }
  4591. }
  4592. return this.args;
  4593. }
  4594. _endsWith(str, end) {
  4595. return str.endsWith(end);
  4596. }
  4597. _isCmdFile() {
  4598. const upperToolPath = this.toolPath.toUpperCase();
  4599. return (this._endsWith(upperToolPath, '.CMD') ||
  4600. this._endsWith(upperToolPath, '.BAT'));
  4601. }
  4602. _windowsQuoteCmdArg(arg) {
  4603. // for .exe, apply the normal quoting rules that libuv applies
  4604. if (!this._isCmdFile()) {
  4605. return this._uvQuoteCmdArg(arg);
  4606. }
  4607. // otherwise apply quoting rules specific to the cmd.exe command line parser.
  4608. // the libuv rules are generic and are not designed specifically for cmd.exe
  4609. // command line parser.
  4610. //
  4611. // for a detailed description of the cmd.exe command line parser, refer to
  4612. // http://stackoverflow.com/questions/4094699/how-does-the-windows-command-interpreter-cmd-exe-parse-scripts/7970912#7970912
  4613. // need quotes for empty arg
  4614. if (!arg) {
  4615. return '""';
  4616. }
  4617. // determine whether the arg needs to be quoted
  4618. const cmdSpecialChars = [
  4619. ' ',
  4620. '\t',
  4621. '&',
  4622. '(',
  4623. ')',
  4624. '[',
  4625. ']',
  4626. '{',
  4627. '}',
  4628. '^',
  4629. '=',
  4630. ';',
  4631. '!',
  4632. "'",
  4633. '+',
  4634. ',',
  4635. '`',
  4636. '~',
  4637. '|',
  4638. '<',
  4639. '>',
  4640. '"'
  4641. ];
  4642. let needsQuotes = false;
  4643. for (const char of arg) {
  4644. if (cmdSpecialChars.some(x => x === char)) {
  4645. needsQuotes = true;
  4646. break;
  4647. }
  4648. }
  4649. // short-circuit if quotes not needed
  4650. if (!needsQuotes) {
  4651. return arg;
  4652. }
  4653. // the following quoting rules are very similar to the rules that by libuv applies.
  4654. //
  4655. // 1) wrap the string in quotes
  4656. //
  4657. // 2) double-up quotes - i.e. " => ""
  4658. //
  4659. // this is different from the libuv quoting rules. libuv replaces " with \", which unfortunately
  4660. // doesn't work well with a cmd.exe command line.
  4661. //
  4662. // note, replacing " with "" also works well if the arg is passed to a downstream .NET console app.
  4663. // for example, the command line:
  4664. // foo.exe "myarg:""my val"""
  4665. // is parsed by a .NET console app into an arg array:
  4666. // [ "myarg:\"my val\"" ]
  4667. // which is the same end result when applying libuv quoting rules. although the actual
  4668. // command line from libuv quoting rules would look like:
  4669. // foo.exe "myarg:\"my val\""
  4670. //
  4671. // 3) double-up slashes that precede a quote,
  4672. // e.g. hello \world => "hello \world"
  4673. // hello\"world => "hello\\""world"
  4674. // hello\\"world => "hello\\\\""world"
  4675. // hello world\ => "hello world\\"
  4676. //
  4677. // technically this is not required for a cmd.exe command line, or the batch argument parser.
  4678. // the reasons for including this as a .cmd quoting rule are:
  4679. //
  4680. // a) this is optimized for the scenario where the argument is passed from the .cmd file to an
  4681. // external program. many programs (e.g. .NET console apps) rely on the slash-doubling rule.
  4682. //
  4683. // b) it's what we've been doing previously (by deferring to node default behavior) and we
  4684. // haven't heard any complaints about that aspect.
  4685. //
  4686. // note, a weakness of the quoting rules chosen here, is that % is not escaped. in fact, % cannot be
  4687. // escaped when used on the command line directly - even though within a .cmd file % can be escaped
  4688. // by using %%.
  4689. //
  4690. // the saving grace is, on the command line, %var% is left as-is if var is not defined. this contrasts
  4691. // the line parsing rules within a .cmd file, where if var is not defined it is replaced with nothing.
  4692. //
  4693. // one option that was explored was replacing % with ^% - i.e. %var% => ^%var^%. this hack would
  4694. // often work, since it is unlikely that var^ would exist, and the ^ character is removed when the
  4695. // variable is used. the problem, however, is that ^ is not removed when %* is used to pass the args
  4696. // to an external program.
  4697. //
  4698. // an unexplored potential solution for the % escaping problem, is to create a wrapper .cmd file.
  4699. // % can be escaped within a .cmd file.
  4700. let reverse = '"';
  4701. let quoteHit = true;
  4702. for (let i = arg.length; i > 0; i--) {
  4703. // walk the string in reverse
  4704. reverse += arg[i - 1];
  4705. if (quoteHit && arg[i - 1] === '\\') {
  4706. reverse += '\\'; // double the slash
  4707. }
  4708. else if (arg[i - 1] === '"') {
  4709. quoteHit = true;
  4710. reverse += '"'; // double the quote
  4711. }
  4712. else {
  4713. quoteHit = false;
  4714. }
  4715. }
  4716. reverse += '"';
  4717. return reverse
  4718. .split('')
  4719. .reverse()
  4720. .join('');
  4721. }
  4722. _uvQuoteCmdArg(arg) {
  4723. // Tool runner wraps child_process.spawn() and needs to apply the same quoting as
  4724. // Node in certain cases where the undocumented spawn option windowsVerbatimArguments
  4725. // is used.
  4726. //
  4727. // Since this function is a port of quote_cmd_arg from Node 4.x (technically, lib UV,
  4728. // see https://github.com/nodejs/node/blob/v4.x/deps/uv/src/win/process.c for details),
  4729. // pasting copyright notice from Node within this function:
  4730. //
  4731. // Copyright Joyent, Inc. and other Node contributors. All rights reserved.
  4732. //
  4733. // Permission is hereby granted, free of charge, to any person obtaining a copy
  4734. // of this software and associated documentation files (the "Software"), to
  4735. // deal in the Software without restriction, including without limitation the
  4736. // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
  4737. // sell copies of the Software, and to permit persons to whom the Software is
  4738. // furnished to do so, subject to the following conditions:
  4739. //
  4740. // The above copyright notice and this permission notice shall be included in
  4741. // all copies or substantial portions of the Software.
  4742. //
  4743. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  4744. // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  4745. // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  4746. // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  4747. // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  4748. // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
  4749. // IN THE SOFTWARE.
  4750. if (!arg) {
  4751. // Need double quotation for empty argument
  4752. return '""';
  4753. }
  4754. if (!arg.includes(' ') && !arg.includes('\t') && !arg.includes('"')) {
  4755. // No quotation needed
  4756. return arg;
  4757. }
  4758. if (!arg.includes('"') && !arg.includes('\\')) {
  4759. // No embedded double quotes or backslashes, so I can just wrap
  4760. // quote marks around the whole thing.
  4761. return `"${arg}"`;
  4762. }
  4763. // Expected input/output:
  4764. // input : hello"world
  4765. // output: "hello\"world"
  4766. // input : hello""world
  4767. // output: "hello\"\"world"
  4768. // input : hello\world
  4769. // output: hello\world
  4770. // input : hello\\world
  4771. // output: hello\\world
  4772. // input : hello\"world
  4773. // output: "hello\\\"world"
  4774. // input : hello\\"world
  4775. // output: "hello\\\\\"world"
  4776. // input : hello world\
  4777. // output: "hello world\\" - note the comment in libuv actually reads "hello world\"
  4778. // but it appears the comment is wrong, it should be "hello world\\"
  4779. let reverse = '"';
  4780. let quoteHit = true;
  4781. for (let i = arg.length; i > 0; i--) {
  4782. // walk the string in reverse
  4783. reverse += arg[i - 1];
  4784. if (quoteHit && arg[i - 1] === '\\') {
  4785. reverse += '\\';
  4786. }
  4787. else if (arg[i - 1] === '"') {
  4788. quoteHit = true;
  4789. reverse += '\\';
  4790. }
  4791. else {
  4792. quoteHit = false;
  4793. }
  4794. }
  4795. reverse += '"';
  4796. return reverse
  4797. .split('')
  4798. .reverse()
  4799. .join('');
  4800. }
  4801. _cloneExecOptions(options) {
  4802. options = options || {};
  4803. const result = {
  4804. cwd: options.cwd || process.cwd(),
  4805. env: options.env || process.env,
  4806. silent: options.silent || false,
  4807. windowsVerbatimArguments: options.windowsVerbatimArguments || false,
  4808. failOnStdErr: options.failOnStdErr || false,
  4809. ignoreReturnCode: options.ignoreReturnCode || false,
  4810. delay: options.delay || 10000
  4811. };
  4812. result.outStream = options.outStream || process.stdout;
  4813. result.errStream = options.errStream || process.stderr;
  4814. return result;
  4815. }
  4816. _getSpawnOptions(options, toolPath) {
  4817. options = options || {};
  4818. const result = {};
  4819. result.cwd = options.cwd;
  4820. result.env = options.env;
  4821. result['windowsVerbatimArguments'] =
  4822. options.windowsVerbatimArguments || this._isCmdFile();
  4823. if (options.windowsVerbatimArguments) {
  4824. result.argv0 = `"${toolPath}"`;
  4825. }
  4826. return result;
  4827. }
  4828. /**
  4829. * Exec a tool.
  4830. * Output will be streamed to the live console.
  4831. * Returns promise with return code
  4832. *
  4833. * @param tool path to tool to exec
  4834. * @param options optional exec options. See ExecOptions
  4835. * @returns number
  4836. */
  4837. exec() {
  4838. return __awaiter(this, void 0, void 0, function* () {
  4839. // root the tool path if it is unrooted and contains relative pathing
  4840. if (!ioUtil.isRooted(this.toolPath) &&
  4841. (this.toolPath.includes('/') ||
  4842. (IS_WINDOWS && this.toolPath.includes('\\')))) {
  4843. // prefer options.cwd if it is specified, however options.cwd may also need to be rooted
  4844. this.toolPath = path.resolve(process.cwd(), this.options.cwd || process.cwd(), this.toolPath);
  4845. }
  4846. // if the tool is only a file name, then resolve it from the PATH
  4847. // otherwise verify it exists (add extension on Windows if necessary)
  4848. this.toolPath = yield io.which(this.toolPath, true);
  4849. return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
  4850. this._debug(`exec tool: ${this.toolPath}`);
  4851. this._debug('arguments:');
  4852. for (const arg of this.args) {
  4853. this._debug(` ${arg}`);
  4854. }
  4855. const optionsNonNull = this._cloneExecOptions(this.options);
  4856. if (!optionsNonNull.silent && optionsNonNull.outStream) {
  4857. optionsNonNull.outStream.write(this._getCommandString(optionsNonNull) + os.EOL);
  4858. }
  4859. const state = new ExecState(optionsNonNull, this.toolPath);
  4860. state.on('debug', (message) => {
  4861. this._debug(message);
  4862. });
  4863. if (this.options.cwd && !(yield ioUtil.exists(this.options.cwd))) {
  4864. return reject(new Error(`The cwd: ${this.options.cwd} does not exist!`));
  4865. }
  4866. const fileName = this._getSpawnFileName();
  4867. const cp = child.spawn(fileName, this._getSpawnArgs(optionsNonNull), this._getSpawnOptions(this.options, fileName));
  4868. let stdbuffer = '';
  4869. if (cp.stdout) {
  4870. cp.stdout.on('data', (data) => {
  4871. if (this.options.listeners && this.options.listeners.stdout) {
  4872. this.options.listeners.stdout(data);
  4873. }
  4874. if (!optionsNonNull.silent && optionsNonNull.outStream) {
  4875. optionsNonNull.outStream.write(data);
  4876. }
  4877. stdbuffer = this._processLineBuffer(data, stdbuffer, (line) => {
  4878. if (this.options.listeners && this.options.listeners.stdline) {
  4879. this.options.listeners.stdline(line);
  4880. }
  4881. });
  4882. });
  4883. }
  4884. let errbuffer = '';
  4885. if (cp.stderr) {
  4886. cp.stderr.on('data', (data) => {
  4887. state.processStderr = true;
  4888. if (this.options.listeners && this.options.listeners.stderr) {
  4889. this.options.listeners.stderr(data);
  4890. }
  4891. if (!optionsNonNull.silent &&
  4892. optionsNonNull.errStream &&
  4893. optionsNonNull.outStream) {
  4894. const s = optionsNonNull.failOnStdErr
  4895. ? optionsNonNull.errStream
  4896. : optionsNonNull.outStream;
  4897. s.write(data);
  4898. }
  4899. errbuffer = this._processLineBuffer(data, errbuffer, (line) => {
  4900. if (this.options.listeners && this.options.listeners.errline) {
  4901. this.options.listeners.errline(line);
  4902. }
  4903. });
  4904. });
  4905. }
  4906. cp.on('error', (err) => {
  4907. state.processError = err.message;
  4908. state.processExited = true;
  4909. state.processClosed = true;
  4910. state.CheckComplete();
  4911. });
  4912. cp.on('exit', (code) => {
  4913. state.processExitCode = code;
  4914. state.processExited = true;
  4915. this._debug(`Exit code ${code} received from tool '${this.toolPath}'`);
  4916. state.CheckComplete();
  4917. });
  4918. cp.on('close', (code) => {
  4919. state.processExitCode = code;
  4920. state.processExited = true;
  4921. state.processClosed = true;
  4922. this._debug(`STDIO streams have closed for tool '${this.toolPath}'`);
  4923. state.CheckComplete();
  4924. });
  4925. state.on('done', (error, exitCode) => {
  4926. if (stdbuffer.length > 0) {
  4927. this.emit('stdline', stdbuffer);
  4928. }
  4929. if (errbuffer.length > 0) {
  4930. this.emit('errline', errbuffer);
  4931. }
  4932. cp.removeAllListeners();
  4933. if (error) {
  4934. reject(error);
  4935. }
  4936. else {
  4937. resolve(exitCode);
  4938. }
  4939. });
  4940. if (this.options.input) {
  4941. if (!cp.stdin) {
  4942. throw new Error('child process missing stdin');
  4943. }
  4944. cp.stdin.end(this.options.input);
  4945. }
  4946. }));
  4947. });
  4948. }
  4949. }
  4950. exports.ToolRunner = ToolRunner;
  4951. /**
  4952. * Convert an arg string to an array of args. Handles escaping
  4953. *
  4954. * @param argString string of arguments
  4955. * @returns string[] array of arguments
  4956. */
  4957. function argStringToArray(argString) {
  4958. const args = [];
  4959. let inQuotes = false;
  4960. let escaped = false;
  4961. let arg = '';
  4962. function append(c) {
  4963. // we only escape double quotes.
  4964. if (escaped && c !== '"') {
  4965. arg += '\\';
  4966. }
  4967. arg += c;
  4968. escaped = false;
  4969. }
  4970. for (let i = 0; i < argString.length; i++) {
  4971. const c = argString.charAt(i);
  4972. if (c === '"') {
  4973. if (!escaped) {
  4974. inQuotes = !inQuotes;
  4975. }
  4976. else {
  4977. append(c);
  4978. }
  4979. continue;
  4980. }
  4981. if (c === '\\' && escaped) {
  4982. append(c);
  4983. continue;
  4984. }
  4985. if (c === '\\' && inQuotes) {
  4986. escaped = true;
  4987. continue;
  4988. }
  4989. if (c === ' ' && !inQuotes) {
  4990. if (arg.length > 0) {
  4991. args.push(arg);
  4992. arg = '';
  4993. }
  4994. continue;
  4995. }
  4996. append(c);
  4997. }
  4998. if (arg.length > 0) {
  4999. args.push(arg.trim());
  5000. }
  5001. return args;
  5002. }
  5003. exports.argStringToArray = argStringToArray;
  5004. class ExecState extends events.EventEmitter {
  5005. constructor(options, toolPath) {
  5006. super();
  5007. this.processClosed = false; // tracks whether the process has exited and stdio is closed
  5008. this.processError = '';
  5009. this.processExitCode = 0;
  5010. this.processExited = false; // tracks whether the process has exited
  5011. this.processStderr = false; // tracks whether stderr was written to
  5012. this.delay = 10000; // 10 seconds
  5013. this.done = false;
  5014. this.timeout = null;
  5015. if (!toolPath) {
  5016. throw new Error('toolPath must not be empty');
  5017. }
  5018. this.options = options;
  5019. this.toolPath = toolPath;
  5020. if (options.delay) {
  5021. this.delay = options.delay;
  5022. }
  5023. }
  5024. CheckComplete() {
  5025. if (this.done) {
  5026. return;
  5027. }
  5028. if (this.processClosed) {
  5029. this._setResult();
  5030. }
  5031. else if (this.processExited) {
  5032. this.timeout = timers_1.setTimeout(ExecState.HandleTimeout, this.delay, this);
  5033. }
  5034. }
  5035. _debug(message) {
  5036. this.emit('debug', message);
  5037. }
  5038. _setResult() {
  5039. // determine whether there is an error
  5040. let error;
  5041. if (this.processExited) {
  5042. if (this.processError) {
  5043. 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}`);
  5044. }
  5045. else if (this.processExitCode !== 0 && !this.options.ignoreReturnCode) {
  5046. error = new Error(`The process '${this.toolPath}' failed with exit code ${this.processExitCode}`);
  5047. }
  5048. else if (this.processStderr && this.options.failOnStdErr) {
  5049. error = new Error(`The process '${this.toolPath}' failed because one or more lines were written to the STDERR stream`);
  5050. }
  5051. }
  5052. // clear the timeout
  5053. if (this.timeout) {
  5054. clearTimeout(this.timeout);
  5055. this.timeout = null;
  5056. }
  5057. this.done = true;
  5058. this.emit('done', error, this.processExitCode);
  5059. }
  5060. static HandleTimeout(state) {
  5061. if (state.done) {
  5062. return;
  5063. }
  5064. if (!state.processClosed && state.processExited) {
  5065. const message = `The STDIO streams did not close within ${state.delay /
  5066. 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.`;
  5067. state._debug(message);
  5068. }
  5069. state._setResult();
  5070. }
  5071. }
  5072. //# sourceMappingURL=toolrunner.js.map
  5073. /***/ }),
  5074. /***/ 4087:
  5075. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  5076. "use strict";
  5077. Object.defineProperty(exports, "__esModule", ({ value: true }));
  5078. exports.Context = void 0;
  5079. const fs_1 = __nccwpck_require__(7147);
  5080. const os_1 = __nccwpck_require__(2037);
  5081. class Context {
  5082. /**
  5083. * Hydrate the context from the environment
  5084. */
  5085. constructor() {
  5086. var _a, _b, _c;
  5087. this.payload = {};
  5088. if (process.env.GITHUB_EVENT_PATH) {
  5089. if ((0, fs_1.existsSync)(process.env.GITHUB_EVENT_PATH)) {
  5090. this.payload = JSON.parse((0, fs_1.readFileSync)(process.env.GITHUB_EVENT_PATH, { encoding: 'utf8' }));
  5091. }
  5092. else {
  5093. const path = process.env.GITHUB_EVENT_PATH;
  5094. process.stdout.write(`GITHUB_EVENT_PATH ${path} does not exist${os_1.EOL}`);
  5095. }
  5096. }
  5097. this.eventName = process.env.GITHUB_EVENT_NAME;
  5098. this.sha = process.env.GITHUB_SHA;
  5099. this.ref = process.env.GITHUB_REF;
  5100. this.workflow = process.env.GITHUB_WORKFLOW;
  5101. this.action = process.env.GITHUB_ACTION;
  5102. this.actor = process.env.GITHUB_ACTOR;
  5103. this.job = process.env.GITHUB_JOB;
  5104. this.runNumber = parseInt(process.env.GITHUB_RUN_NUMBER, 10);
  5105. this.runId = parseInt(process.env.GITHUB_RUN_ID, 10);
  5106. this.apiUrl = (_a = process.env.GITHUB_API_URL) !== null && _a !== void 0 ? _a : `https://api.github.com`;
  5107. this.serverUrl = (_b = process.env.GITHUB_SERVER_URL) !== null && _b !== void 0 ? _b : `https://github.com`;
  5108. this.graphqlUrl =
  5109. (_c = process.env.GITHUB_GRAPHQL_URL) !== null && _c !== void 0 ? _c : `https://api.github.com/graphql`;
  5110. }
  5111. get issue() {
  5112. const payload = this.payload;
  5113. return Object.assign(Object.assign({}, this.repo), { number: (payload.issue || payload.pull_request || payload).number });
  5114. }
  5115. get repo() {
  5116. if (process.env.GITHUB_REPOSITORY) {
  5117. const [owner, repo] = process.env.GITHUB_REPOSITORY.split('/');
  5118. return { owner, repo };
  5119. }
  5120. if (this.payload.repository) {
  5121. return {
  5122. owner: this.payload.repository.owner.login,
  5123. repo: this.payload.repository.name
  5124. };
  5125. }
  5126. throw new Error("context.repo requires a GITHUB_REPOSITORY environment variable like 'owner/repo'");
  5127. }
  5128. }
  5129. exports.Context = Context;
  5130. //# sourceMappingURL=context.js.map
  5131. /***/ }),
  5132. /***/ 5438:
  5133. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  5134. "use strict";
  5135. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  5136. if (k2 === undefined) k2 = k;
  5137. var desc = Object.getOwnPropertyDescriptor(m, k);
  5138. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  5139. desc = { enumerable: true, get: function() { return m[k]; } };
  5140. }
  5141. Object.defineProperty(o, k2, desc);
  5142. }) : (function(o, m, k, k2) {
  5143. if (k2 === undefined) k2 = k;
  5144. o[k2] = m[k];
  5145. }));
  5146. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  5147. Object.defineProperty(o, "default", { enumerable: true, value: v });
  5148. }) : function(o, v) {
  5149. o["default"] = v;
  5150. });
  5151. var __importStar = (this && this.__importStar) || function (mod) {
  5152. if (mod && mod.__esModule) return mod;
  5153. var result = {};
  5154. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  5155. __setModuleDefault(result, mod);
  5156. return result;
  5157. };
  5158. Object.defineProperty(exports, "__esModule", ({ value: true }));
  5159. exports.getOctokit = exports.context = void 0;
  5160. const Context = __importStar(__nccwpck_require__(4087));
  5161. const utils_1 = __nccwpck_require__(3030);
  5162. exports.context = new Context.Context();
  5163. /**
  5164. * Returns a hydrated octokit ready to use for GitHub Actions
  5165. *
  5166. * @param token the repo PAT or GITHUB_TOKEN
  5167. * @param options other options to set
  5168. */
  5169. function getOctokit(token, options, ...additionalPlugins) {
  5170. const GitHubWithPlugins = utils_1.GitHub.plugin(...additionalPlugins);
  5171. return new GitHubWithPlugins((0, utils_1.getOctokitOptions)(token, options));
  5172. }
  5173. exports.getOctokit = getOctokit;
  5174. //# sourceMappingURL=github.js.map
  5175. /***/ }),
  5176. /***/ 7914:
  5177. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  5178. "use strict";
  5179. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  5180. if (k2 === undefined) k2 = k;
  5181. var desc = Object.getOwnPropertyDescriptor(m, k);
  5182. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  5183. desc = { enumerable: true, get: function() { return m[k]; } };
  5184. }
  5185. Object.defineProperty(o, k2, desc);
  5186. }) : (function(o, m, k, k2) {
  5187. if (k2 === undefined) k2 = k;
  5188. o[k2] = m[k];
  5189. }));
  5190. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  5191. Object.defineProperty(o, "default", { enumerable: true, value: v });
  5192. }) : function(o, v) {
  5193. o["default"] = v;
  5194. });
  5195. var __importStar = (this && this.__importStar) || function (mod) {
  5196. if (mod && mod.__esModule) return mod;
  5197. var result = {};
  5198. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  5199. __setModuleDefault(result, mod);
  5200. return result;
  5201. };
  5202. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  5203. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  5204. return new (P || (P = Promise))(function (resolve, reject) {
  5205. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  5206. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  5207. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  5208. step((generator = generator.apply(thisArg, _arguments || [])).next());
  5209. });
  5210. };
  5211. Object.defineProperty(exports, "__esModule", ({ value: true }));
  5212. exports.getApiBaseUrl = exports.getProxyFetch = exports.getProxyAgentDispatcher = exports.getProxyAgent = exports.getAuthString = void 0;
  5213. const httpClient = __importStar(__nccwpck_require__(6255));
  5214. const undici_1 = __nccwpck_require__(1773);
  5215. function getAuthString(token, options) {
  5216. if (!token && !options.auth) {
  5217. throw new Error('Parameter token or opts.auth is required');
  5218. }
  5219. else if (token && options.auth) {
  5220. throw new Error('Parameters token and opts.auth may not both be specified');
  5221. }
  5222. return typeof options.auth === 'string' ? options.auth : `token ${token}`;
  5223. }
  5224. exports.getAuthString = getAuthString;
  5225. function getProxyAgent(destinationUrl) {
  5226. const hc = new httpClient.HttpClient();
  5227. return hc.getAgent(destinationUrl);
  5228. }
  5229. exports.getProxyAgent = getProxyAgent;
  5230. function getProxyAgentDispatcher(destinationUrl) {
  5231. const hc = new httpClient.HttpClient();
  5232. return hc.getAgentDispatcher(destinationUrl);
  5233. }
  5234. exports.getProxyAgentDispatcher = getProxyAgentDispatcher;
  5235. function getProxyFetch(destinationUrl) {
  5236. const httpDispatcher = getProxyAgentDispatcher(destinationUrl);
  5237. const proxyFetch = (url, opts) => __awaiter(this, void 0, void 0, function* () {
  5238. return (0, undici_1.fetch)(url, Object.assign(Object.assign({}, opts), { dispatcher: httpDispatcher }));
  5239. });
  5240. return proxyFetch;
  5241. }
  5242. exports.getProxyFetch = getProxyFetch;
  5243. function getApiBaseUrl() {
  5244. return process.env['GITHUB_API_URL'] || 'https://api.github.com';
  5245. }
  5246. exports.getApiBaseUrl = getApiBaseUrl;
  5247. //# sourceMappingURL=utils.js.map
  5248. /***/ }),
  5249. /***/ 3030:
  5250. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  5251. "use strict";
  5252. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  5253. if (k2 === undefined) k2 = k;
  5254. var desc = Object.getOwnPropertyDescriptor(m, k);
  5255. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  5256. desc = { enumerable: true, get: function() { return m[k]; } };
  5257. }
  5258. Object.defineProperty(o, k2, desc);
  5259. }) : (function(o, m, k, k2) {
  5260. if (k2 === undefined) k2 = k;
  5261. o[k2] = m[k];
  5262. }));
  5263. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  5264. Object.defineProperty(o, "default", { enumerable: true, value: v });
  5265. }) : function(o, v) {
  5266. o["default"] = v;
  5267. });
  5268. var __importStar = (this && this.__importStar) || function (mod) {
  5269. if (mod && mod.__esModule) return mod;
  5270. var result = {};
  5271. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  5272. __setModuleDefault(result, mod);
  5273. return result;
  5274. };
  5275. Object.defineProperty(exports, "__esModule", ({ value: true }));
  5276. exports.getOctokitOptions = exports.GitHub = exports.defaults = exports.context = void 0;
  5277. const Context = __importStar(__nccwpck_require__(4087));
  5278. const Utils = __importStar(__nccwpck_require__(7914));
  5279. // octokit + plugins
  5280. const core_1 = __nccwpck_require__(6762);
  5281. const plugin_rest_endpoint_methods_1 = __nccwpck_require__(3044);
  5282. const plugin_paginate_rest_1 = __nccwpck_require__(4193);
  5283. exports.context = new Context.Context();
  5284. const baseUrl = Utils.getApiBaseUrl();
  5285. exports.defaults = {
  5286. baseUrl,
  5287. request: {
  5288. agent: Utils.getProxyAgent(baseUrl),
  5289. fetch: Utils.getProxyFetch(baseUrl)
  5290. }
  5291. };
  5292. exports.GitHub = core_1.Octokit.plugin(plugin_rest_endpoint_methods_1.restEndpointMethods, plugin_paginate_rest_1.paginateRest).defaults(exports.defaults);
  5293. /**
  5294. * Convience function to correctly format Octokit Options to pass into the constructor.
  5295. *
  5296. * @param token the repo PAT or GITHUB_TOKEN
  5297. * @param options other options to set
  5298. */
  5299. function getOctokitOptions(token, options) {
  5300. const opts = Object.assign({}, options || {}); // Shallow clone - don't mutate the object provided by the caller
  5301. // Auth
  5302. const auth = Utils.getAuthString(token, opts);
  5303. if (auth) {
  5304. opts.auth = auth;
  5305. }
  5306. return opts;
  5307. }
  5308. exports.getOctokitOptions = getOctokitOptions;
  5309. //# sourceMappingURL=utils.js.map
  5310. /***/ }),
  5311. /***/ 5526:
  5312. /***/ (function(__unused_webpack_module, exports) {
  5313. "use strict";
  5314. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  5315. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  5316. return new (P || (P = Promise))(function (resolve, reject) {
  5317. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  5318. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  5319. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  5320. step((generator = generator.apply(thisArg, _arguments || [])).next());
  5321. });
  5322. };
  5323. Object.defineProperty(exports, "__esModule", ({ value: true }));
  5324. exports.PersonalAccessTokenCredentialHandler = exports.BearerCredentialHandler = exports.BasicCredentialHandler = void 0;
  5325. class BasicCredentialHandler {
  5326. constructor(username, password) {
  5327. this.username = username;
  5328. this.password = password;
  5329. }
  5330. prepareRequest(options) {
  5331. if (!options.headers) {
  5332. throw Error('The request has no headers');
  5333. }
  5334. options.headers['Authorization'] = `Basic ${Buffer.from(`${this.username}:${this.password}`).toString('base64')}`;
  5335. }
  5336. // This handler cannot handle 401
  5337. canHandleAuthentication() {
  5338. return false;
  5339. }
  5340. handleAuthentication() {
  5341. return __awaiter(this, void 0, void 0, function* () {
  5342. throw new Error('not implemented');
  5343. });
  5344. }
  5345. }
  5346. exports.BasicCredentialHandler = BasicCredentialHandler;
  5347. class BearerCredentialHandler {
  5348. constructor(token) {
  5349. this.token = token;
  5350. }
  5351. // currently implements pre-authorization
  5352. // TODO: support preAuth = false where it hooks on 401
  5353. prepareRequest(options) {
  5354. if (!options.headers) {
  5355. throw Error('The request has no headers');
  5356. }
  5357. options.headers['Authorization'] = `Bearer ${this.token}`;
  5358. }
  5359. // This handler cannot handle 401
  5360. canHandleAuthentication() {
  5361. return false;
  5362. }
  5363. handleAuthentication() {
  5364. return __awaiter(this, void 0, void 0, function* () {
  5365. throw new Error('not implemented');
  5366. });
  5367. }
  5368. }
  5369. exports.BearerCredentialHandler = BearerCredentialHandler;
  5370. class PersonalAccessTokenCredentialHandler {
  5371. constructor(token) {
  5372. this.token = token;
  5373. }
  5374. // currently implements pre-authorization
  5375. // TODO: support preAuth = false where it hooks on 401
  5376. prepareRequest(options) {
  5377. if (!options.headers) {
  5378. throw Error('The request has no headers');
  5379. }
  5380. options.headers['Authorization'] = `Basic ${Buffer.from(`PAT:${this.token}`).toString('base64')}`;
  5381. }
  5382. // This handler cannot handle 401
  5383. canHandleAuthentication() {
  5384. return false;
  5385. }
  5386. handleAuthentication() {
  5387. return __awaiter(this, void 0, void 0, function* () {
  5388. throw new Error('not implemented');
  5389. });
  5390. }
  5391. }
  5392. exports.PersonalAccessTokenCredentialHandler = PersonalAccessTokenCredentialHandler;
  5393. //# sourceMappingURL=auth.js.map
  5394. /***/ }),
  5395. /***/ 6255:
  5396. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  5397. "use strict";
  5398. /* eslint-disable @typescript-eslint/no-explicit-any */
  5399. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  5400. if (k2 === undefined) k2 = k;
  5401. var desc = Object.getOwnPropertyDescriptor(m, k);
  5402. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  5403. desc = { enumerable: true, get: function() { return m[k]; } };
  5404. }
  5405. Object.defineProperty(o, k2, desc);
  5406. }) : (function(o, m, k, k2) {
  5407. if (k2 === undefined) k2 = k;
  5408. o[k2] = m[k];
  5409. }));
  5410. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  5411. Object.defineProperty(o, "default", { enumerable: true, value: v });
  5412. }) : function(o, v) {
  5413. o["default"] = v;
  5414. });
  5415. var __importStar = (this && this.__importStar) || function (mod) {
  5416. if (mod && mod.__esModule) return mod;
  5417. var result = {};
  5418. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  5419. __setModuleDefault(result, mod);
  5420. return result;
  5421. };
  5422. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  5423. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  5424. return new (P || (P = Promise))(function (resolve, reject) {
  5425. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  5426. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  5427. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  5428. step((generator = generator.apply(thisArg, _arguments || [])).next());
  5429. });
  5430. };
  5431. Object.defineProperty(exports, "__esModule", ({ value: true }));
  5432. exports.HttpClient = exports.isHttps = exports.HttpClientResponse = exports.HttpClientError = exports.getProxyUrl = exports.MediaTypes = exports.Headers = exports.HttpCodes = void 0;
  5433. const http = __importStar(__nccwpck_require__(3685));
  5434. const https = __importStar(__nccwpck_require__(5687));
  5435. const pm = __importStar(__nccwpck_require__(9835));
  5436. const tunnel = __importStar(__nccwpck_require__(4294));
  5437. const undici_1 = __nccwpck_require__(1773);
  5438. var HttpCodes;
  5439. (function (HttpCodes) {
  5440. HttpCodes[HttpCodes["OK"] = 200] = "OK";
  5441. HttpCodes[HttpCodes["MultipleChoices"] = 300] = "MultipleChoices";
  5442. HttpCodes[HttpCodes["MovedPermanently"] = 301] = "MovedPermanently";
  5443. HttpCodes[HttpCodes["ResourceMoved"] = 302] = "ResourceMoved";
  5444. HttpCodes[HttpCodes["SeeOther"] = 303] = "SeeOther";
  5445. HttpCodes[HttpCodes["NotModified"] = 304] = "NotModified";
  5446. HttpCodes[HttpCodes["UseProxy"] = 305] = "UseProxy";
  5447. HttpCodes[HttpCodes["SwitchProxy"] = 306] = "SwitchProxy";
  5448. HttpCodes[HttpCodes["TemporaryRedirect"] = 307] = "TemporaryRedirect";
  5449. HttpCodes[HttpCodes["PermanentRedirect"] = 308] = "PermanentRedirect";
  5450. HttpCodes[HttpCodes["BadRequest"] = 400] = "BadRequest";
  5451. HttpCodes[HttpCodes["Unauthorized"] = 401] = "Unauthorized";
  5452. HttpCodes[HttpCodes["PaymentRequired"] = 402] = "PaymentRequired";
  5453. HttpCodes[HttpCodes["Forbidden"] = 403] = "Forbidden";
  5454. HttpCodes[HttpCodes["NotFound"] = 404] = "NotFound";
  5455. HttpCodes[HttpCodes["MethodNotAllowed"] = 405] = "MethodNotAllowed";
  5456. HttpCodes[HttpCodes["NotAcceptable"] = 406] = "NotAcceptable";
  5457. HttpCodes[HttpCodes["ProxyAuthenticationRequired"] = 407] = "ProxyAuthenticationRequired";
  5458. HttpCodes[HttpCodes["RequestTimeout"] = 408] = "RequestTimeout";
  5459. HttpCodes[HttpCodes["Conflict"] = 409] = "Conflict";
  5460. HttpCodes[HttpCodes["Gone"] = 410] = "Gone";
  5461. HttpCodes[HttpCodes["TooManyRequests"] = 429] = "TooManyRequests";
  5462. HttpCodes[HttpCodes["InternalServerError"] = 500] = "InternalServerError";
  5463. HttpCodes[HttpCodes["NotImplemented"] = 501] = "NotImplemented";
  5464. HttpCodes[HttpCodes["BadGateway"] = 502] = "BadGateway";
  5465. HttpCodes[HttpCodes["ServiceUnavailable"] = 503] = "ServiceUnavailable";
  5466. HttpCodes[HttpCodes["GatewayTimeout"] = 504] = "GatewayTimeout";
  5467. })(HttpCodes || (exports.HttpCodes = HttpCodes = {}));
  5468. var Headers;
  5469. (function (Headers) {
  5470. Headers["Accept"] = "accept";
  5471. Headers["ContentType"] = "content-type";
  5472. })(Headers || (exports.Headers = Headers = {}));
  5473. var MediaTypes;
  5474. (function (MediaTypes) {
  5475. MediaTypes["ApplicationJson"] = "application/json";
  5476. })(MediaTypes || (exports.MediaTypes = MediaTypes = {}));
  5477. /**
  5478. * Returns the proxy URL, depending upon the supplied url and proxy environment variables.
  5479. * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com
  5480. */
  5481. function getProxyUrl(serverUrl) {
  5482. const proxyUrl = pm.getProxyUrl(new URL(serverUrl));
  5483. return proxyUrl ? proxyUrl.href : '';
  5484. }
  5485. exports.getProxyUrl = getProxyUrl;
  5486. const HttpRedirectCodes = [
  5487. HttpCodes.MovedPermanently,
  5488. HttpCodes.ResourceMoved,
  5489. HttpCodes.SeeOther,
  5490. HttpCodes.TemporaryRedirect,
  5491. HttpCodes.PermanentRedirect
  5492. ];
  5493. const HttpResponseRetryCodes = [
  5494. HttpCodes.BadGateway,
  5495. HttpCodes.ServiceUnavailable,
  5496. HttpCodes.GatewayTimeout
  5497. ];
  5498. const RetryableHttpVerbs = ['OPTIONS', 'GET', 'DELETE', 'HEAD'];
  5499. const ExponentialBackoffCeiling = 10;
  5500. const ExponentialBackoffTimeSlice = 5;
  5501. class HttpClientError extends Error {
  5502. constructor(message, statusCode) {
  5503. super(message);
  5504. this.name = 'HttpClientError';
  5505. this.statusCode = statusCode;
  5506. Object.setPrototypeOf(this, HttpClientError.prototype);
  5507. }
  5508. }
  5509. exports.HttpClientError = HttpClientError;
  5510. class HttpClientResponse {
  5511. constructor(message) {
  5512. this.message = message;
  5513. }
  5514. readBody() {
  5515. return __awaiter(this, void 0, void 0, function* () {
  5516. return new Promise((resolve) => __awaiter(this, void 0, void 0, function* () {
  5517. let output = Buffer.alloc(0);
  5518. this.message.on('data', (chunk) => {
  5519. output = Buffer.concat([output, chunk]);
  5520. });
  5521. this.message.on('end', () => {
  5522. resolve(output.toString());
  5523. });
  5524. }));
  5525. });
  5526. }
  5527. readBodyBuffer() {
  5528. return __awaiter(this, void 0, void 0, function* () {
  5529. return new Promise((resolve) => __awaiter(this, void 0, void 0, function* () {
  5530. const chunks = [];
  5531. this.message.on('data', (chunk) => {
  5532. chunks.push(chunk);
  5533. });
  5534. this.message.on('end', () => {
  5535. resolve(Buffer.concat(chunks));
  5536. });
  5537. }));
  5538. });
  5539. }
  5540. }
  5541. exports.HttpClientResponse = HttpClientResponse;
  5542. function isHttps(requestUrl) {
  5543. const parsedUrl = new URL(requestUrl);
  5544. return parsedUrl.protocol === 'https:';
  5545. }
  5546. exports.isHttps = isHttps;
  5547. class HttpClient {
  5548. constructor(userAgent, handlers, requestOptions) {
  5549. this._ignoreSslError = false;
  5550. this._allowRedirects = true;
  5551. this._allowRedirectDowngrade = false;
  5552. this._maxRedirects = 50;
  5553. this._allowRetries = false;
  5554. this._maxRetries = 1;
  5555. this._keepAlive = false;
  5556. this._disposed = false;
  5557. this.userAgent = userAgent;
  5558. this.handlers = handlers || [];
  5559. this.requestOptions = requestOptions;
  5560. if (requestOptions) {
  5561. if (requestOptions.ignoreSslError != null) {
  5562. this._ignoreSslError = requestOptions.ignoreSslError;
  5563. }
  5564. this._socketTimeout = requestOptions.socketTimeout;
  5565. if (requestOptions.allowRedirects != null) {
  5566. this._allowRedirects = requestOptions.allowRedirects;
  5567. }
  5568. if (requestOptions.allowRedirectDowngrade != null) {
  5569. this._allowRedirectDowngrade = requestOptions.allowRedirectDowngrade;
  5570. }
  5571. if (requestOptions.maxRedirects != null) {
  5572. this._maxRedirects = Math.max(requestOptions.maxRedirects, 0);
  5573. }
  5574. if (requestOptions.keepAlive != null) {
  5575. this._keepAlive = requestOptions.keepAlive;
  5576. }
  5577. if (requestOptions.allowRetries != null) {
  5578. this._allowRetries = requestOptions.allowRetries;
  5579. }
  5580. if (requestOptions.maxRetries != null) {
  5581. this._maxRetries = requestOptions.maxRetries;
  5582. }
  5583. }
  5584. }
  5585. options(requestUrl, additionalHeaders) {
  5586. return __awaiter(this, void 0, void 0, function* () {
  5587. return this.request('OPTIONS', requestUrl, null, additionalHeaders || {});
  5588. });
  5589. }
  5590. get(requestUrl, additionalHeaders) {
  5591. return __awaiter(this, void 0, void 0, function* () {
  5592. return this.request('GET', requestUrl, null, additionalHeaders || {});
  5593. });
  5594. }
  5595. del(requestUrl, additionalHeaders) {
  5596. return __awaiter(this, void 0, void 0, function* () {
  5597. return this.request('DELETE', requestUrl, null, additionalHeaders || {});
  5598. });
  5599. }
  5600. post(requestUrl, data, additionalHeaders) {
  5601. return __awaiter(this, void 0, void 0, function* () {
  5602. return this.request('POST', requestUrl, data, additionalHeaders || {});
  5603. });
  5604. }
  5605. patch(requestUrl, data, additionalHeaders) {
  5606. return __awaiter(this, void 0, void 0, function* () {
  5607. return this.request('PATCH', requestUrl, data, additionalHeaders || {});
  5608. });
  5609. }
  5610. put(requestUrl, data, additionalHeaders) {
  5611. return __awaiter(this, void 0, void 0, function* () {
  5612. return this.request('PUT', requestUrl, data, additionalHeaders || {});
  5613. });
  5614. }
  5615. head(requestUrl, additionalHeaders) {
  5616. return __awaiter(this, void 0, void 0, function* () {
  5617. return this.request('HEAD', requestUrl, null, additionalHeaders || {});
  5618. });
  5619. }
  5620. sendStream(verb, requestUrl, stream, additionalHeaders) {
  5621. return __awaiter(this, void 0, void 0, function* () {
  5622. return this.request(verb, requestUrl, stream, additionalHeaders);
  5623. });
  5624. }
  5625. /**
  5626. * Gets a typed object from an endpoint
  5627. * Be aware that not found returns a null. Other errors (4xx, 5xx) reject the promise
  5628. */
  5629. getJson(requestUrl, additionalHeaders = {}) {
  5630. return __awaiter(this, void 0, void 0, function* () {
  5631. additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
  5632. const res = yield this.get(requestUrl, additionalHeaders);
  5633. return this._processResponse(res, this.requestOptions);
  5634. });
  5635. }
  5636. postJson(requestUrl, obj, additionalHeaders = {}) {
  5637. return __awaiter(this, void 0, void 0, function* () {
  5638. const data = JSON.stringify(obj, null, 2);
  5639. additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
  5640. additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);
  5641. const res = yield this.post(requestUrl, data, additionalHeaders);
  5642. return this._processResponse(res, this.requestOptions);
  5643. });
  5644. }
  5645. putJson(requestUrl, obj, additionalHeaders = {}) {
  5646. return __awaiter(this, void 0, void 0, function* () {
  5647. const data = JSON.stringify(obj, null, 2);
  5648. additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
  5649. additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);
  5650. const res = yield this.put(requestUrl, data, additionalHeaders);
  5651. return this._processResponse(res, this.requestOptions);
  5652. });
  5653. }
  5654. patchJson(requestUrl, obj, additionalHeaders = {}) {
  5655. return __awaiter(this, void 0, void 0, function* () {
  5656. const data = JSON.stringify(obj, null, 2);
  5657. additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
  5658. additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);
  5659. const res = yield this.patch(requestUrl, data, additionalHeaders);
  5660. return this._processResponse(res, this.requestOptions);
  5661. });
  5662. }
  5663. /**
  5664. * Makes a raw http request.
  5665. * All other methods such as get, post, patch, and request ultimately call this.
  5666. * Prefer get, del, post and patch
  5667. */
  5668. request(verb, requestUrl, data, headers) {
  5669. return __awaiter(this, void 0, void 0, function* () {
  5670. if (this._disposed) {
  5671. throw new Error('Client has already been disposed.');
  5672. }
  5673. const parsedUrl = new URL(requestUrl);
  5674. let info = this._prepareRequest(verb, parsedUrl, headers);
  5675. // Only perform retries on reads since writes may not be idempotent.
  5676. const maxTries = this._allowRetries && RetryableHttpVerbs.includes(verb)
  5677. ? this._maxRetries + 1
  5678. : 1;
  5679. let numTries = 0;
  5680. let response;
  5681. do {
  5682. response = yield this.requestRaw(info, data);
  5683. // Check if it's an authentication challenge
  5684. if (response &&
  5685. response.message &&
  5686. response.message.statusCode === HttpCodes.Unauthorized) {
  5687. let authenticationHandler;
  5688. for (const handler of this.handlers) {
  5689. if (handler.canHandleAuthentication(response)) {
  5690. authenticationHandler = handler;
  5691. break;
  5692. }
  5693. }
  5694. if (authenticationHandler) {
  5695. return authenticationHandler.handleAuthentication(this, info, data);
  5696. }
  5697. else {
  5698. // We have received an unauthorized response but have no handlers to handle it.
  5699. // Let the response return to the caller.
  5700. return response;
  5701. }
  5702. }
  5703. let redirectsRemaining = this._maxRedirects;
  5704. while (response.message.statusCode &&
  5705. HttpRedirectCodes.includes(response.message.statusCode) &&
  5706. this._allowRedirects &&
  5707. redirectsRemaining > 0) {
  5708. const redirectUrl = response.message.headers['location'];
  5709. if (!redirectUrl) {
  5710. // if there's no location to redirect to, we won't
  5711. break;
  5712. }
  5713. const parsedRedirectUrl = new URL(redirectUrl);
  5714. if (parsedUrl.protocol === 'https:' &&
  5715. parsedUrl.protocol !== parsedRedirectUrl.protocol &&
  5716. !this._allowRedirectDowngrade) {
  5717. 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.');
  5718. }
  5719. // we need to finish reading the response before reassigning response
  5720. // which will leak the open socket.
  5721. yield response.readBody();
  5722. // strip authorization header if redirected to a different hostname
  5723. if (parsedRedirectUrl.hostname !== parsedUrl.hostname) {
  5724. for (const header in headers) {
  5725. // header names are case insensitive
  5726. if (header.toLowerCase() === 'authorization') {
  5727. delete headers[header];
  5728. }
  5729. }
  5730. }
  5731. // let's make the request with the new redirectUrl
  5732. info = this._prepareRequest(verb, parsedRedirectUrl, headers);
  5733. response = yield this.requestRaw(info, data);
  5734. redirectsRemaining--;
  5735. }
  5736. if (!response.message.statusCode ||
  5737. !HttpResponseRetryCodes.includes(response.message.statusCode)) {
  5738. // If not a retry code, return immediately instead of retrying
  5739. return response;
  5740. }
  5741. numTries += 1;
  5742. if (numTries < maxTries) {
  5743. yield response.readBody();
  5744. yield this._performExponentialBackoff(numTries);
  5745. }
  5746. } while (numTries < maxTries);
  5747. return response;
  5748. });
  5749. }
  5750. /**
  5751. * Needs to be called if keepAlive is set to true in request options.
  5752. */
  5753. dispose() {
  5754. if (this._agent) {
  5755. this._agent.destroy();
  5756. }
  5757. this._disposed = true;
  5758. }
  5759. /**
  5760. * Raw request.
  5761. * @param info
  5762. * @param data
  5763. */
  5764. requestRaw(info, data) {
  5765. return __awaiter(this, void 0, void 0, function* () {
  5766. return new Promise((resolve, reject) => {
  5767. function callbackForResult(err, res) {
  5768. if (err) {
  5769. reject(err);
  5770. }
  5771. else if (!res) {
  5772. // If `err` is not passed, then `res` must be passed.
  5773. reject(new Error('Unknown error'));
  5774. }
  5775. else {
  5776. resolve(res);
  5777. }
  5778. }
  5779. this.requestRawWithCallback(info, data, callbackForResult);
  5780. });
  5781. });
  5782. }
  5783. /**
  5784. * Raw request with callback.
  5785. * @param info
  5786. * @param data
  5787. * @param onResult
  5788. */
  5789. requestRawWithCallback(info, data, onResult) {
  5790. if (typeof data === 'string') {
  5791. if (!info.options.headers) {
  5792. info.options.headers = {};
  5793. }
  5794. info.options.headers['Content-Length'] = Buffer.byteLength(data, 'utf8');
  5795. }
  5796. let callbackCalled = false;
  5797. function handleResult(err, res) {
  5798. if (!callbackCalled) {
  5799. callbackCalled = true;
  5800. onResult(err, res);
  5801. }
  5802. }
  5803. const req = info.httpModule.request(info.options, (msg) => {
  5804. const res = new HttpClientResponse(msg);
  5805. handleResult(undefined, res);
  5806. });
  5807. let socket;
  5808. req.on('socket', sock => {
  5809. socket = sock;
  5810. });
  5811. // If we ever get disconnected, we want the socket to timeout eventually
  5812. req.setTimeout(this._socketTimeout || 3 * 60000, () => {
  5813. if (socket) {
  5814. socket.end();
  5815. }
  5816. handleResult(new Error(`Request timeout: ${info.options.path}`));
  5817. });
  5818. req.on('error', function (err) {
  5819. // err has statusCode property
  5820. // res should have headers
  5821. handleResult(err);
  5822. });
  5823. if (data && typeof data === 'string') {
  5824. req.write(data, 'utf8');
  5825. }
  5826. if (data && typeof data !== 'string') {
  5827. data.on('close', function () {
  5828. req.end();
  5829. });
  5830. data.pipe(req);
  5831. }
  5832. else {
  5833. req.end();
  5834. }
  5835. }
  5836. /**
  5837. * Gets an http agent. This function is useful when you need an http agent that handles
  5838. * routing through a proxy server - depending upon the url and proxy environment variables.
  5839. * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com
  5840. */
  5841. getAgent(serverUrl) {
  5842. const parsedUrl = new URL(serverUrl);
  5843. return this._getAgent(parsedUrl);
  5844. }
  5845. getAgentDispatcher(serverUrl) {
  5846. const parsedUrl = new URL(serverUrl);
  5847. const proxyUrl = pm.getProxyUrl(parsedUrl);
  5848. const useProxy = proxyUrl && proxyUrl.hostname;
  5849. if (!useProxy) {
  5850. return;
  5851. }
  5852. return this._getProxyAgentDispatcher(parsedUrl, proxyUrl);
  5853. }
  5854. _prepareRequest(method, requestUrl, headers) {
  5855. const info = {};
  5856. info.parsedUrl = requestUrl;
  5857. const usingSsl = info.parsedUrl.protocol === 'https:';
  5858. info.httpModule = usingSsl ? https : http;
  5859. const defaultPort = usingSsl ? 443 : 80;
  5860. info.options = {};
  5861. info.options.host = info.parsedUrl.hostname;
  5862. info.options.port = info.parsedUrl.port
  5863. ? parseInt(info.parsedUrl.port)
  5864. : defaultPort;
  5865. info.options.path =
  5866. (info.parsedUrl.pathname || '') + (info.parsedUrl.search || '');
  5867. info.options.method = method;
  5868. info.options.headers = this._mergeHeaders(headers);
  5869. if (this.userAgent != null) {
  5870. info.options.headers['user-agent'] = this.userAgent;
  5871. }
  5872. info.options.agent = this._getAgent(info.parsedUrl);
  5873. // gives handlers an opportunity to participate
  5874. if (this.handlers) {
  5875. for (const handler of this.handlers) {
  5876. handler.prepareRequest(info.options);
  5877. }
  5878. }
  5879. return info;
  5880. }
  5881. _mergeHeaders(headers) {
  5882. if (this.requestOptions && this.requestOptions.headers) {
  5883. return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers || {}));
  5884. }
  5885. return lowercaseKeys(headers || {});
  5886. }
  5887. _getExistingOrDefaultHeader(additionalHeaders, header, _default) {
  5888. let clientHeader;
  5889. if (this.requestOptions && this.requestOptions.headers) {
  5890. clientHeader = lowercaseKeys(this.requestOptions.headers)[header];
  5891. }
  5892. return additionalHeaders[header] || clientHeader || _default;
  5893. }
  5894. _getAgent(parsedUrl) {
  5895. let agent;
  5896. const proxyUrl = pm.getProxyUrl(parsedUrl);
  5897. const useProxy = proxyUrl && proxyUrl.hostname;
  5898. if (this._keepAlive && useProxy) {
  5899. agent = this._proxyAgent;
  5900. }
  5901. if (!useProxy) {
  5902. agent = this._agent;
  5903. }
  5904. // if agent is already assigned use that agent.
  5905. if (agent) {
  5906. return agent;
  5907. }
  5908. const usingSsl = parsedUrl.protocol === 'https:';
  5909. let maxSockets = 100;
  5910. if (this.requestOptions) {
  5911. maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets;
  5912. }
  5913. // This is `useProxy` again, but we need to check `proxyURl` directly for TypeScripts's flow analysis.
  5914. if (proxyUrl && proxyUrl.hostname) {
  5915. const agentOptions = {
  5916. maxSockets,
  5917. keepAlive: this._keepAlive,
  5918. proxy: Object.assign(Object.assign({}, ((proxyUrl.username || proxyUrl.password) && {
  5919. proxyAuth: `${proxyUrl.username}:${proxyUrl.password}`
  5920. })), { host: proxyUrl.hostname, port: proxyUrl.port })
  5921. };
  5922. let tunnelAgent;
  5923. const overHttps = proxyUrl.protocol === 'https:';
  5924. if (usingSsl) {
  5925. tunnelAgent = overHttps ? tunnel.httpsOverHttps : tunnel.httpsOverHttp;
  5926. }
  5927. else {
  5928. tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp;
  5929. }
  5930. agent = tunnelAgent(agentOptions);
  5931. this._proxyAgent = agent;
  5932. }
  5933. // if tunneling agent isn't assigned create a new agent
  5934. if (!agent) {
  5935. const options = { keepAlive: this._keepAlive, maxSockets };
  5936. agent = usingSsl ? new https.Agent(options) : new http.Agent(options);
  5937. this._agent = agent;
  5938. }
  5939. if (usingSsl && this._ignoreSslError) {
  5940. // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process
  5941. // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options
  5942. // we have to cast it to any and change it directly
  5943. agent.options = Object.assign(agent.options || {}, {
  5944. rejectUnauthorized: false
  5945. });
  5946. }
  5947. return agent;
  5948. }
  5949. _getProxyAgentDispatcher(parsedUrl, proxyUrl) {
  5950. let proxyAgent;
  5951. if (this._keepAlive) {
  5952. proxyAgent = this._proxyAgentDispatcher;
  5953. }
  5954. // if agent is already assigned use that agent.
  5955. if (proxyAgent) {
  5956. return proxyAgent;
  5957. }
  5958. const usingSsl = parsedUrl.protocol === 'https:';
  5959. proxyAgent = new undici_1.ProxyAgent(Object.assign({ uri: proxyUrl.href, pipelining: !this._keepAlive ? 0 : 1 }, ((proxyUrl.username || proxyUrl.password) && {
  5960. token: `${proxyUrl.username}:${proxyUrl.password}`
  5961. })));
  5962. this._proxyAgentDispatcher = proxyAgent;
  5963. if (usingSsl && this._ignoreSslError) {
  5964. // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process
  5965. // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options
  5966. // we have to cast it to any and change it directly
  5967. proxyAgent.options = Object.assign(proxyAgent.options.requestTls || {}, {
  5968. rejectUnauthorized: false
  5969. });
  5970. }
  5971. return proxyAgent;
  5972. }
  5973. _performExponentialBackoff(retryNumber) {
  5974. return __awaiter(this, void 0, void 0, function* () {
  5975. retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber);
  5976. const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber);
  5977. return new Promise(resolve => setTimeout(() => resolve(), ms));
  5978. });
  5979. }
  5980. _processResponse(res, options) {
  5981. return __awaiter(this, void 0, void 0, function* () {
  5982. return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
  5983. const statusCode = res.message.statusCode || 0;
  5984. const response = {
  5985. statusCode,
  5986. result: null,
  5987. headers: {}
  5988. };
  5989. // not found leads to null obj returned
  5990. if (statusCode === HttpCodes.NotFound) {
  5991. resolve(response);
  5992. }
  5993. // get the result from the body
  5994. function dateTimeDeserializer(key, value) {
  5995. if (typeof value === 'string') {
  5996. const a = new Date(value);
  5997. if (!isNaN(a.valueOf())) {
  5998. return a;
  5999. }
  6000. }
  6001. return value;
  6002. }
  6003. let obj;
  6004. let contents;
  6005. try {
  6006. contents = yield res.readBody();
  6007. if (contents && contents.length > 0) {
  6008. if (options && options.deserializeDates) {
  6009. obj = JSON.parse(contents, dateTimeDeserializer);
  6010. }
  6011. else {
  6012. obj = JSON.parse(contents);
  6013. }
  6014. response.result = obj;
  6015. }
  6016. response.headers = res.message.headers;
  6017. }
  6018. catch (err) {
  6019. // Invalid resource (contents not json); leaving result obj null
  6020. }
  6021. // note that 3xx redirects are handled by the http layer.
  6022. if (statusCode > 299) {
  6023. let msg;
  6024. // if exception/error in body, attempt to get better error
  6025. if (obj && obj.message) {
  6026. msg = obj.message;
  6027. }
  6028. else if (contents && contents.length > 0) {
  6029. // it may be the case that the exception is in the body message as string
  6030. msg = contents;
  6031. }
  6032. else {
  6033. msg = `Failed request: (${statusCode})`;
  6034. }
  6035. const err = new HttpClientError(msg, statusCode);
  6036. err.result = response.result;
  6037. reject(err);
  6038. }
  6039. else {
  6040. resolve(response);
  6041. }
  6042. }));
  6043. });
  6044. }
  6045. }
  6046. exports.HttpClient = HttpClient;
  6047. const lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCase()] = obj[k]), c), {});
  6048. //# sourceMappingURL=index.js.map
  6049. /***/ }),
  6050. /***/ 9835:
  6051. /***/ ((__unused_webpack_module, exports) => {
  6052. "use strict";
  6053. Object.defineProperty(exports, "__esModule", ({ value: true }));
  6054. exports.checkBypass = exports.getProxyUrl = void 0;
  6055. function getProxyUrl(reqUrl) {
  6056. const usingSsl = reqUrl.protocol === 'https:';
  6057. if (checkBypass(reqUrl)) {
  6058. return undefined;
  6059. }
  6060. const proxyVar = (() => {
  6061. if (usingSsl) {
  6062. return process.env['https_proxy'] || process.env['HTTPS_PROXY'];
  6063. }
  6064. else {
  6065. return process.env['http_proxy'] || process.env['HTTP_PROXY'];
  6066. }
  6067. })();
  6068. if (proxyVar) {
  6069. try {
  6070. return new URL(proxyVar);
  6071. }
  6072. catch (_a) {
  6073. if (!proxyVar.startsWith('http://') && !proxyVar.startsWith('https://'))
  6074. return new URL(`http://${proxyVar}`);
  6075. }
  6076. }
  6077. else {
  6078. return undefined;
  6079. }
  6080. }
  6081. exports.getProxyUrl = getProxyUrl;
  6082. function checkBypass(reqUrl) {
  6083. if (!reqUrl.hostname) {
  6084. return false;
  6085. }
  6086. const reqHost = reqUrl.hostname;
  6087. if (isLoopbackAddress(reqHost)) {
  6088. return true;
  6089. }
  6090. const noProxy = process.env['no_proxy'] || process.env['NO_PROXY'] || '';
  6091. if (!noProxy) {
  6092. return false;
  6093. }
  6094. // Determine the request port
  6095. let reqPort;
  6096. if (reqUrl.port) {
  6097. reqPort = Number(reqUrl.port);
  6098. }
  6099. else if (reqUrl.protocol === 'http:') {
  6100. reqPort = 80;
  6101. }
  6102. else if (reqUrl.protocol === 'https:') {
  6103. reqPort = 443;
  6104. }
  6105. // Format the request hostname and hostname with port
  6106. const upperReqHosts = [reqUrl.hostname.toUpperCase()];
  6107. if (typeof reqPort === 'number') {
  6108. upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`);
  6109. }
  6110. // Compare request host against noproxy
  6111. for (const upperNoProxyItem of noProxy
  6112. .split(',')
  6113. .map(x => x.trim().toUpperCase())
  6114. .filter(x => x)) {
  6115. if (upperNoProxyItem === '*' ||
  6116. upperReqHosts.some(x => x === upperNoProxyItem ||
  6117. x.endsWith(`.${upperNoProxyItem}`) ||
  6118. (upperNoProxyItem.startsWith('.') &&
  6119. x.endsWith(`${upperNoProxyItem}`)))) {
  6120. return true;
  6121. }
  6122. }
  6123. return false;
  6124. }
  6125. exports.checkBypass = checkBypass;
  6126. function isLoopbackAddress(host) {
  6127. const hostLower = host.toLowerCase();
  6128. return (hostLower === 'localhost' ||
  6129. hostLower.startsWith('127.') ||
  6130. hostLower.startsWith('[::1]') ||
  6131. hostLower.startsWith('[0:0:0:0:0:0:0:1]'));
  6132. }
  6133. //# sourceMappingURL=proxy.js.map
  6134. /***/ }),
  6135. /***/ 1962:
  6136. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  6137. "use strict";
  6138. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  6139. if (k2 === undefined) k2 = k;
  6140. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  6141. }) : (function(o, m, k, k2) {
  6142. if (k2 === undefined) k2 = k;
  6143. o[k2] = m[k];
  6144. }));
  6145. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  6146. Object.defineProperty(o, "default", { enumerable: true, value: v });
  6147. }) : function(o, v) {
  6148. o["default"] = v;
  6149. });
  6150. var __importStar = (this && this.__importStar) || function (mod) {
  6151. if (mod && mod.__esModule) return mod;
  6152. var result = {};
  6153. if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  6154. __setModuleDefault(result, mod);
  6155. return result;
  6156. };
  6157. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  6158. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  6159. return new (P || (P = Promise))(function (resolve, reject) {
  6160. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  6161. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  6162. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  6163. step((generator = generator.apply(thisArg, _arguments || [])).next());
  6164. });
  6165. };
  6166. var _a;
  6167. Object.defineProperty(exports, "__esModule", ({ value: true }));
  6168. 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;
  6169. const fs = __importStar(__nccwpck_require__(7147));
  6170. const path = __importStar(__nccwpck_require__(1017));
  6171. _a = fs.promises
  6172. // export const {open} = 'fs'
  6173. , 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;
  6174. // export const {open} = 'fs'
  6175. exports.IS_WINDOWS = process.platform === 'win32';
  6176. // See https://github.com/nodejs/node/blob/d0153aee367422d0858105abec186da4dff0a0c5/deps/uv/include/uv/win.h#L691
  6177. exports.UV_FS_O_EXLOCK = 0x10000000;
  6178. exports.READONLY = fs.constants.O_RDONLY;
  6179. function exists(fsPath) {
  6180. return __awaiter(this, void 0, void 0, function* () {
  6181. try {
  6182. yield exports.stat(fsPath);
  6183. }
  6184. catch (err) {
  6185. if (err.code === 'ENOENT') {
  6186. return false;
  6187. }
  6188. throw err;
  6189. }
  6190. return true;
  6191. });
  6192. }
  6193. exports.exists = exists;
  6194. function isDirectory(fsPath, useStat = false) {
  6195. return __awaiter(this, void 0, void 0, function* () {
  6196. const stats = useStat ? yield exports.stat(fsPath) : yield exports.lstat(fsPath);
  6197. return stats.isDirectory();
  6198. });
  6199. }
  6200. exports.isDirectory = isDirectory;
  6201. /**
  6202. * On OSX/Linux, true if path starts with '/'. On Windows, true for paths like:
  6203. * \, \hello, \\hello\share, C:, and C:\hello (and corresponding alternate separator cases).
  6204. */
  6205. function isRooted(p) {
  6206. p = normalizeSeparators(p);
  6207. if (!p) {
  6208. throw new Error('isRooted() parameter "p" cannot be empty');
  6209. }
  6210. if (exports.IS_WINDOWS) {
  6211. return (p.startsWith('\\') || /^[A-Z]:/i.test(p) // e.g. \ or \hello or \\hello
  6212. ); // e.g. C: or C:\hello
  6213. }
  6214. return p.startsWith('/');
  6215. }
  6216. exports.isRooted = isRooted;
  6217. /**
  6218. * Best effort attempt to determine whether a file exists and is executable.
  6219. * @param filePath file path to check
  6220. * @param extensions additional file extensions to try
  6221. * @return if file exists and is executable, returns the file path. otherwise empty string.
  6222. */
  6223. function tryGetExecutablePath(filePath, extensions) {
  6224. return __awaiter(this, void 0, void 0, function* () {
  6225. let stats = undefined;
  6226. try {
  6227. // test file exists
  6228. stats = yield exports.stat(filePath);
  6229. }
  6230. catch (err) {
  6231. if (err.code !== 'ENOENT') {
  6232. // eslint-disable-next-line no-console
  6233. console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`);
  6234. }
  6235. }
  6236. if (stats && stats.isFile()) {
  6237. if (exports.IS_WINDOWS) {
  6238. // on Windows, test for valid extension
  6239. const upperExt = path.extname(filePath).toUpperCase();
  6240. if (extensions.some(validExt => validExt.toUpperCase() === upperExt)) {
  6241. return filePath;
  6242. }
  6243. }
  6244. else {
  6245. if (isUnixExecutable(stats)) {
  6246. return filePath;
  6247. }
  6248. }
  6249. }
  6250. // try each extension
  6251. const originalFilePath = filePath;
  6252. for (const extension of extensions) {
  6253. filePath = originalFilePath + extension;
  6254. stats = undefined;
  6255. try {
  6256. stats = yield exports.stat(filePath);
  6257. }
  6258. catch (err) {
  6259. if (err.code !== 'ENOENT') {
  6260. // eslint-disable-next-line no-console
  6261. console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`);
  6262. }
  6263. }
  6264. if (stats && stats.isFile()) {
  6265. if (exports.IS_WINDOWS) {
  6266. // preserve the case of the actual file (since an extension was appended)
  6267. try {
  6268. const directory = path.dirname(filePath);
  6269. const upperName = path.basename(filePath).toUpperCase();
  6270. for (const actualName of yield exports.readdir(directory)) {
  6271. if (upperName === actualName.toUpperCase()) {
  6272. filePath = path.join(directory, actualName);
  6273. break;
  6274. }
  6275. }
  6276. }
  6277. catch (err) {
  6278. // eslint-disable-next-line no-console
  6279. console.log(`Unexpected error attempting to determine the actual case of the file '${filePath}': ${err}`);
  6280. }
  6281. return filePath;
  6282. }
  6283. else {
  6284. if (isUnixExecutable(stats)) {
  6285. return filePath;
  6286. }
  6287. }
  6288. }
  6289. }
  6290. return '';
  6291. });
  6292. }
  6293. exports.tryGetExecutablePath = tryGetExecutablePath;
  6294. function normalizeSeparators(p) {
  6295. p = p || '';
  6296. if (exports.IS_WINDOWS) {
  6297. // convert slashes on Windows
  6298. p = p.replace(/\//g, '\\');
  6299. // remove redundant slashes
  6300. return p.replace(/\\\\+/g, '\\');
  6301. }
  6302. // remove redundant slashes
  6303. return p.replace(/\/\/+/g, '/');
  6304. }
  6305. // on Mac/Linux, test the execute bit
  6306. // R W X R W X R W X
  6307. // 256 128 64 32 16 8 4 2 1
  6308. function isUnixExecutable(stats) {
  6309. return ((stats.mode & 1) > 0 ||
  6310. ((stats.mode & 8) > 0 && stats.gid === process.getgid()) ||
  6311. ((stats.mode & 64) > 0 && stats.uid === process.getuid()));
  6312. }
  6313. // Get the path of cmd.exe in windows
  6314. function getCmdPath() {
  6315. var _a;
  6316. return (_a = process.env['COMSPEC']) !== null && _a !== void 0 ? _a : `cmd.exe`;
  6317. }
  6318. exports.getCmdPath = getCmdPath;
  6319. //# sourceMappingURL=io-util.js.map
  6320. /***/ }),
  6321. /***/ 7436:
  6322. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  6323. "use strict";
  6324. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  6325. if (k2 === undefined) k2 = k;
  6326. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  6327. }) : (function(o, m, k, k2) {
  6328. if (k2 === undefined) k2 = k;
  6329. o[k2] = m[k];
  6330. }));
  6331. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  6332. Object.defineProperty(o, "default", { enumerable: true, value: v });
  6333. }) : function(o, v) {
  6334. o["default"] = v;
  6335. });
  6336. var __importStar = (this && this.__importStar) || function (mod) {
  6337. if (mod && mod.__esModule) return mod;
  6338. var result = {};
  6339. if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  6340. __setModuleDefault(result, mod);
  6341. return result;
  6342. };
  6343. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  6344. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  6345. return new (P || (P = Promise))(function (resolve, reject) {
  6346. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  6347. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  6348. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  6349. step((generator = generator.apply(thisArg, _arguments || [])).next());
  6350. });
  6351. };
  6352. Object.defineProperty(exports, "__esModule", ({ value: true }));
  6353. exports.findInPath = exports.which = exports.mkdirP = exports.rmRF = exports.mv = exports.cp = void 0;
  6354. const assert_1 = __nccwpck_require__(9491);
  6355. const path = __importStar(__nccwpck_require__(1017));
  6356. const ioUtil = __importStar(__nccwpck_require__(1962));
  6357. /**
  6358. * Copies a file or folder.
  6359. * Based off of shelljs - https://github.com/shelljs/shelljs/blob/9237f66c52e5daa40458f94f9565e18e8132f5a6/src/cp.js
  6360. *
  6361. * @param source source path
  6362. * @param dest destination path
  6363. * @param options optional. See CopyOptions.
  6364. */
  6365. function cp(source, dest, options = {}) {
  6366. return __awaiter(this, void 0, void 0, function* () {
  6367. const { force, recursive, copySourceDirectory } = readCopyOptions(options);
  6368. const destStat = (yield ioUtil.exists(dest)) ? yield ioUtil.stat(dest) : null;
  6369. // Dest is an existing file, but not forcing
  6370. if (destStat && destStat.isFile() && !force) {
  6371. return;
  6372. }
  6373. // If dest is an existing directory, should copy inside.
  6374. const newDest = destStat && destStat.isDirectory() && copySourceDirectory
  6375. ? path.join(dest, path.basename(source))
  6376. : dest;
  6377. if (!(yield ioUtil.exists(source))) {
  6378. throw new Error(`no such file or directory: ${source}`);
  6379. }
  6380. const sourceStat = yield ioUtil.stat(source);
  6381. if (sourceStat.isDirectory()) {
  6382. if (!recursive) {
  6383. throw new Error(`Failed to copy. ${source} is a directory, but tried to copy without recursive flag.`);
  6384. }
  6385. else {
  6386. yield cpDirRecursive(source, newDest, 0, force);
  6387. }
  6388. }
  6389. else {
  6390. if (path.relative(source, newDest) === '') {
  6391. // a file cannot be copied to itself
  6392. throw new Error(`'${newDest}' and '${source}' are the same file`);
  6393. }
  6394. yield copyFile(source, newDest, force);
  6395. }
  6396. });
  6397. }
  6398. exports.cp = cp;
  6399. /**
  6400. * Moves a path.
  6401. *
  6402. * @param source source path
  6403. * @param dest destination path
  6404. * @param options optional. See MoveOptions.
  6405. */
  6406. function mv(source, dest, options = {}) {
  6407. return __awaiter(this, void 0, void 0, function* () {
  6408. if (yield ioUtil.exists(dest)) {
  6409. let destExists = true;
  6410. if (yield ioUtil.isDirectory(dest)) {
  6411. // If dest is directory copy src into dest
  6412. dest = path.join(dest, path.basename(source));
  6413. destExists = yield ioUtil.exists(dest);
  6414. }
  6415. if (destExists) {
  6416. if (options.force == null || options.force) {
  6417. yield rmRF(dest);
  6418. }
  6419. else {
  6420. throw new Error('Destination already exists');
  6421. }
  6422. }
  6423. }
  6424. yield mkdirP(path.dirname(dest));
  6425. yield ioUtil.rename(source, dest);
  6426. });
  6427. }
  6428. exports.mv = mv;
  6429. /**
  6430. * Remove a path recursively with force
  6431. *
  6432. * @param inputPath path to remove
  6433. */
  6434. function rmRF(inputPath) {
  6435. return __awaiter(this, void 0, void 0, function* () {
  6436. if (ioUtil.IS_WINDOWS) {
  6437. // Check for invalid characters
  6438. // https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file
  6439. if (/[*"<>|]/.test(inputPath)) {
  6440. throw new Error('File path must not contain `*`, `"`, `<`, `>` or `|` on Windows');
  6441. }
  6442. }
  6443. try {
  6444. // note if path does not exist, error is silent
  6445. yield ioUtil.rm(inputPath, {
  6446. force: true,
  6447. maxRetries: 3,
  6448. recursive: true,
  6449. retryDelay: 300
  6450. });
  6451. }
  6452. catch (err) {
  6453. throw new Error(`File was unable to be removed ${err}`);
  6454. }
  6455. });
  6456. }
  6457. exports.rmRF = rmRF;
  6458. /**
  6459. * Make a directory. Creates the full path with folders in between
  6460. * Will throw if it fails
  6461. *
  6462. * @param fsPath path to create
  6463. * @returns Promise<void>
  6464. */
  6465. function mkdirP(fsPath) {
  6466. return __awaiter(this, void 0, void 0, function* () {
  6467. assert_1.ok(fsPath, 'a path argument must be provided');
  6468. yield ioUtil.mkdir(fsPath, { recursive: true });
  6469. });
  6470. }
  6471. exports.mkdirP = mkdirP;
  6472. /**
  6473. * Returns path of a tool had the tool actually been invoked. Resolves via paths.
  6474. * If you check and the tool does not exist, it will throw.
  6475. *
  6476. * @param tool name of the tool
  6477. * @param check whether to check if tool exists
  6478. * @returns Promise<string> path to tool
  6479. */
  6480. function which(tool, check) {
  6481. return __awaiter(this, void 0, void 0, function* () {
  6482. if (!tool) {
  6483. throw new Error("parameter 'tool' is required");
  6484. }
  6485. // recursive when check=true
  6486. if (check) {
  6487. const result = yield which(tool, false);
  6488. if (!result) {
  6489. if (ioUtil.IS_WINDOWS) {
  6490. 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.`);
  6491. }
  6492. else {
  6493. 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.`);
  6494. }
  6495. }
  6496. return result;
  6497. }
  6498. const matches = yield findInPath(tool);
  6499. if (matches && matches.length > 0) {
  6500. return matches[0];
  6501. }
  6502. return '';
  6503. });
  6504. }
  6505. exports.which = which;
  6506. /**
  6507. * Returns a list of all occurrences of the given tool on the system path.
  6508. *
  6509. * @returns Promise<string[]> the paths of the tool
  6510. */
  6511. function findInPath(tool) {
  6512. return __awaiter(this, void 0, void 0, function* () {
  6513. if (!tool) {
  6514. throw new Error("parameter 'tool' is required");
  6515. }
  6516. // build the list of extensions to try
  6517. const extensions = [];
  6518. if (ioUtil.IS_WINDOWS && process.env['PATHEXT']) {
  6519. for (const extension of process.env['PATHEXT'].split(path.delimiter)) {
  6520. if (extension) {
  6521. extensions.push(extension);
  6522. }
  6523. }
  6524. }
  6525. // if it's rooted, return it if exists. otherwise return empty.
  6526. if (ioUtil.isRooted(tool)) {
  6527. const filePath = yield ioUtil.tryGetExecutablePath(tool, extensions);
  6528. if (filePath) {
  6529. return [filePath];
  6530. }
  6531. return [];
  6532. }
  6533. // if any path separators, return empty
  6534. if (tool.includes(path.sep)) {
  6535. return [];
  6536. }
  6537. // build the list of directories
  6538. //
  6539. // Note, technically "where" checks the current directory on Windows. From a toolkit perspective,
  6540. // it feels like we should not do this. Checking the current directory seems like more of a use
  6541. // case of a shell, and the which() function exposed by the toolkit should strive for consistency
  6542. // across platforms.
  6543. const directories = [];
  6544. if (process.env.PATH) {
  6545. for (const p of process.env.PATH.split(path.delimiter)) {
  6546. if (p) {
  6547. directories.push(p);
  6548. }
  6549. }
  6550. }
  6551. // find all matches
  6552. const matches = [];
  6553. for (const directory of directories) {
  6554. const filePath = yield ioUtil.tryGetExecutablePath(path.join(directory, tool), extensions);
  6555. if (filePath) {
  6556. matches.push(filePath);
  6557. }
  6558. }
  6559. return matches;
  6560. });
  6561. }
  6562. exports.findInPath = findInPath;
  6563. function readCopyOptions(options) {
  6564. const force = options.force == null ? true : options.force;
  6565. const recursive = Boolean(options.recursive);
  6566. const copySourceDirectory = options.copySourceDirectory == null
  6567. ? true
  6568. : Boolean(options.copySourceDirectory);
  6569. return { force, recursive, copySourceDirectory };
  6570. }
  6571. function cpDirRecursive(sourceDir, destDir, currentDepth, force) {
  6572. return __awaiter(this, void 0, void 0, function* () {
  6573. // Ensure there is not a run away recursive copy
  6574. if (currentDepth >= 255)
  6575. return;
  6576. currentDepth++;
  6577. yield mkdirP(destDir);
  6578. const files = yield ioUtil.readdir(sourceDir);
  6579. for (const fileName of files) {
  6580. const srcFile = `${sourceDir}/${fileName}`;
  6581. const destFile = `${destDir}/${fileName}`;
  6582. const srcFileStat = yield ioUtil.lstat(srcFile);
  6583. if (srcFileStat.isDirectory()) {
  6584. // Recurse
  6585. yield cpDirRecursive(srcFile, destFile, currentDepth, force);
  6586. }
  6587. else {
  6588. yield copyFile(srcFile, destFile, force);
  6589. }
  6590. }
  6591. // Change the mode for the newly created directory
  6592. yield ioUtil.chmod(destDir, (yield ioUtil.stat(sourceDir)).mode);
  6593. });
  6594. }
  6595. // Buffered file copy
  6596. function copyFile(srcFile, destFile, force) {
  6597. return __awaiter(this, void 0, void 0, function* () {
  6598. if ((yield ioUtil.lstat(srcFile)).isSymbolicLink()) {
  6599. // unlink/re-link it
  6600. try {
  6601. yield ioUtil.lstat(destFile);
  6602. yield ioUtil.unlink(destFile);
  6603. }
  6604. catch (e) {
  6605. // Try to override file permission
  6606. if (e.code === 'EPERM') {
  6607. yield ioUtil.chmod(destFile, '0666');
  6608. yield ioUtil.unlink(destFile);
  6609. }
  6610. // other errors = it doesn't exist, no work to do
  6611. }
  6612. // Copy over symlink
  6613. const symlinkFull = yield ioUtil.readlink(srcFile);
  6614. yield ioUtil.symlink(symlinkFull, destFile, ioUtil.IS_WINDOWS ? 'junction' : null);
  6615. }
  6616. else if (!(yield ioUtil.exists(destFile)) || force) {
  6617. yield ioUtil.copyFile(srcFile, destFile);
  6618. }
  6619. });
  6620. }
  6621. //# sourceMappingURL=io.js.map
  6622. /***/ }),
  6623. /***/ 2473:
  6624. /***/ (function(module, exports, __nccwpck_require__) {
  6625. "use strict";
  6626. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  6627. if (k2 === undefined) k2 = k;
  6628. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  6629. }) : (function(o, m, k, k2) {
  6630. if (k2 === undefined) k2 = k;
  6631. o[k2] = m[k];
  6632. }));
  6633. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  6634. Object.defineProperty(o, "default", { enumerable: true, value: v });
  6635. }) : function(o, v) {
  6636. o["default"] = v;
  6637. });
  6638. var __importStar = (this && this.__importStar) || function (mod) {
  6639. if (mod && mod.__esModule) return mod;
  6640. var result = {};
  6641. if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  6642. __setModuleDefault(result, mod);
  6643. return result;
  6644. };
  6645. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  6646. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  6647. return new (P || (P = Promise))(function (resolve, reject) {
  6648. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  6649. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  6650. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  6651. step((generator = generator.apply(thisArg, _arguments || [])).next());
  6652. });
  6653. };
  6654. Object.defineProperty(exports, "__esModule", ({ value: true }));
  6655. exports._readLinuxVersionFile = exports._getOsVersion = exports._findMatch = void 0;
  6656. const semver = __importStar(__nccwpck_require__(5911));
  6657. const core_1 = __nccwpck_require__(2186);
  6658. // needs to be require for core node modules to be mocked
  6659. /* eslint @typescript-eslint/no-require-imports: 0 */
  6660. const os = __nccwpck_require__(2037);
  6661. const cp = __nccwpck_require__(2081);
  6662. const fs = __nccwpck_require__(7147);
  6663. function _findMatch(versionSpec, stable, candidates, archFilter) {
  6664. return __awaiter(this, void 0, void 0, function* () {
  6665. const platFilter = os.platform();
  6666. let result;
  6667. let match;
  6668. let file;
  6669. for (const candidate of candidates) {
  6670. const version = candidate.version;
  6671. core_1.debug(`check ${version} satisfies ${versionSpec}`);
  6672. if (semver.satisfies(version, versionSpec) &&
  6673. (!stable || candidate.stable === stable)) {
  6674. file = candidate.files.find(item => {
  6675. core_1.debug(`${item.arch}===${archFilter} && ${item.platform}===${platFilter}`);
  6676. let chk = item.arch === archFilter && item.platform === platFilter;
  6677. if (chk && item.platform_version) {
  6678. const osVersion = module.exports._getOsVersion();
  6679. if (osVersion === item.platform_version) {
  6680. chk = true;
  6681. }
  6682. else {
  6683. chk = semver.satisfies(osVersion, item.platform_version);
  6684. }
  6685. }
  6686. return chk;
  6687. });
  6688. if (file) {
  6689. core_1.debug(`matched ${candidate.version}`);
  6690. match = candidate;
  6691. break;
  6692. }
  6693. }
  6694. }
  6695. if (match && file) {
  6696. // clone since we're mutating the file list to be only the file that matches
  6697. result = Object.assign({}, match);
  6698. result.files = [file];
  6699. }
  6700. return result;
  6701. });
  6702. }
  6703. exports._findMatch = _findMatch;
  6704. function _getOsVersion() {
  6705. // TODO: add windows and other linux, arm variants
  6706. // right now filtering on version is only an ubuntu and macos scenario for tools we build for hosted (python)
  6707. const plat = os.platform();
  6708. let version = '';
  6709. if (plat === 'darwin') {
  6710. version = cp.execSync('sw_vers -productVersion').toString();
  6711. }
  6712. else if (plat === 'linux') {
  6713. // lsb_release process not in some containers, readfile
  6714. // Run cat /etc/lsb-release
  6715. // DISTRIB_ID=Ubuntu
  6716. // DISTRIB_RELEASE=18.04
  6717. // DISTRIB_CODENAME=bionic
  6718. // DISTRIB_DESCRIPTION="Ubuntu 18.04.4 LTS"
  6719. const lsbContents = module.exports._readLinuxVersionFile();
  6720. if (lsbContents) {
  6721. const lines = lsbContents.split('\n');
  6722. for (const line of lines) {
  6723. const parts = line.split('=');
  6724. if (parts.length === 2 &&
  6725. (parts[0].trim() === 'VERSION_ID' ||
  6726. parts[0].trim() === 'DISTRIB_RELEASE')) {
  6727. version = parts[1]
  6728. .trim()
  6729. .replace(/^"/, '')
  6730. .replace(/"$/, '');
  6731. break;
  6732. }
  6733. }
  6734. }
  6735. }
  6736. return version;
  6737. }
  6738. exports._getOsVersion = _getOsVersion;
  6739. function _readLinuxVersionFile() {
  6740. const lsbReleaseFile = '/etc/lsb-release';
  6741. const osReleaseFile = '/etc/os-release';
  6742. let contents = '';
  6743. if (fs.existsSync(lsbReleaseFile)) {
  6744. contents = fs.readFileSync(lsbReleaseFile).toString();
  6745. }
  6746. else if (fs.existsSync(osReleaseFile)) {
  6747. contents = fs.readFileSync(osReleaseFile).toString();
  6748. }
  6749. return contents;
  6750. }
  6751. exports._readLinuxVersionFile = _readLinuxVersionFile;
  6752. //# sourceMappingURL=manifest.js.map
  6753. /***/ }),
  6754. /***/ 8279:
  6755. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  6756. "use strict";
  6757. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  6758. if (k2 === undefined) k2 = k;
  6759. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  6760. }) : (function(o, m, k, k2) {
  6761. if (k2 === undefined) k2 = k;
  6762. o[k2] = m[k];
  6763. }));
  6764. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  6765. Object.defineProperty(o, "default", { enumerable: true, value: v });
  6766. }) : function(o, v) {
  6767. o["default"] = v;
  6768. });
  6769. var __importStar = (this && this.__importStar) || function (mod) {
  6770. if (mod && mod.__esModule) return mod;
  6771. var result = {};
  6772. if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  6773. __setModuleDefault(result, mod);
  6774. return result;
  6775. };
  6776. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  6777. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  6778. return new (P || (P = Promise))(function (resolve, reject) {
  6779. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  6780. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  6781. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  6782. step((generator = generator.apply(thisArg, _arguments || [])).next());
  6783. });
  6784. };
  6785. Object.defineProperty(exports, "__esModule", ({ value: true }));
  6786. exports.RetryHelper = void 0;
  6787. const core = __importStar(__nccwpck_require__(2186));
  6788. /**
  6789. * Internal class for retries
  6790. */
  6791. class RetryHelper {
  6792. constructor(maxAttempts, minSeconds, maxSeconds) {
  6793. if (maxAttempts < 1) {
  6794. throw new Error('max attempts should be greater than or equal to 1');
  6795. }
  6796. this.maxAttempts = maxAttempts;
  6797. this.minSeconds = Math.floor(minSeconds);
  6798. this.maxSeconds = Math.floor(maxSeconds);
  6799. if (this.minSeconds > this.maxSeconds) {
  6800. throw new Error('min seconds should be less than or equal to max seconds');
  6801. }
  6802. }
  6803. execute(action, isRetryable) {
  6804. return __awaiter(this, void 0, void 0, function* () {
  6805. let attempt = 1;
  6806. while (attempt < this.maxAttempts) {
  6807. // Try
  6808. try {
  6809. return yield action();
  6810. }
  6811. catch (err) {
  6812. if (isRetryable && !isRetryable(err)) {
  6813. throw err;
  6814. }
  6815. core.info(err.message);
  6816. }
  6817. // Sleep
  6818. const seconds = this.getSleepAmount();
  6819. core.info(`Waiting ${seconds} seconds before trying again`);
  6820. yield this.sleep(seconds);
  6821. attempt++;
  6822. }
  6823. // Last attempt
  6824. return yield action();
  6825. });
  6826. }
  6827. getSleepAmount() {
  6828. return (Math.floor(Math.random() * (this.maxSeconds - this.minSeconds + 1)) +
  6829. this.minSeconds);
  6830. }
  6831. sleep(seconds) {
  6832. return __awaiter(this, void 0, void 0, function* () {
  6833. return new Promise(resolve => setTimeout(resolve, seconds * 1000));
  6834. });
  6835. }
  6836. }
  6837. exports.RetryHelper = RetryHelper;
  6838. //# sourceMappingURL=retry-helper.js.map
  6839. /***/ }),
  6840. /***/ 7784:
  6841. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  6842. "use strict";
  6843. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  6844. if (k2 === undefined) k2 = k;
  6845. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  6846. }) : (function(o, m, k, k2) {
  6847. if (k2 === undefined) k2 = k;
  6848. o[k2] = m[k];
  6849. }));
  6850. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  6851. Object.defineProperty(o, "default", { enumerable: true, value: v });
  6852. }) : function(o, v) {
  6853. o["default"] = v;
  6854. });
  6855. var __importStar = (this && this.__importStar) || function (mod) {
  6856. if (mod && mod.__esModule) return mod;
  6857. var result = {};
  6858. if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  6859. __setModuleDefault(result, mod);
  6860. return result;
  6861. };
  6862. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  6863. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  6864. return new (P || (P = Promise))(function (resolve, reject) {
  6865. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  6866. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  6867. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  6868. step((generator = generator.apply(thisArg, _arguments || [])).next());
  6869. });
  6870. };
  6871. var __importDefault = (this && this.__importDefault) || function (mod) {
  6872. return (mod && mod.__esModule) ? mod : { "default": mod };
  6873. };
  6874. Object.defineProperty(exports, "__esModule", ({ value: true }));
  6875. 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;
  6876. const core = __importStar(__nccwpck_require__(2186));
  6877. const io = __importStar(__nccwpck_require__(7436));
  6878. const fs = __importStar(__nccwpck_require__(7147));
  6879. const mm = __importStar(__nccwpck_require__(2473));
  6880. const os = __importStar(__nccwpck_require__(2037));
  6881. const path = __importStar(__nccwpck_require__(1017));
  6882. const httpm = __importStar(__nccwpck_require__(6255));
  6883. const semver = __importStar(__nccwpck_require__(5911));
  6884. const stream = __importStar(__nccwpck_require__(2781));
  6885. const util = __importStar(__nccwpck_require__(3837));
  6886. const assert_1 = __nccwpck_require__(9491);
  6887. const v4_1 = __importDefault(__nccwpck_require__(7468));
  6888. const exec_1 = __nccwpck_require__(1514);
  6889. const retry_helper_1 = __nccwpck_require__(8279);
  6890. class HTTPError extends Error {
  6891. constructor(httpStatusCode) {
  6892. super(`Unexpected HTTP response: ${httpStatusCode}`);
  6893. this.httpStatusCode = httpStatusCode;
  6894. Object.setPrototypeOf(this, new.target.prototype);
  6895. }
  6896. }
  6897. exports.HTTPError = HTTPError;
  6898. const IS_WINDOWS = process.platform === 'win32';
  6899. const IS_MAC = process.platform === 'darwin';
  6900. const userAgent = 'actions/tool-cache';
  6901. /**
  6902. * Download a tool from an url and stream it into a file
  6903. *
  6904. * @param url url of tool to download
  6905. * @param dest path to download tool
  6906. * @param auth authorization header
  6907. * @param headers other headers
  6908. * @returns path to downloaded tool
  6909. */
  6910. function downloadTool(url, dest, auth, headers) {
  6911. return __awaiter(this, void 0, void 0, function* () {
  6912. dest = dest || path.join(_getTempDirectory(), v4_1.default());
  6913. yield io.mkdirP(path.dirname(dest));
  6914. core.debug(`Downloading ${url}`);
  6915. core.debug(`Destination ${dest}`);
  6916. const maxAttempts = 3;
  6917. const minSeconds = _getGlobal('TEST_DOWNLOAD_TOOL_RETRY_MIN_SECONDS', 10);
  6918. const maxSeconds = _getGlobal('TEST_DOWNLOAD_TOOL_RETRY_MAX_SECONDS', 20);
  6919. const retryHelper = new retry_helper_1.RetryHelper(maxAttempts, minSeconds, maxSeconds);
  6920. return yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  6921. return yield downloadToolAttempt(url, dest || '', auth, headers);
  6922. }), (err) => {
  6923. if (err instanceof HTTPError && err.httpStatusCode) {
  6924. // Don't retry anything less than 500, except 408 Request Timeout and 429 Too Many Requests
  6925. if (err.httpStatusCode < 500 &&
  6926. err.httpStatusCode !== 408 &&
  6927. err.httpStatusCode !== 429) {
  6928. return false;
  6929. }
  6930. }
  6931. // Otherwise retry
  6932. return true;
  6933. });
  6934. });
  6935. }
  6936. exports.downloadTool = downloadTool;
  6937. function downloadToolAttempt(url, dest, auth, headers) {
  6938. return __awaiter(this, void 0, void 0, function* () {
  6939. if (fs.existsSync(dest)) {
  6940. throw new Error(`Destination file path ${dest} already exists`);
  6941. }
  6942. // Get the response headers
  6943. const http = new httpm.HttpClient(userAgent, [], {
  6944. allowRetries: false
  6945. });
  6946. if (auth) {
  6947. core.debug('set auth');
  6948. if (headers === undefined) {
  6949. headers = {};
  6950. }
  6951. headers.authorization = auth;
  6952. }
  6953. const response = yield http.get(url, headers);
  6954. if (response.message.statusCode !== 200) {
  6955. const err = new HTTPError(response.message.statusCode);
  6956. core.debug(`Failed to download from "${url}". Code(${response.message.statusCode}) Message(${response.message.statusMessage})`);
  6957. throw err;
  6958. }
  6959. // Download the response body
  6960. const pipeline = util.promisify(stream.pipeline);
  6961. const responseMessageFactory = _getGlobal('TEST_DOWNLOAD_TOOL_RESPONSE_MESSAGE_FACTORY', () => response.message);
  6962. const readStream = responseMessageFactory();
  6963. let succeeded = false;
  6964. try {
  6965. yield pipeline(readStream, fs.createWriteStream(dest));
  6966. core.debug('download complete');
  6967. succeeded = true;
  6968. return dest;
  6969. }
  6970. finally {
  6971. // Error, delete dest before retry
  6972. if (!succeeded) {
  6973. core.debug('download failed');
  6974. try {
  6975. yield io.rmRF(dest);
  6976. }
  6977. catch (err) {
  6978. core.debug(`Failed to delete '${dest}'. ${err.message}`);
  6979. }
  6980. }
  6981. }
  6982. });
  6983. }
  6984. /**
  6985. * Extract a .7z file
  6986. *
  6987. * @param file path to the .7z file
  6988. * @param dest destination directory. Optional.
  6989. * @param _7zPath path to 7zr.exe. Optional, for long path support. Most .7z archives do not have this
  6990. * problem. If your .7z archive contains very long paths, you can pass the path to 7zr.exe which will
  6991. * gracefully handle long paths. By default 7zdec.exe is used because it is a very small program and is
  6992. * bundled with the tool lib. However it does not support long paths. 7zr.exe is the reduced command line
  6993. * interface, it is smaller than the full command line interface, and it does support long paths. At the
  6994. * time of this writing, it is freely available from the LZMA SDK that is available on the 7zip website.
  6995. * Be sure to check the current license agreement. If 7zr.exe is bundled with your action, then the path
  6996. * to 7zr.exe can be pass to this function.
  6997. * @returns path to the destination directory
  6998. */
  6999. function extract7z(file, dest, _7zPath) {
  7000. return __awaiter(this, void 0, void 0, function* () {
  7001. assert_1.ok(IS_WINDOWS, 'extract7z() not supported on current OS');
  7002. assert_1.ok(file, 'parameter "file" is required');
  7003. dest = yield _createExtractFolder(dest);
  7004. const originalCwd = process.cwd();
  7005. process.chdir(dest);
  7006. if (_7zPath) {
  7007. try {
  7008. const logLevel = core.isDebug() ? '-bb1' : '-bb0';
  7009. const args = [
  7010. 'x',
  7011. logLevel,
  7012. '-bd',
  7013. '-sccUTF-8',
  7014. file
  7015. ];
  7016. const options = {
  7017. silent: true
  7018. };
  7019. yield exec_1.exec(`"${_7zPath}"`, args, options);
  7020. }
  7021. finally {
  7022. process.chdir(originalCwd);
  7023. }
  7024. }
  7025. else {
  7026. const escapedScript = path
  7027. .join(__dirname, '..', 'scripts', 'Invoke-7zdec.ps1')
  7028. .replace(/'/g, "''")
  7029. .replace(/"|\n|\r/g, ''); // double-up single quotes, remove double quotes and newlines
  7030. const escapedFile = file.replace(/'/g, "''").replace(/"|\n|\r/g, '');
  7031. const escapedTarget = dest.replace(/'/g, "''").replace(/"|\n|\r/g, '');
  7032. const command = `& '${escapedScript}' -Source '${escapedFile}' -Target '${escapedTarget}'`;
  7033. const args = [
  7034. '-NoLogo',
  7035. '-Sta',
  7036. '-NoProfile',
  7037. '-NonInteractive',
  7038. '-ExecutionPolicy',
  7039. 'Unrestricted',
  7040. '-Command',
  7041. command
  7042. ];
  7043. const options = {
  7044. silent: true
  7045. };
  7046. try {
  7047. const powershellPath = yield io.which('powershell', true);
  7048. yield exec_1.exec(`"${powershellPath}"`, args, options);
  7049. }
  7050. finally {
  7051. process.chdir(originalCwd);
  7052. }
  7053. }
  7054. return dest;
  7055. });
  7056. }
  7057. exports.extract7z = extract7z;
  7058. /**
  7059. * Extract a compressed tar archive
  7060. *
  7061. * @param file path to the tar
  7062. * @param dest destination directory. Optional.
  7063. * @param flags flags for the tar command to use for extraction. Defaults to 'xz' (extracting gzipped tars). Optional.
  7064. * @returns path to the destination directory
  7065. */
  7066. function extractTar(file, dest, flags = 'xz') {
  7067. return __awaiter(this, void 0, void 0, function* () {
  7068. if (!file) {
  7069. throw new Error("parameter 'file' is required");
  7070. }
  7071. // Create dest
  7072. dest = yield _createExtractFolder(dest);
  7073. // Determine whether GNU tar
  7074. core.debug('Checking tar --version');
  7075. let versionOutput = '';
  7076. yield exec_1.exec('tar --version', [], {
  7077. ignoreReturnCode: true,
  7078. silent: true,
  7079. listeners: {
  7080. stdout: (data) => (versionOutput += data.toString()),
  7081. stderr: (data) => (versionOutput += data.toString())
  7082. }
  7083. });
  7084. core.debug(versionOutput.trim());
  7085. const isGnuTar = versionOutput.toUpperCase().includes('GNU TAR');
  7086. // Initialize args
  7087. let args;
  7088. if (flags instanceof Array) {
  7089. args = flags;
  7090. }
  7091. else {
  7092. args = [flags];
  7093. }
  7094. if (core.isDebug() && !flags.includes('v')) {
  7095. args.push('-v');
  7096. }
  7097. let destArg = dest;
  7098. let fileArg = file;
  7099. if (IS_WINDOWS && isGnuTar) {
  7100. args.push('--force-local');
  7101. destArg = dest.replace(/\\/g, '/');
  7102. // Technically only the dest needs to have `/` but for aesthetic consistency
  7103. // convert slashes in the file arg too.
  7104. fileArg = file.replace(/\\/g, '/');
  7105. }
  7106. if (isGnuTar) {
  7107. // Suppress warnings when using GNU tar to extract archives created by BSD tar
  7108. args.push('--warning=no-unknown-keyword');
  7109. args.push('--overwrite');
  7110. }
  7111. args.push('-C', destArg, '-f', fileArg);
  7112. yield exec_1.exec(`tar`, args);
  7113. return dest;
  7114. });
  7115. }
  7116. exports.extractTar = extractTar;
  7117. /**
  7118. * Extract a xar compatible archive
  7119. *
  7120. * @param file path to the archive
  7121. * @param dest destination directory. Optional.
  7122. * @param flags flags for the xar. Optional.
  7123. * @returns path to the destination directory
  7124. */
  7125. function extractXar(file, dest, flags = []) {
  7126. return __awaiter(this, void 0, void 0, function* () {
  7127. assert_1.ok(IS_MAC, 'extractXar() not supported on current OS');
  7128. assert_1.ok(file, 'parameter "file" is required');
  7129. dest = yield _createExtractFolder(dest);
  7130. let args;
  7131. if (flags instanceof Array) {
  7132. args = flags;
  7133. }
  7134. else {
  7135. args = [flags];
  7136. }
  7137. args.push('-x', '-C', dest, '-f', file);
  7138. if (core.isDebug()) {
  7139. args.push('-v');
  7140. }
  7141. const xarPath = yield io.which('xar', true);
  7142. yield exec_1.exec(`"${xarPath}"`, _unique(args));
  7143. return dest;
  7144. });
  7145. }
  7146. exports.extractXar = extractXar;
  7147. /**
  7148. * Extract a zip
  7149. *
  7150. * @param file path to the zip
  7151. * @param dest destination directory. Optional.
  7152. * @returns path to the destination directory
  7153. */
  7154. function extractZip(file, dest) {
  7155. return __awaiter(this, void 0, void 0, function* () {
  7156. if (!file) {
  7157. throw new Error("parameter 'file' is required");
  7158. }
  7159. dest = yield _createExtractFolder(dest);
  7160. if (IS_WINDOWS) {
  7161. yield extractZipWin(file, dest);
  7162. }
  7163. else {
  7164. yield extractZipNix(file, dest);
  7165. }
  7166. return dest;
  7167. });
  7168. }
  7169. exports.extractZip = extractZip;
  7170. function extractZipWin(file, dest) {
  7171. return __awaiter(this, void 0, void 0, function* () {
  7172. // build the powershell command
  7173. const escapedFile = file.replace(/'/g, "''").replace(/"|\n|\r/g, ''); // double-up single quotes, remove double quotes and newlines
  7174. const escapedDest = dest.replace(/'/g, "''").replace(/"|\n|\r/g, '');
  7175. const pwshPath = yield io.which('pwsh', false);
  7176. //To match the file overwrite behavior on nix systems, we use the overwrite = true flag for ExtractToDirectory
  7177. //and the -Force flag for Expand-Archive as a fallback
  7178. if (pwshPath) {
  7179. //attempt to use pwsh with ExtractToDirectory, if this fails attempt Expand-Archive
  7180. const pwshCommand = [
  7181. `$ErrorActionPreference = 'Stop' ;`,
  7182. `try { Add-Type -AssemblyName System.IO.Compression.ZipFile } catch { } ;`,
  7183. `try { [System.IO.Compression.ZipFile]::ExtractToDirectory('${escapedFile}', '${escapedDest}', $true) }`,
  7184. `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 $_ } } ;`
  7185. ].join(' ');
  7186. const args = [
  7187. '-NoLogo',
  7188. '-NoProfile',
  7189. '-NonInteractive',
  7190. '-ExecutionPolicy',
  7191. 'Unrestricted',
  7192. '-Command',
  7193. pwshCommand
  7194. ];
  7195. core.debug(`Using pwsh at path: ${pwshPath}`);
  7196. yield exec_1.exec(`"${pwshPath}"`, args);
  7197. }
  7198. else {
  7199. const powershellCommand = [
  7200. `$ErrorActionPreference = 'Stop' ;`,
  7201. `try { Add-Type -AssemblyName System.IO.Compression.FileSystem } catch { } ;`,
  7202. `if ((Get-Command -Name Expand-Archive -Module Microsoft.PowerShell.Archive -ErrorAction Ignore)) { Expand-Archive -LiteralPath '${escapedFile}' -DestinationPath '${escapedDest}' -Force }`,
  7203. `else {[System.IO.Compression.ZipFile]::ExtractToDirectory('${escapedFile}', '${escapedDest}', $true) }`
  7204. ].join(' ');
  7205. const args = [
  7206. '-NoLogo',
  7207. '-Sta',
  7208. '-NoProfile',
  7209. '-NonInteractive',
  7210. '-ExecutionPolicy',
  7211. 'Unrestricted',
  7212. '-Command',
  7213. powershellCommand
  7214. ];
  7215. const powershellPath = yield io.which('powershell', true);
  7216. core.debug(`Using powershell at path: ${powershellPath}`);
  7217. yield exec_1.exec(`"${powershellPath}"`, args);
  7218. }
  7219. });
  7220. }
  7221. function extractZipNix(file, dest) {
  7222. return __awaiter(this, void 0, void 0, function* () {
  7223. const unzipPath = yield io.which('unzip', true);
  7224. const args = [file];
  7225. if (!core.isDebug()) {
  7226. args.unshift('-q');
  7227. }
  7228. args.unshift('-o'); //overwrite with -o, otherwise a prompt is shown which freezes the run
  7229. yield exec_1.exec(`"${unzipPath}"`, args, { cwd: dest });
  7230. });
  7231. }
  7232. /**
  7233. * Caches a directory and installs it into the tool cacheDir
  7234. *
  7235. * @param sourceDir the directory to cache into tools
  7236. * @param tool tool name
  7237. * @param version version of the tool. semver format
  7238. * @param arch architecture of the tool. Optional. Defaults to machine architecture
  7239. */
  7240. function cacheDir(sourceDir, tool, version, arch) {
  7241. return __awaiter(this, void 0, void 0, function* () {
  7242. version = semver.clean(version) || version;
  7243. arch = arch || os.arch();
  7244. core.debug(`Caching tool ${tool} ${version} ${arch}`);
  7245. core.debug(`source dir: ${sourceDir}`);
  7246. if (!fs.statSync(sourceDir).isDirectory()) {
  7247. throw new Error('sourceDir is not a directory');
  7248. }
  7249. // Create the tool dir
  7250. const destPath = yield _createToolPath(tool, version, arch);
  7251. // copy each child item. do not move. move can fail on Windows
  7252. // due to anti-virus software having an open handle on a file.
  7253. for (const itemName of fs.readdirSync(sourceDir)) {
  7254. const s = path.join(sourceDir, itemName);
  7255. yield io.cp(s, destPath, { recursive: true });
  7256. }
  7257. // write .complete
  7258. _completeToolPath(tool, version, arch);
  7259. return destPath;
  7260. });
  7261. }
  7262. exports.cacheDir = cacheDir;
  7263. /**
  7264. * Caches a downloaded file (GUID) and installs it
  7265. * into the tool cache with a given targetName
  7266. *
  7267. * @param sourceFile the file to cache into tools. Typically a result of downloadTool which is a guid.
  7268. * @param targetFile the name of the file name in the tools directory
  7269. * @param tool tool name
  7270. * @param version version of the tool. semver format
  7271. * @param arch architecture of the tool. Optional. Defaults to machine architecture
  7272. */
  7273. function cacheFile(sourceFile, targetFile, tool, version, arch) {
  7274. return __awaiter(this, void 0, void 0, function* () {
  7275. version = semver.clean(version) || version;
  7276. arch = arch || os.arch();
  7277. core.debug(`Caching tool ${tool} ${version} ${arch}`);
  7278. core.debug(`source file: ${sourceFile}`);
  7279. if (!fs.statSync(sourceFile).isFile()) {
  7280. throw new Error('sourceFile is not a file');
  7281. }
  7282. // create the tool dir
  7283. const destFolder = yield _createToolPath(tool, version, arch);
  7284. // copy instead of move. move can fail on Windows due to
  7285. // anti-virus software having an open handle on a file.
  7286. const destPath = path.join(destFolder, targetFile);
  7287. core.debug(`destination file ${destPath}`);
  7288. yield io.cp(sourceFile, destPath);
  7289. // write .complete
  7290. _completeToolPath(tool, version, arch);
  7291. return destFolder;
  7292. });
  7293. }
  7294. exports.cacheFile = cacheFile;
  7295. /**
  7296. * Finds the path to a tool version in the local installed tool cache
  7297. *
  7298. * @param toolName name of the tool
  7299. * @param versionSpec version of the tool
  7300. * @param arch optional arch. defaults to arch of computer
  7301. */
  7302. function find(toolName, versionSpec, arch) {
  7303. if (!toolName) {
  7304. throw new Error('toolName parameter is required');
  7305. }
  7306. if (!versionSpec) {
  7307. throw new Error('versionSpec parameter is required');
  7308. }
  7309. arch = arch || os.arch();
  7310. // attempt to resolve an explicit version
  7311. if (!isExplicitVersion(versionSpec)) {
  7312. const localVersions = findAllVersions(toolName, arch);
  7313. const match = evaluateVersions(localVersions, versionSpec);
  7314. versionSpec = match;
  7315. }
  7316. // check for the explicit version in the cache
  7317. let toolPath = '';
  7318. if (versionSpec) {
  7319. versionSpec = semver.clean(versionSpec) || '';
  7320. const cachePath = path.join(_getCacheDirectory(), toolName, versionSpec, arch);
  7321. core.debug(`checking cache: ${cachePath}`);
  7322. if (fs.existsSync(cachePath) && fs.existsSync(`${cachePath}.complete`)) {
  7323. core.debug(`Found tool in cache ${toolName} ${versionSpec} ${arch}`);
  7324. toolPath = cachePath;
  7325. }
  7326. else {
  7327. core.debug('not found');
  7328. }
  7329. }
  7330. return toolPath;
  7331. }
  7332. exports.find = find;
  7333. /**
  7334. * Finds the paths to all versions of a tool that are installed in the local tool cache
  7335. *
  7336. * @param toolName name of the tool
  7337. * @param arch optional arch. defaults to arch of computer
  7338. */
  7339. function findAllVersions(toolName, arch) {
  7340. const versions = [];
  7341. arch = arch || os.arch();
  7342. const toolPath = path.join(_getCacheDirectory(), toolName);
  7343. if (fs.existsSync(toolPath)) {
  7344. const children = fs.readdirSync(toolPath);
  7345. for (const child of children) {
  7346. if (isExplicitVersion(child)) {
  7347. const fullPath = path.join(toolPath, child, arch || '');
  7348. if (fs.existsSync(fullPath) && fs.existsSync(`${fullPath}.complete`)) {
  7349. versions.push(child);
  7350. }
  7351. }
  7352. }
  7353. }
  7354. return versions;
  7355. }
  7356. exports.findAllVersions = findAllVersions;
  7357. function getManifestFromRepo(owner, repo, auth, branch = 'master') {
  7358. return __awaiter(this, void 0, void 0, function* () {
  7359. let releases = [];
  7360. const treeUrl = `https://api.github.com/repos/${owner}/${repo}/git/trees/${branch}`;
  7361. const http = new httpm.HttpClient('tool-cache');
  7362. const headers = {};
  7363. if (auth) {
  7364. core.debug('set auth');
  7365. headers.authorization = auth;
  7366. }
  7367. const response = yield http.getJson(treeUrl, headers);
  7368. if (!response.result) {
  7369. return releases;
  7370. }
  7371. let manifestUrl = '';
  7372. for (const item of response.result.tree) {
  7373. if (item.path === 'versions-manifest.json') {
  7374. manifestUrl = item.url;
  7375. break;
  7376. }
  7377. }
  7378. headers['accept'] = 'application/vnd.github.VERSION.raw';
  7379. let versionsRaw = yield (yield http.get(manifestUrl, headers)).readBody();
  7380. if (versionsRaw) {
  7381. // shouldn't be needed but protects against invalid json saved with BOM
  7382. versionsRaw = versionsRaw.replace(/^\uFEFF/, '');
  7383. try {
  7384. releases = JSON.parse(versionsRaw);
  7385. }
  7386. catch (_a) {
  7387. core.debug('Invalid json');
  7388. }
  7389. }
  7390. return releases;
  7391. });
  7392. }
  7393. exports.getManifestFromRepo = getManifestFromRepo;
  7394. function findFromManifest(versionSpec, stable, manifest, archFilter = os.arch()) {
  7395. return __awaiter(this, void 0, void 0, function* () {
  7396. // wrap the internal impl
  7397. const match = yield mm._findMatch(versionSpec, stable, manifest, archFilter);
  7398. return match;
  7399. });
  7400. }
  7401. exports.findFromManifest = findFromManifest;
  7402. function _createExtractFolder(dest) {
  7403. return __awaiter(this, void 0, void 0, function* () {
  7404. if (!dest) {
  7405. // create a temp dir
  7406. dest = path.join(_getTempDirectory(), v4_1.default());
  7407. }
  7408. yield io.mkdirP(dest);
  7409. return dest;
  7410. });
  7411. }
  7412. function _createToolPath(tool, version, arch) {
  7413. return __awaiter(this, void 0, void 0, function* () {
  7414. const folderPath = path.join(_getCacheDirectory(), tool, semver.clean(version) || version, arch || '');
  7415. core.debug(`destination ${folderPath}`);
  7416. const markerPath = `${folderPath}.complete`;
  7417. yield io.rmRF(folderPath);
  7418. yield io.rmRF(markerPath);
  7419. yield io.mkdirP(folderPath);
  7420. return folderPath;
  7421. });
  7422. }
  7423. function _completeToolPath(tool, version, arch) {
  7424. const folderPath = path.join(_getCacheDirectory(), tool, semver.clean(version) || version, arch || '');
  7425. const markerPath = `${folderPath}.complete`;
  7426. fs.writeFileSync(markerPath, '');
  7427. core.debug('finished caching tool');
  7428. }
  7429. /**
  7430. * Check if version string is explicit
  7431. *
  7432. * @param versionSpec version string to check
  7433. */
  7434. function isExplicitVersion(versionSpec) {
  7435. const c = semver.clean(versionSpec) || '';
  7436. core.debug(`isExplicit: ${c}`);
  7437. const valid = semver.valid(c) != null;
  7438. core.debug(`explicit? ${valid}`);
  7439. return valid;
  7440. }
  7441. exports.isExplicitVersion = isExplicitVersion;
  7442. /**
  7443. * Get the highest satisfiying semantic version in `versions` which satisfies `versionSpec`
  7444. *
  7445. * @param versions array of versions to evaluate
  7446. * @param versionSpec semantic version spec to satisfy
  7447. */
  7448. function evaluateVersions(versions, versionSpec) {
  7449. let version = '';
  7450. core.debug(`evaluating ${versions.length} versions`);
  7451. versions = versions.sort((a, b) => {
  7452. if (semver.gt(a, b)) {
  7453. return 1;
  7454. }
  7455. return -1;
  7456. });
  7457. for (let i = versions.length - 1; i >= 0; i--) {
  7458. const potential = versions[i];
  7459. const satisfied = semver.satisfies(potential, versionSpec);
  7460. if (satisfied) {
  7461. version = potential;
  7462. break;
  7463. }
  7464. }
  7465. if (version) {
  7466. core.debug(`matched: ${version}`);
  7467. }
  7468. else {
  7469. core.debug('match not found');
  7470. }
  7471. return version;
  7472. }
  7473. exports.evaluateVersions = evaluateVersions;
  7474. /**
  7475. * Gets RUNNER_TOOL_CACHE
  7476. */
  7477. function _getCacheDirectory() {
  7478. const cacheDirectory = process.env['RUNNER_TOOL_CACHE'] || '';
  7479. assert_1.ok(cacheDirectory, 'Expected RUNNER_TOOL_CACHE to be defined');
  7480. return cacheDirectory;
  7481. }
  7482. /**
  7483. * Gets RUNNER_TEMP
  7484. */
  7485. function _getTempDirectory() {
  7486. const tempDirectory = process.env['RUNNER_TEMP'] || '';
  7487. assert_1.ok(tempDirectory, 'Expected RUNNER_TEMP to be defined');
  7488. return tempDirectory;
  7489. }
  7490. /**
  7491. * Gets a global variable
  7492. */
  7493. function _getGlobal(key, defaultValue) {
  7494. /* eslint-disable @typescript-eslint/no-explicit-any */
  7495. const value = global[key];
  7496. /* eslint-enable @typescript-eslint/no-explicit-any */
  7497. return value !== undefined ? value : defaultValue;
  7498. }
  7499. /**
  7500. * Returns an array of unique values.
  7501. * @param values Values to make unique.
  7502. */
  7503. function _unique(values) {
  7504. return Array.from(new Set(values));
  7505. }
  7506. //# sourceMappingURL=tool-cache.js.map
  7507. /***/ }),
  7508. /***/ 7701:
  7509. /***/ ((module) => {
  7510. /**
  7511. * Convert array of 16 byte values to UUID string format of the form:
  7512. * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
  7513. */
  7514. var byteToHex = [];
  7515. for (var i = 0; i < 256; ++i) {
  7516. byteToHex[i] = (i + 0x100).toString(16).substr(1);
  7517. }
  7518. function bytesToUuid(buf, offset) {
  7519. var i = offset || 0;
  7520. var bth = byteToHex;
  7521. // join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4
  7522. return ([
  7523. bth[buf[i++]], bth[buf[i++]],
  7524. bth[buf[i++]], bth[buf[i++]], '-',
  7525. bth[buf[i++]], bth[buf[i++]], '-',
  7526. bth[buf[i++]], bth[buf[i++]], '-',
  7527. bth[buf[i++]], bth[buf[i++]], '-',
  7528. bth[buf[i++]], bth[buf[i++]],
  7529. bth[buf[i++]], bth[buf[i++]],
  7530. bth[buf[i++]], bth[buf[i++]]
  7531. ]).join('');
  7532. }
  7533. module.exports = bytesToUuid;
  7534. /***/ }),
  7535. /***/ 7269:
  7536. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  7537. // Unique ID creation requires a high quality random # generator. In node.js
  7538. // this is pretty straight-forward - we use the crypto API.
  7539. var crypto = __nccwpck_require__(6113);
  7540. module.exports = function nodeRNG() {
  7541. return crypto.randomBytes(16);
  7542. };
  7543. /***/ }),
  7544. /***/ 7468:
  7545. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  7546. var rng = __nccwpck_require__(7269);
  7547. var bytesToUuid = __nccwpck_require__(7701);
  7548. function v4(options, buf, offset) {
  7549. var i = buf && offset || 0;
  7550. if (typeof(options) == 'string') {
  7551. buf = options === 'binary' ? new Array(16) : null;
  7552. options = null;
  7553. }
  7554. options = options || {};
  7555. var rnds = options.random || (options.rng || rng)();
  7556. // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
  7557. rnds[6] = (rnds[6] & 0x0f) | 0x40;
  7558. rnds[8] = (rnds[8] & 0x3f) | 0x80;
  7559. // Copy bytes to buffer, if provided
  7560. if (buf) {
  7561. for (var ii = 0; ii < 16; ++ii) {
  7562. buf[i + ii] = rnds[ii];
  7563. }
  7564. }
  7565. return buf || bytesToUuid(rnds);
  7566. }
  7567. module.exports = v4;
  7568. /***/ }),
  7569. /***/ 334:
  7570. /***/ ((module) => {
  7571. "use strict";
  7572. var __defProp = Object.defineProperty;
  7573. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  7574. var __getOwnPropNames = Object.getOwnPropertyNames;
  7575. var __hasOwnProp = Object.prototype.hasOwnProperty;
  7576. var __export = (target, all) => {
  7577. for (var name in all)
  7578. __defProp(target, name, { get: all[name], enumerable: true });
  7579. };
  7580. var __copyProps = (to, from, except, desc) => {
  7581. if (from && typeof from === "object" || typeof from === "function") {
  7582. for (let key of __getOwnPropNames(from))
  7583. if (!__hasOwnProp.call(to, key) && key !== except)
  7584. __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  7585. }
  7586. return to;
  7587. };
  7588. var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
  7589. // pkg/dist-src/index.js
  7590. var dist_src_exports = {};
  7591. __export(dist_src_exports, {
  7592. createTokenAuth: () => createTokenAuth
  7593. });
  7594. module.exports = __toCommonJS(dist_src_exports);
  7595. // pkg/dist-src/auth.js
  7596. var REGEX_IS_INSTALLATION_LEGACY = /^v1\./;
  7597. var REGEX_IS_INSTALLATION = /^ghs_/;
  7598. var REGEX_IS_USER_TO_SERVER = /^ghu_/;
  7599. async function auth(token) {
  7600. const isApp = token.split(/\./).length === 3;
  7601. const isInstallation = REGEX_IS_INSTALLATION_LEGACY.test(token) || REGEX_IS_INSTALLATION.test(token);
  7602. const isUserToServer = REGEX_IS_USER_TO_SERVER.test(token);
  7603. const tokenType = isApp ? "app" : isInstallation ? "installation" : isUserToServer ? "user-to-server" : "oauth";
  7604. return {
  7605. type: "token",
  7606. token,
  7607. tokenType
  7608. };
  7609. }
  7610. // pkg/dist-src/with-authorization-prefix.js
  7611. function withAuthorizationPrefix(token) {
  7612. if (token.split(/\./).length === 3) {
  7613. return `bearer ${token}`;
  7614. }
  7615. return `token ${token}`;
  7616. }
  7617. // pkg/dist-src/hook.js
  7618. async function hook(token, request, route, parameters) {
  7619. const endpoint = request.endpoint.merge(
  7620. route,
  7621. parameters
  7622. );
  7623. endpoint.headers.authorization = withAuthorizationPrefix(token);
  7624. return request(endpoint);
  7625. }
  7626. // pkg/dist-src/index.js
  7627. var createTokenAuth = function createTokenAuth2(token) {
  7628. if (!token) {
  7629. throw new Error("[@octokit/auth-token] No token passed to createTokenAuth");
  7630. }
  7631. if (typeof token !== "string") {
  7632. throw new Error(
  7633. "[@octokit/auth-token] Token passed to createTokenAuth is not a string"
  7634. );
  7635. }
  7636. token = token.replace(/^(token|bearer) +/i, "");
  7637. return Object.assign(auth.bind(null, token), {
  7638. hook: hook.bind(null, token)
  7639. });
  7640. };
  7641. // Annotate the CommonJS export names for ESM import in node:
  7642. 0 && (0);
  7643. /***/ }),
  7644. /***/ 6762:
  7645. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  7646. "use strict";
  7647. var __defProp = Object.defineProperty;
  7648. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  7649. var __getOwnPropNames = Object.getOwnPropertyNames;
  7650. var __hasOwnProp = Object.prototype.hasOwnProperty;
  7651. var __export = (target, all) => {
  7652. for (var name in all)
  7653. __defProp(target, name, { get: all[name], enumerable: true });
  7654. };
  7655. var __copyProps = (to, from, except, desc) => {
  7656. if (from && typeof from === "object" || typeof from === "function") {
  7657. for (let key of __getOwnPropNames(from))
  7658. if (!__hasOwnProp.call(to, key) && key !== except)
  7659. __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  7660. }
  7661. return to;
  7662. };
  7663. var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
  7664. // pkg/dist-src/index.js
  7665. var dist_src_exports = {};
  7666. __export(dist_src_exports, {
  7667. Octokit: () => Octokit
  7668. });
  7669. module.exports = __toCommonJS(dist_src_exports);
  7670. var import_universal_user_agent = __nccwpck_require__(5030);
  7671. var import_before_after_hook = __nccwpck_require__(3682);
  7672. var import_request = __nccwpck_require__(6234);
  7673. var import_graphql = __nccwpck_require__(8467);
  7674. var import_auth_token = __nccwpck_require__(334);
  7675. // pkg/dist-src/version.js
  7676. var VERSION = "5.2.0";
  7677. // pkg/dist-src/index.js
  7678. var noop = () => {
  7679. };
  7680. var consoleWarn = console.warn.bind(console);
  7681. var consoleError = console.error.bind(console);
  7682. var userAgentTrail = `octokit-core.js/${VERSION} ${(0, import_universal_user_agent.getUserAgent)()}`;
  7683. var Octokit = class {
  7684. static {
  7685. this.VERSION = VERSION;
  7686. }
  7687. static defaults(defaults) {
  7688. const OctokitWithDefaults = class extends this {
  7689. constructor(...args) {
  7690. const options = args[0] || {};
  7691. if (typeof defaults === "function") {
  7692. super(defaults(options));
  7693. return;
  7694. }
  7695. super(
  7696. Object.assign(
  7697. {},
  7698. defaults,
  7699. options,
  7700. options.userAgent && defaults.userAgent ? {
  7701. userAgent: `${options.userAgent} ${defaults.userAgent}`
  7702. } : null
  7703. )
  7704. );
  7705. }
  7706. };
  7707. return OctokitWithDefaults;
  7708. }
  7709. static {
  7710. this.plugins = [];
  7711. }
  7712. /**
  7713. * Attach a plugin (or many) to your Octokit instance.
  7714. *
  7715. * @example
  7716. * const API = Octokit.plugin(plugin1, plugin2, plugin3, ...)
  7717. */
  7718. static plugin(...newPlugins) {
  7719. const currentPlugins = this.plugins;
  7720. const NewOctokit = class extends this {
  7721. static {
  7722. this.plugins = currentPlugins.concat(
  7723. newPlugins.filter((plugin) => !currentPlugins.includes(plugin))
  7724. );
  7725. }
  7726. };
  7727. return NewOctokit;
  7728. }
  7729. constructor(options = {}) {
  7730. const hook = new import_before_after_hook.Collection();
  7731. const requestDefaults = {
  7732. baseUrl: import_request.request.endpoint.DEFAULTS.baseUrl,
  7733. headers: {},
  7734. request: Object.assign({}, options.request, {
  7735. // @ts-ignore internal usage only, no need to type
  7736. hook: hook.bind(null, "request")
  7737. }),
  7738. mediaType: {
  7739. previews: [],
  7740. format: ""
  7741. }
  7742. };
  7743. requestDefaults.headers["user-agent"] = options.userAgent ? `${options.userAgent} ${userAgentTrail}` : userAgentTrail;
  7744. if (options.baseUrl) {
  7745. requestDefaults.baseUrl = options.baseUrl;
  7746. }
  7747. if (options.previews) {
  7748. requestDefaults.mediaType.previews = options.previews;
  7749. }
  7750. if (options.timeZone) {
  7751. requestDefaults.headers["time-zone"] = options.timeZone;
  7752. }
  7753. this.request = import_request.request.defaults(requestDefaults);
  7754. this.graphql = (0, import_graphql.withCustomRequest)(this.request).defaults(requestDefaults);
  7755. this.log = Object.assign(
  7756. {
  7757. debug: noop,
  7758. info: noop,
  7759. warn: consoleWarn,
  7760. error: consoleError
  7761. },
  7762. options.log
  7763. );
  7764. this.hook = hook;
  7765. if (!options.authStrategy) {
  7766. if (!options.auth) {
  7767. this.auth = async () => ({
  7768. type: "unauthenticated"
  7769. });
  7770. } else {
  7771. const auth = (0, import_auth_token.createTokenAuth)(options.auth);
  7772. hook.wrap("request", auth.hook);
  7773. this.auth = auth;
  7774. }
  7775. } else {
  7776. const { authStrategy, ...otherOptions } = options;
  7777. const auth = authStrategy(
  7778. Object.assign(
  7779. {
  7780. request: this.request,
  7781. log: this.log,
  7782. // we pass the current octokit instance as well as its constructor options
  7783. // to allow for authentication strategies that return a new octokit instance
  7784. // that shares the same internal state as the current one. The original
  7785. // requirement for this was the "event-octokit" authentication strategy
  7786. // of https://github.com/probot/octokit-auth-probot.
  7787. octokit: this,
  7788. octokitOptions: otherOptions
  7789. },
  7790. options.auth
  7791. )
  7792. );
  7793. hook.wrap("request", auth.hook);
  7794. this.auth = auth;
  7795. }
  7796. const classConstructor = this.constructor;
  7797. for (let i = 0; i < classConstructor.plugins.length; ++i) {
  7798. Object.assign(this, classConstructor.plugins[i](this, options));
  7799. }
  7800. }
  7801. };
  7802. // Annotate the CommonJS export names for ESM import in node:
  7803. 0 && (0);
  7804. /***/ }),
  7805. /***/ 9440:
  7806. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  7807. "use strict";
  7808. var __defProp = Object.defineProperty;
  7809. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  7810. var __getOwnPropNames = Object.getOwnPropertyNames;
  7811. var __hasOwnProp = Object.prototype.hasOwnProperty;
  7812. var __export = (target, all) => {
  7813. for (var name in all)
  7814. __defProp(target, name, { get: all[name], enumerable: true });
  7815. };
  7816. var __copyProps = (to, from, except, desc) => {
  7817. if (from && typeof from === "object" || typeof from === "function") {
  7818. for (let key of __getOwnPropNames(from))
  7819. if (!__hasOwnProp.call(to, key) && key !== except)
  7820. __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  7821. }
  7822. return to;
  7823. };
  7824. var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
  7825. // pkg/dist-src/index.js
  7826. var dist_src_exports = {};
  7827. __export(dist_src_exports, {
  7828. endpoint: () => endpoint
  7829. });
  7830. module.exports = __toCommonJS(dist_src_exports);
  7831. // pkg/dist-src/defaults.js
  7832. var import_universal_user_agent = __nccwpck_require__(5030);
  7833. // pkg/dist-src/version.js
  7834. var VERSION = "9.0.6";
  7835. // pkg/dist-src/defaults.js
  7836. var userAgent = `octokit-endpoint.js/${VERSION} ${(0, import_universal_user_agent.getUserAgent)()}`;
  7837. var DEFAULTS = {
  7838. method: "GET",
  7839. baseUrl: "https://api.github.com",
  7840. headers: {
  7841. accept: "application/vnd.github.v3+json",
  7842. "user-agent": userAgent
  7843. },
  7844. mediaType: {
  7845. format: ""
  7846. }
  7847. };
  7848. // pkg/dist-src/util/lowercase-keys.js
  7849. function lowercaseKeys(object) {
  7850. if (!object) {
  7851. return {};
  7852. }
  7853. return Object.keys(object).reduce((newObj, key) => {
  7854. newObj[key.toLowerCase()] = object[key];
  7855. return newObj;
  7856. }, {});
  7857. }
  7858. // pkg/dist-src/util/is-plain-object.js
  7859. function isPlainObject(value) {
  7860. if (typeof value !== "object" || value === null)
  7861. return false;
  7862. if (Object.prototype.toString.call(value) !== "[object Object]")
  7863. return false;
  7864. const proto = Object.getPrototypeOf(value);
  7865. if (proto === null)
  7866. return true;
  7867. const Ctor = Object.prototype.hasOwnProperty.call(proto, "constructor") && proto.constructor;
  7868. return typeof Ctor === "function" && Ctor instanceof Ctor && Function.prototype.call(Ctor) === Function.prototype.call(value);
  7869. }
  7870. // pkg/dist-src/util/merge-deep.js
  7871. function mergeDeep(defaults, options) {
  7872. const result = Object.assign({}, defaults);
  7873. Object.keys(options).forEach((key) => {
  7874. if (isPlainObject(options[key])) {
  7875. if (!(key in defaults))
  7876. Object.assign(result, { [key]: options[key] });
  7877. else
  7878. result[key] = mergeDeep(defaults[key], options[key]);
  7879. } else {
  7880. Object.assign(result, { [key]: options[key] });
  7881. }
  7882. });
  7883. return result;
  7884. }
  7885. // pkg/dist-src/util/remove-undefined-properties.js
  7886. function removeUndefinedProperties(obj) {
  7887. for (const key in obj) {
  7888. if (obj[key] === void 0) {
  7889. delete obj[key];
  7890. }
  7891. }
  7892. return obj;
  7893. }
  7894. // pkg/dist-src/merge.js
  7895. function merge(defaults, route, options) {
  7896. if (typeof route === "string") {
  7897. let [method, url] = route.split(" ");
  7898. options = Object.assign(url ? { method, url } : { url: method }, options);
  7899. } else {
  7900. options = Object.assign({}, route);
  7901. }
  7902. options.headers = lowercaseKeys(options.headers);
  7903. removeUndefinedProperties(options);
  7904. removeUndefinedProperties(options.headers);
  7905. const mergedOptions = mergeDeep(defaults || {}, options);
  7906. if (options.url === "/graphql") {
  7907. if (defaults && defaults.mediaType.previews?.length) {
  7908. mergedOptions.mediaType.previews = defaults.mediaType.previews.filter(
  7909. (preview) => !mergedOptions.mediaType.previews.includes(preview)
  7910. ).concat(mergedOptions.mediaType.previews);
  7911. }
  7912. mergedOptions.mediaType.previews = (mergedOptions.mediaType.previews || []).map((preview) => preview.replace(/-preview/, ""));
  7913. }
  7914. return mergedOptions;
  7915. }
  7916. // pkg/dist-src/util/add-query-parameters.js
  7917. function addQueryParameters(url, parameters) {
  7918. const separator = /\?/.test(url) ? "&" : "?";
  7919. const names = Object.keys(parameters);
  7920. if (names.length === 0) {
  7921. return url;
  7922. }
  7923. return url + separator + names.map((name) => {
  7924. if (name === "q") {
  7925. return "q=" + parameters.q.split("+").map(encodeURIComponent).join("+");
  7926. }
  7927. return `${name}=${encodeURIComponent(parameters[name])}`;
  7928. }).join("&");
  7929. }
  7930. // pkg/dist-src/util/extract-url-variable-names.js
  7931. var urlVariableRegex = /\{[^{}}]+\}/g;
  7932. function removeNonChars(variableName) {
  7933. return variableName.replace(/(?:^\W+)|(?:(?<!\W)\W+$)/g, "").split(/,/);
  7934. }
  7935. function extractUrlVariableNames(url) {
  7936. const matches = url.match(urlVariableRegex);
  7937. if (!matches) {
  7938. return [];
  7939. }
  7940. return matches.map(removeNonChars).reduce((a, b) => a.concat(b), []);
  7941. }
  7942. // pkg/dist-src/util/omit.js
  7943. function omit(object, keysToOmit) {
  7944. const result = { __proto__: null };
  7945. for (const key of Object.keys(object)) {
  7946. if (keysToOmit.indexOf(key) === -1) {
  7947. result[key] = object[key];
  7948. }
  7949. }
  7950. return result;
  7951. }
  7952. // pkg/dist-src/util/url-template.js
  7953. function encodeReserved(str) {
  7954. return str.split(/(%[0-9A-Fa-f]{2})/g).map(function(part) {
  7955. if (!/%[0-9A-Fa-f]/.test(part)) {
  7956. part = encodeURI(part).replace(/%5B/g, "[").replace(/%5D/g, "]");
  7957. }
  7958. return part;
  7959. }).join("");
  7960. }
  7961. function encodeUnreserved(str) {
  7962. return encodeURIComponent(str).replace(/[!'()*]/g, function(c) {
  7963. return "%" + c.charCodeAt(0).toString(16).toUpperCase();
  7964. });
  7965. }
  7966. function encodeValue(operator, value, key) {
  7967. value = operator === "+" || operator === "#" ? encodeReserved(value) : encodeUnreserved(value);
  7968. if (key) {
  7969. return encodeUnreserved(key) + "=" + value;
  7970. } else {
  7971. return value;
  7972. }
  7973. }
  7974. function isDefined(value) {
  7975. return value !== void 0 && value !== null;
  7976. }
  7977. function isKeyOperator(operator) {
  7978. return operator === ";" || operator === "&" || operator === "?";
  7979. }
  7980. function getValues(context, operator, key, modifier) {
  7981. var value = context[key], result = [];
  7982. if (isDefined(value) && value !== "") {
  7983. if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
  7984. value = value.toString();
  7985. if (modifier && modifier !== "*") {
  7986. value = value.substring(0, parseInt(modifier, 10));
  7987. }
  7988. result.push(
  7989. encodeValue(operator, value, isKeyOperator(operator) ? key : "")
  7990. );
  7991. } else {
  7992. if (modifier === "*") {
  7993. if (Array.isArray(value)) {
  7994. value.filter(isDefined).forEach(function(value2) {
  7995. result.push(
  7996. encodeValue(operator, value2, isKeyOperator(operator) ? key : "")
  7997. );
  7998. });
  7999. } else {
  8000. Object.keys(value).forEach(function(k) {
  8001. if (isDefined(value[k])) {
  8002. result.push(encodeValue(operator, value[k], k));
  8003. }
  8004. });
  8005. }
  8006. } else {
  8007. const tmp = [];
  8008. if (Array.isArray(value)) {
  8009. value.filter(isDefined).forEach(function(value2) {
  8010. tmp.push(encodeValue(operator, value2));
  8011. });
  8012. } else {
  8013. Object.keys(value).forEach(function(k) {
  8014. if (isDefined(value[k])) {
  8015. tmp.push(encodeUnreserved(k));
  8016. tmp.push(encodeValue(operator, value[k].toString()));
  8017. }
  8018. });
  8019. }
  8020. if (isKeyOperator(operator)) {
  8021. result.push(encodeUnreserved(key) + "=" + tmp.join(","));
  8022. } else if (tmp.length !== 0) {
  8023. result.push(tmp.join(","));
  8024. }
  8025. }
  8026. }
  8027. } else {
  8028. if (operator === ";") {
  8029. if (isDefined(value)) {
  8030. result.push(encodeUnreserved(key));
  8031. }
  8032. } else if (value === "" && (operator === "&" || operator === "?")) {
  8033. result.push(encodeUnreserved(key) + "=");
  8034. } else if (value === "") {
  8035. result.push("");
  8036. }
  8037. }
  8038. return result;
  8039. }
  8040. function parseUrl(template) {
  8041. return {
  8042. expand: expand.bind(null, template)
  8043. };
  8044. }
  8045. function expand(template, context) {
  8046. var operators = ["+", "#", ".", "/", ";", "?", "&"];
  8047. template = template.replace(
  8048. /\{([^\{\}]+)\}|([^\{\}]+)/g,
  8049. function(_, expression, literal) {
  8050. if (expression) {
  8051. let operator = "";
  8052. const values = [];
  8053. if (operators.indexOf(expression.charAt(0)) !== -1) {
  8054. operator = expression.charAt(0);
  8055. expression = expression.substr(1);
  8056. }
  8057. expression.split(/,/g).forEach(function(variable) {
  8058. var tmp = /([^:\*]*)(?::(\d+)|(\*))?/.exec(variable);
  8059. values.push(getValues(context, operator, tmp[1], tmp[2] || tmp[3]));
  8060. });
  8061. if (operator && operator !== "+") {
  8062. var separator = ",";
  8063. if (operator === "?") {
  8064. separator = "&";
  8065. } else if (operator !== "#") {
  8066. separator = operator;
  8067. }
  8068. return (values.length !== 0 ? operator : "") + values.join(separator);
  8069. } else {
  8070. return values.join(",");
  8071. }
  8072. } else {
  8073. return encodeReserved(literal);
  8074. }
  8075. }
  8076. );
  8077. if (template === "/") {
  8078. return template;
  8079. } else {
  8080. return template.replace(/\/$/, "");
  8081. }
  8082. }
  8083. // pkg/dist-src/parse.js
  8084. function parse(options) {
  8085. let method = options.method.toUpperCase();
  8086. let url = (options.url || "/").replace(/:([a-z]\w+)/g, "{$1}");
  8087. let headers = Object.assign({}, options.headers);
  8088. let body;
  8089. let parameters = omit(options, [
  8090. "method",
  8091. "baseUrl",
  8092. "url",
  8093. "headers",
  8094. "request",
  8095. "mediaType"
  8096. ]);
  8097. const urlVariableNames = extractUrlVariableNames(url);
  8098. url = parseUrl(url).expand(parameters);
  8099. if (!/^http/.test(url)) {
  8100. url = options.baseUrl + url;
  8101. }
  8102. const omittedParameters = Object.keys(options).filter((option) => urlVariableNames.includes(option)).concat("baseUrl");
  8103. const remainingParameters = omit(parameters, omittedParameters);
  8104. const isBinaryRequest = /application\/octet-stream/i.test(headers.accept);
  8105. if (!isBinaryRequest) {
  8106. if (options.mediaType.format) {
  8107. headers.accept = headers.accept.split(/,/).map(
  8108. (format) => format.replace(
  8109. /application\/vnd(\.\w+)(\.v3)?(\.\w+)?(\+json)?$/,
  8110. `application/vnd$1$2.${options.mediaType.format}`
  8111. )
  8112. ).join(",");
  8113. }
  8114. if (url.endsWith("/graphql")) {
  8115. if (options.mediaType.previews?.length) {
  8116. const previewsFromAcceptHeader = headers.accept.match(/(?<![\w-])[\w-]+(?=-preview)/g) || [];
  8117. headers.accept = previewsFromAcceptHeader.concat(options.mediaType.previews).map((preview) => {
  8118. const format = options.mediaType.format ? `.${options.mediaType.format}` : "+json";
  8119. return `application/vnd.github.${preview}-preview${format}`;
  8120. }).join(",");
  8121. }
  8122. }
  8123. }
  8124. if (["GET", "HEAD"].includes(method)) {
  8125. url = addQueryParameters(url, remainingParameters);
  8126. } else {
  8127. if ("data" in remainingParameters) {
  8128. body = remainingParameters.data;
  8129. } else {
  8130. if (Object.keys(remainingParameters).length) {
  8131. body = remainingParameters;
  8132. }
  8133. }
  8134. }
  8135. if (!headers["content-type"] && typeof body !== "undefined") {
  8136. headers["content-type"] = "application/json; charset=utf-8";
  8137. }
  8138. if (["PATCH", "PUT"].includes(method) && typeof body === "undefined") {
  8139. body = "";
  8140. }
  8141. return Object.assign(
  8142. { method, url, headers },
  8143. typeof body !== "undefined" ? { body } : null,
  8144. options.request ? { request: options.request } : null
  8145. );
  8146. }
  8147. // pkg/dist-src/endpoint-with-defaults.js
  8148. function endpointWithDefaults(defaults, route, options) {
  8149. return parse(merge(defaults, route, options));
  8150. }
  8151. // pkg/dist-src/with-defaults.js
  8152. function withDefaults(oldDefaults, newDefaults) {
  8153. const DEFAULTS2 = merge(oldDefaults, newDefaults);
  8154. const endpoint2 = endpointWithDefaults.bind(null, DEFAULTS2);
  8155. return Object.assign(endpoint2, {
  8156. DEFAULTS: DEFAULTS2,
  8157. defaults: withDefaults.bind(null, DEFAULTS2),
  8158. merge: merge.bind(null, DEFAULTS2),
  8159. parse
  8160. });
  8161. }
  8162. // pkg/dist-src/index.js
  8163. var endpoint = withDefaults(null, DEFAULTS);
  8164. // Annotate the CommonJS export names for ESM import in node:
  8165. 0 && (0);
  8166. /***/ }),
  8167. /***/ 8467:
  8168. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  8169. "use strict";
  8170. var __defProp = Object.defineProperty;
  8171. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  8172. var __getOwnPropNames = Object.getOwnPropertyNames;
  8173. var __hasOwnProp = Object.prototype.hasOwnProperty;
  8174. var __export = (target, all) => {
  8175. for (var name in all)
  8176. __defProp(target, name, { get: all[name], enumerable: true });
  8177. };
  8178. var __copyProps = (to, from, except, desc) => {
  8179. if (from && typeof from === "object" || typeof from === "function") {
  8180. for (let key of __getOwnPropNames(from))
  8181. if (!__hasOwnProp.call(to, key) && key !== except)
  8182. __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  8183. }
  8184. return to;
  8185. };
  8186. var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
  8187. // pkg/dist-src/index.js
  8188. var dist_src_exports = {};
  8189. __export(dist_src_exports, {
  8190. GraphqlResponseError: () => GraphqlResponseError,
  8191. graphql: () => graphql2,
  8192. withCustomRequest: () => withCustomRequest
  8193. });
  8194. module.exports = __toCommonJS(dist_src_exports);
  8195. var import_request3 = __nccwpck_require__(6234);
  8196. var import_universal_user_agent = __nccwpck_require__(5030);
  8197. // pkg/dist-src/version.js
  8198. var VERSION = "7.1.0";
  8199. // pkg/dist-src/with-defaults.js
  8200. var import_request2 = __nccwpck_require__(6234);
  8201. // pkg/dist-src/graphql.js
  8202. var import_request = __nccwpck_require__(6234);
  8203. // pkg/dist-src/error.js
  8204. function _buildMessageForResponseErrors(data) {
  8205. return `Request failed due to following response errors:
  8206. ` + data.errors.map((e) => ` - ${e.message}`).join("\n");
  8207. }
  8208. var GraphqlResponseError = class extends Error {
  8209. constructor(request2, headers, response) {
  8210. super(_buildMessageForResponseErrors(response));
  8211. this.request = request2;
  8212. this.headers = headers;
  8213. this.response = response;
  8214. this.name = "GraphqlResponseError";
  8215. this.errors = response.errors;
  8216. this.data = response.data;
  8217. if (Error.captureStackTrace) {
  8218. Error.captureStackTrace(this, this.constructor);
  8219. }
  8220. }
  8221. };
  8222. // pkg/dist-src/graphql.js
  8223. var NON_VARIABLE_OPTIONS = [
  8224. "method",
  8225. "baseUrl",
  8226. "url",
  8227. "headers",
  8228. "request",
  8229. "query",
  8230. "mediaType"
  8231. ];
  8232. var FORBIDDEN_VARIABLE_OPTIONS = ["query", "method", "url"];
  8233. var GHES_V3_SUFFIX_REGEX = /\/api\/v3\/?$/;
  8234. function graphql(request2, query, options) {
  8235. if (options) {
  8236. if (typeof query === "string" && "query" in options) {
  8237. return Promise.reject(
  8238. new Error(`[@octokit/graphql] "query" cannot be used as variable name`)
  8239. );
  8240. }
  8241. for (const key in options) {
  8242. if (!FORBIDDEN_VARIABLE_OPTIONS.includes(key))
  8243. continue;
  8244. return Promise.reject(
  8245. new Error(
  8246. `[@octokit/graphql] "${key}" cannot be used as variable name`
  8247. )
  8248. );
  8249. }
  8250. }
  8251. const parsedOptions = typeof query === "string" ? Object.assign({ query }, options) : query;
  8252. const requestOptions = Object.keys(
  8253. parsedOptions
  8254. ).reduce((result, key) => {
  8255. if (NON_VARIABLE_OPTIONS.includes(key)) {
  8256. result[key] = parsedOptions[key];
  8257. return result;
  8258. }
  8259. if (!result.variables) {
  8260. result.variables = {};
  8261. }
  8262. result.variables[key] = parsedOptions[key];
  8263. return result;
  8264. }, {});
  8265. const baseUrl = parsedOptions.baseUrl || request2.endpoint.DEFAULTS.baseUrl;
  8266. if (GHES_V3_SUFFIX_REGEX.test(baseUrl)) {
  8267. requestOptions.url = baseUrl.replace(GHES_V3_SUFFIX_REGEX, "/api/graphql");
  8268. }
  8269. return request2(requestOptions).then((response) => {
  8270. if (response.data.errors) {
  8271. const headers = {};
  8272. for (const key of Object.keys(response.headers)) {
  8273. headers[key] = response.headers[key];
  8274. }
  8275. throw new GraphqlResponseError(
  8276. requestOptions,
  8277. headers,
  8278. response.data
  8279. );
  8280. }
  8281. return response.data.data;
  8282. });
  8283. }
  8284. // pkg/dist-src/with-defaults.js
  8285. function withDefaults(request2, newDefaults) {
  8286. const newRequest = request2.defaults(newDefaults);
  8287. const newApi = (query, options) => {
  8288. return graphql(newRequest, query, options);
  8289. };
  8290. return Object.assign(newApi, {
  8291. defaults: withDefaults.bind(null, newRequest),
  8292. endpoint: newRequest.endpoint
  8293. });
  8294. }
  8295. // pkg/dist-src/index.js
  8296. var graphql2 = withDefaults(import_request3.request, {
  8297. headers: {
  8298. "user-agent": `octokit-graphql.js/${VERSION} ${(0, import_universal_user_agent.getUserAgent)()}`
  8299. },
  8300. method: "POST",
  8301. url: "/graphql"
  8302. });
  8303. function withCustomRequest(customRequest) {
  8304. return withDefaults(customRequest, {
  8305. method: "POST",
  8306. url: "/graphql"
  8307. });
  8308. }
  8309. // Annotate the CommonJS export names for ESM import in node:
  8310. 0 && (0);
  8311. /***/ }),
  8312. /***/ 4193:
  8313. /***/ ((module) => {
  8314. "use strict";
  8315. var __defProp = Object.defineProperty;
  8316. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  8317. var __getOwnPropNames = Object.getOwnPropertyNames;
  8318. var __hasOwnProp = Object.prototype.hasOwnProperty;
  8319. var __export = (target, all) => {
  8320. for (var name in all)
  8321. __defProp(target, name, { get: all[name], enumerable: true });
  8322. };
  8323. var __copyProps = (to, from, except, desc) => {
  8324. if (from && typeof from === "object" || typeof from === "function") {
  8325. for (let key of __getOwnPropNames(from))
  8326. if (!__hasOwnProp.call(to, key) && key !== except)
  8327. __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  8328. }
  8329. return to;
  8330. };
  8331. var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
  8332. // pkg/dist-src/index.js
  8333. var dist_src_exports = {};
  8334. __export(dist_src_exports, {
  8335. composePaginateRest: () => composePaginateRest,
  8336. isPaginatingEndpoint: () => isPaginatingEndpoint,
  8337. paginateRest: () => paginateRest,
  8338. paginatingEndpoints: () => paginatingEndpoints
  8339. });
  8340. module.exports = __toCommonJS(dist_src_exports);
  8341. // pkg/dist-src/version.js
  8342. var VERSION = "9.2.2";
  8343. // pkg/dist-src/normalize-paginated-list-response.js
  8344. function normalizePaginatedListResponse(response) {
  8345. if (!response.data) {
  8346. return {
  8347. ...response,
  8348. data: []
  8349. };
  8350. }
  8351. const responseNeedsNormalization = "total_count" in response.data && !("url" in response.data);
  8352. if (!responseNeedsNormalization)
  8353. return response;
  8354. const incompleteResults = response.data.incomplete_results;
  8355. const repositorySelection = response.data.repository_selection;
  8356. const totalCount = response.data.total_count;
  8357. delete response.data.incomplete_results;
  8358. delete response.data.repository_selection;
  8359. delete response.data.total_count;
  8360. const namespaceKey = Object.keys(response.data)[0];
  8361. const data = response.data[namespaceKey];
  8362. response.data = data;
  8363. if (typeof incompleteResults !== "undefined") {
  8364. response.data.incomplete_results = incompleteResults;
  8365. }
  8366. if (typeof repositorySelection !== "undefined") {
  8367. response.data.repository_selection = repositorySelection;
  8368. }
  8369. response.data.total_count = totalCount;
  8370. return response;
  8371. }
  8372. // pkg/dist-src/iterator.js
  8373. function iterator(octokit, route, parameters) {
  8374. const options = typeof route === "function" ? route.endpoint(parameters) : octokit.request.endpoint(route, parameters);
  8375. const requestMethod = typeof route === "function" ? route : octokit.request;
  8376. const method = options.method;
  8377. const headers = options.headers;
  8378. let url = options.url;
  8379. return {
  8380. [Symbol.asyncIterator]: () => ({
  8381. async next() {
  8382. if (!url)
  8383. return { done: true };
  8384. try {
  8385. const response = await requestMethod({ method, url, headers });
  8386. const normalizedResponse = normalizePaginatedListResponse(response);
  8387. url = ((normalizedResponse.headers.link || "").match(
  8388. /<([^<>]+)>;\s*rel="next"/
  8389. ) || [])[1];
  8390. return { value: normalizedResponse };
  8391. } catch (error) {
  8392. if (error.status !== 409)
  8393. throw error;
  8394. url = "";
  8395. return {
  8396. value: {
  8397. status: 200,
  8398. headers: {},
  8399. data: []
  8400. }
  8401. };
  8402. }
  8403. }
  8404. })
  8405. };
  8406. }
  8407. // pkg/dist-src/paginate.js
  8408. function paginate(octokit, route, parameters, mapFn) {
  8409. if (typeof parameters === "function") {
  8410. mapFn = parameters;
  8411. parameters = void 0;
  8412. }
  8413. return gather(
  8414. octokit,
  8415. [],
  8416. iterator(octokit, route, parameters)[Symbol.asyncIterator](),
  8417. mapFn
  8418. );
  8419. }
  8420. function gather(octokit, results, iterator2, mapFn) {
  8421. return iterator2.next().then((result) => {
  8422. if (result.done) {
  8423. return results;
  8424. }
  8425. let earlyExit = false;
  8426. function done() {
  8427. earlyExit = true;
  8428. }
  8429. results = results.concat(
  8430. mapFn ? mapFn(result.value, done) : result.value.data
  8431. );
  8432. if (earlyExit) {
  8433. return results;
  8434. }
  8435. return gather(octokit, results, iterator2, mapFn);
  8436. });
  8437. }
  8438. // pkg/dist-src/compose-paginate.js
  8439. var composePaginateRest = Object.assign(paginate, {
  8440. iterator
  8441. });
  8442. // pkg/dist-src/generated/paginating-endpoints.js
  8443. var paginatingEndpoints = [
  8444. "GET /advisories",
  8445. "GET /app/hook/deliveries",
  8446. "GET /app/installation-requests",
  8447. "GET /app/installations",
  8448. "GET /assignments/{assignment_id}/accepted_assignments",
  8449. "GET /classrooms",
  8450. "GET /classrooms/{classroom_id}/assignments",
  8451. "GET /enterprises/{enterprise}/dependabot/alerts",
  8452. "GET /enterprises/{enterprise}/secret-scanning/alerts",
  8453. "GET /events",
  8454. "GET /gists",
  8455. "GET /gists/public",
  8456. "GET /gists/starred",
  8457. "GET /gists/{gist_id}/comments",
  8458. "GET /gists/{gist_id}/commits",
  8459. "GET /gists/{gist_id}/forks",
  8460. "GET /installation/repositories",
  8461. "GET /issues",
  8462. "GET /licenses",
  8463. "GET /marketplace_listing/plans",
  8464. "GET /marketplace_listing/plans/{plan_id}/accounts",
  8465. "GET /marketplace_listing/stubbed/plans",
  8466. "GET /marketplace_listing/stubbed/plans/{plan_id}/accounts",
  8467. "GET /networks/{owner}/{repo}/events",
  8468. "GET /notifications",
  8469. "GET /organizations",
  8470. "GET /orgs/{org}/actions/cache/usage-by-repository",
  8471. "GET /orgs/{org}/actions/permissions/repositories",
  8472. "GET /orgs/{org}/actions/runners",
  8473. "GET /orgs/{org}/actions/secrets",
  8474. "GET /orgs/{org}/actions/secrets/{secret_name}/repositories",
  8475. "GET /orgs/{org}/actions/variables",
  8476. "GET /orgs/{org}/actions/variables/{name}/repositories",
  8477. "GET /orgs/{org}/blocks",
  8478. "GET /orgs/{org}/code-scanning/alerts",
  8479. "GET /orgs/{org}/codespaces",
  8480. "GET /orgs/{org}/codespaces/secrets",
  8481. "GET /orgs/{org}/codespaces/secrets/{secret_name}/repositories",
  8482. "GET /orgs/{org}/copilot/billing/seats",
  8483. "GET /orgs/{org}/dependabot/alerts",
  8484. "GET /orgs/{org}/dependabot/secrets",
  8485. "GET /orgs/{org}/dependabot/secrets/{secret_name}/repositories",
  8486. "GET /orgs/{org}/events",
  8487. "GET /orgs/{org}/failed_invitations",
  8488. "GET /orgs/{org}/hooks",
  8489. "GET /orgs/{org}/hooks/{hook_id}/deliveries",
  8490. "GET /orgs/{org}/installations",
  8491. "GET /orgs/{org}/invitations",
  8492. "GET /orgs/{org}/invitations/{invitation_id}/teams",
  8493. "GET /orgs/{org}/issues",
  8494. "GET /orgs/{org}/members",
  8495. "GET /orgs/{org}/members/{username}/codespaces",
  8496. "GET /orgs/{org}/migrations",
  8497. "GET /orgs/{org}/migrations/{migration_id}/repositories",
  8498. "GET /orgs/{org}/organization-roles/{role_id}/teams",
  8499. "GET /orgs/{org}/organization-roles/{role_id}/users",
  8500. "GET /orgs/{org}/outside_collaborators",
  8501. "GET /orgs/{org}/packages",
  8502. "GET /orgs/{org}/packages/{package_type}/{package_name}/versions",
  8503. "GET /orgs/{org}/personal-access-token-requests",
  8504. "GET /orgs/{org}/personal-access-token-requests/{pat_request_id}/repositories",
  8505. "GET /orgs/{org}/personal-access-tokens",
  8506. "GET /orgs/{org}/personal-access-tokens/{pat_id}/repositories",
  8507. "GET /orgs/{org}/projects",
  8508. "GET /orgs/{org}/properties/values",
  8509. "GET /orgs/{org}/public_members",
  8510. "GET /orgs/{org}/repos",
  8511. "GET /orgs/{org}/rulesets",
  8512. "GET /orgs/{org}/rulesets/rule-suites",
  8513. "GET /orgs/{org}/secret-scanning/alerts",
  8514. "GET /orgs/{org}/security-advisories",
  8515. "GET /orgs/{org}/teams",
  8516. "GET /orgs/{org}/teams/{team_slug}/discussions",
  8517. "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments",
  8518. "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions",
  8519. "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions",
  8520. "GET /orgs/{org}/teams/{team_slug}/invitations",
  8521. "GET /orgs/{org}/teams/{team_slug}/members",
  8522. "GET /orgs/{org}/teams/{team_slug}/projects",
  8523. "GET /orgs/{org}/teams/{team_slug}/repos",
  8524. "GET /orgs/{org}/teams/{team_slug}/teams",
  8525. "GET /projects/columns/{column_id}/cards",
  8526. "GET /projects/{project_id}/collaborators",
  8527. "GET /projects/{project_id}/columns",
  8528. "GET /repos/{owner}/{repo}/actions/artifacts",
  8529. "GET /repos/{owner}/{repo}/actions/caches",
  8530. "GET /repos/{owner}/{repo}/actions/organization-secrets",
  8531. "GET /repos/{owner}/{repo}/actions/organization-variables",
  8532. "GET /repos/{owner}/{repo}/actions/runners",
  8533. "GET /repos/{owner}/{repo}/actions/runs",
  8534. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts",
  8535. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/jobs",
  8536. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs",
  8537. "GET /repos/{owner}/{repo}/actions/secrets",
  8538. "GET /repos/{owner}/{repo}/actions/variables",
  8539. "GET /repos/{owner}/{repo}/actions/workflows",
  8540. "GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs",
  8541. "GET /repos/{owner}/{repo}/activity",
  8542. "GET /repos/{owner}/{repo}/assignees",
  8543. "GET /repos/{owner}/{repo}/branches",
  8544. "GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations",
  8545. "GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs",
  8546. "GET /repos/{owner}/{repo}/code-scanning/alerts",
  8547. "GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances",
  8548. "GET /repos/{owner}/{repo}/code-scanning/analyses",
  8549. "GET /repos/{owner}/{repo}/codespaces",
  8550. "GET /repos/{owner}/{repo}/codespaces/devcontainers",
  8551. "GET /repos/{owner}/{repo}/codespaces/secrets",
  8552. "GET /repos/{owner}/{repo}/collaborators",
  8553. "GET /repos/{owner}/{repo}/comments",
  8554. "GET /repos/{owner}/{repo}/comments/{comment_id}/reactions",
  8555. "GET /repos/{owner}/{repo}/commits",
  8556. "GET /repos/{owner}/{repo}/commits/{commit_sha}/comments",
  8557. "GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls",
  8558. "GET /repos/{owner}/{repo}/commits/{ref}/check-runs",
  8559. "GET /repos/{owner}/{repo}/commits/{ref}/check-suites",
  8560. "GET /repos/{owner}/{repo}/commits/{ref}/status",
  8561. "GET /repos/{owner}/{repo}/commits/{ref}/statuses",
  8562. "GET /repos/{owner}/{repo}/contributors",
  8563. "GET /repos/{owner}/{repo}/dependabot/alerts",
  8564. "GET /repos/{owner}/{repo}/dependabot/secrets",
  8565. "GET /repos/{owner}/{repo}/deployments",
  8566. "GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses",
  8567. "GET /repos/{owner}/{repo}/environments",
  8568. "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies",
  8569. "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/apps",
  8570. "GET /repos/{owner}/{repo}/events",
  8571. "GET /repos/{owner}/{repo}/forks",
  8572. "GET /repos/{owner}/{repo}/hooks",
  8573. "GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries",
  8574. "GET /repos/{owner}/{repo}/invitations",
  8575. "GET /repos/{owner}/{repo}/issues",
  8576. "GET /repos/{owner}/{repo}/issues/comments",
  8577. "GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions",
  8578. "GET /repos/{owner}/{repo}/issues/events",
  8579. "GET /repos/{owner}/{repo}/issues/{issue_number}/comments",
  8580. "GET /repos/{owner}/{repo}/issues/{issue_number}/events",
  8581. "GET /repos/{owner}/{repo}/issues/{issue_number}/labels",
  8582. "GET /repos/{owner}/{repo}/issues/{issue_number}/reactions",
  8583. "GET /repos/{owner}/{repo}/issues/{issue_number}/timeline",
  8584. "GET /repos/{owner}/{repo}/keys",
  8585. "GET /repos/{owner}/{repo}/labels",
  8586. "GET /repos/{owner}/{repo}/milestones",
  8587. "GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels",
  8588. "GET /repos/{owner}/{repo}/notifications",
  8589. "GET /repos/{owner}/{repo}/pages/builds",
  8590. "GET /repos/{owner}/{repo}/projects",
  8591. "GET /repos/{owner}/{repo}/pulls",
  8592. "GET /repos/{owner}/{repo}/pulls/comments",
  8593. "GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions",
  8594. "GET /repos/{owner}/{repo}/pulls/{pull_number}/comments",
  8595. "GET /repos/{owner}/{repo}/pulls/{pull_number}/commits",
  8596. "GET /repos/{owner}/{repo}/pulls/{pull_number}/files",
  8597. "GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews",
  8598. "GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments",
  8599. "GET /repos/{owner}/{repo}/releases",
  8600. "GET /repos/{owner}/{repo}/releases/{release_id}/assets",
  8601. "GET /repos/{owner}/{repo}/releases/{release_id}/reactions",
  8602. "GET /repos/{owner}/{repo}/rules/branches/{branch}",
  8603. "GET /repos/{owner}/{repo}/rulesets",
  8604. "GET /repos/{owner}/{repo}/rulesets/rule-suites",
  8605. "GET /repos/{owner}/{repo}/secret-scanning/alerts",
  8606. "GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations",
  8607. "GET /repos/{owner}/{repo}/security-advisories",
  8608. "GET /repos/{owner}/{repo}/stargazers",
  8609. "GET /repos/{owner}/{repo}/subscribers",
  8610. "GET /repos/{owner}/{repo}/tags",
  8611. "GET /repos/{owner}/{repo}/teams",
  8612. "GET /repos/{owner}/{repo}/topics",
  8613. "GET /repositories",
  8614. "GET /repositories/{repository_id}/environments/{environment_name}/secrets",
  8615. "GET /repositories/{repository_id}/environments/{environment_name}/variables",
  8616. "GET /search/code",
  8617. "GET /search/commits",
  8618. "GET /search/issues",
  8619. "GET /search/labels",
  8620. "GET /search/repositories",
  8621. "GET /search/topics",
  8622. "GET /search/users",
  8623. "GET /teams/{team_id}/discussions",
  8624. "GET /teams/{team_id}/discussions/{discussion_number}/comments",
  8625. "GET /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions",
  8626. "GET /teams/{team_id}/discussions/{discussion_number}/reactions",
  8627. "GET /teams/{team_id}/invitations",
  8628. "GET /teams/{team_id}/members",
  8629. "GET /teams/{team_id}/projects",
  8630. "GET /teams/{team_id}/repos",
  8631. "GET /teams/{team_id}/teams",
  8632. "GET /user/blocks",
  8633. "GET /user/codespaces",
  8634. "GET /user/codespaces/secrets",
  8635. "GET /user/emails",
  8636. "GET /user/followers",
  8637. "GET /user/following",
  8638. "GET /user/gpg_keys",
  8639. "GET /user/installations",
  8640. "GET /user/installations/{installation_id}/repositories",
  8641. "GET /user/issues",
  8642. "GET /user/keys",
  8643. "GET /user/marketplace_purchases",
  8644. "GET /user/marketplace_purchases/stubbed",
  8645. "GET /user/memberships/orgs",
  8646. "GET /user/migrations",
  8647. "GET /user/migrations/{migration_id}/repositories",
  8648. "GET /user/orgs",
  8649. "GET /user/packages",
  8650. "GET /user/packages/{package_type}/{package_name}/versions",
  8651. "GET /user/public_emails",
  8652. "GET /user/repos",
  8653. "GET /user/repository_invitations",
  8654. "GET /user/social_accounts",
  8655. "GET /user/ssh_signing_keys",
  8656. "GET /user/starred",
  8657. "GET /user/subscriptions",
  8658. "GET /user/teams",
  8659. "GET /users",
  8660. "GET /users/{username}/events",
  8661. "GET /users/{username}/events/orgs/{org}",
  8662. "GET /users/{username}/events/public",
  8663. "GET /users/{username}/followers",
  8664. "GET /users/{username}/following",
  8665. "GET /users/{username}/gists",
  8666. "GET /users/{username}/gpg_keys",
  8667. "GET /users/{username}/keys",
  8668. "GET /users/{username}/orgs",
  8669. "GET /users/{username}/packages",
  8670. "GET /users/{username}/projects",
  8671. "GET /users/{username}/received_events",
  8672. "GET /users/{username}/received_events/public",
  8673. "GET /users/{username}/repos",
  8674. "GET /users/{username}/social_accounts",
  8675. "GET /users/{username}/ssh_signing_keys",
  8676. "GET /users/{username}/starred",
  8677. "GET /users/{username}/subscriptions"
  8678. ];
  8679. // pkg/dist-src/paginating-endpoints.js
  8680. function isPaginatingEndpoint(arg) {
  8681. if (typeof arg === "string") {
  8682. return paginatingEndpoints.includes(arg);
  8683. } else {
  8684. return false;
  8685. }
  8686. }
  8687. // pkg/dist-src/index.js
  8688. function paginateRest(octokit) {
  8689. return {
  8690. paginate: Object.assign(paginate.bind(null, octokit), {
  8691. iterator: iterator.bind(null, octokit)
  8692. })
  8693. };
  8694. }
  8695. paginateRest.VERSION = VERSION;
  8696. // Annotate the CommonJS export names for ESM import in node:
  8697. 0 && (0);
  8698. /***/ }),
  8699. /***/ 3044:
  8700. /***/ ((module) => {
  8701. "use strict";
  8702. var __defProp = Object.defineProperty;
  8703. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  8704. var __getOwnPropNames = Object.getOwnPropertyNames;
  8705. var __hasOwnProp = Object.prototype.hasOwnProperty;
  8706. var __export = (target, all) => {
  8707. for (var name in all)
  8708. __defProp(target, name, { get: all[name], enumerable: true });
  8709. };
  8710. var __copyProps = (to, from, except, desc) => {
  8711. if (from && typeof from === "object" || typeof from === "function") {
  8712. for (let key of __getOwnPropNames(from))
  8713. if (!__hasOwnProp.call(to, key) && key !== except)
  8714. __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  8715. }
  8716. return to;
  8717. };
  8718. var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
  8719. // pkg/dist-src/index.js
  8720. var dist_src_exports = {};
  8721. __export(dist_src_exports, {
  8722. legacyRestEndpointMethods: () => legacyRestEndpointMethods,
  8723. restEndpointMethods: () => restEndpointMethods
  8724. });
  8725. module.exports = __toCommonJS(dist_src_exports);
  8726. // pkg/dist-src/version.js
  8727. var VERSION = "10.4.1";
  8728. // pkg/dist-src/generated/endpoints.js
  8729. var Endpoints = {
  8730. actions: {
  8731. addCustomLabelsToSelfHostedRunnerForOrg: [
  8732. "POST /orgs/{org}/actions/runners/{runner_id}/labels"
  8733. ],
  8734. addCustomLabelsToSelfHostedRunnerForRepo: [
  8735. "POST /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"
  8736. ],
  8737. addSelectedRepoToOrgSecret: [
  8738. "PUT /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}"
  8739. ],
  8740. addSelectedRepoToOrgVariable: [
  8741. "PUT /orgs/{org}/actions/variables/{name}/repositories/{repository_id}"
  8742. ],
  8743. approveWorkflowRun: [
  8744. "POST /repos/{owner}/{repo}/actions/runs/{run_id}/approve"
  8745. ],
  8746. cancelWorkflowRun: [
  8747. "POST /repos/{owner}/{repo}/actions/runs/{run_id}/cancel"
  8748. ],
  8749. createEnvironmentVariable: [
  8750. "POST /repositories/{repository_id}/environments/{environment_name}/variables"
  8751. ],
  8752. createOrUpdateEnvironmentSecret: [
  8753. "PUT /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}"
  8754. ],
  8755. createOrUpdateOrgSecret: ["PUT /orgs/{org}/actions/secrets/{secret_name}"],
  8756. createOrUpdateRepoSecret: [
  8757. "PUT /repos/{owner}/{repo}/actions/secrets/{secret_name}"
  8758. ],
  8759. createOrgVariable: ["POST /orgs/{org}/actions/variables"],
  8760. createRegistrationTokenForOrg: [
  8761. "POST /orgs/{org}/actions/runners/registration-token"
  8762. ],
  8763. createRegistrationTokenForRepo: [
  8764. "POST /repos/{owner}/{repo}/actions/runners/registration-token"
  8765. ],
  8766. createRemoveTokenForOrg: ["POST /orgs/{org}/actions/runners/remove-token"],
  8767. createRemoveTokenForRepo: [
  8768. "POST /repos/{owner}/{repo}/actions/runners/remove-token"
  8769. ],
  8770. createRepoVariable: ["POST /repos/{owner}/{repo}/actions/variables"],
  8771. createWorkflowDispatch: [
  8772. "POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches"
  8773. ],
  8774. deleteActionsCacheById: [
  8775. "DELETE /repos/{owner}/{repo}/actions/caches/{cache_id}"
  8776. ],
  8777. deleteActionsCacheByKey: [
  8778. "DELETE /repos/{owner}/{repo}/actions/caches{?key,ref}"
  8779. ],
  8780. deleteArtifact: [
  8781. "DELETE /repos/{owner}/{repo}/actions/artifacts/{artifact_id}"
  8782. ],
  8783. deleteEnvironmentSecret: [
  8784. "DELETE /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}"
  8785. ],
  8786. deleteEnvironmentVariable: [
  8787. "DELETE /repositories/{repository_id}/environments/{environment_name}/variables/{name}"
  8788. ],
  8789. deleteOrgSecret: ["DELETE /orgs/{org}/actions/secrets/{secret_name}"],
  8790. deleteOrgVariable: ["DELETE /orgs/{org}/actions/variables/{name}"],
  8791. deleteRepoSecret: [
  8792. "DELETE /repos/{owner}/{repo}/actions/secrets/{secret_name}"
  8793. ],
  8794. deleteRepoVariable: [
  8795. "DELETE /repos/{owner}/{repo}/actions/variables/{name}"
  8796. ],
  8797. deleteSelfHostedRunnerFromOrg: [
  8798. "DELETE /orgs/{org}/actions/runners/{runner_id}"
  8799. ],
  8800. deleteSelfHostedRunnerFromRepo: [
  8801. "DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}"
  8802. ],
  8803. deleteWorkflowRun: ["DELETE /repos/{owner}/{repo}/actions/runs/{run_id}"],
  8804. deleteWorkflowRunLogs: [
  8805. "DELETE /repos/{owner}/{repo}/actions/runs/{run_id}/logs"
  8806. ],
  8807. disableSelectedRepositoryGithubActionsOrganization: [
  8808. "DELETE /orgs/{org}/actions/permissions/repositories/{repository_id}"
  8809. ],
  8810. disableWorkflow: [
  8811. "PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/disable"
  8812. ],
  8813. downloadArtifact: [
  8814. "GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}"
  8815. ],
  8816. downloadJobLogsForWorkflowRun: [
  8817. "GET /repos/{owner}/{repo}/actions/jobs/{job_id}/logs"
  8818. ],
  8819. downloadWorkflowRunAttemptLogs: [
  8820. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/logs"
  8821. ],
  8822. downloadWorkflowRunLogs: [
  8823. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/logs"
  8824. ],
  8825. enableSelectedRepositoryGithubActionsOrganization: [
  8826. "PUT /orgs/{org}/actions/permissions/repositories/{repository_id}"
  8827. ],
  8828. enableWorkflow: [
  8829. "PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/enable"
  8830. ],
  8831. forceCancelWorkflowRun: [
  8832. "POST /repos/{owner}/{repo}/actions/runs/{run_id}/force-cancel"
  8833. ],
  8834. generateRunnerJitconfigForOrg: [
  8835. "POST /orgs/{org}/actions/runners/generate-jitconfig"
  8836. ],
  8837. generateRunnerJitconfigForRepo: [
  8838. "POST /repos/{owner}/{repo}/actions/runners/generate-jitconfig"
  8839. ],
  8840. getActionsCacheList: ["GET /repos/{owner}/{repo}/actions/caches"],
  8841. getActionsCacheUsage: ["GET /repos/{owner}/{repo}/actions/cache/usage"],
  8842. getActionsCacheUsageByRepoForOrg: [
  8843. "GET /orgs/{org}/actions/cache/usage-by-repository"
  8844. ],
  8845. getActionsCacheUsageForOrg: ["GET /orgs/{org}/actions/cache/usage"],
  8846. getAllowedActionsOrganization: [
  8847. "GET /orgs/{org}/actions/permissions/selected-actions"
  8848. ],
  8849. getAllowedActionsRepository: [
  8850. "GET /repos/{owner}/{repo}/actions/permissions/selected-actions"
  8851. ],
  8852. getArtifact: ["GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}"],
  8853. getCustomOidcSubClaimForRepo: [
  8854. "GET /repos/{owner}/{repo}/actions/oidc/customization/sub"
  8855. ],
  8856. getEnvironmentPublicKey: [
  8857. "GET /repositories/{repository_id}/environments/{environment_name}/secrets/public-key"
  8858. ],
  8859. getEnvironmentSecret: [
  8860. "GET /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}"
  8861. ],
  8862. getEnvironmentVariable: [
  8863. "GET /repositories/{repository_id}/environments/{environment_name}/variables/{name}"
  8864. ],
  8865. getGithubActionsDefaultWorkflowPermissionsOrganization: [
  8866. "GET /orgs/{org}/actions/permissions/workflow"
  8867. ],
  8868. getGithubActionsDefaultWorkflowPermissionsRepository: [
  8869. "GET /repos/{owner}/{repo}/actions/permissions/workflow"
  8870. ],
  8871. getGithubActionsPermissionsOrganization: [
  8872. "GET /orgs/{org}/actions/permissions"
  8873. ],
  8874. getGithubActionsPermissionsRepository: [
  8875. "GET /repos/{owner}/{repo}/actions/permissions"
  8876. ],
  8877. getJobForWorkflowRun: ["GET /repos/{owner}/{repo}/actions/jobs/{job_id}"],
  8878. getOrgPublicKey: ["GET /orgs/{org}/actions/secrets/public-key"],
  8879. getOrgSecret: ["GET /orgs/{org}/actions/secrets/{secret_name}"],
  8880. getOrgVariable: ["GET /orgs/{org}/actions/variables/{name}"],
  8881. getPendingDeploymentsForRun: [
  8882. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments"
  8883. ],
  8884. getRepoPermissions: [
  8885. "GET /repos/{owner}/{repo}/actions/permissions",
  8886. {},
  8887. { renamed: ["actions", "getGithubActionsPermissionsRepository"] }
  8888. ],
  8889. getRepoPublicKey: ["GET /repos/{owner}/{repo}/actions/secrets/public-key"],
  8890. getRepoSecret: ["GET /repos/{owner}/{repo}/actions/secrets/{secret_name}"],
  8891. getRepoVariable: ["GET /repos/{owner}/{repo}/actions/variables/{name}"],
  8892. getReviewsForRun: [
  8893. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/approvals"
  8894. ],
  8895. getSelfHostedRunnerForOrg: ["GET /orgs/{org}/actions/runners/{runner_id}"],
  8896. getSelfHostedRunnerForRepo: [
  8897. "GET /repos/{owner}/{repo}/actions/runners/{runner_id}"
  8898. ],
  8899. getWorkflow: ["GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}"],
  8900. getWorkflowAccessToRepository: [
  8901. "GET /repos/{owner}/{repo}/actions/permissions/access"
  8902. ],
  8903. getWorkflowRun: ["GET /repos/{owner}/{repo}/actions/runs/{run_id}"],
  8904. getWorkflowRunAttempt: [
  8905. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}"
  8906. ],
  8907. getWorkflowRunUsage: [
  8908. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/timing"
  8909. ],
  8910. getWorkflowUsage: [
  8911. "GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/timing"
  8912. ],
  8913. listArtifactsForRepo: ["GET /repos/{owner}/{repo}/actions/artifacts"],
  8914. listEnvironmentSecrets: [
  8915. "GET /repositories/{repository_id}/environments/{environment_name}/secrets"
  8916. ],
  8917. listEnvironmentVariables: [
  8918. "GET /repositories/{repository_id}/environments/{environment_name}/variables"
  8919. ],
  8920. listJobsForWorkflowRun: [
  8921. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs"
  8922. ],
  8923. listJobsForWorkflowRunAttempt: [
  8924. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/jobs"
  8925. ],
  8926. listLabelsForSelfHostedRunnerForOrg: [
  8927. "GET /orgs/{org}/actions/runners/{runner_id}/labels"
  8928. ],
  8929. listLabelsForSelfHostedRunnerForRepo: [
  8930. "GET /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"
  8931. ],
  8932. listOrgSecrets: ["GET /orgs/{org}/actions/secrets"],
  8933. listOrgVariables: ["GET /orgs/{org}/actions/variables"],
  8934. listRepoOrganizationSecrets: [
  8935. "GET /repos/{owner}/{repo}/actions/organization-secrets"
  8936. ],
  8937. listRepoOrganizationVariables: [
  8938. "GET /repos/{owner}/{repo}/actions/organization-variables"
  8939. ],
  8940. listRepoSecrets: ["GET /repos/{owner}/{repo}/actions/secrets"],
  8941. listRepoVariables: ["GET /repos/{owner}/{repo}/actions/variables"],
  8942. listRepoWorkflows: ["GET /repos/{owner}/{repo}/actions/workflows"],
  8943. listRunnerApplicationsForOrg: ["GET /orgs/{org}/actions/runners/downloads"],
  8944. listRunnerApplicationsForRepo: [
  8945. "GET /repos/{owner}/{repo}/actions/runners/downloads"
  8946. ],
  8947. listSelectedReposForOrgSecret: [
  8948. "GET /orgs/{org}/actions/secrets/{secret_name}/repositories"
  8949. ],
  8950. listSelectedReposForOrgVariable: [
  8951. "GET /orgs/{org}/actions/variables/{name}/repositories"
  8952. ],
  8953. listSelectedRepositoriesEnabledGithubActionsOrganization: [
  8954. "GET /orgs/{org}/actions/permissions/repositories"
  8955. ],
  8956. listSelfHostedRunnersForOrg: ["GET /orgs/{org}/actions/runners"],
  8957. listSelfHostedRunnersForRepo: ["GET /repos/{owner}/{repo}/actions/runners"],
  8958. listWorkflowRunArtifacts: [
  8959. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts"
  8960. ],
  8961. listWorkflowRuns: [
  8962. "GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs"
  8963. ],
  8964. listWorkflowRunsForRepo: ["GET /repos/{owner}/{repo}/actions/runs"],
  8965. reRunJobForWorkflowRun: [
  8966. "POST /repos/{owner}/{repo}/actions/jobs/{job_id}/rerun"
  8967. ],
  8968. reRunWorkflow: ["POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun"],
  8969. reRunWorkflowFailedJobs: [
  8970. "POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun-failed-jobs"
  8971. ],
  8972. removeAllCustomLabelsFromSelfHostedRunnerForOrg: [
  8973. "DELETE /orgs/{org}/actions/runners/{runner_id}/labels"
  8974. ],
  8975. removeAllCustomLabelsFromSelfHostedRunnerForRepo: [
  8976. "DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"
  8977. ],
  8978. removeCustomLabelFromSelfHostedRunnerForOrg: [
  8979. "DELETE /orgs/{org}/actions/runners/{runner_id}/labels/{name}"
  8980. ],
  8981. removeCustomLabelFromSelfHostedRunnerForRepo: [
  8982. "DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}/labels/{name}"
  8983. ],
  8984. removeSelectedRepoFromOrgSecret: [
  8985. "DELETE /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}"
  8986. ],
  8987. removeSelectedRepoFromOrgVariable: [
  8988. "DELETE /orgs/{org}/actions/variables/{name}/repositories/{repository_id}"
  8989. ],
  8990. reviewCustomGatesForRun: [
  8991. "POST /repos/{owner}/{repo}/actions/runs/{run_id}/deployment_protection_rule"
  8992. ],
  8993. reviewPendingDeploymentsForRun: [
  8994. "POST /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments"
  8995. ],
  8996. setAllowedActionsOrganization: [
  8997. "PUT /orgs/{org}/actions/permissions/selected-actions"
  8998. ],
  8999. setAllowedActionsRepository: [
  9000. "PUT /repos/{owner}/{repo}/actions/permissions/selected-actions"
  9001. ],
  9002. setCustomLabelsForSelfHostedRunnerForOrg: [
  9003. "PUT /orgs/{org}/actions/runners/{runner_id}/labels"
  9004. ],
  9005. setCustomLabelsForSelfHostedRunnerForRepo: [
  9006. "PUT /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"
  9007. ],
  9008. setCustomOidcSubClaimForRepo: [
  9009. "PUT /repos/{owner}/{repo}/actions/oidc/customization/sub"
  9010. ],
  9011. setGithubActionsDefaultWorkflowPermissionsOrganization: [
  9012. "PUT /orgs/{org}/actions/permissions/workflow"
  9013. ],
  9014. setGithubActionsDefaultWorkflowPermissionsRepository: [
  9015. "PUT /repos/{owner}/{repo}/actions/permissions/workflow"
  9016. ],
  9017. setGithubActionsPermissionsOrganization: [
  9018. "PUT /orgs/{org}/actions/permissions"
  9019. ],
  9020. setGithubActionsPermissionsRepository: [
  9021. "PUT /repos/{owner}/{repo}/actions/permissions"
  9022. ],
  9023. setSelectedReposForOrgSecret: [
  9024. "PUT /orgs/{org}/actions/secrets/{secret_name}/repositories"
  9025. ],
  9026. setSelectedReposForOrgVariable: [
  9027. "PUT /orgs/{org}/actions/variables/{name}/repositories"
  9028. ],
  9029. setSelectedRepositoriesEnabledGithubActionsOrganization: [
  9030. "PUT /orgs/{org}/actions/permissions/repositories"
  9031. ],
  9032. setWorkflowAccessToRepository: [
  9033. "PUT /repos/{owner}/{repo}/actions/permissions/access"
  9034. ],
  9035. updateEnvironmentVariable: [
  9036. "PATCH /repositories/{repository_id}/environments/{environment_name}/variables/{name}"
  9037. ],
  9038. updateOrgVariable: ["PATCH /orgs/{org}/actions/variables/{name}"],
  9039. updateRepoVariable: [
  9040. "PATCH /repos/{owner}/{repo}/actions/variables/{name}"
  9041. ]
  9042. },
  9043. activity: {
  9044. checkRepoIsStarredByAuthenticatedUser: ["GET /user/starred/{owner}/{repo}"],
  9045. deleteRepoSubscription: ["DELETE /repos/{owner}/{repo}/subscription"],
  9046. deleteThreadSubscription: [
  9047. "DELETE /notifications/threads/{thread_id}/subscription"
  9048. ],
  9049. getFeeds: ["GET /feeds"],
  9050. getRepoSubscription: ["GET /repos/{owner}/{repo}/subscription"],
  9051. getThread: ["GET /notifications/threads/{thread_id}"],
  9052. getThreadSubscriptionForAuthenticatedUser: [
  9053. "GET /notifications/threads/{thread_id}/subscription"
  9054. ],
  9055. listEventsForAuthenticatedUser: ["GET /users/{username}/events"],
  9056. listNotificationsForAuthenticatedUser: ["GET /notifications"],
  9057. listOrgEventsForAuthenticatedUser: [
  9058. "GET /users/{username}/events/orgs/{org}"
  9059. ],
  9060. listPublicEvents: ["GET /events"],
  9061. listPublicEventsForRepoNetwork: ["GET /networks/{owner}/{repo}/events"],
  9062. listPublicEventsForUser: ["GET /users/{username}/events/public"],
  9063. listPublicOrgEvents: ["GET /orgs/{org}/events"],
  9064. listReceivedEventsForUser: ["GET /users/{username}/received_events"],
  9065. listReceivedPublicEventsForUser: [
  9066. "GET /users/{username}/received_events/public"
  9067. ],
  9068. listRepoEvents: ["GET /repos/{owner}/{repo}/events"],
  9069. listRepoNotificationsForAuthenticatedUser: [
  9070. "GET /repos/{owner}/{repo}/notifications"
  9071. ],
  9072. listReposStarredByAuthenticatedUser: ["GET /user/starred"],
  9073. listReposStarredByUser: ["GET /users/{username}/starred"],
  9074. listReposWatchedByUser: ["GET /users/{username}/subscriptions"],
  9075. listStargazersForRepo: ["GET /repos/{owner}/{repo}/stargazers"],
  9076. listWatchedReposForAuthenticatedUser: ["GET /user/subscriptions"],
  9077. listWatchersForRepo: ["GET /repos/{owner}/{repo}/subscribers"],
  9078. markNotificationsAsRead: ["PUT /notifications"],
  9079. markRepoNotificationsAsRead: ["PUT /repos/{owner}/{repo}/notifications"],
  9080. markThreadAsDone: ["DELETE /notifications/threads/{thread_id}"],
  9081. markThreadAsRead: ["PATCH /notifications/threads/{thread_id}"],
  9082. setRepoSubscription: ["PUT /repos/{owner}/{repo}/subscription"],
  9083. setThreadSubscription: [
  9084. "PUT /notifications/threads/{thread_id}/subscription"
  9085. ],
  9086. starRepoForAuthenticatedUser: ["PUT /user/starred/{owner}/{repo}"],
  9087. unstarRepoForAuthenticatedUser: ["DELETE /user/starred/{owner}/{repo}"]
  9088. },
  9089. apps: {
  9090. addRepoToInstallation: [
  9091. "PUT /user/installations/{installation_id}/repositories/{repository_id}",
  9092. {},
  9093. { renamed: ["apps", "addRepoToInstallationForAuthenticatedUser"] }
  9094. ],
  9095. addRepoToInstallationForAuthenticatedUser: [
  9096. "PUT /user/installations/{installation_id}/repositories/{repository_id}"
  9097. ],
  9098. checkToken: ["POST /applications/{client_id}/token"],
  9099. createFromManifest: ["POST /app-manifests/{code}/conversions"],
  9100. createInstallationAccessToken: [
  9101. "POST /app/installations/{installation_id}/access_tokens"
  9102. ],
  9103. deleteAuthorization: ["DELETE /applications/{client_id}/grant"],
  9104. deleteInstallation: ["DELETE /app/installations/{installation_id}"],
  9105. deleteToken: ["DELETE /applications/{client_id}/token"],
  9106. getAuthenticated: ["GET /app"],
  9107. getBySlug: ["GET /apps/{app_slug}"],
  9108. getInstallation: ["GET /app/installations/{installation_id}"],
  9109. getOrgInstallation: ["GET /orgs/{org}/installation"],
  9110. getRepoInstallation: ["GET /repos/{owner}/{repo}/installation"],
  9111. getSubscriptionPlanForAccount: [
  9112. "GET /marketplace_listing/accounts/{account_id}"
  9113. ],
  9114. getSubscriptionPlanForAccountStubbed: [
  9115. "GET /marketplace_listing/stubbed/accounts/{account_id}"
  9116. ],
  9117. getUserInstallation: ["GET /users/{username}/installation"],
  9118. getWebhookConfigForApp: ["GET /app/hook/config"],
  9119. getWebhookDelivery: ["GET /app/hook/deliveries/{delivery_id}"],
  9120. listAccountsForPlan: ["GET /marketplace_listing/plans/{plan_id}/accounts"],
  9121. listAccountsForPlanStubbed: [
  9122. "GET /marketplace_listing/stubbed/plans/{plan_id}/accounts"
  9123. ],
  9124. listInstallationReposForAuthenticatedUser: [
  9125. "GET /user/installations/{installation_id}/repositories"
  9126. ],
  9127. listInstallationRequestsForAuthenticatedApp: [
  9128. "GET /app/installation-requests"
  9129. ],
  9130. listInstallations: ["GET /app/installations"],
  9131. listInstallationsForAuthenticatedUser: ["GET /user/installations"],
  9132. listPlans: ["GET /marketplace_listing/plans"],
  9133. listPlansStubbed: ["GET /marketplace_listing/stubbed/plans"],
  9134. listReposAccessibleToInstallation: ["GET /installation/repositories"],
  9135. listSubscriptionsForAuthenticatedUser: ["GET /user/marketplace_purchases"],
  9136. listSubscriptionsForAuthenticatedUserStubbed: [
  9137. "GET /user/marketplace_purchases/stubbed"
  9138. ],
  9139. listWebhookDeliveries: ["GET /app/hook/deliveries"],
  9140. redeliverWebhookDelivery: [
  9141. "POST /app/hook/deliveries/{delivery_id}/attempts"
  9142. ],
  9143. removeRepoFromInstallation: [
  9144. "DELETE /user/installations/{installation_id}/repositories/{repository_id}",
  9145. {},
  9146. { renamed: ["apps", "removeRepoFromInstallationForAuthenticatedUser"] }
  9147. ],
  9148. removeRepoFromInstallationForAuthenticatedUser: [
  9149. "DELETE /user/installations/{installation_id}/repositories/{repository_id}"
  9150. ],
  9151. resetToken: ["PATCH /applications/{client_id}/token"],
  9152. revokeInstallationAccessToken: ["DELETE /installation/token"],
  9153. scopeToken: ["POST /applications/{client_id}/token/scoped"],
  9154. suspendInstallation: ["PUT /app/installations/{installation_id}/suspended"],
  9155. unsuspendInstallation: [
  9156. "DELETE /app/installations/{installation_id}/suspended"
  9157. ],
  9158. updateWebhookConfigForApp: ["PATCH /app/hook/config"]
  9159. },
  9160. billing: {
  9161. getGithubActionsBillingOrg: ["GET /orgs/{org}/settings/billing/actions"],
  9162. getGithubActionsBillingUser: [
  9163. "GET /users/{username}/settings/billing/actions"
  9164. ],
  9165. getGithubPackagesBillingOrg: ["GET /orgs/{org}/settings/billing/packages"],
  9166. getGithubPackagesBillingUser: [
  9167. "GET /users/{username}/settings/billing/packages"
  9168. ],
  9169. getSharedStorageBillingOrg: [
  9170. "GET /orgs/{org}/settings/billing/shared-storage"
  9171. ],
  9172. getSharedStorageBillingUser: [
  9173. "GET /users/{username}/settings/billing/shared-storage"
  9174. ]
  9175. },
  9176. checks: {
  9177. create: ["POST /repos/{owner}/{repo}/check-runs"],
  9178. createSuite: ["POST /repos/{owner}/{repo}/check-suites"],
  9179. get: ["GET /repos/{owner}/{repo}/check-runs/{check_run_id}"],
  9180. getSuite: ["GET /repos/{owner}/{repo}/check-suites/{check_suite_id}"],
  9181. listAnnotations: [
  9182. "GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations"
  9183. ],
  9184. listForRef: ["GET /repos/{owner}/{repo}/commits/{ref}/check-runs"],
  9185. listForSuite: [
  9186. "GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs"
  9187. ],
  9188. listSuitesForRef: ["GET /repos/{owner}/{repo}/commits/{ref}/check-suites"],
  9189. rerequestRun: [
  9190. "POST /repos/{owner}/{repo}/check-runs/{check_run_id}/rerequest"
  9191. ],
  9192. rerequestSuite: [
  9193. "POST /repos/{owner}/{repo}/check-suites/{check_suite_id}/rerequest"
  9194. ],
  9195. setSuitesPreferences: [
  9196. "PATCH /repos/{owner}/{repo}/check-suites/preferences"
  9197. ],
  9198. update: ["PATCH /repos/{owner}/{repo}/check-runs/{check_run_id}"]
  9199. },
  9200. codeScanning: {
  9201. deleteAnalysis: [
  9202. "DELETE /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}{?confirm_delete}"
  9203. ],
  9204. getAlert: [
  9205. "GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}",
  9206. {},
  9207. { renamedParameters: { alert_id: "alert_number" } }
  9208. ],
  9209. getAnalysis: [
  9210. "GET /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}"
  9211. ],
  9212. getCodeqlDatabase: [
  9213. "GET /repos/{owner}/{repo}/code-scanning/codeql/databases/{language}"
  9214. ],
  9215. getDefaultSetup: ["GET /repos/{owner}/{repo}/code-scanning/default-setup"],
  9216. getSarif: ["GET /repos/{owner}/{repo}/code-scanning/sarifs/{sarif_id}"],
  9217. listAlertInstances: [
  9218. "GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances"
  9219. ],
  9220. listAlertsForOrg: ["GET /orgs/{org}/code-scanning/alerts"],
  9221. listAlertsForRepo: ["GET /repos/{owner}/{repo}/code-scanning/alerts"],
  9222. listAlertsInstances: [
  9223. "GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances",
  9224. {},
  9225. { renamed: ["codeScanning", "listAlertInstances"] }
  9226. ],
  9227. listCodeqlDatabases: [
  9228. "GET /repos/{owner}/{repo}/code-scanning/codeql/databases"
  9229. ],
  9230. listRecentAnalyses: ["GET /repos/{owner}/{repo}/code-scanning/analyses"],
  9231. updateAlert: [
  9232. "PATCH /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}"
  9233. ],
  9234. updateDefaultSetup: [
  9235. "PATCH /repos/{owner}/{repo}/code-scanning/default-setup"
  9236. ],
  9237. uploadSarif: ["POST /repos/{owner}/{repo}/code-scanning/sarifs"]
  9238. },
  9239. codesOfConduct: {
  9240. getAllCodesOfConduct: ["GET /codes_of_conduct"],
  9241. getConductCode: ["GET /codes_of_conduct/{key}"]
  9242. },
  9243. codespaces: {
  9244. addRepositoryForSecretForAuthenticatedUser: [
  9245. "PUT /user/codespaces/secrets/{secret_name}/repositories/{repository_id}"
  9246. ],
  9247. addSelectedRepoToOrgSecret: [
  9248. "PUT /orgs/{org}/codespaces/secrets/{secret_name}/repositories/{repository_id}"
  9249. ],
  9250. checkPermissionsForDevcontainer: [
  9251. "GET /repos/{owner}/{repo}/codespaces/permissions_check"
  9252. ],
  9253. codespaceMachinesForAuthenticatedUser: [
  9254. "GET /user/codespaces/{codespace_name}/machines"
  9255. ],
  9256. createForAuthenticatedUser: ["POST /user/codespaces"],
  9257. createOrUpdateOrgSecret: [
  9258. "PUT /orgs/{org}/codespaces/secrets/{secret_name}"
  9259. ],
  9260. createOrUpdateRepoSecret: [
  9261. "PUT /repos/{owner}/{repo}/codespaces/secrets/{secret_name}"
  9262. ],
  9263. createOrUpdateSecretForAuthenticatedUser: [
  9264. "PUT /user/codespaces/secrets/{secret_name}"
  9265. ],
  9266. createWithPrForAuthenticatedUser: [
  9267. "POST /repos/{owner}/{repo}/pulls/{pull_number}/codespaces"
  9268. ],
  9269. createWithRepoForAuthenticatedUser: [
  9270. "POST /repos/{owner}/{repo}/codespaces"
  9271. ],
  9272. deleteForAuthenticatedUser: ["DELETE /user/codespaces/{codespace_name}"],
  9273. deleteFromOrganization: [
  9274. "DELETE /orgs/{org}/members/{username}/codespaces/{codespace_name}"
  9275. ],
  9276. deleteOrgSecret: ["DELETE /orgs/{org}/codespaces/secrets/{secret_name}"],
  9277. deleteRepoSecret: [
  9278. "DELETE /repos/{owner}/{repo}/codespaces/secrets/{secret_name}"
  9279. ],
  9280. deleteSecretForAuthenticatedUser: [
  9281. "DELETE /user/codespaces/secrets/{secret_name}"
  9282. ],
  9283. exportForAuthenticatedUser: [
  9284. "POST /user/codespaces/{codespace_name}/exports"
  9285. ],
  9286. getCodespacesForUserInOrg: [
  9287. "GET /orgs/{org}/members/{username}/codespaces"
  9288. ],
  9289. getExportDetailsForAuthenticatedUser: [
  9290. "GET /user/codespaces/{codespace_name}/exports/{export_id}"
  9291. ],
  9292. getForAuthenticatedUser: ["GET /user/codespaces/{codespace_name}"],
  9293. getOrgPublicKey: ["GET /orgs/{org}/codespaces/secrets/public-key"],
  9294. getOrgSecret: ["GET /orgs/{org}/codespaces/secrets/{secret_name}"],
  9295. getPublicKeyForAuthenticatedUser: [
  9296. "GET /user/codespaces/secrets/public-key"
  9297. ],
  9298. getRepoPublicKey: [
  9299. "GET /repos/{owner}/{repo}/codespaces/secrets/public-key"
  9300. ],
  9301. getRepoSecret: [
  9302. "GET /repos/{owner}/{repo}/codespaces/secrets/{secret_name}"
  9303. ],
  9304. getSecretForAuthenticatedUser: [
  9305. "GET /user/codespaces/secrets/{secret_name}"
  9306. ],
  9307. listDevcontainersInRepositoryForAuthenticatedUser: [
  9308. "GET /repos/{owner}/{repo}/codespaces/devcontainers"
  9309. ],
  9310. listForAuthenticatedUser: ["GET /user/codespaces"],
  9311. listInOrganization: [
  9312. "GET /orgs/{org}/codespaces",
  9313. {},
  9314. { renamedParameters: { org_id: "org" } }
  9315. ],
  9316. listInRepositoryForAuthenticatedUser: [
  9317. "GET /repos/{owner}/{repo}/codespaces"
  9318. ],
  9319. listOrgSecrets: ["GET /orgs/{org}/codespaces/secrets"],
  9320. listRepoSecrets: ["GET /repos/{owner}/{repo}/codespaces/secrets"],
  9321. listRepositoriesForSecretForAuthenticatedUser: [
  9322. "GET /user/codespaces/secrets/{secret_name}/repositories"
  9323. ],
  9324. listSecretsForAuthenticatedUser: ["GET /user/codespaces/secrets"],
  9325. listSelectedReposForOrgSecret: [
  9326. "GET /orgs/{org}/codespaces/secrets/{secret_name}/repositories"
  9327. ],
  9328. preFlightWithRepoForAuthenticatedUser: [
  9329. "GET /repos/{owner}/{repo}/codespaces/new"
  9330. ],
  9331. publishForAuthenticatedUser: [
  9332. "POST /user/codespaces/{codespace_name}/publish"
  9333. ],
  9334. removeRepositoryForSecretForAuthenticatedUser: [
  9335. "DELETE /user/codespaces/secrets/{secret_name}/repositories/{repository_id}"
  9336. ],
  9337. removeSelectedRepoFromOrgSecret: [
  9338. "DELETE /orgs/{org}/codespaces/secrets/{secret_name}/repositories/{repository_id}"
  9339. ],
  9340. repoMachinesForAuthenticatedUser: [
  9341. "GET /repos/{owner}/{repo}/codespaces/machines"
  9342. ],
  9343. setRepositoriesForSecretForAuthenticatedUser: [
  9344. "PUT /user/codespaces/secrets/{secret_name}/repositories"
  9345. ],
  9346. setSelectedReposForOrgSecret: [
  9347. "PUT /orgs/{org}/codespaces/secrets/{secret_name}/repositories"
  9348. ],
  9349. startForAuthenticatedUser: ["POST /user/codespaces/{codespace_name}/start"],
  9350. stopForAuthenticatedUser: ["POST /user/codespaces/{codespace_name}/stop"],
  9351. stopInOrganization: [
  9352. "POST /orgs/{org}/members/{username}/codespaces/{codespace_name}/stop"
  9353. ],
  9354. updateForAuthenticatedUser: ["PATCH /user/codespaces/{codespace_name}"]
  9355. },
  9356. copilot: {
  9357. addCopilotSeatsForTeams: [
  9358. "POST /orgs/{org}/copilot/billing/selected_teams"
  9359. ],
  9360. addCopilotSeatsForUsers: [
  9361. "POST /orgs/{org}/copilot/billing/selected_users"
  9362. ],
  9363. cancelCopilotSeatAssignmentForTeams: [
  9364. "DELETE /orgs/{org}/copilot/billing/selected_teams"
  9365. ],
  9366. cancelCopilotSeatAssignmentForUsers: [
  9367. "DELETE /orgs/{org}/copilot/billing/selected_users"
  9368. ],
  9369. getCopilotOrganizationDetails: ["GET /orgs/{org}/copilot/billing"],
  9370. getCopilotSeatDetailsForUser: [
  9371. "GET /orgs/{org}/members/{username}/copilot"
  9372. ],
  9373. listCopilotSeats: ["GET /orgs/{org}/copilot/billing/seats"]
  9374. },
  9375. dependabot: {
  9376. addSelectedRepoToOrgSecret: [
  9377. "PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id}"
  9378. ],
  9379. createOrUpdateOrgSecret: [
  9380. "PUT /orgs/{org}/dependabot/secrets/{secret_name}"
  9381. ],
  9382. createOrUpdateRepoSecret: [
  9383. "PUT /repos/{owner}/{repo}/dependabot/secrets/{secret_name}"
  9384. ],
  9385. deleteOrgSecret: ["DELETE /orgs/{org}/dependabot/secrets/{secret_name}"],
  9386. deleteRepoSecret: [
  9387. "DELETE /repos/{owner}/{repo}/dependabot/secrets/{secret_name}"
  9388. ],
  9389. getAlert: ["GET /repos/{owner}/{repo}/dependabot/alerts/{alert_number}"],
  9390. getOrgPublicKey: ["GET /orgs/{org}/dependabot/secrets/public-key"],
  9391. getOrgSecret: ["GET /orgs/{org}/dependabot/secrets/{secret_name}"],
  9392. getRepoPublicKey: [
  9393. "GET /repos/{owner}/{repo}/dependabot/secrets/public-key"
  9394. ],
  9395. getRepoSecret: [
  9396. "GET /repos/{owner}/{repo}/dependabot/secrets/{secret_name}"
  9397. ],
  9398. listAlertsForEnterprise: [
  9399. "GET /enterprises/{enterprise}/dependabot/alerts"
  9400. ],
  9401. listAlertsForOrg: ["GET /orgs/{org}/dependabot/alerts"],
  9402. listAlertsForRepo: ["GET /repos/{owner}/{repo}/dependabot/alerts"],
  9403. listOrgSecrets: ["GET /orgs/{org}/dependabot/secrets"],
  9404. listRepoSecrets: ["GET /repos/{owner}/{repo}/dependabot/secrets"],
  9405. listSelectedReposForOrgSecret: [
  9406. "GET /orgs/{org}/dependabot/secrets/{secret_name}/repositories"
  9407. ],
  9408. removeSelectedRepoFromOrgSecret: [
  9409. "DELETE /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id}"
  9410. ],
  9411. setSelectedReposForOrgSecret: [
  9412. "PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories"
  9413. ],
  9414. updateAlert: [
  9415. "PATCH /repos/{owner}/{repo}/dependabot/alerts/{alert_number}"
  9416. ]
  9417. },
  9418. dependencyGraph: {
  9419. createRepositorySnapshot: [
  9420. "POST /repos/{owner}/{repo}/dependency-graph/snapshots"
  9421. ],
  9422. diffRange: [
  9423. "GET /repos/{owner}/{repo}/dependency-graph/compare/{basehead}"
  9424. ],
  9425. exportSbom: ["GET /repos/{owner}/{repo}/dependency-graph/sbom"]
  9426. },
  9427. emojis: { get: ["GET /emojis"] },
  9428. gists: {
  9429. checkIsStarred: ["GET /gists/{gist_id}/star"],
  9430. create: ["POST /gists"],
  9431. createComment: ["POST /gists/{gist_id}/comments"],
  9432. delete: ["DELETE /gists/{gist_id}"],
  9433. deleteComment: ["DELETE /gists/{gist_id}/comments/{comment_id}"],
  9434. fork: ["POST /gists/{gist_id}/forks"],
  9435. get: ["GET /gists/{gist_id}"],
  9436. getComment: ["GET /gists/{gist_id}/comments/{comment_id}"],
  9437. getRevision: ["GET /gists/{gist_id}/{sha}"],
  9438. list: ["GET /gists"],
  9439. listComments: ["GET /gists/{gist_id}/comments"],
  9440. listCommits: ["GET /gists/{gist_id}/commits"],
  9441. listForUser: ["GET /users/{username}/gists"],
  9442. listForks: ["GET /gists/{gist_id}/forks"],
  9443. listPublic: ["GET /gists/public"],
  9444. listStarred: ["GET /gists/starred"],
  9445. star: ["PUT /gists/{gist_id}/star"],
  9446. unstar: ["DELETE /gists/{gist_id}/star"],
  9447. update: ["PATCH /gists/{gist_id}"],
  9448. updateComment: ["PATCH /gists/{gist_id}/comments/{comment_id}"]
  9449. },
  9450. git: {
  9451. createBlob: ["POST /repos/{owner}/{repo}/git/blobs"],
  9452. createCommit: ["POST /repos/{owner}/{repo}/git/commits"],
  9453. createRef: ["POST /repos/{owner}/{repo}/git/refs"],
  9454. createTag: ["POST /repos/{owner}/{repo}/git/tags"],
  9455. createTree: ["POST /repos/{owner}/{repo}/git/trees"],
  9456. deleteRef: ["DELETE /repos/{owner}/{repo}/git/refs/{ref}"],
  9457. getBlob: ["GET /repos/{owner}/{repo}/git/blobs/{file_sha}"],
  9458. getCommit: ["GET /repos/{owner}/{repo}/git/commits/{commit_sha}"],
  9459. getRef: ["GET /repos/{owner}/{repo}/git/ref/{ref}"],
  9460. getTag: ["GET /repos/{owner}/{repo}/git/tags/{tag_sha}"],
  9461. getTree: ["GET /repos/{owner}/{repo}/git/trees/{tree_sha}"],
  9462. listMatchingRefs: ["GET /repos/{owner}/{repo}/git/matching-refs/{ref}"],
  9463. updateRef: ["PATCH /repos/{owner}/{repo}/git/refs/{ref}"]
  9464. },
  9465. gitignore: {
  9466. getAllTemplates: ["GET /gitignore/templates"],
  9467. getTemplate: ["GET /gitignore/templates/{name}"]
  9468. },
  9469. interactions: {
  9470. getRestrictionsForAuthenticatedUser: ["GET /user/interaction-limits"],
  9471. getRestrictionsForOrg: ["GET /orgs/{org}/interaction-limits"],
  9472. getRestrictionsForRepo: ["GET /repos/{owner}/{repo}/interaction-limits"],
  9473. getRestrictionsForYourPublicRepos: [
  9474. "GET /user/interaction-limits",
  9475. {},
  9476. { renamed: ["interactions", "getRestrictionsForAuthenticatedUser"] }
  9477. ],
  9478. removeRestrictionsForAuthenticatedUser: ["DELETE /user/interaction-limits"],
  9479. removeRestrictionsForOrg: ["DELETE /orgs/{org}/interaction-limits"],
  9480. removeRestrictionsForRepo: [
  9481. "DELETE /repos/{owner}/{repo}/interaction-limits"
  9482. ],
  9483. removeRestrictionsForYourPublicRepos: [
  9484. "DELETE /user/interaction-limits",
  9485. {},
  9486. { renamed: ["interactions", "removeRestrictionsForAuthenticatedUser"] }
  9487. ],
  9488. setRestrictionsForAuthenticatedUser: ["PUT /user/interaction-limits"],
  9489. setRestrictionsForOrg: ["PUT /orgs/{org}/interaction-limits"],
  9490. setRestrictionsForRepo: ["PUT /repos/{owner}/{repo}/interaction-limits"],
  9491. setRestrictionsForYourPublicRepos: [
  9492. "PUT /user/interaction-limits",
  9493. {},
  9494. { renamed: ["interactions", "setRestrictionsForAuthenticatedUser"] }
  9495. ]
  9496. },
  9497. issues: {
  9498. addAssignees: [
  9499. "POST /repos/{owner}/{repo}/issues/{issue_number}/assignees"
  9500. ],
  9501. addLabels: ["POST /repos/{owner}/{repo}/issues/{issue_number}/labels"],
  9502. checkUserCanBeAssigned: ["GET /repos/{owner}/{repo}/assignees/{assignee}"],
  9503. checkUserCanBeAssignedToIssue: [
  9504. "GET /repos/{owner}/{repo}/issues/{issue_number}/assignees/{assignee}"
  9505. ],
  9506. create: ["POST /repos/{owner}/{repo}/issues"],
  9507. createComment: [
  9508. "POST /repos/{owner}/{repo}/issues/{issue_number}/comments"
  9509. ],
  9510. createLabel: ["POST /repos/{owner}/{repo}/labels"],
  9511. createMilestone: ["POST /repos/{owner}/{repo}/milestones"],
  9512. deleteComment: [
  9513. "DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}"
  9514. ],
  9515. deleteLabel: ["DELETE /repos/{owner}/{repo}/labels/{name}"],
  9516. deleteMilestone: [
  9517. "DELETE /repos/{owner}/{repo}/milestones/{milestone_number}"
  9518. ],
  9519. get: ["GET /repos/{owner}/{repo}/issues/{issue_number}"],
  9520. getComment: ["GET /repos/{owner}/{repo}/issues/comments/{comment_id}"],
  9521. getEvent: ["GET /repos/{owner}/{repo}/issues/events/{event_id}"],
  9522. getLabel: ["GET /repos/{owner}/{repo}/labels/{name}"],
  9523. getMilestone: ["GET /repos/{owner}/{repo}/milestones/{milestone_number}"],
  9524. list: ["GET /issues"],
  9525. listAssignees: ["GET /repos/{owner}/{repo}/assignees"],
  9526. listComments: ["GET /repos/{owner}/{repo}/issues/{issue_number}/comments"],
  9527. listCommentsForRepo: ["GET /repos/{owner}/{repo}/issues/comments"],
  9528. listEvents: ["GET /repos/{owner}/{repo}/issues/{issue_number}/events"],
  9529. listEventsForRepo: ["GET /repos/{owner}/{repo}/issues/events"],
  9530. listEventsForTimeline: [
  9531. "GET /repos/{owner}/{repo}/issues/{issue_number}/timeline"
  9532. ],
  9533. listForAuthenticatedUser: ["GET /user/issues"],
  9534. listForOrg: ["GET /orgs/{org}/issues"],
  9535. listForRepo: ["GET /repos/{owner}/{repo}/issues"],
  9536. listLabelsForMilestone: [
  9537. "GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels"
  9538. ],
  9539. listLabelsForRepo: ["GET /repos/{owner}/{repo}/labels"],
  9540. listLabelsOnIssue: [
  9541. "GET /repos/{owner}/{repo}/issues/{issue_number}/labels"
  9542. ],
  9543. listMilestones: ["GET /repos/{owner}/{repo}/milestones"],
  9544. lock: ["PUT /repos/{owner}/{repo}/issues/{issue_number}/lock"],
  9545. removeAllLabels: [
  9546. "DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels"
  9547. ],
  9548. removeAssignees: [
  9549. "DELETE /repos/{owner}/{repo}/issues/{issue_number}/assignees"
  9550. ],
  9551. removeLabel: [
  9552. "DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels/{name}"
  9553. ],
  9554. setLabels: ["PUT /repos/{owner}/{repo}/issues/{issue_number}/labels"],
  9555. unlock: ["DELETE /repos/{owner}/{repo}/issues/{issue_number}/lock"],
  9556. update: ["PATCH /repos/{owner}/{repo}/issues/{issue_number}"],
  9557. updateComment: ["PATCH /repos/{owner}/{repo}/issues/comments/{comment_id}"],
  9558. updateLabel: ["PATCH /repos/{owner}/{repo}/labels/{name}"],
  9559. updateMilestone: [
  9560. "PATCH /repos/{owner}/{repo}/milestones/{milestone_number}"
  9561. ]
  9562. },
  9563. licenses: {
  9564. get: ["GET /licenses/{license}"],
  9565. getAllCommonlyUsed: ["GET /licenses"],
  9566. getForRepo: ["GET /repos/{owner}/{repo}/license"]
  9567. },
  9568. markdown: {
  9569. render: ["POST /markdown"],
  9570. renderRaw: [
  9571. "POST /markdown/raw",
  9572. { headers: { "content-type": "text/plain; charset=utf-8" } }
  9573. ]
  9574. },
  9575. meta: {
  9576. get: ["GET /meta"],
  9577. getAllVersions: ["GET /versions"],
  9578. getOctocat: ["GET /octocat"],
  9579. getZen: ["GET /zen"],
  9580. root: ["GET /"]
  9581. },
  9582. migrations: {
  9583. cancelImport: [
  9584. "DELETE /repos/{owner}/{repo}/import",
  9585. {},
  9586. {
  9587. deprecated: "octokit.rest.migrations.cancelImport() is deprecated, see https://docs.github.com/rest/migrations/source-imports#cancel-an-import"
  9588. }
  9589. ],
  9590. deleteArchiveForAuthenticatedUser: [
  9591. "DELETE /user/migrations/{migration_id}/archive"
  9592. ],
  9593. deleteArchiveForOrg: [
  9594. "DELETE /orgs/{org}/migrations/{migration_id}/archive"
  9595. ],
  9596. downloadArchiveForOrg: [
  9597. "GET /orgs/{org}/migrations/{migration_id}/archive"
  9598. ],
  9599. getArchiveForAuthenticatedUser: [
  9600. "GET /user/migrations/{migration_id}/archive"
  9601. ],
  9602. getCommitAuthors: [
  9603. "GET /repos/{owner}/{repo}/import/authors",
  9604. {},
  9605. {
  9606. deprecated: "octokit.rest.migrations.getCommitAuthors() is deprecated, see https://docs.github.com/rest/migrations/source-imports#get-commit-authors"
  9607. }
  9608. ],
  9609. getImportStatus: [
  9610. "GET /repos/{owner}/{repo}/import",
  9611. {},
  9612. {
  9613. deprecated: "octokit.rest.migrations.getImportStatus() is deprecated, see https://docs.github.com/rest/migrations/source-imports#get-an-import-status"
  9614. }
  9615. ],
  9616. getLargeFiles: [
  9617. "GET /repos/{owner}/{repo}/import/large_files",
  9618. {},
  9619. {
  9620. deprecated: "octokit.rest.migrations.getLargeFiles() is deprecated, see https://docs.github.com/rest/migrations/source-imports#get-large-files"
  9621. }
  9622. ],
  9623. getStatusForAuthenticatedUser: ["GET /user/migrations/{migration_id}"],
  9624. getStatusForOrg: ["GET /orgs/{org}/migrations/{migration_id}"],
  9625. listForAuthenticatedUser: ["GET /user/migrations"],
  9626. listForOrg: ["GET /orgs/{org}/migrations"],
  9627. listReposForAuthenticatedUser: [
  9628. "GET /user/migrations/{migration_id}/repositories"
  9629. ],
  9630. listReposForOrg: ["GET /orgs/{org}/migrations/{migration_id}/repositories"],
  9631. listReposForUser: [
  9632. "GET /user/migrations/{migration_id}/repositories",
  9633. {},
  9634. { renamed: ["migrations", "listReposForAuthenticatedUser"] }
  9635. ],
  9636. mapCommitAuthor: [
  9637. "PATCH /repos/{owner}/{repo}/import/authors/{author_id}",
  9638. {},
  9639. {
  9640. deprecated: "octokit.rest.migrations.mapCommitAuthor() is deprecated, see https://docs.github.com/rest/migrations/source-imports#map-a-commit-author"
  9641. }
  9642. ],
  9643. setLfsPreference: [
  9644. "PATCH /repos/{owner}/{repo}/import/lfs",
  9645. {},
  9646. {
  9647. deprecated: "octokit.rest.migrations.setLfsPreference() is deprecated, see https://docs.github.com/rest/migrations/source-imports#update-git-lfs-preference"
  9648. }
  9649. ],
  9650. startForAuthenticatedUser: ["POST /user/migrations"],
  9651. startForOrg: ["POST /orgs/{org}/migrations"],
  9652. startImport: [
  9653. "PUT /repos/{owner}/{repo}/import",
  9654. {},
  9655. {
  9656. deprecated: "octokit.rest.migrations.startImport() is deprecated, see https://docs.github.com/rest/migrations/source-imports#start-an-import"
  9657. }
  9658. ],
  9659. unlockRepoForAuthenticatedUser: [
  9660. "DELETE /user/migrations/{migration_id}/repos/{repo_name}/lock"
  9661. ],
  9662. unlockRepoForOrg: [
  9663. "DELETE /orgs/{org}/migrations/{migration_id}/repos/{repo_name}/lock"
  9664. ],
  9665. updateImport: [
  9666. "PATCH /repos/{owner}/{repo}/import",
  9667. {},
  9668. {
  9669. deprecated: "octokit.rest.migrations.updateImport() is deprecated, see https://docs.github.com/rest/migrations/source-imports#update-an-import"
  9670. }
  9671. ]
  9672. },
  9673. oidc: {
  9674. getOidcCustomSubTemplateForOrg: [
  9675. "GET /orgs/{org}/actions/oidc/customization/sub"
  9676. ],
  9677. updateOidcCustomSubTemplateForOrg: [
  9678. "PUT /orgs/{org}/actions/oidc/customization/sub"
  9679. ]
  9680. },
  9681. orgs: {
  9682. addSecurityManagerTeam: [
  9683. "PUT /orgs/{org}/security-managers/teams/{team_slug}"
  9684. ],
  9685. assignTeamToOrgRole: [
  9686. "PUT /orgs/{org}/organization-roles/teams/{team_slug}/{role_id}"
  9687. ],
  9688. assignUserToOrgRole: [
  9689. "PUT /orgs/{org}/organization-roles/users/{username}/{role_id}"
  9690. ],
  9691. blockUser: ["PUT /orgs/{org}/blocks/{username}"],
  9692. cancelInvitation: ["DELETE /orgs/{org}/invitations/{invitation_id}"],
  9693. checkBlockedUser: ["GET /orgs/{org}/blocks/{username}"],
  9694. checkMembershipForUser: ["GET /orgs/{org}/members/{username}"],
  9695. checkPublicMembershipForUser: ["GET /orgs/{org}/public_members/{username}"],
  9696. convertMemberToOutsideCollaborator: [
  9697. "PUT /orgs/{org}/outside_collaborators/{username}"
  9698. ],
  9699. createCustomOrganizationRole: ["POST /orgs/{org}/organization-roles"],
  9700. createInvitation: ["POST /orgs/{org}/invitations"],
  9701. createOrUpdateCustomProperties: ["PATCH /orgs/{org}/properties/schema"],
  9702. createOrUpdateCustomPropertiesValuesForRepos: [
  9703. "PATCH /orgs/{org}/properties/values"
  9704. ],
  9705. createOrUpdateCustomProperty: [
  9706. "PUT /orgs/{org}/properties/schema/{custom_property_name}"
  9707. ],
  9708. createWebhook: ["POST /orgs/{org}/hooks"],
  9709. delete: ["DELETE /orgs/{org}"],
  9710. deleteCustomOrganizationRole: [
  9711. "DELETE /orgs/{org}/organization-roles/{role_id}"
  9712. ],
  9713. deleteWebhook: ["DELETE /orgs/{org}/hooks/{hook_id}"],
  9714. enableOrDisableSecurityProductOnAllOrgRepos: [
  9715. "POST /orgs/{org}/{security_product}/{enablement}"
  9716. ],
  9717. get: ["GET /orgs/{org}"],
  9718. getAllCustomProperties: ["GET /orgs/{org}/properties/schema"],
  9719. getCustomProperty: [
  9720. "GET /orgs/{org}/properties/schema/{custom_property_name}"
  9721. ],
  9722. getMembershipForAuthenticatedUser: ["GET /user/memberships/orgs/{org}"],
  9723. getMembershipForUser: ["GET /orgs/{org}/memberships/{username}"],
  9724. getOrgRole: ["GET /orgs/{org}/organization-roles/{role_id}"],
  9725. getWebhook: ["GET /orgs/{org}/hooks/{hook_id}"],
  9726. getWebhookConfigForOrg: ["GET /orgs/{org}/hooks/{hook_id}/config"],
  9727. getWebhookDelivery: [
  9728. "GET /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}"
  9729. ],
  9730. list: ["GET /organizations"],
  9731. listAppInstallations: ["GET /orgs/{org}/installations"],
  9732. listBlockedUsers: ["GET /orgs/{org}/blocks"],
  9733. listCustomPropertiesValuesForRepos: ["GET /orgs/{org}/properties/values"],
  9734. listFailedInvitations: ["GET /orgs/{org}/failed_invitations"],
  9735. listForAuthenticatedUser: ["GET /user/orgs"],
  9736. listForUser: ["GET /users/{username}/orgs"],
  9737. listInvitationTeams: ["GET /orgs/{org}/invitations/{invitation_id}/teams"],
  9738. listMembers: ["GET /orgs/{org}/members"],
  9739. listMembershipsForAuthenticatedUser: ["GET /user/memberships/orgs"],
  9740. listOrgRoleTeams: ["GET /orgs/{org}/organization-roles/{role_id}/teams"],
  9741. listOrgRoleUsers: ["GET /orgs/{org}/organization-roles/{role_id}/users"],
  9742. listOrgRoles: ["GET /orgs/{org}/organization-roles"],
  9743. listOrganizationFineGrainedPermissions: [
  9744. "GET /orgs/{org}/organization-fine-grained-permissions"
  9745. ],
  9746. listOutsideCollaborators: ["GET /orgs/{org}/outside_collaborators"],
  9747. listPatGrantRepositories: [
  9748. "GET /orgs/{org}/personal-access-tokens/{pat_id}/repositories"
  9749. ],
  9750. listPatGrantRequestRepositories: [
  9751. "GET /orgs/{org}/personal-access-token-requests/{pat_request_id}/repositories"
  9752. ],
  9753. listPatGrantRequests: ["GET /orgs/{org}/personal-access-token-requests"],
  9754. listPatGrants: ["GET /orgs/{org}/personal-access-tokens"],
  9755. listPendingInvitations: ["GET /orgs/{org}/invitations"],
  9756. listPublicMembers: ["GET /orgs/{org}/public_members"],
  9757. listSecurityManagerTeams: ["GET /orgs/{org}/security-managers"],
  9758. listWebhookDeliveries: ["GET /orgs/{org}/hooks/{hook_id}/deliveries"],
  9759. listWebhooks: ["GET /orgs/{org}/hooks"],
  9760. patchCustomOrganizationRole: [
  9761. "PATCH /orgs/{org}/organization-roles/{role_id}"
  9762. ],
  9763. pingWebhook: ["POST /orgs/{org}/hooks/{hook_id}/pings"],
  9764. redeliverWebhookDelivery: [
  9765. "POST /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts"
  9766. ],
  9767. removeCustomProperty: [
  9768. "DELETE /orgs/{org}/properties/schema/{custom_property_name}"
  9769. ],
  9770. removeMember: ["DELETE /orgs/{org}/members/{username}"],
  9771. removeMembershipForUser: ["DELETE /orgs/{org}/memberships/{username}"],
  9772. removeOutsideCollaborator: [
  9773. "DELETE /orgs/{org}/outside_collaborators/{username}"
  9774. ],
  9775. removePublicMembershipForAuthenticatedUser: [
  9776. "DELETE /orgs/{org}/public_members/{username}"
  9777. ],
  9778. removeSecurityManagerTeam: [
  9779. "DELETE /orgs/{org}/security-managers/teams/{team_slug}"
  9780. ],
  9781. reviewPatGrantRequest: [
  9782. "POST /orgs/{org}/personal-access-token-requests/{pat_request_id}"
  9783. ],
  9784. reviewPatGrantRequestsInBulk: [
  9785. "POST /orgs/{org}/personal-access-token-requests"
  9786. ],
  9787. revokeAllOrgRolesTeam: [
  9788. "DELETE /orgs/{org}/organization-roles/teams/{team_slug}"
  9789. ],
  9790. revokeAllOrgRolesUser: [
  9791. "DELETE /orgs/{org}/organization-roles/users/{username}"
  9792. ],
  9793. revokeOrgRoleTeam: [
  9794. "DELETE /orgs/{org}/organization-roles/teams/{team_slug}/{role_id}"
  9795. ],
  9796. revokeOrgRoleUser: [
  9797. "DELETE /orgs/{org}/organization-roles/users/{username}/{role_id}"
  9798. ],
  9799. setMembershipForUser: ["PUT /orgs/{org}/memberships/{username}"],
  9800. setPublicMembershipForAuthenticatedUser: [
  9801. "PUT /orgs/{org}/public_members/{username}"
  9802. ],
  9803. unblockUser: ["DELETE /orgs/{org}/blocks/{username}"],
  9804. update: ["PATCH /orgs/{org}"],
  9805. updateMembershipForAuthenticatedUser: [
  9806. "PATCH /user/memberships/orgs/{org}"
  9807. ],
  9808. updatePatAccess: ["POST /orgs/{org}/personal-access-tokens/{pat_id}"],
  9809. updatePatAccesses: ["POST /orgs/{org}/personal-access-tokens"],
  9810. updateWebhook: ["PATCH /orgs/{org}/hooks/{hook_id}"],
  9811. updateWebhookConfigForOrg: ["PATCH /orgs/{org}/hooks/{hook_id}/config"]
  9812. },
  9813. packages: {
  9814. deletePackageForAuthenticatedUser: [
  9815. "DELETE /user/packages/{package_type}/{package_name}"
  9816. ],
  9817. deletePackageForOrg: [
  9818. "DELETE /orgs/{org}/packages/{package_type}/{package_name}"
  9819. ],
  9820. deletePackageForUser: [
  9821. "DELETE /users/{username}/packages/{package_type}/{package_name}"
  9822. ],
  9823. deletePackageVersionForAuthenticatedUser: [
  9824. "DELETE /user/packages/{package_type}/{package_name}/versions/{package_version_id}"
  9825. ],
  9826. deletePackageVersionForOrg: [
  9827. "DELETE /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}"
  9828. ],
  9829. deletePackageVersionForUser: [
  9830. "DELETE /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}"
  9831. ],
  9832. getAllPackageVersionsForAPackageOwnedByAnOrg: [
  9833. "GET /orgs/{org}/packages/{package_type}/{package_name}/versions",
  9834. {},
  9835. { renamed: ["packages", "getAllPackageVersionsForPackageOwnedByOrg"] }
  9836. ],
  9837. getAllPackageVersionsForAPackageOwnedByTheAuthenticatedUser: [
  9838. "GET /user/packages/{package_type}/{package_name}/versions",
  9839. {},
  9840. {
  9841. renamed: [
  9842. "packages",
  9843. "getAllPackageVersionsForPackageOwnedByAuthenticatedUser"
  9844. ]
  9845. }
  9846. ],
  9847. getAllPackageVersionsForPackageOwnedByAuthenticatedUser: [
  9848. "GET /user/packages/{package_type}/{package_name}/versions"
  9849. ],
  9850. getAllPackageVersionsForPackageOwnedByOrg: [
  9851. "GET /orgs/{org}/packages/{package_type}/{package_name}/versions"
  9852. ],
  9853. getAllPackageVersionsForPackageOwnedByUser: [
  9854. "GET /users/{username}/packages/{package_type}/{package_name}/versions"
  9855. ],
  9856. getPackageForAuthenticatedUser: [
  9857. "GET /user/packages/{package_type}/{package_name}"
  9858. ],
  9859. getPackageForOrganization: [
  9860. "GET /orgs/{org}/packages/{package_type}/{package_name}"
  9861. ],
  9862. getPackageForUser: [
  9863. "GET /users/{username}/packages/{package_type}/{package_name}"
  9864. ],
  9865. getPackageVersionForAuthenticatedUser: [
  9866. "GET /user/packages/{package_type}/{package_name}/versions/{package_version_id}"
  9867. ],
  9868. getPackageVersionForOrganization: [
  9869. "GET /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}"
  9870. ],
  9871. getPackageVersionForUser: [
  9872. "GET /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}"
  9873. ],
  9874. listDockerMigrationConflictingPackagesForAuthenticatedUser: [
  9875. "GET /user/docker/conflicts"
  9876. ],
  9877. listDockerMigrationConflictingPackagesForOrganization: [
  9878. "GET /orgs/{org}/docker/conflicts"
  9879. ],
  9880. listDockerMigrationConflictingPackagesForUser: [
  9881. "GET /users/{username}/docker/conflicts"
  9882. ],
  9883. listPackagesForAuthenticatedUser: ["GET /user/packages"],
  9884. listPackagesForOrganization: ["GET /orgs/{org}/packages"],
  9885. listPackagesForUser: ["GET /users/{username}/packages"],
  9886. restorePackageForAuthenticatedUser: [
  9887. "POST /user/packages/{package_type}/{package_name}/restore{?token}"
  9888. ],
  9889. restorePackageForOrg: [
  9890. "POST /orgs/{org}/packages/{package_type}/{package_name}/restore{?token}"
  9891. ],
  9892. restorePackageForUser: [
  9893. "POST /users/{username}/packages/{package_type}/{package_name}/restore{?token}"
  9894. ],
  9895. restorePackageVersionForAuthenticatedUser: [
  9896. "POST /user/packages/{package_type}/{package_name}/versions/{package_version_id}/restore"
  9897. ],
  9898. restorePackageVersionForOrg: [
  9899. "POST /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore"
  9900. ],
  9901. restorePackageVersionForUser: [
  9902. "POST /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore"
  9903. ]
  9904. },
  9905. projects: {
  9906. addCollaborator: ["PUT /projects/{project_id}/collaborators/{username}"],
  9907. createCard: ["POST /projects/columns/{column_id}/cards"],
  9908. createColumn: ["POST /projects/{project_id}/columns"],
  9909. createForAuthenticatedUser: ["POST /user/projects"],
  9910. createForOrg: ["POST /orgs/{org}/projects"],
  9911. createForRepo: ["POST /repos/{owner}/{repo}/projects"],
  9912. delete: ["DELETE /projects/{project_id}"],
  9913. deleteCard: ["DELETE /projects/columns/cards/{card_id}"],
  9914. deleteColumn: ["DELETE /projects/columns/{column_id}"],
  9915. get: ["GET /projects/{project_id}"],
  9916. getCard: ["GET /projects/columns/cards/{card_id}"],
  9917. getColumn: ["GET /projects/columns/{column_id}"],
  9918. getPermissionForUser: [
  9919. "GET /projects/{project_id}/collaborators/{username}/permission"
  9920. ],
  9921. listCards: ["GET /projects/columns/{column_id}/cards"],
  9922. listCollaborators: ["GET /projects/{project_id}/collaborators"],
  9923. listColumns: ["GET /projects/{project_id}/columns"],
  9924. listForOrg: ["GET /orgs/{org}/projects"],
  9925. listForRepo: ["GET /repos/{owner}/{repo}/projects"],
  9926. listForUser: ["GET /users/{username}/projects"],
  9927. moveCard: ["POST /projects/columns/cards/{card_id}/moves"],
  9928. moveColumn: ["POST /projects/columns/{column_id}/moves"],
  9929. removeCollaborator: [
  9930. "DELETE /projects/{project_id}/collaborators/{username}"
  9931. ],
  9932. update: ["PATCH /projects/{project_id}"],
  9933. updateCard: ["PATCH /projects/columns/cards/{card_id}"],
  9934. updateColumn: ["PATCH /projects/columns/{column_id}"]
  9935. },
  9936. pulls: {
  9937. checkIfMerged: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/merge"],
  9938. create: ["POST /repos/{owner}/{repo}/pulls"],
  9939. createReplyForReviewComment: [
  9940. "POST /repos/{owner}/{repo}/pulls/{pull_number}/comments/{comment_id}/replies"
  9941. ],
  9942. createReview: ["POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews"],
  9943. createReviewComment: [
  9944. "POST /repos/{owner}/{repo}/pulls/{pull_number}/comments"
  9945. ],
  9946. deletePendingReview: [
  9947. "DELETE /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}"
  9948. ],
  9949. deleteReviewComment: [
  9950. "DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}"
  9951. ],
  9952. dismissReview: [
  9953. "PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/dismissals"
  9954. ],
  9955. get: ["GET /repos/{owner}/{repo}/pulls/{pull_number}"],
  9956. getReview: [
  9957. "GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}"
  9958. ],
  9959. getReviewComment: ["GET /repos/{owner}/{repo}/pulls/comments/{comment_id}"],
  9960. list: ["GET /repos/{owner}/{repo}/pulls"],
  9961. listCommentsForReview: [
  9962. "GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments"
  9963. ],
  9964. listCommits: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/commits"],
  9965. listFiles: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/files"],
  9966. listRequestedReviewers: [
  9967. "GET /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers"
  9968. ],
  9969. listReviewComments: [
  9970. "GET /repos/{owner}/{repo}/pulls/{pull_number}/comments"
  9971. ],
  9972. listReviewCommentsForRepo: ["GET /repos/{owner}/{repo}/pulls/comments"],
  9973. listReviews: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews"],
  9974. merge: ["PUT /repos/{owner}/{repo}/pulls/{pull_number}/merge"],
  9975. removeRequestedReviewers: [
  9976. "DELETE /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers"
  9977. ],
  9978. requestReviewers: [
  9979. "POST /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers"
  9980. ],
  9981. submitReview: [
  9982. "POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/events"
  9983. ],
  9984. update: ["PATCH /repos/{owner}/{repo}/pulls/{pull_number}"],
  9985. updateBranch: [
  9986. "PUT /repos/{owner}/{repo}/pulls/{pull_number}/update-branch"
  9987. ],
  9988. updateReview: [
  9989. "PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}"
  9990. ],
  9991. updateReviewComment: [
  9992. "PATCH /repos/{owner}/{repo}/pulls/comments/{comment_id}"
  9993. ]
  9994. },
  9995. rateLimit: { get: ["GET /rate_limit"] },
  9996. reactions: {
  9997. createForCommitComment: [
  9998. "POST /repos/{owner}/{repo}/comments/{comment_id}/reactions"
  9999. ],
  10000. createForIssue: [
  10001. "POST /repos/{owner}/{repo}/issues/{issue_number}/reactions"
  10002. ],
  10003. createForIssueComment: [
  10004. "POST /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions"
  10005. ],
  10006. createForPullRequestReviewComment: [
  10007. "POST /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions"
  10008. ],
  10009. createForRelease: [
  10010. "POST /repos/{owner}/{repo}/releases/{release_id}/reactions"
  10011. ],
  10012. createForTeamDiscussionCommentInOrg: [
  10013. "POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions"
  10014. ],
  10015. createForTeamDiscussionInOrg: [
  10016. "POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions"
  10017. ],
  10018. deleteForCommitComment: [
  10019. "DELETE /repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id}"
  10020. ],
  10021. deleteForIssue: [
  10022. "DELETE /repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id}"
  10023. ],
  10024. deleteForIssueComment: [
  10025. "DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/{reaction_id}"
  10026. ],
  10027. deleteForPullRequestComment: [
  10028. "DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/{reaction_id}"
  10029. ],
  10030. deleteForRelease: [
  10031. "DELETE /repos/{owner}/{repo}/releases/{release_id}/reactions/{reaction_id}"
  10032. ],
  10033. deleteForTeamDiscussion: [
  10034. "DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/{reaction_id}"
  10035. ],
  10036. deleteForTeamDiscussionComment: [
  10037. "DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/{reaction_id}"
  10038. ],
  10039. listForCommitComment: [
  10040. "GET /repos/{owner}/{repo}/comments/{comment_id}/reactions"
  10041. ],
  10042. listForIssue: ["GET /repos/{owner}/{repo}/issues/{issue_number}/reactions"],
  10043. listForIssueComment: [
  10044. "GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions"
  10045. ],
  10046. listForPullRequestReviewComment: [
  10047. "GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions"
  10048. ],
  10049. listForRelease: [
  10050. "GET /repos/{owner}/{repo}/releases/{release_id}/reactions"
  10051. ],
  10052. listForTeamDiscussionCommentInOrg: [
  10053. "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions"
  10054. ],
  10055. listForTeamDiscussionInOrg: [
  10056. "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions"
  10057. ]
  10058. },
  10059. repos: {
  10060. acceptInvitation: [
  10061. "PATCH /user/repository_invitations/{invitation_id}",
  10062. {},
  10063. { renamed: ["repos", "acceptInvitationForAuthenticatedUser"] }
  10064. ],
  10065. acceptInvitationForAuthenticatedUser: [
  10066. "PATCH /user/repository_invitations/{invitation_id}"
  10067. ],
  10068. addAppAccessRestrictions: [
  10069. "POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps",
  10070. {},
  10071. { mapToData: "apps" }
  10072. ],
  10073. addCollaborator: ["PUT /repos/{owner}/{repo}/collaborators/{username}"],
  10074. addStatusCheckContexts: [
  10075. "POST /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts",
  10076. {},
  10077. { mapToData: "contexts" }
  10078. ],
  10079. addTeamAccessRestrictions: [
  10080. "POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams",
  10081. {},
  10082. { mapToData: "teams" }
  10083. ],
  10084. addUserAccessRestrictions: [
  10085. "POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users",
  10086. {},
  10087. { mapToData: "users" }
  10088. ],
  10089. cancelPagesDeployment: [
  10090. "POST /repos/{owner}/{repo}/pages/deployments/{pages_deployment_id}/cancel"
  10091. ],
  10092. checkAutomatedSecurityFixes: [
  10093. "GET /repos/{owner}/{repo}/automated-security-fixes"
  10094. ],
  10095. checkCollaborator: ["GET /repos/{owner}/{repo}/collaborators/{username}"],
  10096. checkVulnerabilityAlerts: [
  10097. "GET /repos/{owner}/{repo}/vulnerability-alerts"
  10098. ],
  10099. codeownersErrors: ["GET /repos/{owner}/{repo}/codeowners/errors"],
  10100. compareCommits: ["GET /repos/{owner}/{repo}/compare/{base}...{head}"],
  10101. compareCommitsWithBasehead: [
  10102. "GET /repos/{owner}/{repo}/compare/{basehead}"
  10103. ],
  10104. createAutolink: ["POST /repos/{owner}/{repo}/autolinks"],
  10105. createCommitComment: [
  10106. "POST /repos/{owner}/{repo}/commits/{commit_sha}/comments"
  10107. ],
  10108. createCommitSignatureProtection: [
  10109. "POST /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures"
  10110. ],
  10111. createCommitStatus: ["POST /repos/{owner}/{repo}/statuses/{sha}"],
  10112. createDeployKey: ["POST /repos/{owner}/{repo}/keys"],
  10113. createDeployment: ["POST /repos/{owner}/{repo}/deployments"],
  10114. createDeploymentBranchPolicy: [
  10115. "POST /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies"
  10116. ],
  10117. createDeploymentProtectionRule: [
  10118. "POST /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules"
  10119. ],
  10120. createDeploymentStatus: [
  10121. "POST /repos/{owner}/{repo}/deployments/{deployment_id}/statuses"
  10122. ],
  10123. createDispatchEvent: ["POST /repos/{owner}/{repo}/dispatches"],
  10124. createForAuthenticatedUser: ["POST /user/repos"],
  10125. createFork: ["POST /repos/{owner}/{repo}/forks"],
  10126. createInOrg: ["POST /orgs/{org}/repos"],
  10127. createOrUpdateCustomPropertiesValues: [
  10128. "PATCH /repos/{owner}/{repo}/properties/values"
  10129. ],
  10130. createOrUpdateEnvironment: [
  10131. "PUT /repos/{owner}/{repo}/environments/{environment_name}"
  10132. ],
  10133. createOrUpdateFileContents: ["PUT /repos/{owner}/{repo}/contents/{path}"],
  10134. createOrgRuleset: ["POST /orgs/{org}/rulesets"],
  10135. createPagesDeployment: ["POST /repos/{owner}/{repo}/pages/deployments"],
  10136. createPagesSite: ["POST /repos/{owner}/{repo}/pages"],
  10137. createRelease: ["POST /repos/{owner}/{repo}/releases"],
  10138. createRepoRuleset: ["POST /repos/{owner}/{repo}/rulesets"],
  10139. createTagProtection: ["POST /repos/{owner}/{repo}/tags/protection"],
  10140. createUsingTemplate: [
  10141. "POST /repos/{template_owner}/{template_repo}/generate"
  10142. ],
  10143. createWebhook: ["POST /repos/{owner}/{repo}/hooks"],
  10144. declineInvitation: [
  10145. "DELETE /user/repository_invitations/{invitation_id}",
  10146. {},
  10147. { renamed: ["repos", "declineInvitationForAuthenticatedUser"] }
  10148. ],
  10149. declineInvitationForAuthenticatedUser: [
  10150. "DELETE /user/repository_invitations/{invitation_id}"
  10151. ],
  10152. delete: ["DELETE /repos/{owner}/{repo}"],
  10153. deleteAccessRestrictions: [
  10154. "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions"
  10155. ],
  10156. deleteAdminBranchProtection: [
  10157. "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins"
  10158. ],
  10159. deleteAnEnvironment: [
  10160. "DELETE /repos/{owner}/{repo}/environments/{environment_name}"
  10161. ],
  10162. deleteAutolink: ["DELETE /repos/{owner}/{repo}/autolinks/{autolink_id}"],
  10163. deleteBranchProtection: [
  10164. "DELETE /repos/{owner}/{repo}/branches/{branch}/protection"
  10165. ],
  10166. deleteCommitComment: ["DELETE /repos/{owner}/{repo}/comments/{comment_id}"],
  10167. deleteCommitSignatureProtection: [
  10168. "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures"
  10169. ],
  10170. deleteDeployKey: ["DELETE /repos/{owner}/{repo}/keys/{key_id}"],
  10171. deleteDeployment: [
  10172. "DELETE /repos/{owner}/{repo}/deployments/{deployment_id}"
  10173. ],
  10174. deleteDeploymentBranchPolicy: [
  10175. "DELETE /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}"
  10176. ],
  10177. deleteFile: ["DELETE /repos/{owner}/{repo}/contents/{path}"],
  10178. deleteInvitation: [
  10179. "DELETE /repos/{owner}/{repo}/invitations/{invitation_id}"
  10180. ],
  10181. deleteOrgRuleset: ["DELETE /orgs/{org}/rulesets/{ruleset_id}"],
  10182. deletePagesSite: ["DELETE /repos/{owner}/{repo}/pages"],
  10183. deletePullRequestReviewProtection: [
  10184. "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews"
  10185. ],
  10186. deleteRelease: ["DELETE /repos/{owner}/{repo}/releases/{release_id}"],
  10187. deleteReleaseAsset: [
  10188. "DELETE /repos/{owner}/{repo}/releases/assets/{asset_id}"
  10189. ],
  10190. deleteRepoRuleset: ["DELETE /repos/{owner}/{repo}/rulesets/{ruleset_id}"],
  10191. deleteTagProtection: [
  10192. "DELETE /repos/{owner}/{repo}/tags/protection/{tag_protection_id}"
  10193. ],
  10194. deleteWebhook: ["DELETE /repos/{owner}/{repo}/hooks/{hook_id}"],
  10195. disableAutomatedSecurityFixes: [
  10196. "DELETE /repos/{owner}/{repo}/automated-security-fixes"
  10197. ],
  10198. disableDeploymentProtectionRule: [
  10199. "DELETE /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/{protection_rule_id}"
  10200. ],
  10201. disablePrivateVulnerabilityReporting: [
  10202. "DELETE /repos/{owner}/{repo}/private-vulnerability-reporting"
  10203. ],
  10204. disableVulnerabilityAlerts: [
  10205. "DELETE /repos/{owner}/{repo}/vulnerability-alerts"
  10206. ],
  10207. downloadArchive: [
  10208. "GET /repos/{owner}/{repo}/zipball/{ref}",
  10209. {},
  10210. { renamed: ["repos", "downloadZipballArchive"] }
  10211. ],
  10212. downloadTarballArchive: ["GET /repos/{owner}/{repo}/tarball/{ref}"],
  10213. downloadZipballArchive: ["GET /repos/{owner}/{repo}/zipball/{ref}"],
  10214. enableAutomatedSecurityFixes: [
  10215. "PUT /repos/{owner}/{repo}/automated-security-fixes"
  10216. ],
  10217. enablePrivateVulnerabilityReporting: [
  10218. "PUT /repos/{owner}/{repo}/private-vulnerability-reporting"
  10219. ],
  10220. enableVulnerabilityAlerts: [
  10221. "PUT /repos/{owner}/{repo}/vulnerability-alerts"
  10222. ],
  10223. generateReleaseNotes: [
  10224. "POST /repos/{owner}/{repo}/releases/generate-notes"
  10225. ],
  10226. get: ["GET /repos/{owner}/{repo}"],
  10227. getAccessRestrictions: [
  10228. "GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions"
  10229. ],
  10230. getAdminBranchProtection: [
  10231. "GET /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins"
  10232. ],
  10233. getAllDeploymentProtectionRules: [
  10234. "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules"
  10235. ],
  10236. getAllEnvironments: ["GET /repos/{owner}/{repo}/environments"],
  10237. getAllStatusCheckContexts: [
  10238. "GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts"
  10239. ],
  10240. getAllTopics: ["GET /repos/{owner}/{repo}/topics"],
  10241. getAppsWithAccessToProtectedBranch: [
  10242. "GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps"
  10243. ],
  10244. getAutolink: ["GET /repos/{owner}/{repo}/autolinks/{autolink_id}"],
  10245. getBranch: ["GET /repos/{owner}/{repo}/branches/{branch}"],
  10246. getBranchProtection: [
  10247. "GET /repos/{owner}/{repo}/branches/{branch}/protection"
  10248. ],
  10249. getBranchRules: ["GET /repos/{owner}/{repo}/rules/branches/{branch}"],
  10250. getClones: ["GET /repos/{owner}/{repo}/traffic/clones"],
  10251. getCodeFrequencyStats: ["GET /repos/{owner}/{repo}/stats/code_frequency"],
  10252. getCollaboratorPermissionLevel: [
  10253. "GET /repos/{owner}/{repo}/collaborators/{username}/permission"
  10254. ],
  10255. getCombinedStatusForRef: ["GET /repos/{owner}/{repo}/commits/{ref}/status"],
  10256. getCommit: ["GET /repos/{owner}/{repo}/commits/{ref}"],
  10257. getCommitActivityStats: ["GET /repos/{owner}/{repo}/stats/commit_activity"],
  10258. getCommitComment: ["GET /repos/{owner}/{repo}/comments/{comment_id}"],
  10259. getCommitSignatureProtection: [
  10260. "GET /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures"
  10261. ],
  10262. getCommunityProfileMetrics: ["GET /repos/{owner}/{repo}/community/profile"],
  10263. getContent: ["GET /repos/{owner}/{repo}/contents/{path}"],
  10264. getContributorsStats: ["GET /repos/{owner}/{repo}/stats/contributors"],
  10265. getCustomDeploymentProtectionRule: [
  10266. "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/{protection_rule_id}"
  10267. ],
  10268. getCustomPropertiesValues: ["GET /repos/{owner}/{repo}/properties/values"],
  10269. getDeployKey: ["GET /repos/{owner}/{repo}/keys/{key_id}"],
  10270. getDeployment: ["GET /repos/{owner}/{repo}/deployments/{deployment_id}"],
  10271. getDeploymentBranchPolicy: [
  10272. "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}"
  10273. ],
  10274. getDeploymentStatus: [
  10275. "GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses/{status_id}"
  10276. ],
  10277. getEnvironment: [
  10278. "GET /repos/{owner}/{repo}/environments/{environment_name}"
  10279. ],
  10280. getLatestPagesBuild: ["GET /repos/{owner}/{repo}/pages/builds/latest"],
  10281. getLatestRelease: ["GET /repos/{owner}/{repo}/releases/latest"],
  10282. getOrgRuleSuite: ["GET /orgs/{org}/rulesets/rule-suites/{rule_suite_id}"],
  10283. getOrgRuleSuites: ["GET /orgs/{org}/rulesets/rule-suites"],
  10284. getOrgRuleset: ["GET /orgs/{org}/rulesets/{ruleset_id}"],
  10285. getOrgRulesets: ["GET /orgs/{org}/rulesets"],
  10286. getPages: ["GET /repos/{owner}/{repo}/pages"],
  10287. getPagesBuild: ["GET /repos/{owner}/{repo}/pages/builds/{build_id}"],
  10288. getPagesDeployment: [
  10289. "GET /repos/{owner}/{repo}/pages/deployments/{pages_deployment_id}"
  10290. ],
  10291. getPagesHealthCheck: ["GET /repos/{owner}/{repo}/pages/health"],
  10292. getParticipationStats: ["GET /repos/{owner}/{repo}/stats/participation"],
  10293. getPullRequestReviewProtection: [
  10294. "GET /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews"
  10295. ],
  10296. getPunchCardStats: ["GET /repos/{owner}/{repo}/stats/punch_card"],
  10297. getReadme: ["GET /repos/{owner}/{repo}/readme"],
  10298. getReadmeInDirectory: ["GET /repos/{owner}/{repo}/readme/{dir}"],
  10299. getRelease: ["GET /repos/{owner}/{repo}/releases/{release_id}"],
  10300. getReleaseAsset: ["GET /repos/{owner}/{repo}/releases/assets/{asset_id}"],
  10301. getReleaseByTag: ["GET /repos/{owner}/{repo}/releases/tags/{tag}"],
  10302. getRepoRuleSuite: [
  10303. "GET /repos/{owner}/{repo}/rulesets/rule-suites/{rule_suite_id}"
  10304. ],
  10305. getRepoRuleSuites: ["GET /repos/{owner}/{repo}/rulesets/rule-suites"],
  10306. getRepoRuleset: ["GET /repos/{owner}/{repo}/rulesets/{ruleset_id}"],
  10307. getRepoRulesets: ["GET /repos/{owner}/{repo}/rulesets"],
  10308. getStatusChecksProtection: [
  10309. "GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks"
  10310. ],
  10311. getTeamsWithAccessToProtectedBranch: [
  10312. "GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams"
  10313. ],
  10314. getTopPaths: ["GET /repos/{owner}/{repo}/traffic/popular/paths"],
  10315. getTopReferrers: ["GET /repos/{owner}/{repo}/traffic/popular/referrers"],
  10316. getUsersWithAccessToProtectedBranch: [
  10317. "GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users"
  10318. ],
  10319. getViews: ["GET /repos/{owner}/{repo}/traffic/views"],
  10320. getWebhook: ["GET /repos/{owner}/{repo}/hooks/{hook_id}"],
  10321. getWebhookConfigForRepo: [
  10322. "GET /repos/{owner}/{repo}/hooks/{hook_id}/config"
  10323. ],
  10324. getWebhookDelivery: [
  10325. "GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}"
  10326. ],
  10327. listActivities: ["GET /repos/{owner}/{repo}/activity"],
  10328. listAutolinks: ["GET /repos/{owner}/{repo}/autolinks"],
  10329. listBranches: ["GET /repos/{owner}/{repo}/branches"],
  10330. listBranchesForHeadCommit: [
  10331. "GET /repos/{owner}/{repo}/commits/{commit_sha}/branches-where-head"
  10332. ],
  10333. listCollaborators: ["GET /repos/{owner}/{repo}/collaborators"],
  10334. listCommentsForCommit: [
  10335. "GET /repos/{owner}/{repo}/commits/{commit_sha}/comments"
  10336. ],
  10337. listCommitCommentsForRepo: ["GET /repos/{owner}/{repo}/comments"],
  10338. listCommitStatusesForRef: [
  10339. "GET /repos/{owner}/{repo}/commits/{ref}/statuses"
  10340. ],
  10341. listCommits: ["GET /repos/{owner}/{repo}/commits"],
  10342. listContributors: ["GET /repos/{owner}/{repo}/contributors"],
  10343. listCustomDeploymentRuleIntegrations: [
  10344. "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/apps"
  10345. ],
  10346. listDeployKeys: ["GET /repos/{owner}/{repo}/keys"],
  10347. listDeploymentBranchPolicies: [
  10348. "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies"
  10349. ],
  10350. listDeploymentStatuses: [
  10351. "GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses"
  10352. ],
  10353. listDeployments: ["GET /repos/{owner}/{repo}/deployments"],
  10354. listForAuthenticatedUser: ["GET /user/repos"],
  10355. listForOrg: ["GET /orgs/{org}/repos"],
  10356. listForUser: ["GET /users/{username}/repos"],
  10357. listForks: ["GET /repos/{owner}/{repo}/forks"],
  10358. listInvitations: ["GET /repos/{owner}/{repo}/invitations"],
  10359. listInvitationsForAuthenticatedUser: ["GET /user/repository_invitations"],
  10360. listLanguages: ["GET /repos/{owner}/{repo}/languages"],
  10361. listPagesBuilds: ["GET /repos/{owner}/{repo}/pages/builds"],
  10362. listPublic: ["GET /repositories"],
  10363. listPullRequestsAssociatedWithCommit: [
  10364. "GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls"
  10365. ],
  10366. listReleaseAssets: [
  10367. "GET /repos/{owner}/{repo}/releases/{release_id}/assets"
  10368. ],
  10369. listReleases: ["GET /repos/{owner}/{repo}/releases"],
  10370. listTagProtection: ["GET /repos/{owner}/{repo}/tags/protection"],
  10371. listTags: ["GET /repos/{owner}/{repo}/tags"],
  10372. listTeams: ["GET /repos/{owner}/{repo}/teams"],
  10373. listWebhookDeliveries: [
  10374. "GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries"
  10375. ],
  10376. listWebhooks: ["GET /repos/{owner}/{repo}/hooks"],
  10377. merge: ["POST /repos/{owner}/{repo}/merges"],
  10378. mergeUpstream: ["POST /repos/{owner}/{repo}/merge-upstream"],
  10379. pingWebhook: ["POST /repos/{owner}/{repo}/hooks/{hook_id}/pings"],
  10380. redeliverWebhookDelivery: [
  10381. "POST /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}/attempts"
  10382. ],
  10383. removeAppAccessRestrictions: [
  10384. "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps",
  10385. {},
  10386. { mapToData: "apps" }
  10387. ],
  10388. removeCollaborator: [
  10389. "DELETE /repos/{owner}/{repo}/collaborators/{username}"
  10390. ],
  10391. removeStatusCheckContexts: [
  10392. "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts",
  10393. {},
  10394. { mapToData: "contexts" }
  10395. ],
  10396. removeStatusCheckProtection: [
  10397. "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks"
  10398. ],
  10399. removeTeamAccessRestrictions: [
  10400. "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams",
  10401. {},
  10402. { mapToData: "teams" }
  10403. ],
  10404. removeUserAccessRestrictions: [
  10405. "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users",
  10406. {},
  10407. { mapToData: "users" }
  10408. ],
  10409. renameBranch: ["POST /repos/{owner}/{repo}/branches/{branch}/rename"],
  10410. replaceAllTopics: ["PUT /repos/{owner}/{repo}/topics"],
  10411. requestPagesBuild: ["POST /repos/{owner}/{repo}/pages/builds"],
  10412. setAdminBranchProtection: [
  10413. "POST /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins"
  10414. ],
  10415. setAppAccessRestrictions: [
  10416. "PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps",
  10417. {},
  10418. { mapToData: "apps" }
  10419. ],
  10420. setStatusCheckContexts: [
  10421. "PUT /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts",
  10422. {},
  10423. { mapToData: "contexts" }
  10424. ],
  10425. setTeamAccessRestrictions: [
  10426. "PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams",
  10427. {},
  10428. { mapToData: "teams" }
  10429. ],
  10430. setUserAccessRestrictions: [
  10431. "PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users",
  10432. {},
  10433. { mapToData: "users" }
  10434. ],
  10435. testPushWebhook: ["POST /repos/{owner}/{repo}/hooks/{hook_id}/tests"],
  10436. transfer: ["POST /repos/{owner}/{repo}/transfer"],
  10437. update: ["PATCH /repos/{owner}/{repo}"],
  10438. updateBranchProtection: [
  10439. "PUT /repos/{owner}/{repo}/branches/{branch}/protection"
  10440. ],
  10441. updateCommitComment: ["PATCH /repos/{owner}/{repo}/comments/{comment_id}"],
  10442. updateDeploymentBranchPolicy: [
  10443. "PUT /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}"
  10444. ],
  10445. updateInformationAboutPagesSite: ["PUT /repos/{owner}/{repo}/pages"],
  10446. updateInvitation: [
  10447. "PATCH /repos/{owner}/{repo}/invitations/{invitation_id}"
  10448. ],
  10449. updateOrgRuleset: ["PUT /orgs/{org}/rulesets/{ruleset_id}"],
  10450. updatePullRequestReviewProtection: [
  10451. "PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews"
  10452. ],
  10453. updateRelease: ["PATCH /repos/{owner}/{repo}/releases/{release_id}"],
  10454. updateReleaseAsset: [
  10455. "PATCH /repos/{owner}/{repo}/releases/assets/{asset_id}"
  10456. ],
  10457. updateRepoRuleset: ["PUT /repos/{owner}/{repo}/rulesets/{ruleset_id}"],
  10458. updateStatusCheckPotection: [
  10459. "PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks",
  10460. {},
  10461. { renamed: ["repos", "updateStatusCheckProtection"] }
  10462. ],
  10463. updateStatusCheckProtection: [
  10464. "PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks"
  10465. ],
  10466. updateWebhook: ["PATCH /repos/{owner}/{repo}/hooks/{hook_id}"],
  10467. updateWebhookConfigForRepo: [
  10468. "PATCH /repos/{owner}/{repo}/hooks/{hook_id}/config"
  10469. ],
  10470. uploadReleaseAsset: [
  10471. "POST /repos/{owner}/{repo}/releases/{release_id}/assets{?name,label}",
  10472. { baseUrl: "https://uploads.github.com" }
  10473. ]
  10474. },
  10475. search: {
  10476. code: ["GET /search/code"],
  10477. commits: ["GET /search/commits"],
  10478. issuesAndPullRequests: ["GET /search/issues"],
  10479. labels: ["GET /search/labels"],
  10480. repos: ["GET /search/repositories"],
  10481. topics: ["GET /search/topics"],
  10482. users: ["GET /search/users"]
  10483. },
  10484. secretScanning: {
  10485. getAlert: [
  10486. "GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}"
  10487. ],
  10488. listAlertsForEnterprise: [
  10489. "GET /enterprises/{enterprise}/secret-scanning/alerts"
  10490. ],
  10491. listAlertsForOrg: ["GET /orgs/{org}/secret-scanning/alerts"],
  10492. listAlertsForRepo: ["GET /repos/{owner}/{repo}/secret-scanning/alerts"],
  10493. listLocationsForAlert: [
  10494. "GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations"
  10495. ],
  10496. updateAlert: [
  10497. "PATCH /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}"
  10498. ]
  10499. },
  10500. securityAdvisories: {
  10501. createFork: [
  10502. "POST /repos/{owner}/{repo}/security-advisories/{ghsa_id}/forks"
  10503. ],
  10504. createPrivateVulnerabilityReport: [
  10505. "POST /repos/{owner}/{repo}/security-advisories/reports"
  10506. ],
  10507. createRepositoryAdvisory: [
  10508. "POST /repos/{owner}/{repo}/security-advisories"
  10509. ],
  10510. createRepositoryAdvisoryCveRequest: [
  10511. "POST /repos/{owner}/{repo}/security-advisories/{ghsa_id}/cve"
  10512. ],
  10513. getGlobalAdvisory: ["GET /advisories/{ghsa_id}"],
  10514. getRepositoryAdvisory: [
  10515. "GET /repos/{owner}/{repo}/security-advisories/{ghsa_id}"
  10516. ],
  10517. listGlobalAdvisories: ["GET /advisories"],
  10518. listOrgRepositoryAdvisories: ["GET /orgs/{org}/security-advisories"],
  10519. listRepositoryAdvisories: ["GET /repos/{owner}/{repo}/security-advisories"],
  10520. updateRepositoryAdvisory: [
  10521. "PATCH /repos/{owner}/{repo}/security-advisories/{ghsa_id}"
  10522. ]
  10523. },
  10524. teams: {
  10525. addOrUpdateMembershipForUserInOrg: [
  10526. "PUT /orgs/{org}/teams/{team_slug}/memberships/{username}"
  10527. ],
  10528. addOrUpdateProjectPermissionsInOrg: [
  10529. "PUT /orgs/{org}/teams/{team_slug}/projects/{project_id}"
  10530. ],
  10531. addOrUpdateRepoPermissionsInOrg: [
  10532. "PUT /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"
  10533. ],
  10534. checkPermissionsForProjectInOrg: [
  10535. "GET /orgs/{org}/teams/{team_slug}/projects/{project_id}"
  10536. ],
  10537. checkPermissionsForRepoInOrg: [
  10538. "GET /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"
  10539. ],
  10540. create: ["POST /orgs/{org}/teams"],
  10541. createDiscussionCommentInOrg: [
  10542. "POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments"
  10543. ],
  10544. createDiscussionInOrg: ["POST /orgs/{org}/teams/{team_slug}/discussions"],
  10545. deleteDiscussionCommentInOrg: [
  10546. "DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}"
  10547. ],
  10548. deleteDiscussionInOrg: [
  10549. "DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}"
  10550. ],
  10551. deleteInOrg: ["DELETE /orgs/{org}/teams/{team_slug}"],
  10552. getByName: ["GET /orgs/{org}/teams/{team_slug}"],
  10553. getDiscussionCommentInOrg: [
  10554. "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}"
  10555. ],
  10556. getDiscussionInOrg: [
  10557. "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}"
  10558. ],
  10559. getMembershipForUserInOrg: [
  10560. "GET /orgs/{org}/teams/{team_slug}/memberships/{username}"
  10561. ],
  10562. list: ["GET /orgs/{org}/teams"],
  10563. listChildInOrg: ["GET /orgs/{org}/teams/{team_slug}/teams"],
  10564. listDiscussionCommentsInOrg: [
  10565. "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments"
  10566. ],
  10567. listDiscussionsInOrg: ["GET /orgs/{org}/teams/{team_slug}/discussions"],
  10568. listForAuthenticatedUser: ["GET /user/teams"],
  10569. listMembersInOrg: ["GET /orgs/{org}/teams/{team_slug}/members"],
  10570. listPendingInvitationsInOrg: [
  10571. "GET /orgs/{org}/teams/{team_slug}/invitations"
  10572. ],
  10573. listProjectsInOrg: ["GET /orgs/{org}/teams/{team_slug}/projects"],
  10574. listReposInOrg: ["GET /orgs/{org}/teams/{team_slug}/repos"],
  10575. removeMembershipForUserInOrg: [
  10576. "DELETE /orgs/{org}/teams/{team_slug}/memberships/{username}"
  10577. ],
  10578. removeProjectInOrg: [
  10579. "DELETE /orgs/{org}/teams/{team_slug}/projects/{project_id}"
  10580. ],
  10581. removeRepoInOrg: [
  10582. "DELETE /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"
  10583. ],
  10584. updateDiscussionCommentInOrg: [
  10585. "PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}"
  10586. ],
  10587. updateDiscussionInOrg: [
  10588. "PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}"
  10589. ],
  10590. updateInOrg: ["PATCH /orgs/{org}/teams/{team_slug}"]
  10591. },
  10592. users: {
  10593. addEmailForAuthenticated: [
  10594. "POST /user/emails",
  10595. {},
  10596. { renamed: ["users", "addEmailForAuthenticatedUser"] }
  10597. ],
  10598. addEmailForAuthenticatedUser: ["POST /user/emails"],
  10599. addSocialAccountForAuthenticatedUser: ["POST /user/social_accounts"],
  10600. block: ["PUT /user/blocks/{username}"],
  10601. checkBlocked: ["GET /user/blocks/{username}"],
  10602. checkFollowingForUser: ["GET /users/{username}/following/{target_user}"],
  10603. checkPersonIsFollowedByAuthenticated: ["GET /user/following/{username}"],
  10604. createGpgKeyForAuthenticated: [
  10605. "POST /user/gpg_keys",
  10606. {},
  10607. { renamed: ["users", "createGpgKeyForAuthenticatedUser"] }
  10608. ],
  10609. createGpgKeyForAuthenticatedUser: ["POST /user/gpg_keys"],
  10610. createPublicSshKeyForAuthenticated: [
  10611. "POST /user/keys",
  10612. {},
  10613. { renamed: ["users", "createPublicSshKeyForAuthenticatedUser"] }
  10614. ],
  10615. createPublicSshKeyForAuthenticatedUser: ["POST /user/keys"],
  10616. createSshSigningKeyForAuthenticatedUser: ["POST /user/ssh_signing_keys"],
  10617. deleteEmailForAuthenticated: [
  10618. "DELETE /user/emails",
  10619. {},
  10620. { renamed: ["users", "deleteEmailForAuthenticatedUser"] }
  10621. ],
  10622. deleteEmailForAuthenticatedUser: ["DELETE /user/emails"],
  10623. deleteGpgKeyForAuthenticated: [
  10624. "DELETE /user/gpg_keys/{gpg_key_id}",
  10625. {},
  10626. { renamed: ["users", "deleteGpgKeyForAuthenticatedUser"] }
  10627. ],
  10628. deleteGpgKeyForAuthenticatedUser: ["DELETE /user/gpg_keys/{gpg_key_id}"],
  10629. deletePublicSshKeyForAuthenticated: [
  10630. "DELETE /user/keys/{key_id}",
  10631. {},
  10632. { renamed: ["users", "deletePublicSshKeyForAuthenticatedUser"] }
  10633. ],
  10634. deletePublicSshKeyForAuthenticatedUser: ["DELETE /user/keys/{key_id}"],
  10635. deleteSocialAccountForAuthenticatedUser: ["DELETE /user/social_accounts"],
  10636. deleteSshSigningKeyForAuthenticatedUser: [
  10637. "DELETE /user/ssh_signing_keys/{ssh_signing_key_id}"
  10638. ],
  10639. follow: ["PUT /user/following/{username}"],
  10640. getAuthenticated: ["GET /user"],
  10641. getByUsername: ["GET /users/{username}"],
  10642. getContextForUser: ["GET /users/{username}/hovercard"],
  10643. getGpgKeyForAuthenticated: [
  10644. "GET /user/gpg_keys/{gpg_key_id}",
  10645. {},
  10646. { renamed: ["users", "getGpgKeyForAuthenticatedUser"] }
  10647. ],
  10648. getGpgKeyForAuthenticatedUser: ["GET /user/gpg_keys/{gpg_key_id}"],
  10649. getPublicSshKeyForAuthenticated: [
  10650. "GET /user/keys/{key_id}",
  10651. {},
  10652. { renamed: ["users", "getPublicSshKeyForAuthenticatedUser"] }
  10653. ],
  10654. getPublicSshKeyForAuthenticatedUser: ["GET /user/keys/{key_id}"],
  10655. getSshSigningKeyForAuthenticatedUser: [
  10656. "GET /user/ssh_signing_keys/{ssh_signing_key_id}"
  10657. ],
  10658. list: ["GET /users"],
  10659. listBlockedByAuthenticated: [
  10660. "GET /user/blocks",
  10661. {},
  10662. { renamed: ["users", "listBlockedByAuthenticatedUser"] }
  10663. ],
  10664. listBlockedByAuthenticatedUser: ["GET /user/blocks"],
  10665. listEmailsForAuthenticated: [
  10666. "GET /user/emails",
  10667. {},
  10668. { renamed: ["users", "listEmailsForAuthenticatedUser"] }
  10669. ],
  10670. listEmailsForAuthenticatedUser: ["GET /user/emails"],
  10671. listFollowedByAuthenticated: [
  10672. "GET /user/following",
  10673. {},
  10674. { renamed: ["users", "listFollowedByAuthenticatedUser"] }
  10675. ],
  10676. listFollowedByAuthenticatedUser: ["GET /user/following"],
  10677. listFollowersForAuthenticatedUser: ["GET /user/followers"],
  10678. listFollowersForUser: ["GET /users/{username}/followers"],
  10679. listFollowingForUser: ["GET /users/{username}/following"],
  10680. listGpgKeysForAuthenticated: [
  10681. "GET /user/gpg_keys",
  10682. {},
  10683. { renamed: ["users", "listGpgKeysForAuthenticatedUser"] }
  10684. ],
  10685. listGpgKeysForAuthenticatedUser: ["GET /user/gpg_keys"],
  10686. listGpgKeysForUser: ["GET /users/{username}/gpg_keys"],
  10687. listPublicEmailsForAuthenticated: [
  10688. "GET /user/public_emails",
  10689. {},
  10690. { renamed: ["users", "listPublicEmailsForAuthenticatedUser"] }
  10691. ],
  10692. listPublicEmailsForAuthenticatedUser: ["GET /user/public_emails"],
  10693. listPublicKeysForUser: ["GET /users/{username}/keys"],
  10694. listPublicSshKeysForAuthenticated: [
  10695. "GET /user/keys",
  10696. {},
  10697. { renamed: ["users", "listPublicSshKeysForAuthenticatedUser"] }
  10698. ],
  10699. listPublicSshKeysForAuthenticatedUser: ["GET /user/keys"],
  10700. listSocialAccountsForAuthenticatedUser: ["GET /user/social_accounts"],
  10701. listSocialAccountsForUser: ["GET /users/{username}/social_accounts"],
  10702. listSshSigningKeysForAuthenticatedUser: ["GET /user/ssh_signing_keys"],
  10703. listSshSigningKeysForUser: ["GET /users/{username}/ssh_signing_keys"],
  10704. setPrimaryEmailVisibilityForAuthenticated: [
  10705. "PATCH /user/email/visibility",
  10706. {},
  10707. { renamed: ["users", "setPrimaryEmailVisibilityForAuthenticatedUser"] }
  10708. ],
  10709. setPrimaryEmailVisibilityForAuthenticatedUser: [
  10710. "PATCH /user/email/visibility"
  10711. ],
  10712. unblock: ["DELETE /user/blocks/{username}"],
  10713. unfollow: ["DELETE /user/following/{username}"],
  10714. updateAuthenticated: ["PATCH /user"]
  10715. }
  10716. };
  10717. var endpoints_default = Endpoints;
  10718. // pkg/dist-src/endpoints-to-methods.js
  10719. var endpointMethodsMap = /* @__PURE__ */ new Map();
  10720. for (const [scope, endpoints] of Object.entries(endpoints_default)) {
  10721. for (const [methodName, endpoint] of Object.entries(endpoints)) {
  10722. const [route, defaults, decorations] = endpoint;
  10723. const [method, url] = route.split(/ /);
  10724. const endpointDefaults = Object.assign(
  10725. {
  10726. method,
  10727. url
  10728. },
  10729. defaults
  10730. );
  10731. if (!endpointMethodsMap.has(scope)) {
  10732. endpointMethodsMap.set(scope, /* @__PURE__ */ new Map());
  10733. }
  10734. endpointMethodsMap.get(scope).set(methodName, {
  10735. scope,
  10736. methodName,
  10737. endpointDefaults,
  10738. decorations
  10739. });
  10740. }
  10741. }
  10742. var handler = {
  10743. has({ scope }, methodName) {
  10744. return endpointMethodsMap.get(scope).has(methodName);
  10745. },
  10746. getOwnPropertyDescriptor(target, methodName) {
  10747. return {
  10748. value: this.get(target, methodName),
  10749. // ensures method is in the cache
  10750. configurable: true,
  10751. writable: true,
  10752. enumerable: true
  10753. };
  10754. },
  10755. defineProperty(target, methodName, descriptor) {
  10756. Object.defineProperty(target.cache, methodName, descriptor);
  10757. return true;
  10758. },
  10759. deleteProperty(target, methodName) {
  10760. delete target.cache[methodName];
  10761. return true;
  10762. },
  10763. ownKeys({ scope }) {
  10764. return [...endpointMethodsMap.get(scope).keys()];
  10765. },
  10766. set(target, methodName, value) {
  10767. return target.cache[methodName] = value;
  10768. },
  10769. get({ octokit, scope, cache }, methodName) {
  10770. if (cache[methodName]) {
  10771. return cache[methodName];
  10772. }
  10773. const method = endpointMethodsMap.get(scope).get(methodName);
  10774. if (!method) {
  10775. return void 0;
  10776. }
  10777. const { endpointDefaults, decorations } = method;
  10778. if (decorations) {
  10779. cache[methodName] = decorate(
  10780. octokit,
  10781. scope,
  10782. methodName,
  10783. endpointDefaults,
  10784. decorations
  10785. );
  10786. } else {
  10787. cache[methodName] = octokit.request.defaults(endpointDefaults);
  10788. }
  10789. return cache[methodName];
  10790. }
  10791. };
  10792. function endpointsToMethods(octokit) {
  10793. const newMethods = {};
  10794. for (const scope of endpointMethodsMap.keys()) {
  10795. newMethods[scope] = new Proxy({ octokit, scope, cache: {} }, handler);
  10796. }
  10797. return newMethods;
  10798. }
  10799. function decorate(octokit, scope, methodName, defaults, decorations) {
  10800. const requestWithDefaults = octokit.request.defaults(defaults);
  10801. function withDecorations(...args) {
  10802. let options = requestWithDefaults.endpoint.merge(...args);
  10803. if (decorations.mapToData) {
  10804. options = Object.assign({}, options, {
  10805. data: options[decorations.mapToData],
  10806. [decorations.mapToData]: void 0
  10807. });
  10808. return requestWithDefaults(options);
  10809. }
  10810. if (decorations.renamed) {
  10811. const [newScope, newMethodName] = decorations.renamed;
  10812. octokit.log.warn(
  10813. `octokit.${scope}.${methodName}() has been renamed to octokit.${newScope}.${newMethodName}()`
  10814. );
  10815. }
  10816. if (decorations.deprecated) {
  10817. octokit.log.warn(decorations.deprecated);
  10818. }
  10819. if (decorations.renamedParameters) {
  10820. const options2 = requestWithDefaults.endpoint.merge(...args);
  10821. for (const [name, alias] of Object.entries(
  10822. decorations.renamedParameters
  10823. )) {
  10824. if (name in options2) {
  10825. octokit.log.warn(
  10826. `"${name}" parameter is deprecated for "octokit.${scope}.${methodName}()". Use "${alias}" instead`
  10827. );
  10828. if (!(alias in options2)) {
  10829. options2[alias] = options2[name];
  10830. }
  10831. delete options2[name];
  10832. }
  10833. }
  10834. return requestWithDefaults(options2);
  10835. }
  10836. return requestWithDefaults(...args);
  10837. }
  10838. return Object.assign(withDecorations, requestWithDefaults);
  10839. }
  10840. // pkg/dist-src/index.js
  10841. function restEndpointMethods(octokit) {
  10842. const api = endpointsToMethods(octokit);
  10843. return {
  10844. rest: api
  10845. };
  10846. }
  10847. restEndpointMethods.VERSION = VERSION;
  10848. function legacyRestEndpointMethods(octokit) {
  10849. const api = endpointsToMethods(octokit);
  10850. return {
  10851. ...api,
  10852. rest: api
  10853. };
  10854. }
  10855. legacyRestEndpointMethods.VERSION = VERSION;
  10856. // Annotate the CommonJS export names for ESM import in node:
  10857. 0 && (0);
  10858. /***/ }),
  10859. /***/ 537:
  10860. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  10861. "use strict";
  10862. var __create = Object.create;
  10863. var __defProp = Object.defineProperty;
  10864. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  10865. var __getOwnPropNames = Object.getOwnPropertyNames;
  10866. var __getProtoOf = Object.getPrototypeOf;
  10867. var __hasOwnProp = Object.prototype.hasOwnProperty;
  10868. var __export = (target, all) => {
  10869. for (var name in all)
  10870. __defProp(target, name, { get: all[name], enumerable: true });
  10871. };
  10872. var __copyProps = (to, from, except, desc) => {
  10873. if (from && typeof from === "object" || typeof from === "function") {
  10874. for (let key of __getOwnPropNames(from))
  10875. if (!__hasOwnProp.call(to, key) && key !== except)
  10876. __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  10877. }
  10878. return to;
  10879. };
  10880. var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
  10881. // If the importer is in node compatibility mode or this is not an ESM
  10882. // file that has been converted to a CommonJS file using a Babel-
  10883. // compatible transform (i.e. "__esModule" has not been set), then set
  10884. // "default" to the CommonJS "module.exports" for node compatibility.
  10885. isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
  10886. mod
  10887. ));
  10888. var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
  10889. // pkg/dist-src/index.js
  10890. var dist_src_exports = {};
  10891. __export(dist_src_exports, {
  10892. RequestError: () => RequestError
  10893. });
  10894. module.exports = __toCommonJS(dist_src_exports);
  10895. var import_deprecation = __nccwpck_require__(8932);
  10896. var import_once = __toESM(__nccwpck_require__(1223));
  10897. var logOnceCode = (0, import_once.default)((deprecation) => console.warn(deprecation));
  10898. var logOnceHeaders = (0, import_once.default)((deprecation) => console.warn(deprecation));
  10899. var RequestError = class extends Error {
  10900. constructor(message, statusCode, options) {
  10901. super(message);
  10902. if (Error.captureStackTrace) {
  10903. Error.captureStackTrace(this, this.constructor);
  10904. }
  10905. this.name = "HttpError";
  10906. this.status = statusCode;
  10907. let headers;
  10908. if ("headers" in options && typeof options.headers !== "undefined") {
  10909. headers = options.headers;
  10910. }
  10911. if ("response" in options) {
  10912. this.response = options.response;
  10913. headers = options.response.headers;
  10914. }
  10915. const requestCopy = Object.assign({}, options.request);
  10916. if (options.request.headers.authorization) {
  10917. requestCopy.headers = Object.assign({}, options.request.headers, {
  10918. authorization: options.request.headers.authorization.replace(
  10919. /(?<! ) .*$/,
  10920. " [REDACTED]"
  10921. )
  10922. });
  10923. }
  10924. requestCopy.url = requestCopy.url.replace(/\bclient_secret=\w+/g, "client_secret=[REDACTED]").replace(/\baccess_token=\w+/g, "access_token=[REDACTED]");
  10925. this.request = requestCopy;
  10926. Object.defineProperty(this, "code", {
  10927. get() {
  10928. logOnceCode(
  10929. new import_deprecation.Deprecation(
  10930. "[@octokit/request-error] `error.code` is deprecated, use `error.status`."
  10931. )
  10932. );
  10933. return statusCode;
  10934. }
  10935. });
  10936. Object.defineProperty(this, "headers", {
  10937. get() {
  10938. logOnceHeaders(
  10939. new import_deprecation.Deprecation(
  10940. "[@octokit/request-error] `error.headers` is deprecated, use `error.response.headers`."
  10941. )
  10942. );
  10943. return headers || {};
  10944. }
  10945. });
  10946. }
  10947. };
  10948. // Annotate the CommonJS export names for ESM import in node:
  10949. 0 && (0);
  10950. /***/ }),
  10951. /***/ 6234:
  10952. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  10953. "use strict";
  10954. var __defProp = Object.defineProperty;
  10955. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  10956. var __getOwnPropNames = Object.getOwnPropertyNames;
  10957. var __hasOwnProp = Object.prototype.hasOwnProperty;
  10958. var __export = (target, all) => {
  10959. for (var name in all)
  10960. __defProp(target, name, { get: all[name], enumerable: true });
  10961. };
  10962. var __copyProps = (to, from, except, desc) => {
  10963. if (from && typeof from === "object" || typeof from === "function") {
  10964. for (let key of __getOwnPropNames(from))
  10965. if (!__hasOwnProp.call(to, key) && key !== except)
  10966. __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  10967. }
  10968. return to;
  10969. };
  10970. var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
  10971. // pkg/dist-src/index.js
  10972. var dist_src_exports = {};
  10973. __export(dist_src_exports, {
  10974. request: () => request
  10975. });
  10976. module.exports = __toCommonJS(dist_src_exports);
  10977. var import_endpoint = __nccwpck_require__(9440);
  10978. var import_universal_user_agent = __nccwpck_require__(5030);
  10979. // pkg/dist-src/version.js
  10980. var VERSION = "8.4.1";
  10981. // pkg/dist-src/is-plain-object.js
  10982. function isPlainObject(value) {
  10983. if (typeof value !== "object" || value === null)
  10984. return false;
  10985. if (Object.prototype.toString.call(value) !== "[object Object]")
  10986. return false;
  10987. const proto = Object.getPrototypeOf(value);
  10988. if (proto === null)
  10989. return true;
  10990. const Ctor = Object.prototype.hasOwnProperty.call(proto, "constructor") && proto.constructor;
  10991. return typeof Ctor === "function" && Ctor instanceof Ctor && Function.prototype.call(Ctor) === Function.prototype.call(value);
  10992. }
  10993. // pkg/dist-src/fetch-wrapper.js
  10994. var import_request_error = __nccwpck_require__(537);
  10995. // pkg/dist-src/get-buffer-response.js
  10996. function getBufferResponse(response) {
  10997. return response.arrayBuffer();
  10998. }
  10999. // pkg/dist-src/fetch-wrapper.js
  11000. function fetchWrapper(requestOptions) {
  11001. var _a, _b, _c, _d;
  11002. const log = requestOptions.request && requestOptions.request.log ? requestOptions.request.log : console;
  11003. const parseSuccessResponseBody = ((_a = requestOptions.request) == null ? void 0 : _a.parseSuccessResponseBody) !== false;
  11004. if (isPlainObject(requestOptions.body) || Array.isArray(requestOptions.body)) {
  11005. requestOptions.body = JSON.stringify(requestOptions.body);
  11006. }
  11007. let headers = {};
  11008. let status;
  11009. let url;
  11010. let { fetch } = globalThis;
  11011. if ((_b = requestOptions.request) == null ? void 0 : _b.fetch) {
  11012. fetch = requestOptions.request.fetch;
  11013. }
  11014. if (!fetch) {
  11015. throw new Error(
  11016. "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"
  11017. );
  11018. }
  11019. return fetch(requestOptions.url, {
  11020. method: requestOptions.method,
  11021. body: requestOptions.body,
  11022. redirect: (_c = requestOptions.request) == null ? void 0 : _c.redirect,
  11023. headers: requestOptions.headers,
  11024. signal: (_d = requestOptions.request) == null ? void 0 : _d.signal,
  11025. // duplex must be set if request.body is ReadableStream or Async Iterables.
  11026. // See https://fetch.spec.whatwg.org/#dom-requestinit-duplex.
  11027. ...requestOptions.body && { duplex: "half" }
  11028. }).then(async (response) => {
  11029. url = response.url;
  11030. status = response.status;
  11031. for (const keyAndValue of response.headers) {
  11032. headers[keyAndValue[0]] = keyAndValue[1];
  11033. }
  11034. if ("deprecation" in headers) {
  11035. const matches = headers.link && headers.link.match(/<([^<>]+)>; rel="deprecation"/);
  11036. const deprecationLink = matches && matches.pop();
  11037. log.warn(
  11038. `[@octokit/request] "${requestOptions.method} ${requestOptions.url}" is deprecated. It is scheduled to be removed on ${headers.sunset}${deprecationLink ? `. See ${deprecationLink}` : ""}`
  11039. );
  11040. }
  11041. if (status === 204 || status === 205) {
  11042. return;
  11043. }
  11044. if (requestOptions.method === "HEAD") {
  11045. if (status < 400) {
  11046. return;
  11047. }
  11048. throw new import_request_error.RequestError(response.statusText, status, {
  11049. response: {
  11050. url,
  11051. status,
  11052. headers,
  11053. data: void 0
  11054. },
  11055. request: requestOptions
  11056. });
  11057. }
  11058. if (status === 304) {
  11059. throw new import_request_error.RequestError("Not modified", status, {
  11060. response: {
  11061. url,
  11062. status,
  11063. headers,
  11064. data: await getResponseData(response)
  11065. },
  11066. request: requestOptions
  11067. });
  11068. }
  11069. if (status >= 400) {
  11070. const data = await getResponseData(response);
  11071. const error = new import_request_error.RequestError(toErrorMessage(data), status, {
  11072. response: {
  11073. url,
  11074. status,
  11075. headers,
  11076. data
  11077. },
  11078. request: requestOptions
  11079. });
  11080. throw error;
  11081. }
  11082. return parseSuccessResponseBody ? await getResponseData(response) : response.body;
  11083. }).then((data) => {
  11084. return {
  11085. status,
  11086. url,
  11087. headers,
  11088. data
  11089. };
  11090. }).catch((error) => {
  11091. if (error instanceof import_request_error.RequestError)
  11092. throw error;
  11093. else if (error.name === "AbortError")
  11094. throw error;
  11095. let message = error.message;
  11096. if (error.name === "TypeError" && "cause" in error) {
  11097. if (error.cause instanceof Error) {
  11098. message = error.cause.message;
  11099. } else if (typeof error.cause === "string") {
  11100. message = error.cause;
  11101. }
  11102. }
  11103. throw new import_request_error.RequestError(message, 500, {
  11104. request: requestOptions
  11105. });
  11106. });
  11107. }
  11108. async function getResponseData(response) {
  11109. const contentType = response.headers.get("content-type");
  11110. if (/application\/json/.test(contentType)) {
  11111. return response.json().catch(() => response.text()).catch(() => "");
  11112. }
  11113. if (!contentType || /^text\/|charset=utf-8$/.test(contentType)) {
  11114. return response.text();
  11115. }
  11116. return getBufferResponse(response);
  11117. }
  11118. function toErrorMessage(data) {
  11119. if (typeof data === "string")
  11120. return data;
  11121. let suffix;
  11122. if ("documentation_url" in data) {
  11123. suffix = ` - ${data.documentation_url}`;
  11124. } else {
  11125. suffix = "";
  11126. }
  11127. if ("message" in data) {
  11128. if (Array.isArray(data.errors)) {
  11129. return `${data.message}: ${data.errors.map(JSON.stringify).join(", ")}${suffix}`;
  11130. }
  11131. return `${data.message}${suffix}`;
  11132. }
  11133. return `Unknown error: ${JSON.stringify(data)}`;
  11134. }
  11135. // pkg/dist-src/with-defaults.js
  11136. function withDefaults(oldEndpoint, newDefaults) {
  11137. const endpoint2 = oldEndpoint.defaults(newDefaults);
  11138. const newApi = function(route, parameters) {
  11139. const endpointOptions = endpoint2.merge(route, parameters);
  11140. if (!endpointOptions.request || !endpointOptions.request.hook) {
  11141. return fetchWrapper(endpoint2.parse(endpointOptions));
  11142. }
  11143. const request2 = (route2, parameters2) => {
  11144. return fetchWrapper(
  11145. endpoint2.parse(endpoint2.merge(route2, parameters2))
  11146. );
  11147. };
  11148. Object.assign(request2, {
  11149. endpoint: endpoint2,
  11150. defaults: withDefaults.bind(null, endpoint2)
  11151. });
  11152. return endpointOptions.request.hook(request2, endpointOptions);
  11153. };
  11154. return Object.assign(newApi, {
  11155. endpoint: endpoint2,
  11156. defaults: withDefaults.bind(null, endpoint2)
  11157. });
  11158. }
  11159. // pkg/dist-src/index.js
  11160. var request = withDefaults(import_endpoint.endpoint, {
  11161. headers: {
  11162. "user-agent": `octokit-request.js/${VERSION} ${(0, import_universal_user_agent.getUserAgent)()}`
  11163. }
  11164. });
  11165. // Annotate the CommonJS export names for ESM import in node:
  11166. 0 && (0);
  11167. /***/ }),
  11168. /***/ 3682:
  11169. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  11170. var register = __nccwpck_require__(4670);
  11171. var addHook = __nccwpck_require__(5549);
  11172. var removeHook = __nccwpck_require__(6819);
  11173. // bind with array of arguments: https://stackoverflow.com/a/21792913
  11174. var bind = Function.bind;
  11175. var bindable = bind.bind(bind);
  11176. function bindApi(hook, state, name) {
  11177. var removeHookRef = bindable(removeHook, null).apply(
  11178. null,
  11179. name ? [state, name] : [state]
  11180. );
  11181. hook.api = { remove: removeHookRef };
  11182. hook.remove = removeHookRef;
  11183. ["before", "error", "after", "wrap"].forEach(function (kind) {
  11184. var args = name ? [state, kind, name] : [state, kind];
  11185. hook[kind] = hook.api[kind] = bindable(addHook, null).apply(null, args);
  11186. });
  11187. }
  11188. function HookSingular() {
  11189. var singularHookName = "h";
  11190. var singularHookState = {
  11191. registry: {},
  11192. };
  11193. var singularHook = register.bind(null, singularHookState, singularHookName);
  11194. bindApi(singularHook, singularHookState, singularHookName);
  11195. return singularHook;
  11196. }
  11197. function HookCollection() {
  11198. var state = {
  11199. registry: {},
  11200. };
  11201. var hook = register.bind(null, state);
  11202. bindApi(hook, state);
  11203. return hook;
  11204. }
  11205. var collectionHookDeprecationMessageDisplayed = false;
  11206. function Hook() {
  11207. if (!collectionHookDeprecationMessageDisplayed) {
  11208. console.warn(
  11209. '[before-after-hook]: "Hook()" repurposing warning, use "Hook.Collection()". Read more: https://git.io/upgrade-before-after-hook-to-1.4'
  11210. );
  11211. collectionHookDeprecationMessageDisplayed = true;
  11212. }
  11213. return HookCollection();
  11214. }
  11215. Hook.Singular = HookSingular.bind();
  11216. Hook.Collection = HookCollection.bind();
  11217. module.exports = Hook;
  11218. // expose constructors as a named property for TypeScript
  11219. module.exports.Hook = Hook;
  11220. module.exports.Singular = Hook.Singular;
  11221. module.exports.Collection = Hook.Collection;
  11222. /***/ }),
  11223. /***/ 5549:
  11224. /***/ ((module) => {
  11225. module.exports = addHook;
  11226. function addHook(state, kind, name, hook) {
  11227. var orig = hook;
  11228. if (!state.registry[name]) {
  11229. state.registry[name] = [];
  11230. }
  11231. if (kind === "before") {
  11232. hook = function (method, options) {
  11233. return Promise.resolve()
  11234. .then(orig.bind(null, options))
  11235. .then(method.bind(null, options));
  11236. };
  11237. }
  11238. if (kind === "after") {
  11239. hook = function (method, options) {
  11240. var result;
  11241. return Promise.resolve()
  11242. .then(method.bind(null, options))
  11243. .then(function (result_) {
  11244. result = result_;
  11245. return orig(result, options);
  11246. })
  11247. .then(function () {
  11248. return result;
  11249. });
  11250. };
  11251. }
  11252. if (kind === "error") {
  11253. hook = function (method, options) {
  11254. return Promise.resolve()
  11255. .then(method.bind(null, options))
  11256. .catch(function (error) {
  11257. return orig(error, options);
  11258. });
  11259. };
  11260. }
  11261. state.registry[name].push({
  11262. hook: hook,
  11263. orig: orig,
  11264. });
  11265. }
  11266. /***/ }),
  11267. /***/ 4670:
  11268. /***/ ((module) => {
  11269. module.exports = register;
  11270. function register(state, name, method, options) {
  11271. if (typeof method !== "function") {
  11272. throw new Error("method for before hook must be a function");
  11273. }
  11274. if (!options) {
  11275. options = {};
  11276. }
  11277. if (Array.isArray(name)) {
  11278. return name.reverse().reduce(function (callback, name) {
  11279. return register.bind(null, state, name, callback, options);
  11280. }, method)();
  11281. }
  11282. return Promise.resolve().then(function () {
  11283. if (!state.registry[name]) {
  11284. return method(options);
  11285. }
  11286. return state.registry[name].reduce(function (method, registered) {
  11287. return registered.hook.bind(null, method, options);
  11288. }, method)();
  11289. });
  11290. }
  11291. /***/ }),
  11292. /***/ 6819:
  11293. /***/ ((module) => {
  11294. module.exports = removeHook;
  11295. function removeHook(state, name, method) {
  11296. if (!state.registry[name]) {
  11297. return;
  11298. }
  11299. var index = state.registry[name]
  11300. .map(function (registered) {
  11301. return registered.orig;
  11302. })
  11303. .indexOf(method);
  11304. if (index === -1) {
  11305. return;
  11306. }
  11307. state.registry[name].splice(index, 1);
  11308. }
  11309. /***/ }),
  11310. /***/ 8932:
  11311. /***/ ((__unused_webpack_module, exports) => {
  11312. "use strict";
  11313. Object.defineProperty(exports, "__esModule", ({ value: true }));
  11314. class Deprecation extends Error {
  11315. constructor(message) {
  11316. super(message); // Maintains proper stack trace (only available on V8)
  11317. /* istanbul ignore next */
  11318. if (Error.captureStackTrace) {
  11319. Error.captureStackTrace(this, this.constructor);
  11320. }
  11321. this.name = 'Deprecation';
  11322. }
  11323. }
  11324. exports.Deprecation = Deprecation;
  11325. /***/ }),
  11326. /***/ 1223:
  11327. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  11328. var wrappy = __nccwpck_require__(2940)
  11329. module.exports = wrappy(once)
  11330. module.exports.strict = wrappy(onceStrict)
  11331. once.proto = once(function () {
  11332. Object.defineProperty(Function.prototype, 'once', {
  11333. value: function () {
  11334. return once(this)
  11335. },
  11336. configurable: true
  11337. })
  11338. Object.defineProperty(Function.prototype, 'onceStrict', {
  11339. value: function () {
  11340. return onceStrict(this)
  11341. },
  11342. configurable: true
  11343. })
  11344. })
  11345. function once (fn) {
  11346. var f = function () {
  11347. if (f.called) return f.value
  11348. f.called = true
  11349. return f.value = fn.apply(this, arguments)
  11350. }
  11351. f.called = false
  11352. return f
  11353. }
  11354. function onceStrict (fn) {
  11355. var f = function () {
  11356. if (f.called)
  11357. throw new Error(f.onceError)
  11358. f.called = true
  11359. return f.value = fn.apply(this, arguments)
  11360. }
  11361. var name = fn.name || 'Function wrapped with `once`'
  11362. f.onceError = name + " shouldn't be called more than once"
  11363. f.called = false
  11364. return f
  11365. }
  11366. /***/ }),
  11367. /***/ 5911:
  11368. /***/ ((module, exports) => {
  11369. exports = module.exports = SemVer
  11370. var debug
  11371. /* istanbul ignore next */
  11372. if (typeof process === 'object' &&
  11373. process.env &&
  11374. process.env.NODE_DEBUG &&
  11375. /\bsemver\b/i.test(process.env.NODE_DEBUG)) {
  11376. debug = function () {
  11377. var args = Array.prototype.slice.call(arguments, 0)
  11378. args.unshift('SEMVER')
  11379. console.log.apply(console, args)
  11380. }
  11381. } else {
  11382. debug = function () {}
  11383. }
  11384. // Note: this is the semver.org version of the spec that it implements
  11385. // Not necessarily the package version of this code.
  11386. exports.SEMVER_SPEC_VERSION = '2.0.0'
  11387. var MAX_LENGTH = 256
  11388. var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER ||
  11389. /* istanbul ignore next */ 9007199254740991
  11390. // Max safe segment length for coercion.
  11391. var MAX_SAFE_COMPONENT_LENGTH = 16
  11392. var MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6
  11393. // The actual regexps go on exports.re
  11394. var re = exports.re = []
  11395. var safeRe = exports.safeRe = []
  11396. var src = exports.src = []
  11397. var t = exports.tokens = {}
  11398. var R = 0
  11399. function tok (n) {
  11400. t[n] = R++
  11401. }
  11402. var LETTERDASHNUMBER = '[a-zA-Z0-9-]'
  11403. // Replace some greedy regex tokens to prevent regex dos issues. These regex are
  11404. // used internally via the safeRe object since all inputs in this library get
  11405. // normalized first to trim and collapse all extra whitespace. The original
  11406. // regexes are exported for userland consumption and lower level usage. A
  11407. // future breaking change could export the safer regex only with a note that
  11408. // all input should have extra whitespace removed.
  11409. var safeRegexReplacements = [
  11410. ['\\s', 1],
  11411. ['\\d', MAX_LENGTH],
  11412. [LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH],
  11413. ]
  11414. function makeSafeRe (value) {
  11415. for (var i = 0; i < safeRegexReplacements.length; i++) {
  11416. var token = safeRegexReplacements[i][0]
  11417. var max = safeRegexReplacements[i][1]
  11418. value = value
  11419. .split(token + '*').join(token + '{0,' + max + '}')
  11420. .split(token + '+').join(token + '{1,' + max + '}')
  11421. }
  11422. return value
  11423. }
  11424. // The following Regular Expressions can be used for tokenizing,
  11425. // validating, and parsing SemVer version strings.
  11426. // ## Numeric Identifier
  11427. // A single `0`, or a non-zero digit followed by zero or more digits.
  11428. tok('NUMERICIDENTIFIER')
  11429. src[t.NUMERICIDENTIFIER] = '0|[1-9]\\d*'
  11430. tok('NUMERICIDENTIFIERLOOSE')
  11431. src[t.NUMERICIDENTIFIERLOOSE] = '\\d+'
  11432. // ## Non-numeric Identifier
  11433. // Zero or more digits, followed by a letter or hyphen, and then zero or
  11434. // more letters, digits, or hyphens.
  11435. tok('NONNUMERICIDENTIFIER')
  11436. src[t.NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-]' + LETTERDASHNUMBER + '*'
  11437. // ## Main Version
  11438. // Three dot-separated numeric identifiers.
  11439. tok('MAINVERSION')
  11440. src[t.MAINVERSION] = '(' + src[t.NUMERICIDENTIFIER] + ')\\.' +
  11441. '(' + src[t.NUMERICIDENTIFIER] + ')\\.' +
  11442. '(' + src[t.NUMERICIDENTIFIER] + ')'
  11443. tok('MAINVERSIONLOOSE')
  11444. src[t.MAINVERSIONLOOSE] = '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')\\.' +
  11445. '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')\\.' +
  11446. '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')'
  11447. // ## Pre-release Version Identifier
  11448. // A numeric identifier, or a non-numeric identifier.
  11449. tok('PRERELEASEIDENTIFIER')
  11450. src[t.PRERELEASEIDENTIFIER] = '(?:' + src[t.NUMERICIDENTIFIER] +
  11451. '|' + src[t.NONNUMERICIDENTIFIER] + ')'
  11452. tok('PRERELEASEIDENTIFIERLOOSE')
  11453. src[t.PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[t.NUMERICIDENTIFIERLOOSE] +
  11454. '|' + src[t.NONNUMERICIDENTIFIER] + ')'
  11455. // ## Pre-release Version
  11456. // Hyphen, followed by one or more dot-separated pre-release version
  11457. // identifiers.
  11458. tok('PRERELEASE')
  11459. src[t.PRERELEASE] = '(?:-(' + src[t.PRERELEASEIDENTIFIER] +
  11460. '(?:\\.' + src[t.PRERELEASEIDENTIFIER] + ')*))'
  11461. tok('PRERELEASELOOSE')
  11462. src[t.PRERELEASELOOSE] = '(?:-?(' + src[t.PRERELEASEIDENTIFIERLOOSE] +
  11463. '(?:\\.' + src[t.PRERELEASEIDENTIFIERLOOSE] + ')*))'
  11464. // ## Build Metadata Identifier
  11465. // Any combination of digits, letters, or hyphens.
  11466. tok('BUILDIDENTIFIER')
  11467. src[t.BUILDIDENTIFIER] = LETTERDASHNUMBER + '+'
  11468. // ## Build Metadata
  11469. // Plus sign, followed by one or more period-separated build metadata
  11470. // identifiers.
  11471. tok('BUILD')
  11472. src[t.BUILD] = '(?:\\+(' + src[t.BUILDIDENTIFIER] +
  11473. '(?:\\.' + src[t.BUILDIDENTIFIER] + ')*))'
  11474. // ## Full Version String
  11475. // A main version, followed optionally by a pre-release version and
  11476. // build metadata.
  11477. // Note that the only major, minor, patch, and pre-release sections of
  11478. // the version string are capturing groups. The build metadata is not a
  11479. // capturing group, because it should not ever be used in version
  11480. // comparison.
  11481. tok('FULL')
  11482. tok('FULLPLAIN')
  11483. src[t.FULLPLAIN] = 'v?' + src[t.MAINVERSION] +
  11484. src[t.PRERELEASE] + '?' +
  11485. src[t.BUILD] + '?'
  11486. src[t.FULL] = '^' + src[t.FULLPLAIN] + '$'
  11487. // like full, but allows v1.2.3 and =1.2.3, which people do sometimes.
  11488. // also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty
  11489. // common in the npm registry.
  11490. tok('LOOSEPLAIN')
  11491. src[t.LOOSEPLAIN] = '[v=\\s]*' + src[t.MAINVERSIONLOOSE] +
  11492. src[t.PRERELEASELOOSE] + '?' +
  11493. src[t.BUILD] + '?'
  11494. tok('LOOSE')
  11495. src[t.LOOSE] = '^' + src[t.LOOSEPLAIN] + '$'
  11496. tok('GTLT')
  11497. src[t.GTLT] = '((?:<|>)?=?)'
  11498. // Something like "2.*" or "1.2.x".
  11499. // Note that "x.x" is a valid xRange identifer, meaning "any version"
  11500. // Only the first item is strictly required.
  11501. tok('XRANGEIDENTIFIERLOOSE')
  11502. src[t.XRANGEIDENTIFIERLOOSE] = src[t.NUMERICIDENTIFIERLOOSE] + '|x|X|\\*'
  11503. tok('XRANGEIDENTIFIER')
  11504. src[t.XRANGEIDENTIFIER] = src[t.NUMERICIDENTIFIER] + '|x|X|\\*'
  11505. tok('XRANGEPLAIN')
  11506. src[t.XRANGEPLAIN] = '[v=\\s]*(' + src[t.XRANGEIDENTIFIER] + ')' +
  11507. '(?:\\.(' + src[t.XRANGEIDENTIFIER] + ')' +
  11508. '(?:\\.(' + src[t.XRANGEIDENTIFIER] + ')' +
  11509. '(?:' + src[t.PRERELEASE] + ')?' +
  11510. src[t.BUILD] + '?' +
  11511. ')?)?'
  11512. tok('XRANGEPLAINLOOSE')
  11513. src[t.XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +
  11514. '(?:\\.(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +
  11515. '(?:\\.(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +
  11516. '(?:' + src[t.PRERELEASELOOSE] + ')?' +
  11517. src[t.BUILD] + '?' +
  11518. ')?)?'
  11519. tok('XRANGE')
  11520. src[t.XRANGE] = '^' + src[t.GTLT] + '\\s*' + src[t.XRANGEPLAIN] + '$'
  11521. tok('XRANGELOOSE')
  11522. src[t.XRANGELOOSE] = '^' + src[t.GTLT] + '\\s*' + src[t.XRANGEPLAINLOOSE] + '$'
  11523. // Coercion.
  11524. // Extract anything that could conceivably be a part of a valid semver
  11525. tok('COERCE')
  11526. src[t.COERCE] = '(^|[^\\d])' +
  11527. '(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '})' +
  11528. '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
  11529. '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
  11530. '(?:$|[^\\d])'
  11531. tok('COERCERTL')
  11532. re[t.COERCERTL] = new RegExp(src[t.COERCE], 'g')
  11533. safeRe[t.COERCERTL] = new RegExp(makeSafeRe(src[t.COERCE]), 'g')
  11534. // Tilde ranges.
  11535. // Meaning is "reasonably at or greater than"
  11536. tok('LONETILDE')
  11537. src[t.LONETILDE] = '(?:~>?)'
  11538. tok('TILDETRIM')
  11539. src[t.TILDETRIM] = '(\\s*)' + src[t.LONETILDE] + '\\s+'
  11540. re[t.TILDETRIM] = new RegExp(src[t.TILDETRIM], 'g')
  11541. safeRe[t.TILDETRIM] = new RegExp(makeSafeRe(src[t.TILDETRIM]), 'g')
  11542. var tildeTrimReplace = '$1~'
  11543. tok('TILDE')
  11544. src[t.TILDE] = '^' + src[t.LONETILDE] + src[t.XRANGEPLAIN] + '$'
  11545. tok('TILDELOOSE')
  11546. src[t.TILDELOOSE] = '^' + src[t.LONETILDE] + src[t.XRANGEPLAINLOOSE] + '$'
  11547. // Caret ranges.
  11548. // Meaning is "at least and backwards compatible with"
  11549. tok('LONECARET')
  11550. src[t.LONECARET] = '(?:\\^)'
  11551. tok('CARETTRIM')
  11552. src[t.CARETTRIM] = '(\\s*)' + src[t.LONECARET] + '\\s+'
  11553. re[t.CARETTRIM] = new RegExp(src[t.CARETTRIM], 'g')
  11554. safeRe[t.CARETTRIM] = new RegExp(makeSafeRe(src[t.CARETTRIM]), 'g')
  11555. var caretTrimReplace = '$1^'
  11556. tok('CARET')
  11557. src[t.CARET] = '^' + src[t.LONECARET] + src[t.XRANGEPLAIN] + '$'
  11558. tok('CARETLOOSE')
  11559. src[t.CARETLOOSE] = '^' + src[t.LONECARET] + src[t.XRANGEPLAINLOOSE] + '$'
  11560. // A simple gt/lt/eq thing, or just "" to indicate "any version"
  11561. tok('COMPARATORLOOSE')
  11562. src[t.COMPARATORLOOSE] = '^' + src[t.GTLT] + '\\s*(' + src[t.LOOSEPLAIN] + ')$|^$'
  11563. tok('COMPARATOR')
  11564. src[t.COMPARATOR] = '^' + src[t.GTLT] + '\\s*(' + src[t.FULLPLAIN] + ')$|^$'
  11565. // An expression to strip any whitespace between the gtlt and the thing
  11566. // it modifies, so that `> 1.2.3` ==> `>1.2.3`
  11567. tok('COMPARATORTRIM')
  11568. src[t.COMPARATORTRIM] = '(\\s*)' + src[t.GTLT] +
  11569. '\\s*(' + src[t.LOOSEPLAIN] + '|' + src[t.XRANGEPLAIN] + ')'
  11570. // this one has to use the /g flag
  11571. re[t.COMPARATORTRIM] = new RegExp(src[t.COMPARATORTRIM], 'g')
  11572. safeRe[t.COMPARATORTRIM] = new RegExp(makeSafeRe(src[t.COMPARATORTRIM]), 'g')
  11573. var comparatorTrimReplace = '$1$2$3'
  11574. // Something like `1.2.3 - 1.2.4`
  11575. // Note that these all use the loose form, because they'll be
  11576. // checked against either the strict or loose comparator form
  11577. // later.
  11578. tok('HYPHENRANGE')
  11579. src[t.HYPHENRANGE] = '^\\s*(' + src[t.XRANGEPLAIN] + ')' +
  11580. '\\s+-\\s+' +
  11581. '(' + src[t.XRANGEPLAIN] + ')' +
  11582. '\\s*$'
  11583. tok('HYPHENRANGELOOSE')
  11584. src[t.HYPHENRANGELOOSE] = '^\\s*(' + src[t.XRANGEPLAINLOOSE] + ')' +
  11585. '\\s+-\\s+' +
  11586. '(' + src[t.XRANGEPLAINLOOSE] + ')' +
  11587. '\\s*$'
  11588. // Star ranges basically just allow anything at all.
  11589. tok('STAR')
  11590. src[t.STAR] = '(<|>)?=?\\s*\\*'
  11591. // Compile to actual regexp objects.
  11592. // All are flag-free, unless they were created above with a flag.
  11593. for (var i = 0; i < R; i++) {
  11594. debug(i, src[i])
  11595. if (!re[i]) {
  11596. re[i] = new RegExp(src[i])
  11597. // Replace all greedy whitespace to prevent regex dos issues. These regex are
  11598. // used internally via the safeRe object since all inputs in this library get
  11599. // normalized first to trim and collapse all extra whitespace. The original
  11600. // regexes are exported for userland consumption and lower level usage. A
  11601. // future breaking change could export the safer regex only with a note that
  11602. // all input should have extra whitespace removed.
  11603. safeRe[i] = new RegExp(makeSafeRe(src[i]))
  11604. }
  11605. }
  11606. exports.parse = parse
  11607. function parse (version, options) {
  11608. if (!options || typeof options !== 'object') {
  11609. options = {
  11610. loose: !!options,
  11611. includePrerelease: false
  11612. }
  11613. }
  11614. if (version instanceof SemVer) {
  11615. return version
  11616. }
  11617. if (typeof version !== 'string') {
  11618. return null
  11619. }
  11620. if (version.length > MAX_LENGTH) {
  11621. return null
  11622. }
  11623. var r = options.loose ? safeRe[t.LOOSE] : safeRe[t.FULL]
  11624. if (!r.test(version)) {
  11625. return null
  11626. }
  11627. try {
  11628. return new SemVer(version, options)
  11629. } catch (er) {
  11630. return null
  11631. }
  11632. }
  11633. exports.valid = valid
  11634. function valid (version, options) {
  11635. var v = parse(version, options)
  11636. return v ? v.version : null
  11637. }
  11638. exports.clean = clean
  11639. function clean (version, options) {
  11640. var s = parse(version.trim().replace(/^[=v]+/, ''), options)
  11641. return s ? s.version : null
  11642. }
  11643. exports.SemVer = SemVer
  11644. function SemVer (version, options) {
  11645. if (!options || typeof options !== 'object') {
  11646. options = {
  11647. loose: !!options,
  11648. includePrerelease: false
  11649. }
  11650. }
  11651. if (version instanceof SemVer) {
  11652. if (version.loose === options.loose) {
  11653. return version
  11654. } else {
  11655. version = version.version
  11656. }
  11657. } else if (typeof version !== 'string') {
  11658. throw new TypeError('Invalid Version: ' + version)
  11659. }
  11660. if (version.length > MAX_LENGTH) {
  11661. throw new TypeError('version is longer than ' + MAX_LENGTH + ' characters')
  11662. }
  11663. if (!(this instanceof SemVer)) {
  11664. return new SemVer(version, options)
  11665. }
  11666. debug('SemVer', version, options)
  11667. this.options = options
  11668. this.loose = !!options.loose
  11669. var m = version.trim().match(options.loose ? safeRe[t.LOOSE] : safeRe[t.FULL])
  11670. if (!m) {
  11671. throw new TypeError('Invalid Version: ' + version)
  11672. }
  11673. this.raw = version
  11674. // these are actually numbers
  11675. this.major = +m[1]
  11676. this.minor = +m[2]
  11677. this.patch = +m[3]
  11678. if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
  11679. throw new TypeError('Invalid major version')
  11680. }
  11681. if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
  11682. throw new TypeError('Invalid minor version')
  11683. }
  11684. if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
  11685. throw new TypeError('Invalid patch version')
  11686. }
  11687. // numberify any prerelease numeric ids
  11688. if (!m[4]) {
  11689. this.prerelease = []
  11690. } else {
  11691. this.prerelease = m[4].split('.').map(function (id) {
  11692. if (/^[0-9]+$/.test(id)) {
  11693. var num = +id
  11694. if (num >= 0 && num < MAX_SAFE_INTEGER) {
  11695. return num
  11696. }
  11697. }
  11698. return id
  11699. })
  11700. }
  11701. this.build = m[5] ? m[5].split('.') : []
  11702. this.format()
  11703. }
  11704. SemVer.prototype.format = function () {
  11705. this.version = this.major + '.' + this.minor + '.' + this.patch
  11706. if (this.prerelease.length) {
  11707. this.version += '-' + this.prerelease.join('.')
  11708. }
  11709. return this.version
  11710. }
  11711. SemVer.prototype.toString = function () {
  11712. return this.version
  11713. }
  11714. SemVer.prototype.compare = function (other) {
  11715. debug('SemVer.compare', this.version, this.options, other)
  11716. if (!(other instanceof SemVer)) {
  11717. other = new SemVer(other, this.options)
  11718. }
  11719. return this.compareMain(other) || this.comparePre(other)
  11720. }
  11721. SemVer.prototype.compareMain = function (other) {
  11722. if (!(other instanceof SemVer)) {
  11723. other = new SemVer(other, this.options)
  11724. }
  11725. return compareIdentifiers(this.major, other.major) ||
  11726. compareIdentifiers(this.minor, other.minor) ||
  11727. compareIdentifiers(this.patch, other.patch)
  11728. }
  11729. SemVer.prototype.comparePre = function (other) {
  11730. if (!(other instanceof SemVer)) {
  11731. other = new SemVer(other, this.options)
  11732. }
  11733. // NOT having a prerelease is > having one
  11734. if (this.prerelease.length && !other.prerelease.length) {
  11735. return -1
  11736. } else if (!this.prerelease.length && other.prerelease.length) {
  11737. return 1
  11738. } else if (!this.prerelease.length && !other.prerelease.length) {
  11739. return 0
  11740. }
  11741. var i = 0
  11742. do {
  11743. var a = this.prerelease[i]
  11744. var b = other.prerelease[i]
  11745. debug('prerelease compare', i, a, b)
  11746. if (a === undefined && b === undefined) {
  11747. return 0
  11748. } else if (b === undefined) {
  11749. return 1
  11750. } else if (a === undefined) {
  11751. return -1
  11752. } else if (a === b) {
  11753. continue
  11754. } else {
  11755. return compareIdentifiers(a, b)
  11756. }
  11757. } while (++i)
  11758. }
  11759. SemVer.prototype.compareBuild = function (other) {
  11760. if (!(other instanceof SemVer)) {
  11761. other = new SemVer(other, this.options)
  11762. }
  11763. var i = 0
  11764. do {
  11765. var a = this.build[i]
  11766. var b = other.build[i]
  11767. debug('prerelease compare', i, a, b)
  11768. if (a === undefined && b === undefined) {
  11769. return 0
  11770. } else if (b === undefined) {
  11771. return 1
  11772. } else if (a === undefined) {
  11773. return -1
  11774. } else if (a === b) {
  11775. continue
  11776. } else {
  11777. return compareIdentifiers(a, b)
  11778. }
  11779. } while (++i)
  11780. }
  11781. // preminor will bump the version up to the next minor release, and immediately
  11782. // down to pre-release. premajor and prepatch work the same way.
  11783. SemVer.prototype.inc = function (release, identifier) {
  11784. switch (release) {
  11785. case 'premajor':
  11786. this.prerelease.length = 0
  11787. this.patch = 0
  11788. this.minor = 0
  11789. this.major++
  11790. this.inc('pre', identifier)
  11791. break
  11792. case 'preminor':
  11793. this.prerelease.length = 0
  11794. this.patch = 0
  11795. this.minor++
  11796. this.inc('pre', identifier)
  11797. break
  11798. case 'prepatch':
  11799. // If this is already a prerelease, it will bump to the next version
  11800. // drop any prereleases that might already exist, since they are not
  11801. // relevant at this point.
  11802. this.prerelease.length = 0
  11803. this.inc('patch', identifier)
  11804. this.inc('pre', identifier)
  11805. break
  11806. // If the input is a non-prerelease version, this acts the same as
  11807. // prepatch.
  11808. case 'prerelease':
  11809. if (this.prerelease.length === 0) {
  11810. this.inc('patch', identifier)
  11811. }
  11812. this.inc('pre', identifier)
  11813. break
  11814. case 'major':
  11815. // If this is a pre-major version, bump up to the same major version.
  11816. // Otherwise increment major.
  11817. // 1.0.0-5 bumps to 1.0.0
  11818. // 1.1.0 bumps to 2.0.0
  11819. if (this.minor !== 0 ||
  11820. this.patch !== 0 ||
  11821. this.prerelease.length === 0) {
  11822. this.major++
  11823. }
  11824. this.minor = 0
  11825. this.patch = 0
  11826. this.prerelease = []
  11827. break
  11828. case 'minor':
  11829. // If this is a pre-minor version, bump up to the same minor version.
  11830. // Otherwise increment minor.
  11831. // 1.2.0-5 bumps to 1.2.0
  11832. // 1.2.1 bumps to 1.3.0
  11833. if (this.patch !== 0 || this.prerelease.length === 0) {
  11834. this.minor++
  11835. }
  11836. this.patch = 0
  11837. this.prerelease = []
  11838. break
  11839. case 'patch':
  11840. // If this is not a pre-release version, it will increment the patch.
  11841. // If it is a pre-release it will bump up to the same patch version.
  11842. // 1.2.0-5 patches to 1.2.0
  11843. // 1.2.0 patches to 1.2.1
  11844. if (this.prerelease.length === 0) {
  11845. this.patch++
  11846. }
  11847. this.prerelease = []
  11848. break
  11849. // This probably shouldn't be used publicly.
  11850. // 1.0.0 "pre" would become 1.0.0-0 which is the wrong direction.
  11851. case 'pre':
  11852. if (this.prerelease.length === 0) {
  11853. this.prerelease = [0]
  11854. } else {
  11855. var i = this.prerelease.length
  11856. while (--i >= 0) {
  11857. if (typeof this.prerelease[i] === 'number') {
  11858. this.prerelease[i]++
  11859. i = -2
  11860. }
  11861. }
  11862. if (i === -1) {
  11863. // didn't increment anything
  11864. this.prerelease.push(0)
  11865. }
  11866. }
  11867. if (identifier) {
  11868. // 1.2.0-beta.1 bumps to 1.2.0-beta.2,
  11869. // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0
  11870. if (this.prerelease[0] === identifier) {
  11871. if (isNaN(this.prerelease[1])) {
  11872. this.prerelease = [identifier, 0]
  11873. }
  11874. } else {
  11875. this.prerelease = [identifier, 0]
  11876. }
  11877. }
  11878. break
  11879. default:
  11880. throw new Error('invalid increment argument: ' + release)
  11881. }
  11882. this.format()
  11883. this.raw = this.version
  11884. return this
  11885. }
  11886. exports.inc = inc
  11887. function inc (version, release, loose, identifier) {
  11888. if (typeof (loose) === 'string') {
  11889. identifier = loose
  11890. loose = undefined
  11891. }
  11892. try {
  11893. return new SemVer(version, loose).inc(release, identifier).version
  11894. } catch (er) {
  11895. return null
  11896. }
  11897. }
  11898. exports.diff = diff
  11899. function diff (version1, version2) {
  11900. if (eq(version1, version2)) {
  11901. return null
  11902. } else {
  11903. var v1 = parse(version1)
  11904. var v2 = parse(version2)
  11905. var prefix = ''
  11906. if (v1.prerelease.length || v2.prerelease.length) {
  11907. prefix = 'pre'
  11908. var defaultResult = 'prerelease'
  11909. }
  11910. for (var key in v1) {
  11911. if (key === 'major' || key === 'minor' || key === 'patch') {
  11912. if (v1[key] !== v2[key]) {
  11913. return prefix + key
  11914. }
  11915. }
  11916. }
  11917. return defaultResult // may be undefined
  11918. }
  11919. }
  11920. exports.compareIdentifiers = compareIdentifiers
  11921. var numeric = /^[0-9]+$/
  11922. function compareIdentifiers (a, b) {
  11923. var anum = numeric.test(a)
  11924. var bnum = numeric.test(b)
  11925. if (anum && bnum) {
  11926. a = +a
  11927. b = +b
  11928. }
  11929. return a === b ? 0
  11930. : (anum && !bnum) ? -1
  11931. : (bnum && !anum) ? 1
  11932. : a < b ? -1
  11933. : 1
  11934. }
  11935. exports.rcompareIdentifiers = rcompareIdentifiers
  11936. function rcompareIdentifiers (a, b) {
  11937. return compareIdentifiers(b, a)
  11938. }
  11939. exports.major = major
  11940. function major (a, loose) {
  11941. return new SemVer(a, loose).major
  11942. }
  11943. exports.minor = minor
  11944. function minor (a, loose) {
  11945. return new SemVer(a, loose).minor
  11946. }
  11947. exports.patch = patch
  11948. function patch (a, loose) {
  11949. return new SemVer(a, loose).patch
  11950. }
  11951. exports.compare = compare
  11952. function compare (a, b, loose) {
  11953. return new SemVer(a, loose).compare(new SemVer(b, loose))
  11954. }
  11955. exports.compareLoose = compareLoose
  11956. function compareLoose (a, b) {
  11957. return compare(a, b, true)
  11958. }
  11959. exports.compareBuild = compareBuild
  11960. function compareBuild (a, b, loose) {
  11961. var versionA = new SemVer(a, loose)
  11962. var versionB = new SemVer(b, loose)
  11963. return versionA.compare(versionB) || versionA.compareBuild(versionB)
  11964. }
  11965. exports.rcompare = rcompare
  11966. function rcompare (a, b, loose) {
  11967. return compare(b, a, loose)
  11968. }
  11969. exports.sort = sort
  11970. function sort (list, loose) {
  11971. return list.sort(function (a, b) {
  11972. return exports.compareBuild(a, b, loose)
  11973. })
  11974. }
  11975. exports.rsort = rsort
  11976. function rsort (list, loose) {
  11977. return list.sort(function (a, b) {
  11978. return exports.compareBuild(b, a, loose)
  11979. })
  11980. }
  11981. exports.gt = gt
  11982. function gt (a, b, loose) {
  11983. return compare(a, b, loose) > 0
  11984. }
  11985. exports.lt = lt
  11986. function lt (a, b, loose) {
  11987. return compare(a, b, loose) < 0
  11988. }
  11989. exports.eq = eq
  11990. function eq (a, b, loose) {
  11991. return compare(a, b, loose) === 0
  11992. }
  11993. exports.neq = neq
  11994. function neq (a, b, loose) {
  11995. return compare(a, b, loose) !== 0
  11996. }
  11997. exports.gte = gte
  11998. function gte (a, b, loose) {
  11999. return compare(a, b, loose) >= 0
  12000. }
  12001. exports.lte = lte
  12002. function lte (a, b, loose) {
  12003. return compare(a, b, loose) <= 0
  12004. }
  12005. exports.cmp = cmp
  12006. function cmp (a, op, b, loose) {
  12007. switch (op) {
  12008. case '===':
  12009. if (typeof a === 'object')
  12010. a = a.version
  12011. if (typeof b === 'object')
  12012. b = b.version
  12013. return a === b
  12014. case '!==':
  12015. if (typeof a === 'object')
  12016. a = a.version
  12017. if (typeof b === 'object')
  12018. b = b.version
  12019. return a !== b
  12020. case '':
  12021. case '=':
  12022. case '==':
  12023. return eq(a, b, loose)
  12024. case '!=':
  12025. return neq(a, b, loose)
  12026. case '>':
  12027. return gt(a, b, loose)
  12028. case '>=':
  12029. return gte(a, b, loose)
  12030. case '<':
  12031. return lt(a, b, loose)
  12032. case '<=':
  12033. return lte(a, b, loose)
  12034. default:
  12035. throw new TypeError('Invalid operator: ' + op)
  12036. }
  12037. }
  12038. exports.Comparator = Comparator
  12039. function Comparator (comp, options) {
  12040. if (!options || typeof options !== 'object') {
  12041. options = {
  12042. loose: !!options,
  12043. includePrerelease: false
  12044. }
  12045. }
  12046. if (comp instanceof Comparator) {
  12047. if (comp.loose === !!options.loose) {
  12048. return comp
  12049. } else {
  12050. comp = comp.value
  12051. }
  12052. }
  12053. if (!(this instanceof Comparator)) {
  12054. return new Comparator(comp, options)
  12055. }
  12056. comp = comp.trim().split(/\s+/).join(' ')
  12057. debug('comparator', comp, options)
  12058. this.options = options
  12059. this.loose = !!options.loose
  12060. this.parse(comp)
  12061. if (this.semver === ANY) {
  12062. this.value = ''
  12063. } else {
  12064. this.value = this.operator + this.semver.version
  12065. }
  12066. debug('comp', this)
  12067. }
  12068. var ANY = {}
  12069. Comparator.prototype.parse = function (comp) {
  12070. var r = this.options.loose ? safeRe[t.COMPARATORLOOSE] : safeRe[t.COMPARATOR]
  12071. var m = comp.match(r)
  12072. if (!m) {
  12073. throw new TypeError('Invalid comparator: ' + comp)
  12074. }
  12075. this.operator = m[1] !== undefined ? m[1] : ''
  12076. if (this.operator === '=') {
  12077. this.operator = ''
  12078. }
  12079. // if it literally is just '>' or '' then allow anything.
  12080. if (!m[2]) {
  12081. this.semver = ANY
  12082. } else {
  12083. this.semver = new SemVer(m[2], this.options.loose)
  12084. }
  12085. }
  12086. Comparator.prototype.toString = function () {
  12087. return this.value
  12088. }
  12089. Comparator.prototype.test = function (version) {
  12090. debug('Comparator.test', version, this.options.loose)
  12091. if (this.semver === ANY || version === ANY) {
  12092. return true
  12093. }
  12094. if (typeof version === 'string') {
  12095. try {
  12096. version = new SemVer(version, this.options)
  12097. } catch (er) {
  12098. return false
  12099. }
  12100. }
  12101. return cmp(version, this.operator, this.semver, this.options)
  12102. }
  12103. Comparator.prototype.intersects = function (comp, options) {
  12104. if (!(comp instanceof Comparator)) {
  12105. throw new TypeError('a Comparator is required')
  12106. }
  12107. if (!options || typeof options !== 'object') {
  12108. options = {
  12109. loose: !!options,
  12110. includePrerelease: false
  12111. }
  12112. }
  12113. var rangeTmp
  12114. if (this.operator === '') {
  12115. if (this.value === '') {
  12116. return true
  12117. }
  12118. rangeTmp = new Range(comp.value, options)
  12119. return satisfies(this.value, rangeTmp, options)
  12120. } else if (comp.operator === '') {
  12121. if (comp.value === '') {
  12122. return true
  12123. }
  12124. rangeTmp = new Range(this.value, options)
  12125. return satisfies(comp.semver, rangeTmp, options)
  12126. }
  12127. var sameDirectionIncreasing =
  12128. (this.operator === '>=' || this.operator === '>') &&
  12129. (comp.operator === '>=' || comp.operator === '>')
  12130. var sameDirectionDecreasing =
  12131. (this.operator === '<=' || this.operator === '<') &&
  12132. (comp.operator === '<=' || comp.operator === '<')
  12133. var sameSemVer = this.semver.version === comp.semver.version
  12134. var differentDirectionsInclusive =
  12135. (this.operator === '>=' || this.operator === '<=') &&
  12136. (comp.operator === '>=' || comp.operator === '<=')
  12137. var oppositeDirectionsLessThan =
  12138. cmp(this.semver, '<', comp.semver, options) &&
  12139. ((this.operator === '>=' || this.operator === '>') &&
  12140. (comp.operator === '<=' || comp.operator === '<'))
  12141. var oppositeDirectionsGreaterThan =
  12142. cmp(this.semver, '>', comp.semver, options) &&
  12143. ((this.operator === '<=' || this.operator === '<') &&
  12144. (comp.operator === '>=' || comp.operator === '>'))
  12145. return sameDirectionIncreasing || sameDirectionDecreasing ||
  12146. (sameSemVer && differentDirectionsInclusive) ||
  12147. oppositeDirectionsLessThan || oppositeDirectionsGreaterThan
  12148. }
  12149. exports.Range = Range
  12150. function Range (range, options) {
  12151. if (!options || typeof options !== 'object') {
  12152. options = {
  12153. loose: !!options,
  12154. includePrerelease: false
  12155. }
  12156. }
  12157. if (range instanceof Range) {
  12158. if (range.loose === !!options.loose &&
  12159. range.includePrerelease === !!options.includePrerelease) {
  12160. return range
  12161. } else {
  12162. return new Range(range.raw, options)
  12163. }
  12164. }
  12165. if (range instanceof Comparator) {
  12166. return new Range(range.value, options)
  12167. }
  12168. if (!(this instanceof Range)) {
  12169. return new Range(range, options)
  12170. }
  12171. this.options = options
  12172. this.loose = !!options.loose
  12173. this.includePrerelease = !!options.includePrerelease
  12174. // First reduce all whitespace as much as possible so we do not have to rely
  12175. // on potentially slow regexes like \s*. This is then stored and used for
  12176. // future error messages as well.
  12177. this.raw = range
  12178. .trim()
  12179. .split(/\s+/)
  12180. .join(' ')
  12181. // First, split based on boolean or ||
  12182. this.set = this.raw.split('||').map(function (range) {
  12183. return this.parseRange(range.trim())
  12184. }, this).filter(function (c) {
  12185. // throw out any that are not relevant for whatever reason
  12186. return c.length
  12187. })
  12188. if (!this.set.length) {
  12189. throw new TypeError('Invalid SemVer Range: ' + this.raw)
  12190. }
  12191. this.format()
  12192. }
  12193. Range.prototype.format = function () {
  12194. this.range = this.set.map(function (comps) {
  12195. return comps.join(' ').trim()
  12196. }).join('||').trim()
  12197. return this.range
  12198. }
  12199. Range.prototype.toString = function () {
  12200. return this.range
  12201. }
  12202. Range.prototype.parseRange = function (range) {
  12203. var loose = this.options.loose
  12204. // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`
  12205. var hr = loose ? safeRe[t.HYPHENRANGELOOSE] : safeRe[t.HYPHENRANGE]
  12206. range = range.replace(hr, hyphenReplace)
  12207. debug('hyphen replace', range)
  12208. // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`
  12209. range = range.replace(safeRe[t.COMPARATORTRIM], comparatorTrimReplace)
  12210. debug('comparator trim', range, safeRe[t.COMPARATORTRIM])
  12211. // `~ 1.2.3` => `~1.2.3`
  12212. range = range.replace(safeRe[t.TILDETRIM], tildeTrimReplace)
  12213. // `^ 1.2.3` => `^1.2.3`
  12214. range = range.replace(safeRe[t.CARETTRIM], caretTrimReplace)
  12215. // normalize spaces
  12216. range = range.split(/\s+/).join(' ')
  12217. // At this point, the range is completely trimmed and
  12218. // ready to be split into comparators.
  12219. var compRe = loose ? safeRe[t.COMPARATORLOOSE] : safeRe[t.COMPARATOR]
  12220. var set = range.split(' ').map(function (comp) {
  12221. return parseComparator(comp, this.options)
  12222. }, this).join(' ').split(/\s+/)
  12223. if (this.options.loose) {
  12224. // in loose mode, throw out any that are not valid comparators
  12225. set = set.filter(function (comp) {
  12226. return !!comp.match(compRe)
  12227. })
  12228. }
  12229. set = set.map(function (comp) {
  12230. return new Comparator(comp, this.options)
  12231. }, this)
  12232. return set
  12233. }
  12234. Range.prototype.intersects = function (range, options) {
  12235. if (!(range instanceof Range)) {
  12236. throw new TypeError('a Range is required')
  12237. }
  12238. return this.set.some(function (thisComparators) {
  12239. return (
  12240. isSatisfiable(thisComparators, options) &&
  12241. range.set.some(function (rangeComparators) {
  12242. return (
  12243. isSatisfiable(rangeComparators, options) &&
  12244. thisComparators.every(function (thisComparator) {
  12245. return rangeComparators.every(function (rangeComparator) {
  12246. return thisComparator.intersects(rangeComparator, options)
  12247. })
  12248. })
  12249. )
  12250. })
  12251. )
  12252. })
  12253. }
  12254. // take a set of comparators and determine whether there
  12255. // exists a version which can satisfy it
  12256. function isSatisfiable (comparators, options) {
  12257. var result = true
  12258. var remainingComparators = comparators.slice()
  12259. var testComparator = remainingComparators.pop()
  12260. while (result && remainingComparators.length) {
  12261. result = remainingComparators.every(function (otherComparator) {
  12262. return testComparator.intersects(otherComparator, options)
  12263. })
  12264. testComparator = remainingComparators.pop()
  12265. }
  12266. return result
  12267. }
  12268. // Mostly just for testing and legacy API reasons
  12269. exports.toComparators = toComparators
  12270. function toComparators (range, options) {
  12271. return new Range(range, options).set.map(function (comp) {
  12272. return comp.map(function (c) {
  12273. return c.value
  12274. }).join(' ').trim().split(' ')
  12275. })
  12276. }
  12277. // comprised of xranges, tildes, stars, and gtlt's at this point.
  12278. // already replaced the hyphen ranges
  12279. // turn into a set of JUST comparators.
  12280. function parseComparator (comp, options) {
  12281. debug('comp', comp, options)
  12282. comp = replaceCarets(comp, options)
  12283. debug('caret', comp)
  12284. comp = replaceTildes(comp, options)
  12285. debug('tildes', comp)
  12286. comp = replaceXRanges(comp, options)
  12287. debug('xrange', comp)
  12288. comp = replaceStars(comp, options)
  12289. debug('stars', comp)
  12290. return comp
  12291. }
  12292. function isX (id) {
  12293. return !id || id.toLowerCase() === 'x' || id === '*'
  12294. }
  12295. // ~, ~> --> * (any, kinda silly)
  12296. // ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0
  12297. // ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0
  12298. // ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0
  12299. // ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0
  12300. // ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0
  12301. function replaceTildes (comp, options) {
  12302. return comp.trim().split(/\s+/).map(function (comp) {
  12303. return replaceTilde(comp, options)
  12304. }).join(' ')
  12305. }
  12306. function replaceTilde (comp, options) {
  12307. var r = options.loose ? safeRe[t.TILDELOOSE] : safeRe[t.TILDE]
  12308. return comp.replace(r, function (_, M, m, p, pr) {
  12309. debug('tilde', comp, _, M, m, p, pr)
  12310. var ret
  12311. if (isX(M)) {
  12312. ret = ''
  12313. } else if (isX(m)) {
  12314. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  12315. } else if (isX(p)) {
  12316. // ~1.2 == >=1.2.0 <1.3.0
  12317. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  12318. } else if (pr) {
  12319. debug('replaceTilde pr', pr)
  12320. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  12321. ' <' + M + '.' + (+m + 1) + '.0'
  12322. } else {
  12323. // ~1.2.3 == >=1.2.3 <1.3.0
  12324. ret = '>=' + M + '.' + m + '.' + p +
  12325. ' <' + M + '.' + (+m + 1) + '.0'
  12326. }
  12327. debug('tilde return', ret)
  12328. return ret
  12329. })
  12330. }
  12331. // ^ --> * (any, kinda silly)
  12332. // ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0
  12333. // ^2.0, ^2.0.x --> >=2.0.0 <3.0.0
  12334. // ^1.2, ^1.2.x --> >=1.2.0 <2.0.0
  12335. // ^1.2.3 --> >=1.2.3 <2.0.0
  12336. // ^1.2.0 --> >=1.2.0 <2.0.0
  12337. function replaceCarets (comp, options) {
  12338. return comp.trim().split(/\s+/).map(function (comp) {
  12339. return replaceCaret(comp, options)
  12340. }).join(' ')
  12341. }
  12342. function replaceCaret (comp, options) {
  12343. debug('caret', comp, options)
  12344. var r = options.loose ? safeRe[t.CARETLOOSE] : safeRe[t.CARET]
  12345. return comp.replace(r, function (_, M, m, p, pr) {
  12346. debug('caret', comp, _, M, m, p, pr)
  12347. var ret
  12348. if (isX(M)) {
  12349. ret = ''
  12350. } else if (isX(m)) {
  12351. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  12352. } else if (isX(p)) {
  12353. if (M === '0') {
  12354. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  12355. } else {
  12356. ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0'
  12357. }
  12358. } else if (pr) {
  12359. debug('replaceCaret pr', pr)
  12360. if (M === '0') {
  12361. if (m === '0') {
  12362. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  12363. ' <' + M + '.' + m + '.' + (+p + 1)
  12364. } else {
  12365. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  12366. ' <' + M + '.' + (+m + 1) + '.0'
  12367. }
  12368. } else {
  12369. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  12370. ' <' + (+M + 1) + '.0.0'
  12371. }
  12372. } else {
  12373. debug('no pr')
  12374. if (M === '0') {
  12375. if (m === '0') {
  12376. ret = '>=' + M + '.' + m + '.' + p +
  12377. ' <' + M + '.' + m + '.' + (+p + 1)
  12378. } else {
  12379. ret = '>=' + M + '.' + m + '.' + p +
  12380. ' <' + M + '.' + (+m + 1) + '.0'
  12381. }
  12382. } else {
  12383. ret = '>=' + M + '.' + m + '.' + p +
  12384. ' <' + (+M + 1) + '.0.0'
  12385. }
  12386. }
  12387. debug('caret return', ret)
  12388. return ret
  12389. })
  12390. }
  12391. function replaceXRanges (comp, options) {
  12392. debug('replaceXRanges', comp, options)
  12393. return comp.split(/\s+/).map(function (comp) {
  12394. return replaceXRange(comp, options)
  12395. }).join(' ')
  12396. }
  12397. function replaceXRange (comp, options) {
  12398. comp = comp.trim()
  12399. var r = options.loose ? safeRe[t.XRANGELOOSE] : safeRe[t.XRANGE]
  12400. return comp.replace(r, function (ret, gtlt, M, m, p, pr) {
  12401. debug('xRange', comp, ret, gtlt, M, m, p, pr)
  12402. var xM = isX(M)
  12403. var xm = xM || isX(m)
  12404. var xp = xm || isX(p)
  12405. var anyX = xp
  12406. if (gtlt === '=' && anyX) {
  12407. gtlt = ''
  12408. }
  12409. // if we're including prereleases in the match, then we need
  12410. // to fix this to -0, the lowest possible prerelease value
  12411. pr = options.includePrerelease ? '-0' : ''
  12412. if (xM) {
  12413. if (gtlt === '>' || gtlt === '<') {
  12414. // nothing is allowed
  12415. ret = '<0.0.0-0'
  12416. } else {
  12417. // nothing is forbidden
  12418. ret = '*'
  12419. }
  12420. } else if (gtlt && anyX) {
  12421. // we know patch is an x, because we have any x at all.
  12422. // replace X with 0
  12423. if (xm) {
  12424. m = 0
  12425. }
  12426. p = 0
  12427. if (gtlt === '>') {
  12428. // >1 => >=2.0.0
  12429. // >1.2 => >=1.3.0
  12430. // >1.2.3 => >= 1.2.4
  12431. gtlt = '>='
  12432. if (xm) {
  12433. M = +M + 1
  12434. m = 0
  12435. p = 0
  12436. } else {
  12437. m = +m + 1
  12438. p = 0
  12439. }
  12440. } else if (gtlt === '<=') {
  12441. // <=0.7.x is actually <0.8.0, since any 0.7.x should
  12442. // pass. Similarly, <=7.x is actually <8.0.0, etc.
  12443. gtlt = '<'
  12444. if (xm) {
  12445. M = +M + 1
  12446. } else {
  12447. m = +m + 1
  12448. }
  12449. }
  12450. ret = gtlt + M + '.' + m + '.' + p + pr
  12451. } else if (xm) {
  12452. ret = '>=' + M + '.0.0' + pr + ' <' + (+M + 1) + '.0.0' + pr
  12453. } else if (xp) {
  12454. ret = '>=' + M + '.' + m + '.0' + pr +
  12455. ' <' + M + '.' + (+m + 1) + '.0' + pr
  12456. }
  12457. debug('xRange return', ret)
  12458. return ret
  12459. })
  12460. }
  12461. // Because * is AND-ed with everything else in the comparator,
  12462. // and '' means "any version", just remove the *s entirely.
  12463. function replaceStars (comp, options) {
  12464. debug('replaceStars', comp, options)
  12465. // Looseness is ignored here. star is always as loose as it gets!
  12466. return comp.trim().replace(safeRe[t.STAR], '')
  12467. }
  12468. // This function is passed to string.replace(re[t.HYPHENRANGE])
  12469. // M, m, patch, prerelease, build
  12470. // 1.2 - 3.4.5 => >=1.2.0 <=3.4.5
  12471. // 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do
  12472. // 1.2 - 3.4 => >=1.2.0 <3.5.0
  12473. function hyphenReplace ($0,
  12474. from, fM, fm, fp, fpr, fb,
  12475. to, tM, tm, tp, tpr, tb) {
  12476. if (isX(fM)) {
  12477. from = ''
  12478. } else if (isX(fm)) {
  12479. from = '>=' + fM + '.0.0'
  12480. } else if (isX(fp)) {
  12481. from = '>=' + fM + '.' + fm + '.0'
  12482. } else {
  12483. from = '>=' + from
  12484. }
  12485. if (isX(tM)) {
  12486. to = ''
  12487. } else if (isX(tm)) {
  12488. to = '<' + (+tM + 1) + '.0.0'
  12489. } else if (isX(tp)) {
  12490. to = '<' + tM + '.' + (+tm + 1) + '.0'
  12491. } else if (tpr) {
  12492. to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr
  12493. } else {
  12494. to = '<=' + to
  12495. }
  12496. return (from + ' ' + to).trim()
  12497. }
  12498. // if ANY of the sets match ALL of its comparators, then pass
  12499. Range.prototype.test = function (version) {
  12500. if (!version) {
  12501. return false
  12502. }
  12503. if (typeof version === 'string') {
  12504. try {
  12505. version = new SemVer(version, this.options)
  12506. } catch (er) {
  12507. return false
  12508. }
  12509. }
  12510. for (var i = 0; i < this.set.length; i++) {
  12511. if (testSet(this.set[i], version, this.options)) {
  12512. return true
  12513. }
  12514. }
  12515. return false
  12516. }
  12517. function testSet (set, version, options) {
  12518. for (var i = 0; i < set.length; i++) {
  12519. if (!set[i].test(version)) {
  12520. return false
  12521. }
  12522. }
  12523. if (version.prerelease.length && !options.includePrerelease) {
  12524. // Find the set of versions that are allowed to have prereleases
  12525. // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0
  12526. // That should allow `1.2.3-pr.2` to pass.
  12527. // However, `1.2.4-alpha.notready` should NOT be allowed,
  12528. // even though it's within the range set by the comparators.
  12529. for (i = 0; i < set.length; i++) {
  12530. debug(set[i].semver)
  12531. if (set[i].semver === ANY) {
  12532. continue
  12533. }
  12534. if (set[i].semver.prerelease.length > 0) {
  12535. var allowed = set[i].semver
  12536. if (allowed.major === version.major &&
  12537. allowed.minor === version.minor &&
  12538. allowed.patch === version.patch) {
  12539. return true
  12540. }
  12541. }
  12542. }
  12543. // Version has a -pre, but it's not one of the ones we like.
  12544. return false
  12545. }
  12546. return true
  12547. }
  12548. exports.satisfies = satisfies
  12549. function satisfies (version, range, options) {
  12550. try {
  12551. range = new Range(range, options)
  12552. } catch (er) {
  12553. return false
  12554. }
  12555. return range.test(version)
  12556. }
  12557. exports.maxSatisfying = maxSatisfying
  12558. function maxSatisfying (versions, range, options) {
  12559. var max = null
  12560. var maxSV = null
  12561. try {
  12562. var rangeObj = new Range(range, options)
  12563. } catch (er) {
  12564. return null
  12565. }
  12566. versions.forEach(function (v) {
  12567. if (rangeObj.test(v)) {
  12568. // satisfies(v, range, options)
  12569. if (!max || maxSV.compare(v) === -1) {
  12570. // compare(max, v, true)
  12571. max = v
  12572. maxSV = new SemVer(max, options)
  12573. }
  12574. }
  12575. })
  12576. return max
  12577. }
  12578. exports.minSatisfying = minSatisfying
  12579. function minSatisfying (versions, range, options) {
  12580. var min = null
  12581. var minSV = null
  12582. try {
  12583. var rangeObj = new Range(range, options)
  12584. } catch (er) {
  12585. return null
  12586. }
  12587. versions.forEach(function (v) {
  12588. if (rangeObj.test(v)) {
  12589. // satisfies(v, range, options)
  12590. if (!min || minSV.compare(v) === 1) {
  12591. // compare(min, v, true)
  12592. min = v
  12593. minSV = new SemVer(min, options)
  12594. }
  12595. }
  12596. })
  12597. return min
  12598. }
  12599. exports.minVersion = minVersion
  12600. function minVersion (range, loose) {
  12601. range = new Range(range, loose)
  12602. var minver = new SemVer('0.0.0')
  12603. if (range.test(minver)) {
  12604. return minver
  12605. }
  12606. minver = new SemVer('0.0.0-0')
  12607. if (range.test(minver)) {
  12608. return minver
  12609. }
  12610. minver = null
  12611. for (var i = 0; i < range.set.length; ++i) {
  12612. var comparators = range.set[i]
  12613. comparators.forEach(function (comparator) {
  12614. // Clone to avoid manipulating the comparator's semver object.
  12615. var compver = new SemVer(comparator.semver.version)
  12616. switch (comparator.operator) {
  12617. case '>':
  12618. if (compver.prerelease.length === 0) {
  12619. compver.patch++
  12620. } else {
  12621. compver.prerelease.push(0)
  12622. }
  12623. compver.raw = compver.format()
  12624. /* fallthrough */
  12625. case '':
  12626. case '>=':
  12627. if (!minver || gt(minver, compver)) {
  12628. minver = compver
  12629. }
  12630. break
  12631. case '<':
  12632. case '<=':
  12633. /* Ignore maximum versions */
  12634. break
  12635. /* istanbul ignore next */
  12636. default:
  12637. throw new Error('Unexpected operation: ' + comparator.operator)
  12638. }
  12639. })
  12640. }
  12641. if (minver && range.test(minver)) {
  12642. return minver
  12643. }
  12644. return null
  12645. }
  12646. exports.validRange = validRange
  12647. function validRange (range, options) {
  12648. try {
  12649. // Return '*' instead of '' so that truthiness works.
  12650. // This will throw if it's invalid anyway
  12651. return new Range(range, options).range || '*'
  12652. } catch (er) {
  12653. return null
  12654. }
  12655. }
  12656. // Determine if version is less than all the versions possible in the range
  12657. exports.ltr = ltr
  12658. function ltr (version, range, options) {
  12659. return outside(version, range, '<', options)
  12660. }
  12661. // Determine if version is greater than all the versions possible in the range.
  12662. exports.gtr = gtr
  12663. function gtr (version, range, options) {
  12664. return outside(version, range, '>', options)
  12665. }
  12666. exports.outside = outside
  12667. function outside (version, range, hilo, options) {
  12668. version = new SemVer(version, options)
  12669. range = new Range(range, options)
  12670. var gtfn, ltefn, ltfn, comp, ecomp
  12671. switch (hilo) {
  12672. case '>':
  12673. gtfn = gt
  12674. ltefn = lte
  12675. ltfn = lt
  12676. comp = '>'
  12677. ecomp = '>='
  12678. break
  12679. case '<':
  12680. gtfn = lt
  12681. ltefn = gte
  12682. ltfn = gt
  12683. comp = '<'
  12684. ecomp = '<='
  12685. break
  12686. default:
  12687. throw new TypeError('Must provide a hilo val of "<" or ">"')
  12688. }
  12689. // If it satisifes the range it is not outside
  12690. if (satisfies(version, range, options)) {
  12691. return false
  12692. }
  12693. // From now on, variable terms are as if we're in "gtr" mode.
  12694. // but note that everything is flipped for the "ltr" function.
  12695. for (var i = 0; i < range.set.length; ++i) {
  12696. var comparators = range.set[i]
  12697. var high = null
  12698. var low = null
  12699. comparators.forEach(function (comparator) {
  12700. if (comparator.semver === ANY) {
  12701. comparator = new Comparator('>=0.0.0')
  12702. }
  12703. high = high || comparator
  12704. low = low || comparator
  12705. if (gtfn(comparator.semver, high.semver, options)) {
  12706. high = comparator
  12707. } else if (ltfn(comparator.semver, low.semver, options)) {
  12708. low = comparator
  12709. }
  12710. })
  12711. // If the edge version comparator has a operator then our version
  12712. // isn't outside it
  12713. if (high.operator === comp || high.operator === ecomp) {
  12714. return false
  12715. }
  12716. // If the lowest version comparator has an operator and our version
  12717. // is less than it then it isn't higher than the range
  12718. if ((!low.operator || low.operator === comp) &&
  12719. ltefn(version, low.semver)) {
  12720. return false
  12721. } else if (low.operator === ecomp && ltfn(version, low.semver)) {
  12722. return false
  12723. }
  12724. }
  12725. return true
  12726. }
  12727. exports.prerelease = prerelease
  12728. function prerelease (version, options) {
  12729. var parsed = parse(version, options)
  12730. return (parsed && parsed.prerelease.length) ? parsed.prerelease : null
  12731. }
  12732. exports.intersects = intersects
  12733. function intersects (r1, r2, options) {
  12734. r1 = new Range(r1, options)
  12735. r2 = new Range(r2, options)
  12736. return r1.intersects(r2)
  12737. }
  12738. exports.coerce = coerce
  12739. function coerce (version, options) {
  12740. if (version instanceof SemVer) {
  12741. return version
  12742. }
  12743. if (typeof version === 'number') {
  12744. version = String(version)
  12745. }
  12746. if (typeof version !== 'string') {
  12747. return null
  12748. }
  12749. options = options || {}
  12750. var match = null
  12751. if (!options.rtl) {
  12752. match = version.match(safeRe[t.COERCE])
  12753. } else {
  12754. // Find the right-most coercible string that does not share
  12755. // a terminus with a more left-ward coercible string.
  12756. // Eg, '1.2.3.4' wants to coerce '2.3.4', not '3.4' or '4'
  12757. //
  12758. // Walk through the string checking with a /g regexp
  12759. // Manually set the index so as to pick up overlapping matches.
  12760. // Stop when we get a match that ends at the string end, since no
  12761. // coercible string can be more right-ward without the same terminus.
  12762. var next
  12763. while ((next = safeRe[t.COERCERTL].exec(version)) &&
  12764. (!match || match.index + match[0].length !== version.length)
  12765. ) {
  12766. if (!match ||
  12767. next.index + next[0].length !== match.index + match[0].length) {
  12768. match = next
  12769. }
  12770. safeRe[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length
  12771. }
  12772. // leave it in a clean state
  12773. safeRe[t.COERCERTL].lastIndex = -1
  12774. }
  12775. if (match === null) {
  12776. return null
  12777. }
  12778. return parse(match[2] +
  12779. '.' + (match[3] || '0') +
  12780. '.' + (match[4] || '0'), options)
  12781. }
  12782. /***/ }),
  12783. /***/ 4294:
  12784. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  12785. module.exports = __nccwpck_require__(4219);
  12786. /***/ }),
  12787. /***/ 4219:
  12788. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  12789. "use strict";
  12790. var net = __nccwpck_require__(1808);
  12791. var tls = __nccwpck_require__(4404);
  12792. var http = __nccwpck_require__(3685);
  12793. var https = __nccwpck_require__(5687);
  12794. var events = __nccwpck_require__(2361);
  12795. var assert = __nccwpck_require__(9491);
  12796. var util = __nccwpck_require__(3837);
  12797. exports.httpOverHttp = httpOverHttp;
  12798. exports.httpsOverHttp = httpsOverHttp;
  12799. exports.httpOverHttps = httpOverHttps;
  12800. exports.httpsOverHttps = httpsOverHttps;
  12801. function httpOverHttp(options) {
  12802. var agent = new TunnelingAgent(options);
  12803. agent.request = http.request;
  12804. return agent;
  12805. }
  12806. function httpsOverHttp(options) {
  12807. var agent = new TunnelingAgent(options);
  12808. agent.request = http.request;
  12809. agent.createSocket = createSecureSocket;
  12810. agent.defaultPort = 443;
  12811. return agent;
  12812. }
  12813. function httpOverHttps(options) {
  12814. var agent = new TunnelingAgent(options);
  12815. agent.request = https.request;
  12816. return agent;
  12817. }
  12818. function httpsOverHttps(options) {
  12819. var agent = new TunnelingAgent(options);
  12820. agent.request = https.request;
  12821. agent.createSocket = createSecureSocket;
  12822. agent.defaultPort = 443;
  12823. return agent;
  12824. }
  12825. function TunnelingAgent(options) {
  12826. var self = this;
  12827. self.options = options || {};
  12828. self.proxyOptions = self.options.proxy || {};
  12829. self.maxSockets = self.options.maxSockets || http.Agent.defaultMaxSockets;
  12830. self.requests = [];
  12831. self.sockets = [];
  12832. self.on('free', function onFree(socket, host, port, localAddress) {
  12833. var options = toOptions(host, port, localAddress);
  12834. for (var i = 0, len = self.requests.length; i < len; ++i) {
  12835. var pending = self.requests[i];
  12836. if (pending.host === options.host && pending.port === options.port) {
  12837. // Detect the request to connect same origin server,
  12838. // reuse the connection.
  12839. self.requests.splice(i, 1);
  12840. pending.request.onSocket(socket);
  12841. return;
  12842. }
  12843. }
  12844. socket.destroy();
  12845. self.removeSocket(socket);
  12846. });
  12847. }
  12848. util.inherits(TunnelingAgent, events.EventEmitter);
  12849. TunnelingAgent.prototype.addRequest = function addRequest(req, host, port, localAddress) {
  12850. var self = this;
  12851. var options = mergeOptions({request: req}, self.options, toOptions(host, port, localAddress));
  12852. if (self.sockets.length >= this.maxSockets) {
  12853. // We are over limit so we'll add it to the queue.
  12854. self.requests.push(options);
  12855. return;
  12856. }
  12857. // If we are under maxSockets create a new one.
  12858. self.createSocket(options, function(socket) {
  12859. socket.on('free', onFree);
  12860. socket.on('close', onCloseOrRemove);
  12861. socket.on('agentRemove', onCloseOrRemove);
  12862. req.onSocket(socket);
  12863. function onFree() {
  12864. self.emit('free', socket, options);
  12865. }
  12866. function onCloseOrRemove(err) {
  12867. self.removeSocket(socket);
  12868. socket.removeListener('free', onFree);
  12869. socket.removeListener('close', onCloseOrRemove);
  12870. socket.removeListener('agentRemove', onCloseOrRemove);
  12871. }
  12872. });
  12873. };
  12874. TunnelingAgent.prototype.createSocket = function createSocket(options, cb) {
  12875. var self = this;
  12876. var placeholder = {};
  12877. self.sockets.push(placeholder);
  12878. var connectOptions = mergeOptions({}, self.proxyOptions, {
  12879. method: 'CONNECT',
  12880. path: options.host + ':' + options.port,
  12881. agent: false,
  12882. headers: {
  12883. host: options.host + ':' + options.port
  12884. }
  12885. });
  12886. if (options.localAddress) {
  12887. connectOptions.localAddress = options.localAddress;
  12888. }
  12889. if (connectOptions.proxyAuth) {
  12890. connectOptions.headers = connectOptions.headers || {};
  12891. connectOptions.headers['Proxy-Authorization'] = 'Basic ' +
  12892. new Buffer(connectOptions.proxyAuth).toString('base64');
  12893. }
  12894. debug('making CONNECT request');
  12895. var connectReq = self.request(connectOptions);
  12896. connectReq.useChunkedEncodingByDefault = false; // for v0.6
  12897. connectReq.once('response', onResponse); // for v0.6
  12898. connectReq.once('upgrade', onUpgrade); // for v0.6
  12899. connectReq.once('connect', onConnect); // for v0.7 or later
  12900. connectReq.once('error', onError);
  12901. connectReq.end();
  12902. function onResponse(res) {
  12903. // Very hacky. This is necessary to avoid http-parser leaks.
  12904. res.upgrade = true;
  12905. }
  12906. function onUpgrade(res, socket, head) {
  12907. // Hacky.
  12908. process.nextTick(function() {
  12909. onConnect(res, socket, head);
  12910. });
  12911. }
  12912. function onConnect(res, socket, head) {
  12913. connectReq.removeAllListeners();
  12914. socket.removeAllListeners();
  12915. if (res.statusCode !== 200) {
  12916. debug('tunneling socket could not be established, statusCode=%d',
  12917. res.statusCode);
  12918. socket.destroy();
  12919. var error = new Error('tunneling socket could not be established, ' +
  12920. 'statusCode=' + res.statusCode);
  12921. error.code = 'ECONNRESET';
  12922. options.request.emit('error', error);
  12923. self.removeSocket(placeholder);
  12924. return;
  12925. }
  12926. if (head.length > 0) {
  12927. debug('got illegal response body from proxy');
  12928. socket.destroy();
  12929. var error = new Error('got illegal response body from proxy');
  12930. error.code = 'ECONNRESET';
  12931. options.request.emit('error', error);
  12932. self.removeSocket(placeholder);
  12933. return;
  12934. }
  12935. debug('tunneling connection has established');
  12936. self.sockets[self.sockets.indexOf(placeholder)] = socket;
  12937. return cb(socket);
  12938. }
  12939. function onError(cause) {
  12940. connectReq.removeAllListeners();
  12941. debug('tunneling socket could not be established, cause=%s\n',
  12942. cause.message, cause.stack);
  12943. var error = new Error('tunneling socket could not be established, ' +
  12944. 'cause=' + cause.message);
  12945. error.code = 'ECONNRESET';
  12946. options.request.emit('error', error);
  12947. self.removeSocket(placeholder);
  12948. }
  12949. };
  12950. TunnelingAgent.prototype.removeSocket = function removeSocket(socket) {
  12951. var pos = this.sockets.indexOf(socket)
  12952. if (pos === -1) {
  12953. return;
  12954. }
  12955. this.sockets.splice(pos, 1);
  12956. var pending = this.requests.shift();
  12957. if (pending) {
  12958. // If we have pending requests and a socket gets closed a new one
  12959. // needs to be created to take over in the pool for the one that closed.
  12960. this.createSocket(pending, function(socket) {
  12961. pending.request.onSocket(socket);
  12962. });
  12963. }
  12964. };
  12965. function createSecureSocket(options, cb) {
  12966. var self = this;
  12967. TunnelingAgent.prototype.createSocket.call(self, options, function(socket) {
  12968. var hostHeader = options.request.getHeader('host');
  12969. var tlsOptions = mergeOptions({}, self.options, {
  12970. socket: socket,
  12971. servername: hostHeader ? hostHeader.replace(/:.*$/, '') : options.host
  12972. });
  12973. // 0 is dummy port for v0.6
  12974. var secureSocket = tls.connect(0, tlsOptions);
  12975. self.sockets[self.sockets.indexOf(socket)] = secureSocket;
  12976. cb(secureSocket);
  12977. });
  12978. }
  12979. function toOptions(host, port, localAddress) {
  12980. if (typeof host === 'string') { // since v0.10
  12981. return {
  12982. host: host,
  12983. port: port,
  12984. localAddress: localAddress
  12985. };
  12986. }
  12987. return host; // for v0.11 or later
  12988. }
  12989. function mergeOptions(target) {
  12990. for (var i = 1, len = arguments.length; i < len; ++i) {
  12991. var overrides = arguments[i];
  12992. if (typeof overrides === 'object') {
  12993. var keys = Object.keys(overrides);
  12994. for (var j = 0, keyLen = keys.length; j < keyLen; ++j) {
  12995. var k = keys[j];
  12996. if (overrides[k] !== undefined) {
  12997. target[k] = overrides[k];
  12998. }
  12999. }
  13000. }
  13001. }
  13002. return target;
  13003. }
  13004. var debug;
  13005. if (process.env.NODE_DEBUG && /\btunnel\b/.test(process.env.NODE_DEBUG)) {
  13006. debug = function() {
  13007. var args = Array.prototype.slice.call(arguments);
  13008. if (typeof args[0] === 'string') {
  13009. args[0] = 'TUNNEL: ' + args[0];
  13010. } else {
  13011. args.unshift('TUNNEL:');
  13012. }
  13013. console.error.apply(console, args);
  13014. }
  13015. } else {
  13016. debug = function() {};
  13017. }
  13018. exports.debug = debug; // for test
  13019. /***/ }),
  13020. /***/ 1773:
  13021. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  13022. "use strict";
  13023. const Client = __nccwpck_require__(3598)
  13024. const Dispatcher = __nccwpck_require__(412)
  13025. const errors = __nccwpck_require__(8045)
  13026. const Pool = __nccwpck_require__(4634)
  13027. const BalancedPool = __nccwpck_require__(7931)
  13028. const Agent = __nccwpck_require__(7890)
  13029. const util = __nccwpck_require__(3983)
  13030. const { InvalidArgumentError } = errors
  13031. const api = __nccwpck_require__(4059)
  13032. const buildConnector = __nccwpck_require__(2067)
  13033. const MockClient = __nccwpck_require__(8687)
  13034. const MockAgent = __nccwpck_require__(6771)
  13035. const MockPool = __nccwpck_require__(6193)
  13036. const mockErrors = __nccwpck_require__(888)
  13037. const ProxyAgent = __nccwpck_require__(7858)
  13038. const RetryHandler = __nccwpck_require__(2286)
  13039. const { getGlobalDispatcher, setGlobalDispatcher } = __nccwpck_require__(1892)
  13040. const DecoratorHandler = __nccwpck_require__(6930)
  13041. const RedirectHandler = __nccwpck_require__(2860)
  13042. const createRedirectInterceptor = __nccwpck_require__(8861)
  13043. let hasCrypto
  13044. try {
  13045. __nccwpck_require__(6113)
  13046. hasCrypto = true
  13047. } catch {
  13048. hasCrypto = false
  13049. }
  13050. Object.assign(Dispatcher.prototype, api)
  13051. module.exports.Dispatcher = Dispatcher
  13052. module.exports.Client = Client
  13053. module.exports.Pool = Pool
  13054. module.exports.BalancedPool = BalancedPool
  13055. module.exports.Agent = Agent
  13056. module.exports.ProxyAgent = ProxyAgent
  13057. module.exports.RetryHandler = RetryHandler
  13058. module.exports.DecoratorHandler = DecoratorHandler
  13059. module.exports.RedirectHandler = RedirectHandler
  13060. module.exports.createRedirectInterceptor = createRedirectInterceptor
  13061. module.exports.buildConnector = buildConnector
  13062. module.exports.errors = errors
  13063. function makeDispatcher (fn) {
  13064. return (url, opts, handler) => {
  13065. if (typeof opts === 'function') {
  13066. handler = opts
  13067. opts = null
  13068. }
  13069. if (!url || (typeof url !== 'string' && typeof url !== 'object' && !(url instanceof URL))) {
  13070. throw new InvalidArgumentError('invalid url')
  13071. }
  13072. if (opts != null && typeof opts !== 'object') {
  13073. throw new InvalidArgumentError('invalid opts')
  13074. }
  13075. if (opts && opts.path != null) {
  13076. if (typeof opts.path !== 'string') {
  13077. throw new InvalidArgumentError('invalid opts.path')
  13078. }
  13079. let path = opts.path
  13080. if (!opts.path.startsWith('/')) {
  13081. path = `/${path}`
  13082. }
  13083. url = new URL(util.parseOrigin(url).origin + path)
  13084. } else {
  13085. if (!opts) {
  13086. opts = typeof url === 'object' ? url : {}
  13087. }
  13088. url = util.parseURL(url)
  13089. }
  13090. const { agent, dispatcher = getGlobalDispatcher() } = opts
  13091. if (agent) {
  13092. throw new InvalidArgumentError('unsupported opts.agent. Did you mean opts.client?')
  13093. }
  13094. return fn.call(dispatcher, {
  13095. ...opts,
  13096. origin: url.origin,
  13097. path: url.search ? `${url.pathname}${url.search}` : url.pathname,
  13098. method: opts.method || (opts.body ? 'PUT' : 'GET')
  13099. }, handler)
  13100. }
  13101. }
  13102. module.exports.setGlobalDispatcher = setGlobalDispatcher
  13103. module.exports.getGlobalDispatcher = getGlobalDispatcher
  13104. if (util.nodeMajor > 16 || (util.nodeMajor === 16 && util.nodeMinor >= 8)) {
  13105. let fetchImpl = null
  13106. module.exports.fetch = async function fetch (resource) {
  13107. if (!fetchImpl) {
  13108. fetchImpl = (__nccwpck_require__(4881).fetch)
  13109. }
  13110. try {
  13111. return await fetchImpl(...arguments)
  13112. } catch (err) {
  13113. if (typeof err === 'object') {
  13114. Error.captureStackTrace(err, this)
  13115. }
  13116. throw err
  13117. }
  13118. }
  13119. module.exports.Headers = __nccwpck_require__(554).Headers
  13120. module.exports.Response = __nccwpck_require__(7823).Response
  13121. module.exports.Request = __nccwpck_require__(8359).Request
  13122. module.exports.FormData = __nccwpck_require__(2015).FormData
  13123. module.exports.File = __nccwpck_require__(8511).File
  13124. module.exports.FileReader = __nccwpck_require__(1446).FileReader
  13125. const { setGlobalOrigin, getGlobalOrigin } = __nccwpck_require__(1246)
  13126. module.exports.setGlobalOrigin = setGlobalOrigin
  13127. module.exports.getGlobalOrigin = getGlobalOrigin
  13128. const { CacheStorage } = __nccwpck_require__(7907)
  13129. const { kConstruct } = __nccwpck_require__(9174)
  13130. // Cache & CacheStorage are tightly coupled with fetch. Even if it may run
  13131. // in an older version of Node, it doesn't have any use without fetch.
  13132. module.exports.caches = new CacheStorage(kConstruct)
  13133. }
  13134. if (util.nodeMajor >= 16) {
  13135. const { deleteCookie, getCookies, getSetCookies, setCookie } = __nccwpck_require__(1724)
  13136. module.exports.deleteCookie = deleteCookie
  13137. module.exports.getCookies = getCookies
  13138. module.exports.getSetCookies = getSetCookies
  13139. module.exports.setCookie = setCookie
  13140. const { parseMIMEType, serializeAMimeType } = __nccwpck_require__(685)
  13141. module.exports.parseMIMEType = parseMIMEType
  13142. module.exports.serializeAMimeType = serializeAMimeType
  13143. }
  13144. if (util.nodeMajor >= 18 && hasCrypto) {
  13145. const { WebSocket } = __nccwpck_require__(4284)
  13146. module.exports.WebSocket = WebSocket
  13147. }
  13148. module.exports.request = makeDispatcher(api.request)
  13149. module.exports.stream = makeDispatcher(api.stream)
  13150. module.exports.pipeline = makeDispatcher(api.pipeline)
  13151. module.exports.connect = makeDispatcher(api.connect)
  13152. module.exports.upgrade = makeDispatcher(api.upgrade)
  13153. module.exports.MockClient = MockClient
  13154. module.exports.MockPool = MockPool
  13155. module.exports.MockAgent = MockAgent
  13156. module.exports.mockErrors = mockErrors
  13157. /***/ }),
  13158. /***/ 7890:
  13159. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  13160. "use strict";
  13161. const { InvalidArgumentError } = __nccwpck_require__(8045)
  13162. const { kClients, kRunning, kClose, kDestroy, kDispatch, kInterceptors } = __nccwpck_require__(2785)
  13163. const DispatcherBase = __nccwpck_require__(4839)
  13164. const Pool = __nccwpck_require__(4634)
  13165. const Client = __nccwpck_require__(3598)
  13166. const util = __nccwpck_require__(3983)
  13167. const createRedirectInterceptor = __nccwpck_require__(8861)
  13168. const { WeakRef, FinalizationRegistry } = __nccwpck_require__(6436)()
  13169. const kOnConnect = Symbol('onConnect')
  13170. const kOnDisconnect = Symbol('onDisconnect')
  13171. const kOnConnectionError = Symbol('onConnectionError')
  13172. const kMaxRedirections = Symbol('maxRedirections')
  13173. const kOnDrain = Symbol('onDrain')
  13174. const kFactory = Symbol('factory')
  13175. const kFinalizer = Symbol('finalizer')
  13176. const kOptions = Symbol('options')
  13177. function defaultFactory (origin, opts) {
  13178. return opts && opts.connections === 1
  13179. ? new Client(origin, opts)
  13180. : new Pool(origin, opts)
  13181. }
  13182. class Agent extends DispatcherBase {
  13183. constructor ({ factory = defaultFactory, maxRedirections = 0, connect, ...options } = {}) {
  13184. super()
  13185. if (typeof factory !== 'function') {
  13186. throw new InvalidArgumentError('factory must be a function.')
  13187. }
  13188. if (connect != null && typeof connect !== 'function' && typeof connect !== 'object') {
  13189. throw new InvalidArgumentError('connect must be a function or an object')
  13190. }
  13191. if (!Number.isInteger(maxRedirections) || maxRedirections < 0) {
  13192. throw new InvalidArgumentError('maxRedirections must be a positive number')
  13193. }
  13194. if (connect && typeof connect !== 'function') {
  13195. connect = { ...connect }
  13196. }
  13197. this[kInterceptors] = options.interceptors && options.interceptors.Agent && Array.isArray(options.interceptors.Agent)
  13198. ? options.interceptors.Agent
  13199. : [createRedirectInterceptor({ maxRedirections })]
  13200. this[kOptions] = { ...util.deepClone(options), connect }
  13201. this[kOptions].interceptors = options.interceptors
  13202. ? { ...options.interceptors }
  13203. : undefined
  13204. this[kMaxRedirections] = maxRedirections
  13205. this[kFactory] = factory
  13206. this[kClients] = new Map()
  13207. this[kFinalizer] = new FinalizationRegistry(/* istanbul ignore next: gc is undeterministic */ key => {
  13208. const ref = this[kClients].get(key)
  13209. if (ref !== undefined && ref.deref() === undefined) {
  13210. this[kClients].delete(key)
  13211. }
  13212. })
  13213. const agent = this
  13214. this[kOnDrain] = (origin, targets) => {
  13215. agent.emit('drain', origin, [agent, ...targets])
  13216. }
  13217. this[kOnConnect] = (origin, targets) => {
  13218. agent.emit('connect', origin, [agent, ...targets])
  13219. }
  13220. this[kOnDisconnect] = (origin, targets, err) => {
  13221. agent.emit('disconnect', origin, [agent, ...targets], err)
  13222. }
  13223. this[kOnConnectionError] = (origin, targets, err) => {
  13224. agent.emit('connectionError', origin, [agent, ...targets], err)
  13225. }
  13226. }
  13227. get [kRunning] () {
  13228. let ret = 0
  13229. for (const ref of this[kClients].values()) {
  13230. const client = ref.deref()
  13231. /* istanbul ignore next: gc is undeterministic */
  13232. if (client) {
  13233. ret += client[kRunning]
  13234. }
  13235. }
  13236. return ret
  13237. }
  13238. [kDispatch] (opts, handler) {
  13239. let key
  13240. if (opts.origin && (typeof opts.origin === 'string' || opts.origin instanceof URL)) {
  13241. key = String(opts.origin)
  13242. } else {
  13243. throw new InvalidArgumentError('opts.origin must be a non-empty string or URL.')
  13244. }
  13245. const ref = this[kClients].get(key)
  13246. let dispatcher = ref ? ref.deref() : null
  13247. if (!dispatcher) {
  13248. dispatcher = this[kFactory](opts.origin, this[kOptions])
  13249. .on('drain', this[kOnDrain])
  13250. .on('connect', this[kOnConnect])
  13251. .on('disconnect', this[kOnDisconnect])
  13252. .on('connectionError', this[kOnConnectionError])
  13253. this[kClients].set(key, new WeakRef(dispatcher))
  13254. this[kFinalizer].register(dispatcher, key)
  13255. }
  13256. return dispatcher.dispatch(opts, handler)
  13257. }
  13258. async [kClose] () {
  13259. const closePromises = []
  13260. for (const ref of this[kClients].values()) {
  13261. const client = ref.deref()
  13262. /* istanbul ignore else: gc is undeterministic */
  13263. if (client) {
  13264. closePromises.push(client.close())
  13265. }
  13266. }
  13267. await Promise.all(closePromises)
  13268. }
  13269. async [kDestroy] (err) {
  13270. const destroyPromises = []
  13271. for (const ref of this[kClients].values()) {
  13272. const client = ref.deref()
  13273. /* istanbul ignore else: gc is undeterministic */
  13274. if (client) {
  13275. destroyPromises.push(client.destroy(err))
  13276. }
  13277. }
  13278. await Promise.all(destroyPromises)
  13279. }
  13280. }
  13281. module.exports = Agent
  13282. /***/ }),
  13283. /***/ 7032:
  13284. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  13285. const { addAbortListener } = __nccwpck_require__(3983)
  13286. const { RequestAbortedError } = __nccwpck_require__(8045)
  13287. const kListener = Symbol('kListener')
  13288. const kSignal = Symbol('kSignal')
  13289. function abort (self) {
  13290. if (self.abort) {
  13291. self.abort()
  13292. } else {
  13293. self.onError(new RequestAbortedError())
  13294. }
  13295. }
  13296. function addSignal (self, signal) {
  13297. self[kSignal] = null
  13298. self[kListener] = null
  13299. if (!signal) {
  13300. return
  13301. }
  13302. if (signal.aborted) {
  13303. abort(self)
  13304. return
  13305. }
  13306. self[kSignal] = signal
  13307. self[kListener] = () => {
  13308. abort(self)
  13309. }
  13310. addAbortListener(self[kSignal], self[kListener])
  13311. }
  13312. function removeSignal (self) {
  13313. if (!self[kSignal]) {
  13314. return
  13315. }
  13316. if ('removeEventListener' in self[kSignal]) {
  13317. self[kSignal].removeEventListener('abort', self[kListener])
  13318. } else {
  13319. self[kSignal].removeListener('abort', self[kListener])
  13320. }
  13321. self[kSignal] = null
  13322. self[kListener] = null
  13323. }
  13324. module.exports = {
  13325. addSignal,
  13326. removeSignal
  13327. }
  13328. /***/ }),
  13329. /***/ 9744:
  13330. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  13331. "use strict";
  13332. const { AsyncResource } = __nccwpck_require__(852)
  13333. const { InvalidArgumentError, RequestAbortedError, SocketError } = __nccwpck_require__(8045)
  13334. const util = __nccwpck_require__(3983)
  13335. const { addSignal, removeSignal } = __nccwpck_require__(7032)
  13336. class ConnectHandler extends AsyncResource {
  13337. constructor (opts, callback) {
  13338. if (!opts || typeof opts !== 'object') {
  13339. throw new InvalidArgumentError('invalid opts')
  13340. }
  13341. if (typeof callback !== 'function') {
  13342. throw new InvalidArgumentError('invalid callback')
  13343. }
  13344. const { signal, opaque, responseHeaders } = opts
  13345. if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') {
  13346. throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget')
  13347. }
  13348. super('UNDICI_CONNECT')
  13349. this.opaque = opaque || null
  13350. this.responseHeaders = responseHeaders || null
  13351. this.callback = callback
  13352. this.abort = null
  13353. addSignal(this, signal)
  13354. }
  13355. onConnect (abort, context) {
  13356. if (!this.callback) {
  13357. throw new RequestAbortedError()
  13358. }
  13359. this.abort = abort
  13360. this.context = context
  13361. }
  13362. onHeaders () {
  13363. throw new SocketError('bad connect', null)
  13364. }
  13365. onUpgrade (statusCode, rawHeaders, socket) {
  13366. const { callback, opaque, context } = this
  13367. removeSignal(this)
  13368. this.callback = null
  13369. let headers = rawHeaders
  13370. // Indicates is an HTTP2Session
  13371. if (headers != null) {
  13372. headers = this.responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)
  13373. }
  13374. this.runInAsyncScope(callback, null, null, {
  13375. statusCode,
  13376. headers,
  13377. socket,
  13378. opaque,
  13379. context
  13380. })
  13381. }
  13382. onError (err) {
  13383. const { callback, opaque } = this
  13384. removeSignal(this)
  13385. if (callback) {
  13386. this.callback = null
  13387. queueMicrotask(() => {
  13388. this.runInAsyncScope(callback, null, err, { opaque })
  13389. })
  13390. }
  13391. }
  13392. }
  13393. function connect (opts, callback) {
  13394. if (callback === undefined) {
  13395. return new Promise((resolve, reject) => {
  13396. connect.call(this, opts, (err, data) => {
  13397. return err ? reject(err) : resolve(data)
  13398. })
  13399. })
  13400. }
  13401. try {
  13402. const connectHandler = new ConnectHandler(opts, callback)
  13403. this.dispatch({ ...opts, method: 'CONNECT' }, connectHandler)
  13404. } catch (err) {
  13405. if (typeof callback !== 'function') {
  13406. throw err
  13407. }
  13408. const opaque = opts && opts.opaque
  13409. queueMicrotask(() => callback(err, { opaque }))
  13410. }
  13411. }
  13412. module.exports = connect
  13413. /***/ }),
  13414. /***/ 8752:
  13415. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  13416. "use strict";
  13417. const {
  13418. Readable,
  13419. Duplex,
  13420. PassThrough
  13421. } = __nccwpck_require__(2781)
  13422. const {
  13423. InvalidArgumentError,
  13424. InvalidReturnValueError,
  13425. RequestAbortedError
  13426. } = __nccwpck_require__(8045)
  13427. const util = __nccwpck_require__(3983)
  13428. const { AsyncResource } = __nccwpck_require__(852)
  13429. const { addSignal, removeSignal } = __nccwpck_require__(7032)
  13430. const assert = __nccwpck_require__(9491)
  13431. const kResume = Symbol('resume')
  13432. class PipelineRequest extends Readable {
  13433. constructor () {
  13434. super({ autoDestroy: true })
  13435. this[kResume] = null
  13436. }
  13437. _read () {
  13438. const { [kResume]: resume } = this
  13439. if (resume) {
  13440. this[kResume] = null
  13441. resume()
  13442. }
  13443. }
  13444. _destroy (err, callback) {
  13445. this._read()
  13446. callback(err)
  13447. }
  13448. }
  13449. class PipelineResponse extends Readable {
  13450. constructor (resume) {
  13451. super({ autoDestroy: true })
  13452. this[kResume] = resume
  13453. }
  13454. _read () {
  13455. this[kResume]()
  13456. }
  13457. _destroy (err, callback) {
  13458. if (!err && !this._readableState.endEmitted) {
  13459. err = new RequestAbortedError()
  13460. }
  13461. callback(err)
  13462. }
  13463. }
  13464. class PipelineHandler extends AsyncResource {
  13465. constructor (opts, handler) {
  13466. if (!opts || typeof opts !== 'object') {
  13467. throw new InvalidArgumentError('invalid opts')
  13468. }
  13469. if (typeof handler !== 'function') {
  13470. throw new InvalidArgumentError('invalid handler')
  13471. }
  13472. const { signal, method, opaque, onInfo, responseHeaders } = opts
  13473. if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') {
  13474. throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget')
  13475. }
  13476. if (method === 'CONNECT') {
  13477. throw new InvalidArgumentError('invalid method')
  13478. }
  13479. if (onInfo && typeof onInfo !== 'function') {
  13480. throw new InvalidArgumentError('invalid onInfo callback')
  13481. }
  13482. super('UNDICI_PIPELINE')
  13483. this.opaque = opaque || null
  13484. this.responseHeaders = responseHeaders || null
  13485. this.handler = handler
  13486. this.abort = null
  13487. this.context = null
  13488. this.onInfo = onInfo || null
  13489. this.req = new PipelineRequest().on('error', util.nop)
  13490. this.ret = new Duplex({
  13491. readableObjectMode: opts.objectMode,
  13492. autoDestroy: true,
  13493. read: () => {
  13494. const { body } = this
  13495. if (body && body.resume) {
  13496. body.resume()
  13497. }
  13498. },
  13499. write: (chunk, encoding, callback) => {
  13500. const { req } = this
  13501. if (req.push(chunk, encoding) || req._readableState.destroyed) {
  13502. callback()
  13503. } else {
  13504. req[kResume] = callback
  13505. }
  13506. },
  13507. destroy: (err, callback) => {
  13508. const { body, req, res, ret, abort } = this
  13509. if (!err && !ret._readableState.endEmitted) {
  13510. err = new RequestAbortedError()
  13511. }
  13512. if (abort && err) {
  13513. abort()
  13514. }
  13515. util.destroy(body, err)
  13516. util.destroy(req, err)
  13517. util.destroy(res, err)
  13518. removeSignal(this)
  13519. callback(err)
  13520. }
  13521. }).on('prefinish', () => {
  13522. const { req } = this
  13523. // Node < 15 does not call _final in same tick.
  13524. req.push(null)
  13525. })
  13526. this.res = null
  13527. addSignal(this, signal)
  13528. }
  13529. onConnect (abort, context) {
  13530. const { ret, res } = this
  13531. assert(!res, 'pipeline cannot be retried')
  13532. if (ret.destroyed) {
  13533. throw new RequestAbortedError()
  13534. }
  13535. this.abort = abort
  13536. this.context = context
  13537. }
  13538. onHeaders (statusCode, rawHeaders, resume) {
  13539. const { opaque, handler, context } = this
  13540. if (statusCode < 200) {
  13541. if (this.onInfo) {
  13542. const headers = this.responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)
  13543. this.onInfo({ statusCode, headers })
  13544. }
  13545. return
  13546. }
  13547. this.res = new PipelineResponse(resume)
  13548. let body
  13549. try {
  13550. this.handler = null
  13551. const headers = this.responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)
  13552. body = this.runInAsyncScope(handler, null, {
  13553. statusCode,
  13554. headers,
  13555. opaque,
  13556. body: this.res,
  13557. context
  13558. })
  13559. } catch (err) {
  13560. this.res.on('error', util.nop)
  13561. throw err
  13562. }
  13563. if (!body || typeof body.on !== 'function') {
  13564. throw new InvalidReturnValueError('expected Readable')
  13565. }
  13566. body
  13567. .on('data', (chunk) => {
  13568. const { ret, body } = this
  13569. if (!ret.push(chunk) && body.pause) {
  13570. body.pause()
  13571. }
  13572. })
  13573. .on('error', (err) => {
  13574. const { ret } = this
  13575. util.destroy(ret, err)
  13576. })
  13577. .on('end', () => {
  13578. const { ret } = this
  13579. ret.push(null)
  13580. })
  13581. .on('close', () => {
  13582. const { ret } = this
  13583. if (!ret._readableState.ended) {
  13584. util.destroy(ret, new RequestAbortedError())
  13585. }
  13586. })
  13587. this.body = body
  13588. }
  13589. onData (chunk) {
  13590. const { res } = this
  13591. return res.push(chunk)
  13592. }
  13593. onComplete (trailers) {
  13594. const { res } = this
  13595. res.push(null)
  13596. }
  13597. onError (err) {
  13598. const { ret } = this
  13599. this.handler = null
  13600. util.destroy(ret, err)
  13601. }
  13602. }
  13603. function pipeline (opts, handler) {
  13604. try {
  13605. const pipelineHandler = new PipelineHandler(opts, handler)
  13606. this.dispatch({ ...opts, body: pipelineHandler.req }, pipelineHandler)
  13607. return pipelineHandler.ret
  13608. } catch (err) {
  13609. return new PassThrough().destroy(err)
  13610. }
  13611. }
  13612. module.exports = pipeline
  13613. /***/ }),
  13614. /***/ 5448:
  13615. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  13616. "use strict";
  13617. const Readable = __nccwpck_require__(3858)
  13618. const {
  13619. InvalidArgumentError,
  13620. RequestAbortedError
  13621. } = __nccwpck_require__(8045)
  13622. const util = __nccwpck_require__(3983)
  13623. const { getResolveErrorBodyCallback } = __nccwpck_require__(7474)
  13624. const { AsyncResource } = __nccwpck_require__(852)
  13625. const { addSignal, removeSignal } = __nccwpck_require__(7032)
  13626. class RequestHandler extends AsyncResource {
  13627. constructor (opts, callback) {
  13628. if (!opts || typeof opts !== 'object') {
  13629. throw new InvalidArgumentError('invalid opts')
  13630. }
  13631. const { signal, method, opaque, body, onInfo, responseHeaders, throwOnError, highWaterMark } = opts
  13632. try {
  13633. if (typeof callback !== 'function') {
  13634. throw new InvalidArgumentError('invalid callback')
  13635. }
  13636. if (highWaterMark && (typeof highWaterMark !== 'number' || highWaterMark < 0)) {
  13637. throw new InvalidArgumentError('invalid highWaterMark')
  13638. }
  13639. if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') {
  13640. throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget')
  13641. }
  13642. if (method === 'CONNECT') {
  13643. throw new InvalidArgumentError('invalid method')
  13644. }
  13645. if (onInfo && typeof onInfo !== 'function') {
  13646. throw new InvalidArgumentError('invalid onInfo callback')
  13647. }
  13648. super('UNDICI_REQUEST')
  13649. } catch (err) {
  13650. if (util.isStream(body)) {
  13651. util.destroy(body.on('error', util.nop), err)
  13652. }
  13653. throw err
  13654. }
  13655. this.responseHeaders = responseHeaders || null
  13656. this.opaque = opaque || null
  13657. this.callback = callback
  13658. this.res = null
  13659. this.abort = null
  13660. this.body = body
  13661. this.trailers = {}
  13662. this.context = null
  13663. this.onInfo = onInfo || null
  13664. this.throwOnError = throwOnError
  13665. this.highWaterMark = highWaterMark
  13666. if (util.isStream(body)) {
  13667. body.on('error', (err) => {
  13668. this.onError(err)
  13669. })
  13670. }
  13671. addSignal(this, signal)
  13672. }
  13673. onConnect (abort, context) {
  13674. if (!this.callback) {
  13675. throw new RequestAbortedError()
  13676. }
  13677. this.abort = abort
  13678. this.context = context
  13679. }
  13680. onHeaders (statusCode, rawHeaders, resume, statusMessage) {
  13681. const { callback, opaque, abort, context, responseHeaders, highWaterMark } = this
  13682. const headers = responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)
  13683. if (statusCode < 200) {
  13684. if (this.onInfo) {
  13685. this.onInfo({ statusCode, headers })
  13686. }
  13687. return
  13688. }
  13689. const parsedHeaders = responseHeaders === 'raw' ? util.parseHeaders(rawHeaders) : headers
  13690. const contentType = parsedHeaders['content-type']
  13691. const body = new Readable({ resume, abort, contentType, highWaterMark })
  13692. this.callback = null
  13693. this.res = body
  13694. if (callback !== null) {
  13695. if (this.throwOnError && statusCode >= 400) {
  13696. this.runInAsyncScope(getResolveErrorBodyCallback, null,
  13697. { callback, body, contentType, statusCode, statusMessage, headers }
  13698. )
  13699. } else {
  13700. this.runInAsyncScope(callback, null, null, {
  13701. statusCode,
  13702. headers,
  13703. trailers: this.trailers,
  13704. opaque,
  13705. body,
  13706. context
  13707. })
  13708. }
  13709. }
  13710. }
  13711. onData (chunk) {
  13712. const { res } = this
  13713. return res.push(chunk)
  13714. }
  13715. onComplete (trailers) {
  13716. const { res } = this
  13717. removeSignal(this)
  13718. util.parseHeaders(trailers, this.trailers)
  13719. res.push(null)
  13720. }
  13721. onError (err) {
  13722. const { res, callback, body, opaque } = this
  13723. removeSignal(this)
  13724. if (callback) {
  13725. // TODO: Does this need queueMicrotask?
  13726. this.callback = null
  13727. queueMicrotask(() => {
  13728. this.runInAsyncScope(callback, null, err, { opaque })
  13729. })
  13730. }
  13731. if (res) {
  13732. this.res = null
  13733. // Ensure all queued handlers are invoked before destroying res.
  13734. queueMicrotask(() => {
  13735. util.destroy(res, err)
  13736. })
  13737. }
  13738. if (body) {
  13739. this.body = null
  13740. util.destroy(body, err)
  13741. }
  13742. }
  13743. }
  13744. function request (opts, callback) {
  13745. if (callback === undefined) {
  13746. return new Promise((resolve, reject) => {
  13747. request.call(this, opts, (err, data) => {
  13748. return err ? reject(err) : resolve(data)
  13749. })
  13750. })
  13751. }
  13752. try {
  13753. this.dispatch(opts, new RequestHandler(opts, callback))
  13754. } catch (err) {
  13755. if (typeof callback !== 'function') {
  13756. throw err
  13757. }
  13758. const opaque = opts && opts.opaque
  13759. queueMicrotask(() => callback(err, { opaque }))
  13760. }
  13761. }
  13762. module.exports = request
  13763. module.exports.RequestHandler = RequestHandler
  13764. /***/ }),
  13765. /***/ 5395:
  13766. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  13767. "use strict";
  13768. const { finished, PassThrough } = __nccwpck_require__(2781)
  13769. const {
  13770. InvalidArgumentError,
  13771. InvalidReturnValueError,
  13772. RequestAbortedError
  13773. } = __nccwpck_require__(8045)
  13774. const util = __nccwpck_require__(3983)
  13775. const { getResolveErrorBodyCallback } = __nccwpck_require__(7474)
  13776. const { AsyncResource } = __nccwpck_require__(852)
  13777. const { addSignal, removeSignal } = __nccwpck_require__(7032)
  13778. class StreamHandler extends AsyncResource {
  13779. constructor (opts, factory, callback) {
  13780. if (!opts || typeof opts !== 'object') {
  13781. throw new InvalidArgumentError('invalid opts')
  13782. }
  13783. const { signal, method, opaque, body, onInfo, responseHeaders, throwOnError } = opts
  13784. try {
  13785. if (typeof callback !== 'function') {
  13786. throw new InvalidArgumentError('invalid callback')
  13787. }
  13788. if (typeof factory !== 'function') {
  13789. throw new InvalidArgumentError('invalid factory')
  13790. }
  13791. if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') {
  13792. throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget')
  13793. }
  13794. if (method === 'CONNECT') {
  13795. throw new InvalidArgumentError('invalid method')
  13796. }
  13797. if (onInfo && typeof onInfo !== 'function') {
  13798. throw new InvalidArgumentError('invalid onInfo callback')
  13799. }
  13800. super('UNDICI_STREAM')
  13801. } catch (err) {
  13802. if (util.isStream(body)) {
  13803. util.destroy(body.on('error', util.nop), err)
  13804. }
  13805. throw err
  13806. }
  13807. this.responseHeaders = responseHeaders || null
  13808. this.opaque = opaque || null
  13809. this.factory = factory
  13810. this.callback = callback
  13811. this.res = null
  13812. this.abort = null
  13813. this.context = null
  13814. this.trailers = null
  13815. this.body = body
  13816. this.onInfo = onInfo || null
  13817. this.throwOnError = throwOnError || false
  13818. if (util.isStream(body)) {
  13819. body.on('error', (err) => {
  13820. this.onError(err)
  13821. })
  13822. }
  13823. addSignal(this, signal)
  13824. }
  13825. onConnect (abort, context) {
  13826. if (!this.callback) {
  13827. throw new RequestAbortedError()
  13828. }
  13829. this.abort = abort
  13830. this.context = context
  13831. }
  13832. onHeaders (statusCode, rawHeaders, resume, statusMessage) {
  13833. const { factory, opaque, context, callback, responseHeaders } = this
  13834. const headers = responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)
  13835. if (statusCode < 200) {
  13836. if (this.onInfo) {
  13837. this.onInfo({ statusCode, headers })
  13838. }
  13839. return
  13840. }
  13841. this.factory = null
  13842. let res
  13843. if (this.throwOnError && statusCode >= 400) {
  13844. const parsedHeaders = responseHeaders === 'raw' ? util.parseHeaders(rawHeaders) : headers
  13845. const contentType = parsedHeaders['content-type']
  13846. res = new PassThrough()
  13847. this.callback = null
  13848. this.runInAsyncScope(getResolveErrorBodyCallback, null,
  13849. { callback, body: res, contentType, statusCode, statusMessage, headers }
  13850. )
  13851. } else {
  13852. if (factory === null) {
  13853. return
  13854. }
  13855. res = this.runInAsyncScope(factory, null, {
  13856. statusCode,
  13857. headers,
  13858. opaque,
  13859. context
  13860. })
  13861. if (
  13862. !res ||
  13863. typeof res.write !== 'function' ||
  13864. typeof res.end !== 'function' ||
  13865. typeof res.on !== 'function'
  13866. ) {
  13867. throw new InvalidReturnValueError('expected Writable')
  13868. }
  13869. // TODO: Avoid finished. It registers an unnecessary amount of listeners.
  13870. finished(res, { readable: false }, (err) => {
  13871. const { callback, res, opaque, trailers, abort } = this
  13872. this.res = null
  13873. if (err || !res.readable) {
  13874. util.destroy(res, err)
  13875. }
  13876. this.callback = null
  13877. this.runInAsyncScope(callback, null, err || null, { opaque, trailers })
  13878. if (err) {
  13879. abort()
  13880. }
  13881. })
  13882. }
  13883. res.on('drain', resume)
  13884. this.res = res
  13885. const needDrain = res.writableNeedDrain !== undefined
  13886. ? res.writableNeedDrain
  13887. : res._writableState && res._writableState.needDrain
  13888. return needDrain !== true
  13889. }
  13890. onData (chunk) {
  13891. const { res } = this
  13892. return res ? res.write(chunk) : true
  13893. }
  13894. onComplete (trailers) {
  13895. const { res } = this
  13896. removeSignal(this)
  13897. if (!res) {
  13898. return
  13899. }
  13900. this.trailers = util.parseHeaders(trailers)
  13901. res.end()
  13902. }
  13903. onError (err) {
  13904. const { res, callback, opaque, body } = this
  13905. removeSignal(this)
  13906. this.factory = null
  13907. if (res) {
  13908. this.res = null
  13909. util.destroy(res, err)
  13910. } else if (callback) {
  13911. this.callback = null
  13912. queueMicrotask(() => {
  13913. this.runInAsyncScope(callback, null, err, { opaque })
  13914. })
  13915. }
  13916. if (body) {
  13917. this.body = null
  13918. util.destroy(body, err)
  13919. }
  13920. }
  13921. }
  13922. function stream (opts, factory, callback) {
  13923. if (callback === undefined) {
  13924. return new Promise((resolve, reject) => {
  13925. stream.call(this, opts, factory, (err, data) => {
  13926. return err ? reject(err) : resolve(data)
  13927. })
  13928. })
  13929. }
  13930. try {
  13931. this.dispatch(opts, new StreamHandler(opts, factory, callback))
  13932. } catch (err) {
  13933. if (typeof callback !== 'function') {
  13934. throw err
  13935. }
  13936. const opaque = opts && opts.opaque
  13937. queueMicrotask(() => callback(err, { opaque }))
  13938. }
  13939. }
  13940. module.exports = stream
  13941. /***/ }),
  13942. /***/ 6923:
  13943. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  13944. "use strict";
  13945. const { InvalidArgumentError, RequestAbortedError, SocketError } = __nccwpck_require__(8045)
  13946. const { AsyncResource } = __nccwpck_require__(852)
  13947. const util = __nccwpck_require__(3983)
  13948. const { addSignal, removeSignal } = __nccwpck_require__(7032)
  13949. const assert = __nccwpck_require__(9491)
  13950. class UpgradeHandler extends AsyncResource {
  13951. constructor (opts, callback) {
  13952. if (!opts || typeof opts !== 'object') {
  13953. throw new InvalidArgumentError('invalid opts')
  13954. }
  13955. if (typeof callback !== 'function') {
  13956. throw new InvalidArgumentError('invalid callback')
  13957. }
  13958. const { signal, opaque, responseHeaders } = opts
  13959. if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') {
  13960. throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget')
  13961. }
  13962. super('UNDICI_UPGRADE')
  13963. this.responseHeaders = responseHeaders || null
  13964. this.opaque = opaque || null
  13965. this.callback = callback
  13966. this.abort = null
  13967. this.context = null
  13968. addSignal(this, signal)
  13969. }
  13970. onConnect (abort, context) {
  13971. if (!this.callback) {
  13972. throw new RequestAbortedError()
  13973. }
  13974. this.abort = abort
  13975. this.context = null
  13976. }
  13977. onHeaders () {
  13978. throw new SocketError('bad upgrade', null)
  13979. }
  13980. onUpgrade (statusCode, rawHeaders, socket) {
  13981. const { callback, opaque, context } = this
  13982. assert.strictEqual(statusCode, 101)
  13983. removeSignal(this)
  13984. this.callback = null
  13985. const headers = this.responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)
  13986. this.runInAsyncScope(callback, null, null, {
  13987. headers,
  13988. socket,
  13989. opaque,
  13990. context
  13991. })
  13992. }
  13993. onError (err) {
  13994. const { callback, opaque } = this
  13995. removeSignal(this)
  13996. if (callback) {
  13997. this.callback = null
  13998. queueMicrotask(() => {
  13999. this.runInAsyncScope(callback, null, err, { opaque })
  14000. })
  14001. }
  14002. }
  14003. }
  14004. function upgrade (opts, callback) {
  14005. if (callback === undefined) {
  14006. return new Promise((resolve, reject) => {
  14007. upgrade.call(this, opts, (err, data) => {
  14008. return err ? reject(err) : resolve(data)
  14009. })
  14010. })
  14011. }
  14012. try {
  14013. const upgradeHandler = new UpgradeHandler(opts, callback)
  14014. this.dispatch({
  14015. ...opts,
  14016. method: opts.method || 'GET',
  14017. upgrade: opts.protocol || 'Websocket'
  14018. }, upgradeHandler)
  14019. } catch (err) {
  14020. if (typeof callback !== 'function') {
  14021. throw err
  14022. }
  14023. const opaque = opts && opts.opaque
  14024. queueMicrotask(() => callback(err, { opaque }))
  14025. }
  14026. }
  14027. module.exports = upgrade
  14028. /***/ }),
  14029. /***/ 4059:
  14030. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  14031. "use strict";
  14032. module.exports.request = __nccwpck_require__(5448)
  14033. module.exports.stream = __nccwpck_require__(5395)
  14034. module.exports.pipeline = __nccwpck_require__(8752)
  14035. module.exports.upgrade = __nccwpck_require__(6923)
  14036. module.exports.connect = __nccwpck_require__(9744)
  14037. /***/ }),
  14038. /***/ 3858:
  14039. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  14040. "use strict";
  14041. // Ported from https://github.com/nodejs/undici/pull/907
  14042. const assert = __nccwpck_require__(9491)
  14043. const { Readable } = __nccwpck_require__(2781)
  14044. const { RequestAbortedError, NotSupportedError, InvalidArgumentError } = __nccwpck_require__(8045)
  14045. const util = __nccwpck_require__(3983)
  14046. const { ReadableStreamFrom, toUSVString } = __nccwpck_require__(3983)
  14047. let Blob
  14048. const kConsume = Symbol('kConsume')
  14049. const kReading = Symbol('kReading')
  14050. const kBody = Symbol('kBody')
  14051. const kAbort = Symbol('abort')
  14052. const kContentType = Symbol('kContentType')
  14053. const noop = () => {}
  14054. module.exports = class BodyReadable extends Readable {
  14055. constructor ({
  14056. resume,
  14057. abort,
  14058. contentType = '',
  14059. highWaterMark = 64 * 1024 // Same as nodejs fs streams.
  14060. }) {
  14061. super({
  14062. autoDestroy: true,
  14063. read: resume,
  14064. highWaterMark
  14065. })
  14066. this._readableState.dataEmitted = false
  14067. this[kAbort] = abort
  14068. this[kConsume] = null
  14069. this[kBody] = null
  14070. this[kContentType] = contentType
  14071. // Is stream being consumed through Readable API?
  14072. // This is an optimization so that we avoid checking
  14073. // for 'data' and 'readable' listeners in the hot path
  14074. // inside push().
  14075. this[kReading] = false
  14076. }
  14077. destroy (err) {
  14078. if (this.destroyed) {
  14079. // Node < 16
  14080. return this
  14081. }
  14082. if (!err && !this._readableState.endEmitted) {
  14083. err = new RequestAbortedError()
  14084. }
  14085. if (err) {
  14086. this[kAbort]()
  14087. }
  14088. return super.destroy(err)
  14089. }
  14090. emit (ev, ...args) {
  14091. if (ev === 'data') {
  14092. // Node < 16.7
  14093. this._readableState.dataEmitted = true
  14094. } else if (ev === 'error') {
  14095. // Node < 16
  14096. this._readableState.errorEmitted = true
  14097. }
  14098. return super.emit(ev, ...args)
  14099. }
  14100. on (ev, ...args) {
  14101. if (ev === 'data' || ev === 'readable') {
  14102. this[kReading] = true
  14103. }
  14104. return super.on(ev, ...args)
  14105. }
  14106. addListener (ev, ...args) {
  14107. return this.on(ev, ...args)
  14108. }
  14109. off (ev, ...args) {
  14110. const ret = super.off(ev, ...args)
  14111. if (ev === 'data' || ev === 'readable') {
  14112. this[kReading] = (
  14113. this.listenerCount('data') > 0 ||
  14114. this.listenerCount('readable') > 0
  14115. )
  14116. }
  14117. return ret
  14118. }
  14119. removeListener (ev, ...args) {
  14120. return this.off(ev, ...args)
  14121. }
  14122. push (chunk) {
  14123. if (this[kConsume] && chunk !== null && this.readableLength === 0) {
  14124. consumePush(this[kConsume], chunk)
  14125. return this[kReading] ? super.push(chunk) : true
  14126. }
  14127. return super.push(chunk)
  14128. }
  14129. // https://fetch.spec.whatwg.org/#dom-body-text
  14130. async text () {
  14131. return consume(this, 'text')
  14132. }
  14133. // https://fetch.spec.whatwg.org/#dom-body-json
  14134. async json () {
  14135. return consume(this, 'json')
  14136. }
  14137. // https://fetch.spec.whatwg.org/#dom-body-blob
  14138. async blob () {
  14139. return consume(this, 'blob')
  14140. }
  14141. // https://fetch.spec.whatwg.org/#dom-body-arraybuffer
  14142. async arrayBuffer () {
  14143. return consume(this, 'arrayBuffer')
  14144. }
  14145. // https://fetch.spec.whatwg.org/#dom-body-formdata
  14146. async formData () {
  14147. // TODO: Implement.
  14148. throw new NotSupportedError()
  14149. }
  14150. // https://fetch.spec.whatwg.org/#dom-body-bodyused
  14151. get bodyUsed () {
  14152. return util.isDisturbed(this)
  14153. }
  14154. // https://fetch.spec.whatwg.org/#dom-body-body
  14155. get body () {
  14156. if (!this[kBody]) {
  14157. this[kBody] = ReadableStreamFrom(this)
  14158. if (this[kConsume]) {
  14159. // TODO: Is this the best way to force a lock?
  14160. this[kBody].getReader() // Ensure stream is locked.
  14161. assert(this[kBody].locked)
  14162. }
  14163. }
  14164. return this[kBody]
  14165. }
  14166. dump (opts) {
  14167. let limit = opts && Number.isFinite(opts.limit) ? opts.limit : 262144
  14168. const signal = opts && opts.signal
  14169. if (signal) {
  14170. try {
  14171. if (typeof signal !== 'object' || !('aborted' in signal)) {
  14172. throw new InvalidArgumentError('signal must be an AbortSignal')
  14173. }
  14174. util.throwIfAborted(signal)
  14175. } catch (err) {
  14176. return Promise.reject(err)
  14177. }
  14178. }
  14179. if (this.closed) {
  14180. return Promise.resolve(null)
  14181. }
  14182. return new Promise((resolve, reject) => {
  14183. const signalListenerCleanup = signal
  14184. ? util.addAbortListener(signal, () => {
  14185. this.destroy()
  14186. })
  14187. : noop
  14188. this
  14189. .on('close', function () {
  14190. signalListenerCleanup()
  14191. if (signal && signal.aborted) {
  14192. reject(signal.reason || Object.assign(new Error('The operation was aborted'), { name: 'AbortError' }))
  14193. } else {
  14194. resolve(null)
  14195. }
  14196. })
  14197. .on('error', noop)
  14198. .on('data', function (chunk) {
  14199. limit -= chunk.length
  14200. if (limit <= 0) {
  14201. this.destroy()
  14202. }
  14203. })
  14204. .resume()
  14205. })
  14206. }
  14207. }
  14208. // https://streams.spec.whatwg.org/#readablestream-locked
  14209. function isLocked (self) {
  14210. // Consume is an implicit lock.
  14211. return (self[kBody] && self[kBody].locked === true) || self[kConsume]
  14212. }
  14213. // https://fetch.spec.whatwg.org/#body-unusable
  14214. function isUnusable (self) {
  14215. return util.isDisturbed(self) || isLocked(self)
  14216. }
  14217. async function consume (stream, type) {
  14218. if (isUnusable(stream)) {
  14219. throw new TypeError('unusable')
  14220. }
  14221. assert(!stream[kConsume])
  14222. return new Promise((resolve, reject) => {
  14223. stream[kConsume] = {
  14224. type,
  14225. stream,
  14226. resolve,
  14227. reject,
  14228. length: 0,
  14229. body: []
  14230. }
  14231. stream
  14232. .on('error', function (err) {
  14233. consumeFinish(this[kConsume], err)
  14234. })
  14235. .on('close', function () {
  14236. if (this[kConsume].body !== null) {
  14237. consumeFinish(this[kConsume], new RequestAbortedError())
  14238. }
  14239. })
  14240. process.nextTick(consumeStart, stream[kConsume])
  14241. })
  14242. }
  14243. function consumeStart (consume) {
  14244. if (consume.body === null) {
  14245. return
  14246. }
  14247. const { _readableState: state } = consume.stream
  14248. for (const chunk of state.buffer) {
  14249. consumePush(consume, chunk)
  14250. }
  14251. if (state.endEmitted) {
  14252. consumeEnd(this[kConsume])
  14253. } else {
  14254. consume.stream.on('end', function () {
  14255. consumeEnd(this[kConsume])
  14256. })
  14257. }
  14258. consume.stream.resume()
  14259. while (consume.stream.read() != null) {
  14260. // Loop
  14261. }
  14262. }
  14263. function consumeEnd (consume) {
  14264. const { type, body, resolve, stream, length } = consume
  14265. try {
  14266. if (type === 'text') {
  14267. resolve(toUSVString(Buffer.concat(body)))
  14268. } else if (type === 'json') {
  14269. resolve(JSON.parse(Buffer.concat(body)))
  14270. } else if (type === 'arrayBuffer') {
  14271. const dst = new Uint8Array(length)
  14272. let pos = 0
  14273. for (const buf of body) {
  14274. dst.set(buf, pos)
  14275. pos += buf.byteLength
  14276. }
  14277. resolve(dst.buffer)
  14278. } else if (type === 'blob') {
  14279. if (!Blob) {
  14280. Blob = (__nccwpck_require__(4300).Blob)
  14281. }
  14282. resolve(new Blob(body, { type: stream[kContentType] }))
  14283. }
  14284. consumeFinish(consume)
  14285. } catch (err) {
  14286. stream.destroy(err)
  14287. }
  14288. }
  14289. function consumePush (consume, chunk) {
  14290. consume.length += chunk.length
  14291. consume.body.push(chunk)
  14292. }
  14293. function consumeFinish (consume, err) {
  14294. if (consume.body === null) {
  14295. return
  14296. }
  14297. if (err) {
  14298. consume.reject(err)
  14299. } else {
  14300. consume.resolve()
  14301. }
  14302. consume.type = null
  14303. consume.stream = null
  14304. consume.resolve = null
  14305. consume.reject = null
  14306. consume.length = 0
  14307. consume.body = null
  14308. }
  14309. /***/ }),
  14310. /***/ 7474:
  14311. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  14312. const assert = __nccwpck_require__(9491)
  14313. const {
  14314. ResponseStatusCodeError
  14315. } = __nccwpck_require__(8045)
  14316. const { toUSVString } = __nccwpck_require__(3983)
  14317. async function getResolveErrorBodyCallback ({ callback, body, contentType, statusCode, statusMessage, headers }) {
  14318. assert(body)
  14319. let chunks = []
  14320. let limit = 0
  14321. for await (const chunk of body) {
  14322. chunks.push(chunk)
  14323. limit += chunk.length
  14324. if (limit > 128 * 1024) {
  14325. chunks = null
  14326. break
  14327. }
  14328. }
  14329. if (statusCode === 204 || !contentType || !chunks) {
  14330. process.nextTick(callback, new ResponseStatusCodeError(`Response status code ${statusCode}${statusMessage ? `: ${statusMessage}` : ''}`, statusCode, headers))
  14331. return
  14332. }
  14333. try {
  14334. if (contentType.startsWith('application/json')) {
  14335. const payload = JSON.parse(toUSVString(Buffer.concat(chunks)))
  14336. process.nextTick(callback, new ResponseStatusCodeError(`Response status code ${statusCode}${statusMessage ? `: ${statusMessage}` : ''}`, statusCode, headers, payload))
  14337. return
  14338. }
  14339. if (contentType.startsWith('text/')) {
  14340. const payload = toUSVString(Buffer.concat(chunks))
  14341. process.nextTick(callback, new ResponseStatusCodeError(`Response status code ${statusCode}${statusMessage ? `: ${statusMessage}` : ''}`, statusCode, headers, payload))
  14342. return
  14343. }
  14344. } catch (err) {
  14345. // Process in a fallback if error
  14346. }
  14347. process.nextTick(callback, new ResponseStatusCodeError(`Response status code ${statusCode}${statusMessage ? `: ${statusMessage}` : ''}`, statusCode, headers))
  14348. }
  14349. module.exports = { getResolveErrorBodyCallback }
  14350. /***/ }),
  14351. /***/ 7931:
  14352. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  14353. "use strict";
  14354. const {
  14355. BalancedPoolMissingUpstreamError,
  14356. InvalidArgumentError
  14357. } = __nccwpck_require__(8045)
  14358. const {
  14359. PoolBase,
  14360. kClients,
  14361. kNeedDrain,
  14362. kAddClient,
  14363. kRemoveClient,
  14364. kGetDispatcher
  14365. } = __nccwpck_require__(3198)
  14366. const Pool = __nccwpck_require__(4634)
  14367. const { kUrl, kInterceptors } = __nccwpck_require__(2785)
  14368. const { parseOrigin } = __nccwpck_require__(3983)
  14369. const kFactory = Symbol('factory')
  14370. const kOptions = Symbol('options')
  14371. const kGreatestCommonDivisor = Symbol('kGreatestCommonDivisor')
  14372. const kCurrentWeight = Symbol('kCurrentWeight')
  14373. const kIndex = Symbol('kIndex')
  14374. const kWeight = Symbol('kWeight')
  14375. const kMaxWeightPerServer = Symbol('kMaxWeightPerServer')
  14376. const kErrorPenalty = Symbol('kErrorPenalty')
  14377. function getGreatestCommonDivisor (a, b) {
  14378. if (b === 0) return a
  14379. return getGreatestCommonDivisor(b, a % b)
  14380. }
  14381. function defaultFactory (origin, opts) {
  14382. return new Pool(origin, opts)
  14383. }
  14384. class BalancedPool extends PoolBase {
  14385. constructor (upstreams = [], { factory = defaultFactory, ...opts } = {}) {
  14386. super()
  14387. this[kOptions] = opts
  14388. this[kIndex] = -1
  14389. this[kCurrentWeight] = 0
  14390. this[kMaxWeightPerServer] = this[kOptions].maxWeightPerServer || 100
  14391. this[kErrorPenalty] = this[kOptions].errorPenalty || 15
  14392. if (!Array.isArray(upstreams)) {
  14393. upstreams = [upstreams]
  14394. }
  14395. if (typeof factory !== 'function') {
  14396. throw new InvalidArgumentError('factory must be a function.')
  14397. }
  14398. this[kInterceptors] = opts.interceptors && opts.interceptors.BalancedPool && Array.isArray(opts.interceptors.BalancedPool)
  14399. ? opts.interceptors.BalancedPool
  14400. : []
  14401. this[kFactory] = factory
  14402. for (const upstream of upstreams) {
  14403. this.addUpstream(upstream)
  14404. }
  14405. this._updateBalancedPoolStats()
  14406. }
  14407. addUpstream (upstream) {
  14408. const upstreamOrigin = parseOrigin(upstream).origin
  14409. if (this[kClients].find((pool) => (
  14410. pool[kUrl].origin === upstreamOrigin &&
  14411. pool.closed !== true &&
  14412. pool.destroyed !== true
  14413. ))) {
  14414. return this
  14415. }
  14416. const pool = this[kFactory](upstreamOrigin, Object.assign({}, this[kOptions]))
  14417. this[kAddClient](pool)
  14418. pool.on('connect', () => {
  14419. pool[kWeight] = Math.min(this[kMaxWeightPerServer], pool[kWeight] + this[kErrorPenalty])
  14420. })
  14421. pool.on('connectionError', () => {
  14422. pool[kWeight] = Math.max(1, pool[kWeight] - this[kErrorPenalty])
  14423. this._updateBalancedPoolStats()
  14424. })
  14425. pool.on('disconnect', (...args) => {
  14426. const err = args[2]
  14427. if (err && err.code === 'UND_ERR_SOCKET') {
  14428. // decrease the weight of the pool.
  14429. pool[kWeight] = Math.max(1, pool[kWeight] - this[kErrorPenalty])
  14430. this._updateBalancedPoolStats()
  14431. }
  14432. })
  14433. for (const client of this[kClients]) {
  14434. client[kWeight] = this[kMaxWeightPerServer]
  14435. }
  14436. this._updateBalancedPoolStats()
  14437. return this
  14438. }
  14439. _updateBalancedPoolStats () {
  14440. this[kGreatestCommonDivisor] = this[kClients].map(p => p[kWeight]).reduce(getGreatestCommonDivisor, 0)
  14441. }
  14442. removeUpstream (upstream) {
  14443. const upstreamOrigin = parseOrigin(upstream).origin
  14444. const pool = this[kClients].find((pool) => (
  14445. pool[kUrl].origin === upstreamOrigin &&
  14446. pool.closed !== true &&
  14447. pool.destroyed !== true
  14448. ))
  14449. if (pool) {
  14450. this[kRemoveClient](pool)
  14451. }
  14452. return this
  14453. }
  14454. get upstreams () {
  14455. return this[kClients]
  14456. .filter(dispatcher => dispatcher.closed !== true && dispatcher.destroyed !== true)
  14457. .map((p) => p[kUrl].origin)
  14458. }
  14459. [kGetDispatcher] () {
  14460. // We validate that pools is greater than 0,
  14461. // otherwise we would have to wait until an upstream
  14462. // is added, which might never happen.
  14463. if (this[kClients].length === 0) {
  14464. throw new BalancedPoolMissingUpstreamError()
  14465. }
  14466. const dispatcher = this[kClients].find(dispatcher => (
  14467. !dispatcher[kNeedDrain] &&
  14468. dispatcher.closed !== true &&
  14469. dispatcher.destroyed !== true
  14470. ))
  14471. if (!dispatcher) {
  14472. return
  14473. }
  14474. const allClientsBusy = this[kClients].map(pool => pool[kNeedDrain]).reduce((a, b) => a && b, true)
  14475. if (allClientsBusy) {
  14476. return
  14477. }
  14478. let counter = 0
  14479. let maxWeightIndex = this[kClients].findIndex(pool => !pool[kNeedDrain])
  14480. while (counter++ < this[kClients].length) {
  14481. this[kIndex] = (this[kIndex] + 1) % this[kClients].length
  14482. const pool = this[kClients][this[kIndex]]
  14483. // find pool index with the largest weight
  14484. if (pool[kWeight] > this[kClients][maxWeightIndex][kWeight] && !pool[kNeedDrain]) {
  14485. maxWeightIndex = this[kIndex]
  14486. }
  14487. // decrease the current weight every `this[kClients].length`.
  14488. if (this[kIndex] === 0) {
  14489. // Set the current weight to the next lower weight.
  14490. this[kCurrentWeight] = this[kCurrentWeight] - this[kGreatestCommonDivisor]
  14491. if (this[kCurrentWeight] <= 0) {
  14492. this[kCurrentWeight] = this[kMaxWeightPerServer]
  14493. }
  14494. }
  14495. if (pool[kWeight] >= this[kCurrentWeight] && (!pool[kNeedDrain])) {
  14496. return pool
  14497. }
  14498. }
  14499. this[kCurrentWeight] = this[kClients][maxWeightIndex][kWeight]
  14500. this[kIndex] = maxWeightIndex
  14501. return this[kClients][maxWeightIndex]
  14502. }
  14503. }
  14504. module.exports = BalancedPool
  14505. /***/ }),
  14506. /***/ 6101:
  14507. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  14508. "use strict";
  14509. const { kConstruct } = __nccwpck_require__(9174)
  14510. const { urlEquals, fieldValues: getFieldValues } = __nccwpck_require__(2396)
  14511. const { kEnumerableProperty, isDisturbed } = __nccwpck_require__(3983)
  14512. const { kHeadersList } = __nccwpck_require__(2785)
  14513. const { webidl } = __nccwpck_require__(1744)
  14514. const { Response, cloneResponse } = __nccwpck_require__(7823)
  14515. const { Request } = __nccwpck_require__(8359)
  14516. const { kState, kHeaders, kGuard, kRealm } = __nccwpck_require__(5861)
  14517. const { fetching } = __nccwpck_require__(4881)
  14518. const { urlIsHttpHttpsScheme, createDeferredPromise, readAllBytes } = __nccwpck_require__(2538)
  14519. const assert = __nccwpck_require__(9491)
  14520. const { getGlobalDispatcher } = __nccwpck_require__(1892)
  14521. /**
  14522. * @see https://w3c.github.io/ServiceWorker/#dfn-cache-batch-operation
  14523. * @typedef {Object} CacheBatchOperation
  14524. * @property {'delete' | 'put'} type
  14525. * @property {any} request
  14526. * @property {any} response
  14527. * @property {import('../../types/cache').CacheQueryOptions} options
  14528. */
  14529. /**
  14530. * @see https://w3c.github.io/ServiceWorker/#dfn-request-response-list
  14531. * @typedef {[any, any][]} requestResponseList
  14532. */
  14533. class Cache {
  14534. /**
  14535. * @see https://w3c.github.io/ServiceWorker/#dfn-relevant-request-response-list
  14536. * @type {requestResponseList}
  14537. */
  14538. #relevantRequestResponseList
  14539. constructor () {
  14540. if (arguments[0] !== kConstruct) {
  14541. webidl.illegalConstructor()
  14542. }
  14543. this.#relevantRequestResponseList = arguments[1]
  14544. }
  14545. async match (request, options = {}) {
  14546. webidl.brandCheck(this, Cache)
  14547. webidl.argumentLengthCheck(arguments, 1, { header: 'Cache.match' })
  14548. request = webidl.converters.RequestInfo(request)
  14549. options = webidl.converters.CacheQueryOptions(options)
  14550. const p = await this.matchAll(request, options)
  14551. if (p.length === 0) {
  14552. return
  14553. }
  14554. return p[0]
  14555. }
  14556. async matchAll (request = undefined, options = {}) {
  14557. webidl.brandCheck(this, Cache)
  14558. if (request !== undefined) request = webidl.converters.RequestInfo(request)
  14559. options = webidl.converters.CacheQueryOptions(options)
  14560. // 1.
  14561. let r = null
  14562. // 2.
  14563. if (request !== undefined) {
  14564. if (request instanceof Request) {
  14565. // 2.1.1
  14566. r = request[kState]
  14567. // 2.1.2
  14568. if (r.method !== 'GET' && !options.ignoreMethod) {
  14569. return []
  14570. }
  14571. } else if (typeof request === 'string') {
  14572. // 2.2.1
  14573. r = new Request(request)[kState]
  14574. }
  14575. }
  14576. // 5.
  14577. // 5.1
  14578. const responses = []
  14579. // 5.2
  14580. if (request === undefined) {
  14581. // 5.2.1
  14582. for (const requestResponse of this.#relevantRequestResponseList) {
  14583. responses.push(requestResponse[1])
  14584. }
  14585. } else { // 5.3
  14586. // 5.3.1
  14587. const requestResponses = this.#queryCache(r, options)
  14588. // 5.3.2
  14589. for (const requestResponse of requestResponses) {
  14590. responses.push(requestResponse[1])
  14591. }
  14592. }
  14593. // 5.4
  14594. // We don't implement CORs so we don't need to loop over the responses, yay!
  14595. // 5.5.1
  14596. const responseList = []
  14597. // 5.5.2
  14598. for (const response of responses) {
  14599. // 5.5.2.1
  14600. const responseObject = new Response(response.body?.source ?? null)
  14601. const body = responseObject[kState].body
  14602. responseObject[kState] = response
  14603. responseObject[kState].body = body
  14604. responseObject[kHeaders][kHeadersList] = response.headersList
  14605. responseObject[kHeaders][kGuard] = 'immutable'
  14606. responseList.push(responseObject)
  14607. }
  14608. // 6.
  14609. return Object.freeze(responseList)
  14610. }
  14611. async add (request) {
  14612. webidl.brandCheck(this, Cache)
  14613. webidl.argumentLengthCheck(arguments, 1, { header: 'Cache.add' })
  14614. request = webidl.converters.RequestInfo(request)
  14615. // 1.
  14616. const requests = [request]
  14617. // 2.
  14618. const responseArrayPromise = this.addAll(requests)
  14619. // 3.
  14620. return await responseArrayPromise
  14621. }
  14622. async addAll (requests) {
  14623. webidl.brandCheck(this, Cache)
  14624. webidl.argumentLengthCheck(arguments, 1, { header: 'Cache.addAll' })
  14625. requests = webidl.converters['sequence<RequestInfo>'](requests)
  14626. // 1.
  14627. const responsePromises = []
  14628. // 2.
  14629. const requestList = []
  14630. // 3.
  14631. for (const request of requests) {
  14632. if (typeof request === 'string') {
  14633. continue
  14634. }
  14635. // 3.1
  14636. const r = request[kState]
  14637. // 3.2
  14638. if (!urlIsHttpHttpsScheme(r.url) || r.method !== 'GET') {
  14639. throw webidl.errors.exception({
  14640. header: 'Cache.addAll',
  14641. message: 'Expected http/s scheme when method is not GET.'
  14642. })
  14643. }
  14644. }
  14645. // 4.
  14646. /** @type {ReturnType<typeof fetching>[]} */
  14647. const fetchControllers = []
  14648. // 5.
  14649. for (const request of requests) {
  14650. // 5.1
  14651. const r = new Request(request)[kState]
  14652. // 5.2
  14653. if (!urlIsHttpHttpsScheme(r.url)) {
  14654. throw webidl.errors.exception({
  14655. header: 'Cache.addAll',
  14656. message: 'Expected http/s scheme.'
  14657. })
  14658. }
  14659. // 5.4
  14660. r.initiator = 'fetch'
  14661. r.destination = 'subresource'
  14662. // 5.5
  14663. requestList.push(r)
  14664. // 5.6
  14665. const responsePromise = createDeferredPromise()
  14666. // 5.7
  14667. fetchControllers.push(fetching({
  14668. request: r,
  14669. dispatcher: getGlobalDispatcher(),
  14670. processResponse (response) {
  14671. // 1.
  14672. if (response.type === 'error' || response.status === 206 || response.status < 200 || response.status > 299) {
  14673. responsePromise.reject(webidl.errors.exception({
  14674. header: 'Cache.addAll',
  14675. message: 'Received an invalid status code or the request failed.'
  14676. }))
  14677. } else if (response.headersList.contains('vary')) { // 2.
  14678. // 2.1
  14679. const fieldValues = getFieldValues(response.headersList.get('vary'))
  14680. // 2.2
  14681. for (const fieldValue of fieldValues) {
  14682. // 2.2.1
  14683. if (fieldValue === '*') {
  14684. responsePromise.reject(webidl.errors.exception({
  14685. header: 'Cache.addAll',
  14686. message: 'invalid vary field value'
  14687. }))
  14688. for (const controller of fetchControllers) {
  14689. controller.abort()
  14690. }
  14691. return
  14692. }
  14693. }
  14694. }
  14695. },
  14696. processResponseEndOfBody (response) {
  14697. // 1.
  14698. if (response.aborted) {
  14699. responsePromise.reject(new DOMException('aborted', 'AbortError'))
  14700. return
  14701. }
  14702. // 2.
  14703. responsePromise.resolve(response)
  14704. }
  14705. }))
  14706. // 5.8
  14707. responsePromises.push(responsePromise.promise)
  14708. }
  14709. // 6.
  14710. const p = Promise.all(responsePromises)
  14711. // 7.
  14712. const responses = await p
  14713. // 7.1
  14714. const operations = []
  14715. // 7.2
  14716. let index = 0
  14717. // 7.3
  14718. for (const response of responses) {
  14719. // 7.3.1
  14720. /** @type {CacheBatchOperation} */
  14721. const operation = {
  14722. type: 'put', // 7.3.2
  14723. request: requestList[index], // 7.3.3
  14724. response // 7.3.4
  14725. }
  14726. operations.push(operation) // 7.3.5
  14727. index++ // 7.3.6
  14728. }
  14729. // 7.5
  14730. const cacheJobPromise = createDeferredPromise()
  14731. // 7.6.1
  14732. let errorData = null
  14733. // 7.6.2
  14734. try {
  14735. this.#batchCacheOperations(operations)
  14736. } catch (e) {
  14737. errorData = e
  14738. }
  14739. // 7.6.3
  14740. queueMicrotask(() => {
  14741. // 7.6.3.1
  14742. if (errorData === null) {
  14743. cacheJobPromise.resolve(undefined)
  14744. } else {
  14745. // 7.6.3.2
  14746. cacheJobPromise.reject(errorData)
  14747. }
  14748. })
  14749. // 7.7
  14750. return cacheJobPromise.promise
  14751. }
  14752. async put (request, response) {
  14753. webidl.brandCheck(this, Cache)
  14754. webidl.argumentLengthCheck(arguments, 2, { header: 'Cache.put' })
  14755. request = webidl.converters.RequestInfo(request)
  14756. response = webidl.converters.Response(response)
  14757. // 1.
  14758. let innerRequest = null
  14759. // 2.
  14760. if (request instanceof Request) {
  14761. innerRequest = request[kState]
  14762. } else { // 3.
  14763. innerRequest = new Request(request)[kState]
  14764. }
  14765. // 4.
  14766. if (!urlIsHttpHttpsScheme(innerRequest.url) || innerRequest.method !== 'GET') {
  14767. throw webidl.errors.exception({
  14768. header: 'Cache.put',
  14769. message: 'Expected an http/s scheme when method is not GET'
  14770. })
  14771. }
  14772. // 5.
  14773. const innerResponse = response[kState]
  14774. // 6.
  14775. if (innerResponse.status === 206) {
  14776. throw webidl.errors.exception({
  14777. header: 'Cache.put',
  14778. message: 'Got 206 status'
  14779. })
  14780. }
  14781. // 7.
  14782. if (innerResponse.headersList.contains('vary')) {
  14783. // 7.1.
  14784. const fieldValues = getFieldValues(innerResponse.headersList.get('vary'))
  14785. // 7.2.
  14786. for (const fieldValue of fieldValues) {
  14787. // 7.2.1
  14788. if (fieldValue === '*') {
  14789. throw webidl.errors.exception({
  14790. header: 'Cache.put',
  14791. message: 'Got * vary field value'
  14792. })
  14793. }
  14794. }
  14795. }
  14796. // 8.
  14797. if (innerResponse.body && (isDisturbed(innerResponse.body.stream) || innerResponse.body.stream.locked)) {
  14798. throw webidl.errors.exception({
  14799. header: 'Cache.put',
  14800. message: 'Response body is locked or disturbed'
  14801. })
  14802. }
  14803. // 9.
  14804. const clonedResponse = cloneResponse(innerResponse)
  14805. // 10.
  14806. const bodyReadPromise = createDeferredPromise()
  14807. // 11.
  14808. if (innerResponse.body != null) {
  14809. // 11.1
  14810. const stream = innerResponse.body.stream
  14811. // 11.2
  14812. const reader = stream.getReader()
  14813. // 11.3
  14814. readAllBytes(reader).then(bodyReadPromise.resolve, bodyReadPromise.reject)
  14815. } else {
  14816. bodyReadPromise.resolve(undefined)
  14817. }
  14818. // 12.
  14819. /** @type {CacheBatchOperation[]} */
  14820. const operations = []
  14821. // 13.
  14822. /** @type {CacheBatchOperation} */
  14823. const operation = {
  14824. type: 'put', // 14.
  14825. request: innerRequest, // 15.
  14826. response: clonedResponse // 16.
  14827. }
  14828. // 17.
  14829. operations.push(operation)
  14830. // 19.
  14831. const bytes = await bodyReadPromise.promise
  14832. if (clonedResponse.body != null) {
  14833. clonedResponse.body.source = bytes
  14834. }
  14835. // 19.1
  14836. const cacheJobPromise = createDeferredPromise()
  14837. // 19.2.1
  14838. let errorData = null
  14839. // 19.2.2
  14840. try {
  14841. this.#batchCacheOperations(operations)
  14842. } catch (e) {
  14843. errorData = e
  14844. }
  14845. // 19.2.3
  14846. queueMicrotask(() => {
  14847. // 19.2.3.1
  14848. if (errorData === null) {
  14849. cacheJobPromise.resolve()
  14850. } else { // 19.2.3.2
  14851. cacheJobPromise.reject(errorData)
  14852. }
  14853. })
  14854. return cacheJobPromise.promise
  14855. }
  14856. async delete (request, options = {}) {
  14857. webidl.brandCheck(this, Cache)
  14858. webidl.argumentLengthCheck(arguments, 1, { header: 'Cache.delete' })
  14859. request = webidl.converters.RequestInfo(request)
  14860. options = webidl.converters.CacheQueryOptions(options)
  14861. /**
  14862. * @type {Request}
  14863. */
  14864. let r = null
  14865. if (request instanceof Request) {
  14866. r = request[kState]
  14867. if (r.method !== 'GET' && !options.ignoreMethod) {
  14868. return false
  14869. }
  14870. } else {
  14871. assert(typeof request === 'string')
  14872. r = new Request(request)[kState]
  14873. }
  14874. /** @type {CacheBatchOperation[]} */
  14875. const operations = []
  14876. /** @type {CacheBatchOperation} */
  14877. const operation = {
  14878. type: 'delete',
  14879. request: r,
  14880. options
  14881. }
  14882. operations.push(operation)
  14883. const cacheJobPromise = createDeferredPromise()
  14884. let errorData = null
  14885. let requestResponses
  14886. try {
  14887. requestResponses = this.#batchCacheOperations(operations)
  14888. } catch (e) {
  14889. errorData = e
  14890. }
  14891. queueMicrotask(() => {
  14892. if (errorData === null) {
  14893. cacheJobPromise.resolve(!!requestResponses?.length)
  14894. } else {
  14895. cacheJobPromise.reject(errorData)
  14896. }
  14897. })
  14898. return cacheJobPromise.promise
  14899. }
  14900. /**
  14901. * @see https://w3c.github.io/ServiceWorker/#dom-cache-keys
  14902. * @param {any} request
  14903. * @param {import('../../types/cache').CacheQueryOptions} options
  14904. * @returns {readonly Request[]}
  14905. */
  14906. async keys (request = undefined, options = {}) {
  14907. webidl.brandCheck(this, Cache)
  14908. if (request !== undefined) request = webidl.converters.RequestInfo(request)
  14909. options = webidl.converters.CacheQueryOptions(options)
  14910. // 1.
  14911. let r = null
  14912. // 2.
  14913. if (request !== undefined) {
  14914. // 2.1
  14915. if (request instanceof Request) {
  14916. // 2.1.1
  14917. r = request[kState]
  14918. // 2.1.2
  14919. if (r.method !== 'GET' && !options.ignoreMethod) {
  14920. return []
  14921. }
  14922. } else if (typeof request === 'string') { // 2.2
  14923. r = new Request(request)[kState]
  14924. }
  14925. }
  14926. // 4.
  14927. const promise = createDeferredPromise()
  14928. // 5.
  14929. // 5.1
  14930. const requests = []
  14931. // 5.2
  14932. if (request === undefined) {
  14933. // 5.2.1
  14934. for (const requestResponse of this.#relevantRequestResponseList) {
  14935. // 5.2.1.1
  14936. requests.push(requestResponse[0])
  14937. }
  14938. } else { // 5.3
  14939. // 5.3.1
  14940. const requestResponses = this.#queryCache(r, options)
  14941. // 5.3.2
  14942. for (const requestResponse of requestResponses) {
  14943. // 5.3.2.1
  14944. requests.push(requestResponse[0])
  14945. }
  14946. }
  14947. // 5.4
  14948. queueMicrotask(() => {
  14949. // 5.4.1
  14950. const requestList = []
  14951. // 5.4.2
  14952. for (const request of requests) {
  14953. const requestObject = new Request('https://a')
  14954. requestObject[kState] = request
  14955. requestObject[kHeaders][kHeadersList] = request.headersList
  14956. requestObject[kHeaders][kGuard] = 'immutable'
  14957. requestObject[kRealm] = request.client
  14958. // 5.4.2.1
  14959. requestList.push(requestObject)
  14960. }
  14961. // 5.4.3
  14962. promise.resolve(Object.freeze(requestList))
  14963. })
  14964. return promise.promise
  14965. }
  14966. /**
  14967. * @see https://w3c.github.io/ServiceWorker/#batch-cache-operations-algorithm
  14968. * @param {CacheBatchOperation[]} operations
  14969. * @returns {requestResponseList}
  14970. */
  14971. #batchCacheOperations (operations) {
  14972. // 1.
  14973. const cache = this.#relevantRequestResponseList
  14974. // 2.
  14975. const backupCache = [...cache]
  14976. // 3.
  14977. const addedItems = []
  14978. // 4.1
  14979. const resultList = []
  14980. try {
  14981. // 4.2
  14982. for (const operation of operations) {
  14983. // 4.2.1
  14984. if (operation.type !== 'delete' && operation.type !== 'put') {
  14985. throw webidl.errors.exception({
  14986. header: 'Cache.#batchCacheOperations',
  14987. message: 'operation type does not match "delete" or "put"'
  14988. })
  14989. }
  14990. // 4.2.2
  14991. if (operation.type === 'delete' && operation.response != null) {
  14992. throw webidl.errors.exception({
  14993. header: 'Cache.#batchCacheOperations',
  14994. message: 'delete operation should not have an associated response'
  14995. })
  14996. }
  14997. // 4.2.3
  14998. if (this.#queryCache(operation.request, operation.options, addedItems).length) {
  14999. throw new DOMException('???', 'InvalidStateError')
  15000. }
  15001. // 4.2.4
  15002. let requestResponses
  15003. // 4.2.5
  15004. if (operation.type === 'delete') {
  15005. // 4.2.5.1
  15006. requestResponses = this.#queryCache(operation.request, operation.options)
  15007. // TODO: the spec is wrong, this is needed to pass WPTs
  15008. if (requestResponses.length === 0) {
  15009. return []
  15010. }
  15011. // 4.2.5.2
  15012. for (const requestResponse of requestResponses) {
  15013. const idx = cache.indexOf(requestResponse)
  15014. assert(idx !== -1)
  15015. // 4.2.5.2.1
  15016. cache.splice(idx, 1)
  15017. }
  15018. } else if (operation.type === 'put') { // 4.2.6
  15019. // 4.2.6.1
  15020. if (operation.response == null) {
  15021. throw webidl.errors.exception({
  15022. header: 'Cache.#batchCacheOperations',
  15023. message: 'put operation should have an associated response'
  15024. })
  15025. }
  15026. // 4.2.6.2
  15027. const r = operation.request
  15028. // 4.2.6.3
  15029. if (!urlIsHttpHttpsScheme(r.url)) {
  15030. throw webidl.errors.exception({
  15031. header: 'Cache.#batchCacheOperations',
  15032. message: 'expected http or https scheme'
  15033. })
  15034. }
  15035. // 4.2.6.4
  15036. if (r.method !== 'GET') {
  15037. throw webidl.errors.exception({
  15038. header: 'Cache.#batchCacheOperations',
  15039. message: 'not get method'
  15040. })
  15041. }
  15042. // 4.2.6.5
  15043. if (operation.options != null) {
  15044. throw webidl.errors.exception({
  15045. header: 'Cache.#batchCacheOperations',
  15046. message: 'options must not be defined'
  15047. })
  15048. }
  15049. // 4.2.6.6
  15050. requestResponses = this.#queryCache(operation.request)
  15051. // 4.2.6.7
  15052. for (const requestResponse of requestResponses) {
  15053. const idx = cache.indexOf(requestResponse)
  15054. assert(idx !== -1)
  15055. // 4.2.6.7.1
  15056. cache.splice(idx, 1)
  15057. }
  15058. // 4.2.6.8
  15059. cache.push([operation.request, operation.response])
  15060. // 4.2.6.10
  15061. addedItems.push([operation.request, operation.response])
  15062. }
  15063. // 4.2.7
  15064. resultList.push([operation.request, operation.response])
  15065. }
  15066. // 4.3
  15067. return resultList
  15068. } catch (e) { // 5.
  15069. // 5.1
  15070. this.#relevantRequestResponseList.length = 0
  15071. // 5.2
  15072. this.#relevantRequestResponseList = backupCache
  15073. // 5.3
  15074. throw e
  15075. }
  15076. }
  15077. /**
  15078. * @see https://w3c.github.io/ServiceWorker/#query-cache
  15079. * @param {any} requestQuery
  15080. * @param {import('../../types/cache').CacheQueryOptions} options
  15081. * @param {requestResponseList} targetStorage
  15082. * @returns {requestResponseList}
  15083. */
  15084. #queryCache (requestQuery, options, targetStorage) {
  15085. /** @type {requestResponseList} */
  15086. const resultList = []
  15087. const storage = targetStorage ?? this.#relevantRequestResponseList
  15088. for (const requestResponse of storage) {
  15089. const [cachedRequest, cachedResponse] = requestResponse
  15090. if (this.#requestMatchesCachedItem(requestQuery, cachedRequest, cachedResponse, options)) {
  15091. resultList.push(requestResponse)
  15092. }
  15093. }
  15094. return resultList
  15095. }
  15096. /**
  15097. * @see https://w3c.github.io/ServiceWorker/#request-matches-cached-item-algorithm
  15098. * @param {any} requestQuery
  15099. * @param {any} request
  15100. * @param {any | null} response
  15101. * @param {import('../../types/cache').CacheQueryOptions | undefined} options
  15102. * @returns {boolean}
  15103. */
  15104. #requestMatchesCachedItem (requestQuery, request, response = null, options) {
  15105. // if (options?.ignoreMethod === false && request.method === 'GET') {
  15106. // return false
  15107. // }
  15108. const queryURL = new URL(requestQuery.url)
  15109. const cachedURL = new URL(request.url)
  15110. if (options?.ignoreSearch) {
  15111. cachedURL.search = ''
  15112. queryURL.search = ''
  15113. }
  15114. if (!urlEquals(queryURL, cachedURL, true)) {
  15115. return false
  15116. }
  15117. if (
  15118. response == null ||
  15119. options?.ignoreVary ||
  15120. !response.headersList.contains('vary')
  15121. ) {
  15122. return true
  15123. }
  15124. const fieldValues = getFieldValues(response.headersList.get('vary'))
  15125. for (const fieldValue of fieldValues) {
  15126. if (fieldValue === '*') {
  15127. return false
  15128. }
  15129. const requestValue = request.headersList.get(fieldValue)
  15130. const queryValue = requestQuery.headersList.get(fieldValue)
  15131. // If one has the header and the other doesn't, or one has
  15132. // a different value than the other, return false
  15133. if (requestValue !== queryValue) {
  15134. return false
  15135. }
  15136. }
  15137. return true
  15138. }
  15139. }
  15140. Object.defineProperties(Cache.prototype, {
  15141. [Symbol.toStringTag]: {
  15142. value: 'Cache',
  15143. configurable: true
  15144. },
  15145. match: kEnumerableProperty,
  15146. matchAll: kEnumerableProperty,
  15147. add: kEnumerableProperty,
  15148. addAll: kEnumerableProperty,
  15149. put: kEnumerableProperty,
  15150. delete: kEnumerableProperty,
  15151. keys: kEnumerableProperty
  15152. })
  15153. const cacheQueryOptionConverters = [
  15154. {
  15155. key: 'ignoreSearch',
  15156. converter: webidl.converters.boolean,
  15157. defaultValue: false
  15158. },
  15159. {
  15160. key: 'ignoreMethod',
  15161. converter: webidl.converters.boolean,
  15162. defaultValue: false
  15163. },
  15164. {
  15165. key: 'ignoreVary',
  15166. converter: webidl.converters.boolean,
  15167. defaultValue: false
  15168. }
  15169. ]
  15170. webidl.converters.CacheQueryOptions = webidl.dictionaryConverter(cacheQueryOptionConverters)
  15171. webidl.converters.MultiCacheQueryOptions = webidl.dictionaryConverter([
  15172. ...cacheQueryOptionConverters,
  15173. {
  15174. key: 'cacheName',
  15175. converter: webidl.converters.DOMString
  15176. }
  15177. ])
  15178. webidl.converters.Response = webidl.interfaceConverter(Response)
  15179. webidl.converters['sequence<RequestInfo>'] = webidl.sequenceConverter(
  15180. webidl.converters.RequestInfo
  15181. )
  15182. module.exports = {
  15183. Cache
  15184. }
  15185. /***/ }),
  15186. /***/ 7907:
  15187. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  15188. "use strict";
  15189. const { kConstruct } = __nccwpck_require__(9174)
  15190. const { Cache } = __nccwpck_require__(6101)
  15191. const { webidl } = __nccwpck_require__(1744)
  15192. const { kEnumerableProperty } = __nccwpck_require__(3983)
  15193. class CacheStorage {
  15194. /**
  15195. * @see https://w3c.github.io/ServiceWorker/#dfn-relevant-name-to-cache-map
  15196. * @type {Map<string, import('./cache').requestResponseList}
  15197. */
  15198. #caches = new Map()
  15199. constructor () {
  15200. if (arguments[0] !== kConstruct) {
  15201. webidl.illegalConstructor()
  15202. }
  15203. }
  15204. async match (request, options = {}) {
  15205. webidl.brandCheck(this, CacheStorage)
  15206. webidl.argumentLengthCheck(arguments, 1, { header: 'CacheStorage.match' })
  15207. request = webidl.converters.RequestInfo(request)
  15208. options = webidl.converters.MultiCacheQueryOptions(options)
  15209. // 1.
  15210. if (options.cacheName != null) {
  15211. // 1.1.1.1
  15212. if (this.#caches.has(options.cacheName)) {
  15213. // 1.1.1.1.1
  15214. const cacheList = this.#caches.get(options.cacheName)
  15215. const cache = new Cache(kConstruct, cacheList)
  15216. return await cache.match(request, options)
  15217. }
  15218. } else { // 2.
  15219. // 2.2
  15220. for (const cacheList of this.#caches.values()) {
  15221. const cache = new Cache(kConstruct, cacheList)
  15222. // 2.2.1.2
  15223. const response = await cache.match(request, options)
  15224. if (response !== undefined) {
  15225. return response
  15226. }
  15227. }
  15228. }
  15229. }
  15230. /**
  15231. * @see https://w3c.github.io/ServiceWorker/#cache-storage-has
  15232. * @param {string} cacheName
  15233. * @returns {Promise<boolean>}
  15234. */
  15235. async has (cacheName) {
  15236. webidl.brandCheck(this, CacheStorage)
  15237. webidl.argumentLengthCheck(arguments, 1, { header: 'CacheStorage.has' })
  15238. cacheName = webidl.converters.DOMString(cacheName)
  15239. // 2.1.1
  15240. // 2.2
  15241. return this.#caches.has(cacheName)
  15242. }
  15243. /**
  15244. * @see https://w3c.github.io/ServiceWorker/#dom-cachestorage-open
  15245. * @param {string} cacheName
  15246. * @returns {Promise<Cache>}
  15247. */
  15248. async open (cacheName) {
  15249. webidl.brandCheck(this, CacheStorage)
  15250. webidl.argumentLengthCheck(arguments, 1, { header: 'CacheStorage.open' })
  15251. cacheName = webidl.converters.DOMString(cacheName)
  15252. // 2.1
  15253. if (this.#caches.has(cacheName)) {
  15254. // await caches.open('v1') !== await caches.open('v1')
  15255. // 2.1.1
  15256. const cache = this.#caches.get(cacheName)
  15257. // 2.1.1.1
  15258. return new Cache(kConstruct, cache)
  15259. }
  15260. // 2.2
  15261. const cache = []
  15262. // 2.3
  15263. this.#caches.set(cacheName, cache)
  15264. // 2.4
  15265. return new Cache(kConstruct, cache)
  15266. }
  15267. /**
  15268. * @see https://w3c.github.io/ServiceWorker/#cache-storage-delete
  15269. * @param {string} cacheName
  15270. * @returns {Promise<boolean>}
  15271. */
  15272. async delete (cacheName) {
  15273. webidl.brandCheck(this, CacheStorage)
  15274. webidl.argumentLengthCheck(arguments, 1, { header: 'CacheStorage.delete' })
  15275. cacheName = webidl.converters.DOMString(cacheName)
  15276. return this.#caches.delete(cacheName)
  15277. }
  15278. /**
  15279. * @see https://w3c.github.io/ServiceWorker/#cache-storage-keys
  15280. * @returns {string[]}
  15281. */
  15282. async keys () {
  15283. webidl.brandCheck(this, CacheStorage)
  15284. // 2.1
  15285. const keys = this.#caches.keys()
  15286. // 2.2
  15287. return [...keys]
  15288. }
  15289. }
  15290. Object.defineProperties(CacheStorage.prototype, {
  15291. [Symbol.toStringTag]: {
  15292. value: 'CacheStorage',
  15293. configurable: true
  15294. },
  15295. match: kEnumerableProperty,
  15296. has: kEnumerableProperty,
  15297. open: kEnumerableProperty,
  15298. delete: kEnumerableProperty,
  15299. keys: kEnumerableProperty
  15300. })
  15301. module.exports = {
  15302. CacheStorage
  15303. }
  15304. /***/ }),
  15305. /***/ 9174:
  15306. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  15307. "use strict";
  15308. module.exports = {
  15309. kConstruct: (__nccwpck_require__(2785).kConstruct)
  15310. }
  15311. /***/ }),
  15312. /***/ 2396:
  15313. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  15314. "use strict";
  15315. const assert = __nccwpck_require__(9491)
  15316. const { URLSerializer } = __nccwpck_require__(685)
  15317. const { isValidHeaderName } = __nccwpck_require__(2538)
  15318. /**
  15319. * @see https://url.spec.whatwg.org/#concept-url-equals
  15320. * @param {URL} A
  15321. * @param {URL} B
  15322. * @param {boolean | undefined} excludeFragment
  15323. * @returns {boolean}
  15324. */
  15325. function urlEquals (A, B, excludeFragment = false) {
  15326. const serializedA = URLSerializer(A, excludeFragment)
  15327. const serializedB = URLSerializer(B, excludeFragment)
  15328. return serializedA === serializedB
  15329. }
  15330. /**
  15331. * @see https://github.com/chromium/chromium/blob/694d20d134cb553d8d89e5500b9148012b1ba299/content/browser/cache_storage/cache_storage_cache.cc#L260-L262
  15332. * @param {string} header
  15333. */
  15334. function fieldValues (header) {
  15335. assert(header !== null)
  15336. const values = []
  15337. for (let value of header.split(',')) {
  15338. value = value.trim()
  15339. if (!value.length) {
  15340. continue
  15341. } else if (!isValidHeaderName(value)) {
  15342. continue
  15343. }
  15344. values.push(value)
  15345. }
  15346. return values
  15347. }
  15348. module.exports = {
  15349. urlEquals,
  15350. fieldValues
  15351. }
  15352. /***/ }),
  15353. /***/ 3598:
  15354. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  15355. "use strict";
  15356. // @ts-check
  15357. /* global WebAssembly */
  15358. const assert = __nccwpck_require__(9491)
  15359. const net = __nccwpck_require__(1808)
  15360. const http = __nccwpck_require__(3685)
  15361. const { pipeline } = __nccwpck_require__(2781)
  15362. const util = __nccwpck_require__(3983)
  15363. const timers = __nccwpck_require__(9459)
  15364. const Request = __nccwpck_require__(2905)
  15365. const DispatcherBase = __nccwpck_require__(4839)
  15366. const {
  15367. RequestContentLengthMismatchError,
  15368. ResponseContentLengthMismatchError,
  15369. InvalidArgumentError,
  15370. RequestAbortedError,
  15371. HeadersTimeoutError,
  15372. HeadersOverflowError,
  15373. SocketError,
  15374. InformationalError,
  15375. BodyTimeoutError,
  15376. HTTPParserError,
  15377. ResponseExceededMaxSizeError,
  15378. ClientDestroyedError
  15379. } = __nccwpck_require__(8045)
  15380. const buildConnector = __nccwpck_require__(2067)
  15381. const {
  15382. kUrl,
  15383. kReset,
  15384. kServerName,
  15385. kClient,
  15386. kBusy,
  15387. kParser,
  15388. kConnect,
  15389. kBlocking,
  15390. kResuming,
  15391. kRunning,
  15392. kPending,
  15393. kSize,
  15394. kWriting,
  15395. kQueue,
  15396. kConnected,
  15397. kConnecting,
  15398. kNeedDrain,
  15399. kNoRef,
  15400. kKeepAliveDefaultTimeout,
  15401. kHostHeader,
  15402. kPendingIdx,
  15403. kRunningIdx,
  15404. kError,
  15405. kPipelining,
  15406. kSocket,
  15407. kKeepAliveTimeoutValue,
  15408. kMaxHeadersSize,
  15409. kKeepAliveMaxTimeout,
  15410. kKeepAliveTimeoutThreshold,
  15411. kHeadersTimeout,
  15412. kBodyTimeout,
  15413. kStrictContentLength,
  15414. kConnector,
  15415. kMaxRedirections,
  15416. kMaxRequests,
  15417. kCounter,
  15418. kClose,
  15419. kDestroy,
  15420. kDispatch,
  15421. kInterceptors,
  15422. kLocalAddress,
  15423. kMaxResponseSize,
  15424. kHTTPConnVersion,
  15425. // HTTP2
  15426. kHost,
  15427. kHTTP2Session,
  15428. kHTTP2SessionState,
  15429. kHTTP2BuildRequest,
  15430. kHTTP2CopyHeaders,
  15431. kHTTP1BuildRequest
  15432. } = __nccwpck_require__(2785)
  15433. /** @type {import('http2')} */
  15434. let http2
  15435. try {
  15436. http2 = __nccwpck_require__(5158)
  15437. } catch {
  15438. // @ts-ignore
  15439. http2 = { constants: {} }
  15440. }
  15441. const {
  15442. constants: {
  15443. HTTP2_HEADER_AUTHORITY,
  15444. HTTP2_HEADER_METHOD,
  15445. HTTP2_HEADER_PATH,
  15446. HTTP2_HEADER_SCHEME,
  15447. HTTP2_HEADER_CONTENT_LENGTH,
  15448. HTTP2_HEADER_EXPECT,
  15449. HTTP2_HEADER_STATUS
  15450. }
  15451. } = http2
  15452. // Experimental
  15453. let h2ExperimentalWarned = false
  15454. const FastBuffer = Buffer[Symbol.species]
  15455. const kClosedResolve = Symbol('kClosedResolve')
  15456. const channels = {}
  15457. try {
  15458. const diagnosticsChannel = __nccwpck_require__(7643)
  15459. channels.sendHeaders = diagnosticsChannel.channel('undici:client:sendHeaders')
  15460. channels.beforeConnect = diagnosticsChannel.channel('undici:client:beforeConnect')
  15461. channels.connectError = diagnosticsChannel.channel('undici:client:connectError')
  15462. channels.connected = diagnosticsChannel.channel('undici:client:connected')
  15463. } catch {
  15464. channels.sendHeaders = { hasSubscribers: false }
  15465. channels.beforeConnect = { hasSubscribers: false }
  15466. channels.connectError = { hasSubscribers: false }
  15467. channels.connected = { hasSubscribers: false }
  15468. }
  15469. /**
  15470. * @type {import('../types/client').default}
  15471. */
  15472. class Client extends DispatcherBase {
  15473. /**
  15474. *
  15475. * @param {string|URL} url
  15476. * @param {import('../types/client').Client.Options} options
  15477. */
  15478. constructor (url, {
  15479. interceptors,
  15480. maxHeaderSize,
  15481. headersTimeout,
  15482. socketTimeout,
  15483. requestTimeout,
  15484. connectTimeout,
  15485. bodyTimeout,
  15486. idleTimeout,
  15487. keepAlive,
  15488. keepAliveTimeout,
  15489. maxKeepAliveTimeout,
  15490. keepAliveMaxTimeout,
  15491. keepAliveTimeoutThreshold,
  15492. socketPath,
  15493. pipelining,
  15494. tls,
  15495. strictContentLength,
  15496. maxCachedSessions,
  15497. maxRedirections,
  15498. connect,
  15499. maxRequestsPerClient,
  15500. localAddress,
  15501. maxResponseSize,
  15502. autoSelectFamily,
  15503. autoSelectFamilyAttemptTimeout,
  15504. // h2
  15505. allowH2,
  15506. maxConcurrentStreams
  15507. } = {}) {
  15508. super()
  15509. if (keepAlive !== undefined) {
  15510. throw new InvalidArgumentError('unsupported keepAlive, use pipelining=0 instead')
  15511. }
  15512. if (socketTimeout !== undefined) {
  15513. throw new InvalidArgumentError('unsupported socketTimeout, use headersTimeout & bodyTimeout instead')
  15514. }
  15515. if (requestTimeout !== undefined) {
  15516. throw new InvalidArgumentError('unsupported requestTimeout, use headersTimeout & bodyTimeout instead')
  15517. }
  15518. if (idleTimeout !== undefined) {
  15519. throw new InvalidArgumentError('unsupported idleTimeout, use keepAliveTimeout instead')
  15520. }
  15521. if (maxKeepAliveTimeout !== undefined) {
  15522. throw new InvalidArgumentError('unsupported maxKeepAliveTimeout, use keepAliveMaxTimeout instead')
  15523. }
  15524. if (maxHeaderSize != null && !Number.isFinite(maxHeaderSize)) {
  15525. throw new InvalidArgumentError('invalid maxHeaderSize')
  15526. }
  15527. if (socketPath != null && typeof socketPath !== 'string') {
  15528. throw new InvalidArgumentError('invalid socketPath')
  15529. }
  15530. if (connectTimeout != null && (!Number.isFinite(connectTimeout) || connectTimeout < 0)) {
  15531. throw new InvalidArgumentError('invalid connectTimeout')
  15532. }
  15533. if (keepAliveTimeout != null && (!Number.isFinite(keepAliveTimeout) || keepAliveTimeout <= 0)) {
  15534. throw new InvalidArgumentError('invalid keepAliveTimeout')
  15535. }
  15536. if (keepAliveMaxTimeout != null && (!Number.isFinite(keepAliveMaxTimeout) || keepAliveMaxTimeout <= 0)) {
  15537. throw new InvalidArgumentError('invalid keepAliveMaxTimeout')
  15538. }
  15539. if (keepAliveTimeoutThreshold != null && !Number.isFinite(keepAliveTimeoutThreshold)) {
  15540. throw new InvalidArgumentError('invalid keepAliveTimeoutThreshold')
  15541. }
  15542. if (headersTimeout != null && (!Number.isInteger(headersTimeout) || headersTimeout < 0)) {
  15543. throw new InvalidArgumentError('headersTimeout must be a positive integer or zero')
  15544. }
  15545. if (bodyTimeout != null && (!Number.isInteger(bodyTimeout) || bodyTimeout < 0)) {
  15546. throw new InvalidArgumentError('bodyTimeout must be a positive integer or zero')
  15547. }
  15548. if (connect != null && typeof connect !== 'function' && typeof connect !== 'object') {
  15549. throw new InvalidArgumentError('connect must be a function or an object')
  15550. }
  15551. if (maxRedirections != null && (!Number.isInteger(maxRedirections) || maxRedirections < 0)) {
  15552. throw new InvalidArgumentError('maxRedirections must be a positive number')
  15553. }
  15554. if (maxRequestsPerClient != null && (!Number.isInteger(maxRequestsPerClient) || maxRequestsPerClient < 0)) {
  15555. throw new InvalidArgumentError('maxRequestsPerClient must be a positive number')
  15556. }
  15557. if (localAddress != null && (typeof localAddress !== 'string' || net.isIP(localAddress) === 0)) {
  15558. throw new InvalidArgumentError('localAddress must be valid string IP address')
  15559. }
  15560. if (maxResponseSize != null && (!Number.isInteger(maxResponseSize) || maxResponseSize < -1)) {
  15561. throw new InvalidArgumentError('maxResponseSize must be a positive number')
  15562. }
  15563. if (
  15564. autoSelectFamilyAttemptTimeout != null &&
  15565. (!Number.isInteger(autoSelectFamilyAttemptTimeout) || autoSelectFamilyAttemptTimeout < -1)
  15566. ) {
  15567. throw new InvalidArgumentError('autoSelectFamilyAttemptTimeout must be a positive number')
  15568. }
  15569. // h2
  15570. if (allowH2 != null && typeof allowH2 !== 'boolean') {
  15571. throw new InvalidArgumentError('allowH2 must be a valid boolean value')
  15572. }
  15573. if (maxConcurrentStreams != null && (typeof maxConcurrentStreams !== 'number' || maxConcurrentStreams < 1)) {
  15574. throw new InvalidArgumentError('maxConcurrentStreams must be a possitive integer, greater than 0')
  15575. }
  15576. if (typeof connect !== 'function') {
  15577. connect = buildConnector({
  15578. ...tls,
  15579. maxCachedSessions,
  15580. allowH2,
  15581. socketPath,
  15582. timeout: connectTimeout,
  15583. ...(util.nodeHasAutoSelectFamily && autoSelectFamily ? { autoSelectFamily, autoSelectFamilyAttemptTimeout } : undefined),
  15584. ...connect
  15585. })
  15586. }
  15587. this[kInterceptors] = interceptors && interceptors.Client && Array.isArray(interceptors.Client)
  15588. ? interceptors.Client
  15589. : [createRedirectInterceptor({ maxRedirections })]
  15590. this[kUrl] = util.parseOrigin(url)
  15591. this[kConnector] = connect
  15592. this[kSocket] = null
  15593. this[kPipelining] = pipelining != null ? pipelining : 1
  15594. this[kMaxHeadersSize] = maxHeaderSize || http.maxHeaderSize
  15595. this[kKeepAliveDefaultTimeout] = keepAliveTimeout == null ? 4e3 : keepAliveTimeout
  15596. this[kKeepAliveMaxTimeout] = keepAliveMaxTimeout == null ? 600e3 : keepAliveMaxTimeout
  15597. this[kKeepAliveTimeoutThreshold] = keepAliveTimeoutThreshold == null ? 1e3 : keepAliveTimeoutThreshold
  15598. this[kKeepAliveTimeoutValue] = this[kKeepAliveDefaultTimeout]
  15599. this[kServerName] = null
  15600. this[kLocalAddress] = localAddress != null ? localAddress : null
  15601. this[kResuming] = 0 // 0, idle, 1, scheduled, 2 resuming
  15602. this[kNeedDrain] = 0 // 0, idle, 1, scheduled, 2 resuming
  15603. this[kHostHeader] = `host: ${this[kUrl].hostname}${this[kUrl].port ? `:${this[kUrl].port}` : ''}\r\n`
  15604. this[kBodyTimeout] = bodyTimeout != null ? bodyTimeout : 300e3
  15605. this[kHeadersTimeout] = headersTimeout != null ? headersTimeout : 300e3
  15606. this[kStrictContentLength] = strictContentLength == null ? true : strictContentLength
  15607. this[kMaxRedirections] = maxRedirections
  15608. this[kMaxRequests] = maxRequestsPerClient
  15609. this[kClosedResolve] = null
  15610. this[kMaxResponseSize] = maxResponseSize > -1 ? maxResponseSize : -1
  15611. this[kHTTPConnVersion] = 'h1'
  15612. // HTTP/2
  15613. this[kHTTP2Session] = null
  15614. this[kHTTP2SessionState] = !allowH2
  15615. ? null
  15616. : {
  15617. // streams: null, // Fixed queue of streams - For future support of `push`
  15618. openStreams: 0, // Keep track of them to decide wether or not unref the session
  15619. maxConcurrentStreams: maxConcurrentStreams != null ? maxConcurrentStreams : 100 // Max peerConcurrentStreams for a Node h2 server
  15620. }
  15621. this[kHost] = `${this[kUrl].hostname}${this[kUrl].port ? `:${this[kUrl].port}` : ''}`
  15622. // kQueue is built up of 3 sections separated by
  15623. // the kRunningIdx and kPendingIdx indices.
  15624. // | complete | running | pending |
  15625. // ^ kRunningIdx ^ kPendingIdx ^ kQueue.length
  15626. // kRunningIdx points to the first running element.
  15627. // kPendingIdx points to the first pending element.
  15628. // This implements a fast queue with an amortized
  15629. // time of O(1).
  15630. this[kQueue] = []
  15631. this[kRunningIdx] = 0
  15632. this[kPendingIdx] = 0
  15633. }
  15634. get pipelining () {
  15635. return this[kPipelining]
  15636. }
  15637. set pipelining (value) {
  15638. this[kPipelining] = value
  15639. resume(this, true)
  15640. }
  15641. get [kPending] () {
  15642. return this[kQueue].length - this[kPendingIdx]
  15643. }
  15644. get [kRunning] () {
  15645. return this[kPendingIdx] - this[kRunningIdx]
  15646. }
  15647. get [kSize] () {
  15648. return this[kQueue].length - this[kRunningIdx]
  15649. }
  15650. get [kConnected] () {
  15651. return !!this[kSocket] && !this[kConnecting] && !this[kSocket].destroyed
  15652. }
  15653. get [kBusy] () {
  15654. const socket = this[kSocket]
  15655. return (
  15656. (socket && (socket[kReset] || socket[kWriting] || socket[kBlocking])) ||
  15657. (this[kSize] >= (this[kPipelining] || 1)) ||
  15658. this[kPending] > 0
  15659. )
  15660. }
  15661. /* istanbul ignore: only used for test */
  15662. [kConnect] (cb) {
  15663. connect(this)
  15664. this.once('connect', cb)
  15665. }
  15666. [kDispatch] (opts, handler) {
  15667. const origin = opts.origin || this[kUrl].origin
  15668. const request = this[kHTTPConnVersion] === 'h2'
  15669. ? Request[kHTTP2BuildRequest](origin, opts, handler)
  15670. : Request[kHTTP1BuildRequest](origin, opts, handler)
  15671. this[kQueue].push(request)
  15672. if (this[kResuming]) {
  15673. // Do nothing.
  15674. } else if (util.bodyLength(request.body) == null && util.isIterable(request.body)) {
  15675. // Wait a tick in case stream/iterator is ended in the same tick.
  15676. this[kResuming] = 1
  15677. process.nextTick(resume, this)
  15678. } else {
  15679. resume(this, true)
  15680. }
  15681. if (this[kResuming] && this[kNeedDrain] !== 2 && this[kBusy]) {
  15682. this[kNeedDrain] = 2
  15683. }
  15684. return this[kNeedDrain] < 2
  15685. }
  15686. async [kClose] () {
  15687. // TODO: for H2 we need to gracefully flush the remaining enqueued
  15688. // request and close each stream.
  15689. return new Promise((resolve) => {
  15690. if (!this[kSize]) {
  15691. resolve(null)
  15692. } else {
  15693. this[kClosedResolve] = resolve
  15694. }
  15695. })
  15696. }
  15697. async [kDestroy] (err) {
  15698. return new Promise((resolve) => {
  15699. const requests = this[kQueue].splice(this[kPendingIdx])
  15700. for (let i = 0; i < requests.length; i++) {
  15701. const request = requests[i]
  15702. errorRequest(this, request, err)
  15703. }
  15704. const callback = () => {
  15705. if (this[kClosedResolve]) {
  15706. // TODO (fix): Should we error here with ClientDestroyedError?
  15707. this[kClosedResolve]()
  15708. this[kClosedResolve] = null
  15709. }
  15710. resolve()
  15711. }
  15712. if (this[kHTTP2Session] != null) {
  15713. util.destroy(this[kHTTP2Session], err)
  15714. this[kHTTP2Session] = null
  15715. this[kHTTP2SessionState] = null
  15716. }
  15717. if (!this[kSocket]) {
  15718. queueMicrotask(callback)
  15719. } else {
  15720. util.destroy(this[kSocket].on('close', callback), err)
  15721. }
  15722. resume(this)
  15723. })
  15724. }
  15725. }
  15726. function onHttp2SessionError (err) {
  15727. assert(err.code !== 'ERR_TLS_CERT_ALTNAME_INVALID')
  15728. this[kSocket][kError] = err
  15729. onError(this[kClient], err)
  15730. }
  15731. function onHttp2FrameError (type, code, id) {
  15732. const err = new InformationalError(`HTTP/2: "frameError" received - type ${type}, code ${code}`)
  15733. if (id === 0) {
  15734. this[kSocket][kError] = err
  15735. onError(this[kClient], err)
  15736. }
  15737. }
  15738. function onHttp2SessionEnd () {
  15739. util.destroy(this, new SocketError('other side closed'))
  15740. util.destroy(this[kSocket], new SocketError('other side closed'))
  15741. }
  15742. function onHTTP2GoAway (code) {
  15743. const client = this[kClient]
  15744. const err = new InformationalError(`HTTP/2: "GOAWAY" frame received with code ${code}`)
  15745. client[kSocket] = null
  15746. client[kHTTP2Session] = null
  15747. if (client.destroyed) {
  15748. assert(this[kPending] === 0)
  15749. // Fail entire queue.
  15750. const requests = client[kQueue].splice(client[kRunningIdx])
  15751. for (let i = 0; i < requests.length; i++) {
  15752. const request = requests[i]
  15753. errorRequest(this, request, err)
  15754. }
  15755. } else if (client[kRunning] > 0) {
  15756. // Fail head of pipeline.
  15757. const request = client[kQueue][client[kRunningIdx]]
  15758. client[kQueue][client[kRunningIdx]++] = null
  15759. errorRequest(client, request, err)
  15760. }
  15761. client[kPendingIdx] = client[kRunningIdx]
  15762. assert(client[kRunning] === 0)
  15763. client.emit('disconnect',
  15764. client[kUrl],
  15765. [client],
  15766. err
  15767. )
  15768. resume(client)
  15769. }
  15770. const constants = __nccwpck_require__(953)
  15771. const createRedirectInterceptor = __nccwpck_require__(8861)
  15772. const EMPTY_BUF = Buffer.alloc(0)
  15773. async function lazyllhttp () {
  15774. const llhttpWasmData = process.env.JEST_WORKER_ID ? __nccwpck_require__(1145) : undefined
  15775. let mod
  15776. try {
  15777. mod = await WebAssembly.compile(Buffer.from(__nccwpck_require__(5627), 'base64'))
  15778. } catch (e) {
  15779. /* istanbul ignore next */
  15780. // We could check if the error was caused by the simd option not
  15781. // being enabled, but the occurring of this other error
  15782. // * https://github.com/emscripten-core/emscripten/issues/11495
  15783. // got me to remove that check to avoid breaking Node 12.
  15784. mod = await WebAssembly.compile(Buffer.from(llhttpWasmData || __nccwpck_require__(1145), 'base64'))
  15785. }
  15786. return await WebAssembly.instantiate(mod, {
  15787. env: {
  15788. /* eslint-disable camelcase */
  15789. wasm_on_url: (p, at, len) => {
  15790. /* istanbul ignore next */
  15791. return 0
  15792. },
  15793. wasm_on_status: (p, at, len) => {
  15794. assert.strictEqual(currentParser.ptr, p)
  15795. const start = at - currentBufferPtr + currentBufferRef.byteOffset
  15796. return currentParser.onStatus(new FastBuffer(currentBufferRef.buffer, start, len)) || 0
  15797. },
  15798. wasm_on_message_begin: (p) => {
  15799. assert.strictEqual(currentParser.ptr, p)
  15800. return currentParser.onMessageBegin() || 0
  15801. },
  15802. wasm_on_header_field: (p, at, len) => {
  15803. assert.strictEqual(currentParser.ptr, p)
  15804. const start = at - currentBufferPtr + currentBufferRef.byteOffset
  15805. return currentParser.onHeaderField(new FastBuffer(currentBufferRef.buffer, start, len)) || 0
  15806. },
  15807. wasm_on_header_value: (p, at, len) => {
  15808. assert.strictEqual(currentParser.ptr, p)
  15809. const start = at - currentBufferPtr + currentBufferRef.byteOffset
  15810. return currentParser.onHeaderValue(new FastBuffer(currentBufferRef.buffer, start, len)) || 0
  15811. },
  15812. wasm_on_headers_complete: (p, statusCode, upgrade, shouldKeepAlive) => {
  15813. assert.strictEqual(currentParser.ptr, p)
  15814. return currentParser.onHeadersComplete(statusCode, Boolean(upgrade), Boolean(shouldKeepAlive)) || 0
  15815. },
  15816. wasm_on_body: (p, at, len) => {
  15817. assert.strictEqual(currentParser.ptr, p)
  15818. const start = at - currentBufferPtr + currentBufferRef.byteOffset
  15819. return currentParser.onBody(new FastBuffer(currentBufferRef.buffer, start, len)) || 0
  15820. },
  15821. wasm_on_message_complete: (p) => {
  15822. assert.strictEqual(currentParser.ptr, p)
  15823. return currentParser.onMessageComplete() || 0
  15824. }
  15825. /* eslint-enable camelcase */
  15826. }
  15827. })
  15828. }
  15829. let llhttpInstance = null
  15830. let llhttpPromise = lazyllhttp()
  15831. llhttpPromise.catch()
  15832. let currentParser = null
  15833. let currentBufferRef = null
  15834. let currentBufferSize = 0
  15835. let currentBufferPtr = null
  15836. const TIMEOUT_HEADERS = 1
  15837. const TIMEOUT_BODY = 2
  15838. const TIMEOUT_IDLE = 3
  15839. class Parser {
  15840. constructor (client, socket, { exports }) {
  15841. assert(Number.isFinite(client[kMaxHeadersSize]) && client[kMaxHeadersSize] > 0)
  15842. this.llhttp = exports
  15843. this.ptr = this.llhttp.llhttp_alloc(constants.TYPE.RESPONSE)
  15844. this.client = client
  15845. this.socket = socket
  15846. this.timeout = null
  15847. this.timeoutValue = null
  15848. this.timeoutType = null
  15849. this.statusCode = null
  15850. this.statusText = ''
  15851. this.upgrade = false
  15852. this.headers = []
  15853. this.headersSize = 0
  15854. this.headersMaxSize = client[kMaxHeadersSize]
  15855. this.shouldKeepAlive = false
  15856. this.paused = false
  15857. this.resume = this.resume.bind(this)
  15858. this.bytesRead = 0
  15859. this.keepAlive = ''
  15860. this.contentLength = ''
  15861. this.connection = ''
  15862. this.maxResponseSize = client[kMaxResponseSize]
  15863. }
  15864. setTimeout (value, type) {
  15865. this.timeoutType = type
  15866. if (value !== this.timeoutValue) {
  15867. timers.clearTimeout(this.timeout)
  15868. if (value) {
  15869. this.timeout = timers.setTimeout(onParserTimeout, value, this)
  15870. // istanbul ignore else: only for jest
  15871. if (this.timeout.unref) {
  15872. this.timeout.unref()
  15873. }
  15874. } else {
  15875. this.timeout = null
  15876. }
  15877. this.timeoutValue = value
  15878. } else if (this.timeout) {
  15879. // istanbul ignore else: only for jest
  15880. if (this.timeout.refresh) {
  15881. this.timeout.refresh()
  15882. }
  15883. }
  15884. }
  15885. resume () {
  15886. if (this.socket.destroyed || !this.paused) {
  15887. return
  15888. }
  15889. assert(this.ptr != null)
  15890. assert(currentParser == null)
  15891. this.llhttp.llhttp_resume(this.ptr)
  15892. assert(this.timeoutType === TIMEOUT_BODY)
  15893. if (this.timeout) {
  15894. // istanbul ignore else: only for jest
  15895. if (this.timeout.refresh) {
  15896. this.timeout.refresh()
  15897. }
  15898. }
  15899. this.paused = false
  15900. this.execute(this.socket.read() || EMPTY_BUF) // Flush parser.
  15901. this.readMore()
  15902. }
  15903. readMore () {
  15904. while (!this.paused && this.ptr) {
  15905. const chunk = this.socket.read()
  15906. if (chunk === null) {
  15907. break
  15908. }
  15909. this.execute(chunk)
  15910. }
  15911. }
  15912. execute (data) {
  15913. assert(this.ptr != null)
  15914. assert(currentParser == null)
  15915. assert(!this.paused)
  15916. const { socket, llhttp } = this
  15917. if (data.length > currentBufferSize) {
  15918. if (currentBufferPtr) {
  15919. llhttp.free(currentBufferPtr)
  15920. }
  15921. currentBufferSize = Math.ceil(data.length / 4096) * 4096
  15922. currentBufferPtr = llhttp.malloc(currentBufferSize)
  15923. }
  15924. new Uint8Array(llhttp.memory.buffer, currentBufferPtr, currentBufferSize).set(data)
  15925. // Call `execute` on the wasm parser.
  15926. // We pass the `llhttp_parser` pointer address, the pointer address of buffer view data,
  15927. // and finally the length of bytes to parse.
  15928. // The return value is an error code or `constants.ERROR.OK`.
  15929. try {
  15930. let ret
  15931. try {
  15932. currentBufferRef = data
  15933. currentParser = this
  15934. ret = llhttp.llhttp_execute(this.ptr, currentBufferPtr, data.length)
  15935. /* eslint-disable-next-line no-useless-catch */
  15936. } catch (err) {
  15937. /* istanbul ignore next: difficult to make a test case for */
  15938. throw err
  15939. } finally {
  15940. currentParser = null
  15941. currentBufferRef = null
  15942. }
  15943. const offset = llhttp.llhttp_get_error_pos(this.ptr) - currentBufferPtr
  15944. if (ret === constants.ERROR.PAUSED_UPGRADE) {
  15945. this.onUpgrade(data.slice(offset))
  15946. } else if (ret === constants.ERROR.PAUSED) {
  15947. this.paused = true
  15948. socket.unshift(data.slice(offset))
  15949. } else if (ret !== constants.ERROR.OK) {
  15950. const ptr = llhttp.llhttp_get_error_reason(this.ptr)
  15951. let message = ''
  15952. /* istanbul ignore else: difficult to make a test case for */
  15953. if (ptr) {
  15954. const len = new Uint8Array(llhttp.memory.buffer, ptr).indexOf(0)
  15955. message =
  15956. 'Response does not match the HTTP/1.1 protocol (' +
  15957. Buffer.from(llhttp.memory.buffer, ptr, len).toString() +
  15958. ')'
  15959. }
  15960. throw new HTTPParserError(message, constants.ERROR[ret], data.slice(offset))
  15961. }
  15962. } catch (err) {
  15963. util.destroy(socket, err)
  15964. }
  15965. }
  15966. destroy () {
  15967. assert(this.ptr != null)
  15968. assert(currentParser == null)
  15969. this.llhttp.llhttp_free(this.ptr)
  15970. this.ptr = null
  15971. timers.clearTimeout(this.timeout)
  15972. this.timeout = null
  15973. this.timeoutValue = null
  15974. this.timeoutType = null
  15975. this.paused = false
  15976. }
  15977. onStatus (buf) {
  15978. this.statusText = buf.toString()
  15979. }
  15980. onMessageBegin () {
  15981. const { socket, client } = this
  15982. /* istanbul ignore next: difficult to make a test case for */
  15983. if (socket.destroyed) {
  15984. return -1
  15985. }
  15986. const request = client[kQueue][client[kRunningIdx]]
  15987. if (!request) {
  15988. return -1
  15989. }
  15990. }
  15991. onHeaderField (buf) {
  15992. const len = this.headers.length
  15993. if ((len & 1) === 0) {
  15994. this.headers.push(buf)
  15995. } else {
  15996. this.headers[len - 1] = Buffer.concat([this.headers[len - 1], buf])
  15997. }
  15998. this.trackHeader(buf.length)
  15999. }
  16000. onHeaderValue (buf) {
  16001. let len = this.headers.length
  16002. if ((len & 1) === 1) {
  16003. this.headers.push(buf)
  16004. len += 1
  16005. } else {
  16006. this.headers[len - 1] = Buffer.concat([this.headers[len - 1], buf])
  16007. }
  16008. const key = this.headers[len - 2]
  16009. if (key.length === 10 && key.toString().toLowerCase() === 'keep-alive') {
  16010. this.keepAlive += buf.toString()
  16011. } else if (key.length === 10 && key.toString().toLowerCase() === 'connection') {
  16012. this.connection += buf.toString()
  16013. } else if (key.length === 14 && key.toString().toLowerCase() === 'content-length') {
  16014. this.contentLength += buf.toString()
  16015. }
  16016. this.trackHeader(buf.length)
  16017. }
  16018. trackHeader (len) {
  16019. this.headersSize += len
  16020. if (this.headersSize >= this.headersMaxSize) {
  16021. util.destroy(this.socket, new HeadersOverflowError())
  16022. }
  16023. }
  16024. onUpgrade (head) {
  16025. const { upgrade, client, socket, headers, statusCode } = this
  16026. assert(upgrade)
  16027. const request = client[kQueue][client[kRunningIdx]]
  16028. assert(request)
  16029. assert(!socket.destroyed)
  16030. assert(socket === client[kSocket])
  16031. assert(!this.paused)
  16032. assert(request.upgrade || request.method === 'CONNECT')
  16033. this.statusCode = null
  16034. this.statusText = ''
  16035. this.shouldKeepAlive = null
  16036. assert(this.headers.length % 2 === 0)
  16037. this.headers = []
  16038. this.headersSize = 0
  16039. socket.unshift(head)
  16040. socket[kParser].destroy()
  16041. socket[kParser] = null
  16042. socket[kClient] = null
  16043. socket[kError] = null
  16044. socket
  16045. .removeListener('error', onSocketError)
  16046. .removeListener('readable', onSocketReadable)
  16047. .removeListener('end', onSocketEnd)
  16048. .removeListener('close', onSocketClose)
  16049. client[kSocket] = null
  16050. client[kQueue][client[kRunningIdx]++] = null
  16051. client.emit('disconnect', client[kUrl], [client], new InformationalError('upgrade'))
  16052. try {
  16053. request.onUpgrade(statusCode, headers, socket)
  16054. } catch (err) {
  16055. util.destroy(socket, err)
  16056. }
  16057. resume(client)
  16058. }
  16059. onHeadersComplete (statusCode, upgrade, shouldKeepAlive) {
  16060. const { client, socket, headers, statusText } = this
  16061. /* istanbul ignore next: difficult to make a test case for */
  16062. if (socket.destroyed) {
  16063. return -1
  16064. }
  16065. const request = client[kQueue][client[kRunningIdx]]
  16066. /* istanbul ignore next: difficult to make a test case for */
  16067. if (!request) {
  16068. return -1
  16069. }
  16070. assert(!this.upgrade)
  16071. assert(this.statusCode < 200)
  16072. if (statusCode === 100) {
  16073. util.destroy(socket, new SocketError('bad response', util.getSocketInfo(socket)))
  16074. return -1
  16075. }
  16076. /* this can only happen if server is misbehaving */
  16077. if (upgrade && !request.upgrade) {
  16078. util.destroy(socket, new SocketError('bad upgrade', util.getSocketInfo(socket)))
  16079. return -1
  16080. }
  16081. assert.strictEqual(this.timeoutType, TIMEOUT_HEADERS)
  16082. this.statusCode = statusCode
  16083. this.shouldKeepAlive = (
  16084. shouldKeepAlive ||
  16085. // Override llhttp value which does not allow keepAlive for HEAD.
  16086. (request.method === 'HEAD' && !socket[kReset] && this.connection.toLowerCase() === 'keep-alive')
  16087. )
  16088. if (this.statusCode >= 200) {
  16089. const bodyTimeout = request.bodyTimeout != null
  16090. ? request.bodyTimeout
  16091. : client[kBodyTimeout]
  16092. this.setTimeout(bodyTimeout, TIMEOUT_BODY)
  16093. } else if (this.timeout) {
  16094. // istanbul ignore else: only for jest
  16095. if (this.timeout.refresh) {
  16096. this.timeout.refresh()
  16097. }
  16098. }
  16099. if (request.method === 'CONNECT') {
  16100. assert(client[kRunning] === 1)
  16101. this.upgrade = true
  16102. return 2
  16103. }
  16104. if (upgrade) {
  16105. assert(client[kRunning] === 1)
  16106. this.upgrade = true
  16107. return 2
  16108. }
  16109. assert(this.headers.length % 2 === 0)
  16110. this.headers = []
  16111. this.headersSize = 0
  16112. if (this.shouldKeepAlive && client[kPipelining]) {
  16113. const keepAliveTimeout = this.keepAlive ? util.parseKeepAliveTimeout(this.keepAlive) : null
  16114. if (keepAliveTimeout != null) {
  16115. const timeout = Math.min(
  16116. keepAliveTimeout - client[kKeepAliveTimeoutThreshold],
  16117. client[kKeepAliveMaxTimeout]
  16118. )
  16119. if (timeout <= 0) {
  16120. socket[kReset] = true
  16121. } else {
  16122. client[kKeepAliveTimeoutValue] = timeout
  16123. }
  16124. } else {
  16125. client[kKeepAliveTimeoutValue] = client[kKeepAliveDefaultTimeout]
  16126. }
  16127. } else {
  16128. // Stop more requests from being dispatched.
  16129. socket[kReset] = true
  16130. }
  16131. const pause = request.onHeaders(statusCode, headers, this.resume, statusText) === false
  16132. if (request.aborted) {
  16133. return -1
  16134. }
  16135. if (request.method === 'HEAD') {
  16136. return 1
  16137. }
  16138. if (statusCode < 200) {
  16139. return 1
  16140. }
  16141. if (socket[kBlocking]) {
  16142. socket[kBlocking] = false
  16143. resume(client)
  16144. }
  16145. return pause ? constants.ERROR.PAUSED : 0
  16146. }
  16147. onBody (buf) {
  16148. const { client, socket, statusCode, maxResponseSize } = this
  16149. if (socket.destroyed) {
  16150. return -1
  16151. }
  16152. const request = client[kQueue][client[kRunningIdx]]
  16153. assert(request)
  16154. assert.strictEqual(this.timeoutType, TIMEOUT_BODY)
  16155. if (this.timeout) {
  16156. // istanbul ignore else: only for jest
  16157. if (this.timeout.refresh) {
  16158. this.timeout.refresh()
  16159. }
  16160. }
  16161. assert(statusCode >= 200)
  16162. if (maxResponseSize > -1 && this.bytesRead + buf.length > maxResponseSize) {
  16163. util.destroy(socket, new ResponseExceededMaxSizeError())
  16164. return -1
  16165. }
  16166. this.bytesRead += buf.length
  16167. if (request.onData(buf) === false) {
  16168. return constants.ERROR.PAUSED
  16169. }
  16170. }
  16171. onMessageComplete () {
  16172. const { client, socket, statusCode, upgrade, headers, contentLength, bytesRead, shouldKeepAlive } = this
  16173. if (socket.destroyed && (!statusCode || shouldKeepAlive)) {
  16174. return -1
  16175. }
  16176. if (upgrade) {
  16177. return
  16178. }
  16179. const request = client[kQueue][client[kRunningIdx]]
  16180. assert(request)
  16181. assert(statusCode >= 100)
  16182. this.statusCode = null
  16183. this.statusText = ''
  16184. this.bytesRead = 0
  16185. this.contentLength = ''
  16186. this.keepAlive = ''
  16187. this.connection = ''
  16188. assert(this.headers.length % 2 === 0)
  16189. this.headers = []
  16190. this.headersSize = 0
  16191. if (statusCode < 200) {
  16192. return
  16193. }
  16194. /* istanbul ignore next: should be handled by llhttp? */
  16195. if (request.method !== 'HEAD' && contentLength && bytesRead !== parseInt(contentLength, 10)) {
  16196. util.destroy(socket, new ResponseContentLengthMismatchError())
  16197. return -1
  16198. }
  16199. request.onComplete(headers)
  16200. client[kQueue][client[kRunningIdx]++] = null
  16201. if (socket[kWriting]) {
  16202. assert.strictEqual(client[kRunning], 0)
  16203. // Response completed before request.
  16204. util.destroy(socket, new InformationalError('reset'))
  16205. return constants.ERROR.PAUSED
  16206. } else if (!shouldKeepAlive) {
  16207. util.destroy(socket, new InformationalError('reset'))
  16208. return constants.ERROR.PAUSED
  16209. } else if (socket[kReset] && client[kRunning] === 0) {
  16210. // Destroy socket once all requests have completed.
  16211. // The request at the tail of the pipeline is the one
  16212. // that requested reset and no further requests should
  16213. // have been queued since then.
  16214. util.destroy(socket, new InformationalError('reset'))
  16215. return constants.ERROR.PAUSED
  16216. } else if (client[kPipelining] === 1) {
  16217. // We must wait a full event loop cycle to reuse this socket to make sure
  16218. // that non-spec compliant servers are not closing the connection even if they
  16219. // said they won't.
  16220. setImmediate(resume, client)
  16221. } else {
  16222. resume(client)
  16223. }
  16224. }
  16225. }
  16226. function onParserTimeout (parser) {
  16227. const { socket, timeoutType, client } = parser
  16228. /* istanbul ignore else */
  16229. if (timeoutType === TIMEOUT_HEADERS) {
  16230. if (!socket[kWriting] || socket.writableNeedDrain || client[kRunning] > 1) {
  16231. assert(!parser.paused, 'cannot be paused while waiting for headers')
  16232. util.destroy(socket, new HeadersTimeoutError())
  16233. }
  16234. } else if (timeoutType === TIMEOUT_BODY) {
  16235. if (!parser.paused) {
  16236. util.destroy(socket, new BodyTimeoutError())
  16237. }
  16238. } else if (timeoutType === TIMEOUT_IDLE) {
  16239. assert(client[kRunning] === 0 && client[kKeepAliveTimeoutValue])
  16240. util.destroy(socket, new InformationalError('socket idle timeout'))
  16241. }
  16242. }
  16243. function onSocketReadable () {
  16244. const { [kParser]: parser } = this
  16245. if (parser) {
  16246. parser.readMore()
  16247. }
  16248. }
  16249. function onSocketError (err) {
  16250. const { [kClient]: client, [kParser]: parser } = this
  16251. assert(err.code !== 'ERR_TLS_CERT_ALTNAME_INVALID')
  16252. if (client[kHTTPConnVersion] !== 'h2') {
  16253. // On Mac OS, we get an ECONNRESET even if there is a full body to be forwarded
  16254. // to the user.
  16255. if (err.code === 'ECONNRESET' && parser.statusCode && !parser.shouldKeepAlive) {
  16256. // We treat all incoming data so for as a valid response.
  16257. parser.onMessageComplete()
  16258. return
  16259. }
  16260. }
  16261. this[kError] = err
  16262. onError(this[kClient], err)
  16263. }
  16264. function onError (client, err) {
  16265. if (
  16266. client[kRunning] === 0 &&
  16267. err.code !== 'UND_ERR_INFO' &&
  16268. err.code !== 'UND_ERR_SOCKET'
  16269. ) {
  16270. // Error is not caused by running request and not a recoverable
  16271. // socket error.
  16272. assert(client[kPendingIdx] === client[kRunningIdx])
  16273. const requests = client[kQueue].splice(client[kRunningIdx])
  16274. for (let i = 0; i < requests.length; i++) {
  16275. const request = requests[i]
  16276. errorRequest(client, request, err)
  16277. }
  16278. assert(client[kSize] === 0)
  16279. }
  16280. }
  16281. function onSocketEnd () {
  16282. const { [kParser]: parser, [kClient]: client } = this
  16283. if (client[kHTTPConnVersion] !== 'h2') {
  16284. if (parser.statusCode && !parser.shouldKeepAlive) {
  16285. // We treat all incoming data so far as a valid response.
  16286. parser.onMessageComplete()
  16287. return
  16288. }
  16289. }
  16290. util.destroy(this, new SocketError('other side closed', util.getSocketInfo(this)))
  16291. }
  16292. function onSocketClose () {
  16293. const { [kClient]: client, [kParser]: parser } = this
  16294. if (client[kHTTPConnVersion] === 'h1' && parser) {
  16295. if (!this[kError] && parser.statusCode && !parser.shouldKeepAlive) {
  16296. // We treat all incoming data so far as a valid response.
  16297. parser.onMessageComplete()
  16298. }
  16299. this[kParser].destroy()
  16300. this[kParser] = null
  16301. }
  16302. const err = this[kError] || new SocketError('closed', util.getSocketInfo(this))
  16303. client[kSocket] = null
  16304. if (client.destroyed) {
  16305. assert(client[kPending] === 0)
  16306. // Fail entire queue.
  16307. const requests = client[kQueue].splice(client[kRunningIdx])
  16308. for (let i = 0; i < requests.length; i++) {
  16309. const request = requests[i]
  16310. errorRequest(client, request, err)
  16311. }
  16312. } else if (client[kRunning] > 0 && err.code !== 'UND_ERR_INFO') {
  16313. // Fail head of pipeline.
  16314. const request = client[kQueue][client[kRunningIdx]]
  16315. client[kQueue][client[kRunningIdx]++] = null
  16316. errorRequest(client, request, err)
  16317. }
  16318. client[kPendingIdx] = client[kRunningIdx]
  16319. assert(client[kRunning] === 0)
  16320. client.emit('disconnect', client[kUrl], [client], err)
  16321. resume(client)
  16322. }
  16323. async function connect (client) {
  16324. assert(!client[kConnecting])
  16325. assert(!client[kSocket])
  16326. let { host, hostname, protocol, port } = client[kUrl]
  16327. // Resolve ipv6
  16328. if (hostname[0] === '[') {
  16329. const idx = hostname.indexOf(']')
  16330. assert(idx !== -1)
  16331. const ip = hostname.substring(1, idx)
  16332. assert(net.isIP(ip))
  16333. hostname = ip
  16334. }
  16335. client[kConnecting] = true
  16336. if (channels.beforeConnect.hasSubscribers) {
  16337. channels.beforeConnect.publish({
  16338. connectParams: {
  16339. host,
  16340. hostname,
  16341. protocol,
  16342. port,
  16343. servername: client[kServerName],
  16344. localAddress: client[kLocalAddress]
  16345. },
  16346. connector: client[kConnector]
  16347. })
  16348. }
  16349. try {
  16350. const socket = await new Promise((resolve, reject) => {
  16351. client[kConnector]({
  16352. host,
  16353. hostname,
  16354. protocol,
  16355. port,
  16356. servername: client[kServerName],
  16357. localAddress: client[kLocalAddress]
  16358. }, (err, socket) => {
  16359. if (err) {
  16360. reject(err)
  16361. } else {
  16362. resolve(socket)
  16363. }
  16364. })
  16365. })
  16366. if (client.destroyed) {
  16367. util.destroy(socket.on('error', () => {}), new ClientDestroyedError())
  16368. return
  16369. }
  16370. client[kConnecting] = false
  16371. assert(socket)
  16372. const isH2 = socket.alpnProtocol === 'h2'
  16373. if (isH2) {
  16374. if (!h2ExperimentalWarned) {
  16375. h2ExperimentalWarned = true
  16376. process.emitWarning('H2 support is experimental, expect them to change at any time.', {
  16377. code: 'UNDICI-H2'
  16378. })
  16379. }
  16380. const session = http2.connect(client[kUrl], {
  16381. createConnection: () => socket,
  16382. peerMaxConcurrentStreams: client[kHTTP2SessionState].maxConcurrentStreams
  16383. })
  16384. client[kHTTPConnVersion] = 'h2'
  16385. session[kClient] = client
  16386. session[kSocket] = socket
  16387. session.on('error', onHttp2SessionError)
  16388. session.on('frameError', onHttp2FrameError)
  16389. session.on('end', onHttp2SessionEnd)
  16390. session.on('goaway', onHTTP2GoAway)
  16391. session.on('close', onSocketClose)
  16392. session.unref()
  16393. client[kHTTP2Session] = session
  16394. socket[kHTTP2Session] = session
  16395. } else {
  16396. if (!llhttpInstance) {
  16397. llhttpInstance = await llhttpPromise
  16398. llhttpPromise = null
  16399. }
  16400. socket[kNoRef] = false
  16401. socket[kWriting] = false
  16402. socket[kReset] = false
  16403. socket[kBlocking] = false
  16404. socket[kParser] = new Parser(client, socket, llhttpInstance)
  16405. }
  16406. socket[kCounter] = 0
  16407. socket[kMaxRequests] = client[kMaxRequests]
  16408. socket[kClient] = client
  16409. socket[kError] = null
  16410. socket
  16411. .on('error', onSocketError)
  16412. .on('readable', onSocketReadable)
  16413. .on('end', onSocketEnd)
  16414. .on('close', onSocketClose)
  16415. client[kSocket] = socket
  16416. if (channels.connected.hasSubscribers) {
  16417. channels.connected.publish({
  16418. connectParams: {
  16419. host,
  16420. hostname,
  16421. protocol,
  16422. port,
  16423. servername: client[kServerName],
  16424. localAddress: client[kLocalAddress]
  16425. },
  16426. connector: client[kConnector],
  16427. socket
  16428. })
  16429. }
  16430. client.emit('connect', client[kUrl], [client])
  16431. } catch (err) {
  16432. if (client.destroyed) {
  16433. return
  16434. }
  16435. client[kConnecting] = false
  16436. if (channels.connectError.hasSubscribers) {
  16437. channels.connectError.publish({
  16438. connectParams: {
  16439. host,
  16440. hostname,
  16441. protocol,
  16442. port,
  16443. servername: client[kServerName],
  16444. localAddress: client[kLocalAddress]
  16445. },
  16446. connector: client[kConnector],
  16447. error: err
  16448. })
  16449. }
  16450. if (err.code === 'ERR_TLS_CERT_ALTNAME_INVALID') {
  16451. assert(client[kRunning] === 0)
  16452. while (client[kPending] > 0 && client[kQueue][client[kPendingIdx]].servername === client[kServerName]) {
  16453. const request = client[kQueue][client[kPendingIdx]++]
  16454. errorRequest(client, request, err)
  16455. }
  16456. } else {
  16457. onError(client, err)
  16458. }
  16459. client.emit('connectionError', client[kUrl], [client], err)
  16460. }
  16461. resume(client)
  16462. }
  16463. function emitDrain (client) {
  16464. client[kNeedDrain] = 0
  16465. client.emit('drain', client[kUrl], [client])
  16466. }
  16467. function resume (client, sync) {
  16468. if (client[kResuming] === 2) {
  16469. return
  16470. }
  16471. client[kResuming] = 2
  16472. _resume(client, sync)
  16473. client[kResuming] = 0
  16474. if (client[kRunningIdx] > 256) {
  16475. client[kQueue].splice(0, client[kRunningIdx])
  16476. client[kPendingIdx] -= client[kRunningIdx]
  16477. client[kRunningIdx] = 0
  16478. }
  16479. }
  16480. function _resume (client, sync) {
  16481. while (true) {
  16482. if (client.destroyed) {
  16483. assert(client[kPending] === 0)
  16484. return
  16485. }
  16486. if (client[kClosedResolve] && !client[kSize]) {
  16487. client[kClosedResolve]()
  16488. client[kClosedResolve] = null
  16489. return
  16490. }
  16491. const socket = client[kSocket]
  16492. if (socket && !socket.destroyed && socket.alpnProtocol !== 'h2') {
  16493. if (client[kSize] === 0) {
  16494. if (!socket[kNoRef] && socket.unref) {
  16495. socket.unref()
  16496. socket[kNoRef] = true
  16497. }
  16498. } else if (socket[kNoRef] && socket.ref) {
  16499. socket.ref()
  16500. socket[kNoRef] = false
  16501. }
  16502. if (client[kSize] === 0) {
  16503. if (socket[kParser].timeoutType !== TIMEOUT_IDLE) {
  16504. socket[kParser].setTimeout(client[kKeepAliveTimeoutValue], TIMEOUT_IDLE)
  16505. }
  16506. } else if (client[kRunning] > 0 && socket[kParser].statusCode < 200) {
  16507. if (socket[kParser].timeoutType !== TIMEOUT_HEADERS) {
  16508. const request = client[kQueue][client[kRunningIdx]]
  16509. const headersTimeout = request.headersTimeout != null
  16510. ? request.headersTimeout
  16511. : client[kHeadersTimeout]
  16512. socket[kParser].setTimeout(headersTimeout, TIMEOUT_HEADERS)
  16513. }
  16514. }
  16515. }
  16516. if (client[kBusy]) {
  16517. client[kNeedDrain] = 2
  16518. } else if (client[kNeedDrain] === 2) {
  16519. if (sync) {
  16520. client[kNeedDrain] = 1
  16521. process.nextTick(emitDrain, client)
  16522. } else {
  16523. emitDrain(client)
  16524. }
  16525. continue
  16526. }
  16527. if (client[kPending] === 0) {
  16528. return
  16529. }
  16530. if (client[kRunning] >= (client[kPipelining] || 1)) {
  16531. return
  16532. }
  16533. const request = client[kQueue][client[kPendingIdx]]
  16534. if (client[kUrl].protocol === 'https:' && client[kServerName] !== request.servername) {
  16535. if (client[kRunning] > 0) {
  16536. return
  16537. }
  16538. client[kServerName] = request.servername
  16539. if (socket && socket.servername !== request.servername) {
  16540. util.destroy(socket, new InformationalError('servername changed'))
  16541. return
  16542. }
  16543. }
  16544. if (client[kConnecting]) {
  16545. return
  16546. }
  16547. if (!socket && !client[kHTTP2Session]) {
  16548. connect(client)
  16549. return
  16550. }
  16551. if (socket.destroyed || socket[kWriting] || socket[kReset] || socket[kBlocking]) {
  16552. return
  16553. }
  16554. if (client[kRunning] > 0 && !request.idempotent) {
  16555. // Non-idempotent request cannot be retried.
  16556. // Ensure that no other requests are inflight and
  16557. // could cause failure.
  16558. return
  16559. }
  16560. if (client[kRunning] > 0 && (request.upgrade || request.method === 'CONNECT')) {
  16561. // Don't dispatch an upgrade until all preceding requests have completed.
  16562. // A misbehaving server might upgrade the connection before all pipelined
  16563. // request has completed.
  16564. return
  16565. }
  16566. if (client[kRunning] > 0 && util.bodyLength(request.body) !== 0 &&
  16567. (util.isStream(request.body) || util.isAsyncIterable(request.body))) {
  16568. // Request with stream or iterator body can error while other requests
  16569. // are inflight and indirectly error those as well.
  16570. // Ensure this doesn't happen by waiting for inflight
  16571. // to complete before dispatching.
  16572. // Request with stream or iterator body cannot be retried.
  16573. // Ensure that no other requests are inflight and
  16574. // could cause failure.
  16575. return
  16576. }
  16577. if (!request.aborted && write(client, request)) {
  16578. client[kPendingIdx]++
  16579. } else {
  16580. client[kQueue].splice(client[kPendingIdx], 1)
  16581. }
  16582. }
  16583. }
  16584. // https://www.rfc-editor.org/rfc/rfc7230#section-3.3.2
  16585. function shouldSendContentLength (method) {
  16586. return method !== 'GET' && method !== 'HEAD' && method !== 'OPTIONS' && method !== 'TRACE' && method !== 'CONNECT'
  16587. }
  16588. function write (client, request) {
  16589. if (client[kHTTPConnVersion] === 'h2') {
  16590. writeH2(client, client[kHTTP2Session], request)
  16591. return
  16592. }
  16593. const { body, method, path, host, upgrade, headers, blocking, reset } = request
  16594. // https://tools.ietf.org/html/rfc7231#section-4.3.1
  16595. // https://tools.ietf.org/html/rfc7231#section-4.3.2
  16596. // https://tools.ietf.org/html/rfc7231#section-4.3.5
  16597. // Sending a payload body on a request that does not
  16598. // expect it can cause undefined behavior on some
  16599. // servers and corrupt connection state. Do not
  16600. // re-use the connection for further requests.
  16601. const expectsPayload = (
  16602. method === 'PUT' ||
  16603. method === 'POST' ||
  16604. method === 'PATCH'
  16605. )
  16606. if (body && typeof body.read === 'function') {
  16607. // Try to read EOF in order to get length.
  16608. body.read(0)
  16609. }
  16610. const bodyLength = util.bodyLength(body)
  16611. let contentLength = bodyLength
  16612. if (contentLength === null) {
  16613. contentLength = request.contentLength
  16614. }
  16615. if (contentLength === 0 && !expectsPayload) {
  16616. // https://tools.ietf.org/html/rfc7230#section-3.3.2
  16617. // A user agent SHOULD NOT send a Content-Length header field when
  16618. // the request message does not contain a payload body and the method
  16619. // semantics do not anticipate such a body.
  16620. contentLength = null
  16621. }
  16622. // https://github.com/nodejs/undici/issues/2046
  16623. // A user agent may send a Content-Length header with 0 value, this should be allowed.
  16624. if (shouldSendContentLength(method) && contentLength > 0 && request.contentLength !== null && request.contentLength !== contentLength) {
  16625. if (client[kStrictContentLength]) {
  16626. errorRequest(client, request, new RequestContentLengthMismatchError())
  16627. return false
  16628. }
  16629. process.emitWarning(new RequestContentLengthMismatchError())
  16630. }
  16631. const socket = client[kSocket]
  16632. try {
  16633. request.onConnect((err) => {
  16634. if (request.aborted || request.completed) {
  16635. return
  16636. }
  16637. errorRequest(client, request, err || new RequestAbortedError())
  16638. util.destroy(socket, new InformationalError('aborted'))
  16639. })
  16640. } catch (err) {
  16641. errorRequest(client, request, err)
  16642. }
  16643. if (request.aborted) {
  16644. return false
  16645. }
  16646. if (method === 'HEAD') {
  16647. // https://github.com/mcollina/undici/issues/258
  16648. // Close after a HEAD request to interop with misbehaving servers
  16649. // that may send a body in the response.
  16650. socket[kReset] = true
  16651. }
  16652. if (upgrade || method === 'CONNECT') {
  16653. // On CONNECT or upgrade, block pipeline from dispatching further
  16654. // requests on this connection.
  16655. socket[kReset] = true
  16656. }
  16657. if (reset != null) {
  16658. socket[kReset] = reset
  16659. }
  16660. if (client[kMaxRequests] && socket[kCounter]++ >= client[kMaxRequests]) {
  16661. socket[kReset] = true
  16662. }
  16663. if (blocking) {
  16664. socket[kBlocking] = true
  16665. }
  16666. let header = `${method} ${path} HTTP/1.1\r\n`
  16667. if (typeof host === 'string') {
  16668. header += `host: ${host}\r\n`
  16669. } else {
  16670. header += client[kHostHeader]
  16671. }
  16672. if (upgrade) {
  16673. header += `connection: upgrade\r\nupgrade: ${upgrade}\r\n`
  16674. } else if (client[kPipelining] && !socket[kReset]) {
  16675. header += 'connection: keep-alive\r\n'
  16676. } else {
  16677. header += 'connection: close\r\n'
  16678. }
  16679. if (headers) {
  16680. header += headers
  16681. }
  16682. if (channels.sendHeaders.hasSubscribers) {
  16683. channels.sendHeaders.publish({ request, headers: header, socket })
  16684. }
  16685. /* istanbul ignore else: assertion */
  16686. if (!body || bodyLength === 0) {
  16687. if (contentLength === 0) {
  16688. socket.write(`${header}content-length: 0\r\n\r\n`, 'latin1')
  16689. } else {
  16690. assert(contentLength === null, 'no body must not have content length')
  16691. socket.write(`${header}\r\n`, 'latin1')
  16692. }
  16693. request.onRequestSent()
  16694. } else if (util.isBuffer(body)) {
  16695. assert(contentLength === body.byteLength, 'buffer body must have content length')
  16696. socket.cork()
  16697. socket.write(`${header}content-length: ${contentLength}\r\n\r\n`, 'latin1')
  16698. socket.write(body)
  16699. socket.uncork()
  16700. request.onBodySent(body)
  16701. request.onRequestSent()
  16702. if (!expectsPayload) {
  16703. socket[kReset] = true
  16704. }
  16705. } else if (util.isBlobLike(body)) {
  16706. if (typeof body.stream === 'function') {
  16707. writeIterable({ body: body.stream(), client, request, socket, contentLength, header, expectsPayload })
  16708. } else {
  16709. writeBlob({ body, client, request, socket, contentLength, header, expectsPayload })
  16710. }
  16711. } else if (util.isStream(body)) {
  16712. writeStream({ body, client, request, socket, contentLength, header, expectsPayload })
  16713. } else if (util.isIterable(body)) {
  16714. writeIterable({ body, client, request, socket, contentLength, header, expectsPayload })
  16715. } else {
  16716. assert(false)
  16717. }
  16718. return true
  16719. }
  16720. function writeH2 (client, session, request) {
  16721. const { body, method, path, host, upgrade, expectContinue, signal, headers: reqHeaders } = request
  16722. let headers
  16723. if (typeof reqHeaders === 'string') headers = Request[kHTTP2CopyHeaders](reqHeaders.trim())
  16724. else headers = reqHeaders
  16725. if (upgrade) {
  16726. errorRequest(client, request, new Error('Upgrade not supported for H2'))
  16727. return false
  16728. }
  16729. try {
  16730. // TODO(HTTP/2): Should we call onConnect immediately or on stream ready event?
  16731. request.onConnect((err) => {
  16732. if (request.aborted || request.completed) {
  16733. return
  16734. }
  16735. errorRequest(client, request, err || new RequestAbortedError())
  16736. })
  16737. } catch (err) {
  16738. errorRequest(client, request, err)
  16739. }
  16740. if (request.aborted) {
  16741. return false
  16742. }
  16743. /** @type {import('node:http2').ClientHttp2Stream} */
  16744. let stream
  16745. const h2State = client[kHTTP2SessionState]
  16746. headers[HTTP2_HEADER_AUTHORITY] = host || client[kHost]
  16747. headers[HTTP2_HEADER_METHOD] = method
  16748. if (method === 'CONNECT') {
  16749. session.ref()
  16750. // we are already connected, streams are pending, first request
  16751. // will create a new stream. We trigger a request to create the stream and wait until
  16752. // `ready` event is triggered
  16753. // We disabled endStream to allow the user to write to the stream
  16754. stream = session.request(headers, { endStream: false, signal })
  16755. if (stream.id && !stream.pending) {
  16756. request.onUpgrade(null, null, stream)
  16757. ++h2State.openStreams
  16758. } else {
  16759. stream.once('ready', () => {
  16760. request.onUpgrade(null, null, stream)
  16761. ++h2State.openStreams
  16762. })
  16763. }
  16764. stream.once('close', () => {
  16765. h2State.openStreams -= 1
  16766. // TODO(HTTP/2): unref only if current streams count is 0
  16767. if (h2State.openStreams === 0) session.unref()
  16768. })
  16769. return true
  16770. }
  16771. // https://tools.ietf.org/html/rfc7540#section-8.3
  16772. // :path and :scheme headers must be omited when sending CONNECT
  16773. headers[HTTP2_HEADER_PATH] = path
  16774. headers[HTTP2_HEADER_SCHEME] = 'https'
  16775. // https://tools.ietf.org/html/rfc7231#section-4.3.1
  16776. // https://tools.ietf.org/html/rfc7231#section-4.3.2
  16777. // https://tools.ietf.org/html/rfc7231#section-4.3.5
  16778. // Sending a payload body on a request that does not
  16779. // expect it can cause undefined behavior on some
  16780. // servers and corrupt connection state. Do not
  16781. // re-use the connection for further requests.
  16782. const expectsPayload = (
  16783. method === 'PUT' ||
  16784. method === 'POST' ||
  16785. method === 'PATCH'
  16786. )
  16787. if (body && typeof body.read === 'function') {
  16788. // Try to read EOF in order to get length.
  16789. body.read(0)
  16790. }
  16791. let contentLength = util.bodyLength(body)
  16792. if (contentLength == null) {
  16793. contentLength = request.contentLength
  16794. }
  16795. if (contentLength === 0 || !expectsPayload) {
  16796. // https://tools.ietf.org/html/rfc7230#section-3.3.2
  16797. // A user agent SHOULD NOT send a Content-Length header field when
  16798. // the request message does not contain a payload body and the method
  16799. // semantics do not anticipate such a body.
  16800. contentLength = null
  16801. }
  16802. // https://github.com/nodejs/undici/issues/2046
  16803. // A user agent may send a Content-Length header with 0 value, this should be allowed.
  16804. if (shouldSendContentLength(method) && contentLength > 0 && request.contentLength != null && request.contentLength !== contentLength) {
  16805. if (client[kStrictContentLength]) {
  16806. errorRequest(client, request, new RequestContentLengthMismatchError())
  16807. return false
  16808. }
  16809. process.emitWarning(new RequestContentLengthMismatchError())
  16810. }
  16811. if (contentLength != null) {
  16812. assert(body, 'no body must not have content length')
  16813. headers[HTTP2_HEADER_CONTENT_LENGTH] = `${contentLength}`
  16814. }
  16815. session.ref()
  16816. const shouldEndStream = method === 'GET' || method === 'HEAD'
  16817. if (expectContinue) {
  16818. headers[HTTP2_HEADER_EXPECT] = '100-continue'
  16819. stream = session.request(headers, { endStream: shouldEndStream, signal })
  16820. stream.once('continue', writeBodyH2)
  16821. } else {
  16822. stream = session.request(headers, {
  16823. endStream: shouldEndStream,
  16824. signal
  16825. })
  16826. writeBodyH2()
  16827. }
  16828. // Increment counter as we have new several streams open
  16829. ++h2State.openStreams
  16830. stream.once('response', headers => {
  16831. const { [HTTP2_HEADER_STATUS]: statusCode, ...realHeaders } = headers
  16832. if (request.onHeaders(Number(statusCode), realHeaders, stream.resume.bind(stream), '') === false) {
  16833. stream.pause()
  16834. }
  16835. })
  16836. stream.once('end', () => {
  16837. request.onComplete([])
  16838. })
  16839. stream.on('data', (chunk) => {
  16840. if (request.onData(chunk) === false) {
  16841. stream.pause()
  16842. }
  16843. })
  16844. stream.once('close', () => {
  16845. h2State.openStreams -= 1
  16846. // TODO(HTTP/2): unref only if current streams count is 0
  16847. if (h2State.openStreams === 0) {
  16848. session.unref()
  16849. }
  16850. })
  16851. stream.once('error', function (err) {
  16852. if (client[kHTTP2Session] && !client[kHTTP2Session].destroyed && !this.closed && !this.destroyed) {
  16853. h2State.streams -= 1
  16854. util.destroy(stream, err)
  16855. }
  16856. })
  16857. stream.once('frameError', (type, code) => {
  16858. const err = new InformationalError(`HTTP/2: "frameError" received - type ${type}, code ${code}`)
  16859. errorRequest(client, request, err)
  16860. if (client[kHTTP2Session] && !client[kHTTP2Session].destroyed && !this.closed && !this.destroyed) {
  16861. h2State.streams -= 1
  16862. util.destroy(stream, err)
  16863. }
  16864. })
  16865. // stream.on('aborted', () => {
  16866. // // TODO(HTTP/2): Support aborted
  16867. // })
  16868. // stream.on('timeout', () => {
  16869. // // TODO(HTTP/2): Support timeout
  16870. // })
  16871. // stream.on('push', headers => {
  16872. // // TODO(HTTP/2): Suppor push
  16873. // })
  16874. // stream.on('trailers', headers => {
  16875. // // TODO(HTTP/2): Support trailers
  16876. // })
  16877. return true
  16878. function writeBodyH2 () {
  16879. /* istanbul ignore else: assertion */
  16880. if (!body) {
  16881. request.onRequestSent()
  16882. } else if (util.isBuffer(body)) {
  16883. assert(contentLength === body.byteLength, 'buffer body must have content length')
  16884. stream.cork()
  16885. stream.write(body)
  16886. stream.uncork()
  16887. stream.end()
  16888. request.onBodySent(body)
  16889. request.onRequestSent()
  16890. } else if (util.isBlobLike(body)) {
  16891. if (typeof body.stream === 'function') {
  16892. writeIterable({
  16893. client,
  16894. request,
  16895. contentLength,
  16896. h2stream: stream,
  16897. expectsPayload,
  16898. body: body.stream(),
  16899. socket: client[kSocket],
  16900. header: ''
  16901. })
  16902. } else {
  16903. writeBlob({
  16904. body,
  16905. client,
  16906. request,
  16907. contentLength,
  16908. expectsPayload,
  16909. h2stream: stream,
  16910. header: '',
  16911. socket: client[kSocket]
  16912. })
  16913. }
  16914. } else if (util.isStream(body)) {
  16915. writeStream({
  16916. body,
  16917. client,
  16918. request,
  16919. contentLength,
  16920. expectsPayload,
  16921. socket: client[kSocket],
  16922. h2stream: stream,
  16923. header: ''
  16924. })
  16925. } else if (util.isIterable(body)) {
  16926. writeIterable({
  16927. body,
  16928. client,
  16929. request,
  16930. contentLength,
  16931. expectsPayload,
  16932. header: '',
  16933. h2stream: stream,
  16934. socket: client[kSocket]
  16935. })
  16936. } else {
  16937. assert(false)
  16938. }
  16939. }
  16940. }
  16941. function writeStream ({ h2stream, body, client, request, socket, contentLength, header, expectsPayload }) {
  16942. assert(contentLength !== 0 || client[kRunning] === 0, 'stream body cannot be pipelined')
  16943. if (client[kHTTPConnVersion] === 'h2') {
  16944. // For HTTP/2, is enough to pipe the stream
  16945. const pipe = pipeline(
  16946. body,
  16947. h2stream,
  16948. (err) => {
  16949. if (err) {
  16950. util.destroy(body, err)
  16951. util.destroy(h2stream, err)
  16952. } else {
  16953. request.onRequestSent()
  16954. }
  16955. }
  16956. )
  16957. pipe.on('data', onPipeData)
  16958. pipe.once('end', () => {
  16959. pipe.removeListener('data', onPipeData)
  16960. util.destroy(pipe)
  16961. })
  16962. function onPipeData (chunk) {
  16963. request.onBodySent(chunk)
  16964. }
  16965. return
  16966. }
  16967. let finished = false
  16968. const writer = new AsyncWriter({ socket, request, contentLength, client, expectsPayload, header })
  16969. const onData = function (chunk) {
  16970. if (finished) {
  16971. return
  16972. }
  16973. try {
  16974. if (!writer.write(chunk) && this.pause) {
  16975. this.pause()
  16976. }
  16977. } catch (err) {
  16978. util.destroy(this, err)
  16979. }
  16980. }
  16981. const onDrain = function () {
  16982. if (finished) {
  16983. return
  16984. }
  16985. if (body.resume) {
  16986. body.resume()
  16987. }
  16988. }
  16989. const onAbort = function () {
  16990. if (finished) {
  16991. return
  16992. }
  16993. const err = new RequestAbortedError()
  16994. queueMicrotask(() => onFinished(err))
  16995. }
  16996. const onFinished = function (err) {
  16997. if (finished) {
  16998. return
  16999. }
  17000. finished = true
  17001. assert(socket.destroyed || (socket[kWriting] && client[kRunning] <= 1))
  17002. socket
  17003. .off('drain', onDrain)
  17004. .off('error', onFinished)
  17005. body
  17006. .removeListener('data', onData)
  17007. .removeListener('end', onFinished)
  17008. .removeListener('error', onFinished)
  17009. .removeListener('close', onAbort)
  17010. if (!err) {
  17011. try {
  17012. writer.end()
  17013. } catch (er) {
  17014. err = er
  17015. }
  17016. }
  17017. writer.destroy(err)
  17018. if (err && (err.code !== 'UND_ERR_INFO' || err.message !== 'reset')) {
  17019. util.destroy(body, err)
  17020. } else {
  17021. util.destroy(body)
  17022. }
  17023. }
  17024. body
  17025. .on('data', onData)
  17026. .on('end', onFinished)
  17027. .on('error', onFinished)
  17028. .on('close', onAbort)
  17029. if (body.resume) {
  17030. body.resume()
  17031. }
  17032. socket
  17033. .on('drain', onDrain)
  17034. .on('error', onFinished)
  17035. }
  17036. async function writeBlob ({ h2stream, body, client, request, socket, contentLength, header, expectsPayload }) {
  17037. assert(contentLength === body.size, 'blob body must have content length')
  17038. const isH2 = client[kHTTPConnVersion] === 'h2'
  17039. try {
  17040. if (contentLength != null && contentLength !== body.size) {
  17041. throw new RequestContentLengthMismatchError()
  17042. }
  17043. const buffer = Buffer.from(await body.arrayBuffer())
  17044. if (isH2) {
  17045. h2stream.cork()
  17046. h2stream.write(buffer)
  17047. h2stream.uncork()
  17048. } else {
  17049. socket.cork()
  17050. socket.write(`${header}content-length: ${contentLength}\r\n\r\n`, 'latin1')
  17051. socket.write(buffer)
  17052. socket.uncork()
  17053. }
  17054. request.onBodySent(buffer)
  17055. request.onRequestSent()
  17056. if (!expectsPayload) {
  17057. socket[kReset] = true
  17058. }
  17059. resume(client)
  17060. } catch (err) {
  17061. util.destroy(isH2 ? h2stream : socket, err)
  17062. }
  17063. }
  17064. async function writeIterable ({ h2stream, body, client, request, socket, contentLength, header, expectsPayload }) {
  17065. assert(contentLength !== 0 || client[kRunning] === 0, 'iterator body cannot be pipelined')
  17066. let callback = null
  17067. function onDrain () {
  17068. if (callback) {
  17069. const cb = callback
  17070. callback = null
  17071. cb()
  17072. }
  17073. }
  17074. const waitForDrain = () => new Promise((resolve, reject) => {
  17075. assert(callback === null)
  17076. if (socket[kError]) {
  17077. reject(socket[kError])
  17078. } else {
  17079. callback = resolve
  17080. }
  17081. })
  17082. if (client[kHTTPConnVersion] === 'h2') {
  17083. h2stream
  17084. .on('close', onDrain)
  17085. .on('drain', onDrain)
  17086. try {
  17087. // It's up to the user to somehow abort the async iterable.
  17088. for await (const chunk of body) {
  17089. if (socket[kError]) {
  17090. throw socket[kError]
  17091. }
  17092. const res = h2stream.write(chunk)
  17093. request.onBodySent(chunk)
  17094. if (!res) {
  17095. await waitForDrain()
  17096. }
  17097. }
  17098. } catch (err) {
  17099. h2stream.destroy(err)
  17100. } finally {
  17101. request.onRequestSent()
  17102. h2stream.end()
  17103. h2stream
  17104. .off('close', onDrain)
  17105. .off('drain', onDrain)
  17106. }
  17107. return
  17108. }
  17109. socket
  17110. .on('close', onDrain)
  17111. .on('drain', onDrain)
  17112. const writer = new AsyncWriter({ socket, request, contentLength, client, expectsPayload, header })
  17113. try {
  17114. // It's up to the user to somehow abort the async iterable.
  17115. for await (const chunk of body) {
  17116. if (socket[kError]) {
  17117. throw socket[kError]
  17118. }
  17119. if (!writer.write(chunk)) {
  17120. await waitForDrain()
  17121. }
  17122. }
  17123. writer.end()
  17124. } catch (err) {
  17125. writer.destroy(err)
  17126. } finally {
  17127. socket
  17128. .off('close', onDrain)
  17129. .off('drain', onDrain)
  17130. }
  17131. }
  17132. class AsyncWriter {
  17133. constructor ({ socket, request, contentLength, client, expectsPayload, header }) {
  17134. this.socket = socket
  17135. this.request = request
  17136. this.contentLength = contentLength
  17137. this.client = client
  17138. this.bytesWritten = 0
  17139. this.expectsPayload = expectsPayload
  17140. this.header = header
  17141. socket[kWriting] = true
  17142. }
  17143. write (chunk) {
  17144. const { socket, request, contentLength, client, bytesWritten, expectsPayload, header } = this
  17145. if (socket[kError]) {
  17146. throw socket[kError]
  17147. }
  17148. if (socket.destroyed) {
  17149. return false
  17150. }
  17151. const len = Buffer.byteLength(chunk)
  17152. if (!len) {
  17153. return true
  17154. }
  17155. // We should defer writing chunks.
  17156. if (contentLength !== null && bytesWritten + len > contentLength) {
  17157. if (client[kStrictContentLength]) {
  17158. throw new RequestContentLengthMismatchError()
  17159. }
  17160. process.emitWarning(new RequestContentLengthMismatchError())
  17161. }
  17162. socket.cork()
  17163. if (bytesWritten === 0) {
  17164. if (!expectsPayload) {
  17165. socket[kReset] = true
  17166. }
  17167. if (contentLength === null) {
  17168. socket.write(`${header}transfer-encoding: chunked\r\n`, 'latin1')
  17169. } else {
  17170. socket.write(`${header}content-length: ${contentLength}\r\n\r\n`, 'latin1')
  17171. }
  17172. }
  17173. if (contentLength === null) {
  17174. socket.write(`\r\n${len.toString(16)}\r\n`, 'latin1')
  17175. }
  17176. this.bytesWritten += len
  17177. const ret = socket.write(chunk)
  17178. socket.uncork()
  17179. request.onBodySent(chunk)
  17180. if (!ret) {
  17181. if (socket[kParser].timeout && socket[kParser].timeoutType === TIMEOUT_HEADERS) {
  17182. // istanbul ignore else: only for jest
  17183. if (socket[kParser].timeout.refresh) {
  17184. socket[kParser].timeout.refresh()
  17185. }
  17186. }
  17187. }
  17188. return ret
  17189. }
  17190. end () {
  17191. const { socket, contentLength, client, bytesWritten, expectsPayload, header, request } = this
  17192. request.onRequestSent()
  17193. socket[kWriting] = false
  17194. if (socket[kError]) {
  17195. throw socket[kError]
  17196. }
  17197. if (socket.destroyed) {
  17198. return
  17199. }
  17200. if (bytesWritten === 0) {
  17201. if (expectsPayload) {
  17202. // https://tools.ietf.org/html/rfc7230#section-3.3.2
  17203. // A user agent SHOULD send a Content-Length in a request message when
  17204. // no Transfer-Encoding is sent and the request method defines a meaning
  17205. // for an enclosed payload body.
  17206. socket.write(`${header}content-length: 0\r\n\r\n`, 'latin1')
  17207. } else {
  17208. socket.write(`${header}\r\n`, 'latin1')
  17209. }
  17210. } else if (contentLength === null) {
  17211. socket.write('\r\n0\r\n\r\n', 'latin1')
  17212. }
  17213. if (contentLength !== null && bytesWritten !== contentLength) {
  17214. if (client[kStrictContentLength]) {
  17215. throw new RequestContentLengthMismatchError()
  17216. } else {
  17217. process.emitWarning(new RequestContentLengthMismatchError())
  17218. }
  17219. }
  17220. if (socket[kParser].timeout && socket[kParser].timeoutType === TIMEOUT_HEADERS) {
  17221. // istanbul ignore else: only for jest
  17222. if (socket[kParser].timeout.refresh) {
  17223. socket[kParser].timeout.refresh()
  17224. }
  17225. }
  17226. resume(client)
  17227. }
  17228. destroy (err) {
  17229. const { socket, client } = this
  17230. socket[kWriting] = false
  17231. if (err) {
  17232. assert(client[kRunning] <= 1, 'pipeline should only contain this request')
  17233. util.destroy(socket, err)
  17234. }
  17235. }
  17236. }
  17237. function errorRequest (client, request, err) {
  17238. try {
  17239. request.onError(err)
  17240. assert(request.aborted)
  17241. } catch (err) {
  17242. client.emit('error', err)
  17243. }
  17244. }
  17245. module.exports = Client
  17246. /***/ }),
  17247. /***/ 6436:
  17248. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  17249. "use strict";
  17250. /* istanbul ignore file: only for Node 12 */
  17251. const { kConnected, kSize } = __nccwpck_require__(2785)
  17252. class CompatWeakRef {
  17253. constructor (value) {
  17254. this.value = value
  17255. }
  17256. deref () {
  17257. return this.value[kConnected] === 0 && this.value[kSize] === 0
  17258. ? undefined
  17259. : this.value
  17260. }
  17261. }
  17262. class CompatFinalizer {
  17263. constructor (finalizer) {
  17264. this.finalizer = finalizer
  17265. }
  17266. register (dispatcher, key) {
  17267. if (dispatcher.on) {
  17268. dispatcher.on('disconnect', () => {
  17269. if (dispatcher[kConnected] === 0 && dispatcher[kSize] === 0) {
  17270. this.finalizer(key)
  17271. }
  17272. })
  17273. }
  17274. }
  17275. }
  17276. module.exports = function () {
  17277. // FIXME: remove workaround when the Node bug is fixed
  17278. // https://github.com/nodejs/node/issues/49344#issuecomment-1741776308
  17279. if (process.env.NODE_V8_COVERAGE) {
  17280. return {
  17281. WeakRef: CompatWeakRef,
  17282. FinalizationRegistry: CompatFinalizer
  17283. }
  17284. }
  17285. return {
  17286. WeakRef: global.WeakRef || CompatWeakRef,
  17287. FinalizationRegistry: global.FinalizationRegistry || CompatFinalizer
  17288. }
  17289. }
  17290. /***/ }),
  17291. /***/ 663:
  17292. /***/ ((module) => {
  17293. "use strict";
  17294. // https://wicg.github.io/cookie-store/#cookie-maximum-attribute-value-size
  17295. const maxAttributeValueSize = 1024
  17296. // https://wicg.github.io/cookie-store/#cookie-maximum-name-value-pair-size
  17297. const maxNameValuePairSize = 4096
  17298. module.exports = {
  17299. maxAttributeValueSize,
  17300. maxNameValuePairSize
  17301. }
  17302. /***/ }),
  17303. /***/ 1724:
  17304. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  17305. "use strict";
  17306. const { parseSetCookie } = __nccwpck_require__(4408)
  17307. const { stringify } = __nccwpck_require__(3121)
  17308. const { webidl } = __nccwpck_require__(1744)
  17309. const { Headers } = __nccwpck_require__(554)
  17310. /**
  17311. * @typedef {Object} Cookie
  17312. * @property {string} name
  17313. * @property {string} value
  17314. * @property {Date|number|undefined} expires
  17315. * @property {number|undefined} maxAge
  17316. * @property {string|undefined} domain
  17317. * @property {string|undefined} path
  17318. * @property {boolean|undefined} secure
  17319. * @property {boolean|undefined} httpOnly
  17320. * @property {'Strict'|'Lax'|'None'} sameSite
  17321. * @property {string[]} unparsed
  17322. */
  17323. /**
  17324. * @param {Headers} headers
  17325. * @returns {Record<string, string>}
  17326. */
  17327. function getCookies (headers) {
  17328. webidl.argumentLengthCheck(arguments, 1, { header: 'getCookies' })
  17329. webidl.brandCheck(headers, Headers, { strict: false })
  17330. const cookie = headers.get('cookie')
  17331. const out = {}
  17332. if (!cookie) {
  17333. return out
  17334. }
  17335. for (const piece of cookie.split(';')) {
  17336. const [name, ...value] = piece.split('=')
  17337. out[name.trim()] = value.join('=')
  17338. }
  17339. return out
  17340. }
  17341. /**
  17342. * @param {Headers} headers
  17343. * @param {string} name
  17344. * @param {{ path?: string, domain?: string }|undefined} attributes
  17345. * @returns {void}
  17346. */
  17347. function deleteCookie (headers, name, attributes) {
  17348. webidl.argumentLengthCheck(arguments, 2, { header: 'deleteCookie' })
  17349. webidl.brandCheck(headers, Headers, { strict: false })
  17350. name = webidl.converters.DOMString(name)
  17351. attributes = webidl.converters.DeleteCookieAttributes(attributes)
  17352. // Matches behavior of
  17353. // https://github.com/denoland/deno_std/blob/63827b16330b82489a04614027c33b7904e08be5/http/cookie.ts#L278
  17354. setCookie(headers, {
  17355. name,
  17356. value: '',
  17357. expires: new Date(0),
  17358. ...attributes
  17359. })
  17360. }
  17361. /**
  17362. * @param {Headers} headers
  17363. * @returns {Cookie[]}
  17364. */
  17365. function getSetCookies (headers) {
  17366. webidl.argumentLengthCheck(arguments, 1, { header: 'getSetCookies' })
  17367. webidl.brandCheck(headers, Headers, { strict: false })
  17368. const cookies = headers.getSetCookie()
  17369. if (!cookies) {
  17370. return []
  17371. }
  17372. return cookies.map((pair) => parseSetCookie(pair))
  17373. }
  17374. /**
  17375. * @param {Headers} headers
  17376. * @param {Cookie} cookie
  17377. * @returns {void}
  17378. */
  17379. function setCookie (headers, cookie) {
  17380. webidl.argumentLengthCheck(arguments, 2, { header: 'setCookie' })
  17381. webidl.brandCheck(headers, Headers, { strict: false })
  17382. cookie = webidl.converters.Cookie(cookie)
  17383. const str = stringify(cookie)
  17384. if (str) {
  17385. headers.append('Set-Cookie', stringify(cookie))
  17386. }
  17387. }
  17388. webidl.converters.DeleteCookieAttributes = webidl.dictionaryConverter([
  17389. {
  17390. converter: webidl.nullableConverter(webidl.converters.DOMString),
  17391. key: 'path',
  17392. defaultValue: null
  17393. },
  17394. {
  17395. converter: webidl.nullableConverter(webidl.converters.DOMString),
  17396. key: 'domain',
  17397. defaultValue: null
  17398. }
  17399. ])
  17400. webidl.converters.Cookie = webidl.dictionaryConverter([
  17401. {
  17402. converter: webidl.converters.DOMString,
  17403. key: 'name'
  17404. },
  17405. {
  17406. converter: webidl.converters.DOMString,
  17407. key: 'value'
  17408. },
  17409. {
  17410. converter: webidl.nullableConverter((value) => {
  17411. if (typeof value === 'number') {
  17412. return webidl.converters['unsigned long long'](value)
  17413. }
  17414. return new Date(value)
  17415. }),
  17416. key: 'expires',
  17417. defaultValue: null
  17418. },
  17419. {
  17420. converter: webidl.nullableConverter(webidl.converters['long long']),
  17421. key: 'maxAge',
  17422. defaultValue: null
  17423. },
  17424. {
  17425. converter: webidl.nullableConverter(webidl.converters.DOMString),
  17426. key: 'domain',
  17427. defaultValue: null
  17428. },
  17429. {
  17430. converter: webidl.nullableConverter(webidl.converters.DOMString),
  17431. key: 'path',
  17432. defaultValue: null
  17433. },
  17434. {
  17435. converter: webidl.nullableConverter(webidl.converters.boolean),
  17436. key: 'secure',
  17437. defaultValue: null
  17438. },
  17439. {
  17440. converter: webidl.nullableConverter(webidl.converters.boolean),
  17441. key: 'httpOnly',
  17442. defaultValue: null
  17443. },
  17444. {
  17445. converter: webidl.converters.USVString,
  17446. key: 'sameSite',
  17447. allowedValues: ['Strict', 'Lax', 'None']
  17448. },
  17449. {
  17450. converter: webidl.sequenceConverter(webidl.converters.DOMString),
  17451. key: 'unparsed',
  17452. defaultValue: []
  17453. }
  17454. ])
  17455. module.exports = {
  17456. getCookies,
  17457. deleteCookie,
  17458. getSetCookies,
  17459. setCookie
  17460. }
  17461. /***/ }),
  17462. /***/ 4408:
  17463. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  17464. "use strict";
  17465. const { maxNameValuePairSize, maxAttributeValueSize } = __nccwpck_require__(663)
  17466. const { isCTLExcludingHtab } = __nccwpck_require__(3121)
  17467. const { collectASequenceOfCodePointsFast } = __nccwpck_require__(685)
  17468. const assert = __nccwpck_require__(9491)
  17469. /**
  17470. * @description Parses the field-value attributes of a set-cookie header string.
  17471. * @see https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4
  17472. * @param {string} header
  17473. * @returns if the header is invalid, null will be returned
  17474. */
  17475. function parseSetCookie (header) {
  17476. // 1. If the set-cookie-string contains a %x00-08 / %x0A-1F / %x7F
  17477. // character (CTL characters excluding HTAB): Abort these steps and
  17478. // ignore the set-cookie-string entirely.
  17479. if (isCTLExcludingHtab(header)) {
  17480. return null
  17481. }
  17482. let nameValuePair = ''
  17483. let unparsedAttributes = ''
  17484. let name = ''
  17485. let value = ''
  17486. // 2. If the set-cookie-string contains a %x3B (";") character:
  17487. if (header.includes(';')) {
  17488. // 1. The name-value-pair string consists of the characters up to,
  17489. // but not including, the first %x3B (";"), and the unparsed-
  17490. // attributes consist of the remainder of the set-cookie-string
  17491. // (including the %x3B (";") in question).
  17492. const position = { position: 0 }
  17493. nameValuePair = collectASequenceOfCodePointsFast(';', header, position)
  17494. unparsedAttributes = header.slice(position.position)
  17495. } else {
  17496. // Otherwise:
  17497. // 1. The name-value-pair string consists of all the characters
  17498. // contained in the set-cookie-string, and the unparsed-
  17499. // attributes is the empty string.
  17500. nameValuePair = header
  17501. }
  17502. // 3. If the name-value-pair string lacks a %x3D ("=") character, then
  17503. // the name string is empty, and the value string is the value of
  17504. // name-value-pair.
  17505. if (!nameValuePair.includes('=')) {
  17506. value = nameValuePair
  17507. } else {
  17508. // Otherwise, the name string consists of the characters up to, but
  17509. // not including, the first %x3D ("=") character, and the (possibly
  17510. // empty) value string consists of the characters after the first
  17511. // %x3D ("=") character.
  17512. const position = { position: 0 }
  17513. name = collectASequenceOfCodePointsFast(
  17514. '=',
  17515. nameValuePair,
  17516. position
  17517. )
  17518. value = nameValuePair.slice(position.position + 1)
  17519. }
  17520. // 4. Remove any leading or trailing WSP characters from the name
  17521. // string and the value string.
  17522. name = name.trim()
  17523. value = value.trim()
  17524. // 5. If the sum of the lengths of the name string and the value string
  17525. // is more than 4096 octets, abort these steps and ignore the set-
  17526. // cookie-string entirely.
  17527. if (name.length + value.length > maxNameValuePairSize) {
  17528. return null
  17529. }
  17530. // 6. The cookie-name is the name string, and the cookie-value is the
  17531. // value string.
  17532. return {
  17533. name, value, ...parseUnparsedAttributes(unparsedAttributes)
  17534. }
  17535. }
  17536. /**
  17537. * Parses the remaining attributes of a set-cookie header
  17538. * @see https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4
  17539. * @param {string} unparsedAttributes
  17540. * @param {[Object.<string, unknown>]={}} cookieAttributeList
  17541. */
  17542. function parseUnparsedAttributes (unparsedAttributes, cookieAttributeList = {}) {
  17543. // 1. If the unparsed-attributes string is empty, skip the rest of
  17544. // these steps.
  17545. if (unparsedAttributes.length === 0) {
  17546. return cookieAttributeList
  17547. }
  17548. // 2. Discard the first character of the unparsed-attributes (which
  17549. // will be a %x3B (";") character).
  17550. assert(unparsedAttributes[0] === ';')
  17551. unparsedAttributes = unparsedAttributes.slice(1)
  17552. let cookieAv = ''
  17553. // 3. If the remaining unparsed-attributes contains a %x3B (";")
  17554. // character:
  17555. if (unparsedAttributes.includes(';')) {
  17556. // 1. Consume the characters of the unparsed-attributes up to, but
  17557. // not including, the first %x3B (";") character.
  17558. cookieAv = collectASequenceOfCodePointsFast(
  17559. ';',
  17560. unparsedAttributes,
  17561. { position: 0 }
  17562. )
  17563. unparsedAttributes = unparsedAttributes.slice(cookieAv.length)
  17564. } else {
  17565. // Otherwise:
  17566. // 1. Consume the remainder of the unparsed-attributes.
  17567. cookieAv = unparsedAttributes
  17568. unparsedAttributes = ''
  17569. }
  17570. // Let the cookie-av string be the characters consumed in this step.
  17571. let attributeName = ''
  17572. let attributeValue = ''
  17573. // 4. If the cookie-av string contains a %x3D ("=") character:
  17574. if (cookieAv.includes('=')) {
  17575. // 1. The (possibly empty) attribute-name string consists of the
  17576. // characters up to, but not including, the first %x3D ("=")
  17577. // character, and the (possibly empty) attribute-value string
  17578. // consists of the characters after the first %x3D ("=")
  17579. // character.
  17580. const position = { position: 0 }
  17581. attributeName = collectASequenceOfCodePointsFast(
  17582. '=',
  17583. cookieAv,
  17584. position
  17585. )
  17586. attributeValue = cookieAv.slice(position.position + 1)
  17587. } else {
  17588. // Otherwise:
  17589. // 1. The attribute-name string consists of the entire cookie-av
  17590. // string, and the attribute-value string is empty.
  17591. attributeName = cookieAv
  17592. }
  17593. // 5. Remove any leading or trailing WSP characters from the attribute-
  17594. // name string and the attribute-value string.
  17595. attributeName = attributeName.trim()
  17596. attributeValue = attributeValue.trim()
  17597. // 6. If the attribute-value is longer than 1024 octets, ignore the
  17598. // cookie-av string and return to Step 1 of this algorithm.
  17599. if (attributeValue.length > maxAttributeValueSize) {
  17600. return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList)
  17601. }
  17602. // 7. Process the attribute-name and attribute-value according to the
  17603. // requirements in the following subsections. (Notice that
  17604. // attributes with unrecognized attribute-names are ignored.)
  17605. const attributeNameLowercase = attributeName.toLowerCase()
  17606. // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.1
  17607. // If the attribute-name case-insensitively matches the string
  17608. // "Expires", the user agent MUST process the cookie-av as follows.
  17609. if (attributeNameLowercase === 'expires') {
  17610. // 1. Let the expiry-time be the result of parsing the attribute-value
  17611. // as cookie-date (see Section 5.1.1).
  17612. const expiryTime = new Date(attributeValue)
  17613. // 2. If the attribute-value failed to parse as a cookie date, ignore
  17614. // the cookie-av.
  17615. cookieAttributeList.expires = expiryTime
  17616. } else if (attributeNameLowercase === 'max-age') {
  17617. // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.2
  17618. // If the attribute-name case-insensitively matches the string "Max-
  17619. // Age", the user agent MUST process the cookie-av as follows.
  17620. // 1. If the first character of the attribute-value is not a DIGIT or a
  17621. // "-" character, ignore the cookie-av.
  17622. const charCode = attributeValue.charCodeAt(0)
  17623. if ((charCode < 48 || charCode > 57) && attributeValue[0] !== '-') {
  17624. return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList)
  17625. }
  17626. // 2. If the remainder of attribute-value contains a non-DIGIT
  17627. // character, ignore the cookie-av.
  17628. if (!/^\d+$/.test(attributeValue)) {
  17629. return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList)
  17630. }
  17631. // 3. Let delta-seconds be the attribute-value converted to an integer.
  17632. const deltaSeconds = Number(attributeValue)
  17633. // 4. Let cookie-age-limit be the maximum age of the cookie (which
  17634. // SHOULD be 400 days or less, see Section 4.1.2.2).
  17635. // 5. Set delta-seconds to the smaller of its present value and cookie-
  17636. // age-limit.
  17637. // deltaSeconds = Math.min(deltaSeconds * 1000, maxExpiresMs)
  17638. // 6. If delta-seconds is less than or equal to zero (0), let expiry-
  17639. // time be the earliest representable date and time. Otherwise, let
  17640. // the expiry-time be the current date and time plus delta-seconds
  17641. // seconds.
  17642. // const expiryTime = deltaSeconds <= 0 ? Date.now() : Date.now() + deltaSeconds
  17643. // 7. Append an attribute to the cookie-attribute-list with an
  17644. // attribute-name of Max-Age and an attribute-value of expiry-time.
  17645. cookieAttributeList.maxAge = deltaSeconds
  17646. } else if (attributeNameLowercase === 'domain') {
  17647. // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.3
  17648. // If the attribute-name case-insensitively matches the string "Domain",
  17649. // the user agent MUST process the cookie-av as follows.
  17650. // 1. Let cookie-domain be the attribute-value.
  17651. let cookieDomain = attributeValue
  17652. // 2. If cookie-domain starts with %x2E ("."), let cookie-domain be
  17653. // cookie-domain without its leading %x2E (".").
  17654. if (cookieDomain[0] === '.') {
  17655. cookieDomain = cookieDomain.slice(1)
  17656. }
  17657. // 3. Convert the cookie-domain to lower case.
  17658. cookieDomain = cookieDomain.toLowerCase()
  17659. // 4. Append an attribute to the cookie-attribute-list with an
  17660. // attribute-name of Domain and an attribute-value of cookie-domain.
  17661. cookieAttributeList.domain = cookieDomain
  17662. } else if (attributeNameLowercase === 'path') {
  17663. // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.4
  17664. // If the attribute-name case-insensitively matches the string "Path",
  17665. // the user agent MUST process the cookie-av as follows.
  17666. // 1. If the attribute-value is empty or if the first character of the
  17667. // attribute-value is not %x2F ("/"):
  17668. let cookiePath = ''
  17669. if (attributeValue.length === 0 || attributeValue[0] !== '/') {
  17670. // 1. Let cookie-path be the default-path.
  17671. cookiePath = '/'
  17672. } else {
  17673. // Otherwise:
  17674. // 1. Let cookie-path be the attribute-value.
  17675. cookiePath = attributeValue
  17676. }
  17677. // 2. Append an attribute to the cookie-attribute-list with an
  17678. // attribute-name of Path and an attribute-value of cookie-path.
  17679. cookieAttributeList.path = cookiePath
  17680. } else if (attributeNameLowercase === 'secure') {
  17681. // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.5
  17682. // If the attribute-name case-insensitively matches the string "Secure",
  17683. // the user agent MUST append an attribute to the cookie-attribute-list
  17684. // with an attribute-name of Secure and an empty attribute-value.
  17685. cookieAttributeList.secure = true
  17686. } else if (attributeNameLowercase === 'httponly') {
  17687. // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.6
  17688. // If the attribute-name case-insensitively matches the string
  17689. // "HttpOnly", the user agent MUST append an attribute to the cookie-
  17690. // attribute-list with an attribute-name of HttpOnly and an empty
  17691. // attribute-value.
  17692. cookieAttributeList.httpOnly = true
  17693. } else if (attributeNameLowercase === 'samesite') {
  17694. // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.7
  17695. // If the attribute-name case-insensitively matches the string
  17696. // "SameSite", the user agent MUST process the cookie-av as follows:
  17697. // 1. Let enforcement be "Default".
  17698. let enforcement = 'Default'
  17699. const attributeValueLowercase = attributeValue.toLowerCase()
  17700. // 2. If cookie-av's attribute-value is a case-insensitive match for
  17701. // "None", set enforcement to "None".
  17702. if (attributeValueLowercase.includes('none')) {
  17703. enforcement = 'None'
  17704. }
  17705. // 3. If cookie-av's attribute-value is a case-insensitive match for
  17706. // "Strict", set enforcement to "Strict".
  17707. if (attributeValueLowercase.includes('strict')) {
  17708. enforcement = 'Strict'
  17709. }
  17710. // 4. If cookie-av's attribute-value is a case-insensitive match for
  17711. // "Lax", set enforcement to "Lax".
  17712. if (attributeValueLowercase.includes('lax')) {
  17713. enforcement = 'Lax'
  17714. }
  17715. // 5. Append an attribute to the cookie-attribute-list with an
  17716. // attribute-name of "SameSite" and an attribute-value of
  17717. // enforcement.
  17718. cookieAttributeList.sameSite = enforcement
  17719. } else {
  17720. cookieAttributeList.unparsed ??= []
  17721. cookieAttributeList.unparsed.push(`${attributeName}=${attributeValue}`)
  17722. }
  17723. // 8. Return to Step 1 of this algorithm.
  17724. return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList)
  17725. }
  17726. module.exports = {
  17727. parseSetCookie,
  17728. parseUnparsedAttributes
  17729. }
  17730. /***/ }),
  17731. /***/ 3121:
  17732. /***/ ((module) => {
  17733. "use strict";
  17734. /**
  17735. * @param {string} value
  17736. * @returns {boolean}
  17737. */
  17738. function isCTLExcludingHtab (value) {
  17739. if (value.length === 0) {
  17740. return false
  17741. }
  17742. for (const char of value) {
  17743. const code = char.charCodeAt(0)
  17744. if (
  17745. (code >= 0x00 || code <= 0x08) ||
  17746. (code >= 0x0A || code <= 0x1F) ||
  17747. code === 0x7F
  17748. ) {
  17749. return false
  17750. }
  17751. }
  17752. }
  17753. /**
  17754. CHAR = <any US-ASCII character (octets 0 - 127)>
  17755. token = 1*<any CHAR except CTLs or separators>
  17756. separators = "(" | ")" | "<" | ">" | "@"
  17757. | "," | ";" | ":" | "\" | <">
  17758. | "/" | "[" | "]" | "?" | "="
  17759. | "{" | "}" | SP | HT
  17760. * @param {string} name
  17761. */
  17762. function validateCookieName (name) {
  17763. for (const char of name) {
  17764. const code = char.charCodeAt(0)
  17765. if (
  17766. (code <= 0x20 || code > 0x7F) ||
  17767. char === '(' ||
  17768. char === ')' ||
  17769. char === '>' ||
  17770. char === '<' ||
  17771. char === '@' ||
  17772. char === ',' ||
  17773. char === ';' ||
  17774. char === ':' ||
  17775. char === '\\' ||
  17776. char === '"' ||
  17777. char === '/' ||
  17778. char === '[' ||
  17779. char === ']' ||
  17780. char === '?' ||
  17781. char === '=' ||
  17782. char === '{' ||
  17783. char === '}'
  17784. ) {
  17785. throw new Error('Invalid cookie name')
  17786. }
  17787. }
  17788. }
  17789. /**
  17790. cookie-value = *cookie-octet / ( DQUOTE *cookie-octet DQUOTE )
  17791. cookie-octet = %x21 / %x23-2B / %x2D-3A / %x3C-5B / %x5D-7E
  17792. ; US-ASCII characters excluding CTLs,
  17793. ; whitespace DQUOTE, comma, semicolon,
  17794. ; and backslash
  17795. * @param {string} value
  17796. */
  17797. function validateCookieValue (value) {
  17798. for (const char of value) {
  17799. const code = char.charCodeAt(0)
  17800. if (
  17801. code < 0x21 || // exclude CTLs (0-31)
  17802. code === 0x22 ||
  17803. code === 0x2C ||
  17804. code === 0x3B ||
  17805. code === 0x5C ||
  17806. code > 0x7E // non-ascii
  17807. ) {
  17808. throw new Error('Invalid header value')
  17809. }
  17810. }
  17811. }
  17812. /**
  17813. * path-value = <any CHAR except CTLs or ";">
  17814. * @param {string} path
  17815. */
  17816. function validateCookiePath (path) {
  17817. for (const char of path) {
  17818. const code = char.charCodeAt(0)
  17819. if (code < 0x21 || char === ';') {
  17820. throw new Error('Invalid cookie path')
  17821. }
  17822. }
  17823. }
  17824. /**
  17825. * I have no idea why these values aren't allowed to be honest,
  17826. * but Deno tests these. - Khafra
  17827. * @param {string} domain
  17828. */
  17829. function validateCookieDomain (domain) {
  17830. if (
  17831. domain.startsWith('-') ||
  17832. domain.endsWith('.') ||
  17833. domain.endsWith('-')
  17834. ) {
  17835. throw new Error('Invalid cookie domain')
  17836. }
  17837. }
  17838. /**
  17839. * @see https://www.rfc-editor.org/rfc/rfc7231#section-7.1.1.1
  17840. * @param {number|Date} date
  17841. IMF-fixdate = day-name "," SP date1 SP time-of-day SP GMT
  17842. ; fixed length/zone/capitalization subset of the format
  17843. ; see Section 3.3 of [RFC5322]
  17844. day-name = %x4D.6F.6E ; "Mon", case-sensitive
  17845. / %x54.75.65 ; "Tue", case-sensitive
  17846. / %x57.65.64 ; "Wed", case-sensitive
  17847. / %x54.68.75 ; "Thu", case-sensitive
  17848. / %x46.72.69 ; "Fri", case-sensitive
  17849. / %x53.61.74 ; "Sat", case-sensitive
  17850. / %x53.75.6E ; "Sun", case-sensitive
  17851. date1 = day SP month SP year
  17852. ; e.g., 02 Jun 1982
  17853. day = 2DIGIT
  17854. month = %x4A.61.6E ; "Jan", case-sensitive
  17855. / %x46.65.62 ; "Feb", case-sensitive
  17856. / %x4D.61.72 ; "Mar", case-sensitive
  17857. / %x41.70.72 ; "Apr", case-sensitive
  17858. / %x4D.61.79 ; "May", case-sensitive
  17859. / %x4A.75.6E ; "Jun", case-sensitive
  17860. / %x4A.75.6C ; "Jul", case-sensitive
  17861. / %x41.75.67 ; "Aug", case-sensitive
  17862. / %x53.65.70 ; "Sep", case-sensitive
  17863. / %x4F.63.74 ; "Oct", case-sensitive
  17864. / %x4E.6F.76 ; "Nov", case-sensitive
  17865. / %x44.65.63 ; "Dec", case-sensitive
  17866. year = 4DIGIT
  17867. GMT = %x47.4D.54 ; "GMT", case-sensitive
  17868. time-of-day = hour ":" minute ":" second
  17869. ; 00:00:00 - 23:59:60 (leap second)
  17870. hour = 2DIGIT
  17871. minute = 2DIGIT
  17872. second = 2DIGIT
  17873. */
  17874. function toIMFDate (date) {
  17875. if (typeof date === 'number') {
  17876. date = new Date(date)
  17877. }
  17878. const days = [
  17879. 'Sun', 'Mon', 'Tue', 'Wed',
  17880. 'Thu', 'Fri', 'Sat'
  17881. ]
  17882. const months = [
  17883. 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
  17884. 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'
  17885. ]
  17886. const dayName = days[date.getUTCDay()]
  17887. const day = date.getUTCDate().toString().padStart(2, '0')
  17888. const month = months[date.getUTCMonth()]
  17889. const year = date.getUTCFullYear()
  17890. const hour = date.getUTCHours().toString().padStart(2, '0')
  17891. const minute = date.getUTCMinutes().toString().padStart(2, '0')
  17892. const second = date.getUTCSeconds().toString().padStart(2, '0')
  17893. return `${dayName}, ${day} ${month} ${year} ${hour}:${minute}:${second} GMT`
  17894. }
  17895. /**
  17896. max-age-av = "Max-Age=" non-zero-digit *DIGIT
  17897. ; In practice, both expires-av and max-age-av
  17898. ; are limited to dates representable by the
  17899. ; user agent.
  17900. * @param {number} maxAge
  17901. */
  17902. function validateCookieMaxAge (maxAge) {
  17903. if (maxAge < 0) {
  17904. throw new Error('Invalid cookie max-age')
  17905. }
  17906. }
  17907. /**
  17908. * @see https://www.rfc-editor.org/rfc/rfc6265#section-4.1.1
  17909. * @param {import('./index').Cookie} cookie
  17910. */
  17911. function stringify (cookie) {
  17912. if (cookie.name.length === 0) {
  17913. return null
  17914. }
  17915. validateCookieName(cookie.name)
  17916. validateCookieValue(cookie.value)
  17917. const out = [`${cookie.name}=${cookie.value}`]
  17918. // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-cookie-prefixes-00#section-3.1
  17919. // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-cookie-prefixes-00#section-3.2
  17920. if (cookie.name.startsWith('__Secure-')) {
  17921. cookie.secure = true
  17922. }
  17923. if (cookie.name.startsWith('__Host-')) {
  17924. cookie.secure = true
  17925. cookie.domain = null
  17926. cookie.path = '/'
  17927. }
  17928. if (cookie.secure) {
  17929. out.push('Secure')
  17930. }
  17931. if (cookie.httpOnly) {
  17932. out.push('HttpOnly')
  17933. }
  17934. if (typeof cookie.maxAge === 'number') {
  17935. validateCookieMaxAge(cookie.maxAge)
  17936. out.push(`Max-Age=${cookie.maxAge}`)
  17937. }
  17938. if (cookie.domain) {
  17939. validateCookieDomain(cookie.domain)
  17940. out.push(`Domain=${cookie.domain}`)
  17941. }
  17942. if (cookie.path) {
  17943. validateCookiePath(cookie.path)
  17944. out.push(`Path=${cookie.path}`)
  17945. }
  17946. if (cookie.expires && cookie.expires.toString() !== 'Invalid Date') {
  17947. out.push(`Expires=${toIMFDate(cookie.expires)}`)
  17948. }
  17949. if (cookie.sameSite) {
  17950. out.push(`SameSite=${cookie.sameSite}`)
  17951. }
  17952. for (const part of cookie.unparsed) {
  17953. if (!part.includes('=')) {
  17954. throw new Error('Invalid unparsed')
  17955. }
  17956. const [key, ...value] = part.split('=')
  17957. out.push(`${key.trim()}=${value.join('=')}`)
  17958. }
  17959. return out.join('; ')
  17960. }
  17961. module.exports = {
  17962. isCTLExcludingHtab,
  17963. validateCookieName,
  17964. validateCookiePath,
  17965. validateCookieValue,
  17966. toIMFDate,
  17967. stringify
  17968. }
  17969. /***/ }),
  17970. /***/ 2067:
  17971. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  17972. "use strict";
  17973. const net = __nccwpck_require__(1808)
  17974. const assert = __nccwpck_require__(9491)
  17975. const util = __nccwpck_require__(3983)
  17976. const { InvalidArgumentError, ConnectTimeoutError } = __nccwpck_require__(8045)
  17977. let tls // include tls conditionally since it is not always available
  17978. // TODO: session re-use does not wait for the first
  17979. // connection to resolve the session and might therefore
  17980. // resolve the same servername multiple times even when
  17981. // re-use is enabled.
  17982. let SessionCache
  17983. // FIXME: remove workaround when the Node bug is fixed
  17984. // https://github.com/nodejs/node/issues/49344#issuecomment-1741776308
  17985. if (global.FinalizationRegistry && !process.env.NODE_V8_COVERAGE) {
  17986. SessionCache = class WeakSessionCache {
  17987. constructor (maxCachedSessions) {
  17988. this._maxCachedSessions = maxCachedSessions
  17989. this._sessionCache = new Map()
  17990. this._sessionRegistry = new global.FinalizationRegistry((key) => {
  17991. if (this._sessionCache.size < this._maxCachedSessions) {
  17992. return
  17993. }
  17994. const ref = this._sessionCache.get(key)
  17995. if (ref !== undefined && ref.deref() === undefined) {
  17996. this._sessionCache.delete(key)
  17997. }
  17998. })
  17999. }
  18000. get (sessionKey) {
  18001. const ref = this._sessionCache.get(sessionKey)
  18002. return ref ? ref.deref() : null
  18003. }
  18004. set (sessionKey, session) {
  18005. if (this._maxCachedSessions === 0) {
  18006. return
  18007. }
  18008. this._sessionCache.set(sessionKey, new WeakRef(session))
  18009. this._sessionRegistry.register(session, sessionKey)
  18010. }
  18011. }
  18012. } else {
  18013. SessionCache = class SimpleSessionCache {
  18014. constructor (maxCachedSessions) {
  18015. this._maxCachedSessions = maxCachedSessions
  18016. this._sessionCache = new Map()
  18017. }
  18018. get (sessionKey) {
  18019. return this._sessionCache.get(sessionKey)
  18020. }
  18021. set (sessionKey, session) {
  18022. if (this._maxCachedSessions === 0) {
  18023. return
  18024. }
  18025. if (this._sessionCache.size >= this._maxCachedSessions) {
  18026. // remove the oldest session
  18027. const { value: oldestKey } = this._sessionCache.keys().next()
  18028. this._sessionCache.delete(oldestKey)
  18029. }
  18030. this._sessionCache.set(sessionKey, session)
  18031. }
  18032. }
  18033. }
  18034. function buildConnector ({ allowH2, maxCachedSessions, socketPath, timeout, ...opts }) {
  18035. if (maxCachedSessions != null && (!Number.isInteger(maxCachedSessions) || maxCachedSessions < 0)) {
  18036. throw new InvalidArgumentError('maxCachedSessions must be a positive integer or zero')
  18037. }
  18038. const options = { path: socketPath, ...opts }
  18039. const sessionCache = new SessionCache(maxCachedSessions == null ? 100 : maxCachedSessions)
  18040. timeout = timeout == null ? 10e3 : timeout
  18041. allowH2 = allowH2 != null ? allowH2 : false
  18042. return function connect ({ hostname, host, protocol, port, servername, localAddress, httpSocket }, callback) {
  18043. let socket
  18044. if (protocol === 'https:') {
  18045. if (!tls) {
  18046. tls = __nccwpck_require__(4404)
  18047. }
  18048. servername = servername || options.servername || util.getServerName(host) || null
  18049. const sessionKey = servername || hostname
  18050. const session = sessionCache.get(sessionKey) || null
  18051. assert(sessionKey)
  18052. socket = tls.connect({
  18053. highWaterMark: 16384, // TLS in node can't have bigger HWM anyway...
  18054. ...options,
  18055. servername,
  18056. session,
  18057. localAddress,
  18058. // TODO(HTTP/2): Add support for h2c
  18059. ALPNProtocols: allowH2 ? ['http/1.1', 'h2'] : ['http/1.1'],
  18060. socket: httpSocket, // upgrade socket connection
  18061. port: port || 443,
  18062. host: hostname
  18063. })
  18064. socket
  18065. .on('session', function (session) {
  18066. // TODO (fix): Can a session become invalid once established? Don't think so?
  18067. sessionCache.set(sessionKey, session)
  18068. })
  18069. } else {
  18070. assert(!httpSocket, 'httpSocket can only be sent on TLS update')
  18071. socket = net.connect({
  18072. highWaterMark: 64 * 1024, // Same as nodejs fs streams.
  18073. ...options,
  18074. localAddress,
  18075. port: port || 80,
  18076. host: hostname
  18077. })
  18078. }
  18079. // Set TCP keep alive options on the socket here instead of in connect() for the case of assigning the socket
  18080. if (options.keepAlive == null || options.keepAlive) {
  18081. const keepAliveInitialDelay = options.keepAliveInitialDelay === undefined ? 60e3 : options.keepAliveInitialDelay
  18082. socket.setKeepAlive(true, keepAliveInitialDelay)
  18083. }
  18084. const cancelTimeout = setupTimeout(() => onConnectTimeout(socket), timeout)
  18085. socket
  18086. .setNoDelay(true)
  18087. .once(protocol === 'https:' ? 'secureConnect' : 'connect', function () {
  18088. cancelTimeout()
  18089. if (callback) {
  18090. const cb = callback
  18091. callback = null
  18092. cb(null, this)
  18093. }
  18094. })
  18095. .on('error', function (err) {
  18096. cancelTimeout()
  18097. if (callback) {
  18098. const cb = callback
  18099. callback = null
  18100. cb(err)
  18101. }
  18102. })
  18103. return socket
  18104. }
  18105. }
  18106. function setupTimeout (onConnectTimeout, timeout) {
  18107. if (!timeout) {
  18108. return () => {}
  18109. }
  18110. let s1 = null
  18111. let s2 = null
  18112. const timeoutId = setTimeout(() => {
  18113. // setImmediate is added to make sure that we priotorise socket error events over timeouts
  18114. s1 = setImmediate(() => {
  18115. if (process.platform === 'win32') {
  18116. // Windows needs an extra setImmediate probably due to implementation differences in the socket logic
  18117. s2 = setImmediate(() => onConnectTimeout())
  18118. } else {
  18119. onConnectTimeout()
  18120. }
  18121. })
  18122. }, timeout)
  18123. return () => {
  18124. clearTimeout(timeoutId)
  18125. clearImmediate(s1)
  18126. clearImmediate(s2)
  18127. }
  18128. }
  18129. function onConnectTimeout (socket) {
  18130. util.destroy(socket, new ConnectTimeoutError())
  18131. }
  18132. module.exports = buildConnector
  18133. /***/ }),
  18134. /***/ 4462:
  18135. /***/ ((module) => {
  18136. "use strict";
  18137. /** @type {Record<string, string | undefined>} */
  18138. const headerNameLowerCasedRecord = {}
  18139. // https://developer.mozilla.org/docs/Web/HTTP/Headers
  18140. const wellknownHeaderNames = [
  18141. 'Accept',
  18142. 'Accept-Encoding',
  18143. 'Accept-Language',
  18144. 'Accept-Ranges',
  18145. 'Access-Control-Allow-Credentials',
  18146. 'Access-Control-Allow-Headers',
  18147. 'Access-Control-Allow-Methods',
  18148. 'Access-Control-Allow-Origin',
  18149. 'Access-Control-Expose-Headers',
  18150. 'Access-Control-Max-Age',
  18151. 'Access-Control-Request-Headers',
  18152. 'Access-Control-Request-Method',
  18153. 'Age',
  18154. 'Allow',
  18155. 'Alt-Svc',
  18156. 'Alt-Used',
  18157. 'Authorization',
  18158. 'Cache-Control',
  18159. 'Clear-Site-Data',
  18160. 'Connection',
  18161. 'Content-Disposition',
  18162. 'Content-Encoding',
  18163. 'Content-Language',
  18164. 'Content-Length',
  18165. 'Content-Location',
  18166. 'Content-Range',
  18167. 'Content-Security-Policy',
  18168. 'Content-Security-Policy-Report-Only',
  18169. 'Content-Type',
  18170. 'Cookie',
  18171. 'Cross-Origin-Embedder-Policy',
  18172. 'Cross-Origin-Opener-Policy',
  18173. 'Cross-Origin-Resource-Policy',
  18174. 'Date',
  18175. 'Device-Memory',
  18176. 'Downlink',
  18177. 'ECT',
  18178. 'ETag',
  18179. 'Expect',
  18180. 'Expect-CT',
  18181. 'Expires',
  18182. 'Forwarded',
  18183. 'From',
  18184. 'Host',
  18185. 'If-Match',
  18186. 'If-Modified-Since',
  18187. 'If-None-Match',
  18188. 'If-Range',
  18189. 'If-Unmodified-Since',
  18190. 'Keep-Alive',
  18191. 'Last-Modified',
  18192. 'Link',
  18193. 'Location',
  18194. 'Max-Forwards',
  18195. 'Origin',
  18196. 'Permissions-Policy',
  18197. 'Pragma',
  18198. 'Proxy-Authenticate',
  18199. 'Proxy-Authorization',
  18200. 'RTT',
  18201. 'Range',
  18202. 'Referer',
  18203. 'Referrer-Policy',
  18204. 'Refresh',
  18205. 'Retry-After',
  18206. 'Sec-WebSocket-Accept',
  18207. 'Sec-WebSocket-Extensions',
  18208. 'Sec-WebSocket-Key',
  18209. 'Sec-WebSocket-Protocol',
  18210. 'Sec-WebSocket-Version',
  18211. 'Server',
  18212. 'Server-Timing',
  18213. 'Service-Worker-Allowed',
  18214. 'Service-Worker-Navigation-Preload',
  18215. 'Set-Cookie',
  18216. 'SourceMap',
  18217. 'Strict-Transport-Security',
  18218. 'Supports-Loading-Mode',
  18219. 'TE',
  18220. 'Timing-Allow-Origin',
  18221. 'Trailer',
  18222. 'Transfer-Encoding',
  18223. 'Upgrade',
  18224. 'Upgrade-Insecure-Requests',
  18225. 'User-Agent',
  18226. 'Vary',
  18227. 'Via',
  18228. 'WWW-Authenticate',
  18229. 'X-Content-Type-Options',
  18230. 'X-DNS-Prefetch-Control',
  18231. 'X-Frame-Options',
  18232. 'X-Permitted-Cross-Domain-Policies',
  18233. 'X-Powered-By',
  18234. 'X-Requested-With',
  18235. 'X-XSS-Protection'
  18236. ]
  18237. for (let i = 0; i < wellknownHeaderNames.length; ++i) {
  18238. const key = wellknownHeaderNames[i]
  18239. const lowerCasedKey = key.toLowerCase()
  18240. headerNameLowerCasedRecord[key] = headerNameLowerCasedRecord[lowerCasedKey] =
  18241. lowerCasedKey
  18242. }
  18243. // Note: object prototypes should not be able to be referenced. e.g. `Object#hasOwnProperty`.
  18244. Object.setPrototypeOf(headerNameLowerCasedRecord, null)
  18245. module.exports = {
  18246. wellknownHeaderNames,
  18247. headerNameLowerCasedRecord
  18248. }
  18249. /***/ }),
  18250. /***/ 8045:
  18251. /***/ ((module) => {
  18252. "use strict";
  18253. class UndiciError extends Error {
  18254. constructor (message) {
  18255. super(message)
  18256. this.name = 'UndiciError'
  18257. this.code = 'UND_ERR'
  18258. }
  18259. }
  18260. class ConnectTimeoutError extends UndiciError {
  18261. constructor (message) {
  18262. super(message)
  18263. Error.captureStackTrace(this, ConnectTimeoutError)
  18264. this.name = 'ConnectTimeoutError'
  18265. this.message = message || 'Connect Timeout Error'
  18266. this.code = 'UND_ERR_CONNECT_TIMEOUT'
  18267. }
  18268. }
  18269. class HeadersTimeoutError extends UndiciError {
  18270. constructor (message) {
  18271. super(message)
  18272. Error.captureStackTrace(this, HeadersTimeoutError)
  18273. this.name = 'HeadersTimeoutError'
  18274. this.message = message || 'Headers Timeout Error'
  18275. this.code = 'UND_ERR_HEADERS_TIMEOUT'
  18276. }
  18277. }
  18278. class HeadersOverflowError extends UndiciError {
  18279. constructor (message) {
  18280. super(message)
  18281. Error.captureStackTrace(this, HeadersOverflowError)
  18282. this.name = 'HeadersOverflowError'
  18283. this.message = message || 'Headers Overflow Error'
  18284. this.code = 'UND_ERR_HEADERS_OVERFLOW'
  18285. }
  18286. }
  18287. class BodyTimeoutError extends UndiciError {
  18288. constructor (message) {
  18289. super(message)
  18290. Error.captureStackTrace(this, BodyTimeoutError)
  18291. this.name = 'BodyTimeoutError'
  18292. this.message = message || 'Body Timeout Error'
  18293. this.code = 'UND_ERR_BODY_TIMEOUT'
  18294. }
  18295. }
  18296. class ResponseStatusCodeError extends UndiciError {
  18297. constructor (message, statusCode, headers, body) {
  18298. super(message)
  18299. Error.captureStackTrace(this, ResponseStatusCodeError)
  18300. this.name = 'ResponseStatusCodeError'
  18301. this.message = message || 'Response Status Code Error'
  18302. this.code = 'UND_ERR_RESPONSE_STATUS_CODE'
  18303. this.body = body
  18304. this.status = statusCode
  18305. this.statusCode = statusCode
  18306. this.headers = headers
  18307. }
  18308. }
  18309. class InvalidArgumentError extends UndiciError {
  18310. constructor (message) {
  18311. super(message)
  18312. Error.captureStackTrace(this, InvalidArgumentError)
  18313. this.name = 'InvalidArgumentError'
  18314. this.message = message || 'Invalid Argument Error'
  18315. this.code = 'UND_ERR_INVALID_ARG'
  18316. }
  18317. }
  18318. class InvalidReturnValueError extends UndiciError {
  18319. constructor (message) {
  18320. super(message)
  18321. Error.captureStackTrace(this, InvalidReturnValueError)
  18322. this.name = 'InvalidReturnValueError'
  18323. this.message = message || 'Invalid Return Value Error'
  18324. this.code = 'UND_ERR_INVALID_RETURN_VALUE'
  18325. }
  18326. }
  18327. class RequestAbortedError extends UndiciError {
  18328. constructor (message) {
  18329. super(message)
  18330. Error.captureStackTrace(this, RequestAbortedError)
  18331. this.name = 'AbortError'
  18332. this.message = message || 'Request aborted'
  18333. this.code = 'UND_ERR_ABORTED'
  18334. }
  18335. }
  18336. class InformationalError extends UndiciError {
  18337. constructor (message) {
  18338. super(message)
  18339. Error.captureStackTrace(this, InformationalError)
  18340. this.name = 'InformationalError'
  18341. this.message = message || 'Request information'
  18342. this.code = 'UND_ERR_INFO'
  18343. }
  18344. }
  18345. class RequestContentLengthMismatchError extends UndiciError {
  18346. constructor (message) {
  18347. super(message)
  18348. Error.captureStackTrace(this, RequestContentLengthMismatchError)
  18349. this.name = 'RequestContentLengthMismatchError'
  18350. this.message = message || 'Request body length does not match content-length header'
  18351. this.code = 'UND_ERR_REQ_CONTENT_LENGTH_MISMATCH'
  18352. }
  18353. }
  18354. class ResponseContentLengthMismatchError extends UndiciError {
  18355. constructor (message) {
  18356. super(message)
  18357. Error.captureStackTrace(this, ResponseContentLengthMismatchError)
  18358. this.name = 'ResponseContentLengthMismatchError'
  18359. this.message = message || 'Response body length does not match content-length header'
  18360. this.code = 'UND_ERR_RES_CONTENT_LENGTH_MISMATCH'
  18361. }
  18362. }
  18363. class ClientDestroyedError extends UndiciError {
  18364. constructor (message) {
  18365. super(message)
  18366. Error.captureStackTrace(this, ClientDestroyedError)
  18367. this.name = 'ClientDestroyedError'
  18368. this.message = message || 'The client is destroyed'
  18369. this.code = 'UND_ERR_DESTROYED'
  18370. }
  18371. }
  18372. class ClientClosedError extends UndiciError {
  18373. constructor (message) {
  18374. super(message)
  18375. Error.captureStackTrace(this, ClientClosedError)
  18376. this.name = 'ClientClosedError'
  18377. this.message = message || 'The client is closed'
  18378. this.code = 'UND_ERR_CLOSED'
  18379. }
  18380. }
  18381. class SocketError extends UndiciError {
  18382. constructor (message, socket) {
  18383. super(message)
  18384. Error.captureStackTrace(this, SocketError)
  18385. this.name = 'SocketError'
  18386. this.message = message || 'Socket error'
  18387. this.code = 'UND_ERR_SOCKET'
  18388. this.socket = socket
  18389. }
  18390. }
  18391. class NotSupportedError extends UndiciError {
  18392. constructor (message) {
  18393. super(message)
  18394. Error.captureStackTrace(this, NotSupportedError)
  18395. this.name = 'NotSupportedError'
  18396. this.message = message || 'Not supported error'
  18397. this.code = 'UND_ERR_NOT_SUPPORTED'
  18398. }
  18399. }
  18400. class BalancedPoolMissingUpstreamError extends UndiciError {
  18401. constructor (message) {
  18402. super(message)
  18403. Error.captureStackTrace(this, NotSupportedError)
  18404. this.name = 'MissingUpstreamError'
  18405. this.message = message || 'No upstream has been added to the BalancedPool'
  18406. this.code = 'UND_ERR_BPL_MISSING_UPSTREAM'
  18407. }
  18408. }
  18409. class HTTPParserError extends Error {
  18410. constructor (message, code, data) {
  18411. super(message)
  18412. Error.captureStackTrace(this, HTTPParserError)
  18413. this.name = 'HTTPParserError'
  18414. this.code = code ? `HPE_${code}` : undefined
  18415. this.data = data ? data.toString() : undefined
  18416. }
  18417. }
  18418. class ResponseExceededMaxSizeError extends UndiciError {
  18419. constructor (message) {
  18420. super(message)
  18421. Error.captureStackTrace(this, ResponseExceededMaxSizeError)
  18422. this.name = 'ResponseExceededMaxSizeError'
  18423. this.message = message || 'Response content exceeded max size'
  18424. this.code = 'UND_ERR_RES_EXCEEDED_MAX_SIZE'
  18425. }
  18426. }
  18427. class RequestRetryError extends UndiciError {
  18428. constructor (message, code, { headers, data }) {
  18429. super(message)
  18430. Error.captureStackTrace(this, RequestRetryError)
  18431. this.name = 'RequestRetryError'
  18432. this.message = message || 'Request retry error'
  18433. this.code = 'UND_ERR_REQ_RETRY'
  18434. this.statusCode = code
  18435. this.data = data
  18436. this.headers = headers
  18437. }
  18438. }
  18439. module.exports = {
  18440. HTTPParserError,
  18441. UndiciError,
  18442. HeadersTimeoutError,
  18443. HeadersOverflowError,
  18444. BodyTimeoutError,
  18445. RequestContentLengthMismatchError,
  18446. ConnectTimeoutError,
  18447. ResponseStatusCodeError,
  18448. InvalidArgumentError,
  18449. InvalidReturnValueError,
  18450. RequestAbortedError,
  18451. ClientDestroyedError,
  18452. ClientClosedError,
  18453. InformationalError,
  18454. SocketError,
  18455. NotSupportedError,
  18456. ResponseContentLengthMismatchError,
  18457. BalancedPoolMissingUpstreamError,
  18458. ResponseExceededMaxSizeError,
  18459. RequestRetryError
  18460. }
  18461. /***/ }),
  18462. /***/ 2905:
  18463. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  18464. "use strict";
  18465. const {
  18466. InvalidArgumentError,
  18467. NotSupportedError
  18468. } = __nccwpck_require__(8045)
  18469. const assert = __nccwpck_require__(9491)
  18470. const { kHTTP2BuildRequest, kHTTP2CopyHeaders, kHTTP1BuildRequest } = __nccwpck_require__(2785)
  18471. const util = __nccwpck_require__(3983)
  18472. // tokenRegExp and headerCharRegex have been lifted from
  18473. // https://github.com/nodejs/node/blob/main/lib/_http_common.js
  18474. /**
  18475. * Verifies that the given val is a valid HTTP token
  18476. * per the rules defined in RFC 7230
  18477. * See https://tools.ietf.org/html/rfc7230#section-3.2.6
  18478. */
  18479. const tokenRegExp = /^[\^_`a-zA-Z\-0-9!#$%&'*+.|~]+$/
  18480. /**
  18481. * Matches if val contains an invalid field-vchar
  18482. * field-value = *( field-content / obs-fold )
  18483. * field-content = field-vchar [ 1*( SP / HTAB ) field-vchar ]
  18484. * field-vchar = VCHAR / obs-text
  18485. */
  18486. const headerCharRegex = /[^\t\x20-\x7e\x80-\xff]/
  18487. // Verifies that a given path is valid does not contain control chars \x00 to \x20
  18488. const invalidPathRegex = /[^\u0021-\u00ff]/
  18489. const kHandler = Symbol('handler')
  18490. const channels = {}
  18491. let extractBody
  18492. try {
  18493. const diagnosticsChannel = __nccwpck_require__(7643)
  18494. channels.create = diagnosticsChannel.channel('undici:request:create')
  18495. channels.bodySent = diagnosticsChannel.channel('undici:request:bodySent')
  18496. channels.headers = diagnosticsChannel.channel('undici:request:headers')
  18497. channels.trailers = diagnosticsChannel.channel('undici:request:trailers')
  18498. channels.error = diagnosticsChannel.channel('undici:request:error')
  18499. } catch {
  18500. channels.create = { hasSubscribers: false }
  18501. channels.bodySent = { hasSubscribers: false }
  18502. channels.headers = { hasSubscribers: false }
  18503. channels.trailers = { hasSubscribers: false }
  18504. channels.error = { hasSubscribers: false }
  18505. }
  18506. class Request {
  18507. constructor (origin, {
  18508. path,
  18509. method,
  18510. body,
  18511. headers,
  18512. query,
  18513. idempotent,
  18514. blocking,
  18515. upgrade,
  18516. headersTimeout,
  18517. bodyTimeout,
  18518. reset,
  18519. throwOnError,
  18520. expectContinue
  18521. }, handler) {
  18522. if (typeof path !== 'string') {
  18523. throw new InvalidArgumentError('path must be a string')
  18524. } else if (
  18525. path[0] !== '/' &&
  18526. !(path.startsWith('http://') || path.startsWith('https://')) &&
  18527. method !== 'CONNECT'
  18528. ) {
  18529. throw new InvalidArgumentError('path must be an absolute URL or start with a slash')
  18530. } else if (invalidPathRegex.exec(path) !== null) {
  18531. throw new InvalidArgumentError('invalid request path')
  18532. }
  18533. if (typeof method !== 'string') {
  18534. throw new InvalidArgumentError('method must be a string')
  18535. } else if (tokenRegExp.exec(method) === null) {
  18536. throw new InvalidArgumentError('invalid request method')
  18537. }
  18538. if (upgrade && typeof upgrade !== 'string') {
  18539. throw new InvalidArgumentError('upgrade must be a string')
  18540. }
  18541. if (headersTimeout != null && (!Number.isFinite(headersTimeout) || headersTimeout < 0)) {
  18542. throw new InvalidArgumentError('invalid headersTimeout')
  18543. }
  18544. if (bodyTimeout != null && (!Number.isFinite(bodyTimeout) || bodyTimeout < 0)) {
  18545. throw new InvalidArgumentError('invalid bodyTimeout')
  18546. }
  18547. if (reset != null && typeof reset !== 'boolean') {
  18548. throw new InvalidArgumentError('invalid reset')
  18549. }
  18550. if (expectContinue != null && typeof expectContinue !== 'boolean') {
  18551. throw new InvalidArgumentError('invalid expectContinue')
  18552. }
  18553. this.headersTimeout = headersTimeout
  18554. this.bodyTimeout = bodyTimeout
  18555. this.throwOnError = throwOnError === true
  18556. this.method = method
  18557. this.abort = null
  18558. if (body == null) {
  18559. this.body = null
  18560. } else if (util.isStream(body)) {
  18561. this.body = body
  18562. const rState = this.body._readableState
  18563. if (!rState || !rState.autoDestroy) {
  18564. this.endHandler = function autoDestroy () {
  18565. util.destroy(this)
  18566. }
  18567. this.body.on('end', this.endHandler)
  18568. }
  18569. this.errorHandler = err => {
  18570. if (this.abort) {
  18571. this.abort(err)
  18572. } else {
  18573. this.error = err
  18574. }
  18575. }
  18576. this.body.on('error', this.errorHandler)
  18577. } else if (util.isBuffer(body)) {
  18578. this.body = body.byteLength ? body : null
  18579. } else if (ArrayBuffer.isView(body)) {
  18580. this.body = body.buffer.byteLength ? Buffer.from(body.buffer, body.byteOffset, body.byteLength) : null
  18581. } else if (body instanceof ArrayBuffer) {
  18582. this.body = body.byteLength ? Buffer.from(body) : null
  18583. } else if (typeof body === 'string') {
  18584. this.body = body.length ? Buffer.from(body) : null
  18585. } else if (util.isFormDataLike(body) || util.isIterable(body) || util.isBlobLike(body)) {
  18586. this.body = body
  18587. } else {
  18588. throw new InvalidArgumentError('body must be a string, a Buffer, a Readable stream, an iterable, or an async iterable')
  18589. }
  18590. this.completed = false
  18591. this.aborted = false
  18592. this.upgrade = upgrade || null
  18593. this.path = query ? util.buildURL(path, query) : path
  18594. this.origin = origin
  18595. this.idempotent = idempotent == null
  18596. ? method === 'HEAD' || method === 'GET'
  18597. : idempotent
  18598. this.blocking = blocking == null ? false : blocking
  18599. this.reset = reset == null ? null : reset
  18600. this.host = null
  18601. this.contentLength = null
  18602. this.contentType = null
  18603. this.headers = ''
  18604. // Only for H2
  18605. this.expectContinue = expectContinue != null ? expectContinue : false
  18606. if (Array.isArray(headers)) {
  18607. if (headers.length % 2 !== 0) {
  18608. throw new InvalidArgumentError('headers array must be even')
  18609. }
  18610. for (let i = 0; i < headers.length; i += 2) {
  18611. processHeader(this, headers[i], headers[i + 1])
  18612. }
  18613. } else if (headers && typeof headers === 'object') {
  18614. const keys = Object.keys(headers)
  18615. for (let i = 0; i < keys.length; i++) {
  18616. const key = keys[i]
  18617. processHeader(this, key, headers[key])
  18618. }
  18619. } else if (headers != null) {
  18620. throw new InvalidArgumentError('headers must be an object or an array')
  18621. }
  18622. if (util.isFormDataLike(this.body)) {
  18623. if (util.nodeMajor < 16 || (util.nodeMajor === 16 && util.nodeMinor < 8)) {
  18624. throw new InvalidArgumentError('Form-Data bodies are only supported in node v16.8 and newer.')
  18625. }
  18626. if (!extractBody) {
  18627. extractBody = (__nccwpck_require__(9990).extractBody)
  18628. }
  18629. const [bodyStream, contentType] = extractBody(body)
  18630. if (this.contentType == null) {
  18631. this.contentType = contentType
  18632. this.headers += `content-type: ${contentType}\r\n`
  18633. }
  18634. this.body = bodyStream.stream
  18635. this.contentLength = bodyStream.length
  18636. } else if (util.isBlobLike(body) && this.contentType == null && body.type) {
  18637. this.contentType = body.type
  18638. this.headers += `content-type: ${body.type}\r\n`
  18639. }
  18640. util.validateHandler(handler, method, upgrade)
  18641. this.servername = util.getServerName(this.host)
  18642. this[kHandler] = handler
  18643. if (channels.create.hasSubscribers) {
  18644. channels.create.publish({ request: this })
  18645. }
  18646. }
  18647. onBodySent (chunk) {
  18648. if (this[kHandler].onBodySent) {
  18649. try {
  18650. return this[kHandler].onBodySent(chunk)
  18651. } catch (err) {
  18652. this.abort(err)
  18653. }
  18654. }
  18655. }
  18656. onRequestSent () {
  18657. if (channels.bodySent.hasSubscribers) {
  18658. channels.bodySent.publish({ request: this })
  18659. }
  18660. if (this[kHandler].onRequestSent) {
  18661. try {
  18662. return this[kHandler].onRequestSent()
  18663. } catch (err) {
  18664. this.abort(err)
  18665. }
  18666. }
  18667. }
  18668. onConnect (abort) {
  18669. assert(!this.aborted)
  18670. assert(!this.completed)
  18671. if (this.error) {
  18672. abort(this.error)
  18673. } else {
  18674. this.abort = abort
  18675. return this[kHandler].onConnect(abort)
  18676. }
  18677. }
  18678. onHeaders (statusCode, headers, resume, statusText) {
  18679. assert(!this.aborted)
  18680. assert(!this.completed)
  18681. if (channels.headers.hasSubscribers) {
  18682. channels.headers.publish({ request: this, response: { statusCode, headers, statusText } })
  18683. }
  18684. try {
  18685. return this[kHandler].onHeaders(statusCode, headers, resume, statusText)
  18686. } catch (err) {
  18687. this.abort(err)
  18688. }
  18689. }
  18690. onData (chunk) {
  18691. assert(!this.aborted)
  18692. assert(!this.completed)
  18693. try {
  18694. return this[kHandler].onData(chunk)
  18695. } catch (err) {
  18696. this.abort(err)
  18697. return false
  18698. }
  18699. }
  18700. onUpgrade (statusCode, headers, socket) {
  18701. assert(!this.aborted)
  18702. assert(!this.completed)
  18703. return this[kHandler].onUpgrade(statusCode, headers, socket)
  18704. }
  18705. onComplete (trailers) {
  18706. this.onFinally()
  18707. assert(!this.aborted)
  18708. this.completed = true
  18709. if (channels.trailers.hasSubscribers) {
  18710. channels.trailers.publish({ request: this, trailers })
  18711. }
  18712. try {
  18713. return this[kHandler].onComplete(trailers)
  18714. } catch (err) {
  18715. // TODO (fix): This might be a bad idea?
  18716. this.onError(err)
  18717. }
  18718. }
  18719. onError (error) {
  18720. this.onFinally()
  18721. if (channels.error.hasSubscribers) {
  18722. channels.error.publish({ request: this, error })
  18723. }
  18724. if (this.aborted) {
  18725. return
  18726. }
  18727. this.aborted = true
  18728. return this[kHandler].onError(error)
  18729. }
  18730. onFinally () {
  18731. if (this.errorHandler) {
  18732. this.body.off('error', this.errorHandler)
  18733. this.errorHandler = null
  18734. }
  18735. if (this.endHandler) {
  18736. this.body.off('end', this.endHandler)
  18737. this.endHandler = null
  18738. }
  18739. }
  18740. // TODO: adjust to support H2
  18741. addHeader (key, value) {
  18742. processHeader(this, key, value)
  18743. return this
  18744. }
  18745. static [kHTTP1BuildRequest] (origin, opts, handler) {
  18746. // TODO: Migrate header parsing here, to make Requests
  18747. // HTTP agnostic
  18748. return new Request(origin, opts, handler)
  18749. }
  18750. static [kHTTP2BuildRequest] (origin, opts, handler) {
  18751. const headers = opts.headers
  18752. opts = { ...opts, headers: null }
  18753. const request = new Request(origin, opts, handler)
  18754. request.headers = {}
  18755. if (Array.isArray(headers)) {
  18756. if (headers.length % 2 !== 0) {
  18757. throw new InvalidArgumentError('headers array must be even')
  18758. }
  18759. for (let i = 0; i < headers.length; i += 2) {
  18760. processHeader(request, headers[i], headers[i + 1], true)
  18761. }
  18762. } else if (headers && typeof headers === 'object') {
  18763. const keys = Object.keys(headers)
  18764. for (let i = 0; i < keys.length; i++) {
  18765. const key = keys[i]
  18766. processHeader(request, key, headers[key], true)
  18767. }
  18768. } else if (headers != null) {
  18769. throw new InvalidArgumentError('headers must be an object or an array')
  18770. }
  18771. return request
  18772. }
  18773. static [kHTTP2CopyHeaders] (raw) {
  18774. const rawHeaders = raw.split('\r\n')
  18775. const headers = {}
  18776. for (const header of rawHeaders) {
  18777. const [key, value] = header.split(': ')
  18778. if (value == null || value.length === 0) continue
  18779. if (headers[key]) headers[key] += `,${value}`
  18780. else headers[key] = value
  18781. }
  18782. return headers
  18783. }
  18784. }
  18785. function processHeaderValue (key, val, skipAppend) {
  18786. if (val && typeof val === 'object') {
  18787. throw new InvalidArgumentError(`invalid ${key} header`)
  18788. }
  18789. val = val != null ? `${val}` : ''
  18790. if (headerCharRegex.exec(val) !== null) {
  18791. throw new InvalidArgumentError(`invalid ${key} header`)
  18792. }
  18793. return skipAppend ? val : `${key}: ${val}\r\n`
  18794. }
  18795. function processHeader (request, key, val, skipAppend = false) {
  18796. if (val && (typeof val === 'object' && !Array.isArray(val))) {
  18797. throw new InvalidArgumentError(`invalid ${key} header`)
  18798. } else if (val === undefined) {
  18799. return
  18800. }
  18801. if (
  18802. request.host === null &&
  18803. key.length === 4 &&
  18804. key.toLowerCase() === 'host'
  18805. ) {
  18806. if (headerCharRegex.exec(val) !== null) {
  18807. throw new InvalidArgumentError(`invalid ${key} header`)
  18808. }
  18809. // Consumed by Client
  18810. request.host = val
  18811. } else if (
  18812. request.contentLength === null &&
  18813. key.length === 14 &&
  18814. key.toLowerCase() === 'content-length'
  18815. ) {
  18816. request.contentLength = parseInt(val, 10)
  18817. if (!Number.isFinite(request.contentLength)) {
  18818. throw new InvalidArgumentError('invalid content-length header')
  18819. }
  18820. } else if (
  18821. request.contentType === null &&
  18822. key.length === 12 &&
  18823. key.toLowerCase() === 'content-type'
  18824. ) {
  18825. request.contentType = val
  18826. if (skipAppend) request.headers[key] = processHeaderValue(key, val, skipAppend)
  18827. else request.headers += processHeaderValue(key, val)
  18828. } else if (
  18829. key.length === 17 &&
  18830. key.toLowerCase() === 'transfer-encoding'
  18831. ) {
  18832. throw new InvalidArgumentError('invalid transfer-encoding header')
  18833. } else if (
  18834. key.length === 10 &&
  18835. key.toLowerCase() === 'connection'
  18836. ) {
  18837. const value = typeof val === 'string' ? val.toLowerCase() : null
  18838. if (value !== 'close' && value !== 'keep-alive') {
  18839. throw new InvalidArgumentError('invalid connection header')
  18840. } else if (value === 'close') {
  18841. request.reset = true
  18842. }
  18843. } else if (
  18844. key.length === 10 &&
  18845. key.toLowerCase() === 'keep-alive'
  18846. ) {
  18847. throw new InvalidArgumentError('invalid keep-alive header')
  18848. } else if (
  18849. key.length === 7 &&
  18850. key.toLowerCase() === 'upgrade'
  18851. ) {
  18852. throw new InvalidArgumentError('invalid upgrade header')
  18853. } else if (
  18854. key.length === 6 &&
  18855. key.toLowerCase() === 'expect'
  18856. ) {
  18857. throw new NotSupportedError('expect header not supported')
  18858. } else if (tokenRegExp.exec(key) === null) {
  18859. throw new InvalidArgumentError('invalid header key')
  18860. } else {
  18861. if (Array.isArray(val)) {
  18862. for (let i = 0; i < val.length; i++) {
  18863. if (skipAppend) {
  18864. if (request.headers[key]) request.headers[key] += `,${processHeaderValue(key, val[i], skipAppend)}`
  18865. else request.headers[key] = processHeaderValue(key, val[i], skipAppend)
  18866. } else {
  18867. request.headers += processHeaderValue(key, val[i])
  18868. }
  18869. }
  18870. } else {
  18871. if (skipAppend) request.headers[key] = processHeaderValue(key, val, skipAppend)
  18872. else request.headers += processHeaderValue(key, val)
  18873. }
  18874. }
  18875. }
  18876. module.exports = Request
  18877. /***/ }),
  18878. /***/ 2785:
  18879. /***/ ((module) => {
  18880. module.exports = {
  18881. kClose: Symbol('close'),
  18882. kDestroy: Symbol('destroy'),
  18883. kDispatch: Symbol('dispatch'),
  18884. kUrl: Symbol('url'),
  18885. kWriting: Symbol('writing'),
  18886. kResuming: Symbol('resuming'),
  18887. kQueue: Symbol('queue'),
  18888. kConnect: Symbol('connect'),
  18889. kConnecting: Symbol('connecting'),
  18890. kHeadersList: Symbol('headers list'),
  18891. kKeepAliveDefaultTimeout: Symbol('default keep alive timeout'),
  18892. kKeepAliveMaxTimeout: Symbol('max keep alive timeout'),
  18893. kKeepAliveTimeoutThreshold: Symbol('keep alive timeout threshold'),
  18894. kKeepAliveTimeoutValue: Symbol('keep alive timeout'),
  18895. kKeepAlive: Symbol('keep alive'),
  18896. kHeadersTimeout: Symbol('headers timeout'),
  18897. kBodyTimeout: Symbol('body timeout'),
  18898. kServerName: Symbol('server name'),
  18899. kLocalAddress: Symbol('local address'),
  18900. kHost: Symbol('host'),
  18901. kNoRef: Symbol('no ref'),
  18902. kBodyUsed: Symbol('used'),
  18903. kRunning: Symbol('running'),
  18904. kBlocking: Symbol('blocking'),
  18905. kPending: Symbol('pending'),
  18906. kSize: Symbol('size'),
  18907. kBusy: Symbol('busy'),
  18908. kQueued: Symbol('queued'),
  18909. kFree: Symbol('free'),
  18910. kConnected: Symbol('connected'),
  18911. kClosed: Symbol('closed'),
  18912. kNeedDrain: Symbol('need drain'),
  18913. kReset: Symbol('reset'),
  18914. kDestroyed: Symbol.for('nodejs.stream.destroyed'),
  18915. kMaxHeadersSize: Symbol('max headers size'),
  18916. kRunningIdx: Symbol('running index'),
  18917. kPendingIdx: Symbol('pending index'),
  18918. kError: Symbol('error'),
  18919. kClients: Symbol('clients'),
  18920. kClient: Symbol('client'),
  18921. kParser: Symbol('parser'),
  18922. kOnDestroyed: Symbol('destroy callbacks'),
  18923. kPipelining: Symbol('pipelining'),
  18924. kSocket: Symbol('socket'),
  18925. kHostHeader: Symbol('host header'),
  18926. kConnector: Symbol('connector'),
  18927. kStrictContentLength: Symbol('strict content length'),
  18928. kMaxRedirections: Symbol('maxRedirections'),
  18929. kMaxRequests: Symbol('maxRequestsPerClient'),
  18930. kProxy: Symbol('proxy agent options'),
  18931. kCounter: Symbol('socket request counter'),
  18932. kInterceptors: Symbol('dispatch interceptors'),
  18933. kMaxResponseSize: Symbol('max response size'),
  18934. kHTTP2Session: Symbol('http2Session'),
  18935. kHTTP2SessionState: Symbol('http2Session state'),
  18936. kHTTP2BuildRequest: Symbol('http2 build request'),
  18937. kHTTP1BuildRequest: Symbol('http1 build request'),
  18938. kHTTP2CopyHeaders: Symbol('http2 copy headers'),
  18939. kHTTPConnVersion: Symbol('http connection version'),
  18940. kRetryHandlerDefaultRetry: Symbol('retry agent default retry'),
  18941. kConstruct: Symbol('constructable')
  18942. }
  18943. /***/ }),
  18944. /***/ 3983:
  18945. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  18946. "use strict";
  18947. const assert = __nccwpck_require__(9491)
  18948. const { kDestroyed, kBodyUsed } = __nccwpck_require__(2785)
  18949. const { IncomingMessage } = __nccwpck_require__(3685)
  18950. const stream = __nccwpck_require__(2781)
  18951. const net = __nccwpck_require__(1808)
  18952. const { InvalidArgumentError } = __nccwpck_require__(8045)
  18953. const { Blob } = __nccwpck_require__(4300)
  18954. const nodeUtil = __nccwpck_require__(3837)
  18955. const { stringify } = __nccwpck_require__(3477)
  18956. const { headerNameLowerCasedRecord } = __nccwpck_require__(4462)
  18957. const [nodeMajor, nodeMinor] = process.versions.node.split('.').map(v => Number(v))
  18958. function nop () {}
  18959. function isStream (obj) {
  18960. return obj && typeof obj === 'object' && typeof obj.pipe === 'function' && typeof obj.on === 'function'
  18961. }
  18962. // based on https://github.com/node-fetch/fetch-blob/blob/8ab587d34080de94140b54f07168451e7d0b655e/index.js#L229-L241 (MIT License)
  18963. function isBlobLike (object) {
  18964. return (Blob && object instanceof Blob) || (
  18965. object &&
  18966. typeof object === 'object' &&
  18967. (typeof object.stream === 'function' ||
  18968. typeof object.arrayBuffer === 'function') &&
  18969. /^(Blob|File)$/.test(object[Symbol.toStringTag])
  18970. )
  18971. }
  18972. function buildURL (url, queryParams) {
  18973. if (url.includes('?') || url.includes('#')) {
  18974. throw new Error('Query params cannot be passed when url already contains "?" or "#".')
  18975. }
  18976. const stringified = stringify(queryParams)
  18977. if (stringified) {
  18978. url += '?' + stringified
  18979. }
  18980. return url
  18981. }
  18982. function parseURL (url) {
  18983. if (typeof url === 'string') {
  18984. url = new URL(url)
  18985. if (!/^https?:/.test(url.origin || url.protocol)) {
  18986. throw new InvalidArgumentError('Invalid URL protocol: the URL must start with `http:` or `https:`.')
  18987. }
  18988. return url
  18989. }
  18990. if (!url || typeof url !== 'object') {
  18991. throw new InvalidArgumentError('Invalid URL: The URL argument must be a non-null object.')
  18992. }
  18993. if (!/^https?:/.test(url.origin || url.protocol)) {
  18994. throw new InvalidArgumentError('Invalid URL protocol: the URL must start with `http:` or `https:`.')
  18995. }
  18996. if (!(url instanceof URL)) {
  18997. if (url.port != null && url.port !== '' && !Number.isFinite(parseInt(url.port))) {
  18998. throw new InvalidArgumentError('Invalid URL: port must be a valid integer or a string representation of an integer.')
  18999. }
  19000. if (url.path != null && typeof url.path !== 'string') {
  19001. throw new InvalidArgumentError('Invalid URL path: the path must be a string or null/undefined.')
  19002. }
  19003. if (url.pathname != null && typeof url.pathname !== 'string') {
  19004. throw new InvalidArgumentError('Invalid URL pathname: the pathname must be a string or null/undefined.')
  19005. }
  19006. if (url.hostname != null && typeof url.hostname !== 'string') {
  19007. throw new InvalidArgumentError('Invalid URL hostname: the hostname must be a string or null/undefined.')
  19008. }
  19009. if (url.origin != null && typeof url.origin !== 'string') {
  19010. throw new InvalidArgumentError('Invalid URL origin: the origin must be a string or null/undefined.')
  19011. }
  19012. const port = url.port != null
  19013. ? url.port
  19014. : (url.protocol === 'https:' ? 443 : 80)
  19015. let origin = url.origin != null
  19016. ? url.origin
  19017. : `${url.protocol}//${url.hostname}:${port}`
  19018. let path = url.path != null
  19019. ? url.path
  19020. : `${url.pathname || ''}${url.search || ''}`
  19021. if (origin.endsWith('/')) {
  19022. origin = origin.substring(0, origin.length - 1)
  19023. }
  19024. if (path && !path.startsWith('/')) {
  19025. path = `/${path}`
  19026. }
  19027. // new URL(path, origin) is unsafe when `path` contains an absolute URL
  19028. // From https://developer.mozilla.org/en-US/docs/Web/API/URL/URL:
  19029. // If first parameter is a relative URL, second param is required, and will be used as the base URL.
  19030. // If first parameter is an absolute URL, a given second param will be ignored.
  19031. url = new URL(origin + path)
  19032. }
  19033. return url
  19034. }
  19035. function parseOrigin (url) {
  19036. url = parseURL(url)
  19037. if (url.pathname !== '/' || url.search || url.hash) {
  19038. throw new InvalidArgumentError('invalid url')
  19039. }
  19040. return url
  19041. }
  19042. function getHostname (host) {
  19043. if (host[0] === '[') {
  19044. const idx = host.indexOf(']')
  19045. assert(idx !== -1)
  19046. return host.substring(1, idx)
  19047. }
  19048. const idx = host.indexOf(':')
  19049. if (idx === -1) return host
  19050. return host.substring(0, idx)
  19051. }
  19052. // IP addresses are not valid server names per RFC6066
  19053. // > Currently, the only server names supported are DNS hostnames
  19054. function getServerName (host) {
  19055. if (!host) {
  19056. return null
  19057. }
  19058. assert.strictEqual(typeof host, 'string')
  19059. const servername = getHostname(host)
  19060. if (net.isIP(servername)) {
  19061. return ''
  19062. }
  19063. return servername
  19064. }
  19065. function deepClone (obj) {
  19066. return JSON.parse(JSON.stringify(obj))
  19067. }
  19068. function isAsyncIterable (obj) {
  19069. return !!(obj != null && typeof obj[Symbol.asyncIterator] === 'function')
  19070. }
  19071. function isIterable (obj) {
  19072. return !!(obj != null && (typeof obj[Symbol.iterator] === 'function' || typeof obj[Symbol.asyncIterator] === 'function'))
  19073. }
  19074. function bodyLength (body) {
  19075. if (body == null) {
  19076. return 0
  19077. } else if (isStream(body)) {
  19078. const state = body._readableState
  19079. return state && state.objectMode === false && state.ended === true && Number.isFinite(state.length)
  19080. ? state.length
  19081. : null
  19082. } else if (isBlobLike(body)) {
  19083. return body.size != null ? body.size : null
  19084. } else if (isBuffer(body)) {
  19085. return body.byteLength
  19086. }
  19087. return null
  19088. }
  19089. function isDestroyed (stream) {
  19090. return !stream || !!(stream.destroyed || stream[kDestroyed])
  19091. }
  19092. function isReadableAborted (stream) {
  19093. const state = stream && stream._readableState
  19094. return isDestroyed(stream) && state && !state.endEmitted
  19095. }
  19096. function destroy (stream, err) {
  19097. if (stream == null || !isStream(stream) || isDestroyed(stream)) {
  19098. return
  19099. }
  19100. if (typeof stream.destroy === 'function') {
  19101. if (Object.getPrototypeOf(stream).constructor === IncomingMessage) {
  19102. // See: https://github.com/nodejs/node/pull/38505/files
  19103. stream.socket = null
  19104. }
  19105. stream.destroy(err)
  19106. } else if (err) {
  19107. process.nextTick((stream, err) => {
  19108. stream.emit('error', err)
  19109. }, stream, err)
  19110. }
  19111. if (stream.destroyed !== true) {
  19112. stream[kDestroyed] = true
  19113. }
  19114. }
  19115. const KEEPALIVE_TIMEOUT_EXPR = /timeout=(\d+)/
  19116. function parseKeepAliveTimeout (val) {
  19117. const m = val.toString().match(KEEPALIVE_TIMEOUT_EXPR)
  19118. return m ? parseInt(m[1], 10) * 1000 : null
  19119. }
  19120. /**
  19121. * Retrieves a header name and returns its lowercase value.
  19122. * @param {string | Buffer} value Header name
  19123. * @returns {string}
  19124. */
  19125. function headerNameToString (value) {
  19126. return headerNameLowerCasedRecord[value] || value.toLowerCase()
  19127. }
  19128. function parseHeaders (headers, obj = {}) {
  19129. // For H2 support
  19130. if (!Array.isArray(headers)) return headers
  19131. for (let i = 0; i < headers.length; i += 2) {
  19132. const key = headers[i].toString().toLowerCase()
  19133. let val = obj[key]
  19134. if (!val) {
  19135. if (Array.isArray(headers[i + 1])) {
  19136. obj[key] = headers[i + 1].map(x => x.toString('utf8'))
  19137. } else {
  19138. obj[key] = headers[i + 1].toString('utf8')
  19139. }
  19140. } else {
  19141. if (!Array.isArray(val)) {
  19142. val = [val]
  19143. obj[key] = val
  19144. }
  19145. val.push(headers[i + 1].toString('utf8'))
  19146. }
  19147. }
  19148. // See https://github.com/nodejs/node/pull/46528
  19149. if ('content-length' in obj && 'content-disposition' in obj) {
  19150. obj['content-disposition'] = Buffer.from(obj['content-disposition']).toString('latin1')
  19151. }
  19152. return obj
  19153. }
  19154. function parseRawHeaders (headers) {
  19155. const ret = []
  19156. let hasContentLength = false
  19157. let contentDispositionIdx = -1
  19158. for (let n = 0; n < headers.length; n += 2) {
  19159. const key = headers[n + 0].toString()
  19160. const val = headers[n + 1].toString('utf8')
  19161. if (key.length === 14 && (key === 'content-length' || key.toLowerCase() === 'content-length')) {
  19162. ret.push(key, val)
  19163. hasContentLength = true
  19164. } else if (key.length === 19 && (key === 'content-disposition' || key.toLowerCase() === 'content-disposition')) {
  19165. contentDispositionIdx = ret.push(key, val) - 1
  19166. } else {
  19167. ret.push(key, val)
  19168. }
  19169. }
  19170. // See https://github.com/nodejs/node/pull/46528
  19171. if (hasContentLength && contentDispositionIdx !== -1) {
  19172. ret[contentDispositionIdx] = Buffer.from(ret[contentDispositionIdx]).toString('latin1')
  19173. }
  19174. return ret
  19175. }
  19176. function isBuffer (buffer) {
  19177. // See, https://github.com/mcollina/undici/pull/319
  19178. return buffer instanceof Uint8Array || Buffer.isBuffer(buffer)
  19179. }
  19180. function validateHandler (handler, method, upgrade) {
  19181. if (!handler || typeof handler !== 'object') {
  19182. throw new InvalidArgumentError('handler must be an object')
  19183. }
  19184. if (typeof handler.onConnect !== 'function') {
  19185. throw new InvalidArgumentError('invalid onConnect method')
  19186. }
  19187. if (typeof handler.onError !== 'function') {
  19188. throw new InvalidArgumentError('invalid onError method')
  19189. }
  19190. if (typeof handler.onBodySent !== 'function' && handler.onBodySent !== undefined) {
  19191. throw new InvalidArgumentError('invalid onBodySent method')
  19192. }
  19193. if (upgrade || method === 'CONNECT') {
  19194. if (typeof handler.onUpgrade !== 'function') {
  19195. throw new InvalidArgumentError('invalid onUpgrade method')
  19196. }
  19197. } else {
  19198. if (typeof handler.onHeaders !== 'function') {
  19199. throw new InvalidArgumentError('invalid onHeaders method')
  19200. }
  19201. if (typeof handler.onData !== 'function') {
  19202. throw new InvalidArgumentError('invalid onData method')
  19203. }
  19204. if (typeof handler.onComplete !== 'function') {
  19205. throw new InvalidArgumentError('invalid onComplete method')
  19206. }
  19207. }
  19208. }
  19209. // A body is disturbed if it has been read from and it cannot
  19210. // be re-used without losing state or data.
  19211. function isDisturbed (body) {
  19212. return !!(body && (
  19213. stream.isDisturbed
  19214. ? stream.isDisturbed(body) || body[kBodyUsed] // TODO (fix): Why is body[kBodyUsed] needed?
  19215. : body[kBodyUsed] ||
  19216. body.readableDidRead ||
  19217. (body._readableState && body._readableState.dataEmitted) ||
  19218. isReadableAborted(body)
  19219. ))
  19220. }
  19221. function isErrored (body) {
  19222. return !!(body && (
  19223. stream.isErrored
  19224. ? stream.isErrored(body)
  19225. : /state: 'errored'/.test(nodeUtil.inspect(body)
  19226. )))
  19227. }
  19228. function isReadable (body) {
  19229. return !!(body && (
  19230. stream.isReadable
  19231. ? stream.isReadable(body)
  19232. : /state: 'readable'/.test(nodeUtil.inspect(body)
  19233. )))
  19234. }
  19235. function getSocketInfo (socket) {
  19236. return {
  19237. localAddress: socket.localAddress,
  19238. localPort: socket.localPort,
  19239. remoteAddress: socket.remoteAddress,
  19240. remotePort: socket.remotePort,
  19241. remoteFamily: socket.remoteFamily,
  19242. timeout: socket.timeout,
  19243. bytesWritten: socket.bytesWritten,
  19244. bytesRead: socket.bytesRead
  19245. }
  19246. }
  19247. async function * convertIterableToBuffer (iterable) {
  19248. for await (const chunk of iterable) {
  19249. yield Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk)
  19250. }
  19251. }
  19252. let ReadableStream
  19253. function ReadableStreamFrom (iterable) {
  19254. if (!ReadableStream) {
  19255. ReadableStream = (__nccwpck_require__(5356).ReadableStream)
  19256. }
  19257. if (ReadableStream.from) {
  19258. return ReadableStream.from(convertIterableToBuffer(iterable))
  19259. }
  19260. let iterator
  19261. return new ReadableStream(
  19262. {
  19263. async start () {
  19264. iterator = iterable[Symbol.asyncIterator]()
  19265. },
  19266. async pull (controller) {
  19267. const { done, value } = await iterator.next()
  19268. if (done) {
  19269. queueMicrotask(() => {
  19270. controller.close()
  19271. })
  19272. } else {
  19273. const buf = Buffer.isBuffer(value) ? value : Buffer.from(value)
  19274. controller.enqueue(new Uint8Array(buf))
  19275. }
  19276. return controller.desiredSize > 0
  19277. },
  19278. async cancel (reason) {
  19279. await iterator.return()
  19280. }
  19281. },
  19282. 0
  19283. )
  19284. }
  19285. // The chunk should be a FormData instance and contains
  19286. // all the required methods.
  19287. function isFormDataLike (object) {
  19288. return (
  19289. object &&
  19290. typeof object === 'object' &&
  19291. typeof object.append === 'function' &&
  19292. typeof object.delete === 'function' &&
  19293. typeof object.get === 'function' &&
  19294. typeof object.getAll === 'function' &&
  19295. typeof object.has === 'function' &&
  19296. typeof object.set === 'function' &&
  19297. object[Symbol.toStringTag] === 'FormData'
  19298. )
  19299. }
  19300. function throwIfAborted (signal) {
  19301. if (!signal) { return }
  19302. if (typeof signal.throwIfAborted === 'function') {
  19303. signal.throwIfAborted()
  19304. } else {
  19305. if (signal.aborted) {
  19306. // DOMException not available < v17.0.0
  19307. const err = new Error('The operation was aborted')
  19308. err.name = 'AbortError'
  19309. throw err
  19310. }
  19311. }
  19312. }
  19313. function addAbortListener (signal, listener) {
  19314. if ('addEventListener' in signal) {
  19315. signal.addEventListener('abort', listener, { once: true })
  19316. return () => signal.removeEventListener('abort', listener)
  19317. }
  19318. signal.addListener('abort', listener)
  19319. return () => signal.removeListener('abort', listener)
  19320. }
  19321. const hasToWellFormed = !!String.prototype.toWellFormed
  19322. /**
  19323. * @param {string} val
  19324. */
  19325. function toUSVString (val) {
  19326. if (hasToWellFormed) {
  19327. return `${val}`.toWellFormed()
  19328. } else if (nodeUtil.toUSVString) {
  19329. return nodeUtil.toUSVString(val)
  19330. }
  19331. return `${val}`
  19332. }
  19333. // Parsed accordingly to RFC 9110
  19334. // https://www.rfc-editor.org/rfc/rfc9110#field.content-range
  19335. function parseRangeHeader (range) {
  19336. if (range == null || range === '') return { start: 0, end: null, size: null }
  19337. const m = range ? range.match(/^bytes (\d+)-(\d+)\/(\d+)?$/) : null
  19338. return m
  19339. ? {
  19340. start: parseInt(m[1]),
  19341. end: m[2] ? parseInt(m[2]) : null,
  19342. size: m[3] ? parseInt(m[3]) : null
  19343. }
  19344. : null
  19345. }
  19346. const kEnumerableProperty = Object.create(null)
  19347. kEnumerableProperty.enumerable = true
  19348. module.exports = {
  19349. kEnumerableProperty,
  19350. nop,
  19351. isDisturbed,
  19352. isErrored,
  19353. isReadable,
  19354. toUSVString,
  19355. isReadableAborted,
  19356. isBlobLike,
  19357. parseOrigin,
  19358. parseURL,
  19359. getServerName,
  19360. isStream,
  19361. isIterable,
  19362. isAsyncIterable,
  19363. isDestroyed,
  19364. headerNameToString,
  19365. parseRawHeaders,
  19366. parseHeaders,
  19367. parseKeepAliveTimeout,
  19368. destroy,
  19369. bodyLength,
  19370. deepClone,
  19371. ReadableStreamFrom,
  19372. isBuffer,
  19373. validateHandler,
  19374. getSocketInfo,
  19375. isFormDataLike,
  19376. buildURL,
  19377. throwIfAborted,
  19378. addAbortListener,
  19379. parseRangeHeader,
  19380. nodeMajor,
  19381. nodeMinor,
  19382. nodeHasAutoSelectFamily: nodeMajor > 18 || (nodeMajor === 18 && nodeMinor >= 13),
  19383. safeHTTPMethods: ['GET', 'HEAD', 'OPTIONS', 'TRACE']
  19384. }
  19385. /***/ }),
  19386. /***/ 4839:
  19387. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  19388. "use strict";
  19389. const Dispatcher = __nccwpck_require__(412)
  19390. const {
  19391. ClientDestroyedError,
  19392. ClientClosedError,
  19393. InvalidArgumentError
  19394. } = __nccwpck_require__(8045)
  19395. const { kDestroy, kClose, kDispatch, kInterceptors } = __nccwpck_require__(2785)
  19396. const kDestroyed = Symbol('destroyed')
  19397. const kClosed = Symbol('closed')
  19398. const kOnDestroyed = Symbol('onDestroyed')
  19399. const kOnClosed = Symbol('onClosed')
  19400. const kInterceptedDispatch = Symbol('Intercepted Dispatch')
  19401. class DispatcherBase extends Dispatcher {
  19402. constructor () {
  19403. super()
  19404. this[kDestroyed] = false
  19405. this[kOnDestroyed] = null
  19406. this[kClosed] = false
  19407. this[kOnClosed] = []
  19408. }
  19409. get destroyed () {
  19410. return this[kDestroyed]
  19411. }
  19412. get closed () {
  19413. return this[kClosed]
  19414. }
  19415. get interceptors () {
  19416. return this[kInterceptors]
  19417. }
  19418. set interceptors (newInterceptors) {
  19419. if (newInterceptors) {
  19420. for (let i = newInterceptors.length - 1; i >= 0; i--) {
  19421. const interceptor = this[kInterceptors][i]
  19422. if (typeof interceptor !== 'function') {
  19423. throw new InvalidArgumentError('interceptor must be an function')
  19424. }
  19425. }
  19426. }
  19427. this[kInterceptors] = newInterceptors
  19428. }
  19429. close (callback) {
  19430. if (callback === undefined) {
  19431. return new Promise((resolve, reject) => {
  19432. this.close((err, data) => {
  19433. return err ? reject(err) : resolve(data)
  19434. })
  19435. })
  19436. }
  19437. if (typeof callback !== 'function') {
  19438. throw new InvalidArgumentError('invalid callback')
  19439. }
  19440. if (this[kDestroyed]) {
  19441. queueMicrotask(() => callback(new ClientDestroyedError(), null))
  19442. return
  19443. }
  19444. if (this[kClosed]) {
  19445. if (this[kOnClosed]) {
  19446. this[kOnClosed].push(callback)
  19447. } else {
  19448. queueMicrotask(() => callback(null, null))
  19449. }
  19450. return
  19451. }
  19452. this[kClosed] = true
  19453. this[kOnClosed].push(callback)
  19454. const onClosed = () => {
  19455. const callbacks = this[kOnClosed]
  19456. this[kOnClosed] = null
  19457. for (let i = 0; i < callbacks.length; i++) {
  19458. callbacks[i](null, null)
  19459. }
  19460. }
  19461. // Should not error.
  19462. this[kClose]()
  19463. .then(() => this.destroy())
  19464. .then(() => {
  19465. queueMicrotask(onClosed)
  19466. })
  19467. }
  19468. destroy (err, callback) {
  19469. if (typeof err === 'function') {
  19470. callback = err
  19471. err = null
  19472. }
  19473. if (callback === undefined) {
  19474. return new Promise((resolve, reject) => {
  19475. this.destroy(err, (err, data) => {
  19476. return err ? /* istanbul ignore next: should never error */ reject(err) : resolve(data)
  19477. })
  19478. })
  19479. }
  19480. if (typeof callback !== 'function') {
  19481. throw new InvalidArgumentError('invalid callback')
  19482. }
  19483. if (this[kDestroyed]) {
  19484. if (this[kOnDestroyed]) {
  19485. this[kOnDestroyed].push(callback)
  19486. } else {
  19487. queueMicrotask(() => callback(null, null))
  19488. }
  19489. return
  19490. }
  19491. if (!err) {
  19492. err = new ClientDestroyedError()
  19493. }
  19494. this[kDestroyed] = true
  19495. this[kOnDestroyed] = this[kOnDestroyed] || []
  19496. this[kOnDestroyed].push(callback)
  19497. const onDestroyed = () => {
  19498. const callbacks = this[kOnDestroyed]
  19499. this[kOnDestroyed] = null
  19500. for (let i = 0; i < callbacks.length; i++) {
  19501. callbacks[i](null, null)
  19502. }
  19503. }
  19504. // Should not error.
  19505. this[kDestroy](err).then(() => {
  19506. queueMicrotask(onDestroyed)
  19507. })
  19508. }
  19509. [kInterceptedDispatch] (opts, handler) {
  19510. if (!this[kInterceptors] || this[kInterceptors].length === 0) {
  19511. this[kInterceptedDispatch] = this[kDispatch]
  19512. return this[kDispatch](opts, handler)
  19513. }
  19514. let dispatch = this[kDispatch].bind(this)
  19515. for (let i = this[kInterceptors].length - 1; i >= 0; i--) {
  19516. dispatch = this[kInterceptors][i](dispatch)
  19517. }
  19518. this[kInterceptedDispatch] = dispatch
  19519. return dispatch(opts, handler)
  19520. }
  19521. dispatch (opts, handler) {
  19522. if (!handler || typeof handler !== 'object') {
  19523. throw new InvalidArgumentError('handler must be an object')
  19524. }
  19525. try {
  19526. if (!opts || typeof opts !== 'object') {
  19527. throw new InvalidArgumentError('opts must be an object.')
  19528. }
  19529. if (this[kDestroyed] || this[kOnDestroyed]) {
  19530. throw new ClientDestroyedError()
  19531. }
  19532. if (this[kClosed]) {
  19533. throw new ClientClosedError()
  19534. }
  19535. return this[kInterceptedDispatch](opts, handler)
  19536. } catch (err) {
  19537. if (typeof handler.onError !== 'function') {
  19538. throw new InvalidArgumentError('invalid onError method')
  19539. }
  19540. handler.onError(err)
  19541. return false
  19542. }
  19543. }
  19544. }
  19545. module.exports = DispatcherBase
  19546. /***/ }),
  19547. /***/ 412:
  19548. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  19549. "use strict";
  19550. const EventEmitter = __nccwpck_require__(2361)
  19551. class Dispatcher extends EventEmitter {
  19552. dispatch () {
  19553. throw new Error('not implemented')
  19554. }
  19555. close () {
  19556. throw new Error('not implemented')
  19557. }
  19558. destroy () {
  19559. throw new Error('not implemented')
  19560. }
  19561. }
  19562. module.exports = Dispatcher
  19563. /***/ }),
  19564. /***/ 9990:
  19565. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  19566. "use strict";
  19567. const Busboy = __nccwpck_require__(727)
  19568. const util = __nccwpck_require__(3983)
  19569. const {
  19570. ReadableStreamFrom,
  19571. isBlobLike,
  19572. isReadableStreamLike,
  19573. readableStreamClose,
  19574. createDeferredPromise,
  19575. fullyReadBody
  19576. } = __nccwpck_require__(2538)
  19577. const { FormData } = __nccwpck_require__(2015)
  19578. const { kState } = __nccwpck_require__(5861)
  19579. const { webidl } = __nccwpck_require__(1744)
  19580. const { DOMException, structuredClone } = __nccwpck_require__(1037)
  19581. const { Blob, File: NativeFile } = __nccwpck_require__(4300)
  19582. const { kBodyUsed } = __nccwpck_require__(2785)
  19583. const assert = __nccwpck_require__(9491)
  19584. const { isErrored } = __nccwpck_require__(3983)
  19585. const { isUint8Array, isArrayBuffer } = __nccwpck_require__(9830)
  19586. const { File: UndiciFile } = __nccwpck_require__(8511)
  19587. const { parseMIMEType, serializeAMimeType } = __nccwpck_require__(685)
  19588. let random
  19589. try {
  19590. const crypto = __nccwpck_require__(6005)
  19591. random = (max) => crypto.randomInt(0, max)
  19592. } catch {
  19593. random = (max) => Math.floor(Math.random(max))
  19594. }
  19595. let ReadableStream = globalThis.ReadableStream
  19596. /** @type {globalThis['File']} */
  19597. const File = NativeFile ?? UndiciFile
  19598. const textEncoder = new TextEncoder()
  19599. const textDecoder = new TextDecoder()
  19600. // https://fetch.spec.whatwg.org/#concept-bodyinit-extract
  19601. function extractBody (object, keepalive = false) {
  19602. if (!ReadableStream) {
  19603. ReadableStream = (__nccwpck_require__(5356).ReadableStream)
  19604. }
  19605. // 1. Let stream be null.
  19606. let stream = null
  19607. // 2. If object is a ReadableStream object, then set stream to object.
  19608. if (object instanceof ReadableStream) {
  19609. stream = object
  19610. } else if (isBlobLike(object)) {
  19611. // 3. Otherwise, if object is a Blob object, set stream to the
  19612. // result of running object’s get stream.
  19613. stream = object.stream()
  19614. } else {
  19615. // 4. Otherwise, set stream to a new ReadableStream object, and set
  19616. // up stream.
  19617. stream = new ReadableStream({
  19618. async pull (controller) {
  19619. controller.enqueue(
  19620. typeof source === 'string' ? textEncoder.encode(source) : source
  19621. )
  19622. queueMicrotask(() => readableStreamClose(controller))
  19623. },
  19624. start () {},
  19625. type: undefined
  19626. })
  19627. }
  19628. // 5. Assert: stream is a ReadableStream object.
  19629. assert(isReadableStreamLike(stream))
  19630. // 6. Let action be null.
  19631. let action = null
  19632. // 7. Let source be null.
  19633. let source = null
  19634. // 8. Let length be null.
  19635. let length = null
  19636. // 9. Let type be null.
  19637. let type = null
  19638. // 10. Switch on object:
  19639. if (typeof object === 'string') {
  19640. // Set source to the UTF-8 encoding of object.
  19641. // Note: setting source to a Uint8Array here breaks some mocking assumptions.
  19642. source = object
  19643. // Set type to `text/plain;charset=UTF-8`.
  19644. type = 'text/plain;charset=UTF-8'
  19645. } else if (object instanceof URLSearchParams) {
  19646. // URLSearchParams
  19647. // spec says to run application/x-www-form-urlencoded on body.list
  19648. // this is implemented in Node.js as apart of an URLSearchParams instance toString method
  19649. // See: https://github.com/nodejs/node/blob/e46c680bf2b211bbd52cf959ca17ee98c7f657f5/lib/internal/url.js#L490
  19650. // and https://github.com/nodejs/node/blob/e46c680bf2b211bbd52cf959ca17ee98c7f657f5/lib/internal/url.js#L1100
  19651. // Set source to the result of running the application/x-www-form-urlencoded serializer with object’s list.
  19652. source = object.toString()
  19653. // Set type to `application/x-www-form-urlencoded;charset=UTF-8`.
  19654. type = 'application/x-www-form-urlencoded;charset=UTF-8'
  19655. } else if (isArrayBuffer(object)) {
  19656. // BufferSource/ArrayBuffer
  19657. // Set source to a copy of the bytes held by object.
  19658. source = new Uint8Array(object.slice())
  19659. } else if (ArrayBuffer.isView(object)) {
  19660. // BufferSource/ArrayBufferView
  19661. // Set source to a copy of the bytes held by object.
  19662. source = new Uint8Array(object.buffer.slice(object.byteOffset, object.byteOffset + object.byteLength))
  19663. } else if (util.isFormDataLike(object)) {
  19664. const boundary = `----formdata-undici-0${`${random(1e11)}`.padStart(11, '0')}`
  19665. const prefix = `--${boundary}\r\nContent-Disposition: form-data`
  19666. /*! formdata-polyfill. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> */
  19667. const escape = (str) =>
  19668. str.replace(/\n/g, '%0A').replace(/\r/g, '%0D').replace(/"/g, '%22')
  19669. const normalizeLinefeeds = (value) => value.replace(/\r?\n|\r/g, '\r\n')
  19670. // Set action to this step: run the multipart/form-data
  19671. // encoding algorithm, with object’s entry list and UTF-8.
  19672. // - This ensures that the body is immutable and can't be changed afterwords
  19673. // - That the content-length is calculated in advance.
  19674. // - And that all parts are pre-encoded and ready to be sent.
  19675. const blobParts = []
  19676. const rn = new Uint8Array([13, 10]) // '\r\n'
  19677. length = 0
  19678. let hasUnknownSizeValue = false
  19679. for (const [name, value] of object) {
  19680. if (typeof value === 'string') {
  19681. const chunk = textEncoder.encode(prefix +
  19682. `; name="${escape(normalizeLinefeeds(name))}"` +
  19683. `\r\n\r\n${normalizeLinefeeds(value)}\r\n`)
  19684. blobParts.push(chunk)
  19685. length += chunk.byteLength
  19686. } else {
  19687. const chunk = textEncoder.encode(`${prefix}; name="${escape(normalizeLinefeeds(name))}"` +
  19688. (value.name ? `; filename="${escape(value.name)}"` : '') + '\r\n' +
  19689. `Content-Type: ${
  19690. value.type || 'application/octet-stream'
  19691. }\r\n\r\n`)
  19692. blobParts.push(chunk, value, rn)
  19693. if (typeof value.size === 'number') {
  19694. length += chunk.byteLength + value.size + rn.byteLength
  19695. } else {
  19696. hasUnknownSizeValue = true
  19697. }
  19698. }
  19699. }
  19700. const chunk = textEncoder.encode(`--${boundary}--`)
  19701. blobParts.push(chunk)
  19702. length += chunk.byteLength
  19703. if (hasUnknownSizeValue) {
  19704. length = null
  19705. }
  19706. // Set source to object.
  19707. source = object
  19708. action = async function * () {
  19709. for (const part of blobParts) {
  19710. if (part.stream) {
  19711. yield * part.stream()
  19712. } else {
  19713. yield part
  19714. }
  19715. }
  19716. }
  19717. // Set type to `multipart/form-data; boundary=`,
  19718. // followed by the multipart/form-data boundary string generated
  19719. // by the multipart/form-data encoding algorithm.
  19720. type = 'multipart/form-data; boundary=' + boundary
  19721. } else if (isBlobLike(object)) {
  19722. // Blob
  19723. // Set source to object.
  19724. source = object
  19725. // Set length to object’s size.
  19726. length = object.size
  19727. // If object’s type attribute is not the empty byte sequence, set
  19728. // type to its value.
  19729. if (object.type) {
  19730. type = object.type
  19731. }
  19732. } else if (typeof object[Symbol.asyncIterator] === 'function') {
  19733. // If keepalive is true, then throw a TypeError.
  19734. if (keepalive) {
  19735. throw new TypeError('keepalive')
  19736. }
  19737. // If object is disturbed or locked, then throw a TypeError.
  19738. if (util.isDisturbed(object) || object.locked) {
  19739. throw new TypeError(
  19740. 'Response body object should not be disturbed or locked'
  19741. )
  19742. }
  19743. stream =
  19744. object instanceof ReadableStream ? object : ReadableStreamFrom(object)
  19745. }
  19746. // 11. If source is a byte sequence, then set action to a
  19747. // step that returns source and length to source’s length.
  19748. if (typeof source === 'string' || util.isBuffer(source)) {
  19749. length = Buffer.byteLength(source)
  19750. }
  19751. // 12. If action is non-null, then run these steps in in parallel:
  19752. if (action != null) {
  19753. // Run action.
  19754. let iterator
  19755. stream = new ReadableStream({
  19756. async start () {
  19757. iterator = action(object)[Symbol.asyncIterator]()
  19758. },
  19759. async pull (controller) {
  19760. const { value, done } = await iterator.next()
  19761. if (done) {
  19762. // When running action is done, close stream.
  19763. queueMicrotask(() => {
  19764. controller.close()
  19765. })
  19766. } else {
  19767. // Whenever one or more bytes are available and stream is not errored,
  19768. // enqueue a Uint8Array wrapping an ArrayBuffer containing the available
  19769. // bytes into stream.
  19770. if (!isErrored(stream)) {
  19771. controller.enqueue(new Uint8Array(value))
  19772. }
  19773. }
  19774. return controller.desiredSize > 0
  19775. },
  19776. async cancel (reason) {
  19777. await iterator.return()
  19778. },
  19779. type: undefined
  19780. })
  19781. }
  19782. // 13. Let body be a body whose stream is stream, source is source,
  19783. // and length is length.
  19784. const body = { stream, source, length }
  19785. // 14. Return (body, type).
  19786. return [body, type]
  19787. }
  19788. // https://fetch.spec.whatwg.org/#bodyinit-safely-extract
  19789. function safelyExtractBody (object, keepalive = false) {
  19790. if (!ReadableStream) {
  19791. // istanbul ignore next
  19792. ReadableStream = (__nccwpck_require__(5356).ReadableStream)
  19793. }
  19794. // To safely extract a body and a `Content-Type` value from
  19795. // a byte sequence or BodyInit object object, run these steps:
  19796. // 1. If object is a ReadableStream object, then:
  19797. if (object instanceof ReadableStream) {
  19798. // Assert: object is neither disturbed nor locked.
  19799. // istanbul ignore next
  19800. assert(!util.isDisturbed(object), 'The body has already been consumed.')
  19801. // istanbul ignore next
  19802. assert(!object.locked, 'The stream is locked.')
  19803. }
  19804. // 2. Return the results of extracting object.
  19805. return extractBody(object, keepalive)
  19806. }
  19807. function cloneBody (body) {
  19808. // To clone a body body, run these steps:
  19809. // https://fetch.spec.whatwg.org/#concept-body-clone
  19810. // 1. Let « out1, out2 » be the result of teeing body’s stream.
  19811. const [out1, out2] = body.stream.tee()
  19812. const out2Clone = structuredClone(out2, { transfer: [out2] })
  19813. // This, for whatever reasons, unrefs out2Clone which allows
  19814. // the process to exit by itself.
  19815. const [, finalClone] = out2Clone.tee()
  19816. // 2. Set body’s stream to out1.
  19817. body.stream = out1
  19818. // 3. Return a body whose stream is out2 and other members are copied from body.
  19819. return {
  19820. stream: finalClone,
  19821. length: body.length,
  19822. source: body.source
  19823. }
  19824. }
  19825. async function * consumeBody (body) {
  19826. if (body) {
  19827. if (isUint8Array(body)) {
  19828. yield body
  19829. } else {
  19830. const stream = body.stream
  19831. if (util.isDisturbed(stream)) {
  19832. throw new TypeError('The body has already been consumed.')
  19833. }
  19834. if (stream.locked) {
  19835. throw new TypeError('The stream is locked.')
  19836. }
  19837. // Compat.
  19838. stream[kBodyUsed] = true
  19839. yield * stream
  19840. }
  19841. }
  19842. }
  19843. function throwIfAborted (state) {
  19844. if (state.aborted) {
  19845. throw new DOMException('The operation was aborted.', 'AbortError')
  19846. }
  19847. }
  19848. function bodyMixinMethods (instance) {
  19849. const methods = {
  19850. blob () {
  19851. // The blob() method steps are to return the result of
  19852. // running consume body with this and the following step
  19853. // given a byte sequence bytes: return a Blob whose
  19854. // contents are bytes and whose type attribute is this’s
  19855. // MIME type.
  19856. return specConsumeBody(this, (bytes) => {
  19857. let mimeType = bodyMimeType(this)
  19858. if (mimeType === 'failure') {
  19859. mimeType = ''
  19860. } else if (mimeType) {
  19861. mimeType = serializeAMimeType(mimeType)
  19862. }
  19863. // Return a Blob whose contents are bytes and type attribute
  19864. // is mimeType.
  19865. return new Blob([bytes], { type: mimeType })
  19866. }, instance)
  19867. },
  19868. arrayBuffer () {
  19869. // The arrayBuffer() method steps are to return the result
  19870. // of running consume body with this and the following step
  19871. // given a byte sequence bytes: return a new ArrayBuffer
  19872. // whose contents are bytes.
  19873. return specConsumeBody(this, (bytes) => {
  19874. return new Uint8Array(bytes).buffer
  19875. }, instance)
  19876. },
  19877. text () {
  19878. // The text() method steps are to return the result of running
  19879. // consume body with this and UTF-8 decode.
  19880. return specConsumeBody(this, utf8DecodeBytes, instance)
  19881. },
  19882. json () {
  19883. // The json() method steps are to return the result of running
  19884. // consume body with this and parse JSON from bytes.
  19885. return specConsumeBody(this, parseJSONFromBytes, instance)
  19886. },
  19887. async formData () {
  19888. webidl.brandCheck(this, instance)
  19889. throwIfAborted(this[kState])
  19890. const contentType = this.headers.get('Content-Type')
  19891. // If mimeType’s essence is "multipart/form-data", then:
  19892. if (/multipart\/form-data/.test(contentType)) {
  19893. const headers = {}
  19894. for (const [key, value] of this.headers) headers[key.toLowerCase()] = value
  19895. const responseFormData = new FormData()
  19896. let busboy
  19897. try {
  19898. busboy = new Busboy({
  19899. headers,
  19900. preservePath: true
  19901. })
  19902. } catch (err) {
  19903. throw new DOMException(`${err}`, 'AbortError')
  19904. }
  19905. busboy.on('field', (name, value) => {
  19906. responseFormData.append(name, value)
  19907. })
  19908. busboy.on('file', (name, value, filename, encoding, mimeType) => {
  19909. const chunks = []
  19910. if (encoding === 'base64' || encoding.toLowerCase() === 'base64') {
  19911. let base64chunk = ''
  19912. value.on('data', (chunk) => {
  19913. base64chunk += chunk.toString().replace(/[\r\n]/gm, '')
  19914. const end = base64chunk.length - base64chunk.length % 4
  19915. chunks.push(Buffer.from(base64chunk.slice(0, end), 'base64'))
  19916. base64chunk = base64chunk.slice(end)
  19917. })
  19918. value.on('end', () => {
  19919. chunks.push(Buffer.from(base64chunk, 'base64'))
  19920. responseFormData.append(name, new File(chunks, filename, { type: mimeType }))
  19921. })
  19922. } else {
  19923. value.on('data', (chunk) => {
  19924. chunks.push(chunk)
  19925. })
  19926. value.on('end', () => {
  19927. responseFormData.append(name, new File(chunks, filename, { type: mimeType }))
  19928. })
  19929. }
  19930. })
  19931. const busboyResolve = new Promise((resolve, reject) => {
  19932. busboy.on('finish', resolve)
  19933. busboy.on('error', (err) => reject(new TypeError(err)))
  19934. })
  19935. if (this.body !== null) for await (const chunk of consumeBody(this[kState].body)) busboy.write(chunk)
  19936. busboy.end()
  19937. await busboyResolve
  19938. return responseFormData
  19939. } else if (/application\/x-www-form-urlencoded/.test(contentType)) {
  19940. // Otherwise, if mimeType’s essence is "application/x-www-form-urlencoded", then:
  19941. // 1. Let entries be the result of parsing bytes.
  19942. let entries
  19943. try {
  19944. let text = ''
  19945. // application/x-www-form-urlencoded parser will keep the BOM.
  19946. // https://url.spec.whatwg.org/#concept-urlencoded-parser
  19947. // Note that streaming decoder is stateful and cannot be reused
  19948. const streamingDecoder = new TextDecoder('utf-8', { ignoreBOM: true })
  19949. for await (const chunk of consumeBody(this[kState].body)) {
  19950. if (!isUint8Array(chunk)) {
  19951. throw new TypeError('Expected Uint8Array chunk')
  19952. }
  19953. text += streamingDecoder.decode(chunk, { stream: true })
  19954. }
  19955. text += streamingDecoder.decode()
  19956. entries = new URLSearchParams(text)
  19957. } catch (err) {
  19958. // istanbul ignore next: Unclear when new URLSearchParams can fail on a string.
  19959. // 2. If entries is failure, then throw a TypeError.
  19960. throw Object.assign(new TypeError(), { cause: err })
  19961. }
  19962. // 3. Return a new FormData object whose entries are entries.
  19963. const formData = new FormData()
  19964. for (const [name, value] of entries) {
  19965. formData.append(name, value)
  19966. }
  19967. return formData
  19968. } else {
  19969. // Wait a tick before checking if the request has been aborted.
  19970. // Otherwise, a TypeError can be thrown when an AbortError should.
  19971. await Promise.resolve()
  19972. throwIfAborted(this[kState])
  19973. // Otherwise, throw a TypeError.
  19974. throw webidl.errors.exception({
  19975. header: `${instance.name}.formData`,
  19976. message: 'Could not parse content as FormData.'
  19977. })
  19978. }
  19979. }
  19980. }
  19981. return methods
  19982. }
  19983. function mixinBody (prototype) {
  19984. Object.assign(prototype.prototype, bodyMixinMethods(prototype))
  19985. }
  19986. /**
  19987. * @see https://fetch.spec.whatwg.org/#concept-body-consume-body
  19988. * @param {Response|Request} object
  19989. * @param {(value: unknown) => unknown} convertBytesToJSValue
  19990. * @param {Response|Request} instance
  19991. */
  19992. async function specConsumeBody (object, convertBytesToJSValue, instance) {
  19993. webidl.brandCheck(object, instance)
  19994. throwIfAborted(object[kState])
  19995. // 1. If object is unusable, then return a promise rejected
  19996. // with a TypeError.
  19997. if (bodyUnusable(object[kState].body)) {
  19998. throw new TypeError('Body is unusable')
  19999. }
  20000. // 2. Let promise be a new promise.
  20001. const promise = createDeferredPromise()
  20002. // 3. Let errorSteps given error be to reject promise with error.
  20003. const errorSteps = (error) => promise.reject(error)
  20004. // 4. Let successSteps given a byte sequence data be to resolve
  20005. // promise with the result of running convertBytesToJSValue
  20006. // with data. If that threw an exception, then run errorSteps
  20007. // with that exception.
  20008. const successSteps = (data) => {
  20009. try {
  20010. promise.resolve(convertBytesToJSValue(data))
  20011. } catch (e) {
  20012. errorSteps(e)
  20013. }
  20014. }
  20015. // 5. If object’s body is null, then run successSteps with an
  20016. // empty byte sequence.
  20017. if (object[kState].body == null) {
  20018. successSteps(new Uint8Array())
  20019. return promise.promise
  20020. }
  20021. // 6. Otherwise, fully read object’s body given successSteps,
  20022. // errorSteps, and object’s relevant global object.
  20023. await fullyReadBody(object[kState].body, successSteps, errorSteps)
  20024. // 7. Return promise.
  20025. return promise.promise
  20026. }
  20027. // https://fetch.spec.whatwg.org/#body-unusable
  20028. function bodyUnusable (body) {
  20029. // An object including the Body interface mixin is
  20030. // said to be unusable if its body is non-null and
  20031. // its body’s stream is disturbed or locked.
  20032. return body != null && (body.stream.locked || util.isDisturbed(body.stream))
  20033. }
  20034. /**
  20035. * @see https://encoding.spec.whatwg.org/#utf-8-decode
  20036. * @param {Buffer} buffer
  20037. */
  20038. function utf8DecodeBytes (buffer) {
  20039. if (buffer.length === 0) {
  20040. return ''
  20041. }
  20042. // 1. Let buffer be the result of peeking three bytes from
  20043. // ioQueue, converted to a byte sequence.
  20044. // 2. If buffer is 0xEF 0xBB 0xBF, then read three
  20045. // bytes from ioQueue. (Do nothing with those bytes.)
  20046. if (buffer[0] === 0xEF && buffer[1] === 0xBB && buffer[2] === 0xBF) {
  20047. buffer = buffer.subarray(3)
  20048. }
  20049. // 3. Process a queue with an instance of UTF-8’s
  20050. // decoder, ioQueue, output, and "replacement".
  20051. const output = textDecoder.decode(buffer)
  20052. // 4. Return output.
  20053. return output
  20054. }
  20055. /**
  20056. * @see https://infra.spec.whatwg.org/#parse-json-bytes-to-a-javascript-value
  20057. * @param {Uint8Array} bytes
  20058. */
  20059. function parseJSONFromBytes (bytes) {
  20060. return JSON.parse(utf8DecodeBytes(bytes))
  20061. }
  20062. /**
  20063. * @see https://fetch.spec.whatwg.org/#concept-body-mime-type
  20064. * @param {import('./response').Response|import('./request').Request} object
  20065. */
  20066. function bodyMimeType (object) {
  20067. const { headersList } = object[kState]
  20068. const contentType = headersList.get('content-type')
  20069. if (contentType === null) {
  20070. return 'failure'
  20071. }
  20072. return parseMIMEType(contentType)
  20073. }
  20074. module.exports = {
  20075. extractBody,
  20076. safelyExtractBody,
  20077. cloneBody,
  20078. mixinBody
  20079. }
  20080. /***/ }),
  20081. /***/ 1037:
  20082. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  20083. "use strict";
  20084. const { MessageChannel, receiveMessageOnPort } = __nccwpck_require__(1267)
  20085. const corsSafeListedMethods = ['GET', 'HEAD', 'POST']
  20086. const corsSafeListedMethodsSet = new Set(corsSafeListedMethods)
  20087. const nullBodyStatus = [101, 204, 205, 304]
  20088. const redirectStatus = [301, 302, 303, 307, 308]
  20089. const redirectStatusSet = new Set(redirectStatus)
  20090. // https://fetch.spec.whatwg.org/#block-bad-port
  20091. const badPorts = [
  20092. '1', '7', '9', '11', '13', '15', '17', '19', '20', '21', '22', '23', '25', '37', '42', '43', '53', '69', '77', '79',
  20093. '87', '95', '101', '102', '103', '104', '109', '110', '111', '113', '115', '117', '119', '123', '135', '137',
  20094. '139', '143', '161', '179', '389', '427', '465', '512', '513', '514', '515', '526', '530', '531', '532',
  20095. '540', '548', '554', '556', '563', '587', '601', '636', '989', '990', '993', '995', '1719', '1720', '1723',
  20096. '2049', '3659', '4045', '5060', '5061', '6000', '6566', '6665', '6666', '6667', '6668', '6669', '6697',
  20097. '10080'
  20098. ]
  20099. const badPortsSet = new Set(badPorts)
  20100. // https://w3c.github.io/webappsec-referrer-policy/#referrer-policies
  20101. const referrerPolicy = [
  20102. '',
  20103. 'no-referrer',
  20104. 'no-referrer-when-downgrade',
  20105. 'same-origin',
  20106. 'origin',
  20107. 'strict-origin',
  20108. 'origin-when-cross-origin',
  20109. 'strict-origin-when-cross-origin',
  20110. 'unsafe-url'
  20111. ]
  20112. const referrerPolicySet = new Set(referrerPolicy)
  20113. const requestRedirect = ['follow', 'manual', 'error']
  20114. const safeMethods = ['GET', 'HEAD', 'OPTIONS', 'TRACE']
  20115. const safeMethodsSet = new Set(safeMethods)
  20116. const requestMode = ['navigate', 'same-origin', 'no-cors', 'cors']
  20117. const requestCredentials = ['omit', 'same-origin', 'include']
  20118. const requestCache = [
  20119. 'default',
  20120. 'no-store',
  20121. 'reload',
  20122. 'no-cache',
  20123. 'force-cache',
  20124. 'only-if-cached'
  20125. ]
  20126. // https://fetch.spec.whatwg.org/#request-body-header-name
  20127. const requestBodyHeader = [
  20128. 'content-encoding',
  20129. 'content-language',
  20130. 'content-location',
  20131. 'content-type',
  20132. // See https://github.com/nodejs/undici/issues/2021
  20133. // 'Content-Length' is a forbidden header name, which is typically
  20134. // removed in the Headers implementation. However, undici doesn't
  20135. // filter out headers, so we add it here.
  20136. 'content-length'
  20137. ]
  20138. // https://fetch.spec.whatwg.org/#enumdef-requestduplex
  20139. const requestDuplex = [
  20140. 'half'
  20141. ]
  20142. // http://fetch.spec.whatwg.org/#forbidden-method
  20143. const forbiddenMethods = ['CONNECT', 'TRACE', 'TRACK']
  20144. const forbiddenMethodsSet = new Set(forbiddenMethods)
  20145. const subresource = [
  20146. 'audio',
  20147. 'audioworklet',
  20148. 'font',
  20149. 'image',
  20150. 'manifest',
  20151. 'paintworklet',
  20152. 'script',
  20153. 'style',
  20154. 'track',
  20155. 'video',
  20156. 'xslt',
  20157. ''
  20158. ]
  20159. const subresourceSet = new Set(subresource)
  20160. /** @type {globalThis['DOMException']} */
  20161. const DOMException = globalThis.DOMException ?? (() => {
  20162. // DOMException was only made a global in Node v17.0.0,
  20163. // but fetch supports >= v16.8.
  20164. try {
  20165. atob('~')
  20166. } catch (err) {
  20167. return Object.getPrototypeOf(err).constructor
  20168. }
  20169. })()
  20170. let channel
  20171. /** @type {globalThis['structuredClone']} */
  20172. const structuredClone =
  20173. globalThis.structuredClone ??
  20174. // https://github.com/nodejs/node/blob/b27ae24dcc4251bad726d9d84baf678d1f707fed/lib/internal/structured_clone.js
  20175. // structuredClone was added in v17.0.0, but fetch supports v16.8
  20176. function structuredClone (value, options = undefined) {
  20177. if (arguments.length === 0) {
  20178. throw new TypeError('missing argument')
  20179. }
  20180. if (!channel) {
  20181. channel = new MessageChannel()
  20182. }
  20183. channel.port1.unref()
  20184. channel.port2.unref()
  20185. channel.port1.postMessage(value, options?.transfer)
  20186. return receiveMessageOnPort(channel.port2).message
  20187. }
  20188. module.exports = {
  20189. DOMException,
  20190. structuredClone,
  20191. subresource,
  20192. forbiddenMethods,
  20193. requestBodyHeader,
  20194. referrerPolicy,
  20195. requestRedirect,
  20196. requestMode,
  20197. requestCredentials,
  20198. requestCache,
  20199. redirectStatus,
  20200. corsSafeListedMethods,
  20201. nullBodyStatus,
  20202. safeMethods,
  20203. badPorts,
  20204. requestDuplex,
  20205. subresourceSet,
  20206. badPortsSet,
  20207. redirectStatusSet,
  20208. corsSafeListedMethodsSet,
  20209. safeMethodsSet,
  20210. forbiddenMethodsSet,
  20211. referrerPolicySet
  20212. }
  20213. /***/ }),
  20214. /***/ 685:
  20215. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  20216. const assert = __nccwpck_require__(9491)
  20217. const { atob } = __nccwpck_require__(4300)
  20218. const { isomorphicDecode } = __nccwpck_require__(2538)
  20219. const encoder = new TextEncoder()
  20220. /**
  20221. * @see https://mimesniff.spec.whatwg.org/#http-token-code-point
  20222. */
  20223. const HTTP_TOKEN_CODEPOINTS = /^[!#$%&'*+-.^_|~A-Za-z0-9]+$/
  20224. const HTTP_WHITESPACE_REGEX = /(\u000A|\u000D|\u0009|\u0020)/ // eslint-disable-line
  20225. /**
  20226. * @see https://mimesniff.spec.whatwg.org/#http-quoted-string-token-code-point
  20227. */
  20228. const HTTP_QUOTED_STRING_TOKENS = /[\u0009|\u0020-\u007E|\u0080-\u00FF]/ // eslint-disable-line
  20229. // https://fetch.spec.whatwg.org/#data-url-processor
  20230. /** @param {URL} dataURL */
  20231. function dataURLProcessor (dataURL) {
  20232. // 1. Assert: dataURL’s scheme is "data".
  20233. assert(dataURL.protocol === 'data:')
  20234. // 2. Let input be the result of running the URL
  20235. // serializer on dataURL with exclude fragment
  20236. // set to true.
  20237. let input = URLSerializer(dataURL, true)
  20238. // 3. Remove the leading "data:" string from input.
  20239. input = input.slice(5)
  20240. // 4. Let position point at the start of input.
  20241. const position = { position: 0 }
  20242. // 5. Let mimeType be the result of collecting a
  20243. // sequence of code points that are not equal
  20244. // to U+002C (,), given position.
  20245. let mimeType = collectASequenceOfCodePointsFast(
  20246. ',',
  20247. input,
  20248. position
  20249. )
  20250. // 6. Strip leading and trailing ASCII whitespace
  20251. // from mimeType.
  20252. // Undici implementation note: we need to store the
  20253. // length because if the mimetype has spaces removed,
  20254. // the wrong amount will be sliced from the input in
  20255. // step #9
  20256. const mimeTypeLength = mimeType.length
  20257. mimeType = removeASCIIWhitespace(mimeType, true, true)
  20258. // 7. If position is past the end of input, then
  20259. // return failure
  20260. if (position.position >= input.length) {
  20261. return 'failure'
  20262. }
  20263. // 8. Advance position by 1.
  20264. position.position++
  20265. // 9. Let encodedBody be the remainder of input.
  20266. const encodedBody = input.slice(mimeTypeLength + 1)
  20267. // 10. Let body be the percent-decoding of encodedBody.
  20268. let body = stringPercentDecode(encodedBody)
  20269. // 11. If mimeType ends with U+003B (;), followed by
  20270. // zero or more U+0020 SPACE, followed by an ASCII
  20271. // case-insensitive match for "base64", then:
  20272. if (/;(\u0020){0,}base64$/i.test(mimeType)) {
  20273. // 1. Let stringBody be the isomorphic decode of body.
  20274. const stringBody = isomorphicDecode(body)
  20275. // 2. Set body to the forgiving-base64 decode of
  20276. // stringBody.
  20277. body = forgivingBase64(stringBody)
  20278. // 3. If body is failure, then return failure.
  20279. if (body === 'failure') {
  20280. return 'failure'
  20281. }
  20282. // 4. Remove the last 6 code points from mimeType.
  20283. mimeType = mimeType.slice(0, -6)
  20284. // 5. Remove trailing U+0020 SPACE code points from mimeType,
  20285. // if any.
  20286. mimeType = mimeType.replace(/(\u0020)+$/, '')
  20287. // 6. Remove the last U+003B (;) code point from mimeType.
  20288. mimeType = mimeType.slice(0, -1)
  20289. }
  20290. // 12. If mimeType starts with U+003B (;), then prepend
  20291. // "text/plain" to mimeType.
  20292. if (mimeType.startsWith(';')) {
  20293. mimeType = 'text/plain' + mimeType
  20294. }
  20295. // 13. Let mimeTypeRecord be the result of parsing
  20296. // mimeType.
  20297. let mimeTypeRecord = parseMIMEType(mimeType)
  20298. // 14. If mimeTypeRecord is failure, then set
  20299. // mimeTypeRecord to text/plain;charset=US-ASCII.
  20300. if (mimeTypeRecord === 'failure') {
  20301. mimeTypeRecord = parseMIMEType('text/plain;charset=US-ASCII')
  20302. }
  20303. // 15. Return a new data: URL struct whose MIME
  20304. // type is mimeTypeRecord and body is body.
  20305. // https://fetch.spec.whatwg.org/#data-url-struct
  20306. return { mimeType: mimeTypeRecord, body }
  20307. }
  20308. // https://url.spec.whatwg.org/#concept-url-serializer
  20309. /**
  20310. * @param {URL} url
  20311. * @param {boolean} excludeFragment
  20312. */
  20313. function URLSerializer (url, excludeFragment = false) {
  20314. if (!excludeFragment) {
  20315. return url.href
  20316. }
  20317. const href = url.href
  20318. const hashLength = url.hash.length
  20319. return hashLength === 0 ? href : href.substring(0, href.length - hashLength)
  20320. }
  20321. // https://infra.spec.whatwg.org/#collect-a-sequence-of-code-points
  20322. /**
  20323. * @param {(char: string) => boolean} condition
  20324. * @param {string} input
  20325. * @param {{ position: number }} position
  20326. */
  20327. function collectASequenceOfCodePoints (condition, input, position) {
  20328. // 1. Let result be the empty string.
  20329. let result = ''
  20330. // 2. While position doesn’t point past the end of input and the
  20331. // code point at position within input meets the condition condition:
  20332. while (position.position < input.length && condition(input[position.position])) {
  20333. // 1. Append that code point to the end of result.
  20334. result += input[position.position]
  20335. // 2. Advance position by 1.
  20336. position.position++
  20337. }
  20338. // 3. Return result.
  20339. return result
  20340. }
  20341. /**
  20342. * A faster collectASequenceOfCodePoints that only works when comparing a single character.
  20343. * @param {string} char
  20344. * @param {string} input
  20345. * @param {{ position: number }} position
  20346. */
  20347. function collectASequenceOfCodePointsFast (char, input, position) {
  20348. const idx = input.indexOf(char, position.position)
  20349. const start = position.position
  20350. if (idx === -1) {
  20351. position.position = input.length
  20352. return input.slice(start)
  20353. }
  20354. position.position = idx
  20355. return input.slice(start, position.position)
  20356. }
  20357. // https://url.spec.whatwg.org/#string-percent-decode
  20358. /** @param {string} input */
  20359. function stringPercentDecode (input) {
  20360. // 1. Let bytes be the UTF-8 encoding of input.
  20361. const bytes = encoder.encode(input)
  20362. // 2. Return the percent-decoding of bytes.
  20363. return percentDecode(bytes)
  20364. }
  20365. // https://url.spec.whatwg.org/#percent-decode
  20366. /** @param {Uint8Array} input */
  20367. function percentDecode (input) {
  20368. // 1. Let output be an empty byte sequence.
  20369. /** @type {number[]} */
  20370. const output = []
  20371. // 2. For each byte byte in input:
  20372. for (let i = 0; i < input.length; i++) {
  20373. const byte = input[i]
  20374. // 1. If byte is not 0x25 (%), then append byte to output.
  20375. if (byte !== 0x25) {
  20376. output.push(byte)
  20377. // 2. Otherwise, if byte is 0x25 (%) and the next two bytes
  20378. // after byte in input are not in the ranges
  20379. // 0x30 (0) to 0x39 (9), 0x41 (A) to 0x46 (F),
  20380. // and 0x61 (a) to 0x66 (f), all inclusive, append byte
  20381. // to output.
  20382. } else if (
  20383. byte === 0x25 &&
  20384. !/^[0-9A-Fa-f]{2}$/i.test(String.fromCharCode(input[i + 1], input[i + 2]))
  20385. ) {
  20386. output.push(0x25)
  20387. // 3. Otherwise:
  20388. } else {
  20389. // 1. Let bytePoint be the two bytes after byte in input,
  20390. // decoded, and then interpreted as hexadecimal number.
  20391. const nextTwoBytes = String.fromCharCode(input[i + 1], input[i + 2])
  20392. const bytePoint = Number.parseInt(nextTwoBytes, 16)
  20393. // 2. Append a byte whose value is bytePoint to output.
  20394. output.push(bytePoint)
  20395. // 3. Skip the next two bytes in input.
  20396. i += 2
  20397. }
  20398. }
  20399. // 3. Return output.
  20400. return Uint8Array.from(output)
  20401. }
  20402. // https://mimesniff.spec.whatwg.org/#parse-a-mime-type
  20403. /** @param {string} input */
  20404. function parseMIMEType (input) {
  20405. // 1. Remove any leading and trailing HTTP whitespace
  20406. // from input.
  20407. input = removeHTTPWhitespace(input, true, true)
  20408. // 2. Let position be a position variable for input,
  20409. // initially pointing at the start of input.
  20410. const position = { position: 0 }
  20411. // 3. Let type be the result of collecting a sequence
  20412. // of code points that are not U+002F (/) from
  20413. // input, given position.
  20414. const type = collectASequenceOfCodePointsFast(
  20415. '/',
  20416. input,
  20417. position
  20418. )
  20419. // 4. If type is the empty string or does not solely
  20420. // contain HTTP token code points, then return failure.
  20421. // https://mimesniff.spec.whatwg.org/#http-token-code-point
  20422. if (type.length === 0 || !HTTP_TOKEN_CODEPOINTS.test(type)) {
  20423. return 'failure'
  20424. }
  20425. // 5. If position is past the end of input, then return
  20426. // failure
  20427. if (position.position > input.length) {
  20428. return 'failure'
  20429. }
  20430. // 6. Advance position by 1. (This skips past U+002F (/).)
  20431. position.position++
  20432. // 7. Let subtype be the result of collecting a sequence of
  20433. // code points that are not U+003B (;) from input, given
  20434. // position.
  20435. let subtype = collectASequenceOfCodePointsFast(
  20436. ';',
  20437. input,
  20438. position
  20439. )
  20440. // 8. Remove any trailing HTTP whitespace from subtype.
  20441. subtype = removeHTTPWhitespace(subtype, false, true)
  20442. // 9. If subtype is the empty string or does not solely
  20443. // contain HTTP token code points, then return failure.
  20444. if (subtype.length === 0 || !HTTP_TOKEN_CODEPOINTS.test(subtype)) {
  20445. return 'failure'
  20446. }
  20447. const typeLowercase = type.toLowerCase()
  20448. const subtypeLowercase = subtype.toLowerCase()
  20449. // 10. Let mimeType be a new MIME type record whose type
  20450. // is type, in ASCII lowercase, and subtype is subtype,
  20451. // in ASCII lowercase.
  20452. // https://mimesniff.spec.whatwg.org/#mime-type
  20453. const mimeType = {
  20454. type: typeLowercase,
  20455. subtype: subtypeLowercase,
  20456. /** @type {Map<string, string>} */
  20457. parameters: new Map(),
  20458. // https://mimesniff.spec.whatwg.org/#mime-type-essence
  20459. essence: `${typeLowercase}/${subtypeLowercase}`
  20460. }
  20461. // 11. While position is not past the end of input:
  20462. while (position.position < input.length) {
  20463. // 1. Advance position by 1. (This skips past U+003B (;).)
  20464. position.position++
  20465. // 2. Collect a sequence of code points that are HTTP
  20466. // whitespace from input given position.
  20467. collectASequenceOfCodePoints(
  20468. // https://fetch.spec.whatwg.org/#http-whitespace
  20469. char => HTTP_WHITESPACE_REGEX.test(char),
  20470. input,
  20471. position
  20472. )
  20473. // 3. Let parameterName be the result of collecting a
  20474. // sequence of code points that are not U+003B (;)
  20475. // or U+003D (=) from input, given position.
  20476. let parameterName = collectASequenceOfCodePoints(
  20477. (char) => char !== ';' && char !== '=',
  20478. input,
  20479. position
  20480. )
  20481. // 4. Set parameterName to parameterName, in ASCII
  20482. // lowercase.
  20483. parameterName = parameterName.toLowerCase()
  20484. // 5. If position is not past the end of input, then:
  20485. if (position.position < input.length) {
  20486. // 1. If the code point at position within input is
  20487. // U+003B (;), then continue.
  20488. if (input[position.position] === ';') {
  20489. continue
  20490. }
  20491. // 2. Advance position by 1. (This skips past U+003D (=).)
  20492. position.position++
  20493. }
  20494. // 6. If position is past the end of input, then break.
  20495. if (position.position > input.length) {
  20496. break
  20497. }
  20498. // 7. Let parameterValue be null.
  20499. let parameterValue = null
  20500. // 8. If the code point at position within input is
  20501. // U+0022 ("), then:
  20502. if (input[position.position] === '"') {
  20503. // 1. Set parameterValue to the result of collecting
  20504. // an HTTP quoted string from input, given position
  20505. // and the extract-value flag.
  20506. parameterValue = collectAnHTTPQuotedString(input, position, true)
  20507. // 2. Collect a sequence of code points that are not
  20508. // U+003B (;) from input, given position.
  20509. collectASequenceOfCodePointsFast(
  20510. ';',
  20511. input,
  20512. position
  20513. )
  20514. // 9. Otherwise:
  20515. } else {
  20516. // 1. Set parameterValue to the result of collecting
  20517. // a sequence of code points that are not U+003B (;)
  20518. // from input, given position.
  20519. parameterValue = collectASequenceOfCodePointsFast(
  20520. ';',
  20521. input,
  20522. position
  20523. )
  20524. // 2. Remove any trailing HTTP whitespace from parameterValue.
  20525. parameterValue = removeHTTPWhitespace(parameterValue, false, true)
  20526. // 3. If parameterValue is the empty string, then continue.
  20527. if (parameterValue.length === 0) {
  20528. continue
  20529. }
  20530. }
  20531. // 10. If all of the following are true
  20532. // - parameterName is not the empty string
  20533. // - parameterName solely contains HTTP token code points
  20534. // - parameterValue solely contains HTTP quoted-string token code points
  20535. // - mimeType’s parameters[parameterName] does not exist
  20536. // then set mimeType’s parameters[parameterName] to parameterValue.
  20537. if (
  20538. parameterName.length !== 0 &&
  20539. HTTP_TOKEN_CODEPOINTS.test(parameterName) &&
  20540. (parameterValue.length === 0 || HTTP_QUOTED_STRING_TOKENS.test(parameterValue)) &&
  20541. !mimeType.parameters.has(parameterName)
  20542. ) {
  20543. mimeType.parameters.set(parameterName, parameterValue)
  20544. }
  20545. }
  20546. // 12. Return mimeType.
  20547. return mimeType
  20548. }
  20549. // https://infra.spec.whatwg.org/#forgiving-base64-decode
  20550. /** @param {string} data */
  20551. function forgivingBase64 (data) {
  20552. // 1. Remove all ASCII whitespace from data.
  20553. data = data.replace(/[\u0009\u000A\u000C\u000D\u0020]/g, '') // eslint-disable-line
  20554. // 2. If data’s code point length divides by 4 leaving
  20555. // no remainder, then:
  20556. if (data.length % 4 === 0) {
  20557. // 1. If data ends with one or two U+003D (=) code points,
  20558. // then remove them from data.
  20559. data = data.replace(/=?=$/, '')
  20560. }
  20561. // 3. If data’s code point length divides by 4 leaving
  20562. // a remainder of 1, then return failure.
  20563. if (data.length % 4 === 1) {
  20564. return 'failure'
  20565. }
  20566. // 4. If data contains a code point that is not one of
  20567. // U+002B (+)
  20568. // U+002F (/)
  20569. // ASCII alphanumeric
  20570. // then return failure.
  20571. if (/[^+/0-9A-Za-z]/.test(data)) {
  20572. return 'failure'
  20573. }
  20574. const binary = atob(data)
  20575. const bytes = new Uint8Array(binary.length)
  20576. for (let byte = 0; byte < binary.length; byte++) {
  20577. bytes[byte] = binary.charCodeAt(byte)
  20578. }
  20579. return bytes
  20580. }
  20581. // https://fetch.spec.whatwg.org/#collect-an-http-quoted-string
  20582. // tests: https://fetch.spec.whatwg.org/#example-http-quoted-string
  20583. /**
  20584. * @param {string} input
  20585. * @param {{ position: number }} position
  20586. * @param {boolean?} extractValue
  20587. */
  20588. function collectAnHTTPQuotedString (input, position, extractValue) {
  20589. // 1. Let positionStart be position.
  20590. const positionStart = position.position
  20591. // 2. Let value be the empty string.
  20592. let value = ''
  20593. // 3. Assert: the code point at position within input
  20594. // is U+0022 (").
  20595. assert(input[position.position] === '"')
  20596. // 4. Advance position by 1.
  20597. position.position++
  20598. // 5. While true:
  20599. while (true) {
  20600. // 1. Append the result of collecting a sequence of code points
  20601. // that are not U+0022 (") or U+005C (\) from input, given
  20602. // position, to value.
  20603. value += collectASequenceOfCodePoints(
  20604. (char) => char !== '"' && char !== '\\',
  20605. input,
  20606. position
  20607. )
  20608. // 2. If position is past the end of input, then break.
  20609. if (position.position >= input.length) {
  20610. break
  20611. }
  20612. // 3. Let quoteOrBackslash be the code point at position within
  20613. // input.
  20614. const quoteOrBackslash = input[position.position]
  20615. // 4. Advance position by 1.
  20616. position.position++
  20617. // 5. If quoteOrBackslash is U+005C (\), then:
  20618. if (quoteOrBackslash === '\\') {
  20619. // 1. If position is past the end of input, then append
  20620. // U+005C (\) to value and break.
  20621. if (position.position >= input.length) {
  20622. value += '\\'
  20623. break
  20624. }
  20625. // 2. Append the code point at position within input to value.
  20626. value += input[position.position]
  20627. // 3. Advance position by 1.
  20628. position.position++
  20629. // 6. Otherwise:
  20630. } else {
  20631. // 1. Assert: quoteOrBackslash is U+0022 (").
  20632. assert(quoteOrBackslash === '"')
  20633. // 2. Break.
  20634. break
  20635. }
  20636. }
  20637. // 6. If the extract-value flag is set, then return value.
  20638. if (extractValue) {
  20639. return value
  20640. }
  20641. // 7. Return the code points from positionStart to position,
  20642. // inclusive, within input.
  20643. return input.slice(positionStart, position.position)
  20644. }
  20645. /**
  20646. * @see https://mimesniff.spec.whatwg.org/#serialize-a-mime-type
  20647. */
  20648. function serializeAMimeType (mimeType) {
  20649. assert(mimeType !== 'failure')
  20650. const { parameters, essence } = mimeType
  20651. // 1. Let serialization be the concatenation of mimeType’s
  20652. // type, U+002F (/), and mimeType’s subtype.
  20653. let serialization = essence
  20654. // 2. For each name → value of mimeType’s parameters:
  20655. for (let [name, value] of parameters.entries()) {
  20656. // 1. Append U+003B (;) to serialization.
  20657. serialization += ';'
  20658. // 2. Append name to serialization.
  20659. serialization += name
  20660. // 3. Append U+003D (=) to serialization.
  20661. serialization += '='
  20662. // 4. If value does not solely contain HTTP token code
  20663. // points or value is the empty string, then:
  20664. if (!HTTP_TOKEN_CODEPOINTS.test(value)) {
  20665. // 1. Precede each occurence of U+0022 (") or
  20666. // U+005C (\) in value with U+005C (\).
  20667. value = value.replace(/(\\|")/g, '\\$1')
  20668. // 2. Prepend U+0022 (") to value.
  20669. value = '"' + value
  20670. // 3. Append U+0022 (") to value.
  20671. value += '"'
  20672. }
  20673. // 5. Append value to serialization.
  20674. serialization += value
  20675. }
  20676. // 3. Return serialization.
  20677. return serialization
  20678. }
  20679. /**
  20680. * @see https://fetch.spec.whatwg.org/#http-whitespace
  20681. * @param {string} char
  20682. */
  20683. function isHTTPWhiteSpace (char) {
  20684. return char === '\r' || char === '\n' || char === '\t' || char === ' '
  20685. }
  20686. /**
  20687. * @see https://fetch.spec.whatwg.org/#http-whitespace
  20688. * @param {string} str
  20689. */
  20690. function removeHTTPWhitespace (str, leading = true, trailing = true) {
  20691. let lead = 0
  20692. let trail = str.length - 1
  20693. if (leading) {
  20694. for (; lead < str.length && isHTTPWhiteSpace(str[lead]); lead++);
  20695. }
  20696. if (trailing) {
  20697. for (; trail > 0 && isHTTPWhiteSpace(str[trail]); trail--);
  20698. }
  20699. return str.slice(lead, trail + 1)
  20700. }
  20701. /**
  20702. * @see https://infra.spec.whatwg.org/#ascii-whitespace
  20703. * @param {string} char
  20704. */
  20705. function isASCIIWhitespace (char) {
  20706. return char === '\r' || char === '\n' || char === '\t' || char === '\f' || char === ' '
  20707. }
  20708. /**
  20709. * @see https://infra.spec.whatwg.org/#strip-leading-and-trailing-ascii-whitespace
  20710. */
  20711. function removeASCIIWhitespace (str, leading = true, trailing = true) {
  20712. let lead = 0
  20713. let trail = str.length - 1
  20714. if (leading) {
  20715. for (; lead < str.length && isASCIIWhitespace(str[lead]); lead++);
  20716. }
  20717. if (trailing) {
  20718. for (; trail > 0 && isASCIIWhitespace(str[trail]); trail--);
  20719. }
  20720. return str.slice(lead, trail + 1)
  20721. }
  20722. module.exports = {
  20723. dataURLProcessor,
  20724. URLSerializer,
  20725. collectASequenceOfCodePoints,
  20726. collectASequenceOfCodePointsFast,
  20727. stringPercentDecode,
  20728. parseMIMEType,
  20729. collectAnHTTPQuotedString,
  20730. serializeAMimeType
  20731. }
  20732. /***/ }),
  20733. /***/ 8511:
  20734. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  20735. "use strict";
  20736. const { Blob, File: NativeFile } = __nccwpck_require__(4300)
  20737. const { types } = __nccwpck_require__(3837)
  20738. const { kState } = __nccwpck_require__(5861)
  20739. const { isBlobLike } = __nccwpck_require__(2538)
  20740. const { webidl } = __nccwpck_require__(1744)
  20741. const { parseMIMEType, serializeAMimeType } = __nccwpck_require__(685)
  20742. const { kEnumerableProperty } = __nccwpck_require__(3983)
  20743. const encoder = new TextEncoder()
  20744. class File extends Blob {
  20745. constructor (fileBits, fileName, options = {}) {
  20746. // The File constructor is invoked with two or three parameters, depending
  20747. // on whether the optional dictionary parameter is used. When the File()
  20748. // constructor is invoked, user agents must run the following steps:
  20749. webidl.argumentLengthCheck(arguments, 2, { header: 'File constructor' })
  20750. fileBits = webidl.converters['sequence<BlobPart>'](fileBits)
  20751. fileName = webidl.converters.USVString(fileName)
  20752. options = webidl.converters.FilePropertyBag(options)
  20753. // 1. Let bytes be the result of processing blob parts given fileBits and
  20754. // options.
  20755. // Note: Blob handles this for us
  20756. // 2. Let n be the fileName argument to the constructor.
  20757. const n = fileName
  20758. // 3. Process FilePropertyBag dictionary argument by running the following
  20759. // substeps:
  20760. // 1. If the type member is provided and is not the empty string, let t
  20761. // be set to the type dictionary member. If t contains any characters
  20762. // outside the range U+0020 to U+007E, then set t to the empty string
  20763. // and return from these substeps.
  20764. // 2. Convert every character in t to ASCII lowercase.
  20765. let t = options.type
  20766. let d
  20767. // eslint-disable-next-line no-labels
  20768. substep: {
  20769. if (t) {
  20770. t = parseMIMEType(t)
  20771. if (t === 'failure') {
  20772. t = ''
  20773. // eslint-disable-next-line no-labels
  20774. break substep
  20775. }
  20776. t = serializeAMimeType(t).toLowerCase()
  20777. }
  20778. // 3. If the lastModified member is provided, let d be set to the
  20779. // lastModified dictionary member. If it is not provided, set d to the
  20780. // current date and time represented as the number of milliseconds since
  20781. // the Unix Epoch (which is the equivalent of Date.now() [ECMA-262]).
  20782. d = options.lastModified
  20783. }
  20784. // 4. Return a new File object F such that:
  20785. // F refers to the bytes byte sequence.
  20786. // F.size is set to the number of total bytes in bytes.
  20787. // F.name is set to n.
  20788. // F.type is set to t.
  20789. // F.lastModified is set to d.
  20790. super(processBlobParts(fileBits, options), { type: t })
  20791. this[kState] = {
  20792. name: n,
  20793. lastModified: d,
  20794. type: t
  20795. }
  20796. }
  20797. get name () {
  20798. webidl.brandCheck(this, File)
  20799. return this[kState].name
  20800. }
  20801. get lastModified () {
  20802. webidl.brandCheck(this, File)
  20803. return this[kState].lastModified
  20804. }
  20805. get type () {
  20806. webidl.brandCheck(this, File)
  20807. return this[kState].type
  20808. }
  20809. }
  20810. class FileLike {
  20811. constructor (blobLike, fileName, options = {}) {
  20812. // TODO: argument idl type check
  20813. // The File constructor is invoked with two or three parameters, depending
  20814. // on whether the optional dictionary parameter is used. When the File()
  20815. // constructor is invoked, user agents must run the following steps:
  20816. // 1. Let bytes be the result of processing blob parts given fileBits and
  20817. // options.
  20818. // 2. Let n be the fileName argument to the constructor.
  20819. const n = fileName
  20820. // 3. Process FilePropertyBag dictionary argument by running the following
  20821. // substeps:
  20822. // 1. If the type member is provided and is not the empty string, let t
  20823. // be set to the type dictionary member. If t contains any characters
  20824. // outside the range U+0020 to U+007E, then set t to the empty string
  20825. // and return from these substeps.
  20826. // TODO
  20827. const t = options.type
  20828. // 2. Convert every character in t to ASCII lowercase.
  20829. // TODO
  20830. // 3. If the lastModified member is provided, let d be set to the
  20831. // lastModified dictionary member. If it is not provided, set d to the
  20832. // current date and time represented as the number of milliseconds since
  20833. // the Unix Epoch (which is the equivalent of Date.now() [ECMA-262]).
  20834. const d = options.lastModified ?? Date.now()
  20835. // 4. Return a new File object F such that:
  20836. // F refers to the bytes byte sequence.
  20837. // F.size is set to the number of total bytes in bytes.
  20838. // F.name is set to n.
  20839. // F.type is set to t.
  20840. // F.lastModified is set to d.
  20841. this[kState] = {
  20842. blobLike,
  20843. name: n,
  20844. type: t,
  20845. lastModified: d
  20846. }
  20847. }
  20848. stream (...args) {
  20849. webidl.brandCheck(this, FileLike)
  20850. return this[kState].blobLike.stream(...args)
  20851. }
  20852. arrayBuffer (...args) {
  20853. webidl.brandCheck(this, FileLike)
  20854. return this[kState].blobLike.arrayBuffer(...args)
  20855. }
  20856. slice (...args) {
  20857. webidl.brandCheck(this, FileLike)
  20858. return this[kState].blobLike.slice(...args)
  20859. }
  20860. text (...args) {
  20861. webidl.brandCheck(this, FileLike)
  20862. return this[kState].blobLike.text(...args)
  20863. }
  20864. get size () {
  20865. webidl.brandCheck(this, FileLike)
  20866. return this[kState].blobLike.size
  20867. }
  20868. get type () {
  20869. webidl.brandCheck(this, FileLike)
  20870. return this[kState].blobLike.type
  20871. }
  20872. get name () {
  20873. webidl.brandCheck(this, FileLike)
  20874. return this[kState].name
  20875. }
  20876. get lastModified () {
  20877. webidl.brandCheck(this, FileLike)
  20878. return this[kState].lastModified
  20879. }
  20880. get [Symbol.toStringTag] () {
  20881. return 'File'
  20882. }
  20883. }
  20884. Object.defineProperties(File.prototype, {
  20885. [Symbol.toStringTag]: {
  20886. value: 'File',
  20887. configurable: true
  20888. },
  20889. name: kEnumerableProperty,
  20890. lastModified: kEnumerableProperty
  20891. })
  20892. webidl.converters.Blob = webidl.interfaceConverter(Blob)
  20893. webidl.converters.BlobPart = function (V, opts) {
  20894. if (webidl.util.Type(V) === 'Object') {
  20895. if (isBlobLike(V)) {
  20896. return webidl.converters.Blob(V, { strict: false })
  20897. }
  20898. if (
  20899. ArrayBuffer.isView(V) ||
  20900. types.isAnyArrayBuffer(V)
  20901. ) {
  20902. return webidl.converters.BufferSource(V, opts)
  20903. }
  20904. }
  20905. return webidl.converters.USVString(V, opts)
  20906. }
  20907. webidl.converters['sequence<BlobPart>'] = webidl.sequenceConverter(
  20908. webidl.converters.BlobPart
  20909. )
  20910. // https://www.w3.org/TR/FileAPI/#dfn-FilePropertyBag
  20911. webidl.converters.FilePropertyBag = webidl.dictionaryConverter([
  20912. {
  20913. key: 'lastModified',
  20914. converter: webidl.converters['long long'],
  20915. get defaultValue () {
  20916. return Date.now()
  20917. }
  20918. },
  20919. {
  20920. key: 'type',
  20921. converter: webidl.converters.DOMString,
  20922. defaultValue: ''
  20923. },
  20924. {
  20925. key: 'endings',
  20926. converter: (value) => {
  20927. value = webidl.converters.DOMString(value)
  20928. value = value.toLowerCase()
  20929. if (value !== 'native') {
  20930. value = 'transparent'
  20931. }
  20932. return value
  20933. },
  20934. defaultValue: 'transparent'
  20935. }
  20936. ])
  20937. /**
  20938. * @see https://www.w3.org/TR/FileAPI/#process-blob-parts
  20939. * @param {(NodeJS.TypedArray|Blob|string)[]} parts
  20940. * @param {{ type: string, endings: string }} options
  20941. */
  20942. function processBlobParts (parts, options) {
  20943. // 1. Let bytes be an empty sequence of bytes.
  20944. /** @type {NodeJS.TypedArray[]} */
  20945. const bytes = []
  20946. // 2. For each element in parts:
  20947. for (const element of parts) {
  20948. // 1. If element is a USVString, run the following substeps:
  20949. if (typeof element === 'string') {
  20950. // 1. Let s be element.
  20951. let s = element
  20952. // 2. If the endings member of options is "native", set s
  20953. // to the result of converting line endings to native
  20954. // of element.
  20955. if (options.endings === 'native') {
  20956. s = convertLineEndingsNative(s)
  20957. }
  20958. // 3. Append the result of UTF-8 encoding s to bytes.
  20959. bytes.push(encoder.encode(s))
  20960. } else if (
  20961. types.isAnyArrayBuffer(element) ||
  20962. types.isTypedArray(element)
  20963. ) {
  20964. // 2. If element is a BufferSource, get a copy of the
  20965. // bytes held by the buffer source, and append those
  20966. // bytes to bytes.
  20967. if (!element.buffer) { // ArrayBuffer
  20968. bytes.push(new Uint8Array(element))
  20969. } else {
  20970. bytes.push(
  20971. new Uint8Array(element.buffer, element.byteOffset, element.byteLength)
  20972. )
  20973. }
  20974. } else if (isBlobLike(element)) {
  20975. // 3. If element is a Blob, append the bytes it represents
  20976. // to bytes.
  20977. bytes.push(element)
  20978. }
  20979. }
  20980. // 3. Return bytes.
  20981. return bytes
  20982. }
  20983. /**
  20984. * @see https://www.w3.org/TR/FileAPI/#convert-line-endings-to-native
  20985. * @param {string} s
  20986. */
  20987. function convertLineEndingsNative (s) {
  20988. // 1. Let native line ending be be the code point U+000A LF.
  20989. let nativeLineEnding = '\n'
  20990. // 2. If the underlying platform’s conventions are to
  20991. // represent newlines as a carriage return and line feed
  20992. // sequence, set native line ending to the code point
  20993. // U+000D CR followed by the code point U+000A LF.
  20994. if (process.platform === 'win32') {
  20995. nativeLineEnding = '\r\n'
  20996. }
  20997. return s.replace(/\r?\n/g, nativeLineEnding)
  20998. }
  20999. // If this function is moved to ./util.js, some tools (such as
  21000. // rollup) will warn about circular dependencies. See:
  21001. // https://github.com/nodejs/undici/issues/1629
  21002. function isFileLike (object) {
  21003. return (
  21004. (NativeFile && object instanceof NativeFile) ||
  21005. object instanceof File || (
  21006. object &&
  21007. (typeof object.stream === 'function' ||
  21008. typeof object.arrayBuffer === 'function') &&
  21009. object[Symbol.toStringTag] === 'File'
  21010. )
  21011. )
  21012. }
  21013. module.exports = { File, FileLike, isFileLike }
  21014. /***/ }),
  21015. /***/ 2015:
  21016. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  21017. "use strict";
  21018. const { isBlobLike, toUSVString, makeIterator } = __nccwpck_require__(2538)
  21019. const { kState } = __nccwpck_require__(5861)
  21020. const { File: UndiciFile, FileLike, isFileLike } = __nccwpck_require__(8511)
  21021. const { webidl } = __nccwpck_require__(1744)
  21022. const { Blob, File: NativeFile } = __nccwpck_require__(4300)
  21023. /** @type {globalThis['File']} */
  21024. const File = NativeFile ?? UndiciFile
  21025. // https://xhr.spec.whatwg.org/#formdata
  21026. class FormData {
  21027. constructor (form) {
  21028. if (form !== undefined) {
  21029. throw webidl.errors.conversionFailed({
  21030. prefix: 'FormData constructor',
  21031. argument: 'Argument 1',
  21032. types: ['undefined']
  21033. })
  21034. }
  21035. this[kState] = []
  21036. }
  21037. append (name, value, filename = undefined) {
  21038. webidl.brandCheck(this, FormData)
  21039. webidl.argumentLengthCheck(arguments, 2, { header: 'FormData.append' })
  21040. if (arguments.length === 3 && !isBlobLike(value)) {
  21041. throw new TypeError(
  21042. "Failed to execute 'append' on 'FormData': parameter 2 is not of type 'Blob'"
  21043. )
  21044. }
  21045. // 1. Let value be value if given; otherwise blobValue.
  21046. name = webidl.converters.USVString(name)
  21047. value = isBlobLike(value)
  21048. ? webidl.converters.Blob(value, { strict: false })
  21049. : webidl.converters.USVString(value)
  21050. filename = arguments.length === 3
  21051. ? webidl.converters.USVString(filename)
  21052. : undefined
  21053. // 2. Let entry be the result of creating an entry with
  21054. // name, value, and filename if given.
  21055. const entry = makeEntry(name, value, filename)
  21056. // 3. Append entry to this’s entry list.
  21057. this[kState].push(entry)
  21058. }
  21059. delete (name) {
  21060. webidl.brandCheck(this, FormData)
  21061. webidl.argumentLengthCheck(arguments, 1, { header: 'FormData.delete' })
  21062. name = webidl.converters.USVString(name)
  21063. // The delete(name) method steps are to remove all entries whose name
  21064. // is name from this’s entry list.
  21065. this[kState] = this[kState].filter(entry => entry.name !== name)
  21066. }
  21067. get (name) {
  21068. webidl.brandCheck(this, FormData)
  21069. webidl.argumentLengthCheck(arguments, 1, { header: 'FormData.get' })
  21070. name = webidl.converters.USVString(name)
  21071. // 1. If there is no entry whose name is name in this’s entry list,
  21072. // then return null.
  21073. const idx = this[kState].findIndex((entry) => entry.name === name)
  21074. if (idx === -1) {
  21075. return null
  21076. }
  21077. // 2. Return the value of the first entry whose name is name from
  21078. // this’s entry list.
  21079. return this[kState][idx].value
  21080. }
  21081. getAll (name) {
  21082. webidl.brandCheck(this, FormData)
  21083. webidl.argumentLengthCheck(arguments, 1, { header: 'FormData.getAll' })
  21084. name = webidl.converters.USVString(name)
  21085. // 1. If there is no entry whose name is name in this’s entry list,
  21086. // then return the empty list.
  21087. // 2. Return the values of all entries whose name is name, in order,
  21088. // from this’s entry list.
  21089. return this[kState]
  21090. .filter((entry) => entry.name === name)
  21091. .map((entry) => entry.value)
  21092. }
  21093. has (name) {
  21094. webidl.brandCheck(this, FormData)
  21095. webidl.argumentLengthCheck(arguments, 1, { header: 'FormData.has' })
  21096. name = webidl.converters.USVString(name)
  21097. // The has(name) method steps are to return true if there is an entry
  21098. // whose name is name in this’s entry list; otherwise false.
  21099. return this[kState].findIndex((entry) => entry.name === name) !== -1
  21100. }
  21101. set (name, value, filename = undefined) {
  21102. webidl.brandCheck(this, FormData)
  21103. webidl.argumentLengthCheck(arguments, 2, { header: 'FormData.set' })
  21104. if (arguments.length === 3 && !isBlobLike(value)) {
  21105. throw new TypeError(
  21106. "Failed to execute 'set' on 'FormData': parameter 2 is not of type 'Blob'"
  21107. )
  21108. }
  21109. // The set(name, value) and set(name, blobValue, filename) method steps
  21110. // are:
  21111. // 1. Let value be value if given; otherwise blobValue.
  21112. name = webidl.converters.USVString(name)
  21113. value = isBlobLike(value)
  21114. ? webidl.converters.Blob(value, { strict: false })
  21115. : webidl.converters.USVString(value)
  21116. filename = arguments.length === 3
  21117. ? toUSVString(filename)
  21118. : undefined
  21119. // 2. Let entry be the result of creating an entry with name, value, and
  21120. // filename if given.
  21121. const entry = makeEntry(name, value, filename)
  21122. // 3. If there are entries in this’s entry list whose name is name, then
  21123. // replace the first such entry with entry and remove the others.
  21124. const idx = this[kState].findIndex((entry) => entry.name === name)
  21125. if (idx !== -1) {
  21126. this[kState] = [
  21127. ...this[kState].slice(0, idx),
  21128. entry,
  21129. ...this[kState].slice(idx + 1).filter((entry) => entry.name !== name)
  21130. ]
  21131. } else {
  21132. // 4. Otherwise, append entry to this’s entry list.
  21133. this[kState].push(entry)
  21134. }
  21135. }
  21136. entries () {
  21137. webidl.brandCheck(this, FormData)
  21138. return makeIterator(
  21139. () => this[kState].map(pair => [pair.name, pair.value]),
  21140. 'FormData',
  21141. 'key+value'
  21142. )
  21143. }
  21144. keys () {
  21145. webidl.brandCheck(this, FormData)
  21146. return makeIterator(
  21147. () => this[kState].map(pair => [pair.name, pair.value]),
  21148. 'FormData',
  21149. 'key'
  21150. )
  21151. }
  21152. values () {
  21153. webidl.brandCheck(this, FormData)
  21154. return makeIterator(
  21155. () => this[kState].map(pair => [pair.name, pair.value]),
  21156. 'FormData',
  21157. 'value'
  21158. )
  21159. }
  21160. /**
  21161. * @param {(value: string, key: string, self: FormData) => void} callbackFn
  21162. * @param {unknown} thisArg
  21163. */
  21164. forEach (callbackFn, thisArg = globalThis) {
  21165. webidl.brandCheck(this, FormData)
  21166. webidl.argumentLengthCheck(arguments, 1, { header: 'FormData.forEach' })
  21167. if (typeof callbackFn !== 'function') {
  21168. throw new TypeError(
  21169. "Failed to execute 'forEach' on 'FormData': parameter 1 is not of type 'Function'."
  21170. )
  21171. }
  21172. for (const [key, value] of this) {
  21173. callbackFn.apply(thisArg, [value, key, this])
  21174. }
  21175. }
  21176. }
  21177. FormData.prototype[Symbol.iterator] = FormData.prototype.entries
  21178. Object.defineProperties(FormData.prototype, {
  21179. [Symbol.toStringTag]: {
  21180. value: 'FormData',
  21181. configurable: true
  21182. }
  21183. })
  21184. /**
  21185. * @see https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#create-an-entry
  21186. * @param {string} name
  21187. * @param {string|Blob} value
  21188. * @param {?string} filename
  21189. * @returns
  21190. */
  21191. function makeEntry (name, value, filename) {
  21192. // 1. Set name to the result of converting name into a scalar value string.
  21193. // "To convert a string into a scalar value string, replace any surrogates
  21194. // with U+FFFD."
  21195. // see: https://nodejs.org/dist/latest-v18.x/docs/api/buffer.html#buftostringencoding-start-end
  21196. name = Buffer.from(name).toString('utf8')
  21197. // 2. If value is a string, then set value to the result of converting
  21198. // value into a scalar value string.
  21199. if (typeof value === 'string') {
  21200. value = Buffer.from(value).toString('utf8')
  21201. } else {
  21202. // 3. Otherwise:
  21203. // 1. If value is not a File object, then set value to a new File object,
  21204. // representing the same bytes, whose name attribute value is "blob"
  21205. if (!isFileLike(value)) {
  21206. value = value instanceof Blob
  21207. ? new File([value], 'blob', { type: value.type })
  21208. : new FileLike(value, 'blob', { type: value.type })
  21209. }
  21210. // 2. If filename is given, then set value to a new File object,
  21211. // representing the same bytes, whose name attribute is filename.
  21212. if (filename !== undefined) {
  21213. /** @type {FilePropertyBag} */
  21214. const options = {
  21215. type: value.type,
  21216. lastModified: value.lastModified
  21217. }
  21218. value = (NativeFile && value instanceof NativeFile) || value instanceof UndiciFile
  21219. ? new File([value], filename, options)
  21220. : new FileLike(value, filename, options)
  21221. }
  21222. }
  21223. // 4. Return an entry whose name is name and whose value is value.
  21224. return { name, value }
  21225. }
  21226. module.exports = { FormData }
  21227. /***/ }),
  21228. /***/ 1246:
  21229. /***/ ((module) => {
  21230. "use strict";
  21231. // In case of breaking changes, increase the version
  21232. // number to avoid conflicts.
  21233. const globalOrigin = Symbol.for('undici.globalOrigin.1')
  21234. function getGlobalOrigin () {
  21235. return globalThis[globalOrigin]
  21236. }
  21237. function setGlobalOrigin (newOrigin) {
  21238. if (newOrigin === undefined) {
  21239. Object.defineProperty(globalThis, globalOrigin, {
  21240. value: undefined,
  21241. writable: true,
  21242. enumerable: false,
  21243. configurable: false
  21244. })
  21245. return
  21246. }
  21247. const parsedURL = new URL(newOrigin)
  21248. if (parsedURL.protocol !== 'http:' && parsedURL.protocol !== 'https:') {
  21249. throw new TypeError(`Only http & https urls are allowed, received ${parsedURL.protocol}`)
  21250. }
  21251. Object.defineProperty(globalThis, globalOrigin, {
  21252. value: parsedURL,
  21253. writable: true,
  21254. enumerable: false,
  21255. configurable: false
  21256. })
  21257. }
  21258. module.exports = {
  21259. getGlobalOrigin,
  21260. setGlobalOrigin
  21261. }
  21262. /***/ }),
  21263. /***/ 554:
  21264. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  21265. "use strict";
  21266. // https://github.com/Ethan-Arrowood/undici-fetch
  21267. const { kHeadersList, kConstruct } = __nccwpck_require__(2785)
  21268. const { kGuard } = __nccwpck_require__(5861)
  21269. const { kEnumerableProperty } = __nccwpck_require__(3983)
  21270. const {
  21271. makeIterator,
  21272. isValidHeaderName,
  21273. isValidHeaderValue
  21274. } = __nccwpck_require__(2538)
  21275. const util = __nccwpck_require__(3837)
  21276. const { webidl } = __nccwpck_require__(1744)
  21277. const assert = __nccwpck_require__(9491)
  21278. const kHeadersMap = Symbol('headers map')
  21279. const kHeadersSortedMap = Symbol('headers map sorted')
  21280. /**
  21281. * @param {number} code
  21282. */
  21283. function isHTTPWhiteSpaceCharCode (code) {
  21284. return code === 0x00a || code === 0x00d || code === 0x009 || code === 0x020
  21285. }
  21286. /**
  21287. * @see https://fetch.spec.whatwg.org/#concept-header-value-normalize
  21288. * @param {string} potentialValue
  21289. */
  21290. function headerValueNormalize (potentialValue) {
  21291. // To normalize a byte sequence potentialValue, remove
  21292. // any leading and trailing HTTP whitespace bytes from
  21293. // potentialValue.
  21294. let i = 0; let j = potentialValue.length
  21295. while (j > i && isHTTPWhiteSpaceCharCode(potentialValue.charCodeAt(j - 1))) --j
  21296. while (j > i && isHTTPWhiteSpaceCharCode(potentialValue.charCodeAt(i))) ++i
  21297. return i === 0 && j === potentialValue.length ? potentialValue : potentialValue.substring(i, j)
  21298. }
  21299. function fill (headers, object) {
  21300. // To fill a Headers object headers with a given object object, run these steps:
  21301. // 1. If object is a sequence, then for each header in object:
  21302. // Note: webidl conversion to array has already been done.
  21303. if (Array.isArray(object)) {
  21304. for (let i = 0; i < object.length; ++i) {
  21305. const header = object[i]
  21306. // 1. If header does not contain exactly two items, then throw a TypeError.
  21307. if (header.length !== 2) {
  21308. throw webidl.errors.exception({
  21309. header: 'Headers constructor',
  21310. message: `expected name/value pair to be length 2, found ${header.length}.`
  21311. })
  21312. }
  21313. // 2. Append (header’s first item, header’s second item) to headers.
  21314. appendHeader(headers, header[0], header[1])
  21315. }
  21316. } else if (typeof object === 'object' && object !== null) {
  21317. // Note: null should throw
  21318. // 2. Otherwise, object is a record, then for each key → value in object,
  21319. // append (key, value) to headers
  21320. const keys = Object.keys(object)
  21321. for (let i = 0; i < keys.length; ++i) {
  21322. appendHeader(headers, keys[i], object[keys[i]])
  21323. }
  21324. } else {
  21325. throw webidl.errors.conversionFailed({
  21326. prefix: 'Headers constructor',
  21327. argument: 'Argument 1',
  21328. types: ['sequence<sequence<ByteString>>', 'record<ByteString, ByteString>']
  21329. })
  21330. }
  21331. }
  21332. /**
  21333. * @see https://fetch.spec.whatwg.org/#concept-headers-append
  21334. */
  21335. function appendHeader (headers, name, value) {
  21336. // 1. Normalize value.
  21337. value = headerValueNormalize(value)
  21338. // 2. If name is not a header name or value is not a
  21339. // header value, then throw a TypeError.
  21340. if (!isValidHeaderName(name)) {
  21341. throw webidl.errors.invalidArgument({
  21342. prefix: 'Headers.append',
  21343. value: name,
  21344. type: 'header name'
  21345. })
  21346. } else if (!isValidHeaderValue(value)) {
  21347. throw webidl.errors.invalidArgument({
  21348. prefix: 'Headers.append',
  21349. value,
  21350. type: 'header value'
  21351. })
  21352. }
  21353. // 3. If headers’s guard is "immutable", then throw a TypeError.
  21354. // 4. Otherwise, if headers’s guard is "request" and name is a
  21355. // forbidden header name, return.
  21356. // Note: undici does not implement forbidden header names
  21357. if (headers[kGuard] === 'immutable') {
  21358. throw new TypeError('immutable')
  21359. } else if (headers[kGuard] === 'request-no-cors') {
  21360. // 5. Otherwise, if headers’s guard is "request-no-cors":
  21361. // TODO
  21362. }
  21363. // 6. Otherwise, if headers’s guard is "response" and name is a
  21364. // forbidden response-header name, return.
  21365. // 7. Append (name, value) to headers’s header list.
  21366. return headers[kHeadersList].append(name, value)
  21367. // 8. If headers’s guard is "request-no-cors", then remove
  21368. // privileged no-CORS request headers from headers
  21369. }
  21370. class HeadersList {
  21371. /** @type {[string, string][]|null} */
  21372. cookies = null
  21373. constructor (init) {
  21374. if (init instanceof HeadersList) {
  21375. this[kHeadersMap] = new Map(init[kHeadersMap])
  21376. this[kHeadersSortedMap] = init[kHeadersSortedMap]
  21377. this.cookies = init.cookies === null ? null : [...init.cookies]
  21378. } else {
  21379. this[kHeadersMap] = new Map(init)
  21380. this[kHeadersSortedMap] = null
  21381. }
  21382. }
  21383. // https://fetch.spec.whatwg.org/#header-list-contains
  21384. contains (name) {
  21385. // A header list list contains a header name name if list
  21386. // contains a header whose name is a byte-case-insensitive
  21387. // match for name.
  21388. name = name.toLowerCase()
  21389. return this[kHeadersMap].has(name)
  21390. }
  21391. clear () {
  21392. this[kHeadersMap].clear()
  21393. this[kHeadersSortedMap] = null
  21394. this.cookies = null
  21395. }
  21396. // https://fetch.spec.whatwg.org/#concept-header-list-append
  21397. append (name, value) {
  21398. this[kHeadersSortedMap] = null
  21399. // 1. If list contains name, then set name to the first such
  21400. // header’s name.
  21401. const lowercaseName = name.toLowerCase()
  21402. const exists = this[kHeadersMap].get(lowercaseName)
  21403. // 2. Append (name, value) to list.
  21404. if (exists) {
  21405. const delimiter = lowercaseName === 'cookie' ? '; ' : ', '
  21406. this[kHeadersMap].set(lowercaseName, {
  21407. name: exists.name,
  21408. value: `${exists.value}${delimiter}${value}`
  21409. })
  21410. } else {
  21411. this[kHeadersMap].set(lowercaseName, { name, value })
  21412. }
  21413. if (lowercaseName === 'set-cookie') {
  21414. this.cookies ??= []
  21415. this.cookies.push(value)
  21416. }
  21417. }
  21418. // https://fetch.spec.whatwg.org/#concept-header-list-set
  21419. set (name, value) {
  21420. this[kHeadersSortedMap] = null
  21421. const lowercaseName = name.toLowerCase()
  21422. if (lowercaseName === 'set-cookie') {
  21423. this.cookies = [value]
  21424. }
  21425. // 1. If list contains name, then set the value of
  21426. // the first such header to value and remove the
  21427. // others.
  21428. // 2. Otherwise, append header (name, value) to list.
  21429. this[kHeadersMap].set(lowercaseName, { name, value })
  21430. }
  21431. // https://fetch.spec.whatwg.org/#concept-header-list-delete
  21432. delete (name) {
  21433. this[kHeadersSortedMap] = null
  21434. name = name.toLowerCase()
  21435. if (name === 'set-cookie') {
  21436. this.cookies = null
  21437. }
  21438. this[kHeadersMap].delete(name)
  21439. }
  21440. // https://fetch.spec.whatwg.org/#concept-header-list-get
  21441. get (name) {
  21442. const value = this[kHeadersMap].get(name.toLowerCase())
  21443. // 1. If list does not contain name, then return null.
  21444. // 2. Return the values of all headers in list whose name
  21445. // is a byte-case-insensitive match for name,
  21446. // separated from each other by 0x2C 0x20, in order.
  21447. return value === undefined ? null : value.value
  21448. }
  21449. * [Symbol.iterator] () {
  21450. // use the lowercased name
  21451. for (const [name, { value }] of this[kHeadersMap]) {
  21452. yield [name, value]
  21453. }
  21454. }
  21455. get entries () {
  21456. const headers = {}
  21457. if (this[kHeadersMap].size) {
  21458. for (const { name, value } of this[kHeadersMap].values()) {
  21459. headers[name] = value
  21460. }
  21461. }
  21462. return headers
  21463. }
  21464. }
  21465. // https://fetch.spec.whatwg.org/#headers-class
  21466. class Headers {
  21467. constructor (init = undefined) {
  21468. if (init === kConstruct) {
  21469. return
  21470. }
  21471. this[kHeadersList] = new HeadersList()
  21472. // The new Headers(init) constructor steps are:
  21473. // 1. Set this’s guard to "none".
  21474. this[kGuard] = 'none'
  21475. // 2. If init is given, then fill this with init.
  21476. if (init !== undefined) {
  21477. init = webidl.converters.HeadersInit(init)
  21478. fill(this, init)
  21479. }
  21480. }
  21481. // https://fetch.spec.whatwg.org/#dom-headers-append
  21482. append (name, value) {
  21483. webidl.brandCheck(this, Headers)
  21484. webidl.argumentLengthCheck(arguments, 2, { header: 'Headers.append' })
  21485. name = webidl.converters.ByteString(name)
  21486. value = webidl.converters.ByteString(value)
  21487. return appendHeader(this, name, value)
  21488. }
  21489. // https://fetch.spec.whatwg.org/#dom-headers-delete
  21490. delete (name) {
  21491. webidl.brandCheck(this, Headers)
  21492. webidl.argumentLengthCheck(arguments, 1, { header: 'Headers.delete' })
  21493. name = webidl.converters.ByteString(name)
  21494. // 1. If name is not a header name, then throw a TypeError.
  21495. if (!isValidHeaderName(name)) {
  21496. throw webidl.errors.invalidArgument({
  21497. prefix: 'Headers.delete',
  21498. value: name,
  21499. type: 'header name'
  21500. })
  21501. }
  21502. // 2. If this’s guard is "immutable", then throw a TypeError.
  21503. // 3. Otherwise, if this’s guard is "request" and name is a
  21504. // forbidden header name, return.
  21505. // 4. Otherwise, if this’s guard is "request-no-cors", name
  21506. // is not a no-CORS-safelisted request-header name, and
  21507. // name is not a privileged no-CORS request-header name,
  21508. // return.
  21509. // 5. Otherwise, if this’s guard is "response" and name is
  21510. // a forbidden response-header name, return.
  21511. // Note: undici does not implement forbidden header names
  21512. if (this[kGuard] === 'immutable') {
  21513. throw new TypeError('immutable')
  21514. } else if (this[kGuard] === 'request-no-cors') {
  21515. // TODO
  21516. }
  21517. // 6. If this’s header list does not contain name, then
  21518. // return.
  21519. if (!this[kHeadersList].contains(name)) {
  21520. return
  21521. }
  21522. // 7. Delete name from this’s header list.
  21523. // 8. If this’s guard is "request-no-cors", then remove
  21524. // privileged no-CORS request headers from this.
  21525. this[kHeadersList].delete(name)
  21526. }
  21527. // https://fetch.spec.whatwg.org/#dom-headers-get
  21528. get (name) {
  21529. webidl.brandCheck(this, Headers)
  21530. webidl.argumentLengthCheck(arguments, 1, { header: 'Headers.get' })
  21531. name = webidl.converters.ByteString(name)
  21532. // 1. If name is not a header name, then throw a TypeError.
  21533. if (!isValidHeaderName(name)) {
  21534. throw webidl.errors.invalidArgument({
  21535. prefix: 'Headers.get',
  21536. value: name,
  21537. type: 'header name'
  21538. })
  21539. }
  21540. // 2. Return the result of getting name from this’s header
  21541. // list.
  21542. return this[kHeadersList].get(name)
  21543. }
  21544. // https://fetch.spec.whatwg.org/#dom-headers-has
  21545. has (name) {
  21546. webidl.brandCheck(this, Headers)
  21547. webidl.argumentLengthCheck(arguments, 1, { header: 'Headers.has' })
  21548. name = webidl.converters.ByteString(name)
  21549. // 1. If name is not a header name, then throw a TypeError.
  21550. if (!isValidHeaderName(name)) {
  21551. throw webidl.errors.invalidArgument({
  21552. prefix: 'Headers.has',
  21553. value: name,
  21554. type: 'header name'
  21555. })
  21556. }
  21557. // 2. Return true if this’s header list contains name;
  21558. // otherwise false.
  21559. return this[kHeadersList].contains(name)
  21560. }
  21561. // https://fetch.spec.whatwg.org/#dom-headers-set
  21562. set (name, value) {
  21563. webidl.brandCheck(this, Headers)
  21564. webidl.argumentLengthCheck(arguments, 2, { header: 'Headers.set' })
  21565. name = webidl.converters.ByteString(name)
  21566. value = webidl.converters.ByteString(value)
  21567. // 1. Normalize value.
  21568. value = headerValueNormalize(value)
  21569. // 2. If name is not a header name or value is not a
  21570. // header value, then throw a TypeError.
  21571. if (!isValidHeaderName(name)) {
  21572. throw webidl.errors.invalidArgument({
  21573. prefix: 'Headers.set',
  21574. value: name,
  21575. type: 'header name'
  21576. })
  21577. } else if (!isValidHeaderValue(value)) {
  21578. throw webidl.errors.invalidArgument({
  21579. prefix: 'Headers.set',
  21580. value,
  21581. type: 'header value'
  21582. })
  21583. }
  21584. // 3. If this’s guard is "immutable", then throw a TypeError.
  21585. // 4. Otherwise, if this’s guard is "request" and name is a
  21586. // forbidden header name, return.
  21587. // 5. Otherwise, if this’s guard is "request-no-cors" and
  21588. // name/value is not a no-CORS-safelisted request-header,
  21589. // return.
  21590. // 6. Otherwise, if this’s guard is "response" and name is a
  21591. // forbidden response-header name, return.
  21592. // Note: undici does not implement forbidden header names
  21593. if (this[kGuard] === 'immutable') {
  21594. throw new TypeError('immutable')
  21595. } else if (this[kGuard] === 'request-no-cors') {
  21596. // TODO
  21597. }
  21598. // 7. Set (name, value) in this’s header list.
  21599. // 8. If this’s guard is "request-no-cors", then remove
  21600. // privileged no-CORS request headers from this
  21601. this[kHeadersList].set(name, value)
  21602. }
  21603. // https://fetch.spec.whatwg.org/#dom-headers-getsetcookie
  21604. getSetCookie () {
  21605. webidl.brandCheck(this, Headers)
  21606. // 1. If this’s header list does not contain `Set-Cookie`, then return « ».
  21607. // 2. Return the values of all headers in this’s header list whose name is
  21608. // a byte-case-insensitive match for `Set-Cookie`, in order.
  21609. const list = this[kHeadersList].cookies
  21610. if (list) {
  21611. return [...list]
  21612. }
  21613. return []
  21614. }
  21615. // https://fetch.spec.whatwg.org/#concept-header-list-sort-and-combine
  21616. get [kHeadersSortedMap] () {
  21617. if (this[kHeadersList][kHeadersSortedMap]) {
  21618. return this[kHeadersList][kHeadersSortedMap]
  21619. }
  21620. // 1. Let headers be an empty list of headers with the key being the name
  21621. // and value the value.
  21622. const headers = []
  21623. // 2. Let names be the result of convert header names to a sorted-lowercase
  21624. // set with all the names of the headers in list.
  21625. const names = [...this[kHeadersList]].sort((a, b) => a[0] < b[0] ? -1 : 1)
  21626. const cookies = this[kHeadersList].cookies
  21627. // 3. For each name of names:
  21628. for (let i = 0; i < names.length; ++i) {
  21629. const [name, value] = names[i]
  21630. // 1. If name is `set-cookie`, then:
  21631. if (name === 'set-cookie') {
  21632. // 1. Let values be a list of all values of headers in list whose name
  21633. // is a byte-case-insensitive match for name, in order.
  21634. // 2. For each value of values:
  21635. // 1. Append (name, value) to headers.
  21636. for (let j = 0; j < cookies.length; ++j) {
  21637. headers.push([name, cookies[j]])
  21638. }
  21639. } else {
  21640. // 2. Otherwise:
  21641. // 1. Let value be the result of getting name from list.
  21642. // 2. Assert: value is non-null.
  21643. assert(value !== null)
  21644. // 3. Append (name, value) to headers.
  21645. headers.push([name, value])
  21646. }
  21647. }
  21648. this[kHeadersList][kHeadersSortedMap] = headers
  21649. // 4. Return headers.
  21650. return headers
  21651. }
  21652. keys () {
  21653. webidl.brandCheck(this, Headers)
  21654. if (this[kGuard] === 'immutable') {
  21655. const value = this[kHeadersSortedMap]
  21656. return makeIterator(() => value, 'Headers',
  21657. 'key')
  21658. }
  21659. return makeIterator(
  21660. () => [...this[kHeadersSortedMap].values()],
  21661. 'Headers',
  21662. 'key'
  21663. )
  21664. }
  21665. values () {
  21666. webidl.brandCheck(this, Headers)
  21667. if (this[kGuard] === 'immutable') {
  21668. const value = this[kHeadersSortedMap]
  21669. return makeIterator(() => value, 'Headers',
  21670. 'value')
  21671. }
  21672. return makeIterator(
  21673. () => [...this[kHeadersSortedMap].values()],
  21674. 'Headers',
  21675. 'value'
  21676. )
  21677. }
  21678. entries () {
  21679. webidl.brandCheck(this, Headers)
  21680. if (this[kGuard] === 'immutable') {
  21681. const value = this[kHeadersSortedMap]
  21682. return makeIterator(() => value, 'Headers',
  21683. 'key+value')
  21684. }
  21685. return makeIterator(
  21686. () => [...this[kHeadersSortedMap].values()],
  21687. 'Headers',
  21688. 'key+value'
  21689. )
  21690. }
  21691. /**
  21692. * @param {(value: string, key: string, self: Headers) => void} callbackFn
  21693. * @param {unknown} thisArg
  21694. */
  21695. forEach (callbackFn, thisArg = globalThis) {
  21696. webidl.brandCheck(this, Headers)
  21697. webidl.argumentLengthCheck(arguments, 1, { header: 'Headers.forEach' })
  21698. if (typeof callbackFn !== 'function') {
  21699. throw new TypeError(
  21700. "Failed to execute 'forEach' on 'Headers': parameter 1 is not of type 'Function'."
  21701. )
  21702. }
  21703. for (const [key, value] of this) {
  21704. callbackFn.apply(thisArg, [value, key, this])
  21705. }
  21706. }
  21707. [Symbol.for('nodejs.util.inspect.custom')] () {
  21708. webidl.brandCheck(this, Headers)
  21709. return this[kHeadersList]
  21710. }
  21711. }
  21712. Headers.prototype[Symbol.iterator] = Headers.prototype.entries
  21713. Object.defineProperties(Headers.prototype, {
  21714. append: kEnumerableProperty,
  21715. delete: kEnumerableProperty,
  21716. get: kEnumerableProperty,
  21717. has: kEnumerableProperty,
  21718. set: kEnumerableProperty,
  21719. getSetCookie: kEnumerableProperty,
  21720. keys: kEnumerableProperty,
  21721. values: kEnumerableProperty,
  21722. entries: kEnumerableProperty,
  21723. forEach: kEnumerableProperty,
  21724. [Symbol.iterator]: { enumerable: false },
  21725. [Symbol.toStringTag]: {
  21726. value: 'Headers',
  21727. configurable: true
  21728. },
  21729. [util.inspect.custom]: {
  21730. enumerable: false
  21731. }
  21732. })
  21733. webidl.converters.HeadersInit = function (V) {
  21734. if (webidl.util.Type(V) === 'Object') {
  21735. if (V[Symbol.iterator]) {
  21736. return webidl.converters['sequence<sequence<ByteString>>'](V)
  21737. }
  21738. return webidl.converters['record<ByteString, ByteString>'](V)
  21739. }
  21740. throw webidl.errors.conversionFailed({
  21741. prefix: 'Headers constructor',
  21742. argument: 'Argument 1',
  21743. types: ['sequence<sequence<ByteString>>', 'record<ByteString, ByteString>']
  21744. })
  21745. }
  21746. module.exports = {
  21747. fill,
  21748. Headers,
  21749. HeadersList
  21750. }
  21751. /***/ }),
  21752. /***/ 4881:
  21753. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  21754. "use strict";
  21755. // https://github.com/Ethan-Arrowood/undici-fetch
  21756. const {
  21757. Response,
  21758. makeNetworkError,
  21759. makeAppropriateNetworkError,
  21760. filterResponse,
  21761. makeResponse
  21762. } = __nccwpck_require__(7823)
  21763. const { Headers } = __nccwpck_require__(554)
  21764. const { Request, makeRequest } = __nccwpck_require__(8359)
  21765. const zlib = __nccwpck_require__(9796)
  21766. const {
  21767. bytesMatch,
  21768. makePolicyContainer,
  21769. clonePolicyContainer,
  21770. requestBadPort,
  21771. TAOCheck,
  21772. appendRequestOriginHeader,
  21773. responseLocationURL,
  21774. requestCurrentURL,
  21775. setRequestReferrerPolicyOnRedirect,
  21776. tryUpgradeRequestToAPotentiallyTrustworthyURL,
  21777. createOpaqueTimingInfo,
  21778. appendFetchMetadata,
  21779. corsCheck,
  21780. crossOriginResourcePolicyCheck,
  21781. determineRequestsReferrer,
  21782. coarsenedSharedCurrentTime,
  21783. createDeferredPromise,
  21784. isBlobLike,
  21785. sameOrigin,
  21786. isCancelled,
  21787. isAborted,
  21788. isErrorLike,
  21789. fullyReadBody,
  21790. readableStreamClose,
  21791. isomorphicEncode,
  21792. urlIsLocal,
  21793. urlIsHttpHttpsScheme,
  21794. urlHasHttpsScheme
  21795. } = __nccwpck_require__(2538)
  21796. const { kState, kHeaders, kGuard, kRealm } = __nccwpck_require__(5861)
  21797. const assert = __nccwpck_require__(9491)
  21798. const { safelyExtractBody } = __nccwpck_require__(9990)
  21799. const {
  21800. redirectStatusSet,
  21801. nullBodyStatus,
  21802. safeMethodsSet,
  21803. requestBodyHeader,
  21804. subresourceSet,
  21805. DOMException
  21806. } = __nccwpck_require__(1037)
  21807. const { kHeadersList } = __nccwpck_require__(2785)
  21808. const EE = __nccwpck_require__(2361)
  21809. const { Readable, pipeline } = __nccwpck_require__(2781)
  21810. const { addAbortListener, isErrored, isReadable, nodeMajor, nodeMinor } = __nccwpck_require__(3983)
  21811. const { dataURLProcessor, serializeAMimeType } = __nccwpck_require__(685)
  21812. const { TransformStream } = __nccwpck_require__(5356)
  21813. const { getGlobalDispatcher } = __nccwpck_require__(1892)
  21814. const { webidl } = __nccwpck_require__(1744)
  21815. const { STATUS_CODES } = __nccwpck_require__(3685)
  21816. const GET_OR_HEAD = ['GET', 'HEAD']
  21817. /** @type {import('buffer').resolveObjectURL} */
  21818. let resolveObjectURL
  21819. let ReadableStream = globalThis.ReadableStream
  21820. class Fetch extends EE {
  21821. constructor (dispatcher) {
  21822. super()
  21823. this.dispatcher = dispatcher
  21824. this.connection = null
  21825. this.dump = false
  21826. this.state = 'ongoing'
  21827. // 2 terminated listeners get added per request,
  21828. // but only 1 gets removed. If there are 20 redirects,
  21829. // 21 listeners will be added.
  21830. // See https://github.com/nodejs/undici/issues/1711
  21831. // TODO (fix): Find and fix root cause for leaked listener.
  21832. this.setMaxListeners(21)
  21833. }
  21834. terminate (reason) {
  21835. if (this.state !== 'ongoing') {
  21836. return
  21837. }
  21838. this.state = 'terminated'
  21839. this.connection?.destroy(reason)
  21840. this.emit('terminated', reason)
  21841. }
  21842. // https://fetch.spec.whatwg.org/#fetch-controller-abort
  21843. abort (error) {
  21844. if (this.state !== 'ongoing') {
  21845. return
  21846. }
  21847. // 1. Set controller’s state to "aborted".
  21848. this.state = 'aborted'
  21849. // 2. Let fallbackError be an "AbortError" DOMException.
  21850. // 3. Set error to fallbackError if it is not given.
  21851. if (!error) {
  21852. error = new DOMException('The operation was aborted.', 'AbortError')
  21853. }
  21854. // 4. Let serializedError be StructuredSerialize(error).
  21855. // If that threw an exception, catch it, and let
  21856. // serializedError be StructuredSerialize(fallbackError).
  21857. // 5. Set controller’s serialized abort reason to serializedError.
  21858. this.serializedAbortReason = error
  21859. this.connection?.destroy(error)
  21860. this.emit('terminated', error)
  21861. }
  21862. }
  21863. // https://fetch.spec.whatwg.org/#fetch-method
  21864. function fetch (input, init = {}) {
  21865. webidl.argumentLengthCheck(arguments, 1, { header: 'globalThis.fetch' })
  21866. // 1. Let p be a new promise.
  21867. const p = createDeferredPromise()
  21868. // 2. Let requestObject be the result of invoking the initial value of
  21869. // Request as constructor with input and init as arguments. If this throws
  21870. // an exception, reject p with it and return p.
  21871. let requestObject
  21872. try {
  21873. requestObject = new Request(input, init)
  21874. } catch (e) {
  21875. p.reject(e)
  21876. return p.promise
  21877. }
  21878. // 3. Let request be requestObject’s request.
  21879. const request = requestObject[kState]
  21880. // 4. If requestObject’s signal’s aborted flag is set, then:
  21881. if (requestObject.signal.aborted) {
  21882. // 1. Abort the fetch() call with p, request, null, and
  21883. // requestObject’s signal’s abort reason.
  21884. abortFetch(p, request, null, requestObject.signal.reason)
  21885. // 2. Return p.
  21886. return p.promise
  21887. }
  21888. // 5. Let globalObject be request’s client’s global object.
  21889. const globalObject = request.client.globalObject
  21890. // 6. If globalObject is a ServiceWorkerGlobalScope object, then set
  21891. // request’s service-workers mode to "none".
  21892. if (globalObject?.constructor?.name === 'ServiceWorkerGlobalScope') {
  21893. request.serviceWorkers = 'none'
  21894. }
  21895. // 7. Let responseObject be null.
  21896. let responseObject = null
  21897. // 8. Let relevantRealm be this’s relevant Realm.
  21898. const relevantRealm = null
  21899. // 9. Let locallyAborted be false.
  21900. let locallyAborted = false
  21901. // 10. Let controller be null.
  21902. let controller = null
  21903. // 11. Add the following abort steps to requestObject’s signal:
  21904. addAbortListener(
  21905. requestObject.signal,
  21906. () => {
  21907. // 1. Set locallyAborted to true.
  21908. locallyAborted = true
  21909. // 2. Assert: controller is non-null.
  21910. assert(controller != null)
  21911. // 3. Abort controller with requestObject’s signal’s abort reason.
  21912. controller.abort(requestObject.signal.reason)
  21913. // 4. Abort the fetch() call with p, request, responseObject,
  21914. // and requestObject’s signal’s abort reason.
  21915. abortFetch(p, request, responseObject, requestObject.signal.reason)
  21916. }
  21917. )
  21918. // 12. Let handleFetchDone given response response be to finalize and
  21919. // report timing with response, globalObject, and "fetch".
  21920. const handleFetchDone = (response) =>
  21921. finalizeAndReportTiming(response, 'fetch')
  21922. // 13. Set controller to the result of calling fetch given request,
  21923. // with processResponseEndOfBody set to handleFetchDone, and processResponse
  21924. // given response being these substeps:
  21925. const processResponse = (response) => {
  21926. // 1. If locallyAborted is true, terminate these substeps.
  21927. if (locallyAborted) {
  21928. return Promise.resolve()
  21929. }
  21930. // 2. If response’s aborted flag is set, then:
  21931. if (response.aborted) {
  21932. // 1. Let deserializedError be the result of deserialize a serialized
  21933. // abort reason given controller’s serialized abort reason and
  21934. // relevantRealm.
  21935. // 2. Abort the fetch() call with p, request, responseObject, and
  21936. // deserializedError.
  21937. abortFetch(p, request, responseObject, controller.serializedAbortReason)
  21938. return Promise.resolve()
  21939. }
  21940. // 3. If response is a network error, then reject p with a TypeError
  21941. // and terminate these substeps.
  21942. if (response.type === 'error') {
  21943. p.reject(
  21944. Object.assign(new TypeError('fetch failed'), { cause: response.error })
  21945. )
  21946. return Promise.resolve()
  21947. }
  21948. // 4. Set responseObject to the result of creating a Response object,
  21949. // given response, "immutable", and relevantRealm.
  21950. responseObject = new Response()
  21951. responseObject[kState] = response
  21952. responseObject[kRealm] = relevantRealm
  21953. responseObject[kHeaders][kHeadersList] = response.headersList
  21954. responseObject[kHeaders][kGuard] = 'immutable'
  21955. responseObject[kHeaders][kRealm] = relevantRealm
  21956. // 5. Resolve p with responseObject.
  21957. p.resolve(responseObject)
  21958. }
  21959. controller = fetching({
  21960. request,
  21961. processResponseEndOfBody: handleFetchDone,
  21962. processResponse,
  21963. dispatcher: init.dispatcher ?? getGlobalDispatcher() // undici
  21964. })
  21965. // 14. Return p.
  21966. return p.promise
  21967. }
  21968. // https://fetch.spec.whatwg.org/#finalize-and-report-timing
  21969. function finalizeAndReportTiming (response, initiatorType = 'other') {
  21970. // 1. If response is an aborted network error, then return.
  21971. if (response.type === 'error' && response.aborted) {
  21972. return
  21973. }
  21974. // 2. If response’s URL list is null or empty, then return.
  21975. if (!response.urlList?.length) {
  21976. return
  21977. }
  21978. // 3. Let originalURL be response’s URL list[0].
  21979. const originalURL = response.urlList[0]
  21980. // 4. Let timingInfo be response’s timing info.
  21981. let timingInfo = response.timingInfo
  21982. // 5. Let cacheState be response’s cache state.
  21983. let cacheState = response.cacheState
  21984. // 6. If originalURL’s scheme is not an HTTP(S) scheme, then return.
  21985. if (!urlIsHttpHttpsScheme(originalURL)) {
  21986. return
  21987. }
  21988. // 7. If timingInfo is null, then return.
  21989. if (timingInfo === null) {
  21990. return
  21991. }
  21992. // 8. If response’s timing allow passed flag is not set, then:
  21993. if (!response.timingAllowPassed) {
  21994. // 1. Set timingInfo to a the result of creating an opaque timing info for timingInfo.
  21995. timingInfo = createOpaqueTimingInfo({
  21996. startTime: timingInfo.startTime
  21997. })
  21998. // 2. Set cacheState to the empty string.
  21999. cacheState = ''
  22000. }
  22001. // 9. Set timingInfo’s end time to the coarsened shared current time
  22002. // given global’s relevant settings object’s cross-origin isolated
  22003. // capability.
  22004. // TODO: given global’s relevant settings object’s cross-origin isolated
  22005. // capability?
  22006. timingInfo.endTime = coarsenedSharedCurrentTime()
  22007. // 10. Set response’s timing info to timingInfo.
  22008. response.timingInfo = timingInfo
  22009. // 11. Mark resource timing for timingInfo, originalURL, initiatorType,
  22010. // global, and cacheState.
  22011. markResourceTiming(
  22012. timingInfo,
  22013. originalURL,
  22014. initiatorType,
  22015. globalThis,
  22016. cacheState
  22017. )
  22018. }
  22019. // https://w3c.github.io/resource-timing/#dfn-mark-resource-timing
  22020. function markResourceTiming (timingInfo, originalURL, initiatorType, globalThis, cacheState) {
  22021. if (nodeMajor > 18 || (nodeMajor === 18 && nodeMinor >= 2)) {
  22022. performance.markResourceTiming(timingInfo, originalURL.href, initiatorType, globalThis, cacheState)
  22023. }
  22024. }
  22025. // https://fetch.spec.whatwg.org/#abort-fetch
  22026. function abortFetch (p, request, responseObject, error) {
  22027. // Note: AbortSignal.reason was added in node v17.2.0
  22028. // which would give us an undefined error to reject with.
  22029. // Remove this once node v16 is no longer supported.
  22030. if (!error) {
  22031. error = new DOMException('The operation was aborted.', 'AbortError')
  22032. }
  22033. // 1. Reject promise with error.
  22034. p.reject(error)
  22035. // 2. If request’s body is not null and is readable, then cancel request’s
  22036. // body with error.
  22037. if (request.body != null && isReadable(request.body?.stream)) {
  22038. request.body.stream.cancel(error).catch((err) => {
  22039. if (err.code === 'ERR_INVALID_STATE') {
  22040. // Node bug?
  22041. return
  22042. }
  22043. throw err
  22044. })
  22045. }
  22046. // 3. If responseObject is null, then return.
  22047. if (responseObject == null) {
  22048. return
  22049. }
  22050. // 4. Let response be responseObject’s response.
  22051. const response = responseObject[kState]
  22052. // 5. If response’s body is not null and is readable, then error response’s
  22053. // body with error.
  22054. if (response.body != null && isReadable(response.body?.stream)) {
  22055. response.body.stream.cancel(error).catch((err) => {
  22056. if (err.code === 'ERR_INVALID_STATE') {
  22057. // Node bug?
  22058. return
  22059. }
  22060. throw err
  22061. })
  22062. }
  22063. }
  22064. // https://fetch.spec.whatwg.org/#fetching
  22065. function fetching ({
  22066. request,
  22067. processRequestBodyChunkLength,
  22068. processRequestEndOfBody,
  22069. processResponse,
  22070. processResponseEndOfBody,
  22071. processResponseConsumeBody,
  22072. useParallelQueue = false,
  22073. dispatcher // undici
  22074. }) {
  22075. // 1. Let taskDestination be null.
  22076. let taskDestination = null
  22077. // 2. Let crossOriginIsolatedCapability be false.
  22078. let crossOriginIsolatedCapability = false
  22079. // 3. If request’s client is non-null, then:
  22080. if (request.client != null) {
  22081. // 1. Set taskDestination to request’s client’s global object.
  22082. taskDestination = request.client.globalObject
  22083. // 2. Set crossOriginIsolatedCapability to request’s client’s cross-origin
  22084. // isolated capability.
  22085. crossOriginIsolatedCapability =
  22086. request.client.crossOriginIsolatedCapability
  22087. }
  22088. // 4. If useParallelQueue is true, then set taskDestination to the result of
  22089. // starting a new parallel queue.
  22090. // TODO
  22091. // 5. Let timingInfo be a new fetch timing info whose start time and
  22092. // post-redirect start time are the coarsened shared current time given
  22093. // crossOriginIsolatedCapability.
  22094. const currenTime = coarsenedSharedCurrentTime(crossOriginIsolatedCapability)
  22095. const timingInfo = createOpaqueTimingInfo({
  22096. startTime: currenTime
  22097. })
  22098. // 6. Let fetchParams be a new fetch params whose
  22099. // request is request,
  22100. // timing info is timingInfo,
  22101. // process request body chunk length is processRequestBodyChunkLength,
  22102. // process request end-of-body is processRequestEndOfBody,
  22103. // process response is processResponse,
  22104. // process response consume body is processResponseConsumeBody,
  22105. // process response end-of-body is processResponseEndOfBody,
  22106. // task destination is taskDestination,
  22107. // and cross-origin isolated capability is crossOriginIsolatedCapability.
  22108. const fetchParams = {
  22109. controller: new Fetch(dispatcher),
  22110. request,
  22111. timingInfo,
  22112. processRequestBodyChunkLength,
  22113. processRequestEndOfBody,
  22114. processResponse,
  22115. processResponseConsumeBody,
  22116. processResponseEndOfBody,
  22117. taskDestination,
  22118. crossOriginIsolatedCapability
  22119. }
  22120. // 7. If request’s body is a byte sequence, then set request’s body to
  22121. // request’s body as a body.
  22122. // NOTE: Since fetching is only called from fetch, body should already be
  22123. // extracted.
  22124. assert(!request.body || request.body.stream)
  22125. // 8. If request’s window is "client", then set request’s window to request’s
  22126. // client, if request’s client’s global object is a Window object; otherwise
  22127. // "no-window".
  22128. if (request.window === 'client') {
  22129. // TODO: What if request.client is null?
  22130. request.window =
  22131. request.client?.globalObject?.constructor?.name === 'Window'
  22132. ? request.client
  22133. : 'no-window'
  22134. }
  22135. // 9. If request’s origin is "client", then set request’s origin to request’s
  22136. // client’s origin.
  22137. if (request.origin === 'client') {
  22138. // TODO: What if request.client is null?
  22139. request.origin = request.client?.origin
  22140. }
  22141. // 10. If all of the following conditions are true:
  22142. // TODO
  22143. // 11. If request’s policy container is "client", then:
  22144. if (request.policyContainer === 'client') {
  22145. // 1. If request’s client is non-null, then set request’s policy
  22146. // container to a clone of request’s client’s policy container. [HTML]
  22147. if (request.client != null) {
  22148. request.policyContainer = clonePolicyContainer(
  22149. request.client.policyContainer
  22150. )
  22151. } else {
  22152. // 2. Otherwise, set request’s policy container to a new policy
  22153. // container.
  22154. request.policyContainer = makePolicyContainer()
  22155. }
  22156. }
  22157. // 12. If request’s header list does not contain `Accept`, then:
  22158. if (!request.headersList.contains('accept')) {
  22159. // 1. Let value be `*/*`.
  22160. const value = '*/*'
  22161. // 2. A user agent should set value to the first matching statement, if
  22162. // any, switching on request’s destination:
  22163. // "document"
  22164. // "frame"
  22165. // "iframe"
  22166. // `text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8`
  22167. // "image"
  22168. // `image/png,image/svg+xml,image/*;q=0.8,*/*;q=0.5`
  22169. // "style"
  22170. // `text/css,*/*;q=0.1`
  22171. // TODO
  22172. // 3. Append `Accept`/value to request’s header list.
  22173. request.headersList.append('accept', value)
  22174. }
  22175. // 13. If request’s header list does not contain `Accept-Language`, then
  22176. // user agents should append `Accept-Language`/an appropriate value to
  22177. // request’s header list.
  22178. if (!request.headersList.contains('accept-language')) {
  22179. request.headersList.append('accept-language', '*')
  22180. }
  22181. // 14. If request’s priority is null, then use request’s initiator and
  22182. // destination appropriately in setting request’s priority to a
  22183. // user-agent-defined object.
  22184. if (request.priority === null) {
  22185. // TODO
  22186. }
  22187. // 15. If request is a subresource request, then:
  22188. if (subresourceSet.has(request.destination)) {
  22189. // TODO
  22190. }
  22191. // 16. Run main fetch given fetchParams.
  22192. mainFetch(fetchParams)
  22193. .catch(err => {
  22194. fetchParams.controller.terminate(err)
  22195. })
  22196. // 17. Return fetchParam's controller
  22197. return fetchParams.controller
  22198. }
  22199. // https://fetch.spec.whatwg.org/#concept-main-fetch
  22200. async function mainFetch (fetchParams, recursive = false) {
  22201. // 1. Let request be fetchParams’s request.
  22202. const request = fetchParams.request
  22203. // 2. Let response be null.
  22204. let response = null
  22205. // 3. If request’s local-URLs-only flag is set and request’s current URL is
  22206. // not local, then set response to a network error.
  22207. if (request.localURLsOnly && !urlIsLocal(requestCurrentURL(request))) {
  22208. response = makeNetworkError('local URLs only')
  22209. }
  22210. // 4. Run report Content Security Policy violations for request.
  22211. // TODO
  22212. // 5. Upgrade request to a potentially trustworthy URL, if appropriate.
  22213. tryUpgradeRequestToAPotentiallyTrustworthyURL(request)
  22214. // 6. If should request be blocked due to a bad port, should fetching request
  22215. // be blocked as mixed content, or should request be blocked by Content
  22216. // Security Policy returns blocked, then set response to a network error.
  22217. if (requestBadPort(request) === 'blocked') {
  22218. response = makeNetworkError('bad port')
  22219. }
  22220. // TODO: should fetching request be blocked as mixed content?
  22221. // TODO: should request be blocked by Content Security Policy?
  22222. // 7. If request’s referrer policy is the empty string, then set request’s
  22223. // referrer policy to request’s policy container’s referrer policy.
  22224. if (request.referrerPolicy === '') {
  22225. request.referrerPolicy = request.policyContainer.referrerPolicy
  22226. }
  22227. // 8. If request’s referrer is not "no-referrer", then set request’s
  22228. // referrer to the result of invoking determine request’s referrer.
  22229. if (request.referrer !== 'no-referrer') {
  22230. request.referrer = determineRequestsReferrer(request)
  22231. }
  22232. // 9. Set request’s current URL’s scheme to "https" if all of the following
  22233. // conditions are true:
  22234. // - request’s current URL’s scheme is "http"
  22235. // - request’s current URL’s host is a domain
  22236. // - Matching request’s current URL’s host per Known HSTS Host Domain Name
  22237. // Matching results in either a superdomain match with an asserted
  22238. // includeSubDomains directive or a congruent match (with or without an
  22239. // asserted includeSubDomains directive). [HSTS]
  22240. // TODO
  22241. // 10. If recursive is false, then run the remaining steps in parallel.
  22242. // TODO
  22243. // 11. If response is null, then set response to the result of running
  22244. // the steps corresponding to the first matching statement:
  22245. if (response === null) {
  22246. response = await (async () => {
  22247. const currentURL = requestCurrentURL(request)
  22248. if (
  22249. // - request’s current URL’s origin is same origin with request’s origin,
  22250. // and request’s response tainting is "basic"
  22251. (sameOrigin(currentURL, request.url) && request.responseTainting === 'basic') ||
  22252. // request’s current URL’s scheme is "data"
  22253. (currentURL.protocol === 'data:') ||
  22254. // - request’s mode is "navigate" or "websocket"
  22255. (request.mode === 'navigate' || request.mode === 'websocket')
  22256. ) {
  22257. // 1. Set request’s response tainting to "basic".
  22258. request.responseTainting = 'basic'
  22259. // 2. Return the result of running scheme fetch given fetchParams.
  22260. return await schemeFetch(fetchParams)
  22261. }
  22262. // request’s mode is "same-origin"
  22263. if (request.mode === 'same-origin') {
  22264. // 1. Return a network error.
  22265. return makeNetworkError('request mode cannot be "same-origin"')
  22266. }
  22267. // request’s mode is "no-cors"
  22268. if (request.mode === 'no-cors') {
  22269. // 1. If request’s redirect mode is not "follow", then return a network
  22270. // error.
  22271. if (request.redirect !== 'follow') {
  22272. return makeNetworkError(
  22273. 'redirect mode cannot be "follow" for "no-cors" request'
  22274. )
  22275. }
  22276. // 2. Set request’s response tainting to "opaque".
  22277. request.responseTainting = 'opaque'
  22278. // 3. Return the result of running scheme fetch given fetchParams.
  22279. return await schemeFetch(fetchParams)
  22280. }
  22281. // request’s current URL’s scheme is not an HTTP(S) scheme
  22282. if (!urlIsHttpHttpsScheme(requestCurrentURL(request))) {
  22283. // Return a network error.
  22284. return makeNetworkError('URL scheme must be a HTTP(S) scheme')
  22285. }
  22286. // - request’s use-CORS-preflight flag is set
  22287. // - request’s unsafe-request flag is set and either request’s method is
  22288. // not a CORS-safelisted method or CORS-unsafe request-header names with
  22289. // request’s header list is not empty
  22290. // 1. Set request’s response tainting to "cors".
  22291. // 2. Let corsWithPreflightResponse be the result of running HTTP fetch
  22292. // given fetchParams and true.
  22293. // 3. If corsWithPreflightResponse is a network error, then clear cache
  22294. // entries using request.
  22295. // 4. Return corsWithPreflightResponse.
  22296. // TODO
  22297. // Otherwise
  22298. // 1. Set request’s response tainting to "cors".
  22299. request.responseTainting = 'cors'
  22300. // 2. Return the result of running HTTP fetch given fetchParams.
  22301. return await httpFetch(fetchParams)
  22302. })()
  22303. }
  22304. // 12. If recursive is true, then return response.
  22305. if (recursive) {
  22306. return response
  22307. }
  22308. // 13. If response is not a network error and response is not a filtered
  22309. // response, then:
  22310. if (response.status !== 0 && !response.internalResponse) {
  22311. // If request’s response tainting is "cors", then:
  22312. if (request.responseTainting === 'cors') {
  22313. // 1. Let headerNames be the result of extracting header list values
  22314. // given `Access-Control-Expose-Headers` and response’s header list.
  22315. // TODO
  22316. // 2. If request’s credentials mode is not "include" and headerNames
  22317. // contains `*`, then set response’s CORS-exposed header-name list to
  22318. // all unique header names in response’s header list.
  22319. // TODO
  22320. // 3. Otherwise, if headerNames is not null or failure, then set
  22321. // response’s CORS-exposed header-name list to headerNames.
  22322. // TODO
  22323. }
  22324. // Set response to the following filtered response with response as its
  22325. // internal response, depending on request’s response tainting:
  22326. if (request.responseTainting === 'basic') {
  22327. response = filterResponse(response, 'basic')
  22328. } else if (request.responseTainting === 'cors') {
  22329. response = filterResponse(response, 'cors')
  22330. } else if (request.responseTainting === 'opaque') {
  22331. response = filterResponse(response, 'opaque')
  22332. } else {
  22333. assert(false)
  22334. }
  22335. }
  22336. // 14. Let internalResponse be response, if response is a network error,
  22337. // and response’s internal response otherwise.
  22338. let internalResponse =
  22339. response.status === 0 ? response : response.internalResponse
  22340. // 15. If internalResponse’s URL list is empty, then set it to a clone of
  22341. // request’s URL list.
  22342. if (internalResponse.urlList.length === 0) {
  22343. internalResponse.urlList.push(...request.urlList)
  22344. }
  22345. // 16. If request’s timing allow failed flag is unset, then set
  22346. // internalResponse’s timing allow passed flag.
  22347. if (!request.timingAllowFailed) {
  22348. response.timingAllowPassed = true
  22349. }
  22350. // 17. If response is not a network error and any of the following returns
  22351. // blocked
  22352. // - should internalResponse to request be blocked as mixed content
  22353. // - should internalResponse to request be blocked by Content Security Policy
  22354. // - should internalResponse to request be blocked due to its MIME type
  22355. // - should internalResponse to request be blocked due to nosniff
  22356. // TODO
  22357. // 18. If response’s type is "opaque", internalResponse’s status is 206,
  22358. // internalResponse’s range-requested flag is set, and request’s header
  22359. // list does not contain `Range`, then set response and internalResponse
  22360. // to a network error.
  22361. if (
  22362. response.type === 'opaque' &&
  22363. internalResponse.status === 206 &&
  22364. internalResponse.rangeRequested &&
  22365. !request.headers.contains('range')
  22366. ) {
  22367. response = internalResponse = makeNetworkError()
  22368. }
  22369. // 19. If response is not a network error and either request’s method is
  22370. // `HEAD` or `CONNECT`, or internalResponse’s status is a null body status,
  22371. // set internalResponse’s body to null and disregard any enqueuing toward
  22372. // it (if any).
  22373. if (
  22374. response.status !== 0 &&
  22375. (request.method === 'HEAD' ||
  22376. request.method === 'CONNECT' ||
  22377. nullBodyStatus.includes(internalResponse.status))
  22378. ) {
  22379. internalResponse.body = null
  22380. fetchParams.controller.dump = true
  22381. }
  22382. // 20. If request’s integrity metadata is not the empty string, then:
  22383. if (request.integrity) {
  22384. // 1. Let processBodyError be this step: run fetch finale given fetchParams
  22385. // and a network error.
  22386. const processBodyError = (reason) =>
  22387. fetchFinale(fetchParams, makeNetworkError(reason))
  22388. // 2. If request’s response tainting is "opaque", or response’s body is null,
  22389. // then run processBodyError and abort these steps.
  22390. if (request.responseTainting === 'opaque' || response.body == null) {
  22391. processBodyError(response.error)
  22392. return
  22393. }
  22394. // 3. Let processBody given bytes be these steps:
  22395. const processBody = (bytes) => {
  22396. // 1. If bytes do not match request’s integrity metadata,
  22397. // then run processBodyError and abort these steps. [SRI]
  22398. if (!bytesMatch(bytes, request.integrity)) {
  22399. processBodyError('integrity mismatch')
  22400. return
  22401. }
  22402. // 2. Set response’s body to bytes as a body.
  22403. response.body = safelyExtractBody(bytes)[0]
  22404. // 3. Run fetch finale given fetchParams and response.
  22405. fetchFinale(fetchParams, response)
  22406. }
  22407. // 4. Fully read response’s body given processBody and processBodyError.
  22408. await fullyReadBody(response.body, processBody, processBodyError)
  22409. } else {
  22410. // 21. Otherwise, run fetch finale given fetchParams and response.
  22411. fetchFinale(fetchParams, response)
  22412. }
  22413. }
  22414. // https://fetch.spec.whatwg.org/#concept-scheme-fetch
  22415. // given a fetch params fetchParams
  22416. function schemeFetch (fetchParams) {
  22417. // Note: since the connection is destroyed on redirect, which sets fetchParams to a
  22418. // cancelled state, we do not want this condition to trigger *unless* there have been
  22419. // no redirects. See https://github.com/nodejs/undici/issues/1776
  22420. // 1. If fetchParams is canceled, then return the appropriate network error for fetchParams.
  22421. if (isCancelled(fetchParams) && fetchParams.request.redirectCount === 0) {
  22422. return Promise.resolve(makeAppropriateNetworkError(fetchParams))
  22423. }
  22424. // 2. Let request be fetchParams’s request.
  22425. const { request } = fetchParams
  22426. const { protocol: scheme } = requestCurrentURL(request)
  22427. // 3. Switch on request’s current URL’s scheme and run the associated steps:
  22428. switch (scheme) {
  22429. case 'about:': {
  22430. // If request’s current URL’s path is the string "blank", then return a new response
  22431. // whose status message is `OK`, header list is « (`Content-Type`, `text/html;charset=utf-8`) »,
  22432. // and body is the empty byte sequence as a body.
  22433. // Otherwise, return a network error.
  22434. return Promise.resolve(makeNetworkError('about scheme is not supported'))
  22435. }
  22436. case 'blob:': {
  22437. if (!resolveObjectURL) {
  22438. resolveObjectURL = (__nccwpck_require__(4300).resolveObjectURL)
  22439. }
  22440. // 1. Let blobURLEntry be request’s current URL’s blob URL entry.
  22441. const blobURLEntry = requestCurrentURL(request)
  22442. // https://github.com/web-platform-tests/wpt/blob/7b0ebaccc62b566a1965396e5be7bb2bc06f841f/FileAPI/url/resources/fetch-tests.js#L52-L56
  22443. // Buffer.resolveObjectURL does not ignore URL queries.
  22444. if (blobURLEntry.search.length !== 0) {
  22445. return Promise.resolve(makeNetworkError('NetworkError when attempting to fetch resource.'))
  22446. }
  22447. const blobURLEntryObject = resolveObjectURL(blobURLEntry.toString())
  22448. // 2. If request’s method is not `GET`, blobURLEntry is null, or blobURLEntry’s
  22449. // object is not a Blob object, then return a network error.
  22450. if (request.method !== 'GET' || !isBlobLike(blobURLEntryObject)) {
  22451. return Promise.resolve(makeNetworkError('invalid method'))
  22452. }
  22453. // 3. Let bodyWithType be the result of safely extracting blobURLEntry’s object.
  22454. const bodyWithType = safelyExtractBody(blobURLEntryObject)
  22455. // 4. Let body be bodyWithType’s body.
  22456. const body = bodyWithType[0]
  22457. // 5. Let length be body’s length, serialized and isomorphic encoded.
  22458. const length = isomorphicEncode(`${body.length}`)
  22459. // 6. Let type be bodyWithType’s type if it is non-null; otherwise the empty byte sequence.
  22460. const type = bodyWithType[1] ?? ''
  22461. // 7. Return a new response whose status message is `OK`, header list is
  22462. // « (`Content-Length`, length), (`Content-Type`, type) », and body is body.
  22463. const response = makeResponse({
  22464. statusText: 'OK',
  22465. headersList: [
  22466. ['content-length', { name: 'Content-Length', value: length }],
  22467. ['content-type', { name: 'Content-Type', value: type }]
  22468. ]
  22469. })
  22470. response.body = body
  22471. return Promise.resolve(response)
  22472. }
  22473. case 'data:': {
  22474. // 1. Let dataURLStruct be the result of running the
  22475. // data: URL processor on request’s current URL.
  22476. const currentURL = requestCurrentURL(request)
  22477. const dataURLStruct = dataURLProcessor(currentURL)
  22478. // 2. If dataURLStruct is failure, then return a
  22479. // network error.
  22480. if (dataURLStruct === 'failure') {
  22481. return Promise.resolve(makeNetworkError('failed to fetch the data URL'))
  22482. }
  22483. // 3. Let mimeType be dataURLStruct’s MIME type, serialized.
  22484. const mimeType = serializeAMimeType(dataURLStruct.mimeType)
  22485. // 4. Return a response whose status message is `OK`,
  22486. // header list is « (`Content-Type`, mimeType) »,
  22487. // and body is dataURLStruct’s body as a body.
  22488. return Promise.resolve(makeResponse({
  22489. statusText: 'OK',
  22490. headersList: [
  22491. ['content-type', { name: 'Content-Type', value: mimeType }]
  22492. ],
  22493. body: safelyExtractBody(dataURLStruct.body)[0]
  22494. }))
  22495. }
  22496. case 'file:': {
  22497. // For now, unfortunate as it is, file URLs are left as an exercise for the reader.
  22498. // When in doubt, return a network error.
  22499. return Promise.resolve(makeNetworkError('not implemented... yet...'))
  22500. }
  22501. case 'http:':
  22502. case 'https:': {
  22503. // Return the result of running HTTP fetch given fetchParams.
  22504. return httpFetch(fetchParams)
  22505. .catch((err) => makeNetworkError(err))
  22506. }
  22507. default: {
  22508. return Promise.resolve(makeNetworkError('unknown scheme'))
  22509. }
  22510. }
  22511. }
  22512. // https://fetch.spec.whatwg.org/#finalize-response
  22513. function finalizeResponse (fetchParams, response) {
  22514. // 1. Set fetchParams’s request’s done flag.
  22515. fetchParams.request.done = true
  22516. // 2, If fetchParams’s process response done is not null, then queue a fetch
  22517. // task to run fetchParams’s process response done given response, with
  22518. // fetchParams’s task destination.
  22519. if (fetchParams.processResponseDone != null) {
  22520. queueMicrotask(() => fetchParams.processResponseDone(response))
  22521. }
  22522. }
  22523. // https://fetch.spec.whatwg.org/#fetch-finale
  22524. function fetchFinale (fetchParams, response) {
  22525. // 1. If response is a network error, then:
  22526. if (response.type === 'error') {
  22527. // 1. Set response’s URL list to « fetchParams’s request’s URL list[0] ».
  22528. response.urlList = [fetchParams.request.urlList[0]]
  22529. // 2. Set response’s timing info to the result of creating an opaque timing
  22530. // info for fetchParams’s timing info.
  22531. response.timingInfo = createOpaqueTimingInfo({
  22532. startTime: fetchParams.timingInfo.startTime
  22533. })
  22534. }
  22535. // 2. Let processResponseEndOfBody be the following steps:
  22536. const processResponseEndOfBody = () => {
  22537. // 1. Set fetchParams’s request’s done flag.
  22538. fetchParams.request.done = true
  22539. // If fetchParams’s process response end-of-body is not null,
  22540. // then queue a fetch task to run fetchParams’s process response
  22541. // end-of-body given response with fetchParams’s task destination.
  22542. if (fetchParams.processResponseEndOfBody != null) {
  22543. queueMicrotask(() => fetchParams.processResponseEndOfBody(response))
  22544. }
  22545. }
  22546. // 3. If fetchParams’s process response is non-null, then queue a fetch task
  22547. // to run fetchParams’s process response given response, with fetchParams’s
  22548. // task destination.
  22549. if (fetchParams.processResponse != null) {
  22550. queueMicrotask(() => fetchParams.processResponse(response))
  22551. }
  22552. // 4. If response’s body is null, then run processResponseEndOfBody.
  22553. if (response.body == null) {
  22554. processResponseEndOfBody()
  22555. } else {
  22556. // 5. Otherwise:
  22557. // 1. Let transformStream be a new a TransformStream.
  22558. // 2. Let identityTransformAlgorithm be an algorithm which, given chunk,
  22559. // enqueues chunk in transformStream.
  22560. const identityTransformAlgorithm = (chunk, controller) => {
  22561. controller.enqueue(chunk)
  22562. }
  22563. // 3. Set up transformStream with transformAlgorithm set to identityTransformAlgorithm
  22564. // and flushAlgorithm set to processResponseEndOfBody.
  22565. const transformStream = new TransformStream({
  22566. start () {},
  22567. transform: identityTransformAlgorithm,
  22568. flush: processResponseEndOfBody
  22569. }, {
  22570. size () {
  22571. return 1
  22572. }
  22573. }, {
  22574. size () {
  22575. return 1
  22576. }
  22577. })
  22578. // 4. Set response’s body to the result of piping response’s body through transformStream.
  22579. response.body = { stream: response.body.stream.pipeThrough(transformStream) }
  22580. }
  22581. // 6. If fetchParams’s process response consume body is non-null, then:
  22582. if (fetchParams.processResponseConsumeBody != null) {
  22583. // 1. Let processBody given nullOrBytes be this step: run fetchParams’s
  22584. // process response consume body given response and nullOrBytes.
  22585. const processBody = (nullOrBytes) => fetchParams.processResponseConsumeBody(response, nullOrBytes)
  22586. // 2. Let processBodyError be this step: run fetchParams’s process
  22587. // response consume body given response and failure.
  22588. const processBodyError = (failure) => fetchParams.processResponseConsumeBody(response, failure)
  22589. // 3. If response’s body is null, then queue a fetch task to run processBody
  22590. // given null, with fetchParams’s task destination.
  22591. if (response.body == null) {
  22592. queueMicrotask(() => processBody(null))
  22593. } else {
  22594. // 4. Otherwise, fully read response’s body given processBody, processBodyError,
  22595. // and fetchParams’s task destination.
  22596. return fullyReadBody(response.body, processBody, processBodyError)
  22597. }
  22598. return Promise.resolve()
  22599. }
  22600. }
  22601. // https://fetch.spec.whatwg.org/#http-fetch
  22602. async function httpFetch (fetchParams) {
  22603. // 1. Let request be fetchParams’s request.
  22604. const request = fetchParams.request
  22605. // 2. Let response be null.
  22606. let response = null
  22607. // 3. Let actualResponse be null.
  22608. let actualResponse = null
  22609. // 4. Let timingInfo be fetchParams’s timing info.
  22610. const timingInfo = fetchParams.timingInfo
  22611. // 5. If request’s service-workers mode is "all", then:
  22612. if (request.serviceWorkers === 'all') {
  22613. // TODO
  22614. }
  22615. // 6. If response is null, then:
  22616. if (response === null) {
  22617. // 1. If makeCORSPreflight is true and one of these conditions is true:
  22618. // TODO
  22619. // 2. If request’s redirect mode is "follow", then set request’s
  22620. // service-workers mode to "none".
  22621. if (request.redirect === 'follow') {
  22622. request.serviceWorkers = 'none'
  22623. }
  22624. // 3. Set response and actualResponse to the result of running
  22625. // HTTP-network-or-cache fetch given fetchParams.
  22626. actualResponse = response = await httpNetworkOrCacheFetch(fetchParams)
  22627. // 4. If request’s response tainting is "cors" and a CORS check
  22628. // for request and response returns failure, then return a network error.
  22629. if (
  22630. request.responseTainting === 'cors' &&
  22631. corsCheck(request, response) === 'failure'
  22632. ) {
  22633. return makeNetworkError('cors failure')
  22634. }
  22635. // 5. If the TAO check for request and response returns failure, then set
  22636. // request’s timing allow failed flag.
  22637. if (TAOCheck(request, response) === 'failure') {
  22638. request.timingAllowFailed = true
  22639. }
  22640. }
  22641. // 7. If either request’s response tainting or response’s type
  22642. // is "opaque", and the cross-origin resource policy check with
  22643. // request’s origin, request’s client, request’s destination,
  22644. // and actualResponse returns blocked, then return a network error.
  22645. if (
  22646. (request.responseTainting === 'opaque' || response.type === 'opaque') &&
  22647. crossOriginResourcePolicyCheck(
  22648. request.origin,
  22649. request.client,
  22650. request.destination,
  22651. actualResponse
  22652. ) === 'blocked'
  22653. ) {
  22654. return makeNetworkError('blocked')
  22655. }
  22656. // 8. If actualResponse’s status is a redirect status, then:
  22657. if (redirectStatusSet.has(actualResponse.status)) {
  22658. // 1. If actualResponse’s status is not 303, request’s body is not null,
  22659. // and the connection uses HTTP/2, then user agents may, and are even
  22660. // encouraged to, transmit an RST_STREAM frame.
  22661. // See, https://github.com/whatwg/fetch/issues/1288
  22662. if (request.redirect !== 'manual') {
  22663. fetchParams.controller.connection.destroy()
  22664. }
  22665. // 2. Switch on request’s redirect mode:
  22666. if (request.redirect === 'error') {
  22667. // Set response to a network error.
  22668. response = makeNetworkError('unexpected redirect')
  22669. } else if (request.redirect === 'manual') {
  22670. // Set response to an opaque-redirect filtered response whose internal
  22671. // response is actualResponse.
  22672. // NOTE(spec): On the web this would return an `opaqueredirect` response,
  22673. // but that doesn't make sense server side.
  22674. // See https://github.com/nodejs/undici/issues/1193.
  22675. response = actualResponse
  22676. } else if (request.redirect === 'follow') {
  22677. // Set response to the result of running HTTP-redirect fetch given
  22678. // fetchParams and response.
  22679. response = await httpRedirectFetch(fetchParams, response)
  22680. } else {
  22681. assert(false)
  22682. }
  22683. }
  22684. // 9. Set response’s timing info to timingInfo.
  22685. response.timingInfo = timingInfo
  22686. // 10. Return response.
  22687. return response
  22688. }
  22689. // https://fetch.spec.whatwg.org/#http-redirect-fetch
  22690. function httpRedirectFetch (fetchParams, response) {
  22691. // 1. Let request be fetchParams’s request.
  22692. const request = fetchParams.request
  22693. // 2. Let actualResponse be response, if response is not a filtered response,
  22694. // and response’s internal response otherwise.
  22695. const actualResponse = response.internalResponse
  22696. ? response.internalResponse
  22697. : response
  22698. // 3. Let locationURL be actualResponse’s location URL given request’s current
  22699. // URL’s fragment.
  22700. let locationURL
  22701. try {
  22702. locationURL = responseLocationURL(
  22703. actualResponse,
  22704. requestCurrentURL(request).hash
  22705. )
  22706. // 4. If locationURL is null, then return response.
  22707. if (locationURL == null) {
  22708. return response
  22709. }
  22710. } catch (err) {
  22711. // 5. If locationURL is failure, then return a network error.
  22712. return Promise.resolve(makeNetworkError(err))
  22713. }
  22714. // 6. If locationURL’s scheme is not an HTTP(S) scheme, then return a network
  22715. // error.
  22716. if (!urlIsHttpHttpsScheme(locationURL)) {
  22717. return Promise.resolve(makeNetworkError('URL scheme must be a HTTP(S) scheme'))
  22718. }
  22719. // 7. If request’s redirect count is 20, then return a network error.
  22720. if (request.redirectCount === 20) {
  22721. return Promise.resolve(makeNetworkError('redirect count exceeded'))
  22722. }
  22723. // 8. Increase request’s redirect count by 1.
  22724. request.redirectCount += 1
  22725. // 9. If request’s mode is "cors", locationURL includes credentials, and
  22726. // request’s origin is not same origin with locationURL’s origin, then return
  22727. // a network error.
  22728. if (
  22729. request.mode === 'cors' &&
  22730. (locationURL.username || locationURL.password) &&
  22731. !sameOrigin(request, locationURL)
  22732. ) {
  22733. return Promise.resolve(makeNetworkError('cross origin not allowed for request mode "cors"'))
  22734. }
  22735. // 10. If request’s response tainting is "cors" and locationURL includes
  22736. // credentials, then return a network error.
  22737. if (
  22738. request.responseTainting === 'cors' &&
  22739. (locationURL.username || locationURL.password)
  22740. ) {
  22741. return Promise.resolve(makeNetworkError(
  22742. 'URL cannot contain credentials for request mode "cors"'
  22743. ))
  22744. }
  22745. // 11. If actualResponse’s status is not 303, request’s body is non-null,
  22746. // and request’s body’s source is null, then return a network error.
  22747. if (
  22748. actualResponse.status !== 303 &&
  22749. request.body != null &&
  22750. request.body.source == null
  22751. ) {
  22752. return Promise.resolve(makeNetworkError())
  22753. }
  22754. // 12. If one of the following is true
  22755. // - actualResponse’s status is 301 or 302 and request’s method is `POST`
  22756. // - actualResponse’s status is 303 and request’s method is not `GET` or `HEAD`
  22757. if (
  22758. ([301, 302].includes(actualResponse.status) && request.method === 'POST') ||
  22759. (actualResponse.status === 303 &&
  22760. !GET_OR_HEAD.includes(request.method))
  22761. ) {
  22762. // then:
  22763. // 1. Set request’s method to `GET` and request’s body to null.
  22764. request.method = 'GET'
  22765. request.body = null
  22766. // 2. For each headerName of request-body-header name, delete headerName from
  22767. // request’s header list.
  22768. for (const headerName of requestBodyHeader) {
  22769. request.headersList.delete(headerName)
  22770. }
  22771. }
  22772. // 13. If request’s current URL’s origin is not same origin with locationURL’s
  22773. // origin, then for each headerName of CORS non-wildcard request-header name,
  22774. // delete headerName from request’s header list.
  22775. if (!sameOrigin(requestCurrentURL(request), locationURL)) {
  22776. // https://fetch.spec.whatwg.org/#cors-non-wildcard-request-header-name
  22777. request.headersList.delete('authorization')
  22778. // https://fetch.spec.whatwg.org/#authentication-entries
  22779. request.headersList.delete('proxy-authorization', true)
  22780. // "Cookie" and "Host" are forbidden request-headers, which undici doesn't implement.
  22781. request.headersList.delete('cookie')
  22782. request.headersList.delete('host')
  22783. }
  22784. // 14. If request’s body is non-null, then set request’s body to the first return
  22785. // value of safely extracting request’s body’s source.
  22786. if (request.body != null) {
  22787. assert(request.body.source != null)
  22788. request.body = safelyExtractBody(request.body.source)[0]
  22789. }
  22790. // 15. Let timingInfo be fetchParams’s timing info.
  22791. const timingInfo = fetchParams.timingInfo
  22792. // 16. Set timingInfo’s redirect end time and post-redirect start time to the
  22793. // coarsened shared current time given fetchParams’s cross-origin isolated
  22794. // capability.
  22795. timingInfo.redirectEndTime = timingInfo.postRedirectStartTime =
  22796. coarsenedSharedCurrentTime(fetchParams.crossOriginIsolatedCapability)
  22797. // 17. If timingInfo’s redirect start time is 0, then set timingInfo’s
  22798. // redirect start time to timingInfo’s start time.
  22799. if (timingInfo.redirectStartTime === 0) {
  22800. timingInfo.redirectStartTime = timingInfo.startTime
  22801. }
  22802. // 18. Append locationURL to request’s URL list.
  22803. request.urlList.push(locationURL)
  22804. // 19. Invoke set request’s referrer policy on redirect on request and
  22805. // actualResponse.
  22806. setRequestReferrerPolicyOnRedirect(request, actualResponse)
  22807. // 20. Return the result of running main fetch given fetchParams and true.
  22808. return mainFetch(fetchParams, true)
  22809. }
  22810. // https://fetch.spec.whatwg.org/#http-network-or-cache-fetch
  22811. async function httpNetworkOrCacheFetch (
  22812. fetchParams,
  22813. isAuthenticationFetch = false,
  22814. isNewConnectionFetch = false
  22815. ) {
  22816. // 1. Let request be fetchParams’s request.
  22817. const request = fetchParams.request
  22818. // 2. Let httpFetchParams be null.
  22819. let httpFetchParams = null
  22820. // 3. Let httpRequest be null.
  22821. let httpRequest = null
  22822. // 4. Let response be null.
  22823. let response = null
  22824. // 5. Let storedResponse be null.
  22825. // TODO: cache
  22826. // 6. Let httpCache be null.
  22827. const httpCache = null
  22828. // 7. Let the revalidatingFlag be unset.
  22829. const revalidatingFlag = false
  22830. // 8. Run these steps, but abort when the ongoing fetch is terminated:
  22831. // 1. If request’s window is "no-window" and request’s redirect mode is
  22832. // "error", then set httpFetchParams to fetchParams and httpRequest to
  22833. // request.
  22834. if (request.window === 'no-window' && request.redirect === 'error') {
  22835. httpFetchParams = fetchParams
  22836. httpRequest = request
  22837. } else {
  22838. // Otherwise:
  22839. // 1. Set httpRequest to a clone of request.
  22840. httpRequest = makeRequest(request)
  22841. // 2. Set httpFetchParams to a copy of fetchParams.
  22842. httpFetchParams = { ...fetchParams }
  22843. // 3. Set httpFetchParams’s request to httpRequest.
  22844. httpFetchParams.request = httpRequest
  22845. }
  22846. // 3. Let includeCredentials be true if one of
  22847. const includeCredentials =
  22848. request.credentials === 'include' ||
  22849. (request.credentials === 'same-origin' &&
  22850. request.responseTainting === 'basic')
  22851. // 4. Let contentLength be httpRequest’s body’s length, if httpRequest’s
  22852. // body is non-null; otherwise null.
  22853. const contentLength = httpRequest.body ? httpRequest.body.length : null
  22854. // 5. Let contentLengthHeaderValue be null.
  22855. let contentLengthHeaderValue = null
  22856. // 6. If httpRequest’s body is null and httpRequest’s method is `POST` or
  22857. // `PUT`, then set contentLengthHeaderValue to `0`.
  22858. if (
  22859. httpRequest.body == null &&
  22860. ['POST', 'PUT'].includes(httpRequest.method)
  22861. ) {
  22862. contentLengthHeaderValue = '0'
  22863. }
  22864. // 7. If contentLength is non-null, then set contentLengthHeaderValue to
  22865. // contentLength, serialized and isomorphic encoded.
  22866. if (contentLength != null) {
  22867. contentLengthHeaderValue = isomorphicEncode(`${contentLength}`)
  22868. }
  22869. // 8. If contentLengthHeaderValue is non-null, then append
  22870. // `Content-Length`/contentLengthHeaderValue to httpRequest’s header
  22871. // list.
  22872. if (contentLengthHeaderValue != null) {
  22873. httpRequest.headersList.append('content-length', contentLengthHeaderValue)
  22874. }
  22875. // 9. If contentLengthHeaderValue is non-null, then append (`Content-Length`,
  22876. // contentLengthHeaderValue) to httpRequest’s header list.
  22877. // 10. If contentLength is non-null and httpRequest’s keepalive is true,
  22878. // then:
  22879. if (contentLength != null && httpRequest.keepalive) {
  22880. // NOTE: keepalive is a noop outside of browser context.
  22881. }
  22882. // 11. If httpRequest’s referrer is a URL, then append
  22883. // `Referer`/httpRequest’s referrer, serialized and isomorphic encoded,
  22884. // to httpRequest’s header list.
  22885. if (httpRequest.referrer instanceof URL) {
  22886. httpRequest.headersList.append('referer', isomorphicEncode(httpRequest.referrer.href))
  22887. }
  22888. // 12. Append a request `Origin` header for httpRequest.
  22889. appendRequestOriginHeader(httpRequest)
  22890. // 13. Append the Fetch metadata headers for httpRequest. [FETCH-METADATA]
  22891. appendFetchMetadata(httpRequest)
  22892. // 14. If httpRequest’s header list does not contain `User-Agent`, then
  22893. // user agents should append `User-Agent`/default `User-Agent` value to
  22894. // httpRequest’s header list.
  22895. if (!httpRequest.headersList.contains('user-agent')) {
  22896. httpRequest.headersList.append('user-agent', typeof esbuildDetection === 'undefined' ? 'undici' : 'node')
  22897. }
  22898. // 15. If httpRequest’s cache mode is "default" and httpRequest’s header
  22899. // list contains `If-Modified-Since`, `If-None-Match`,
  22900. // `If-Unmodified-Since`, `If-Match`, or `If-Range`, then set
  22901. // httpRequest’s cache mode to "no-store".
  22902. if (
  22903. httpRequest.cache === 'default' &&
  22904. (httpRequest.headersList.contains('if-modified-since') ||
  22905. httpRequest.headersList.contains('if-none-match') ||
  22906. httpRequest.headersList.contains('if-unmodified-since') ||
  22907. httpRequest.headersList.contains('if-match') ||
  22908. httpRequest.headersList.contains('if-range'))
  22909. ) {
  22910. httpRequest.cache = 'no-store'
  22911. }
  22912. // 16. If httpRequest’s cache mode is "no-cache", httpRequest’s prevent
  22913. // no-cache cache-control header modification flag is unset, and
  22914. // httpRequest’s header list does not contain `Cache-Control`, then append
  22915. // `Cache-Control`/`max-age=0` to httpRequest’s header list.
  22916. if (
  22917. httpRequest.cache === 'no-cache' &&
  22918. !httpRequest.preventNoCacheCacheControlHeaderModification &&
  22919. !httpRequest.headersList.contains('cache-control')
  22920. ) {
  22921. httpRequest.headersList.append('cache-control', 'max-age=0')
  22922. }
  22923. // 17. If httpRequest’s cache mode is "no-store" or "reload", then:
  22924. if (httpRequest.cache === 'no-store' || httpRequest.cache === 'reload') {
  22925. // 1. If httpRequest’s header list does not contain `Pragma`, then append
  22926. // `Pragma`/`no-cache` to httpRequest’s header list.
  22927. if (!httpRequest.headersList.contains('pragma')) {
  22928. httpRequest.headersList.append('pragma', 'no-cache')
  22929. }
  22930. // 2. If httpRequest’s header list does not contain `Cache-Control`,
  22931. // then append `Cache-Control`/`no-cache` to httpRequest’s header list.
  22932. if (!httpRequest.headersList.contains('cache-control')) {
  22933. httpRequest.headersList.append('cache-control', 'no-cache')
  22934. }
  22935. }
  22936. // 18. If httpRequest’s header list contains `Range`, then append
  22937. // `Accept-Encoding`/`identity` to httpRequest’s header list.
  22938. if (httpRequest.headersList.contains('range')) {
  22939. httpRequest.headersList.append('accept-encoding', 'identity')
  22940. }
  22941. // 19. Modify httpRequest’s header list per HTTP. Do not append a given
  22942. // header if httpRequest’s header list contains that header’s name.
  22943. // TODO: https://github.com/whatwg/fetch/issues/1285#issuecomment-896560129
  22944. if (!httpRequest.headersList.contains('accept-encoding')) {
  22945. if (urlHasHttpsScheme(requestCurrentURL(httpRequest))) {
  22946. httpRequest.headersList.append('accept-encoding', 'br, gzip, deflate')
  22947. } else {
  22948. httpRequest.headersList.append('accept-encoding', 'gzip, deflate')
  22949. }
  22950. }
  22951. httpRequest.headersList.delete('host')
  22952. // 20. If includeCredentials is true, then:
  22953. if (includeCredentials) {
  22954. // 1. If the user agent is not configured to block cookies for httpRequest
  22955. // (see section 7 of [COOKIES]), then:
  22956. // TODO: credentials
  22957. // 2. If httpRequest’s header list does not contain `Authorization`, then:
  22958. // TODO: credentials
  22959. }
  22960. // 21. If there’s a proxy-authentication entry, use it as appropriate.
  22961. // TODO: proxy-authentication
  22962. // 22. Set httpCache to the result of determining the HTTP cache
  22963. // partition, given httpRequest.
  22964. // TODO: cache
  22965. // 23. If httpCache is null, then set httpRequest’s cache mode to
  22966. // "no-store".
  22967. if (httpCache == null) {
  22968. httpRequest.cache = 'no-store'
  22969. }
  22970. // 24. If httpRequest’s cache mode is neither "no-store" nor "reload",
  22971. // then:
  22972. if (httpRequest.mode !== 'no-store' && httpRequest.mode !== 'reload') {
  22973. // TODO: cache
  22974. }
  22975. // 9. If aborted, then return the appropriate network error for fetchParams.
  22976. // TODO
  22977. // 10. If response is null, then:
  22978. if (response == null) {
  22979. // 1. If httpRequest’s cache mode is "only-if-cached", then return a
  22980. // network error.
  22981. if (httpRequest.mode === 'only-if-cached') {
  22982. return makeNetworkError('only if cached')
  22983. }
  22984. // 2. Let forwardResponse be the result of running HTTP-network fetch
  22985. // given httpFetchParams, includeCredentials, and isNewConnectionFetch.
  22986. const forwardResponse = await httpNetworkFetch(
  22987. httpFetchParams,
  22988. includeCredentials,
  22989. isNewConnectionFetch
  22990. )
  22991. // 3. If httpRequest’s method is unsafe and forwardResponse’s status is
  22992. // in the range 200 to 399, inclusive, invalidate appropriate stored
  22993. // responses in httpCache, as per the "Invalidation" chapter of HTTP
  22994. // Caching, and set storedResponse to null. [HTTP-CACHING]
  22995. if (
  22996. !safeMethodsSet.has(httpRequest.method) &&
  22997. forwardResponse.status >= 200 &&
  22998. forwardResponse.status <= 399
  22999. ) {
  23000. // TODO: cache
  23001. }
  23002. // 4. If the revalidatingFlag is set and forwardResponse’s status is 304,
  23003. // then:
  23004. if (revalidatingFlag && forwardResponse.status === 304) {
  23005. // TODO: cache
  23006. }
  23007. // 5. If response is null, then:
  23008. if (response == null) {
  23009. // 1. Set response to forwardResponse.
  23010. response = forwardResponse
  23011. // 2. Store httpRequest and forwardResponse in httpCache, as per the
  23012. // "Storing Responses in Caches" chapter of HTTP Caching. [HTTP-CACHING]
  23013. // TODO: cache
  23014. }
  23015. }
  23016. // 11. Set response’s URL list to a clone of httpRequest’s URL list.
  23017. response.urlList = [...httpRequest.urlList]
  23018. // 12. If httpRequest’s header list contains `Range`, then set response’s
  23019. // range-requested flag.
  23020. if (httpRequest.headersList.contains('range')) {
  23021. response.rangeRequested = true
  23022. }
  23023. // 13. Set response’s request-includes-credentials to includeCredentials.
  23024. response.requestIncludesCredentials = includeCredentials
  23025. // 14. If response’s status is 401, httpRequest’s response tainting is not
  23026. // "cors", includeCredentials is true, and request’s window is an environment
  23027. // settings object, then:
  23028. // TODO
  23029. // 15. If response’s status is 407, then:
  23030. if (response.status === 407) {
  23031. // 1. If request’s window is "no-window", then return a network error.
  23032. if (request.window === 'no-window') {
  23033. return makeNetworkError()
  23034. }
  23035. // 2. ???
  23036. // 3. If fetchParams is canceled, then return the appropriate network error for fetchParams.
  23037. if (isCancelled(fetchParams)) {
  23038. return makeAppropriateNetworkError(fetchParams)
  23039. }
  23040. // 4. Prompt the end user as appropriate in request’s window and store
  23041. // the result as a proxy-authentication entry. [HTTP-AUTH]
  23042. // TODO: Invoke some kind of callback?
  23043. // 5. Set response to the result of running HTTP-network-or-cache fetch given
  23044. // fetchParams.
  23045. // TODO
  23046. return makeNetworkError('proxy authentication required')
  23047. }
  23048. // 16. If all of the following are true
  23049. if (
  23050. // response’s status is 421
  23051. response.status === 421 &&
  23052. // isNewConnectionFetch is false
  23053. !isNewConnectionFetch &&
  23054. // request’s body is null, or request’s body is non-null and request’s body’s source is non-null
  23055. (request.body == null || request.body.source != null)
  23056. ) {
  23057. // then:
  23058. // 1. If fetchParams is canceled, then return the appropriate network error for fetchParams.
  23059. if (isCancelled(fetchParams)) {
  23060. return makeAppropriateNetworkError(fetchParams)
  23061. }
  23062. // 2. Set response to the result of running HTTP-network-or-cache
  23063. // fetch given fetchParams, isAuthenticationFetch, and true.
  23064. // TODO (spec): The spec doesn't specify this but we need to cancel
  23065. // the active response before we can start a new one.
  23066. // https://github.com/whatwg/fetch/issues/1293
  23067. fetchParams.controller.connection.destroy()
  23068. response = await httpNetworkOrCacheFetch(
  23069. fetchParams,
  23070. isAuthenticationFetch,
  23071. true
  23072. )
  23073. }
  23074. // 17. If isAuthenticationFetch is true, then create an authentication entry
  23075. if (isAuthenticationFetch) {
  23076. // TODO
  23077. }
  23078. // 18. Return response.
  23079. return response
  23080. }
  23081. // https://fetch.spec.whatwg.org/#http-network-fetch
  23082. async function httpNetworkFetch (
  23083. fetchParams,
  23084. includeCredentials = false,
  23085. forceNewConnection = false
  23086. ) {
  23087. assert(!fetchParams.controller.connection || fetchParams.controller.connection.destroyed)
  23088. fetchParams.controller.connection = {
  23089. abort: null,
  23090. destroyed: false,
  23091. destroy (err) {
  23092. if (!this.destroyed) {
  23093. this.destroyed = true
  23094. this.abort?.(err ?? new DOMException('The operation was aborted.', 'AbortError'))
  23095. }
  23096. }
  23097. }
  23098. // 1. Let request be fetchParams’s request.
  23099. const request = fetchParams.request
  23100. // 2. Let response be null.
  23101. let response = null
  23102. // 3. Let timingInfo be fetchParams’s timing info.
  23103. const timingInfo = fetchParams.timingInfo
  23104. // 4. Let httpCache be the result of determining the HTTP cache partition,
  23105. // given request.
  23106. // TODO: cache
  23107. const httpCache = null
  23108. // 5. If httpCache is null, then set request’s cache mode to "no-store".
  23109. if (httpCache == null) {
  23110. request.cache = 'no-store'
  23111. }
  23112. // 6. Let networkPartitionKey be the result of determining the network
  23113. // partition key given request.
  23114. // TODO
  23115. // 7. Let newConnection be "yes" if forceNewConnection is true; otherwise
  23116. // "no".
  23117. const newConnection = forceNewConnection ? 'yes' : 'no' // eslint-disable-line no-unused-vars
  23118. // 8. Switch on request’s mode:
  23119. if (request.mode === 'websocket') {
  23120. // Let connection be the result of obtaining a WebSocket connection,
  23121. // given request’s current URL.
  23122. // TODO
  23123. } else {
  23124. // Let connection be the result of obtaining a connection, given
  23125. // networkPartitionKey, request’s current URL’s origin,
  23126. // includeCredentials, and forceNewConnection.
  23127. // TODO
  23128. }
  23129. // 9. Run these steps, but abort when the ongoing fetch is terminated:
  23130. // 1. If connection is failure, then return a network error.
  23131. // 2. Set timingInfo’s final connection timing info to the result of
  23132. // calling clamp and coarsen connection timing info with connection’s
  23133. // timing info, timingInfo’s post-redirect start time, and fetchParams’s
  23134. // cross-origin isolated capability.
  23135. // 3. If connection is not an HTTP/2 connection, request’s body is non-null,
  23136. // and request’s body’s source is null, then append (`Transfer-Encoding`,
  23137. // `chunked`) to request’s header list.
  23138. // 4. Set timingInfo’s final network-request start time to the coarsened
  23139. // shared current time given fetchParams’s cross-origin isolated
  23140. // capability.
  23141. // 5. Set response to the result of making an HTTP request over connection
  23142. // using request with the following caveats:
  23143. // - Follow the relevant requirements from HTTP. [HTTP] [HTTP-SEMANTICS]
  23144. // [HTTP-COND] [HTTP-CACHING] [HTTP-AUTH]
  23145. // - If request’s body is non-null, and request’s body’s source is null,
  23146. // then the user agent may have a buffer of up to 64 kibibytes and store
  23147. // a part of request’s body in that buffer. If the user agent reads from
  23148. // request’s body beyond that buffer’s size and the user agent needs to
  23149. // resend request, then instead return a network error.
  23150. // - Set timingInfo’s final network-response start time to the coarsened
  23151. // shared current time given fetchParams’s cross-origin isolated capability,
  23152. // immediately after the user agent’s HTTP parser receives the first byte
  23153. // of the response (e.g., frame header bytes for HTTP/2 or response status
  23154. // line for HTTP/1.x).
  23155. // - Wait until all the headers are transmitted.
  23156. // - Any responses whose status is in the range 100 to 199, inclusive,
  23157. // and is not 101, are to be ignored, except for the purposes of setting
  23158. // timingInfo’s final network-response start time above.
  23159. // - If request’s header list contains `Transfer-Encoding`/`chunked` and
  23160. // response is transferred via HTTP/1.0 or older, then return a network
  23161. // error.
  23162. // - If the HTTP request results in a TLS client certificate dialog, then:
  23163. // 1. If request’s window is an environment settings object, make the
  23164. // dialog available in request’s window.
  23165. // 2. Otherwise, return a network error.
  23166. // To transmit request’s body body, run these steps:
  23167. let requestBody = null
  23168. // 1. If body is null and fetchParams’s process request end-of-body is
  23169. // non-null, then queue a fetch task given fetchParams’s process request
  23170. // end-of-body and fetchParams’s task destination.
  23171. if (request.body == null && fetchParams.processRequestEndOfBody) {
  23172. queueMicrotask(() => fetchParams.processRequestEndOfBody())
  23173. } else if (request.body != null) {
  23174. // 2. Otherwise, if body is non-null:
  23175. // 1. Let processBodyChunk given bytes be these steps:
  23176. const processBodyChunk = async function * (bytes) {
  23177. // 1. If the ongoing fetch is terminated, then abort these steps.
  23178. if (isCancelled(fetchParams)) {
  23179. return
  23180. }
  23181. // 2. Run this step in parallel: transmit bytes.
  23182. yield bytes
  23183. // 3. If fetchParams’s process request body is non-null, then run
  23184. // fetchParams’s process request body given bytes’s length.
  23185. fetchParams.processRequestBodyChunkLength?.(bytes.byteLength)
  23186. }
  23187. // 2. Let processEndOfBody be these steps:
  23188. const processEndOfBody = () => {
  23189. // 1. If fetchParams is canceled, then abort these steps.
  23190. if (isCancelled(fetchParams)) {
  23191. return
  23192. }
  23193. // 2. If fetchParams’s process request end-of-body is non-null,
  23194. // then run fetchParams’s process request end-of-body.
  23195. if (fetchParams.processRequestEndOfBody) {
  23196. fetchParams.processRequestEndOfBody()
  23197. }
  23198. }
  23199. // 3. Let processBodyError given e be these steps:
  23200. const processBodyError = (e) => {
  23201. // 1. If fetchParams is canceled, then abort these steps.
  23202. if (isCancelled(fetchParams)) {
  23203. return
  23204. }
  23205. // 2. If e is an "AbortError" DOMException, then abort fetchParams’s controller.
  23206. if (e.name === 'AbortError') {
  23207. fetchParams.controller.abort()
  23208. } else {
  23209. fetchParams.controller.terminate(e)
  23210. }
  23211. }
  23212. // 4. Incrementally read request’s body given processBodyChunk, processEndOfBody,
  23213. // processBodyError, and fetchParams’s task destination.
  23214. requestBody = (async function * () {
  23215. try {
  23216. for await (const bytes of request.body.stream) {
  23217. yield * processBodyChunk(bytes)
  23218. }
  23219. processEndOfBody()
  23220. } catch (err) {
  23221. processBodyError(err)
  23222. }
  23223. })()
  23224. }
  23225. try {
  23226. // socket is only provided for websockets
  23227. const { body, status, statusText, headersList, socket } = await dispatch({ body: requestBody })
  23228. if (socket) {
  23229. response = makeResponse({ status, statusText, headersList, socket })
  23230. } else {
  23231. const iterator = body[Symbol.asyncIterator]()
  23232. fetchParams.controller.next = () => iterator.next()
  23233. response = makeResponse({ status, statusText, headersList })
  23234. }
  23235. } catch (err) {
  23236. // 10. If aborted, then:
  23237. if (err.name === 'AbortError') {
  23238. // 1. If connection uses HTTP/2, then transmit an RST_STREAM frame.
  23239. fetchParams.controller.connection.destroy()
  23240. // 2. Return the appropriate network error for fetchParams.
  23241. return makeAppropriateNetworkError(fetchParams, err)
  23242. }
  23243. return makeNetworkError(err)
  23244. }
  23245. // 11. Let pullAlgorithm be an action that resumes the ongoing fetch
  23246. // if it is suspended.
  23247. const pullAlgorithm = () => {
  23248. fetchParams.controller.resume()
  23249. }
  23250. // 12. Let cancelAlgorithm be an algorithm that aborts fetchParams’s
  23251. // controller with reason, given reason.
  23252. const cancelAlgorithm = (reason) => {
  23253. fetchParams.controller.abort(reason)
  23254. }
  23255. // 13. Let highWaterMark be a non-negative, non-NaN number, chosen by
  23256. // the user agent.
  23257. // TODO
  23258. // 14. Let sizeAlgorithm be an algorithm that accepts a chunk object
  23259. // and returns a non-negative, non-NaN, non-infinite number, chosen by the user agent.
  23260. // TODO
  23261. // 15. Let stream be a new ReadableStream.
  23262. // 16. Set up stream with pullAlgorithm set to pullAlgorithm,
  23263. // cancelAlgorithm set to cancelAlgorithm, highWaterMark set to
  23264. // highWaterMark, and sizeAlgorithm set to sizeAlgorithm.
  23265. if (!ReadableStream) {
  23266. ReadableStream = (__nccwpck_require__(5356).ReadableStream)
  23267. }
  23268. const stream = new ReadableStream(
  23269. {
  23270. async start (controller) {
  23271. fetchParams.controller.controller = controller
  23272. },
  23273. async pull (controller) {
  23274. await pullAlgorithm(controller)
  23275. },
  23276. async cancel (reason) {
  23277. await cancelAlgorithm(reason)
  23278. }
  23279. },
  23280. {
  23281. highWaterMark: 0,
  23282. size () {
  23283. return 1
  23284. }
  23285. }
  23286. )
  23287. // 17. Run these steps, but abort when the ongoing fetch is terminated:
  23288. // 1. Set response’s body to a new body whose stream is stream.
  23289. response.body = { stream }
  23290. // 2. If response is not a network error and request’s cache mode is
  23291. // not "no-store", then update response in httpCache for request.
  23292. // TODO
  23293. // 3. If includeCredentials is true and the user agent is not configured
  23294. // to block cookies for request (see section 7 of [COOKIES]), then run the
  23295. // "set-cookie-string" parsing algorithm (see section 5.2 of [COOKIES]) on
  23296. // the value of each header whose name is a byte-case-insensitive match for
  23297. // `Set-Cookie` in response’s header list, if any, and request’s current URL.
  23298. // TODO
  23299. // 18. If aborted, then:
  23300. // TODO
  23301. // 19. Run these steps in parallel:
  23302. // 1. Run these steps, but abort when fetchParams is canceled:
  23303. fetchParams.controller.on('terminated', onAborted)
  23304. fetchParams.controller.resume = async () => {
  23305. // 1. While true
  23306. while (true) {
  23307. // 1-3. See onData...
  23308. // 4. Set bytes to the result of handling content codings given
  23309. // codings and bytes.
  23310. let bytes
  23311. let isFailure
  23312. try {
  23313. const { done, value } = await fetchParams.controller.next()
  23314. if (isAborted(fetchParams)) {
  23315. break
  23316. }
  23317. bytes = done ? undefined : value
  23318. } catch (err) {
  23319. if (fetchParams.controller.ended && !timingInfo.encodedBodySize) {
  23320. // zlib doesn't like empty streams.
  23321. bytes = undefined
  23322. } else {
  23323. bytes = err
  23324. // err may be propagated from the result of calling readablestream.cancel,
  23325. // which might not be an error. https://github.com/nodejs/undici/issues/2009
  23326. isFailure = true
  23327. }
  23328. }
  23329. if (bytes === undefined) {
  23330. // 2. Otherwise, if the bytes transmission for response’s message
  23331. // body is done normally and stream is readable, then close
  23332. // stream, finalize response for fetchParams and response, and
  23333. // abort these in-parallel steps.
  23334. readableStreamClose(fetchParams.controller.controller)
  23335. finalizeResponse(fetchParams, response)
  23336. return
  23337. }
  23338. // 5. Increase timingInfo’s decoded body size by bytes’s length.
  23339. timingInfo.decodedBodySize += bytes?.byteLength ?? 0
  23340. // 6. If bytes is failure, then terminate fetchParams’s controller.
  23341. if (isFailure) {
  23342. fetchParams.controller.terminate(bytes)
  23343. return
  23344. }
  23345. // 7. Enqueue a Uint8Array wrapping an ArrayBuffer containing bytes
  23346. // into stream.
  23347. fetchParams.controller.controller.enqueue(new Uint8Array(bytes))
  23348. // 8. If stream is errored, then terminate the ongoing fetch.
  23349. if (isErrored(stream)) {
  23350. fetchParams.controller.terminate()
  23351. return
  23352. }
  23353. // 9. If stream doesn’t need more data ask the user agent to suspend
  23354. // the ongoing fetch.
  23355. if (!fetchParams.controller.controller.desiredSize) {
  23356. return
  23357. }
  23358. }
  23359. }
  23360. // 2. If aborted, then:
  23361. function onAborted (reason) {
  23362. // 2. If fetchParams is aborted, then:
  23363. if (isAborted(fetchParams)) {
  23364. // 1. Set response’s aborted flag.
  23365. response.aborted = true
  23366. // 2. If stream is readable, then error stream with the result of
  23367. // deserialize a serialized abort reason given fetchParams’s
  23368. // controller’s serialized abort reason and an
  23369. // implementation-defined realm.
  23370. if (isReadable(stream)) {
  23371. fetchParams.controller.controller.error(
  23372. fetchParams.controller.serializedAbortReason
  23373. )
  23374. }
  23375. } else {
  23376. // 3. Otherwise, if stream is readable, error stream with a TypeError.
  23377. if (isReadable(stream)) {
  23378. fetchParams.controller.controller.error(new TypeError('terminated', {
  23379. cause: isErrorLike(reason) ? reason : undefined
  23380. }))
  23381. }
  23382. }
  23383. // 4. If connection uses HTTP/2, then transmit an RST_STREAM frame.
  23384. // 5. Otherwise, the user agent should close connection unless it would be bad for performance to do so.
  23385. fetchParams.controller.connection.destroy()
  23386. }
  23387. // 20. Return response.
  23388. return response
  23389. async function dispatch ({ body }) {
  23390. const url = requestCurrentURL(request)
  23391. /** @type {import('../..').Agent} */
  23392. const agent = fetchParams.controller.dispatcher
  23393. return new Promise((resolve, reject) => agent.dispatch(
  23394. {
  23395. path: url.pathname + url.search,
  23396. origin: url.origin,
  23397. method: request.method,
  23398. body: fetchParams.controller.dispatcher.isMockActive ? request.body && (request.body.source || request.body.stream) : body,
  23399. headers: request.headersList.entries,
  23400. maxRedirections: 0,
  23401. upgrade: request.mode === 'websocket' ? 'websocket' : undefined
  23402. },
  23403. {
  23404. body: null,
  23405. abort: null,
  23406. onConnect (abort) {
  23407. // TODO (fix): Do we need connection here?
  23408. const { connection } = fetchParams.controller
  23409. if (connection.destroyed) {
  23410. abort(new DOMException('The operation was aborted.', 'AbortError'))
  23411. } else {
  23412. fetchParams.controller.on('terminated', abort)
  23413. this.abort = connection.abort = abort
  23414. }
  23415. },
  23416. onHeaders (status, headersList, resume, statusText) {
  23417. if (status < 200) {
  23418. return
  23419. }
  23420. let codings = []
  23421. let location = ''
  23422. const headers = new Headers()
  23423. // For H2, the headers are a plain JS object
  23424. // We distinguish between them and iterate accordingly
  23425. if (Array.isArray(headersList)) {
  23426. for (let n = 0; n < headersList.length; n += 2) {
  23427. const key = headersList[n + 0].toString('latin1')
  23428. const val = headersList[n + 1].toString('latin1')
  23429. if (key.toLowerCase() === 'content-encoding') {
  23430. // https://www.rfc-editor.org/rfc/rfc7231#section-3.1.2.1
  23431. // "All content-coding values are case-insensitive..."
  23432. codings = val.toLowerCase().split(',').map((x) => x.trim())
  23433. } else if (key.toLowerCase() === 'location') {
  23434. location = val
  23435. }
  23436. headers[kHeadersList].append(key, val)
  23437. }
  23438. } else {
  23439. const keys = Object.keys(headersList)
  23440. for (const key of keys) {
  23441. const val = headersList[key]
  23442. if (key.toLowerCase() === 'content-encoding') {
  23443. // https://www.rfc-editor.org/rfc/rfc7231#section-3.1.2.1
  23444. // "All content-coding values are case-insensitive..."
  23445. codings = val.toLowerCase().split(',').map((x) => x.trim()).reverse()
  23446. } else if (key.toLowerCase() === 'location') {
  23447. location = val
  23448. }
  23449. headers[kHeadersList].append(key, val)
  23450. }
  23451. }
  23452. this.body = new Readable({ read: resume })
  23453. const decoders = []
  23454. const willFollow = request.redirect === 'follow' &&
  23455. location &&
  23456. redirectStatusSet.has(status)
  23457. // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Encoding
  23458. if (request.method !== 'HEAD' && request.method !== 'CONNECT' && !nullBodyStatus.includes(status) && !willFollow) {
  23459. for (const coding of codings) {
  23460. // https://www.rfc-editor.org/rfc/rfc9112.html#section-7.2
  23461. if (coding === 'x-gzip' || coding === 'gzip') {
  23462. decoders.push(zlib.createGunzip({
  23463. // Be less strict when decoding compressed responses, since sometimes
  23464. // servers send slightly invalid responses that are still accepted
  23465. // by common browsers.
  23466. // Always using Z_SYNC_FLUSH is what cURL does.
  23467. flush: zlib.constants.Z_SYNC_FLUSH,
  23468. finishFlush: zlib.constants.Z_SYNC_FLUSH
  23469. }))
  23470. } else if (coding === 'deflate') {
  23471. decoders.push(zlib.createInflate())
  23472. } else if (coding === 'br') {
  23473. decoders.push(zlib.createBrotliDecompress())
  23474. } else {
  23475. decoders.length = 0
  23476. break
  23477. }
  23478. }
  23479. }
  23480. resolve({
  23481. status,
  23482. statusText,
  23483. headersList: headers[kHeadersList],
  23484. body: decoders.length
  23485. ? pipeline(this.body, ...decoders, () => { })
  23486. : this.body.on('error', () => {})
  23487. })
  23488. return true
  23489. },
  23490. onData (chunk) {
  23491. if (fetchParams.controller.dump) {
  23492. return
  23493. }
  23494. // 1. If one or more bytes have been transmitted from response’s
  23495. // message body, then:
  23496. // 1. Let bytes be the transmitted bytes.
  23497. const bytes = chunk
  23498. // 2. Let codings be the result of extracting header list values
  23499. // given `Content-Encoding` and response’s header list.
  23500. // See pullAlgorithm.
  23501. // 3. Increase timingInfo’s encoded body size by bytes’s length.
  23502. timingInfo.encodedBodySize += bytes.byteLength
  23503. // 4. See pullAlgorithm...
  23504. return this.body.push(bytes)
  23505. },
  23506. onComplete () {
  23507. if (this.abort) {
  23508. fetchParams.controller.off('terminated', this.abort)
  23509. }
  23510. fetchParams.controller.ended = true
  23511. this.body.push(null)
  23512. },
  23513. onError (error) {
  23514. if (this.abort) {
  23515. fetchParams.controller.off('terminated', this.abort)
  23516. }
  23517. this.body?.destroy(error)
  23518. fetchParams.controller.terminate(error)
  23519. reject(error)
  23520. },
  23521. onUpgrade (status, headersList, socket) {
  23522. if (status !== 101) {
  23523. return
  23524. }
  23525. const headers = new Headers()
  23526. for (let n = 0; n < headersList.length; n += 2) {
  23527. const key = headersList[n + 0].toString('latin1')
  23528. const val = headersList[n + 1].toString('latin1')
  23529. headers[kHeadersList].append(key, val)
  23530. }
  23531. resolve({
  23532. status,
  23533. statusText: STATUS_CODES[status],
  23534. headersList: headers[kHeadersList],
  23535. socket
  23536. })
  23537. return true
  23538. }
  23539. }
  23540. ))
  23541. }
  23542. }
  23543. module.exports = {
  23544. fetch,
  23545. Fetch,
  23546. fetching,
  23547. finalizeAndReportTiming
  23548. }
  23549. /***/ }),
  23550. /***/ 8359:
  23551. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  23552. "use strict";
  23553. /* globals AbortController */
  23554. const { extractBody, mixinBody, cloneBody } = __nccwpck_require__(9990)
  23555. const { Headers, fill: fillHeaders, HeadersList } = __nccwpck_require__(554)
  23556. const { FinalizationRegistry } = __nccwpck_require__(6436)()
  23557. const util = __nccwpck_require__(3983)
  23558. const {
  23559. isValidHTTPToken,
  23560. sameOrigin,
  23561. normalizeMethod,
  23562. makePolicyContainer,
  23563. normalizeMethodRecord
  23564. } = __nccwpck_require__(2538)
  23565. const {
  23566. forbiddenMethodsSet,
  23567. corsSafeListedMethodsSet,
  23568. referrerPolicy,
  23569. requestRedirect,
  23570. requestMode,
  23571. requestCredentials,
  23572. requestCache,
  23573. requestDuplex
  23574. } = __nccwpck_require__(1037)
  23575. const { kEnumerableProperty } = util
  23576. const { kHeaders, kSignal, kState, kGuard, kRealm } = __nccwpck_require__(5861)
  23577. const { webidl } = __nccwpck_require__(1744)
  23578. const { getGlobalOrigin } = __nccwpck_require__(1246)
  23579. const { URLSerializer } = __nccwpck_require__(685)
  23580. const { kHeadersList, kConstruct } = __nccwpck_require__(2785)
  23581. const assert = __nccwpck_require__(9491)
  23582. const { getMaxListeners, setMaxListeners, getEventListeners, defaultMaxListeners } = __nccwpck_require__(2361)
  23583. let TransformStream = globalThis.TransformStream
  23584. const kAbortController = Symbol('abortController')
  23585. const requestFinalizer = new FinalizationRegistry(({ signal, abort }) => {
  23586. signal.removeEventListener('abort', abort)
  23587. })
  23588. // https://fetch.spec.whatwg.org/#request-class
  23589. class Request {
  23590. // https://fetch.spec.whatwg.org/#dom-request
  23591. constructor (input, init = {}) {
  23592. if (input === kConstruct) {
  23593. return
  23594. }
  23595. webidl.argumentLengthCheck(arguments, 1, { header: 'Request constructor' })
  23596. input = webidl.converters.RequestInfo(input)
  23597. init = webidl.converters.RequestInit(init)
  23598. // https://html.spec.whatwg.org/multipage/webappapis.html#environment-settings-object
  23599. this[kRealm] = {
  23600. settingsObject: {
  23601. baseUrl: getGlobalOrigin(),
  23602. get origin () {
  23603. return this.baseUrl?.origin
  23604. },
  23605. policyContainer: makePolicyContainer()
  23606. }
  23607. }
  23608. // 1. Let request be null.
  23609. let request = null
  23610. // 2. Let fallbackMode be null.
  23611. let fallbackMode = null
  23612. // 3. Let baseURL be this’s relevant settings object’s API base URL.
  23613. const baseUrl = this[kRealm].settingsObject.baseUrl
  23614. // 4. Let signal be null.
  23615. let signal = null
  23616. // 5. If input is a string, then:
  23617. if (typeof input === 'string') {
  23618. // 1. Let parsedURL be the result of parsing input with baseURL.
  23619. // 2. If parsedURL is failure, then throw a TypeError.
  23620. let parsedURL
  23621. try {
  23622. parsedURL = new URL(input, baseUrl)
  23623. } catch (err) {
  23624. throw new TypeError('Failed to parse URL from ' + input, { cause: err })
  23625. }
  23626. // 3. If parsedURL includes credentials, then throw a TypeError.
  23627. if (parsedURL.username || parsedURL.password) {
  23628. throw new TypeError(
  23629. 'Request cannot be constructed from a URL that includes credentials: ' +
  23630. input
  23631. )
  23632. }
  23633. // 4. Set request to a new request whose URL is parsedURL.
  23634. request = makeRequest({ urlList: [parsedURL] })
  23635. // 5. Set fallbackMode to "cors".
  23636. fallbackMode = 'cors'
  23637. } else {
  23638. // 6. Otherwise:
  23639. // 7. Assert: input is a Request object.
  23640. assert(input instanceof Request)
  23641. // 8. Set request to input’s request.
  23642. request = input[kState]
  23643. // 9. Set signal to input’s signal.
  23644. signal = input[kSignal]
  23645. }
  23646. // 7. Let origin be this’s relevant settings object’s origin.
  23647. const origin = this[kRealm].settingsObject.origin
  23648. // 8. Let window be "client".
  23649. let window = 'client'
  23650. // 9. If request’s window is an environment settings object and its origin
  23651. // is same origin with origin, then set window to request’s window.
  23652. if (
  23653. request.window?.constructor?.name === 'EnvironmentSettingsObject' &&
  23654. sameOrigin(request.window, origin)
  23655. ) {
  23656. window = request.window
  23657. }
  23658. // 10. If init["window"] exists and is non-null, then throw a TypeError.
  23659. if (init.window != null) {
  23660. throw new TypeError(`'window' option '${window}' must be null`)
  23661. }
  23662. // 11. If init["window"] exists, then set window to "no-window".
  23663. if ('window' in init) {
  23664. window = 'no-window'
  23665. }
  23666. // 12. Set request to a new request with the following properties:
  23667. request = makeRequest({
  23668. // URL request’s URL.
  23669. // undici implementation note: this is set as the first item in request's urlList in makeRequest
  23670. // method request’s method.
  23671. method: request.method,
  23672. // header list A copy of request’s header list.
  23673. // undici implementation note: headersList is cloned in makeRequest
  23674. headersList: request.headersList,
  23675. // unsafe-request flag Set.
  23676. unsafeRequest: request.unsafeRequest,
  23677. // client This’s relevant settings object.
  23678. client: this[kRealm].settingsObject,
  23679. // window window.
  23680. window,
  23681. // priority request’s priority.
  23682. priority: request.priority,
  23683. // origin request’s origin. The propagation of the origin is only significant for navigation requests
  23684. // being handled by a service worker. In this scenario a request can have an origin that is different
  23685. // from the current client.
  23686. origin: request.origin,
  23687. // referrer request’s referrer.
  23688. referrer: request.referrer,
  23689. // referrer policy request’s referrer policy.
  23690. referrerPolicy: request.referrerPolicy,
  23691. // mode request’s mode.
  23692. mode: request.mode,
  23693. // credentials mode request’s credentials mode.
  23694. credentials: request.credentials,
  23695. // cache mode request’s cache mode.
  23696. cache: request.cache,
  23697. // redirect mode request’s redirect mode.
  23698. redirect: request.redirect,
  23699. // integrity metadata request’s integrity metadata.
  23700. integrity: request.integrity,
  23701. // keepalive request’s keepalive.
  23702. keepalive: request.keepalive,
  23703. // reload-navigation flag request’s reload-navigation flag.
  23704. reloadNavigation: request.reloadNavigation,
  23705. // history-navigation flag request’s history-navigation flag.
  23706. historyNavigation: request.historyNavigation,
  23707. // URL list A clone of request’s URL list.
  23708. urlList: [...request.urlList]
  23709. })
  23710. const initHasKey = Object.keys(init).length !== 0
  23711. // 13. If init is not empty, then:
  23712. if (initHasKey) {
  23713. // 1. If request’s mode is "navigate", then set it to "same-origin".
  23714. if (request.mode === 'navigate') {
  23715. request.mode = 'same-origin'
  23716. }
  23717. // 2. Unset request’s reload-navigation flag.
  23718. request.reloadNavigation = false
  23719. // 3. Unset request’s history-navigation flag.
  23720. request.historyNavigation = false
  23721. // 4. Set request’s origin to "client".
  23722. request.origin = 'client'
  23723. // 5. Set request’s referrer to "client"
  23724. request.referrer = 'client'
  23725. // 6. Set request’s referrer policy to the empty string.
  23726. request.referrerPolicy = ''
  23727. // 7. Set request’s URL to request’s current URL.
  23728. request.url = request.urlList[request.urlList.length - 1]
  23729. // 8. Set request’s URL list to « request’s URL ».
  23730. request.urlList = [request.url]
  23731. }
  23732. // 14. If init["referrer"] exists, then:
  23733. if (init.referrer !== undefined) {
  23734. // 1. Let referrer be init["referrer"].
  23735. const referrer = init.referrer
  23736. // 2. If referrer is the empty string, then set request’s referrer to "no-referrer".
  23737. if (referrer === '') {
  23738. request.referrer = 'no-referrer'
  23739. } else {
  23740. // 1. Let parsedReferrer be the result of parsing referrer with
  23741. // baseURL.
  23742. // 2. If parsedReferrer is failure, then throw a TypeError.
  23743. let parsedReferrer
  23744. try {
  23745. parsedReferrer = new URL(referrer, baseUrl)
  23746. } catch (err) {
  23747. throw new TypeError(`Referrer "${referrer}" is not a valid URL.`, { cause: err })
  23748. }
  23749. // 3. If one of the following is true
  23750. // - parsedReferrer’s scheme is "about" and path is the string "client"
  23751. // - parsedReferrer’s origin is not same origin with origin
  23752. // then set request’s referrer to "client".
  23753. if (
  23754. (parsedReferrer.protocol === 'about:' && parsedReferrer.hostname === 'client') ||
  23755. (origin && !sameOrigin(parsedReferrer, this[kRealm].settingsObject.baseUrl))
  23756. ) {
  23757. request.referrer = 'client'
  23758. } else {
  23759. // 4. Otherwise, set request’s referrer to parsedReferrer.
  23760. request.referrer = parsedReferrer
  23761. }
  23762. }
  23763. }
  23764. // 15. If init["referrerPolicy"] exists, then set request’s referrer policy
  23765. // to it.
  23766. if (init.referrerPolicy !== undefined) {
  23767. request.referrerPolicy = init.referrerPolicy
  23768. }
  23769. // 16. Let mode be init["mode"] if it exists, and fallbackMode otherwise.
  23770. let mode
  23771. if (init.mode !== undefined) {
  23772. mode = init.mode
  23773. } else {
  23774. mode = fallbackMode
  23775. }
  23776. // 17. If mode is "navigate", then throw a TypeError.
  23777. if (mode === 'navigate') {
  23778. throw webidl.errors.exception({
  23779. header: 'Request constructor',
  23780. message: 'invalid request mode navigate.'
  23781. })
  23782. }
  23783. // 18. If mode is non-null, set request’s mode to mode.
  23784. if (mode != null) {
  23785. request.mode = mode
  23786. }
  23787. // 19. If init["credentials"] exists, then set request’s credentials mode
  23788. // to it.
  23789. if (init.credentials !== undefined) {
  23790. request.credentials = init.credentials
  23791. }
  23792. // 18. If init["cache"] exists, then set request’s cache mode to it.
  23793. if (init.cache !== undefined) {
  23794. request.cache = init.cache
  23795. }
  23796. // 21. If request’s cache mode is "only-if-cached" and request’s mode is
  23797. // not "same-origin", then throw a TypeError.
  23798. if (request.cache === 'only-if-cached' && request.mode !== 'same-origin') {
  23799. throw new TypeError(
  23800. "'only-if-cached' can be set only with 'same-origin' mode"
  23801. )
  23802. }
  23803. // 22. If init["redirect"] exists, then set request’s redirect mode to it.
  23804. if (init.redirect !== undefined) {
  23805. request.redirect = init.redirect
  23806. }
  23807. // 23. If init["integrity"] exists, then set request’s integrity metadata to it.
  23808. if (init.integrity != null) {
  23809. request.integrity = String(init.integrity)
  23810. }
  23811. // 24. If init["keepalive"] exists, then set request’s keepalive to it.
  23812. if (init.keepalive !== undefined) {
  23813. request.keepalive = Boolean(init.keepalive)
  23814. }
  23815. // 25. If init["method"] exists, then:
  23816. if (init.method !== undefined) {
  23817. // 1. Let method be init["method"].
  23818. let method = init.method
  23819. // 2. If method is not a method or method is a forbidden method, then
  23820. // throw a TypeError.
  23821. if (!isValidHTTPToken(method)) {
  23822. throw new TypeError(`'${method}' is not a valid HTTP method.`)
  23823. }
  23824. if (forbiddenMethodsSet.has(method.toUpperCase())) {
  23825. throw new TypeError(`'${method}' HTTP method is unsupported.`)
  23826. }
  23827. // 3. Normalize method.
  23828. method = normalizeMethodRecord[method] ?? normalizeMethod(method)
  23829. // 4. Set request’s method to method.
  23830. request.method = method
  23831. }
  23832. // 26. If init["signal"] exists, then set signal to it.
  23833. if (init.signal !== undefined) {
  23834. signal = init.signal
  23835. }
  23836. // 27. Set this’s request to request.
  23837. this[kState] = request
  23838. // 28. Set this’s signal to a new AbortSignal object with this’s relevant
  23839. // Realm.
  23840. // TODO: could this be simplified with AbortSignal.any
  23841. // (https://dom.spec.whatwg.org/#dom-abortsignal-any)
  23842. const ac = new AbortController()
  23843. this[kSignal] = ac.signal
  23844. this[kSignal][kRealm] = this[kRealm]
  23845. // 29. If signal is not null, then make this’s signal follow signal.
  23846. if (signal != null) {
  23847. if (
  23848. !signal ||
  23849. typeof signal.aborted !== 'boolean' ||
  23850. typeof signal.addEventListener !== 'function'
  23851. ) {
  23852. throw new TypeError(
  23853. "Failed to construct 'Request': member signal is not of type AbortSignal."
  23854. )
  23855. }
  23856. if (signal.aborted) {
  23857. ac.abort(signal.reason)
  23858. } else {
  23859. // Keep a strong ref to ac while request object
  23860. // is alive. This is needed to prevent AbortController
  23861. // from being prematurely garbage collected.
  23862. // See, https://github.com/nodejs/undici/issues/1926.
  23863. this[kAbortController] = ac
  23864. const acRef = new WeakRef(ac)
  23865. const abort = function () {
  23866. const ac = acRef.deref()
  23867. if (ac !== undefined) {
  23868. ac.abort(this.reason)
  23869. }
  23870. }
  23871. // Third-party AbortControllers may not work with these.
  23872. // See, https://github.com/nodejs/undici/pull/1910#issuecomment-1464495619.
  23873. try {
  23874. // If the max amount of listeners is equal to the default, increase it
  23875. // This is only available in node >= v19.9.0
  23876. if (typeof getMaxListeners === 'function' && getMaxListeners(signal) === defaultMaxListeners) {
  23877. setMaxListeners(100, signal)
  23878. } else if (getEventListeners(signal, 'abort').length >= defaultMaxListeners) {
  23879. setMaxListeners(100, signal)
  23880. }
  23881. } catch {}
  23882. util.addAbortListener(signal, abort)
  23883. requestFinalizer.register(ac, { signal, abort })
  23884. }
  23885. }
  23886. // 30. Set this’s headers to a new Headers object with this’s relevant
  23887. // Realm, whose header list is request’s header list and guard is
  23888. // "request".
  23889. this[kHeaders] = new Headers(kConstruct)
  23890. this[kHeaders][kHeadersList] = request.headersList
  23891. this[kHeaders][kGuard] = 'request'
  23892. this[kHeaders][kRealm] = this[kRealm]
  23893. // 31. If this’s request’s mode is "no-cors", then:
  23894. if (mode === 'no-cors') {
  23895. // 1. If this’s request’s method is not a CORS-safelisted method,
  23896. // then throw a TypeError.
  23897. if (!corsSafeListedMethodsSet.has(request.method)) {
  23898. throw new TypeError(
  23899. `'${request.method} is unsupported in no-cors mode.`
  23900. )
  23901. }
  23902. // 2. Set this’s headers’s guard to "request-no-cors".
  23903. this[kHeaders][kGuard] = 'request-no-cors'
  23904. }
  23905. // 32. If init is not empty, then:
  23906. if (initHasKey) {
  23907. /** @type {HeadersList} */
  23908. const headersList = this[kHeaders][kHeadersList]
  23909. // 1. Let headers be a copy of this’s headers and its associated header
  23910. // list.
  23911. // 2. If init["headers"] exists, then set headers to init["headers"].
  23912. const headers = init.headers !== undefined ? init.headers : new HeadersList(headersList)
  23913. // 3. Empty this’s headers’s header list.
  23914. headersList.clear()
  23915. // 4. If headers is a Headers object, then for each header in its header
  23916. // list, append header’s name/header’s value to this’s headers.
  23917. if (headers instanceof HeadersList) {
  23918. for (const [key, val] of headers) {
  23919. headersList.append(key, val)
  23920. }
  23921. // Note: Copy the `set-cookie` meta-data.
  23922. headersList.cookies = headers.cookies
  23923. } else {
  23924. // 5. Otherwise, fill this’s headers with headers.
  23925. fillHeaders(this[kHeaders], headers)
  23926. }
  23927. }
  23928. // 33. Let inputBody be input’s request’s body if input is a Request
  23929. // object; otherwise null.
  23930. const inputBody = input instanceof Request ? input[kState].body : null
  23931. // 34. If either init["body"] exists and is non-null or inputBody is
  23932. // non-null, and request’s method is `GET` or `HEAD`, then throw a
  23933. // TypeError.
  23934. if (
  23935. (init.body != null || inputBody != null) &&
  23936. (request.method === 'GET' || request.method === 'HEAD')
  23937. ) {
  23938. throw new TypeError('Request with GET/HEAD method cannot have body.')
  23939. }
  23940. // 35. Let initBody be null.
  23941. let initBody = null
  23942. // 36. If init["body"] exists and is non-null, then:
  23943. if (init.body != null) {
  23944. // 1. Let Content-Type be null.
  23945. // 2. Set initBody and Content-Type to the result of extracting
  23946. // init["body"], with keepalive set to request’s keepalive.
  23947. const [extractedBody, contentType] = extractBody(
  23948. init.body,
  23949. request.keepalive
  23950. )
  23951. initBody = extractedBody
  23952. // 3, If Content-Type is non-null and this’s headers’s header list does
  23953. // not contain `Content-Type`, then append `Content-Type`/Content-Type to
  23954. // this’s headers.
  23955. if (contentType && !this[kHeaders][kHeadersList].contains('content-type')) {
  23956. this[kHeaders].append('content-type', contentType)
  23957. }
  23958. }
  23959. // 37. Let inputOrInitBody be initBody if it is non-null; otherwise
  23960. // inputBody.
  23961. const inputOrInitBody = initBody ?? inputBody
  23962. // 38. If inputOrInitBody is non-null and inputOrInitBody’s source is
  23963. // null, then:
  23964. if (inputOrInitBody != null && inputOrInitBody.source == null) {
  23965. // 1. If initBody is non-null and init["duplex"] does not exist,
  23966. // then throw a TypeError.
  23967. if (initBody != null && init.duplex == null) {
  23968. throw new TypeError('RequestInit: duplex option is required when sending a body.')
  23969. }
  23970. // 2. If this’s request’s mode is neither "same-origin" nor "cors",
  23971. // then throw a TypeError.
  23972. if (request.mode !== 'same-origin' && request.mode !== 'cors') {
  23973. throw new TypeError(
  23974. 'If request is made from ReadableStream, mode should be "same-origin" or "cors"'
  23975. )
  23976. }
  23977. // 3. Set this’s request’s use-CORS-preflight flag.
  23978. request.useCORSPreflightFlag = true
  23979. }
  23980. // 39. Let finalBody be inputOrInitBody.
  23981. let finalBody = inputOrInitBody
  23982. // 40. If initBody is null and inputBody is non-null, then:
  23983. if (initBody == null && inputBody != null) {
  23984. // 1. If input is unusable, then throw a TypeError.
  23985. if (util.isDisturbed(inputBody.stream) || inputBody.stream.locked) {
  23986. throw new TypeError(
  23987. 'Cannot construct a Request with a Request object that has already been used.'
  23988. )
  23989. }
  23990. // 2. Set finalBody to the result of creating a proxy for inputBody.
  23991. if (!TransformStream) {
  23992. TransformStream = (__nccwpck_require__(5356).TransformStream)
  23993. }
  23994. // https://streams.spec.whatwg.org/#readablestream-create-a-proxy
  23995. const identityTransform = new TransformStream()
  23996. inputBody.stream.pipeThrough(identityTransform)
  23997. finalBody = {
  23998. source: inputBody.source,
  23999. length: inputBody.length,
  24000. stream: identityTransform.readable
  24001. }
  24002. }
  24003. // 41. Set this’s request’s body to finalBody.
  24004. this[kState].body = finalBody
  24005. }
  24006. // Returns request’s HTTP method, which is "GET" by default.
  24007. get method () {
  24008. webidl.brandCheck(this, Request)
  24009. // The method getter steps are to return this’s request’s method.
  24010. return this[kState].method
  24011. }
  24012. // Returns the URL of request as a string.
  24013. get url () {
  24014. webidl.brandCheck(this, Request)
  24015. // The url getter steps are to return this’s request’s URL, serialized.
  24016. return URLSerializer(this[kState].url)
  24017. }
  24018. // Returns a Headers object consisting of the headers associated with request.
  24019. // Note that headers added in the network layer by the user agent will not
  24020. // be accounted for in this object, e.g., the "Host" header.
  24021. get headers () {
  24022. webidl.brandCheck(this, Request)
  24023. // The headers getter steps are to return this’s headers.
  24024. return this[kHeaders]
  24025. }
  24026. // Returns the kind of resource requested by request, e.g., "document"
  24027. // or "script".
  24028. get destination () {
  24029. webidl.brandCheck(this, Request)
  24030. // The destination getter are to return this’s request’s destination.
  24031. return this[kState].destination
  24032. }
  24033. // Returns the referrer of request. Its value can be a same-origin URL if
  24034. // explicitly set in init, the empty string to indicate no referrer, and
  24035. // "about:client" when defaulting to the global’s default. This is used
  24036. // during fetching to determine the value of the `Referer` header of the
  24037. // request being made.
  24038. get referrer () {
  24039. webidl.brandCheck(this, Request)
  24040. // 1. If this’s request’s referrer is "no-referrer", then return the
  24041. // empty string.
  24042. if (this[kState].referrer === 'no-referrer') {
  24043. return ''
  24044. }
  24045. // 2. If this’s request’s referrer is "client", then return
  24046. // "about:client".
  24047. if (this[kState].referrer === 'client') {
  24048. return 'about:client'
  24049. }
  24050. // Return this’s request’s referrer, serialized.
  24051. return this[kState].referrer.toString()
  24052. }
  24053. // Returns the referrer policy associated with request.
  24054. // This is used during fetching to compute the value of the request’s
  24055. // referrer.
  24056. get referrerPolicy () {
  24057. webidl.brandCheck(this, Request)
  24058. // The referrerPolicy getter steps are to return this’s request’s referrer policy.
  24059. return this[kState].referrerPolicy
  24060. }
  24061. // Returns the mode associated with request, which is a string indicating
  24062. // whether the request will use CORS, or will be restricted to same-origin
  24063. // URLs.
  24064. get mode () {
  24065. webidl.brandCheck(this, Request)
  24066. // The mode getter steps are to return this’s request’s mode.
  24067. return this[kState].mode
  24068. }
  24069. // Returns the credentials mode associated with request,
  24070. // which is a string indicating whether credentials will be sent with the
  24071. // request always, never, or only when sent to a same-origin URL.
  24072. get credentials () {
  24073. // The credentials getter steps are to return this’s request’s credentials mode.
  24074. return this[kState].credentials
  24075. }
  24076. // Returns the cache mode associated with request,
  24077. // which is a string indicating how the request will
  24078. // interact with the browser’s cache when fetching.
  24079. get cache () {
  24080. webidl.brandCheck(this, Request)
  24081. // The cache getter steps are to return this’s request’s cache mode.
  24082. return this[kState].cache
  24083. }
  24084. // Returns the redirect mode associated with request,
  24085. // which is a string indicating how redirects for the
  24086. // request will be handled during fetching. A request
  24087. // will follow redirects by default.
  24088. get redirect () {
  24089. webidl.brandCheck(this, Request)
  24090. // The redirect getter steps are to return this’s request’s redirect mode.
  24091. return this[kState].redirect
  24092. }
  24093. // Returns request’s subresource integrity metadata, which is a
  24094. // cryptographic hash of the resource being fetched. Its value
  24095. // consists of multiple hashes separated by whitespace. [SRI]
  24096. get integrity () {
  24097. webidl.brandCheck(this, Request)
  24098. // The integrity getter steps are to return this’s request’s integrity
  24099. // metadata.
  24100. return this[kState].integrity
  24101. }
  24102. // Returns a boolean indicating whether or not request can outlive the
  24103. // global in which it was created.
  24104. get keepalive () {
  24105. webidl.brandCheck(this, Request)
  24106. // The keepalive getter steps are to return this’s request’s keepalive.
  24107. return this[kState].keepalive
  24108. }
  24109. // Returns a boolean indicating whether or not request is for a reload
  24110. // navigation.
  24111. get isReloadNavigation () {
  24112. webidl.brandCheck(this, Request)
  24113. // The isReloadNavigation getter steps are to return true if this’s
  24114. // request’s reload-navigation flag is set; otherwise false.
  24115. return this[kState].reloadNavigation
  24116. }
  24117. // Returns a boolean indicating whether or not request is for a history
  24118. // navigation (a.k.a. back-foward navigation).
  24119. get isHistoryNavigation () {
  24120. webidl.brandCheck(this, Request)
  24121. // The isHistoryNavigation getter steps are to return true if this’s request’s
  24122. // history-navigation flag is set; otherwise false.
  24123. return this[kState].historyNavigation
  24124. }
  24125. // Returns the signal associated with request, which is an AbortSignal
  24126. // object indicating whether or not request has been aborted, and its
  24127. // abort event handler.
  24128. get signal () {
  24129. webidl.brandCheck(this, Request)
  24130. // The signal getter steps are to return this’s signal.
  24131. return this[kSignal]
  24132. }
  24133. get body () {
  24134. webidl.brandCheck(this, Request)
  24135. return this[kState].body ? this[kState].body.stream : null
  24136. }
  24137. get bodyUsed () {
  24138. webidl.brandCheck(this, Request)
  24139. return !!this[kState].body && util.isDisturbed(this[kState].body.stream)
  24140. }
  24141. get duplex () {
  24142. webidl.brandCheck(this, Request)
  24143. return 'half'
  24144. }
  24145. // Returns a clone of request.
  24146. clone () {
  24147. webidl.brandCheck(this, Request)
  24148. // 1. If this is unusable, then throw a TypeError.
  24149. if (this.bodyUsed || this.body?.locked) {
  24150. throw new TypeError('unusable')
  24151. }
  24152. // 2. Let clonedRequest be the result of cloning this’s request.
  24153. const clonedRequest = cloneRequest(this[kState])
  24154. // 3. Let clonedRequestObject be the result of creating a Request object,
  24155. // given clonedRequest, this’s headers’s guard, and this’s relevant Realm.
  24156. const clonedRequestObject = new Request(kConstruct)
  24157. clonedRequestObject[kState] = clonedRequest
  24158. clonedRequestObject[kRealm] = this[kRealm]
  24159. clonedRequestObject[kHeaders] = new Headers(kConstruct)
  24160. clonedRequestObject[kHeaders][kHeadersList] = clonedRequest.headersList
  24161. clonedRequestObject[kHeaders][kGuard] = this[kHeaders][kGuard]
  24162. clonedRequestObject[kHeaders][kRealm] = this[kHeaders][kRealm]
  24163. // 4. Make clonedRequestObject’s signal follow this’s signal.
  24164. const ac = new AbortController()
  24165. if (this.signal.aborted) {
  24166. ac.abort(this.signal.reason)
  24167. } else {
  24168. util.addAbortListener(
  24169. this.signal,
  24170. () => {
  24171. ac.abort(this.signal.reason)
  24172. }
  24173. )
  24174. }
  24175. clonedRequestObject[kSignal] = ac.signal
  24176. // 4. Return clonedRequestObject.
  24177. return clonedRequestObject
  24178. }
  24179. }
  24180. mixinBody(Request)
  24181. function makeRequest (init) {
  24182. // https://fetch.spec.whatwg.org/#requests
  24183. const request = {
  24184. method: 'GET',
  24185. localURLsOnly: false,
  24186. unsafeRequest: false,
  24187. body: null,
  24188. client: null,
  24189. reservedClient: null,
  24190. replacesClientId: '',
  24191. window: 'client',
  24192. keepalive: false,
  24193. serviceWorkers: 'all',
  24194. initiator: '',
  24195. destination: '',
  24196. priority: null,
  24197. origin: 'client',
  24198. policyContainer: 'client',
  24199. referrer: 'client',
  24200. referrerPolicy: '',
  24201. mode: 'no-cors',
  24202. useCORSPreflightFlag: false,
  24203. credentials: 'same-origin',
  24204. useCredentials: false,
  24205. cache: 'default',
  24206. redirect: 'follow',
  24207. integrity: '',
  24208. cryptoGraphicsNonceMetadata: '',
  24209. parserMetadata: '',
  24210. reloadNavigation: false,
  24211. historyNavigation: false,
  24212. userActivation: false,
  24213. taintedOrigin: false,
  24214. redirectCount: 0,
  24215. responseTainting: 'basic',
  24216. preventNoCacheCacheControlHeaderModification: false,
  24217. done: false,
  24218. timingAllowFailed: false,
  24219. ...init,
  24220. headersList: init.headersList
  24221. ? new HeadersList(init.headersList)
  24222. : new HeadersList()
  24223. }
  24224. request.url = request.urlList[0]
  24225. return request
  24226. }
  24227. // https://fetch.spec.whatwg.org/#concept-request-clone
  24228. function cloneRequest (request) {
  24229. // To clone a request request, run these steps:
  24230. // 1. Let newRequest be a copy of request, except for its body.
  24231. const newRequest = makeRequest({ ...request, body: null })
  24232. // 2. If request’s body is non-null, set newRequest’s body to the
  24233. // result of cloning request’s body.
  24234. if (request.body != null) {
  24235. newRequest.body = cloneBody(request.body)
  24236. }
  24237. // 3. Return newRequest.
  24238. return newRequest
  24239. }
  24240. Object.defineProperties(Request.prototype, {
  24241. method: kEnumerableProperty,
  24242. url: kEnumerableProperty,
  24243. headers: kEnumerableProperty,
  24244. redirect: kEnumerableProperty,
  24245. clone: kEnumerableProperty,
  24246. signal: kEnumerableProperty,
  24247. duplex: kEnumerableProperty,
  24248. destination: kEnumerableProperty,
  24249. body: kEnumerableProperty,
  24250. bodyUsed: kEnumerableProperty,
  24251. isHistoryNavigation: kEnumerableProperty,
  24252. isReloadNavigation: kEnumerableProperty,
  24253. keepalive: kEnumerableProperty,
  24254. integrity: kEnumerableProperty,
  24255. cache: kEnumerableProperty,
  24256. credentials: kEnumerableProperty,
  24257. attribute: kEnumerableProperty,
  24258. referrerPolicy: kEnumerableProperty,
  24259. referrer: kEnumerableProperty,
  24260. mode: kEnumerableProperty,
  24261. [Symbol.toStringTag]: {
  24262. value: 'Request',
  24263. configurable: true
  24264. }
  24265. })
  24266. webidl.converters.Request = webidl.interfaceConverter(
  24267. Request
  24268. )
  24269. // https://fetch.spec.whatwg.org/#requestinfo
  24270. webidl.converters.RequestInfo = function (V) {
  24271. if (typeof V === 'string') {
  24272. return webidl.converters.USVString(V)
  24273. }
  24274. if (V instanceof Request) {
  24275. return webidl.converters.Request(V)
  24276. }
  24277. return webidl.converters.USVString(V)
  24278. }
  24279. webidl.converters.AbortSignal = webidl.interfaceConverter(
  24280. AbortSignal
  24281. )
  24282. // https://fetch.spec.whatwg.org/#requestinit
  24283. webidl.converters.RequestInit = webidl.dictionaryConverter([
  24284. {
  24285. key: 'method',
  24286. converter: webidl.converters.ByteString
  24287. },
  24288. {
  24289. key: 'headers',
  24290. converter: webidl.converters.HeadersInit
  24291. },
  24292. {
  24293. key: 'body',
  24294. converter: webidl.nullableConverter(
  24295. webidl.converters.BodyInit
  24296. )
  24297. },
  24298. {
  24299. key: 'referrer',
  24300. converter: webidl.converters.USVString
  24301. },
  24302. {
  24303. key: 'referrerPolicy',
  24304. converter: webidl.converters.DOMString,
  24305. // https://w3c.github.io/webappsec-referrer-policy/#referrer-policy
  24306. allowedValues: referrerPolicy
  24307. },
  24308. {
  24309. key: 'mode',
  24310. converter: webidl.converters.DOMString,
  24311. // https://fetch.spec.whatwg.org/#concept-request-mode
  24312. allowedValues: requestMode
  24313. },
  24314. {
  24315. key: 'credentials',
  24316. converter: webidl.converters.DOMString,
  24317. // https://fetch.spec.whatwg.org/#requestcredentials
  24318. allowedValues: requestCredentials
  24319. },
  24320. {
  24321. key: 'cache',
  24322. converter: webidl.converters.DOMString,
  24323. // https://fetch.spec.whatwg.org/#requestcache
  24324. allowedValues: requestCache
  24325. },
  24326. {
  24327. key: 'redirect',
  24328. converter: webidl.converters.DOMString,
  24329. // https://fetch.spec.whatwg.org/#requestredirect
  24330. allowedValues: requestRedirect
  24331. },
  24332. {
  24333. key: 'integrity',
  24334. converter: webidl.converters.DOMString
  24335. },
  24336. {
  24337. key: 'keepalive',
  24338. converter: webidl.converters.boolean
  24339. },
  24340. {
  24341. key: 'signal',
  24342. converter: webidl.nullableConverter(
  24343. (signal) => webidl.converters.AbortSignal(
  24344. signal,
  24345. { strict: false }
  24346. )
  24347. )
  24348. },
  24349. {
  24350. key: 'window',
  24351. converter: webidl.converters.any
  24352. },
  24353. {
  24354. key: 'duplex',
  24355. converter: webidl.converters.DOMString,
  24356. allowedValues: requestDuplex
  24357. }
  24358. ])
  24359. module.exports = { Request, makeRequest }
  24360. /***/ }),
  24361. /***/ 7823:
  24362. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  24363. "use strict";
  24364. const { Headers, HeadersList, fill } = __nccwpck_require__(554)
  24365. const { extractBody, cloneBody, mixinBody } = __nccwpck_require__(9990)
  24366. const util = __nccwpck_require__(3983)
  24367. const { kEnumerableProperty } = util
  24368. const {
  24369. isValidReasonPhrase,
  24370. isCancelled,
  24371. isAborted,
  24372. isBlobLike,
  24373. serializeJavascriptValueToJSONString,
  24374. isErrorLike,
  24375. isomorphicEncode
  24376. } = __nccwpck_require__(2538)
  24377. const {
  24378. redirectStatusSet,
  24379. nullBodyStatus,
  24380. DOMException
  24381. } = __nccwpck_require__(1037)
  24382. const { kState, kHeaders, kGuard, kRealm } = __nccwpck_require__(5861)
  24383. const { webidl } = __nccwpck_require__(1744)
  24384. const { FormData } = __nccwpck_require__(2015)
  24385. const { getGlobalOrigin } = __nccwpck_require__(1246)
  24386. const { URLSerializer } = __nccwpck_require__(685)
  24387. const { kHeadersList, kConstruct } = __nccwpck_require__(2785)
  24388. const assert = __nccwpck_require__(9491)
  24389. const { types } = __nccwpck_require__(3837)
  24390. const ReadableStream = globalThis.ReadableStream || (__nccwpck_require__(5356).ReadableStream)
  24391. const textEncoder = new TextEncoder('utf-8')
  24392. // https://fetch.spec.whatwg.org/#response-class
  24393. class Response {
  24394. // Creates network error Response.
  24395. static error () {
  24396. // TODO
  24397. const relevantRealm = { settingsObject: {} }
  24398. // The static error() method steps are to return the result of creating a
  24399. // Response object, given a new network error, "immutable", and this’s
  24400. // relevant Realm.
  24401. const responseObject = new Response()
  24402. responseObject[kState] = makeNetworkError()
  24403. responseObject[kRealm] = relevantRealm
  24404. responseObject[kHeaders][kHeadersList] = responseObject[kState].headersList
  24405. responseObject[kHeaders][kGuard] = 'immutable'
  24406. responseObject[kHeaders][kRealm] = relevantRealm
  24407. return responseObject
  24408. }
  24409. // https://fetch.spec.whatwg.org/#dom-response-json
  24410. static json (data, init = {}) {
  24411. webidl.argumentLengthCheck(arguments, 1, { header: 'Response.json' })
  24412. if (init !== null) {
  24413. init = webidl.converters.ResponseInit(init)
  24414. }
  24415. // 1. Let bytes the result of running serialize a JavaScript value to JSON bytes on data.
  24416. const bytes = textEncoder.encode(
  24417. serializeJavascriptValueToJSONString(data)
  24418. )
  24419. // 2. Let body be the result of extracting bytes.
  24420. const body = extractBody(bytes)
  24421. // 3. Let responseObject be the result of creating a Response object, given a new response,
  24422. // "response", and this’s relevant Realm.
  24423. const relevantRealm = { settingsObject: {} }
  24424. const responseObject = new Response()
  24425. responseObject[kRealm] = relevantRealm
  24426. responseObject[kHeaders][kGuard] = 'response'
  24427. responseObject[kHeaders][kRealm] = relevantRealm
  24428. // 4. Perform initialize a response given responseObject, init, and (body, "application/json").
  24429. initializeResponse(responseObject, init, { body: body[0], type: 'application/json' })
  24430. // 5. Return responseObject.
  24431. return responseObject
  24432. }
  24433. // Creates a redirect Response that redirects to url with status status.
  24434. static redirect (url, status = 302) {
  24435. const relevantRealm = { settingsObject: {} }
  24436. webidl.argumentLengthCheck(arguments, 1, { header: 'Response.redirect' })
  24437. url = webidl.converters.USVString(url)
  24438. status = webidl.converters['unsigned short'](status)
  24439. // 1. Let parsedURL be the result of parsing url with current settings
  24440. // object’s API base URL.
  24441. // 2. If parsedURL is failure, then throw a TypeError.
  24442. // TODO: base-URL?
  24443. let parsedURL
  24444. try {
  24445. parsedURL = new URL(url, getGlobalOrigin())
  24446. } catch (err) {
  24447. throw Object.assign(new TypeError('Failed to parse URL from ' + url), {
  24448. cause: err
  24449. })
  24450. }
  24451. // 3. If status is not a redirect status, then throw a RangeError.
  24452. if (!redirectStatusSet.has(status)) {
  24453. throw new RangeError('Invalid status code ' + status)
  24454. }
  24455. // 4. Let responseObject be the result of creating a Response object,
  24456. // given a new response, "immutable", and this’s relevant Realm.
  24457. const responseObject = new Response()
  24458. responseObject[kRealm] = relevantRealm
  24459. responseObject[kHeaders][kGuard] = 'immutable'
  24460. responseObject[kHeaders][kRealm] = relevantRealm
  24461. // 5. Set responseObject’s response’s status to status.
  24462. responseObject[kState].status = status
  24463. // 6. Let value be parsedURL, serialized and isomorphic encoded.
  24464. const value = isomorphicEncode(URLSerializer(parsedURL))
  24465. // 7. Append `Location`/value to responseObject’s response’s header list.
  24466. responseObject[kState].headersList.append('location', value)
  24467. // 8. Return responseObject.
  24468. return responseObject
  24469. }
  24470. // https://fetch.spec.whatwg.org/#dom-response
  24471. constructor (body = null, init = {}) {
  24472. if (body !== null) {
  24473. body = webidl.converters.BodyInit(body)
  24474. }
  24475. init = webidl.converters.ResponseInit(init)
  24476. // TODO
  24477. this[kRealm] = { settingsObject: {} }
  24478. // 1. Set this’s response to a new response.
  24479. this[kState] = makeResponse({})
  24480. // 2. Set this’s headers to a new Headers object with this’s relevant
  24481. // Realm, whose header list is this’s response’s header list and guard
  24482. // is "response".
  24483. this[kHeaders] = new Headers(kConstruct)
  24484. this[kHeaders][kGuard] = 'response'
  24485. this[kHeaders][kHeadersList] = this[kState].headersList
  24486. this[kHeaders][kRealm] = this[kRealm]
  24487. // 3. Let bodyWithType be null.
  24488. let bodyWithType = null
  24489. // 4. If body is non-null, then set bodyWithType to the result of extracting body.
  24490. if (body != null) {
  24491. const [extractedBody, type] = extractBody(body)
  24492. bodyWithType = { body: extractedBody, type }
  24493. }
  24494. // 5. Perform initialize a response given this, init, and bodyWithType.
  24495. initializeResponse(this, init, bodyWithType)
  24496. }
  24497. // Returns response’s type, e.g., "cors".
  24498. get type () {
  24499. webidl.brandCheck(this, Response)
  24500. // The type getter steps are to return this’s response’s type.
  24501. return this[kState].type
  24502. }
  24503. // Returns response’s URL, if it has one; otherwise the empty string.
  24504. get url () {
  24505. webidl.brandCheck(this, Response)
  24506. const urlList = this[kState].urlList
  24507. // The url getter steps are to return the empty string if this’s
  24508. // response’s URL is null; otherwise this’s response’s URL,
  24509. // serialized with exclude fragment set to true.
  24510. const url = urlList[urlList.length - 1] ?? null
  24511. if (url === null) {
  24512. return ''
  24513. }
  24514. return URLSerializer(url, true)
  24515. }
  24516. // Returns whether response was obtained through a redirect.
  24517. get redirected () {
  24518. webidl.brandCheck(this, Response)
  24519. // The redirected getter steps are to return true if this’s response’s URL
  24520. // list has more than one item; otherwise false.
  24521. return this[kState].urlList.length > 1
  24522. }
  24523. // Returns response’s status.
  24524. get status () {
  24525. webidl.brandCheck(this, Response)
  24526. // The status getter steps are to return this’s response’s status.
  24527. return this[kState].status
  24528. }
  24529. // Returns whether response’s status is an ok status.
  24530. get ok () {
  24531. webidl.brandCheck(this, Response)
  24532. // The ok getter steps are to return true if this’s response’s status is an
  24533. // ok status; otherwise false.
  24534. return this[kState].status >= 200 && this[kState].status <= 299
  24535. }
  24536. // Returns response’s status message.
  24537. get statusText () {
  24538. webidl.brandCheck(this, Response)
  24539. // The statusText getter steps are to return this’s response’s status
  24540. // message.
  24541. return this[kState].statusText
  24542. }
  24543. // Returns response’s headers as Headers.
  24544. get headers () {
  24545. webidl.brandCheck(this, Response)
  24546. // The headers getter steps are to return this’s headers.
  24547. return this[kHeaders]
  24548. }
  24549. get body () {
  24550. webidl.brandCheck(this, Response)
  24551. return this[kState].body ? this[kState].body.stream : null
  24552. }
  24553. get bodyUsed () {
  24554. webidl.brandCheck(this, Response)
  24555. return !!this[kState].body && util.isDisturbed(this[kState].body.stream)
  24556. }
  24557. // Returns a clone of response.
  24558. clone () {
  24559. webidl.brandCheck(this, Response)
  24560. // 1. If this is unusable, then throw a TypeError.
  24561. if (this.bodyUsed || (this.body && this.body.locked)) {
  24562. throw webidl.errors.exception({
  24563. header: 'Response.clone',
  24564. message: 'Body has already been consumed.'
  24565. })
  24566. }
  24567. // 2. Let clonedResponse be the result of cloning this’s response.
  24568. const clonedResponse = cloneResponse(this[kState])
  24569. // 3. Return the result of creating a Response object, given
  24570. // clonedResponse, this’s headers’s guard, and this’s relevant Realm.
  24571. const clonedResponseObject = new Response()
  24572. clonedResponseObject[kState] = clonedResponse
  24573. clonedResponseObject[kRealm] = this[kRealm]
  24574. clonedResponseObject[kHeaders][kHeadersList] = clonedResponse.headersList
  24575. clonedResponseObject[kHeaders][kGuard] = this[kHeaders][kGuard]
  24576. clonedResponseObject[kHeaders][kRealm] = this[kHeaders][kRealm]
  24577. return clonedResponseObject
  24578. }
  24579. }
  24580. mixinBody(Response)
  24581. Object.defineProperties(Response.prototype, {
  24582. type: kEnumerableProperty,
  24583. url: kEnumerableProperty,
  24584. status: kEnumerableProperty,
  24585. ok: kEnumerableProperty,
  24586. redirected: kEnumerableProperty,
  24587. statusText: kEnumerableProperty,
  24588. headers: kEnumerableProperty,
  24589. clone: kEnumerableProperty,
  24590. body: kEnumerableProperty,
  24591. bodyUsed: kEnumerableProperty,
  24592. [Symbol.toStringTag]: {
  24593. value: 'Response',
  24594. configurable: true
  24595. }
  24596. })
  24597. Object.defineProperties(Response, {
  24598. json: kEnumerableProperty,
  24599. redirect: kEnumerableProperty,
  24600. error: kEnumerableProperty
  24601. })
  24602. // https://fetch.spec.whatwg.org/#concept-response-clone
  24603. function cloneResponse (response) {
  24604. // To clone a response response, run these steps:
  24605. // 1. If response is a filtered response, then return a new identical
  24606. // filtered response whose internal response is a clone of response’s
  24607. // internal response.
  24608. if (response.internalResponse) {
  24609. return filterResponse(
  24610. cloneResponse(response.internalResponse),
  24611. response.type
  24612. )
  24613. }
  24614. // 2. Let newResponse be a copy of response, except for its body.
  24615. const newResponse = makeResponse({ ...response, body: null })
  24616. // 3. If response’s body is non-null, then set newResponse’s body to the
  24617. // result of cloning response’s body.
  24618. if (response.body != null) {
  24619. newResponse.body = cloneBody(response.body)
  24620. }
  24621. // 4. Return newResponse.
  24622. return newResponse
  24623. }
  24624. function makeResponse (init) {
  24625. return {
  24626. aborted: false,
  24627. rangeRequested: false,
  24628. timingAllowPassed: false,
  24629. requestIncludesCredentials: false,
  24630. type: 'default',
  24631. status: 200,
  24632. timingInfo: null,
  24633. cacheState: '',
  24634. statusText: '',
  24635. ...init,
  24636. headersList: init.headersList
  24637. ? new HeadersList(init.headersList)
  24638. : new HeadersList(),
  24639. urlList: init.urlList ? [...init.urlList] : []
  24640. }
  24641. }
  24642. function makeNetworkError (reason) {
  24643. const isError = isErrorLike(reason)
  24644. return makeResponse({
  24645. type: 'error',
  24646. status: 0,
  24647. error: isError
  24648. ? reason
  24649. : new Error(reason ? String(reason) : reason),
  24650. aborted: reason && reason.name === 'AbortError'
  24651. })
  24652. }
  24653. function makeFilteredResponse (response, state) {
  24654. state = {
  24655. internalResponse: response,
  24656. ...state
  24657. }
  24658. return new Proxy(response, {
  24659. get (target, p) {
  24660. return p in state ? state[p] : target[p]
  24661. },
  24662. set (target, p, value) {
  24663. assert(!(p in state))
  24664. target[p] = value
  24665. return true
  24666. }
  24667. })
  24668. }
  24669. // https://fetch.spec.whatwg.org/#concept-filtered-response
  24670. function filterResponse (response, type) {
  24671. // Set response to the following filtered response with response as its
  24672. // internal response, depending on request’s response tainting:
  24673. if (type === 'basic') {
  24674. // A basic filtered response is a filtered response whose type is "basic"
  24675. // and header list excludes any headers in internal response’s header list
  24676. // whose name is a forbidden response-header name.
  24677. // Note: undici does not implement forbidden response-header names
  24678. return makeFilteredResponse(response, {
  24679. type: 'basic',
  24680. headersList: response.headersList
  24681. })
  24682. } else if (type === 'cors') {
  24683. // A CORS filtered response is a filtered response whose type is "cors"
  24684. // and header list excludes any headers in internal response’s header
  24685. // list whose name is not a CORS-safelisted response-header name, given
  24686. // internal response’s CORS-exposed header-name list.
  24687. // Note: undici does not implement CORS-safelisted response-header names
  24688. return makeFilteredResponse(response, {
  24689. type: 'cors',
  24690. headersList: response.headersList
  24691. })
  24692. } else if (type === 'opaque') {
  24693. // An opaque filtered response is a filtered response whose type is
  24694. // "opaque", URL list is the empty list, status is 0, status message
  24695. // is the empty byte sequence, header list is empty, and body is null.
  24696. return makeFilteredResponse(response, {
  24697. type: 'opaque',
  24698. urlList: Object.freeze([]),
  24699. status: 0,
  24700. statusText: '',
  24701. body: null
  24702. })
  24703. } else if (type === 'opaqueredirect') {
  24704. // An opaque-redirect filtered response is a filtered response whose type
  24705. // is "opaqueredirect", status is 0, status message is the empty byte
  24706. // sequence, header list is empty, and body is null.
  24707. return makeFilteredResponse(response, {
  24708. type: 'opaqueredirect',
  24709. status: 0,
  24710. statusText: '',
  24711. headersList: [],
  24712. body: null
  24713. })
  24714. } else {
  24715. assert(false)
  24716. }
  24717. }
  24718. // https://fetch.spec.whatwg.org/#appropriate-network-error
  24719. function makeAppropriateNetworkError (fetchParams, err = null) {
  24720. // 1. Assert: fetchParams is canceled.
  24721. assert(isCancelled(fetchParams))
  24722. // 2. Return an aborted network error if fetchParams is aborted;
  24723. // otherwise return a network error.
  24724. return isAborted(fetchParams)
  24725. ? makeNetworkError(Object.assign(new DOMException('The operation was aborted.', 'AbortError'), { cause: err }))
  24726. : makeNetworkError(Object.assign(new DOMException('Request was cancelled.'), { cause: err }))
  24727. }
  24728. // https://whatpr.org/fetch/1392.html#initialize-a-response
  24729. function initializeResponse (response, init, body) {
  24730. // 1. If init["status"] is not in the range 200 to 599, inclusive, then
  24731. // throw a RangeError.
  24732. if (init.status !== null && (init.status < 200 || init.status > 599)) {
  24733. throw new RangeError('init["status"] must be in the range of 200 to 599, inclusive.')
  24734. }
  24735. // 2. If init["statusText"] does not match the reason-phrase token production,
  24736. // then throw a TypeError.
  24737. if ('statusText' in init && init.statusText != null) {
  24738. // See, https://datatracker.ietf.org/doc/html/rfc7230#section-3.1.2:
  24739. // reason-phrase = *( HTAB / SP / VCHAR / obs-text )
  24740. if (!isValidReasonPhrase(String(init.statusText))) {
  24741. throw new TypeError('Invalid statusText')
  24742. }
  24743. }
  24744. // 3. Set response’s response’s status to init["status"].
  24745. if ('status' in init && init.status != null) {
  24746. response[kState].status = init.status
  24747. }
  24748. // 4. Set response’s response’s status message to init["statusText"].
  24749. if ('statusText' in init && init.statusText != null) {
  24750. response[kState].statusText = init.statusText
  24751. }
  24752. // 5. If init["headers"] exists, then fill response’s headers with init["headers"].
  24753. if ('headers' in init && init.headers != null) {
  24754. fill(response[kHeaders], init.headers)
  24755. }
  24756. // 6. If body was given, then:
  24757. if (body) {
  24758. // 1. If response's status is a null body status, then throw a TypeError.
  24759. if (nullBodyStatus.includes(response.status)) {
  24760. throw webidl.errors.exception({
  24761. header: 'Response constructor',
  24762. message: 'Invalid response status code ' + response.status
  24763. })
  24764. }
  24765. // 2. Set response's body to body's body.
  24766. response[kState].body = body.body
  24767. // 3. If body's type is non-null and response's header list does not contain
  24768. // `Content-Type`, then append (`Content-Type`, body's type) to response's header list.
  24769. if (body.type != null && !response[kState].headersList.contains('Content-Type')) {
  24770. response[kState].headersList.append('content-type', body.type)
  24771. }
  24772. }
  24773. }
  24774. webidl.converters.ReadableStream = webidl.interfaceConverter(
  24775. ReadableStream
  24776. )
  24777. webidl.converters.FormData = webidl.interfaceConverter(
  24778. FormData
  24779. )
  24780. webidl.converters.URLSearchParams = webidl.interfaceConverter(
  24781. URLSearchParams
  24782. )
  24783. // https://fetch.spec.whatwg.org/#typedefdef-xmlhttprequestbodyinit
  24784. webidl.converters.XMLHttpRequestBodyInit = function (V) {
  24785. if (typeof V === 'string') {
  24786. return webidl.converters.USVString(V)
  24787. }
  24788. if (isBlobLike(V)) {
  24789. return webidl.converters.Blob(V, { strict: false })
  24790. }
  24791. if (types.isArrayBuffer(V) || types.isTypedArray(V) || types.isDataView(V)) {
  24792. return webidl.converters.BufferSource(V)
  24793. }
  24794. if (util.isFormDataLike(V)) {
  24795. return webidl.converters.FormData(V, { strict: false })
  24796. }
  24797. if (V instanceof URLSearchParams) {
  24798. return webidl.converters.URLSearchParams(V)
  24799. }
  24800. return webidl.converters.DOMString(V)
  24801. }
  24802. // https://fetch.spec.whatwg.org/#bodyinit
  24803. webidl.converters.BodyInit = function (V) {
  24804. if (V instanceof ReadableStream) {
  24805. return webidl.converters.ReadableStream(V)
  24806. }
  24807. // Note: the spec doesn't include async iterables,
  24808. // this is an undici extension.
  24809. if (V?.[Symbol.asyncIterator]) {
  24810. return V
  24811. }
  24812. return webidl.converters.XMLHttpRequestBodyInit(V)
  24813. }
  24814. webidl.converters.ResponseInit = webidl.dictionaryConverter([
  24815. {
  24816. key: 'status',
  24817. converter: webidl.converters['unsigned short'],
  24818. defaultValue: 200
  24819. },
  24820. {
  24821. key: 'statusText',
  24822. converter: webidl.converters.ByteString,
  24823. defaultValue: ''
  24824. },
  24825. {
  24826. key: 'headers',
  24827. converter: webidl.converters.HeadersInit
  24828. }
  24829. ])
  24830. module.exports = {
  24831. makeNetworkError,
  24832. makeResponse,
  24833. makeAppropriateNetworkError,
  24834. filterResponse,
  24835. Response,
  24836. cloneResponse
  24837. }
  24838. /***/ }),
  24839. /***/ 5861:
  24840. /***/ ((module) => {
  24841. "use strict";
  24842. module.exports = {
  24843. kUrl: Symbol('url'),
  24844. kHeaders: Symbol('headers'),
  24845. kSignal: Symbol('signal'),
  24846. kState: Symbol('state'),
  24847. kGuard: Symbol('guard'),
  24848. kRealm: Symbol('realm')
  24849. }
  24850. /***/ }),
  24851. /***/ 2538:
  24852. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  24853. "use strict";
  24854. const { redirectStatusSet, referrerPolicySet: referrerPolicyTokens, badPortsSet } = __nccwpck_require__(1037)
  24855. const { getGlobalOrigin } = __nccwpck_require__(1246)
  24856. const { performance } = __nccwpck_require__(4074)
  24857. const { isBlobLike, toUSVString, ReadableStreamFrom } = __nccwpck_require__(3983)
  24858. const assert = __nccwpck_require__(9491)
  24859. const { isUint8Array } = __nccwpck_require__(9830)
  24860. let supportedHashes = []
  24861. // https://nodejs.org/api/crypto.html#determining-if-crypto-support-is-unavailable
  24862. /** @type {import('crypto')|undefined} */
  24863. let crypto
  24864. try {
  24865. crypto = __nccwpck_require__(6113)
  24866. const possibleRelevantHashes = ['sha256', 'sha384', 'sha512']
  24867. supportedHashes = crypto.getHashes().filter((hash) => possibleRelevantHashes.includes(hash))
  24868. /* c8 ignore next 3 */
  24869. } catch {
  24870. }
  24871. function responseURL (response) {
  24872. // https://fetch.spec.whatwg.org/#responses
  24873. // A response has an associated URL. It is a pointer to the last URL
  24874. // in response’s URL list and null if response’s URL list is empty.
  24875. const urlList = response.urlList
  24876. const length = urlList.length
  24877. return length === 0 ? null : urlList[length - 1].toString()
  24878. }
  24879. // https://fetch.spec.whatwg.org/#concept-response-location-url
  24880. function responseLocationURL (response, requestFragment) {
  24881. // 1. If response’s status is not a redirect status, then return null.
  24882. if (!redirectStatusSet.has(response.status)) {
  24883. return null
  24884. }
  24885. // 2. Let location be the result of extracting header list values given
  24886. // `Location` and response’s header list.
  24887. let location = response.headersList.get('location')
  24888. // 3. If location is a header value, then set location to the result of
  24889. // parsing location with response’s URL.
  24890. if (location !== null && isValidHeaderValue(location)) {
  24891. location = new URL(location, responseURL(response))
  24892. }
  24893. // 4. If location is a URL whose fragment is null, then set location’s
  24894. // fragment to requestFragment.
  24895. if (location && !location.hash) {
  24896. location.hash = requestFragment
  24897. }
  24898. // 5. Return location.
  24899. return location
  24900. }
  24901. /** @returns {URL} */
  24902. function requestCurrentURL (request) {
  24903. return request.urlList[request.urlList.length - 1]
  24904. }
  24905. function requestBadPort (request) {
  24906. // 1. Let url be request’s current URL.
  24907. const url = requestCurrentURL(request)
  24908. // 2. If url’s scheme is an HTTP(S) scheme and url’s port is a bad port,
  24909. // then return blocked.
  24910. if (urlIsHttpHttpsScheme(url) && badPortsSet.has(url.port)) {
  24911. return 'blocked'
  24912. }
  24913. // 3. Return allowed.
  24914. return 'allowed'
  24915. }
  24916. function isErrorLike (object) {
  24917. return object instanceof Error || (
  24918. object?.constructor?.name === 'Error' ||
  24919. object?.constructor?.name === 'DOMException'
  24920. )
  24921. }
  24922. // Check whether |statusText| is a ByteString and
  24923. // matches the Reason-Phrase token production.
  24924. // RFC 2616: https://tools.ietf.org/html/rfc2616
  24925. // RFC 7230: https://tools.ietf.org/html/rfc7230
  24926. // "reason-phrase = *( HTAB / SP / VCHAR / obs-text )"
  24927. // https://github.com/chromium/chromium/blob/94.0.4604.1/third_party/blink/renderer/core/fetch/response.cc#L116
  24928. function isValidReasonPhrase (statusText) {
  24929. for (let i = 0; i < statusText.length; ++i) {
  24930. const c = statusText.charCodeAt(i)
  24931. if (
  24932. !(
  24933. (
  24934. c === 0x09 || // HTAB
  24935. (c >= 0x20 && c <= 0x7e) || // SP / VCHAR
  24936. (c >= 0x80 && c <= 0xff)
  24937. ) // obs-text
  24938. )
  24939. ) {
  24940. return false
  24941. }
  24942. }
  24943. return true
  24944. }
  24945. /**
  24946. * @see https://tools.ietf.org/html/rfc7230#section-3.2.6
  24947. * @param {number} c
  24948. */
  24949. function isTokenCharCode (c) {
  24950. switch (c) {
  24951. case 0x22:
  24952. case 0x28:
  24953. case 0x29:
  24954. case 0x2c:
  24955. case 0x2f:
  24956. case 0x3a:
  24957. case 0x3b:
  24958. case 0x3c:
  24959. case 0x3d:
  24960. case 0x3e:
  24961. case 0x3f:
  24962. case 0x40:
  24963. case 0x5b:
  24964. case 0x5c:
  24965. case 0x5d:
  24966. case 0x7b:
  24967. case 0x7d:
  24968. // DQUOTE and "(),/:;<=>?@[\]{}"
  24969. return false
  24970. default:
  24971. // VCHAR %x21-7E
  24972. return c >= 0x21 && c <= 0x7e
  24973. }
  24974. }
  24975. /**
  24976. * @param {string} characters
  24977. */
  24978. function isValidHTTPToken (characters) {
  24979. if (characters.length === 0) {
  24980. return false
  24981. }
  24982. for (let i = 0; i < characters.length; ++i) {
  24983. if (!isTokenCharCode(characters.charCodeAt(i))) {
  24984. return false
  24985. }
  24986. }
  24987. return true
  24988. }
  24989. /**
  24990. * @see https://fetch.spec.whatwg.org/#header-name
  24991. * @param {string} potentialValue
  24992. */
  24993. function isValidHeaderName (potentialValue) {
  24994. return isValidHTTPToken(potentialValue)
  24995. }
  24996. /**
  24997. * @see https://fetch.spec.whatwg.org/#header-value
  24998. * @param {string} potentialValue
  24999. */
  25000. function isValidHeaderValue (potentialValue) {
  25001. // - Has no leading or trailing HTTP tab or space bytes.
  25002. // - Contains no 0x00 (NUL) or HTTP newline bytes.
  25003. if (
  25004. potentialValue.startsWith('\t') ||
  25005. potentialValue.startsWith(' ') ||
  25006. potentialValue.endsWith('\t') ||
  25007. potentialValue.endsWith(' ')
  25008. ) {
  25009. return false
  25010. }
  25011. if (
  25012. potentialValue.includes('\0') ||
  25013. potentialValue.includes('\r') ||
  25014. potentialValue.includes('\n')
  25015. ) {
  25016. return false
  25017. }
  25018. return true
  25019. }
  25020. // https://w3c.github.io/webappsec-referrer-policy/#set-requests-referrer-policy-on-redirect
  25021. function setRequestReferrerPolicyOnRedirect (request, actualResponse) {
  25022. // Given a request request and a response actualResponse, this algorithm
  25023. // updates request’s referrer policy according to the Referrer-Policy
  25024. // header (if any) in actualResponse.
  25025. // 1. Let policy be the result of executing § 8.1 Parse a referrer policy
  25026. // from a Referrer-Policy header on actualResponse.
  25027. // 8.1 Parse a referrer policy from a Referrer-Policy header
  25028. // 1. Let policy-tokens be the result of extracting header list values given `Referrer-Policy` and response’s header list.
  25029. const { headersList } = actualResponse
  25030. // 2. Let policy be the empty string.
  25031. // 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.
  25032. // 4. Return policy.
  25033. const policyHeader = (headersList.get('referrer-policy') ?? '').split(',')
  25034. // Note: As the referrer-policy can contain multiple policies
  25035. // separated by comma, we need to loop through all of them
  25036. // and pick the first valid one.
  25037. // Ref: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Referrer-Policy#specify_a_fallback_policy
  25038. let policy = ''
  25039. if (policyHeader.length > 0) {
  25040. // The right-most policy takes precedence.
  25041. // The left-most policy is the fallback.
  25042. for (let i = policyHeader.length; i !== 0; i--) {
  25043. const token = policyHeader[i - 1].trim()
  25044. if (referrerPolicyTokens.has(token)) {
  25045. policy = token
  25046. break
  25047. }
  25048. }
  25049. }
  25050. // 2. If policy is not the empty string, then set request’s referrer policy to policy.
  25051. if (policy !== '') {
  25052. request.referrerPolicy = policy
  25053. }
  25054. }
  25055. // https://fetch.spec.whatwg.org/#cross-origin-resource-policy-check
  25056. function crossOriginResourcePolicyCheck () {
  25057. // TODO
  25058. return 'allowed'
  25059. }
  25060. // https://fetch.spec.whatwg.org/#concept-cors-check
  25061. function corsCheck () {
  25062. // TODO
  25063. return 'success'
  25064. }
  25065. // https://fetch.spec.whatwg.org/#concept-tao-check
  25066. function TAOCheck () {
  25067. // TODO
  25068. return 'success'
  25069. }
  25070. function appendFetchMetadata (httpRequest) {
  25071. // https://w3c.github.io/webappsec-fetch-metadata/#sec-fetch-dest-header
  25072. // TODO
  25073. // https://w3c.github.io/webappsec-fetch-metadata/#sec-fetch-mode-header
  25074. // 1. Assert: r’s url is a potentially trustworthy URL.
  25075. // TODO
  25076. // 2. Let header be a Structured Header whose value is a token.
  25077. let header = null
  25078. // 3. Set header’s value to r’s mode.
  25079. header = httpRequest.mode
  25080. // 4. Set a structured field value `Sec-Fetch-Mode`/header in r’s header list.
  25081. httpRequest.headersList.set('sec-fetch-mode', header)
  25082. // https://w3c.github.io/webappsec-fetch-metadata/#sec-fetch-site-header
  25083. // TODO
  25084. // https://w3c.github.io/webappsec-fetch-metadata/#sec-fetch-user-header
  25085. // TODO
  25086. }
  25087. // https://fetch.spec.whatwg.org/#append-a-request-origin-header
  25088. function appendRequestOriginHeader (request) {
  25089. // 1. Let serializedOrigin be the result of byte-serializing a request origin with request.
  25090. let serializedOrigin = request.origin
  25091. // 2. If request’s response tainting is "cors" or request’s mode is "websocket", then append (`Origin`, serializedOrigin) to request’s header list.
  25092. if (request.responseTainting === 'cors' || request.mode === 'websocket') {
  25093. if (serializedOrigin) {
  25094. request.headersList.append('origin', serializedOrigin)
  25095. }
  25096. // 3. Otherwise, if request’s method is neither `GET` nor `HEAD`, then:
  25097. } else if (request.method !== 'GET' && request.method !== 'HEAD') {
  25098. // 1. Switch on request’s referrer policy:
  25099. switch (request.referrerPolicy) {
  25100. case 'no-referrer':
  25101. // Set serializedOrigin to `null`.
  25102. serializedOrigin = null
  25103. break
  25104. case 'no-referrer-when-downgrade':
  25105. case 'strict-origin':
  25106. case 'strict-origin-when-cross-origin':
  25107. // 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`.
  25108. if (request.origin && urlHasHttpsScheme(request.origin) && !urlHasHttpsScheme(requestCurrentURL(request))) {
  25109. serializedOrigin = null
  25110. }
  25111. break
  25112. case 'same-origin':
  25113. // If request’s origin is not same origin with request’s current URL’s origin, then set serializedOrigin to `null`.
  25114. if (!sameOrigin(request, requestCurrentURL(request))) {
  25115. serializedOrigin = null
  25116. }
  25117. break
  25118. default:
  25119. // Do nothing.
  25120. }
  25121. if (serializedOrigin) {
  25122. // 2. Append (`Origin`, serializedOrigin) to request’s header list.
  25123. request.headersList.append('origin', serializedOrigin)
  25124. }
  25125. }
  25126. }
  25127. function coarsenedSharedCurrentTime (crossOriginIsolatedCapability) {
  25128. // TODO
  25129. return performance.now()
  25130. }
  25131. // https://fetch.spec.whatwg.org/#create-an-opaque-timing-info
  25132. function createOpaqueTimingInfo (timingInfo) {
  25133. return {
  25134. startTime: timingInfo.startTime ?? 0,
  25135. redirectStartTime: 0,
  25136. redirectEndTime: 0,
  25137. postRedirectStartTime: timingInfo.startTime ?? 0,
  25138. finalServiceWorkerStartTime: 0,
  25139. finalNetworkResponseStartTime: 0,
  25140. finalNetworkRequestStartTime: 0,
  25141. endTime: 0,
  25142. encodedBodySize: 0,
  25143. decodedBodySize: 0,
  25144. finalConnectionTimingInfo: null
  25145. }
  25146. }
  25147. // https://html.spec.whatwg.org/multipage/origin.html#policy-container
  25148. function makePolicyContainer () {
  25149. // Note: the fetch spec doesn't make use of embedder policy or CSP list
  25150. return {
  25151. referrerPolicy: 'strict-origin-when-cross-origin'
  25152. }
  25153. }
  25154. // https://html.spec.whatwg.org/multipage/origin.html#clone-a-policy-container
  25155. function clonePolicyContainer (policyContainer) {
  25156. return {
  25157. referrerPolicy: policyContainer.referrerPolicy
  25158. }
  25159. }
  25160. // https://w3c.github.io/webappsec-referrer-policy/#determine-requests-referrer
  25161. function determineRequestsReferrer (request) {
  25162. // 1. Let policy be request's referrer policy.
  25163. const policy = request.referrerPolicy
  25164. // Note: policy cannot (shouldn't) be null or an empty string.
  25165. assert(policy)
  25166. // 2. Let environment be request’s client.
  25167. let referrerSource = null
  25168. // 3. Switch on request’s referrer:
  25169. if (request.referrer === 'client') {
  25170. // Note: node isn't a browser and doesn't implement document/iframes,
  25171. // so we bypass this step and replace it with our own.
  25172. const globalOrigin = getGlobalOrigin()
  25173. if (!globalOrigin || globalOrigin.origin === 'null') {
  25174. return 'no-referrer'
  25175. }
  25176. // note: we need to clone it as it's mutated
  25177. referrerSource = new URL(globalOrigin)
  25178. } else if (request.referrer instanceof URL) {
  25179. // Let referrerSource be request’s referrer.
  25180. referrerSource = request.referrer
  25181. }
  25182. // 4. Let request’s referrerURL be the result of stripping referrerSource for
  25183. // use as a referrer.
  25184. let referrerURL = stripURLForReferrer(referrerSource)
  25185. // 5. Let referrerOrigin be the result of stripping referrerSource for use as
  25186. // a referrer, with the origin-only flag set to true.
  25187. const referrerOrigin = stripURLForReferrer(referrerSource, true)
  25188. // 6. If the result of serializing referrerURL is a string whose length is
  25189. // greater than 4096, set referrerURL to referrerOrigin.
  25190. if (referrerURL.toString().length > 4096) {
  25191. referrerURL = referrerOrigin
  25192. }
  25193. const areSameOrigin = sameOrigin(request, referrerURL)
  25194. const isNonPotentiallyTrustWorthy = isURLPotentiallyTrustworthy(referrerURL) &&
  25195. !isURLPotentiallyTrustworthy(request.url)
  25196. // 8. Execute the switch statements corresponding to the value of policy:
  25197. switch (policy) {
  25198. case 'origin': return referrerOrigin != null ? referrerOrigin : stripURLForReferrer(referrerSource, true)
  25199. case 'unsafe-url': return referrerURL
  25200. case 'same-origin':
  25201. return areSameOrigin ? referrerOrigin : 'no-referrer'
  25202. case 'origin-when-cross-origin':
  25203. return areSameOrigin ? referrerURL : referrerOrigin
  25204. case 'strict-origin-when-cross-origin': {
  25205. const currentURL = requestCurrentURL(request)
  25206. // 1. If the origin of referrerURL and the origin of request’s current
  25207. // URL are the same, then return referrerURL.
  25208. if (sameOrigin(referrerURL, currentURL)) {
  25209. return referrerURL
  25210. }
  25211. // 2. If referrerURL is a potentially trustworthy URL and request’s
  25212. // current URL is not a potentially trustworthy URL, then return no
  25213. // referrer.
  25214. if (isURLPotentiallyTrustworthy(referrerURL) && !isURLPotentiallyTrustworthy(currentURL)) {
  25215. return 'no-referrer'
  25216. }
  25217. // 3. Return referrerOrigin.
  25218. return referrerOrigin
  25219. }
  25220. case 'strict-origin': // eslint-disable-line
  25221. /**
  25222. * 1. If referrerURL is a potentially trustworthy URL and
  25223. * request’s current URL is not a potentially trustworthy URL,
  25224. * then return no referrer.
  25225. * 2. Return referrerOrigin
  25226. */
  25227. case 'no-referrer-when-downgrade': // eslint-disable-line
  25228. /**
  25229. * 1. If referrerURL is a potentially trustworthy URL and
  25230. * request’s current URL is not a potentially trustworthy URL,
  25231. * then return no referrer.
  25232. * 2. Return referrerOrigin
  25233. */
  25234. default: // eslint-disable-line
  25235. return isNonPotentiallyTrustWorthy ? 'no-referrer' : referrerOrigin
  25236. }
  25237. }
  25238. /**
  25239. * @see https://w3c.github.io/webappsec-referrer-policy/#strip-url
  25240. * @param {URL} url
  25241. * @param {boolean|undefined} originOnly
  25242. */
  25243. function stripURLForReferrer (url, originOnly) {
  25244. // 1. Assert: url is a URL.
  25245. assert(url instanceof URL)
  25246. // 2. If url’s scheme is a local scheme, then return no referrer.
  25247. if (url.protocol === 'file:' || url.protocol === 'about:' || url.protocol === 'blank:') {
  25248. return 'no-referrer'
  25249. }
  25250. // 3. Set url’s username to the empty string.
  25251. url.username = ''
  25252. // 4. Set url’s password to the empty string.
  25253. url.password = ''
  25254. // 5. Set url’s fragment to null.
  25255. url.hash = ''
  25256. // 6. If the origin-only flag is true, then:
  25257. if (originOnly) {
  25258. // 1. Set url’s path to « the empty string ».
  25259. url.pathname = ''
  25260. // 2. Set url’s query to null.
  25261. url.search = ''
  25262. }
  25263. // 7. Return url.
  25264. return url
  25265. }
  25266. function isURLPotentiallyTrustworthy (url) {
  25267. if (!(url instanceof URL)) {
  25268. return false
  25269. }
  25270. // If child of about, return true
  25271. if (url.href === 'about:blank' || url.href === 'about:srcdoc') {
  25272. return true
  25273. }
  25274. // If scheme is data, return true
  25275. if (url.protocol === 'data:') return true
  25276. // If file, return true
  25277. if (url.protocol === 'file:') return true
  25278. return isOriginPotentiallyTrustworthy(url.origin)
  25279. function isOriginPotentiallyTrustworthy (origin) {
  25280. // If origin is explicitly null, return false
  25281. if (origin == null || origin === 'null') return false
  25282. const originAsURL = new URL(origin)
  25283. // If secure, return true
  25284. if (originAsURL.protocol === 'https:' || originAsURL.protocol === 'wss:') {
  25285. return true
  25286. }
  25287. // If localhost or variants, return true
  25288. if (/^127(?:\.[0-9]+){0,2}\.[0-9]+$|^\[(?:0*:)*?:?0*1\]$/.test(originAsURL.hostname) ||
  25289. (originAsURL.hostname === 'localhost' || originAsURL.hostname.includes('localhost.')) ||
  25290. (originAsURL.hostname.endsWith('.localhost'))) {
  25291. return true
  25292. }
  25293. // If any other, return false
  25294. return false
  25295. }
  25296. }
  25297. /**
  25298. * @see https://w3c.github.io/webappsec-subresource-integrity/#does-response-match-metadatalist
  25299. * @param {Uint8Array} bytes
  25300. * @param {string} metadataList
  25301. */
  25302. function bytesMatch (bytes, metadataList) {
  25303. // If node is not built with OpenSSL support, we cannot check
  25304. // a request's integrity, so allow it by default (the spec will
  25305. // allow requests if an invalid hash is given, as precedence).
  25306. /* istanbul ignore if: only if node is built with --without-ssl */
  25307. if (crypto === undefined) {
  25308. return true
  25309. }
  25310. // 1. Let parsedMetadata be the result of parsing metadataList.
  25311. const parsedMetadata = parseMetadata(metadataList)
  25312. // 2. If parsedMetadata is no metadata, return true.
  25313. if (parsedMetadata === 'no metadata') {
  25314. return true
  25315. }
  25316. // 3. If response is not eligible for integrity validation, return false.
  25317. // TODO
  25318. // 4. If parsedMetadata is the empty set, return true.
  25319. if (parsedMetadata.length === 0) {
  25320. return true
  25321. }
  25322. // 5. Let metadata be the result of getting the strongest
  25323. // metadata from parsedMetadata.
  25324. const strongest = getStrongestMetadata(parsedMetadata)
  25325. const metadata = filterMetadataListByAlgorithm(parsedMetadata, strongest)
  25326. // 6. For each item in metadata:
  25327. for (const item of metadata) {
  25328. // 1. Let algorithm be the alg component of item.
  25329. const algorithm = item.algo
  25330. // 2. Let expectedValue be the val component of item.
  25331. const expectedValue = item.hash
  25332. // See https://github.com/web-platform-tests/wpt/commit/e4c5cc7a5e48093220528dfdd1c4012dc3837a0e
  25333. // "be liberal with padding". This is annoying, and it's not even in the spec.
  25334. // 3. Let actualValue be the result of applying algorithm to bytes.
  25335. let actualValue = crypto.createHash(algorithm).update(bytes).digest('base64')
  25336. if (actualValue[actualValue.length - 1] === '=') {
  25337. if (actualValue[actualValue.length - 2] === '=') {
  25338. actualValue = actualValue.slice(0, -2)
  25339. } else {
  25340. actualValue = actualValue.slice(0, -1)
  25341. }
  25342. }
  25343. // 4. If actualValue is a case-sensitive match for expectedValue,
  25344. // return true.
  25345. if (compareBase64Mixed(actualValue, expectedValue)) {
  25346. return true
  25347. }
  25348. }
  25349. // 7. Return false.
  25350. return false
  25351. }
  25352. // https://w3c.github.io/webappsec-subresource-integrity/#grammardef-hash-with-options
  25353. // https://www.w3.org/TR/CSP2/#source-list-syntax
  25354. // https://www.rfc-editor.org/rfc/rfc5234#appendix-B.1
  25355. const parseHashWithOptions = /(?<algo>sha256|sha384|sha512)-((?<hash>[A-Za-z0-9+/]+|[A-Za-z0-9_-]+)={0,2}(?:\s|$)( +[!-~]*)?)?/i
  25356. /**
  25357. * @see https://w3c.github.io/webappsec-subresource-integrity/#parse-metadata
  25358. * @param {string} metadata
  25359. */
  25360. function parseMetadata (metadata) {
  25361. // 1. Let result be the empty set.
  25362. /** @type {{ algo: string, hash: string }[]} */
  25363. const result = []
  25364. // 2. Let empty be equal to true.
  25365. let empty = true
  25366. // 3. For each token returned by splitting metadata on spaces:
  25367. for (const token of metadata.split(' ')) {
  25368. // 1. Set empty to false.
  25369. empty = false
  25370. // 2. Parse token as a hash-with-options.
  25371. const parsedToken = parseHashWithOptions.exec(token)
  25372. // 3. If token does not parse, continue to the next token.
  25373. if (
  25374. parsedToken === null ||
  25375. parsedToken.groups === undefined ||
  25376. parsedToken.groups.algo === undefined
  25377. ) {
  25378. // Note: Chromium blocks the request at this point, but Firefox
  25379. // gives a warning that an invalid integrity was given. The
  25380. // correct behavior is to ignore these, and subsequently not
  25381. // check the integrity of the resource.
  25382. continue
  25383. }
  25384. // 4. Let algorithm be the hash-algo component of token.
  25385. const algorithm = parsedToken.groups.algo.toLowerCase()
  25386. // 5. If algorithm is a hash function recognized by the user
  25387. // agent, add the parsed token to result.
  25388. if (supportedHashes.includes(algorithm)) {
  25389. result.push(parsedToken.groups)
  25390. }
  25391. }
  25392. // 4. Return no metadata if empty is true, otherwise return result.
  25393. if (empty === true) {
  25394. return 'no metadata'
  25395. }
  25396. return result
  25397. }
  25398. /**
  25399. * @param {{ algo: 'sha256' | 'sha384' | 'sha512' }[]} metadataList
  25400. */
  25401. function getStrongestMetadata (metadataList) {
  25402. // Let algorithm be the algo component of the first item in metadataList.
  25403. // Can be sha256
  25404. let algorithm = metadataList[0].algo
  25405. // If the algorithm is sha512, then it is the strongest
  25406. // and we can return immediately
  25407. if (algorithm[3] === '5') {
  25408. return algorithm
  25409. }
  25410. for (let i = 1; i < metadataList.length; ++i) {
  25411. const metadata = metadataList[i]
  25412. // If the algorithm is sha512, then it is the strongest
  25413. // and we can break the loop immediately
  25414. if (metadata.algo[3] === '5') {
  25415. algorithm = 'sha512'
  25416. break
  25417. // If the algorithm is sha384, then a potential sha256 or sha384 is ignored
  25418. } else if (algorithm[3] === '3') {
  25419. continue
  25420. // algorithm is sha256, check if algorithm is sha384 and if so, set it as
  25421. // the strongest
  25422. } else if (metadata.algo[3] === '3') {
  25423. algorithm = 'sha384'
  25424. }
  25425. }
  25426. return algorithm
  25427. }
  25428. function filterMetadataListByAlgorithm (metadataList, algorithm) {
  25429. if (metadataList.length === 1) {
  25430. return metadataList
  25431. }
  25432. let pos = 0
  25433. for (let i = 0; i < metadataList.length; ++i) {
  25434. if (metadataList[i].algo === algorithm) {
  25435. metadataList[pos++] = metadataList[i]
  25436. }
  25437. }
  25438. metadataList.length = pos
  25439. return metadataList
  25440. }
  25441. /**
  25442. * Compares two base64 strings, allowing for base64url
  25443. * in the second string.
  25444. *
  25445. * @param {string} actualValue always base64
  25446. * @param {string} expectedValue base64 or base64url
  25447. * @returns {boolean}
  25448. */
  25449. function compareBase64Mixed (actualValue, expectedValue) {
  25450. if (actualValue.length !== expectedValue.length) {
  25451. return false
  25452. }
  25453. for (let i = 0; i < actualValue.length; ++i) {
  25454. if (actualValue[i] !== expectedValue[i]) {
  25455. if (
  25456. (actualValue[i] === '+' && expectedValue[i] === '-') ||
  25457. (actualValue[i] === '/' && expectedValue[i] === '_')
  25458. ) {
  25459. continue
  25460. }
  25461. return false
  25462. }
  25463. }
  25464. return true
  25465. }
  25466. // https://w3c.github.io/webappsec-upgrade-insecure-requests/#upgrade-request
  25467. function tryUpgradeRequestToAPotentiallyTrustworthyURL (request) {
  25468. // TODO
  25469. }
  25470. /**
  25471. * @link {https://html.spec.whatwg.org/multipage/origin.html#same-origin}
  25472. * @param {URL} A
  25473. * @param {URL} B
  25474. */
  25475. function sameOrigin (A, B) {
  25476. // 1. If A and B are the same opaque origin, then return true.
  25477. if (A.origin === B.origin && A.origin === 'null') {
  25478. return true
  25479. }
  25480. // 2. If A and B are both tuple origins and their schemes,
  25481. // hosts, and port are identical, then return true.
  25482. if (A.protocol === B.protocol && A.hostname === B.hostname && A.port === B.port) {
  25483. return true
  25484. }
  25485. // 3. Return false.
  25486. return false
  25487. }
  25488. function createDeferredPromise () {
  25489. let res
  25490. let rej
  25491. const promise = new Promise((resolve, reject) => {
  25492. res = resolve
  25493. rej = reject
  25494. })
  25495. return { promise, resolve: res, reject: rej }
  25496. }
  25497. function isAborted (fetchParams) {
  25498. return fetchParams.controller.state === 'aborted'
  25499. }
  25500. function isCancelled (fetchParams) {
  25501. return fetchParams.controller.state === 'aborted' ||
  25502. fetchParams.controller.state === 'terminated'
  25503. }
  25504. const normalizeMethodRecord = {
  25505. delete: 'DELETE',
  25506. DELETE: 'DELETE',
  25507. get: 'GET',
  25508. GET: 'GET',
  25509. head: 'HEAD',
  25510. HEAD: 'HEAD',
  25511. options: 'OPTIONS',
  25512. OPTIONS: 'OPTIONS',
  25513. post: 'POST',
  25514. POST: 'POST',
  25515. put: 'PUT',
  25516. PUT: 'PUT'
  25517. }
  25518. // Note: object prototypes should not be able to be referenced. e.g. `Object#hasOwnProperty`.
  25519. Object.setPrototypeOf(normalizeMethodRecord, null)
  25520. /**
  25521. * @see https://fetch.spec.whatwg.org/#concept-method-normalize
  25522. * @param {string} method
  25523. */
  25524. function normalizeMethod (method) {
  25525. return normalizeMethodRecord[method.toLowerCase()] ?? method
  25526. }
  25527. // https://infra.spec.whatwg.org/#serialize-a-javascript-value-to-a-json-string
  25528. function serializeJavascriptValueToJSONString (value) {
  25529. // 1. Let result be ? Call(%JSON.stringify%, undefined, « value »).
  25530. const result = JSON.stringify(value)
  25531. // 2. If result is undefined, then throw a TypeError.
  25532. if (result === undefined) {
  25533. throw new TypeError('Value is not JSON serializable')
  25534. }
  25535. // 3. Assert: result is a string.
  25536. assert(typeof result === 'string')
  25537. // 4. Return result.
  25538. return result
  25539. }
  25540. // https://tc39.es/ecma262/#sec-%25iteratorprototype%25-object
  25541. const esIteratorPrototype = Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]()))
  25542. /**
  25543. * @see https://webidl.spec.whatwg.org/#dfn-iterator-prototype-object
  25544. * @param {() => unknown[]} iterator
  25545. * @param {string} name name of the instance
  25546. * @param {'key'|'value'|'key+value'} kind
  25547. */
  25548. function makeIterator (iterator, name, kind) {
  25549. const object = {
  25550. index: 0,
  25551. kind,
  25552. target: iterator
  25553. }
  25554. const i = {
  25555. next () {
  25556. // 1. Let interface be the interface for which the iterator prototype object exists.
  25557. // 2. Let thisValue be the this value.
  25558. // 3. Let object be ? ToObject(thisValue).
  25559. // 4. If object is a platform object, then perform a security
  25560. // check, passing:
  25561. // 5. If object is not a default iterator object for interface,
  25562. // then throw a TypeError.
  25563. if (Object.getPrototypeOf(this) !== i) {
  25564. throw new TypeError(
  25565. `'next' called on an object that does not implement interface ${name} Iterator.`
  25566. )
  25567. }
  25568. // 6. Let index be object’s index.
  25569. // 7. Let kind be object’s kind.
  25570. // 8. Let values be object’s target's value pairs to iterate over.
  25571. const { index, kind, target } = object
  25572. const values = target()
  25573. // 9. Let len be the length of values.
  25574. const len = values.length
  25575. // 10. If index is greater than or equal to len, then return
  25576. // CreateIterResultObject(undefined, true).
  25577. if (index >= len) {
  25578. return { value: undefined, done: true }
  25579. }
  25580. // 11. Let pair be the entry in values at index index.
  25581. const pair = values[index]
  25582. // 12. Set object’s index to index + 1.
  25583. object.index = index + 1
  25584. // 13. Return the iterator result for pair and kind.
  25585. return iteratorResult(pair, kind)
  25586. },
  25587. // The class string of an iterator prototype object for a given interface is the
  25588. // result of concatenating the identifier of the interface and the string " Iterator".
  25589. [Symbol.toStringTag]: `${name} Iterator`
  25590. }
  25591. // The [[Prototype]] internal slot of an iterator prototype object must be %IteratorPrototype%.
  25592. Object.setPrototypeOf(i, esIteratorPrototype)
  25593. // esIteratorPrototype needs to be the prototype of i
  25594. // which is the prototype of an empty object. Yes, it's confusing.
  25595. return Object.setPrototypeOf({}, i)
  25596. }
  25597. // https://webidl.spec.whatwg.org/#iterator-result
  25598. function iteratorResult (pair, kind) {
  25599. let result
  25600. // 1. Let result be a value determined by the value of kind:
  25601. switch (kind) {
  25602. case 'key': {
  25603. // 1. Let idlKey be pair’s key.
  25604. // 2. Let key be the result of converting idlKey to an
  25605. // ECMAScript value.
  25606. // 3. result is key.
  25607. result = pair[0]
  25608. break
  25609. }
  25610. case 'value': {
  25611. // 1. Let idlValue be pair’s value.
  25612. // 2. Let value be the result of converting idlValue to
  25613. // an ECMAScript value.
  25614. // 3. result is value.
  25615. result = pair[1]
  25616. break
  25617. }
  25618. case 'key+value': {
  25619. // 1. Let idlKey be pair’s key.
  25620. // 2. Let idlValue be pair’s value.
  25621. // 3. Let key be the result of converting idlKey to an
  25622. // ECMAScript value.
  25623. // 4. Let value be the result of converting idlValue to
  25624. // an ECMAScript value.
  25625. // 5. Let array be ! ArrayCreate(2).
  25626. // 6. Call ! CreateDataProperty(array, "0", key).
  25627. // 7. Call ! CreateDataProperty(array, "1", value).
  25628. // 8. result is array.
  25629. result = pair
  25630. break
  25631. }
  25632. }
  25633. // 2. Return CreateIterResultObject(result, false).
  25634. return { value: result, done: false }
  25635. }
  25636. /**
  25637. * @see https://fetch.spec.whatwg.org/#body-fully-read
  25638. */
  25639. async function fullyReadBody (body, processBody, processBodyError) {
  25640. // 1. If taskDestination is null, then set taskDestination to
  25641. // the result of starting a new parallel queue.
  25642. // 2. Let successSteps given a byte sequence bytes be to queue a
  25643. // fetch task to run processBody given bytes, with taskDestination.
  25644. const successSteps = processBody
  25645. // 3. Let errorSteps be to queue a fetch task to run processBodyError,
  25646. // with taskDestination.
  25647. const errorSteps = processBodyError
  25648. // 4. Let reader be the result of getting a reader for body’s stream.
  25649. // If that threw an exception, then run errorSteps with that
  25650. // exception and return.
  25651. let reader
  25652. try {
  25653. reader = body.stream.getReader()
  25654. } catch (e) {
  25655. errorSteps(e)
  25656. return
  25657. }
  25658. // 5. Read all bytes from reader, given successSteps and errorSteps.
  25659. try {
  25660. const result = await readAllBytes(reader)
  25661. successSteps(result)
  25662. } catch (e) {
  25663. errorSteps(e)
  25664. }
  25665. }
  25666. /** @type {ReadableStream} */
  25667. let ReadableStream = globalThis.ReadableStream
  25668. function isReadableStreamLike (stream) {
  25669. if (!ReadableStream) {
  25670. ReadableStream = (__nccwpck_require__(5356).ReadableStream)
  25671. }
  25672. return stream instanceof ReadableStream || (
  25673. stream[Symbol.toStringTag] === 'ReadableStream' &&
  25674. typeof stream.tee === 'function'
  25675. )
  25676. }
  25677. const MAXIMUM_ARGUMENT_LENGTH = 65535
  25678. /**
  25679. * @see https://infra.spec.whatwg.org/#isomorphic-decode
  25680. * @param {number[]|Uint8Array} input
  25681. */
  25682. function isomorphicDecode (input) {
  25683. // 1. To isomorphic decode a byte sequence input, return a string whose code point
  25684. // length is equal to input’s length and whose code points have the same values
  25685. // as the values of input’s bytes, in the same order.
  25686. if (input.length < MAXIMUM_ARGUMENT_LENGTH) {
  25687. return String.fromCharCode(...input)
  25688. }
  25689. return input.reduce((previous, current) => previous + String.fromCharCode(current), '')
  25690. }
  25691. /**
  25692. * @param {ReadableStreamController<Uint8Array>} controller
  25693. */
  25694. function readableStreamClose (controller) {
  25695. try {
  25696. controller.close()
  25697. } catch (err) {
  25698. // TODO: add comment explaining why this error occurs.
  25699. if (!err.message.includes('Controller is already closed')) {
  25700. throw err
  25701. }
  25702. }
  25703. }
  25704. /**
  25705. * @see https://infra.spec.whatwg.org/#isomorphic-encode
  25706. * @param {string} input
  25707. */
  25708. function isomorphicEncode (input) {
  25709. // 1. Assert: input contains no code points greater than U+00FF.
  25710. for (let i = 0; i < input.length; i++) {
  25711. assert(input.charCodeAt(i) <= 0xFF)
  25712. }
  25713. // 2. Return a byte sequence whose length is equal to input’s code
  25714. // point length and whose bytes have the same values as the
  25715. // values of input’s code points, in the same order
  25716. return input
  25717. }
  25718. /**
  25719. * @see https://streams.spec.whatwg.org/#readablestreamdefaultreader-read-all-bytes
  25720. * @see https://streams.spec.whatwg.org/#read-loop
  25721. * @param {ReadableStreamDefaultReader} reader
  25722. */
  25723. async function readAllBytes (reader) {
  25724. const bytes = []
  25725. let byteLength = 0
  25726. while (true) {
  25727. const { done, value: chunk } = await reader.read()
  25728. if (done) {
  25729. // 1. Call successSteps with bytes.
  25730. return Buffer.concat(bytes, byteLength)
  25731. }
  25732. // 1. If chunk is not a Uint8Array object, call failureSteps
  25733. // with a TypeError and abort these steps.
  25734. if (!isUint8Array(chunk)) {
  25735. throw new TypeError('Received non-Uint8Array chunk')
  25736. }
  25737. // 2. Append the bytes represented by chunk to bytes.
  25738. bytes.push(chunk)
  25739. byteLength += chunk.length
  25740. // 3. Read-loop given reader, bytes, successSteps, and failureSteps.
  25741. }
  25742. }
  25743. /**
  25744. * @see https://fetch.spec.whatwg.org/#is-local
  25745. * @param {URL} url
  25746. */
  25747. function urlIsLocal (url) {
  25748. assert('protocol' in url) // ensure it's a url object
  25749. const protocol = url.protocol
  25750. return protocol === 'about:' || protocol === 'blob:' || protocol === 'data:'
  25751. }
  25752. /**
  25753. * @param {string|URL} url
  25754. */
  25755. function urlHasHttpsScheme (url) {
  25756. if (typeof url === 'string') {
  25757. return url.startsWith('https:')
  25758. }
  25759. return url.protocol === 'https:'
  25760. }
  25761. /**
  25762. * @see https://fetch.spec.whatwg.org/#http-scheme
  25763. * @param {URL} url
  25764. */
  25765. function urlIsHttpHttpsScheme (url) {
  25766. assert('protocol' in url) // ensure it's a url object
  25767. const protocol = url.protocol
  25768. return protocol === 'http:' || protocol === 'https:'
  25769. }
  25770. /**
  25771. * Fetch supports node >= 16.8.0, but Object.hasOwn was added in v16.9.0.
  25772. */
  25773. const hasOwn = Object.hasOwn || ((dict, key) => Object.prototype.hasOwnProperty.call(dict, key))
  25774. module.exports = {
  25775. isAborted,
  25776. isCancelled,
  25777. createDeferredPromise,
  25778. ReadableStreamFrom,
  25779. toUSVString,
  25780. tryUpgradeRequestToAPotentiallyTrustworthyURL,
  25781. coarsenedSharedCurrentTime,
  25782. determineRequestsReferrer,
  25783. makePolicyContainer,
  25784. clonePolicyContainer,
  25785. appendFetchMetadata,
  25786. appendRequestOriginHeader,
  25787. TAOCheck,
  25788. corsCheck,
  25789. crossOriginResourcePolicyCheck,
  25790. createOpaqueTimingInfo,
  25791. setRequestReferrerPolicyOnRedirect,
  25792. isValidHTTPToken,
  25793. requestBadPort,
  25794. requestCurrentURL,
  25795. responseURL,
  25796. responseLocationURL,
  25797. isBlobLike,
  25798. isURLPotentiallyTrustworthy,
  25799. isValidReasonPhrase,
  25800. sameOrigin,
  25801. normalizeMethod,
  25802. serializeJavascriptValueToJSONString,
  25803. makeIterator,
  25804. isValidHeaderName,
  25805. isValidHeaderValue,
  25806. hasOwn,
  25807. isErrorLike,
  25808. fullyReadBody,
  25809. bytesMatch,
  25810. isReadableStreamLike,
  25811. readableStreamClose,
  25812. isomorphicEncode,
  25813. isomorphicDecode,
  25814. urlIsLocal,
  25815. urlHasHttpsScheme,
  25816. urlIsHttpHttpsScheme,
  25817. readAllBytes,
  25818. normalizeMethodRecord,
  25819. parseMetadata
  25820. }
  25821. /***/ }),
  25822. /***/ 1744:
  25823. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  25824. "use strict";
  25825. const { types } = __nccwpck_require__(3837)
  25826. const { hasOwn, toUSVString } = __nccwpck_require__(2538)
  25827. /** @type {import('../../types/webidl').Webidl} */
  25828. const webidl = {}
  25829. webidl.converters = {}
  25830. webidl.util = {}
  25831. webidl.errors = {}
  25832. webidl.errors.exception = function (message) {
  25833. return new TypeError(`${message.header}: ${message.message}`)
  25834. }
  25835. webidl.errors.conversionFailed = function (context) {
  25836. const plural = context.types.length === 1 ? '' : ' one of'
  25837. const message =
  25838. `${context.argument} could not be converted to` +
  25839. `${plural}: ${context.types.join(', ')}.`
  25840. return webidl.errors.exception({
  25841. header: context.prefix,
  25842. message
  25843. })
  25844. }
  25845. webidl.errors.invalidArgument = function (context) {
  25846. return webidl.errors.exception({
  25847. header: context.prefix,
  25848. message: `"${context.value}" is an invalid ${context.type}.`
  25849. })
  25850. }
  25851. // https://webidl.spec.whatwg.org/#implements
  25852. webidl.brandCheck = function (V, I, opts = undefined) {
  25853. if (opts?.strict !== false && !(V instanceof I)) {
  25854. throw new TypeError('Illegal invocation')
  25855. } else {
  25856. return V?.[Symbol.toStringTag] === I.prototype[Symbol.toStringTag]
  25857. }
  25858. }
  25859. webidl.argumentLengthCheck = function ({ length }, min, ctx) {
  25860. if (length < min) {
  25861. throw webidl.errors.exception({
  25862. message: `${min} argument${min !== 1 ? 's' : ''} required, ` +
  25863. `but${length ? ' only' : ''} ${length} found.`,
  25864. ...ctx
  25865. })
  25866. }
  25867. }
  25868. webidl.illegalConstructor = function () {
  25869. throw webidl.errors.exception({
  25870. header: 'TypeError',
  25871. message: 'Illegal constructor'
  25872. })
  25873. }
  25874. // https://tc39.es/ecma262/#sec-ecmascript-data-types-and-values
  25875. webidl.util.Type = function (V) {
  25876. switch (typeof V) {
  25877. case 'undefined': return 'Undefined'
  25878. case 'boolean': return 'Boolean'
  25879. case 'string': return 'String'
  25880. case 'symbol': return 'Symbol'
  25881. case 'number': return 'Number'
  25882. case 'bigint': return 'BigInt'
  25883. case 'function':
  25884. case 'object': {
  25885. if (V === null) {
  25886. return 'Null'
  25887. }
  25888. return 'Object'
  25889. }
  25890. }
  25891. }
  25892. // https://webidl.spec.whatwg.org/#abstract-opdef-converttoint
  25893. webidl.util.ConvertToInt = function (V, bitLength, signedness, opts = {}) {
  25894. let upperBound
  25895. let lowerBound
  25896. // 1. If bitLength is 64, then:
  25897. if (bitLength === 64) {
  25898. // 1. Let upperBound be 2^53 − 1.
  25899. upperBound = Math.pow(2, 53) - 1
  25900. // 2. If signedness is "unsigned", then let lowerBound be 0.
  25901. if (signedness === 'unsigned') {
  25902. lowerBound = 0
  25903. } else {
  25904. // 3. Otherwise let lowerBound be −2^53 + 1.
  25905. lowerBound = Math.pow(-2, 53) + 1
  25906. }
  25907. } else if (signedness === 'unsigned') {
  25908. // 2. Otherwise, if signedness is "unsigned", then:
  25909. // 1. Let lowerBound be 0.
  25910. lowerBound = 0
  25911. // 2. Let upperBound be 2^bitLength − 1.
  25912. upperBound = Math.pow(2, bitLength) - 1
  25913. } else {
  25914. // 3. Otherwise:
  25915. // 1. Let lowerBound be -2^bitLength − 1.
  25916. lowerBound = Math.pow(-2, bitLength) - 1
  25917. // 2. Let upperBound be 2^bitLength − 1 − 1.
  25918. upperBound = Math.pow(2, bitLength - 1) - 1
  25919. }
  25920. // 4. Let x be ? ToNumber(V).
  25921. let x = Number(V)
  25922. // 5. If x is −0, then set x to +0.
  25923. if (x === 0) {
  25924. x = 0
  25925. }
  25926. // 6. If the conversion is to an IDL type associated
  25927. // with the [EnforceRange] extended attribute, then:
  25928. if (opts.enforceRange === true) {
  25929. // 1. If x is NaN, +∞, or −∞, then throw a TypeError.
  25930. if (
  25931. Number.isNaN(x) ||
  25932. x === Number.POSITIVE_INFINITY ||
  25933. x === Number.NEGATIVE_INFINITY
  25934. ) {
  25935. throw webidl.errors.exception({
  25936. header: 'Integer conversion',
  25937. message: `Could not convert ${V} to an integer.`
  25938. })
  25939. }
  25940. // 2. Set x to IntegerPart(x).
  25941. x = webidl.util.IntegerPart(x)
  25942. // 3. If x < lowerBound or x > upperBound, then
  25943. // throw a TypeError.
  25944. if (x < lowerBound || x > upperBound) {
  25945. throw webidl.errors.exception({
  25946. header: 'Integer conversion',
  25947. message: `Value must be between ${lowerBound}-${upperBound}, got ${x}.`
  25948. })
  25949. }
  25950. // 4. Return x.
  25951. return x
  25952. }
  25953. // 7. If x is not NaN and the conversion is to an IDL
  25954. // type associated with the [Clamp] extended
  25955. // attribute, then:
  25956. if (!Number.isNaN(x) && opts.clamp === true) {
  25957. // 1. Set x to min(max(x, lowerBound), upperBound).
  25958. x = Math.min(Math.max(x, lowerBound), upperBound)
  25959. // 2. Round x to the nearest integer, choosing the
  25960. // even integer if it lies halfway between two,
  25961. // and choosing +0 rather than −0.
  25962. if (Math.floor(x) % 2 === 0) {
  25963. x = Math.floor(x)
  25964. } else {
  25965. x = Math.ceil(x)
  25966. }
  25967. // 3. Return x.
  25968. return x
  25969. }
  25970. // 8. If x is NaN, +0, +∞, or −∞, then return +0.
  25971. if (
  25972. Number.isNaN(x) ||
  25973. (x === 0 && Object.is(0, x)) ||
  25974. x === Number.POSITIVE_INFINITY ||
  25975. x === Number.NEGATIVE_INFINITY
  25976. ) {
  25977. return 0
  25978. }
  25979. // 9. Set x to IntegerPart(x).
  25980. x = webidl.util.IntegerPart(x)
  25981. // 10. Set x to x modulo 2^bitLength.
  25982. x = x % Math.pow(2, bitLength)
  25983. // 11. If signedness is "signed" and x ≥ 2^bitLength − 1,
  25984. // then return x − 2^bitLength.
  25985. if (signedness === 'signed' && x >= Math.pow(2, bitLength) - 1) {
  25986. return x - Math.pow(2, bitLength)
  25987. }
  25988. // 12. Otherwise, return x.
  25989. return x
  25990. }
  25991. // https://webidl.spec.whatwg.org/#abstract-opdef-integerpart
  25992. webidl.util.IntegerPart = function (n) {
  25993. // 1. Let r be floor(abs(n)).
  25994. const r = Math.floor(Math.abs(n))
  25995. // 2. If n < 0, then return -1 × r.
  25996. if (n < 0) {
  25997. return -1 * r
  25998. }
  25999. // 3. Otherwise, return r.
  26000. return r
  26001. }
  26002. // https://webidl.spec.whatwg.org/#es-sequence
  26003. webidl.sequenceConverter = function (converter) {
  26004. return (V) => {
  26005. // 1. If Type(V) is not Object, throw a TypeError.
  26006. if (webidl.util.Type(V) !== 'Object') {
  26007. throw webidl.errors.exception({
  26008. header: 'Sequence',
  26009. message: `Value of type ${webidl.util.Type(V)} is not an Object.`
  26010. })
  26011. }
  26012. // 2. Let method be ? GetMethod(V, @@iterator).
  26013. /** @type {Generator} */
  26014. const method = V?.[Symbol.iterator]?.()
  26015. const seq = []
  26016. // 3. If method is undefined, throw a TypeError.
  26017. if (
  26018. method === undefined ||
  26019. typeof method.next !== 'function'
  26020. ) {
  26021. throw webidl.errors.exception({
  26022. header: 'Sequence',
  26023. message: 'Object is not an iterator.'
  26024. })
  26025. }
  26026. // https://webidl.spec.whatwg.org/#create-sequence-from-iterable
  26027. while (true) {
  26028. const { done, value } = method.next()
  26029. if (done) {
  26030. break
  26031. }
  26032. seq.push(converter(value))
  26033. }
  26034. return seq
  26035. }
  26036. }
  26037. // https://webidl.spec.whatwg.org/#es-to-record
  26038. webidl.recordConverter = function (keyConverter, valueConverter) {
  26039. return (O) => {
  26040. // 1. If Type(O) is not Object, throw a TypeError.
  26041. if (webidl.util.Type(O) !== 'Object') {
  26042. throw webidl.errors.exception({
  26043. header: 'Record',
  26044. message: `Value of type ${webidl.util.Type(O)} is not an Object.`
  26045. })
  26046. }
  26047. // 2. Let result be a new empty instance of record<K, V>.
  26048. const result = {}
  26049. if (!types.isProxy(O)) {
  26050. // Object.keys only returns enumerable properties
  26051. const keys = Object.keys(O)
  26052. for (const key of keys) {
  26053. // 1. Let typedKey be key converted to an IDL value of type K.
  26054. const typedKey = keyConverter(key)
  26055. // 2. Let value be ? Get(O, key).
  26056. // 3. Let typedValue be value converted to an IDL value of type V.
  26057. const typedValue = valueConverter(O[key])
  26058. // 4. Set result[typedKey] to typedValue.
  26059. result[typedKey] = typedValue
  26060. }
  26061. // 5. Return result.
  26062. return result
  26063. }
  26064. // 3. Let keys be ? O.[[OwnPropertyKeys]]().
  26065. const keys = Reflect.ownKeys(O)
  26066. // 4. For each key of keys.
  26067. for (const key of keys) {
  26068. // 1. Let desc be ? O.[[GetOwnProperty]](key).
  26069. const desc = Reflect.getOwnPropertyDescriptor(O, key)
  26070. // 2. If desc is not undefined and desc.[[Enumerable]] is true:
  26071. if (desc?.enumerable) {
  26072. // 1. Let typedKey be key converted to an IDL value of type K.
  26073. const typedKey = keyConverter(key)
  26074. // 2. Let value be ? Get(O, key).
  26075. // 3. Let typedValue be value converted to an IDL value of type V.
  26076. const typedValue = valueConverter(O[key])
  26077. // 4. Set result[typedKey] to typedValue.
  26078. result[typedKey] = typedValue
  26079. }
  26080. }
  26081. // 5. Return result.
  26082. return result
  26083. }
  26084. }
  26085. webidl.interfaceConverter = function (i) {
  26086. return (V, opts = {}) => {
  26087. if (opts.strict !== false && !(V instanceof i)) {
  26088. throw webidl.errors.exception({
  26089. header: i.name,
  26090. message: `Expected ${V} to be an instance of ${i.name}.`
  26091. })
  26092. }
  26093. return V
  26094. }
  26095. }
  26096. webidl.dictionaryConverter = function (converters) {
  26097. return (dictionary) => {
  26098. const type = webidl.util.Type(dictionary)
  26099. const dict = {}
  26100. if (type === 'Null' || type === 'Undefined') {
  26101. return dict
  26102. } else if (type !== 'Object') {
  26103. throw webidl.errors.exception({
  26104. header: 'Dictionary',
  26105. message: `Expected ${dictionary} to be one of: Null, Undefined, Object.`
  26106. })
  26107. }
  26108. for (const options of converters) {
  26109. const { key, defaultValue, required, converter } = options
  26110. if (required === true) {
  26111. if (!hasOwn(dictionary, key)) {
  26112. throw webidl.errors.exception({
  26113. header: 'Dictionary',
  26114. message: `Missing required key "${key}".`
  26115. })
  26116. }
  26117. }
  26118. let value = dictionary[key]
  26119. const hasDefault = hasOwn(options, 'defaultValue')
  26120. // Only use defaultValue if value is undefined and
  26121. // a defaultValue options was provided.
  26122. if (hasDefault && value !== null) {
  26123. value = value ?? defaultValue
  26124. }
  26125. // A key can be optional and have no default value.
  26126. // When this happens, do not perform a conversion,
  26127. // and do not assign the key a value.
  26128. if (required || hasDefault || value !== undefined) {
  26129. value = converter(value)
  26130. if (
  26131. options.allowedValues &&
  26132. !options.allowedValues.includes(value)
  26133. ) {
  26134. throw webidl.errors.exception({
  26135. header: 'Dictionary',
  26136. message: `${value} is not an accepted type. Expected one of ${options.allowedValues.join(', ')}.`
  26137. })
  26138. }
  26139. dict[key] = value
  26140. }
  26141. }
  26142. return dict
  26143. }
  26144. }
  26145. webidl.nullableConverter = function (converter) {
  26146. return (V) => {
  26147. if (V === null) {
  26148. return V
  26149. }
  26150. return converter(V)
  26151. }
  26152. }
  26153. // https://webidl.spec.whatwg.org/#es-DOMString
  26154. webidl.converters.DOMString = function (V, opts = {}) {
  26155. // 1. If V is null and the conversion is to an IDL type
  26156. // associated with the [LegacyNullToEmptyString]
  26157. // extended attribute, then return the DOMString value
  26158. // that represents the empty string.
  26159. if (V === null && opts.legacyNullToEmptyString) {
  26160. return ''
  26161. }
  26162. // 2. Let x be ? ToString(V).
  26163. if (typeof V === 'symbol') {
  26164. throw new TypeError('Could not convert argument of type symbol to string.')
  26165. }
  26166. // 3. Return the IDL DOMString value that represents the
  26167. // same sequence of code units as the one the
  26168. // ECMAScript String value x represents.
  26169. return String(V)
  26170. }
  26171. // https://webidl.spec.whatwg.org/#es-ByteString
  26172. webidl.converters.ByteString = function (V) {
  26173. // 1. Let x be ? ToString(V).
  26174. // Note: DOMString converter perform ? ToString(V)
  26175. const x = webidl.converters.DOMString(V)
  26176. // 2. If the value of any element of x is greater than
  26177. // 255, then throw a TypeError.
  26178. for (let index = 0; index < x.length; index++) {
  26179. if (x.charCodeAt(index) > 255) {
  26180. throw new TypeError(
  26181. 'Cannot convert argument to a ByteString because the character at ' +
  26182. `index ${index} has a value of ${x.charCodeAt(index)} which is greater than 255.`
  26183. )
  26184. }
  26185. }
  26186. // 3. Return an IDL ByteString value whose length is the
  26187. // length of x, and where the value of each element is
  26188. // the value of the corresponding element of x.
  26189. return x
  26190. }
  26191. // https://webidl.spec.whatwg.org/#es-USVString
  26192. webidl.converters.USVString = toUSVString
  26193. // https://webidl.spec.whatwg.org/#es-boolean
  26194. webidl.converters.boolean = function (V) {
  26195. // 1. Let x be the result of computing ToBoolean(V).
  26196. const x = Boolean(V)
  26197. // 2. Return the IDL boolean value that is the one that represents
  26198. // the same truth value as the ECMAScript Boolean value x.
  26199. return x
  26200. }
  26201. // https://webidl.spec.whatwg.org/#es-any
  26202. webidl.converters.any = function (V) {
  26203. return V
  26204. }
  26205. // https://webidl.spec.whatwg.org/#es-long-long
  26206. webidl.converters['long long'] = function (V) {
  26207. // 1. Let x be ? ConvertToInt(V, 64, "signed").
  26208. const x = webidl.util.ConvertToInt(V, 64, 'signed')
  26209. // 2. Return the IDL long long value that represents
  26210. // the same numeric value as x.
  26211. return x
  26212. }
  26213. // https://webidl.spec.whatwg.org/#es-unsigned-long-long
  26214. webidl.converters['unsigned long long'] = function (V) {
  26215. // 1. Let x be ? ConvertToInt(V, 64, "unsigned").
  26216. const x = webidl.util.ConvertToInt(V, 64, 'unsigned')
  26217. // 2. Return the IDL unsigned long long value that
  26218. // represents the same numeric value as x.
  26219. return x
  26220. }
  26221. // https://webidl.spec.whatwg.org/#es-unsigned-long
  26222. webidl.converters['unsigned long'] = function (V) {
  26223. // 1. Let x be ? ConvertToInt(V, 32, "unsigned").
  26224. const x = webidl.util.ConvertToInt(V, 32, 'unsigned')
  26225. // 2. Return the IDL unsigned long value that
  26226. // represents the same numeric value as x.
  26227. return x
  26228. }
  26229. // https://webidl.spec.whatwg.org/#es-unsigned-short
  26230. webidl.converters['unsigned short'] = function (V, opts) {
  26231. // 1. Let x be ? ConvertToInt(V, 16, "unsigned").
  26232. const x = webidl.util.ConvertToInt(V, 16, 'unsigned', opts)
  26233. // 2. Return the IDL unsigned short value that represents
  26234. // the same numeric value as x.
  26235. return x
  26236. }
  26237. // https://webidl.spec.whatwg.org/#idl-ArrayBuffer
  26238. webidl.converters.ArrayBuffer = function (V, opts = {}) {
  26239. // 1. If Type(V) is not Object, or V does not have an
  26240. // [[ArrayBufferData]] internal slot, then throw a
  26241. // TypeError.
  26242. // see: https://tc39.es/ecma262/#sec-properties-of-the-arraybuffer-instances
  26243. // see: https://tc39.es/ecma262/#sec-properties-of-the-sharedarraybuffer-instances
  26244. if (
  26245. webidl.util.Type(V) !== 'Object' ||
  26246. !types.isAnyArrayBuffer(V)
  26247. ) {
  26248. throw webidl.errors.conversionFailed({
  26249. prefix: `${V}`,
  26250. argument: `${V}`,
  26251. types: ['ArrayBuffer']
  26252. })
  26253. }
  26254. // 2. If the conversion is not to an IDL type associated
  26255. // with the [AllowShared] extended attribute, and
  26256. // IsSharedArrayBuffer(V) is true, then throw a
  26257. // TypeError.
  26258. if (opts.allowShared === false && types.isSharedArrayBuffer(V)) {
  26259. throw webidl.errors.exception({
  26260. header: 'ArrayBuffer',
  26261. message: 'SharedArrayBuffer is not allowed.'
  26262. })
  26263. }
  26264. // 3. If the conversion is not to an IDL type associated
  26265. // with the [AllowResizable] extended attribute, and
  26266. // IsResizableArrayBuffer(V) is true, then throw a
  26267. // TypeError.
  26268. // Note: resizable ArrayBuffers are currently a proposal.
  26269. // 4. Return the IDL ArrayBuffer value that is a
  26270. // reference to the same object as V.
  26271. return V
  26272. }
  26273. webidl.converters.TypedArray = function (V, T, opts = {}) {
  26274. // 1. Let T be the IDL type V is being converted to.
  26275. // 2. If Type(V) is not Object, or V does not have a
  26276. // [[TypedArrayName]] internal slot with a value
  26277. // equal to T’s name, then throw a TypeError.
  26278. if (
  26279. webidl.util.Type(V) !== 'Object' ||
  26280. !types.isTypedArray(V) ||
  26281. V.constructor.name !== T.name
  26282. ) {
  26283. throw webidl.errors.conversionFailed({
  26284. prefix: `${T.name}`,
  26285. argument: `${V}`,
  26286. types: [T.name]
  26287. })
  26288. }
  26289. // 3. If the conversion is not to an IDL type associated
  26290. // with the [AllowShared] extended attribute, and
  26291. // IsSharedArrayBuffer(V.[[ViewedArrayBuffer]]) is
  26292. // true, then throw a TypeError.
  26293. if (opts.allowShared === false && types.isSharedArrayBuffer(V.buffer)) {
  26294. throw webidl.errors.exception({
  26295. header: 'ArrayBuffer',
  26296. message: 'SharedArrayBuffer is not allowed.'
  26297. })
  26298. }
  26299. // 4. If the conversion is not to an IDL type associated
  26300. // with the [AllowResizable] extended attribute, and
  26301. // IsResizableArrayBuffer(V.[[ViewedArrayBuffer]]) is
  26302. // true, then throw a TypeError.
  26303. // Note: resizable array buffers are currently a proposal
  26304. // 5. Return the IDL value of type T that is a reference
  26305. // to the same object as V.
  26306. return V
  26307. }
  26308. webidl.converters.DataView = function (V, opts = {}) {
  26309. // 1. If Type(V) is not Object, or V does not have a
  26310. // [[DataView]] internal slot, then throw a TypeError.
  26311. if (webidl.util.Type(V) !== 'Object' || !types.isDataView(V)) {
  26312. throw webidl.errors.exception({
  26313. header: 'DataView',
  26314. message: 'Object is not a DataView.'
  26315. })
  26316. }
  26317. // 2. If the conversion is not to an IDL type associated
  26318. // with the [AllowShared] extended attribute, and
  26319. // IsSharedArrayBuffer(V.[[ViewedArrayBuffer]]) is true,
  26320. // then throw a TypeError.
  26321. if (opts.allowShared === false && types.isSharedArrayBuffer(V.buffer)) {
  26322. throw webidl.errors.exception({
  26323. header: 'ArrayBuffer',
  26324. message: 'SharedArrayBuffer is not allowed.'
  26325. })
  26326. }
  26327. // 3. If the conversion is not to an IDL type associated
  26328. // with the [AllowResizable] extended attribute, and
  26329. // IsResizableArrayBuffer(V.[[ViewedArrayBuffer]]) is
  26330. // true, then throw a TypeError.
  26331. // Note: resizable ArrayBuffers are currently a proposal
  26332. // 4. Return the IDL DataView value that is a reference
  26333. // to the same object as V.
  26334. return V
  26335. }
  26336. // https://webidl.spec.whatwg.org/#BufferSource
  26337. webidl.converters.BufferSource = function (V, opts = {}) {
  26338. if (types.isAnyArrayBuffer(V)) {
  26339. return webidl.converters.ArrayBuffer(V, opts)
  26340. }
  26341. if (types.isTypedArray(V)) {
  26342. return webidl.converters.TypedArray(V, V.constructor)
  26343. }
  26344. if (types.isDataView(V)) {
  26345. return webidl.converters.DataView(V, opts)
  26346. }
  26347. throw new TypeError(`Could not convert ${V} to a BufferSource.`)
  26348. }
  26349. webidl.converters['sequence<ByteString>'] = webidl.sequenceConverter(
  26350. webidl.converters.ByteString
  26351. )
  26352. webidl.converters['sequence<sequence<ByteString>>'] = webidl.sequenceConverter(
  26353. webidl.converters['sequence<ByteString>']
  26354. )
  26355. webidl.converters['record<ByteString, ByteString>'] = webidl.recordConverter(
  26356. webidl.converters.ByteString,
  26357. webidl.converters.ByteString
  26358. )
  26359. module.exports = {
  26360. webidl
  26361. }
  26362. /***/ }),
  26363. /***/ 4854:
  26364. /***/ ((module) => {
  26365. "use strict";
  26366. /**
  26367. * @see https://encoding.spec.whatwg.org/#concept-encoding-get
  26368. * @param {string|undefined} label
  26369. */
  26370. function getEncoding (label) {
  26371. if (!label) {
  26372. return 'failure'
  26373. }
  26374. // 1. Remove any leading and trailing ASCII whitespace from label.
  26375. // 2. If label is an ASCII case-insensitive match for any of the
  26376. // labels listed in the table below, then return the
  26377. // corresponding encoding; otherwise return failure.
  26378. switch (label.trim().toLowerCase()) {
  26379. case 'unicode-1-1-utf-8':
  26380. case 'unicode11utf8':
  26381. case 'unicode20utf8':
  26382. case 'utf-8':
  26383. case 'utf8':
  26384. case 'x-unicode20utf8':
  26385. return 'UTF-8'
  26386. case '866':
  26387. case 'cp866':
  26388. case 'csibm866':
  26389. case 'ibm866':
  26390. return 'IBM866'
  26391. case 'csisolatin2':
  26392. case 'iso-8859-2':
  26393. case 'iso-ir-101':
  26394. case 'iso8859-2':
  26395. case 'iso88592':
  26396. case 'iso_8859-2':
  26397. case 'iso_8859-2:1987':
  26398. case 'l2':
  26399. case 'latin2':
  26400. return 'ISO-8859-2'
  26401. case 'csisolatin3':
  26402. case 'iso-8859-3':
  26403. case 'iso-ir-109':
  26404. case 'iso8859-3':
  26405. case 'iso88593':
  26406. case 'iso_8859-3':
  26407. case 'iso_8859-3:1988':
  26408. case 'l3':
  26409. case 'latin3':
  26410. return 'ISO-8859-3'
  26411. case 'csisolatin4':
  26412. case 'iso-8859-4':
  26413. case 'iso-ir-110':
  26414. case 'iso8859-4':
  26415. case 'iso88594':
  26416. case 'iso_8859-4':
  26417. case 'iso_8859-4:1988':
  26418. case 'l4':
  26419. case 'latin4':
  26420. return 'ISO-8859-4'
  26421. case 'csisolatincyrillic':
  26422. case 'cyrillic':
  26423. case 'iso-8859-5':
  26424. case 'iso-ir-144':
  26425. case 'iso8859-5':
  26426. case 'iso88595':
  26427. case 'iso_8859-5':
  26428. case 'iso_8859-5:1988':
  26429. return 'ISO-8859-5'
  26430. case 'arabic':
  26431. case 'asmo-708':
  26432. case 'csiso88596e':
  26433. case 'csiso88596i':
  26434. case 'csisolatinarabic':
  26435. case 'ecma-114':
  26436. case 'iso-8859-6':
  26437. case 'iso-8859-6-e':
  26438. case 'iso-8859-6-i':
  26439. case 'iso-ir-127':
  26440. case 'iso8859-6':
  26441. case 'iso88596':
  26442. case 'iso_8859-6':
  26443. case 'iso_8859-6:1987':
  26444. return 'ISO-8859-6'
  26445. case 'csisolatingreek':
  26446. case 'ecma-118':
  26447. case 'elot_928':
  26448. case 'greek':
  26449. case 'greek8':
  26450. case 'iso-8859-7':
  26451. case 'iso-ir-126':
  26452. case 'iso8859-7':
  26453. case 'iso88597':
  26454. case 'iso_8859-7':
  26455. case 'iso_8859-7:1987':
  26456. case 'sun_eu_greek':
  26457. return 'ISO-8859-7'
  26458. case 'csiso88598e':
  26459. case 'csisolatinhebrew':
  26460. case 'hebrew':
  26461. case 'iso-8859-8':
  26462. case 'iso-8859-8-e':
  26463. case 'iso-ir-138':
  26464. case 'iso8859-8':
  26465. case 'iso88598':
  26466. case 'iso_8859-8':
  26467. case 'iso_8859-8:1988':
  26468. case 'visual':
  26469. return 'ISO-8859-8'
  26470. case 'csiso88598i':
  26471. case 'iso-8859-8-i':
  26472. case 'logical':
  26473. return 'ISO-8859-8-I'
  26474. case 'csisolatin6':
  26475. case 'iso-8859-10':
  26476. case 'iso-ir-157':
  26477. case 'iso8859-10':
  26478. case 'iso885910':
  26479. case 'l6':
  26480. case 'latin6':
  26481. return 'ISO-8859-10'
  26482. case 'iso-8859-13':
  26483. case 'iso8859-13':
  26484. case 'iso885913':
  26485. return 'ISO-8859-13'
  26486. case 'iso-8859-14':
  26487. case 'iso8859-14':
  26488. case 'iso885914':
  26489. return 'ISO-8859-14'
  26490. case 'csisolatin9':
  26491. case 'iso-8859-15':
  26492. case 'iso8859-15':
  26493. case 'iso885915':
  26494. case 'iso_8859-15':
  26495. case 'l9':
  26496. return 'ISO-8859-15'
  26497. case 'iso-8859-16':
  26498. return 'ISO-8859-16'
  26499. case 'cskoi8r':
  26500. case 'koi':
  26501. case 'koi8':
  26502. case 'koi8-r':
  26503. case 'koi8_r':
  26504. return 'KOI8-R'
  26505. case 'koi8-ru':
  26506. case 'koi8-u':
  26507. return 'KOI8-U'
  26508. case 'csmacintosh':
  26509. case 'mac':
  26510. case 'macintosh':
  26511. case 'x-mac-roman':
  26512. return 'macintosh'
  26513. case 'iso-8859-11':
  26514. case 'iso8859-11':
  26515. case 'iso885911':
  26516. case 'tis-620':
  26517. case 'windows-874':
  26518. return 'windows-874'
  26519. case 'cp1250':
  26520. case 'windows-1250':
  26521. case 'x-cp1250':
  26522. return 'windows-1250'
  26523. case 'cp1251':
  26524. case 'windows-1251':
  26525. case 'x-cp1251':
  26526. return 'windows-1251'
  26527. case 'ansi_x3.4-1968':
  26528. case 'ascii':
  26529. case 'cp1252':
  26530. case 'cp819':
  26531. case 'csisolatin1':
  26532. case 'ibm819':
  26533. case 'iso-8859-1':
  26534. case 'iso-ir-100':
  26535. case 'iso8859-1':
  26536. case 'iso88591':
  26537. case 'iso_8859-1':
  26538. case 'iso_8859-1:1987':
  26539. case 'l1':
  26540. case 'latin1':
  26541. case 'us-ascii':
  26542. case 'windows-1252':
  26543. case 'x-cp1252':
  26544. return 'windows-1252'
  26545. case 'cp1253':
  26546. case 'windows-1253':
  26547. case 'x-cp1253':
  26548. return 'windows-1253'
  26549. case 'cp1254':
  26550. case 'csisolatin5':
  26551. case 'iso-8859-9':
  26552. case 'iso-ir-148':
  26553. case 'iso8859-9':
  26554. case 'iso88599':
  26555. case 'iso_8859-9':
  26556. case 'iso_8859-9:1989':
  26557. case 'l5':
  26558. case 'latin5':
  26559. case 'windows-1254':
  26560. case 'x-cp1254':
  26561. return 'windows-1254'
  26562. case 'cp1255':
  26563. case 'windows-1255':
  26564. case 'x-cp1255':
  26565. return 'windows-1255'
  26566. case 'cp1256':
  26567. case 'windows-1256':
  26568. case 'x-cp1256':
  26569. return 'windows-1256'
  26570. case 'cp1257':
  26571. case 'windows-1257':
  26572. case 'x-cp1257':
  26573. return 'windows-1257'
  26574. case 'cp1258':
  26575. case 'windows-1258':
  26576. case 'x-cp1258':
  26577. return 'windows-1258'
  26578. case 'x-mac-cyrillic':
  26579. case 'x-mac-ukrainian':
  26580. return 'x-mac-cyrillic'
  26581. case 'chinese':
  26582. case 'csgb2312':
  26583. case 'csiso58gb231280':
  26584. case 'gb2312':
  26585. case 'gb_2312':
  26586. case 'gb_2312-80':
  26587. case 'gbk':
  26588. case 'iso-ir-58':
  26589. case 'x-gbk':
  26590. return 'GBK'
  26591. case 'gb18030':
  26592. return 'gb18030'
  26593. case 'big5':
  26594. case 'big5-hkscs':
  26595. case 'cn-big5':
  26596. case 'csbig5':
  26597. case 'x-x-big5':
  26598. return 'Big5'
  26599. case 'cseucpkdfmtjapanese':
  26600. case 'euc-jp':
  26601. case 'x-euc-jp':
  26602. return 'EUC-JP'
  26603. case 'csiso2022jp':
  26604. case 'iso-2022-jp':
  26605. return 'ISO-2022-JP'
  26606. case 'csshiftjis':
  26607. case 'ms932':
  26608. case 'ms_kanji':
  26609. case 'shift-jis':
  26610. case 'shift_jis':
  26611. case 'sjis':
  26612. case 'windows-31j':
  26613. case 'x-sjis':
  26614. return 'Shift_JIS'
  26615. case 'cseuckr':
  26616. case 'csksc56011987':
  26617. case 'euc-kr':
  26618. case 'iso-ir-149':
  26619. case 'korean':
  26620. case 'ks_c_5601-1987':
  26621. case 'ks_c_5601-1989':
  26622. case 'ksc5601':
  26623. case 'ksc_5601':
  26624. case 'windows-949':
  26625. return 'EUC-KR'
  26626. case 'csiso2022kr':
  26627. case 'hz-gb-2312':
  26628. case 'iso-2022-cn':
  26629. case 'iso-2022-cn-ext':
  26630. case 'iso-2022-kr':
  26631. case 'replacement':
  26632. return 'replacement'
  26633. case 'unicodefffe':
  26634. case 'utf-16be':
  26635. return 'UTF-16BE'
  26636. case 'csunicode':
  26637. case 'iso-10646-ucs-2':
  26638. case 'ucs-2':
  26639. case 'unicode':
  26640. case 'unicodefeff':
  26641. case 'utf-16':
  26642. case 'utf-16le':
  26643. return 'UTF-16LE'
  26644. case 'x-user-defined':
  26645. return 'x-user-defined'
  26646. default: return 'failure'
  26647. }
  26648. }
  26649. module.exports = {
  26650. getEncoding
  26651. }
  26652. /***/ }),
  26653. /***/ 1446:
  26654. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  26655. "use strict";
  26656. const {
  26657. staticPropertyDescriptors,
  26658. readOperation,
  26659. fireAProgressEvent
  26660. } = __nccwpck_require__(7530)
  26661. const {
  26662. kState,
  26663. kError,
  26664. kResult,
  26665. kEvents,
  26666. kAborted
  26667. } = __nccwpck_require__(9054)
  26668. const { webidl } = __nccwpck_require__(1744)
  26669. const { kEnumerableProperty } = __nccwpck_require__(3983)
  26670. class FileReader extends EventTarget {
  26671. constructor () {
  26672. super()
  26673. this[kState] = 'empty'
  26674. this[kResult] = null
  26675. this[kError] = null
  26676. this[kEvents] = {
  26677. loadend: null,
  26678. error: null,
  26679. abort: null,
  26680. load: null,
  26681. progress: null,
  26682. loadstart: null
  26683. }
  26684. }
  26685. /**
  26686. * @see https://w3c.github.io/FileAPI/#dfn-readAsArrayBuffer
  26687. * @param {import('buffer').Blob} blob
  26688. */
  26689. readAsArrayBuffer (blob) {
  26690. webidl.brandCheck(this, FileReader)
  26691. webidl.argumentLengthCheck(arguments, 1, { header: 'FileReader.readAsArrayBuffer' })
  26692. blob = webidl.converters.Blob(blob, { strict: false })
  26693. // The readAsArrayBuffer(blob) method, when invoked,
  26694. // must initiate a read operation for blob with ArrayBuffer.
  26695. readOperation(this, blob, 'ArrayBuffer')
  26696. }
  26697. /**
  26698. * @see https://w3c.github.io/FileAPI/#readAsBinaryString
  26699. * @param {import('buffer').Blob} blob
  26700. */
  26701. readAsBinaryString (blob) {
  26702. webidl.brandCheck(this, FileReader)
  26703. webidl.argumentLengthCheck(arguments, 1, { header: 'FileReader.readAsBinaryString' })
  26704. blob = webidl.converters.Blob(blob, { strict: false })
  26705. // The readAsBinaryString(blob) method, when invoked,
  26706. // must initiate a read operation for blob with BinaryString.
  26707. readOperation(this, blob, 'BinaryString')
  26708. }
  26709. /**
  26710. * @see https://w3c.github.io/FileAPI/#readAsDataText
  26711. * @param {import('buffer').Blob} blob
  26712. * @param {string?} encoding
  26713. */
  26714. readAsText (blob, encoding = undefined) {
  26715. webidl.brandCheck(this, FileReader)
  26716. webidl.argumentLengthCheck(arguments, 1, { header: 'FileReader.readAsText' })
  26717. blob = webidl.converters.Blob(blob, { strict: false })
  26718. if (encoding !== undefined) {
  26719. encoding = webidl.converters.DOMString(encoding)
  26720. }
  26721. // The readAsText(blob, encoding) method, when invoked,
  26722. // must initiate a read operation for blob with Text and encoding.
  26723. readOperation(this, blob, 'Text', encoding)
  26724. }
  26725. /**
  26726. * @see https://w3c.github.io/FileAPI/#dfn-readAsDataURL
  26727. * @param {import('buffer').Blob} blob
  26728. */
  26729. readAsDataURL (blob) {
  26730. webidl.brandCheck(this, FileReader)
  26731. webidl.argumentLengthCheck(arguments, 1, { header: 'FileReader.readAsDataURL' })
  26732. blob = webidl.converters.Blob(blob, { strict: false })
  26733. // The readAsDataURL(blob) method, when invoked, must
  26734. // initiate a read operation for blob with DataURL.
  26735. readOperation(this, blob, 'DataURL')
  26736. }
  26737. /**
  26738. * @see https://w3c.github.io/FileAPI/#dfn-abort
  26739. */
  26740. abort () {
  26741. // 1. If this's state is "empty" or if this's state is
  26742. // "done" set this's result to null and terminate
  26743. // this algorithm.
  26744. if (this[kState] === 'empty' || this[kState] === 'done') {
  26745. this[kResult] = null
  26746. return
  26747. }
  26748. // 2. If this's state is "loading" set this's state to
  26749. // "done" and set this's result to null.
  26750. if (this[kState] === 'loading') {
  26751. this[kState] = 'done'
  26752. this[kResult] = null
  26753. }
  26754. // 3. If there are any tasks from this on the file reading
  26755. // task source in an affiliated task queue, then remove
  26756. // those tasks from that task queue.
  26757. this[kAborted] = true
  26758. // 4. Terminate the algorithm for the read method being processed.
  26759. // TODO
  26760. // 5. Fire a progress event called abort at this.
  26761. fireAProgressEvent('abort', this)
  26762. // 6. If this's state is not "loading", fire a progress
  26763. // event called loadend at this.
  26764. if (this[kState] !== 'loading') {
  26765. fireAProgressEvent('loadend', this)
  26766. }
  26767. }
  26768. /**
  26769. * @see https://w3c.github.io/FileAPI/#dom-filereader-readystate
  26770. */
  26771. get readyState () {
  26772. webidl.brandCheck(this, FileReader)
  26773. switch (this[kState]) {
  26774. case 'empty': return this.EMPTY
  26775. case 'loading': return this.LOADING
  26776. case 'done': return this.DONE
  26777. }
  26778. }
  26779. /**
  26780. * @see https://w3c.github.io/FileAPI/#dom-filereader-result
  26781. */
  26782. get result () {
  26783. webidl.brandCheck(this, FileReader)
  26784. // The result attribute’s getter, when invoked, must return
  26785. // this's result.
  26786. return this[kResult]
  26787. }
  26788. /**
  26789. * @see https://w3c.github.io/FileAPI/#dom-filereader-error
  26790. */
  26791. get error () {
  26792. webidl.brandCheck(this, FileReader)
  26793. // The error attribute’s getter, when invoked, must return
  26794. // this's error.
  26795. return this[kError]
  26796. }
  26797. get onloadend () {
  26798. webidl.brandCheck(this, FileReader)
  26799. return this[kEvents].loadend
  26800. }
  26801. set onloadend (fn) {
  26802. webidl.brandCheck(this, FileReader)
  26803. if (this[kEvents].loadend) {
  26804. this.removeEventListener('loadend', this[kEvents].loadend)
  26805. }
  26806. if (typeof fn === 'function') {
  26807. this[kEvents].loadend = fn
  26808. this.addEventListener('loadend', fn)
  26809. } else {
  26810. this[kEvents].loadend = null
  26811. }
  26812. }
  26813. get onerror () {
  26814. webidl.brandCheck(this, FileReader)
  26815. return this[kEvents].error
  26816. }
  26817. set onerror (fn) {
  26818. webidl.brandCheck(this, FileReader)
  26819. if (this[kEvents].error) {
  26820. this.removeEventListener('error', this[kEvents].error)
  26821. }
  26822. if (typeof fn === 'function') {
  26823. this[kEvents].error = fn
  26824. this.addEventListener('error', fn)
  26825. } else {
  26826. this[kEvents].error = null
  26827. }
  26828. }
  26829. get onloadstart () {
  26830. webidl.brandCheck(this, FileReader)
  26831. return this[kEvents].loadstart
  26832. }
  26833. set onloadstart (fn) {
  26834. webidl.brandCheck(this, FileReader)
  26835. if (this[kEvents].loadstart) {
  26836. this.removeEventListener('loadstart', this[kEvents].loadstart)
  26837. }
  26838. if (typeof fn === 'function') {
  26839. this[kEvents].loadstart = fn
  26840. this.addEventListener('loadstart', fn)
  26841. } else {
  26842. this[kEvents].loadstart = null
  26843. }
  26844. }
  26845. get onprogress () {
  26846. webidl.brandCheck(this, FileReader)
  26847. return this[kEvents].progress
  26848. }
  26849. set onprogress (fn) {
  26850. webidl.brandCheck(this, FileReader)
  26851. if (this[kEvents].progress) {
  26852. this.removeEventListener('progress', this[kEvents].progress)
  26853. }
  26854. if (typeof fn === 'function') {
  26855. this[kEvents].progress = fn
  26856. this.addEventListener('progress', fn)
  26857. } else {
  26858. this[kEvents].progress = null
  26859. }
  26860. }
  26861. get onload () {
  26862. webidl.brandCheck(this, FileReader)
  26863. return this[kEvents].load
  26864. }
  26865. set onload (fn) {
  26866. webidl.brandCheck(this, FileReader)
  26867. if (this[kEvents].load) {
  26868. this.removeEventListener('load', this[kEvents].load)
  26869. }
  26870. if (typeof fn === 'function') {
  26871. this[kEvents].load = fn
  26872. this.addEventListener('load', fn)
  26873. } else {
  26874. this[kEvents].load = null
  26875. }
  26876. }
  26877. get onabort () {
  26878. webidl.brandCheck(this, FileReader)
  26879. return this[kEvents].abort
  26880. }
  26881. set onabort (fn) {
  26882. webidl.brandCheck(this, FileReader)
  26883. if (this[kEvents].abort) {
  26884. this.removeEventListener('abort', this[kEvents].abort)
  26885. }
  26886. if (typeof fn === 'function') {
  26887. this[kEvents].abort = fn
  26888. this.addEventListener('abort', fn)
  26889. } else {
  26890. this[kEvents].abort = null
  26891. }
  26892. }
  26893. }
  26894. // https://w3c.github.io/FileAPI/#dom-filereader-empty
  26895. FileReader.EMPTY = FileReader.prototype.EMPTY = 0
  26896. // https://w3c.github.io/FileAPI/#dom-filereader-loading
  26897. FileReader.LOADING = FileReader.prototype.LOADING = 1
  26898. // https://w3c.github.io/FileAPI/#dom-filereader-done
  26899. FileReader.DONE = FileReader.prototype.DONE = 2
  26900. Object.defineProperties(FileReader.prototype, {
  26901. EMPTY: staticPropertyDescriptors,
  26902. LOADING: staticPropertyDescriptors,
  26903. DONE: staticPropertyDescriptors,
  26904. readAsArrayBuffer: kEnumerableProperty,
  26905. readAsBinaryString: kEnumerableProperty,
  26906. readAsText: kEnumerableProperty,
  26907. readAsDataURL: kEnumerableProperty,
  26908. abort: kEnumerableProperty,
  26909. readyState: kEnumerableProperty,
  26910. result: kEnumerableProperty,
  26911. error: kEnumerableProperty,
  26912. onloadstart: kEnumerableProperty,
  26913. onprogress: kEnumerableProperty,
  26914. onload: kEnumerableProperty,
  26915. onabort: kEnumerableProperty,
  26916. onerror: kEnumerableProperty,
  26917. onloadend: kEnumerableProperty,
  26918. [Symbol.toStringTag]: {
  26919. value: 'FileReader',
  26920. writable: false,
  26921. enumerable: false,
  26922. configurable: true
  26923. }
  26924. })
  26925. Object.defineProperties(FileReader, {
  26926. EMPTY: staticPropertyDescriptors,
  26927. LOADING: staticPropertyDescriptors,
  26928. DONE: staticPropertyDescriptors
  26929. })
  26930. module.exports = {
  26931. FileReader
  26932. }
  26933. /***/ }),
  26934. /***/ 5504:
  26935. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  26936. "use strict";
  26937. const { webidl } = __nccwpck_require__(1744)
  26938. const kState = Symbol('ProgressEvent state')
  26939. /**
  26940. * @see https://xhr.spec.whatwg.org/#progressevent
  26941. */
  26942. class ProgressEvent extends Event {
  26943. constructor (type, eventInitDict = {}) {
  26944. type = webidl.converters.DOMString(type)
  26945. eventInitDict = webidl.converters.ProgressEventInit(eventInitDict ?? {})
  26946. super(type, eventInitDict)
  26947. this[kState] = {
  26948. lengthComputable: eventInitDict.lengthComputable,
  26949. loaded: eventInitDict.loaded,
  26950. total: eventInitDict.total
  26951. }
  26952. }
  26953. get lengthComputable () {
  26954. webidl.brandCheck(this, ProgressEvent)
  26955. return this[kState].lengthComputable
  26956. }
  26957. get loaded () {
  26958. webidl.brandCheck(this, ProgressEvent)
  26959. return this[kState].loaded
  26960. }
  26961. get total () {
  26962. webidl.brandCheck(this, ProgressEvent)
  26963. return this[kState].total
  26964. }
  26965. }
  26966. webidl.converters.ProgressEventInit = webidl.dictionaryConverter([
  26967. {
  26968. key: 'lengthComputable',
  26969. converter: webidl.converters.boolean,
  26970. defaultValue: false
  26971. },
  26972. {
  26973. key: 'loaded',
  26974. converter: webidl.converters['unsigned long long'],
  26975. defaultValue: 0
  26976. },
  26977. {
  26978. key: 'total',
  26979. converter: webidl.converters['unsigned long long'],
  26980. defaultValue: 0
  26981. },
  26982. {
  26983. key: 'bubbles',
  26984. converter: webidl.converters.boolean,
  26985. defaultValue: false
  26986. },
  26987. {
  26988. key: 'cancelable',
  26989. converter: webidl.converters.boolean,
  26990. defaultValue: false
  26991. },
  26992. {
  26993. key: 'composed',
  26994. converter: webidl.converters.boolean,
  26995. defaultValue: false
  26996. }
  26997. ])
  26998. module.exports = {
  26999. ProgressEvent
  27000. }
  27001. /***/ }),
  27002. /***/ 9054:
  27003. /***/ ((module) => {
  27004. "use strict";
  27005. module.exports = {
  27006. kState: Symbol('FileReader state'),
  27007. kResult: Symbol('FileReader result'),
  27008. kError: Symbol('FileReader error'),
  27009. kLastProgressEventFired: Symbol('FileReader last progress event fired timestamp'),
  27010. kEvents: Symbol('FileReader events'),
  27011. kAborted: Symbol('FileReader aborted')
  27012. }
  27013. /***/ }),
  27014. /***/ 7530:
  27015. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  27016. "use strict";
  27017. const {
  27018. kState,
  27019. kError,
  27020. kResult,
  27021. kAborted,
  27022. kLastProgressEventFired
  27023. } = __nccwpck_require__(9054)
  27024. const { ProgressEvent } = __nccwpck_require__(5504)
  27025. const { getEncoding } = __nccwpck_require__(4854)
  27026. const { DOMException } = __nccwpck_require__(1037)
  27027. const { serializeAMimeType, parseMIMEType } = __nccwpck_require__(685)
  27028. const { types } = __nccwpck_require__(3837)
  27029. const { StringDecoder } = __nccwpck_require__(1576)
  27030. const { btoa } = __nccwpck_require__(4300)
  27031. /** @type {PropertyDescriptor} */
  27032. const staticPropertyDescriptors = {
  27033. enumerable: true,
  27034. writable: false,
  27035. configurable: false
  27036. }
  27037. /**
  27038. * @see https://w3c.github.io/FileAPI/#readOperation
  27039. * @param {import('./filereader').FileReader} fr
  27040. * @param {import('buffer').Blob} blob
  27041. * @param {string} type
  27042. * @param {string?} encodingName
  27043. */
  27044. function readOperation (fr, blob, type, encodingName) {
  27045. // 1. If fr’s state is "loading", throw an InvalidStateError
  27046. // DOMException.
  27047. if (fr[kState] === 'loading') {
  27048. throw new DOMException('Invalid state', 'InvalidStateError')
  27049. }
  27050. // 2. Set fr’s state to "loading".
  27051. fr[kState] = 'loading'
  27052. // 3. Set fr’s result to null.
  27053. fr[kResult] = null
  27054. // 4. Set fr’s error to null.
  27055. fr[kError] = null
  27056. // 5. Let stream be the result of calling get stream on blob.
  27057. /** @type {import('stream/web').ReadableStream} */
  27058. const stream = blob.stream()
  27059. // 6. Let reader be the result of getting a reader from stream.
  27060. const reader = stream.getReader()
  27061. // 7. Let bytes be an empty byte sequence.
  27062. /** @type {Uint8Array[]} */
  27063. const bytes = []
  27064. // 8. Let chunkPromise be the result of reading a chunk from
  27065. // stream with reader.
  27066. let chunkPromise = reader.read()
  27067. // 9. Let isFirstChunk be true.
  27068. let isFirstChunk = true
  27069. // 10. In parallel, while true:
  27070. // Note: "In parallel" just means non-blocking
  27071. // Note 2: readOperation itself cannot be async as double
  27072. // reading the body would then reject the promise, instead
  27073. // of throwing an error.
  27074. ;(async () => {
  27075. while (!fr[kAborted]) {
  27076. // 1. Wait for chunkPromise to be fulfilled or rejected.
  27077. try {
  27078. const { done, value } = await chunkPromise
  27079. // 2. If chunkPromise is fulfilled, and isFirstChunk is
  27080. // true, queue a task to fire a progress event called
  27081. // loadstart at fr.
  27082. if (isFirstChunk && !fr[kAborted]) {
  27083. queueMicrotask(() => {
  27084. fireAProgressEvent('loadstart', fr)
  27085. })
  27086. }
  27087. // 3. Set isFirstChunk to false.
  27088. isFirstChunk = false
  27089. // 4. If chunkPromise is fulfilled with an object whose
  27090. // done property is false and whose value property is
  27091. // a Uint8Array object, run these steps:
  27092. if (!done && types.isUint8Array(value)) {
  27093. // 1. Let bs be the byte sequence represented by the
  27094. // Uint8Array object.
  27095. // 2. Append bs to bytes.
  27096. bytes.push(value)
  27097. // 3. If roughly 50ms have passed since these steps
  27098. // were last invoked, queue a task to fire a
  27099. // progress event called progress at fr.
  27100. if (
  27101. (
  27102. fr[kLastProgressEventFired] === undefined ||
  27103. Date.now() - fr[kLastProgressEventFired] >= 50
  27104. ) &&
  27105. !fr[kAborted]
  27106. ) {
  27107. fr[kLastProgressEventFired] = Date.now()
  27108. queueMicrotask(() => {
  27109. fireAProgressEvent('progress', fr)
  27110. })
  27111. }
  27112. // 4. Set chunkPromise to the result of reading a
  27113. // chunk from stream with reader.
  27114. chunkPromise = reader.read()
  27115. } else if (done) {
  27116. // 5. Otherwise, if chunkPromise is fulfilled with an
  27117. // object whose done property is true, queue a task
  27118. // to run the following steps and abort this algorithm:
  27119. queueMicrotask(() => {
  27120. // 1. Set fr’s state to "done".
  27121. fr[kState] = 'done'
  27122. // 2. Let result be the result of package data given
  27123. // bytes, type, blob’s type, and encodingName.
  27124. try {
  27125. const result = packageData(bytes, type, blob.type, encodingName)
  27126. // 4. Else:
  27127. if (fr[kAborted]) {
  27128. return
  27129. }
  27130. // 1. Set fr’s result to result.
  27131. fr[kResult] = result
  27132. // 2. Fire a progress event called load at the fr.
  27133. fireAProgressEvent('load', fr)
  27134. } catch (error) {
  27135. // 3. If package data threw an exception error:
  27136. // 1. Set fr’s error to error.
  27137. fr[kError] = error
  27138. // 2. Fire a progress event called error at fr.
  27139. fireAProgressEvent('error', fr)
  27140. }
  27141. // 5. If fr’s state is not "loading", fire a progress
  27142. // event called loadend at the fr.
  27143. if (fr[kState] !== 'loading') {
  27144. fireAProgressEvent('loadend', fr)
  27145. }
  27146. })
  27147. break
  27148. }
  27149. } catch (error) {
  27150. if (fr[kAborted]) {
  27151. return
  27152. }
  27153. // 6. Otherwise, if chunkPromise is rejected with an
  27154. // error error, queue a task to run the following
  27155. // steps and abort this algorithm:
  27156. queueMicrotask(() => {
  27157. // 1. Set fr’s state to "done".
  27158. fr[kState] = 'done'
  27159. // 2. Set fr’s error to error.
  27160. fr[kError] = error
  27161. // 3. Fire a progress event called error at fr.
  27162. fireAProgressEvent('error', fr)
  27163. // 4. If fr’s state is not "loading", fire a progress
  27164. // event called loadend at fr.
  27165. if (fr[kState] !== 'loading') {
  27166. fireAProgressEvent('loadend', fr)
  27167. }
  27168. })
  27169. break
  27170. }
  27171. }
  27172. })()
  27173. }
  27174. /**
  27175. * @see https://w3c.github.io/FileAPI/#fire-a-progress-event
  27176. * @see https://dom.spec.whatwg.org/#concept-event-fire
  27177. * @param {string} e The name of the event
  27178. * @param {import('./filereader').FileReader} reader
  27179. */
  27180. function fireAProgressEvent (e, reader) {
  27181. // The progress event e does not bubble. e.bubbles must be false
  27182. // The progress event e is NOT cancelable. e.cancelable must be false
  27183. const event = new ProgressEvent(e, {
  27184. bubbles: false,
  27185. cancelable: false
  27186. })
  27187. reader.dispatchEvent(event)
  27188. }
  27189. /**
  27190. * @see https://w3c.github.io/FileAPI/#blob-package-data
  27191. * @param {Uint8Array[]} bytes
  27192. * @param {string} type
  27193. * @param {string?} mimeType
  27194. * @param {string?} encodingName
  27195. */
  27196. function packageData (bytes, type, mimeType, encodingName) {
  27197. // 1. A Blob has an associated package data algorithm, given
  27198. // bytes, a type, a optional mimeType, and a optional
  27199. // encodingName, which switches on type and runs the
  27200. // associated steps:
  27201. switch (type) {
  27202. case 'DataURL': {
  27203. // 1. Return bytes as a DataURL [RFC2397] subject to
  27204. // the considerations below:
  27205. // * Use mimeType as part of the Data URL if it is
  27206. // available in keeping with the Data URL
  27207. // specification [RFC2397].
  27208. // * If mimeType is not available return a Data URL
  27209. // without a media-type. [RFC2397].
  27210. // https://datatracker.ietf.org/doc/html/rfc2397#section-3
  27211. // dataurl := "data:" [ mediatype ] [ ";base64" ] "," data
  27212. // mediatype := [ type "/" subtype ] *( ";" parameter )
  27213. // data := *urlchar
  27214. // parameter := attribute "=" value
  27215. let dataURL = 'data:'
  27216. const parsed = parseMIMEType(mimeType || 'application/octet-stream')
  27217. if (parsed !== 'failure') {
  27218. dataURL += serializeAMimeType(parsed)
  27219. }
  27220. dataURL += ';base64,'
  27221. const decoder = new StringDecoder('latin1')
  27222. for (const chunk of bytes) {
  27223. dataURL += btoa(decoder.write(chunk))
  27224. }
  27225. dataURL += btoa(decoder.end())
  27226. return dataURL
  27227. }
  27228. case 'Text': {
  27229. // 1. Let encoding be failure
  27230. let encoding = 'failure'
  27231. // 2. If the encodingName is present, set encoding to the
  27232. // result of getting an encoding from encodingName.
  27233. if (encodingName) {
  27234. encoding = getEncoding(encodingName)
  27235. }
  27236. // 3. If encoding is failure, and mimeType is present:
  27237. if (encoding === 'failure' && mimeType) {
  27238. // 1. Let type be the result of parse a MIME type
  27239. // given mimeType.
  27240. const type = parseMIMEType(mimeType)
  27241. // 2. If type is not failure, set encoding to the result
  27242. // of getting an encoding from type’s parameters["charset"].
  27243. if (type !== 'failure') {
  27244. encoding = getEncoding(type.parameters.get('charset'))
  27245. }
  27246. }
  27247. // 4. If encoding is failure, then set encoding to UTF-8.
  27248. if (encoding === 'failure') {
  27249. encoding = 'UTF-8'
  27250. }
  27251. // 5. Decode bytes using fallback encoding encoding, and
  27252. // return the result.
  27253. return decode(bytes, encoding)
  27254. }
  27255. case 'ArrayBuffer': {
  27256. // Return a new ArrayBuffer whose contents are bytes.
  27257. const sequence = combineByteSequences(bytes)
  27258. return sequence.buffer
  27259. }
  27260. case 'BinaryString': {
  27261. // Return bytes as a binary string, in which every byte
  27262. // is represented by a code unit of equal value [0..255].
  27263. let binaryString = ''
  27264. const decoder = new StringDecoder('latin1')
  27265. for (const chunk of bytes) {
  27266. binaryString += decoder.write(chunk)
  27267. }
  27268. binaryString += decoder.end()
  27269. return binaryString
  27270. }
  27271. }
  27272. }
  27273. /**
  27274. * @see https://encoding.spec.whatwg.org/#decode
  27275. * @param {Uint8Array[]} ioQueue
  27276. * @param {string} encoding
  27277. */
  27278. function decode (ioQueue, encoding) {
  27279. const bytes = combineByteSequences(ioQueue)
  27280. // 1. Let BOMEncoding be the result of BOM sniffing ioQueue.
  27281. const BOMEncoding = BOMSniffing(bytes)
  27282. let slice = 0
  27283. // 2. If BOMEncoding is non-null:
  27284. if (BOMEncoding !== null) {
  27285. // 1. Set encoding to BOMEncoding.
  27286. encoding = BOMEncoding
  27287. // 2. Read three bytes from ioQueue, if BOMEncoding is
  27288. // UTF-8; otherwise read two bytes.
  27289. // (Do nothing with those bytes.)
  27290. slice = BOMEncoding === 'UTF-8' ? 3 : 2
  27291. }
  27292. // 3. Process a queue with an instance of encoding’s
  27293. // decoder, ioQueue, output, and "replacement".
  27294. // 4. Return output.
  27295. const sliced = bytes.slice(slice)
  27296. return new TextDecoder(encoding).decode(sliced)
  27297. }
  27298. /**
  27299. * @see https://encoding.spec.whatwg.org/#bom-sniff
  27300. * @param {Uint8Array} ioQueue
  27301. */
  27302. function BOMSniffing (ioQueue) {
  27303. // 1. Let BOM be the result of peeking 3 bytes from ioQueue,
  27304. // converted to a byte sequence.
  27305. const [a, b, c] = ioQueue
  27306. // 2. For each of the rows in the table below, starting with
  27307. // the first one and going down, if BOM starts with the
  27308. // bytes given in the first column, then return the
  27309. // encoding given in the cell in the second column of that
  27310. // row. Otherwise, return null.
  27311. if (a === 0xEF && b === 0xBB && c === 0xBF) {
  27312. return 'UTF-8'
  27313. } else if (a === 0xFE && b === 0xFF) {
  27314. return 'UTF-16BE'
  27315. } else if (a === 0xFF && b === 0xFE) {
  27316. return 'UTF-16LE'
  27317. }
  27318. return null
  27319. }
  27320. /**
  27321. * @param {Uint8Array[]} sequences
  27322. */
  27323. function combineByteSequences (sequences) {
  27324. const size = sequences.reduce((a, b) => {
  27325. return a + b.byteLength
  27326. }, 0)
  27327. let offset = 0
  27328. return sequences.reduce((a, b) => {
  27329. a.set(b, offset)
  27330. offset += b.byteLength
  27331. return a
  27332. }, new Uint8Array(size))
  27333. }
  27334. module.exports = {
  27335. staticPropertyDescriptors,
  27336. readOperation,
  27337. fireAProgressEvent
  27338. }
  27339. /***/ }),
  27340. /***/ 1892:
  27341. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  27342. "use strict";
  27343. // We include a version number for the Dispatcher API. In case of breaking changes,
  27344. // this version number must be increased to avoid conflicts.
  27345. const globalDispatcher = Symbol.for('undici.globalDispatcher.1')
  27346. const { InvalidArgumentError } = __nccwpck_require__(8045)
  27347. const Agent = __nccwpck_require__(7890)
  27348. if (getGlobalDispatcher() === undefined) {
  27349. setGlobalDispatcher(new Agent())
  27350. }
  27351. function setGlobalDispatcher (agent) {
  27352. if (!agent || typeof agent.dispatch !== 'function') {
  27353. throw new InvalidArgumentError('Argument agent must implement Agent')
  27354. }
  27355. Object.defineProperty(globalThis, globalDispatcher, {
  27356. value: agent,
  27357. writable: true,
  27358. enumerable: false,
  27359. configurable: false
  27360. })
  27361. }
  27362. function getGlobalDispatcher () {
  27363. return globalThis[globalDispatcher]
  27364. }
  27365. module.exports = {
  27366. setGlobalDispatcher,
  27367. getGlobalDispatcher
  27368. }
  27369. /***/ }),
  27370. /***/ 6930:
  27371. /***/ ((module) => {
  27372. "use strict";
  27373. module.exports = class DecoratorHandler {
  27374. constructor (handler) {
  27375. this.handler = handler
  27376. }
  27377. onConnect (...args) {
  27378. return this.handler.onConnect(...args)
  27379. }
  27380. onError (...args) {
  27381. return this.handler.onError(...args)
  27382. }
  27383. onUpgrade (...args) {
  27384. return this.handler.onUpgrade(...args)
  27385. }
  27386. onHeaders (...args) {
  27387. return this.handler.onHeaders(...args)
  27388. }
  27389. onData (...args) {
  27390. return this.handler.onData(...args)
  27391. }
  27392. onComplete (...args) {
  27393. return this.handler.onComplete(...args)
  27394. }
  27395. onBodySent (...args) {
  27396. return this.handler.onBodySent(...args)
  27397. }
  27398. }
  27399. /***/ }),
  27400. /***/ 2860:
  27401. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  27402. "use strict";
  27403. const util = __nccwpck_require__(3983)
  27404. const { kBodyUsed } = __nccwpck_require__(2785)
  27405. const assert = __nccwpck_require__(9491)
  27406. const { InvalidArgumentError } = __nccwpck_require__(8045)
  27407. const EE = __nccwpck_require__(2361)
  27408. const redirectableStatusCodes = [300, 301, 302, 303, 307, 308]
  27409. const kBody = Symbol('body')
  27410. class BodyAsyncIterable {
  27411. constructor (body) {
  27412. this[kBody] = body
  27413. this[kBodyUsed] = false
  27414. }
  27415. async * [Symbol.asyncIterator] () {
  27416. assert(!this[kBodyUsed], 'disturbed')
  27417. this[kBodyUsed] = true
  27418. yield * this[kBody]
  27419. }
  27420. }
  27421. class RedirectHandler {
  27422. constructor (dispatch, maxRedirections, opts, handler) {
  27423. if (maxRedirections != null && (!Number.isInteger(maxRedirections) || maxRedirections < 0)) {
  27424. throw new InvalidArgumentError('maxRedirections must be a positive number')
  27425. }
  27426. util.validateHandler(handler, opts.method, opts.upgrade)
  27427. this.dispatch = dispatch
  27428. this.location = null
  27429. this.abort = null
  27430. this.opts = { ...opts, maxRedirections: 0 } // opts must be a copy
  27431. this.maxRedirections = maxRedirections
  27432. this.handler = handler
  27433. this.history = []
  27434. if (util.isStream(this.opts.body)) {
  27435. // TODO (fix): Provide some way for the user to cache the file to e.g. /tmp
  27436. // so that it can be dispatched again?
  27437. // TODO (fix): Do we need 100-expect support to provide a way to do this properly?
  27438. if (util.bodyLength(this.opts.body) === 0) {
  27439. this.opts.body
  27440. .on('data', function () {
  27441. assert(false)
  27442. })
  27443. }
  27444. if (typeof this.opts.body.readableDidRead !== 'boolean') {
  27445. this.opts.body[kBodyUsed] = false
  27446. EE.prototype.on.call(this.opts.body, 'data', function () {
  27447. this[kBodyUsed] = true
  27448. })
  27449. }
  27450. } else if (this.opts.body && typeof this.opts.body.pipeTo === 'function') {
  27451. // TODO (fix): We can't access ReadableStream internal state
  27452. // to determine whether or not it has been disturbed. This is just
  27453. // a workaround.
  27454. this.opts.body = new BodyAsyncIterable(this.opts.body)
  27455. } else if (
  27456. this.opts.body &&
  27457. typeof this.opts.body !== 'string' &&
  27458. !ArrayBuffer.isView(this.opts.body) &&
  27459. util.isIterable(this.opts.body)
  27460. ) {
  27461. // TODO: Should we allow re-using iterable if !this.opts.idempotent
  27462. // or through some other flag?
  27463. this.opts.body = new BodyAsyncIterable(this.opts.body)
  27464. }
  27465. }
  27466. onConnect (abort) {
  27467. this.abort = abort
  27468. this.handler.onConnect(abort, { history: this.history })
  27469. }
  27470. onUpgrade (statusCode, headers, socket) {
  27471. this.handler.onUpgrade(statusCode, headers, socket)
  27472. }
  27473. onError (error) {
  27474. this.handler.onError(error)
  27475. }
  27476. onHeaders (statusCode, headers, resume, statusText) {
  27477. this.location = this.history.length >= this.maxRedirections || util.isDisturbed(this.opts.body)
  27478. ? null
  27479. : parseLocation(statusCode, headers)
  27480. if (this.opts.origin) {
  27481. this.history.push(new URL(this.opts.path, this.opts.origin))
  27482. }
  27483. if (!this.location) {
  27484. return this.handler.onHeaders(statusCode, headers, resume, statusText)
  27485. }
  27486. const { origin, pathname, search } = util.parseURL(new URL(this.location, this.opts.origin && new URL(this.opts.path, this.opts.origin)))
  27487. const path = search ? `${pathname}${search}` : pathname
  27488. // Remove headers referring to the original URL.
  27489. // By default it is Host only, unless it's a 303 (see below), which removes also all Content-* headers.
  27490. // https://tools.ietf.org/html/rfc7231#section-6.4
  27491. this.opts.headers = cleanRequestHeaders(this.opts.headers, statusCode === 303, this.opts.origin !== origin)
  27492. this.opts.path = path
  27493. this.opts.origin = origin
  27494. this.opts.maxRedirections = 0
  27495. this.opts.query = null
  27496. // https://tools.ietf.org/html/rfc7231#section-6.4.4
  27497. // In case of HTTP 303, always replace method to be either HEAD or GET
  27498. if (statusCode === 303 && this.opts.method !== 'HEAD') {
  27499. this.opts.method = 'GET'
  27500. this.opts.body = null
  27501. }
  27502. }
  27503. onData (chunk) {
  27504. if (this.location) {
  27505. /*
  27506. https://tools.ietf.org/html/rfc7231#section-6.4
  27507. TLDR: undici always ignores 3xx response bodies.
  27508. Redirection is used to serve the requested resource from another URL, so it is assumes that
  27509. no body is generated (and thus can be ignored). Even though generating a body is not prohibited.
  27510. For status 301, 302, 303, 307 and 308 (the latter from RFC 7238), the specs mention that the body usually
  27511. (which means it's optional and not mandated) contain just an hyperlink to the value of
  27512. the Location response header, so the body can be ignored safely.
  27513. For status 300, which is "Multiple Choices", the spec mentions both generating a Location
  27514. response header AND a response body with the other possible location to follow.
  27515. Since the spec explicitily chooses not to specify a format for such body and leave it to
  27516. servers and browsers implementors, we ignore the body as there is no specified way to eventually parse it.
  27517. */
  27518. } else {
  27519. return this.handler.onData(chunk)
  27520. }
  27521. }
  27522. onComplete (trailers) {
  27523. if (this.location) {
  27524. /*
  27525. https://tools.ietf.org/html/rfc7231#section-6.4
  27526. TLDR: undici always ignores 3xx response trailers as they are not expected in case of redirections
  27527. and neither are useful if present.
  27528. See comment on onData method above for more detailed informations.
  27529. */
  27530. this.location = null
  27531. this.abort = null
  27532. this.dispatch(this.opts, this)
  27533. } else {
  27534. this.handler.onComplete(trailers)
  27535. }
  27536. }
  27537. onBodySent (chunk) {
  27538. if (this.handler.onBodySent) {
  27539. this.handler.onBodySent(chunk)
  27540. }
  27541. }
  27542. }
  27543. function parseLocation (statusCode, headers) {
  27544. if (redirectableStatusCodes.indexOf(statusCode) === -1) {
  27545. return null
  27546. }
  27547. for (let i = 0; i < headers.length; i += 2) {
  27548. if (headers[i].toString().toLowerCase() === 'location') {
  27549. return headers[i + 1]
  27550. }
  27551. }
  27552. }
  27553. // https://tools.ietf.org/html/rfc7231#section-6.4.4
  27554. function shouldRemoveHeader (header, removeContent, unknownOrigin) {
  27555. if (header.length === 4) {
  27556. return util.headerNameToString(header) === 'host'
  27557. }
  27558. if (removeContent && util.headerNameToString(header).startsWith('content-')) {
  27559. return true
  27560. }
  27561. if (unknownOrigin && (header.length === 13 || header.length === 6 || header.length === 19)) {
  27562. const name = util.headerNameToString(header)
  27563. return name === 'authorization' || name === 'cookie' || name === 'proxy-authorization'
  27564. }
  27565. return false
  27566. }
  27567. // https://tools.ietf.org/html/rfc7231#section-6.4
  27568. function cleanRequestHeaders (headers, removeContent, unknownOrigin) {
  27569. const ret = []
  27570. if (Array.isArray(headers)) {
  27571. for (let i = 0; i < headers.length; i += 2) {
  27572. if (!shouldRemoveHeader(headers[i], removeContent, unknownOrigin)) {
  27573. ret.push(headers[i], headers[i + 1])
  27574. }
  27575. }
  27576. } else if (headers && typeof headers === 'object') {
  27577. for (const key of Object.keys(headers)) {
  27578. if (!shouldRemoveHeader(key, removeContent, unknownOrigin)) {
  27579. ret.push(key, headers[key])
  27580. }
  27581. }
  27582. } else {
  27583. assert(headers == null, 'headers must be an object or an array')
  27584. }
  27585. return ret
  27586. }
  27587. module.exports = RedirectHandler
  27588. /***/ }),
  27589. /***/ 2286:
  27590. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  27591. const assert = __nccwpck_require__(9491)
  27592. const { kRetryHandlerDefaultRetry } = __nccwpck_require__(2785)
  27593. const { RequestRetryError } = __nccwpck_require__(8045)
  27594. const { isDisturbed, parseHeaders, parseRangeHeader } = __nccwpck_require__(3983)
  27595. function calculateRetryAfterHeader (retryAfter) {
  27596. const current = Date.now()
  27597. const diff = new Date(retryAfter).getTime() - current
  27598. return diff
  27599. }
  27600. class RetryHandler {
  27601. constructor (opts, handlers) {
  27602. const { retryOptions, ...dispatchOpts } = opts
  27603. const {
  27604. // Retry scoped
  27605. retry: retryFn,
  27606. maxRetries,
  27607. maxTimeout,
  27608. minTimeout,
  27609. timeoutFactor,
  27610. // Response scoped
  27611. methods,
  27612. errorCodes,
  27613. retryAfter,
  27614. statusCodes
  27615. } = retryOptions ?? {}
  27616. this.dispatch = handlers.dispatch
  27617. this.handler = handlers.handler
  27618. this.opts = dispatchOpts
  27619. this.abort = null
  27620. this.aborted = false
  27621. this.retryOpts = {
  27622. retry: retryFn ?? RetryHandler[kRetryHandlerDefaultRetry],
  27623. retryAfter: retryAfter ?? true,
  27624. maxTimeout: maxTimeout ?? 30 * 1000, // 30s,
  27625. timeout: minTimeout ?? 500, // .5s
  27626. timeoutFactor: timeoutFactor ?? 2,
  27627. maxRetries: maxRetries ?? 5,
  27628. // What errors we should retry
  27629. methods: methods ?? ['GET', 'HEAD', 'OPTIONS', 'PUT', 'DELETE', 'TRACE'],
  27630. // Indicates which errors to retry
  27631. statusCodes: statusCodes ?? [500, 502, 503, 504, 429],
  27632. // List of errors to retry
  27633. errorCodes: errorCodes ?? [
  27634. 'ECONNRESET',
  27635. 'ECONNREFUSED',
  27636. 'ENOTFOUND',
  27637. 'ENETDOWN',
  27638. 'ENETUNREACH',
  27639. 'EHOSTDOWN',
  27640. 'EHOSTUNREACH',
  27641. 'EPIPE'
  27642. ]
  27643. }
  27644. this.retryCount = 0
  27645. this.start = 0
  27646. this.end = null
  27647. this.etag = null
  27648. this.resume = null
  27649. // Handle possible onConnect duplication
  27650. this.handler.onConnect(reason => {
  27651. this.aborted = true
  27652. if (this.abort) {
  27653. this.abort(reason)
  27654. } else {
  27655. this.reason = reason
  27656. }
  27657. })
  27658. }
  27659. onRequestSent () {
  27660. if (this.handler.onRequestSent) {
  27661. this.handler.onRequestSent()
  27662. }
  27663. }
  27664. onUpgrade (statusCode, headers, socket) {
  27665. if (this.handler.onUpgrade) {
  27666. this.handler.onUpgrade(statusCode, headers, socket)
  27667. }
  27668. }
  27669. onConnect (abort) {
  27670. if (this.aborted) {
  27671. abort(this.reason)
  27672. } else {
  27673. this.abort = abort
  27674. }
  27675. }
  27676. onBodySent (chunk) {
  27677. if (this.handler.onBodySent) return this.handler.onBodySent(chunk)
  27678. }
  27679. static [kRetryHandlerDefaultRetry] (err, { state, opts }, cb) {
  27680. const { statusCode, code, headers } = err
  27681. const { method, retryOptions } = opts
  27682. const {
  27683. maxRetries,
  27684. timeout,
  27685. maxTimeout,
  27686. timeoutFactor,
  27687. statusCodes,
  27688. errorCodes,
  27689. methods
  27690. } = retryOptions
  27691. let { counter, currentTimeout } = state
  27692. currentTimeout =
  27693. currentTimeout != null && currentTimeout > 0 ? currentTimeout : timeout
  27694. // Any code that is not a Undici's originated and allowed to retry
  27695. if (
  27696. code &&
  27697. code !== 'UND_ERR_REQ_RETRY' &&
  27698. code !== 'UND_ERR_SOCKET' &&
  27699. !errorCodes.includes(code)
  27700. ) {
  27701. cb(err)
  27702. return
  27703. }
  27704. // If a set of method are provided and the current method is not in the list
  27705. if (Array.isArray(methods) && !methods.includes(method)) {
  27706. cb(err)
  27707. return
  27708. }
  27709. // If a set of status code are provided and the current status code is not in the list
  27710. if (
  27711. statusCode != null &&
  27712. Array.isArray(statusCodes) &&
  27713. !statusCodes.includes(statusCode)
  27714. ) {
  27715. cb(err)
  27716. return
  27717. }
  27718. // If we reached the max number of retries
  27719. if (counter > maxRetries) {
  27720. cb(err)
  27721. return
  27722. }
  27723. let retryAfterHeader = headers != null && headers['retry-after']
  27724. if (retryAfterHeader) {
  27725. retryAfterHeader = Number(retryAfterHeader)
  27726. retryAfterHeader = isNaN(retryAfterHeader)
  27727. ? calculateRetryAfterHeader(retryAfterHeader)
  27728. : retryAfterHeader * 1e3 // Retry-After is in seconds
  27729. }
  27730. const retryTimeout =
  27731. retryAfterHeader > 0
  27732. ? Math.min(retryAfterHeader, maxTimeout)
  27733. : Math.min(currentTimeout * timeoutFactor ** counter, maxTimeout)
  27734. state.currentTimeout = retryTimeout
  27735. setTimeout(() => cb(null), retryTimeout)
  27736. }
  27737. onHeaders (statusCode, rawHeaders, resume, statusMessage) {
  27738. const headers = parseHeaders(rawHeaders)
  27739. this.retryCount += 1
  27740. if (statusCode >= 300) {
  27741. this.abort(
  27742. new RequestRetryError('Request failed', statusCode, {
  27743. headers,
  27744. count: this.retryCount
  27745. })
  27746. )
  27747. return false
  27748. }
  27749. // Checkpoint for resume from where we left it
  27750. if (this.resume != null) {
  27751. this.resume = null
  27752. if (statusCode !== 206) {
  27753. return true
  27754. }
  27755. const contentRange = parseRangeHeader(headers['content-range'])
  27756. // If no content range
  27757. if (!contentRange) {
  27758. this.abort(
  27759. new RequestRetryError('Content-Range mismatch', statusCode, {
  27760. headers,
  27761. count: this.retryCount
  27762. })
  27763. )
  27764. return false
  27765. }
  27766. // Let's start with a weak etag check
  27767. if (this.etag != null && this.etag !== headers.etag) {
  27768. this.abort(
  27769. new RequestRetryError('ETag mismatch', statusCode, {
  27770. headers,
  27771. count: this.retryCount
  27772. })
  27773. )
  27774. return false
  27775. }
  27776. const { start, size, end = size } = contentRange
  27777. assert(this.start === start, 'content-range mismatch')
  27778. assert(this.end == null || this.end === end, 'content-range mismatch')
  27779. this.resume = resume
  27780. return true
  27781. }
  27782. if (this.end == null) {
  27783. if (statusCode === 206) {
  27784. // First time we receive 206
  27785. const range = parseRangeHeader(headers['content-range'])
  27786. if (range == null) {
  27787. return this.handler.onHeaders(
  27788. statusCode,
  27789. rawHeaders,
  27790. resume,
  27791. statusMessage
  27792. )
  27793. }
  27794. const { start, size, end = size } = range
  27795. assert(
  27796. start != null && Number.isFinite(start) && this.start !== start,
  27797. 'content-range mismatch'
  27798. )
  27799. assert(Number.isFinite(start))
  27800. assert(
  27801. end != null && Number.isFinite(end) && this.end !== end,
  27802. 'invalid content-length'
  27803. )
  27804. this.start = start
  27805. this.end = end
  27806. }
  27807. // We make our best to checkpoint the body for further range headers
  27808. if (this.end == null) {
  27809. const contentLength = headers['content-length']
  27810. this.end = contentLength != null ? Number(contentLength) : null
  27811. }
  27812. assert(Number.isFinite(this.start))
  27813. assert(
  27814. this.end == null || Number.isFinite(this.end),
  27815. 'invalid content-length'
  27816. )
  27817. this.resume = resume
  27818. this.etag = headers.etag != null ? headers.etag : null
  27819. return this.handler.onHeaders(
  27820. statusCode,
  27821. rawHeaders,
  27822. resume,
  27823. statusMessage
  27824. )
  27825. }
  27826. const err = new RequestRetryError('Request failed', statusCode, {
  27827. headers,
  27828. count: this.retryCount
  27829. })
  27830. this.abort(err)
  27831. return false
  27832. }
  27833. onData (chunk) {
  27834. this.start += chunk.length
  27835. return this.handler.onData(chunk)
  27836. }
  27837. onComplete (rawTrailers) {
  27838. this.retryCount = 0
  27839. return this.handler.onComplete(rawTrailers)
  27840. }
  27841. onError (err) {
  27842. if (this.aborted || isDisturbed(this.opts.body)) {
  27843. return this.handler.onError(err)
  27844. }
  27845. this.retryOpts.retry(
  27846. err,
  27847. {
  27848. state: { counter: this.retryCount++, currentTimeout: this.retryAfter },
  27849. opts: { retryOptions: this.retryOpts, ...this.opts }
  27850. },
  27851. onRetry.bind(this)
  27852. )
  27853. function onRetry (err) {
  27854. if (err != null || this.aborted || isDisturbed(this.opts.body)) {
  27855. return this.handler.onError(err)
  27856. }
  27857. if (this.start !== 0) {
  27858. this.opts = {
  27859. ...this.opts,
  27860. headers: {
  27861. ...this.opts.headers,
  27862. range: `bytes=${this.start}-${this.end ?? ''}`
  27863. }
  27864. }
  27865. }
  27866. try {
  27867. this.dispatch(this.opts, this)
  27868. } catch (err) {
  27869. this.handler.onError(err)
  27870. }
  27871. }
  27872. }
  27873. }
  27874. module.exports = RetryHandler
  27875. /***/ }),
  27876. /***/ 8861:
  27877. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  27878. "use strict";
  27879. const RedirectHandler = __nccwpck_require__(2860)
  27880. function createRedirectInterceptor ({ maxRedirections: defaultMaxRedirections }) {
  27881. return (dispatch) => {
  27882. return function Intercept (opts, handler) {
  27883. const { maxRedirections = defaultMaxRedirections } = opts
  27884. if (!maxRedirections) {
  27885. return dispatch(opts, handler)
  27886. }
  27887. const redirectHandler = new RedirectHandler(dispatch, maxRedirections, opts, handler)
  27888. opts = { ...opts, maxRedirections: 0 } // Stop sub dispatcher from also redirecting.
  27889. return dispatch(opts, redirectHandler)
  27890. }
  27891. }
  27892. }
  27893. module.exports = createRedirectInterceptor
  27894. /***/ }),
  27895. /***/ 953:
  27896. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  27897. "use strict";
  27898. Object.defineProperty(exports, "__esModule", ({ value: true }));
  27899. 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;
  27900. const utils_1 = __nccwpck_require__(1891);
  27901. // C headers
  27902. var ERROR;
  27903. (function (ERROR) {
  27904. ERROR[ERROR["OK"] = 0] = "OK";
  27905. ERROR[ERROR["INTERNAL"] = 1] = "INTERNAL";
  27906. ERROR[ERROR["STRICT"] = 2] = "STRICT";
  27907. ERROR[ERROR["LF_EXPECTED"] = 3] = "LF_EXPECTED";
  27908. ERROR[ERROR["UNEXPECTED_CONTENT_LENGTH"] = 4] = "UNEXPECTED_CONTENT_LENGTH";
  27909. ERROR[ERROR["CLOSED_CONNECTION"] = 5] = "CLOSED_CONNECTION";
  27910. ERROR[ERROR["INVALID_METHOD"] = 6] = "INVALID_METHOD";
  27911. ERROR[ERROR["INVALID_URL"] = 7] = "INVALID_URL";
  27912. ERROR[ERROR["INVALID_CONSTANT"] = 8] = "INVALID_CONSTANT";
  27913. ERROR[ERROR["INVALID_VERSION"] = 9] = "INVALID_VERSION";
  27914. ERROR[ERROR["INVALID_HEADER_TOKEN"] = 10] = "INVALID_HEADER_TOKEN";
  27915. ERROR[ERROR["INVALID_CONTENT_LENGTH"] = 11] = "INVALID_CONTENT_LENGTH";
  27916. ERROR[ERROR["INVALID_CHUNK_SIZE"] = 12] = "INVALID_CHUNK_SIZE";
  27917. ERROR[ERROR["INVALID_STATUS"] = 13] = "INVALID_STATUS";
  27918. ERROR[ERROR["INVALID_EOF_STATE"] = 14] = "INVALID_EOF_STATE";
  27919. ERROR[ERROR["INVALID_TRANSFER_ENCODING"] = 15] = "INVALID_TRANSFER_ENCODING";
  27920. ERROR[ERROR["CB_MESSAGE_BEGIN"] = 16] = "CB_MESSAGE_BEGIN";
  27921. ERROR[ERROR["CB_HEADERS_COMPLETE"] = 17] = "CB_HEADERS_COMPLETE";
  27922. ERROR[ERROR["CB_MESSAGE_COMPLETE"] = 18] = "CB_MESSAGE_COMPLETE";
  27923. ERROR[ERROR["CB_CHUNK_HEADER"] = 19] = "CB_CHUNK_HEADER";
  27924. ERROR[ERROR["CB_CHUNK_COMPLETE"] = 20] = "CB_CHUNK_COMPLETE";
  27925. ERROR[ERROR["PAUSED"] = 21] = "PAUSED";
  27926. ERROR[ERROR["PAUSED_UPGRADE"] = 22] = "PAUSED_UPGRADE";
  27927. ERROR[ERROR["PAUSED_H2_UPGRADE"] = 23] = "PAUSED_H2_UPGRADE";
  27928. ERROR[ERROR["USER"] = 24] = "USER";
  27929. })(ERROR = exports.ERROR || (exports.ERROR = {}));
  27930. var TYPE;
  27931. (function (TYPE) {
  27932. TYPE[TYPE["BOTH"] = 0] = "BOTH";
  27933. TYPE[TYPE["REQUEST"] = 1] = "REQUEST";
  27934. TYPE[TYPE["RESPONSE"] = 2] = "RESPONSE";
  27935. })(TYPE = exports.TYPE || (exports.TYPE = {}));
  27936. var FLAGS;
  27937. (function (FLAGS) {
  27938. FLAGS[FLAGS["CONNECTION_KEEP_ALIVE"] = 1] = "CONNECTION_KEEP_ALIVE";
  27939. FLAGS[FLAGS["CONNECTION_CLOSE"] = 2] = "CONNECTION_CLOSE";
  27940. FLAGS[FLAGS["CONNECTION_UPGRADE"] = 4] = "CONNECTION_UPGRADE";
  27941. FLAGS[FLAGS["CHUNKED"] = 8] = "CHUNKED";
  27942. FLAGS[FLAGS["UPGRADE"] = 16] = "UPGRADE";
  27943. FLAGS[FLAGS["CONTENT_LENGTH"] = 32] = "CONTENT_LENGTH";
  27944. FLAGS[FLAGS["SKIPBODY"] = 64] = "SKIPBODY";
  27945. FLAGS[FLAGS["TRAILING"] = 128] = "TRAILING";
  27946. // 1 << 8 is unused
  27947. FLAGS[FLAGS["TRANSFER_ENCODING"] = 512] = "TRANSFER_ENCODING";
  27948. })(FLAGS = exports.FLAGS || (exports.FLAGS = {}));
  27949. var LENIENT_FLAGS;
  27950. (function (LENIENT_FLAGS) {
  27951. LENIENT_FLAGS[LENIENT_FLAGS["HEADERS"] = 1] = "HEADERS";
  27952. LENIENT_FLAGS[LENIENT_FLAGS["CHUNKED_LENGTH"] = 2] = "CHUNKED_LENGTH";
  27953. LENIENT_FLAGS[LENIENT_FLAGS["KEEP_ALIVE"] = 4] = "KEEP_ALIVE";
  27954. })(LENIENT_FLAGS = exports.LENIENT_FLAGS || (exports.LENIENT_FLAGS = {}));
  27955. var METHODS;
  27956. (function (METHODS) {
  27957. METHODS[METHODS["DELETE"] = 0] = "DELETE";
  27958. METHODS[METHODS["GET"] = 1] = "GET";
  27959. METHODS[METHODS["HEAD"] = 2] = "HEAD";
  27960. METHODS[METHODS["POST"] = 3] = "POST";
  27961. METHODS[METHODS["PUT"] = 4] = "PUT";
  27962. /* pathological */
  27963. METHODS[METHODS["CONNECT"] = 5] = "CONNECT";
  27964. METHODS[METHODS["OPTIONS"] = 6] = "OPTIONS";
  27965. METHODS[METHODS["TRACE"] = 7] = "TRACE";
  27966. /* WebDAV */
  27967. METHODS[METHODS["COPY"] = 8] = "COPY";
  27968. METHODS[METHODS["LOCK"] = 9] = "LOCK";
  27969. METHODS[METHODS["MKCOL"] = 10] = "MKCOL";
  27970. METHODS[METHODS["MOVE"] = 11] = "MOVE";
  27971. METHODS[METHODS["PROPFIND"] = 12] = "PROPFIND";
  27972. METHODS[METHODS["PROPPATCH"] = 13] = "PROPPATCH";
  27973. METHODS[METHODS["SEARCH"] = 14] = "SEARCH";
  27974. METHODS[METHODS["UNLOCK"] = 15] = "UNLOCK";
  27975. METHODS[METHODS["BIND"] = 16] = "BIND";
  27976. METHODS[METHODS["REBIND"] = 17] = "REBIND";
  27977. METHODS[METHODS["UNBIND"] = 18] = "UNBIND";
  27978. METHODS[METHODS["ACL"] = 19] = "ACL";
  27979. /* subversion */
  27980. METHODS[METHODS["REPORT"] = 20] = "REPORT";
  27981. METHODS[METHODS["MKACTIVITY"] = 21] = "MKACTIVITY";
  27982. METHODS[METHODS["CHECKOUT"] = 22] = "CHECKOUT";
  27983. METHODS[METHODS["MERGE"] = 23] = "MERGE";
  27984. /* upnp */
  27985. METHODS[METHODS["M-SEARCH"] = 24] = "M-SEARCH";
  27986. METHODS[METHODS["NOTIFY"] = 25] = "NOTIFY";
  27987. METHODS[METHODS["SUBSCRIBE"] = 26] = "SUBSCRIBE";
  27988. METHODS[METHODS["UNSUBSCRIBE"] = 27] = "UNSUBSCRIBE";
  27989. /* RFC-5789 */
  27990. METHODS[METHODS["PATCH"] = 28] = "PATCH";
  27991. METHODS[METHODS["PURGE"] = 29] = "PURGE";
  27992. /* CalDAV */
  27993. METHODS[METHODS["MKCALENDAR"] = 30] = "MKCALENDAR";
  27994. /* RFC-2068, section 19.6.1.2 */
  27995. METHODS[METHODS["LINK"] = 31] = "LINK";
  27996. METHODS[METHODS["UNLINK"] = 32] = "UNLINK";
  27997. /* icecast */
  27998. METHODS[METHODS["SOURCE"] = 33] = "SOURCE";
  27999. /* RFC-7540, section 11.6 */
  28000. METHODS[METHODS["PRI"] = 34] = "PRI";
  28001. /* RFC-2326 RTSP */
  28002. METHODS[METHODS["DESCRIBE"] = 35] = "DESCRIBE";
  28003. METHODS[METHODS["ANNOUNCE"] = 36] = "ANNOUNCE";
  28004. METHODS[METHODS["SETUP"] = 37] = "SETUP";
  28005. METHODS[METHODS["PLAY"] = 38] = "PLAY";
  28006. METHODS[METHODS["PAUSE"] = 39] = "PAUSE";
  28007. METHODS[METHODS["TEARDOWN"] = 40] = "TEARDOWN";
  28008. METHODS[METHODS["GET_PARAMETER"] = 41] = "GET_PARAMETER";
  28009. METHODS[METHODS["SET_PARAMETER"] = 42] = "SET_PARAMETER";
  28010. METHODS[METHODS["REDIRECT"] = 43] = "REDIRECT";
  28011. METHODS[METHODS["RECORD"] = 44] = "RECORD";
  28012. /* RAOP */
  28013. METHODS[METHODS["FLUSH"] = 45] = "FLUSH";
  28014. })(METHODS = exports.METHODS || (exports.METHODS = {}));
  28015. exports.METHODS_HTTP = [
  28016. METHODS.DELETE,
  28017. METHODS.GET,
  28018. METHODS.HEAD,
  28019. METHODS.POST,
  28020. METHODS.PUT,
  28021. METHODS.CONNECT,
  28022. METHODS.OPTIONS,
  28023. METHODS.TRACE,
  28024. METHODS.COPY,
  28025. METHODS.LOCK,
  28026. METHODS.MKCOL,
  28027. METHODS.MOVE,
  28028. METHODS.PROPFIND,
  28029. METHODS.PROPPATCH,
  28030. METHODS.SEARCH,
  28031. METHODS.UNLOCK,
  28032. METHODS.BIND,
  28033. METHODS.REBIND,
  28034. METHODS.UNBIND,
  28035. METHODS.ACL,
  28036. METHODS.REPORT,
  28037. METHODS.MKACTIVITY,
  28038. METHODS.CHECKOUT,
  28039. METHODS.MERGE,
  28040. METHODS['M-SEARCH'],
  28041. METHODS.NOTIFY,
  28042. METHODS.SUBSCRIBE,
  28043. METHODS.UNSUBSCRIBE,
  28044. METHODS.PATCH,
  28045. METHODS.PURGE,
  28046. METHODS.MKCALENDAR,
  28047. METHODS.LINK,
  28048. METHODS.UNLINK,
  28049. METHODS.PRI,
  28050. // TODO(indutny): should we allow it with HTTP?
  28051. METHODS.SOURCE,
  28052. ];
  28053. exports.METHODS_ICE = [
  28054. METHODS.SOURCE,
  28055. ];
  28056. exports.METHODS_RTSP = [
  28057. METHODS.OPTIONS,
  28058. METHODS.DESCRIBE,
  28059. METHODS.ANNOUNCE,
  28060. METHODS.SETUP,
  28061. METHODS.PLAY,
  28062. METHODS.PAUSE,
  28063. METHODS.TEARDOWN,
  28064. METHODS.GET_PARAMETER,
  28065. METHODS.SET_PARAMETER,
  28066. METHODS.REDIRECT,
  28067. METHODS.RECORD,
  28068. METHODS.FLUSH,
  28069. // For AirPlay
  28070. METHODS.GET,
  28071. METHODS.POST,
  28072. ];
  28073. exports.METHOD_MAP = utils_1.enumToMap(METHODS);
  28074. exports.H_METHOD_MAP = {};
  28075. Object.keys(exports.METHOD_MAP).forEach((key) => {
  28076. if (/^H/.test(key)) {
  28077. exports.H_METHOD_MAP[key] = exports.METHOD_MAP[key];
  28078. }
  28079. });
  28080. var FINISH;
  28081. (function (FINISH) {
  28082. FINISH[FINISH["SAFE"] = 0] = "SAFE";
  28083. FINISH[FINISH["SAFE_WITH_CB"] = 1] = "SAFE_WITH_CB";
  28084. FINISH[FINISH["UNSAFE"] = 2] = "UNSAFE";
  28085. })(FINISH = exports.FINISH || (exports.FINISH = {}));
  28086. exports.ALPHA = [];
  28087. for (let i = 'A'.charCodeAt(0); i <= 'Z'.charCodeAt(0); i++) {
  28088. // Upper case
  28089. exports.ALPHA.push(String.fromCharCode(i));
  28090. // Lower case
  28091. exports.ALPHA.push(String.fromCharCode(i + 0x20));
  28092. }
  28093. exports.NUM_MAP = {
  28094. 0: 0, 1: 1, 2: 2, 3: 3, 4: 4,
  28095. 5: 5, 6: 6, 7: 7, 8: 8, 9: 9,
  28096. };
  28097. exports.HEX_MAP = {
  28098. 0: 0, 1: 1, 2: 2, 3: 3, 4: 4,
  28099. 5: 5, 6: 6, 7: 7, 8: 8, 9: 9,
  28100. A: 0XA, B: 0XB, C: 0XC, D: 0XD, E: 0XE, F: 0XF,
  28101. a: 0xa, b: 0xb, c: 0xc, d: 0xd, e: 0xe, f: 0xf,
  28102. };
  28103. exports.NUM = [
  28104. '0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
  28105. ];
  28106. exports.ALPHANUM = exports.ALPHA.concat(exports.NUM);
  28107. exports.MARK = ['-', '_', '.', '!', '~', '*', '\'', '(', ')'];
  28108. exports.USERINFO_CHARS = exports.ALPHANUM
  28109. .concat(exports.MARK)
  28110. .concat(['%', ';', ':', '&', '=', '+', '$', ',']);
  28111. // TODO(indutny): use RFC
  28112. exports.STRICT_URL_CHAR = [
  28113. '!', '"', '$', '%', '&', '\'',
  28114. '(', ')', '*', '+', ',', '-', '.', '/',
  28115. ':', ';', '<', '=', '>',
  28116. '@', '[', '\\', ']', '^', '_',
  28117. '`',
  28118. '{', '|', '}', '~',
  28119. ].concat(exports.ALPHANUM);
  28120. exports.URL_CHAR = exports.STRICT_URL_CHAR
  28121. .concat(['\t', '\f']);
  28122. // All characters with 0x80 bit set to 1
  28123. for (let i = 0x80; i <= 0xff; i++) {
  28124. exports.URL_CHAR.push(i);
  28125. }
  28126. exports.HEX = exports.NUM.concat(['a', 'b', 'c', 'd', 'e', 'f', 'A', 'B', 'C', 'D', 'E', 'F']);
  28127. /* Tokens as defined by rfc 2616. Also lowercases them.
  28128. * token = 1*<any CHAR except CTLs or separators>
  28129. * separators = "(" | ")" | "<" | ">" | "@"
  28130. * | "," | ";" | ":" | "\" | <">
  28131. * | "/" | "[" | "]" | "?" | "="
  28132. * | "{" | "}" | SP | HT
  28133. */
  28134. exports.STRICT_TOKEN = [
  28135. '!', '#', '$', '%', '&', '\'',
  28136. '*', '+', '-', '.',
  28137. '^', '_', '`',
  28138. '|', '~',
  28139. ].concat(exports.ALPHANUM);
  28140. exports.TOKEN = exports.STRICT_TOKEN.concat([' ']);
  28141. /*
  28142. * Verify that a char is a valid visible (printable) US-ASCII
  28143. * character or %x80-FF
  28144. */
  28145. exports.HEADER_CHARS = ['\t'];
  28146. for (let i = 32; i <= 255; i++) {
  28147. if (i !== 127) {
  28148. exports.HEADER_CHARS.push(i);
  28149. }
  28150. }
  28151. // ',' = \x44
  28152. exports.CONNECTION_TOKEN_CHARS = exports.HEADER_CHARS.filter((c) => c !== 44);
  28153. exports.MAJOR = exports.NUM_MAP;
  28154. exports.MINOR = exports.MAJOR;
  28155. var HEADER_STATE;
  28156. (function (HEADER_STATE) {
  28157. HEADER_STATE[HEADER_STATE["GENERAL"] = 0] = "GENERAL";
  28158. HEADER_STATE[HEADER_STATE["CONNECTION"] = 1] = "CONNECTION";
  28159. HEADER_STATE[HEADER_STATE["CONTENT_LENGTH"] = 2] = "CONTENT_LENGTH";
  28160. HEADER_STATE[HEADER_STATE["TRANSFER_ENCODING"] = 3] = "TRANSFER_ENCODING";
  28161. HEADER_STATE[HEADER_STATE["UPGRADE"] = 4] = "UPGRADE";
  28162. HEADER_STATE[HEADER_STATE["CONNECTION_KEEP_ALIVE"] = 5] = "CONNECTION_KEEP_ALIVE";
  28163. HEADER_STATE[HEADER_STATE["CONNECTION_CLOSE"] = 6] = "CONNECTION_CLOSE";
  28164. HEADER_STATE[HEADER_STATE["CONNECTION_UPGRADE"] = 7] = "CONNECTION_UPGRADE";
  28165. HEADER_STATE[HEADER_STATE["TRANSFER_ENCODING_CHUNKED"] = 8] = "TRANSFER_ENCODING_CHUNKED";
  28166. })(HEADER_STATE = exports.HEADER_STATE || (exports.HEADER_STATE = {}));
  28167. exports.SPECIAL_HEADERS = {
  28168. 'connection': HEADER_STATE.CONNECTION,
  28169. 'content-length': HEADER_STATE.CONTENT_LENGTH,
  28170. 'proxy-connection': HEADER_STATE.CONNECTION,
  28171. 'transfer-encoding': HEADER_STATE.TRANSFER_ENCODING,
  28172. 'upgrade': HEADER_STATE.UPGRADE,
  28173. };
  28174. //# sourceMappingURL=constants.js.map
  28175. /***/ }),
  28176. /***/ 1145:
  28177. /***/ ((module) => {
  28178. module.exports = 'AGFzbQEAAAABMAhgAX8Bf2ADf39/AX9gBH9/f38Bf2AAAGADf39/AGABfwBgAn9/AGAGf39/f39/AALLAQgDZW52GHdhc21fb25faGVhZGVy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ACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCAQDscBAAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxweHyAhIyUoP0BBREVGR0hJSktMTU9QUVJT3gNXWVtcXWBiZWZnaGlqa2xtb3BxcnN0dXZ3eHl6e3x9foABggGFAYYBhwGJAYsBjAGNAY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AtBHiEQDL0DC0ICIREM5QELQgMhEQzkAQtCBCERDOMBC0IFIREM4gELQgYhEQzhAQtCByERDOABC0IIIREM3wELQgkhEQzeAQtCCiERDN0BC0ILIREM3AELQgwhEQzbAQtCDSERDNoBC0IOIREM2QELQg8hEQzYAQtCCiERDNcBC0ILIREM1gELQgwhEQzVAQtCDSERDNQBC0IOIREM0wELQg8hEQzSAQtCACERAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCAQLQAAQVBqDjflAeQBAAECAwQFBgfmAeYB5gHmAeYB5gHmAQgJCgsMDeYB5gHmAeYB5gHmAeYB5gHmAeYB5gHmAeYB5gHmAeYB5gHmAeYB5gHmAeYB5gHmAeYB5gEODxAREhPmAQtCAiERDOQBC0IDIREM4wELQgQhEQziAQtCBSERDOEBC0IGIREM4AELQgchEQzfAQtCCCERDN4BC0IJIREM3QELQgohEQzcAQtCCyERDNsBC0IMIREM2gELQg0hEQzZAQtCDiERDNgBC0IPIREM1wELQgohEQzWAQtCCyERDNUBC0IMIREM1AELQg0hEQzTAQtCDiERDNIBC0IPIREM0QELIABCACAAKQMgIhEgAiABIhBrrSISfSITIBMgEVYbNwMgIBEgElYiFEUN0gFBHyEQDMADCwJAIAEiASACRg0AIABBiYCAgAA2AgggACABNgIEIAEhAUEkIRAMpwMLQSAhEAy/AwsgACABIhAgAhC+gICAAEF/ag4FtgEAxQIB0QHSAQtBESEQDKQDCyAAQQE6AC8gECEBDLsDCyABIgEgAkcN0gFBJCEQDLsDCyABIg0gAkcNHkHGACEQDLoDCyAAIAEiASACELKAgIAAIhAN1AEgASEBDLUBCyABIhAgAkcNJkHQACEQDLgDCwJAIAEiASACRw0AQSghEAy4AwsgAEEANgIEIABBjICAgAA2AgggACABIAEQsYCAgAAiEA3TASABIQEM2AELAkAgASIQIAJHDQBBKSEQDLcDCyAQLQAAIgFBIEYNFCABQQlHDdMBIBBBAWohAQwVCwJAIAEiASACRg0AIAFBAWohAQwXC0EqIR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BA2AgxBACEQDLMBCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQp4CAgAAiEA0AIAEhAQxNCyAAQdIANgIcIAAgATYCFCAAIBA2AgxBACEQDLIBCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQp4CAgAAiEA0AIAEhAQxNCyAAQdMANgIcIAAgATYCFCAAIBA2AgxBACEQDLEBCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQp4CAgAAiEA0AIAEhAQxRCyAAQeUANgIcIAAgATYCFCAAIBA2AgxBACEQDLABCyAAQQA2AhwgACABNgIUIABBxoqAgAA2AhAgAEEHNgIMQQAhEAyvAQsgACgCBCEQIABBADYCBAJAIAAgECABEKeAgIAAIhANACABIQEMSQsgAEHSADYCHCAAIAE2AhQgACAQNgIMQQAhEAyuAQsgACgCBCEQIABBADYCBAJAIAAgECABEKeAgIAAIhANACABIQEMSQsgAEHTADYCHCAAIAE2AhQgACAQNgIMQQAhEAytAQsgACgCBCEQIABBADYCBAJAIAAgECABEKeAgIAAIhANACABIQEMTQsgAEHlADYCHCAAIAE2AhQgACAQNgIMQQAhEAysAQsgAEEANgIcIAAgATYCFCAAQdyIgIAANgIQIABBBzYCDEEAIRAMqwELIBBBP0cNASABQQFqIQELQQUhEAyQAQtBACEQIABBADYCHCAAIAE2AhQgAEH9koCAADYCECAAQQc2AgwMqAELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDEILIABB0gA2AhwgACABNgIUIAAgEDYCDEEAIRAMpwELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDEILIABB0wA2AhwgACABNgIUIAAgEDYCDEEAIRAMpgELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDEYLIABB5QA2AhwgACABNgIUIAAgEDYCDEEAIRAMpQELIAAoAgQhASAAQQA2AgQCQCAAIAEgFBCngICAACIBDQAgFCEBDD8LIABB0gA2AhwgACAUNgIUIAAgATYCDEEAIRAMpAELIAAo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0EAIQEgAC8BMCICQQFxRQ0BC0EBIQEgAC0AKEEBRg0AIAAvATJB//8DcSIAQZx/akHkAEkNACAAQcwBRg0AIABBsAJGDQAgAkHAAHENAEEAIQEgAkGIBHFBgARGDQAgAkEocUEARyEBCyABC0kBAXsgAEEQav0MAAAAAAAAAAAAAAAAAAAAACIB/QsDACAAIAH9CwMAIABBMGogAf0LAwAgAEEgaiAB/QsDACAAQd0BNgIcQQALewEBfwJAIAAoAgwiAw0AAkAgACgCBEUNACAAIAE2AgQLAkAgACABIAIQxICAgAAiAw0AIAAoAgwPCyAAIAM2AhxBACEDIAAoAgQiAUUNACAAIAEgAiAAKAIIEYGAgIAAACIBRQ0AIAAgAjYCFCAAIAE2AgwgASEDCyADC+TzAQMOfwN+BH8jgICAgABBEGsiAySAgICAACABIQQgASEFIAEhBiABIQcgASEIIAEhCSABIQogASELIAEhDCABIQ0gASEOIAEhDwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCAAKAIcIhBBf2oO3QHaAQHZAQIDBAUGB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DCULQaABIRAMJAtBoQEhEAwjC0GiASEQDCILQaMBIRAMIQtBpAEhEAwgC0GlASEQDB8LQaYBIRAMHgtBpwEhEAwdC0GoASEQDBwLQakBIRAMGwtBqgEhEAwaC0GrASEQDBkLQawBIRAMGAtBrQEhEAwXC0GuASEQDBYLQQEhEAwVC0GvASEQDBQLQbABIRAMEwtBsQEhEAwSC0GzASEQDBELQbIBIRAMEAtBtAEhEAwPC0G1ASEQDA4LQbYBIRAMDQtBtwEhEAwMC0G4ASEQDAsLQbkBIRAMCgtBugEhEAwJC0G7ASEQDAgLQcYBIRAMBwtBvAEhEAwGC0G9ASEQDAULQb4BIRAMBAtBvwEhEAwDC0HAASEQDAILQcIBIRAMAQtBwQEhEAsDQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQA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IAEiASACRw17QegAIRAM+gMLIAEiASACRw14QeYAIRAM+QMLIAEiASACRw0aQRghEAz4AwsgASIBIAJHDRRBEiEQDPcDCyABIgEgAkcNWUHFACEQDPYDCyABIgEgAkcNSkE/IRAM9QMLIAEiASACRw1IQTwhEAz0AwsgASIBIAJHDUFBMSEQDPMDCyAALQAuQQFGDesDDIcCCyAAIAEiASACEMCAgIAAQQFHDeYBIABCADcDIAznAQsgACABIgEgAhC0gICAACIQDecBIAEhAQz1AgsCQCABIgEgAkcNAEEGIRAM8AMLIAAgAUEBaiIBIAIQu4CAgAAiEA3oASABIQEMMQsgAEIANwMgQRIhEAzVAwsgASIQIAJHDStBHSEQDO0DCwJAIAEiASACRg0AIAFBAWohAUEQIRAM1AMLQQchEAzsAwsgAEIAIAApAyAiESACIAEiEGutIhJ9IhMgEyARVhs3AyAgESASViIURQ3lAUEIIRAM6wMLAkAgASIBIAJGDQAgAEGJgICAADYCCCAAIAE2AgQgASEBQRQhEAzSAwtBCSEQDOoDCyABIQEgACkDIFAN5AEgASEBDPICCwJAIAEiASACRw0AQQshEAzpAwsgACABQQFqIgEgAhC2gICAACIQDeUBIAEhAQzyAgsgACABIgEgAhC4gICAACIQDeUBIAEhAQzyAgsgACABIgEgAhC4gICAACIQDeYBIAEhAQwNCyAAIAEiASACELqAgIAAIhAN5wEgASEBDPACCwJAIAEiASACRw0AQQ8hEAzlAwsgAS0AACIQQTtGDQggEEENRw3oASABQQFqIQEM7wILIAAgASIBIAIQuoCAgAAiEA3oASABIQEM8gILA0ACQCABLQAAQfC1gIAAai0AACIQQQFGDQAgEEECRw3rASAAKAIEIRAgAEEANgIEIAAgECABQQFqIgEQuYCAgAAiEA3qASABIQEM9AILIAFBAWoiASACRw0AC0ESIRAM4gMLIAAgASIBIAIQuoCAgAAiEA3pASABIQEMCgsgASIBIAJHDQZBGyEQDOADCwJAIAEiASACRw0AQRYhEAzgAwsgAEGKgICAADYCCCAAIAE2AgQgACABIAIQuICAgAAiEA3qASAB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AgQhBCAAQQA2AgQCQCAAIAQgARCtgICAACIEDQAgASEBDKcBCyAAQd4ANgIcIAAgATYCFCAAIAQ2AgxBACEQDLoBCyAAQQA2AgAgF0EBaiEBAkAgAC0AKUEjTw0AIAEhAQxZCyAAQQA2AhwgACABNgIUIABB04mAgAA2AhAgAEEINgIMQQAhEAy5AQsgAEEANgIAC0EAIRAgAEEANgIcIAAgATYCFCAAQZCzgIAANgIQIABBCDYCDAy3AQsgAEEANgIAIBdBAWohAQJAIAAtAClBIUcNACABIQEMVgsgAEEANgIcIAAgATYCFCAAQZuKgIAANgIQIABBCDYCDEEAIRAMtgELIABBADYCACAXQQFqIQECQCAALQApIhBBXWpBC08NACABIQEMVQsCQCAQQQZLDQBBASAQdEHKAHFFDQAgASEBDFULQQAhECAAQQA2AhwgACABNgIUIABB94mAgAA2AhAgAEEINgIMDLUBCyAQQRVGDXEgAEEANgIcIAAgATYCFCAAQbmNgIAANgIQIABBGjYCDEEAIRAMtAELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDFQLIABB5QA2AhwgACABNgIUIAAgEDYCDEEAIRAMswELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDE0LIABB0gA2AhwgACABNgIUIAAgEDYCDEEAIRAMsgELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDE0LIABB0wA2AhwgACABNgIUIAAgEDYCDEEAIRAMsQELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDFELIABB5QA2AhwgACABNgIUIAAgEDYCDEEAIRAMsAELIABBADYCHCAAIAE2AhQgAEHGioCAADYCECAAQQc2AgxBACEQDK8BCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQp4CAgAAiEA0AIAEhAQxJCyAAQdIANgIcIAAgATYCFCAAIBA2AgxBACEQDK4BCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQp4CAgAAiEA0AIAEhAQxJCyAAQdMANgIc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R0VPUkRJUkVDVE9SVFJDSFBBUkFNRVRFUlVSQ0VCU0NSSUJFQVJET1dOQUNFSU5ETktDS1VCU0NSSUJFSFRUUC9BRFRQLw=='
  28183. /***/ }),
  28184. /***/ 1891:
  28185. /***/ ((__unused_webpack_module, exports) => {
  28186. "use strict";
  28187. Object.defineProperty(exports, "__esModule", ({ value: true }));
  28188. exports.enumToMap = void 0;
  28189. function enumToMap(obj) {
  28190. const res = {};
  28191. Object.keys(obj).forEach((key) => {
  28192. const value = obj[key];
  28193. if (typeof value === 'number') {
  28194. res[key] = value;
  28195. }
  28196. });
  28197. return res;
  28198. }
  28199. exports.enumToMap = enumToMap;
  28200. //# sourceMappingURL=utils.js.map
  28201. /***/ }),
  28202. /***/ 6771:
  28203. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  28204. "use strict";
  28205. const { kClients } = __nccwpck_require__(2785)
  28206. const Agent = __nccwpck_require__(7890)
  28207. const {
  28208. kAgent,
  28209. kMockAgentSet,
  28210. kMockAgentGet,
  28211. kDispatches,
  28212. kIsMockActive,
  28213. kNetConnect,
  28214. kGetNetConnect,
  28215. kOptions,
  28216. kFactory
  28217. } = __nccwpck_require__(4347)
  28218. const MockClient = __nccwpck_require__(8687)
  28219. const MockPool = __nccwpck_require__(6193)
  28220. const { matchValue, buildMockOptions } = __nccwpck_require__(9323)
  28221. const { InvalidArgumentError, UndiciError } = __nccwpck_require__(8045)
  28222. const Dispatcher = __nccwpck_require__(412)
  28223. const Pluralizer = __nccwpck_require__(8891)
  28224. const PendingInterceptorsFormatter = __nccwpck_require__(6823)
  28225. class FakeWeakRef {
  28226. constructor (value) {
  28227. this.value = value
  28228. }
  28229. deref () {
  28230. return this.value
  28231. }
  28232. }
  28233. class MockAgent extends Dispatcher {
  28234. constructor (opts) {
  28235. super(opts)
  28236. this[kNetConnect] = true
  28237. this[kIsMockActive] = true
  28238. // Instantiate Agent and encapsulate
  28239. if ((opts && opts.agent && typeof opts.agent.dispatch !== 'function')) {
  28240. throw new InvalidArgumentError('Argument opts.agent must implement Agent')
  28241. }
  28242. const agent = opts && opts.agent ? opts.agent : new Agent(opts)
  28243. this[kAgent] = agent
  28244. this[kClients] = agent[kClients]
  28245. this[kOptions] = buildMockOptions(opts)
  28246. }
  28247. get (origin) {
  28248. let dispatcher = this[kMockAgentGet](origin)
  28249. if (!dispatcher) {
  28250. dispatcher = this[kFactory](origin)
  28251. this[kMockAgentSet](origin, dispatcher)
  28252. }
  28253. return dispatcher
  28254. }
  28255. dispatch (opts, handler) {
  28256. // Call MockAgent.get to perform additional setup before dispatching as normal
  28257. this.get(opts.origin)
  28258. return this[kAgent].dispatch(opts, handler)
  28259. }
  28260. async close () {
  28261. await this[kAgent].close()
  28262. this[kClients].clear()
  28263. }
  28264. deactivate () {
  28265. this[kIsMockActive] = false
  28266. }
  28267. activate () {
  28268. this[kIsMockActive] = true
  28269. }
  28270. enableNetConnect (matcher) {
  28271. if (typeof matcher === 'string' || typeof matcher === 'function' || matcher instanceof RegExp) {
  28272. if (Array.isArray(this[kNetConnect])) {
  28273. this[kNetConnect].push(matcher)
  28274. } else {
  28275. this[kNetConnect] = [matcher]
  28276. }
  28277. } else if (typeof matcher === 'undefined') {
  28278. this[kNetConnect] = true
  28279. } else {
  28280. throw new InvalidArgumentError('Unsupported matcher. Must be one of String|Function|RegExp.')
  28281. }
  28282. }
  28283. disableNetConnect () {
  28284. this[kNetConnect] = false
  28285. }
  28286. // This is required to bypass issues caused by using global symbols - see:
  28287. // https://github.com/nodejs/undici/issues/1447
  28288. get isMockActive () {
  28289. return this[kIsMockActive]
  28290. }
  28291. [kMockAgentSet] (origin, dispatcher) {
  28292. this[kClients].set(origin, new FakeWeakRef(dispatcher))
  28293. }
  28294. [kFactory] (origin) {
  28295. const mockOptions = Object.assign({ agent: this }, this[kOptions])
  28296. return this[kOptions] && this[kOptions].connections === 1
  28297. ? new MockClient(origin, mockOptions)
  28298. : new MockPool(origin, mockOptions)
  28299. }
  28300. [kMockAgentGet] (origin) {
  28301. // First check if we can immediately find it
  28302. const ref = this[kClients].get(origin)
  28303. if (ref) {
  28304. return ref.deref()
  28305. }
  28306. // If the origin is not a string create a dummy parent pool and return to user
  28307. if (typeof origin !== 'string') {
  28308. const dispatcher = this[kFactory]('http://localhost:9999')
  28309. this[kMockAgentSet](origin, dispatcher)
  28310. return dispatcher
  28311. }
  28312. // If we match, create a pool and assign the same dispatches
  28313. for (const [keyMatcher, nonExplicitRef] of Array.from(this[kClients])) {
  28314. const nonExplicitDispatcher = nonExplicitRef.deref()
  28315. if (nonExplicitDispatcher && typeof keyMatcher !== 'string' && matchValue(keyMatcher, origin)) {
  28316. const dispatcher = this[kFactory](origin)
  28317. this[kMockAgentSet](origin, dispatcher)
  28318. dispatcher[kDispatches] = nonExplicitDispatcher[kDispatches]
  28319. return dispatcher
  28320. }
  28321. }
  28322. }
  28323. [kGetNetConnect] () {
  28324. return this[kNetConnect]
  28325. }
  28326. pendingInterceptors () {
  28327. const mockAgentClients = this[kClients]
  28328. return Array.from(mockAgentClients.entries())
  28329. .flatMap(([origin, scope]) => scope.deref()[kDispatches].map(dispatch => ({ ...dispatch, origin })))
  28330. .filter(({ pending }) => pending)
  28331. }
  28332. assertNoPendingInterceptors ({ pendingInterceptorsFormatter = new PendingInterceptorsFormatter() } = {}) {
  28333. const pending = this.pendingInterceptors()
  28334. if (pending.length === 0) {
  28335. return
  28336. }
  28337. const pluralizer = new Pluralizer('interceptor', 'interceptors').pluralize(pending.length)
  28338. throw new UndiciError(`
  28339. ${pluralizer.count} ${pluralizer.noun} ${pluralizer.is} pending:
  28340. ${pendingInterceptorsFormatter.format(pending)}
  28341. `.trim())
  28342. }
  28343. }
  28344. module.exports = MockAgent
  28345. /***/ }),
  28346. /***/ 8687:
  28347. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  28348. "use strict";
  28349. const { promisify } = __nccwpck_require__(3837)
  28350. const Client = __nccwpck_require__(3598)
  28351. const { buildMockDispatch } = __nccwpck_require__(9323)
  28352. const {
  28353. kDispatches,
  28354. kMockAgent,
  28355. kClose,
  28356. kOriginalClose,
  28357. kOrigin,
  28358. kOriginalDispatch,
  28359. kConnected
  28360. } = __nccwpck_require__(4347)
  28361. const { MockInterceptor } = __nccwpck_require__(410)
  28362. const Symbols = __nccwpck_require__(2785)
  28363. const { InvalidArgumentError } = __nccwpck_require__(8045)
  28364. /**
  28365. * MockClient provides an API that extends the Client to influence the mockDispatches.
  28366. */
  28367. class MockClient extends Client {
  28368. constructor (origin, opts) {
  28369. super(origin, opts)
  28370. if (!opts || !opts.agent || typeof opts.agent.dispatch !== 'function') {
  28371. throw new InvalidArgumentError('Argument opts.agent must implement Agent')
  28372. }
  28373. this[kMockAgent] = opts.agent
  28374. this[kOrigin] = origin
  28375. this[kDispatches] = []
  28376. this[kConnected] = 1
  28377. this[kOriginalDispatch] = this.dispatch
  28378. this[kOriginalClose] = this.close.bind(this)
  28379. this.dispatch = buildMockDispatch.call(this)
  28380. this.close = this[kClose]
  28381. }
  28382. get [Symbols.kConnected] () {
  28383. return this[kConnected]
  28384. }
  28385. /**
  28386. * Sets up the base interceptor for mocking replies from undici.
  28387. */
  28388. intercept (opts) {
  28389. return new MockInterceptor(opts, this[kDispatches])
  28390. }
  28391. async [kClose] () {
  28392. await promisify(this[kOriginalClose])()
  28393. this[kConnected] = 0
  28394. this[kMockAgent][Symbols.kClients].delete(this[kOrigin])
  28395. }
  28396. }
  28397. module.exports = MockClient
  28398. /***/ }),
  28399. /***/ 888:
  28400. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  28401. "use strict";
  28402. const { UndiciError } = __nccwpck_require__(8045)
  28403. class MockNotMatchedError extends UndiciError {
  28404. constructor (message) {
  28405. super(message)
  28406. Error.captureStackTrace(this, MockNotMatchedError)
  28407. this.name = 'MockNotMatchedError'
  28408. this.message = message || 'The request does not match any registered mock dispatches'
  28409. this.code = 'UND_MOCK_ERR_MOCK_NOT_MATCHED'
  28410. }
  28411. }
  28412. module.exports = {
  28413. MockNotMatchedError
  28414. }
  28415. /***/ }),
  28416. /***/ 410:
  28417. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  28418. "use strict";
  28419. const { getResponseData, buildKey, addMockDispatch } = __nccwpck_require__(9323)
  28420. const {
  28421. kDispatches,
  28422. kDispatchKey,
  28423. kDefaultHeaders,
  28424. kDefaultTrailers,
  28425. kContentLength,
  28426. kMockDispatch
  28427. } = __nccwpck_require__(4347)
  28428. const { InvalidArgumentError } = __nccwpck_require__(8045)
  28429. const { buildURL } = __nccwpck_require__(3983)
  28430. /**
  28431. * Defines the scope API for an interceptor reply
  28432. */
  28433. class MockScope {
  28434. constructor (mockDispatch) {
  28435. this[kMockDispatch] = mockDispatch
  28436. }
  28437. /**
  28438. * Delay a reply by a set amount in ms.
  28439. */
  28440. delay (waitInMs) {
  28441. if (typeof waitInMs !== 'number' || !Number.isInteger(waitInMs) || waitInMs <= 0) {
  28442. throw new InvalidArgumentError('waitInMs must be a valid integer > 0')
  28443. }
  28444. this[kMockDispatch].delay = waitInMs
  28445. return this
  28446. }
  28447. /**
  28448. * For a defined reply, never mark as consumed.
  28449. */
  28450. persist () {
  28451. this[kMockDispatch].persist = true
  28452. return this
  28453. }
  28454. /**
  28455. * Allow one to define a reply for a set amount of matching requests.
  28456. */
  28457. times (repeatTimes) {
  28458. if (typeof repeatTimes !== 'number' || !Number.isInteger(repeatTimes) || repeatTimes <= 0) {
  28459. throw new InvalidArgumentError('repeatTimes must be a valid integer > 0')
  28460. }
  28461. this[kMockDispatch].times = repeatTimes
  28462. return this
  28463. }
  28464. }
  28465. /**
  28466. * Defines an interceptor for a Mock
  28467. */
  28468. class MockInterceptor {
  28469. constructor (opts, mockDispatches) {
  28470. if (typeof opts !== 'object') {
  28471. throw new InvalidArgumentError('opts must be an object')
  28472. }
  28473. if (typeof opts.path === 'undefined') {
  28474. throw new InvalidArgumentError('opts.path must be defined')
  28475. }
  28476. if (typeof opts.method === 'undefined') {
  28477. opts.method = 'GET'
  28478. }
  28479. // See https://github.com/nodejs/undici/issues/1245
  28480. // As per RFC 3986, clients are not supposed to send URI
  28481. // fragments to servers when they retrieve a document,
  28482. if (typeof opts.path === 'string') {
  28483. if (opts.query) {
  28484. opts.path = buildURL(opts.path, opts.query)
  28485. } else {
  28486. // Matches https://github.com/nodejs/undici/blob/main/lib/fetch/index.js#L1811
  28487. const parsedURL = new URL(opts.path, 'data://')
  28488. opts.path = parsedURL.pathname + parsedURL.search
  28489. }
  28490. }
  28491. if (typeof opts.method === 'string') {
  28492. opts.method = opts.method.toUpperCase()
  28493. }
  28494. this[kDispatchKey] = buildKey(opts)
  28495. this[kDispatches] = mockDispatches
  28496. this[kDefaultHeaders] = {}
  28497. this[kDefaultTrailers] = {}
  28498. this[kContentLength] = false
  28499. }
  28500. createMockScopeDispatchData (statusCode, data, responseOptions = {}) {
  28501. const responseData = getResponseData(data)
  28502. const contentLength = this[kContentLength] ? { 'content-length': responseData.length } : {}
  28503. const headers = { ...this[kDefaultHeaders], ...contentLength, ...responseOptions.headers }
  28504. const trailers = { ...this[kDefaultTrailers], ...responseOptions.trailers }
  28505. return { statusCode, data, headers, trailers }
  28506. }
  28507. validateReplyParameters (statusCode, data, responseOptions) {
  28508. if (typeof statusCode === 'undefined') {
  28509. throw new InvalidArgumentError('statusCode must be defined')
  28510. }
  28511. if (typeof data === 'undefined') {
  28512. throw new InvalidArgumentError('data must be defined')
  28513. }
  28514. if (typeof responseOptions !== 'object') {
  28515. throw new InvalidArgumentError('responseOptions must be an object')
  28516. }
  28517. }
  28518. /**
  28519. * Mock an undici request with a defined reply.
  28520. */
  28521. reply (replyData) {
  28522. // Values of reply aren't available right now as they
  28523. // can only be available when the reply callback is invoked.
  28524. if (typeof replyData === 'function') {
  28525. // We'll first wrap the provided callback in another function,
  28526. // this function will properly resolve the data from the callback
  28527. // when invoked.
  28528. const wrappedDefaultsCallback = (opts) => {
  28529. // Our reply options callback contains the parameter for statusCode, data and options.
  28530. const resolvedData = replyData(opts)
  28531. // Check if it is in the right format
  28532. if (typeof resolvedData !== 'object') {
  28533. throw new InvalidArgumentError('reply options callback must return an object')
  28534. }
  28535. const { statusCode, data = '', responseOptions = {} } = resolvedData
  28536. this.validateReplyParameters(statusCode, data, responseOptions)
  28537. // Since the values can be obtained immediately we return them
  28538. // from this higher order function that will be resolved later.
  28539. return {
  28540. ...this.createMockScopeDispatchData(statusCode, data, responseOptions)
  28541. }
  28542. }
  28543. // Add usual dispatch data, but this time set the data parameter to function that will eventually provide data.
  28544. const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], wrappedDefaultsCallback)
  28545. return new MockScope(newMockDispatch)
  28546. }
  28547. // We can have either one or three parameters, if we get here,
  28548. // we should have 1-3 parameters. So we spread the arguments of
  28549. // this function to obtain the parameters, since replyData will always
  28550. // just be the statusCode.
  28551. const [statusCode, data = '', responseOptions = {}] = [...arguments]
  28552. this.validateReplyParameters(statusCode, data, responseOptions)
  28553. // Send in-already provided data like usual
  28554. const dispatchData = this.createMockScopeDispatchData(statusCode, data, responseOptions)
  28555. const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], dispatchData)
  28556. return new MockScope(newMockDispatch)
  28557. }
  28558. /**
  28559. * Mock an undici request with a defined error.
  28560. */
  28561. replyWithError (error) {
  28562. if (typeof error === 'undefined') {
  28563. throw new InvalidArgumentError('error must be defined')
  28564. }
  28565. const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], { error })
  28566. return new MockScope(newMockDispatch)
  28567. }
  28568. /**
  28569. * Set default reply headers on the interceptor for subsequent replies
  28570. */
  28571. defaultReplyHeaders (headers) {
  28572. if (typeof headers === 'undefined') {
  28573. throw new InvalidArgumentError('headers must be defined')
  28574. }
  28575. this[kDefaultHeaders] = headers
  28576. return this
  28577. }
  28578. /**
  28579. * Set default reply trailers on the interceptor for subsequent replies
  28580. */
  28581. defaultReplyTrailers (trailers) {
  28582. if (typeof trailers === 'undefined') {
  28583. throw new InvalidArgumentError('trailers must be defined')
  28584. }
  28585. this[kDefaultTrailers] = trailers
  28586. return this
  28587. }
  28588. /**
  28589. * Set reply content length header for replies on the interceptor
  28590. */
  28591. replyContentLength () {
  28592. this[kContentLength] = true
  28593. return this
  28594. }
  28595. }
  28596. module.exports.MockInterceptor = MockInterceptor
  28597. module.exports.MockScope = MockScope
  28598. /***/ }),
  28599. /***/ 6193:
  28600. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  28601. "use strict";
  28602. const { promisify } = __nccwpck_require__(3837)
  28603. const Pool = __nccwpck_require__(4634)
  28604. const { buildMockDispatch } = __nccwpck_require__(9323)
  28605. const {
  28606. kDispatches,
  28607. kMockAgent,
  28608. kClose,
  28609. kOriginalClose,
  28610. kOrigin,
  28611. kOriginalDispatch,
  28612. kConnected
  28613. } = __nccwpck_require__(4347)
  28614. const { MockInterceptor } = __nccwpck_require__(410)
  28615. const Symbols = __nccwpck_require__(2785)
  28616. const { InvalidArgumentError } = __nccwpck_require__(8045)
  28617. /**
  28618. * MockPool provides an API that extends the Pool to influence the mockDispatches.
  28619. */
  28620. class MockPool extends Pool {
  28621. constructor (origin, opts) {
  28622. super(origin, opts)
  28623. if (!opts || !opts.agent || typeof opts.agent.dispatch !== 'function') {
  28624. throw new InvalidArgumentError('Argument opts.agent must implement Agent')
  28625. }
  28626. this[kMockAgent] = opts.agent
  28627. this[kOrigin] = origin
  28628. this[kDispatches] = []
  28629. this[kConnected] = 1
  28630. this[kOriginalDispatch] = this.dispatch
  28631. this[kOriginalClose] = this.close.bind(this)
  28632. this.dispatch = buildMockDispatch.call(this)
  28633. this.close = this[kClose]
  28634. }
  28635. get [Symbols.kConnected] () {
  28636. return this[kConnected]
  28637. }
  28638. /**
  28639. * Sets up the base interceptor for mocking replies from undici.
  28640. */
  28641. intercept (opts) {
  28642. return new MockInterceptor(opts, this[kDispatches])
  28643. }
  28644. async [kClose] () {
  28645. await promisify(this[kOriginalClose])()
  28646. this[kConnected] = 0
  28647. this[kMockAgent][Symbols.kClients].delete(this[kOrigin])
  28648. }
  28649. }
  28650. module.exports = MockPool
  28651. /***/ }),
  28652. /***/ 4347:
  28653. /***/ ((module) => {
  28654. "use strict";
  28655. module.exports = {
  28656. kAgent: Symbol('agent'),
  28657. kOptions: Symbol('options'),
  28658. kFactory: Symbol('factory'),
  28659. kDispatches: Symbol('dispatches'),
  28660. kDispatchKey: Symbol('dispatch key'),
  28661. kDefaultHeaders: Symbol('default headers'),
  28662. kDefaultTrailers: Symbol('default trailers'),
  28663. kContentLength: Symbol('content length'),
  28664. kMockAgent: Symbol('mock agent'),
  28665. kMockAgentSet: Symbol('mock agent set'),
  28666. kMockAgentGet: Symbol('mock agent get'),
  28667. kMockDispatch: Symbol('mock dispatch'),
  28668. kClose: Symbol('close'),
  28669. kOriginalClose: Symbol('original agent close'),
  28670. kOrigin: Symbol('origin'),
  28671. kIsMockActive: Symbol('is mock active'),
  28672. kNetConnect: Symbol('net connect'),
  28673. kGetNetConnect: Symbol('get net connect'),
  28674. kConnected: Symbol('connected')
  28675. }
  28676. /***/ }),
  28677. /***/ 9323:
  28678. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  28679. "use strict";
  28680. const { MockNotMatchedError } = __nccwpck_require__(888)
  28681. const {
  28682. kDispatches,
  28683. kMockAgent,
  28684. kOriginalDispatch,
  28685. kOrigin,
  28686. kGetNetConnect
  28687. } = __nccwpck_require__(4347)
  28688. const { buildURL, nop } = __nccwpck_require__(3983)
  28689. const { STATUS_CODES } = __nccwpck_require__(3685)
  28690. const {
  28691. types: {
  28692. isPromise
  28693. }
  28694. } = __nccwpck_require__(3837)
  28695. function matchValue (match, value) {
  28696. if (typeof match === 'string') {
  28697. return match === value
  28698. }
  28699. if (match instanceof RegExp) {
  28700. return match.test(value)
  28701. }
  28702. if (typeof match === 'function') {
  28703. return match(value) === true
  28704. }
  28705. return false
  28706. }
  28707. function lowerCaseEntries (headers) {
  28708. return Object.fromEntries(
  28709. Object.entries(headers).map(([headerName, headerValue]) => {
  28710. return [headerName.toLocaleLowerCase(), headerValue]
  28711. })
  28712. )
  28713. }
  28714. /**
  28715. * @param {import('../../index').Headers|string[]|Record<string, string>} headers
  28716. * @param {string} key
  28717. */
  28718. function getHeaderByName (headers, key) {
  28719. if (Array.isArray(headers)) {
  28720. for (let i = 0; i < headers.length; i += 2) {
  28721. if (headers[i].toLocaleLowerCase() === key.toLocaleLowerCase()) {
  28722. return headers[i + 1]
  28723. }
  28724. }
  28725. return undefined
  28726. } else if (typeof headers.get === 'function') {
  28727. return headers.get(key)
  28728. } else {
  28729. return lowerCaseEntries(headers)[key.toLocaleLowerCase()]
  28730. }
  28731. }
  28732. /** @param {string[]} headers */
  28733. function buildHeadersFromArray (headers) { // fetch HeadersList
  28734. const clone = headers.slice()
  28735. const entries = []
  28736. for (let index = 0; index < clone.length; index += 2) {
  28737. entries.push([clone[index], clone[index + 1]])
  28738. }
  28739. return Object.fromEntries(entries)
  28740. }
  28741. function matchHeaders (mockDispatch, headers) {
  28742. if (typeof mockDispatch.headers === 'function') {
  28743. if (Array.isArray(headers)) { // fetch HeadersList
  28744. headers = buildHeadersFromArray(headers)
  28745. }
  28746. return mockDispatch.headers(headers ? lowerCaseEntries(headers) : {})
  28747. }
  28748. if (typeof mockDispatch.headers === 'undefined') {
  28749. return true
  28750. }
  28751. if (typeof headers !== 'object' || typeof mockDispatch.headers !== 'object') {
  28752. return false
  28753. }
  28754. for (const [matchHeaderName, matchHeaderValue] of Object.entries(mockDispatch.headers)) {
  28755. const headerValue = getHeaderByName(headers, matchHeaderName)
  28756. if (!matchValue(matchHeaderValue, headerValue)) {
  28757. return false
  28758. }
  28759. }
  28760. return true
  28761. }
  28762. function safeUrl (path) {
  28763. if (typeof path !== 'string') {
  28764. return path
  28765. }
  28766. const pathSegments = path.split('?')
  28767. if (pathSegments.length !== 2) {
  28768. return path
  28769. }
  28770. const qp = new URLSearchParams(pathSegments.pop())
  28771. qp.sort()
  28772. return [...pathSegments, qp.toString()].join('?')
  28773. }
  28774. function matchKey (mockDispatch, { path, method, body, headers }) {
  28775. const pathMatch = matchValue(mockDispatch.path, path)
  28776. const methodMatch = matchValue(mockDispatch.method, method)
  28777. const bodyMatch = typeof mockDispatch.body !== 'undefined' ? matchValue(mockDispatch.body, body) : true
  28778. const headersMatch = matchHeaders(mockDispatch, headers)
  28779. return pathMatch && methodMatch && bodyMatch && headersMatch
  28780. }
  28781. function getResponseData (data) {
  28782. if (Buffer.isBuffer(data)) {
  28783. return data
  28784. } else if (typeof data === 'object') {
  28785. return JSON.stringify(data)
  28786. } else {
  28787. return data.toString()
  28788. }
  28789. }
  28790. function getMockDispatch (mockDispatches, key) {
  28791. const basePath = key.query ? buildURL(key.path, key.query) : key.path
  28792. const resolvedPath = typeof basePath === 'string' ? safeUrl(basePath) : basePath
  28793. // Match path
  28794. let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path }) => matchValue(safeUrl(path), resolvedPath))
  28795. if (matchedMockDispatches.length === 0) {
  28796. throw new MockNotMatchedError(`Mock dispatch not matched for path '${resolvedPath}'`)
  28797. }
  28798. // Match method
  28799. matchedMockDispatches = matchedMockDispatches.filter(({ method }) => matchValue(method, key.method))
  28800. if (matchedMockDispatches.length === 0) {
  28801. throw new MockNotMatchedError(`Mock dispatch not matched for method '${key.method}'`)
  28802. }
  28803. // Match body
  28804. matchedMockDispatches = matchedMockDispatches.filter(({ body }) => typeof body !== 'undefined' ? matchValue(body, key.body) : true)
  28805. if (matchedMockDispatches.length === 0) {
  28806. throw new MockNotMatchedError(`Mock dispatch not matched for body '${key.body}'`)
  28807. }
  28808. // Match headers
  28809. matchedMockDispatches = matchedMockDispatches.filter((mockDispatch) => matchHeaders(mockDispatch, key.headers))
  28810. if (matchedMockDispatches.length === 0) {
  28811. throw new MockNotMatchedError(`Mock dispatch not matched for headers '${typeof key.headers === 'object' ? JSON.stringify(key.headers) : key.headers}'`)
  28812. }
  28813. return matchedMockDispatches[0]
  28814. }
  28815. function addMockDispatch (mockDispatches, key, data) {
  28816. const baseData = { timesInvoked: 0, times: 1, persist: false, consumed: false }
  28817. const replyData = typeof data === 'function' ? { callback: data } : { ...data }
  28818. const newMockDispatch = { ...baseData, ...key, pending: true, data: { error: null, ...replyData } }
  28819. mockDispatches.push(newMockDispatch)
  28820. return newMockDispatch
  28821. }
  28822. function deleteMockDispatch (mockDispatches, key) {
  28823. const index = mockDispatches.findIndex(dispatch => {
  28824. if (!dispatch.consumed) {
  28825. return false
  28826. }
  28827. return matchKey(dispatch, key)
  28828. })
  28829. if (index !== -1) {
  28830. mockDispatches.splice(index, 1)
  28831. }
  28832. }
  28833. function buildKey (opts) {
  28834. const { path, method, body, headers, query } = opts
  28835. return {
  28836. path,
  28837. method,
  28838. body,
  28839. headers,
  28840. query
  28841. }
  28842. }
  28843. function generateKeyValues (data) {
  28844. return Object.entries(data).reduce((keyValuePairs, [key, value]) => [
  28845. ...keyValuePairs,
  28846. Buffer.from(`${key}`),
  28847. Array.isArray(value) ? value.map(x => Buffer.from(`${x}`)) : Buffer.from(`${value}`)
  28848. ], [])
  28849. }
  28850. /**
  28851. * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Status
  28852. * @param {number} statusCode
  28853. */
  28854. function getStatusText (statusCode) {
  28855. return STATUS_CODES[statusCode] || 'unknown'
  28856. }
  28857. async function getResponse (body) {
  28858. const buffers = []
  28859. for await (const data of body) {
  28860. buffers.push(data)
  28861. }
  28862. return Buffer.concat(buffers).toString('utf8')
  28863. }
  28864. /**
  28865. * Mock dispatch function used to simulate undici dispatches
  28866. */
  28867. function mockDispatch (opts, handler) {
  28868. // Get mock dispatch from built key
  28869. const key = buildKey(opts)
  28870. const mockDispatch = getMockDispatch(this[kDispatches], key)
  28871. mockDispatch.timesInvoked++
  28872. // Here's where we resolve a callback if a callback is present for the dispatch data.
  28873. if (mockDispatch.data.callback) {
  28874. mockDispatch.data = { ...mockDispatch.data, ...mockDispatch.data.callback(opts) }
  28875. }
  28876. // Parse mockDispatch data
  28877. const { data: { statusCode, data, headers, trailers, error }, delay, persist } = mockDispatch
  28878. const { timesInvoked, times } = mockDispatch
  28879. // If it's used up and not persistent, mark as consumed
  28880. mockDispatch.consumed = !persist && timesInvoked >= times
  28881. mockDispatch.pending = timesInvoked < times
  28882. // If specified, trigger dispatch error
  28883. if (error !== null) {
  28884. deleteMockDispatch(this[kDispatches], key)
  28885. handler.onError(error)
  28886. return true
  28887. }
  28888. // Handle the request with a delay if necessary
  28889. if (typeof delay === 'number' && delay > 0) {
  28890. setTimeout(() => {
  28891. handleReply(this[kDispatches])
  28892. }, delay)
  28893. } else {
  28894. handleReply(this[kDispatches])
  28895. }
  28896. function handleReply (mockDispatches, _data = data) {
  28897. // fetch's HeadersList is a 1D string array
  28898. const optsHeaders = Array.isArray(opts.headers)
  28899. ? buildHeadersFromArray(opts.headers)
  28900. : opts.headers
  28901. const body = typeof _data === 'function'
  28902. ? _data({ ...opts, headers: optsHeaders })
  28903. : _data
  28904. // util.types.isPromise is likely needed for jest.
  28905. if (isPromise(body)) {
  28906. // If handleReply is asynchronous, throwing an error
  28907. // in the callback will reject the promise, rather than
  28908. // synchronously throw the error, which breaks some tests.
  28909. // Rather, we wait for the callback to resolve if it is a
  28910. // promise, and then re-run handleReply with the new body.
  28911. body.then((newData) => handleReply(mockDispatches, newData))
  28912. return
  28913. }
  28914. const responseData = getResponseData(body)
  28915. const responseHeaders = generateKeyValues(headers)
  28916. const responseTrailers = generateKeyValues(trailers)
  28917. handler.abort = nop
  28918. handler.onHeaders(statusCode, responseHeaders, resume, getStatusText(statusCode))
  28919. handler.onData(Buffer.from(responseData))
  28920. handler.onComplete(responseTrailers)
  28921. deleteMockDispatch(mockDispatches, key)
  28922. }
  28923. function resume () {}
  28924. return true
  28925. }
  28926. function buildMockDispatch () {
  28927. const agent = this[kMockAgent]
  28928. const origin = this[kOrigin]
  28929. const originalDispatch = this[kOriginalDispatch]
  28930. return function dispatch (opts, handler) {
  28931. if (agent.isMockActive) {
  28932. try {
  28933. mockDispatch.call(this, opts, handler)
  28934. } catch (error) {
  28935. if (error instanceof MockNotMatchedError) {
  28936. const netConnect = agent[kGetNetConnect]()
  28937. if (netConnect === false) {
  28938. throw new MockNotMatchedError(`${error.message}: subsequent request to origin ${origin} was not allowed (net.connect disabled)`)
  28939. }
  28940. if (checkNetConnect(netConnect, origin)) {
  28941. originalDispatch.call(this, opts, handler)
  28942. } else {
  28943. throw new MockNotMatchedError(`${error.message}: subsequent request to origin ${origin} was not allowed (net.connect is not enabled for this origin)`)
  28944. }
  28945. } else {
  28946. throw error
  28947. }
  28948. }
  28949. } else {
  28950. originalDispatch.call(this, opts, handler)
  28951. }
  28952. }
  28953. }
  28954. function checkNetConnect (netConnect, origin) {
  28955. const url = new URL(origin)
  28956. if (netConnect === true) {
  28957. return true
  28958. } else if (Array.isArray(netConnect) && netConnect.some((matcher) => matchValue(matcher, url.host))) {
  28959. return true
  28960. }
  28961. return false
  28962. }
  28963. function buildMockOptions (opts) {
  28964. if (opts) {
  28965. const { agent, ...mockOptions } = opts
  28966. return mockOptions
  28967. }
  28968. }
  28969. module.exports = {
  28970. getResponseData,
  28971. getMockDispatch,
  28972. addMockDispatch,
  28973. deleteMockDispatch,
  28974. buildKey,
  28975. generateKeyValues,
  28976. matchValue,
  28977. getResponse,
  28978. getStatusText,
  28979. mockDispatch,
  28980. buildMockDispatch,
  28981. checkNetConnect,
  28982. buildMockOptions,
  28983. getHeaderByName
  28984. }
  28985. /***/ }),
  28986. /***/ 6823:
  28987. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  28988. "use strict";
  28989. const { Transform } = __nccwpck_require__(2781)
  28990. const { Console } = __nccwpck_require__(6206)
  28991. /**
  28992. * Gets the output of `console.table(…)` as a string.
  28993. */
  28994. module.exports = class PendingInterceptorsFormatter {
  28995. constructor ({ disableColors } = {}) {
  28996. this.transform = new Transform({
  28997. transform (chunk, _enc, cb) {
  28998. cb(null, chunk)
  28999. }
  29000. })
  29001. this.logger = new Console({
  29002. stdout: this.transform,
  29003. inspectOptions: {
  29004. colors: !disableColors && !process.env.CI
  29005. }
  29006. })
  29007. }
  29008. format (pendingInterceptors) {
  29009. const withPrettyHeaders = pendingInterceptors.map(
  29010. ({ method, path, data: { statusCode }, persist, times, timesInvoked, origin }) => ({
  29011. Method: method,
  29012. Origin: origin,
  29013. Path: path,
  29014. 'Status code': statusCode,
  29015. Persistent: persist ? '✅' : '❌',
  29016. Invocations: timesInvoked,
  29017. Remaining: persist ? Infinity : times - timesInvoked
  29018. }))
  29019. this.logger.table(withPrettyHeaders)
  29020. return this.transform.read().toString()
  29021. }
  29022. }
  29023. /***/ }),
  29024. /***/ 8891:
  29025. /***/ ((module) => {
  29026. "use strict";
  29027. const singulars = {
  29028. pronoun: 'it',
  29029. is: 'is',
  29030. was: 'was',
  29031. this: 'this'
  29032. }
  29033. const plurals = {
  29034. pronoun: 'they',
  29035. is: 'are',
  29036. was: 'were',
  29037. this: 'these'
  29038. }
  29039. module.exports = class Pluralizer {
  29040. constructor (singular, plural) {
  29041. this.singular = singular
  29042. this.plural = plural
  29043. }
  29044. pluralize (count) {
  29045. const one = count === 1
  29046. const keys = one ? singulars : plurals
  29047. const noun = one ? this.singular : this.plural
  29048. return { ...keys, count, noun }
  29049. }
  29050. }
  29051. /***/ }),
  29052. /***/ 8266:
  29053. /***/ ((module) => {
  29054. "use strict";
  29055. /* eslint-disable */
  29056. // Extracted from node/lib/internal/fixed_queue.js
  29057. // Currently optimal queue size, tested on V8 6.0 - 6.6. Must be power of two.
  29058. const kSize = 2048;
  29059. const kMask = kSize - 1;
  29060. // The FixedQueue is implemented as a singly-linked list of fixed-size
  29061. // circular buffers. It looks something like this:
  29062. //
  29063. // head tail
  29064. // | |
  29065. // v v
  29066. // +-----------+ <-----\ +-----------+ <------\ +-----------+
  29067. // | [null] | \----- | next | \------- | next |
  29068. // +-----------+ +-----------+ +-----------+
  29069. // | item | <-- bottom | item | <-- bottom | [empty] |
  29070. // | item | | item | | [empty] |
  29071. // | item | | item | | [empty] |
  29072. // | item | | item | | [empty] |
  29073. // | item | | item | bottom --> | item |
  29074. // | item | | item | | item |
  29075. // | ... | | ... | | ... |
  29076. // | item | | item | | item |
  29077. // | item | | item | | item |
  29078. // | [empty] | <-- top | item | | item |
  29079. // | [empty] | | item | | item |
  29080. // | [empty] | | [empty] | <-- top top --> | [empty] |
  29081. // +-----------+ +-----------+ +-----------+
  29082. //
  29083. // Or, if there is only one circular buffer, it looks something
  29084. // like either of these:
  29085. //
  29086. // head tail head tail
  29087. // | | | |
  29088. // v v v v
  29089. // +-----------+ +-----------+
  29090. // | [null] | | [null] |
  29091. // +-----------+ +-----------+
  29092. // | [empty] | | item |
  29093. // | [empty] | | item |
  29094. // | item | <-- bottom top --> | [empty] |
  29095. // | item | | [empty] |
  29096. // | [empty] | <-- top bottom --> | item |
  29097. // | [empty] | | item |
  29098. // +-----------+ +-----------+
  29099. //
  29100. // Adding a value means moving `top` forward by one, removing means
  29101. // moving `bottom` forward by one. After reaching the end, the queue
  29102. // wraps around.
  29103. //
  29104. // When `top === bottom` the current queue is empty and when
  29105. // `top + 1 === bottom` it's full. This wastes a single space of storage
  29106. // but allows much quicker checks.
  29107. class FixedCircularBuffer {
  29108. constructor() {
  29109. this.bottom = 0;
  29110. this.top = 0;
  29111. this.list = new Array(kSize);
  29112. this.next = null;
  29113. }
  29114. isEmpty() {
  29115. return this.top === this.bottom;
  29116. }
  29117. isFull() {
  29118. return ((this.top + 1) & kMask) === this.bottom;
  29119. }
  29120. push(data) {
  29121. this.list[this.top] = data;
  29122. this.top = (this.top + 1) & kMask;
  29123. }
  29124. shift() {
  29125. const nextItem = this.list[this.bottom];
  29126. if (nextItem === undefined)
  29127. return null;
  29128. this.list[this.bottom] = undefined;
  29129. this.bottom = (this.bottom + 1) & kMask;
  29130. return nextItem;
  29131. }
  29132. }
  29133. module.exports = class FixedQueue {
  29134. constructor() {
  29135. this.head = this.tail = new FixedCircularBuffer();
  29136. }
  29137. isEmpty() {
  29138. return this.head.isEmpty();
  29139. }
  29140. push(data) {
  29141. if (this.head.isFull()) {
  29142. // Head is full: Creates a new queue, sets the old queue's `.next` to it,
  29143. // and sets it as the new main queue.
  29144. this.head = this.head.next = new FixedCircularBuffer();
  29145. }
  29146. this.head.push(data);
  29147. }
  29148. shift() {
  29149. const tail = this.tail;
  29150. const next = tail.shift();
  29151. if (tail.isEmpty() && tail.next !== null) {
  29152. // If there is another queue, it forms the new tail.
  29153. this.tail = tail.next;
  29154. }
  29155. return next;
  29156. }
  29157. };
  29158. /***/ }),
  29159. /***/ 3198:
  29160. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  29161. "use strict";
  29162. const DispatcherBase = __nccwpck_require__(4839)
  29163. const FixedQueue = __nccwpck_require__(8266)
  29164. const { kConnected, kSize, kRunning, kPending, kQueued, kBusy, kFree, kUrl, kClose, kDestroy, kDispatch } = __nccwpck_require__(2785)
  29165. const PoolStats = __nccwpck_require__(9689)
  29166. const kClients = Symbol('clients')
  29167. const kNeedDrain = Symbol('needDrain')
  29168. const kQueue = Symbol('queue')
  29169. const kClosedResolve = Symbol('closed resolve')
  29170. const kOnDrain = Symbol('onDrain')
  29171. const kOnConnect = Symbol('onConnect')
  29172. const kOnDisconnect = Symbol('onDisconnect')
  29173. const kOnConnectionError = Symbol('onConnectionError')
  29174. const kGetDispatcher = Symbol('get dispatcher')
  29175. const kAddClient = Symbol('add client')
  29176. const kRemoveClient = Symbol('remove client')
  29177. const kStats = Symbol('stats')
  29178. class PoolBase extends DispatcherBase {
  29179. constructor () {
  29180. super()
  29181. this[kQueue] = new FixedQueue()
  29182. this[kClients] = []
  29183. this[kQueued] = 0
  29184. const pool = this
  29185. this[kOnDrain] = function onDrain (origin, targets) {
  29186. const queue = pool[kQueue]
  29187. let needDrain = false
  29188. while (!needDrain) {
  29189. const item = queue.shift()
  29190. if (!item) {
  29191. break
  29192. }
  29193. pool[kQueued]--
  29194. needDrain = !this.dispatch(item.opts, item.handler)
  29195. }
  29196. this[kNeedDrain] = needDrain
  29197. if (!this[kNeedDrain] && pool[kNeedDrain]) {
  29198. pool[kNeedDrain] = false
  29199. pool.emit('drain', origin, [pool, ...targets])
  29200. }
  29201. if (pool[kClosedResolve] && queue.isEmpty()) {
  29202. Promise
  29203. .all(pool[kClients].map(c => c.close()))
  29204. .then(pool[kClosedResolve])
  29205. }
  29206. }
  29207. this[kOnConnect] = (origin, targets) => {
  29208. pool.emit('connect', origin, [pool, ...targets])
  29209. }
  29210. this[kOnDisconnect] = (origin, targets, err) => {
  29211. pool.emit('disconnect', origin, [pool, ...targets], err)
  29212. }
  29213. this[kOnConnectionError] = (origin, targets, err) => {
  29214. pool.emit('connectionError', origin, [pool, ...targets], err)
  29215. }
  29216. this[kStats] = new PoolStats(this)
  29217. }
  29218. get [kBusy] () {
  29219. return this[kNeedDrain]
  29220. }
  29221. get [kConnected] () {
  29222. return this[kClients].filter(client => client[kConnected]).length
  29223. }
  29224. get [kFree] () {
  29225. return this[kClients].filter(client => client[kConnected] && !client[kNeedDrain]).length
  29226. }
  29227. get [kPending] () {
  29228. let ret = this[kQueued]
  29229. for (const { [kPending]: pending } of this[kClients]) {
  29230. ret += pending
  29231. }
  29232. return ret
  29233. }
  29234. get [kRunning] () {
  29235. let ret = 0
  29236. for (const { [kRunning]: running } of this[kClients]) {
  29237. ret += running
  29238. }
  29239. return ret
  29240. }
  29241. get [kSize] () {
  29242. let ret = this[kQueued]
  29243. for (const { [kSize]: size } of this[kClients]) {
  29244. ret += size
  29245. }
  29246. return ret
  29247. }
  29248. get stats () {
  29249. return this[kStats]
  29250. }
  29251. async [kClose] () {
  29252. if (this[kQueue].isEmpty()) {
  29253. return Promise.all(this[kClients].map(c => c.close()))
  29254. } else {
  29255. return new Promise((resolve) => {
  29256. this[kClosedResolve] = resolve
  29257. })
  29258. }
  29259. }
  29260. async [kDestroy] (err) {
  29261. while (true) {
  29262. const item = this[kQueue].shift()
  29263. if (!item) {
  29264. break
  29265. }
  29266. item.handler.onError(err)
  29267. }
  29268. return Promise.all(this[kClients].map(c => c.destroy(err)))
  29269. }
  29270. [kDispatch] (opts, handler) {
  29271. const dispatcher = this[kGetDispatcher]()
  29272. if (!dispatcher) {
  29273. this[kNeedDrain] = true
  29274. this[kQueue].push({ opts, handler })
  29275. this[kQueued]++
  29276. } else if (!dispatcher.dispatch(opts, handler)) {
  29277. dispatcher[kNeedDrain] = true
  29278. this[kNeedDrain] = !this[kGetDispatcher]()
  29279. }
  29280. return !this[kNeedDrain]
  29281. }
  29282. [kAddClient] (client) {
  29283. client
  29284. .on('drain', this[kOnDrain])
  29285. .on('connect', this[kOnConnect])
  29286. .on('disconnect', this[kOnDisconnect])
  29287. .on('connectionError', this[kOnConnectionError])
  29288. this[kClients].push(client)
  29289. if (this[kNeedDrain]) {
  29290. process.nextTick(() => {
  29291. if (this[kNeedDrain]) {
  29292. this[kOnDrain](client[kUrl], [this, client])
  29293. }
  29294. })
  29295. }
  29296. return this
  29297. }
  29298. [kRemoveClient] (client) {
  29299. client.close(() => {
  29300. const idx = this[kClients].indexOf(client)
  29301. if (idx !== -1) {
  29302. this[kClients].splice(idx, 1)
  29303. }
  29304. })
  29305. this[kNeedDrain] = this[kClients].some(dispatcher => (
  29306. !dispatcher[kNeedDrain] &&
  29307. dispatcher.closed !== true &&
  29308. dispatcher.destroyed !== true
  29309. ))
  29310. }
  29311. }
  29312. module.exports = {
  29313. PoolBase,
  29314. kClients,
  29315. kNeedDrain,
  29316. kAddClient,
  29317. kRemoveClient,
  29318. kGetDispatcher
  29319. }
  29320. /***/ }),
  29321. /***/ 9689:
  29322. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  29323. const { kFree, kConnected, kPending, kQueued, kRunning, kSize } = __nccwpck_require__(2785)
  29324. const kPool = Symbol('pool')
  29325. class PoolStats {
  29326. constructor (pool) {
  29327. this[kPool] = pool
  29328. }
  29329. get connected () {
  29330. return this[kPool][kConnected]
  29331. }
  29332. get free () {
  29333. return this[kPool][kFree]
  29334. }
  29335. get pending () {
  29336. return this[kPool][kPending]
  29337. }
  29338. get queued () {
  29339. return this[kPool][kQueued]
  29340. }
  29341. get running () {
  29342. return this[kPool][kRunning]
  29343. }
  29344. get size () {
  29345. return this[kPool][kSize]
  29346. }
  29347. }
  29348. module.exports = PoolStats
  29349. /***/ }),
  29350. /***/ 4634:
  29351. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  29352. "use strict";
  29353. const {
  29354. PoolBase,
  29355. kClients,
  29356. kNeedDrain,
  29357. kAddClient,
  29358. kGetDispatcher
  29359. } = __nccwpck_require__(3198)
  29360. const Client = __nccwpck_require__(3598)
  29361. const {
  29362. InvalidArgumentError
  29363. } = __nccwpck_require__(8045)
  29364. const util = __nccwpck_require__(3983)
  29365. const { kUrl, kInterceptors } = __nccwpck_require__(2785)
  29366. const buildConnector = __nccwpck_require__(2067)
  29367. const kOptions = Symbol('options')
  29368. const kConnections = Symbol('connections')
  29369. const kFactory = Symbol('factory')
  29370. function defaultFactory (origin, opts) {
  29371. return new Client(origin, opts)
  29372. }
  29373. class Pool extends PoolBase {
  29374. constructor (origin, {
  29375. connections,
  29376. factory = defaultFactory,
  29377. connect,
  29378. connectTimeout,
  29379. tls,
  29380. maxCachedSessions,
  29381. socketPath,
  29382. autoSelectFamily,
  29383. autoSelectFamilyAttemptTimeout,
  29384. allowH2,
  29385. ...options
  29386. } = {}) {
  29387. super()
  29388. if (connections != null && (!Number.isFinite(connections) || connections < 0)) {
  29389. throw new InvalidArgumentError('invalid connections')
  29390. }
  29391. if (typeof factory !== 'function') {
  29392. throw new InvalidArgumentError('factory must be a function.')
  29393. }
  29394. if (connect != null && typeof connect !== 'function' && typeof connect !== 'object') {
  29395. throw new InvalidArgumentError('connect must be a function or an object')
  29396. }
  29397. if (typeof connect !== 'function') {
  29398. connect = buildConnector({
  29399. ...tls,
  29400. maxCachedSessions,
  29401. allowH2,
  29402. socketPath,
  29403. timeout: connectTimeout,
  29404. ...(util.nodeHasAutoSelectFamily && autoSelectFamily ? { autoSelectFamily, autoSelectFamilyAttemptTimeout } : undefined),
  29405. ...connect
  29406. })
  29407. }
  29408. this[kInterceptors] = options.interceptors && options.interceptors.Pool && Array.isArray(options.interceptors.Pool)
  29409. ? options.interceptors.Pool
  29410. : []
  29411. this[kConnections] = connections || null
  29412. this[kUrl] = util.parseOrigin(origin)
  29413. this[kOptions] = { ...util.deepClone(options), connect, allowH2 }
  29414. this[kOptions].interceptors = options.interceptors
  29415. ? { ...options.interceptors }
  29416. : undefined
  29417. this[kFactory] = factory
  29418. this.on('connectionError', (origin, targets, error) => {
  29419. // If a connection error occurs, we remove the client from the pool,
  29420. // and emit a connectionError event. They will not be re-used.
  29421. // Fixes https://github.com/nodejs/undici/issues/3895
  29422. for (const target of targets) {
  29423. // Do not use kRemoveClient here, as it will close the client,
  29424. // but the client cannot be closed in this state.
  29425. const idx = this[kClients].indexOf(target)
  29426. if (idx !== -1) {
  29427. this[kClients].splice(idx, 1)
  29428. }
  29429. }
  29430. })
  29431. }
  29432. [kGetDispatcher] () {
  29433. let dispatcher = this[kClients].find(dispatcher => !dispatcher[kNeedDrain])
  29434. if (dispatcher) {
  29435. return dispatcher
  29436. }
  29437. if (!this[kConnections] || this[kClients].length < this[kConnections]) {
  29438. dispatcher = this[kFactory](this[kUrl], this[kOptions])
  29439. this[kAddClient](dispatcher)
  29440. }
  29441. return dispatcher
  29442. }
  29443. }
  29444. module.exports = Pool
  29445. /***/ }),
  29446. /***/ 7858:
  29447. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  29448. "use strict";
  29449. const { kProxy, kClose, kDestroy, kInterceptors } = __nccwpck_require__(2785)
  29450. const { URL } = __nccwpck_require__(7310)
  29451. const Agent = __nccwpck_require__(7890)
  29452. const Pool = __nccwpck_require__(4634)
  29453. const DispatcherBase = __nccwpck_require__(4839)
  29454. const { InvalidArgumentError, RequestAbortedError } = __nccwpck_require__(8045)
  29455. const buildConnector = __nccwpck_require__(2067)
  29456. const kAgent = Symbol('proxy agent')
  29457. const kClient = Symbol('proxy client')
  29458. const kProxyHeaders = Symbol('proxy headers')
  29459. const kRequestTls = Symbol('request tls settings')
  29460. const kProxyTls = Symbol('proxy tls settings')
  29461. const kConnectEndpoint = Symbol('connect endpoint function')
  29462. function defaultProtocolPort (protocol) {
  29463. return protocol === 'https:' ? 443 : 80
  29464. }
  29465. function buildProxyOptions (opts) {
  29466. if (typeof opts === 'string') {
  29467. opts = { uri: opts }
  29468. }
  29469. if (!opts || !opts.uri) {
  29470. throw new InvalidArgumentError('Proxy opts.uri is mandatory')
  29471. }
  29472. return {
  29473. uri: opts.uri,
  29474. protocol: opts.protocol || 'https'
  29475. }
  29476. }
  29477. function defaultFactory (origin, opts) {
  29478. return new Pool(origin, opts)
  29479. }
  29480. class ProxyAgent extends DispatcherBase {
  29481. constructor (opts) {
  29482. super(opts)
  29483. this[kProxy] = buildProxyOptions(opts)
  29484. this[kAgent] = new Agent(opts)
  29485. this[kInterceptors] = opts.interceptors && opts.interceptors.ProxyAgent && Array.isArray(opts.interceptors.ProxyAgent)
  29486. ? opts.interceptors.ProxyAgent
  29487. : []
  29488. if (typeof opts === 'string') {
  29489. opts = { uri: opts }
  29490. }
  29491. if (!opts || !opts.uri) {
  29492. throw new InvalidArgumentError('Proxy opts.uri is mandatory')
  29493. }
  29494. const { clientFactory = defaultFactory } = opts
  29495. if (typeof clientFactory !== 'function') {
  29496. throw new InvalidArgumentError('Proxy opts.clientFactory must be a function.')
  29497. }
  29498. this[kRequestTls] = opts.requestTls
  29499. this[kProxyTls] = opts.proxyTls
  29500. this[kProxyHeaders] = opts.headers || {}
  29501. const resolvedUrl = new URL(opts.uri)
  29502. const { origin, port, host, username, password } = resolvedUrl
  29503. if (opts.auth && opts.token) {
  29504. throw new InvalidArgumentError('opts.auth cannot be used in combination with opts.token')
  29505. } else if (opts.auth) {
  29506. /* @deprecated in favour of opts.token */
  29507. this[kProxyHeaders]['proxy-authorization'] = `Basic ${opts.auth}`
  29508. } else if (opts.token) {
  29509. this[kProxyHeaders]['proxy-authorization'] = opts.token
  29510. } else if (username && password) {
  29511. this[kProxyHeaders]['proxy-authorization'] = `Basic ${Buffer.from(`${decodeURIComponent(username)}:${decodeURIComponent(password)}`).toString('base64')}`
  29512. }
  29513. const connect = buildConnector({ ...opts.proxyTls })
  29514. this[kConnectEndpoint] = buildConnector({ ...opts.requestTls })
  29515. this[kClient] = clientFactory(resolvedUrl, { connect })
  29516. this[kAgent] = new Agent({
  29517. ...opts,
  29518. connect: async (opts, callback) => {
  29519. let requestedHost = opts.host
  29520. if (!opts.port) {
  29521. requestedHost += `:${defaultProtocolPort(opts.protocol)}`
  29522. }
  29523. try {
  29524. const { socket, statusCode } = await this[kClient].connect({
  29525. origin,
  29526. port,
  29527. path: requestedHost,
  29528. signal: opts.signal,
  29529. headers: {
  29530. ...this[kProxyHeaders],
  29531. host
  29532. }
  29533. })
  29534. if (statusCode !== 200) {
  29535. socket.on('error', () => {}).destroy()
  29536. callback(new RequestAbortedError(`Proxy response (${statusCode}) !== 200 when HTTP Tunneling`))
  29537. }
  29538. if (opts.protocol !== 'https:') {
  29539. callback(null, socket)
  29540. return
  29541. }
  29542. let servername
  29543. if (this[kRequestTls]) {
  29544. servername = this[kRequestTls].servername
  29545. } else {
  29546. servername = opts.servername
  29547. }
  29548. this[kConnectEndpoint]({ ...opts, servername, httpSocket: socket }, callback)
  29549. } catch (err) {
  29550. callback(err)
  29551. }
  29552. }
  29553. })
  29554. }
  29555. dispatch (opts, handler) {
  29556. const { host } = new URL(opts.origin)
  29557. const headers = buildHeaders(opts.headers)
  29558. throwIfProxyAuthIsSent(headers)
  29559. return this[kAgent].dispatch(
  29560. {
  29561. ...opts,
  29562. headers: {
  29563. ...headers,
  29564. host
  29565. }
  29566. },
  29567. handler
  29568. )
  29569. }
  29570. async [kClose] () {
  29571. await this[kAgent].close()
  29572. await this[kClient].close()
  29573. }
  29574. async [kDestroy] () {
  29575. await this[kAgent].destroy()
  29576. await this[kClient].destroy()
  29577. }
  29578. }
  29579. /**
  29580. * @param {string[] | Record<string, string>} headers
  29581. * @returns {Record<string, string>}
  29582. */
  29583. function buildHeaders (headers) {
  29584. // When using undici.fetch, the headers list is stored
  29585. // as an array.
  29586. if (Array.isArray(headers)) {
  29587. /** @type {Record<string, string>} */
  29588. const headersPair = {}
  29589. for (let i = 0; i < headers.length; i += 2) {
  29590. headersPair[headers[i]] = headers[i + 1]
  29591. }
  29592. return headersPair
  29593. }
  29594. return headers
  29595. }
  29596. /**
  29597. * @param {Record<string, string>} headers
  29598. *
  29599. * Previous versions of ProxyAgent suggests the Proxy-Authorization in request headers
  29600. * Nevertheless, it was changed and to avoid a security vulnerability by end users
  29601. * this check was created.
  29602. * It should be removed in the next major version for performance reasons
  29603. */
  29604. function throwIfProxyAuthIsSent (headers) {
  29605. const existProxyAuth = headers && Object.keys(headers)
  29606. .find((key) => key.toLowerCase() === 'proxy-authorization')
  29607. if (existProxyAuth) {
  29608. throw new InvalidArgumentError('Proxy-Authorization should be sent in ProxyAgent constructor')
  29609. }
  29610. }
  29611. module.exports = ProxyAgent
  29612. /***/ }),
  29613. /***/ 9459:
  29614. /***/ ((module) => {
  29615. "use strict";
  29616. let fastNow = Date.now()
  29617. let fastNowTimeout
  29618. const fastTimers = []
  29619. function onTimeout () {
  29620. fastNow = Date.now()
  29621. let len = fastTimers.length
  29622. let idx = 0
  29623. while (idx < len) {
  29624. const timer = fastTimers[idx]
  29625. if (timer.state === 0) {
  29626. timer.state = fastNow + timer.delay
  29627. } else if (timer.state > 0 && fastNow >= timer.state) {
  29628. timer.state = -1
  29629. timer.callback(timer.opaque)
  29630. }
  29631. if (timer.state === -1) {
  29632. timer.state = -2
  29633. if (idx !== len - 1) {
  29634. fastTimers[idx] = fastTimers.pop()
  29635. } else {
  29636. fastTimers.pop()
  29637. }
  29638. len -= 1
  29639. } else {
  29640. idx += 1
  29641. }
  29642. }
  29643. if (fastTimers.length > 0) {
  29644. refreshTimeout()
  29645. }
  29646. }
  29647. function refreshTimeout () {
  29648. if (fastNowTimeout && fastNowTimeout.refresh) {
  29649. fastNowTimeout.refresh()
  29650. } else {
  29651. clearTimeout(fastNowTimeout)
  29652. fastNowTimeout = setTimeout(onTimeout, 1e3)
  29653. if (fastNowTimeout.unref) {
  29654. fastNowTimeout.unref()
  29655. }
  29656. }
  29657. }
  29658. class Timeout {
  29659. constructor (callback, delay, opaque) {
  29660. this.callback = callback
  29661. this.delay = delay
  29662. this.opaque = opaque
  29663. // -2 not in timer list
  29664. // -1 in timer list but inactive
  29665. // 0 in timer list waiting for time
  29666. // > 0 in timer list waiting for time to expire
  29667. this.state = -2
  29668. this.refresh()
  29669. }
  29670. refresh () {
  29671. if (this.state === -2) {
  29672. fastTimers.push(this)
  29673. if (!fastNowTimeout || fastTimers.length === 1) {
  29674. refreshTimeout()
  29675. }
  29676. }
  29677. this.state = 0
  29678. }
  29679. clear () {
  29680. this.state = -1
  29681. }
  29682. }
  29683. module.exports = {
  29684. setTimeout (callback, delay, opaque) {
  29685. return delay < 1e3
  29686. ? setTimeout(callback, delay, opaque)
  29687. : new Timeout(callback, delay, opaque)
  29688. },
  29689. clearTimeout (timeout) {
  29690. if (timeout instanceof Timeout) {
  29691. timeout.clear()
  29692. } else {
  29693. clearTimeout(timeout)
  29694. }
  29695. }
  29696. }
  29697. /***/ }),
  29698. /***/ 5354:
  29699. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  29700. "use strict";
  29701. const diagnosticsChannel = __nccwpck_require__(7643)
  29702. const { uid, states } = __nccwpck_require__(9188)
  29703. const {
  29704. kReadyState,
  29705. kSentClose,
  29706. kByteParser,
  29707. kReceivedClose
  29708. } = __nccwpck_require__(7578)
  29709. const { fireEvent, failWebsocketConnection } = __nccwpck_require__(5515)
  29710. const { CloseEvent } = __nccwpck_require__(2611)
  29711. const { makeRequest } = __nccwpck_require__(8359)
  29712. const { fetching } = __nccwpck_require__(4881)
  29713. const { Headers } = __nccwpck_require__(554)
  29714. const { getGlobalDispatcher } = __nccwpck_require__(1892)
  29715. const { kHeadersList } = __nccwpck_require__(2785)
  29716. const channels = {}
  29717. channels.open = diagnosticsChannel.channel('undici:websocket:open')
  29718. channels.close = diagnosticsChannel.channel('undici:websocket:close')
  29719. channels.socketError = diagnosticsChannel.channel('undici:websocket:socket_error')
  29720. /** @type {import('crypto')} */
  29721. let crypto
  29722. try {
  29723. crypto = __nccwpck_require__(6113)
  29724. } catch {
  29725. }
  29726. /**
  29727. * @see https://websockets.spec.whatwg.org/#concept-websocket-establish
  29728. * @param {URL} url
  29729. * @param {string|string[]} protocols
  29730. * @param {import('./websocket').WebSocket} ws
  29731. * @param {(response: any) => void} onEstablish
  29732. * @param {Partial<import('../../types/websocket').WebSocketInit>} options
  29733. */
  29734. function establishWebSocketConnection (url, protocols, ws, onEstablish, options) {
  29735. // 1. Let requestURL be a copy of url, with its scheme set to "http", if url’s
  29736. // scheme is "ws", and to "https" otherwise.
  29737. const requestURL = url
  29738. requestURL.protocol = url.protocol === 'ws:' ? 'http:' : 'https:'
  29739. // 2. Let request be a new request, whose URL is requestURL, client is client,
  29740. // service-workers mode is "none", referrer is "no-referrer", mode is
  29741. // "websocket", credentials mode is "include", cache mode is "no-store" ,
  29742. // and redirect mode is "error".
  29743. const request = makeRequest({
  29744. urlList: [requestURL],
  29745. serviceWorkers: 'none',
  29746. referrer: 'no-referrer',
  29747. mode: 'websocket',
  29748. credentials: 'include',
  29749. cache: 'no-store',
  29750. redirect: 'error'
  29751. })
  29752. // Note: undici extension, allow setting custom headers.
  29753. if (options.headers) {
  29754. const headersList = new Headers(options.headers)[kHeadersList]
  29755. request.headersList = headersList
  29756. }
  29757. // 3. Append (`Upgrade`, `websocket`) to request’s header list.
  29758. // 4. Append (`Connection`, `Upgrade`) to request’s header list.
  29759. // Note: both of these are handled by undici currently.
  29760. // https://github.com/nodejs/undici/blob/68c269c4144c446f3f1220951338daef4a6b5ec4/lib/client.js#L1397
  29761. // 5. Let keyValue be a nonce consisting of a randomly selected
  29762. // 16-byte value that has been forgiving-base64-encoded and
  29763. // isomorphic encoded.
  29764. const keyValue = crypto.randomBytes(16).toString('base64')
  29765. // 6. Append (`Sec-WebSocket-Key`, keyValue) to request’s
  29766. // header list.
  29767. request.headersList.append('sec-websocket-key', keyValue)
  29768. // 7. Append (`Sec-WebSocket-Version`, `13`) to request’s
  29769. // header list.
  29770. request.headersList.append('sec-websocket-version', '13')
  29771. // 8. For each protocol in protocols, combine
  29772. // (`Sec-WebSocket-Protocol`, protocol) in request’s header
  29773. // list.
  29774. for (const protocol of protocols) {
  29775. request.headersList.append('sec-websocket-protocol', protocol)
  29776. }
  29777. // 9. Let permessageDeflate be a user-agent defined
  29778. // "permessage-deflate" extension header value.
  29779. // https://github.com/mozilla/gecko-dev/blob/ce78234f5e653a5d3916813ff990f053510227bc/netwerk/protocol/websocket/WebSocketChannel.cpp#L2673
  29780. // TODO: enable once permessage-deflate is supported
  29781. const permessageDeflate = '' // 'permessage-deflate; 15'
  29782. // 10. Append (`Sec-WebSocket-Extensions`, permessageDeflate) to
  29783. // request’s header list.
  29784. // request.headersList.append('sec-websocket-extensions', permessageDeflate)
  29785. // 11. Fetch request with useParallelQueue set to true, and
  29786. // processResponse given response being these steps:
  29787. const controller = fetching({
  29788. request,
  29789. useParallelQueue: true,
  29790. dispatcher: options.dispatcher ?? getGlobalDispatcher(),
  29791. processResponse (response) {
  29792. // 1. If response is a network error or its status is not 101,
  29793. // fail the WebSocket connection.
  29794. if (response.type === 'error' || response.status !== 101) {
  29795. failWebsocketConnection(ws, 'Received network error or non-101 status code.')
  29796. return
  29797. }
  29798. // 2. If protocols is not the empty list and extracting header
  29799. // list values given `Sec-WebSocket-Protocol` and response’s
  29800. // header list results in null, failure, or the empty byte
  29801. // sequence, then fail the WebSocket connection.
  29802. if (protocols.length !== 0 && !response.headersList.get('Sec-WebSocket-Protocol')) {
  29803. failWebsocketConnection(ws, 'Server did not respond with sent protocols.')
  29804. return
  29805. }
  29806. // 3. Follow the requirements stated step 2 to step 6, inclusive,
  29807. // of the last set of steps in section 4.1 of The WebSocket
  29808. // Protocol to validate response. This either results in fail
  29809. // the WebSocket connection or the WebSocket connection is
  29810. // established.
  29811. // 2. If the response lacks an |Upgrade| header field or the |Upgrade|
  29812. // header field contains a value that is not an ASCII case-
  29813. // insensitive match for the value "websocket", the client MUST
  29814. // _Fail the WebSocket Connection_.
  29815. if (response.headersList.get('Upgrade')?.toLowerCase() !== 'websocket') {
  29816. failWebsocketConnection(ws, 'Server did not set Upgrade header to "websocket".')
  29817. return
  29818. }
  29819. // 3. If the response lacks a |Connection| header field or the
  29820. // |Connection| header field doesn't contain a token that is an
  29821. // ASCII case-insensitive match for the value "Upgrade", the client
  29822. // MUST _Fail the WebSocket Connection_.
  29823. if (response.headersList.get('Connection')?.toLowerCase() !== 'upgrade') {
  29824. failWebsocketConnection(ws, 'Server did not set Connection header to "upgrade".')
  29825. return
  29826. }
  29827. // 4. If the response lacks a |Sec-WebSocket-Accept| header field or
  29828. // the |Sec-WebSocket-Accept| contains a value other than the
  29829. // base64-encoded SHA-1 of the concatenation of the |Sec-WebSocket-
  29830. // Key| (as a string, not base64-decoded) with the string "258EAFA5-
  29831. // E914-47DA-95CA-C5AB0DC85B11" but ignoring any leading and
  29832. // trailing whitespace, the client MUST _Fail the WebSocket
  29833. // Connection_.
  29834. const secWSAccept = response.headersList.get('Sec-WebSocket-Accept')
  29835. const digest = crypto.createHash('sha1').update(keyValue + uid).digest('base64')
  29836. if (secWSAccept !== digest) {
  29837. failWebsocketConnection(ws, 'Incorrect hash received in Sec-WebSocket-Accept header.')
  29838. return
  29839. }
  29840. // 5. If the response includes a |Sec-WebSocket-Extensions| header
  29841. // field and this header field indicates the use of an extension
  29842. // that was not present in the client's handshake (the server has
  29843. // indicated an extension not requested by the client), the client
  29844. // MUST _Fail the WebSocket Connection_. (The parsing of this
  29845. // header field to determine which extensions are requested is
  29846. // discussed in Section 9.1.)
  29847. const secExtension = response.headersList.get('Sec-WebSocket-Extensions')
  29848. if (secExtension !== null && secExtension !== permessageDeflate) {
  29849. failWebsocketConnection(ws, 'Received different permessage-deflate than the one set.')
  29850. return
  29851. }
  29852. // 6. If the response includes a |Sec-WebSocket-Protocol| header field
  29853. // and this header field indicates the use of a subprotocol that was
  29854. // not present in the client's handshake (the server has indicated a
  29855. // subprotocol not requested by the client), the client MUST _Fail
  29856. // the WebSocket Connection_.
  29857. const secProtocol = response.headersList.get('Sec-WebSocket-Protocol')
  29858. if (secProtocol !== null && secProtocol !== request.headersList.get('Sec-WebSocket-Protocol')) {
  29859. failWebsocketConnection(ws, 'Protocol was not set in the opening handshake.')
  29860. return
  29861. }
  29862. response.socket.on('data', onSocketData)
  29863. response.socket.on('close', onSocketClose)
  29864. response.socket.on('error', onSocketError)
  29865. if (channels.open.hasSubscribers) {
  29866. channels.open.publish({
  29867. address: response.socket.address(),
  29868. protocol: secProtocol,
  29869. extensions: secExtension
  29870. })
  29871. }
  29872. onEstablish(response)
  29873. }
  29874. })
  29875. return controller
  29876. }
  29877. /**
  29878. * @param {Buffer} chunk
  29879. */
  29880. function onSocketData (chunk) {
  29881. if (!this.ws[kByteParser].write(chunk)) {
  29882. this.pause()
  29883. }
  29884. }
  29885. /**
  29886. * @see https://websockets.spec.whatwg.org/#feedback-from-the-protocol
  29887. * @see https://datatracker.ietf.org/doc/html/rfc6455#section-7.1.4
  29888. */
  29889. function onSocketClose () {
  29890. const { ws } = this
  29891. // If the TCP connection was closed after the
  29892. // WebSocket closing handshake was completed, the WebSocket connection
  29893. // is said to have been closed _cleanly_.
  29894. const wasClean = ws[kSentClose] && ws[kReceivedClose]
  29895. let code = 1005
  29896. let reason = ''
  29897. const result = ws[kByteParser].closingInfo
  29898. if (result) {
  29899. code = result.code ?? 1005
  29900. reason = result.reason
  29901. } else if (!ws[kSentClose]) {
  29902. // If _The WebSocket
  29903. // Connection is Closed_ and no Close control frame was received by the
  29904. // endpoint (such as could occur if the underlying transport connection
  29905. // is lost), _The WebSocket Connection Close Code_ is considered to be
  29906. // 1006.
  29907. code = 1006
  29908. }
  29909. // 1. Change the ready state to CLOSED (3).
  29910. ws[kReadyState] = states.CLOSED
  29911. // 2. If the user agent was required to fail the WebSocket
  29912. // connection, or if the WebSocket connection was closed
  29913. // after being flagged as full, fire an event named error
  29914. // at the WebSocket object.
  29915. // TODO
  29916. // 3. Fire an event named close at the WebSocket object,
  29917. // using CloseEvent, with the wasClean attribute
  29918. // initialized to true if the connection closed cleanly
  29919. // and false otherwise, the code attribute initialized to
  29920. // the WebSocket connection close code, and the reason
  29921. // attribute initialized to the result of applying UTF-8
  29922. // decode without BOM to the WebSocket connection close
  29923. // reason.
  29924. fireEvent('close', ws, CloseEvent, {
  29925. wasClean, code, reason
  29926. })
  29927. if (channels.close.hasSubscribers) {
  29928. channels.close.publish({
  29929. websocket: ws,
  29930. code,
  29931. reason
  29932. })
  29933. }
  29934. }
  29935. function onSocketError (error) {
  29936. const { ws } = this
  29937. ws[kReadyState] = states.CLOSING
  29938. if (channels.socketError.hasSubscribers) {
  29939. channels.socketError.publish(error)
  29940. }
  29941. this.destroy()
  29942. }
  29943. module.exports = {
  29944. establishWebSocketConnection
  29945. }
  29946. /***/ }),
  29947. /***/ 9188:
  29948. /***/ ((module) => {
  29949. "use strict";
  29950. // This is a Globally Unique Identifier unique used
  29951. // to validate that the endpoint accepts websocket
  29952. // connections.
  29953. // See https://www.rfc-editor.org/rfc/rfc6455.html#section-1.3
  29954. const uid = '258EAFA5-E914-47DA-95CA-C5AB0DC85B11'
  29955. /** @type {PropertyDescriptor} */
  29956. const staticPropertyDescriptors = {
  29957. enumerable: true,
  29958. writable: false,
  29959. configurable: false
  29960. }
  29961. const states = {
  29962. CONNECTING: 0,
  29963. OPEN: 1,
  29964. CLOSING: 2,
  29965. CLOSED: 3
  29966. }
  29967. const opcodes = {
  29968. CONTINUATION: 0x0,
  29969. TEXT: 0x1,
  29970. BINARY: 0x2,
  29971. CLOSE: 0x8,
  29972. PING: 0x9,
  29973. PONG: 0xA
  29974. }
  29975. const maxUnsigned16Bit = 2 ** 16 - 1 // 65535
  29976. const parserStates = {
  29977. INFO: 0,
  29978. PAYLOADLENGTH_16: 2,
  29979. PAYLOADLENGTH_64: 3,
  29980. READ_DATA: 4
  29981. }
  29982. const emptyBuffer = Buffer.allocUnsafe(0)
  29983. module.exports = {
  29984. uid,
  29985. staticPropertyDescriptors,
  29986. states,
  29987. opcodes,
  29988. maxUnsigned16Bit,
  29989. parserStates,
  29990. emptyBuffer
  29991. }
  29992. /***/ }),
  29993. /***/ 2611:
  29994. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  29995. "use strict";
  29996. const { webidl } = __nccwpck_require__(1744)
  29997. const { kEnumerableProperty } = __nccwpck_require__(3983)
  29998. const { MessagePort } = __nccwpck_require__(1267)
  29999. /**
  30000. * @see https://html.spec.whatwg.org/multipage/comms.html#messageevent
  30001. */
  30002. class MessageEvent extends Event {
  30003. #eventInit
  30004. constructor (type, eventInitDict = {}) {
  30005. webidl.argumentLengthCheck(arguments, 1, { header: 'MessageEvent constructor' })
  30006. type = webidl.converters.DOMString(type)
  30007. eventInitDict = webidl.converters.MessageEventInit(eventInitDict)
  30008. super(type, eventInitDict)
  30009. this.#eventInit = eventInitDict
  30010. }
  30011. get data () {
  30012. webidl.brandCheck(this, MessageEvent)
  30013. return this.#eventInit.data
  30014. }
  30015. get origin () {
  30016. webidl.brandCheck(this, MessageEvent)
  30017. return this.#eventInit.origin
  30018. }
  30019. get lastEventId () {
  30020. webidl.brandCheck(this, MessageEvent)
  30021. return this.#eventInit.lastEventId
  30022. }
  30023. get source () {
  30024. webidl.brandCheck(this, MessageEvent)
  30025. return this.#eventInit.source
  30026. }
  30027. get ports () {
  30028. webidl.brandCheck(this, MessageEvent)
  30029. if (!Object.isFrozen(this.#eventInit.ports)) {
  30030. Object.freeze(this.#eventInit.ports)
  30031. }
  30032. return this.#eventInit.ports
  30033. }
  30034. initMessageEvent (
  30035. type,
  30036. bubbles = false,
  30037. cancelable = false,
  30038. data = null,
  30039. origin = '',
  30040. lastEventId = '',
  30041. source = null,
  30042. ports = []
  30043. ) {
  30044. webidl.brandCheck(this, MessageEvent)
  30045. webidl.argumentLengthCheck(arguments, 1, { header: 'MessageEvent.initMessageEvent' })
  30046. return new MessageEvent(type, {
  30047. bubbles, cancelable, data, origin, lastEventId, source, ports
  30048. })
  30049. }
  30050. }
  30051. /**
  30052. * @see https://websockets.spec.whatwg.org/#the-closeevent-interface
  30053. */
  30054. class CloseEvent extends Event {
  30055. #eventInit
  30056. constructor (type, eventInitDict = {}) {
  30057. webidl.argumentLengthCheck(arguments, 1, { header: 'CloseEvent constructor' })
  30058. type = webidl.converters.DOMString(type)
  30059. eventInitDict = webidl.converters.CloseEventInit(eventInitDict)
  30060. super(type, eventInitDict)
  30061. this.#eventInit = eventInitDict
  30062. }
  30063. get wasClean () {
  30064. webidl.brandCheck(this, CloseEvent)
  30065. return this.#eventInit.wasClean
  30066. }
  30067. get code () {
  30068. webidl.brandCheck(this, CloseEvent)
  30069. return this.#eventInit.code
  30070. }
  30071. get reason () {
  30072. webidl.brandCheck(this, CloseEvent)
  30073. return this.#eventInit.reason
  30074. }
  30075. }
  30076. // https://html.spec.whatwg.org/multipage/webappapis.html#the-errorevent-interface
  30077. class ErrorEvent extends Event {
  30078. #eventInit
  30079. constructor (type, eventInitDict) {
  30080. webidl.argumentLengthCheck(arguments, 1, { header: 'ErrorEvent constructor' })
  30081. super(type, eventInitDict)
  30082. type = webidl.converters.DOMString(type)
  30083. eventInitDict = webidl.converters.ErrorEventInit(eventInitDict ?? {})
  30084. this.#eventInit = eventInitDict
  30085. }
  30086. get message () {
  30087. webidl.brandCheck(this, ErrorEvent)
  30088. return this.#eventInit.message
  30089. }
  30090. get filename () {
  30091. webidl.brandCheck(this, ErrorEvent)
  30092. return this.#eventInit.filename
  30093. }
  30094. get lineno () {
  30095. webidl.brandCheck(this, ErrorEvent)
  30096. return this.#eventInit.lineno
  30097. }
  30098. get colno () {
  30099. webidl.brandCheck(this, ErrorEvent)
  30100. return this.#eventInit.colno
  30101. }
  30102. get error () {
  30103. webidl.brandCheck(this, ErrorEvent)
  30104. return this.#eventInit.error
  30105. }
  30106. }
  30107. Object.defineProperties(MessageEvent.prototype, {
  30108. [Symbol.toStringTag]: {
  30109. value: 'MessageEvent',
  30110. configurable: true
  30111. },
  30112. data: kEnumerableProperty,
  30113. origin: kEnumerableProperty,
  30114. lastEventId: kEnumerableProperty,
  30115. source: kEnumerableProperty,
  30116. ports: kEnumerableProperty,
  30117. initMessageEvent: kEnumerableProperty
  30118. })
  30119. Object.defineProperties(CloseEvent.prototype, {
  30120. [Symbol.toStringTag]: {
  30121. value: 'CloseEvent',
  30122. configurable: true
  30123. },
  30124. reason: kEnumerableProperty,
  30125. code: kEnumerableProperty,
  30126. wasClean: kEnumerableProperty
  30127. })
  30128. Object.defineProperties(ErrorEvent.prototype, {
  30129. [Symbol.toStringTag]: {
  30130. value: 'ErrorEvent',
  30131. configurable: true
  30132. },
  30133. message: kEnumerableProperty,
  30134. filename: kEnumerableProperty,
  30135. lineno: kEnumerableProperty,
  30136. colno: kEnumerableProperty,
  30137. error: kEnumerableProperty
  30138. })
  30139. webidl.converters.MessagePort = webidl.interfaceConverter(MessagePort)
  30140. webidl.converters['sequence<MessagePort>'] = webidl.sequenceConverter(
  30141. webidl.converters.MessagePort
  30142. )
  30143. const eventInit = [
  30144. {
  30145. key: 'bubbles',
  30146. converter: webidl.converters.boolean,
  30147. defaultValue: false
  30148. },
  30149. {
  30150. key: 'cancelable',
  30151. converter: webidl.converters.boolean,
  30152. defaultValue: false
  30153. },
  30154. {
  30155. key: 'composed',
  30156. converter: webidl.converters.boolean,
  30157. defaultValue: false
  30158. }
  30159. ]
  30160. webidl.converters.MessageEventInit = webidl.dictionaryConverter([
  30161. ...eventInit,
  30162. {
  30163. key: 'data',
  30164. converter: webidl.converters.any,
  30165. defaultValue: null
  30166. },
  30167. {
  30168. key: 'origin',
  30169. converter: webidl.converters.USVString,
  30170. defaultValue: ''
  30171. },
  30172. {
  30173. key: 'lastEventId',
  30174. converter: webidl.converters.DOMString,
  30175. defaultValue: ''
  30176. },
  30177. {
  30178. key: 'source',
  30179. // Node doesn't implement WindowProxy or ServiceWorker, so the only
  30180. // valid value for source is a MessagePort.
  30181. converter: webidl.nullableConverter(webidl.converters.MessagePort),
  30182. defaultValue: null
  30183. },
  30184. {
  30185. key: 'ports',
  30186. converter: webidl.converters['sequence<MessagePort>'],
  30187. get defaultValue () {
  30188. return []
  30189. }
  30190. }
  30191. ])
  30192. webidl.converters.CloseEventInit = webidl.dictionaryConverter([
  30193. ...eventInit,
  30194. {
  30195. key: 'wasClean',
  30196. converter: webidl.converters.boolean,
  30197. defaultValue: false
  30198. },
  30199. {
  30200. key: 'code',
  30201. converter: webidl.converters['unsigned short'],
  30202. defaultValue: 0
  30203. },
  30204. {
  30205. key: 'reason',
  30206. converter: webidl.converters.USVString,
  30207. defaultValue: ''
  30208. }
  30209. ])
  30210. webidl.converters.ErrorEventInit = webidl.dictionaryConverter([
  30211. ...eventInit,
  30212. {
  30213. key: 'message',
  30214. converter: webidl.converters.DOMString,
  30215. defaultValue: ''
  30216. },
  30217. {
  30218. key: 'filename',
  30219. converter: webidl.converters.USVString,
  30220. defaultValue: ''
  30221. },
  30222. {
  30223. key: 'lineno',
  30224. converter: webidl.converters['unsigned long'],
  30225. defaultValue: 0
  30226. },
  30227. {
  30228. key: 'colno',
  30229. converter: webidl.converters['unsigned long'],
  30230. defaultValue: 0
  30231. },
  30232. {
  30233. key: 'error',
  30234. converter: webidl.converters.any
  30235. }
  30236. ])
  30237. module.exports = {
  30238. MessageEvent,
  30239. CloseEvent,
  30240. ErrorEvent
  30241. }
  30242. /***/ }),
  30243. /***/ 5444:
  30244. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  30245. "use strict";
  30246. const { maxUnsigned16Bit } = __nccwpck_require__(9188)
  30247. /** @type {import('crypto')} */
  30248. let crypto
  30249. try {
  30250. crypto = __nccwpck_require__(6113)
  30251. } catch {
  30252. }
  30253. class WebsocketFrameSend {
  30254. /**
  30255. * @param {Buffer|undefined} data
  30256. */
  30257. constructor (data) {
  30258. this.frameData = data
  30259. this.maskKey = crypto.randomBytes(4)
  30260. }
  30261. createFrame (opcode) {
  30262. const bodyLength = this.frameData?.byteLength ?? 0
  30263. /** @type {number} */
  30264. let payloadLength = bodyLength // 0-125
  30265. let offset = 6
  30266. if (bodyLength > maxUnsigned16Bit) {
  30267. offset += 8 // payload length is next 8 bytes
  30268. payloadLength = 127
  30269. } else if (bodyLength > 125) {
  30270. offset += 2 // payload length is next 2 bytes
  30271. payloadLength = 126
  30272. }
  30273. const buffer = Buffer.allocUnsafe(bodyLength + offset)
  30274. // Clear first 2 bytes, everything else is overwritten
  30275. buffer[0] = buffer[1] = 0
  30276. buffer[0] |= 0x80 // FIN
  30277. buffer[0] = (buffer[0] & 0xF0) + opcode // opcode
  30278. /*! ws. MIT License. Einar Otto Stangvik <einaros@gmail.com> */
  30279. buffer[offset - 4] = this.maskKey[0]
  30280. buffer[offset - 3] = this.maskKey[1]
  30281. buffer[offset - 2] = this.maskKey[2]
  30282. buffer[offset - 1] = this.maskKey[3]
  30283. buffer[1] = payloadLength
  30284. if (payloadLength === 126) {
  30285. buffer.writeUInt16BE(bodyLength, 2)
  30286. } else if (payloadLength === 127) {
  30287. // Clear extended payload length
  30288. buffer[2] = buffer[3] = 0
  30289. buffer.writeUIntBE(bodyLength, 4, 6)
  30290. }
  30291. buffer[1] |= 0x80 // MASK
  30292. // mask body
  30293. for (let i = 0; i < bodyLength; i++) {
  30294. buffer[offset + i] = this.frameData[i] ^ this.maskKey[i % 4]
  30295. }
  30296. return buffer
  30297. }
  30298. }
  30299. module.exports = {
  30300. WebsocketFrameSend
  30301. }
  30302. /***/ }),
  30303. /***/ 1688:
  30304. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  30305. "use strict";
  30306. const { Writable } = __nccwpck_require__(2781)
  30307. const diagnosticsChannel = __nccwpck_require__(7643)
  30308. const { parserStates, opcodes, states, emptyBuffer } = __nccwpck_require__(9188)
  30309. const { kReadyState, kSentClose, kResponse, kReceivedClose } = __nccwpck_require__(7578)
  30310. const { isValidStatusCode, failWebsocketConnection, websocketMessageReceived } = __nccwpck_require__(5515)
  30311. const { WebsocketFrameSend } = __nccwpck_require__(5444)
  30312. // This code was influenced by ws released under the MIT license.
  30313. // Copyright (c) 2011 Einar Otto Stangvik <einaros@gmail.com>
  30314. // Copyright (c) 2013 Arnout Kazemier and contributors
  30315. // Copyright (c) 2016 Luigi Pinca and contributors
  30316. const channels = {}
  30317. channels.ping = diagnosticsChannel.channel('undici:websocket:ping')
  30318. channels.pong = diagnosticsChannel.channel('undici:websocket:pong')
  30319. class ByteParser extends Writable {
  30320. #buffers = []
  30321. #byteOffset = 0
  30322. #state = parserStates.INFO
  30323. #info = {}
  30324. #fragments = []
  30325. constructor (ws) {
  30326. super()
  30327. this.ws = ws
  30328. }
  30329. /**
  30330. * @param {Buffer} chunk
  30331. * @param {() => void} callback
  30332. */
  30333. _write (chunk, _, callback) {
  30334. this.#buffers.push(chunk)
  30335. this.#byteOffset += chunk.length
  30336. this.run(callback)
  30337. }
  30338. /**
  30339. * Runs whenever a new chunk is received.
  30340. * Callback is called whenever there are no more chunks buffering,
  30341. * or not enough bytes are buffered to parse.
  30342. */
  30343. run (callback) {
  30344. while (true) {
  30345. if (this.#state === parserStates.INFO) {
  30346. // If there aren't enough bytes to parse the payload length, etc.
  30347. if (this.#byteOffset < 2) {
  30348. return callback()
  30349. }
  30350. const buffer = this.consume(2)
  30351. this.#info.fin = (buffer[0] & 0x80) !== 0
  30352. this.#info.opcode = buffer[0] & 0x0F
  30353. // If we receive a fragmented message, we use the type of the first
  30354. // frame to parse the full message as binary/text, when it's terminated
  30355. this.#info.originalOpcode ??= this.#info.opcode
  30356. this.#info.fragmented = !this.#info.fin && this.#info.opcode !== opcodes.CONTINUATION
  30357. if (this.#info.fragmented && this.#info.opcode !== opcodes.BINARY && this.#info.opcode !== opcodes.TEXT) {
  30358. // Only text and binary frames can be fragmented
  30359. failWebsocketConnection(this.ws, 'Invalid frame type was fragmented.')
  30360. return
  30361. }
  30362. const payloadLength = buffer[1] & 0x7F
  30363. if (payloadLength <= 125) {
  30364. this.#info.payloadLength = payloadLength
  30365. this.#state = parserStates.READ_DATA
  30366. } else if (payloadLength === 126) {
  30367. this.#state = parserStates.PAYLOADLENGTH_16
  30368. } else if (payloadLength === 127) {
  30369. this.#state = parserStates.PAYLOADLENGTH_64
  30370. }
  30371. if (this.#info.fragmented && payloadLength > 125) {
  30372. // A fragmented frame can't be fragmented itself
  30373. failWebsocketConnection(this.ws, 'Fragmented frame exceeded 125 bytes.')
  30374. return
  30375. } else if (
  30376. (this.#info.opcode === opcodes.PING ||
  30377. this.#info.opcode === opcodes.PONG ||
  30378. this.#info.opcode === opcodes.CLOSE) &&
  30379. payloadLength > 125
  30380. ) {
  30381. // Control frames can have a payload length of 125 bytes MAX
  30382. failWebsocketConnection(this.ws, 'Payload length for control frame exceeded 125 bytes.')
  30383. return
  30384. } else if (this.#info.opcode === opcodes.CLOSE) {
  30385. if (payloadLength === 1) {
  30386. failWebsocketConnection(this.ws, 'Received close frame with a 1-byte body.')
  30387. return
  30388. }
  30389. const body = this.consume(payloadLength)
  30390. this.#info.closeInfo = this.parseCloseBody(false, body)
  30391. if (!this.ws[kSentClose]) {
  30392. // If an endpoint receives a Close frame and did not previously send a
  30393. // Close frame, the endpoint MUST send a Close frame in response. (When
  30394. // sending a Close frame in response, the endpoint typically echos the
  30395. // status code it received.)
  30396. const body = Buffer.allocUnsafe(2)
  30397. body.writeUInt16BE(this.#info.closeInfo.code, 0)
  30398. const closeFrame = new WebsocketFrameSend(body)
  30399. this.ws[kResponse].socket.write(
  30400. closeFrame.createFrame(opcodes.CLOSE),
  30401. (err) => {
  30402. if (!err) {
  30403. this.ws[kSentClose] = true
  30404. }
  30405. }
  30406. )
  30407. }
  30408. // Upon either sending or receiving a Close control frame, it is said
  30409. // that _The WebSocket Closing Handshake is Started_ and that the
  30410. // WebSocket connection is in the CLOSING state.
  30411. this.ws[kReadyState] = states.CLOSING
  30412. this.ws[kReceivedClose] = true
  30413. this.end()
  30414. return
  30415. } else if (this.#info.opcode === opcodes.PING) {
  30416. // Upon receipt of a Ping frame, an endpoint MUST send a Pong frame in
  30417. // response, unless it already received a Close frame.
  30418. // A Pong frame sent in response to a Ping frame must have identical
  30419. // "Application data"
  30420. const body = this.consume(payloadLength)
  30421. if (!this.ws[kReceivedClose]) {
  30422. const frame = new WebsocketFrameSend(body)
  30423. this.ws[kResponse].socket.write(frame.createFrame(opcodes.PONG))
  30424. if (channels.ping.hasSubscribers) {
  30425. channels.ping.publish({
  30426. payload: body
  30427. })
  30428. }
  30429. }
  30430. this.#state = parserStates.INFO
  30431. if (this.#byteOffset > 0) {
  30432. continue
  30433. } else {
  30434. callback()
  30435. return
  30436. }
  30437. } else if (this.#info.opcode === opcodes.PONG) {
  30438. // A Pong frame MAY be sent unsolicited. This serves as a
  30439. // unidirectional heartbeat. A response to an unsolicited Pong frame is
  30440. // not expected.
  30441. const body = this.consume(payloadLength)
  30442. if (channels.pong.hasSubscribers) {
  30443. channels.pong.publish({
  30444. payload: body
  30445. })
  30446. }
  30447. if (this.#byteOffset > 0) {
  30448. continue
  30449. } else {
  30450. callback()
  30451. return
  30452. }
  30453. }
  30454. } else if (this.#state === parserStates.PAYLOADLENGTH_16) {
  30455. if (this.#byteOffset < 2) {
  30456. return callback()
  30457. }
  30458. const buffer = this.consume(2)
  30459. this.#info.payloadLength = buffer.readUInt16BE(0)
  30460. this.#state = parserStates.READ_DATA
  30461. } else if (this.#state === parserStates.PAYLOADLENGTH_64) {
  30462. if (this.#byteOffset < 8) {
  30463. return callback()
  30464. }
  30465. const buffer = this.consume(8)
  30466. const upper = buffer.readUInt32BE(0)
  30467. // 2^31 is the maxinimum bytes an arraybuffer can contain
  30468. // on 32-bit systems. Although, on 64-bit systems, this is
  30469. // 2^53-1 bytes.
  30470. // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Invalid_array_length
  30471. // https://source.chromium.org/chromium/chromium/src/+/main:v8/src/common/globals.h;drc=1946212ac0100668f14eb9e2843bdd846e510a1e;bpv=1;bpt=1;l=1275
  30472. // https://source.chromium.org/chromium/chromium/src/+/main:v8/src/objects/js-array-buffer.h;l=34;drc=1946212ac0100668f14eb9e2843bdd846e510a1e
  30473. if (upper > 2 ** 31 - 1) {
  30474. failWebsocketConnection(this.ws, 'Received payload length > 2^31 bytes.')
  30475. return
  30476. }
  30477. const lower = buffer.readUInt32BE(4)
  30478. this.#info.payloadLength = (upper << 8) + lower
  30479. this.#state = parserStates.READ_DATA
  30480. } else if (this.#state === parserStates.READ_DATA) {
  30481. if (this.#byteOffset < this.#info.payloadLength) {
  30482. // If there is still more data in this chunk that needs to be read
  30483. return callback()
  30484. } else if (this.#byteOffset >= this.#info.payloadLength) {
  30485. // If the server sent multiple frames in a single chunk
  30486. const body = this.consume(this.#info.payloadLength)
  30487. this.#fragments.push(body)
  30488. // If the frame is unfragmented, or a fragmented frame was terminated,
  30489. // a message was received
  30490. if (!this.#info.fragmented || (this.#info.fin && this.#info.opcode === opcodes.CONTINUATION)) {
  30491. const fullMessage = Buffer.concat(this.#fragments)
  30492. websocketMessageReceived(this.ws, this.#info.originalOpcode, fullMessage)
  30493. this.#info = {}
  30494. this.#fragments.length = 0
  30495. }
  30496. this.#state = parserStates.INFO
  30497. }
  30498. }
  30499. if (this.#byteOffset > 0) {
  30500. continue
  30501. } else {
  30502. callback()
  30503. break
  30504. }
  30505. }
  30506. }
  30507. /**
  30508. * Take n bytes from the buffered Buffers
  30509. * @param {number} n
  30510. * @returns {Buffer|null}
  30511. */
  30512. consume (n) {
  30513. if (n > this.#byteOffset) {
  30514. return null
  30515. } else if (n === 0) {
  30516. return emptyBuffer
  30517. }
  30518. if (this.#buffers[0].length === n) {
  30519. this.#byteOffset -= this.#buffers[0].length
  30520. return this.#buffers.shift()
  30521. }
  30522. const buffer = Buffer.allocUnsafe(n)
  30523. let offset = 0
  30524. while (offset !== n) {
  30525. const next = this.#buffers[0]
  30526. const { length } = next
  30527. if (length + offset === n) {
  30528. buffer.set(this.#buffers.shift(), offset)
  30529. break
  30530. } else if (length + offset > n) {
  30531. buffer.set(next.subarray(0, n - offset), offset)
  30532. this.#buffers[0] = next.subarray(n - offset)
  30533. break
  30534. } else {
  30535. buffer.set(this.#buffers.shift(), offset)
  30536. offset += next.length
  30537. }
  30538. }
  30539. this.#byteOffset -= n
  30540. return buffer
  30541. }
  30542. parseCloseBody (onlyCode, data) {
  30543. // https://datatracker.ietf.org/doc/html/rfc6455#section-7.1.5
  30544. /** @type {number|undefined} */
  30545. let code
  30546. if (data.length >= 2) {
  30547. // _The WebSocket Connection Close Code_ is
  30548. // defined as the status code (Section 7.4) contained in the first Close
  30549. // control frame received by the application
  30550. code = data.readUInt16BE(0)
  30551. }
  30552. if (onlyCode) {
  30553. if (!isValidStatusCode(code)) {
  30554. return null
  30555. }
  30556. return { code }
  30557. }
  30558. // https://datatracker.ietf.org/doc/html/rfc6455#section-7.1.6
  30559. /** @type {Buffer} */
  30560. let reason = data.subarray(2)
  30561. // Remove BOM
  30562. if (reason[0] === 0xEF && reason[1] === 0xBB && reason[2] === 0xBF) {
  30563. reason = reason.subarray(3)
  30564. }
  30565. if (code !== undefined && !isValidStatusCode(code)) {
  30566. return null
  30567. }
  30568. try {
  30569. // TODO: optimize this
  30570. reason = new TextDecoder('utf-8', { fatal: true }).decode(reason)
  30571. } catch {
  30572. return null
  30573. }
  30574. return { code, reason }
  30575. }
  30576. get closingInfo () {
  30577. return this.#info.closeInfo
  30578. }
  30579. }
  30580. module.exports = {
  30581. ByteParser
  30582. }
  30583. /***/ }),
  30584. /***/ 7578:
  30585. /***/ ((module) => {
  30586. "use strict";
  30587. module.exports = {
  30588. kWebSocketURL: Symbol('url'),
  30589. kReadyState: Symbol('ready state'),
  30590. kController: Symbol('controller'),
  30591. kResponse: Symbol('response'),
  30592. kBinaryType: Symbol('binary type'),
  30593. kSentClose: Symbol('sent close'),
  30594. kReceivedClose: Symbol('received close'),
  30595. kByteParser: Symbol('byte parser')
  30596. }
  30597. /***/ }),
  30598. /***/ 5515:
  30599. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  30600. "use strict";
  30601. const { kReadyState, kController, kResponse, kBinaryType, kWebSocketURL } = __nccwpck_require__(7578)
  30602. const { states, opcodes } = __nccwpck_require__(9188)
  30603. const { MessageEvent, ErrorEvent } = __nccwpck_require__(2611)
  30604. /* globals Blob */
  30605. /**
  30606. * @param {import('./websocket').WebSocket} ws
  30607. */
  30608. function isEstablished (ws) {
  30609. // If the server's response is validated as provided for above, it is
  30610. // said that _The WebSocket Connection is Established_ and that the
  30611. // WebSocket Connection is in the OPEN state.
  30612. return ws[kReadyState] === states.OPEN
  30613. }
  30614. /**
  30615. * @param {import('./websocket').WebSocket} ws
  30616. */
  30617. function isClosing (ws) {
  30618. // Upon either sending or receiving a Close control frame, it is said
  30619. // that _The WebSocket Closing Handshake is Started_ and that the
  30620. // WebSocket connection is in the CLOSING state.
  30621. return ws[kReadyState] === states.CLOSING
  30622. }
  30623. /**
  30624. * @param {import('./websocket').WebSocket} ws
  30625. */
  30626. function isClosed (ws) {
  30627. return ws[kReadyState] === states.CLOSED
  30628. }
  30629. /**
  30630. * @see https://dom.spec.whatwg.org/#concept-event-fire
  30631. * @param {string} e
  30632. * @param {EventTarget} target
  30633. * @param {EventInit | undefined} eventInitDict
  30634. */
  30635. function fireEvent (e, target, eventConstructor = Event, eventInitDict) {
  30636. // 1. If eventConstructor is not given, then let eventConstructor be Event.
  30637. // 2. Let event be the result of creating an event given eventConstructor,
  30638. // in the relevant realm of target.
  30639. // 3. Initialize event’s type attribute to e.
  30640. const event = new eventConstructor(e, eventInitDict) // eslint-disable-line new-cap
  30641. // 4. Initialize any other IDL attributes of event as described in the
  30642. // invocation of this algorithm.
  30643. // 5. Return the result of dispatching event at target, with legacy target
  30644. // override flag set if set.
  30645. target.dispatchEvent(event)
  30646. }
  30647. /**
  30648. * @see https://websockets.spec.whatwg.org/#feedback-from-the-protocol
  30649. * @param {import('./websocket').WebSocket} ws
  30650. * @param {number} type Opcode
  30651. * @param {Buffer} data application data
  30652. */
  30653. function websocketMessageReceived (ws, type, data) {
  30654. // 1. If ready state is not OPEN (1), then return.
  30655. if (ws[kReadyState] !== states.OPEN) {
  30656. return
  30657. }
  30658. // 2. Let dataForEvent be determined by switching on type and binary type:
  30659. let dataForEvent
  30660. if (type === opcodes.TEXT) {
  30661. // -> type indicates that the data is Text
  30662. // a new DOMString containing data
  30663. try {
  30664. dataForEvent = new TextDecoder('utf-8', { fatal: true }).decode(data)
  30665. } catch {
  30666. failWebsocketConnection(ws, 'Received invalid UTF-8 in text frame.')
  30667. return
  30668. }
  30669. } else if (type === opcodes.BINARY) {
  30670. if (ws[kBinaryType] === 'blob') {
  30671. // -> type indicates that the data is Binary and binary type is "blob"
  30672. // a new Blob object, created in the relevant Realm of the WebSocket
  30673. // object, that represents data as its raw data
  30674. dataForEvent = new Blob([data])
  30675. } else {
  30676. // -> type indicates that the data is Binary and binary type is "arraybuffer"
  30677. // a new ArrayBuffer object, created in the relevant Realm of the
  30678. // WebSocket object, whose contents are data
  30679. dataForEvent = new Uint8Array(data).buffer
  30680. }
  30681. }
  30682. // 3. Fire an event named message at the WebSocket object, using MessageEvent,
  30683. // with the origin attribute initialized to the serialization of the WebSocket
  30684. // object’s url's origin, and the data attribute initialized to dataForEvent.
  30685. fireEvent('message', ws, MessageEvent, {
  30686. origin: ws[kWebSocketURL].origin,
  30687. data: dataForEvent
  30688. })
  30689. }
  30690. /**
  30691. * @see https://datatracker.ietf.org/doc/html/rfc6455
  30692. * @see https://datatracker.ietf.org/doc/html/rfc2616
  30693. * @see https://bugs.chromium.org/p/chromium/issues/detail?id=398407
  30694. * @param {string} protocol
  30695. */
  30696. function isValidSubprotocol (protocol) {
  30697. // If present, this value indicates one
  30698. // or more comma-separated subprotocol the client wishes to speak,
  30699. // ordered by preference. The elements that comprise this value
  30700. // MUST be non-empty strings with characters in the range U+0021 to
  30701. // U+007E not including separator characters as defined in
  30702. // [RFC2616] and MUST all be unique strings.
  30703. if (protocol.length === 0) {
  30704. return false
  30705. }
  30706. for (const char of protocol) {
  30707. const code = char.charCodeAt(0)
  30708. if (
  30709. code < 0x21 ||
  30710. code > 0x7E ||
  30711. char === '(' ||
  30712. char === ')' ||
  30713. char === '<' ||
  30714. char === '>' ||
  30715. char === '@' ||
  30716. char === ',' ||
  30717. char === ';' ||
  30718. char === ':' ||
  30719. char === '\\' ||
  30720. char === '"' ||
  30721. char === '/' ||
  30722. char === '[' ||
  30723. char === ']' ||
  30724. char === '?' ||
  30725. char === '=' ||
  30726. char === '{' ||
  30727. char === '}' ||
  30728. code === 32 || // SP
  30729. code === 9 // HT
  30730. ) {
  30731. return false
  30732. }
  30733. }
  30734. return true
  30735. }
  30736. /**
  30737. * @see https://datatracker.ietf.org/doc/html/rfc6455#section-7-4
  30738. * @param {number} code
  30739. */
  30740. function isValidStatusCode (code) {
  30741. if (code >= 1000 && code < 1015) {
  30742. return (
  30743. code !== 1004 && // reserved
  30744. code !== 1005 && // "MUST NOT be set as a status code"
  30745. code !== 1006 // "MUST NOT be set as a status code"
  30746. )
  30747. }
  30748. return code >= 3000 && code <= 4999
  30749. }
  30750. /**
  30751. * @param {import('./websocket').WebSocket} ws
  30752. * @param {string|undefined} reason
  30753. */
  30754. function failWebsocketConnection (ws, reason) {
  30755. const { [kController]: controller, [kResponse]: response } = ws
  30756. controller.abort()
  30757. if (response?.socket && !response.socket.destroyed) {
  30758. response.socket.destroy()
  30759. }
  30760. if (reason) {
  30761. fireEvent('error', ws, ErrorEvent, {
  30762. error: new Error(reason)
  30763. })
  30764. }
  30765. }
  30766. module.exports = {
  30767. isEstablished,
  30768. isClosing,
  30769. isClosed,
  30770. fireEvent,
  30771. isValidSubprotocol,
  30772. isValidStatusCode,
  30773. failWebsocketConnection,
  30774. websocketMessageReceived
  30775. }
  30776. /***/ }),
  30777. /***/ 4284:
  30778. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  30779. "use strict";
  30780. const { webidl } = __nccwpck_require__(1744)
  30781. const { DOMException } = __nccwpck_require__(1037)
  30782. const { URLSerializer } = __nccwpck_require__(685)
  30783. const { getGlobalOrigin } = __nccwpck_require__(1246)
  30784. const { staticPropertyDescriptors, states, opcodes, emptyBuffer } = __nccwpck_require__(9188)
  30785. const {
  30786. kWebSocketURL,
  30787. kReadyState,
  30788. kController,
  30789. kBinaryType,
  30790. kResponse,
  30791. kSentClose,
  30792. kByteParser
  30793. } = __nccwpck_require__(7578)
  30794. const { isEstablished, isClosing, isValidSubprotocol, failWebsocketConnection, fireEvent } = __nccwpck_require__(5515)
  30795. const { establishWebSocketConnection } = __nccwpck_require__(5354)
  30796. const { WebsocketFrameSend } = __nccwpck_require__(5444)
  30797. const { ByteParser } = __nccwpck_require__(1688)
  30798. const { kEnumerableProperty, isBlobLike } = __nccwpck_require__(3983)
  30799. const { getGlobalDispatcher } = __nccwpck_require__(1892)
  30800. const { types } = __nccwpck_require__(3837)
  30801. let experimentalWarned = false
  30802. // https://websockets.spec.whatwg.org/#interface-definition
  30803. class WebSocket extends EventTarget {
  30804. #events = {
  30805. open: null,
  30806. error: null,
  30807. close: null,
  30808. message: null
  30809. }
  30810. #bufferedAmount = 0
  30811. #protocol = ''
  30812. #extensions = ''
  30813. /**
  30814. * @param {string} url
  30815. * @param {string|string[]} protocols
  30816. */
  30817. constructor (url, protocols = []) {
  30818. super()
  30819. webidl.argumentLengthCheck(arguments, 1, { header: 'WebSocket constructor' })
  30820. if (!experimentalWarned) {
  30821. experimentalWarned = true
  30822. process.emitWarning('WebSockets are experimental, expect them to change at any time.', {
  30823. code: 'UNDICI-WS'
  30824. })
  30825. }
  30826. const options = webidl.converters['DOMString or sequence<DOMString> or WebSocketInit'](protocols)
  30827. url = webidl.converters.USVString(url)
  30828. protocols = options.protocols
  30829. // 1. Let baseURL be this's relevant settings object's API base URL.
  30830. const baseURL = getGlobalOrigin()
  30831. // 1. Let urlRecord be the result of applying the URL parser to url with baseURL.
  30832. let urlRecord
  30833. try {
  30834. urlRecord = new URL(url, baseURL)
  30835. } catch (e) {
  30836. // 3. If urlRecord is failure, then throw a "SyntaxError" DOMException.
  30837. throw new DOMException(e, 'SyntaxError')
  30838. }
  30839. // 4. If urlRecord’s scheme is "http", then set urlRecord’s scheme to "ws".
  30840. if (urlRecord.protocol === 'http:') {
  30841. urlRecord.protocol = 'ws:'
  30842. } else if (urlRecord.protocol === 'https:') {
  30843. // 5. Otherwise, if urlRecord’s scheme is "https", set urlRecord’s scheme to "wss".
  30844. urlRecord.protocol = 'wss:'
  30845. }
  30846. // 6. If urlRecord’s scheme is not "ws" or "wss", then throw a "SyntaxError" DOMException.
  30847. if (urlRecord.protocol !== 'ws:' && urlRecord.protocol !== 'wss:') {
  30848. throw new DOMException(
  30849. `Expected a ws: or wss: protocol, got ${urlRecord.protocol}`,
  30850. 'SyntaxError'
  30851. )
  30852. }
  30853. // 7. If urlRecord’s fragment is non-null, then throw a "SyntaxError"
  30854. // DOMException.
  30855. if (urlRecord.hash || urlRecord.href.endsWith('#')) {
  30856. throw new DOMException('Got fragment', 'SyntaxError')
  30857. }
  30858. // 8. If protocols is a string, set protocols to a sequence consisting
  30859. // of just that string.
  30860. if (typeof protocols === 'string') {
  30861. protocols = [protocols]
  30862. }
  30863. // 9. If any of the values in protocols occur more than once or otherwise
  30864. // fail to match the requirements for elements that comprise the value
  30865. // of `Sec-WebSocket-Protocol` fields as defined by The WebSocket
  30866. // protocol, then throw a "SyntaxError" DOMException.
  30867. if (protocols.length !== new Set(protocols.map(p => p.toLowerCase())).size) {
  30868. throw new DOMException('Invalid Sec-WebSocket-Protocol value', 'SyntaxError')
  30869. }
  30870. if (protocols.length > 0 && !protocols.every(p => isValidSubprotocol(p))) {
  30871. throw new DOMException('Invalid Sec-WebSocket-Protocol value', 'SyntaxError')
  30872. }
  30873. // 10. Set this's url to urlRecord.
  30874. this[kWebSocketURL] = new URL(urlRecord.href)
  30875. // 11. Let client be this's relevant settings object.
  30876. // 12. Run this step in parallel:
  30877. // 1. Establish a WebSocket connection given urlRecord, protocols,
  30878. // and client.
  30879. this[kController] = establishWebSocketConnection(
  30880. urlRecord,
  30881. protocols,
  30882. this,
  30883. (response) => this.#onConnectionEstablished(response),
  30884. options
  30885. )
  30886. // Each WebSocket object has an associated ready state, which is a
  30887. // number representing the state of the connection. Initially it must
  30888. // be CONNECTING (0).
  30889. this[kReadyState] = WebSocket.CONNECTING
  30890. // The extensions attribute must initially return the empty string.
  30891. // The protocol attribute must initially return the empty string.
  30892. // Each WebSocket object has an associated binary type, which is a
  30893. // BinaryType. Initially it must be "blob".
  30894. this[kBinaryType] = 'blob'
  30895. }
  30896. /**
  30897. * @see https://websockets.spec.whatwg.org/#dom-websocket-close
  30898. * @param {number|undefined} code
  30899. * @param {string|undefined} reason
  30900. */
  30901. close (code = undefined, reason = undefined) {
  30902. webidl.brandCheck(this, WebSocket)
  30903. if (code !== undefined) {
  30904. code = webidl.converters['unsigned short'](code, { clamp: true })
  30905. }
  30906. if (reason !== undefined) {
  30907. reason = webidl.converters.USVString(reason)
  30908. }
  30909. // 1. If code is present, but is neither an integer equal to 1000 nor an
  30910. // integer in the range 3000 to 4999, inclusive, throw an
  30911. // "InvalidAccessError" DOMException.
  30912. if (code !== undefined) {
  30913. if (code !== 1000 && (code < 3000 || code > 4999)) {
  30914. throw new DOMException('invalid code', 'InvalidAccessError')
  30915. }
  30916. }
  30917. let reasonByteLength = 0
  30918. // 2. If reason is present, then run these substeps:
  30919. if (reason !== undefined) {
  30920. // 1. Let reasonBytes be the result of encoding reason.
  30921. // 2. If reasonBytes is longer than 123 bytes, then throw a
  30922. // "SyntaxError" DOMException.
  30923. reasonByteLength = Buffer.byteLength(reason)
  30924. if (reasonByteLength > 123) {
  30925. throw new DOMException(
  30926. `Reason must be less than 123 bytes; received ${reasonByteLength}`,
  30927. 'SyntaxError'
  30928. )
  30929. }
  30930. }
  30931. // 3. Run the first matching steps from the following list:
  30932. if (this[kReadyState] === WebSocket.CLOSING || this[kReadyState] === WebSocket.CLOSED) {
  30933. // If this's ready state is CLOSING (2) or CLOSED (3)
  30934. // Do nothing.
  30935. } else if (!isEstablished(this)) {
  30936. // If the WebSocket connection is not yet established
  30937. // Fail the WebSocket connection and set this's ready state
  30938. // to CLOSING (2).
  30939. failWebsocketConnection(this, 'Connection was closed before it was established.')
  30940. this[kReadyState] = WebSocket.CLOSING
  30941. } else if (!isClosing(this)) {
  30942. // If the WebSocket closing handshake has not yet been started
  30943. // Start the WebSocket closing handshake and set this's ready
  30944. // state to CLOSING (2).
  30945. // - If neither code nor reason is present, the WebSocket Close
  30946. // message must not have a body.
  30947. // - If code is present, then the status code to use in the
  30948. // WebSocket Close message must be the integer given by code.
  30949. // - If reason is also present, then reasonBytes must be
  30950. // provided in the Close message after the status code.
  30951. const frame = new WebsocketFrameSend()
  30952. // If neither code nor reason is present, the WebSocket Close
  30953. // message must not have a body.
  30954. // If code is present, then the status code to use in the
  30955. // WebSocket Close message must be the integer given by code.
  30956. if (code !== undefined && reason === undefined) {
  30957. frame.frameData = Buffer.allocUnsafe(2)
  30958. frame.frameData.writeUInt16BE(code, 0)
  30959. } else if (code !== undefined && reason !== undefined) {
  30960. // If reason is also present, then reasonBytes must be
  30961. // provided in the Close message after the status code.
  30962. frame.frameData = Buffer.allocUnsafe(2 + reasonByteLength)
  30963. frame.frameData.writeUInt16BE(code, 0)
  30964. // the body MAY contain UTF-8-encoded data with value /reason/
  30965. frame.frameData.write(reason, 2, 'utf-8')
  30966. } else {
  30967. frame.frameData = emptyBuffer
  30968. }
  30969. /** @type {import('stream').Duplex} */
  30970. const socket = this[kResponse].socket
  30971. socket.write(frame.createFrame(opcodes.CLOSE), (err) => {
  30972. if (!err) {
  30973. this[kSentClose] = true
  30974. }
  30975. })
  30976. // Upon either sending or receiving a Close control frame, it is said
  30977. // that _The WebSocket Closing Handshake is Started_ and that the
  30978. // WebSocket connection is in the CLOSING state.
  30979. this[kReadyState] = states.CLOSING
  30980. } else {
  30981. // Otherwise
  30982. // Set this's ready state to CLOSING (2).
  30983. this[kReadyState] = WebSocket.CLOSING
  30984. }
  30985. }
  30986. /**
  30987. * @see https://websockets.spec.whatwg.org/#dom-websocket-send
  30988. * @param {NodeJS.TypedArray|ArrayBuffer|Blob|string} data
  30989. */
  30990. send (data) {
  30991. webidl.brandCheck(this, WebSocket)
  30992. webidl.argumentLengthCheck(arguments, 1, { header: 'WebSocket.send' })
  30993. data = webidl.converters.WebSocketSendData(data)
  30994. // 1. If this's ready state is CONNECTING, then throw an
  30995. // "InvalidStateError" DOMException.
  30996. if (this[kReadyState] === WebSocket.CONNECTING) {
  30997. throw new DOMException('Sent before connected.', 'InvalidStateError')
  30998. }
  30999. // 2. Run the appropriate set of steps from the following list:
  31000. // https://datatracker.ietf.org/doc/html/rfc6455#section-6.1
  31001. // https://datatracker.ietf.org/doc/html/rfc6455#section-5.2
  31002. if (!isEstablished(this) || isClosing(this)) {
  31003. return
  31004. }
  31005. /** @type {import('stream').Duplex} */
  31006. const socket = this[kResponse].socket
  31007. // If data is a string
  31008. if (typeof data === 'string') {
  31009. // If the WebSocket connection is established and the WebSocket
  31010. // closing handshake has not yet started, then the user agent
  31011. // must send a WebSocket Message comprised of the data argument
  31012. // using a text frame opcode; if the data cannot be sent, e.g.
  31013. // because it would need to be buffered but the buffer is full,
  31014. // the user agent must flag the WebSocket as full and then close
  31015. // the WebSocket connection. Any invocation of this method with a
  31016. // string argument that does not throw an exception must increase
  31017. // the bufferedAmount attribute by the number of bytes needed to
  31018. // express the argument as UTF-8.
  31019. const value = Buffer.from(data)
  31020. const frame = new WebsocketFrameSend(value)
  31021. const buffer = frame.createFrame(opcodes.TEXT)
  31022. this.#bufferedAmount += value.byteLength
  31023. socket.write(buffer, () => {
  31024. this.#bufferedAmount -= value.byteLength
  31025. })
  31026. } else if (types.isArrayBuffer(data)) {
  31027. // If the WebSocket connection is established, and the WebSocket
  31028. // closing handshake has not yet started, then the user agent must
  31029. // send a WebSocket Message comprised of data using a binary frame
  31030. // opcode; if the data cannot be sent, e.g. because it would need
  31031. // to be buffered but the buffer is full, the user agent must flag
  31032. // the WebSocket as full and then close the WebSocket connection.
  31033. // The data to be sent is the data stored in the buffer described
  31034. // by the ArrayBuffer object. Any invocation of this method with an
  31035. // ArrayBuffer argument that does not throw an exception must
  31036. // increase the bufferedAmount attribute by the length of the
  31037. // ArrayBuffer in bytes.
  31038. const value = Buffer.from(data)
  31039. const frame = new WebsocketFrameSend(value)
  31040. const buffer = frame.createFrame(opcodes.BINARY)
  31041. this.#bufferedAmount += value.byteLength
  31042. socket.write(buffer, () => {
  31043. this.#bufferedAmount -= value.byteLength
  31044. })
  31045. } else if (ArrayBuffer.isView(data)) {
  31046. // If the WebSocket connection is established, and the WebSocket
  31047. // closing handshake has not yet started, then the user agent must
  31048. // send a WebSocket Message comprised of data using a binary frame
  31049. // opcode; if the data cannot be sent, e.g. because it would need to
  31050. // be buffered but the buffer is full, the user agent must flag the
  31051. // WebSocket as full and then close the WebSocket connection. The
  31052. // data to be sent is the data stored in the section of the buffer
  31053. // described by the ArrayBuffer object that data references. Any
  31054. // invocation of this method with this kind of argument that does
  31055. // not throw an exception must increase the bufferedAmount attribute
  31056. // by the length of data’s buffer in bytes.
  31057. const ab = Buffer.from(data, data.byteOffset, data.byteLength)
  31058. const frame = new WebsocketFrameSend(ab)
  31059. const buffer = frame.createFrame(opcodes.BINARY)
  31060. this.#bufferedAmount += ab.byteLength
  31061. socket.write(buffer, () => {
  31062. this.#bufferedAmount -= ab.byteLength
  31063. })
  31064. } else if (isBlobLike(data)) {
  31065. // If the WebSocket connection is established, and the WebSocket
  31066. // closing handshake has not yet started, then the user agent must
  31067. // send a WebSocket Message comprised of data using a binary frame
  31068. // opcode; if the data cannot be sent, e.g. because it would need to
  31069. // be buffered but the buffer is full, the user agent must flag the
  31070. // WebSocket as full and then close the WebSocket connection. The data
  31071. // to be sent is the raw data represented by the Blob object. Any
  31072. // invocation of this method with a Blob argument that does not throw
  31073. // an exception must increase the bufferedAmount attribute by the size
  31074. // of the Blob object’s raw data, in bytes.
  31075. const frame = new WebsocketFrameSend()
  31076. data.arrayBuffer().then((ab) => {
  31077. const value = Buffer.from(ab)
  31078. frame.frameData = value
  31079. const buffer = frame.createFrame(opcodes.BINARY)
  31080. this.#bufferedAmount += value.byteLength
  31081. socket.write(buffer, () => {
  31082. this.#bufferedAmount -= value.byteLength
  31083. })
  31084. })
  31085. }
  31086. }
  31087. get readyState () {
  31088. webidl.brandCheck(this, WebSocket)
  31089. // The readyState getter steps are to return this's ready state.
  31090. return this[kReadyState]
  31091. }
  31092. get bufferedAmount () {
  31093. webidl.brandCheck(this, WebSocket)
  31094. return this.#bufferedAmount
  31095. }
  31096. get url () {
  31097. webidl.brandCheck(this, WebSocket)
  31098. // The url getter steps are to return this's url, serialized.
  31099. return URLSerializer(this[kWebSocketURL])
  31100. }
  31101. get extensions () {
  31102. webidl.brandCheck(this, WebSocket)
  31103. return this.#extensions
  31104. }
  31105. get protocol () {
  31106. webidl.brandCheck(this, WebSocket)
  31107. return this.#protocol
  31108. }
  31109. get onopen () {
  31110. webidl.brandCheck(this, WebSocket)
  31111. return this.#events.open
  31112. }
  31113. set onopen (fn) {
  31114. webidl.brandCheck(this, WebSocket)
  31115. if (this.#events.open) {
  31116. this.removeEventListener('open', this.#events.open)
  31117. }
  31118. if (typeof fn === 'function') {
  31119. this.#events.open = fn
  31120. this.addEventListener('open', fn)
  31121. } else {
  31122. this.#events.open = null
  31123. }
  31124. }
  31125. get onerror () {
  31126. webidl.brandCheck(this, WebSocket)
  31127. return this.#events.error
  31128. }
  31129. set onerror (fn) {
  31130. webidl.brandCheck(this, WebSocket)
  31131. if (this.#events.error) {
  31132. this.removeEventListener('error', this.#events.error)
  31133. }
  31134. if (typeof fn === 'function') {
  31135. this.#events.error = fn
  31136. this.addEventListener('error', fn)
  31137. } else {
  31138. this.#events.error = null
  31139. }
  31140. }
  31141. get onclose () {
  31142. webidl.brandCheck(this, WebSocket)
  31143. return this.#events.close
  31144. }
  31145. set onclose (fn) {
  31146. webidl.brandCheck(this, WebSocket)
  31147. if (this.#events.close) {
  31148. this.removeEventListener('close', this.#events.close)
  31149. }
  31150. if (typeof fn === 'function') {
  31151. this.#events.close = fn
  31152. this.addEventListener('close', fn)
  31153. } else {
  31154. this.#events.close = null
  31155. }
  31156. }
  31157. get onmessage () {
  31158. webidl.brandCheck(this, WebSocket)
  31159. return this.#events.message
  31160. }
  31161. set onmessage (fn) {
  31162. webidl.brandCheck(this, WebSocket)
  31163. if (this.#events.message) {
  31164. this.removeEventListener('message', this.#events.message)
  31165. }
  31166. if (typeof fn === 'function') {
  31167. this.#events.message = fn
  31168. this.addEventListener('message', fn)
  31169. } else {
  31170. this.#events.message = null
  31171. }
  31172. }
  31173. get binaryType () {
  31174. webidl.brandCheck(this, WebSocket)
  31175. return this[kBinaryType]
  31176. }
  31177. set binaryType (type) {
  31178. webidl.brandCheck(this, WebSocket)
  31179. if (type !== 'blob' && type !== 'arraybuffer') {
  31180. this[kBinaryType] = 'blob'
  31181. } else {
  31182. this[kBinaryType] = type
  31183. }
  31184. }
  31185. /**
  31186. * @see https://websockets.spec.whatwg.org/#feedback-from-the-protocol
  31187. */
  31188. #onConnectionEstablished (response) {
  31189. // processResponse is called when the "response’s header list has been received and initialized."
  31190. // once this happens, the connection is open
  31191. this[kResponse] = response
  31192. const parser = new ByteParser(this)
  31193. parser.on('drain', function onParserDrain () {
  31194. this.ws[kResponse].socket.resume()
  31195. })
  31196. response.socket.ws = this
  31197. this[kByteParser] = parser
  31198. // 1. Change the ready state to OPEN (1).
  31199. this[kReadyState] = states.OPEN
  31200. // 2. Change the extensions attribute’s value to the extensions in use, if
  31201. // it is not the null value.
  31202. // https://datatracker.ietf.org/doc/html/rfc6455#section-9.1
  31203. const extensions = response.headersList.get('sec-websocket-extensions')
  31204. if (extensions !== null) {
  31205. this.#extensions = extensions
  31206. }
  31207. // 3. Change the protocol attribute’s value to the subprotocol in use, if
  31208. // it is not the null value.
  31209. // https://datatracker.ietf.org/doc/html/rfc6455#section-1.9
  31210. const protocol = response.headersList.get('sec-websocket-protocol')
  31211. if (protocol !== null) {
  31212. this.#protocol = protocol
  31213. }
  31214. // 4. Fire an event named open at the WebSocket object.
  31215. fireEvent('open', this)
  31216. }
  31217. }
  31218. // https://websockets.spec.whatwg.org/#dom-websocket-connecting
  31219. WebSocket.CONNECTING = WebSocket.prototype.CONNECTING = states.CONNECTING
  31220. // https://websockets.spec.whatwg.org/#dom-websocket-open
  31221. WebSocket.OPEN = WebSocket.prototype.OPEN = states.OPEN
  31222. // https://websockets.spec.whatwg.org/#dom-websocket-closing
  31223. WebSocket.CLOSING = WebSocket.prototype.CLOSING = states.CLOSING
  31224. // https://websockets.spec.whatwg.org/#dom-websocket-closed
  31225. WebSocket.CLOSED = WebSocket.prototype.CLOSED = states.CLOSED
  31226. Object.defineProperties(WebSocket.prototype, {
  31227. CONNECTING: staticPropertyDescriptors,
  31228. OPEN: staticPropertyDescriptors,
  31229. CLOSING: staticPropertyDescriptors,
  31230. CLOSED: staticPropertyDescriptors,
  31231. url: kEnumerableProperty,
  31232. readyState: kEnumerableProperty,
  31233. bufferedAmount: kEnumerableProperty,
  31234. onopen: kEnumerableProperty,
  31235. onerror: kEnumerableProperty,
  31236. onclose: kEnumerableProperty,
  31237. close: kEnumerableProperty,
  31238. onmessage: kEnumerableProperty,
  31239. binaryType: kEnumerableProperty,
  31240. send: kEnumerableProperty,
  31241. extensions: kEnumerableProperty,
  31242. protocol: kEnumerableProperty,
  31243. [Symbol.toStringTag]: {
  31244. value: 'WebSocket',
  31245. writable: false,
  31246. enumerable: false,
  31247. configurable: true
  31248. }
  31249. })
  31250. Object.defineProperties(WebSocket, {
  31251. CONNECTING: staticPropertyDescriptors,
  31252. OPEN: staticPropertyDescriptors,
  31253. CLOSING: staticPropertyDescriptors,
  31254. CLOSED: staticPropertyDescriptors
  31255. })
  31256. webidl.converters['sequence<DOMString>'] = webidl.sequenceConverter(
  31257. webidl.converters.DOMString
  31258. )
  31259. webidl.converters['DOMString or sequence<DOMString>'] = function (V) {
  31260. if (webidl.util.Type(V) === 'Object' && Symbol.iterator in V) {
  31261. return webidl.converters['sequence<DOMString>'](V)
  31262. }
  31263. return webidl.converters.DOMString(V)
  31264. }
  31265. // This implements the propsal made in https://github.com/whatwg/websockets/issues/42
  31266. webidl.converters.WebSocketInit = webidl.dictionaryConverter([
  31267. {
  31268. key: 'protocols',
  31269. converter: webidl.converters['DOMString or sequence<DOMString>'],
  31270. get defaultValue () {
  31271. return []
  31272. }
  31273. },
  31274. {
  31275. key: 'dispatcher',
  31276. converter: (V) => V,
  31277. get defaultValue () {
  31278. return getGlobalDispatcher()
  31279. }
  31280. },
  31281. {
  31282. key: 'headers',
  31283. converter: webidl.nullableConverter(webidl.converters.HeadersInit)
  31284. }
  31285. ])
  31286. webidl.converters['DOMString or sequence<DOMString> or WebSocketInit'] = function (V) {
  31287. if (webidl.util.Type(V) === 'Object' && !(Symbol.iterator in V)) {
  31288. return webidl.converters.WebSocketInit(V)
  31289. }
  31290. return { protocols: webidl.converters['DOMString or sequence<DOMString>'](V) }
  31291. }
  31292. webidl.converters.WebSocketSendData = function (V) {
  31293. if (webidl.util.Type(V) === 'Object') {
  31294. if (isBlobLike(V)) {
  31295. return webidl.converters.Blob(V, { strict: false })
  31296. }
  31297. if (ArrayBuffer.isView(V) || types.isAnyArrayBuffer(V)) {
  31298. return webidl.converters.BufferSource(V)
  31299. }
  31300. }
  31301. return webidl.converters.USVString(V)
  31302. }
  31303. module.exports = {
  31304. WebSocket
  31305. }
  31306. /***/ }),
  31307. /***/ 5030:
  31308. /***/ ((__unused_webpack_module, exports) => {
  31309. "use strict";
  31310. Object.defineProperty(exports, "__esModule", ({ value: true }));
  31311. function getUserAgent() {
  31312. if (typeof navigator === "object" && "userAgent" in navigator) {
  31313. return navigator.userAgent;
  31314. }
  31315. if (typeof process === "object" && process.version !== undefined) {
  31316. return `Node.js/${process.version.substr(1)} (${process.platform}; ${process.arch})`;
  31317. }
  31318. return "<environment undetectable>";
  31319. }
  31320. exports.getUserAgent = getUserAgent;
  31321. //# sourceMappingURL=index.js.map
  31322. /***/ }),
  31323. /***/ 5840:
  31324. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31325. "use strict";
  31326. Object.defineProperty(exports, "__esModule", ({
  31327. value: true
  31328. }));
  31329. Object.defineProperty(exports, "NIL", ({
  31330. enumerable: true,
  31331. get: function () {
  31332. return _nil.default;
  31333. }
  31334. }));
  31335. Object.defineProperty(exports, "parse", ({
  31336. enumerable: true,
  31337. get: function () {
  31338. return _parse.default;
  31339. }
  31340. }));
  31341. Object.defineProperty(exports, "stringify", ({
  31342. enumerable: true,
  31343. get: function () {
  31344. return _stringify.default;
  31345. }
  31346. }));
  31347. Object.defineProperty(exports, "v1", ({
  31348. enumerable: true,
  31349. get: function () {
  31350. return _v.default;
  31351. }
  31352. }));
  31353. Object.defineProperty(exports, "v3", ({
  31354. enumerable: true,
  31355. get: function () {
  31356. return _v2.default;
  31357. }
  31358. }));
  31359. Object.defineProperty(exports, "v4", ({
  31360. enumerable: true,
  31361. get: function () {
  31362. return _v3.default;
  31363. }
  31364. }));
  31365. Object.defineProperty(exports, "v5", ({
  31366. enumerable: true,
  31367. get: function () {
  31368. return _v4.default;
  31369. }
  31370. }));
  31371. Object.defineProperty(exports, "validate", ({
  31372. enumerable: true,
  31373. get: function () {
  31374. return _validate.default;
  31375. }
  31376. }));
  31377. Object.defineProperty(exports, "version", ({
  31378. enumerable: true,
  31379. get: function () {
  31380. return _version.default;
  31381. }
  31382. }));
  31383. var _v = _interopRequireDefault(__nccwpck_require__(8628));
  31384. var _v2 = _interopRequireDefault(__nccwpck_require__(6409));
  31385. var _v3 = _interopRequireDefault(__nccwpck_require__(5122));
  31386. var _v4 = _interopRequireDefault(__nccwpck_require__(9120));
  31387. var _nil = _interopRequireDefault(__nccwpck_require__(5332));
  31388. var _version = _interopRequireDefault(__nccwpck_require__(2414));
  31389. var _validate = _interopRequireDefault(__nccwpck_require__(6900));
  31390. var _stringify = _interopRequireDefault(__nccwpck_require__(8950));
  31391. var _parse = _interopRequireDefault(__nccwpck_require__(2746));
  31392. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31393. /***/ }),
  31394. /***/ 4569:
  31395. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31396. "use strict";
  31397. Object.defineProperty(exports, "__esModule", ({
  31398. value: true
  31399. }));
  31400. exports["default"] = void 0;
  31401. var _crypto = _interopRequireDefault(__nccwpck_require__(6113));
  31402. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31403. function md5(bytes) {
  31404. if (Array.isArray(bytes)) {
  31405. bytes = Buffer.from(bytes);
  31406. } else if (typeof bytes === 'string') {
  31407. bytes = Buffer.from(bytes, 'utf8');
  31408. }
  31409. return _crypto.default.createHash('md5').update(bytes).digest();
  31410. }
  31411. var _default = md5;
  31412. exports["default"] = _default;
  31413. /***/ }),
  31414. /***/ 2054:
  31415. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31416. "use strict";
  31417. Object.defineProperty(exports, "__esModule", ({
  31418. value: true
  31419. }));
  31420. exports["default"] = void 0;
  31421. var _crypto = _interopRequireDefault(__nccwpck_require__(6113));
  31422. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31423. var _default = {
  31424. randomUUID: _crypto.default.randomUUID
  31425. };
  31426. exports["default"] = _default;
  31427. /***/ }),
  31428. /***/ 5332:
  31429. /***/ ((__unused_webpack_module, exports) => {
  31430. "use strict";
  31431. Object.defineProperty(exports, "__esModule", ({
  31432. value: true
  31433. }));
  31434. exports["default"] = void 0;
  31435. var _default = '00000000-0000-0000-0000-000000000000';
  31436. exports["default"] = _default;
  31437. /***/ }),
  31438. /***/ 2746:
  31439. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31440. "use strict";
  31441. Object.defineProperty(exports, "__esModule", ({
  31442. value: true
  31443. }));
  31444. exports["default"] = void 0;
  31445. var _validate = _interopRequireDefault(__nccwpck_require__(6900));
  31446. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31447. function parse(uuid) {
  31448. if (!(0, _validate.default)(uuid)) {
  31449. throw TypeError('Invalid UUID');
  31450. }
  31451. let v;
  31452. const arr = new Uint8Array(16); // Parse ########-....-....-....-............
  31453. arr[0] = (v = parseInt(uuid.slice(0, 8), 16)) >>> 24;
  31454. arr[1] = v >>> 16 & 0xff;
  31455. arr[2] = v >>> 8 & 0xff;
  31456. arr[3] = v & 0xff; // Parse ........-####-....-....-............
  31457. arr[4] = (v = parseInt(uuid.slice(9, 13), 16)) >>> 8;
  31458. arr[5] = v & 0xff; // Parse ........-....-####-....-............
  31459. arr[6] = (v = parseInt(uuid.slice(14, 18), 16)) >>> 8;
  31460. arr[7] = v & 0xff; // Parse ........-....-....-####-............
  31461. arr[8] = (v = parseInt(uuid.slice(19, 23), 16)) >>> 8;
  31462. arr[9] = v & 0xff; // Parse ........-....-....-....-############
  31463. // (Use "/" to avoid 32-bit truncation when bit-shifting high-order bytes)
  31464. arr[10] = (v = parseInt(uuid.slice(24, 36), 16)) / 0x10000000000 & 0xff;
  31465. arr[11] = v / 0x100000000 & 0xff;
  31466. arr[12] = v >>> 24 & 0xff;
  31467. arr[13] = v >>> 16 & 0xff;
  31468. arr[14] = v >>> 8 & 0xff;
  31469. arr[15] = v & 0xff;
  31470. return arr;
  31471. }
  31472. var _default = parse;
  31473. exports["default"] = _default;
  31474. /***/ }),
  31475. /***/ 814:
  31476. /***/ ((__unused_webpack_module, exports) => {
  31477. "use strict";
  31478. Object.defineProperty(exports, "__esModule", ({
  31479. value: true
  31480. }));
  31481. exports["default"] = void 0;
  31482. 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;
  31483. exports["default"] = _default;
  31484. /***/ }),
  31485. /***/ 807:
  31486. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31487. "use strict";
  31488. Object.defineProperty(exports, "__esModule", ({
  31489. value: true
  31490. }));
  31491. exports["default"] = rng;
  31492. var _crypto = _interopRequireDefault(__nccwpck_require__(6113));
  31493. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31494. const rnds8Pool = new Uint8Array(256); // # of random values to pre-allocate
  31495. let poolPtr = rnds8Pool.length;
  31496. function rng() {
  31497. if (poolPtr > rnds8Pool.length - 16) {
  31498. _crypto.default.randomFillSync(rnds8Pool);
  31499. poolPtr = 0;
  31500. }
  31501. return rnds8Pool.slice(poolPtr, poolPtr += 16);
  31502. }
  31503. /***/ }),
  31504. /***/ 5274:
  31505. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31506. "use strict";
  31507. Object.defineProperty(exports, "__esModule", ({
  31508. value: true
  31509. }));
  31510. exports["default"] = void 0;
  31511. var _crypto = _interopRequireDefault(__nccwpck_require__(6113));
  31512. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31513. function sha1(bytes) {
  31514. if (Array.isArray(bytes)) {
  31515. bytes = Buffer.from(bytes);
  31516. } else if (typeof bytes === 'string') {
  31517. bytes = Buffer.from(bytes, 'utf8');
  31518. }
  31519. return _crypto.default.createHash('sha1').update(bytes).digest();
  31520. }
  31521. var _default = sha1;
  31522. exports["default"] = _default;
  31523. /***/ }),
  31524. /***/ 8950:
  31525. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31526. "use strict";
  31527. Object.defineProperty(exports, "__esModule", ({
  31528. value: true
  31529. }));
  31530. exports["default"] = void 0;
  31531. exports.unsafeStringify = unsafeStringify;
  31532. var _validate = _interopRequireDefault(__nccwpck_require__(6900));
  31533. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31534. /**
  31535. * Convert array of 16 byte values to UUID string format of the form:
  31536. * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
  31537. */
  31538. const byteToHex = [];
  31539. for (let i = 0; i < 256; ++i) {
  31540. byteToHex.push((i + 0x100).toString(16).slice(1));
  31541. }
  31542. function unsafeStringify(arr, offset = 0) {
  31543. // Note: Be careful editing this code! It's been tuned for performance
  31544. // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
  31545. 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]];
  31546. }
  31547. function stringify(arr, offset = 0) {
  31548. const uuid = unsafeStringify(arr, offset); // Consistency check for valid UUID. If this throws, it's likely due to one
  31549. // of the following:
  31550. // - One or more input array values don't map to a hex octet (leading to
  31551. // "undefined" in the uuid)
  31552. // - Invalid input values for the RFC `version` or `variant` fields
  31553. if (!(0, _validate.default)(uuid)) {
  31554. throw TypeError('Stringified UUID is invalid');
  31555. }
  31556. return uuid;
  31557. }
  31558. var _default = stringify;
  31559. exports["default"] = _default;
  31560. /***/ }),
  31561. /***/ 8628:
  31562. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31563. "use strict";
  31564. Object.defineProperty(exports, "__esModule", ({
  31565. value: true
  31566. }));
  31567. exports["default"] = void 0;
  31568. var _rng = _interopRequireDefault(__nccwpck_require__(807));
  31569. var _stringify = __nccwpck_require__(8950);
  31570. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31571. // **`v1()` - Generate time-based UUID**
  31572. //
  31573. // Inspired by https://github.com/LiosK/UUID.js
  31574. // and http://docs.python.org/library/uuid.html
  31575. let _nodeId;
  31576. let _clockseq; // Previous uuid creation time
  31577. let _lastMSecs = 0;
  31578. let _lastNSecs = 0; // See https://github.com/uuidjs/uuid for API details
  31579. function v1(options, buf, offset) {
  31580. let i = buf && offset || 0;
  31581. const b = buf || new Array(16);
  31582. options = options || {};
  31583. let node = options.node || _nodeId;
  31584. let clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq; // node and clockseq need to be initialized to random values if they're not
  31585. // specified. We do this lazily to minimize issues related to insufficient
  31586. // system entropy. See #189
  31587. if (node == null || clockseq == null) {
  31588. const seedBytes = options.random || (options.rng || _rng.default)();
  31589. if (node == null) {
  31590. // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1)
  31591. node = _nodeId = [seedBytes[0] | 0x01, seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]];
  31592. }
  31593. if (clockseq == null) {
  31594. // Per 4.2.2, randomize (14 bit) clockseq
  31595. clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff;
  31596. }
  31597. } // UUID timestamps are 100 nano-second units since the Gregorian epoch,
  31598. // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so
  31599. // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs'
  31600. // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00.
  31601. let msecs = options.msecs !== undefined ? options.msecs : Date.now(); // Per 4.2.1.2, use count of uuid's generated during the current clock
  31602. // cycle to simulate higher resolution clock
  31603. let nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1; // Time since last uuid creation (in msecs)
  31604. const dt = msecs - _lastMSecs + (nsecs - _lastNSecs) / 10000; // Per 4.2.1.2, Bump clockseq on clock regression
  31605. if (dt < 0 && options.clockseq === undefined) {
  31606. clockseq = clockseq + 1 & 0x3fff;
  31607. } // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new
  31608. // time interval
  31609. if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) {
  31610. nsecs = 0;
  31611. } // Per 4.2.1.2 Throw error if too many uuids are requested
  31612. if (nsecs >= 10000) {
  31613. throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");
  31614. }
  31615. _lastMSecs = msecs;
  31616. _lastNSecs = nsecs;
  31617. _clockseq = clockseq; // Per 4.1.4 - Convert from unix epoch to Gregorian epoch
  31618. msecs += 12219292800000; // `time_low`
  31619. const tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000;
  31620. b[i++] = tl >>> 24 & 0xff;
  31621. b[i++] = tl >>> 16 & 0xff;
  31622. b[i++] = tl >>> 8 & 0xff;
  31623. b[i++] = tl & 0xff; // `time_mid`
  31624. const tmh = msecs / 0x100000000 * 10000 & 0xfffffff;
  31625. b[i++] = tmh >>> 8 & 0xff;
  31626. b[i++] = tmh & 0xff; // `time_high_and_version`
  31627. b[i++] = tmh >>> 24 & 0xf | 0x10; // include version
  31628. b[i++] = tmh >>> 16 & 0xff; // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant)
  31629. b[i++] = clockseq >>> 8 | 0x80; // `clock_seq_low`
  31630. b[i++] = clockseq & 0xff; // `node`
  31631. for (let n = 0; n < 6; ++n) {
  31632. b[i + n] = node[n];
  31633. }
  31634. return buf || (0, _stringify.unsafeStringify)(b);
  31635. }
  31636. var _default = v1;
  31637. exports["default"] = _default;
  31638. /***/ }),
  31639. /***/ 6409:
  31640. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31641. "use strict";
  31642. Object.defineProperty(exports, "__esModule", ({
  31643. value: true
  31644. }));
  31645. exports["default"] = void 0;
  31646. var _v = _interopRequireDefault(__nccwpck_require__(5998));
  31647. var _md = _interopRequireDefault(__nccwpck_require__(4569));
  31648. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31649. const v3 = (0, _v.default)('v3', 0x30, _md.default);
  31650. var _default = v3;
  31651. exports["default"] = _default;
  31652. /***/ }),
  31653. /***/ 5998:
  31654. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31655. "use strict";
  31656. Object.defineProperty(exports, "__esModule", ({
  31657. value: true
  31658. }));
  31659. exports.URL = exports.DNS = void 0;
  31660. exports["default"] = v35;
  31661. var _stringify = __nccwpck_require__(8950);
  31662. var _parse = _interopRequireDefault(__nccwpck_require__(2746));
  31663. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31664. function stringToBytes(str) {
  31665. str = unescape(encodeURIComponent(str)); // UTF8 escape
  31666. const bytes = [];
  31667. for (let i = 0; i < str.length; ++i) {
  31668. bytes.push(str.charCodeAt(i));
  31669. }
  31670. return bytes;
  31671. }
  31672. const DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8';
  31673. exports.DNS = DNS;
  31674. const URL = '6ba7b811-9dad-11d1-80b4-00c04fd430c8';
  31675. exports.URL = URL;
  31676. function v35(name, version, hashfunc) {
  31677. function generateUUID(value, namespace, buf, offset) {
  31678. var _namespace;
  31679. if (typeof value === 'string') {
  31680. value = stringToBytes(value);
  31681. }
  31682. if (typeof namespace === 'string') {
  31683. namespace = (0, _parse.default)(namespace);
  31684. }
  31685. if (((_namespace = namespace) === null || _namespace === void 0 ? void 0 : _namespace.length) !== 16) {
  31686. throw TypeError('Namespace must be array-like (16 iterable integer values, 0-255)');
  31687. } // Compute hash of namespace and value, Per 4.3
  31688. // Future: Use spread syntax when supported on all platforms, e.g. `bytes =
  31689. // hashfunc([...namespace, ... value])`
  31690. let bytes = new Uint8Array(16 + value.length);
  31691. bytes.set(namespace);
  31692. bytes.set(value, namespace.length);
  31693. bytes = hashfunc(bytes);
  31694. bytes[6] = bytes[6] & 0x0f | version;
  31695. bytes[8] = bytes[8] & 0x3f | 0x80;
  31696. if (buf) {
  31697. offset = offset || 0;
  31698. for (let i = 0; i < 16; ++i) {
  31699. buf[offset + i] = bytes[i];
  31700. }
  31701. return buf;
  31702. }
  31703. return (0, _stringify.unsafeStringify)(bytes);
  31704. } // Function#name is not settable on some platforms (#270)
  31705. try {
  31706. generateUUID.name = name; // eslint-disable-next-line no-empty
  31707. } catch (err) {} // For CommonJS default export support
  31708. generateUUID.DNS = DNS;
  31709. generateUUID.URL = URL;
  31710. return generateUUID;
  31711. }
  31712. /***/ }),
  31713. /***/ 5122:
  31714. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31715. "use strict";
  31716. Object.defineProperty(exports, "__esModule", ({
  31717. value: true
  31718. }));
  31719. exports["default"] = void 0;
  31720. var _native = _interopRequireDefault(__nccwpck_require__(2054));
  31721. var _rng = _interopRequireDefault(__nccwpck_require__(807));
  31722. var _stringify = __nccwpck_require__(8950);
  31723. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31724. function v4(options, buf, offset) {
  31725. if (_native.default.randomUUID && !buf && !options) {
  31726. return _native.default.randomUUID();
  31727. }
  31728. options = options || {};
  31729. const rnds = options.random || (options.rng || _rng.default)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
  31730. rnds[6] = rnds[6] & 0x0f | 0x40;
  31731. rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided
  31732. if (buf) {
  31733. offset = offset || 0;
  31734. for (let i = 0; i < 16; ++i) {
  31735. buf[offset + i] = rnds[i];
  31736. }
  31737. return buf;
  31738. }
  31739. return (0, _stringify.unsafeStringify)(rnds);
  31740. }
  31741. var _default = v4;
  31742. exports["default"] = _default;
  31743. /***/ }),
  31744. /***/ 9120:
  31745. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31746. "use strict";
  31747. Object.defineProperty(exports, "__esModule", ({
  31748. value: true
  31749. }));
  31750. exports["default"] = void 0;
  31751. var _v = _interopRequireDefault(__nccwpck_require__(5998));
  31752. var _sha = _interopRequireDefault(__nccwpck_require__(5274));
  31753. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31754. const v5 = (0, _v.default)('v5', 0x50, _sha.default);
  31755. var _default = v5;
  31756. exports["default"] = _default;
  31757. /***/ }),
  31758. /***/ 6900:
  31759. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31760. "use strict";
  31761. Object.defineProperty(exports, "__esModule", ({
  31762. value: true
  31763. }));
  31764. exports["default"] = void 0;
  31765. var _regex = _interopRequireDefault(__nccwpck_require__(814));
  31766. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31767. function validate(uuid) {
  31768. return typeof uuid === 'string' && _regex.default.test(uuid);
  31769. }
  31770. var _default = validate;
  31771. exports["default"] = _default;
  31772. /***/ }),
  31773. /***/ 2414:
  31774. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31775. "use strict";
  31776. Object.defineProperty(exports, "__esModule", ({
  31777. value: true
  31778. }));
  31779. exports["default"] = void 0;
  31780. var _validate = _interopRequireDefault(__nccwpck_require__(6900));
  31781. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31782. function version(uuid) {
  31783. if (!(0, _validate.default)(uuid)) {
  31784. throw TypeError('Invalid UUID');
  31785. }
  31786. return parseInt(uuid.slice(14, 15), 16);
  31787. }
  31788. var _default = version;
  31789. exports["default"] = _default;
  31790. /***/ }),
  31791. /***/ 2940:
  31792. /***/ ((module) => {
  31793. // Returns a wrapper function that returns a wrapped callback
  31794. // The wrapper function should do some stuff, and return a
  31795. // presumably different callback function.
  31796. // This makes sure that own properties are retained, so that
  31797. // decorations and such are not lost along the way.
  31798. module.exports = wrappy
  31799. function wrappy (fn, cb) {
  31800. if (fn && cb) return wrappy(fn)(cb)
  31801. if (typeof fn !== 'function')
  31802. throw new TypeError('need wrapper function')
  31803. Object.keys(fn).forEach(function (k) {
  31804. wrapper[k] = fn[k]
  31805. })
  31806. return wrapper
  31807. function wrapper() {
  31808. var args = new Array(arguments.length)
  31809. for (var i = 0; i < args.length; i++) {
  31810. args[i] = arguments[i]
  31811. }
  31812. var ret = fn.apply(this, args)
  31813. var cb = args[args.length-1]
  31814. if (typeof ret === 'function' && ret !== cb) {
  31815. Object.keys(cb).forEach(function (k) {
  31816. ret[k] = cb[k]
  31817. })
  31818. }
  31819. return ret
  31820. }
  31821. }
  31822. /***/ }),
  31823. /***/ 9491:
  31824. /***/ ((module) => {
  31825. "use strict";
  31826. module.exports = require("assert");
  31827. /***/ }),
  31828. /***/ 852:
  31829. /***/ ((module) => {
  31830. "use strict";
  31831. module.exports = require("async_hooks");
  31832. /***/ }),
  31833. /***/ 4300:
  31834. /***/ ((module) => {
  31835. "use strict";
  31836. module.exports = require("buffer");
  31837. /***/ }),
  31838. /***/ 2081:
  31839. /***/ ((module) => {
  31840. "use strict";
  31841. module.exports = require("child_process");
  31842. /***/ }),
  31843. /***/ 6206:
  31844. /***/ ((module) => {
  31845. "use strict";
  31846. module.exports = require("console");
  31847. /***/ }),
  31848. /***/ 6113:
  31849. /***/ ((module) => {
  31850. "use strict";
  31851. module.exports = require("crypto");
  31852. /***/ }),
  31853. /***/ 7643:
  31854. /***/ ((module) => {
  31855. "use strict";
  31856. module.exports = require("diagnostics_channel");
  31857. /***/ }),
  31858. /***/ 2361:
  31859. /***/ ((module) => {
  31860. "use strict";
  31861. module.exports = require("events");
  31862. /***/ }),
  31863. /***/ 7147:
  31864. /***/ ((module) => {
  31865. "use strict";
  31866. module.exports = require("fs");
  31867. /***/ }),
  31868. /***/ 3685:
  31869. /***/ ((module) => {
  31870. "use strict";
  31871. module.exports = require("http");
  31872. /***/ }),
  31873. /***/ 5158:
  31874. /***/ ((module) => {
  31875. "use strict";
  31876. module.exports = require("http2");
  31877. /***/ }),
  31878. /***/ 5687:
  31879. /***/ ((module) => {
  31880. "use strict";
  31881. module.exports = require("https");
  31882. /***/ }),
  31883. /***/ 1808:
  31884. /***/ ((module) => {
  31885. "use strict";
  31886. module.exports = require("net");
  31887. /***/ }),
  31888. /***/ 6005:
  31889. /***/ ((module) => {
  31890. "use strict";
  31891. module.exports = require("node:crypto");
  31892. /***/ }),
  31893. /***/ 5673:
  31894. /***/ ((module) => {
  31895. "use strict";
  31896. module.exports = require("node:events");
  31897. /***/ }),
  31898. /***/ 4492:
  31899. /***/ ((module) => {
  31900. "use strict";
  31901. module.exports = require("node:stream");
  31902. /***/ }),
  31903. /***/ 7261:
  31904. /***/ ((module) => {
  31905. "use strict";
  31906. module.exports = require("node:util");
  31907. /***/ }),
  31908. /***/ 2037:
  31909. /***/ ((module) => {
  31910. "use strict";
  31911. module.exports = require("os");
  31912. /***/ }),
  31913. /***/ 1017:
  31914. /***/ ((module) => {
  31915. "use strict";
  31916. module.exports = require("path");
  31917. /***/ }),
  31918. /***/ 4074:
  31919. /***/ ((module) => {
  31920. "use strict";
  31921. module.exports = require("perf_hooks");
  31922. /***/ }),
  31923. /***/ 3477:
  31924. /***/ ((module) => {
  31925. "use strict";
  31926. module.exports = require("querystring");
  31927. /***/ }),
  31928. /***/ 2781:
  31929. /***/ ((module) => {
  31930. "use strict";
  31931. module.exports = require("stream");
  31932. /***/ }),
  31933. /***/ 5356:
  31934. /***/ ((module) => {
  31935. "use strict";
  31936. module.exports = require("stream/web");
  31937. /***/ }),
  31938. /***/ 1576:
  31939. /***/ ((module) => {
  31940. "use strict";
  31941. module.exports = require("string_decoder");
  31942. /***/ }),
  31943. /***/ 9512:
  31944. /***/ ((module) => {
  31945. "use strict";
  31946. module.exports = require("timers");
  31947. /***/ }),
  31948. /***/ 4404:
  31949. /***/ ((module) => {
  31950. "use strict";
  31951. module.exports = require("tls");
  31952. /***/ }),
  31953. /***/ 7310:
  31954. /***/ ((module) => {
  31955. "use strict";
  31956. module.exports = require("url");
  31957. /***/ }),
  31958. /***/ 3837:
  31959. /***/ ((module) => {
  31960. "use strict";
  31961. module.exports = require("util");
  31962. /***/ }),
  31963. /***/ 9830:
  31964. /***/ ((module) => {
  31965. "use strict";
  31966. module.exports = require("util/types");
  31967. /***/ }),
  31968. /***/ 1267:
  31969. /***/ ((module) => {
  31970. "use strict";
  31971. module.exports = require("worker_threads");
  31972. /***/ }),
  31973. /***/ 9796:
  31974. /***/ ((module) => {
  31975. "use strict";
  31976. module.exports = require("zlib");
  31977. /***/ }),
  31978. /***/ 2960:
  31979. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  31980. "use strict";
  31981. const WritableStream = (__nccwpck_require__(4492).Writable)
  31982. const inherits = (__nccwpck_require__(7261).inherits)
  31983. const StreamSearch = __nccwpck_require__(1142)
  31984. const PartStream = __nccwpck_require__(1620)
  31985. const HeaderParser = __nccwpck_require__(2032)
  31986. const DASH = 45
  31987. const B_ONEDASH = Buffer.from('-')
  31988. const B_CRLF = Buffer.from('\r\n')
  31989. const EMPTY_FN = function () {}
  31990. function Dicer (cfg) {
  31991. if (!(this instanceof Dicer)) { return new Dicer(cfg) }
  31992. WritableStream.call(this, cfg)
  31993. if (!cfg || (!cfg.headerFirst && typeof cfg.boundary !== 'string')) { throw new TypeError('Boundary required') }
  31994. if (typeof cfg.boundary === 'string') { this.setBoundary(cfg.boundary) } else { this._bparser = undefined }
  31995. this._headerFirst = cfg.headerFirst
  31996. this._dashes = 0
  31997. this._parts = 0
  31998. this._finished = false
  31999. this._realFinish = false
  32000. this._isPreamble = true
  32001. this._justMatched = false
  32002. this._firstWrite = true
  32003. this._inHeader = true
  32004. this._part = undefined
  32005. this._cb = undefined
  32006. this._ignoreData = false
  32007. this._partOpts = { highWaterMark: cfg.partHwm }
  32008. this._pause = false
  32009. const self = this
  32010. this._hparser = new HeaderParser(cfg)
  32011. this._hparser.on('header', function (header) {
  32012. self._inHeader = false
  32013. self._part.emit('header', header)
  32014. })
  32015. }
  32016. inherits(Dicer, WritableStream)
  32017. Dicer.prototype.emit = function (ev) {
  32018. if (ev === 'finish' && !this._realFinish) {
  32019. if (!this._finished) {
  32020. const self = this
  32021. process.nextTick(function () {
  32022. self.emit('error', new Error('Unexpected end of multipart data'))
  32023. if (self._part && !self._ignoreData) {
  32024. const type = (self._isPreamble ? 'Preamble' : 'Part')
  32025. self._part.emit('error', new Error(type + ' terminated early due to unexpected end of multipart data'))
  32026. self._part.push(null)
  32027. process.nextTick(function () {
  32028. self._realFinish = true
  32029. self.emit('finish')
  32030. self._realFinish = false
  32031. })
  32032. return
  32033. }
  32034. self._realFinish = true
  32035. self.emit('finish')
  32036. self._realFinish = false
  32037. })
  32038. }
  32039. } else { WritableStream.prototype.emit.apply(this, arguments) }
  32040. }
  32041. Dicer.prototype._write = function (data, encoding, cb) {
  32042. // ignore unexpected data (e.g. extra trailer data after finished)
  32043. if (!this._hparser && !this._bparser) { return cb() }
  32044. if (this._headerFirst && this._isPreamble) {
  32045. if (!this._part) {
  32046. this._part = new PartStream(this._partOpts)
  32047. if (this.listenerCount('preamble') !== 0) { this.emit('preamble', this._part) } else { this._ignore() }
  32048. }
  32049. const r = this._hparser.push(data)
  32050. if (!this._inHeader && r !== undefined && r < data.length) { data = data.slice(r) } else { return cb() }
  32051. }
  32052. // allows for "easier" testing
  32053. if (this._firstWrite) {
  32054. this._bparser.push(B_CRLF)
  32055. this._firstWrite = false
  32056. }
  32057. this._bparser.push(data)
  32058. if (this._pause) { this._cb = cb } else { cb() }
  32059. }
  32060. Dicer.prototype.reset = function () {
  32061. this._part = undefined
  32062. this._bparser = undefined
  32063. this._hparser = undefined
  32064. }
  32065. Dicer.prototype.setBoundary = function (boundary) {
  32066. const self = this
  32067. this._bparser = new StreamSearch('\r\n--' + boundary)
  32068. this._bparser.on('info', function (isMatch, data, start, end) {
  32069. self._oninfo(isMatch, data, start, end)
  32070. })
  32071. }
  32072. Dicer.prototype._ignore = function () {
  32073. if (this._part && !this._ignoreData) {
  32074. this._ignoreData = true
  32075. this._part.on('error', EMPTY_FN)
  32076. // we must perform some kind of read on the stream even though we are
  32077. // ignoring the data, otherwise node's Readable stream will not emit 'end'
  32078. // after pushing null to the stream
  32079. this._part.resume()
  32080. }
  32081. }
  32082. Dicer.prototype._oninfo = function (isMatch, data, start, end) {
  32083. let buf; const self = this; let i = 0; let r; let shouldWriteMore = true
  32084. if (!this._part && this._justMatched && data) {
  32085. while (this._dashes < 2 && (start + i) < end) {
  32086. if (data[start + i] === DASH) {
  32087. ++i
  32088. ++this._dashes
  32089. } else {
  32090. if (this._dashes) { buf = B_ONEDASH }
  32091. this._dashes = 0
  32092. break
  32093. }
  32094. }
  32095. if (this._dashes === 2) {
  32096. if ((start + i) < end && this.listenerCount('trailer') !== 0) { this.emit('trailer', data.slice(start + i, end)) }
  32097. this.reset()
  32098. this._finished = true
  32099. // no more parts will be added
  32100. if (self._parts === 0) {
  32101. self._realFinish = true
  32102. self.emit('finish')
  32103. self._realFinish = false
  32104. }
  32105. }
  32106. if (this._dashes) { return }
  32107. }
  32108. if (this._justMatched) { this._justMatched = false }
  32109. if (!this._part) {
  32110. this._part = new PartStream(this._partOpts)
  32111. this._part._read = function (n) {
  32112. self._unpause()
  32113. }
  32114. if (this._isPreamble && this.listenerCount('preamble') !== 0) {
  32115. this.emit('preamble', this._part)
  32116. } else if (this._isPreamble !== true && this.listenerCount('part') !== 0) {
  32117. this.emit('part', this._part)
  32118. } else {
  32119. this._ignore()
  32120. }
  32121. if (!this._isPreamble) { this._inHeader = true }
  32122. }
  32123. if (data && start < end && !this._ignoreData) {
  32124. if (this._isPreamble || !this._inHeader) {
  32125. if (buf) { shouldWriteMore = this._part.push(buf) }
  32126. shouldWriteMore = this._part.push(data.slice(start, end))
  32127. if (!shouldWriteMore) { this._pause = true }
  32128. } else if (!this._isPreamble && this._inHeader) {
  32129. if (buf) { this._hparser.push(buf) }
  32130. r = this._hparser.push(data.slice(start, end))
  32131. if (!this._inHeader && r !== undefined && r < end) { this._oninfo(false, data, start + r, end) }
  32132. }
  32133. }
  32134. if (isMatch) {
  32135. this._hparser.reset()
  32136. if (this._isPreamble) { this._isPreamble = false } else {
  32137. if (start !== end) {
  32138. ++this._parts
  32139. this._part.on('end', function () {
  32140. if (--self._parts === 0) {
  32141. if (self._finished) {
  32142. self._realFinish = true
  32143. self.emit('finish')
  32144. self._realFinish = false
  32145. } else {
  32146. self._unpause()
  32147. }
  32148. }
  32149. })
  32150. }
  32151. }
  32152. this._part.push(null)
  32153. this._part = undefined
  32154. this._ignoreData = false
  32155. this._justMatched = true
  32156. this._dashes = 0
  32157. }
  32158. }
  32159. Dicer.prototype._unpause = function () {
  32160. if (!this._pause) { return }
  32161. this._pause = false
  32162. if (this._cb) {
  32163. const cb = this._cb
  32164. this._cb = undefined
  32165. cb()
  32166. }
  32167. }
  32168. module.exports = Dicer
  32169. /***/ }),
  32170. /***/ 2032:
  32171. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  32172. "use strict";
  32173. const EventEmitter = (__nccwpck_require__(5673).EventEmitter)
  32174. const inherits = (__nccwpck_require__(7261).inherits)
  32175. const getLimit = __nccwpck_require__(1467)
  32176. const StreamSearch = __nccwpck_require__(1142)
  32177. const B_DCRLF = Buffer.from('\r\n\r\n')
  32178. const RE_CRLF = /\r\n/g
  32179. const RE_HDR = /^([^:]+):[ \t]?([\x00-\xFF]+)?$/ // eslint-disable-line no-control-regex
  32180. function HeaderParser (cfg) {
  32181. EventEmitter.call(this)
  32182. cfg = cfg || {}
  32183. const self = this
  32184. this.nread = 0
  32185. this.maxed = false
  32186. this.npairs = 0
  32187. this.maxHeaderPairs = getLimit(cfg, 'maxHeaderPairs', 2000)
  32188. this.maxHeaderSize = getLimit(cfg, 'maxHeaderSize', 80 * 1024)
  32189. this.buffer = ''
  32190. this.header = {}
  32191. this.finished = false
  32192. this.ss = new StreamSearch(B_DCRLF)
  32193. this.ss.on('info', function (isMatch, data, start, end) {
  32194. if (data && !self.maxed) {
  32195. if (self.nread + end - start >= self.maxHeaderSize) {
  32196. end = self.maxHeaderSize - self.nread + start
  32197. self.nread = self.maxHeaderSize
  32198. self.maxed = true
  32199. } else { self.nread += (end - start) }
  32200. self.buffer += data.toString('binary', start, end)
  32201. }
  32202. if (isMatch) { self._finish() }
  32203. })
  32204. }
  32205. inherits(HeaderParser, EventEmitter)
  32206. HeaderParser.prototype.push = function (data) {
  32207. const r = this.ss.push(data)
  32208. if (this.finished) { return r }
  32209. }
  32210. HeaderParser.prototype.reset = function () {
  32211. this.finished = false
  32212. this.buffer = ''
  32213. this.header = {}
  32214. this.ss.reset()
  32215. }
  32216. HeaderParser.prototype._finish = function () {
  32217. if (this.buffer) { this._parseHeader() }
  32218. this.ss.matches = this.ss.maxMatches
  32219. const header = this.header
  32220. this.header = {}
  32221. this.buffer = ''
  32222. this.finished = true
  32223. this.nread = this.npairs = 0
  32224. this.maxed = false
  32225. this.emit('header', header)
  32226. }
  32227. HeaderParser.prototype._parseHeader = function () {
  32228. if (this.npairs === this.maxHeaderPairs) { return }
  32229. const lines = this.buffer.split(RE_CRLF)
  32230. const len = lines.length
  32231. let m, h
  32232. for (var i = 0; i < len; ++i) { // eslint-disable-line no-var
  32233. if (lines[i].length === 0) { continue }
  32234. if (lines[i][0] === '\t' || lines[i][0] === ' ') {
  32235. // folded header content
  32236. // RFC2822 says to just remove the CRLF and not the whitespace following
  32237. // it, so we follow the RFC and include the leading whitespace ...
  32238. if (h) {
  32239. this.header[h][this.header[h].length - 1] += lines[i]
  32240. continue
  32241. }
  32242. }
  32243. const posColon = lines[i].indexOf(':')
  32244. if (
  32245. posColon === -1 ||
  32246. posColon === 0
  32247. ) {
  32248. return
  32249. }
  32250. m = RE_HDR.exec(lines[i])
  32251. h = m[1].toLowerCase()
  32252. this.header[h] = this.header[h] || []
  32253. this.header[h].push((m[2] || ''))
  32254. if (++this.npairs === this.maxHeaderPairs) { break }
  32255. }
  32256. }
  32257. module.exports = HeaderParser
  32258. /***/ }),
  32259. /***/ 1620:
  32260. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  32261. "use strict";
  32262. const inherits = (__nccwpck_require__(7261).inherits)
  32263. const ReadableStream = (__nccwpck_require__(4492).Readable)
  32264. function PartStream (opts) {
  32265. ReadableStream.call(this, opts)
  32266. }
  32267. inherits(PartStream, ReadableStream)
  32268. PartStream.prototype._read = function (n) {}
  32269. module.exports = PartStream
  32270. /***/ }),
  32271. /***/ 1142:
  32272. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  32273. "use strict";
  32274. /**
  32275. * Copyright Brian White. All rights reserved.
  32276. *
  32277. * @see https://github.com/mscdex/streamsearch
  32278. *
  32279. * Permission is hereby granted, free of charge, to any person obtaining a copy
  32280. * of this software and associated documentation files (the "Software"), to
  32281. * deal in the Software without restriction, including without limitation the
  32282. * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
  32283. * sell copies of the Software, and to permit persons to whom the Software is
  32284. * furnished to do so, subject to the following conditions:
  32285. *
  32286. * The above copyright notice and this permission notice shall be included in
  32287. * all copies or substantial portions of the Software.
  32288. *
  32289. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  32290. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  32291. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  32292. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  32293. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  32294. * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
  32295. * IN THE SOFTWARE.
  32296. *
  32297. * Based heavily on the Streaming Boyer-Moore-Horspool C++ implementation
  32298. * by Hongli Lai at: https://github.com/FooBarWidget/boyer-moore-horspool
  32299. */
  32300. const EventEmitter = (__nccwpck_require__(5673).EventEmitter)
  32301. const inherits = (__nccwpck_require__(7261).inherits)
  32302. function SBMH (needle) {
  32303. if (typeof needle === 'string') {
  32304. needle = Buffer.from(needle)
  32305. }
  32306. if (!Buffer.isBuffer(needle)) {
  32307. throw new TypeError('The needle has to be a String or a Buffer.')
  32308. }
  32309. const needleLength = needle.length
  32310. if (needleLength === 0) {
  32311. throw new Error('The needle cannot be an empty String/Buffer.')
  32312. }
  32313. if (needleLength > 256) {
  32314. throw new Error('The needle cannot have a length bigger than 256.')
  32315. }
  32316. this.maxMatches = Infinity
  32317. this.matches = 0
  32318. this._occ = new Array(256)
  32319. .fill(needleLength) // Initialize occurrence table.
  32320. this._lookbehind_size = 0
  32321. this._needle = needle
  32322. this._bufpos = 0
  32323. this._lookbehind = Buffer.alloc(needleLength)
  32324. // Populate occurrence table with analysis of the needle,
  32325. // ignoring last letter.
  32326. for (var i = 0; i < needleLength - 1; ++i) { // eslint-disable-line no-var
  32327. this._occ[needle[i]] = needleLength - 1 - i
  32328. }
  32329. }
  32330. inherits(SBMH, EventEmitter)
  32331. SBMH.prototype.reset = function () {
  32332. this._lookbehind_size = 0
  32333. this.matches = 0
  32334. this._bufpos = 0
  32335. }
  32336. SBMH.prototype.push = function (chunk, pos) {
  32337. if (!Buffer.isBuffer(chunk)) {
  32338. chunk = Buffer.from(chunk, 'binary')
  32339. }
  32340. const chlen = chunk.length
  32341. this._bufpos = pos || 0
  32342. let r
  32343. while (r !== chlen && this.matches < this.maxMatches) { r = this._sbmh_feed(chunk) }
  32344. return r
  32345. }
  32346. SBMH.prototype._sbmh_feed = function (data) {
  32347. const len = data.length
  32348. const needle = this._needle
  32349. const needleLength = needle.length
  32350. const lastNeedleChar = needle[needleLength - 1]
  32351. // Positive: points to a position in `data`
  32352. // pos == 3 points to data[3]
  32353. // Negative: points to a position in the lookbehind buffer
  32354. // pos == -2 points to lookbehind[lookbehind_size - 2]
  32355. let pos = -this._lookbehind_size
  32356. let ch
  32357. if (pos < 0) {
  32358. // Lookbehind buffer is not empty. Perform Boyer-Moore-Horspool
  32359. // search with character lookup code that considers both the
  32360. // lookbehind buffer and the current round's haystack data.
  32361. //
  32362. // Loop until
  32363. // there is a match.
  32364. // or until
  32365. // we've moved past the position that requires the
  32366. // lookbehind buffer. In this case we switch to the
  32367. // optimized loop.
  32368. // or until
  32369. // the character to look at lies outside the haystack.
  32370. while (pos < 0 && pos <= len - needleLength) {
  32371. ch = this._sbmh_lookup_char(data, pos + needleLength - 1)
  32372. if (
  32373. ch === lastNeedleChar &&
  32374. this._sbmh_memcmp(data, pos, needleLength - 1)
  32375. ) {
  32376. this._lookbehind_size = 0
  32377. ++this.matches
  32378. this.emit('info', true)
  32379. return (this._bufpos = pos + needleLength)
  32380. }
  32381. pos += this._occ[ch]
  32382. }
  32383. // No match.
  32384. if (pos < 0) {
  32385. // There's too few data for Boyer-Moore-Horspool to run,
  32386. // so let's use a different algorithm to skip as much as
  32387. // we can.
  32388. // Forward pos until
  32389. // the trailing part of lookbehind + data
  32390. // looks like the beginning of the needle
  32391. // or until
  32392. // pos == 0
  32393. while (pos < 0 && !this._sbmh_memcmp(data, pos, len - pos)) { ++pos }
  32394. }
  32395. if (pos >= 0) {
  32396. // Discard lookbehind buffer.
  32397. this.emit('info', false, this._lookbehind, 0, this._lookbehind_size)
  32398. this._lookbehind_size = 0
  32399. } else {
  32400. // Cut off part of the lookbehind buffer that has
  32401. // been processed and append the entire haystack
  32402. // into it.
  32403. const bytesToCutOff = this._lookbehind_size + pos
  32404. if (bytesToCutOff > 0) {
  32405. // The cut off data is guaranteed not to contain the needle.
  32406. this.emit('info', false, this._lookbehind, 0, bytesToCutOff)
  32407. }
  32408. this._lookbehind.copy(this._lookbehind, 0, bytesToCutOff,
  32409. this._lookbehind_size - bytesToCutOff)
  32410. this._lookbehind_size -= bytesToCutOff
  32411. data.copy(this._lookbehind, this._lookbehind_size)
  32412. this._lookbehind_size += len
  32413. this._bufpos = len
  32414. return len
  32415. }
  32416. }
  32417. pos += (pos >= 0) * this._bufpos
  32418. // Lookbehind buffer is now empty. We only need to check if the
  32419. // needle is in the haystack.
  32420. if (data.indexOf(needle, pos) !== -1) {
  32421. pos = data.indexOf(needle, pos)
  32422. ++this.matches
  32423. if (pos > 0) { this.emit('info', true, data, this._bufpos, pos) } else { this.emit('info', true) }
  32424. return (this._bufpos = pos + needleLength)
  32425. } else {
  32426. pos = len - needleLength
  32427. }
  32428. // There was no match. If there's trailing haystack data that we cannot
  32429. // match yet using the Boyer-Moore-Horspool algorithm (because the trailing
  32430. // data is less than the needle size) then match using a modified
  32431. // algorithm that starts matching from the beginning instead of the end.
  32432. // Whatever trailing data is left after running this algorithm is added to
  32433. // the lookbehind buffer.
  32434. while (
  32435. pos < len &&
  32436. (
  32437. data[pos] !== needle[0] ||
  32438. (
  32439. (Buffer.compare(
  32440. data.subarray(pos, pos + len - pos),
  32441. needle.subarray(0, len - pos)
  32442. ) !== 0)
  32443. )
  32444. )
  32445. ) {
  32446. ++pos
  32447. }
  32448. if (pos < len) {
  32449. data.copy(this._lookbehind, 0, pos, pos + (len - pos))
  32450. this._lookbehind_size = len - pos
  32451. }
  32452. // Everything until pos is guaranteed not to contain needle data.
  32453. if (pos > 0) { this.emit('info', false, data, this._bufpos, pos < len ? pos : len) }
  32454. this._bufpos = len
  32455. return len
  32456. }
  32457. SBMH.prototype._sbmh_lookup_char = function (data, pos) {
  32458. return (pos < 0)
  32459. ? this._lookbehind[this._lookbehind_size + pos]
  32460. : data[pos]
  32461. }
  32462. SBMH.prototype._sbmh_memcmp = function (data, pos, len) {
  32463. for (var i = 0; i < len; ++i) { // eslint-disable-line no-var
  32464. if (this._sbmh_lookup_char(data, pos + i) !== this._needle[i]) { return false }
  32465. }
  32466. return true
  32467. }
  32468. module.exports = SBMH
  32469. /***/ }),
  32470. /***/ 727:
  32471. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  32472. "use strict";
  32473. const WritableStream = (__nccwpck_require__(4492).Writable)
  32474. const { inherits } = __nccwpck_require__(7261)
  32475. const Dicer = __nccwpck_require__(2960)
  32476. const MultipartParser = __nccwpck_require__(2183)
  32477. const UrlencodedParser = __nccwpck_require__(8306)
  32478. const parseParams = __nccwpck_require__(1854)
  32479. function Busboy (opts) {
  32480. if (!(this instanceof Busboy)) { return new Busboy(opts) }
  32481. if (typeof opts !== 'object') {
  32482. throw new TypeError('Busboy expected an options-Object.')
  32483. }
  32484. if (typeof opts.headers !== 'object') {
  32485. throw new TypeError('Busboy expected an options-Object with headers-attribute.')
  32486. }
  32487. if (typeof opts.headers['content-type'] !== 'string') {
  32488. throw new TypeError('Missing Content-Type-header.')
  32489. }
  32490. const {
  32491. headers,
  32492. ...streamOptions
  32493. } = opts
  32494. this.opts = {
  32495. autoDestroy: false,
  32496. ...streamOptions
  32497. }
  32498. WritableStream.call(this, this.opts)
  32499. this._done = false
  32500. this._parser = this.getParserByHeaders(headers)
  32501. this._finished = false
  32502. }
  32503. inherits(Busboy, WritableStream)
  32504. Busboy.prototype.emit = function (ev) {
  32505. if (ev === 'finish') {
  32506. if (!this._done) {
  32507. this._parser?.end()
  32508. return
  32509. } else if (this._finished) {
  32510. return
  32511. }
  32512. this._finished = true
  32513. }
  32514. WritableStream.prototype.emit.apply(this, arguments)
  32515. }
  32516. Busboy.prototype.getParserByHeaders = function (headers) {
  32517. const parsed = parseParams(headers['content-type'])
  32518. const cfg = {
  32519. defCharset: this.opts.defCharset,
  32520. fileHwm: this.opts.fileHwm,
  32521. headers,
  32522. highWaterMark: this.opts.highWaterMark,
  32523. isPartAFile: this.opts.isPartAFile,
  32524. limits: this.opts.limits,
  32525. parsedConType: parsed,
  32526. preservePath: this.opts.preservePath
  32527. }
  32528. if (MultipartParser.detect.test(parsed[0])) {
  32529. return new MultipartParser(this, cfg)
  32530. }
  32531. if (UrlencodedParser.detect.test(parsed[0])) {
  32532. return new UrlencodedParser(this, cfg)
  32533. }
  32534. throw new Error('Unsupported Content-Type.')
  32535. }
  32536. Busboy.prototype._write = function (chunk, encoding, cb) {
  32537. this._parser.write(chunk, cb)
  32538. }
  32539. module.exports = Busboy
  32540. module.exports["default"] = Busboy
  32541. module.exports.Busboy = Busboy
  32542. module.exports.Dicer = Dicer
  32543. /***/ }),
  32544. /***/ 2183:
  32545. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  32546. "use strict";
  32547. // TODO:
  32548. // * support 1 nested multipart level
  32549. // (see second multipart example here:
  32550. // http://www.w3.org/TR/html401/interact/forms.html#didx-multipartform-data)
  32551. // * support limits.fieldNameSize
  32552. // -- this will require modifications to utils.parseParams
  32553. const { Readable } = __nccwpck_require__(4492)
  32554. const { inherits } = __nccwpck_require__(7261)
  32555. const Dicer = __nccwpck_require__(2960)
  32556. const parseParams = __nccwpck_require__(1854)
  32557. const decodeText = __nccwpck_require__(4619)
  32558. const basename = __nccwpck_require__(8647)
  32559. const getLimit = __nccwpck_require__(1467)
  32560. const RE_BOUNDARY = /^boundary$/i
  32561. const RE_FIELD = /^form-data$/i
  32562. const RE_CHARSET = /^charset$/i
  32563. const RE_FILENAME = /^filename$/i
  32564. const RE_NAME = /^name$/i
  32565. Multipart.detect = /^multipart\/form-data/i
  32566. function Multipart (boy, cfg) {
  32567. let i
  32568. let len
  32569. const self = this
  32570. let boundary
  32571. const limits = cfg.limits
  32572. const isPartAFile = cfg.isPartAFile || ((fieldName, contentType, fileName) => (contentType === 'application/octet-stream' || fileName !== undefined))
  32573. const parsedConType = cfg.parsedConType || []
  32574. const defCharset = cfg.defCharset || 'utf8'
  32575. const preservePath = cfg.preservePath
  32576. const fileOpts = { highWaterMark: cfg.fileHwm }
  32577. for (i = 0, len = parsedConType.length; i < len; ++i) {
  32578. if (Array.isArray(parsedConType[i]) &&
  32579. RE_BOUNDARY.test(parsedConType[i][0])) {
  32580. boundary = parsedConType[i][1]
  32581. break
  32582. }
  32583. }
  32584. function checkFinished () {
  32585. if (nends === 0 && finished && !boy._done) {
  32586. finished = false
  32587. self.end()
  32588. }
  32589. }
  32590. if (typeof boundary !== 'string') { throw new Error('Multipart: Boundary not found') }
  32591. const fieldSizeLimit = getLimit(limits, 'fieldSize', 1 * 1024 * 1024)
  32592. const fileSizeLimit = getLimit(limits, 'fileSize', Infinity)
  32593. const filesLimit = getLimit(limits, 'files', Infinity)
  32594. const fieldsLimit = getLimit(limits, 'fields', Infinity)
  32595. const partsLimit = getLimit(limits, 'parts', Infinity)
  32596. const headerPairsLimit = getLimit(limits, 'headerPairs', 2000)
  32597. const headerSizeLimit = getLimit(limits, 'headerSize', 80 * 1024)
  32598. let nfiles = 0
  32599. let nfields = 0
  32600. let nends = 0
  32601. let curFile
  32602. let curField
  32603. let finished = false
  32604. this._needDrain = false
  32605. this._pause = false
  32606. this._cb = undefined
  32607. this._nparts = 0
  32608. this._boy = boy
  32609. const parserCfg = {
  32610. boundary,
  32611. maxHeaderPairs: headerPairsLimit,
  32612. maxHeaderSize: headerSizeLimit,
  32613. partHwm: fileOpts.highWaterMark,
  32614. highWaterMark: cfg.highWaterMark
  32615. }
  32616. this.parser = new Dicer(parserCfg)
  32617. this.parser.on('drain', function () {
  32618. self._needDrain = false
  32619. if (self._cb && !self._pause) {
  32620. const cb = self._cb
  32621. self._cb = undefined
  32622. cb()
  32623. }
  32624. }).on('part', function onPart (part) {
  32625. if (++self._nparts > partsLimit) {
  32626. self.parser.removeListener('part', onPart)
  32627. self.parser.on('part', skipPart)
  32628. boy.hitPartsLimit = true
  32629. boy.emit('partsLimit')
  32630. return skipPart(part)
  32631. }
  32632. // hack because streams2 _always_ doesn't emit 'end' until nextTick, so let
  32633. // us emit 'end' early since we know the part has ended if we are already
  32634. // seeing the next part
  32635. if (curField) {
  32636. const field = curField
  32637. field.emit('end')
  32638. field.removeAllListeners('end')
  32639. }
  32640. part.on('header', function (header) {
  32641. let contype
  32642. let fieldname
  32643. let parsed
  32644. let charset
  32645. let encoding
  32646. let filename
  32647. let nsize = 0
  32648. if (header['content-type']) {
  32649. parsed = parseParams(header['content-type'][0])
  32650. if (parsed[0]) {
  32651. contype = parsed[0].toLowerCase()
  32652. for (i = 0, len = parsed.length; i < len; ++i) {
  32653. if (RE_CHARSET.test(parsed[i][0])) {
  32654. charset = parsed[i][1].toLowerCase()
  32655. break
  32656. }
  32657. }
  32658. }
  32659. }
  32660. if (contype === undefined) { contype = 'text/plain' }
  32661. if (charset === undefined) { charset = defCharset }
  32662. if (header['content-disposition']) {
  32663. parsed = parseParams(header['content-disposition'][0])
  32664. if (!RE_FIELD.test(parsed[0])) { return skipPart(part) }
  32665. for (i = 0, len = parsed.length; i < len; ++i) {
  32666. if (RE_NAME.test(parsed[i][0])) {
  32667. fieldname = parsed[i][1]
  32668. } else if (RE_FILENAME.test(parsed[i][0])) {
  32669. filename = parsed[i][1]
  32670. if (!preservePath) { filename = basename(filename) }
  32671. }
  32672. }
  32673. } else { return skipPart(part) }
  32674. if (header['content-transfer-encoding']) { encoding = header['content-transfer-encoding'][0].toLowerCase() } else { encoding = '7bit' }
  32675. let onData,
  32676. onEnd
  32677. if (isPartAFile(fieldname, contype, filename)) {
  32678. // file/binary field
  32679. if (nfiles === filesLimit) {
  32680. if (!boy.hitFilesLimit) {
  32681. boy.hitFilesLimit = true
  32682. boy.emit('filesLimit')
  32683. }
  32684. return skipPart(part)
  32685. }
  32686. ++nfiles
  32687. if (boy.listenerCount('file') === 0) {
  32688. self.parser._ignore()
  32689. return
  32690. }
  32691. ++nends
  32692. const file = new FileStream(fileOpts)
  32693. curFile = file
  32694. file.on('end', function () {
  32695. --nends
  32696. self._pause = false
  32697. checkFinished()
  32698. if (self._cb && !self._needDrain) {
  32699. const cb = self._cb
  32700. self._cb = undefined
  32701. cb()
  32702. }
  32703. })
  32704. file._read = function (n) {
  32705. if (!self._pause) { return }
  32706. self._pause = false
  32707. if (self._cb && !self._needDrain) {
  32708. const cb = self._cb
  32709. self._cb = undefined
  32710. cb()
  32711. }
  32712. }
  32713. boy.emit('file', fieldname, file, filename, encoding, contype)
  32714. onData = function (data) {
  32715. if ((nsize += data.length) > fileSizeLimit) {
  32716. const extralen = fileSizeLimit - nsize + data.length
  32717. if (extralen > 0) { file.push(data.slice(0, extralen)) }
  32718. file.truncated = true
  32719. file.bytesRead = fileSizeLimit
  32720. part.removeAllListeners('data')
  32721. file.emit('limit')
  32722. return
  32723. } else if (!file.push(data)) { self._pause = true }
  32724. file.bytesRead = nsize
  32725. }
  32726. onEnd = function () {
  32727. curFile = undefined
  32728. file.push(null)
  32729. }
  32730. } else {
  32731. // non-file field
  32732. if (nfields === fieldsLimit) {
  32733. if (!boy.hitFieldsLimit) {
  32734. boy.hitFieldsLimit = true
  32735. boy.emit('fieldsLimit')
  32736. }
  32737. return skipPart(part)
  32738. }
  32739. ++nfields
  32740. ++nends
  32741. let buffer = ''
  32742. let truncated = false
  32743. curField = part
  32744. onData = function (data) {
  32745. if ((nsize += data.length) > fieldSizeLimit) {
  32746. const extralen = (fieldSizeLimit - (nsize - data.length))
  32747. buffer += data.toString('binary', 0, extralen)
  32748. truncated = true
  32749. part.removeAllListeners('data')
  32750. } else { buffer += data.toString('binary') }
  32751. }
  32752. onEnd = function () {
  32753. curField = undefined
  32754. if (buffer.length) { buffer = decodeText(buffer, 'binary', charset) }
  32755. boy.emit('field', fieldname, buffer, false, truncated, encoding, contype)
  32756. --nends
  32757. checkFinished()
  32758. }
  32759. }
  32760. /* As of node@2efe4ab761666 (v0.10.29+/v0.11.14+), busboy had become
  32761. broken. Streams2/streams3 is a huge black box of confusion, but
  32762. somehow overriding the sync state seems to fix things again (and still
  32763. seems to work for previous node versions).
  32764. */
  32765. part._readableState.sync = false
  32766. part.on('data', onData)
  32767. part.on('end', onEnd)
  32768. }).on('error', function (err) {
  32769. if (curFile) { curFile.emit('error', err) }
  32770. })
  32771. }).on('error', function (err) {
  32772. boy.emit('error', err)
  32773. }).on('finish', function () {
  32774. finished = true
  32775. checkFinished()
  32776. })
  32777. }
  32778. Multipart.prototype.write = function (chunk, cb) {
  32779. const r = this.parser.write(chunk)
  32780. if (r && !this._pause) {
  32781. cb()
  32782. } else {
  32783. this._needDrain = !r
  32784. this._cb = cb
  32785. }
  32786. }
  32787. Multipart.prototype.end = function () {
  32788. const self = this
  32789. if (self.parser.writable) {
  32790. self.parser.end()
  32791. } else if (!self._boy._done) {
  32792. process.nextTick(function () {
  32793. self._boy._done = true
  32794. self._boy.emit('finish')
  32795. })
  32796. }
  32797. }
  32798. function skipPart (part) {
  32799. part.resume()
  32800. }
  32801. function FileStream (opts) {
  32802. Readable.call(this, opts)
  32803. this.bytesRead = 0
  32804. this.truncated = false
  32805. }
  32806. inherits(FileStream, Readable)
  32807. FileStream.prototype._read = function (n) {}
  32808. module.exports = Multipart
  32809. /***/ }),
  32810. /***/ 8306:
  32811. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  32812. "use strict";
  32813. const Decoder = __nccwpck_require__(7100)
  32814. const decodeText = __nccwpck_require__(4619)
  32815. const getLimit = __nccwpck_require__(1467)
  32816. const RE_CHARSET = /^charset$/i
  32817. UrlEncoded.detect = /^application\/x-www-form-urlencoded/i
  32818. function UrlEncoded (boy, cfg) {
  32819. const limits = cfg.limits
  32820. const parsedConType = cfg.parsedConType
  32821. this.boy = boy
  32822. this.fieldSizeLimit = getLimit(limits, 'fieldSize', 1 * 1024 * 1024)
  32823. this.fieldNameSizeLimit = getLimit(limits, 'fieldNameSize', 100)
  32824. this.fieldsLimit = getLimit(limits, 'fields', Infinity)
  32825. let charset
  32826. for (var i = 0, len = parsedConType.length; i < len; ++i) { // eslint-disable-line no-var
  32827. if (Array.isArray(parsedConType[i]) &&
  32828. RE_CHARSET.test(parsedConType[i][0])) {
  32829. charset = parsedConType[i][1].toLowerCase()
  32830. break
  32831. }
  32832. }
  32833. if (charset === undefined) { charset = cfg.defCharset || 'utf8' }
  32834. this.decoder = new Decoder()
  32835. this.charset = charset
  32836. this._fields = 0
  32837. this._state = 'key'
  32838. this._checkingBytes = true
  32839. this._bytesKey = 0
  32840. this._bytesVal = 0
  32841. this._key = ''
  32842. this._val = ''
  32843. this._keyTrunc = false
  32844. this._valTrunc = false
  32845. this._hitLimit = false
  32846. }
  32847. UrlEncoded.prototype.write = function (data, cb) {
  32848. if (this._fields === this.fieldsLimit) {
  32849. if (!this.boy.hitFieldsLimit) {
  32850. this.boy.hitFieldsLimit = true
  32851. this.boy.emit('fieldsLimit')
  32852. }
  32853. return cb()
  32854. }
  32855. let idxeq; let idxamp; let i; let p = 0; const len = data.length
  32856. while (p < len) {
  32857. if (this._state === 'key') {
  32858. idxeq = idxamp = undefined
  32859. for (i = p; i < len; ++i) {
  32860. if (!this._checkingBytes) { ++p }
  32861. if (data[i] === 0x3D/* = */) {
  32862. idxeq = i
  32863. break
  32864. } else if (data[i] === 0x26/* & */) {
  32865. idxamp = i
  32866. break
  32867. }
  32868. if (this._checkingBytes && this._bytesKey === this.fieldNameSizeLimit) {
  32869. this._hitLimit = true
  32870. break
  32871. } else if (this._checkingBytes) { ++this._bytesKey }
  32872. }
  32873. if (idxeq !== undefined) {
  32874. // key with assignment
  32875. if (idxeq > p) { this._key += this.decoder.write(data.toString('binary', p, idxeq)) }
  32876. this._state = 'val'
  32877. this._hitLimit = false
  32878. this._checkingBytes = true
  32879. this._val = ''
  32880. this._bytesVal = 0
  32881. this._valTrunc = false
  32882. this.decoder.reset()
  32883. p = idxeq + 1
  32884. } else if (idxamp !== undefined) {
  32885. // key with no assignment
  32886. ++this._fields
  32887. let key; const keyTrunc = this._keyTrunc
  32888. if (idxamp > p) { key = (this._key += this.decoder.write(data.toString('binary', p, idxamp))) } else { key = this._key }
  32889. this._hitLimit = false
  32890. this._checkingBytes = true
  32891. this._key = ''
  32892. this._bytesKey = 0
  32893. this._keyTrunc = false
  32894. this.decoder.reset()
  32895. if (key.length) {
  32896. this.boy.emit('field', decodeText(key, 'binary', this.charset),
  32897. '',
  32898. keyTrunc,
  32899. false)
  32900. }
  32901. p = idxamp + 1
  32902. if (this._fields === this.fieldsLimit) { return cb() }
  32903. } else if (this._hitLimit) {
  32904. // we may not have hit the actual limit if there are encoded bytes...
  32905. if (i > p) { this._key += this.decoder.write(data.toString('binary', p, i)) }
  32906. p = i
  32907. if ((this._bytesKey = this._key.length) === this.fieldNameSizeLimit) {
  32908. // yep, we actually did hit the limit
  32909. this._checkingBytes = false
  32910. this._keyTrunc = true
  32911. }
  32912. } else {
  32913. if (p < len) { this._key += this.decoder.write(data.toString('binary', p)) }
  32914. p = len
  32915. }
  32916. } else {
  32917. idxamp = undefined
  32918. for (i = p; i < len; ++i) {
  32919. if (!this._checkingBytes) { ++p }
  32920. if (data[i] === 0x26/* & */) {
  32921. idxamp = i
  32922. break
  32923. }
  32924. if (this._checkingBytes && this._bytesVal === this.fieldSizeLimit) {
  32925. this._hitLimit = true
  32926. break
  32927. } else if (this._checkingBytes) { ++this._bytesVal }
  32928. }
  32929. if (idxamp !== undefined) {
  32930. ++this._fields
  32931. if (idxamp > p) { this._val += this.decoder.write(data.toString('binary', p, idxamp)) }
  32932. this.boy.emit('field', decodeText(this._key, 'binary', this.charset),
  32933. decodeText(this._val, 'binary', this.charset),
  32934. this._keyTrunc,
  32935. this._valTrunc)
  32936. this._state = 'key'
  32937. this._hitLimit = false
  32938. this._checkingBytes = true
  32939. this._key = ''
  32940. this._bytesKey = 0
  32941. this._keyTrunc = false
  32942. this.decoder.reset()
  32943. p = idxamp + 1
  32944. if (this._fields === this.fieldsLimit) { return cb() }
  32945. } else if (this._hitLimit) {
  32946. // we may not have hit the actual limit if there are encoded bytes...
  32947. if (i > p) { this._val += this.decoder.write(data.toString('binary', p, i)) }
  32948. p = i
  32949. if ((this._val === '' && this.fieldSizeLimit === 0) ||
  32950. (this._bytesVal = this._val.length) === this.fieldSizeLimit) {
  32951. // yep, we actually did hit the limit
  32952. this._checkingBytes = false
  32953. this._valTrunc = true
  32954. }
  32955. } else {
  32956. if (p < len) { this._val += this.decoder.write(data.toString('binary', p)) }
  32957. p = len
  32958. }
  32959. }
  32960. }
  32961. cb()
  32962. }
  32963. UrlEncoded.prototype.end = function () {
  32964. if (this.boy._done) { return }
  32965. if (this._state === 'key' && this._key.length > 0) {
  32966. this.boy.emit('field', decodeText(this._key, 'binary', this.charset),
  32967. '',
  32968. this._keyTrunc,
  32969. false)
  32970. } else if (this._state === 'val') {
  32971. this.boy.emit('field', decodeText(this._key, 'binary', this.charset),
  32972. decodeText(this._val, 'binary', this.charset),
  32973. this._keyTrunc,
  32974. this._valTrunc)
  32975. }
  32976. this.boy._done = true
  32977. this.boy.emit('finish')
  32978. }
  32979. module.exports = UrlEncoded
  32980. /***/ }),
  32981. /***/ 7100:
  32982. /***/ ((module) => {
  32983. "use strict";
  32984. const RE_PLUS = /\+/g
  32985. const HEX = [
  32986. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  32987. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  32988. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  32989. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0,
  32990. 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  32991. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  32992. 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  32993. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
  32994. ]
  32995. function Decoder () {
  32996. this.buffer = undefined
  32997. }
  32998. Decoder.prototype.write = function (str) {
  32999. // Replace '+' with ' ' before decoding
  33000. str = str.replace(RE_PLUS, ' ')
  33001. let res = ''
  33002. let i = 0; let p = 0; const len = str.length
  33003. for (; i < len; ++i) {
  33004. if (this.buffer !== undefined) {
  33005. if (!HEX[str.charCodeAt(i)]) {
  33006. res += '%' + this.buffer
  33007. this.buffer = undefined
  33008. --i // retry character
  33009. } else {
  33010. this.buffer += str[i]
  33011. ++p
  33012. if (this.buffer.length === 2) {
  33013. res += String.fromCharCode(parseInt(this.buffer, 16))
  33014. this.buffer = undefined
  33015. }
  33016. }
  33017. } else if (str[i] === '%') {
  33018. if (i > p) {
  33019. res += str.substring(p, i)
  33020. p = i
  33021. }
  33022. this.buffer = ''
  33023. ++p
  33024. }
  33025. }
  33026. if (p < len && this.buffer === undefined) { res += str.substring(p) }
  33027. return res
  33028. }
  33029. Decoder.prototype.reset = function () {
  33030. this.buffer = undefined
  33031. }
  33032. module.exports = Decoder
  33033. /***/ }),
  33034. /***/ 8647:
  33035. /***/ ((module) => {
  33036. "use strict";
  33037. module.exports = function basename (path) {
  33038. if (typeof path !== 'string') { return '' }
  33039. for (var i = path.length - 1; i >= 0; --i) { // eslint-disable-line no-var
  33040. switch (path.charCodeAt(i)) {
  33041. case 0x2F: // '/'
  33042. case 0x5C: // '\'
  33043. path = path.slice(i + 1)
  33044. return (path === '..' || path === '.' ? '' : path)
  33045. }
  33046. }
  33047. return (path === '..' || path === '.' ? '' : path)
  33048. }
  33049. /***/ }),
  33050. /***/ 4619:
  33051. /***/ (function(module) {
  33052. "use strict";
  33053. // Node has always utf-8
  33054. const utf8Decoder = new TextDecoder('utf-8')
  33055. const textDecoders = new Map([
  33056. ['utf-8', utf8Decoder],
  33057. ['utf8', utf8Decoder]
  33058. ])
  33059. function getDecoder (charset) {
  33060. let lc
  33061. while (true) {
  33062. switch (charset) {
  33063. case 'utf-8':
  33064. case 'utf8':
  33065. return decoders.utf8
  33066. case 'latin1':
  33067. case 'ascii': // TODO: Make these a separate, strict decoder?
  33068. case 'us-ascii':
  33069. case 'iso-8859-1':
  33070. case 'iso8859-1':
  33071. case 'iso88591':
  33072. case 'iso_8859-1':
  33073. case 'windows-1252':
  33074. case 'iso_8859-1:1987':
  33075. case 'cp1252':
  33076. case 'x-cp1252':
  33077. return decoders.latin1
  33078. case 'utf16le':
  33079. case 'utf-16le':
  33080. case 'ucs2':
  33081. case 'ucs-2':
  33082. return decoders.utf16le
  33083. case 'base64':
  33084. return decoders.base64
  33085. default:
  33086. if (lc === undefined) {
  33087. lc = true
  33088. charset = charset.toLowerCase()
  33089. continue
  33090. }
  33091. return decoders.other.bind(charset)
  33092. }
  33093. }
  33094. }
  33095. const decoders = {
  33096. utf8: (data, sourceEncoding) => {
  33097. if (data.length === 0) {
  33098. return ''
  33099. }
  33100. if (typeof data === 'string') {
  33101. data = Buffer.from(data, sourceEncoding)
  33102. }
  33103. return data.utf8Slice(0, data.length)
  33104. },
  33105. latin1: (data, sourceEncoding) => {
  33106. if (data.length === 0) {
  33107. return ''
  33108. }
  33109. if (typeof data === 'string') {
  33110. return data
  33111. }
  33112. return data.latin1Slice(0, data.length)
  33113. },
  33114. utf16le: (data, sourceEncoding) => {
  33115. if (data.length === 0) {
  33116. return ''
  33117. }
  33118. if (typeof data === 'string') {
  33119. data = Buffer.from(data, sourceEncoding)
  33120. }
  33121. return data.ucs2Slice(0, data.length)
  33122. },
  33123. base64: (data, sourceEncoding) => {
  33124. if (data.length === 0) {
  33125. return ''
  33126. }
  33127. if (typeof data === 'string') {
  33128. data = Buffer.from(data, sourceEncoding)
  33129. }
  33130. return data.base64Slice(0, data.length)
  33131. },
  33132. other: (data, sourceEncoding) => {
  33133. if (data.length === 0) {
  33134. return ''
  33135. }
  33136. if (typeof data === 'string') {
  33137. data = Buffer.from(data, sourceEncoding)
  33138. }
  33139. if (textDecoders.has(this.toString())) {
  33140. try {
  33141. return textDecoders.get(this).decode(data)
  33142. } catch {}
  33143. }
  33144. return typeof data === 'string'
  33145. ? data
  33146. : data.toString()
  33147. }
  33148. }
  33149. function decodeText (text, sourceEncoding, destEncoding) {
  33150. if (text) {
  33151. return getDecoder(destEncoding)(text, sourceEncoding)
  33152. }
  33153. return text
  33154. }
  33155. module.exports = decodeText
  33156. /***/ }),
  33157. /***/ 1467:
  33158. /***/ ((module) => {
  33159. "use strict";
  33160. module.exports = function getLimit (limits, name, defaultLimit) {
  33161. if (
  33162. !limits ||
  33163. limits[name] === undefined ||
  33164. limits[name] === null
  33165. ) { return defaultLimit }
  33166. if (
  33167. typeof limits[name] !== 'number' ||
  33168. isNaN(limits[name])
  33169. ) { throw new TypeError('Limit ' + name + ' is not a valid number') }
  33170. return limits[name]
  33171. }
  33172. /***/ }),
  33173. /***/ 1854:
  33174. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  33175. "use strict";
  33176. /* eslint-disable object-property-newline */
  33177. const decodeText = __nccwpck_require__(4619)
  33178. const RE_ENCODED = /%[a-fA-F0-9][a-fA-F0-9]/g
  33179. const EncodedLookup = {
  33180. '%00': '\x00', '%01': '\x01', '%02': '\x02', '%03': '\x03', '%04': '\x04',
  33181. '%05': '\x05', '%06': '\x06', '%07': '\x07', '%08': '\x08', '%09': '\x09',
  33182. '%0a': '\x0a', '%0A': '\x0a', '%0b': '\x0b', '%0B': '\x0b', '%0c': '\x0c',
  33183. '%0C': '\x0c', '%0d': '\x0d', '%0D': '\x0d', '%0e': '\x0e', '%0E': '\x0e',
  33184. '%0f': '\x0f', '%0F': '\x0f', '%10': '\x10', '%11': '\x11', '%12': '\x12',
  33185. '%13': '\x13', '%14': '\x14', '%15': '\x15', '%16': '\x16', '%17': '\x17',
  33186. '%18': '\x18', '%19': '\x19', '%1a': '\x1a', '%1A': '\x1a', '%1b': '\x1b',
  33187. '%1B': '\x1b', '%1c': '\x1c', '%1C': '\x1c', '%1d': '\x1d', '%1D': '\x1d',
  33188. '%1e': '\x1e', '%1E': '\x1e', '%1f': '\x1f', '%1F': '\x1f', '%20': '\x20',
  33189. '%21': '\x21', '%22': '\x22', '%23': '\x23', '%24': '\x24', '%25': '\x25',
  33190. '%26': '\x26', '%27': '\x27', '%28': '\x28', '%29': '\x29', '%2a': '\x2a',
  33191. '%2A': '\x2a', '%2b': '\x2b', '%2B': '\x2b', '%2c': '\x2c', '%2C': '\x2c',
  33192. '%2d': '\x2d', '%2D': '\x2d', '%2e': '\x2e', '%2E': '\x2e', '%2f': '\x2f',
  33193. '%2F': '\x2f', '%30': '\x30', '%31': '\x31', '%32': '\x32', '%33': '\x33',
  33194. '%34': '\x34', '%35': '\x35', '%36': '\x36', '%37': '\x37', '%38': '\x38',
  33195. '%39': '\x39', '%3a': '\x3a', '%3A': '\x3a', '%3b': '\x3b', '%3B': '\x3b',
  33196. '%3c': '\x3c', '%3C': '\x3c', '%3d': '\x3d', '%3D': '\x3d', '%3e': '\x3e',
  33197. '%3E': '\x3e', '%3f': '\x3f', '%3F': '\x3f', '%40': '\x40', '%41': '\x41',
  33198. '%42': '\x42', '%43': '\x43', '%44': '\x44', '%45': '\x45', '%46': '\x46',
  33199. '%47': '\x47', '%48': '\x48', '%49': '\x49', '%4a': '\x4a', '%4A': '\x4a',
  33200. '%4b': '\x4b', '%4B': '\x4b', '%4c': '\x4c', '%4C': '\x4c', '%4d': '\x4d',
  33201. '%4D': '\x4d', '%4e': '\x4e', '%4E': '\x4e', '%4f': '\x4f', '%4F': '\x4f',
  33202. '%50': '\x50', '%51': '\x51', '%52': '\x52', '%53': '\x53', '%54': '\x54',
  33203. '%55': '\x55', '%56': '\x56', '%57': '\x57', '%58': '\x58', '%59': '\x59',
  33204. '%5a': '\x5a', '%5A': '\x5a', '%5b': '\x5b', '%5B': '\x5b', '%5c': '\x5c',
  33205. '%5C': '\x5c', '%5d': '\x5d', '%5D': '\x5d', '%5e': '\x5e', '%5E': '\x5e',
  33206. '%5f': '\x5f', '%5F': '\x5f', '%60': '\x60', '%61': '\x61', '%62': '\x62',
  33207. '%63': '\x63', '%64': '\x64', '%65': '\x65', '%66': '\x66', '%67': '\x67',
  33208. '%68': '\x68', '%69': '\x69', '%6a': '\x6a', '%6A': '\x6a', '%6b': '\x6b',
  33209. '%6B': '\x6b', '%6c': '\x6c', '%6C': '\x6c', '%6d': '\x6d', '%6D': '\x6d',
  33210. '%6e': '\x6e', '%6E': '\x6e', '%6f': '\x6f', '%6F': '\x6f', '%70': '\x70',
  33211. '%71': '\x71', '%72': '\x72', '%73': '\x73', '%74': '\x74', '%75': '\x75',
  33212. '%76': '\x76', '%77': '\x77', '%78': '\x78', '%79': '\x79', '%7a': '\x7a',
  33213. '%7A': '\x7a', '%7b': '\x7b', '%7B': '\x7b', '%7c': '\x7c', '%7C': '\x7c',
  33214. '%7d': '\x7d', '%7D': '\x7d', '%7e': '\x7e', '%7E': '\x7e', '%7f': '\x7f',
  33215. '%7F': '\x7f', '%80': '\x80', '%81': '\x81', '%82': '\x82', '%83': '\x83',
  33216. '%84': '\x84', '%85': '\x85', '%86': '\x86', '%87': '\x87', '%88': '\x88',
  33217. '%89': '\x89', '%8a': '\x8a', '%8A': '\x8a', '%8b': '\x8b', '%8B': '\x8b',
  33218. '%8c': '\x8c', '%8C': '\x8c', '%8d': '\x8d', '%8D': '\x8d', '%8e': '\x8e',
  33219. '%8E': '\x8e', '%8f': '\x8f', '%8F': '\x8f', '%90': '\x90', '%91': '\x91',
  33220. '%92': '\x92', '%93': '\x93', '%94': '\x94', '%95': '\x95', '%96': '\x96',
  33221. '%97': '\x97', '%98': '\x98', '%99': '\x99', '%9a': '\x9a', '%9A': '\x9a',
  33222. '%9b': '\x9b', '%9B': '\x9b', '%9c': '\x9c', '%9C': '\x9c', '%9d': '\x9d',
  33223. '%9D': '\x9d', '%9e': '\x9e', '%9E': '\x9e', '%9f': '\x9f', '%9F': '\x9f',
  33224. '%a0': '\xa0', '%A0': '\xa0', '%a1': '\xa1', '%A1': '\xa1', '%a2': '\xa2',
  33225. '%A2': '\xa2', '%a3': '\xa3', '%A3': '\xa3', '%a4': '\xa4', '%A4': '\xa4',
  33226. '%a5': '\xa5', '%A5': '\xa5', '%a6': '\xa6', '%A6': '\xa6', '%a7': '\xa7',
  33227. '%A7': '\xa7', '%a8': '\xa8', '%A8': '\xa8', '%a9': '\xa9', '%A9': '\xa9',
  33228. '%aa': '\xaa', '%Aa': '\xaa', '%aA': '\xaa', '%AA': '\xaa', '%ab': '\xab',
  33229. '%Ab': '\xab', '%aB': '\xab', '%AB': '\xab', '%ac': '\xac', '%Ac': '\xac',
  33230. '%aC': '\xac', '%AC': '\xac', '%ad': '\xad', '%Ad': '\xad', '%aD': '\xad',
  33231. '%AD': '\xad', '%ae': '\xae', '%Ae': '\xae', '%aE': '\xae', '%AE': '\xae',
  33232. '%af': '\xaf', '%Af': '\xaf', '%aF': '\xaf', '%AF': '\xaf', '%b0': '\xb0',
  33233. '%B0': '\xb0', '%b1': '\xb1', '%B1': '\xb1', '%b2': '\xb2', '%B2': '\xb2',
  33234. '%b3': '\xb3', '%B3': '\xb3', '%b4': '\xb4', '%B4': '\xb4', '%b5': '\xb5',
  33235. '%B5': '\xb5', '%b6': '\xb6', '%B6': '\xb6', '%b7': '\xb7', '%B7': '\xb7',
  33236. '%b8': '\xb8', '%B8': '\xb8', '%b9': '\xb9', '%B9': '\xb9', '%ba': '\xba',
  33237. '%Ba': '\xba', '%bA': '\xba', '%BA': '\xba', '%bb': '\xbb', '%Bb': '\xbb',
  33238. '%bB': '\xbb', '%BB': '\xbb', '%bc': '\xbc', '%Bc': '\xbc', '%bC': '\xbc',
  33239. '%BC': '\xbc', '%bd': '\xbd', '%Bd': '\xbd', '%bD': '\xbd', '%BD': '\xbd',
  33240. '%be': '\xbe', '%Be': '\xbe', '%bE': '\xbe', '%BE': '\xbe', '%bf': '\xbf',
  33241. '%Bf': '\xbf', '%bF': '\xbf', '%BF': '\xbf', '%c0': '\xc0', '%C0': '\xc0',
  33242. '%c1': '\xc1', '%C1': '\xc1', '%c2': '\xc2', '%C2': '\xc2', '%c3': '\xc3',
  33243. '%C3': '\xc3', '%c4': '\xc4', '%C4': '\xc4', '%c5': '\xc5', '%C5': '\xc5',
  33244. '%c6': '\xc6', '%C6': '\xc6', '%c7': '\xc7', '%C7': '\xc7', '%c8': '\xc8',
  33245. '%C8': '\xc8', '%c9': '\xc9', '%C9': '\xc9', '%ca': '\xca', '%Ca': '\xca',
  33246. '%cA': '\xca', '%CA': '\xca', '%cb': '\xcb', '%Cb': '\xcb', '%cB': '\xcb',
  33247. '%CB': '\xcb', '%cc': '\xcc', '%Cc': '\xcc', '%cC': '\xcc', '%CC': '\xcc',
  33248. '%cd': '\xcd', '%Cd': '\xcd', '%cD': '\xcd', '%CD': '\xcd', '%ce': '\xce',
  33249. '%Ce': '\xce', '%cE': '\xce', '%CE': '\xce', '%cf': '\xcf', '%Cf': '\xcf',
  33250. '%cF': '\xcf', '%CF': '\xcf', '%d0': '\xd0', '%D0': '\xd0', '%d1': '\xd1',
  33251. '%D1': '\xd1', '%d2': '\xd2', '%D2': '\xd2', '%d3': '\xd3', '%D3': '\xd3',
  33252. '%d4': '\xd4', '%D4': '\xd4', '%d5': '\xd5', '%D5': '\xd5', '%d6': '\xd6',
  33253. '%D6': '\xd6', '%d7': '\xd7', '%D7': '\xd7', '%d8': '\xd8', '%D8': '\xd8',
  33254. '%d9': '\xd9', '%D9': '\xd9', '%da': '\xda', '%Da': '\xda', '%dA': '\xda',
  33255. '%DA': '\xda', '%db': '\xdb', '%Db': '\xdb', '%dB': '\xdb', '%DB': '\xdb',
  33256. '%dc': '\xdc', '%Dc': '\xdc', '%dC': '\xdc', '%DC': '\xdc', '%dd': '\xdd',
  33257. '%Dd': '\xdd', '%dD': '\xdd', '%DD': '\xdd', '%de': '\xde', '%De': '\xde',
  33258. '%dE': '\xde', '%DE': '\xde', '%df': '\xdf', '%Df': '\xdf', '%dF': '\xdf',
  33259. '%DF': '\xdf', '%e0': '\xe0', '%E0': '\xe0', '%e1': '\xe1', '%E1': '\xe1',
  33260. '%e2': '\xe2', '%E2': '\xe2', '%e3': '\xe3', '%E3': '\xe3', '%e4': '\xe4',
  33261. '%E4': '\xe4', '%e5': '\xe5', '%E5': '\xe5', '%e6': '\xe6', '%E6': '\xe6',
  33262. '%e7': '\xe7', '%E7': '\xe7', '%e8': '\xe8', '%E8': '\xe8', '%e9': '\xe9',
  33263. '%E9': '\xe9', '%ea': '\xea', '%Ea': '\xea', '%eA': '\xea', '%EA': '\xea',
  33264. '%eb': '\xeb', '%Eb': '\xeb', '%eB': '\xeb', '%EB': '\xeb', '%ec': '\xec',
  33265. '%Ec': '\xec', '%eC': '\xec', '%EC': '\xec', '%ed': '\xed', '%Ed': '\xed',
  33266. '%eD': '\xed', '%ED': '\xed', '%ee': '\xee', '%Ee': '\xee', '%eE': '\xee',
  33267. '%EE': '\xee', '%ef': '\xef', '%Ef': '\xef', '%eF': '\xef', '%EF': '\xef',
  33268. '%f0': '\xf0', '%F0': '\xf0', '%f1': '\xf1', '%F1': '\xf1', '%f2': '\xf2',
  33269. '%F2': '\xf2', '%f3': '\xf3', '%F3': '\xf3', '%f4': '\xf4', '%F4': '\xf4',
  33270. '%f5': '\xf5', '%F5': '\xf5', '%f6': '\xf6', '%F6': '\xf6', '%f7': '\xf7',
  33271. '%F7': '\xf7', '%f8': '\xf8', '%F8': '\xf8', '%f9': '\xf9', '%F9': '\xf9',
  33272. '%fa': '\xfa', '%Fa': '\xfa', '%fA': '\xfa', '%FA': '\xfa', '%fb': '\xfb',
  33273. '%Fb': '\xfb', '%fB': '\xfb', '%FB': '\xfb', '%fc': '\xfc', '%Fc': '\xfc',
  33274. '%fC': '\xfc', '%FC': '\xfc', '%fd': '\xfd', '%Fd': '\xfd', '%fD': '\xfd',
  33275. '%FD': '\xfd', '%fe': '\xfe', '%Fe': '\xfe', '%fE': '\xfe', '%FE': '\xfe',
  33276. '%ff': '\xff', '%Ff': '\xff', '%fF': '\xff', '%FF': '\xff'
  33277. }
  33278. function encodedReplacer (match) {
  33279. return EncodedLookup[match]
  33280. }
  33281. const STATE_KEY = 0
  33282. const STATE_VALUE = 1
  33283. const STATE_CHARSET = 2
  33284. const STATE_LANG = 3
  33285. function parseParams (str) {
  33286. const res = []
  33287. let state = STATE_KEY
  33288. let charset = ''
  33289. let inquote = false
  33290. let escaping = false
  33291. let p = 0
  33292. let tmp = ''
  33293. const len = str.length
  33294. for (var i = 0; i < len; ++i) { // eslint-disable-line no-var
  33295. const char = str[i]
  33296. if (char === '\\' && inquote) {
  33297. if (escaping) { escaping = false } else {
  33298. escaping = true
  33299. continue
  33300. }
  33301. } else if (char === '"') {
  33302. if (!escaping) {
  33303. if (inquote) {
  33304. inquote = false
  33305. state = STATE_KEY
  33306. } else { inquote = true }
  33307. continue
  33308. } else { escaping = false }
  33309. } else {
  33310. if (escaping && inquote) { tmp += '\\' }
  33311. escaping = false
  33312. if ((state === STATE_CHARSET || state === STATE_LANG) && char === "'") {
  33313. if (state === STATE_CHARSET) {
  33314. state = STATE_LANG
  33315. charset = tmp.substring(1)
  33316. } else { state = STATE_VALUE }
  33317. tmp = ''
  33318. continue
  33319. } else if (state === STATE_KEY &&
  33320. (char === '*' || char === '=') &&
  33321. res.length) {
  33322. state = char === '*'
  33323. ? STATE_CHARSET
  33324. : STATE_VALUE
  33325. res[p] = [tmp, undefined]
  33326. tmp = ''
  33327. continue
  33328. } else if (!inquote && char === ';') {
  33329. state = STATE_KEY
  33330. if (charset) {
  33331. if (tmp.length) {
  33332. tmp = decodeText(tmp.replace(RE_ENCODED, encodedReplacer),
  33333. 'binary',
  33334. charset)
  33335. }
  33336. charset = ''
  33337. } else if (tmp.length) {
  33338. tmp = decodeText(tmp, 'binary', 'utf8')
  33339. }
  33340. if (res[p] === undefined) { res[p] = tmp } else { res[p][1] = tmp }
  33341. tmp = ''
  33342. ++p
  33343. continue
  33344. } else if (!inquote && (char === ' ' || char === '\t')) { continue }
  33345. }
  33346. tmp += char
  33347. }
  33348. if (charset && tmp.length) {
  33349. tmp = decodeText(tmp.replace(RE_ENCODED, encodedReplacer),
  33350. 'binary',
  33351. charset)
  33352. } else if (tmp) {
  33353. tmp = decodeText(tmp, 'binary', 'utf8')
  33354. }
  33355. if (res[p] === undefined) {
  33356. if (tmp) { res[p] = tmp }
  33357. } else { res[p][1] = tmp }
  33358. return res
  33359. }
  33360. module.exports = parseParams
  33361. /***/ })
  33362. /******/ });
  33363. /************************************************************************/
  33364. /******/ // The module cache
  33365. /******/ var __webpack_module_cache__ = {};
  33366. /******/
  33367. /******/ // The require function
  33368. /******/ function __nccwpck_require__(moduleId) {
  33369. /******/ // Check if module is in cache
  33370. /******/ var cachedModule = __webpack_module_cache__[moduleId];
  33371. /******/ if (cachedModule !== undefined) {
  33372. /******/ return cachedModule.exports;
  33373. /******/ }
  33374. /******/ // Create a new module (and put it into the cache)
  33375. /******/ var module = __webpack_module_cache__[moduleId] = {
  33376. /******/ // no module.id needed
  33377. /******/ // no module.loaded needed
  33378. /******/ exports: {}
  33379. /******/ };
  33380. /******/
  33381. /******/ // Execute the module function
  33382. /******/ var threw = true;
  33383. /******/ try {
  33384. /******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __nccwpck_require__);
  33385. /******/ threw = false;
  33386. /******/ } finally {
  33387. /******/ if(threw) delete __webpack_module_cache__[moduleId];
  33388. /******/ }
  33389. /******/
  33390. /******/ // Return the exports of the module
  33391. /******/ return module.exports;
  33392. /******/ }
  33393. /******/
  33394. /************************************************************************/
  33395. /******/ /* webpack/runtime/compat */
  33396. /******/
  33397. /******/ if (typeof __nccwpck_require__ !== 'undefined') __nccwpck_require__.ab = __dirname + "/";
  33398. /******/
  33399. /************************************************************************/
  33400. /******/
  33401. /******/ // startup
  33402. /******/ // Load entry module and return exports
  33403. /******/ // This entry module is referenced by other modules so it can't be inlined
  33404. /******/ var __webpack_exports__ = __nccwpck_require__(3109);
  33405. /******/ module.exports = __webpack_exports__;
  33406. /******/
  33407. /******/ })()
  33408. ;