index.js 1.3 MB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437174381743917440174411744217443174441744517446174471744817449174501745117452174531745417455174561745717458174591746017461174621746317464174651746617467174681746917470174711747217473174741747517476174771747817479174801748117482174831748417485174861748717488174891749017491174921749317494174951749617497174981749917500175011750217503175041750517506175071750817509175101751117512175131751417515175161751717518175191752017521175221752317524175251752617527175281752917530175311753217533175341753517536175371753817539175401754117542175431754417545175461754717548175491755017551175521755317554175551755617557175581755917560175611756217563175641756517566175671756817569175701757117572175731757417575175761757717578175791758017581175821758317584175851758617587175881758917590175911759217593175941759517596175971759817599176001760117602176031760417605176061760717608176091761017611176121761317614176151761617617176181761917620176211762217623176241762517626176271762817629176301763117632176331763417635176361763717638176391764017641176421764317644176451764617647176481764917650176511765217653176541765517656176571765817659176601766117662176631766417665176661766717668176691767017671176721767317674176751767617677176781767917680176811768217683176841768517686176871768817689176901769117692176931769417695176961769717698176991770017701177021770317704177051770617707177081770917710177111771217713177141771517716177171771817719177201772117722177231772417725177261772717728177291773017731177321773317734177351773617737177381773917740177411774217743177441774517746177471774817749177501775117752177531775417755177561775717758177591776017761177621776317764177651776617767177681776917770177711777217773177741777517776177771777817779177801778117782177831778417785177861778717788177891779017791177921779317794177951779617797177981779917800178011780217803178041780517806178071780817809178101781117812178131781417815178161781717818178191782017821178221782317824178251782617827178281782917830178311783217833178341783517836178371783817839178401784117842178431784417845178461784717848178491785017851178521785317854178551785617857178581785917860178611786217863178641786517866178671786817869178701787117872178731787417875178761787717878178791788017881178821788317884178851788617887178881788917890178911789217893178941789517896178971789817899179001790117902179031790417905179061790717908179091791017911179121791317914179151791617917179181791917920179211792217923179241792517926179271792817929179301793117932179331793417935179361793717938179391794017941179421794317944179451794617947179481794917950179511795217953179541795517956179571795817959179601796117962179631796417965179661796717968179691797017971179721797317974179751797617977179781797917980179811798217983179841798517986179871798817989179901799117992179931799417995179961799717998179991800018001180021800318004180051800618007180081800918010180111801218013180141801518016180171801818019180201802118022180231802418025180261802718028180291803018031180321803318034180351803618037180381803918040180411804218043180441804518046180471804818049180501805118052180531805418055180561805718058180591806018061180621806318064180651806618067180681806918070180711807218073180741807518076180771807818079180801808118082180831808418085180861808718088180891809018091180921809318094180951809618097180981809918100181011810218103181041810518106181071810818109181101811118112181131811418115181161811718118181191812018121181221812318124181251812618127181281812918130181311813218133181341813518136181371813818139181401814118142181431814418145181461814718148181491815018151181521815318154181551815618157181581815918160181611816218163181641816518166181671816818169181701817118172181731817418175181761817718178181791818018181181821818318184181851818618187181881818918190181911819218193181941819518196181971819818199182001820118202182031820418205182061820718208182091821018211182121821318214182151821618217182181821918220182211822218223182241822518226182271822818229182301823118232182331823418235182361823718238182391824018241182421824318244182451824618247182481824918250182511825218253182541825518256182571825818259182601826118262182631826418265182661826718268182691827018271182721827318274182751827618277182781827918280182811828218283182841828518286182871828818289182901829118292182931829418295182961829718298182991830018301183021830318304183051830618307183081830918310183111831218313183141831518316183171831818319183201832118322183231832418325183261832718328183291833018331183321833318334183351833618337183381833918340183411834218343183441834518346183471834818349183501835118352183531835418355183561835718358183591836018361183621836318364183651836618367183681836918370183711837218373183741837518376183771837818379183801838118382183831838418385183861838718388183891839018391183921839318394183951839618397183981839918400184011840218403184041840518406184071840818409184101841118412184131841418415184161841718418184191842018421184221842318424184251842618427184281842918430184311843218433184341843518436184371843818439184401844118442184431844418445184461844718448184491845018451184521845318454184551845618457184581845918460184611846218463184641846518466184671846818469184701847118472184731847418475184761847718478184791848018481184821848318484184851848618487184881848918490184911849218493184941849518496184971849818499185001850118502185031850418505185061850718508185091851018511185121851318514185151851618517185181851918520185211852218523185241852518526185271852818529185301853118532185331853418535185361853718538185391854018541185421854318544185451854618547185481854918550185511855218553185541855518556185571855818559185601856118562185631856418565185661856718568185691857018571185721857318574185751857618577185781857918580185811858218583185841858518586185871858818589185901859118592185931859418595185961859718598185991860018601186021860318604186051860618607186081860918610186111861218613186141861518616186171861818619186201862118622186231862418625186261862718628186291863018631186321863318634186351863618637186381863918640186411864218643186441864518646186471864818649186501865118652186531865418655186561865718658186591866018661186621866318664186651866618667186681866918670186711867218673186741867518676186771867818679186801868118682186831868418685186861868718688186891869018691186921869318694186951869618697186981869918700187011870218703187041870518706187071870818709187101871118712187131871418715187161871718718187191872018721187221872318724187251872618727187281872918730187311873218733187341873518736187371873818739187401874118742187431874418745187461874718748187491875018751187521875318754187551875618757187581875918760187611876218763187641876518766187671876818769187701877118772187731877418775187761877718778187791878018781187821878318784187851878618787187881878918790187911879218793187941879518796187971879818799188001880118802188031880418805188061880718808188091881018811188121881318814188151881618817188181881918820188211882218823188241882518826188271882818829188301883118832188331883418835188361883718838188391884018841188421884318844188451884618847188481884918850188511885218853188541885518856188571885818859188601886118862188631886418865188661886718868188691887018871188721887318874188751887618877188781887918880188811888218883188841888518886188871888818889188901889118892188931889418895188961889718898188991890018901189021890318904189051890618907189081890918910189111891218913189141891518916189171891818919189201892118922189231892418925189261892718928189291893018931189321893318934189351893618937189381893918940189411894218943189441894518946189471894818949189501895118952189531895418955189561895718958189591896018961189621896318964189651896618967189681896918970189711897218973189741897518976189771897818979189801898118982189831898418985189861898718988189891899018991189921899318994189951899618997189981899919000190011900219003190041900519006190071900819009190101901119012190131901419015190161901719018190191902019021190221902319024190251902619027190281902919030190311903219033190341903519036190371903819039190401904119042190431904419045190461904719048190491905019051190521905319054190551905619057190581905919060190611906219063190641906519066190671906819069190701907119072190731907419075190761907719078190791908019081190821908319084190851908619087190881908919090190911909219093190941909519096190971909819099191001910119102191031910419105191061910719108191091911019111191121911319114191151911619117191181911919120191211912219123191241912519126191271912819129191301913119132191331913419135191361913719138191391914019141191421914319144191451914619147191481914919150191511915219153191541915519156191571915819159191601916119162191631916419165191661916719168191691917019171191721917319174191751917619177191781917919180191811918219183191841918519186191871918819189191901919119192191931919419195191961919719198191991920019201192021920319204192051920619207192081920919210192111921219213192141921519216192171921819219192201922119222192231922419225192261922719228192291923019231192321923319234192351923619237192381923919240192411924219243192441924519246192471924819249192501925119252192531925419255192561925719258192591926019261192621926319264192651926619267192681926919270192711927219273192741927519276192771927819279192801928119282192831928419285192861928719288192891929019291192921929319294192951929619297192981929919300193011930219303193041930519306193071930819309193101931119312193131931419315193161931719318193191932019321193221932319324193251932619327193281932919330193311933219333193341933519336193371933819339193401934119342193431934419345193461934719348193491935019351193521935319354193551935619357193581935919360193611936219363193641936519366193671936819369193701937119372193731937419375193761937719378193791938019381193821938319384193851938619387193881938919390193911939219393193941939519396193971939819399194001940119402194031940419405194061940719408194091941019411194121941319414194151941619417194181941919420194211942219423194241942519426194271942819429194301943119432194331943419435194361943719438194391944019441194421944319444194451944619447194481944919450194511945219453194541945519456194571945819459194601946119462194631946419465194661946719468194691947019471194721947319474194751947619477194781947919480194811948219483194841948519486194871948819489194901949119492194931949419495194961949719498194991950019501195021950319504195051950619507195081950919510195111951219513195141951519516195171951819519195201952119522195231952419525195261952719528195291953019531195321953319534195351953619537195381953919540195411954219543195441954519546195471954819549195501955119552195531955419555195561955719558195591956019561195621956319564195651956619567195681956919570195711957219573195741957519576195771957819579195801958119582195831958419585195861958719588195891959019591195921959319594195951959619597195981959919600196011960219603196041960519606196071960819609196101961119612196131961419615196161961719618196191962019621196221962319624196251962619627196281962919630196311963219633196341963519636196371963819639196401964119642196431964419645196461964719648196491965019651196521965319654196551965619657196581965919660196611966219663196641966519666196671966819669196701967119672196731967419675196761967719678196791968019681196821968319684196851968619687196881968919690196911969219693196941969519696196971969819699197001970119702197031970419705197061970719708197091971019711197121971319714197151971619717197181971919720197211972219723197241972519726197271972819729197301973119732197331973419735197361973719738197391974019741197421974319744197451974619747197481974919750197511975219753197541975519756197571975819759197601976119762197631976419765197661976719768197691977019771197721977319774197751977619777197781977919780197811978219783197841978519786197871978819789197901979119792197931979419795197961979719798197991980019801198021980319804198051980619807198081980919810198111981219813198141981519816198171981819819198201982119822198231982419825198261982719828198291983019831198321983319834198351983619837198381983919840198411984219843198441984519846198471984819849198501985119852198531985419855198561985719858198591986019861198621986319864198651986619867198681986919870198711987219873198741987519876198771987819879198801988119882198831988419885198861988719888198891989019891198921989319894198951989619897198981989919900199011990219903199041990519906199071990819909199101991119912199131991419915199161991719918199191992019921199221992319924199251992619927199281992919930199311993219933199341993519936199371993819939199401994119942199431994419945199461994719948199491995019951199521995319954199551995619957199581995919960199611996219963199641996519966199671996819969199701997119972199731997419975199761997719978199791998019981199821998319984199851998619987199881998919990199911999219993199941999519996199971999819999200002000120002200032000420005200062000720008200092001020011200122001320014200152001620017200182001920020200212002220023200242002520026200272002820029200302003120032200332003420035200362003720038200392004020041200422004320044200452004620047200482004920050200512005220053200542005520056200572005820059200602006120062200632006420065200662006720068200692007020071200722007320074200752007620077200782007920080200812008220083200842008520086200872008820089200902009120092200932009420095200962009720098200992010020101201022010320104201052010620107201082010920110201112011220113201142011520116201172011820119201202012120122201232012420125201262012720128201292013020131201322013320134201352013620137201382013920140201412014220143201442014520146201472014820149201502015120152201532015420155201562015720158201592016020161201622016320164201652016620167201682016920170201712017220173201742017520176201772017820179201802018120182201832018420185201862018720188201892019020191201922019320194201952019620197201982019920200202012020220203202042020520206202072020820209202102021120212202132021420215202162021720218202192022020221202222022320224202252022620227202282022920230202312023220233202342023520236202372023820239202402024120242202432024420245202462024720248202492025020251202522025320254202552025620257202582025920260202612026220263202642026520266202672026820269202702027120272202732027420275202762027720278202792028020281202822028320284202852028620287202882028920290202912029220293202942029520296202972029820299203002030120302203032030420305203062030720308203092031020311203122031320314203152031620317203182031920320203212032220323203242032520326203272032820329203302033120332203332033420335203362033720338203392034020341203422034320344203452034620347203482034920350203512035220353203542035520356203572035820359203602036120362203632036420365203662036720368203692037020371203722037320374203752037620377203782037920380203812038220383203842038520386203872038820389203902039120392203932039420395203962039720398203992040020401204022040320404204052040620407204082040920410204112041220413204142041520416204172041820419204202042120422204232042420425204262042720428204292043020431204322043320434204352043620437204382043920440204412044220443204442044520446204472044820449204502045120452204532045420455204562045720458204592046020461204622046320464204652046620467204682046920470204712047220473204742047520476204772047820479204802048120482204832048420485204862048720488204892049020491204922049320494204952049620497204982049920500205012050220503205042050520506205072050820509205102051120512205132051420515205162051720518205192052020521205222052320524205252052620527205282052920530205312053220533205342053520536205372053820539205402054120542205432054420545205462054720548205492055020551205522055320554205552055620557205582055920560205612056220563205642056520566205672056820569205702057120572205732057420575205762057720578205792058020581205822058320584205852058620587205882058920590205912059220593205942059520596205972059820599206002060120602206032060420605206062060720608206092061020611206122061320614206152061620617206182061920620206212062220623206242062520626206272062820629206302063120632206332063420635206362063720638206392064020641206422064320644206452064620647206482064920650206512065220653206542065520656206572065820659206602066120662206632066420665206662066720668206692067020671206722067320674206752067620677206782067920680206812068220683206842068520686206872068820689206902069120692206932069420695206962069720698206992070020701207022070320704207052070620707207082070920710207112071220713207142071520716207172071820719207202072120722207232072420725207262072720728207292073020731207322073320734207352073620737207382073920740207412074220743207442074520746207472074820749207502075120752207532075420755207562075720758207592076020761207622076320764207652076620767207682076920770207712077220773207742077520776207772077820779207802078120782207832078420785207862078720788207892079020791207922079320794207952079620797207982079920800208012080220803208042080520806208072080820809208102081120812208132081420815208162081720818208192082020821208222082320824208252082620827208282082920830208312083220833208342083520836208372083820839208402084120842208432084420845208462084720848208492085020851208522085320854208552085620857208582085920860208612086220863208642086520866208672086820869208702087120872208732087420875208762087720878208792088020881208822088320884208852088620887208882088920890208912089220893208942089520896208972089820899209002090120902209032090420905209062090720908209092091020911209122091320914209152091620917209182091920920209212092220923209242092520926209272092820929209302093120932209332093420935209362093720938209392094020941209422094320944209452094620947209482094920950209512095220953209542095520956209572095820959209602096120962209632096420965209662096720968209692097020971209722097320974209752097620977209782097920980209812098220983209842098520986209872098820989209902099120992209932099420995209962099720998209992100021001210022100321004210052100621007210082100921010210112101221013210142101521016210172101821019210202102121022210232102421025210262102721028210292103021031210322103321034210352103621037210382103921040210412104221043210442104521046210472104821049210502105121052210532105421055210562105721058210592106021061210622106321064210652106621067210682106921070210712107221073210742107521076210772107821079210802108121082210832108421085210862108721088210892109021091210922109321094210952109621097210982109921100211012110221103211042110521106211072110821109211102111121112211132111421115211162111721118211192112021121211222112321124211252112621127211282112921130211312113221133211342113521136211372113821139211402114121142211432114421145211462114721148211492115021151211522115321154211552115621157211582115921160211612116221163211642116521166211672116821169211702117121172211732117421175211762117721178211792118021181211822118321184211852118621187211882118921190211912119221193211942119521196211972119821199212002120121202212032120421205212062120721208212092121021211212122121321214212152121621217212182121921220212212122221223212242122521226212272122821229212302123121232212332123421235212362123721238212392124021241212422124321244212452124621247212482124921250212512125221253212542125521256212572125821259212602126121262212632126421265212662126721268212692127021271212722127321274212752127621277212782127921280212812128221283212842128521286212872128821289212902129121292212932129421295212962129721298212992130021301213022130321304213052130621307213082130921310213112131221313213142131521316213172131821319213202132121322213232132421325213262132721328213292133021331213322133321334213352133621337213382133921340213412134221343213442134521346213472134821349213502135121352213532135421355213562135721358213592136021361213622136321364213652136621367213682136921370213712137221373213742137521376213772137821379213802138121382213832138421385213862138721388213892139021391213922139321394213952139621397213982139921400214012140221403214042140521406214072140821409214102141121412214132141421415214162141721418214192142021421214222142321424214252142621427214282142921430214312143221433214342143521436214372143821439214402144121442214432144421445214462144721448214492145021451214522145321454214552145621457214582145921460214612146221463214642146521466214672146821469214702147121472214732147421475214762147721478214792148021481214822148321484214852148621487214882148921490214912149221493214942149521496214972149821499215002150121502215032150421505215062150721508215092151021511215122151321514215152151621517215182151921520215212152221523215242152521526215272152821529215302153121532215332153421535215362153721538215392154021541215422154321544215452154621547215482154921550215512155221553215542155521556215572155821559215602156121562215632156421565215662156721568215692157021571215722157321574215752157621577215782157921580215812158221583215842158521586215872158821589215902159121592215932159421595215962159721598215992160021601216022160321604216052160621607216082160921610216112161221613216142161521616216172161821619216202162121622216232162421625216262162721628216292163021631216322163321634216352163621637216382163921640216412164221643216442164521646216472164821649216502165121652216532165421655216562165721658216592166021661216622166321664216652166621667216682166921670216712167221673216742167521676216772167821679216802168121682216832168421685216862168721688216892169021691216922169321694216952169621697216982169921700217012170221703217042170521706217072170821709217102171121712217132171421715217162171721718217192172021721217222172321724217252172621727217282172921730217312173221733217342173521736217372173821739217402174121742217432174421745217462174721748217492175021751217522175321754217552175621757217582175921760217612176221763217642176521766217672176821769217702177121772217732177421775217762177721778217792178021781217822178321784217852178621787217882178921790217912179221793217942179521796217972179821799218002180121802218032180421805218062180721808218092181021811218122181321814218152181621817218182181921820218212182221823218242182521826218272182821829218302183121832218332183421835218362183721838218392184021841218422184321844218452184621847218482184921850218512185221853218542185521856218572185821859218602186121862218632186421865218662186721868218692187021871218722187321874218752187621877218782187921880218812188221883218842188521886218872188821889218902189121892218932189421895218962189721898218992190021901219022190321904219052190621907219082190921910219112191221913219142191521916219172191821919219202192121922219232192421925219262192721928219292193021931219322193321934219352193621937219382193921940219412194221943219442194521946219472194821949219502195121952219532195421955219562195721958219592196021961219622196321964219652196621967219682196921970219712197221973219742197521976219772197821979219802198121982219832198421985219862198721988219892199021991219922199321994219952199621997219982199922000220012200222003220042200522006220072200822009220102201122012220132201422015220162201722018220192202022021220222202322024220252202622027220282202922030220312203222033220342203522036220372203822039220402204122042220432204422045220462204722048220492205022051220522205322054220552205622057220582205922060220612206222063220642206522066220672206822069220702207122072220732207422075220762207722078220792208022081220822208322084220852208622087220882208922090220912209222093220942209522096220972209822099221002210122102221032210422105221062210722108221092211022111221122211322114221152211622117221182211922120221212212222123221242212522126221272212822129221302213122132221332213422135221362213722138221392214022141221422214322144221452214622147221482214922150221512215222153221542215522156221572215822159221602216122162221632216422165221662216722168221692217022171221722217322174221752217622177221782217922180221812218222183221842218522186221872218822189221902219122192221932219422195221962219722198221992220022201222022220322204222052220622207222082220922210222112221222213222142221522216222172221822219222202222122222222232222422225222262222722228222292223022231222322223322234222352223622237222382223922240222412224222243222442224522246222472224822249222502225122252222532225422255222562225722258222592226022261222622226322264222652226622267222682226922270222712227222273222742227522276222772227822279222802228122282222832228422285222862228722288222892229022291222922229322294222952229622297222982229922300223012230222303223042230522306223072230822309223102231122312223132231422315223162231722318223192232022321223222232322324223252232622327223282232922330223312233222333223342233522336223372233822339223402234122342223432234422345223462234722348223492235022351223522235322354223552235622357223582235922360223612236222363223642236522366223672236822369223702237122372223732237422375223762237722378223792238022381223822238322384223852238622387223882238922390223912239222393223942239522396223972239822399224002240122402224032240422405224062240722408224092241022411224122241322414224152241622417224182241922420224212242222423224242242522426224272242822429224302243122432224332243422435224362243722438224392244022441224422244322444224452244622447224482244922450224512245222453224542245522456224572245822459224602246122462224632246422465224662246722468224692247022471224722247322474224752247622477224782247922480224812248222483224842248522486224872248822489224902249122492224932249422495224962249722498224992250022501225022250322504225052250622507225082250922510225112251222513225142251522516225172251822519225202252122522225232252422525225262252722528225292253022531225322253322534225352253622537225382253922540225412254222543225442254522546225472254822549225502255122552225532255422555225562255722558225592256022561225622256322564225652256622567225682256922570225712257222573225742257522576225772257822579225802258122582225832258422585225862258722588225892259022591225922259322594225952259622597225982259922600226012260222603226042260522606226072260822609226102261122612226132261422615226162261722618226192262022621226222262322624226252262622627226282262922630226312263222633226342263522636226372263822639226402264122642226432264422645226462264722648226492265022651226522265322654226552265622657226582265922660226612266222663226642266522666226672266822669226702267122672226732267422675226762267722678226792268022681226822268322684226852268622687226882268922690226912269222693226942269522696226972269822699227002270122702227032270422705227062270722708227092271022711227122271322714227152271622717227182271922720227212272222723227242272522726227272272822729227302273122732227332273422735227362273722738227392274022741227422274322744227452274622747227482274922750227512275222753227542275522756227572275822759227602276122762227632276422765227662276722768227692277022771227722277322774227752277622777227782277922780227812278222783227842278522786227872278822789227902279122792227932279422795227962279722798227992280022801228022280322804228052280622807228082280922810228112281222813228142281522816228172281822819228202282122822228232282422825228262282722828228292283022831228322283322834228352283622837228382283922840228412284222843228442284522846228472284822849228502285122852228532285422855228562285722858228592286022861228622286322864228652286622867228682286922870228712287222873228742287522876228772287822879228802288122882228832288422885228862288722888228892289022891228922289322894228952289622897228982289922900229012290222903229042290522906229072290822909229102291122912229132291422915229162291722918229192292022921229222292322924229252292622927229282292922930229312293222933229342293522936229372293822939229402294122942229432294422945229462294722948229492295022951229522295322954229552295622957229582295922960229612296222963229642296522966229672296822969229702297122972229732297422975229762297722978229792298022981229822298322984229852298622987229882298922990229912299222993229942299522996229972299822999230002300123002230032300423005230062300723008230092301023011230122301323014230152301623017230182301923020230212302223023230242302523026230272302823029230302303123032230332303423035230362303723038230392304023041230422304323044230452304623047230482304923050230512305223053230542305523056230572305823059230602306123062230632306423065230662306723068230692307023071230722307323074230752307623077230782307923080230812308223083230842308523086230872308823089230902309123092230932309423095230962309723098230992310023101231022310323104231052310623107231082310923110231112311223113231142311523116231172311823119231202312123122231232312423125231262312723128231292313023131231322313323134231352313623137231382313923140231412314223143231442314523146231472314823149231502315123152231532315423155231562315723158231592316023161231622316323164231652316623167231682316923170231712317223173231742317523176231772317823179231802318123182231832318423185231862318723188231892319023191231922319323194231952319623197231982319923200232012320223203232042320523206232072320823209232102321123212232132321423215232162321723218232192322023221232222322323224232252322623227232282322923230232312323223233232342323523236232372323823239232402324123242232432324423245232462324723248232492325023251232522325323254232552325623257232582325923260232612326223263232642326523266232672326823269232702327123272232732327423275232762327723278232792328023281232822328323284232852328623287232882328923290232912329223293232942329523296232972329823299233002330123302233032330423305233062330723308233092331023311233122331323314233152331623317233182331923320233212332223323233242332523326233272332823329233302333123332233332333423335233362333723338233392334023341233422334323344233452334623347233482334923350233512335223353233542335523356233572335823359233602336123362233632336423365233662336723368233692337023371233722337323374233752337623377233782337923380233812338223383233842338523386233872338823389233902339123392233932339423395233962339723398233992340023401234022340323404234052340623407234082340923410234112341223413234142341523416234172341823419234202342123422234232342423425234262342723428234292343023431234322343323434234352343623437234382343923440234412344223443234442344523446234472344823449234502345123452234532345423455234562345723458234592346023461234622346323464234652346623467234682346923470234712347223473234742347523476234772347823479234802348123482234832348423485234862348723488234892349023491234922349323494234952349623497234982349923500235012350223503235042350523506235072350823509235102351123512235132351423515235162351723518235192352023521235222352323524235252352623527235282352923530235312353223533235342353523536235372353823539235402354123542235432354423545235462354723548235492355023551235522355323554235552355623557235582355923560235612356223563235642356523566235672356823569235702357123572235732357423575235762357723578235792358023581235822358323584235852358623587235882358923590235912359223593235942359523596235972359823599236002360123602236032360423605236062360723608236092361023611236122361323614236152361623617236182361923620236212362223623236242362523626236272362823629236302363123632236332363423635236362363723638236392364023641236422364323644236452364623647236482364923650236512365223653236542365523656236572365823659236602366123662236632366423665236662366723668236692367023671236722367323674236752367623677236782367923680236812368223683236842368523686236872368823689236902369123692236932369423695236962369723698236992370023701237022370323704237052370623707237082370923710237112371223713237142371523716237172371823719237202372123722237232372423725237262372723728237292373023731237322373323734237352373623737237382373923740237412374223743237442374523746237472374823749237502375123752237532375423755237562375723758237592376023761237622376323764237652376623767237682376923770237712377223773237742377523776237772377823779237802378123782237832378423785237862378723788237892379023791237922379323794237952379623797237982379923800238012380223803238042380523806238072380823809238102381123812238132381423815238162381723818238192382023821238222382323824238252382623827238282382923830238312383223833238342383523836238372383823839238402384123842238432384423845238462384723848238492385023851238522385323854238552385623857238582385923860238612386223863238642386523866238672386823869238702387123872238732387423875238762387723878238792388023881238822388323884238852388623887238882388923890238912389223893238942389523896238972389823899239002390123902239032390423905239062390723908239092391023911239122391323914239152391623917239182391923920239212392223923239242392523926239272392823929239302393123932239332393423935239362393723938239392394023941239422394323944239452394623947239482394923950239512395223953239542395523956239572395823959239602396123962239632396423965239662396723968239692397023971239722397323974239752397623977239782397923980239812398223983239842398523986239872398823989239902399123992239932399423995239962399723998239992400024001240022400324004240052400624007240082400924010240112401224013240142401524016240172401824019240202402124022240232402424025240262402724028240292403024031240322403324034240352403624037240382403924040240412404224043240442404524046240472404824049240502405124052240532405424055240562405724058240592406024061240622406324064240652406624067240682406924070240712407224073240742407524076240772407824079240802408124082240832408424085240862408724088240892409024091240922409324094240952409624097240982409924100241012410224103241042410524106241072410824109241102411124112241132411424115241162411724118241192412024121241222412324124241252412624127241282412924130241312413224133241342413524136241372413824139241402414124142241432414424145241462414724148241492415024151241522415324154241552415624157241582415924160241612416224163241642416524166241672416824169241702417124172241732417424175241762417724178241792418024181241822418324184241852418624187241882418924190241912419224193241942419524196241972419824199242002420124202242032420424205242062420724208242092421024211242122421324214242152421624217242182421924220242212422224223242242422524226242272422824229242302423124232242332423424235242362423724238242392424024241242422424324244242452424624247242482424924250242512425224253242542425524256242572425824259242602426124262242632426424265242662426724268242692427024271242722427324274242752427624277242782427924280242812428224283242842428524286242872428824289242902429124292242932429424295242962429724298242992430024301243022430324304243052430624307243082430924310243112431224313243142431524316243172431824319243202432124322243232432424325243262432724328243292433024331243322433324334243352433624337243382433924340243412434224343243442434524346243472434824349243502435124352243532435424355243562435724358243592436024361243622436324364243652436624367243682436924370243712437224373243742437524376243772437824379243802438124382243832438424385243862438724388243892439024391243922439324394243952439624397243982439924400244012440224403244042440524406244072440824409244102441124412244132441424415244162441724418244192442024421244222442324424244252442624427244282442924430244312443224433244342443524436244372443824439244402444124442244432444424445244462444724448244492445024451244522445324454244552445624457244582445924460244612446224463244642446524466244672446824469244702447124472244732447424475244762447724478244792448024481244822448324484244852448624487244882448924490244912449224493244942449524496244972449824499245002450124502245032450424505245062450724508245092451024511245122451324514245152451624517245182451924520245212452224523245242452524526245272452824529245302453124532245332453424535245362453724538245392454024541245422454324544245452454624547245482454924550245512455224553245542455524556245572455824559245602456124562245632456424565245662456724568245692457024571245722457324574245752457624577245782457924580245812458224583245842458524586245872458824589245902459124592245932459424595245962459724598245992460024601246022460324604246052460624607246082460924610246112461224613246142461524616246172461824619246202462124622246232462424625246262462724628246292463024631246322463324634246352463624637246382463924640246412464224643246442464524646246472464824649246502465124652246532465424655246562465724658246592466024661246622466324664246652466624667246682466924670246712467224673246742467524676246772467824679246802468124682246832468424685246862468724688246892469024691246922469324694246952469624697246982469924700247012470224703247042470524706247072470824709247102471124712247132471424715247162471724718247192472024721247222472324724247252472624727247282472924730247312473224733247342473524736247372473824739247402474124742247432474424745247462474724748247492475024751247522475324754247552475624757247582475924760247612476224763247642476524766247672476824769247702477124772247732477424775247762477724778247792478024781247822478324784247852478624787247882478924790247912479224793247942479524796247972479824799248002480124802248032480424805248062480724808248092481024811248122481324814248152481624817248182481924820248212482224823248242482524826248272482824829248302483124832248332483424835248362483724838248392484024841248422484324844248452484624847248482484924850248512485224853248542485524856248572485824859248602486124862248632486424865248662486724868248692487024871248722487324874248752487624877248782487924880248812488224883248842488524886248872488824889248902489124892248932489424895248962489724898248992490024901249022490324904249052490624907249082490924910249112491224913249142491524916249172491824919249202492124922249232492424925249262492724928249292493024931249322493324934249352493624937249382493924940249412494224943249442494524946249472494824949249502495124952249532495424955249562495724958249592496024961249622496324964249652496624967249682496924970249712497224973249742497524976249772497824979249802498124982249832498424985249862498724988249892499024991249922499324994249952499624997249982499925000250012500225003250042500525006250072500825009250102501125012250132501425015250162501725018250192502025021250222502325024250252502625027250282502925030250312503225033250342503525036250372503825039250402504125042250432504425045250462504725048250492505025051250522505325054250552505625057250582505925060250612506225063250642506525066250672506825069250702507125072250732507425075250762507725078250792508025081250822508325084250852508625087250882508925090250912509225093250942509525096250972509825099251002510125102251032510425105251062510725108251092511025111251122511325114251152511625117251182511925120251212512225123251242512525126251272512825129251302513125132251332513425135251362513725138251392514025141251422514325144251452514625147251482514925150251512515225153251542515525156251572515825159251602516125162251632516425165251662516725168251692517025171251722517325174251752517625177251782517925180251812518225183251842518525186251872518825189251902519125192251932519425195251962519725198251992520025201252022520325204252052520625207252082520925210252112521225213252142521525216252172521825219252202522125222252232522425225252262522725228252292523025231252322523325234252352523625237252382523925240252412524225243252442524525246252472524825249252502525125252252532525425255252562525725258252592526025261252622526325264252652526625267252682526925270252712527225273252742527525276252772527825279252802528125282252832528425285252862528725288252892529025291252922529325294252952529625297252982529925300253012530225303253042530525306253072530825309253102531125312253132531425315253162531725318253192532025321253222532325324253252532625327253282532925330253312533225333253342533525336253372533825339253402534125342253432534425345253462534725348253492535025351253522535325354253552535625357253582535925360253612536225363253642536525366253672536825369253702537125372253732537425375253762537725378253792538025381253822538325384253852538625387253882538925390253912539225393253942539525396253972539825399254002540125402254032540425405254062540725408254092541025411254122541325414254152541625417254182541925420254212542225423254242542525426254272542825429254302543125432254332543425435254362543725438254392544025441254422544325444254452544625447254482544925450254512545225453254542545525456254572545825459254602546125462254632546425465254662546725468254692547025471254722547325474254752547625477254782547925480254812548225483254842548525486254872548825489254902549125492254932549425495254962549725498254992550025501255022550325504255052550625507255082550925510255112551225513255142551525516255172551825519255202552125522255232552425525255262552725528255292553025531255322553325534255352553625537255382553925540255412554225543255442554525546255472554825549255502555125552255532555425555255562555725558255592556025561255622556325564255652556625567255682556925570255712557225573255742557525576255772557825579255802558125582255832558425585255862558725588255892559025591255922559325594255952559625597255982559925600256012560225603256042560525606256072560825609256102561125612256132561425615256162561725618256192562025621256222562325624256252562625627256282562925630256312563225633256342563525636256372563825639256402564125642256432564425645256462564725648256492565025651256522565325654256552565625657256582565925660256612566225663256642566525666256672566825669256702567125672256732567425675256762567725678256792568025681256822568325684256852568625687256882568925690256912569225693256942569525696256972569825699257002570125702257032570425705257062570725708257092571025711257122571325714257152571625717257182571925720257212572225723257242572525726257272572825729257302573125732257332573425735257362573725738257392574025741257422574325744257452574625747257482574925750257512575225753257542575525756257572575825759257602576125762257632576425765257662576725768257692577025771257722577325774257752577625777257782577925780257812578225783257842578525786257872578825789257902579125792257932579425795257962579725798257992580025801258022580325804258052580625807258082580925810258112581225813258142581525816258172581825819258202582125822258232582425825258262582725828258292583025831258322583325834258352583625837258382583925840258412584225843258442584525846258472584825849258502585125852258532585425855258562585725858258592586025861258622586325864258652586625867258682586925870258712587225873258742587525876258772587825879258802588125882258832588425885258862588725888258892589025891258922589325894258952589625897258982589925900259012590225903259042590525906259072590825909259102591125912259132591425915259162591725918259192592025921259222592325924259252592625927259282592925930259312593225933259342593525936259372593825939259402594125942259432594425945259462594725948259492595025951259522595325954259552595625957259582595925960259612596225963259642596525966259672596825969259702597125972259732597425975259762597725978259792598025981259822598325984259852598625987259882598925990259912599225993259942599525996259972599825999260002600126002260032600426005260062600726008260092601026011260122601326014260152601626017260182601926020260212602226023260242602526026260272602826029260302603126032260332603426035260362603726038260392604026041260422604326044260452604626047260482604926050260512605226053260542605526056260572605826059260602606126062260632606426065260662606726068260692607026071260722607326074260752607626077260782607926080260812608226083260842608526086260872608826089260902609126092260932609426095260962609726098260992610026101261022610326104261052610626107261082610926110261112611226113261142611526116261172611826119261202612126122261232612426125261262612726128261292613026131261322613326134261352613626137261382613926140261412614226143261442614526146261472614826149261502615126152261532615426155261562615726158261592616026161261622616326164261652616626167261682616926170261712617226173261742617526176261772617826179261802618126182261832618426185261862618726188261892619026191261922619326194261952619626197261982619926200262012620226203262042620526206262072620826209262102621126212262132621426215262162621726218262192622026221262222622326224262252622626227262282622926230262312623226233262342623526236262372623826239262402624126242262432624426245262462624726248262492625026251262522625326254262552625626257262582625926260262612626226263262642626526266262672626826269262702627126272262732627426275262762627726278262792628026281262822628326284262852628626287262882628926290262912629226293262942629526296262972629826299263002630126302263032630426305263062630726308263092631026311263122631326314263152631626317263182631926320263212632226323263242632526326263272632826329263302633126332263332633426335263362633726338263392634026341263422634326344263452634626347263482634926350263512635226353263542635526356263572635826359263602636126362263632636426365263662636726368263692637026371263722637326374263752637626377263782637926380263812638226383263842638526386263872638826389263902639126392263932639426395263962639726398263992640026401264022640326404264052640626407264082640926410264112641226413264142641526416264172641826419264202642126422264232642426425264262642726428264292643026431264322643326434264352643626437264382643926440264412644226443264442644526446264472644826449264502645126452264532645426455264562645726458264592646026461264622646326464264652646626467264682646926470264712647226473264742647526476264772647826479264802648126482264832648426485264862648726488264892649026491264922649326494264952649626497264982649926500265012650226503265042650526506265072650826509265102651126512265132651426515265162651726518265192652026521265222652326524265252652626527265282652926530265312653226533265342653526536265372653826539265402654126542265432654426545265462654726548265492655026551265522655326554265552655626557265582655926560265612656226563265642656526566265672656826569265702657126572265732657426575265762657726578265792658026581265822658326584265852658626587265882658926590265912659226593265942659526596265972659826599266002660126602266032660426605266062660726608266092661026611266122661326614266152661626617266182661926620266212662226623266242662526626266272662826629266302663126632266332663426635266362663726638266392664026641266422664326644266452664626647266482664926650266512665226653266542665526656266572665826659266602666126662266632666426665266662666726668266692667026671266722667326674266752667626677266782667926680266812668226683266842668526686266872668826689266902669126692266932669426695266962669726698266992670026701267022670326704267052670626707267082670926710267112671226713267142671526716267172671826719267202672126722267232672426725267262672726728267292673026731267322673326734267352673626737267382673926740267412674226743267442674526746267472674826749267502675126752267532675426755267562675726758267592676026761267622676326764267652676626767267682676926770267712677226773267742677526776267772677826779267802678126782267832678426785267862678726788267892679026791267922679326794267952679626797267982679926800268012680226803268042680526806268072680826809268102681126812268132681426815268162681726818268192682026821268222682326824268252682626827268282682926830268312683226833268342683526836268372683826839268402684126842268432684426845268462684726848268492685026851268522685326854268552685626857268582685926860268612686226863268642686526866268672686826869268702687126872268732687426875268762687726878268792688026881268822688326884268852688626887268882688926890268912689226893268942689526896268972689826899269002690126902269032690426905269062690726908269092691026911269122691326914269152691626917269182691926920269212692226923269242692526926269272692826929269302693126932269332693426935269362693726938269392694026941269422694326944269452694626947269482694926950269512695226953269542695526956269572695826959269602696126962269632696426965269662696726968269692697026971269722697326974269752697626977269782697926980269812698226983269842698526986269872698826989269902699126992269932699426995269962699726998269992700027001270022700327004270052700627007270082700927010270112701227013270142701527016270172701827019270202702127022270232702427025270262702727028270292703027031270322703327034270352703627037270382703927040270412704227043270442704527046270472704827049270502705127052270532705427055270562705727058270592706027061270622706327064270652706627067270682706927070270712707227073270742707527076270772707827079270802708127082270832708427085270862708727088270892709027091270922709327094270952709627097270982709927100271012710227103271042710527106271072710827109271102711127112271132711427115271162711727118271192712027121271222712327124271252712627127271282712927130271312713227133271342713527136271372713827139271402714127142271432714427145271462714727148271492715027151271522715327154271552715627157271582715927160271612716227163271642716527166271672716827169271702717127172271732717427175271762717727178271792718027181271822718327184271852718627187271882718927190271912719227193271942719527196271972719827199272002720127202272032720427205272062720727208272092721027211272122721327214272152721627217272182721927220272212722227223272242722527226272272722827229272302723127232272332723427235272362723727238272392724027241272422724327244272452724627247272482724927250272512725227253272542725527256272572725827259272602726127262272632726427265272662726727268272692727027271272722727327274272752727627277272782727927280272812728227283272842728527286272872728827289272902729127292272932729427295272962729727298272992730027301273022730327304273052730627307273082730927310273112731227313273142731527316273172731827319273202732127322273232732427325273262732727328273292733027331273322733327334273352733627337273382733927340273412734227343273442734527346273472734827349273502735127352273532735427355273562735727358273592736027361273622736327364273652736627367273682736927370273712737227373273742737527376273772737827379273802738127382273832738427385273862738727388273892739027391273922739327394273952739627397273982739927400274012740227403274042740527406274072740827409274102741127412274132741427415274162741727418274192742027421274222742327424274252742627427274282742927430274312743227433274342743527436274372743827439274402744127442274432744427445274462744727448274492745027451274522745327454274552745627457274582745927460274612746227463274642746527466274672746827469274702747127472274732747427475274762747727478274792748027481274822748327484274852748627487274882748927490274912749227493274942749527496274972749827499275002750127502275032750427505275062750727508275092751027511275122751327514275152751627517275182751927520275212752227523275242752527526275272752827529275302753127532275332753427535275362753727538275392754027541275422754327544275452754627547275482754927550275512755227553275542755527556275572755827559275602756127562275632756427565275662756727568275692757027571275722757327574275752757627577275782757927580275812758227583275842758527586275872758827589275902759127592275932759427595275962759727598275992760027601276022760327604276052760627607276082760927610276112761227613276142761527616276172761827619276202762127622276232762427625276262762727628276292763027631276322763327634276352763627637276382763927640276412764227643276442764527646276472764827649276502765127652276532765427655276562765727658276592766027661276622766327664276652766627667276682766927670276712767227673276742767527676276772767827679276802768127682276832768427685276862768727688276892769027691276922769327694276952769627697276982769927700277012770227703277042770527706277072770827709277102771127712277132771427715277162771727718277192772027721277222772327724277252772627727277282772927730277312773227733277342773527736277372773827739277402774127742277432774427745277462774727748277492775027751277522775327754277552775627757277582775927760277612776227763277642776527766277672776827769277702777127772277732777427775277762777727778277792778027781277822778327784277852778627787277882778927790277912779227793277942779527796277972779827799278002780127802278032780427805278062780727808278092781027811278122781327814278152781627817278182781927820278212782227823278242782527826278272782827829278302783127832278332783427835278362783727838278392784027841278422784327844278452784627847278482784927850278512785227853278542785527856278572785827859278602786127862278632786427865278662786727868278692787027871278722787327874278752787627877278782787927880278812788227883278842788527886278872788827889278902789127892278932789427895278962789727898278992790027901279022790327904279052790627907279082790927910279112791227913279142791527916279172791827919279202792127922279232792427925279262792727928279292793027931279322793327934279352793627937279382793927940279412794227943279442794527946279472794827949279502795127952279532795427955279562795727958279592796027961279622796327964279652796627967279682796927970279712797227973279742797527976279772797827979279802798127982279832798427985279862798727988279892799027991279922799327994279952799627997279982799928000280012800228003280042800528006280072800828009280102801128012280132801428015280162801728018280192802028021280222802328024280252802628027280282802928030280312803228033280342803528036280372803828039280402804128042280432804428045280462804728048280492805028051280522805328054280552805628057280582805928060280612806228063280642806528066280672806828069280702807128072280732807428075280762807728078280792808028081280822808328084280852808628087280882808928090280912809228093280942809528096280972809828099281002810128102281032810428105281062810728108281092811028111281122811328114281152811628117281182811928120281212812228123281242812528126281272812828129281302813128132281332813428135281362813728138281392814028141281422814328144281452814628147281482814928150281512815228153281542815528156281572815828159281602816128162281632816428165281662816728168281692817028171281722817328174281752817628177281782817928180281812818228183281842818528186281872818828189281902819128192281932819428195281962819728198281992820028201282022820328204282052820628207282082820928210282112821228213282142821528216282172821828219282202822128222282232822428225282262822728228282292823028231282322823328234282352823628237282382823928240282412824228243282442824528246282472824828249282502825128252282532825428255282562825728258282592826028261282622826328264282652826628267282682826928270282712827228273282742827528276282772827828279282802828128282282832828428285282862828728288282892829028291282922829328294282952829628297282982829928300283012830228303283042830528306283072830828309283102831128312283132831428315283162831728318283192832028321283222832328324283252832628327283282832928330283312833228333283342833528336283372833828339283402834128342283432834428345283462834728348283492835028351283522835328354283552835628357283582835928360283612836228363283642836528366283672836828369283702837128372283732837428375283762837728378283792838028381283822838328384283852838628387283882838928390283912839228393283942839528396283972839828399284002840128402284032840428405284062840728408284092841028411284122841328414284152841628417284182841928420284212842228423284242842528426284272842828429284302843128432284332843428435284362843728438284392844028441284422844328444284452844628447284482844928450284512845228453284542845528456284572845828459284602846128462284632846428465284662846728468284692847028471284722847328474284752847628477284782847928480284812848228483284842848528486284872848828489284902849128492284932849428495284962849728498284992850028501285022850328504285052850628507285082850928510285112851228513285142851528516285172851828519285202852128522285232852428525285262852728528285292853028531285322853328534285352853628537285382853928540285412854228543285442854528546285472854828549285502855128552285532855428555285562855728558285592856028561285622856328564285652856628567285682856928570285712857228573285742857528576285772857828579285802858128582285832858428585285862858728588285892859028591285922859328594285952859628597285982859928600286012860228603286042860528606286072860828609286102861128612286132861428615286162861728618286192862028621286222862328624286252862628627286282862928630286312863228633286342863528636286372863828639286402864128642286432864428645286462864728648286492865028651286522865328654286552865628657286582865928660286612866228663286642866528666286672866828669286702867128672286732867428675286762867728678286792868028681286822868328684286852868628687286882868928690286912869228693286942869528696286972869828699287002870128702287032870428705287062870728708287092871028711287122871328714287152871628717287182871928720287212872228723287242872528726287272872828729287302873128732287332873428735287362873728738287392874028741287422874328744287452874628747287482874928750287512875228753287542875528756287572875828759287602876128762287632876428765287662876728768287692877028771287722877328774287752877628777287782877928780287812878228783287842878528786287872878828789287902879128792287932879428795287962879728798287992880028801288022880328804288052880628807288082880928810288112881228813288142881528816288172881828819288202882128822288232882428825288262882728828288292883028831288322883328834288352883628837288382883928840288412884228843288442884528846288472884828849288502885128852288532885428855288562885728858288592886028861288622886328864288652886628867288682886928870288712887228873288742887528876288772887828879288802888128882288832888428885288862888728888288892889028891288922889328894288952889628897288982889928900289012890228903289042890528906289072890828909289102891128912289132891428915289162891728918289192892028921289222892328924289252892628927289282892928930289312893228933289342893528936289372893828939289402894128942289432894428945289462894728948289492895028951289522895328954289552895628957289582895928960289612896228963289642896528966289672896828969289702897128972289732897428975289762897728978289792898028981289822898328984289852898628987289882898928990289912899228993289942899528996289972899828999290002900129002290032900429005290062900729008290092901029011290122901329014290152901629017290182901929020290212902229023290242902529026290272902829029290302903129032290332903429035290362903729038290392904029041290422904329044290452904629047290482904929050290512905229053290542905529056290572905829059290602906129062290632906429065290662906729068290692907029071290722907329074290752907629077290782907929080290812908229083290842908529086290872908829089290902909129092290932909429095290962909729098290992910029101291022910329104291052910629107291082910929110291112911229113291142911529116291172911829119291202912129122291232912429125291262912729128291292913029131291322913329134291352913629137291382913929140291412914229143291442914529146291472914829149291502915129152291532915429155291562915729158291592916029161291622916329164291652916629167291682916929170291712917229173291742917529176291772917829179291802918129182291832918429185291862918729188291892919029191291922919329194291952919629197291982919929200292012920229203292042920529206292072920829209292102921129212292132921429215292162921729218292192922029221292222922329224292252922629227292282922929230292312923229233292342923529236292372923829239292402924129242292432924429245292462924729248292492925029251292522925329254292552925629257292582925929260292612926229263292642926529266292672926829269292702927129272292732927429275292762927729278292792928029281292822928329284292852928629287292882928929290292912929229293292942929529296292972929829299293002930129302293032930429305293062930729308293092931029311293122931329314293152931629317293182931929320293212932229323293242932529326293272932829329293302933129332293332933429335293362933729338293392934029341293422934329344293452934629347293482934929350293512935229353293542935529356293572935829359293602936129362293632936429365293662936729368293692937029371293722937329374293752937629377293782937929380293812938229383293842938529386293872938829389293902939129392293932939429395293962939729398293992940029401294022940329404294052940629407294082940929410294112941229413294142941529416294172941829419294202942129422294232942429425294262942729428294292943029431294322943329434294352943629437294382943929440294412944229443294442944529446294472944829449294502945129452294532945429455294562945729458294592946029461294622946329464294652946629467294682946929470294712947229473294742947529476294772947829479294802948129482294832948429485294862948729488294892949029491294922949329494294952949629497294982949929500295012950229503295042950529506295072950829509295102951129512295132951429515295162951729518295192952029521295222952329524295252952629527295282952929530295312953229533295342953529536295372953829539295402954129542295432954429545295462954729548295492955029551295522955329554295552955629557295582955929560295612956229563295642956529566295672956829569295702957129572295732957429575295762957729578295792958029581295822958329584295852958629587295882958929590295912959229593295942959529596295972959829599296002960129602296032960429605296062960729608296092961029611296122961329614296152961629617296182961929620296212962229623296242962529626296272962829629296302963129632296332963429635296362963729638296392964029641296422964329644296452964629647296482964929650296512965229653296542965529656296572965829659296602966129662296632966429665296662966729668296692967029671296722967329674296752967629677296782967929680296812968229683296842968529686296872968829689296902969129692296932969429695296962969729698296992970029701297022970329704297052970629707297082970929710297112971229713297142971529716297172971829719297202972129722297232972429725297262972729728297292973029731297322973329734297352973629737297382973929740297412974229743297442974529746297472974829749297502975129752297532975429755297562975729758297592976029761297622976329764297652976629767297682976929770297712977229773297742977529776297772977829779297802978129782297832978429785297862978729788297892979029791297922979329794297952979629797297982979929800298012980229803298042980529806298072980829809298102981129812298132981429815298162981729818298192982029821298222982329824298252982629827298282982929830298312983229833298342983529836298372983829839298402984129842298432984429845298462984729848298492985029851298522985329854298552985629857298582985929860298612986229863298642986529866298672986829869298702987129872298732987429875298762987729878298792988029881298822988329884298852988629887298882988929890298912989229893298942989529896298972989829899299002990129902299032990429905299062990729908299092991029911299122991329914299152991629917299182991929920299212992229923299242992529926299272992829929299302993129932299332993429935299362993729938299392994029941299422994329944299452994629947299482994929950299512995229953299542995529956299572995829959299602996129962299632996429965299662996729968299692997029971299722997329974299752997629977299782997929980299812998229983299842998529986299872998829989299902999129992299932999429995299962999729998299993000030001300023000330004300053000630007300083000930010300113001230013300143001530016300173001830019300203002130022300233002430025300263002730028300293003030031300323003330034300353003630037300383003930040300413004230043300443004530046300473004830049300503005130052300533005430055300563005730058300593006030061300623006330064300653006630067300683006930070300713007230073300743007530076300773007830079300803008130082300833008430085300863008730088300893009030091300923009330094300953009630097300983009930100301013010230103301043010530106301073010830109301103011130112301133011430115301163011730118301193012030121301223012330124301253012630127301283012930130301313013230133301343013530136301373013830139301403014130142301433014430145301463014730148301493015030151301523015330154301553015630157301583015930160301613016230163301643016530166301673016830169301703017130172301733017430175301763017730178301793018030181301823018330184301853018630187301883018930190301913019230193301943019530196301973019830199302003020130202302033020430205302063020730208302093021030211302123021330214302153021630217302183021930220302213022230223302243022530226302273022830229302303023130232302333023430235302363023730238302393024030241302423024330244302453024630247302483024930250302513025230253302543025530256302573025830259302603026130262302633026430265302663026730268302693027030271302723027330274302753027630277302783027930280302813028230283302843028530286302873028830289302903029130292302933029430295302963029730298302993030030301303023030330304303053030630307303083030930310303113031230313303143031530316303173031830319303203032130322303233032430325303263032730328303293033030331303323033330334303353033630337303383033930340303413034230343303443034530346303473034830349303503035130352303533035430355303563035730358303593036030361303623036330364303653036630367303683036930370303713037230373303743037530376303773037830379303803038130382303833038430385303863038730388303893039030391303923039330394303953039630397303983039930400304013040230403304043040530406304073040830409304103041130412304133041430415304163041730418304193042030421304223042330424304253042630427304283042930430304313043230433304343043530436304373043830439304403044130442304433044430445304463044730448304493045030451304523045330454304553045630457304583045930460304613046230463304643046530466304673046830469304703047130472304733047430475304763047730478304793048030481304823048330484304853048630487304883048930490304913049230493304943049530496304973049830499305003050130502305033050430505305063050730508305093051030511305123051330514305153051630517305183051930520305213052230523305243052530526305273052830529305303053130532305333053430535305363053730538305393054030541305423054330544305453054630547305483054930550305513055230553305543055530556305573055830559305603056130562305633056430565305663056730568305693057030571305723057330574305753057630577305783057930580305813058230583305843058530586305873058830589305903059130592305933059430595305963059730598305993060030601306023060330604306053060630607306083060930610306113061230613306143061530616306173061830619306203062130622306233062430625306263062730628306293063030631306323063330634306353063630637306383063930640306413064230643306443064530646306473064830649306503065130652306533065430655306563065730658306593066030661306623066330664306653066630667306683066930670306713067230673306743067530676306773067830679306803068130682306833068430685306863068730688306893069030691306923069330694306953069630697306983069930700307013070230703307043070530706307073070830709307103071130712307133071430715307163071730718307193072030721307223072330724307253072630727307283072930730307313073230733307343073530736307373073830739307403074130742307433074430745307463074730748307493075030751307523075330754307553075630757307583075930760307613076230763307643076530766307673076830769307703077130772307733077430775307763077730778307793078030781307823078330784307853078630787307883078930790307913079230793307943079530796307973079830799308003080130802308033080430805308063080730808308093081030811308123081330814308153081630817308183081930820308213082230823308243082530826308273082830829308303083130832308333083430835308363083730838308393084030841308423084330844308453084630847308483084930850308513085230853308543085530856308573085830859308603086130862308633086430865308663086730868308693087030871308723087330874308753087630877308783087930880308813088230883308843088530886308873088830889308903089130892308933089430895308963089730898308993090030901309023090330904309053090630907309083090930910309113091230913309143091530916309173091830919309203092130922309233092430925309263092730928309293093030931309323093330934309353093630937309383093930940309413094230943309443094530946309473094830949309503095130952309533095430955309563095730958309593096030961309623096330964309653096630967309683096930970309713097230973309743097530976309773097830979309803098130982309833098430985309863098730988309893099030991309923099330994309953099630997309983099931000310013100231003310043100531006310073100831009310103101131012310133101431015310163101731018310193102031021310223102331024310253102631027310283102931030310313103231033310343103531036310373103831039310403104131042310433104431045310463104731048310493105031051310523105331054310553105631057310583105931060310613106231063310643106531066310673106831069310703107131072310733107431075310763107731078310793108031081310823108331084310853108631087310883108931090310913109231093310943109531096310973109831099311003110131102311033110431105311063110731108311093111031111311123111331114311153111631117311183111931120311213112231123311243112531126311273112831129311303113131132311333113431135311363113731138311393114031141311423114331144311453114631147311483114931150311513115231153311543115531156311573115831159311603116131162311633116431165311663116731168311693117031171311723117331174311753117631177311783117931180311813118231183311843118531186311873118831189311903119131192311933119431195311963119731198311993120031201312023120331204312053120631207312083120931210312113121231213312143121531216312173121831219312203122131222312233122431225312263122731228312293123031231312323123331234312353123631237312383123931240312413124231243312443124531246312473124831249312503125131252312533125431255312563125731258312593126031261312623126331264312653126631267312683126931270312713127231273312743127531276312773127831279312803128131282312833128431285312863128731288312893129031291312923129331294312953129631297312983129931300313013130231303313043130531306313073130831309313103131131312313133131431315313163131731318313193132031321313223132331324313253132631327313283132931330313313133231333313343133531336313373133831339313403134131342313433134431345313463134731348313493135031351313523135331354313553135631357313583135931360313613136231363313643136531366313673136831369313703137131372313733137431375313763137731378313793138031381313823138331384313853138631387313883138931390313913139231393313943139531396313973139831399314003140131402314033140431405314063140731408314093141031411314123141331414314153141631417314183141931420314213142231423314243142531426314273142831429314303143131432314333143431435314363143731438314393144031441314423144331444314453144631447314483144931450314513145231453314543145531456314573145831459314603146131462314633146431465314663146731468314693147031471314723147331474314753147631477314783147931480314813148231483314843148531486314873148831489314903149131492314933149431495314963149731498314993150031501315023150331504315053150631507315083150931510315113151231513315143151531516315173151831519315203152131522315233152431525315263152731528315293153031531315323153331534315353153631537315383153931540315413154231543315443154531546315473154831549315503155131552315533155431555315563155731558315593156031561315623156331564315653156631567315683156931570315713157231573315743157531576315773157831579315803158131582315833158431585315863158731588315893159031591315923159331594315953159631597315983159931600316013160231603316043160531606316073160831609316103161131612316133161431615316163161731618316193162031621316223162331624316253162631627316283162931630316313163231633316343163531636316373163831639316403164131642316433164431645316463164731648316493165031651316523165331654316553165631657316583165931660316613166231663316643166531666316673166831669316703167131672316733167431675316763167731678316793168031681316823168331684316853168631687316883168931690316913169231693316943169531696316973169831699317003170131702317033170431705317063170731708317093171031711317123171331714317153171631717317183171931720317213172231723317243172531726317273172831729317303173131732317333173431735317363173731738317393174031741317423174331744317453174631747317483174931750317513175231753317543175531756317573175831759317603176131762317633176431765317663176731768317693177031771317723177331774317753177631777317783177931780317813178231783317843178531786317873178831789317903179131792317933179431795317963179731798317993180031801318023180331804318053180631807318083180931810318113181231813318143181531816318173181831819318203182131822318233182431825318263182731828318293183031831318323183331834318353183631837318383183931840318413184231843318443184531846318473184831849318503185131852318533185431855318563185731858318593186031861318623186331864318653186631867318683186931870318713187231873318743187531876318773187831879318803188131882318833188431885318863188731888318893189031891318923189331894318953189631897318983189931900319013190231903319043190531906319073190831909319103191131912319133191431915319163191731918319193192031921319223192331924319253192631927319283192931930319313193231933319343193531936319373193831939319403194131942319433194431945319463194731948319493195031951319523195331954319553195631957319583195931960319613196231963319643196531966319673196831969319703197131972319733197431975319763197731978319793198031981319823198331984319853198631987319883198931990319913199231993319943199531996319973199831999320003200132002320033200432005320063200732008320093201032011320123201332014320153201632017320183201932020320213202232023320243202532026320273202832029320303203132032320333203432035320363203732038320393204032041320423204332044320453204632047320483204932050320513205232053320543205532056320573205832059320603206132062320633206432065320663206732068320693207032071320723207332074320753207632077320783207932080320813208232083320843208532086320873208832089320903209132092320933209432095320963209732098320993210032101321023210332104321053210632107321083210932110321113211232113321143211532116321173211832119321203212132122321233212432125321263212732128321293213032131321323213332134321353213632137321383213932140321413214232143321443214532146321473214832149321503215132152321533215432155321563215732158321593216032161321623216332164321653216632167321683216932170321713217232173321743217532176321773217832179321803218132182321833218432185321863218732188321893219032191321923219332194321953219632197321983219932200322013220232203322043220532206322073220832209322103221132212322133221432215322163221732218322193222032221322223222332224322253222632227322283222932230322313223232233322343223532236322373223832239322403224132242322433224432245322463224732248322493225032251322523225332254322553225632257322583225932260322613226232263322643226532266322673226832269322703227132272322733227432275322763227732278322793228032281322823228332284322853228632287322883228932290322913229232293322943229532296322973229832299323003230132302323033230432305323063230732308323093231032311323123231332314323153231632317323183231932320323213232232323323243232532326323273232832329323303233132332323333233432335323363233732338323393234032341323423234332344323453234632347323483234932350323513235232353323543235532356323573235832359323603236132362323633236432365323663236732368323693237032371323723237332374323753237632377323783237932380323813238232383323843238532386323873238832389323903239132392323933239432395323963239732398323993240032401324023240332404324053240632407324083240932410324113241232413324143241532416324173241832419324203242132422324233242432425324263242732428324293243032431324323243332434324353243632437324383243932440324413244232443324443244532446324473244832449324503245132452324533245432455324563245732458324593246032461324623246332464324653246632467324683246932470324713247232473324743247532476324773247832479324803248132482324833248432485324863248732488324893249032491324923249332494324953249632497324983249932500325013250232503325043250532506325073250832509325103251132512325133251432515325163251732518325193252032521325223252332524325253252632527325283252932530325313253232533325343253532536325373253832539325403254132542325433254432545325463254732548325493255032551325523255332554325553255632557325583255932560325613256232563325643256532566325673256832569325703257132572325733257432575325763257732578325793258032581325823258332584325853258632587325883258932590325913259232593325943259532596325973259832599326003260132602326033260432605326063260732608326093261032611326123261332614326153261632617326183261932620326213262232623326243262532626326273262832629326303263132632326333263432635326363263732638326393264032641326423264332644326453264632647326483264932650326513265232653326543265532656326573265832659326603266132662326633266432665326663266732668326693267032671326723267332674326753267632677326783267932680326813268232683326843268532686326873268832689326903269132692326933269432695326963269732698326993270032701327023270332704327053270632707327083270932710327113271232713327143271532716327173271832719327203272132722327233272432725327263272732728327293273032731327323273332734327353273632737327383273932740327413274232743327443274532746327473274832749327503275132752327533275432755327563275732758327593276032761327623276332764327653276632767327683276932770327713277232773327743277532776327773277832779327803278132782327833278432785327863278732788327893279032791327923279332794327953279632797327983279932800328013280232803328043280532806328073280832809328103281132812328133281432815328163281732818328193282032821328223282332824328253282632827328283282932830328313283232833328343283532836328373283832839328403284132842328433284432845328463284732848328493285032851328523285332854328553285632857328583285932860328613286232863328643286532866328673286832869328703287132872328733287432875328763287732878328793288032881328823288332884328853288632887328883288932890328913289232893328943289532896328973289832899329003290132902329033290432905329063290732908329093291032911329123291332914329153291632917329183291932920329213292232923329243292532926329273292832929329303293132932329333293432935329363293732938329393294032941329423294332944329453294632947329483294932950329513295232953329543295532956329573295832959329603296132962329633296432965329663296732968329693297032971329723297332974329753297632977329783297932980329813298232983329843298532986329873298832989329903299132992329933299432995329963299732998329993300033001330023300333004330053300633007330083300933010330113301233013330143301533016330173301833019330203302133022330233302433025330263302733028330293303033031330323303333034330353303633037330383303933040330413304233043330443304533046330473304833049330503305133052330533305433055330563305733058330593306033061330623306333064330653306633067330683306933070330713307233073330743307533076330773307833079330803308133082330833308433085330863308733088330893309033091330923309333094330953309633097330983309933100331013310233103331043310533106331073310833109331103311133112331133311433115331163311733118331193312033121331223312333124331253312633127331283312933130331313313233133331343313533136331373313833139331403314133142331433314433145331463314733148331493315033151331523315333154331553315633157331583315933160331613316233163331643316533166331673316833169331703317133172331733317433175331763317733178331793318033181331823318333184331853318633187331883318933190331913319233193331943319533196331973319833199332003320133202332033320433205332063320733208332093321033211332123321333214332153321633217332183321933220332213322233223332243322533226332273322833229332303323133232332333323433235332363323733238332393324033241332423324333244332453324633247332483324933250332513325233253332543325533256332573325833259332603326133262332633326433265332663326733268332693327033271332723327333274332753327633277332783327933280332813328233283332843328533286332873328833289332903329133292332933329433295332963329733298332993330033301333023330333304333053330633307333083330933310333113331233313333143331533316333173331833319333203332133322333233332433325333263332733328333293333033331333323333333334333353333633337333383333933340333413334233343333443334533346333473334833349333503335133352333533335433355333563335733358333593336033361333623336333364333653336633367333683336933370333713337233373333743337533376333773337833379333803338133382333833338433385333863338733388333893339033391333923339333394333953339633397333983339933400334013340233403334043340533406334073340833409334103341133412334133341433415334163341733418334193342033421334223342333424334253342633427334283342933430334313343233433334343343533436334373343833439334403344133442334433344433445334463344733448334493345033451334523345333454334553345633457334583345933460334613346233463334643346533466334673346833469334703347133472334733347433475334763347733478334793348033481334823348333484334853348633487334883348933490334913349233493334943349533496334973349833499335003350133502335033350433505335063350733508335093351033511335123351333514335153351633517335183351933520335213352233523335243352533526335273352833529335303353133532335333353433535335363353733538335393354033541335423354333544335453354633547335483354933550335513355233553335543355533556335573355833559335603356133562335633356433565335663356733568335693357033571335723357333574335753357633577335783357933580335813358233583335843358533586335873358833589335903359133592335933359433595335963359733598335993360033601336023360333604336053360633607336083360933610336113361233613336143361533616336173361833619336203362133622336233362433625336263362733628336293363033631336323363333634336353363633637336383363933640336413364233643336443364533646336473364833649336503365133652336533365433655336563365733658336593366033661336623366333664336653366633667336683366933670336713367233673336743367533676336773367833679336803368133682336833368433685336863368733688336893369033691336923369333694336953369633697336983369933700337013370233703337043370533706337073370833709337103371133712337133371433715337163371733718337193372033721337223372333724337253372633727337283372933730337313373233733337343373533736337373373833739337403374133742337433374433745337463374733748337493375033751337523375333754337553375633757337583375933760337613376233763337643376533766337673376833769337703377133772337733377433775337763377733778337793378033781337823378333784337853378633787337883378933790337913379233793337943379533796337973379833799338003380133802338033380433805338063380733808338093381033811338123381333814338153381633817338183381933820338213382233823338243382533826338273382833829338303383133832338333383433835338363383733838338393384033841338423384333844338453384633847338483384933850338513385233853338543385533856338573385833859338603386133862338633386433865338663386733868338693387033871338723387333874338753387633877338783387933880338813388233883338843388533886338873388833889338903389133892338933389433895338963389733898338993390033901339023390333904339053390633907339083390933910339113391233913339143391533916339173391833919339203392133922339233392433925339263392733928339293393033931339323393333934339353393633937339383393933940339413394233943339443394533946339473394833949339503395133952339533395433955339563395733958339593396033961339623396333964339653396633967339683396933970339713397233973339743397533976339773397833979339803398133982339833398433985339863398733988339893399033991339923399333994339953399633997339983399934000340013400234003340043400534006340073400834009340103401134012340133401434015340163401734018340193402034021340223402334024340253402634027340283402934030340313403234033340343403534036340373403834039340403404134042340433404434045340463404734048340493405034051340523405334054340553405634057340583405934060340613406234063340643406534066340673406834069340703407134072340733407434075340763407734078340793408034081340823408334084340853408634087340883408934090340913409234093340943409534096340973409834099341003410134102341033410434105341063410734108341093411034111341123411334114341153411634117341183411934120341213412234123341243412534126341273412834129341303413134132341333413434135341363413734138341393414034141341423414334144341453414634147341483414934150341513415234153341543415534156341573415834159341603416134162341633416434165341663416734168341693417034171341723417334174341753417634177341783417934180341813418234183341843418534186341873418834189341903419134192341933419434195341963419734198341993420034201342023420334204342053420634207342083420934210342113421234213342143421534216342173421834219342203422134222342233422434225342263422734228342293423034231342323423334234342353423634237342383423934240342413424234243342443424534246342473424834249342503425134252342533425434255342563425734258342593426034261342623426334264342653426634267342683426934270342713427234273342743427534276342773427834279342803428134282342833428434285342863428734288342893429034291342923429334294342953429634297342983429934300343013430234303343043430534306343073430834309343103431134312343133431434315343163431734318343193432034321343223432334324343253432634327343283432934330343313433234333343343433534336343373433834339343403434134342343433434434345343463434734348343493435034351343523435334354343553435634357343583435934360343613436234363343643436534366343673436834369343703437134372343733437434375343763437734378343793438034381343823438334384343853438634387343883438934390343913439234393343943439534396343973439834399344003440134402344033440434405344063440734408344093441034411344123441334414344153441634417344183441934420344213442234423344243442534426344273442834429344303443134432344333443434435344363443734438344393444034441344423444334444344453444634447344483444934450344513445234453344543445534456344573445834459344603446134462344633446434465344663446734468344693447034471344723447334474344753447634477344783447934480344813448234483344843448534486344873448834489344903449134492344933449434495344963449734498344993450034501345023450334504345053450634507345083450934510345113451234513345143451534516345173451834519345203452134522345233452434525345263452734528345293453034531345323453334534345353453634537345383453934540345413454234543345443454534546345473454834549345503455134552345533455434555345563455734558345593456034561345623456334564345653456634567345683456934570345713457234573345743457534576345773457834579345803458134582345833458434585345863458734588345893459034591345923459334594345953459634597345983459934600346013460234603346043460534606346073460834609346103461134612346133461434615346163461734618346193462034621346223462334624346253462634627346283462934630346313463234633346343463534636346373463834639346403464134642346433464434645346463464734648346493465034651346523465334654346553465634657346583465934660346613466234663346643466534666346673466834669346703467134672346733467434675346763467734678346793468034681346823468334684346853468634687346883468934690346913469234693346943469534696346973469834699347003470134702347033470434705347063470734708347093471034711347123471334714347153471634717347183471934720347213472234723347243472534726347273472834729347303473134732347333473434735347363473734738347393474034741347423474334744347453474634747347483474934750347513475234753347543475534756347573475834759347603476134762347633476434765347663476734768347693477034771347723477334774347753477634777347783477934780347813478234783347843478534786347873478834789347903479134792347933479434795347963479734798347993480034801348023480334804348053480634807348083480934810348113481234813348143481534816348173481834819348203482134822348233482434825348263482734828348293483034831348323483334834348353483634837348383483934840348413484234843348443484534846348473484834849348503485134852348533485434855348563485734858348593486034861348623486334864348653486634867348683486934870348713487234873348743487534876348773487834879348803488134882348833488434885348863488734888348893489034891348923489334894348953489634897348983489934900349013490234903349043490534906349073490834909349103491134912349133491434915349163491734918349193492034921349223492334924349253492634927349283492934930349313493234933349343493534936349373493834939349403494134942349433494434945349463494734948349493495034951349523495334954349553495634957349583495934960349613496234963349643496534966349673496834969349703497134972349733497434975349763497734978349793498034981349823498334984349853498634987349883498934990349913499234993349943499534996349973499834999350003500135002350033500435005350063500735008350093501035011350123501335014350153501635017350183501935020350213502235023350243502535026350273502835029350303503135032350333503435035350363503735038350393504035041350423504335044350453504635047350483504935050350513505235053350543505535056350573505835059350603506135062350633506435065350663506735068350693507035071350723507335074350753507635077350783507935080350813508235083350843508535086350873508835089350903509135092350933509435095350963509735098350993510035101351023510335104351053510635107351083510935110351113511235113351143511535116351173511835119351203512135122351233512435125351263512735128351293513035131351323513335134351353513635137351383513935140351413514235143351443514535146351473514835149351503515135152351533515435155351563515735158351593516035161351623516335164351653516635167351683516935170351713517235173351743517535176351773517835179351803518135182351833518435185351863518735188351893519035191351923519335194351953519635197351983519935200352013520235203352043520535206352073520835209352103521135212352133521435215352163521735218352193522035221352223522335224352253522635227352283522935230352313523235233352343523535236352373523835239352403524135242352433524435245352463524735248352493525035251352523525335254352553525635257352583525935260352613526235263352643526535266352673526835269352703527135272352733527435275352763527735278352793528035281352823528335284352853528635287352883528935290352913529235293352943529535296352973529835299353003530135302353033530435305353063530735308353093531035311353123531335314353153531635317353183531935320353213532235323353243532535326353273532835329353303533135332353333533435335353363533735338353393534035341353423534335344353453534635347353483534935350353513535235353353543535535356353573535835359353603536135362353633536435365353663536735368353693537035371353723537335374353753537635377353783537935380353813538235383353843538535386353873538835389353903539135392353933539435395353963539735398353993540035401354023540335404354053540635407354083540935410354113541235413354143541535416354173541835419354203542135422354233542435425354263542735428354293543035431354323543335434354353543635437354383543935440354413544235443354443544535446354473544835449354503545135452354533545435455354563545735458354593546035461354623546335464354653546635467354683546935470354713547235473354743547535476354773547835479354803548135482354833548435485354863548735488354893549035491354923549335494354953549635497354983549935500355013550235503355043550535506355073550835509355103551135512355133551435515355163551735518355193552035521355223552335524355253552635527355283552935530355313553235533355343553535536355373553835539355403554135542355433554435545355463554735548355493555035551355523555335554355553555635557355583555935560355613556235563355643556535566355673556835569355703557135572355733557435575355763557735578355793558035581355823558335584355853558635587355883558935590355913559235593355943559535596355973559835599356003560135602356033560435605356063560735608356093561035611356123561335614356153561635617356183561935620356213562235623356243562535626356273562835629356303563135632356333563435635356363563735638356393564035641356423564335644356453564635647356483564935650356513565235653356543565535656356573565835659356603566135662356633566435665356663566735668356693567035671356723567335674356753567635677356783567935680356813568235683356843568535686356873568835689356903569135692356933569435695356963569735698356993570035701357023570335704357053570635707357083570935710357113571235713357143571535716357173571835719357203572135722357233572435725357263572735728357293573035731357323573335734357353573635737357383573935740357413574235743357443574535746357473574835749357503575135752357533575435755357563575735758357593576035761357623576335764357653576635767357683576935770357713577235773357743577535776357773577835779357803578135782357833578435785357863578735788357893579035791357923579335794357953579635797357983579935800358013580235803358043580535806358073580835809358103581135812358133581435815358163581735818358193582035821358223582335824358253582635827358283582935830358313583235833358343583535836358373583835839358403584135842358433584435845358463584735848358493585035851358523585335854358553585635857358583585935860358613586235863358643586535866358673586835869358703587135872358733587435875358763587735878358793588035881358823588335884358853588635887358883588935890358913589235893358943589535896358973589835899359003590135902359033590435905359063590735908359093591035911359123591335914359153591635917359183591935920359213592235923359243592535926359273592835929359303593135932359333593435935359363593735938359393594035941359423594335944359453594635947359483594935950359513595235953359543595535956359573595835959359603596135962359633596435965359663596735968359693597035971359723597335974359753597635977359783597935980359813598235983359843598535986359873598835989359903599135992359933599435995359963599735998359993600036001360023600336004360053600636007360083600936010360113601236013360143601536016360173601836019360203602136022360233602436025360263602736028360293603036031360323603336034360353603636037360383603936040360413604236043360443604536046360473604836049360503605136052360533605436055360563605736058360593606036061360623606336064360653606636067360683606936070360713607236073360743607536076360773607836079360803608136082360833608436085360863608736088360893609036091360923609336094360953609636097360983609936100361013610236103361043610536106361073610836109361103611136112361133611436115361163611736118361193612036121361223612336124361253612636127361283612936130361313613236133361343613536136361373613836139361403614136142361433614436145361463614736148361493615036151361523615336154361553615636157361583615936160361613616236163361643616536166361673616836169361703617136172361733617436175361763617736178361793618036181361823618336184361853618636187361883618936190361913619236193361943619536196361973619836199362003620136202362033620436205362063620736208362093621036211362123621336214362153621636217362183621936220362213622236223362243622536226362273622836229362303623136232362333623436235362363623736238362393624036241362423624336244362453624636247362483624936250362513625236253362543625536256362573625836259362603626136262362633626436265362663626736268362693627036271362723627336274362753627636277362783627936280362813628236283362843628536286362873628836289362903629136292362933629436295362963629736298362993630036301363023630336304363053630636307363083630936310363113631236313363143631536316363173631836319363203632136322363233632436325363263632736328363293633036331363323633336334363353633636337363383633936340363413634236343363443634536346363473634836349363503635136352363533635436355363563635736358363593636036361363623636336364363653636636367363683636936370363713637236373363743637536376363773637836379363803638136382363833638436385363863638736388363893639036391363923639336394363953639636397363983639936400364013640236403364043640536406364073640836409364103641136412364133641436415364163641736418364193642036421364223642336424364253642636427364283642936430364313643236433364343643536436364373643836439364403644136442364433644436445364463644736448364493645036451364523645336454364553645636457364583645936460364613646236463364643646536466364673646836469364703647136472364733647436475364763647736478364793648036481364823648336484364853648636487364883648936490364913649236493364943649536496364973649836499365003650136502365033650436505365063650736508365093651036511365123651336514365153651636517365183651936520365213652236523365243652536526365273652836529365303653136532365333653436535365363653736538365393654036541365423654336544365453654636547365483654936550365513655236553365543655536556365573655836559365603656136562365633656436565365663656736568365693657036571365723657336574365753657636577365783657936580365813658236583365843658536586365873658836589365903659136592365933659436595365963659736598365993660036601366023660336604366053660636607366083660936610366113661236613366143661536616366173661836619366203662136622366233662436625366263662736628366293663036631366323663336634366353663636637366383663936640366413664236643366443664536646366473664836649366503665136652366533665436655366563665736658366593666036661366623666336664366653666636667366683666936670366713667236673366743667536676366773667836679366803668136682366833668436685366863668736688366893669036691366923669336694366953669636697366983669936700367013670236703367043670536706367073670836709367103671136712367133671436715367163671736718367193672036721367223672336724367253672636727367283672936730367313673236733367343673536736367373673836739367403674136742367433674436745367463674736748367493675036751367523675336754367553675636757367583675936760367613676236763367643676536766367673676836769367703677136772367733677436775367763677736778367793678036781367823678336784367853678636787367883678936790367913679236793367943679536796367973679836799368003680136802368033680436805368063680736808368093681036811368123681336814368153681636817368183681936820368213682236823368243682536826368273682836829368303683136832368333683436835368363683736838368393684036841368423684336844368453684636847368483684936850368513685236853368543685536856368573685836859368603686136862368633686436865368663686736868368693687036871368723687336874368753687636877368783687936880368813688236883368843688536886368873688836889368903689136892368933689436895368963689736898368993690036901369023690336904369053690636907369083690936910369113691236913369143691536916369173691836919369203692136922369233692436925369263692736928369293693036931369323693336934369353693636937369383693936940369413694236943369443694536946369473694836949369503695136952369533695436955369563695736958369593696036961369623696336964369653696636967369683696936970369713697236973369743697536976369773697836979369803698136982369833698436985369863698736988369893699036991369923699336994369953699636997369983699937000370013700237003370043700537006370073700837009370103701137012370133701437015370163701737018370193702037021370223702337024370253702637027370283702937030370313703237033370343703537036370373703837039370403704137042370433704437045370463704737048370493705037051370523705337054370553705637057370583705937060370613706237063370643706537066370673706837069370703707137072370733707437075370763707737078370793708037081370823708337084370853708637087370883708937090370913709237093370943709537096370973709837099371003710137102371033710437105371063710737108371093711037111371123711337114371153711637117371183711937120371213712237123371243712537126371273712837129371303713137132371333713437135371363713737138371393714037141371423714337144371453714637147371483714937150371513715237153371543715537156371573715837159371603716137162371633716437165371663716737168371693717037171371723717337174371753717637177371783717937180371813718237183371843718537186371873718837189371903719137192371933719437195371963719737198371993720037201372023720337204372053720637207372083720937210372113721237213372143721537216372173721837219372203722137222372233722437225372263722737228372293723037231372323723337234372353723637237372383723937240372413724237243372443724537246372473724837249372503725137252372533725437255372563725737258372593726037261372623726337264372653726637267372683726937270372713727237273372743727537276372773727837279372803728137282372833728437285372863728737288372893729037291372923729337294372953729637297372983729937300373013730237303373043730537306373073730837309373103731137312373133731437315373163731737318373193732037321373223732337324373253732637327373283732937330373313733237333373343733537336373373733837339373403734137342373433734437345373463734737348373493735037351373523735337354373553735637357373583735937360373613736237363373643736537366373673736837369373703737137372373733737437375373763737737378373793738037381373823738337384373853738637387373883738937390373913739237393373943739537396373973739837399374003740137402374033740437405374063740737408374093741037411374123741337414374153741637417374183741937420374213742237423374243742537426374273742837429374303743137432374333743437435374363743737438374393744037441374423744337444374453744637447374483744937450374513745237453374543745537456374573745837459374603746137462374633746437465374663746737468374693747037471374723747337474374753747637477374783747937480374813748237483374843748537486374873748837489374903749137492374933749437495374963749737498374993750037501375023750337504375053750637507375083750937510375113751237513375143751537516375173751837519375203752137522375233752437525375263752737528375293753037531375323753337534375353753637537375383753937540375413754237543375443754537546375473754837549375503755137552375533755437555375563755737558375593756037561375623756337564375653756637567375683756937570375713757237573375743757537576375773757837579375803758137582375833758437585375863758737588375893759037591375923759337594375953759637597375983759937600376013760237603376043760537606376073760837609376103761137612376133761437615376163761737618376193762037621376223762337624376253762637627376283762937630376313763237633376343763537636376373763837639376403764137642376433764437645376463764737648376493765037651376523765337654376553765637657376583765937660376613766237663376643766537666376673766837669376703767137672376733767437675376763767737678376793768037681376823768337684376853768637687376883768937690376913769237693376943769537696376973769837699377003770137702377033770437705377063770737708377093771037711377123771337714377153771637717377183771937720377213772237723377243772537726377273772837729377303773137732377333773437735377363773737738377393774037741377423774337744377453774637747377483774937750377513775237753377543775537756377573775837759377603776137762377633776437765377663776737768377693777037771377723777337774377753777637777377783777937780377813778237783377843778537786377873778837789377903779137792377933779437795377963779737798377993780037801378023780337804378053780637807378083780937810378113781237813378143781537816378173781837819378203782137822378233782437825378263782737828378293783037831378323783337834378353783637837378383783937840378413784237843378443784537846378473784837849378503785137852378533785437855378563785737858378593786037861378623786337864378653786637867378683786937870378713787237873378743787537876378773787837879378803788137882378833788437885378863788737888378893789037891378923789337894378953789637897378983789937900379013790237903379043790537906379073790837909379103791137912379133791437915379163791737918379193792037921379223792337924379253792637927379283792937930379313793237933379343793537936379373793837939379403794137942379433794437945379463794737948379493795037951379523795337954379553795637957379583795937960379613796237963379643796537966379673796837969379703797137972379733797437975379763797737978379793798037981379823798337984379853798637987379883798937990379913799237993379943799537996379973799837999380003800138002380033800438005380063800738008380093801038011380123801338014380153801638017380183801938020380213802238023380243802538026380273802838029380303803138032380333803438035380363803738038380393804038041380423804338044380453804638047380483804938050380513805238053380543805538056380573805838059380603806138062380633806438065380663806738068380693807038071380723807338074380753807638077380783807938080380813808238083380843808538086380873808838089380903809138092380933809438095380963809738098380993810038101381023810338104381053810638107381083810938110381113811238113381143811538116381173811838119381203812138122381233812438125381263812738128381293813038131381323813338134381353813638137381383813938140381413814238143381443814538146381473814838149381503815138152381533815438155381563815738158381593816038161381623816338164381653816638167381683816938170381713817238173381743817538176381773817838179381803818138182381833818438185381863818738188381893819038191381923819338194381953819638197381983819938200382013820238203382043820538206382073820838209382103821138212382133821438215382163821738218
  1. /******/ (() => { // webpackBootstrap
  2. /******/ var __webpack_modules__ = ({
  3. /***/ 7219:
  4. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  5. "use strict";
  6. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  7. if (k2 === undefined) k2 = k;
  8. var desc = Object.getOwnPropertyDescriptor(m, k);
  9. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  10. desc = { enumerable: true, get: function() { return m[k]; } };
  11. }
  12. Object.defineProperty(o, k2, desc);
  13. }) : (function(o, m, k, k2) {
  14. if (k2 === undefined) k2 = k;
  15. o[k2] = m[k];
  16. }));
  17. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  18. Object.defineProperty(o, "default", { enumerable: true, value: v });
  19. }) : function(o, v) {
  20. o["default"] = v;
  21. });
  22. var __importStar = (this && this.__importStar) || function (mod) {
  23. if (mod && mod.__esModule) return mod;
  24. var result = {};
  25. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  26. __setModuleDefault(result, mod);
  27. return result;
  28. };
  29. Object.defineProperty(exports, "__esModule", ({ value: true }));
  30. exports.directoryExistsSync = directoryExistsSync;
  31. exports.existsSync = existsSync;
  32. exports.fileExistsSync = fileExistsSync;
  33. const fs = __importStar(__nccwpck_require__(7147));
  34. function directoryExistsSync(path, required) {
  35. var _a;
  36. if (!path) {
  37. throw new Error("Arg 'path' must not be empty");
  38. }
  39. let stats;
  40. try {
  41. stats = fs.statSync(path);
  42. }
  43. catch (error) {
  44. if ((error === null || error === void 0 ? void 0 : error.code) === 'ENOENT') {
  45. if (!required) {
  46. return false;
  47. }
  48. throw new Error(`Directory '${path}' does not exist`);
  49. }
  50. throw new Error(`Encountered an error when checking whether path '${path}' exists: ${(_a = error === null || error === void 0 ? void 0 : error.message) !== null && _a !== void 0 ? _a : error}`);
  51. }
  52. if (stats.isDirectory()) {
  53. return true;
  54. }
  55. else if (!required) {
  56. return false;
  57. }
  58. throw new Error(`Directory '${path}' does not exist`);
  59. }
  60. function existsSync(path) {
  61. var _a;
  62. if (!path) {
  63. throw new Error("Arg 'path' must not be empty");
  64. }
  65. try {
  66. fs.statSync(path);
  67. }
  68. catch (error) {
  69. if ((error === null || error === void 0 ? void 0 : error.code) === 'ENOENT') {
  70. return false;
  71. }
  72. throw new Error(`Encountered an error when checking whether path '${path}' exists: ${(_a = error === null || error === void 0 ? void 0 : error.message) !== null && _a !== void 0 ? _a : error}`);
  73. }
  74. return true;
  75. }
  76. function fileExistsSync(path) {
  77. var _a;
  78. if (!path) {
  79. throw new Error("Arg 'path' must not be empty");
  80. }
  81. let stats;
  82. try {
  83. stats = fs.statSync(path);
  84. }
  85. catch (error) {
  86. if ((error === null || error === void 0 ? void 0 : error.code) === 'ENOENT') {
  87. return false;
  88. }
  89. throw new Error(`Encountered an error when checking whether path '${path}' exists: ${(_a = error === null || error === void 0 ? void 0 : error.message) !== null && _a !== void 0 ? _a : error}`);
  90. }
  91. if (!stats.isDirectory()) {
  92. return true;
  93. }
  94. return false;
  95. }
  96. /***/ }),
  97. /***/ 2565:
  98. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  99. "use strict";
  100. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  101. if (k2 === undefined) k2 = k;
  102. var desc = Object.getOwnPropertyDescriptor(m, k);
  103. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  104. desc = { enumerable: true, get: function() { return m[k]; } };
  105. }
  106. Object.defineProperty(o, k2, desc);
  107. }) : (function(o, m, k, k2) {
  108. if (k2 === undefined) k2 = k;
  109. o[k2] = m[k];
  110. }));
  111. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  112. Object.defineProperty(o, "default", { enumerable: true, value: v });
  113. }) : function(o, v) {
  114. o["default"] = v;
  115. });
  116. var __importStar = (this && this.__importStar) || function (mod) {
  117. if (mod && mod.__esModule) return mod;
  118. var result = {};
  119. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  120. __setModuleDefault(result, mod);
  121. return result;
  122. };
  123. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  124. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  125. return new (P || (P = Promise))(function (resolve, reject) {
  126. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  127. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  128. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  129. step((generator = generator.apply(thisArg, _arguments || [])).next());
  130. });
  131. };
  132. Object.defineProperty(exports, "__esModule", ({ value: true }));
  133. exports.createAuthHelper = createAuthHelper;
  134. const assert = __importStar(__nccwpck_require__(9491));
  135. const core = __importStar(__nccwpck_require__(2186));
  136. const exec = __importStar(__nccwpck_require__(1514));
  137. const fs = __importStar(__nccwpck_require__(7147));
  138. const io = __importStar(__nccwpck_require__(7436));
  139. const os = __importStar(__nccwpck_require__(2037));
  140. const path = __importStar(__nccwpck_require__(1017));
  141. const regexpHelper = __importStar(__nccwpck_require__(3120));
  142. const stateHelper = __importStar(__nccwpck_require__(4866));
  143. const urlHelper = __importStar(__nccwpck_require__(9437));
  144. const uuid_1 = __nccwpck_require__(5840);
  145. const IS_WINDOWS = process.platform === 'win32';
  146. const SSH_COMMAND_KEY = 'core.sshCommand';
  147. function createAuthHelper(git, settings) {
  148. return new GitAuthHelper(git, settings);
  149. }
  150. class GitAuthHelper {
  151. constructor(gitCommandManager, gitSourceSettings) {
  152. this.insteadOfValues = [];
  153. this.sshCommand = '';
  154. this.sshKeyPath = '';
  155. this.sshKnownHostsPath = '';
  156. this.temporaryHomePath = '';
  157. this.git = gitCommandManager;
  158. this.settings = gitSourceSettings || {};
  159. // Token auth header
  160. const serverUrl = urlHelper.getServerUrl(this.settings.githubServerUrl);
  161. this.tokenConfigKey = `http.${serverUrl.origin}/.extraheader`; // "origin" is SCHEME://HOSTNAME[:PORT]
  162. const basicCredential = Buffer.from(`x-access-token:${this.settings.authToken}`, 'utf8').toString('base64');
  163. core.setSecret(basicCredential);
  164. this.tokenPlaceholderConfigValue = `AUTHORIZATION: basic ***`;
  165. this.tokenConfigValue = `AUTHORIZATION: basic ${basicCredential}`;
  166. // Instead of SSH URL
  167. this.insteadOfKey = `url.${serverUrl.origin}/.insteadOf`; // "origin" is SCHEME://HOSTNAME[:PORT]
  168. this.insteadOfValues.push(`git@${serverUrl.hostname}:`);
  169. if (this.settings.workflowOrganizationId) {
  170. this.insteadOfValues.push(`org-${this.settings.workflowOrganizationId}@github.com:`);
  171. }
  172. }
  173. configureAuth() {
  174. return __awaiter(this, void 0, void 0, function* () {
  175. // Remove possible previous values
  176. yield this.removeAuth();
  177. // Configure new values
  178. yield this.configureSsh();
  179. yield this.configureToken();
  180. });
  181. }
  182. configureTempGlobalConfig() {
  183. return __awaiter(this, void 0, void 0, function* () {
  184. var _a;
  185. // Already setup global config
  186. if (((_a = this.temporaryHomePath) === null || _a === void 0 ? void 0 : _a.length) > 0) {
  187. return path.join(this.temporaryHomePath, '.gitconfig');
  188. }
  189. // Create a temp home directory
  190. const runnerTemp = process.env['RUNNER_TEMP'] || '';
  191. assert.ok(runnerTemp, 'RUNNER_TEMP is not defined');
  192. const uniqueId = (0, uuid_1.v4)();
  193. this.temporaryHomePath = path.join(runnerTemp, uniqueId);
  194. yield fs.promises.mkdir(this.temporaryHomePath, { recursive: true });
  195. // Copy the global git config
  196. const gitConfigPath = path.join(process.env['HOME'] || os.homedir(), '.gitconfig');
  197. const newGitConfigPath = path.join(this.temporaryHomePath, '.gitconfig');
  198. let configExists = false;
  199. try {
  200. yield fs.promises.stat(gitConfigPath);
  201. configExists = true;
  202. }
  203. catch (err) {
  204. if ((err === null || err === void 0 ? void 0 : err.code) !== 'ENOENT') {
  205. throw err;
  206. }
  207. }
  208. if (configExists) {
  209. core.info(`Copying '${gitConfigPath}' to '${newGitConfigPath}'`);
  210. yield io.cp(gitConfigPath, newGitConfigPath);
  211. }
  212. else {
  213. yield fs.promises.writeFile(newGitConfigPath, '');
  214. }
  215. // Override HOME
  216. core.info(`Temporarily overriding HOME='${this.temporaryHomePath}' before making global git config changes`);
  217. this.git.setEnvironmentVariable('HOME', this.temporaryHomePath);
  218. return newGitConfigPath;
  219. });
  220. }
  221. configureGlobalAuth() {
  222. return __awaiter(this, void 0, void 0, function* () {
  223. // 'configureTempGlobalConfig' noops if already set, just returns the path
  224. const newGitConfigPath = yield this.configureTempGlobalConfig();
  225. try {
  226. // Configure the token
  227. yield this.configureToken(newGitConfigPath, true);
  228. // Configure HTTPS instead of SSH
  229. yield this.git.tryConfigUnset(this.insteadOfKey, true);
  230. if (!this.settings.sshKey) {
  231. for (const insteadOfValue of this.insteadOfValues) {
  232. yield this.git.config(this.insteadOfKey, insteadOfValue, true, true);
  233. }
  234. }
  235. }
  236. catch (err) {
  237. // Unset in case somehow written to the real global config
  238. core.info('Encountered an error when attempting to configure token. Attempting unconfigure.');
  239. yield this.git.tryConfigUnset(this.tokenConfigKey, true);
  240. throw err;
  241. }
  242. });
  243. }
  244. configureSubmoduleAuth() {
  245. return __awaiter(this, void 0, void 0, function* () {
  246. // Remove possible previous HTTPS instead of SSH
  247. yield this.removeGitConfig(this.insteadOfKey, true);
  248. if (this.settings.persistCredentials) {
  249. // Configure a placeholder value. This approach avoids the credential being captured
  250. // by process creation audit events, which are commonly logged. For more information,
  251. // refer to https://docs.microsoft.com/en-us/windows-server/identity/ad-ds/manage/component-updates/command-line-process-auditing
  252. const output = yield this.git.submoduleForeach(
  253. // wrap the pipeline in quotes to make sure it's handled properly by submoduleForeach, rather than just the first part of the pipeline
  254. `sh -c "git config --local '${this.tokenConfigKey}' '${this.tokenPlaceholderConfigValue}' && git config --local --show-origin --name-only --get-regexp remote.origin.url"`, this.settings.nestedSubmodules);
  255. // Replace the placeholder
  256. const configPaths = output.match(/(?<=(^|\n)file:)[^\t]+(?=\tremote\.origin\.url)/g) || [];
  257. for (const configPath of configPaths) {
  258. core.debug(`Replacing token placeholder in '${configPath}'`);
  259. yield this.replaceTokenPlaceholder(configPath);
  260. }
  261. if (this.settings.sshKey) {
  262. // Configure core.sshCommand
  263. yield this.git.submoduleForeach(`git config --local '${SSH_COMMAND_KEY}' '${this.sshCommand}'`, this.settings.nestedSubmodules);
  264. }
  265. else {
  266. // Configure HTTPS instead of SSH
  267. for (const insteadOfValue of this.insteadOfValues) {
  268. yield this.git.submoduleForeach(`git config --local --add '${this.insteadOfKey}' '${insteadOfValue}'`, this.settings.nestedSubmodules);
  269. }
  270. }
  271. }
  272. });
  273. }
  274. removeAuth() {
  275. return __awaiter(this, void 0, void 0, function* () {
  276. yield this.removeSsh();
  277. yield this.removeToken();
  278. });
  279. }
  280. removeGlobalConfig() {
  281. return __awaiter(this, void 0, void 0, function* () {
  282. var _a;
  283. if (((_a = this.temporaryHomePath) === null || _a === void 0 ? void 0 : _a.length) > 0) {
  284. core.debug(`Unsetting HOME override`);
  285. this.git.removeEnvironmentVariable('HOME');
  286. yield io.rmRF(this.temporaryHomePath);
  287. }
  288. });
  289. }
  290. configureSsh() {
  291. return __awaiter(this, void 0, void 0, function* () {
  292. if (!this.settings.sshKey) {
  293. return;
  294. }
  295. // Write key
  296. const runnerTemp = process.env['RUNNER_TEMP'] || '';
  297. assert.ok(runnerTemp, 'RUNNER_TEMP is not defined');
  298. const uniqueId = (0, uuid_1.v4)();
  299. this.sshKeyPath = path.join(runnerTemp, uniqueId);
  300. stateHelper.setSshKeyPath(this.sshKeyPath);
  301. yield fs.promises.mkdir(runnerTemp, { recursive: true });
  302. yield fs.promises.writeFile(this.sshKeyPath, this.settings.sshKey.trim() + '\n', { mode: 0o600 });
  303. // Remove inherited permissions on Windows
  304. if (IS_WINDOWS) {
  305. const icacls = yield io.which('icacls.exe');
  306. yield exec.exec(`"${icacls}" "${this.sshKeyPath}" /grant:r "${process.env['USERDOMAIN']}\\${process.env['USERNAME']}:F"`);
  307. yield exec.exec(`"${icacls}" "${this.sshKeyPath}" /inheritance:r`);
  308. }
  309. // Write known hosts
  310. const userKnownHostsPath = path.join(os.homedir(), '.ssh', 'known_hosts');
  311. let userKnownHosts = '';
  312. try {
  313. userKnownHosts = (yield fs.promises.readFile(userKnownHostsPath)).toString();
  314. }
  315. catch (err) {
  316. if ((err === null || err === void 0 ? void 0 : err.code) !== 'ENOENT') {
  317. throw err;
  318. }
  319. }
  320. let knownHosts = '';
  321. if (userKnownHosts) {
  322. knownHosts += `# Begin from ${userKnownHostsPath}\n${userKnownHosts}\n# End from ${userKnownHostsPath}\n`;
  323. }
  324. if (this.settings.sshKnownHosts) {
  325. knownHosts += `# Begin from input known hosts\n${this.settings.sshKnownHosts}\n# end from input known hosts\n`;
  326. }
  327. knownHosts += `# Begin implicitly added github.com\ngithub.com ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCj7ndNxQowgcQnjshcLrqPEiiphnt+VTTvDP6mHBL9j1aNUkY4Ue1gvwnGLVlOhGeYrnZaMgRK6+PKCUXaDbC7qtbW8gIkhL7aGCsOr/C56SJMy/BCZfxd1nWzAOxSDPgVsmerOBYfNqltV9/hWCqBywINIR+5dIg6JTJ72pcEpEjcYgXkE2YEFXV1JHnsKgbLWNlhScqb2UmyRkQyytRLtL+38TGxkxCflmO+5Z8CSSNY7GidjMIZ7Q4zMjA2n1nGrlTDkzwDCsw+wqFPGQA179cnfGWOWRVruj16z6XyvxvjJwbz0wQZ75XK5tKSb7FNyeIEs4TT4jk+S4dhPeAUC5y+bDYirYgM4GC7uEnztnZyaVWQ7B381AK4Qdrwt51ZqExKbQpTUNn+EjqoTwvqNj4kqx5QUCI0ThS/YkOxJCXmPUWZbhjpCg56i+2aB6CmK2JGhn57K5mj0MNdBXA4/WnwH6XoPWJzK5Nyu2zB3nAZp+S5hpQs+p1vN1/wsjk=\n# End implicitly added github.com\n`;
  328. this.sshKnownHostsPath = path.join(runnerTemp, `${uniqueId}_known_hosts`);
  329. stateHelper.setSshKnownHostsPath(this.sshKnownHostsPath);
  330. yield fs.promises.writeFile(this.sshKnownHostsPath, knownHosts);
  331. // Configure GIT_SSH_COMMAND
  332. const sshPath = yield io.which('ssh', true);
  333. this.sshCommand = `"${sshPath}" -i "$RUNNER_TEMP/${path.basename(this.sshKeyPath)}"`;
  334. if (this.settings.sshStrict) {
  335. this.sshCommand += ' -o StrictHostKeyChecking=yes -o CheckHostIP=no';
  336. }
  337. this.sshCommand += ` -o "UserKnownHostsFile=$RUNNER_TEMP/${path.basename(this.sshKnownHostsPath)}"`;
  338. core.info(`Temporarily overriding GIT_SSH_COMMAND=${this.sshCommand}`);
  339. this.git.setEnvironmentVariable('GIT_SSH_COMMAND', this.sshCommand);
  340. // Configure core.sshCommand
  341. if (this.settings.persistCredentials) {
  342. yield this.git.config(SSH_COMMAND_KEY, this.sshCommand);
  343. }
  344. });
  345. }
  346. configureToken(configPath, globalConfig) {
  347. return __awaiter(this, void 0, void 0, function* () {
  348. // Validate args
  349. assert.ok((configPath && globalConfig) || (!configPath && !globalConfig), 'Unexpected configureToken parameter combinations');
  350. // Default config path
  351. if (!configPath && !globalConfig) {
  352. configPath = path.join(this.git.getWorkingDirectory(), '.git', 'config');
  353. }
  354. // Configure a placeholder value. This approach avoids the credential being captured
  355. // by process creation audit events, which are commonly logged. For more information,
  356. // refer to https://docs.microsoft.com/en-us/windows-server/identity/ad-ds/manage/component-updates/command-line-process-auditing
  357. yield this.git.config(this.tokenConfigKey, this.tokenPlaceholderConfigValue, globalConfig);
  358. // Replace the placeholder
  359. yield this.replaceTokenPlaceholder(configPath || '');
  360. });
  361. }
  362. replaceTokenPlaceholder(configPath) {
  363. return __awaiter(this, void 0, void 0, function* () {
  364. assert.ok(configPath, 'configPath is not defined');
  365. let content = (yield fs.promises.readFile(configPath)).toString();
  366. const placeholderIndex = content.indexOf(this.tokenPlaceholderConfigValue);
  367. if (placeholderIndex < 0 ||
  368. placeholderIndex != content.lastIndexOf(this.tokenPlaceholderConfigValue)) {
  369. throw new Error(`Unable to replace auth placeholder in ${configPath}`);
  370. }
  371. assert.ok(this.tokenConfigValue, 'tokenConfigValue is not defined');
  372. content = content.replace(this.tokenPlaceholderConfigValue, this.tokenConfigValue);
  373. yield fs.promises.writeFile(configPath, content);
  374. });
  375. }
  376. removeSsh() {
  377. return __awaiter(this, void 0, void 0, function* () {
  378. var _a;
  379. // SSH key
  380. const keyPath = this.sshKeyPath || stateHelper.SshKeyPath;
  381. if (keyPath) {
  382. try {
  383. yield io.rmRF(keyPath);
  384. }
  385. catch (err) {
  386. core.debug(`${(_a = err === null || err === void 0 ? void 0 : err.message) !== null && _a !== void 0 ? _a : err}`);
  387. core.warning(`Failed to remove SSH key '${keyPath}'`);
  388. }
  389. }
  390. // SSH known hosts
  391. const knownHostsPath = this.sshKnownHostsPath || stateHelper.SshKnownHostsPath;
  392. if (knownHostsPath) {
  393. try {
  394. yield io.rmRF(knownHostsPath);
  395. }
  396. catch (_b) {
  397. // Intentionally empty
  398. }
  399. }
  400. // SSH command
  401. yield this.removeGitConfig(SSH_COMMAND_KEY);
  402. });
  403. }
  404. removeToken() {
  405. return __awaiter(this, void 0, void 0, function* () {
  406. // HTTP extra header
  407. yield this.removeGitConfig(this.tokenConfigKey);
  408. });
  409. }
  410. removeGitConfig(configKey_1) {
  411. return __awaiter(this, arguments, void 0, function* (configKey, submoduleOnly = false) {
  412. if (!submoduleOnly) {
  413. if ((yield this.git.configExists(configKey)) &&
  414. !(yield this.git.tryConfigUnset(configKey))) {
  415. // Load the config contents
  416. core.warning(`Failed to remove '${configKey}' from the git config`);
  417. }
  418. }
  419. const pattern = regexpHelper.escape(configKey);
  420. yield this.git.submoduleForeach(
  421. // wrap the pipeline in quotes to make sure it's handled properly by submoduleForeach, rather than just the first part of the pipeline
  422. `sh -c "git config --local --name-only --get-regexp '${pattern}' && git config --local --unset-all '${configKey}' || :"`, true);
  423. });
  424. }
  425. }
  426. /***/ }),
  427. /***/ 738:
  428. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  429. "use strict";
  430. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  431. if (k2 === undefined) k2 = k;
  432. var desc = Object.getOwnPropertyDescriptor(m, k);
  433. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  434. desc = { enumerable: true, get: function() { return m[k]; } };
  435. }
  436. Object.defineProperty(o, k2, desc);
  437. }) : (function(o, m, k, k2) {
  438. if (k2 === undefined) k2 = k;
  439. o[k2] = m[k];
  440. }));
  441. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  442. Object.defineProperty(o, "default", { enumerable: true, value: v });
  443. }) : function(o, v) {
  444. o["default"] = v;
  445. });
  446. var __importStar = (this && this.__importStar) || function (mod) {
  447. if (mod && mod.__esModule) return mod;
  448. var result = {};
  449. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  450. __setModuleDefault(result, mod);
  451. return result;
  452. };
  453. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  454. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  455. return new (P || (P = Promise))(function (resolve, reject) {
  456. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  457. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  458. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  459. step((generator = generator.apply(thisArg, _arguments || [])).next());
  460. });
  461. };
  462. Object.defineProperty(exports, "__esModule", ({ value: true }));
  463. exports.MinimumGitSparseCheckoutVersion = exports.MinimumGitVersion = void 0;
  464. exports.createCommandManager = createCommandManager;
  465. const core = __importStar(__nccwpck_require__(2186));
  466. const exec = __importStar(__nccwpck_require__(1514));
  467. const fs = __importStar(__nccwpck_require__(7147));
  468. const fshelper = __importStar(__nccwpck_require__(7219));
  469. const io = __importStar(__nccwpck_require__(7436));
  470. const path = __importStar(__nccwpck_require__(1017));
  471. const refHelper = __importStar(__nccwpck_require__(8601));
  472. const regexpHelper = __importStar(__nccwpck_require__(3120));
  473. const retryHelper = __importStar(__nccwpck_require__(2155));
  474. const git_version_1 = __nccwpck_require__(3142);
  475. // Auth header not supported before 2.9
  476. // Wire protocol v2 not supported before 2.18
  477. // sparse-checkout not [well-]supported before 2.28 (see https://github.com/actions/checkout/issues/1386)
  478. exports.MinimumGitVersion = new git_version_1.GitVersion('2.18');
  479. exports.MinimumGitSparseCheckoutVersion = new git_version_1.GitVersion('2.28');
  480. function createCommandManager(workingDirectory, lfs, doSparseCheckout) {
  481. return __awaiter(this, void 0, void 0, function* () {
  482. return yield GitCommandManager.createCommandManager(workingDirectory, lfs, doSparseCheckout);
  483. });
  484. }
  485. class GitCommandManager {
  486. // Private constructor; use createCommandManager()
  487. constructor() {
  488. this.gitEnv = {
  489. GIT_TERMINAL_PROMPT: '0', // Disable git prompt
  490. GCM_INTERACTIVE: 'Never' // Disable prompting for git credential manager
  491. };
  492. this.gitPath = '';
  493. this.lfs = false;
  494. this.doSparseCheckout = false;
  495. this.workingDirectory = '';
  496. this.gitVersion = new git_version_1.GitVersion();
  497. }
  498. branchDelete(remote, branch) {
  499. return __awaiter(this, void 0, void 0, function* () {
  500. const args = ['branch', '--delete', '--force'];
  501. if (remote) {
  502. args.push('--remote');
  503. }
  504. args.push(branch);
  505. yield this.execGit(args);
  506. });
  507. }
  508. branchExists(remote, pattern) {
  509. return __awaiter(this, void 0, void 0, function* () {
  510. const args = ['branch', '--list'];
  511. if (remote) {
  512. args.push('--remote');
  513. }
  514. args.push(pattern);
  515. const output = yield this.execGit(args);
  516. return !!output.stdout.trim();
  517. });
  518. }
  519. branchList(remote) {
  520. return __awaiter(this, void 0, void 0, function* () {
  521. const result = [];
  522. // Note, this implementation uses "rev-parse --symbolic-full-name" because the output from
  523. // "branch --list" is more difficult when in a detached HEAD state.
  524. // TODO(https://github.com/actions/checkout/issues/786): this implementation uses
  525. // "rev-parse --symbolic-full-name" because there is a bug
  526. // in Git 2.18 that causes "rev-parse --symbolic" to output symbolic full names. When
  527. // 2.18 is no longer supported, we can switch back to --symbolic.
  528. const args = ['rev-parse', '--symbolic-full-name'];
  529. if (remote) {
  530. args.push('--remotes=origin');
  531. }
  532. else {
  533. args.push('--branches');
  534. }
  535. const stderr = [];
  536. const errline = [];
  537. const stdout = [];
  538. const stdline = [];
  539. const listeners = {
  540. stderr: (data) => {
  541. stderr.push(data.toString());
  542. },
  543. errline: (data) => {
  544. errline.push(data.toString());
  545. },
  546. stdout: (data) => {
  547. stdout.push(data.toString());
  548. },
  549. stdline: (data) => {
  550. stdline.push(data.toString());
  551. }
  552. };
  553. // Suppress the output in order to avoid flooding annotations with innocuous errors.
  554. yield this.execGit(args, false, true, listeners);
  555. core.debug(`stderr callback is: ${stderr}`);
  556. core.debug(`errline callback is: ${errline}`);
  557. core.debug(`stdout callback is: ${stdout}`);
  558. core.debug(`stdline callback is: ${stdline}`);
  559. for (let branch of stdline) {
  560. branch = branch.trim();
  561. if (!branch) {
  562. continue;
  563. }
  564. if (branch.startsWith('refs/heads/')) {
  565. branch = branch.substring('refs/heads/'.length);
  566. }
  567. else if (branch.startsWith('refs/remotes/')) {
  568. branch = branch.substring('refs/remotes/'.length);
  569. }
  570. result.push(branch);
  571. }
  572. return result;
  573. });
  574. }
  575. disableSparseCheckout() {
  576. return __awaiter(this, void 0, void 0, function* () {
  577. yield this.execGit(['sparse-checkout', 'disable']);
  578. // Disabling 'sparse-checkout` leaves behind an undesirable side-effect in config (even in a pristine environment).
  579. yield this.tryConfigUnset('extensions.worktreeConfig', false);
  580. });
  581. }
  582. sparseCheckout(sparseCheckout) {
  583. return __awaiter(this, void 0, void 0, function* () {
  584. yield this.execGit(['sparse-checkout', 'set', ...sparseCheckout]);
  585. });
  586. }
  587. sparseCheckoutNonConeMode(sparseCheckout) {
  588. return __awaiter(this, void 0, void 0, function* () {
  589. yield this.execGit(['config', 'core.sparseCheckout', 'true']);
  590. const output = yield this.execGit([
  591. 'rev-parse',
  592. '--git-path',
  593. 'info/sparse-checkout'
  594. ]);
  595. const sparseCheckoutPath = path.join(this.workingDirectory, output.stdout.trimRight());
  596. yield fs.promises.appendFile(sparseCheckoutPath, `\n${sparseCheckout.join('\n')}\n`);
  597. });
  598. }
  599. checkout(ref, startPoint) {
  600. return __awaiter(this, void 0, void 0, function* () {
  601. const args = ['checkout', '--progress', '--force'];
  602. if (startPoint) {
  603. args.push('-B', ref, startPoint);
  604. }
  605. else {
  606. args.push(ref);
  607. }
  608. yield this.execGit(args);
  609. });
  610. }
  611. checkoutDetach() {
  612. return __awaiter(this, void 0, void 0, function* () {
  613. const args = ['checkout', '--detach'];
  614. yield this.execGit(args);
  615. });
  616. }
  617. config(configKey, configValue, globalConfig, add) {
  618. return __awaiter(this, void 0, void 0, function* () {
  619. const args = ['config', globalConfig ? '--global' : '--local'];
  620. if (add) {
  621. args.push('--add');
  622. }
  623. args.push(...[configKey, configValue]);
  624. yield this.execGit(args);
  625. });
  626. }
  627. configExists(configKey, globalConfig) {
  628. return __awaiter(this, void 0, void 0, function* () {
  629. const pattern = regexpHelper.escape(configKey);
  630. const output = yield this.execGit([
  631. 'config',
  632. globalConfig ? '--global' : '--local',
  633. '--name-only',
  634. '--get-regexp',
  635. pattern
  636. ], true);
  637. return output.exitCode === 0;
  638. });
  639. }
  640. fetch(refSpec, options) {
  641. return __awaiter(this, void 0, void 0, function* () {
  642. const args = ['-c', 'protocol.version=2', 'fetch'];
  643. if (!refSpec.some(x => x === refHelper.tagsRefSpec) && !options.fetchTags) {
  644. args.push('--no-tags');
  645. }
  646. args.push('--prune', '--no-recurse-submodules');
  647. if (options.showProgress) {
  648. args.push('--progress');
  649. }
  650. if (options.filter) {
  651. args.push(`--filter=${options.filter}`);
  652. }
  653. if (options.fetchDepth && options.fetchDepth > 0) {
  654. args.push(`--depth=${options.fetchDepth}`);
  655. }
  656. else if (fshelper.fileExistsSync(path.join(this.workingDirectory, '.git', 'shallow'))) {
  657. args.push('--unshallow');
  658. }
  659. args.push('origin');
  660. for (const arg of refSpec) {
  661. args.push(arg);
  662. }
  663. const that = this;
  664. yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  665. yield that.execGit(args);
  666. }));
  667. });
  668. }
  669. getDefaultBranch(repositoryUrl) {
  670. return __awaiter(this, void 0, void 0, function* () {
  671. let output;
  672. yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  673. output = yield this.execGit([
  674. 'ls-remote',
  675. '--quiet',
  676. '--exit-code',
  677. '--symref',
  678. repositoryUrl,
  679. 'HEAD'
  680. ]);
  681. }));
  682. if (output) {
  683. // Satisfy compiler, will always be set
  684. for (let line of output.stdout.trim().split('\n')) {
  685. line = line.trim();
  686. if (line.startsWith('ref:') || line.endsWith('HEAD')) {
  687. return line
  688. .substr('ref:'.length, line.length - 'ref:'.length - 'HEAD'.length)
  689. .trim();
  690. }
  691. }
  692. }
  693. throw new Error('Unexpected output when retrieving default branch');
  694. });
  695. }
  696. getWorkingDirectory() {
  697. return this.workingDirectory;
  698. }
  699. init() {
  700. return __awaiter(this, void 0, void 0, function* () {
  701. yield this.execGit(['init', this.workingDirectory]);
  702. });
  703. }
  704. isDetached() {
  705. return __awaiter(this, void 0, void 0, function* () {
  706. // Note, "branch --show-current" would be simpler but isn't available until Git 2.22
  707. const output = yield this.execGit(['rev-parse', '--symbolic-full-name', '--verify', '--quiet', 'HEAD'], true);
  708. return !output.stdout.trim().startsWith('refs/heads/');
  709. });
  710. }
  711. lfsFetch(ref) {
  712. return __awaiter(this, void 0, void 0, function* () {
  713. const args = ['lfs', 'fetch', 'origin', ref];
  714. const that = this;
  715. yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  716. yield that.execGit(args);
  717. }));
  718. });
  719. }
  720. lfsInstall() {
  721. return __awaiter(this, void 0, void 0, function* () {
  722. yield this.execGit(['lfs', 'install', '--local']);
  723. });
  724. }
  725. log1(format) {
  726. return __awaiter(this, void 0, void 0, function* () {
  727. const args = format ? ['log', '-1', format] : ['log', '-1'];
  728. const silent = format ? false : true;
  729. const output = yield this.execGit(args, false, silent);
  730. return output.stdout;
  731. });
  732. }
  733. remoteAdd(remoteName, remoteUrl) {
  734. return __awaiter(this, void 0, void 0, function* () {
  735. yield this.execGit(['remote', 'add', remoteName, remoteUrl]);
  736. });
  737. }
  738. removeEnvironmentVariable(name) {
  739. delete this.gitEnv[name];
  740. }
  741. /**
  742. * Resolves a ref to a SHA. For a branch or lightweight tag, the commit SHA is returned.
  743. * For an annotated tag, the tag SHA is returned.
  744. * @param {string} ref For example: 'refs/heads/main' or '/refs/tags/v1'
  745. * @returns {Promise<string>}
  746. */
  747. revParse(ref) {
  748. return __awaiter(this, void 0, void 0, function* () {
  749. const output = yield this.execGit(['rev-parse', ref]);
  750. return output.stdout.trim();
  751. });
  752. }
  753. setEnvironmentVariable(name, value) {
  754. this.gitEnv[name] = value;
  755. }
  756. shaExists(sha) {
  757. return __awaiter(this, void 0, void 0, function* () {
  758. const args = ['rev-parse', '--verify', '--quiet', `${sha}^{object}`];
  759. const output = yield this.execGit(args, true);
  760. return output.exitCode === 0;
  761. });
  762. }
  763. submoduleForeach(command, recursive) {
  764. return __awaiter(this, void 0, void 0, function* () {
  765. const args = ['submodule', 'foreach'];
  766. if (recursive) {
  767. args.push('--recursive');
  768. }
  769. args.push(command);
  770. const output = yield this.execGit(args);
  771. return output.stdout;
  772. });
  773. }
  774. submoduleSync(recursive) {
  775. return __awaiter(this, void 0, void 0, function* () {
  776. const args = ['submodule', 'sync'];
  777. if (recursive) {
  778. args.push('--recursive');
  779. }
  780. yield this.execGit(args);
  781. });
  782. }
  783. submoduleUpdate(fetchDepth, recursive) {
  784. return __awaiter(this, void 0, void 0, function* () {
  785. const args = ['-c', 'protocol.version=2'];
  786. args.push('submodule', 'update', '--init', '--force');
  787. if (fetchDepth > 0) {
  788. args.push(`--depth=${fetchDepth}`);
  789. }
  790. if (recursive) {
  791. args.push('--recursive');
  792. }
  793. yield this.execGit(args);
  794. });
  795. }
  796. submoduleStatus() {
  797. return __awaiter(this, void 0, void 0, function* () {
  798. const output = yield this.execGit(['submodule', 'status'], true);
  799. core.debug(output.stdout);
  800. return output.exitCode === 0;
  801. });
  802. }
  803. tagExists(pattern) {
  804. return __awaiter(this, void 0, void 0, function* () {
  805. const output = yield this.execGit(['tag', '--list', pattern]);
  806. return !!output.stdout.trim();
  807. });
  808. }
  809. tryClean() {
  810. return __awaiter(this, void 0, void 0, function* () {
  811. const output = yield this.execGit(['clean', '-ffdx'], true);
  812. return output.exitCode === 0;
  813. });
  814. }
  815. tryConfigUnset(configKey, globalConfig) {
  816. return __awaiter(this, void 0, void 0, function* () {
  817. const output = yield this.execGit([
  818. 'config',
  819. globalConfig ? '--global' : '--local',
  820. '--unset-all',
  821. configKey
  822. ], true);
  823. return output.exitCode === 0;
  824. });
  825. }
  826. tryDisableAutomaticGarbageCollection() {
  827. return __awaiter(this, void 0, void 0, function* () {
  828. const output = yield this.execGit(['config', '--local', 'gc.auto', '0'], true);
  829. return output.exitCode === 0;
  830. });
  831. }
  832. tryGetFetchUrl() {
  833. return __awaiter(this, void 0, void 0, function* () {
  834. const output = yield this.execGit(['config', '--local', '--get', 'remote.origin.url'], true);
  835. if (output.exitCode !== 0) {
  836. return '';
  837. }
  838. const stdout = output.stdout.trim();
  839. if (stdout.includes('\n')) {
  840. return '';
  841. }
  842. return stdout;
  843. });
  844. }
  845. tryReset() {
  846. return __awaiter(this, void 0, void 0, function* () {
  847. const output = yield this.execGit(['reset', '--hard', 'HEAD'], true);
  848. return output.exitCode === 0;
  849. });
  850. }
  851. version() {
  852. return __awaiter(this, void 0, void 0, function* () {
  853. return this.gitVersion;
  854. });
  855. }
  856. static createCommandManager(workingDirectory, lfs, doSparseCheckout) {
  857. return __awaiter(this, void 0, void 0, function* () {
  858. const result = new GitCommandManager();
  859. yield result.initializeCommandManager(workingDirectory, lfs, doSparseCheckout);
  860. return result;
  861. });
  862. }
  863. execGit(args_1) {
  864. return __awaiter(this, arguments, void 0, function* (args, allowAllExitCodes = false, silent = false, customListeners = {}) {
  865. fshelper.directoryExistsSync(this.workingDirectory, true);
  866. const result = new GitOutput();
  867. const env = {};
  868. for (const key of Object.keys(process.env)) {
  869. env[key] = process.env[key];
  870. }
  871. for (const key of Object.keys(this.gitEnv)) {
  872. env[key] = this.gitEnv[key];
  873. }
  874. const defaultListener = {
  875. stdout: (data) => {
  876. stdout.push(data.toString());
  877. }
  878. };
  879. const mergedListeners = Object.assign(Object.assign({}, defaultListener), customListeners);
  880. const stdout = [];
  881. const options = {
  882. cwd: this.workingDirectory,
  883. env,
  884. silent,
  885. ignoreReturnCode: allowAllExitCodes,
  886. listeners: mergedListeners
  887. };
  888. result.exitCode = yield exec.exec(`"${this.gitPath}"`, args, options);
  889. result.stdout = stdout.join('');
  890. core.debug(result.exitCode.toString());
  891. core.debug(result.stdout);
  892. return result;
  893. });
  894. }
  895. initializeCommandManager(workingDirectory, lfs, doSparseCheckout) {
  896. return __awaiter(this, void 0, void 0, function* () {
  897. this.workingDirectory = workingDirectory;
  898. // Git-lfs will try to pull down assets if any of the local/user/system setting exist.
  899. // If the user didn't enable `LFS` in their pipeline definition, disable LFS fetch/checkout.
  900. this.lfs = lfs;
  901. if (!this.lfs) {
  902. this.gitEnv['GIT_LFS_SKIP_SMUDGE'] = '1';
  903. }
  904. this.gitPath = yield io.which('git', true);
  905. // Git version
  906. core.debug('Getting git version');
  907. this.gitVersion = new git_version_1.GitVersion();
  908. let gitOutput = yield this.execGit(['version']);
  909. let stdout = gitOutput.stdout.trim();
  910. if (!stdout.includes('\n')) {
  911. const match = stdout.match(/\d+\.\d+(\.\d+)?/);
  912. if (match) {
  913. this.gitVersion = new git_version_1.GitVersion(match[0]);
  914. }
  915. }
  916. if (!this.gitVersion.isValid()) {
  917. throw new Error('Unable to determine git version');
  918. }
  919. // Minimum git version
  920. if (!this.gitVersion.checkMinimum(exports.MinimumGitVersion)) {
  921. throw new Error(`Minimum required git version is ${exports.MinimumGitVersion}. Your git ('${this.gitPath}') is ${this.gitVersion}`);
  922. }
  923. if (this.lfs) {
  924. // Git-lfs version
  925. core.debug('Getting git-lfs version');
  926. let gitLfsVersion = new git_version_1.GitVersion();
  927. const gitLfsPath = yield io.which('git-lfs', true);
  928. gitOutput = yield this.execGit(['lfs', 'version']);
  929. stdout = gitOutput.stdout.trim();
  930. if (!stdout.includes('\n')) {
  931. const match = stdout.match(/\d+\.\d+(\.\d+)?/);
  932. if (match) {
  933. gitLfsVersion = new git_version_1.GitVersion(match[0]);
  934. }
  935. }
  936. if (!gitLfsVersion.isValid()) {
  937. throw new Error('Unable to determine git-lfs version');
  938. }
  939. // Minimum git-lfs version
  940. // Note:
  941. // - Auth header not supported before 2.1
  942. const minimumGitLfsVersion = new git_version_1.GitVersion('2.1');
  943. if (!gitLfsVersion.checkMinimum(minimumGitLfsVersion)) {
  944. throw new Error(`Minimum required git-lfs version is ${minimumGitLfsVersion}. Your git-lfs ('${gitLfsPath}') is ${gitLfsVersion}`);
  945. }
  946. }
  947. this.doSparseCheckout = doSparseCheckout;
  948. if (this.doSparseCheckout) {
  949. if (!this.gitVersion.checkMinimum(exports.MinimumGitSparseCheckoutVersion)) {
  950. throw new Error(`Minimum Git version required for sparse checkout is ${exports.MinimumGitSparseCheckoutVersion}. Your git ('${this.gitPath}') is ${this.gitVersion}`);
  951. }
  952. }
  953. // Set the user agent
  954. const gitHttpUserAgent = `git/${this.gitVersion} (github-actions-checkout)`;
  955. core.debug(`Set git useragent to: ${gitHttpUserAgent}`);
  956. this.gitEnv['GIT_HTTP_USER_AGENT'] = gitHttpUserAgent;
  957. });
  958. }
  959. }
  960. class GitOutput {
  961. constructor() {
  962. this.stdout = '';
  963. this.exitCode = 0;
  964. }
  965. }
  966. /***/ }),
  967. /***/ 8609:
  968. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  969. "use strict";
  970. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  971. if (k2 === undefined) k2 = k;
  972. var desc = Object.getOwnPropertyDescriptor(m, k);
  973. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  974. desc = { enumerable: true, get: function() { return m[k]; } };
  975. }
  976. Object.defineProperty(o, k2, desc);
  977. }) : (function(o, m, k, k2) {
  978. if (k2 === undefined) k2 = k;
  979. o[k2] = m[k];
  980. }));
  981. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  982. Object.defineProperty(o, "default", { enumerable: true, value: v });
  983. }) : function(o, v) {
  984. o["default"] = v;
  985. });
  986. var __importStar = (this && this.__importStar) || function (mod) {
  987. if (mod && mod.__esModule) return mod;
  988. var result = {};
  989. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  990. __setModuleDefault(result, mod);
  991. return result;
  992. };
  993. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  994. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  995. return new (P || (P = Promise))(function (resolve, reject) {
  996. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  997. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  998. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  999. step((generator = generator.apply(thisArg, _arguments || [])).next());
  1000. });
  1001. };
  1002. Object.defineProperty(exports, "__esModule", ({ value: true }));
  1003. exports.prepareExistingDirectory = prepareExistingDirectory;
  1004. const assert = __importStar(__nccwpck_require__(9491));
  1005. const core = __importStar(__nccwpck_require__(2186));
  1006. const fs = __importStar(__nccwpck_require__(7147));
  1007. const fsHelper = __importStar(__nccwpck_require__(7219));
  1008. const io = __importStar(__nccwpck_require__(7436));
  1009. const path = __importStar(__nccwpck_require__(1017));
  1010. function prepareExistingDirectory(git, repositoryPath, repositoryUrl, clean, ref) {
  1011. return __awaiter(this, void 0, void 0, function* () {
  1012. var _a;
  1013. assert.ok(repositoryPath, 'Expected repositoryPath to be defined');
  1014. assert.ok(repositoryUrl, 'Expected repositoryUrl to be defined');
  1015. // Indicates whether to delete the directory contents
  1016. let remove = false;
  1017. // Check whether using git or REST API
  1018. if (!git) {
  1019. remove = true;
  1020. }
  1021. // Fetch URL does not match
  1022. else if (!fsHelper.directoryExistsSync(path.join(repositoryPath, '.git')) ||
  1023. repositoryUrl !== (yield git.tryGetFetchUrl())) {
  1024. remove = true;
  1025. }
  1026. else {
  1027. // Delete any index.lock and shallow.lock left by a previously canceled run or crashed git process
  1028. const lockPaths = [
  1029. path.join(repositoryPath, '.git', 'index.lock'),
  1030. path.join(repositoryPath, '.git', 'shallow.lock')
  1031. ];
  1032. for (const lockPath of lockPaths) {
  1033. try {
  1034. yield io.rmRF(lockPath);
  1035. }
  1036. catch (error) {
  1037. core.debug(`Unable to delete '${lockPath}'. ${(_a = error === null || error === void 0 ? void 0 : error.message) !== null && _a !== void 0 ? _a : error}`);
  1038. }
  1039. }
  1040. try {
  1041. core.startGroup('Removing previously created refs, to avoid conflicts');
  1042. // Checkout detached HEAD
  1043. if (!(yield git.isDetached())) {
  1044. yield git.checkoutDetach();
  1045. }
  1046. // Remove all refs/heads/*
  1047. let branches = yield git.branchList(false);
  1048. for (const branch of branches) {
  1049. yield git.branchDelete(false, branch);
  1050. }
  1051. // Remove any conflicting refs/remotes/origin/*
  1052. // Example 1: Consider ref is refs/heads/foo and previously fetched refs/remotes/origin/foo/bar
  1053. // Example 2: Consider ref is refs/heads/foo/bar and previously fetched refs/remotes/origin/foo
  1054. if (ref) {
  1055. ref = ref.startsWith('refs/') ? ref : `refs/heads/${ref}`;
  1056. if (ref.startsWith('refs/heads/')) {
  1057. const upperName1 = ref.toUpperCase().substr('REFS/HEADS/'.length);
  1058. const upperName1Slash = `${upperName1}/`;
  1059. branches = yield git.branchList(true);
  1060. for (const branch of branches) {
  1061. const upperName2 = branch.substr('origin/'.length).toUpperCase();
  1062. const upperName2Slash = `${upperName2}/`;
  1063. if (upperName1.startsWith(upperName2Slash) ||
  1064. upperName2.startsWith(upperName1Slash)) {
  1065. yield git.branchDelete(true, branch);
  1066. }
  1067. }
  1068. }
  1069. }
  1070. core.endGroup();
  1071. // Check for submodules and delete any existing files if submodules are present
  1072. if (!(yield git.submoduleStatus())) {
  1073. remove = true;
  1074. core.info('Bad Submodules found, removing existing files');
  1075. }
  1076. // Clean
  1077. if (clean) {
  1078. core.startGroup('Cleaning the repository');
  1079. if (!(yield git.tryClean())) {
  1080. 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}'.`);
  1081. remove = true;
  1082. }
  1083. else if (!(yield git.tryReset())) {
  1084. remove = true;
  1085. }
  1086. core.endGroup();
  1087. if (remove) {
  1088. core.warning(`Unable to clean or reset the repository. The repository will be recreated instead.`);
  1089. }
  1090. }
  1091. }
  1092. catch (error) {
  1093. core.warning(`Unable to prepare the existing repository. The repository will be recreated instead.`);
  1094. remove = true;
  1095. }
  1096. }
  1097. if (remove) {
  1098. // Delete the contents of the directory. Don't delete the directory itself
  1099. // since it might be the current working directory.
  1100. core.info(`Deleting the contents of '${repositoryPath}'`);
  1101. for (const file of yield fs.promises.readdir(repositoryPath)) {
  1102. yield io.rmRF(path.join(repositoryPath, file));
  1103. }
  1104. }
  1105. });
  1106. }
  1107. /***/ }),
  1108. /***/ 9210:
  1109. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  1110. "use strict";
  1111. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  1112. if (k2 === undefined) k2 = k;
  1113. var desc = Object.getOwnPropertyDescriptor(m, k);
  1114. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  1115. desc = { enumerable: true, get: function() { return m[k]; } };
  1116. }
  1117. Object.defineProperty(o, k2, desc);
  1118. }) : (function(o, m, k, k2) {
  1119. if (k2 === undefined) k2 = k;
  1120. o[k2] = m[k];
  1121. }));
  1122. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  1123. Object.defineProperty(o, "default", { enumerable: true, value: v });
  1124. }) : function(o, v) {
  1125. o["default"] = v;
  1126. });
  1127. var __importStar = (this && this.__importStar) || function (mod) {
  1128. if (mod && mod.__esModule) return mod;
  1129. var result = {};
  1130. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  1131. __setModuleDefault(result, mod);
  1132. return result;
  1133. };
  1134. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  1135. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  1136. return new (P || (P = Promise))(function (resolve, reject) {
  1137. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  1138. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  1139. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  1140. step((generator = generator.apply(thisArg, _arguments || [])).next());
  1141. });
  1142. };
  1143. Object.defineProperty(exports, "__esModule", ({ value: true }));
  1144. exports.getSource = getSource;
  1145. exports.cleanup = cleanup;
  1146. const core = __importStar(__nccwpck_require__(2186));
  1147. const fsHelper = __importStar(__nccwpck_require__(7219));
  1148. const gitAuthHelper = __importStar(__nccwpck_require__(2565));
  1149. const gitCommandManager = __importStar(__nccwpck_require__(738));
  1150. const gitDirectoryHelper = __importStar(__nccwpck_require__(8609));
  1151. const githubApiHelper = __importStar(__nccwpck_require__(138));
  1152. const io = __importStar(__nccwpck_require__(7436));
  1153. const path = __importStar(__nccwpck_require__(1017));
  1154. const refHelper = __importStar(__nccwpck_require__(8601));
  1155. const stateHelper = __importStar(__nccwpck_require__(4866));
  1156. const urlHelper = __importStar(__nccwpck_require__(9437));
  1157. const git_command_manager_1 = __nccwpck_require__(738);
  1158. function getSource(settings) {
  1159. return __awaiter(this, void 0, void 0, function* () {
  1160. // Repository URL
  1161. core.info(`Syncing repository: ${settings.repositoryOwner}/${settings.repositoryName}`);
  1162. const repositoryUrl = urlHelper.getFetchUrl(settings);
  1163. // Remove conflicting file path
  1164. if (fsHelper.fileExistsSync(settings.repositoryPath)) {
  1165. yield io.rmRF(settings.repositoryPath);
  1166. }
  1167. // Create directory
  1168. let isExisting = true;
  1169. if (!fsHelper.directoryExistsSync(settings.repositoryPath)) {
  1170. isExisting = false;
  1171. yield io.mkdirP(settings.repositoryPath);
  1172. }
  1173. // Git command manager
  1174. core.startGroup('Getting Git version info');
  1175. const git = yield getGitCommandManager(settings);
  1176. core.endGroup();
  1177. let authHelper = null;
  1178. try {
  1179. if (git) {
  1180. authHelper = gitAuthHelper.createAuthHelper(git, settings);
  1181. if (settings.setSafeDirectory) {
  1182. // 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
  1183. // Otherwise all git commands we run in a container fail
  1184. yield authHelper.configureTempGlobalConfig();
  1185. core.info(`Adding repository directory to the temporary git global config as a safe directory`);
  1186. yield git
  1187. .config('safe.directory', settings.repositoryPath, true, true)
  1188. .catch(error => {
  1189. core.info(`Failed to initialize safe directory with error: ${error}`);
  1190. });
  1191. stateHelper.setSafeDirectory();
  1192. }
  1193. }
  1194. // Prepare existing directory, otherwise recreate
  1195. if (isExisting) {
  1196. yield gitDirectoryHelper.prepareExistingDirectory(git, settings.repositoryPath, repositoryUrl, settings.clean, settings.ref);
  1197. }
  1198. if (!git) {
  1199. // Downloading using REST API
  1200. core.info(`The repository will be downloaded using the GitHub REST API`);
  1201. core.info(`To create a local Git repository instead, add Git ${gitCommandManager.MinimumGitVersion} or higher to the PATH`);
  1202. if (settings.submodules) {
  1203. 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.`);
  1204. }
  1205. else if (settings.sshKey) {
  1206. 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.`);
  1207. }
  1208. yield githubApiHelper.downloadRepository(settings.authToken, settings.repositoryOwner, settings.repositoryName, settings.ref, settings.commit, settings.repositoryPath, settings.githubServerUrl);
  1209. return;
  1210. }
  1211. // Save state for POST action
  1212. stateHelper.setRepositoryPath(settings.repositoryPath);
  1213. // Initialize the repository
  1214. if (!fsHelper.directoryExistsSync(path.join(settings.repositoryPath, '.git'))) {
  1215. core.startGroup('Initializing the repository');
  1216. yield git.init();
  1217. yield git.remoteAdd('origin', repositoryUrl);
  1218. core.endGroup();
  1219. }
  1220. // Disable automatic garbage collection
  1221. core.startGroup('Disabling automatic garbage collection');
  1222. if (!(yield git.tryDisableAutomaticGarbageCollection())) {
  1223. core.warning(`Unable to turn off git automatic garbage collection. The git fetch operation may trigger garbage collection and cause a delay.`);
  1224. }
  1225. core.endGroup();
  1226. // If we didn't initialize it above, do it now
  1227. if (!authHelper) {
  1228. authHelper = gitAuthHelper.createAuthHelper(git, settings);
  1229. }
  1230. // Configure auth
  1231. core.startGroup('Setting up auth');
  1232. yield authHelper.configureAuth();
  1233. core.endGroup();
  1234. // Determine the default branch
  1235. if (!settings.ref && !settings.commit) {
  1236. core.startGroup('Determining the default branch');
  1237. if (settings.sshKey) {
  1238. settings.ref = yield git.getDefaultBranch(repositoryUrl);
  1239. }
  1240. else {
  1241. settings.ref = yield githubApiHelper.getDefaultBranch(settings.authToken, settings.repositoryOwner, settings.repositoryName, settings.githubServerUrl);
  1242. }
  1243. core.endGroup();
  1244. }
  1245. // LFS install
  1246. if (settings.lfs) {
  1247. yield git.lfsInstall();
  1248. }
  1249. // Fetch
  1250. core.startGroup('Fetching the repository');
  1251. const fetchOptions = {};
  1252. if (settings.filter) {
  1253. fetchOptions.filter = settings.filter;
  1254. }
  1255. else if (settings.sparseCheckout) {
  1256. fetchOptions.filter = 'blob:none';
  1257. }
  1258. if (settings.fetchDepth <= 0) {
  1259. // Fetch all branches and tags
  1260. let refSpec = refHelper.getRefSpecForAllHistory(settings.ref, settings.commit);
  1261. yield git.fetch(refSpec, fetchOptions);
  1262. // When all history is fetched, the ref we're interested in may have moved to a different
  1263. // commit (push or force push). If so, fetch again with a targeted refspec.
  1264. if (!(yield refHelper.testRef(git, settings.ref, settings.commit))) {
  1265. refSpec = refHelper.getRefSpec(settings.ref, settings.commit);
  1266. yield git.fetch(refSpec, fetchOptions);
  1267. }
  1268. }
  1269. else {
  1270. fetchOptions.fetchDepth = settings.fetchDepth;
  1271. fetchOptions.fetchTags = settings.fetchTags;
  1272. const refSpec = refHelper.getRefSpec(settings.ref, settings.commit);
  1273. yield git.fetch(refSpec, fetchOptions);
  1274. }
  1275. core.endGroup();
  1276. // Checkout info
  1277. core.startGroup('Determining the checkout info');
  1278. const checkoutInfo = yield refHelper.getCheckoutInfo(git, settings.ref, settings.commit);
  1279. core.endGroup();
  1280. // LFS fetch
  1281. // Explicit lfs-fetch to avoid slow checkout (fetches one lfs object at a time).
  1282. // Explicit lfs fetch will fetch lfs objects in parallel.
  1283. // For sparse checkouts, let `checkout` fetch the needed objects lazily.
  1284. if (settings.lfs && !settings.sparseCheckout) {
  1285. core.startGroup('Fetching LFS objects');
  1286. yield git.lfsFetch(checkoutInfo.startPoint || checkoutInfo.ref);
  1287. core.endGroup();
  1288. }
  1289. // Sparse checkout
  1290. if (!settings.sparseCheckout) {
  1291. let gitVersion = yield git.version();
  1292. // no need to disable sparse-checkout if the installed git runtime doesn't even support it.
  1293. if (gitVersion.checkMinimum(git_command_manager_1.MinimumGitSparseCheckoutVersion)) {
  1294. yield git.disableSparseCheckout();
  1295. }
  1296. }
  1297. else {
  1298. core.startGroup('Setting up sparse checkout');
  1299. if (settings.sparseCheckoutConeMode) {
  1300. yield git.sparseCheckout(settings.sparseCheckout);
  1301. }
  1302. else {
  1303. yield git.sparseCheckoutNonConeMode(settings.sparseCheckout);
  1304. }
  1305. core.endGroup();
  1306. }
  1307. // Checkout
  1308. core.startGroup('Checking out the ref');
  1309. yield git.checkout(checkoutInfo.ref, checkoutInfo.startPoint);
  1310. core.endGroup();
  1311. // Submodules
  1312. if (settings.submodules) {
  1313. // Temporarily override global config
  1314. core.startGroup('Setting up auth for fetching submodules');
  1315. yield authHelper.configureGlobalAuth();
  1316. core.endGroup();
  1317. // Checkout submodules
  1318. core.startGroup('Fetching submodules');
  1319. yield git.submoduleSync(settings.nestedSubmodules);
  1320. yield git.submoduleUpdate(settings.fetchDepth, settings.nestedSubmodules);
  1321. yield git.submoduleForeach('git config --local gc.auto 0', settings.nestedSubmodules);
  1322. core.endGroup();
  1323. // Persist credentials
  1324. if (settings.persistCredentials) {
  1325. core.startGroup('Persisting credentials for submodules');
  1326. yield authHelper.configureSubmoduleAuth();
  1327. core.endGroup();
  1328. }
  1329. }
  1330. // Get commit information
  1331. const commitInfo = yield git.log1();
  1332. // Log commit sha
  1333. const commitSHA = yield git.log1('--format=%H');
  1334. core.setOutput('commit', commitSHA.trim());
  1335. // Check for incorrect pull request merge commit
  1336. yield refHelper.checkCommitInfo(settings.authToken, commitInfo, settings.repositoryOwner, settings.repositoryName, settings.ref, settings.commit, settings.githubServerUrl);
  1337. }
  1338. finally {
  1339. // Remove auth
  1340. if (authHelper) {
  1341. if (!settings.persistCredentials) {
  1342. core.startGroup('Removing auth');
  1343. yield authHelper.removeAuth();
  1344. core.endGroup();
  1345. }
  1346. authHelper.removeGlobalConfig();
  1347. }
  1348. }
  1349. });
  1350. }
  1351. function cleanup(repositoryPath) {
  1352. return __awaiter(this, void 0, void 0, function* () {
  1353. // Repo exists?
  1354. if (!repositoryPath ||
  1355. !fsHelper.fileExistsSync(path.join(repositoryPath, '.git', 'config'))) {
  1356. return;
  1357. }
  1358. let git;
  1359. try {
  1360. git = yield gitCommandManager.createCommandManager(repositoryPath, false, false);
  1361. }
  1362. catch (_a) {
  1363. return;
  1364. }
  1365. // Remove auth
  1366. const authHelper = gitAuthHelper.createAuthHelper(git);
  1367. try {
  1368. if (stateHelper.PostSetSafeDirectory) {
  1369. // 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
  1370. // Otherwise all git commands we run in a container fail
  1371. yield authHelper.configureTempGlobalConfig();
  1372. core.info(`Adding repository directory to the temporary git global config as a safe directory`);
  1373. yield git
  1374. .config('safe.directory', repositoryPath, true, true)
  1375. .catch(error => {
  1376. core.info(`Failed to initialize safe directory with error: ${error}`);
  1377. });
  1378. }
  1379. yield authHelper.removeAuth();
  1380. }
  1381. finally {
  1382. yield authHelper.removeGlobalConfig();
  1383. }
  1384. });
  1385. }
  1386. function getGitCommandManager(settings) {
  1387. return __awaiter(this, void 0, void 0, function* () {
  1388. core.info(`Working directory is '${settings.repositoryPath}'`);
  1389. try {
  1390. return yield gitCommandManager.createCommandManager(settings.repositoryPath, settings.lfs, settings.sparseCheckout != null);
  1391. }
  1392. catch (err) {
  1393. // Git is required for LFS
  1394. if (settings.lfs) {
  1395. throw err;
  1396. }
  1397. // Otherwise fallback to REST API
  1398. return undefined;
  1399. }
  1400. });
  1401. }
  1402. /***/ }),
  1403. /***/ 3142:
  1404. /***/ ((__unused_webpack_module, exports) => {
  1405. "use strict";
  1406. Object.defineProperty(exports, "__esModule", ({ value: true }));
  1407. exports.GitVersion = void 0;
  1408. class GitVersion {
  1409. /**
  1410. * Used for comparing the version of git and git-lfs against the minimum required version
  1411. * @param version the version string, e.g. 1.2 or 1.2.3
  1412. */
  1413. constructor(version) {
  1414. this.major = NaN;
  1415. this.minor = NaN;
  1416. this.patch = NaN;
  1417. if (version) {
  1418. const match = version.match(/^(\d+)\.(\d+)(\.(\d+))?$/);
  1419. if (match) {
  1420. this.major = Number(match[1]);
  1421. this.minor = Number(match[2]);
  1422. if (match[4]) {
  1423. this.patch = Number(match[4]);
  1424. }
  1425. }
  1426. }
  1427. }
  1428. /**
  1429. * Compares the instance against a minimum required version
  1430. * @param minimum Minimum version
  1431. */
  1432. checkMinimum(minimum) {
  1433. if (!minimum.isValid()) {
  1434. throw new Error('Arg minimum is not a valid version');
  1435. }
  1436. // Major is insufficient
  1437. if (this.major < minimum.major) {
  1438. return false;
  1439. }
  1440. // Major is equal
  1441. if (this.major === minimum.major) {
  1442. // Minor is insufficient
  1443. if (this.minor < minimum.minor) {
  1444. return false;
  1445. }
  1446. // Minor is equal
  1447. if (this.minor === minimum.minor) {
  1448. // Patch is insufficient
  1449. if (this.patch && this.patch < (minimum.patch || 0)) {
  1450. return false;
  1451. }
  1452. }
  1453. }
  1454. return true;
  1455. }
  1456. /**
  1457. * Indicates whether the instance was constructed from a valid version string
  1458. */
  1459. isValid() {
  1460. return !isNaN(this.major);
  1461. }
  1462. /**
  1463. * Returns the version as a string, e.g. 1.2 or 1.2.3
  1464. */
  1465. toString() {
  1466. let result = '';
  1467. if (this.isValid()) {
  1468. result = `${this.major}.${this.minor}`;
  1469. if (!isNaN(this.patch)) {
  1470. result += `.${this.patch}`;
  1471. }
  1472. }
  1473. return result;
  1474. }
  1475. }
  1476. exports.GitVersion = GitVersion;
  1477. /***/ }),
  1478. /***/ 138:
  1479. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  1480. "use strict";
  1481. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  1482. if (k2 === undefined) k2 = k;
  1483. var desc = Object.getOwnPropertyDescriptor(m, k);
  1484. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  1485. desc = { enumerable: true, get: function() { return m[k]; } };
  1486. }
  1487. Object.defineProperty(o, k2, desc);
  1488. }) : (function(o, m, k, k2) {
  1489. if (k2 === undefined) k2 = k;
  1490. o[k2] = m[k];
  1491. }));
  1492. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  1493. Object.defineProperty(o, "default", { enumerable: true, value: v });
  1494. }) : function(o, v) {
  1495. o["default"] = v;
  1496. });
  1497. var __importStar = (this && this.__importStar) || function (mod) {
  1498. if (mod && mod.__esModule) return mod;
  1499. var result = {};
  1500. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  1501. __setModuleDefault(result, mod);
  1502. return result;
  1503. };
  1504. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  1505. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  1506. return new (P || (P = Promise))(function (resolve, reject) {
  1507. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  1508. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  1509. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  1510. step((generator = generator.apply(thisArg, _arguments || [])).next());
  1511. });
  1512. };
  1513. Object.defineProperty(exports, "__esModule", ({ value: true }));
  1514. exports.downloadRepository = downloadRepository;
  1515. exports.getDefaultBranch = getDefaultBranch;
  1516. const assert = __importStar(__nccwpck_require__(9491));
  1517. const core = __importStar(__nccwpck_require__(2186));
  1518. const fs = __importStar(__nccwpck_require__(7147));
  1519. const github = __importStar(__nccwpck_require__(5438));
  1520. const io = __importStar(__nccwpck_require__(7436));
  1521. const path = __importStar(__nccwpck_require__(1017));
  1522. const retryHelper = __importStar(__nccwpck_require__(2155));
  1523. const toolCache = __importStar(__nccwpck_require__(7784));
  1524. const uuid_1 = __nccwpck_require__(5840);
  1525. const url_helper_1 = __nccwpck_require__(9437);
  1526. const IS_WINDOWS = process.platform === 'win32';
  1527. function downloadRepository(authToken, owner, repo, ref, commit, repositoryPath, baseUrl) {
  1528. return __awaiter(this, void 0, void 0, function* () {
  1529. // Determine the default branch
  1530. if (!ref && !commit) {
  1531. core.info('Determining the default branch');
  1532. ref = yield getDefaultBranch(authToken, owner, repo, baseUrl);
  1533. }
  1534. // Download the archive
  1535. let archiveData = yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  1536. core.info('Downloading the archive');
  1537. return yield downloadArchive(authToken, owner, repo, ref, commit, baseUrl);
  1538. }));
  1539. // Write archive to disk
  1540. core.info('Writing archive to disk');
  1541. const uniqueId = (0, uuid_1.v4)();
  1542. const archivePath = IS_WINDOWS
  1543. ? path.join(repositoryPath, `${uniqueId}.zip`)
  1544. : path.join(repositoryPath, `${uniqueId}.tar.gz`);
  1545. yield fs.promises.writeFile(archivePath, archiveData);
  1546. archiveData = Buffer.from(''); // Free memory
  1547. // Extract archive
  1548. core.info('Extracting the archive');
  1549. const extractPath = path.join(repositoryPath, uniqueId);
  1550. yield io.mkdirP(extractPath);
  1551. if (IS_WINDOWS) {
  1552. yield toolCache.extractZip(archivePath, extractPath);
  1553. }
  1554. else {
  1555. yield toolCache.extractTar(archivePath, extractPath);
  1556. }
  1557. yield io.rmRF(archivePath);
  1558. // Determine the path of the repository content. The archive contains
  1559. // a top-level folder and the repository content is inside.
  1560. const archiveFileNames = yield fs.promises.readdir(extractPath);
  1561. assert.ok(archiveFileNames.length == 1, 'Expected exactly one directory inside archive');
  1562. const archiveVersion = archiveFileNames[0]; // The top-level folder name includes the short SHA
  1563. core.info(`Resolved version ${archiveVersion}`);
  1564. const tempRepositoryPath = path.join(extractPath, archiveVersion);
  1565. // Move the files
  1566. for (const fileName of yield fs.promises.readdir(tempRepositoryPath)) {
  1567. const sourcePath = path.join(tempRepositoryPath, fileName);
  1568. const targetPath = path.join(repositoryPath, fileName);
  1569. if (IS_WINDOWS) {
  1570. yield io.cp(sourcePath, targetPath, { recursive: true }); // Copy on Windows (Windows Defender may have a lock)
  1571. }
  1572. else {
  1573. yield io.mv(sourcePath, targetPath);
  1574. }
  1575. }
  1576. yield io.rmRF(extractPath);
  1577. });
  1578. }
  1579. /**
  1580. * Looks up the default branch name
  1581. */
  1582. function getDefaultBranch(authToken, owner, repo, baseUrl) {
  1583. return __awaiter(this, void 0, void 0, function* () {
  1584. return yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  1585. core.info('Retrieving the default branch name');
  1586. const octokit = github.getOctokit(authToken, {
  1587. baseUrl: (0, url_helper_1.getServerApiUrl)(baseUrl)
  1588. });
  1589. let result;
  1590. try {
  1591. // Get the default branch from the repo info
  1592. const response = yield octokit.rest.repos.get({ owner, repo });
  1593. result = response.data.default_branch;
  1594. assert.ok(result, 'default_branch cannot be empty');
  1595. }
  1596. catch (err) {
  1597. // Handle .wiki repo
  1598. if ((err === null || err === void 0 ? void 0 : err.status) === 404 &&
  1599. repo.toUpperCase().endsWith('.WIKI')) {
  1600. result = 'master';
  1601. }
  1602. // Otherwise error
  1603. else {
  1604. throw err;
  1605. }
  1606. }
  1607. // Print the default branch
  1608. core.info(`Default branch '${result}'`);
  1609. // Prefix with 'refs/heads'
  1610. if (!result.startsWith('refs/')) {
  1611. result = `refs/heads/${result}`;
  1612. }
  1613. return result;
  1614. }));
  1615. });
  1616. }
  1617. function downloadArchive(authToken, owner, repo, ref, commit, baseUrl) {
  1618. return __awaiter(this, void 0, void 0, function* () {
  1619. const octokit = github.getOctokit(authToken, {
  1620. baseUrl: (0, url_helper_1.getServerApiUrl)(baseUrl)
  1621. });
  1622. const download = IS_WINDOWS
  1623. ? octokit.rest.repos.downloadZipballArchive
  1624. : octokit.rest.repos.downloadTarballArchive;
  1625. const response = yield download({
  1626. owner: owner,
  1627. repo: repo,
  1628. ref: commit || ref
  1629. });
  1630. return Buffer.from(response.data); // response.data is ArrayBuffer
  1631. });
  1632. }
  1633. /***/ }),
  1634. /***/ 5480:
  1635. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  1636. "use strict";
  1637. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  1638. if (k2 === undefined) k2 = k;
  1639. var desc = Object.getOwnPropertyDescriptor(m, k);
  1640. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  1641. desc = { enumerable: true, get: function() { return m[k]; } };
  1642. }
  1643. Object.defineProperty(o, k2, desc);
  1644. }) : (function(o, m, k, k2) {
  1645. if (k2 === undefined) k2 = k;
  1646. o[k2] = m[k];
  1647. }));
  1648. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  1649. Object.defineProperty(o, "default", { enumerable: true, value: v });
  1650. }) : function(o, v) {
  1651. o["default"] = v;
  1652. });
  1653. var __importStar = (this && this.__importStar) || function (mod) {
  1654. if (mod && mod.__esModule) return mod;
  1655. var result = {};
  1656. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  1657. __setModuleDefault(result, mod);
  1658. return result;
  1659. };
  1660. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  1661. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  1662. return new (P || (P = Promise))(function (resolve, reject) {
  1663. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  1664. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  1665. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  1666. step((generator = generator.apply(thisArg, _arguments || [])).next());
  1667. });
  1668. };
  1669. Object.defineProperty(exports, "__esModule", ({ value: true }));
  1670. exports.getInputs = getInputs;
  1671. const core = __importStar(__nccwpck_require__(2186));
  1672. const fsHelper = __importStar(__nccwpck_require__(7219));
  1673. const github = __importStar(__nccwpck_require__(5438));
  1674. const path = __importStar(__nccwpck_require__(1017));
  1675. const workflowContextHelper = __importStar(__nccwpck_require__(9568));
  1676. function getInputs() {
  1677. return __awaiter(this, void 0, void 0, function* () {
  1678. const result = {};
  1679. // GitHub workspace
  1680. let githubWorkspacePath = process.env['GITHUB_WORKSPACE'];
  1681. if (!githubWorkspacePath) {
  1682. throw new Error('GITHUB_WORKSPACE not defined');
  1683. }
  1684. githubWorkspacePath = path.resolve(githubWorkspacePath);
  1685. core.debug(`GITHUB_WORKSPACE = '${githubWorkspacePath}'`);
  1686. fsHelper.directoryExistsSync(githubWorkspacePath, true);
  1687. // Qualified repository
  1688. const qualifiedRepository = core.getInput('repository') ||
  1689. `${github.context.repo.owner}/${github.context.repo.repo}`;
  1690. core.debug(`qualified repository = '${qualifiedRepository}'`);
  1691. const splitRepository = qualifiedRepository.split('/');
  1692. if (splitRepository.length !== 2 ||
  1693. !splitRepository[0] ||
  1694. !splitRepository[1]) {
  1695. throw new Error(`Invalid repository '${qualifiedRepository}'. Expected format {owner}/{repo}.`);
  1696. }
  1697. result.repositoryOwner = splitRepository[0];
  1698. result.repositoryName = splitRepository[1];
  1699. // Repository path
  1700. result.repositoryPath = core.getInput('path') || '.';
  1701. result.repositoryPath = path.resolve(githubWorkspacePath, result.repositoryPath);
  1702. if (!(result.repositoryPath + path.sep).startsWith(githubWorkspacePath + path.sep)) {
  1703. throw new Error(`Repository path '${result.repositoryPath}' is not under '${githubWorkspacePath}'`);
  1704. }
  1705. // Workflow repository?
  1706. const isWorkflowRepository = qualifiedRepository.toUpperCase() ===
  1707. `${github.context.repo.owner}/${github.context.repo.repo}`.toUpperCase();
  1708. // Source branch, source version
  1709. result.ref = core.getInput('ref');
  1710. if (!result.ref) {
  1711. if (isWorkflowRepository) {
  1712. result.ref = github.context.ref;
  1713. result.commit = github.context.sha;
  1714. // Some events have an unqualifed ref. For example when a PR is merged (pull_request closed event),
  1715. // the ref is unqualifed like "main" instead of "refs/heads/main".
  1716. if (result.commit && result.ref && !result.ref.startsWith('refs/')) {
  1717. result.ref = `refs/heads/${result.ref}`;
  1718. }
  1719. }
  1720. }
  1721. // SHA?
  1722. else if (result.ref.match(/^[0-9a-fA-F]{40}$/)) {
  1723. result.commit = result.ref;
  1724. result.ref = '';
  1725. }
  1726. core.debug(`ref = '${result.ref}'`);
  1727. core.debug(`commit = '${result.commit}'`);
  1728. // Clean
  1729. result.clean = (core.getInput('clean') || 'true').toUpperCase() === 'TRUE';
  1730. core.debug(`clean = ${result.clean}`);
  1731. // Filter
  1732. const filter = core.getInput('filter');
  1733. if (filter) {
  1734. result.filter = filter;
  1735. }
  1736. core.debug(`filter = ${result.filter}`);
  1737. // Sparse checkout
  1738. const sparseCheckout = core.getMultilineInput('sparse-checkout');
  1739. if (sparseCheckout.length) {
  1740. result.sparseCheckout = sparseCheckout;
  1741. core.debug(`sparse checkout = ${result.sparseCheckout}`);
  1742. }
  1743. result.sparseCheckoutConeMode =
  1744. (core.getInput('sparse-checkout-cone-mode') || 'true').toUpperCase() ===
  1745. 'TRUE';
  1746. // Fetch depth
  1747. result.fetchDepth = Math.floor(Number(core.getInput('fetch-depth') || '1'));
  1748. if (isNaN(result.fetchDepth) || result.fetchDepth < 0) {
  1749. result.fetchDepth = 0;
  1750. }
  1751. core.debug(`fetch depth = ${result.fetchDepth}`);
  1752. // Fetch tags
  1753. result.fetchTags =
  1754. (core.getInput('fetch-tags') || 'false').toUpperCase() === 'TRUE';
  1755. core.debug(`fetch tags = ${result.fetchTags}`);
  1756. // Show fetch progress
  1757. result.showProgress =
  1758. (core.getInput('show-progress') || 'true').toUpperCase() === 'TRUE';
  1759. core.debug(`show progress = ${result.showProgress}`);
  1760. // LFS
  1761. result.lfs = (core.getInput('lfs') || 'false').toUpperCase() === 'TRUE';
  1762. core.debug(`lfs = ${result.lfs}`);
  1763. // Submodules
  1764. result.submodules = false;
  1765. result.nestedSubmodules = false;
  1766. const submodulesString = (core.getInput('submodules') || '').toUpperCase();
  1767. if (submodulesString == 'RECURSIVE') {
  1768. result.submodules = true;
  1769. result.nestedSubmodules = true;
  1770. }
  1771. else if (submodulesString == 'TRUE') {
  1772. result.submodules = true;
  1773. }
  1774. core.debug(`submodules = ${result.submodules}`);
  1775. core.debug(`recursive submodules = ${result.nestedSubmodules}`);
  1776. // Auth token
  1777. result.authToken = core.getInput('token', { required: true });
  1778. // SSH
  1779. result.sshKey = core.getInput('ssh-key');
  1780. result.sshKnownHosts = core.getInput('ssh-known-hosts');
  1781. result.sshStrict =
  1782. (core.getInput('ssh-strict') || 'true').toUpperCase() === 'TRUE';
  1783. result.sshUser = core.getInput('ssh-user');
  1784. // Persist credentials
  1785. result.persistCredentials =
  1786. (core.getInput('persist-credentials') || 'false').toUpperCase() === 'TRUE';
  1787. // Workflow organization ID
  1788. result.workflowOrganizationId =
  1789. yield workflowContextHelper.getOrganizationId();
  1790. // Set safe.directory in git global config.
  1791. result.setSafeDirectory =
  1792. (core.getInput('set-safe-directory') || 'true').toUpperCase() === 'TRUE';
  1793. // Determine the GitHub URL that the repository is being hosted from
  1794. result.githubServerUrl = core.getInput('github-server-url');
  1795. core.debug(`GitHub Host URL = ${result.githubServerUrl}`);
  1796. return result;
  1797. });
  1798. }
  1799. /***/ }),
  1800. /***/ 3109:
  1801. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  1802. "use strict";
  1803. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  1804. if (k2 === undefined) k2 = k;
  1805. var desc = Object.getOwnPropertyDescriptor(m, k);
  1806. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  1807. desc = { enumerable: true, get: function() { return m[k]; } };
  1808. }
  1809. Object.defineProperty(o, k2, desc);
  1810. }) : (function(o, m, k, k2) {
  1811. if (k2 === undefined) k2 = k;
  1812. o[k2] = m[k];
  1813. }));
  1814. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  1815. Object.defineProperty(o, "default", { enumerable: true, value: v });
  1816. }) : function(o, v) {
  1817. o["default"] = v;
  1818. });
  1819. var __importStar = (this && this.__importStar) || function (mod) {
  1820. if (mod && mod.__esModule) return mod;
  1821. var result = {};
  1822. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  1823. __setModuleDefault(result, mod);
  1824. return result;
  1825. };
  1826. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  1827. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  1828. return new (P || (P = Promise))(function (resolve, reject) {
  1829. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  1830. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  1831. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  1832. step((generator = generator.apply(thisArg, _arguments || [])).next());
  1833. });
  1834. };
  1835. Object.defineProperty(exports, "__esModule", ({ value: true }));
  1836. const core = __importStar(__nccwpck_require__(2186));
  1837. const coreCommand = __importStar(__nccwpck_require__(7351));
  1838. const gitSourceProvider = __importStar(__nccwpck_require__(9210));
  1839. const inputHelper = __importStar(__nccwpck_require__(5480));
  1840. const path = __importStar(__nccwpck_require__(1017));
  1841. const stateHelper = __importStar(__nccwpck_require__(4866));
  1842. function run() {
  1843. return __awaiter(this, void 0, void 0, function* () {
  1844. var _a;
  1845. try {
  1846. const sourceSettings = yield inputHelper.getInputs();
  1847. try {
  1848. // Register problem matcher
  1849. coreCommand.issueCommand('add-matcher', {}, path.join(__dirname, 'problem-matcher.json'));
  1850. // Get sources
  1851. yield gitSourceProvider.getSource(sourceSettings);
  1852. core.setOutput('ref', sourceSettings.ref);
  1853. }
  1854. finally {
  1855. // Unregister problem matcher
  1856. coreCommand.issueCommand('remove-matcher', { owner: 'checkout-git' }, '');
  1857. }
  1858. }
  1859. catch (error) {
  1860. core.setFailed(`${(_a = error === null || error === void 0 ? void 0 : error.message) !== null && _a !== void 0 ? _a : error}`);
  1861. }
  1862. });
  1863. }
  1864. function cleanup() {
  1865. return __awaiter(this, void 0, void 0, function* () {
  1866. var _a;
  1867. try {
  1868. yield gitSourceProvider.cleanup(stateHelper.RepositoryPath);
  1869. }
  1870. catch (error) {
  1871. core.warning(`${(_a = error === null || error === void 0 ? void 0 : error.message) !== null && _a !== void 0 ? _a : error}`);
  1872. }
  1873. });
  1874. }
  1875. // Main
  1876. if (!stateHelper.IsPost) {
  1877. run();
  1878. }
  1879. // Post
  1880. else {
  1881. cleanup();
  1882. }
  1883. /***/ }),
  1884. /***/ 8601:
  1885. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  1886. "use strict";
  1887. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  1888. if (k2 === undefined) k2 = k;
  1889. var desc = Object.getOwnPropertyDescriptor(m, k);
  1890. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  1891. desc = { enumerable: true, get: function() { return m[k]; } };
  1892. }
  1893. Object.defineProperty(o, k2, desc);
  1894. }) : (function(o, m, k, k2) {
  1895. if (k2 === undefined) k2 = k;
  1896. o[k2] = m[k];
  1897. }));
  1898. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  1899. Object.defineProperty(o, "default", { enumerable: true, value: v });
  1900. }) : function(o, v) {
  1901. o["default"] = v;
  1902. });
  1903. var __importStar = (this && this.__importStar) || function (mod) {
  1904. if (mod && mod.__esModule) return mod;
  1905. var result = {};
  1906. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  1907. __setModuleDefault(result, mod);
  1908. return result;
  1909. };
  1910. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  1911. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  1912. return new (P || (P = Promise))(function (resolve, reject) {
  1913. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  1914. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  1915. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  1916. step((generator = generator.apply(thisArg, _arguments || [])).next());
  1917. });
  1918. };
  1919. Object.defineProperty(exports, "__esModule", ({ value: true }));
  1920. exports.tagsRefSpec = void 0;
  1921. exports.getCheckoutInfo = getCheckoutInfo;
  1922. exports.getRefSpecForAllHistory = getRefSpecForAllHistory;
  1923. exports.getRefSpec = getRefSpec;
  1924. exports.testRef = testRef;
  1925. exports.checkCommitInfo = checkCommitInfo;
  1926. const core = __importStar(__nccwpck_require__(2186));
  1927. const github = __importStar(__nccwpck_require__(5438));
  1928. const url_helper_1 = __nccwpck_require__(9437);
  1929. exports.tagsRefSpec = '+refs/tags/*:refs/tags/*';
  1930. function getCheckoutInfo(git, ref, commit) {
  1931. return __awaiter(this, void 0, void 0, function* () {
  1932. if (!git) {
  1933. throw new Error('Arg git cannot be empty');
  1934. }
  1935. if (!ref && !commit) {
  1936. throw new Error('Args ref and commit cannot both be empty');
  1937. }
  1938. const result = {};
  1939. const upperRef = (ref || '').toUpperCase();
  1940. // SHA only
  1941. if (!ref) {
  1942. result.ref = commit;
  1943. }
  1944. // refs/heads/
  1945. else if (upperRef.startsWith('REFS/HEADS/')) {
  1946. const branch = ref.substring('refs/heads/'.length);
  1947. result.ref = branch;
  1948. result.startPoint = `refs/remotes/origin/${branch}`;
  1949. }
  1950. // refs/pull/
  1951. else if (upperRef.startsWith('REFS/PULL/')) {
  1952. const branch = ref.substring('refs/pull/'.length);
  1953. result.ref = `refs/remotes/pull/${branch}`;
  1954. }
  1955. // refs/tags/
  1956. else if (upperRef.startsWith('REFS/TAGS/')) {
  1957. result.ref = ref;
  1958. }
  1959. // refs/
  1960. else if (upperRef.startsWith('REFS/')) {
  1961. result.ref = commit ? commit : ref;
  1962. }
  1963. // Unqualified ref, check for a matching branch or tag
  1964. else {
  1965. if (yield git.branchExists(true, `origin/${ref}`)) {
  1966. result.ref = ref;
  1967. result.startPoint = `refs/remotes/origin/${ref}`;
  1968. }
  1969. else if (yield git.tagExists(`${ref}`)) {
  1970. result.ref = `refs/tags/${ref}`;
  1971. }
  1972. else {
  1973. throw new Error(`A branch or tag with the name '${ref}' could not be found`);
  1974. }
  1975. }
  1976. return result;
  1977. });
  1978. }
  1979. function getRefSpecForAllHistory(ref, commit) {
  1980. const result = ['+refs/heads/*:refs/remotes/origin/*', exports.tagsRefSpec];
  1981. if (ref && ref.toUpperCase().startsWith('REFS/PULL/')) {
  1982. const branch = ref.substring('refs/pull/'.length);
  1983. result.push(`+${commit || ref}:refs/remotes/pull/${branch}`);
  1984. }
  1985. return result;
  1986. }
  1987. function getRefSpec(ref, commit) {
  1988. if (!ref && !commit) {
  1989. throw new Error('Args ref and commit cannot both be empty');
  1990. }
  1991. const upperRef = (ref || '').toUpperCase();
  1992. // SHA
  1993. if (commit) {
  1994. // refs/heads
  1995. if (upperRef.startsWith('REFS/HEADS/')) {
  1996. const branch = ref.substring('refs/heads/'.length);
  1997. return [`+${commit}:refs/remotes/origin/${branch}`];
  1998. }
  1999. // refs/pull/
  2000. else if (upperRef.startsWith('REFS/PULL/')) {
  2001. const branch = ref.substring('refs/pull/'.length);
  2002. return [`+${commit}:refs/remotes/pull/${branch}`];
  2003. }
  2004. // refs/tags/
  2005. else if (upperRef.startsWith('REFS/TAGS/')) {
  2006. return [`+${commit}:${ref}`];
  2007. }
  2008. // Otherwise no destination ref
  2009. else {
  2010. return [commit];
  2011. }
  2012. }
  2013. // Unqualified ref, check for a matching branch or tag
  2014. else if (!upperRef.startsWith('REFS/')) {
  2015. return [
  2016. `+refs/heads/${ref}*:refs/remotes/origin/${ref}*`,
  2017. `+refs/tags/${ref}*:refs/tags/${ref}*`
  2018. ];
  2019. }
  2020. // refs/heads/
  2021. else if (upperRef.startsWith('REFS/HEADS/')) {
  2022. const branch = ref.substring('refs/heads/'.length);
  2023. return [`+${ref}:refs/remotes/origin/${branch}`];
  2024. }
  2025. // refs/pull/
  2026. else if (upperRef.startsWith('REFS/PULL/')) {
  2027. const branch = ref.substring('refs/pull/'.length);
  2028. return [`+${ref}:refs/remotes/pull/${branch}`];
  2029. }
  2030. // refs/tags/
  2031. else {
  2032. return [`+${ref}:${ref}`];
  2033. }
  2034. }
  2035. /**
  2036. * Tests whether the initial fetch created the ref at the expected commit
  2037. */
  2038. function testRef(git, ref, commit) {
  2039. return __awaiter(this, void 0, void 0, function* () {
  2040. if (!git) {
  2041. throw new Error('Arg git cannot be empty');
  2042. }
  2043. if (!ref && !commit) {
  2044. throw new Error('Args ref and commit cannot both be empty');
  2045. }
  2046. // No SHA? Nothing to test
  2047. if (!commit) {
  2048. return true;
  2049. }
  2050. // SHA only?
  2051. else if (!ref) {
  2052. return yield git.shaExists(commit);
  2053. }
  2054. const upperRef = ref.toUpperCase();
  2055. // refs/heads/
  2056. if (upperRef.startsWith('REFS/HEADS/')) {
  2057. const branch = ref.substring('refs/heads/'.length);
  2058. return ((yield git.branchExists(true, `origin/${branch}`)) &&
  2059. commit === (yield git.revParse(`refs/remotes/origin/${branch}`)));
  2060. }
  2061. // refs/pull/
  2062. else if (upperRef.startsWith('REFS/PULL/')) {
  2063. // Assume matches because fetched using the commit
  2064. return true;
  2065. }
  2066. // refs/tags/
  2067. else if (upperRef.startsWith('REFS/TAGS/')) {
  2068. const tagName = ref.substring('refs/tags/'.length);
  2069. return ((yield git.tagExists(tagName)) && commit === (yield git.revParse(ref)));
  2070. }
  2071. // Unexpected
  2072. else {
  2073. core.debug(`Unexpected ref format '${ref}' when testing ref info`);
  2074. return true;
  2075. }
  2076. });
  2077. }
  2078. function checkCommitInfo(token, commitInfo, repositoryOwner, repositoryName, ref, commit, baseUrl) {
  2079. return __awaiter(this, void 0, void 0, function* () {
  2080. var _a;
  2081. try {
  2082. // GHES?
  2083. if ((0, url_helper_1.isGhes)(baseUrl)) {
  2084. return;
  2085. }
  2086. // Auth token?
  2087. if (!token) {
  2088. return;
  2089. }
  2090. // Public PR synchronize, for workflow repo?
  2091. if (fromPayload('repository.private') !== false ||
  2092. github.context.eventName !== 'pull_request' ||
  2093. fromPayload('action') !== 'synchronize' ||
  2094. repositoryOwner !== github.context.repo.owner ||
  2095. repositoryName !== github.context.repo.repo ||
  2096. ref !== github.context.ref ||
  2097. !ref.startsWith('refs/pull/') ||
  2098. commit !== github.context.sha) {
  2099. return;
  2100. }
  2101. // Head SHA
  2102. const expectedHeadSha = fromPayload('after');
  2103. if (!expectedHeadSha) {
  2104. core.debug('Unable to determine head sha');
  2105. return;
  2106. }
  2107. // Base SHA
  2108. const expectedBaseSha = fromPayload('pull_request.base.sha');
  2109. if (!expectedBaseSha) {
  2110. core.debug('Unable to determine base sha');
  2111. return;
  2112. }
  2113. // Expected message?
  2114. const expectedMessage = `Merge ${expectedHeadSha} into ${expectedBaseSha}`;
  2115. if (commitInfo.indexOf(expectedMessage) >= 0) {
  2116. return;
  2117. }
  2118. // Extract details from message
  2119. const match = commitInfo.match(/Merge ([0-9a-f]{40}) into ([0-9a-f]{40})/);
  2120. if (!match) {
  2121. core.debug('Unexpected message format');
  2122. return;
  2123. }
  2124. // Post telemetry
  2125. const actualHeadSha = match[1];
  2126. if (actualHeadSha !== expectedHeadSha) {
  2127. core.debug(`Expected head sha ${expectedHeadSha}; actual head sha ${actualHeadSha}`);
  2128. const octokit = github.getOctokit(token, {
  2129. baseUrl: (0, url_helper_1.getServerApiUrl)(baseUrl),
  2130. 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})`
  2131. });
  2132. yield octokit.rest.repos.get({
  2133. owner: repositoryOwner,
  2134. repo: repositoryName
  2135. });
  2136. }
  2137. }
  2138. catch (err) {
  2139. core.debug(`Error when validating commit info: ${(_a = err === null || err === void 0 ? void 0 : err.stack) !== null && _a !== void 0 ? _a : err}`);
  2140. }
  2141. });
  2142. }
  2143. function fromPayload(path) {
  2144. return select(github.context.payload, path);
  2145. }
  2146. function select(obj, path) {
  2147. if (!obj) {
  2148. return undefined;
  2149. }
  2150. const i = path.indexOf('.');
  2151. if (i < 0) {
  2152. return obj[path];
  2153. }
  2154. const key = path.substr(0, i);
  2155. return select(obj[key], path.substr(i + 1));
  2156. }
  2157. /***/ }),
  2158. /***/ 3120:
  2159. /***/ ((__unused_webpack_module, exports) => {
  2160. "use strict";
  2161. Object.defineProperty(exports, "__esModule", ({ value: true }));
  2162. exports.escape = escape;
  2163. function escape(value) {
  2164. return value.replace(/[^a-zA-Z0-9_]/g, x => {
  2165. return `\\${x}`;
  2166. });
  2167. }
  2168. /***/ }),
  2169. /***/ 2155:
  2170. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  2171. "use strict";
  2172. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  2173. if (k2 === undefined) k2 = k;
  2174. var desc = Object.getOwnPropertyDescriptor(m, k);
  2175. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  2176. desc = { enumerable: true, get: function() { return m[k]; } };
  2177. }
  2178. Object.defineProperty(o, k2, desc);
  2179. }) : (function(o, m, k, k2) {
  2180. if (k2 === undefined) k2 = k;
  2181. o[k2] = m[k];
  2182. }));
  2183. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  2184. Object.defineProperty(o, "default", { enumerable: true, value: v });
  2185. }) : function(o, v) {
  2186. o["default"] = v;
  2187. });
  2188. var __importStar = (this && this.__importStar) || function (mod) {
  2189. if (mod && mod.__esModule) return mod;
  2190. var result = {};
  2191. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  2192. __setModuleDefault(result, mod);
  2193. return result;
  2194. };
  2195. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  2196. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  2197. return new (P || (P = Promise))(function (resolve, reject) {
  2198. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  2199. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  2200. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  2201. step((generator = generator.apply(thisArg, _arguments || [])).next());
  2202. });
  2203. };
  2204. Object.defineProperty(exports, "__esModule", ({ value: true }));
  2205. exports.RetryHelper = void 0;
  2206. exports.execute = execute;
  2207. const core = __importStar(__nccwpck_require__(2186));
  2208. const defaultMaxAttempts = 3;
  2209. const defaultMinSeconds = 10;
  2210. const defaultMaxSeconds = 20;
  2211. class RetryHelper {
  2212. constructor(maxAttempts = defaultMaxAttempts, minSeconds = defaultMinSeconds, maxSeconds = defaultMaxSeconds) {
  2213. this.maxAttempts = maxAttempts;
  2214. this.minSeconds = Math.floor(minSeconds);
  2215. this.maxSeconds = Math.floor(maxSeconds);
  2216. if (this.minSeconds > this.maxSeconds) {
  2217. throw new Error('min seconds should be less than or equal to max seconds');
  2218. }
  2219. }
  2220. execute(action) {
  2221. return __awaiter(this, void 0, void 0, function* () {
  2222. let attempt = 1;
  2223. while (attempt < this.maxAttempts) {
  2224. // Try
  2225. try {
  2226. return yield action();
  2227. }
  2228. catch (err) {
  2229. core.info(err === null || err === void 0 ? void 0 : err.message);
  2230. }
  2231. // Sleep
  2232. const seconds = this.getSleepAmount();
  2233. core.info(`Waiting ${seconds} seconds before trying again`);
  2234. yield this.sleep(seconds);
  2235. attempt++;
  2236. }
  2237. // Last attempt
  2238. return yield action();
  2239. });
  2240. }
  2241. getSleepAmount() {
  2242. return (Math.floor(Math.random() * (this.maxSeconds - this.minSeconds + 1)) +
  2243. this.minSeconds);
  2244. }
  2245. sleep(seconds) {
  2246. return __awaiter(this, void 0, void 0, function* () {
  2247. return new Promise(resolve => setTimeout(resolve, seconds * 1000));
  2248. });
  2249. }
  2250. }
  2251. exports.RetryHelper = RetryHelper;
  2252. function execute(action) {
  2253. return __awaiter(this, void 0, void 0, function* () {
  2254. const retryHelper = new RetryHelper();
  2255. return yield retryHelper.execute(action);
  2256. });
  2257. }
  2258. /***/ }),
  2259. /***/ 4866:
  2260. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  2261. "use strict";
  2262. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  2263. if (k2 === undefined) k2 = k;
  2264. var desc = Object.getOwnPropertyDescriptor(m, k);
  2265. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  2266. desc = { enumerable: true, get: function() { return m[k]; } };
  2267. }
  2268. Object.defineProperty(o, k2, desc);
  2269. }) : (function(o, m, k, k2) {
  2270. if (k2 === undefined) k2 = k;
  2271. o[k2] = m[k];
  2272. }));
  2273. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  2274. Object.defineProperty(o, "default", { enumerable: true, value: v });
  2275. }) : function(o, v) {
  2276. o["default"] = v;
  2277. });
  2278. var __importStar = (this && this.__importStar) || function (mod) {
  2279. if (mod && mod.__esModule) return mod;
  2280. var result = {};
  2281. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  2282. __setModuleDefault(result, mod);
  2283. return result;
  2284. };
  2285. Object.defineProperty(exports, "__esModule", ({ value: true }));
  2286. exports.SshKnownHostsPath = exports.SshKeyPath = exports.PostSetSafeDirectory = exports.RepositoryPath = exports.IsPost = void 0;
  2287. exports.setRepositoryPath = setRepositoryPath;
  2288. exports.setSshKeyPath = setSshKeyPath;
  2289. exports.setSshKnownHostsPath = setSshKnownHostsPath;
  2290. exports.setSafeDirectory = setSafeDirectory;
  2291. const core = __importStar(__nccwpck_require__(2186));
  2292. /**
  2293. * Indicates whether the POST action is running
  2294. */
  2295. exports.IsPost = !!core.getState('isPost');
  2296. /**
  2297. * The repository path for the POST action. The value is empty during the MAIN action.
  2298. */
  2299. exports.RepositoryPath = core.getState('repositoryPath');
  2300. /**
  2301. * The set-safe-directory for the POST action. The value is set if input: 'safe-directory' is set during the MAIN action.
  2302. */
  2303. exports.PostSetSafeDirectory = core.getState('setSafeDirectory') === 'true';
  2304. /**
  2305. * The SSH key path for the POST action. The value is empty during the MAIN action.
  2306. */
  2307. exports.SshKeyPath = core.getState('sshKeyPath');
  2308. /**
  2309. * The SSH known hosts path for the POST action. The value is empty during the MAIN action.
  2310. */
  2311. exports.SshKnownHostsPath = core.getState('sshKnownHostsPath');
  2312. /**
  2313. * Save the repository path so the POST action can retrieve the value.
  2314. */
  2315. function setRepositoryPath(repositoryPath) {
  2316. core.saveState('repositoryPath', repositoryPath);
  2317. }
  2318. /**
  2319. * Save the SSH key path so the POST action can retrieve the value.
  2320. */
  2321. function setSshKeyPath(sshKeyPath) {
  2322. core.saveState('sshKeyPath', sshKeyPath);
  2323. }
  2324. /**
  2325. * Save the SSH known hosts path so the POST action can retrieve the value.
  2326. */
  2327. function setSshKnownHostsPath(sshKnownHostsPath) {
  2328. core.saveState('sshKnownHostsPath', sshKnownHostsPath);
  2329. }
  2330. /**
  2331. * Save the set-safe-directory input so the POST action can retrieve the value.
  2332. */
  2333. function setSafeDirectory() {
  2334. core.saveState('setSafeDirectory', 'true');
  2335. }
  2336. // Publish a variable so that when the POST action runs, it can determine it should run the cleanup logic.
  2337. // This is necessary since we don't have a separate entry point.
  2338. if (!exports.IsPost) {
  2339. core.saveState('isPost', 'true');
  2340. }
  2341. /***/ }),
  2342. /***/ 9437:
  2343. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  2344. "use strict";
  2345. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  2346. if (k2 === undefined) k2 = k;
  2347. var desc = Object.getOwnPropertyDescriptor(m, k);
  2348. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  2349. desc = { enumerable: true, get: function() { return m[k]; } };
  2350. }
  2351. Object.defineProperty(o, k2, desc);
  2352. }) : (function(o, m, k, k2) {
  2353. if (k2 === undefined) k2 = k;
  2354. o[k2] = m[k];
  2355. }));
  2356. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  2357. Object.defineProperty(o, "default", { enumerable: true, value: v });
  2358. }) : function(o, v) {
  2359. o["default"] = v;
  2360. });
  2361. var __importStar = (this && this.__importStar) || function (mod) {
  2362. if (mod && mod.__esModule) return mod;
  2363. var result = {};
  2364. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  2365. __setModuleDefault(result, mod);
  2366. return result;
  2367. };
  2368. Object.defineProperty(exports, "__esModule", ({ value: true }));
  2369. exports.getFetchUrl = getFetchUrl;
  2370. exports.getServerUrl = getServerUrl;
  2371. exports.getServerApiUrl = getServerApiUrl;
  2372. exports.isGhes = isGhes;
  2373. const assert = __importStar(__nccwpck_require__(9491));
  2374. const url_1 = __nccwpck_require__(7310);
  2375. function getFetchUrl(settings) {
  2376. assert.ok(settings.repositoryOwner, 'settings.repositoryOwner must be defined');
  2377. assert.ok(settings.repositoryName, 'settings.repositoryName must be defined');
  2378. const serviceUrl = getServerUrl(settings.githubServerUrl);
  2379. const encodedOwner = encodeURIComponent(settings.repositoryOwner);
  2380. const encodedName = encodeURIComponent(settings.repositoryName);
  2381. if (settings.sshKey) {
  2382. const user = settings.sshUser.length > 0 ? settings.sshUser : 'git';
  2383. return `${user}@${serviceUrl.hostname}:${encodedOwner}/${encodedName}.git`;
  2384. }
  2385. // "origin" is SCHEME://HOSTNAME[:PORT]
  2386. return `${serviceUrl.origin}/${encodedOwner}/${encodedName}`;
  2387. }
  2388. function getServerUrl(url) {
  2389. let resolvedUrl = process.env['GITHUB_SERVER_URL'] || 'https://github.com';
  2390. if (hasContent(url, WhitespaceMode.Trim)) {
  2391. resolvedUrl = url;
  2392. }
  2393. return new url_1.URL(resolvedUrl);
  2394. }
  2395. function getServerApiUrl(url) {
  2396. if (hasContent(url, WhitespaceMode.Trim)) {
  2397. let serverUrl = getServerUrl(url);
  2398. if (isGhes(url)) {
  2399. serverUrl.pathname = 'api/v3';
  2400. }
  2401. else {
  2402. serverUrl.hostname = 'api.' + serverUrl.hostname;
  2403. }
  2404. return pruneSuffix(serverUrl.toString(), '/');
  2405. }
  2406. return process.env['GITHUB_API_URL'] || 'https://api.github.com';
  2407. }
  2408. function isGhes(url) {
  2409. const ghUrl = new url_1.URL(url || process.env['GITHUB_SERVER_URL'] || 'https://github.com');
  2410. const hostname = ghUrl.hostname.trimEnd().toUpperCase();
  2411. const isGitHubHost = hostname === 'GITHUB.COM';
  2412. const isGitHubEnterpriseCloudHost = hostname.endsWith('.GHE.COM');
  2413. const isLocalHost = hostname.endsWith('.LOCALHOST');
  2414. return !isGitHubHost && !isGitHubEnterpriseCloudHost && !isLocalHost;
  2415. }
  2416. function pruneSuffix(text, suffix) {
  2417. if (hasContent(suffix, WhitespaceMode.Preserve) && (text === null || text === void 0 ? void 0 : text.endsWith(suffix))) {
  2418. return text.substring(0, text.length - suffix.length);
  2419. }
  2420. return text;
  2421. }
  2422. var WhitespaceMode;
  2423. (function (WhitespaceMode) {
  2424. WhitespaceMode[WhitespaceMode["Trim"] = 0] = "Trim";
  2425. WhitespaceMode[WhitespaceMode["Preserve"] = 1] = "Preserve";
  2426. })(WhitespaceMode || (WhitespaceMode = {}));
  2427. function hasContent(text, whitespaceMode) {
  2428. let refinedText = text !== null && text !== void 0 ? text : '';
  2429. if (whitespaceMode == WhitespaceMode.Trim) {
  2430. refinedText = refinedText.trim();
  2431. }
  2432. return refinedText.length > 0;
  2433. }
  2434. /***/ }),
  2435. /***/ 9568:
  2436. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  2437. "use strict";
  2438. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  2439. if (k2 === undefined) k2 = k;
  2440. var desc = Object.getOwnPropertyDescriptor(m, k);
  2441. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  2442. desc = { enumerable: true, get: function() { return m[k]; } };
  2443. }
  2444. Object.defineProperty(o, k2, desc);
  2445. }) : (function(o, m, k, k2) {
  2446. if (k2 === undefined) k2 = k;
  2447. o[k2] = m[k];
  2448. }));
  2449. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  2450. Object.defineProperty(o, "default", { enumerable: true, value: v });
  2451. }) : function(o, v) {
  2452. o["default"] = v;
  2453. });
  2454. var __importStar = (this && this.__importStar) || function (mod) {
  2455. if (mod && mod.__esModule) return mod;
  2456. var result = {};
  2457. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  2458. __setModuleDefault(result, mod);
  2459. return result;
  2460. };
  2461. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  2462. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  2463. return new (P || (P = Promise))(function (resolve, reject) {
  2464. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  2465. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  2466. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  2467. step((generator = generator.apply(thisArg, _arguments || [])).next());
  2468. });
  2469. };
  2470. Object.defineProperty(exports, "__esModule", ({ value: true }));
  2471. exports.getOrganizationId = getOrganizationId;
  2472. const core = __importStar(__nccwpck_require__(2186));
  2473. const fs = __importStar(__nccwpck_require__(7147));
  2474. /**
  2475. * Gets the organization ID of the running workflow or undefined if the value cannot be loaded from the GITHUB_EVENT_PATH
  2476. */
  2477. function getOrganizationId() {
  2478. return __awaiter(this, void 0, void 0, function* () {
  2479. var _a, _b;
  2480. try {
  2481. const eventPath = process.env.GITHUB_EVENT_PATH;
  2482. if (!eventPath) {
  2483. core.debug(`GITHUB_EVENT_PATH is not defined`);
  2484. return;
  2485. }
  2486. const content = yield fs.promises.readFile(eventPath, { encoding: 'utf8' });
  2487. const event = JSON.parse(content);
  2488. 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;
  2489. if (typeof id !== 'number') {
  2490. core.debug('Repository owner ID not found within GITHUB event info');
  2491. return;
  2492. }
  2493. return id;
  2494. }
  2495. catch (err) {
  2496. core.debug(`Unable to load organization ID from GITHUB_EVENT_PATH: ${err.message || err}`);
  2497. }
  2498. });
  2499. }
  2500. /***/ }),
  2501. /***/ 7351:
  2502. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  2503. "use strict";
  2504. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  2505. if (k2 === undefined) k2 = k;
  2506. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  2507. }) : (function(o, m, k, k2) {
  2508. if (k2 === undefined) k2 = k;
  2509. o[k2] = m[k];
  2510. }));
  2511. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  2512. Object.defineProperty(o, "default", { enumerable: true, value: v });
  2513. }) : function(o, v) {
  2514. o["default"] = v;
  2515. });
  2516. var __importStar = (this && this.__importStar) || function (mod) {
  2517. if (mod && mod.__esModule) return mod;
  2518. var result = {};
  2519. if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  2520. __setModuleDefault(result, mod);
  2521. return result;
  2522. };
  2523. Object.defineProperty(exports, "__esModule", ({ value: true }));
  2524. exports.issue = exports.issueCommand = void 0;
  2525. const os = __importStar(__nccwpck_require__(2037));
  2526. const utils_1 = __nccwpck_require__(5278);
  2527. /**
  2528. * Commands
  2529. *
  2530. * Command Format:
  2531. * ::name key=value,key=value::message
  2532. *
  2533. * Examples:
  2534. * ::warning::This is the message
  2535. * ::set-env name=MY_VAR::some value
  2536. */
  2537. function issueCommand(command, properties, message) {
  2538. const cmd = new Command(command, properties, message);
  2539. process.stdout.write(cmd.toString() + os.EOL);
  2540. }
  2541. exports.issueCommand = issueCommand;
  2542. function issue(name, message = '') {
  2543. issueCommand(name, {}, message);
  2544. }
  2545. exports.issue = issue;
  2546. const CMD_STRING = '::';
  2547. class Command {
  2548. constructor(command, properties, message) {
  2549. if (!command) {
  2550. command = 'missing.command';
  2551. }
  2552. this.command = command;
  2553. this.properties = properties;
  2554. this.message = message;
  2555. }
  2556. toString() {
  2557. let cmdStr = CMD_STRING + this.command;
  2558. if (this.properties && Object.keys(this.properties).length > 0) {
  2559. cmdStr += ' ';
  2560. let first = true;
  2561. for (const key in this.properties) {
  2562. if (this.properties.hasOwnProperty(key)) {
  2563. const val = this.properties[key];
  2564. if (val) {
  2565. if (first) {
  2566. first = false;
  2567. }
  2568. else {
  2569. cmdStr += ',';
  2570. }
  2571. cmdStr += `${key}=${escapeProperty(val)}`;
  2572. }
  2573. }
  2574. }
  2575. }
  2576. cmdStr += `${CMD_STRING}${escapeData(this.message)}`;
  2577. return cmdStr;
  2578. }
  2579. }
  2580. function escapeData(s) {
  2581. return utils_1.toCommandValue(s)
  2582. .replace(/%/g, '%25')
  2583. .replace(/\r/g, '%0D')
  2584. .replace(/\n/g, '%0A');
  2585. }
  2586. function escapeProperty(s) {
  2587. return utils_1.toCommandValue(s)
  2588. .replace(/%/g, '%25')
  2589. .replace(/\r/g, '%0D')
  2590. .replace(/\n/g, '%0A')
  2591. .replace(/:/g, '%3A')
  2592. .replace(/,/g, '%2C');
  2593. }
  2594. //# sourceMappingURL=command.js.map
  2595. /***/ }),
  2596. /***/ 2186:
  2597. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  2598. "use strict";
  2599. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  2600. if (k2 === undefined) k2 = k;
  2601. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  2602. }) : (function(o, m, k, k2) {
  2603. if (k2 === undefined) k2 = k;
  2604. o[k2] = m[k];
  2605. }));
  2606. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  2607. Object.defineProperty(o, "default", { enumerable: true, value: v });
  2608. }) : function(o, v) {
  2609. o["default"] = v;
  2610. });
  2611. var __importStar = (this && this.__importStar) || function (mod) {
  2612. if (mod && mod.__esModule) return mod;
  2613. var result = {};
  2614. if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  2615. __setModuleDefault(result, mod);
  2616. return result;
  2617. };
  2618. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  2619. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  2620. return new (P || (P = Promise))(function (resolve, reject) {
  2621. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  2622. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  2623. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  2624. step((generator = generator.apply(thisArg, _arguments || [])).next());
  2625. });
  2626. };
  2627. Object.defineProperty(exports, "__esModule", ({ value: true }));
  2628. 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;
  2629. const command_1 = __nccwpck_require__(7351);
  2630. const file_command_1 = __nccwpck_require__(717);
  2631. const utils_1 = __nccwpck_require__(5278);
  2632. const os = __importStar(__nccwpck_require__(2037));
  2633. const path = __importStar(__nccwpck_require__(1017));
  2634. const oidc_utils_1 = __nccwpck_require__(8041);
  2635. /**
  2636. * The code to exit an action
  2637. */
  2638. var ExitCode;
  2639. (function (ExitCode) {
  2640. /**
  2641. * A code indicating that the action was successful
  2642. */
  2643. ExitCode[ExitCode["Success"] = 0] = "Success";
  2644. /**
  2645. * A code indicating that the action was a failure
  2646. */
  2647. ExitCode[ExitCode["Failure"] = 1] = "Failure";
  2648. })(ExitCode = exports.ExitCode || (exports.ExitCode = {}));
  2649. //-----------------------------------------------------------------------
  2650. // Variables
  2651. //-----------------------------------------------------------------------
  2652. /**
  2653. * Sets env variable for this action and future actions in the job
  2654. * @param name the name of the variable to set
  2655. * @param val the value of the variable. Non-string values will be converted to a string via JSON.stringify
  2656. */
  2657. // eslint-disable-next-line @typescript-eslint/no-explicit-any
  2658. function exportVariable(name, val) {
  2659. const convertedVal = utils_1.toCommandValue(val);
  2660. process.env[name] = convertedVal;
  2661. const filePath = process.env['GITHUB_ENV'] || '';
  2662. if (filePath) {
  2663. return file_command_1.issueFileCommand('ENV', file_command_1.prepareKeyValueMessage(name, val));
  2664. }
  2665. command_1.issueCommand('set-env', { name }, convertedVal);
  2666. }
  2667. exports.exportVariable = exportVariable;
  2668. /**
  2669. * Registers a secret which will get masked from logs
  2670. * @param secret value of the secret
  2671. */
  2672. function setSecret(secret) {
  2673. command_1.issueCommand('add-mask', {}, secret);
  2674. }
  2675. exports.setSecret = setSecret;
  2676. /**
  2677. * Prepends inputPath to the PATH (for this action and future actions)
  2678. * @param inputPath
  2679. */
  2680. function addPath(inputPath) {
  2681. const filePath = process.env['GITHUB_PATH'] || '';
  2682. if (filePath) {
  2683. file_command_1.issueFileCommand('PATH', inputPath);
  2684. }
  2685. else {
  2686. command_1.issueCommand('add-path', {}, inputPath);
  2687. }
  2688. process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`;
  2689. }
  2690. exports.addPath = addPath;
  2691. /**
  2692. * Gets the value of an input.
  2693. * Unless trimWhitespace is set to false in InputOptions, the value is also trimmed.
  2694. * Returns an empty string if the value is not defined.
  2695. *
  2696. * @param name name of the input to get
  2697. * @param options optional. See InputOptions.
  2698. * @returns string
  2699. */
  2700. function getInput(name, options) {
  2701. const val = process.env[`INPUT_${name.replace(/ /g, '_').toUpperCase()}`] || '';
  2702. if (options && options.required && !val) {
  2703. throw new Error(`Input required and not supplied: ${name}`);
  2704. }
  2705. if (options && options.trimWhitespace === false) {
  2706. return val;
  2707. }
  2708. return val.trim();
  2709. }
  2710. exports.getInput = getInput;
  2711. /**
  2712. * Gets the values of an multiline input. Each value is also trimmed.
  2713. *
  2714. * @param name name of the input to get
  2715. * @param options optional. See InputOptions.
  2716. * @returns string[]
  2717. *
  2718. */
  2719. function getMultilineInput(name, options) {
  2720. const inputs = getInput(name, options)
  2721. .split('\n')
  2722. .filter(x => x !== '');
  2723. if (options && options.trimWhitespace === false) {
  2724. return inputs;
  2725. }
  2726. return inputs.map(input => input.trim());
  2727. }
  2728. exports.getMultilineInput = getMultilineInput;
  2729. /**
  2730. * Gets the input value of the boolean type in the YAML 1.2 "core schema" specification.
  2731. * Support boolean input list: `true | True | TRUE | false | False | FALSE` .
  2732. * The return value is also in boolean type.
  2733. * ref: https://yaml.org/spec/1.2/spec.html#id2804923
  2734. *
  2735. * @param name name of the input to get
  2736. * @param options optional. See InputOptions.
  2737. * @returns boolean
  2738. */
  2739. function getBooleanInput(name, options) {
  2740. const trueValue = ['true', 'True', 'TRUE'];
  2741. const falseValue = ['false', 'False', 'FALSE'];
  2742. const val = getInput(name, options);
  2743. if (trueValue.includes(val))
  2744. return true;
  2745. if (falseValue.includes(val))
  2746. return false;
  2747. throw new TypeError(`Input does not meet YAML 1.2 "Core Schema" specification: ${name}\n` +
  2748. `Support boolean input list: \`true | True | TRUE | false | False | FALSE\``);
  2749. }
  2750. exports.getBooleanInput = getBooleanInput;
  2751. /**
  2752. * Sets the value of an output.
  2753. *
  2754. * @param name name of the output to set
  2755. * @param value value to store. Non-string values will be converted to a string via JSON.stringify
  2756. */
  2757. // eslint-disable-next-line @typescript-eslint/no-explicit-any
  2758. function setOutput(name, value) {
  2759. const filePath = process.env['GITHUB_OUTPUT'] || '';
  2760. if (filePath) {
  2761. return file_command_1.issueFileCommand('OUTPUT', file_command_1.prepareKeyValueMessage(name, value));
  2762. }
  2763. process.stdout.write(os.EOL);
  2764. command_1.issueCommand('set-output', { name }, utils_1.toCommandValue(value));
  2765. }
  2766. exports.setOutput = setOutput;
  2767. /**
  2768. * Enables or disables the echoing of commands into stdout for the rest of the step.
  2769. * Echoing is disabled by default if ACTIONS_STEP_DEBUG is not set.
  2770. *
  2771. */
  2772. function setCommandEcho(enabled) {
  2773. command_1.issue('echo', enabled ? 'on' : 'off');
  2774. }
  2775. exports.setCommandEcho = setCommandEcho;
  2776. //-----------------------------------------------------------------------
  2777. // Results
  2778. //-----------------------------------------------------------------------
  2779. /**
  2780. * Sets the action status to failed.
  2781. * When the action exits it will be with an exit code of 1
  2782. * @param message add error issue message
  2783. */
  2784. function setFailed(message) {
  2785. process.exitCode = ExitCode.Failure;
  2786. error(message);
  2787. }
  2788. exports.setFailed = setFailed;
  2789. //-----------------------------------------------------------------------
  2790. // Logging Commands
  2791. //-----------------------------------------------------------------------
  2792. /**
  2793. * Gets whether Actions Step Debug is on or not
  2794. */
  2795. function isDebug() {
  2796. return process.env['RUNNER_DEBUG'] === '1';
  2797. }
  2798. exports.isDebug = isDebug;
  2799. /**
  2800. * Writes debug message to user log
  2801. * @param message debug message
  2802. */
  2803. function debug(message) {
  2804. command_1.issueCommand('debug', {}, message);
  2805. }
  2806. exports.debug = debug;
  2807. /**
  2808. * Adds an error issue
  2809. * @param message error issue message. Errors will be converted to string via toString()
  2810. * @param properties optional properties to add to the annotation.
  2811. */
  2812. function error(message, properties = {}) {
  2813. command_1.issueCommand('error', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message);
  2814. }
  2815. exports.error = error;
  2816. /**
  2817. * Adds a warning issue
  2818. * @param message warning issue message. Errors will be converted to string via toString()
  2819. * @param properties optional properties to add to the annotation.
  2820. */
  2821. function warning(message, properties = {}) {
  2822. command_1.issueCommand('warning', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message);
  2823. }
  2824. exports.warning = warning;
  2825. /**
  2826. * Adds a notice issue
  2827. * @param message notice issue message. Errors will be converted to string via toString()
  2828. * @param properties optional properties to add to the annotation.
  2829. */
  2830. function notice(message, properties = {}) {
  2831. command_1.issueCommand('notice', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message);
  2832. }
  2833. exports.notice = notice;
  2834. /**
  2835. * Writes info to log with console.log.
  2836. * @param message info message
  2837. */
  2838. function info(message) {
  2839. process.stdout.write(message + os.EOL);
  2840. }
  2841. exports.info = info;
  2842. /**
  2843. * Begin an output group.
  2844. *
  2845. * Output until the next `groupEnd` will be foldable in this group
  2846. *
  2847. * @param name The name of the output group
  2848. */
  2849. function startGroup(name) {
  2850. command_1.issue('group', name);
  2851. }
  2852. exports.startGroup = startGroup;
  2853. /**
  2854. * End an output group.
  2855. */
  2856. function endGroup() {
  2857. command_1.issue('endgroup');
  2858. }
  2859. exports.endGroup = endGroup;
  2860. /**
  2861. * Wrap an asynchronous function call in a group.
  2862. *
  2863. * Returns the same type as the function itself.
  2864. *
  2865. * @param name The name of the group
  2866. * @param fn The function to wrap in the group
  2867. */
  2868. function group(name, fn) {
  2869. return __awaiter(this, void 0, void 0, function* () {
  2870. startGroup(name);
  2871. let result;
  2872. try {
  2873. result = yield fn();
  2874. }
  2875. finally {
  2876. endGroup();
  2877. }
  2878. return result;
  2879. });
  2880. }
  2881. exports.group = group;
  2882. //-----------------------------------------------------------------------
  2883. // Wrapper action state
  2884. //-----------------------------------------------------------------------
  2885. /**
  2886. * Saves state for current action, the state can only be retrieved by this action's post job execution.
  2887. *
  2888. * @param name name of the state to store
  2889. * @param value value to store. Non-string values will be converted to a string via JSON.stringify
  2890. */
  2891. // eslint-disable-next-line @typescript-eslint/no-explicit-any
  2892. function saveState(name, value) {
  2893. const filePath = process.env['GITHUB_STATE'] || '';
  2894. if (filePath) {
  2895. return file_command_1.issueFileCommand('STATE', file_command_1.prepareKeyValueMessage(name, value));
  2896. }
  2897. command_1.issueCommand('save-state', { name }, utils_1.toCommandValue(value));
  2898. }
  2899. exports.saveState = saveState;
  2900. /**
  2901. * Gets the value of an state set by this action's main execution.
  2902. *
  2903. * @param name name of the state to get
  2904. * @returns string
  2905. */
  2906. function getState(name) {
  2907. return process.env[`STATE_${name}`] || '';
  2908. }
  2909. exports.getState = getState;
  2910. function getIDToken(aud) {
  2911. return __awaiter(this, void 0, void 0, function* () {
  2912. return yield oidc_utils_1.OidcClient.getIDToken(aud);
  2913. });
  2914. }
  2915. exports.getIDToken = getIDToken;
  2916. /**
  2917. * Summary exports
  2918. */
  2919. var summary_1 = __nccwpck_require__(1327);
  2920. Object.defineProperty(exports, "summary", ({ enumerable: true, get: function () { return summary_1.summary; } }));
  2921. /**
  2922. * @deprecated use core.summary
  2923. */
  2924. var summary_2 = __nccwpck_require__(1327);
  2925. Object.defineProperty(exports, "markdownSummary", ({ enumerable: true, get: function () { return summary_2.markdownSummary; } }));
  2926. /**
  2927. * Path exports
  2928. */
  2929. var path_utils_1 = __nccwpck_require__(2981);
  2930. Object.defineProperty(exports, "toPosixPath", ({ enumerable: true, get: function () { return path_utils_1.toPosixPath; } }));
  2931. Object.defineProperty(exports, "toWin32Path", ({ enumerable: true, get: function () { return path_utils_1.toWin32Path; } }));
  2932. Object.defineProperty(exports, "toPlatformPath", ({ enumerable: true, get: function () { return path_utils_1.toPlatformPath; } }));
  2933. //# sourceMappingURL=core.js.map
  2934. /***/ }),
  2935. /***/ 717:
  2936. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  2937. "use strict";
  2938. // For internal use, subject to change.
  2939. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  2940. if (k2 === undefined) k2 = k;
  2941. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  2942. }) : (function(o, m, k, k2) {
  2943. if (k2 === undefined) k2 = k;
  2944. o[k2] = m[k];
  2945. }));
  2946. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  2947. Object.defineProperty(o, "default", { enumerable: true, value: v });
  2948. }) : function(o, v) {
  2949. o["default"] = v;
  2950. });
  2951. var __importStar = (this && this.__importStar) || function (mod) {
  2952. if (mod && mod.__esModule) return mod;
  2953. var result = {};
  2954. if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  2955. __setModuleDefault(result, mod);
  2956. return result;
  2957. };
  2958. Object.defineProperty(exports, "__esModule", ({ value: true }));
  2959. exports.prepareKeyValueMessage = exports.issueFileCommand = void 0;
  2960. // We use any as a valid input type
  2961. /* eslint-disable @typescript-eslint/no-explicit-any */
  2962. const fs = __importStar(__nccwpck_require__(7147));
  2963. const os = __importStar(__nccwpck_require__(2037));
  2964. const uuid_1 = __nccwpck_require__(8974);
  2965. const utils_1 = __nccwpck_require__(5278);
  2966. function issueFileCommand(command, message) {
  2967. const filePath = process.env[`GITHUB_${command}`];
  2968. if (!filePath) {
  2969. throw new Error(`Unable to find environment variable for file command ${command}`);
  2970. }
  2971. if (!fs.existsSync(filePath)) {
  2972. throw new Error(`Missing file at path: ${filePath}`);
  2973. }
  2974. fs.appendFileSync(filePath, `${utils_1.toCommandValue(message)}${os.EOL}`, {
  2975. encoding: 'utf8'
  2976. });
  2977. }
  2978. exports.issueFileCommand = issueFileCommand;
  2979. function prepareKeyValueMessage(key, value) {
  2980. const delimiter = `ghadelimiter_${uuid_1.v4()}`;
  2981. const convertedValue = utils_1.toCommandValue(value);
  2982. // These should realistically never happen, but just in case someone finds a
  2983. // way to exploit uuid generation let's not allow keys or values that contain
  2984. // the delimiter.
  2985. if (key.includes(delimiter)) {
  2986. throw new Error(`Unexpected input: name should not contain the delimiter "${delimiter}"`);
  2987. }
  2988. if (convertedValue.includes(delimiter)) {
  2989. throw new Error(`Unexpected input: value should not contain the delimiter "${delimiter}"`);
  2990. }
  2991. return `${key}<<${delimiter}${os.EOL}${convertedValue}${os.EOL}${delimiter}`;
  2992. }
  2993. exports.prepareKeyValueMessage = prepareKeyValueMessage;
  2994. //# sourceMappingURL=file-command.js.map
  2995. /***/ }),
  2996. /***/ 8041:
  2997. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  2998. "use strict";
  2999. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  3000. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  3001. return new (P || (P = Promise))(function (resolve, reject) {
  3002. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  3003. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  3004. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  3005. step((generator = generator.apply(thisArg, _arguments || [])).next());
  3006. });
  3007. };
  3008. Object.defineProperty(exports, "__esModule", ({ value: true }));
  3009. exports.OidcClient = void 0;
  3010. const http_client_1 = __nccwpck_require__(6255);
  3011. const auth_1 = __nccwpck_require__(5526);
  3012. const core_1 = __nccwpck_require__(2186);
  3013. class OidcClient {
  3014. static createHttpClient(allowRetry = true, maxRetry = 10) {
  3015. const requestOptions = {
  3016. allowRetries: allowRetry,
  3017. maxRetries: maxRetry
  3018. };
  3019. return new http_client_1.HttpClient('actions/oidc-client', [new auth_1.BearerCredentialHandler(OidcClient.getRequestToken())], requestOptions);
  3020. }
  3021. static getRequestToken() {
  3022. const token = process.env['ACTIONS_ID_TOKEN_REQUEST_TOKEN'];
  3023. if (!token) {
  3024. throw new Error('Unable to get ACTIONS_ID_TOKEN_REQUEST_TOKEN env variable');
  3025. }
  3026. return token;
  3027. }
  3028. static getIDTokenUrl() {
  3029. const runtimeUrl = process.env['ACTIONS_ID_TOKEN_REQUEST_URL'];
  3030. if (!runtimeUrl) {
  3031. throw new Error('Unable to get ACTIONS_ID_TOKEN_REQUEST_URL env variable');
  3032. }
  3033. return runtimeUrl;
  3034. }
  3035. static getCall(id_token_url) {
  3036. var _a;
  3037. return __awaiter(this, void 0, void 0, function* () {
  3038. const httpclient = OidcClient.createHttpClient();
  3039. const res = yield httpclient
  3040. .getJson(id_token_url)
  3041. .catch(error => {
  3042. throw new Error(`Failed to get ID Token. \n
  3043. Error Code : ${error.statusCode}\n
  3044. Error Message: ${error.message}`);
  3045. });
  3046. const id_token = (_a = res.result) === null || _a === void 0 ? void 0 : _a.value;
  3047. if (!id_token) {
  3048. throw new Error('Response json body do not have ID Token field');
  3049. }
  3050. return id_token;
  3051. });
  3052. }
  3053. static getIDToken(audience) {
  3054. return __awaiter(this, void 0, void 0, function* () {
  3055. try {
  3056. // New ID Token is requested from action service
  3057. let id_token_url = OidcClient.getIDTokenUrl();
  3058. if (audience) {
  3059. const encodedAudience = encodeURIComponent(audience);
  3060. id_token_url = `${id_token_url}&audience=${encodedAudience}`;
  3061. }
  3062. core_1.debug(`ID token url is ${id_token_url}`);
  3063. const id_token = yield OidcClient.getCall(id_token_url);
  3064. core_1.setSecret(id_token);
  3065. return id_token;
  3066. }
  3067. catch (error) {
  3068. throw new Error(`Error message: ${error.message}`);
  3069. }
  3070. });
  3071. }
  3072. }
  3073. exports.OidcClient = OidcClient;
  3074. //# sourceMappingURL=oidc-utils.js.map
  3075. /***/ }),
  3076. /***/ 2981:
  3077. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  3078. "use strict";
  3079. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  3080. if (k2 === undefined) k2 = k;
  3081. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  3082. }) : (function(o, m, k, k2) {
  3083. if (k2 === undefined) k2 = k;
  3084. o[k2] = m[k];
  3085. }));
  3086. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  3087. Object.defineProperty(o, "default", { enumerable: true, value: v });
  3088. }) : function(o, v) {
  3089. o["default"] = v;
  3090. });
  3091. var __importStar = (this && this.__importStar) || function (mod) {
  3092. if (mod && mod.__esModule) return mod;
  3093. var result = {};
  3094. if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  3095. __setModuleDefault(result, mod);
  3096. return result;
  3097. };
  3098. Object.defineProperty(exports, "__esModule", ({ value: true }));
  3099. exports.toPlatformPath = exports.toWin32Path = exports.toPosixPath = void 0;
  3100. const path = __importStar(__nccwpck_require__(1017));
  3101. /**
  3102. * toPosixPath converts the given path to the posix form. On Windows, \\ will be
  3103. * replaced with /.
  3104. *
  3105. * @param pth. Path to transform.
  3106. * @return string Posix path.
  3107. */
  3108. function toPosixPath(pth) {
  3109. return pth.replace(/[\\]/g, '/');
  3110. }
  3111. exports.toPosixPath = toPosixPath;
  3112. /**
  3113. * toWin32Path converts the given path to the win32 form. On Linux, / will be
  3114. * replaced with \\.
  3115. *
  3116. * @param pth. Path to transform.
  3117. * @return string Win32 path.
  3118. */
  3119. function toWin32Path(pth) {
  3120. return pth.replace(/[/]/g, '\\');
  3121. }
  3122. exports.toWin32Path = toWin32Path;
  3123. /**
  3124. * toPlatformPath converts the given path to a platform-specific path. It does
  3125. * this by replacing instances of / and \ with the platform-specific path
  3126. * separator.
  3127. *
  3128. * @param pth The path to platformize.
  3129. * @return string The platform-specific path.
  3130. */
  3131. function toPlatformPath(pth) {
  3132. return pth.replace(/[/\\]/g, path.sep);
  3133. }
  3134. exports.toPlatformPath = toPlatformPath;
  3135. //# sourceMappingURL=path-utils.js.map
  3136. /***/ }),
  3137. /***/ 1327:
  3138. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  3139. "use strict";
  3140. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  3141. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  3142. return new (P || (P = Promise))(function (resolve, reject) {
  3143. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  3144. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  3145. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  3146. step((generator = generator.apply(thisArg, _arguments || [])).next());
  3147. });
  3148. };
  3149. Object.defineProperty(exports, "__esModule", ({ value: true }));
  3150. exports.summary = exports.markdownSummary = exports.SUMMARY_DOCS_URL = exports.SUMMARY_ENV_VAR = void 0;
  3151. const os_1 = __nccwpck_require__(2037);
  3152. const fs_1 = __nccwpck_require__(7147);
  3153. const { access, appendFile, writeFile } = fs_1.promises;
  3154. exports.SUMMARY_ENV_VAR = 'GITHUB_STEP_SUMMARY';
  3155. exports.SUMMARY_DOCS_URL = 'https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#adding-a-job-summary';
  3156. class Summary {
  3157. constructor() {
  3158. this._buffer = '';
  3159. }
  3160. /**
  3161. * Finds the summary file path from the environment, rejects if env var is not found or file does not exist
  3162. * Also checks r/w permissions.
  3163. *
  3164. * @returns step summary file path
  3165. */
  3166. filePath() {
  3167. return __awaiter(this, void 0, void 0, function* () {
  3168. if (this._filePath) {
  3169. return this._filePath;
  3170. }
  3171. const pathFromEnv = process.env[exports.SUMMARY_ENV_VAR];
  3172. if (!pathFromEnv) {
  3173. throw new Error(`Unable to find environment variable for $${exports.SUMMARY_ENV_VAR}. Check if your runtime environment supports job summaries.`);
  3174. }
  3175. try {
  3176. yield access(pathFromEnv, fs_1.constants.R_OK | fs_1.constants.W_OK);
  3177. }
  3178. catch (_a) {
  3179. throw new Error(`Unable to access summary file: '${pathFromEnv}'. Check if the file has correct read/write permissions.`);
  3180. }
  3181. this._filePath = pathFromEnv;
  3182. return this._filePath;
  3183. });
  3184. }
  3185. /**
  3186. * Wraps content in an HTML tag, adding any HTML attributes
  3187. *
  3188. * @param {string} tag HTML tag to wrap
  3189. * @param {string | null} content content within the tag
  3190. * @param {[attribute: string]: string} attrs key-value list of HTML attributes to add
  3191. *
  3192. * @returns {string} content wrapped in HTML element
  3193. */
  3194. wrap(tag, content, attrs = {}) {
  3195. const htmlAttrs = Object.entries(attrs)
  3196. .map(([key, value]) => ` ${key}="${value}"`)
  3197. .join('');
  3198. if (!content) {
  3199. return `<${tag}${htmlAttrs}>`;
  3200. }
  3201. return `<${tag}${htmlAttrs}>${content}</${tag}>`;
  3202. }
  3203. /**
  3204. * Writes text in the buffer to the summary buffer file and empties buffer. Will append by default.
  3205. *
  3206. * @param {SummaryWriteOptions} [options] (optional) options for write operation
  3207. *
  3208. * @returns {Promise<Summary>} summary instance
  3209. */
  3210. write(options) {
  3211. return __awaiter(this, void 0, void 0, function* () {
  3212. const overwrite = !!(options === null || options === void 0 ? void 0 : options.overwrite);
  3213. const filePath = yield this.filePath();
  3214. const writeFunc = overwrite ? writeFile : appendFile;
  3215. yield writeFunc(filePath, this._buffer, { encoding: 'utf8' });
  3216. return this.emptyBuffer();
  3217. });
  3218. }
  3219. /**
  3220. * Clears the summary buffer and wipes the summary file
  3221. *
  3222. * @returns {Summary} summary instance
  3223. */
  3224. clear() {
  3225. return __awaiter(this, void 0, void 0, function* () {
  3226. return this.emptyBuffer().write({ overwrite: true });
  3227. });
  3228. }
  3229. /**
  3230. * Returns the current summary buffer as a string
  3231. *
  3232. * @returns {string} string of summary buffer
  3233. */
  3234. stringify() {
  3235. return this._buffer;
  3236. }
  3237. /**
  3238. * If the summary buffer is empty
  3239. *
  3240. * @returns {boolen} true if the buffer is empty
  3241. */
  3242. isEmptyBuffer() {
  3243. return this._buffer.length === 0;
  3244. }
  3245. /**
  3246. * Resets the summary buffer without writing to summary file
  3247. *
  3248. * @returns {Summary} summary instance
  3249. */
  3250. emptyBuffer() {
  3251. this._buffer = '';
  3252. return this;
  3253. }
  3254. /**
  3255. * Adds raw text to the summary buffer
  3256. *
  3257. * @param {string} text content to add
  3258. * @param {boolean} [addEOL=false] (optional) append an EOL to the raw text (default: false)
  3259. *
  3260. * @returns {Summary} summary instance
  3261. */
  3262. addRaw(text, addEOL = false) {
  3263. this._buffer += text;
  3264. return addEOL ? this.addEOL() : this;
  3265. }
  3266. /**
  3267. * Adds the operating system-specific end-of-line marker to the buffer
  3268. *
  3269. * @returns {Summary} summary instance
  3270. */
  3271. addEOL() {
  3272. return this.addRaw(os_1.EOL);
  3273. }
  3274. /**
  3275. * Adds an HTML codeblock to the summary buffer
  3276. *
  3277. * @param {string} code content to render within fenced code block
  3278. * @param {string} lang (optional) language to syntax highlight code
  3279. *
  3280. * @returns {Summary} summary instance
  3281. */
  3282. addCodeBlock(code, lang) {
  3283. const attrs = Object.assign({}, (lang && { lang }));
  3284. const element = this.wrap('pre', this.wrap('code', code), attrs);
  3285. return this.addRaw(element).addEOL();
  3286. }
  3287. /**
  3288. * Adds an HTML list to the summary buffer
  3289. *
  3290. * @param {string[]} items list of items to render
  3291. * @param {boolean} [ordered=false] (optional) if the rendered list should be ordered or not (default: false)
  3292. *
  3293. * @returns {Summary} summary instance
  3294. */
  3295. addList(items, ordered = false) {
  3296. const tag = ordered ? 'ol' : 'ul';
  3297. const listItems = items.map(item => this.wrap('li', item)).join('');
  3298. const element = this.wrap(tag, listItems);
  3299. return this.addRaw(element).addEOL();
  3300. }
  3301. /**
  3302. * Adds an HTML table to the summary buffer
  3303. *
  3304. * @param {SummaryTableCell[]} rows table rows
  3305. *
  3306. * @returns {Summary} summary instance
  3307. */
  3308. addTable(rows) {
  3309. const tableBody = rows
  3310. .map(row => {
  3311. const cells = row
  3312. .map(cell => {
  3313. if (typeof cell === 'string') {
  3314. return this.wrap('td', cell);
  3315. }
  3316. const { header, data, colspan, rowspan } = cell;
  3317. const tag = header ? 'th' : 'td';
  3318. const attrs = Object.assign(Object.assign({}, (colspan && { colspan })), (rowspan && { rowspan }));
  3319. return this.wrap(tag, data, attrs);
  3320. })
  3321. .join('');
  3322. return this.wrap('tr', cells);
  3323. })
  3324. .join('');
  3325. const element = this.wrap('table', tableBody);
  3326. return this.addRaw(element).addEOL();
  3327. }
  3328. /**
  3329. * Adds a collapsable HTML details element to the summary buffer
  3330. *
  3331. * @param {string} label text for the closed state
  3332. * @param {string} content collapsable content
  3333. *
  3334. * @returns {Summary} summary instance
  3335. */
  3336. addDetails(label, content) {
  3337. const element = this.wrap('details', this.wrap('summary', label) + content);
  3338. return this.addRaw(element).addEOL();
  3339. }
  3340. /**
  3341. * Adds an HTML image tag to the summary buffer
  3342. *
  3343. * @param {string} src path to the image you to embed
  3344. * @param {string} alt text description of the image
  3345. * @param {SummaryImageOptions} options (optional) addition image attributes
  3346. *
  3347. * @returns {Summary} summary instance
  3348. */
  3349. addImage(src, alt, options) {
  3350. const { width, height } = options || {};
  3351. const attrs = Object.assign(Object.assign({}, (width && { width })), (height && { height }));
  3352. const element = this.wrap('img', null, Object.assign({ src, alt }, attrs));
  3353. return this.addRaw(element).addEOL();
  3354. }
  3355. /**
  3356. * Adds an HTML section heading element
  3357. *
  3358. * @param {string} text heading text
  3359. * @param {number | string} [level=1] (optional) the heading level, default: 1
  3360. *
  3361. * @returns {Summary} summary instance
  3362. */
  3363. addHeading(text, level) {
  3364. const tag = `h${level}`;
  3365. const allowedTag = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'].includes(tag)
  3366. ? tag
  3367. : 'h1';
  3368. const element = this.wrap(allowedTag, text);
  3369. return this.addRaw(element).addEOL();
  3370. }
  3371. /**
  3372. * Adds an HTML thematic break (<hr>) to the summary buffer
  3373. *
  3374. * @returns {Summary} summary instance
  3375. */
  3376. addSeparator() {
  3377. const element = this.wrap('hr', null);
  3378. return this.addRaw(element).addEOL();
  3379. }
  3380. /**
  3381. * Adds an HTML line break (<br>) to the summary buffer
  3382. *
  3383. * @returns {Summary} summary instance
  3384. */
  3385. addBreak() {
  3386. const element = this.wrap('br', null);
  3387. return this.addRaw(element).addEOL();
  3388. }
  3389. /**
  3390. * Adds an HTML blockquote to the summary buffer
  3391. *
  3392. * @param {string} text quote text
  3393. * @param {string} cite (optional) citation url
  3394. *
  3395. * @returns {Summary} summary instance
  3396. */
  3397. addQuote(text, cite) {
  3398. const attrs = Object.assign({}, (cite && { cite }));
  3399. const element = this.wrap('blockquote', text, attrs);
  3400. return this.addRaw(element).addEOL();
  3401. }
  3402. /**
  3403. * Adds an HTML anchor tag to the summary buffer
  3404. *
  3405. * @param {string} text link text/content
  3406. * @param {string} href hyperlink
  3407. *
  3408. * @returns {Summary} summary instance
  3409. */
  3410. addLink(text, href) {
  3411. const element = this.wrap('a', text, { href });
  3412. return this.addRaw(element).addEOL();
  3413. }
  3414. }
  3415. const _summary = new Summary();
  3416. /**
  3417. * @deprecated use `core.summary`
  3418. */
  3419. exports.markdownSummary = _summary;
  3420. exports.summary = _summary;
  3421. //# sourceMappingURL=summary.js.map
  3422. /***/ }),
  3423. /***/ 5278:
  3424. /***/ ((__unused_webpack_module, exports) => {
  3425. "use strict";
  3426. // We use any as a valid input type
  3427. /* eslint-disable @typescript-eslint/no-explicit-any */
  3428. Object.defineProperty(exports, "__esModule", ({ value: true }));
  3429. exports.toCommandProperties = exports.toCommandValue = void 0;
  3430. /**
  3431. * Sanitizes an input into a string so it can be passed into issueCommand safely
  3432. * @param input input to sanitize into a string
  3433. */
  3434. function toCommandValue(input) {
  3435. if (input === null || input === undefined) {
  3436. return '';
  3437. }
  3438. else if (typeof input === 'string' || input instanceof String) {
  3439. return input;
  3440. }
  3441. return JSON.stringify(input);
  3442. }
  3443. exports.toCommandValue = toCommandValue;
  3444. /**
  3445. *
  3446. * @param annotationProperties
  3447. * @returns The command properties to send with the actual annotation command
  3448. * See IssueCommandProperties: https://github.com/actions/runner/blob/main/src/Runner.Worker/ActionCommandManager.cs#L646
  3449. */
  3450. function toCommandProperties(annotationProperties) {
  3451. if (!Object.keys(annotationProperties).length) {
  3452. return {};
  3453. }
  3454. return {
  3455. title: annotationProperties.title,
  3456. file: annotationProperties.file,
  3457. line: annotationProperties.startLine,
  3458. endLine: annotationProperties.endLine,
  3459. col: annotationProperties.startColumn,
  3460. endColumn: annotationProperties.endColumn
  3461. };
  3462. }
  3463. exports.toCommandProperties = toCommandProperties;
  3464. //# sourceMappingURL=utils.js.map
  3465. /***/ }),
  3466. /***/ 8974:
  3467. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  3468. "use strict";
  3469. Object.defineProperty(exports, "__esModule", ({
  3470. value: true
  3471. }));
  3472. Object.defineProperty(exports, "v1", ({
  3473. enumerable: true,
  3474. get: function () {
  3475. return _v.default;
  3476. }
  3477. }));
  3478. Object.defineProperty(exports, "v3", ({
  3479. enumerable: true,
  3480. get: function () {
  3481. return _v2.default;
  3482. }
  3483. }));
  3484. Object.defineProperty(exports, "v4", ({
  3485. enumerable: true,
  3486. get: function () {
  3487. return _v3.default;
  3488. }
  3489. }));
  3490. Object.defineProperty(exports, "v5", ({
  3491. enumerable: true,
  3492. get: function () {
  3493. return _v4.default;
  3494. }
  3495. }));
  3496. Object.defineProperty(exports, "NIL", ({
  3497. enumerable: true,
  3498. get: function () {
  3499. return _nil.default;
  3500. }
  3501. }));
  3502. Object.defineProperty(exports, "version", ({
  3503. enumerable: true,
  3504. get: function () {
  3505. return _version.default;
  3506. }
  3507. }));
  3508. Object.defineProperty(exports, "validate", ({
  3509. enumerable: true,
  3510. get: function () {
  3511. return _validate.default;
  3512. }
  3513. }));
  3514. Object.defineProperty(exports, "stringify", ({
  3515. enumerable: true,
  3516. get: function () {
  3517. return _stringify.default;
  3518. }
  3519. }));
  3520. Object.defineProperty(exports, "parse", ({
  3521. enumerable: true,
  3522. get: function () {
  3523. return _parse.default;
  3524. }
  3525. }));
  3526. var _v = _interopRequireDefault(__nccwpck_require__(1595));
  3527. var _v2 = _interopRequireDefault(__nccwpck_require__(6993));
  3528. var _v3 = _interopRequireDefault(__nccwpck_require__(1472));
  3529. var _v4 = _interopRequireDefault(__nccwpck_require__(6217));
  3530. var _nil = _interopRequireDefault(__nccwpck_require__(2381));
  3531. var _version = _interopRequireDefault(__nccwpck_require__(427));
  3532. var _validate = _interopRequireDefault(__nccwpck_require__(2609));
  3533. var _stringify = _interopRequireDefault(__nccwpck_require__(1458));
  3534. var _parse = _interopRequireDefault(__nccwpck_require__(6385));
  3535. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  3536. /***/ }),
  3537. /***/ 5842:
  3538. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  3539. "use strict";
  3540. Object.defineProperty(exports, "__esModule", ({
  3541. value: true
  3542. }));
  3543. exports["default"] = void 0;
  3544. var _crypto = _interopRequireDefault(__nccwpck_require__(6113));
  3545. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  3546. function md5(bytes) {
  3547. if (Array.isArray(bytes)) {
  3548. bytes = Buffer.from(bytes);
  3549. } else if (typeof bytes === 'string') {
  3550. bytes = Buffer.from(bytes, 'utf8');
  3551. }
  3552. return _crypto.default.createHash('md5').update(bytes).digest();
  3553. }
  3554. var _default = md5;
  3555. exports["default"] = _default;
  3556. /***/ }),
  3557. /***/ 2381:
  3558. /***/ ((__unused_webpack_module, exports) => {
  3559. "use strict";
  3560. Object.defineProperty(exports, "__esModule", ({
  3561. value: true
  3562. }));
  3563. exports["default"] = void 0;
  3564. var _default = '00000000-0000-0000-0000-000000000000';
  3565. exports["default"] = _default;
  3566. /***/ }),
  3567. /***/ 6385:
  3568. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  3569. "use strict";
  3570. Object.defineProperty(exports, "__esModule", ({
  3571. value: true
  3572. }));
  3573. exports["default"] = void 0;
  3574. var _validate = _interopRequireDefault(__nccwpck_require__(2609));
  3575. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  3576. function parse(uuid) {
  3577. if (!(0, _validate.default)(uuid)) {
  3578. throw TypeError('Invalid UUID');
  3579. }
  3580. let v;
  3581. const arr = new Uint8Array(16); // Parse ########-....-....-....-............
  3582. arr[0] = (v = parseInt(uuid.slice(0, 8), 16)) >>> 24;
  3583. arr[1] = v >>> 16 & 0xff;
  3584. arr[2] = v >>> 8 & 0xff;
  3585. arr[3] = v & 0xff; // Parse ........-####-....-....-............
  3586. arr[4] = (v = parseInt(uuid.slice(9, 13), 16)) >>> 8;
  3587. arr[5] = v & 0xff; // Parse ........-....-####-....-............
  3588. arr[6] = (v = parseInt(uuid.slice(14, 18), 16)) >>> 8;
  3589. arr[7] = v & 0xff; // Parse ........-....-....-####-............
  3590. arr[8] = (v = parseInt(uuid.slice(19, 23), 16)) >>> 8;
  3591. arr[9] = v & 0xff; // Parse ........-....-....-....-############
  3592. // (Use "/" to avoid 32-bit truncation when bit-shifting high-order bytes)
  3593. arr[10] = (v = parseInt(uuid.slice(24, 36), 16)) / 0x10000000000 & 0xff;
  3594. arr[11] = v / 0x100000000 & 0xff;
  3595. arr[12] = v >>> 24 & 0xff;
  3596. arr[13] = v >>> 16 & 0xff;
  3597. arr[14] = v >>> 8 & 0xff;
  3598. arr[15] = v & 0xff;
  3599. return arr;
  3600. }
  3601. var _default = parse;
  3602. exports["default"] = _default;
  3603. /***/ }),
  3604. /***/ 6230:
  3605. /***/ ((__unused_webpack_module, exports) => {
  3606. "use strict";
  3607. Object.defineProperty(exports, "__esModule", ({
  3608. value: true
  3609. }));
  3610. exports["default"] = void 0;
  3611. 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;
  3612. exports["default"] = _default;
  3613. /***/ }),
  3614. /***/ 9784:
  3615. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  3616. "use strict";
  3617. Object.defineProperty(exports, "__esModule", ({
  3618. value: true
  3619. }));
  3620. exports["default"] = rng;
  3621. var _crypto = _interopRequireDefault(__nccwpck_require__(6113));
  3622. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  3623. const rnds8Pool = new Uint8Array(256); // # of random values to pre-allocate
  3624. let poolPtr = rnds8Pool.length;
  3625. function rng() {
  3626. if (poolPtr > rnds8Pool.length - 16) {
  3627. _crypto.default.randomFillSync(rnds8Pool);
  3628. poolPtr = 0;
  3629. }
  3630. return rnds8Pool.slice(poolPtr, poolPtr += 16);
  3631. }
  3632. /***/ }),
  3633. /***/ 8844:
  3634. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  3635. "use strict";
  3636. Object.defineProperty(exports, "__esModule", ({
  3637. value: true
  3638. }));
  3639. exports["default"] = void 0;
  3640. var _crypto = _interopRequireDefault(__nccwpck_require__(6113));
  3641. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  3642. function sha1(bytes) {
  3643. if (Array.isArray(bytes)) {
  3644. bytes = Buffer.from(bytes);
  3645. } else if (typeof bytes === 'string') {
  3646. bytes = Buffer.from(bytes, 'utf8');
  3647. }
  3648. return _crypto.default.createHash('sha1').update(bytes).digest();
  3649. }
  3650. var _default = sha1;
  3651. exports["default"] = _default;
  3652. /***/ }),
  3653. /***/ 1458:
  3654. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  3655. "use strict";
  3656. Object.defineProperty(exports, "__esModule", ({
  3657. value: true
  3658. }));
  3659. exports["default"] = void 0;
  3660. var _validate = _interopRequireDefault(__nccwpck_require__(2609));
  3661. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  3662. /**
  3663. * Convert array of 16 byte values to UUID string format of the form:
  3664. * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
  3665. */
  3666. const byteToHex = [];
  3667. for (let i = 0; i < 256; ++i) {
  3668. byteToHex.push((i + 0x100).toString(16).substr(1));
  3669. }
  3670. function stringify(arr, offset = 0) {
  3671. // Note: Be careful editing this code! It's been tuned for performance
  3672. // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
  3673. 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
  3674. // of the following:
  3675. // - One or more input array values don't map to a hex octet (leading to
  3676. // "undefined" in the uuid)
  3677. // - Invalid input values for the RFC `version` or `variant` fields
  3678. if (!(0, _validate.default)(uuid)) {
  3679. throw TypeError('Stringified UUID is invalid');
  3680. }
  3681. return uuid;
  3682. }
  3683. var _default = stringify;
  3684. exports["default"] = _default;
  3685. /***/ }),
  3686. /***/ 1595:
  3687. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  3688. "use strict";
  3689. Object.defineProperty(exports, "__esModule", ({
  3690. value: true
  3691. }));
  3692. exports["default"] = void 0;
  3693. var _rng = _interopRequireDefault(__nccwpck_require__(9784));
  3694. var _stringify = _interopRequireDefault(__nccwpck_require__(1458));
  3695. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  3696. // **`v1()` - Generate time-based UUID**
  3697. //
  3698. // Inspired by https://github.com/LiosK/UUID.js
  3699. // and http://docs.python.org/library/uuid.html
  3700. let _nodeId;
  3701. let _clockseq; // Previous uuid creation time
  3702. let _lastMSecs = 0;
  3703. let _lastNSecs = 0; // See https://github.com/uuidjs/uuid for API details
  3704. function v1(options, buf, offset) {
  3705. let i = buf && offset || 0;
  3706. const b = buf || new Array(16);
  3707. options = options || {};
  3708. let node = options.node || _nodeId;
  3709. let clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq; // node and clockseq need to be initialized to random values if they're not
  3710. // specified. We do this lazily to minimize issues related to insufficient
  3711. // system entropy. See #189
  3712. if (node == null || clockseq == null) {
  3713. const seedBytes = options.random || (options.rng || _rng.default)();
  3714. if (node == null) {
  3715. // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1)
  3716. node = _nodeId = [seedBytes[0] | 0x01, seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]];
  3717. }
  3718. if (clockseq == null) {
  3719. // Per 4.2.2, randomize (14 bit) clockseq
  3720. clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff;
  3721. }
  3722. } // UUID timestamps are 100 nano-second units since the Gregorian epoch,
  3723. // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so
  3724. // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs'
  3725. // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00.
  3726. let msecs = options.msecs !== undefined ? options.msecs : Date.now(); // Per 4.2.1.2, use count of uuid's generated during the current clock
  3727. // cycle to simulate higher resolution clock
  3728. let nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1; // Time since last uuid creation (in msecs)
  3729. const dt = msecs - _lastMSecs + (nsecs - _lastNSecs) / 10000; // Per 4.2.1.2, Bump clockseq on clock regression
  3730. if (dt < 0 && options.clockseq === undefined) {
  3731. clockseq = clockseq + 1 & 0x3fff;
  3732. } // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new
  3733. // time interval
  3734. if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) {
  3735. nsecs = 0;
  3736. } // Per 4.2.1.2 Throw error if too many uuids are requested
  3737. if (nsecs >= 10000) {
  3738. throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");
  3739. }
  3740. _lastMSecs = msecs;
  3741. _lastNSecs = nsecs;
  3742. _clockseq = clockseq; // Per 4.1.4 - Convert from unix epoch to Gregorian epoch
  3743. msecs += 12219292800000; // `time_low`
  3744. const tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000;
  3745. b[i++] = tl >>> 24 & 0xff;
  3746. b[i++] = tl >>> 16 & 0xff;
  3747. b[i++] = tl >>> 8 & 0xff;
  3748. b[i++] = tl & 0xff; // `time_mid`
  3749. const tmh = msecs / 0x100000000 * 10000 & 0xfffffff;
  3750. b[i++] = tmh >>> 8 & 0xff;
  3751. b[i++] = tmh & 0xff; // `time_high_and_version`
  3752. b[i++] = tmh >>> 24 & 0xf | 0x10; // include version
  3753. b[i++] = tmh >>> 16 & 0xff; // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant)
  3754. b[i++] = clockseq >>> 8 | 0x80; // `clock_seq_low`
  3755. b[i++] = clockseq & 0xff; // `node`
  3756. for (let n = 0; n < 6; ++n) {
  3757. b[i + n] = node[n];
  3758. }
  3759. return buf || (0, _stringify.default)(b);
  3760. }
  3761. var _default = v1;
  3762. exports["default"] = _default;
  3763. /***/ }),
  3764. /***/ 6993:
  3765. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  3766. "use strict";
  3767. Object.defineProperty(exports, "__esModule", ({
  3768. value: true
  3769. }));
  3770. exports["default"] = void 0;
  3771. var _v = _interopRequireDefault(__nccwpck_require__(5920));
  3772. var _md = _interopRequireDefault(__nccwpck_require__(5842));
  3773. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  3774. const v3 = (0, _v.default)('v3', 0x30, _md.default);
  3775. var _default = v3;
  3776. exports["default"] = _default;
  3777. /***/ }),
  3778. /***/ 5920:
  3779. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  3780. "use strict";
  3781. Object.defineProperty(exports, "__esModule", ({
  3782. value: true
  3783. }));
  3784. exports["default"] = _default;
  3785. exports.URL = exports.DNS = void 0;
  3786. var _stringify = _interopRequireDefault(__nccwpck_require__(1458));
  3787. var _parse = _interopRequireDefault(__nccwpck_require__(6385));
  3788. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  3789. function stringToBytes(str) {
  3790. str = unescape(encodeURIComponent(str)); // UTF8 escape
  3791. const bytes = [];
  3792. for (let i = 0; i < str.length; ++i) {
  3793. bytes.push(str.charCodeAt(i));
  3794. }
  3795. return bytes;
  3796. }
  3797. const DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8';
  3798. exports.DNS = DNS;
  3799. const URL = '6ba7b811-9dad-11d1-80b4-00c04fd430c8';
  3800. exports.URL = URL;
  3801. function _default(name, version, hashfunc) {
  3802. function generateUUID(value, namespace, buf, offset) {
  3803. if (typeof value === 'string') {
  3804. value = stringToBytes(value);
  3805. }
  3806. if (typeof namespace === 'string') {
  3807. namespace = (0, _parse.default)(namespace);
  3808. }
  3809. if (namespace.length !== 16) {
  3810. throw TypeError('Namespace must be array-like (16 iterable integer values, 0-255)');
  3811. } // Compute hash of namespace and value, Per 4.3
  3812. // Future: Use spread syntax when supported on all platforms, e.g. `bytes =
  3813. // hashfunc([...namespace, ... value])`
  3814. let bytes = new Uint8Array(16 + value.length);
  3815. bytes.set(namespace);
  3816. bytes.set(value, namespace.length);
  3817. bytes = hashfunc(bytes);
  3818. bytes[6] = bytes[6] & 0x0f | version;
  3819. bytes[8] = bytes[8] & 0x3f | 0x80;
  3820. if (buf) {
  3821. offset = offset || 0;
  3822. for (let i = 0; i < 16; ++i) {
  3823. buf[offset + i] = bytes[i];
  3824. }
  3825. return buf;
  3826. }
  3827. return (0, _stringify.default)(bytes);
  3828. } // Function#name is not settable on some platforms (#270)
  3829. try {
  3830. generateUUID.name = name; // eslint-disable-next-line no-empty
  3831. } catch (err) {} // For CommonJS default export support
  3832. generateUUID.DNS = DNS;
  3833. generateUUID.URL = URL;
  3834. return generateUUID;
  3835. }
  3836. /***/ }),
  3837. /***/ 1472:
  3838. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  3839. "use strict";
  3840. Object.defineProperty(exports, "__esModule", ({
  3841. value: true
  3842. }));
  3843. exports["default"] = void 0;
  3844. var _rng = _interopRequireDefault(__nccwpck_require__(9784));
  3845. var _stringify = _interopRequireDefault(__nccwpck_require__(1458));
  3846. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  3847. function v4(options, buf, offset) {
  3848. options = options || {};
  3849. const rnds = options.random || (options.rng || _rng.default)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
  3850. rnds[6] = rnds[6] & 0x0f | 0x40;
  3851. rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided
  3852. if (buf) {
  3853. offset = offset || 0;
  3854. for (let i = 0; i < 16; ++i) {
  3855. buf[offset + i] = rnds[i];
  3856. }
  3857. return buf;
  3858. }
  3859. return (0, _stringify.default)(rnds);
  3860. }
  3861. var _default = v4;
  3862. exports["default"] = _default;
  3863. /***/ }),
  3864. /***/ 6217:
  3865. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  3866. "use strict";
  3867. Object.defineProperty(exports, "__esModule", ({
  3868. value: true
  3869. }));
  3870. exports["default"] = void 0;
  3871. var _v = _interopRequireDefault(__nccwpck_require__(5920));
  3872. var _sha = _interopRequireDefault(__nccwpck_require__(8844));
  3873. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  3874. const v5 = (0, _v.default)('v5', 0x50, _sha.default);
  3875. var _default = v5;
  3876. exports["default"] = _default;
  3877. /***/ }),
  3878. /***/ 2609:
  3879. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  3880. "use strict";
  3881. Object.defineProperty(exports, "__esModule", ({
  3882. value: true
  3883. }));
  3884. exports["default"] = void 0;
  3885. var _regex = _interopRequireDefault(__nccwpck_require__(6230));
  3886. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  3887. function validate(uuid) {
  3888. return typeof uuid === 'string' && _regex.default.test(uuid);
  3889. }
  3890. var _default = validate;
  3891. exports["default"] = _default;
  3892. /***/ }),
  3893. /***/ 427:
  3894. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  3895. "use strict";
  3896. Object.defineProperty(exports, "__esModule", ({
  3897. value: true
  3898. }));
  3899. exports["default"] = void 0;
  3900. var _validate = _interopRequireDefault(__nccwpck_require__(2609));
  3901. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  3902. function version(uuid) {
  3903. if (!(0, _validate.default)(uuid)) {
  3904. throw TypeError('Invalid UUID');
  3905. }
  3906. return parseInt(uuid.substr(14, 1), 16);
  3907. }
  3908. var _default = version;
  3909. exports["default"] = _default;
  3910. /***/ }),
  3911. /***/ 1514:
  3912. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  3913. "use strict";
  3914. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  3915. if (k2 === undefined) k2 = k;
  3916. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  3917. }) : (function(o, m, k, k2) {
  3918. if (k2 === undefined) k2 = k;
  3919. o[k2] = m[k];
  3920. }));
  3921. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  3922. Object.defineProperty(o, "default", { enumerable: true, value: v });
  3923. }) : function(o, v) {
  3924. o["default"] = v;
  3925. });
  3926. var __importStar = (this && this.__importStar) || function (mod) {
  3927. if (mod && mod.__esModule) return mod;
  3928. var result = {};
  3929. if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  3930. __setModuleDefault(result, mod);
  3931. return result;
  3932. };
  3933. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  3934. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  3935. return new (P || (P = Promise))(function (resolve, reject) {
  3936. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  3937. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  3938. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  3939. step((generator = generator.apply(thisArg, _arguments || [])).next());
  3940. });
  3941. };
  3942. Object.defineProperty(exports, "__esModule", ({ value: true }));
  3943. exports.getExecOutput = exports.exec = void 0;
  3944. const string_decoder_1 = __nccwpck_require__(1576);
  3945. const tr = __importStar(__nccwpck_require__(8159));
  3946. /**
  3947. * Exec a command.
  3948. * Output will be streamed to the live console.
  3949. * Returns promise with return code
  3950. *
  3951. * @param commandLine command to execute (can include additional args). Must be correctly escaped.
  3952. * @param args optional arguments for tool. Escaping is handled by the lib.
  3953. * @param options optional exec options. See ExecOptions
  3954. * @returns Promise<number> exit code
  3955. */
  3956. function exec(commandLine, args, options) {
  3957. return __awaiter(this, void 0, void 0, function* () {
  3958. const commandArgs = tr.argStringToArray(commandLine);
  3959. if (commandArgs.length === 0) {
  3960. throw new Error(`Parameter 'commandLine' cannot be null or empty.`);
  3961. }
  3962. // Path to tool to execute should be first arg
  3963. const toolPath = commandArgs[0];
  3964. args = commandArgs.slice(1).concat(args || []);
  3965. const runner = new tr.ToolRunner(toolPath, args, options);
  3966. return runner.exec();
  3967. });
  3968. }
  3969. exports.exec = exec;
  3970. /**
  3971. * Exec a command and get the output.
  3972. * Output will be streamed to the live console.
  3973. * Returns promise with the exit code and collected stdout and stderr
  3974. *
  3975. * @param commandLine command to execute (can include additional args). Must be correctly escaped.
  3976. * @param args optional arguments for tool. Escaping is handled by the lib.
  3977. * @param options optional exec options. See ExecOptions
  3978. * @returns Promise<ExecOutput> exit code, stdout, and stderr
  3979. */
  3980. function getExecOutput(commandLine, args, options) {
  3981. var _a, _b;
  3982. return __awaiter(this, void 0, void 0, function* () {
  3983. let stdout = '';
  3984. let stderr = '';
  3985. //Using string decoder covers the case where a mult-byte character is split
  3986. const stdoutDecoder = new string_decoder_1.StringDecoder('utf8');
  3987. const stderrDecoder = new string_decoder_1.StringDecoder('utf8');
  3988. const originalStdoutListener = (_a = options === null || options === void 0 ? void 0 : options.listeners) === null || _a === void 0 ? void 0 : _a.stdout;
  3989. const originalStdErrListener = (_b = options === null || options === void 0 ? void 0 : options.listeners) === null || _b === void 0 ? void 0 : _b.stderr;
  3990. const stdErrListener = (data) => {
  3991. stderr += stderrDecoder.write(data);
  3992. if (originalStdErrListener) {
  3993. originalStdErrListener(data);
  3994. }
  3995. };
  3996. const stdOutListener = (data) => {
  3997. stdout += stdoutDecoder.write(data);
  3998. if (originalStdoutListener) {
  3999. originalStdoutListener(data);
  4000. }
  4001. };
  4002. const listeners = Object.assign(Object.assign({}, options === null || options === void 0 ? void 0 : options.listeners), { stdout: stdOutListener, stderr: stdErrListener });
  4003. const exitCode = yield exec(commandLine, args, Object.assign(Object.assign({}, options), { listeners }));
  4004. //flush any remaining characters
  4005. stdout += stdoutDecoder.end();
  4006. stderr += stderrDecoder.end();
  4007. return {
  4008. exitCode,
  4009. stdout,
  4010. stderr
  4011. };
  4012. });
  4013. }
  4014. exports.getExecOutput = getExecOutput;
  4015. //# sourceMappingURL=exec.js.map
  4016. /***/ }),
  4017. /***/ 8159:
  4018. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  4019. "use strict";
  4020. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  4021. if (k2 === undefined) k2 = k;
  4022. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  4023. }) : (function(o, m, k, k2) {
  4024. if (k2 === undefined) k2 = k;
  4025. o[k2] = m[k];
  4026. }));
  4027. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  4028. Object.defineProperty(o, "default", { enumerable: true, value: v });
  4029. }) : function(o, v) {
  4030. o["default"] = v;
  4031. });
  4032. var __importStar = (this && this.__importStar) || function (mod) {
  4033. if (mod && mod.__esModule) return mod;
  4034. var result = {};
  4035. if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  4036. __setModuleDefault(result, mod);
  4037. return result;
  4038. };
  4039. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  4040. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  4041. return new (P || (P = Promise))(function (resolve, reject) {
  4042. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  4043. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  4044. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  4045. step((generator = generator.apply(thisArg, _arguments || [])).next());
  4046. });
  4047. };
  4048. Object.defineProperty(exports, "__esModule", ({ value: true }));
  4049. exports.argStringToArray = exports.ToolRunner = void 0;
  4050. const os = __importStar(__nccwpck_require__(2037));
  4051. const events = __importStar(__nccwpck_require__(2361));
  4052. const child = __importStar(__nccwpck_require__(2081));
  4053. const path = __importStar(__nccwpck_require__(1017));
  4054. const io = __importStar(__nccwpck_require__(7436));
  4055. const ioUtil = __importStar(__nccwpck_require__(1962));
  4056. const timers_1 = __nccwpck_require__(9512);
  4057. /* eslint-disable @typescript-eslint/unbound-method */
  4058. const IS_WINDOWS = process.platform === 'win32';
  4059. /*
  4060. * Class for running command line tools. Handles quoting and arg parsing in a platform agnostic way.
  4061. */
  4062. class ToolRunner extends events.EventEmitter {
  4063. constructor(toolPath, args, options) {
  4064. super();
  4065. if (!toolPath) {
  4066. throw new Error("Parameter 'toolPath' cannot be null or empty.");
  4067. }
  4068. this.toolPath = toolPath;
  4069. this.args = args || [];
  4070. this.options = options || {};
  4071. }
  4072. _debug(message) {
  4073. if (this.options.listeners && this.options.listeners.debug) {
  4074. this.options.listeners.debug(message);
  4075. }
  4076. }
  4077. _getCommandString(options, noPrefix) {
  4078. const toolPath = this._getSpawnFileName();
  4079. const args = this._getSpawnArgs(options);
  4080. let cmd = noPrefix ? '' : '[command]'; // omit prefix when piped to a second tool
  4081. if (IS_WINDOWS) {
  4082. // Windows + cmd file
  4083. if (this._isCmdFile()) {
  4084. cmd += toolPath;
  4085. for (const a of args) {
  4086. cmd += ` ${a}`;
  4087. }
  4088. }
  4089. // Windows + verbatim
  4090. else if (options.windowsVerbatimArguments) {
  4091. cmd += `"${toolPath}"`;
  4092. for (const a of args) {
  4093. cmd += ` ${a}`;
  4094. }
  4095. }
  4096. // Windows (regular)
  4097. else {
  4098. cmd += this._windowsQuoteCmdArg(toolPath);
  4099. for (const a of args) {
  4100. cmd += ` ${this._windowsQuoteCmdArg(a)}`;
  4101. }
  4102. }
  4103. }
  4104. else {
  4105. // OSX/Linux - this can likely be improved with some form of quoting.
  4106. // creating processes on Unix is fundamentally different than Windows.
  4107. // on Unix, execvp() takes an arg array.
  4108. cmd += toolPath;
  4109. for (const a of args) {
  4110. cmd += ` ${a}`;
  4111. }
  4112. }
  4113. return cmd;
  4114. }
  4115. _processLineBuffer(data, strBuffer, onLine) {
  4116. try {
  4117. let s = strBuffer + data.toString();
  4118. let n = s.indexOf(os.EOL);
  4119. while (n > -1) {
  4120. const line = s.substring(0, n);
  4121. onLine(line);
  4122. // the rest of the string ...
  4123. s = s.substring(n + os.EOL.length);
  4124. n = s.indexOf(os.EOL);
  4125. }
  4126. return s;
  4127. }
  4128. catch (err) {
  4129. // streaming lines to console is best effort. Don't fail a build.
  4130. this._debug(`error processing line. Failed with error ${err}`);
  4131. return '';
  4132. }
  4133. }
  4134. _getSpawnFileName() {
  4135. if (IS_WINDOWS) {
  4136. if (this._isCmdFile()) {
  4137. return process.env['COMSPEC'] || 'cmd.exe';
  4138. }
  4139. }
  4140. return this.toolPath;
  4141. }
  4142. _getSpawnArgs(options) {
  4143. if (IS_WINDOWS) {
  4144. if (this._isCmdFile()) {
  4145. let argline = `/D /S /C "${this._windowsQuoteCmdArg(this.toolPath)}`;
  4146. for (const a of this.args) {
  4147. argline += ' ';
  4148. argline += options.windowsVerbatimArguments
  4149. ? a
  4150. : this._windowsQuoteCmdArg(a);
  4151. }
  4152. argline += '"';
  4153. return [argline];
  4154. }
  4155. }
  4156. return this.args;
  4157. }
  4158. _endsWith(str, end) {
  4159. return str.endsWith(end);
  4160. }
  4161. _isCmdFile() {
  4162. const upperToolPath = this.toolPath.toUpperCase();
  4163. return (this._endsWith(upperToolPath, '.CMD') ||
  4164. this._endsWith(upperToolPath, '.BAT'));
  4165. }
  4166. _windowsQuoteCmdArg(arg) {
  4167. // for .exe, apply the normal quoting rules that libuv applies
  4168. if (!this._isCmdFile()) {
  4169. return this._uvQuoteCmdArg(arg);
  4170. }
  4171. // otherwise apply quoting rules specific to the cmd.exe command line parser.
  4172. // the libuv rules are generic and are not designed specifically for cmd.exe
  4173. // command line parser.
  4174. //
  4175. // for a detailed description of the cmd.exe command line parser, refer to
  4176. // http://stackoverflow.com/questions/4094699/how-does-the-windows-command-interpreter-cmd-exe-parse-scripts/7970912#7970912
  4177. // need quotes for empty arg
  4178. if (!arg) {
  4179. return '""';
  4180. }
  4181. // determine whether the arg needs to be quoted
  4182. const cmdSpecialChars = [
  4183. ' ',
  4184. '\t',
  4185. '&',
  4186. '(',
  4187. ')',
  4188. '[',
  4189. ']',
  4190. '{',
  4191. '}',
  4192. '^',
  4193. '=',
  4194. ';',
  4195. '!',
  4196. "'",
  4197. '+',
  4198. ',',
  4199. '`',
  4200. '~',
  4201. '|',
  4202. '<',
  4203. '>',
  4204. '"'
  4205. ];
  4206. let needsQuotes = false;
  4207. for (const char of arg) {
  4208. if (cmdSpecialChars.some(x => x === char)) {
  4209. needsQuotes = true;
  4210. break;
  4211. }
  4212. }
  4213. // short-circuit if quotes not needed
  4214. if (!needsQuotes) {
  4215. return arg;
  4216. }
  4217. // the following quoting rules are very similar to the rules that by libuv applies.
  4218. //
  4219. // 1) wrap the string in quotes
  4220. //
  4221. // 2) double-up quotes - i.e. " => ""
  4222. //
  4223. // this is different from the libuv quoting rules. libuv replaces " with \", which unfortunately
  4224. // doesn't work well with a cmd.exe command line.
  4225. //
  4226. // note, replacing " with "" also works well if the arg is passed to a downstream .NET console app.
  4227. // for example, the command line:
  4228. // foo.exe "myarg:""my val"""
  4229. // is parsed by a .NET console app into an arg array:
  4230. // [ "myarg:\"my val\"" ]
  4231. // which is the same end result when applying libuv quoting rules. although the actual
  4232. // command line from libuv quoting rules would look like:
  4233. // foo.exe "myarg:\"my val\""
  4234. //
  4235. // 3) double-up slashes that precede a quote,
  4236. // e.g. hello \world => "hello \world"
  4237. // hello\"world => "hello\\""world"
  4238. // hello\\"world => "hello\\\\""world"
  4239. // hello world\ => "hello world\\"
  4240. //
  4241. // technically this is not required for a cmd.exe command line, or the batch argument parser.
  4242. // the reasons for including this as a .cmd quoting rule are:
  4243. //
  4244. // a) this is optimized for the scenario where the argument is passed from the .cmd file to an
  4245. // external program. many programs (e.g. .NET console apps) rely on the slash-doubling rule.
  4246. //
  4247. // b) it's what we've been doing previously (by deferring to node default behavior) and we
  4248. // haven't heard any complaints about that aspect.
  4249. //
  4250. // note, a weakness of the quoting rules chosen here, is that % is not escaped. in fact, % cannot be
  4251. // escaped when used on the command line directly - even though within a .cmd file % can be escaped
  4252. // by using %%.
  4253. //
  4254. // the saving grace is, on the command line, %var% is left as-is if var is not defined. this contrasts
  4255. // the line parsing rules within a .cmd file, where if var is not defined it is replaced with nothing.
  4256. //
  4257. // one option that was explored was replacing % with ^% - i.e. %var% => ^%var^%. this hack would
  4258. // often work, since it is unlikely that var^ would exist, and the ^ character is removed when the
  4259. // variable is used. the problem, however, is that ^ is not removed when %* is used to pass the args
  4260. // to an external program.
  4261. //
  4262. // an unexplored potential solution for the % escaping problem, is to create a wrapper .cmd file.
  4263. // % can be escaped within a .cmd file.
  4264. let reverse = '"';
  4265. let quoteHit = true;
  4266. for (let i = arg.length; i > 0; i--) {
  4267. // walk the string in reverse
  4268. reverse += arg[i - 1];
  4269. if (quoteHit && arg[i - 1] === '\\') {
  4270. reverse += '\\'; // double the slash
  4271. }
  4272. else if (arg[i - 1] === '"') {
  4273. quoteHit = true;
  4274. reverse += '"'; // double the quote
  4275. }
  4276. else {
  4277. quoteHit = false;
  4278. }
  4279. }
  4280. reverse += '"';
  4281. return reverse
  4282. .split('')
  4283. .reverse()
  4284. .join('');
  4285. }
  4286. _uvQuoteCmdArg(arg) {
  4287. // Tool runner wraps child_process.spawn() and needs to apply the same quoting as
  4288. // Node in certain cases where the undocumented spawn option windowsVerbatimArguments
  4289. // is used.
  4290. //
  4291. // Since this function is a port of quote_cmd_arg from Node 4.x (technically, lib UV,
  4292. // see https://github.com/nodejs/node/blob/v4.x/deps/uv/src/win/process.c for details),
  4293. // pasting copyright notice from Node within this function:
  4294. //
  4295. // Copyright Joyent, Inc. and other Node contributors. All rights reserved.
  4296. //
  4297. // Permission is hereby granted, free of charge, to any person obtaining a copy
  4298. // of this software and associated documentation files (the "Software"), to
  4299. // deal in the Software without restriction, including without limitation the
  4300. // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
  4301. // sell copies of the Software, and to permit persons to whom the Software is
  4302. // furnished to do so, subject to the following conditions:
  4303. //
  4304. // The above copyright notice and this permission notice shall be included in
  4305. // all copies or substantial portions of the Software.
  4306. //
  4307. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  4308. // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  4309. // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  4310. // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  4311. // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  4312. // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
  4313. // IN THE SOFTWARE.
  4314. if (!arg) {
  4315. // Need double quotation for empty argument
  4316. return '""';
  4317. }
  4318. if (!arg.includes(' ') && !arg.includes('\t') && !arg.includes('"')) {
  4319. // No quotation needed
  4320. return arg;
  4321. }
  4322. if (!arg.includes('"') && !arg.includes('\\')) {
  4323. // No embedded double quotes or backslashes, so I can just wrap
  4324. // quote marks around the whole thing.
  4325. return `"${arg}"`;
  4326. }
  4327. // Expected input/output:
  4328. // input : hello"world
  4329. // output: "hello\"world"
  4330. // input : hello""world
  4331. // output: "hello\"\"world"
  4332. // input : hello\world
  4333. // output: hello\world
  4334. // input : hello\\world
  4335. // output: hello\\world
  4336. // input : hello\"world
  4337. // output: "hello\\\"world"
  4338. // input : hello\\"world
  4339. // output: "hello\\\\\"world"
  4340. // input : hello world\
  4341. // output: "hello world\\" - note the comment in libuv actually reads "hello world\"
  4342. // but it appears the comment is wrong, it should be "hello world\\"
  4343. let reverse = '"';
  4344. let quoteHit = true;
  4345. for (let i = arg.length; i > 0; i--) {
  4346. // walk the string in reverse
  4347. reverse += arg[i - 1];
  4348. if (quoteHit && arg[i - 1] === '\\') {
  4349. reverse += '\\';
  4350. }
  4351. else if (arg[i - 1] === '"') {
  4352. quoteHit = true;
  4353. reverse += '\\';
  4354. }
  4355. else {
  4356. quoteHit = false;
  4357. }
  4358. }
  4359. reverse += '"';
  4360. return reverse
  4361. .split('')
  4362. .reverse()
  4363. .join('');
  4364. }
  4365. _cloneExecOptions(options) {
  4366. options = options || {};
  4367. const result = {
  4368. cwd: options.cwd || process.cwd(),
  4369. env: options.env || process.env,
  4370. silent: options.silent || false,
  4371. windowsVerbatimArguments: options.windowsVerbatimArguments || false,
  4372. failOnStdErr: options.failOnStdErr || false,
  4373. ignoreReturnCode: options.ignoreReturnCode || false,
  4374. delay: options.delay || 10000
  4375. };
  4376. result.outStream = options.outStream || process.stdout;
  4377. result.errStream = options.errStream || process.stderr;
  4378. return result;
  4379. }
  4380. _getSpawnOptions(options, toolPath) {
  4381. options = options || {};
  4382. const result = {};
  4383. result.cwd = options.cwd;
  4384. result.env = options.env;
  4385. result['windowsVerbatimArguments'] =
  4386. options.windowsVerbatimArguments || this._isCmdFile();
  4387. if (options.windowsVerbatimArguments) {
  4388. result.argv0 = `"${toolPath}"`;
  4389. }
  4390. return result;
  4391. }
  4392. /**
  4393. * Exec a tool.
  4394. * Output will be streamed to the live console.
  4395. * Returns promise with return code
  4396. *
  4397. * @param tool path to tool to exec
  4398. * @param options optional exec options. See ExecOptions
  4399. * @returns number
  4400. */
  4401. exec() {
  4402. return __awaiter(this, void 0, void 0, function* () {
  4403. // root the tool path if it is unrooted and contains relative pathing
  4404. if (!ioUtil.isRooted(this.toolPath) &&
  4405. (this.toolPath.includes('/') ||
  4406. (IS_WINDOWS && this.toolPath.includes('\\')))) {
  4407. // prefer options.cwd if it is specified, however options.cwd may also need to be rooted
  4408. this.toolPath = path.resolve(process.cwd(), this.options.cwd || process.cwd(), this.toolPath);
  4409. }
  4410. // if the tool is only a file name, then resolve it from the PATH
  4411. // otherwise verify it exists (add extension on Windows if necessary)
  4412. this.toolPath = yield io.which(this.toolPath, true);
  4413. return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
  4414. this._debug(`exec tool: ${this.toolPath}`);
  4415. this._debug('arguments:');
  4416. for (const arg of this.args) {
  4417. this._debug(` ${arg}`);
  4418. }
  4419. const optionsNonNull = this._cloneExecOptions(this.options);
  4420. if (!optionsNonNull.silent && optionsNonNull.outStream) {
  4421. optionsNonNull.outStream.write(this._getCommandString(optionsNonNull) + os.EOL);
  4422. }
  4423. const state = new ExecState(optionsNonNull, this.toolPath);
  4424. state.on('debug', (message) => {
  4425. this._debug(message);
  4426. });
  4427. if (this.options.cwd && !(yield ioUtil.exists(this.options.cwd))) {
  4428. return reject(new Error(`The cwd: ${this.options.cwd} does not exist!`));
  4429. }
  4430. const fileName = this._getSpawnFileName();
  4431. const cp = child.spawn(fileName, this._getSpawnArgs(optionsNonNull), this._getSpawnOptions(this.options, fileName));
  4432. let stdbuffer = '';
  4433. if (cp.stdout) {
  4434. cp.stdout.on('data', (data) => {
  4435. if (this.options.listeners && this.options.listeners.stdout) {
  4436. this.options.listeners.stdout(data);
  4437. }
  4438. if (!optionsNonNull.silent && optionsNonNull.outStream) {
  4439. optionsNonNull.outStream.write(data);
  4440. }
  4441. stdbuffer = this._processLineBuffer(data, stdbuffer, (line) => {
  4442. if (this.options.listeners && this.options.listeners.stdline) {
  4443. this.options.listeners.stdline(line);
  4444. }
  4445. });
  4446. });
  4447. }
  4448. let errbuffer = '';
  4449. if (cp.stderr) {
  4450. cp.stderr.on('data', (data) => {
  4451. state.processStderr = true;
  4452. if (this.options.listeners && this.options.listeners.stderr) {
  4453. this.options.listeners.stderr(data);
  4454. }
  4455. if (!optionsNonNull.silent &&
  4456. optionsNonNull.errStream &&
  4457. optionsNonNull.outStream) {
  4458. const s = optionsNonNull.failOnStdErr
  4459. ? optionsNonNull.errStream
  4460. : optionsNonNull.outStream;
  4461. s.write(data);
  4462. }
  4463. errbuffer = this._processLineBuffer(data, errbuffer, (line) => {
  4464. if (this.options.listeners && this.options.listeners.errline) {
  4465. this.options.listeners.errline(line);
  4466. }
  4467. });
  4468. });
  4469. }
  4470. cp.on('error', (err) => {
  4471. state.processError = err.message;
  4472. state.processExited = true;
  4473. state.processClosed = true;
  4474. state.CheckComplete();
  4475. });
  4476. cp.on('exit', (code) => {
  4477. state.processExitCode = code;
  4478. state.processExited = true;
  4479. this._debug(`Exit code ${code} received from tool '${this.toolPath}'`);
  4480. state.CheckComplete();
  4481. });
  4482. cp.on('close', (code) => {
  4483. state.processExitCode = code;
  4484. state.processExited = true;
  4485. state.processClosed = true;
  4486. this._debug(`STDIO streams have closed for tool '${this.toolPath}'`);
  4487. state.CheckComplete();
  4488. });
  4489. state.on('done', (error, exitCode) => {
  4490. if (stdbuffer.length > 0) {
  4491. this.emit('stdline', stdbuffer);
  4492. }
  4493. if (errbuffer.length > 0) {
  4494. this.emit('errline', errbuffer);
  4495. }
  4496. cp.removeAllListeners();
  4497. if (error) {
  4498. reject(error);
  4499. }
  4500. else {
  4501. resolve(exitCode);
  4502. }
  4503. });
  4504. if (this.options.input) {
  4505. if (!cp.stdin) {
  4506. throw new Error('child process missing stdin');
  4507. }
  4508. cp.stdin.end(this.options.input);
  4509. }
  4510. }));
  4511. });
  4512. }
  4513. }
  4514. exports.ToolRunner = ToolRunner;
  4515. /**
  4516. * Convert an arg string to an array of args. Handles escaping
  4517. *
  4518. * @param argString string of arguments
  4519. * @returns string[] array of arguments
  4520. */
  4521. function argStringToArray(argString) {
  4522. const args = [];
  4523. let inQuotes = false;
  4524. let escaped = false;
  4525. let arg = '';
  4526. function append(c) {
  4527. // we only escape double quotes.
  4528. if (escaped && c !== '"') {
  4529. arg += '\\';
  4530. }
  4531. arg += c;
  4532. escaped = false;
  4533. }
  4534. for (let i = 0; i < argString.length; i++) {
  4535. const c = argString.charAt(i);
  4536. if (c === '"') {
  4537. if (!escaped) {
  4538. inQuotes = !inQuotes;
  4539. }
  4540. else {
  4541. append(c);
  4542. }
  4543. continue;
  4544. }
  4545. if (c === '\\' && escaped) {
  4546. append(c);
  4547. continue;
  4548. }
  4549. if (c === '\\' && inQuotes) {
  4550. escaped = true;
  4551. continue;
  4552. }
  4553. if (c === ' ' && !inQuotes) {
  4554. if (arg.length > 0) {
  4555. args.push(arg);
  4556. arg = '';
  4557. }
  4558. continue;
  4559. }
  4560. append(c);
  4561. }
  4562. if (arg.length > 0) {
  4563. args.push(arg.trim());
  4564. }
  4565. return args;
  4566. }
  4567. exports.argStringToArray = argStringToArray;
  4568. class ExecState extends events.EventEmitter {
  4569. constructor(options, toolPath) {
  4570. super();
  4571. this.processClosed = false; // tracks whether the process has exited and stdio is closed
  4572. this.processError = '';
  4573. this.processExitCode = 0;
  4574. this.processExited = false; // tracks whether the process has exited
  4575. this.processStderr = false; // tracks whether stderr was written to
  4576. this.delay = 10000; // 10 seconds
  4577. this.done = false;
  4578. this.timeout = null;
  4579. if (!toolPath) {
  4580. throw new Error('toolPath must not be empty');
  4581. }
  4582. this.options = options;
  4583. this.toolPath = toolPath;
  4584. if (options.delay) {
  4585. this.delay = options.delay;
  4586. }
  4587. }
  4588. CheckComplete() {
  4589. if (this.done) {
  4590. return;
  4591. }
  4592. if (this.processClosed) {
  4593. this._setResult();
  4594. }
  4595. else if (this.processExited) {
  4596. this.timeout = timers_1.setTimeout(ExecState.HandleTimeout, this.delay, this);
  4597. }
  4598. }
  4599. _debug(message) {
  4600. this.emit('debug', message);
  4601. }
  4602. _setResult() {
  4603. // determine whether there is an error
  4604. let error;
  4605. if (this.processExited) {
  4606. if (this.processError) {
  4607. 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}`);
  4608. }
  4609. else if (this.processExitCode !== 0 && !this.options.ignoreReturnCode) {
  4610. error = new Error(`The process '${this.toolPath}' failed with exit code ${this.processExitCode}`);
  4611. }
  4612. else if (this.processStderr && this.options.failOnStdErr) {
  4613. error = new Error(`The process '${this.toolPath}' failed because one or more lines were written to the STDERR stream`);
  4614. }
  4615. }
  4616. // clear the timeout
  4617. if (this.timeout) {
  4618. clearTimeout(this.timeout);
  4619. this.timeout = null;
  4620. }
  4621. this.done = true;
  4622. this.emit('done', error, this.processExitCode);
  4623. }
  4624. static HandleTimeout(state) {
  4625. if (state.done) {
  4626. return;
  4627. }
  4628. if (!state.processClosed && state.processExited) {
  4629. const message = `The STDIO streams did not close within ${state.delay /
  4630. 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.`;
  4631. state._debug(message);
  4632. }
  4633. state._setResult();
  4634. }
  4635. }
  4636. //# sourceMappingURL=toolrunner.js.map
  4637. /***/ }),
  4638. /***/ 4087:
  4639. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  4640. "use strict";
  4641. Object.defineProperty(exports, "__esModule", ({ value: true }));
  4642. exports.Context = void 0;
  4643. const fs_1 = __nccwpck_require__(7147);
  4644. const os_1 = __nccwpck_require__(2037);
  4645. class Context {
  4646. /**
  4647. * Hydrate the context from the environment
  4648. */
  4649. constructor() {
  4650. var _a, _b, _c;
  4651. this.payload = {};
  4652. if (process.env.GITHUB_EVENT_PATH) {
  4653. if ((0, fs_1.existsSync)(process.env.GITHUB_EVENT_PATH)) {
  4654. this.payload = JSON.parse((0, fs_1.readFileSync)(process.env.GITHUB_EVENT_PATH, { encoding: 'utf8' }));
  4655. }
  4656. else {
  4657. const path = process.env.GITHUB_EVENT_PATH;
  4658. process.stdout.write(`GITHUB_EVENT_PATH ${path} does not exist${os_1.EOL}`);
  4659. }
  4660. }
  4661. this.eventName = process.env.GITHUB_EVENT_NAME;
  4662. this.sha = process.env.GITHUB_SHA;
  4663. this.ref = process.env.GITHUB_REF;
  4664. this.workflow = process.env.GITHUB_WORKFLOW;
  4665. this.action = process.env.GITHUB_ACTION;
  4666. this.actor = process.env.GITHUB_ACTOR;
  4667. this.job = process.env.GITHUB_JOB;
  4668. this.runNumber = parseInt(process.env.GITHUB_RUN_NUMBER, 10);
  4669. this.runId = parseInt(process.env.GITHUB_RUN_ID, 10);
  4670. this.apiUrl = (_a = process.env.GITHUB_API_URL) !== null && _a !== void 0 ? _a : `https://api.github.com`;
  4671. this.serverUrl = (_b = process.env.GITHUB_SERVER_URL) !== null && _b !== void 0 ? _b : `https://github.com`;
  4672. this.graphqlUrl =
  4673. (_c = process.env.GITHUB_GRAPHQL_URL) !== null && _c !== void 0 ? _c : `https://api.github.com/graphql`;
  4674. }
  4675. get issue() {
  4676. const payload = this.payload;
  4677. return Object.assign(Object.assign({}, this.repo), { number: (payload.issue || payload.pull_request || payload).number });
  4678. }
  4679. get repo() {
  4680. if (process.env.GITHUB_REPOSITORY) {
  4681. const [owner, repo] = process.env.GITHUB_REPOSITORY.split('/');
  4682. return { owner, repo };
  4683. }
  4684. if (this.payload.repository) {
  4685. return {
  4686. owner: this.payload.repository.owner.login,
  4687. repo: this.payload.repository.name
  4688. };
  4689. }
  4690. throw new Error("context.repo requires a GITHUB_REPOSITORY environment variable like 'owner/repo'");
  4691. }
  4692. }
  4693. exports.Context = Context;
  4694. //# sourceMappingURL=context.js.map
  4695. /***/ }),
  4696. /***/ 5438:
  4697. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  4698. "use strict";
  4699. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  4700. if (k2 === undefined) k2 = k;
  4701. var desc = Object.getOwnPropertyDescriptor(m, k);
  4702. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  4703. desc = { enumerable: true, get: function() { return m[k]; } };
  4704. }
  4705. Object.defineProperty(o, k2, desc);
  4706. }) : (function(o, m, k, k2) {
  4707. if (k2 === undefined) k2 = k;
  4708. o[k2] = m[k];
  4709. }));
  4710. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  4711. Object.defineProperty(o, "default", { enumerable: true, value: v });
  4712. }) : function(o, v) {
  4713. o["default"] = v;
  4714. });
  4715. var __importStar = (this && this.__importStar) || function (mod) {
  4716. if (mod && mod.__esModule) return mod;
  4717. var result = {};
  4718. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  4719. __setModuleDefault(result, mod);
  4720. return result;
  4721. };
  4722. Object.defineProperty(exports, "__esModule", ({ value: true }));
  4723. exports.getOctokit = exports.context = void 0;
  4724. const Context = __importStar(__nccwpck_require__(4087));
  4725. const utils_1 = __nccwpck_require__(3030);
  4726. exports.context = new Context.Context();
  4727. /**
  4728. * Returns a hydrated octokit ready to use for GitHub Actions
  4729. *
  4730. * @param token the repo PAT or GITHUB_TOKEN
  4731. * @param options other options to set
  4732. */
  4733. function getOctokit(token, options, ...additionalPlugins) {
  4734. const GitHubWithPlugins = utils_1.GitHub.plugin(...additionalPlugins);
  4735. return new GitHubWithPlugins((0, utils_1.getOctokitOptions)(token, options));
  4736. }
  4737. exports.getOctokit = getOctokit;
  4738. //# sourceMappingURL=github.js.map
  4739. /***/ }),
  4740. /***/ 7914:
  4741. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  4742. "use strict";
  4743. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  4744. if (k2 === undefined) k2 = k;
  4745. var desc = Object.getOwnPropertyDescriptor(m, k);
  4746. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  4747. desc = { enumerable: true, get: function() { return m[k]; } };
  4748. }
  4749. Object.defineProperty(o, k2, desc);
  4750. }) : (function(o, m, k, k2) {
  4751. if (k2 === undefined) k2 = k;
  4752. o[k2] = m[k];
  4753. }));
  4754. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  4755. Object.defineProperty(o, "default", { enumerable: true, value: v });
  4756. }) : function(o, v) {
  4757. o["default"] = v;
  4758. });
  4759. var __importStar = (this && this.__importStar) || function (mod) {
  4760. if (mod && mod.__esModule) return mod;
  4761. var result = {};
  4762. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  4763. __setModuleDefault(result, mod);
  4764. return result;
  4765. };
  4766. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  4767. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  4768. return new (P || (P = Promise))(function (resolve, reject) {
  4769. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  4770. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  4771. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  4772. step((generator = generator.apply(thisArg, _arguments || [])).next());
  4773. });
  4774. };
  4775. Object.defineProperty(exports, "__esModule", ({ value: true }));
  4776. exports.getApiBaseUrl = exports.getProxyFetch = exports.getProxyAgentDispatcher = exports.getProxyAgent = exports.getAuthString = void 0;
  4777. const httpClient = __importStar(__nccwpck_require__(6255));
  4778. const undici_1 = __nccwpck_require__(1773);
  4779. function getAuthString(token, options) {
  4780. if (!token && !options.auth) {
  4781. throw new Error('Parameter token or opts.auth is required');
  4782. }
  4783. else if (token && options.auth) {
  4784. throw new Error('Parameters token and opts.auth may not both be specified');
  4785. }
  4786. return typeof options.auth === 'string' ? options.auth : `token ${token}`;
  4787. }
  4788. exports.getAuthString = getAuthString;
  4789. function getProxyAgent(destinationUrl) {
  4790. const hc = new httpClient.HttpClient();
  4791. return hc.getAgent(destinationUrl);
  4792. }
  4793. exports.getProxyAgent = getProxyAgent;
  4794. function getProxyAgentDispatcher(destinationUrl) {
  4795. const hc = new httpClient.HttpClient();
  4796. return hc.getAgentDispatcher(destinationUrl);
  4797. }
  4798. exports.getProxyAgentDispatcher = getProxyAgentDispatcher;
  4799. function getProxyFetch(destinationUrl) {
  4800. const httpDispatcher = getProxyAgentDispatcher(destinationUrl);
  4801. const proxyFetch = (url, opts) => __awaiter(this, void 0, void 0, function* () {
  4802. return (0, undici_1.fetch)(url, Object.assign(Object.assign({}, opts), { dispatcher: httpDispatcher }));
  4803. });
  4804. return proxyFetch;
  4805. }
  4806. exports.getProxyFetch = getProxyFetch;
  4807. function getApiBaseUrl() {
  4808. return process.env['GITHUB_API_URL'] || 'https://api.github.com';
  4809. }
  4810. exports.getApiBaseUrl = getApiBaseUrl;
  4811. //# sourceMappingURL=utils.js.map
  4812. /***/ }),
  4813. /***/ 3030:
  4814. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  4815. "use strict";
  4816. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  4817. if (k2 === undefined) k2 = k;
  4818. var desc = Object.getOwnPropertyDescriptor(m, k);
  4819. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  4820. desc = { enumerable: true, get: function() { return m[k]; } };
  4821. }
  4822. Object.defineProperty(o, k2, desc);
  4823. }) : (function(o, m, k, k2) {
  4824. if (k2 === undefined) k2 = k;
  4825. o[k2] = m[k];
  4826. }));
  4827. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  4828. Object.defineProperty(o, "default", { enumerable: true, value: v });
  4829. }) : function(o, v) {
  4830. o["default"] = v;
  4831. });
  4832. var __importStar = (this && this.__importStar) || function (mod) {
  4833. if (mod && mod.__esModule) return mod;
  4834. var result = {};
  4835. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  4836. __setModuleDefault(result, mod);
  4837. return result;
  4838. };
  4839. Object.defineProperty(exports, "__esModule", ({ value: true }));
  4840. exports.getOctokitOptions = exports.GitHub = exports.defaults = exports.context = void 0;
  4841. const Context = __importStar(__nccwpck_require__(4087));
  4842. const Utils = __importStar(__nccwpck_require__(7914));
  4843. // octokit + plugins
  4844. const core_1 = __nccwpck_require__(6762);
  4845. const plugin_rest_endpoint_methods_1 = __nccwpck_require__(3044);
  4846. const plugin_paginate_rest_1 = __nccwpck_require__(4193);
  4847. exports.context = new Context.Context();
  4848. const baseUrl = Utils.getApiBaseUrl();
  4849. exports.defaults = {
  4850. baseUrl,
  4851. request: {
  4852. agent: Utils.getProxyAgent(baseUrl),
  4853. fetch: Utils.getProxyFetch(baseUrl)
  4854. }
  4855. };
  4856. exports.GitHub = core_1.Octokit.plugin(plugin_rest_endpoint_methods_1.restEndpointMethods, plugin_paginate_rest_1.paginateRest).defaults(exports.defaults);
  4857. /**
  4858. * Convience function to correctly format Octokit Options to pass into the constructor.
  4859. *
  4860. * @param token the repo PAT or GITHUB_TOKEN
  4861. * @param options other options to set
  4862. */
  4863. function getOctokitOptions(token, options) {
  4864. const opts = Object.assign({}, options || {}); // Shallow clone - don't mutate the object provided by the caller
  4865. // Auth
  4866. const auth = Utils.getAuthString(token, opts);
  4867. if (auth) {
  4868. opts.auth = auth;
  4869. }
  4870. return opts;
  4871. }
  4872. exports.getOctokitOptions = getOctokitOptions;
  4873. //# sourceMappingURL=utils.js.map
  4874. /***/ }),
  4875. /***/ 5526:
  4876. /***/ (function(__unused_webpack_module, exports) {
  4877. "use strict";
  4878. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  4879. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  4880. return new (P || (P = Promise))(function (resolve, reject) {
  4881. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  4882. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  4883. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  4884. step((generator = generator.apply(thisArg, _arguments || [])).next());
  4885. });
  4886. };
  4887. Object.defineProperty(exports, "__esModule", ({ value: true }));
  4888. exports.PersonalAccessTokenCredentialHandler = exports.BearerCredentialHandler = exports.BasicCredentialHandler = void 0;
  4889. class BasicCredentialHandler {
  4890. constructor(username, password) {
  4891. this.username = username;
  4892. this.password = password;
  4893. }
  4894. prepareRequest(options) {
  4895. if (!options.headers) {
  4896. throw Error('The request has no headers');
  4897. }
  4898. options.headers['Authorization'] = `Basic ${Buffer.from(`${this.username}:${this.password}`).toString('base64')}`;
  4899. }
  4900. // This handler cannot handle 401
  4901. canHandleAuthentication() {
  4902. return false;
  4903. }
  4904. handleAuthentication() {
  4905. return __awaiter(this, void 0, void 0, function* () {
  4906. throw new Error('not implemented');
  4907. });
  4908. }
  4909. }
  4910. exports.BasicCredentialHandler = BasicCredentialHandler;
  4911. class BearerCredentialHandler {
  4912. constructor(token) {
  4913. this.token = token;
  4914. }
  4915. // currently implements pre-authorization
  4916. // TODO: support preAuth = false where it hooks on 401
  4917. prepareRequest(options) {
  4918. if (!options.headers) {
  4919. throw Error('The request has no headers');
  4920. }
  4921. options.headers['Authorization'] = `Bearer ${this.token}`;
  4922. }
  4923. // This handler cannot handle 401
  4924. canHandleAuthentication() {
  4925. return false;
  4926. }
  4927. handleAuthentication() {
  4928. return __awaiter(this, void 0, void 0, function* () {
  4929. throw new Error('not implemented');
  4930. });
  4931. }
  4932. }
  4933. exports.BearerCredentialHandler = BearerCredentialHandler;
  4934. class PersonalAccessTokenCredentialHandler {
  4935. constructor(token) {
  4936. this.token = token;
  4937. }
  4938. // currently implements pre-authorization
  4939. // TODO: support preAuth = false where it hooks on 401
  4940. prepareRequest(options) {
  4941. if (!options.headers) {
  4942. throw Error('The request has no headers');
  4943. }
  4944. options.headers['Authorization'] = `Basic ${Buffer.from(`PAT:${this.token}`).toString('base64')}`;
  4945. }
  4946. // This handler cannot handle 401
  4947. canHandleAuthentication() {
  4948. return false;
  4949. }
  4950. handleAuthentication() {
  4951. return __awaiter(this, void 0, void 0, function* () {
  4952. throw new Error('not implemented');
  4953. });
  4954. }
  4955. }
  4956. exports.PersonalAccessTokenCredentialHandler = PersonalAccessTokenCredentialHandler;
  4957. //# sourceMappingURL=auth.js.map
  4958. /***/ }),
  4959. /***/ 6255:
  4960. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  4961. "use strict";
  4962. /* eslint-disable @typescript-eslint/no-explicit-any */
  4963. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  4964. if (k2 === undefined) k2 = k;
  4965. var desc = Object.getOwnPropertyDescriptor(m, k);
  4966. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  4967. desc = { enumerable: true, get: function() { return m[k]; } };
  4968. }
  4969. Object.defineProperty(o, k2, desc);
  4970. }) : (function(o, m, k, k2) {
  4971. if (k2 === undefined) k2 = k;
  4972. o[k2] = m[k];
  4973. }));
  4974. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  4975. Object.defineProperty(o, "default", { enumerable: true, value: v });
  4976. }) : function(o, v) {
  4977. o["default"] = v;
  4978. });
  4979. var __importStar = (this && this.__importStar) || function (mod) {
  4980. if (mod && mod.__esModule) return mod;
  4981. var result = {};
  4982. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  4983. __setModuleDefault(result, mod);
  4984. return result;
  4985. };
  4986. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  4987. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  4988. return new (P || (P = Promise))(function (resolve, reject) {
  4989. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  4990. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  4991. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  4992. step((generator = generator.apply(thisArg, _arguments || [])).next());
  4993. });
  4994. };
  4995. Object.defineProperty(exports, "__esModule", ({ value: true }));
  4996. exports.HttpClient = exports.isHttps = exports.HttpClientResponse = exports.HttpClientError = exports.getProxyUrl = exports.MediaTypes = exports.Headers = exports.HttpCodes = void 0;
  4997. const http = __importStar(__nccwpck_require__(3685));
  4998. const https = __importStar(__nccwpck_require__(5687));
  4999. const pm = __importStar(__nccwpck_require__(9835));
  5000. const tunnel = __importStar(__nccwpck_require__(4294));
  5001. const undici_1 = __nccwpck_require__(1773);
  5002. var HttpCodes;
  5003. (function (HttpCodes) {
  5004. HttpCodes[HttpCodes["OK"] = 200] = "OK";
  5005. HttpCodes[HttpCodes["MultipleChoices"] = 300] = "MultipleChoices";
  5006. HttpCodes[HttpCodes["MovedPermanently"] = 301] = "MovedPermanently";
  5007. HttpCodes[HttpCodes["ResourceMoved"] = 302] = "ResourceMoved";
  5008. HttpCodes[HttpCodes["SeeOther"] = 303] = "SeeOther";
  5009. HttpCodes[HttpCodes["NotModified"] = 304] = "NotModified";
  5010. HttpCodes[HttpCodes["UseProxy"] = 305] = "UseProxy";
  5011. HttpCodes[HttpCodes["SwitchProxy"] = 306] = "SwitchProxy";
  5012. HttpCodes[HttpCodes["TemporaryRedirect"] = 307] = "TemporaryRedirect";
  5013. HttpCodes[HttpCodes["PermanentRedirect"] = 308] = "PermanentRedirect";
  5014. HttpCodes[HttpCodes["BadRequest"] = 400] = "BadRequest";
  5015. HttpCodes[HttpCodes["Unauthorized"] = 401] = "Unauthorized";
  5016. HttpCodes[HttpCodes["PaymentRequired"] = 402] = "PaymentRequired";
  5017. HttpCodes[HttpCodes["Forbidden"] = 403] = "Forbidden";
  5018. HttpCodes[HttpCodes["NotFound"] = 404] = "NotFound";
  5019. HttpCodes[HttpCodes["MethodNotAllowed"] = 405] = "MethodNotAllowed";
  5020. HttpCodes[HttpCodes["NotAcceptable"] = 406] = "NotAcceptable";
  5021. HttpCodes[HttpCodes["ProxyAuthenticationRequired"] = 407] = "ProxyAuthenticationRequired";
  5022. HttpCodes[HttpCodes["RequestTimeout"] = 408] = "RequestTimeout";
  5023. HttpCodes[HttpCodes["Conflict"] = 409] = "Conflict";
  5024. HttpCodes[HttpCodes["Gone"] = 410] = "Gone";
  5025. HttpCodes[HttpCodes["TooManyRequests"] = 429] = "TooManyRequests";
  5026. HttpCodes[HttpCodes["InternalServerError"] = 500] = "InternalServerError";
  5027. HttpCodes[HttpCodes["NotImplemented"] = 501] = "NotImplemented";
  5028. HttpCodes[HttpCodes["BadGateway"] = 502] = "BadGateway";
  5029. HttpCodes[HttpCodes["ServiceUnavailable"] = 503] = "ServiceUnavailable";
  5030. HttpCodes[HttpCodes["GatewayTimeout"] = 504] = "GatewayTimeout";
  5031. })(HttpCodes || (exports.HttpCodes = HttpCodes = {}));
  5032. var Headers;
  5033. (function (Headers) {
  5034. Headers["Accept"] = "accept";
  5035. Headers["ContentType"] = "content-type";
  5036. })(Headers || (exports.Headers = Headers = {}));
  5037. var MediaTypes;
  5038. (function (MediaTypes) {
  5039. MediaTypes["ApplicationJson"] = "application/json";
  5040. })(MediaTypes || (exports.MediaTypes = MediaTypes = {}));
  5041. /**
  5042. * Returns the proxy URL, depending upon the supplied url and proxy environment variables.
  5043. * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com
  5044. */
  5045. function getProxyUrl(serverUrl) {
  5046. const proxyUrl = pm.getProxyUrl(new URL(serverUrl));
  5047. return proxyUrl ? proxyUrl.href : '';
  5048. }
  5049. exports.getProxyUrl = getProxyUrl;
  5050. const HttpRedirectCodes = [
  5051. HttpCodes.MovedPermanently,
  5052. HttpCodes.ResourceMoved,
  5053. HttpCodes.SeeOther,
  5054. HttpCodes.TemporaryRedirect,
  5055. HttpCodes.PermanentRedirect
  5056. ];
  5057. const HttpResponseRetryCodes = [
  5058. HttpCodes.BadGateway,
  5059. HttpCodes.ServiceUnavailable,
  5060. HttpCodes.GatewayTimeout
  5061. ];
  5062. const RetryableHttpVerbs = ['OPTIONS', 'GET', 'DELETE', 'HEAD'];
  5063. const ExponentialBackoffCeiling = 10;
  5064. const ExponentialBackoffTimeSlice = 5;
  5065. class HttpClientError extends Error {
  5066. constructor(message, statusCode) {
  5067. super(message);
  5068. this.name = 'HttpClientError';
  5069. this.statusCode = statusCode;
  5070. Object.setPrototypeOf(this, HttpClientError.prototype);
  5071. }
  5072. }
  5073. exports.HttpClientError = HttpClientError;
  5074. class HttpClientResponse {
  5075. constructor(message) {
  5076. this.message = message;
  5077. }
  5078. readBody() {
  5079. return __awaiter(this, void 0, void 0, function* () {
  5080. return new Promise((resolve) => __awaiter(this, void 0, void 0, function* () {
  5081. let output = Buffer.alloc(0);
  5082. this.message.on('data', (chunk) => {
  5083. output = Buffer.concat([output, chunk]);
  5084. });
  5085. this.message.on('end', () => {
  5086. resolve(output.toString());
  5087. });
  5088. }));
  5089. });
  5090. }
  5091. readBodyBuffer() {
  5092. return __awaiter(this, void 0, void 0, function* () {
  5093. return new Promise((resolve) => __awaiter(this, void 0, void 0, function* () {
  5094. const chunks = [];
  5095. this.message.on('data', (chunk) => {
  5096. chunks.push(chunk);
  5097. });
  5098. this.message.on('end', () => {
  5099. resolve(Buffer.concat(chunks));
  5100. });
  5101. }));
  5102. });
  5103. }
  5104. }
  5105. exports.HttpClientResponse = HttpClientResponse;
  5106. function isHttps(requestUrl) {
  5107. const parsedUrl = new URL(requestUrl);
  5108. return parsedUrl.protocol === 'https:';
  5109. }
  5110. exports.isHttps = isHttps;
  5111. class HttpClient {
  5112. constructor(userAgent, handlers, requestOptions) {
  5113. this._ignoreSslError = false;
  5114. this._allowRedirects = true;
  5115. this._allowRedirectDowngrade = false;
  5116. this._maxRedirects = 50;
  5117. this._allowRetries = false;
  5118. this._maxRetries = 1;
  5119. this._keepAlive = false;
  5120. this._disposed = false;
  5121. this.userAgent = userAgent;
  5122. this.handlers = handlers || [];
  5123. this.requestOptions = requestOptions;
  5124. if (requestOptions) {
  5125. if (requestOptions.ignoreSslError != null) {
  5126. this._ignoreSslError = requestOptions.ignoreSslError;
  5127. }
  5128. this._socketTimeout = requestOptions.socketTimeout;
  5129. if (requestOptions.allowRedirects != null) {
  5130. this._allowRedirects = requestOptions.allowRedirects;
  5131. }
  5132. if (requestOptions.allowRedirectDowngrade != null) {
  5133. this._allowRedirectDowngrade = requestOptions.allowRedirectDowngrade;
  5134. }
  5135. if (requestOptions.maxRedirects != null) {
  5136. this._maxRedirects = Math.max(requestOptions.maxRedirects, 0);
  5137. }
  5138. if (requestOptions.keepAlive != null) {
  5139. this._keepAlive = requestOptions.keepAlive;
  5140. }
  5141. if (requestOptions.allowRetries != null) {
  5142. this._allowRetries = requestOptions.allowRetries;
  5143. }
  5144. if (requestOptions.maxRetries != null) {
  5145. this._maxRetries = requestOptions.maxRetries;
  5146. }
  5147. }
  5148. }
  5149. options(requestUrl, additionalHeaders) {
  5150. return __awaiter(this, void 0, void 0, function* () {
  5151. return this.request('OPTIONS', requestUrl, null, additionalHeaders || {});
  5152. });
  5153. }
  5154. get(requestUrl, additionalHeaders) {
  5155. return __awaiter(this, void 0, void 0, function* () {
  5156. return this.request('GET', requestUrl, null, additionalHeaders || {});
  5157. });
  5158. }
  5159. del(requestUrl, additionalHeaders) {
  5160. return __awaiter(this, void 0, void 0, function* () {
  5161. return this.request('DELETE', requestUrl, null, additionalHeaders || {});
  5162. });
  5163. }
  5164. post(requestUrl, data, additionalHeaders) {
  5165. return __awaiter(this, void 0, void 0, function* () {
  5166. return this.request('POST', requestUrl, data, additionalHeaders || {});
  5167. });
  5168. }
  5169. patch(requestUrl, data, additionalHeaders) {
  5170. return __awaiter(this, void 0, void 0, function* () {
  5171. return this.request('PATCH', requestUrl, data, additionalHeaders || {});
  5172. });
  5173. }
  5174. put(requestUrl, data, additionalHeaders) {
  5175. return __awaiter(this, void 0, void 0, function* () {
  5176. return this.request('PUT', requestUrl, data, additionalHeaders || {});
  5177. });
  5178. }
  5179. head(requestUrl, additionalHeaders) {
  5180. return __awaiter(this, void 0, void 0, function* () {
  5181. return this.request('HEAD', requestUrl, null, additionalHeaders || {});
  5182. });
  5183. }
  5184. sendStream(verb, requestUrl, stream, additionalHeaders) {
  5185. return __awaiter(this, void 0, void 0, function* () {
  5186. return this.request(verb, requestUrl, stream, additionalHeaders);
  5187. });
  5188. }
  5189. /**
  5190. * Gets a typed object from an endpoint
  5191. * Be aware that not found returns a null. Other errors (4xx, 5xx) reject the promise
  5192. */
  5193. getJson(requestUrl, additionalHeaders = {}) {
  5194. return __awaiter(this, void 0, void 0, function* () {
  5195. additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
  5196. const res = yield this.get(requestUrl, additionalHeaders);
  5197. return this._processResponse(res, this.requestOptions);
  5198. });
  5199. }
  5200. postJson(requestUrl, obj, additionalHeaders = {}) {
  5201. return __awaiter(this, void 0, void 0, function* () {
  5202. const data = JSON.stringify(obj, null, 2);
  5203. additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
  5204. additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);
  5205. const res = yield this.post(requestUrl, data, additionalHeaders);
  5206. return this._processResponse(res, this.requestOptions);
  5207. });
  5208. }
  5209. putJson(requestUrl, obj, additionalHeaders = {}) {
  5210. return __awaiter(this, void 0, void 0, function* () {
  5211. const data = JSON.stringify(obj, null, 2);
  5212. additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
  5213. additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);
  5214. const res = yield this.put(requestUrl, data, additionalHeaders);
  5215. return this._processResponse(res, this.requestOptions);
  5216. });
  5217. }
  5218. patchJson(requestUrl, obj, additionalHeaders = {}) {
  5219. return __awaiter(this, void 0, void 0, function* () {
  5220. const data = JSON.stringify(obj, null, 2);
  5221. additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
  5222. additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);
  5223. const res = yield this.patch(requestUrl, data, additionalHeaders);
  5224. return this._processResponse(res, this.requestOptions);
  5225. });
  5226. }
  5227. /**
  5228. * Makes a raw http request.
  5229. * All other methods such as get, post, patch, and request ultimately call this.
  5230. * Prefer get, del, post and patch
  5231. */
  5232. request(verb, requestUrl, data, headers) {
  5233. return __awaiter(this, void 0, void 0, function* () {
  5234. if (this._disposed) {
  5235. throw new Error('Client has already been disposed.');
  5236. }
  5237. const parsedUrl = new URL(requestUrl);
  5238. let info = this._prepareRequest(verb, parsedUrl, headers);
  5239. // Only perform retries on reads since writes may not be idempotent.
  5240. const maxTries = this._allowRetries && RetryableHttpVerbs.includes(verb)
  5241. ? this._maxRetries + 1
  5242. : 1;
  5243. let numTries = 0;
  5244. let response;
  5245. do {
  5246. response = yield this.requestRaw(info, data);
  5247. // Check if it's an authentication challenge
  5248. if (response &&
  5249. response.message &&
  5250. response.message.statusCode === HttpCodes.Unauthorized) {
  5251. let authenticationHandler;
  5252. for (const handler of this.handlers) {
  5253. if (handler.canHandleAuthentication(response)) {
  5254. authenticationHandler = handler;
  5255. break;
  5256. }
  5257. }
  5258. if (authenticationHandler) {
  5259. return authenticationHandler.handleAuthentication(this, info, data);
  5260. }
  5261. else {
  5262. // We have received an unauthorized response but have no handlers to handle it.
  5263. // Let the response return to the caller.
  5264. return response;
  5265. }
  5266. }
  5267. let redirectsRemaining = this._maxRedirects;
  5268. while (response.message.statusCode &&
  5269. HttpRedirectCodes.includes(response.message.statusCode) &&
  5270. this._allowRedirects &&
  5271. redirectsRemaining > 0) {
  5272. const redirectUrl = response.message.headers['location'];
  5273. if (!redirectUrl) {
  5274. // if there's no location to redirect to, we won't
  5275. break;
  5276. }
  5277. const parsedRedirectUrl = new URL(redirectUrl);
  5278. if (parsedUrl.protocol === 'https:' &&
  5279. parsedUrl.protocol !== parsedRedirectUrl.protocol &&
  5280. !this._allowRedirectDowngrade) {
  5281. 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.');
  5282. }
  5283. // we need to finish reading the response before reassigning response
  5284. // which will leak the open socket.
  5285. yield response.readBody();
  5286. // strip authorization header if redirected to a different hostname
  5287. if (parsedRedirectUrl.hostname !== parsedUrl.hostname) {
  5288. for (const header in headers) {
  5289. // header names are case insensitive
  5290. if (header.toLowerCase() === 'authorization') {
  5291. delete headers[header];
  5292. }
  5293. }
  5294. }
  5295. // let's make the request with the new redirectUrl
  5296. info = this._prepareRequest(verb, parsedRedirectUrl, headers);
  5297. response = yield this.requestRaw(info, data);
  5298. redirectsRemaining--;
  5299. }
  5300. if (!response.message.statusCode ||
  5301. !HttpResponseRetryCodes.includes(response.message.statusCode)) {
  5302. // If not a retry code, return immediately instead of retrying
  5303. return response;
  5304. }
  5305. numTries += 1;
  5306. if (numTries < maxTries) {
  5307. yield response.readBody();
  5308. yield this._performExponentialBackoff(numTries);
  5309. }
  5310. } while (numTries < maxTries);
  5311. return response;
  5312. });
  5313. }
  5314. /**
  5315. * Needs to be called if keepAlive is set to true in request options.
  5316. */
  5317. dispose() {
  5318. if (this._agent) {
  5319. this._agent.destroy();
  5320. }
  5321. this._disposed = true;
  5322. }
  5323. /**
  5324. * Raw request.
  5325. * @param info
  5326. * @param data
  5327. */
  5328. requestRaw(info, data) {
  5329. return __awaiter(this, void 0, void 0, function* () {
  5330. return new Promise((resolve, reject) => {
  5331. function callbackForResult(err, res) {
  5332. if (err) {
  5333. reject(err);
  5334. }
  5335. else if (!res) {
  5336. // If `err` is not passed, then `res` must be passed.
  5337. reject(new Error('Unknown error'));
  5338. }
  5339. else {
  5340. resolve(res);
  5341. }
  5342. }
  5343. this.requestRawWithCallback(info, data, callbackForResult);
  5344. });
  5345. });
  5346. }
  5347. /**
  5348. * Raw request with callback.
  5349. * @param info
  5350. * @param data
  5351. * @param onResult
  5352. */
  5353. requestRawWithCallback(info, data, onResult) {
  5354. if (typeof data === 'string') {
  5355. if (!info.options.headers) {
  5356. info.options.headers = {};
  5357. }
  5358. info.options.headers['Content-Length'] = Buffer.byteLength(data, 'utf8');
  5359. }
  5360. let callbackCalled = false;
  5361. function handleResult(err, res) {
  5362. if (!callbackCalled) {
  5363. callbackCalled = true;
  5364. onResult(err, res);
  5365. }
  5366. }
  5367. const req = info.httpModule.request(info.options, (msg) => {
  5368. const res = new HttpClientResponse(msg);
  5369. handleResult(undefined, res);
  5370. });
  5371. let socket;
  5372. req.on('socket', sock => {
  5373. socket = sock;
  5374. });
  5375. // If we ever get disconnected, we want the socket to timeout eventually
  5376. req.setTimeout(this._socketTimeout || 3 * 60000, () => {
  5377. if (socket) {
  5378. socket.end();
  5379. }
  5380. handleResult(new Error(`Request timeout: ${info.options.path}`));
  5381. });
  5382. req.on('error', function (err) {
  5383. // err has statusCode property
  5384. // res should have headers
  5385. handleResult(err);
  5386. });
  5387. if (data && typeof data === 'string') {
  5388. req.write(data, 'utf8');
  5389. }
  5390. if (data && typeof data !== 'string') {
  5391. data.on('close', function () {
  5392. req.end();
  5393. });
  5394. data.pipe(req);
  5395. }
  5396. else {
  5397. req.end();
  5398. }
  5399. }
  5400. /**
  5401. * Gets an http agent. This function is useful when you need an http agent that handles
  5402. * routing through a proxy server - depending upon the url and proxy environment variables.
  5403. * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com
  5404. */
  5405. getAgent(serverUrl) {
  5406. const parsedUrl = new URL(serverUrl);
  5407. return this._getAgent(parsedUrl);
  5408. }
  5409. getAgentDispatcher(serverUrl) {
  5410. const parsedUrl = new URL(serverUrl);
  5411. const proxyUrl = pm.getProxyUrl(parsedUrl);
  5412. const useProxy = proxyUrl && proxyUrl.hostname;
  5413. if (!useProxy) {
  5414. return;
  5415. }
  5416. return this._getProxyAgentDispatcher(parsedUrl, proxyUrl);
  5417. }
  5418. _prepareRequest(method, requestUrl, headers) {
  5419. const info = {};
  5420. info.parsedUrl = requestUrl;
  5421. const usingSsl = info.parsedUrl.protocol === 'https:';
  5422. info.httpModule = usingSsl ? https : http;
  5423. const defaultPort = usingSsl ? 443 : 80;
  5424. info.options = {};
  5425. info.options.host = info.parsedUrl.hostname;
  5426. info.options.port = info.parsedUrl.port
  5427. ? parseInt(info.parsedUrl.port)
  5428. : defaultPort;
  5429. info.options.path =
  5430. (info.parsedUrl.pathname || '') + (info.parsedUrl.search || '');
  5431. info.options.method = method;
  5432. info.options.headers = this._mergeHeaders(headers);
  5433. if (this.userAgent != null) {
  5434. info.options.headers['user-agent'] = this.userAgent;
  5435. }
  5436. info.options.agent = this._getAgent(info.parsedUrl);
  5437. // gives handlers an opportunity to participate
  5438. if (this.handlers) {
  5439. for (const handler of this.handlers) {
  5440. handler.prepareRequest(info.options);
  5441. }
  5442. }
  5443. return info;
  5444. }
  5445. _mergeHeaders(headers) {
  5446. if (this.requestOptions && this.requestOptions.headers) {
  5447. return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers || {}));
  5448. }
  5449. return lowercaseKeys(headers || {});
  5450. }
  5451. _getExistingOrDefaultHeader(additionalHeaders, header, _default) {
  5452. let clientHeader;
  5453. if (this.requestOptions && this.requestOptions.headers) {
  5454. clientHeader = lowercaseKeys(this.requestOptions.headers)[header];
  5455. }
  5456. return additionalHeaders[header] || clientHeader || _default;
  5457. }
  5458. _getAgent(parsedUrl) {
  5459. let agent;
  5460. const proxyUrl = pm.getProxyUrl(parsedUrl);
  5461. const useProxy = proxyUrl && proxyUrl.hostname;
  5462. if (this._keepAlive && useProxy) {
  5463. agent = this._proxyAgent;
  5464. }
  5465. if (!useProxy) {
  5466. agent = this._agent;
  5467. }
  5468. // if agent is already assigned use that agent.
  5469. if (agent) {
  5470. return agent;
  5471. }
  5472. const usingSsl = parsedUrl.protocol === 'https:';
  5473. let maxSockets = 100;
  5474. if (this.requestOptions) {
  5475. maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets;
  5476. }
  5477. // This is `useProxy` again, but we need to check `proxyURl` directly for TypeScripts's flow analysis.
  5478. if (proxyUrl && proxyUrl.hostname) {
  5479. const agentOptions = {
  5480. maxSockets,
  5481. keepAlive: this._keepAlive,
  5482. proxy: Object.assign(Object.assign({}, ((proxyUrl.username || proxyUrl.password) && {
  5483. proxyAuth: `${proxyUrl.username}:${proxyUrl.password}`
  5484. })), { host: proxyUrl.hostname, port: proxyUrl.port })
  5485. };
  5486. let tunnelAgent;
  5487. const overHttps = proxyUrl.protocol === 'https:';
  5488. if (usingSsl) {
  5489. tunnelAgent = overHttps ? tunnel.httpsOverHttps : tunnel.httpsOverHttp;
  5490. }
  5491. else {
  5492. tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp;
  5493. }
  5494. agent = tunnelAgent(agentOptions);
  5495. this._proxyAgent = agent;
  5496. }
  5497. // if tunneling agent isn't assigned create a new agent
  5498. if (!agent) {
  5499. const options = { keepAlive: this._keepAlive, maxSockets };
  5500. agent = usingSsl ? new https.Agent(options) : new http.Agent(options);
  5501. this._agent = agent;
  5502. }
  5503. if (usingSsl && this._ignoreSslError) {
  5504. // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process
  5505. // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options
  5506. // we have to cast it to any and change it directly
  5507. agent.options = Object.assign(agent.options || {}, {
  5508. rejectUnauthorized: false
  5509. });
  5510. }
  5511. return agent;
  5512. }
  5513. _getProxyAgentDispatcher(parsedUrl, proxyUrl) {
  5514. let proxyAgent;
  5515. if (this._keepAlive) {
  5516. proxyAgent = this._proxyAgentDispatcher;
  5517. }
  5518. // if agent is already assigned use that agent.
  5519. if (proxyAgent) {
  5520. return proxyAgent;
  5521. }
  5522. const usingSsl = parsedUrl.protocol === 'https:';
  5523. proxyAgent = new undici_1.ProxyAgent(Object.assign({ uri: proxyUrl.href, pipelining: !this._keepAlive ? 0 : 1 }, ((proxyUrl.username || proxyUrl.password) && {
  5524. token: `${proxyUrl.username}:${proxyUrl.password}`
  5525. })));
  5526. this._proxyAgentDispatcher = proxyAgent;
  5527. if (usingSsl && this._ignoreSslError) {
  5528. // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process
  5529. // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options
  5530. // we have to cast it to any and change it directly
  5531. proxyAgent.options = Object.assign(proxyAgent.options.requestTls || {}, {
  5532. rejectUnauthorized: false
  5533. });
  5534. }
  5535. return proxyAgent;
  5536. }
  5537. _performExponentialBackoff(retryNumber) {
  5538. return __awaiter(this, void 0, void 0, function* () {
  5539. retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber);
  5540. const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber);
  5541. return new Promise(resolve => setTimeout(() => resolve(), ms));
  5542. });
  5543. }
  5544. _processResponse(res, options) {
  5545. return __awaiter(this, void 0, void 0, function* () {
  5546. return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
  5547. const statusCode = res.message.statusCode || 0;
  5548. const response = {
  5549. statusCode,
  5550. result: null,
  5551. headers: {}
  5552. };
  5553. // not found leads to null obj returned
  5554. if (statusCode === HttpCodes.NotFound) {
  5555. resolve(response);
  5556. }
  5557. // get the result from the body
  5558. function dateTimeDeserializer(key, value) {
  5559. if (typeof value === 'string') {
  5560. const a = new Date(value);
  5561. if (!isNaN(a.valueOf())) {
  5562. return a;
  5563. }
  5564. }
  5565. return value;
  5566. }
  5567. let obj;
  5568. let contents;
  5569. try {
  5570. contents = yield res.readBody();
  5571. if (contents && contents.length > 0) {
  5572. if (options && options.deserializeDates) {
  5573. obj = JSON.parse(contents, dateTimeDeserializer);
  5574. }
  5575. else {
  5576. obj = JSON.parse(contents);
  5577. }
  5578. response.result = obj;
  5579. }
  5580. response.headers = res.message.headers;
  5581. }
  5582. catch (err) {
  5583. // Invalid resource (contents not json); leaving result obj null
  5584. }
  5585. // note that 3xx redirects are handled by the http layer.
  5586. if (statusCode > 299) {
  5587. let msg;
  5588. // if exception/error in body, attempt to get better error
  5589. if (obj && obj.message) {
  5590. msg = obj.message;
  5591. }
  5592. else if (contents && contents.length > 0) {
  5593. // it may be the case that the exception is in the body message as string
  5594. msg = contents;
  5595. }
  5596. else {
  5597. msg = `Failed request: (${statusCode})`;
  5598. }
  5599. const err = new HttpClientError(msg, statusCode);
  5600. err.result = response.result;
  5601. reject(err);
  5602. }
  5603. else {
  5604. resolve(response);
  5605. }
  5606. }));
  5607. });
  5608. }
  5609. }
  5610. exports.HttpClient = HttpClient;
  5611. const lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCase()] = obj[k]), c), {});
  5612. //# sourceMappingURL=index.js.map
  5613. /***/ }),
  5614. /***/ 9835:
  5615. /***/ ((__unused_webpack_module, exports) => {
  5616. "use strict";
  5617. Object.defineProperty(exports, "__esModule", ({ value: true }));
  5618. exports.checkBypass = exports.getProxyUrl = void 0;
  5619. function getProxyUrl(reqUrl) {
  5620. const usingSsl = reqUrl.protocol === 'https:';
  5621. if (checkBypass(reqUrl)) {
  5622. return undefined;
  5623. }
  5624. const proxyVar = (() => {
  5625. if (usingSsl) {
  5626. return process.env['https_proxy'] || process.env['HTTPS_PROXY'];
  5627. }
  5628. else {
  5629. return process.env['http_proxy'] || process.env['HTTP_PROXY'];
  5630. }
  5631. })();
  5632. if (proxyVar) {
  5633. try {
  5634. return new URL(proxyVar);
  5635. }
  5636. catch (_a) {
  5637. if (!proxyVar.startsWith('http://') && !proxyVar.startsWith('https://'))
  5638. return new URL(`http://${proxyVar}`);
  5639. }
  5640. }
  5641. else {
  5642. return undefined;
  5643. }
  5644. }
  5645. exports.getProxyUrl = getProxyUrl;
  5646. function checkBypass(reqUrl) {
  5647. if (!reqUrl.hostname) {
  5648. return false;
  5649. }
  5650. const reqHost = reqUrl.hostname;
  5651. if (isLoopbackAddress(reqHost)) {
  5652. return true;
  5653. }
  5654. const noProxy = process.env['no_proxy'] || process.env['NO_PROXY'] || '';
  5655. if (!noProxy) {
  5656. return false;
  5657. }
  5658. // Determine the request port
  5659. let reqPort;
  5660. if (reqUrl.port) {
  5661. reqPort = Number(reqUrl.port);
  5662. }
  5663. else if (reqUrl.protocol === 'http:') {
  5664. reqPort = 80;
  5665. }
  5666. else if (reqUrl.protocol === 'https:') {
  5667. reqPort = 443;
  5668. }
  5669. // Format the request hostname and hostname with port
  5670. const upperReqHosts = [reqUrl.hostname.toUpperCase()];
  5671. if (typeof reqPort === 'number') {
  5672. upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`);
  5673. }
  5674. // Compare request host against noproxy
  5675. for (const upperNoProxyItem of noProxy
  5676. .split(',')
  5677. .map(x => x.trim().toUpperCase())
  5678. .filter(x => x)) {
  5679. if (upperNoProxyItem === '*' ||
  5680. upperReqHosts.some(x => x === upperNoProxyItem ||
  5681. x.endsWith(`.${upperNoProxyItem}`) ||
  5682. (upperNoProxyItem.startsWith('.') &&
  5683. x.endsWith(`${upperNoProxyItem}`)))) {
  5684. return true;
  5685. }
  5686. }
  5687. return false;
  5688. }
  5689. exports.checkBypass = checkBypass;
  5690. function isLoopbackAddress(host) {
  5691. const hostLower = host.toLowerCase();
  5692. return (hostLower === 'localhost' ||
  5693. hostLower.startsWith('127.') ||
  5694. hostLower.startsWith('[::1]') ||
  5695. hostLower.startsWith('[0:0:0:0:0:0:0:1]'));
  5696. }
  5697. //# sourceMappingURL=proxy.js.map
  5698. /***/ }),
  5699. /***/ 1962:
  5700. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  5701. "use strict";
  5702. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  5703. if (k2 === undefined) k2 = k;
  5704. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  5705. }) : (function(o, m, k, k2) {
  5706. if (k2 === undefined) k2 = k;
  5707. o[k2] = m[k];
  5708. }));
  5709. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  5710. Object.defineProperty(o, "default", { enumerable: true, value: v });
  5711. }) : function(o, v) {
  5712. o["default"] = v;
  5713. });
  5714. var __importStar = (this && this.__importStar) || function (mod) {
  5715. if (mod && mod.__esModule) return mod;
  5716. var result = {};
  5717. if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  5718. __setModuleDefault(result, mod);
  5719. return result;
  5720. };
  5721. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  5722. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  5723. return new (P || (P = Promise))(function (resolve, reject) {
  5724. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  5725. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  5726. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  5727. step((generator = generator.apply(thisArg, _arguments || [])).next());
  5728. });
  5729. };
  5730. var _a;
  5731. Object.defineProperty(exports, "__esModule", ({ value: true }));
  5732. 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;
  5733. const fs = __importStar(__nccwpck_require__(7147));
  5734. const path = __importStar(__nccwpck_require__(1017));
  5735. _a = fs.promises
  5736. // export const {open} = 'fs'
  5737. , 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;
  5738. // export const {open} = 'fs'
  5739. exports.IS_WINDOWS = process.platform === 'win32';
  5740. // See https://github.com/nodejs/node/blob/d0153aee367422d0858105abec186da4dff0a0c5/deps/uv/include/uv/win.h#L691
  5741. exports.UV_FS_O_EXLOCK = 0x10000000;
  5742. exports.READONLY = fs.constants.O_RDONLY;
  5743. function exists(fsPath) {
  5744. return __awaiter(this, void 0, void 0, function* () {
  5745. try {
  5746. yield exports.stat(fsPath);
  5747. }
  5748. catch (err) {
  5749. if (err.code === 'ENOENT') {
  5750. return false;
  5751. }
  5752. throw err;
  5753. }
  5754. return true;
  5755. });
  5756. }
  5757. exports.exists = exists;
  5758. function isDirectory(fsPath, useStat = false) {
  5759. return __awaiter(this, void 0, void 0, function* () {
  5760. const stats = useStat ? yield exports.stat(fsPath) : yield exports.lstat(fsPath);
  5761. return stats.isDirectory();
  5762. });
  5763. }
  5764. exports.isDirectory = isDirectory;
  5765. /**
  5766. * On OSX/Linux, true if path starts with '/'. On Windows, true for paths like:
  5767. * \, \hello, \\hello\share, C:, and C:\hello (and corresponding alternate separator cases).
  5768. */
  5769. function isRooted(p) {
  5770. p = normalizeSeparators(p);
  5771. if (!p) {
  5772. throw new Error('isRooted() parameter "p" cannot be empty');
  5773. }
  5774. if (exports.IS_WINDOWS) {
  5775. return (p.startsWith('\\') || /^[A-Z]:/i.test(p) // e.g. \ or \hello or \\hello
  5776. ); // e.g. C: or C:\hello
  5777. }
  5778. return p.startsWith('/');
  5779. }
  5780. exports.isRooted = isRooted;
  5781. /**
  5782. * Best effort attempt to determine whether a file exists and is executable.
  5783. * @param filePath file path to check
  5784. * @param extensions additional file extensions to try
  5785. * @return if file exists and is executable, returns the file path. otherwise empty string.
  5786. */
  5787. function tryGetExecutablePath(filePath, extensions) {
  5788. return __awaiter(this, void 0, void 0, function* () {
  5789. let stats = undefined;
  5790. try {
  5791. // test file exists
  5792. stats = yield exports.stat(filePath);
  5793. }
  5794. catch (err) {
  5795. if (err.code !== 'ENOENT') {
  5796. // eslint-disable-next-line no-console
  5797. console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`);
  5798. }
  5799. }
  5800. if (stats && stats.isFile()) {
  5801. if (exports.IS_WINDOWS) {
  5802. // on Windows, test for valid extension
  5803. const upperExt = path.extname(filePath).toUpperCase();
  5804. if (extensions.some(validExt => validExt.toUpperCase() === upperExt)) {
  5805. return filePath;
  5806. }
  5807. }
  5808. else {
  5809. if (isUnixExecutable(stats)) {
  5810. return filePath;
  5811. }
  5812. }
  5813. }
  5814. // try each extension
  5815. const originalFilePath = filePath;
  5816. for (const extension of extensions) {
  5817. filePath = originalFilePath + extension;
  5818. stats = undefined;
  5819. try {
  5820. stats = yield exports.stat(filePath);
  5821. }
  5822. catch (err) {
  5823. if (err.code !== 'ENOENT') {
  5824. // eslint-disable-next-line no-console
  5825. console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`);
  5826. }
  5827. }
  5828. if (stats && stats.isFile()) {
  5829. if (exports.IS_WINDOWS) {
  5830. // preserve the case of the actual file (since an extension was appended)
  5831. try {
  5832. const directory = path.dirname(filePath);
  5833. const upperName = path.basename(filePath).toUpperCase();
  5834. for (const actualName of yield exports.readdir(directory)) {
  5835. if (upperName === actualName.toUpperCase()) {
  5836. filePath = path.join(directory, actualName);
  5837. break;
  5838. }
  5839. }
  5840. }
  5841. catch (err) {
  5842. // eslint-disable-next-line no-console
  5843. console.log(`Unexpected error attempting to determine the actual case of the file '${filePath}': ${err}`);
  5844. }
  5845. return filePath;
  5846. }
  5847. else {
  5848. if (isUnixExecutable(stats)) {
  5849. return filePath;
  5850. }
  5851. }
  5852. }
  5853. }
  5854. return '';
  5855. });
  5856. }
  5857. exports.tryGetExecutablePath = tryGetExecutablePath;
  5858. function normalizeSeparators(p) {
  5859. p = p || '';
  5860. if (exports.IS_WINDOWS) {
  5861. // convert slashes on Windows
  5862. p = p.replace(/\//g, '\\');
  5863. // remove redundant slashes
  5864. return p.replace(/\\\\+/g, '\\');
  5865. }
  5866. // remove redundant slashes
  5867. return p.replace(/\/\/+/g, '/');
  5868. }
  5869. // on Mac/Linux, test the execute bit
  5870. // R W X R W X R W X
  5871. // 256 128 64 32 16 8 4 2 1
  5872. function isUnixExecutable(stats) {
  5873. return ((stats.mode & 1) > 0 ||
  5874. ((stats.mode & 8) > 0 && stats.gid === process.getgid()) ||
  5875. ((stats.mode & 64) > 0 && stats.uid === process.getuid()));
  5876. }
  5877. // Get the path of cmd.exe in windows
  5878. function getCmdPath() {
  5879. var _a;
  5880. return (_a = process.env['COMSPEC']) !== null && _a !== void 0 ? _a : `cmd.exe`;
  5881. }
  5882. exports.getCmdPath = getCmdPath;
  5883. //# sourceMappingURL=io-util.js.map
  5884. /***/ }),
  5885. /***/ 7436:
  5886. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  5887. "use strict";
  5888. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  5889. if (k2 === undefined) k2 = k;
  5890. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  5891. }) : (function(o, m, k, k2) {
  5892. if (k2 === undefined) k2 = k;
  5893. o[k2] = m[k];
  5894. }));
  5895. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  5896. Object.defineProperty(o, "default", { enumerable: true, value: v });
  5897. }) : function(o, v) {
  5898. o["default"] = v;
  5899. });
  5900. var __importStar = (this && this.__importStar) || function (mod) {
  5901. if (mod && mod.__esModule) return mod;
  5902. var result = {};
  5903. if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  5904. __setModuleDefault(result, mod);
  5905. return result;
  5906. };
  5907. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  5908. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  5909. return new (P || (P = Promise))(function (resolve, reject) {
  5910. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  5911. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  5912. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  5913. step((generator = generator.apply(thisArg, _arguments || [])).next());
  5914. });
  5915. };
  5916. Object.defineProperty(exports, "__esModule", ({ value: true }));
  5917. exports.findInPath = exports.which = exports.mkdirP = exports.rmRF = exports.mv = exports.cp = void 0;
  5918. const assert_1 = __nccwpck_require__(9491);
  5919. const path = __importStar(__nccwpck_require__(1017));
  5920. const ioUtil = __importStar(__nccwpck_require__(1962));
  5921. /**
  5922. * Copies a file or folder.
  5923. * Based off of shelljs - https://github.com/shelljs/shelljs/blob/9237f66c52e5daa40458f94f9565e18e8132f5a6/src/cp.js
  5924. *
  5925. * @param source source path
  5926. * @param dest destination path
  5927. * @param options optional. See CopyOptions.
  5928. */
  5929. function cp(source, dest, options = {}) {
  5930. return __awaiter(this, void 0, void 0, function* () {
  5931. const { force, recursive, copySourceDirectory } = readCopyOptions(options);
  5932. const destStat = (yield ioUtil.exists(dest)) ? yield ioUtil.stat(dest) : null;
  5933. // Dest is an existing file, but not forcing
  5934. if (destStat && destStat.isFile() && !force) {
  5935. return;
  5936. }
  5937. // If dest is an existing directory, should copy inside.
  5938. const newDest = destStat && destStat.isDirectory() && copySourceDirectory
  5939. ? path.join(dest, path.basename(source))
  5940. : dest;
  5941. if (!(yield ioUtil.exists(source))) {
  5942. throw new Error(`no such file or directory: ${source}`);
  5943. }
  5944. const sourceStat = yield ioUtil.stat(source);
  5945. if (sourceStat.isDirectory()) {
  5946. if (!recursive) {
  5947. throw new Error(`Failed to copy. ${source} is a directory, but tried to copy without recursive flag.`);
  5948. }
  5949. else {
  5950. yield cpDirRecursive(source, newDest, 0, force);
  5951. }
  5952. }
  5953. else {
  5954. if (path.relative(source, newDest) === '') {
  5955. // a file cannot be copied to itself
  5956. throw new Error(`'${newDest}' and '${source}' are the same file`);
  5957. }
  5958. yield copyFile(source, newDest, force);
  5959. }
  5960. });
  5961. }
  5962. exports.cp = cp;
  5963. /**
  5964. * Moves a path.
  5965. *
  5966. * @param source source path
  5967. * @param dest destination path
  5968. * @param options optional. See MoveOptions.
  5969. */
  5970. function mv(source, dest, options = {}) {
  5971. return __awaiter(this, void 0, void 0, function* () {
  5972. if (yield ioUtil.exists(dest)) {
  5973. let destExists = true;
  5974. if (yield ioUtil.isDirectory(dest)) {
  5975. // If dest is directory copy src into dest
  5976. dest = path.join(dest, path.basename(source));
  5977. destExists = yield ioUtil.exists(dest);
  5978. }
  5979. if (destExists) {
  5980. if (options.force == null || options.force) {
  5981. yield rmRF(dest);
  5982. }
  5983. else {
  5984. throw new Error('Destination already exists');
  5985. }
  5986. }
  5987. }
  5988. yield mkdirP(path.dirname(dest));
  5989. yield ioUtil.rename(source, dest);
  5990. });
  5991. }
  5992. exports.mv = mv;
  5993. /**
  5994. * Remove a path recursively with force
  5995. *
  5996. * @param inputPath path to remove
  5997. */
  5998. function rmRF(inputPath) {
  5999. return __awaiter(this, void 0, void 0, function* () {
  6000. if (ioUtil.IS_WINDOWS) {
  6001. // Check for invalid characters
  6002. // https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file
  6003. if (/[*"<>|]/.test(inputPath)) {
  6004. throw new Error('File path must not contain `*`, `"`, `<`, `>` or `|` on Windows');
  6005. }
  6006. }
  6007. try {
  6008. // note if path does not exist, error is silent
  6009. yield ioUtil.rm(inputPath, {
  6010. force: true,
  6011. maxRetries: 3,
  6012. recursive: true,
  6013. retryDelay: 300
  6014. });
  6015. }
  6016. catch (err) {
  6017. throw new Error(`File was unable to be removed ${err}`);
  6018. }
  6019. });
  6020. }
  6021. exports.rmRF = rmRF;
  6022. /**
  6023. * Make a directory. Creates the full path with folders in between
  6024. * Will throw if it fails
  6025. *
  6026. * @param fsPath path to create
  6027. * @returns Promise<void>
  6028. */
  6029. function mkdirP(fsPath) {
  6030. return __awaiter(this, void 0, void 0, function* () {
  6031. assert_1.ok(fsPath, 'a path argument must be provided');
  6032. yield ioUtil.mkdir(fsPath, { recursive: true });
  6033. });
  6034. }
  6035. exports.mkdirP = mkdirP;
  6036. /**
  6037. * Returns path of a tool had the tool actually been invoked. Resolves via paths.
  6038. * If you check and the tool does not exist, it will throw.
  6039. *
  6040. * @param tool name of the tool
  6041. * @param check whether to check if tool exists
  6042. * @returns Promise<string> path to tool
  6043. */
  6044. function which(tool, check) {
  6045. return __awaiter(this, void 0, void 0, function* () {
  6046. if (!tool) {
  6047. throw new Error("parameter 'tool' is required");
  6048. }
  6049. // recursive when check=true
  6050. if (check) {
  6051. const result = yield which(tool, false);
  6052. if (!result) {
  6053. if (ioUtil.IS_WINDOWS) {
  6054. 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.`);
  6055. }
  6056. else {
  6057. 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.`);
  6058. }
  6059. }
  6060. return result;
  6061. }
  6062. const matches = yield findInPath(tool);
  6063. if (matches && matches.length > 0) {
  6064. return matches[0];
  6065. }
  6066. return '';
  6067. });
  6068. }
  6069. exports.which = which;
  6070. /**
  6071. * Returns a list of all occurrences of the given tool on the system path.
  6072. *
  6073. * @returns Promise<string[]> the paths of the tool
  6074. */
  6075. function findInPath(tool) {
  6076. return __awaiter(this, void 0, void 0, function* () {
  6077. if (!tool) {
  6078. throw new Error("parameter 'tool' is required");
  6079. }
  6080. // build the list of extensions to try
  6081. const extensions = [];
  6082. if (ioUtil.IS_WINDOWS && process.env['PATHEXT']) {
  6083. for (const extension of process.env['PATHEXT'].split(path.delimiter)) {
  6084. if (extension) {
  6085. extensions.push(extension);
  6086. }
  6087. }
  6088. }
  6089. // if it's rooted, return it if exists. otherwise return empty.
  6090. if (ioUtil.isRooted(tool)) {
  6091. const filePath = yield ioUtil.tryGetExecutablePath(tool, extensions);
  6092. if (filePath) {
  6093. return [filePath];
  6094. }
  6095. return [];
  6096. }
  6097. // if any path separators, return empty
  6098. if (tool.includes(path.sep)) {
  6099. return [];
  6100. }
  6101. // build the list of directories
  6102. //
  6103. // Note, technically "where" checks the current directory on Windows. From a toolkit perspective,
  6104. // it feels like we should not do this. Checking the current directory seems like more of a use
  6105. // case of a shell, and the which() function exposed by the toolkit should strive for consistency
  6106. // across platforms.
  6107. const directories = [];
  6108. if (process.env.PATH) {
  6109. for (const p of process.env.PATH.split(path.delimiter)) {
  6110. if (p) {
  6111. directories.push(p);
  6112. }
  6113. }
  6114. }
  6115. // find all matches
  6116. const matches = [];
  6117. for (const directory of directories) {
  6118. const filePath = yield ioUtil.tryGetExecutablePath(path.join(directory, tool), extensions);
  6119. if (filePath) {
  6120. matches.push(filePath);
  6121. }
  6122. }
  6123. return matches;
  6124. });
  6125. }
  6126. exports.findInPath = findInPath;
  6127. function readCopyOptions(options) {
  6128. const force = options.force == null ? true : options.force;
  6129. const recursive = Boolean(options.recursive);
  6130. const copySourceDirectory = options.copySourceDirectory == null
  6131. ? true
  6132. : Boolean(options.copySourceDirectory);
  6133. return { force, recursive, copySourceDirectory };
  6134. }
  6135. function cpDirRecursive(sourceDir, destDir, currentDepth, force) {
  6136. return __awaiter(this, void 0, void 0, function* () {
  6137. // Ensure there is not a run away recursive copy
  6138. if (currentDepth >= 255)
  6139. return;
  6140. currentDepth++;
  6141. yield mkdirP(destDir);
  6142. const files = yield ioUtil.readdir(sourceDir);
  6143. for (const fileName of files) {
  6144. const srcFile = `${sourceDir}/${fileName}`;
  6145. const destFile = `${destDir}/${fileName}`;
  6146. const srcFileStat = yield ioUtil.lstat(srcFile);
  6147. if (srcFileStat.isDirectory()) {
  6148. // Recurse
  6149. yield cpDirRecursive(srcFile, destFile, currentDepth, force);
  6150. }
  6151. else {
  6152. yield copyFile(srcFile, destFile, force);
  6153. }
  6154. }
  6155. // Change the mode for the newly created directory
  6156. yield ioUtil.chmod(destDir, (yield ioUtil.stat(sourceDir)).mode);
  6157. });
  6158. }
  6159. // Buffered file copy
  6160. function copyFile(srcFile, destFile, force) {
  6161. return __awaiter(this, void 0, void 0, function* () {
  6162. if ((yield ioUtil.lstat(srcFile)).isSymbolicLink()) {
  6163. // unlink/re-link it
  6164. try {
  6165. yield ioUtil.lstat(destFile);
  6166. yield ioUtil.unlink(destFile);
  6167. }
  6168. catch (e) {
  6169. // Try to override file permission
  6170. if (e.code === 'EPERM') {
  6171. yield ioUtil.chmod(destFile, '0666');
  6172. yield ioUtil.unlink(destFile);
  6173. }
  6174. // other errors = it doesn't exist, no work to do
  6175. }
  6176. // Copy over symlink
  6177. const symlinkFull = yield ioUtil.readlink(srcFile);
  6178. yield ioUtil.symlink(symlinkFull, destFile, ioUtil.IS_WINDOWS ? 'junction' : null);
  6179. }
  6180. else if (!(yield ioUtil.exists(destFile)) || force) {
  6181. yield ioUtil.copyFile(srcFile, destFile);
  6182. }
  6183. });
  6184. }
  6185. //# sourceMappingURL=io.js.map
  6186. /***/ }),
  6187. /***/ 2473:
  6188. /***/ (function(module, exports, __nccwpck_require__) {
  6189. "use strict";
  6190. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  6191. if (k2 === undefined) k2 = k;
  6192. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  6193. }) : (function(o, m, k, k2) {
  6194. if (k2 === undefined) k2 = k;
  6195. o[k2] = m[k];
  6196. }));
  6197. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  6198. Object.defineProperty(o, "default", { enumerable: true, value: v });
  6199. }) : function(o, v) {
  6200. o["default"] = v;
  6201. });
  6202. var __importStar = (this && this.__importStar) || function (mod) {
  6203. if (mod && mod.__esModule) return mod;
  6204. var result = {};
  6205. if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  6206. __setModuleDefault(result, mod);
  6207. return result;
  6208. };
  6209. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  6210. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  6211. return new (P || (P = Promise))(function (resolve, reject) {
  6212. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  6213. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  6214. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  6215. step((generator = generator.apply(thisArg, _arguments || [])).next());
  6216. });
  6217. };
  6218. Object.defineProperty(exports, "__esModule", ({ value: true }));
  6219. exports._readLinuxVersionFile = exports._getOsVersion = exports._findMatch = void 0;
  6220. const semver = __importStar(__nccwpck_require__(5911));
  6221. const core_1 = __nccwpck_require__(2186);
  6222. // needs to be require for core node modules to be mocked
  6223. /* eslint @typescript-eslint/no-require-imports: 0 */
  6224. const os = __nccwpck_require__(2037);
  6225. const cp = __nccwpck_require__(2081);
  6226. const fs = __nccwpck_require__(7147);
  6227. function _findMatch(versionSpec, stable, candidates, archFilter) {
  6228. return __awaiter(this, void 0, void 0, function* () {
  6229. const platFilter = os.platform();
  6230. let result;
  6231. let match;
  6232. let file;
  6233. for (const candidate of candidates) {
  6234. const version = candidate.version;
  6235. core_1.debug(`check ${version} satisfies ${versionSpec}`);
  6236. if (semver.satisfies(version, versionSpec) &&
  6237. (!stable || candidate.stable === stable)) {
  6238. file = candidate.files.find(item => {
  6239. core_1.debug(`${item.arch}===${archFilter} && ${item.platform}===${platFilter}`);
  6240. let chk = item.arch === archFilter && item.platform === platFilter;
  6241. if (chk && item.platform_version) {
  6242. const osVersion = module.exports._getOsVersion();
  6243. if (osVersion === item.platform_version) {
  6244. chk = true;
  6245. }
  6246. else {
  6247. chk = semver.satisfies(osVersion, item.platform_version);
  6248. }
  6249. }
  6250. return chk;
  6251. });
  6252. if (file) {
  6253. core_1.debug(`matched ${candidate.version}`);
  6254. match = candidate;
  6255. break;
  6256. }
  6257. }
  6258. }
  6259. if (match && file) {
  6260. // clone since we're mutating the file list to be only the file that matches
  6261. result = Object.assign({}, match);
  6262. result.files = [file];
  6263. }
  6264. return result;
  6265. });
  6266. }
  6267. exports._findMatch = _findMatch;
  6268. function _getOsVersion() {
  6269. // TODO: add windows and other linux, arm variants
  6270. // right now filtering on version is only an ubuntu and macos scenario for tools we build for hosted (python)
  6271. const plat = os.platform();
  6272. let version = '';
  6273. if (plat === 'darwin') {
  6274. version = cp.execSync('sw_vers -productVersion').toString();
  6275. }
  6276. else if (plat === 'linux') {
  6277. // lsb_release process not in some containers, readfile
  6278. // Run cat /etc/lsb-release
  6279. // DISTRIB_ID=Ubuntu
  6280. // DISTRIB_RELEASE=18.04
  6281. // DISTRIB_CODENAME=bionic
  6282. // DISTRIB_DESCRIPTION="Ubuntu 18.04.4 LTS"
  6283. const lsbContents = module.exports._readLinuxVersionFile();
  6284. if (lsbContents) {
  6285. const lines = lsbContents.split('\n');
  6286. for (const line of lines) {
  6287. const parts = line.split('=');
  6288. if (parts.length === 2 &&
  6289. (parts[0].trim() === 'VERSION_ID' ||
  6290. parts[0].trim() === 'DISTRIB_RELEASE')) {
  6291. version = parts[1]
  6292. .trim()
  6293. .replace(/^"/, '')
  6294. .replace(/"$/, '');
  6295. break;
  6296. }
  6297. }
  6298. }
  6299. }
  6300. return version;
  6301. }
  6302. exports._getOsVersion = _getOsVersion;
  6303. function _readLinuxVersionFile() {
  6304. const lsbReleaseFile = '/etc/lsb-release';
  6305. const osReleaseFile = '/etc/os-release';
  6306. let contents = '';
  6307. if (fs.existsSync(lsbReleaseFile)) {
  6308. contents = fs.readFileSync(lsbReleaseFile).toString();
  6309. }
  6310. else if (fs.existsSync(osReleaseFile)) {
  6311. contents = fs.readFileSync(osReleaseFile).toString();
  6312. }
  6313. return contents;
  6314. }
  6315. exports._readLinuxVersionFile = _readLinuxVersionFile;
  6316. //# sourceMappingURL=manifest.js.map
  6317. /***/ }),
  6318. /***/ 8279:
  6319. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  6320. "use strict";
  6321. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  6322. if (k2 === undefined) k2 = k;
  6323. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  6324. }) : (function(o, m, k, k2) {
  6325. if (k2 === undefined) k2 = k;
  6326. o[k2] = m[k];
  6327. }));
  6328. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  6329. Object.defineProperty(o, "default", { enumerable: true, value: v });
  6330. }) : function(o, v) {
  6331. o["default"] = v;
  6332. });
  6333. var __importStar = (this && this.__importStar) || function (mod) {
  6334. if (mod && mod.__esModule) return mod;
  6335. var result = {};
  6336. if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  6337. __setModuleDefault(result, mod);
  6338. return result;
  6339. };
  6340. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  6341. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  6342. return new (P || (P = Promise))(function (resolve, reject) {
  6343. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  6344. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  6345. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  6346. step((generator = generator.apply(thisArg, _arguments || [])).next());
  6347. });
  6348. };
  6349. Object.defineProperty(exports, "__esModule", ({ value: true }));
  6350. exports.RetryHelper = void 0;
  6351. const core = __importStar(__nccwpck_require__(2186));
  6352. /**
  6353. * Internal class for retries
  6354. */
  6355. class RetryHelper {
  6356. constructor(maxAttempts, minSeconds, maxSeconds) {
  6357. if (maxAttempts < 1) {
  6358. throw new Error('max attempts should be greater than or equal to 1');
  6359. }
  6360. this.maxAttempts = maxAttempts;
  6361. this.minSeconds = Math.floor(minSeconds);
  6362. this.maxSeconds = Math.floor(maxSeconds);
  6363. if (this.minSeconds > this.maxSeconds) {
  6364. throw new Error('min seconds should be less than or equal to max seconds');
  6365. }
  6366. }
  6367. execute(action, isRetryable) {
  6368. return __awaiter(this, void 0, void 0, function* () {
  6369. let attempt = 1;
  6370. while (attempt < this.maxAttempts) {
  6371. // Try
  6372. try {
  6373. return yield action();
  6374. }
  6375. catch (err) {
  6376. if (isRetryable && !isRetryable(err)) {
  6377. throw err;
  6378. }
  6379. core.info(err.message);
  6380. }
  6381. // Sleep
  6382. const seconds = this.getSleepAmount();
  6383. core.info(`Waiting ${seconds} seconds before trying again`);
  6384. yield this.sleep(seconds);
  6385. attempt++;
  6386. }
  6387. // Last attempt
  6388. return yield action();
  6389. });
  6390. }
  6391. getSleepAmount() {
  6392. return (Math.floor(Math.random() * (this.maxSeconds - this.minSeconds + 1)) +
  6393. this.minSeconds);
  6394. }
  6395. sleep(seconds) {
  6396. return __awaiter(this, void 0, void 0, function* () {
  6397. return new Promise(resolve => setTimeout(resolve, seconds * 1000));
  6398. });
  6399. }
  6400. }
  6401. exports.RetryHelper = RetryHelper;
  6402. //# sourceMappingURL=retry-helper.js.map
  6403. /***/ }),
  6404. /***/ 7784:
  6405. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  6406. "use strict";
  6407. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  6408. if (k2 === undefined) k2 = k;
  6409. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  6410. }) : (function(o, m, k, k2) {
  6411. if (k2 === undefined) k2 = k;
  6412. o[k2] = m[k];
  6413. }));
  6414. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  6415. Object.defineProperty(o, "default", { enumerable: true, value: v });
  6416. }) : function(o, v) {
  6417. o["default"] = v;
  6418. });
  6419. var __importStar = (this && this.__importStar) || function (mod) {
  6420. if (mod && mod.__esModule) return mod;
  6421. var result = {};
  6422. if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  6423. __setModuleDefault(result, mod);
  6424. return result;
  6425. };
  6426. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  6427. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  6428. return new (P || (P = Promise))(function (resolve, reject) {
  6429. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  6430. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  6431. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  6432. step((generator = generator.apply(thisArg, _arguments || [])).next());
  6433. });
  6434. };
  6435. var __importDefault = (this && this.__importDefault) || function (mod) {
  6436. return (mod && mod.__esModule) ? mod : { "default": mod };
  6437. };
  6438. Object.defineProperty(exports, "__esModule", ({ value: true }));
  6439. 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;
  6440. const core = __importStar(__nccwpck_require__(2186));
  6441. const io = __importStar(__nccwpck_require__(7436));
  6442. const fs = __importStar(__nccwpck_require__(7147));
  6443. const mm = __importStar(__nccwpck_require__(2473));
  6444. const os = __importStar(__nccwpck_require__(2037));
  6445. const path = __importStar(__nccwpck_require__(1017));
  6446. const httpm = __importStar(__nccwpck_require__(6255));
  6447. const semver = __importStar(__nccwpck_require__(5911));
  6448. const stream = __importStar(__nccwpck_require__(2781));
  6449. const util = __importStar(__nccwpck_require__(3837));
  6450. const assert_1 = __nccwpck_require__(9491);
  6451. const v4_1 = __importDefault(__nccwpck_require__(7468));
  6452. const exec_1 = __nccwpck_require__(1514);
  6453. const retry_helper_1 = __nccwpck_require__(8279);
  6454. class HTTPError extends Error {
  6455. constructor(httpStatusCode) {
  6456. super(`Unexpected HTTP response: ${httpStatusCode}`);
  6457. this.httpStatusCode = httpStatusCode;
  6458. Object.setPrototypeOf(this, new.target.prototype);
  6459. }
  6460. }
  6461. exports.HTTPError = HTTPError;
  6462. const IS_WINDOWS = process.platform === 'win32';
  6463. const IS_MAC = process.platform === 'darwin';
  6464. const userAgent = 'actions/tool-cache';
  6465. /**
  6466. * Download a tool from an url and stream it into a file
  6467. *
  6468. * @param url url of tool to download
  6469. * @param dest path to download tool
  6470. * @param auth authorization header
  6471. * @param headers other headers
  6472. * @returns path to downloaded tool
  6473. */
  6474. function downloadTool(url, dest, auth, headers) {
  6475. return __awaiter(this, void 0, void 0, function* () {
  6476. dest = dest || path.join(_getTempDirectory(), v4_1.default());
  6477. yield io.mkdirP(path.dirname(dest));
  6478. core.debug(`Downloading ${url}`);
  6479. core.debug(`Destination ${dest}`);
  6480. const maxAttempts = 3;
  6481. const minSeconds = _getGlobal('TEST_DOWNLOAD_TOOL_RETRY_MIN_SECONDS', 10);
  6482. const maxSeconds = _getGlobal('TEST_DOWNLOAD_TOOL_RETRY_MAX_SECONDS', 20);
  6483. const retryHelper = new retry_helper_1.RetryHelper(maxAttempts, minSeconds, maxSeconds);
  6484. return yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  6485. return yield downloadToolAttempt(url, dest || '', auth, headers);
  6486. }), (err) => {
  6487. if (err instanceof HTTPError && err.httpStatusCode) {
  6488. // Don't retry anything less than 500, except 408 Request Timeout and 429 Too Many Requests
  6489. if (err.httpStatusCode < 500 &&
  6490. err.httpStatusCode !== 408 &&
  6491. err.httpStatusCode !== 429) {
  6492. return false;
  6493. }
  6494. }
  6495. // Otherwise retry
  6496. return true;
  6497. });
  6498. });
  6499. }
  6500. exports.downloadTool = downloadTool;
  6501. function downloadToolAttempt(url, dest, auth, headers) {
  6502. return __awaiter(this, void 0, void 0, function* () {
  6503. if (fs.existsSync(dest)) {
  6504. throw new Error(`Destination file path ${dest} already exists`);
  6505. }
  6506. // Get the response headers
  6507. const http = new httpm.HttpClient(userAgent, [], {
  6508. allowRetries: false
  6509. });
  6510. if (auth) {
  6511. core.debug('set auth');
  6512. if (headers === undefined) {
  6513. headers = {};
  6514. }
  6515. headers.authorization = auth;
  6516. }
  6517. const response = yield http.get(url, headers);
  6518. if (response.message.statusCode !== 200) {
  6519. const err = new HTTPError(response.message.statusCode);
  6520. core.debug(`Failed to download from "${url}". Code(${response.message.statusCode}) Message(${response.message.statusMessage})`);
  6521. throw err;
  6522. }
  6523. // Download the response body
  6524. const pipeline = util.promisify(stream.pipeline);
  6525. const responseMessageFactory = _getGlobal('TEST_DOWNLOAD_TOOL_RESPONSE_MESSAGE_FACTORY', () => response.message);
  6526. const readStream = responseMessageFactory();
  6527. let succeeded = false;
  6528. try {
  6529. yield pipeline(readStream, fs.createWriteStream(dest));
  6530. core.debug('download complete');
  6531. succeeded = true;
  6532. return dest;
  6533. }
  6534. finally {
  6535. // Error, delete dest before retry
  6536. if (!succeeded) {
  6537. core.debug('download failed');
  6538. try {
  6539. yield io.rmRF(dest);
  6540. }
  6541. catch (err) {
  6542. core.debug(`Failed to delete '${dest}'. ${err.message}`);
  6543. }
  6544. }
  6545. }
  6546. });
  6547. }
  6548. /**
  6549. * Extract a .7z file
  6550. *
  6551. * @param file path to the .7z file
  6552. * @param dest destination directory. Optional.
  6553. * @param _7zPath path to 7zr.exe. Optional, for long path support. Most .7z archives do not have this
  6554. * problem. If your .7z archive contains very long paths, you can pass the path to 7zr.exe which will
  6555. * gracefully handle long paths. By default 7zdec.exe is used because it is a very small program and is
  6556. * bundled with the tool lib. However it does not support long paths. 7zr.exe is the reduced command line
  6557. * interface, it is smaller than the full command line interface, and it does support long paths. At the
  6558. * time of this writing, it is freely available from the LZMA SDK that is available on the 7zip website.
  6559. * Be sure to check the current license agreement. If 7zr.exe is bundled with your action, then the path
  6560. * to 7zr.exe can be pass to this function.
  6561. * @returns path to the destination directory
  6562. */
  6563. function extract7z(file, dest, _7zPath) {
  6564. return __awaiter(this, void 0, void 0, function* () {
  6565. assert_1.ok(IS_WINDOWS, 'extract7z() not supported on current OS');
  6566. assert_1.ok(file, 'parameter "file" is required');
  6567. dest = yield _createExtractFolder(dest);
  6568. const originalCwd = process.cwd();
  6569. process.chdir(dest);
  6570. if (_7zPath) {
  6571. try {
  6572. const logLevel = core.isDebug() ? '-bb1' : '-bb0';
  6573. const args = [
  6574. 'x',
  6575. logLevel,
  6576. '-bd',
  6577. '-sccUTF-8',
  6578. file
  6579. ];
  6580. const options = {
  6581. silent: true
  6582. };
  6583. yield exec_1.exec(`"${_7zPath}"`, args, options);
  6584. }
  6585. finally {
  6586. process.chdir(originalCwd);
  6587. }
  6588. }
  6589. else {
  6590. const escapedScript = path
  6591. .join(__dirname, '..', 'scripts', 'Invoke-7zdec.ps1')
  6592. .replace(/'/g, "''")
  6593. .replace(/"|\n|\r/g, ''); // double-up single quotes, remove double quotes and newlines
  6594. const escapedFile = file.replace(/'/g, "''").replace(/"|\n|\r/g, '');
  6595. const escapedTarget = dest.replace(/'/g, "''").replace(/"|\n|\r/g, '');
  6596. const command = `& '${escapedScript}' -Source '${escapedFile}' -Target '${escapedTarget}'`;
  6597. const args = [
  6598. '-NoLogo',
  6599. '-Sta',
  6600. '-NoProfile',
  6601. '-NonInteractive',
  6602. '-ExecutionPolicy',
  6603. 'Unrestricted',
  6604. '-Command',
  6605. command
  6606. ];
  6607. const options = {
  6608. silent: true
  6609. };
  6610. try {
  6611. const powershellPath = yield io.which('powershell', true);
  6612. yield exec_1.exec(`"${powershellPath}"`, args, options);
  6613. }
  6614. finally {
  6615. process.chdir(originalCwd);
  6616. }
  6617. }
  6618. return dest;
  6619. });
  6620. }
  6621. exports.extract7z = extract7z;
  6622. /**
  6623. * Extract a compressed tar archive
  6624. *
  6625. * @param file path to the tar
  6626. * @param dest destination directory. Optional.
  6627. * @param flags flags for the tar command to use for extraction. Defaults to 'xz' (extracting gzipped tars). Optional.
  6628. * @returns path to the destination directory
  6629. */
  6630. function extractTar(file, dest, flags = 'xz') {
  6631. return __awaiter(this, void 0, void 0, function* () {
  6632. if (!file) {
  6633. throw new Error("parameter 'file' is required");
  6634. }
  6635. // Create dest
  6636. dest = yield _createExtractFolder(dest);
  6637. // Determine whether GNU tar
  6638. core.debug('Checking tar --version');
  6639. let versionOutput = '';
  6640. yield exec_1.exec('tar --version', [], {
  6641. ignoreReturnCode: true,
  6642. silent: true,
  6643. listeners: {
  6644. stdout: (data) => (versionOutput += data.toString()),
  6645. stderr: (data) => (versionOutput += data.toString())
  6646. }
  6647. });
  6648. core.debug(versionOutput.trim());
  6649. const isGnuTar = versionOutput.toUpperCase().includes('GNU TAR');
  6650. // Initialize args
  6651. let args;
  6652. if (flags instanceof Array) {
  6653. args = flags;
  6654. }
  6655. else {
  6656. args = [flags];
  6657. }
  6658. if (core.isDebug() && !flags.includes('v')) {
  6659. args.push('-v');
  6660. }
  6661. let destArg = dest;
  6662. let fileArg = file;
  6663. if (IS_WINDOWS && isGnuTar) {
  6664. args.push('--force-local');
  6665. destArg = dest.replace(/\\/g, '/');
  6666. // Technically only the dest needs to have `/` but for aesthetic consistency
  6667. // convert slashes in the file arg too.
  6668. fileArg = file.replace(/\\/g, '/');
  6669. }
  6670. if (isGnuTar) {
  6671. // Suppress warnings when using GNU tar to extract archives created by BSD tar
  6672. args.push('--warning=no-unknown-keyword');
  6673. args.push('--overwrite');
  6674. }
  6675. args.push('-C', destArg, '-f', fileArg);
  6676. yield exec_1.exec(`tar`, args);
  6677. return dest;
  6678. });
  6679. }
  6680. exports.extractTar = extractTar;
  6681. /**
  6682. * Extract a xar compatible archive
  6683. *
  6684. * @param file path to the archive
  6685. * @param dest destination directory. Optional.
  6686. * @param flags flags for the xar. Optional.
  6687. * @returns path to the destination directory
  6688. */
  6689. function extractXar(file, dest, flags = []) {
  6690. return __awaiter(this, void 0, void 0, function* () {
  6691. assert_1.ok(IS_MAC, 'extractXar() not supported on current OS');
  6692. assert_1.ok(file, 'parameter "file" is required');
  6693. dest = yield _createExtractFolder(dest);
  6694. let args;
  6695. if (flags instanceof Array) {
  6696. args = flags;
  6697. }
  6698. else {
  6699. args = [flags];
  6700. }
  6701. args.push('-x', '-C', dest, '-f', file);
  6702. if (core.isDebug()) {
  6703. args.push('-v');
  6704. }
  6705. const xarPath = yield io.which('xar', true);
  6706. yield exec_1.exec(`"${xarPath}"`, _unique(args));
  6707. return dest;
  6708. });
  6709. }
  6710. exports.extractXar = extractXar;
  6711. /**
  6712. * Extract a zip
  6713. *
  6714. * @param file path to the zip
  6715. * @param dest destination directory. Optional.
  6716. * @returns path to the destination directory
  6717. */
  6718. function extractZip(file, dest) {
  6719. return __awaiter(this, void 0, void 0, function* () {
  6720. if (!file) {
  6721. throw new Error("parameter 'file' is required");
  6722. }
  6723. dest = yield _createExtractFolder(dest);
  6724. if (IS_WINDOWS) {
  6725. yield extractZipWin(file, dest);
  6726. }
  6727. else {
  6728. yield extractZipNix(file, dest);
  6729. }
  6730. return dest;
  6731. });
  6732. }
  6733. exports.extractZip = extractZip;
  6734. function extractZipWin(file, dest) {
  6735. return __awaiter(this, void 0, void 0, function* () {
  6736. // build the powershell command
  6737. const escapedFile = file.replace(/'/g, "''").replace(/"|\n|\r/g, ''); // double-up single quotes, remove double quotes and newlines
  6738. const escapedDest = dest.replace(/'/g, "''").replace(/"|\n|\r/g, '');
  6739. const pwshPath = yield io.which('pwsh', false);
  6740. //To match the file overwrite behavior on nix systems, we use the overwrite = true flag for ExtractToDirectory
  6741. //and the -Force flag for Expand-Archive as a fallback
  6742. if (pwshPath) {
  6743. //attempt to use pwsh with ExtractToDirectory, if this fails attempt Expand-Archive
  6744. const pwshCommand = [
  6745. `$ErrorActionPreference = 'Stop' ;`,
  6746. `try { Add-Type -AssemblyName System.IO.Compression.ZipFile } catch { } ;`,
  6747. `try { [System.IO.Compression.ZipFile]::ExtractToDirectory('${escapedFile}', '${escapedDest}', $true) }`,
  6748. `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 $_ } } ;`
  6749. ].join(' ');
  6750. const args = [
  6751. '-NoLogo',
  6752. '-NoProfile',
  6753. '-NonInteractive',
  6754. '-ExecutionPolicy',
  6755. 'Unrestricted',
  6756. '-Command',
  6757. pwshCommand
  6758. ];
  6759. core.debug(`Using pwsh at path: ${pwshPath}`);
  6760. yield exec_1.exec(`"${pwshPath}"`, args);
  6761. }
  6762. else {
  6763. const powershellCommand = [
  6764. `$ErrorActionPreference = 'Stop' ;`,
  6765. `try { Add-Type -AssemblyName System.IO.Compression.FileSystem } catch { } ;`,
  6766. `if ((Get-Command -Name Expand-Archive -Module Microsoft.PowerShell.Archive -ErrorAction Ignore)) { Expand-Archive -LiteralPath '${escapedFile}' -DestinationPath '${escapedDest}' -Force }`,
  6767. `else {[System.IO.Compression.ZipFile]::ExtractToDirectory('${escapedFile}', '${escapedDest}', $true) }`
  6768. ].join(' ');
  6769. const args = [
  6770. '-NoLogo',
  6771. '-Sta',
  6772. '-NoProfile',
  6773. '-NonInteractive',
  6774. '-ExecutionPolicy',
  6775. 'Unrestricted',
  6776. '-Command',
  6777. powershellCommand
  6778. ];
  6779. const powershellPath = yield io.which('powershell', true);
  6780. core.debug(`Using powershell at path: ${powershellPath}`);
  6781. yield exec_1.exec(`"${powershellPath}"`, args);
  6782. }
  6783. });
  6784. }
  6785. function extractZipNix(file, dest) {
  6786. return __awaiter(this, void 0, void 0, function* () {
  6787. const unzipPath = yield io.which('unzip', true);
  6788. const args = [file];
  6789. if (!core.isDebug()) {
  6790. args.unshift('-q');
  6791. }
  6792. args.unshift('-o'); //overwrite with -o, otherwise a prompt is shown which freezes the run
  6793. yield exec_1.exec(`"${unzipPath}"`, args, { cwd: dest });
  6794. });
  6795. }
  6796. /**
  6797. * Caches a directory and installs it into the tool cacheDir
  6798. *
  6799. * @param sourceDir the directory to cache into tools
  6800. * @param tool tool name
  6801. * @param version version of the tool. semver format
  6802. * @param arch architecture of the tool. Optional. Defaults to machine architecture
  6803. */
  6804. function cacheDir(sourceDir, tool, version, arch) {
  6805. return __awaiter(this, void 0, void 0, function* () {
  6806. version = semver.clean(version) || version;
  6807. arch = arch || os.arch();
  6808. core.debug(`Caching tool ${tool} ${version} ${arch}`);
  6809. core.debug(`source dir: ${sourceDir}`);
  6810. if (!fs.statSync(sourceDir).isDirectory()) {
  6811. throw new Error('sourceDir is not a directory');
  6812. }
  6813. // Create the tool dir
  6814. const destPath = yield _createToolPath(tool, version, arch);
  6815. // copy each child item. do not move. move can fail on Windows
  6816. // due to anti-virus software having an open handle on a file.
  6817. for (const itemName of fs.readdirSync(sourceDir)) {
  6818. const s = path.join(sourceDir, itemName);
  6819. yield io.cp(s, destPath, { recursive: true });
  6820. }
  6821. // write .complete
  6822. _completeToolPath(tool, version, arch);
  6823. return destPath;
  6824. });
  6825. }
  6826. exports.cacheDir = cacheDir;
  6827. /**
  6828. * Caches a downloaded file (GUID) and installs it
  6829. * into the tool cache with a given targetName
  6830. *
  6831. * @param sourceFile the file to cache into tools. Typically a result of downloadTool which is a guid.
  6832. * @param targetFile the name of the file name in the tools directory
  6833. * @param tool tool name
  6834. * @param version version of the tool. semver format
  6835. * @param arch architecture of the tool. Optional. Defaults to machine architecture
  6836. */
  6837. function cacheFile(sourceFile, targetFile, tool, version, arch) {
  6838. return __awaiter(this, void 0, void 0, function* () {
  6839. version = semver.clean(version) || version;
  6840. arch = arch || os.arch();
  6841. core.debug(`Caching tool ${tool} ${version} ${arch}`);
  6842. core.debug(`source file: ${sourceFile}`);
  6843. if (!fs.statSync(sourceFile).isFile()) {
  6844. throw new Error('sourceFile is not a file');
  6845. }
  6846. // create the tool dir
  6847. const destFolder = yield _createToolPath(tool, version, arch);
  6848. // copy instead of move. move can fail on Windows due to
  6849. // anti-virus software having an open handle on a file.
  6850. const destPath = path.join(destFolder, targetFile);
  6851. core.debug(`destination file ${destPath}`);
  6852. yield io.cp(sourceFile, destPath);
  6853. // write .complete
  6854. _completeToolPath(tool, version, arch);
  6855. return destFolder;
  6856. });
  6857. }
  6858. exports.cacheFile = cacheFile;
  6859. /**
  6860. * Finds the path to a tool version in the local installed tool cache
  6861. *
  6862. * @param toolName name of the tool
  6863. * @param versionSpec version of the tool
  6864. * @param arch optional arch. defaults to arch of computer
  6865. */
  6866. function find(toolName, versionSpec, arch) {
  6867. if (!toolName) {
  6868. throw new Error('toolName parameter is required');
  6869. }
  6870. if (!versionSpec) {
  6871. throw new Error('versionSpec parameter is required');
  6872. }
  6873. arch = arch || os.arch();
  6874. // attempt to resolve an explicit version
  6875. if (!isExplicitVersion(versionSpec)) {
  6876. const localVersions = findAllVersions(toolName, arch);
  6877. const match = evaluateVersions(localVersions, versionSpec);
  6878. versionSpec = match;
  6879. }
  6880. // check for the explicit version in the cache
  6881. let toolPath = '';
  6882. if (versionSpec) {
  6883. versionSpec = semver.clean(versionSpec) || '';
  6884. const cachePath = path.join(_getCacheDirectory(), toolName, versionSpec, arch);
  6885. core.debug(`checking cache: ${cachePath}`);
  6886. if (fs.existsSync(cachePath) && fs.existsSync(`${cachePath}.complete`)) {
  6887. core.debug(`Found tool in cache ${toolName} ${versionSpec} ${arch}`);
  6888. toolPath = cachePath;
  6889. }
  6890. else {
  6891. core.debug('not found');
  6892. }
  6893. }
  6894. return toolPath;
  6895. }
  6896. exports.find = find;
  6897. /**
  6898. * Finds the paths to all versions of a tool that are installed in the local tool cache
  6899. *
  6900. * @param toolName name of the tool
  6901. * @param arch optional arch. defaults to arch of computer
  6902. */
  6903. function findAllVersions(toolName, arch) {
  6904. const versions = [];
  6905. arch = arch || os.arch();
  6906. const toolPath = path.join(_getCacheDirectory(), toolName);
  6907. if (fs.existsSync(toolPath)) {
  6908. const children = fs.readdirSync(toolPath);
  6909. for (const child of children) {
  6910. if (isExplicitVersion(child)) {
  6911. const fullPath = path.join(toolPath, child, arch || '');
  6912. if (fs.existsSync(fullPath) && fs.existsSync(`${fullPath}.complete`)) {
  6913. versions.push(child);
  6914. }
  6915. }
  6916. }
  6917. }
  6918. return versions;
  6919. }
  6920. exports.findAllVersions = findAllVersions;
  6921. function getManifestFromRepo(owner, repo, auth, branch = 'master') {
  6922. return __awaiter(this, void 0, void 0, function* () {
  6923. let releases = [];
  6924. const treeUrl = `https://api.github.com/repos/${owner}/${repo}/git/trees/${branch}`;
  6925. const http = new httpm.HttpClient('tool-cache');
  6926. const headers = {};
  6927. if (auth) {
  6928. core.debug('set auth');
  6929. headers.authorization = auth;
  6930. }
  6931. const response = yield http.getJson(treeUrl, headers);
  6932. if (!response.result) {
  6933. return releases;
  6934. }
  6935. let manifestUrl = '';
  6936. for (const item of response.result.tree) {
  6937. if (item.path === 'versions-manifest.json') {
  6938. manifestUrl = item.url;
  6939. break;
  6940. }
  6941. }
  6942. headers['accept'] = 'application/vnd.github.VERSION.raw';
  6943. let versionsRaw = yield (yield http.get(manifestUrl, headers)).readBody();
  6944. if (versionsRaw) {
  6945. // shouldn't be needed but protects against invalid json saved with BOM
  6946. versionsRaw = versionsRaw.replace(/^\uFEFF/, '');
  6947. try {
  6948. releases = JSON.parse(versionsRaw);
  6949. }
  6950. catch (_a) {
  6951. core.debug('Invalid json');
  6952. }
  6953. }
  6954. return releases;
  6955. });
  6956. }
  6957. exports.getManifestFromRepo = getManifestFromRepo;
  6958. function findFromManifest(versionSpec, stable, manifest, archFilter = os.arch()) {
  6959. return __awaiter(this, void 0, void 0, function* () {
  6960. // wrap the internal impl
  6961. const match = yield mm._findMatch(versionSpec, stable, manifest, archFilter);
  6962. return match;
  6963. });
  6964. }
  6965. exports.findFromManifest = findFromManifest;
  6966. function _createExtractFolder(dest) {
  6967. return __awaiter(this, void 0, void 0, function* () {
  6968. if (!dest) {
  6969. // create a temp dir
  6970. dest = path.join(_getTempDirectory(), v4_1.default());
  6971. }
  6972. yield io.mkdirP(dest);
  6973. return dest;
  6974. });
  6975. }
  6976. function _createToolPath(tool, version, arch) {
  6977. return __awaiter(this, void 0, void 0, function* () {
  6978. const folderPath = path.join(_getCacheDirectory(), tool, semver.clean(version) || version, arch || '');
  6979. core.debug(`destination ${folderPath}`);
  6980. const markerPath = `${folderPath}.complete`;
  6981. yield io.rmRF(folderPath);
  6982. yield io.rmRF(markerPath);
  6983. yield io.mkdirP(folderPath);
  6984. return folderPath;
  6985. });
  6986. }
  6987. function _completeToolPath(tool, version, arch) {
  6988. const folderPath = path.join(_getCacheDirectory(), tool, semver.clean(version) || version, arch || '');
  6989. const markerPath = `${folderPath}.complete`;
  6990. fs.writeFileSync(markerPath, '');
  6991. core.debug('finished caching tool');
  6992. }
  6993. /**
  6994. * Check if version string is explicit
  6995. *
  6996. * @param versionSpec version string to check
  6997. */
  6998. function isExplicitVersion(versionSpec) {
  6999. const c = semver.clean(versionSpec) || '';
  7000. core.debug(`isExplicit: ${c}`);
  7001. const valid = semver.valid(c) != null;
  7002. core.debug(`explicit? ${valid}`);
  7003. return valid;
  7004. }
  7005. exports.isExplicitVersion = isExplicitVersion;
  7006. /**
  7007. * Get the highest satisfiying semantic version in `versions` which satisfies `versionSpec`
  7008. *
  7009. * @param versions array of versions to evaluate
  7010. * @param versionSpec semantic version spec to satisfy
  7011. */
  7012. function evaluateVersions(versions, versionSpec) {
  7013. let version = '';
  7014. core.debug(`evaluating ${versions.length} versions`);
  7015. versions = versions.sort((a, b) => {
  7016. if (semver.gt(a, b)) {
  7017. return 1;
  7018. }
  7019. return -1;
  7020. });
  7021. for (let i = versions.length - 1; i >= 0; i--) {
  7022. const potential = versions[i];
  7023. const satisfied = semver.satisfies(potential, versionSpec);
  7024. if (satisfied) {
  7025. version = potential;
  7026. break;
  7027. }
  7028. }
  7029. if (version) {
  7030. core.debug(`matched: ${version}`);
  7031. }
  7032. else {
  7033. core.debug('match not found');
  7034. }
  7035. return version;
  7036. }
  7037. exports.evaluateVersions = evaluateVersions;
  7038. /**
  7039. * Gets RUNNER_TOOL_CACHE
  7040. */
  7041. function _getCacheDirectory() {
  7042. const cacheDirectory = process.env['RUNNER_TOOL_CACHE'] || '';
  7043. assert_1.ok(cacheDirectory, 'Expected RUNNER_TOOL_CACHE to be defined');
  7044. return cacheDirectory;
  7045. }
  7046. /**
  7047. * Gets RUNNER_TEMP
  7048. */
  7049. function _getTempDirectory() {
  7050. const tempDirectory = process.env['RUNNER_TEMP'] || '';
  7051. assert_1.ok(tempDirectory, 'Expected RUNNER_TEMP to be defined');
  7052. return tempDirectory;
  7053. }
  7054. /**
  7055. * Gets a global variable
  7056. */
  7057. function _getGlobal(key, defaultValue) {
  7058. /* eslint-disable @typescript-eslint/no-explicit-any */
  7059. const value = global[key];
  7060. /* eslint-enable @typescript-eslint/no-explicit-any */
  7061. return value !== undefined ? value : defaultValue;
  7062. }
  7063. /**
  7064. * Returns an array of unique values.
  7065. * @param values Values to make unique.
  7066. */
  7067. function _unique(values) {
  7068. return Array.from(new Set(values));
  7069. }
  7070. //# sourceMappingURL=tool-cache.js.map
  7071. /***/ }),
  7072. /***/ 7701:
  7073. /***/ ((module) => {
  7074. /**
  7075. * Convert array of 16 byte values to UUID string format of the form:
  7076. * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
  7077. */
  7078. var byteToHex = [];
  7079. for (var i = 0; i < 256; ++i) {
  7080. byteToHex[i] = (i + 0x100).toString(16).substr(1);
  7081. }
  7082. function bytesToUuid(buf, offset) {
  7083. var i = offset || 0;
  7084. var bth = byteToHex;
  7085. // join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4
  7086. return ([
  7087. bth[buf[i++]], bth[buf[i++]],
  7088. bth[buf[i++]], bth[buf[i++]], '-',
  7089. bth[buf[i++]], bth[buf[i++]], '-',
  7090. bth[buf[i++]], bth[buf[i++]], '-',
  7091. bth[buf[i++]], bth[buf[i++]], '-',
  7092. bth[buf[i++]], bth[buf[i++]],
  7093. bth[buf[i++]], bth[buf[i++]],
  7094. bth[buf[i++]], bth[buf[i++]]
  7095. ]).join('');
  7096. }
  7097. module.exports = bytesToUuid;
  7098. /***/ }),
  7099. /***/ 7269:
  7100. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  7101. // Unique ID creation requires a high quality random # generator. In node.js
  7102. // this is pretty straight-forward - we use the crypto API.
  7103. var crypto = __nccwpck_require__(6113);
  7104. module.exports = function nodeRNG() {
  7105. return crypto.randomBytes(16);
  7106. };
  7107. /***/ }),
  7108. /***/ 7468:
  7109. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  7110. var rng = __nccwpck_require__(7269);
  7111. var bytesToUuid = __nccwpck_require__(7701);
  7112. function v4(options, buf, offset) {
  7113. var i = buf && offset || 0;
  7114. if (typeof(options) == 'string') {
  7115. buf = options === 'binary' ? new Array(16) : null;
  7116. options = null;
  7117. }
  7118. options = options || {};
  7119. var rnds = options.random || (options.rng || rng)();
  7120. // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
  7121. rnds[6] = (rnds[6] & 0x0f) | 0x40;
  7122. rnds[8] = (rnds[8] & 0x3f) | 0x80;
  7123. // Copy bytes to buffer, if provided
  7124. if (buf) {
  7125. for (var ii = 0; ii < 16; ++ii) {
  7126. buf[i + ii] = rnds[ii];
  7127. }
  7128. }
  7129. return buf || bytesToUuid(rnds);
  7130. }
  7131. module.exports = v4;
  7132. /***/ }),
  7133. /***/ 334:
  7134. /***/ ((module) => {
  7135. "use strict";
  7136. var __defProp = Object.defineProperty;
  7137. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  7138. var __getOwnPropNames = Object.getOwnPropertyNames;
  7139. var __hasOwnProp = Object.prototype.hasOwnProperty;
  7140. var __export = (target, all) => {
  7141. for (var name in all)
  7142. __defProp(target, name, { get: all[name], enumerable: true });
  7143. };
  7144. var __copyProps = (to, from, except, desc) => {
  7145. if (from && typeof from === "object" || typeof from === "function") {
  7146. for (let key of __getOwnPropNames(from))
  7147. if (!__hasOwnProp.call(to, key) && key !== except)
  7148. __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  7149. }
  7150. return to;
  7151. };
  7152. var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
  7153. // pkg/dist-src/index.js
  7154. var dist_src_exports = {};
  7155. __export(dist_src_exports, {
  7156. createTokenAuth: () => createTokenAuth
  7157. });
  7158. module.exports = __toCommonJS(dist_src_exports);
  7159. // pkg/dist-src/auth.js
  7160. var REGEX_IS_INSTALLATION_LEGACY = /^v1\./;
  7161. var REGEX_IS_INSTALLATION = /^ghs_/;
  7162. var REGEX_IS_USER_TO_SERVER = /^ghu_/;
  7163. async function auth(token) {
  7164. const isApp = token.split(/\./).length === 3;
  7165. const isInstallation = REGEX_IS_INSTALLATION_LEGACY.test(token) || REGEX_IS_INSTALLATION.test(token);
  7166. const isUserToServer = REGEX_IS_USER_TO_SERVER.test(token);
  7167. const tokenType = isApp ? "app" : isInstallation ? "installation" : isUserToServer ? "user-to-server" : "oauth";
  7168. return {
  7169. type: "token",
  7170. token,
  7171. tokenType
  7172. };
  7173. }
  7174. // pkg/dist-src/with-authorization-prefix.js
  7175. function withAuthorizationPrefix(token) {
  7176. if (token.split(/\./).length === 3) {
  7177. return `bearer ${token}`;
  7178. }
  7179. return `token ${token}`;
  7180. }
  7181. // pkg/dist-src/hook.js
  7182. async function hook(token, request, route, parameters) {
  7183. const endpoint = request.endpoint.merge(
  7184. route,
  7185. parameters
  7186. );
  7187. endpoint.headers.authorization = withAuthorizationPrefix(token);
  7188. return request(endpoint);
  7189. }
  7190. // pkg/dist-src/index.js
  7191. var createTokenAuth = function createTokenAuth2(token) {
  7192. if (!token) {
  7193. throw new Error("[@octokit/auth-token] No token passed to createTokenAuth");
  7194. }
  7195. if (typeof token !== "string") {
  7196. throw new Error(
  7197. "[@octokit/auth-token] Token passed to createTokenAuth is not a string"
  7198. );
  7199. }
  7200. token = token.replace(/^(token|bearer) +/i, "");
  7201. return Object.assign(auth.bind(null, token), {
  7202. hook: hook.bind(null, token)
  7203. });
  7204. };
  7205. // Annotate the CommonJS export names for ESM import in node:
  7206. 0 && (0);
  7207. /***/ }),
  7208. /***/ 6762:
  7209. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  7210. "use strict";
  7211. var __defProp = Object.defineProperty;
  7212. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  7213. var __getOwnPropNames = Object.getOwnPropertyNames;
  7214. var __hasOwnProp = Object.prototype.hasOwnProperty;
  7215. var __export = (target, all) => {
  7216. for (var name in all)
  7217. __defProp(target, name, { get: all[name], enumerable: true });
  7218. };
  7219. var __copyProps = (to, from, except, desc) => {
  7220. if (from && typeof from === "object" || typeof from === "function") {
  7221. for (let key of __getOwnPropNames(from))
  7222. if (!__hasOwnProp.call(to, key) && key !== except)
  7223. __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  7224. }
  7225. return to;
  7226. };
  7227. var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
  7228. // pkg/dist-src/index.js
  7229. var dist_src_exports = {};
  7230. __export(dist_src_exports, {
  7231. Octokit: () => Octokit
  7232. });
  7233. module.exports = __toCommonJS(dist_src_exports);
  7234. var import_universal_user_agent = __nccwpck_require__(5030);
  7235. var import_before_after_hook = __nccwpck_require__(3682);
  7236. var import_request = __nccwpck_require__(6234);
  7237. var import_graphql = __nccwpck_require__(8467);
  7238. var import_auth_token = __nccwpck_require__(334);
  7239. // pkg/dist-src/version.js
  7240. var VERSION = "5.2.0";
  7241. // pkg/dist-src/index.js
  7242. var noop = () => {
  7243. };
  7244. var consoleWarn = console.warn.bind(console);
  7245. var consoleError = console.error.bind(console);
  7246. var userAgentTrail = `octokit-core.js/${VERSION} ${(0, import_universal_user_agent.getUserAgent)()}`;
  7247. var Octokit = class {
  7248. static {
  7249. this.VERSION = VERSION;
  7250. }
  7251. static defaults(defaults) {
  7252. const OctokitWithDefaults = class extends this {
  7253. constructor(...args) {
  7254. const options = args[0] || {};
  7255. if (typeof defaults === "function") {
  7256. super(defaults(options));
  7257. return;
  7258. }
  7259. super(
  7260. Object.assign(
  7261. {},
  7262. defaults,
  7263. options,
  7264. options.userAgent && defaults.userAgent ? {
  7265. userAgent: `${options.userAgent} ${defaults.userAgent}`
  7266. } : null
  7267. )
  7268. );
  7269. }
  7270. };
  7271. return OctokitWithDefaults;
  7272. }
  7273. static {
  7274. this.plugins = [];
  7275. }
  7276. /**
  7277. * Attach a plugin (or many) to your Octokit instance.
  7278. *
  7279. * @example
  7280. * const API = Octokit.plugin(plugin1, plugin2, plugin3, ...)
  7281. */
  7282. static plugin(...newPlugins) {
  7283. const currentPlugins = this.plugins;
  7284. const NewOctokit = class extends this {
  7285. static {
  7286. this.plugins = currentPlugins.concat(
  7287. newPlugins.filter((plugin) => !currentPlugins.includes(plugin))
  7288. );
  7289. }
  7290. };
  7291. return NewOctokit;
  7292. }
  7293. constructor(options = {}) {
  7294. const hook = new import_before_after_hook.Collection();
  7295. const requestDefaults = {
  7296. baseUrl: import_request.request.endpoint.DEFAULTS.baseUrl,
  7297. headers: {},
  7298. request: Object.assign({}, options.request, {
  7299. // @ts-ignore internal usage only, no need to type
  7300. hook: hook.bind(null, "request")
  7301. }),
  7302. mediaType: {
  7303. previews: [],
  7304. format: ""
  7305. }
  7306. };
  7307. requestDefaults.headers["user-agent"] = options.userAgent ? `${options.userAgent} ${userAgentTrail}` : userAgentTrail;
  7308. if (options.baseUrl) {
  7309. requestDefaults.baseUrl = options.baseUrl;
  7310. }
  7311. if (options.previews) {
  7312. requestDefaults.mediaType.previews = options.previews;
  7313. }
  7314. if (options.timeZone) {
  7315. requestDefaults.headers["time-zone"] = options.timeZone;
  7316. }
  7317. this.request = import_request.request.defaults(requestDefaults);
  7318. this.graphql = (0, import_graphql.withCustomRequest)(this.request).defaults(requestDefaults);
  7319. this.log = Object.assign(
  7320. {
  7321. debug: noop,
  7322. info: noop,
  7323. warn: consoleWarn,
  7324. error: consoleError
  7325. },
  7326. options.log
  7327. );
  7328. this.hook = hook;
  7329. if (!options.authStrategy) {
  7330. if (!options.auth) {
  7331. this.auth = async () => ({
  7332. type: "unauthenticated"
  7333. });
  7334. } else {
  7335. const auth = (0, import_auth_token.createTokenAuth)(options.auth);
  7336. hook.wrap("request", auth.hook);
  7337. this.auth = auth;
  7338. }
  7339. } else {
  7340. const { authStrategy, ...otherOptions } = options;
  7341. const auth = authStrategy(
  7342. Object.assign(
  7343. {
  7344. request: this.request,
  7345. log: this.log,
  7346. // we pass the current octokit instance as well as its constructor options
  7347. // to allow for authentication strategies that return a new octokit instance
  7348. // that shares the same internal state as the current one. The original
  7349. // requirement for this was the "event-octokit" authentication strategy
  7350. // of https://github.com/probot/octokit-auth-probot.
  7351. octokit: this,
  7352. octokitOptions: otherOptions
  7353. },
  7354. options.auth
  7355. )
  7356. );
  7357. hook.wrap("request", auth.hook);
  7358. this.auth = auth;
  7359. }
  7360. const classConstructor = this.constructor;
  7361. for (let i = 0; i < classConstructor.plugins.length; ++i) {
  7362. Object.assign(this, classConstructor.plugins[i](this, options));
  7363. }
  7364. }
  7365. };
  7366. // Annotate the CommonJS export names for ESM import in node:
  7367. 0 && (0);
  7368. /***/ }),
  7369. /***/ 9440:
  7370. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  7371. "use strict";
  7372. var __defProp = Object.defineProperty;
  7373. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  7374. var __getOwnPropNames = Object.getOwnPropertyNames;
  7375. var __hasOwnProp = Object.prototype.hasOwnProperty;
  7376. var __export = (target, all) => {
  7377. for (var name in all)
  7378. __defProp(target, name, { get: all[name], enumerable: true });
  7379. };
  7380. var __copyProps = (to, from, except, desc) => {
  7381. if (from && typeof from === "object" || typeof from === "function") {
  7382. for (let key of __getOwnPropNames(from))
  7383. if (!__hasOwnProp.call(to, key) && key !== except)
  7384. __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  7385. }
  7386. return to;
  7387. };
  7388. var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
  7389. // pkg/dist-src/index.js
  7390. var dist_src_exports = {};
  7391. __export(dist_src_exports, {
  7392. endpoint: () => endpoint
  7393. });
  7394. module.exports = __toCommonJS(dist_src_exports);
  7395. // pkg/dist-src/defaults.js
  7396. var import_universal_user_agent = __nccwpck_require__(5030);
  7397. // pkg/dist-src/version.js
  7398. var VERSION = "9.0.5";
  7399. // pkg/dist-src/defaults.js
  7400. var userAgent = `octokit-endpoint.js/${VERSION} ${(0, import_universal_user_agent.getUserAgent)()}`;
  7401. var DEFAULTS = {
  7402. method: "GET",
  7403. baseUrl: "https://api.github.com",
  7404. headers: {
  7405. accept: "application/vnd.github.v3+json",
  7406. "user-agent": userAgent
  7407. },
  7408. mediaType: {
  7409. format: ""
  7410. }
  7411. };
  7412. // pkg/dist-src/util/lowercase-keys.js
  7413. function lowercaseKeys(object) {
  7414. if (!object) {
  7415. return {};
  7416. }
  7417. return Object.keys(object).reduce((newObj, key) => {
  7418. newObj[key.toLowerCase()] = object[key];
  7419. return newObj;
  7420. }, {});
  7421. }
  7422. // pkg/dist-src/util/is-plain-object.js
  7423. function isPlainObject(value) {
  7424. if (typeof value !== "object" || value === null)
  7425. return false;
  7426. if (Object.prototype.toString.call(value) !== "[object Object]")
  7427. return false;
  7428. const proto = Object.getPrototypeOf(value);
  7429. if (proto === null)
  7430. return true;
  7431. const Ctor = Object.prototype.hasOwnProperty.call(proto, "constructor") && proto.constructor;
  7432. return typeof Ctor === "function" && Ctor instanceof Ctor && Function.prototype.call(Ctor) === Function.prototype.call(value);
  7433. }
  7434. // pkg/dist-src/util/merge-deep.js
  7435. function mergeDeep(defaults, options) {
  7436. const result = Object.assign({}, defaults);
  7437. Object.keys(options).forEach((key) => {
  7438. if (isPlainObject(options[key])) {
  7439. if (!(key in defaults))
  7440. Object.assign(result, { [key]: options[key] });
  7441. else
  7442. result[key] = mergeDeep(defaults[key], options[key]);
  7443. } else {
  7444. Object.assign(result, { [key]: options[key] });
  7445. }
  7446. });
  7447. return result;
  7448. }
  7449. // pkg/dist-src/util/remove-undefined-properties.js
  7450. function removeUndefinedProperties(obj) {
  7451. for (const key in obj) {
  7452. if (obj[key] === void 0) {
  7453. delete obj[key];
  7454. }
  7455. }
  7456. return obj;
  7457. }
  7458. // pkg/dist-src/merge.js
  7459. function merge(defaults, route, options) {
  7460. if (typeof route === "string") {
  7461. let [method, url] = route.split(" ");
  7462. options = Object.assign(url ? { method, url } : { url: method }, options);
  7463. } else {
  7464. options = Object.assign({}, route);
  7465. }
  7466. options.headers = lowercaseKeys(options.headers);
  7467. removeUndefinedProperties(options);
  7468. removeUndefinedProperties(options.headers);
  7469. const mergedOptions = mergeDeep(defaults || {}, options);
  7470. if (options.url === "/graphql") {
  7471. if (defaults && defaults.mediaType.previews?.length) {
  7472. mergedOptions.mediaType.previews = defaults.mediaType.previews.filter(
  7473. (preview) => !mergedOptions.mediaType.previews.includes(preview)
  7474. ).concat(mergedOptions.mediaType.previews);
  7475. }
  7476. mergedOptions.mediaType.previews = (mergedOptions.mediaType.previews || []).map((preview) => preview.replace(/-preview/, ""));
  7477. }
  7478. return mergedOptions;
  7479. }
  7480. // pkg/dist-src/util/add-query-parameters.js
  7481. function addQueryParameters(url, parameters) {
  7482. const separator = /\?/.test(url) ? "&" : "?";
  7483. const names = Object.keys(parameters);
  7484. if (names.length === 0) {
  7485. return url;
  7486. }
  7487. return url + separator + names.map((name) => {
  7488. if (name === "q") {
  7489. return "q=" + parameters.q.split("+").map(encodeURIComponent).join("+");
  7490. }
  7491. return `${name}=${encodeURIComponent(parameters[name])}`;
  7492. }).join("&");
  7493. }
  7494. // pkg/dist-src/util/extract-url-variable-names.js
  7495. var urlVariableRegex = /\{[^}]+\}/g;
  7496. function removeNonChars(variableName) {
  7497. return variableName.replace(/^\W+|\W+$/g, "").split(/,/);
  7498. }
  7499. function extractUrlVariableNames(url) {
  7500. const matches = url.match(urlVariableRegex);
  7501. if (!matches) {
  7502. return [];
  7503. }
  7504. return matches.map(removeNonChars).reduce((a, b) => a.concat(b), []);
  7505. }
  7506. // pkg/dist-src/util/omit.js
  7507. function omit(object, keysToOmit) {
  7508. const result = { __proto__: null };
  7509. for (const key of Object.keys(object)) {
  7510. if (keysToOmit.indexOf(key) === -1) {
  7511. result[key] = object[key];
  7512. }
  7513. }
  7514. return result;
  7515. }
  7516. // pkg/dist-src/util/url-template.js
  7517. function encodeReserved(str) {
  7518. return str.split(/(%[0-9A-Fa-f]{2})/g).map(function(part) {
  7519. if (!/%[0-9A-Fa-f]/.test(part)) {
  7520. part = encodeURI(part).replace(/%5B/g, "[").replace(/%5D/g, "]");
  7521. }
  7522. return part;
  7523. }).join("");
  7524. }
  7525. function encodeUnreserved(str) {
  7526. return encodeURIComponent(str).replace(/[!'()*]/g, function(c) {
  7527. return "%" + c.charCodeAt(0).toString(16).toUpperCase();
  7528. });
  7529. }
  7530. function encodeValue(operator, value, key) {
  7531. value = operator === "+" || operator === "#" ? encodeReserved(value) : encodeUnreserved(value);
  7532. if (key) {
  7533. return encodeUnreserved(key) + "=" + value;
  7534. } else {
  7535. return value;
  7536. }
  7537. }
  7538. function isDefined(value) {
  7539. return value !== void 0 && value !== null;
  7540. }
  7541. function isKeyOperator(operator) {
  7542. return operator === ";" || operator === "&" || operator === "?";
  7543. }
  7544. function getValues(context, operator, key, modifier) {
  7545. var value = context[key], result = [];
  7546. if (isDefined(value) && value !== "") {
  7547. if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
  7548. value = value.toString();
  7549. if (modifier && modifier !== "*") {
  7550. value = value.substring(0, parseInt(modifier, 10));
  7551. }
  7552. result.push(
  7553. encodeValue(operator, value, isKeyOperator(operator) ? key : "")
  7554. );
  7555. } else {
  7556. if (modifier === "*") {
  7557. if (Array.isArray(value)) {
  7558. value.filter(isDefined).forEach(function(value2) {
  7559. result.push(
  7560. encodeValue(operator, value2, isKeyOperator(operator) ? key : "")
  7561. );
  7562. });
  7563. } else {
  7564. Object.keys(value).forEach(function(k) {
  7565. if (isDefined(value[k])) {
  7566. result.push(encodeValue(operator, value[k], k));
  7567. }
  7568. });
  7569. }
  7570. } else {
  7571. const tmp = [];
  7572. if (Array.isArray(value)) {
  7573. value.filter(isDefined).forEach(function(value2) {
  7574. tmp.push(encodeValue(operator, value2));
  7575. });
  7576. } else {
  7577. Object.keys(value).forEach(function(k) {
  7578. if (isDefined(value[k])) {
  7579. tmp.push(encodeUnreserved(k));
  7580. tmp.push(encodeValue(operator, value[k].toString()));
  7581. }
  7582. });
  7583. }
  7584. if (isKeyOperator(operator)) {
  7585. result.push(encodeUnreserved(key) + "=" + tmp.join(","));
  7586. } else if (tmp.length !== 0) {
  7587. result.push(tmp.join(","));
  7588. }
  7589. }
  7590. }
  7591. } else {
  7592. if (operator === ";") {
  7593. if (isDefined(value)) {
  7594. result.push(encodeUnreserved(key));
  7595. }
  7596. } else if (value === "" && (operator === "&" || operator === "?")) {
  7597. result.push(encodeUnreserved(key) + "=");
  7598. } else if (value === "") {
  7599. result.push("");
  7600. }
  7601. }
  7602. return result;
  7603. }
  7604. function parseUrl(template) {
  7605. return {
  7606. expand: expand.bind(null, template)
  7607. };
  7608. }
  7609. function expand(template, context) {
  7610. var operators = ["+", "#", ".", "/", ";", "?", "&"];
  7611. template = template.replace(
  7612. /\{([^\{\}]+)\}|([^\{\}]+)/g,
  7613. function(_, expression, literal) {
  7614. if (expression) {
  7615. let operator = "";
  7616. const values = [];
  7617. if (operators.indexOf(expression.charAt(0)) !== -1) {
  7618. operator = expression.charAt(0);
  7619. expression = expression.substr(1);
  7620. }
  7621. expression.split(/,/g).forEach(function(variable) {
  7622. var tmp = /([^:\*]*)(?::(\d+)|(\*))?/.exec(variable);
  7623. values.push(getValues(context, operator, tmp[1], tmp[2] || tmp[3]));
  7624. });
  7625. if (operator && operator !== "+") {
  7626. var separator = ",";
  7627. if (operator === "?") {
  7628. separator = "&";
  7629. } else if (operator !== "#") {
  7630. separator = operator;
  7631. }
  7632. return (values.length !== 0 ? operator : "") + values.join(separator);
  7633. } else {
  7634. return values.join(",");
  7635. }
  7636. } else {
  7637. return encodeReserved(literal);
  7638. }
  7639. }
  7640. );
  7641. if (template === "/") {
  7642. return template;
  7643. } else {
  7644. return template.replace(/\/$/, "");
  7645. }
  7646. }
  7647. // pkg/dist-src/parse.js
  7648. function parse(options) {
  7649. let method = options.method.toUpperCase();
  7650. let url = (options.url || "/").replace(/:([a-z]\w+)/g, "{$1}");
  7651. let headers = Object.assign({}, options.headers);
  7652. let body;
  7653. let parameters = omit(options, [
  7654. "method",
  7655. "baseUrl",
  7656. "url",
  7657. "headers",
  7658. "request",
  7659. "mediaType"
  7660. ]);
  7661. const urlVariableNames = extractUrlVariableNames(url);
  7662. url = parseUrl(url).expand(parameters);
  7663. if (!/^http/.test(url)) {
  7664. url = options.baseUrl + url;
  7665. }
  7666. const omittedParameters = Object.keys(options).filter((option) => urlVariableNames.includes(option)).concat("baseUrl");
  7667. const remainingParameters = omit(parameters, omittedParameters);
  7668. const isBinaryRequest = /application\/octet-stream/i.test(headers.accept);
  7669. if (!isBinaryRequest) {
  7670. if (options.mediaType.format) {
  7671. headers.accept = headers.accept.split(/,/).map(
  7672. (format) => format.replace(
  7673. /application\/vnd(\.\w+)(\.v3)?(\.\w+)?(\+json)?$/,
  7674. `application/vnd$1$2.${options.mediaType.format}`
  7675. )
  7676. ).join(",");
  7677. }
  7678. if (url.endsWith("/graphql")) {
  7679. if (options.mediaType.previews?.length) {
  7680. const previewsFromAcceptHeader = headers.accept.match(/[\w-]+(?=-preview)/g) || [];
  7681. headers.accept = previewsFromAcceptHeader.concat(options.mediaType.previews).map((preview) => {
  7682. const format = options.mediaType.format ? `.${options.mediaType.format}` : "+json";
  7683. return `application/vnd.github.${preview}-preview${format}`;
  7684. }).join(",");
  7685. }
  7686. }
  7687. }
  7688. if (["GET", "HEAD"].includes(method)) {
  7689. url = addQueryParameters(url, remainingParameters);
  7690. } else {
  7691. if ("data" in remainingParameters) {
  7692. body = remainingParameters.data;
  7693. } else {
  7694. if (Object.keys(remainingParameters).length) {
  7695. body = remainingParameters;
  7696. }
  7697. }
  7698. }
  7699. if (!headers["content-type"] && typeof body !== "undefined") {
  7700. headers["content-type"] = "application/json; charset=utf-8";
  7701. }
  7702. if (["PATCH", "PUT"].includes(method) && typeof body === "undefined") {
  7703. body = "";
  7704. }
  7705. return Object.assign(
  7706. { method, url, headers },
  7707. typeof body !== "undefined" ? { body } : null,
  7708. options.request ? { request: options.request } : null
  7709. );
  7710. }
  7711. // pkg/dist-src/endpoint-with-defaults.js
  7712. function endpointWithDefaults(defaults, route, options) {
  7713. return parse(merge(defaults, route, options));
  7714. }
  7715. // pkg/dist-src/with-defaults.js
  7716. function withDefaults(oldDefaults, newDefaults) {
  7717. const DEFAULTS2 = merge(oldDefaults, newDefaults);
  7718. const endpoint2 = endpointWithDefaults.bind(null, DEFAULTS2);
  7719. return Object.assign(endpoint2, {
  7720. DEFAULTS: DEFAULTS2,
  7721. defaults: withDefaults.bind(null, DEFAULTS2),
  7722. merge: merge.bind(null, DEFAULTS2),
  7723. parse
  7724. });
  7725. }
  7726. // pkg/dist-src/index.js
  7727. var endpoint = withDefaults(null, DEFAULTS);
  7728. // Annotate the CommonJS export names for ESM import in node:
  7729. 0 && (0);
  7730. /***/ }),
  7731. /***/ 8467:
  7732. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  7733. "use strict";
  7734. var __defProp = Object.defineProperty;
  7735. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  7736. var __getOwnPropNames = Object.getOwnPropertyNames;
  7737. var __hasOwnProp = Object.prototype.hasOwnProperty;
  7738. var __export = (target, all) => {
  7739. for (var name in all)
  7740. __defProp(target, name, { get: all[name], enumerable: true });
  7741. };
  7742. var __copyProps = (to, from, except, desc) => {
  7743. if (from && typeof from === "object" || typeof from === "function") {
  7744. for (let key of __getOwnPropNames(from))
  7745. if (!__hasOwnProp.call(to, key) && key !== except)
  7746. __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  7747. }
  7748. return to;
  7749. };
  7750. var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
  7751. // pkg/dist-src/index.js
  7752. var dist_src_exports = {};
  7753. __export(dist_src_exports, {
  7754. GraphqlResponseError: () => GraphqlResponseError,
  7755. graphql: () => graphql2,
  7756. withCustomRequest: () => withCustomRequest
  7757. });
  7758. module.exports = __toCommonJS(dist_src_exports);
  7759. var import_request3 = __nccwpck_require__(6234);
  7760. var import_universal_user_agent = __nccwpck_require__(5030);
  7761. // pkg/dist-src/version.js
  7762. var VERSION = "7.1.0";
  7763. // pkg/dist-src/with-defaults.js
  7764. var import_request2 = __nccwpck_require__(6234);
  7765. // pkg/dist-src/graphql.js
  7766. var import_request = __nccwpck_require__(6234);
  7767. // pkg/dist-src/error.js
  7768. function _buildMessageForResponseErrors(data) {
  7769. return `Request failed due to following response errors:
  7770. ` + data.errors.map((e) => ` - ${e.message}`).join("\n");
  7771. }
  7772. var GraphqlResponseError = class extends Error {
  7773. constructor(request2, headers, response) {
  7774. super(_buildMessageForResponseErrors(response));
  7775. this.request = request2;
  7776. this.headers = headers;
  7777. this.response = response;
  7778. this.name = "GraphqlResponseError";
  7779. this.errors = response.errors;
  7780. this.data = response.data;
  7781. if (Error.captureStackTrace) {
  7782. Error.captureStackTrace(this, this.constructor);
  7783. }
  7784. }
  7785. };
  7786. // pkg/dist-src/graphql.js
  7787. var NON_VARIABLE_OPTIONS = [
  7788. "method",
  7789. "baseUrl",
  7790. "url",
  7791. "headers",
  7792. "request",
  7793. "query",
  7794. "mediaType"
  7795. ];
  7796. var FORBIDDEN_VARIABLE_OPTIONS = ["query", "method", "url"];
  7797. var GHES_V3_SUFFIX_REGEX = /\/api\/v3\/?$/;
  7798. function graphql(request2, query, options) {
  7799. if (options) {
  7800. if (typeof query === "string" && "query" in options) {
  7801. return Promise.reject(
  7802. new Error(`[@octokit/graphql] "query" cannot be used as variable name`)
  7803. );
  7804. }
  7805. for (const key in options) {
  7806. if (!FORBIDDEN_VARIABLE_OPTIONS.includes(key))
  7807. continue;
  7808. return Promise.reject(
  7809. new Error(
  7810. `[@octokit/graphql] "${key}" cannot be used as variable name`
  7811. )
  7812. );
  7813. }
  7814. }
  7815. const parsedOptions = typeof query === "string" ? Object.assign({ query }, options) : query;
  7816. const requestOptions = Object.keys(
  7817. parsedOptions
  7818. ).reduce((result, key) => {
  7819. if (NON_VARIABLE_OPTIONS.includes(key)) {
  7820. result[key] = parsedOptions[key];
  7821. return result;
  7822. }
  7823. if (!result.variables) {
  7824. result.variables = {};
  7825. }
  7826. result.variables[key] = parsedOptions[key];
  7827. return result;
  7828. }, {});
  7829. const baseUrl = parsedOptions.baseUrl || request2.endpoint.DEFAULTS.baseUrl;
  7830. if (GHES_V3_SUFFIX_REGEX.test(baseUrl)) {
  7831. requestOptions.url = baseUrl.replace(GHES_V3_SUFFIX_REGEX, "/api/graphql");
  7832. }
  7833. return request2(requestOptions).then((response) => {
  7834. if (response.data.errors) {
  7835. const headers = {};
  7836. for (const key of Object.keys(response.headers)) {
  7837. headers[key] = response.headers[key];
  7838. }
  7839. throw new GraphqlResponseError(
  7840. requestOptions,
  7841. headers,
  7842. response.data
  7843. );
  7844. }
  7845. return response.data.data;
  7846. });
  7847. }
  7848. // pkg/dist-src/with-defaults.js
  7849. function withDefaults(request2, newDefaults) {
  7850. const newRequest = request2.defaults(newDefaults);
  7851. const newApi = (query, options) => {
  7852. return graphql(newRequest, query, options);
  7853. };
  7854. return Object.assign(newApi, {
  7855. defaults: withDefaults.bind(null, newRequest),
  7856. endpoint: newRequest.endpoint
  7857. });
  7858. }
  7859. // pkg/dist-src/index.js
  7860. var graphql2 = withDefaults(import_request3.request, {
  7861. headers: {
  7862. "user-agent": `octokit-graphql.js/${VERSION} ${(0, import_universal_user_agent.getUserAgent)()}`
  7863. },
  7864. method: "POST",
  7865. url: "/graphql"
  7866. });
  7867. function withCustomRequest(customRequest) {
  7868. return withDefaults(customRequest, {
  7869. method: "POST",
  7870. url: "/graphql"
  7871. });
  7872. }
  7873. // Annotate the CommonJS export names for ESM import in node:
  7874. 0 && (0);
  7875. /***/ }),
  7876. /***/ 4193:
  7877. /***/ ((module) => {
  7878. "use strict";
  7879. var __defProp = Object.defineProperty;
  7880. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  7881. var __getOwnPropNames = Object.getOwnPropertyNames;
  7882. var __hasOwnProp = Object.prototype.hasOwnProperty;
  7883. var __export = (target, all) => {
  7884. for (var name in all)
  7885. __defProp(target, name, { get: all[name], enumerable: true });
  7886. };
  7887. var __copyProps = (to, from, except, desc) => {
  7888. if (from && typeof from === "object" || typeof from === "function") {
  7889. for (let key of __getOwnPropNames(from))
  7890. if (!__hasOwnProp.call(to, key) && key !== except)
  7891. __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  7892. }
  7893. return to;
  7894. };
  7895. var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
  7896. // pkg/dist-src/index.js
  7897. var dist_src_exports = {};
  7898. __export(dist_src_exports, {
  7899. composePaginateRest: () => composePaginateRest,
  7900. isPaginatingEndpoint: () => isPaginatingEndpoint,
  7901. paginateRest: () => paginateRest,
  7902. paginatingEndpoints: () => paginatingEndpoints
  7903. });
  7904. module.exports = __toCommonJS(dist_src_exports);
  7905. // pkg/dist-src/version.js
  7906. var VERSION = "9.2.1";
  7907. // pkg/dist-src/normalize-paginated-list-response.js
  7908. function normalizePaginatedListResponse(response) {
  7909. if (!response.data) {
  7910. return {
  7911. ...response,
  7912. data: []
  7913. };
  7914. }
  7915. const responseNeedsNormalization = "total_count" in response.data && !("url" in response.data);
  7916. if (!responseNeedsNormalization)
  7917. return response;
  7918. const incompleteResults = response.data.incomplete_results;
  7919. const repositorySelection = response.data.repository_selection;
  7920. const totalCount = response.data.total_count;
  7921. delete response.data.incomplete_results;
  7922. delete response.data.repository_selection;
  7923. delete response.data.total_count;
  7924. const namespaceKey = Object.keys(response.data)[0];
  7925. const data = response.data[namespaceKey];
  7926. response.data = data;
  7927. if (typeof incompleteResults !== "undefined") {
  7928. response.data.incomplete_results = incompleteResults;
  7929. }
  7930. if (typeof repositorySelection !== "undefined") {
  7931. response.data.repository_selection = repositorySelection;
  7932. }
  7933. response.data.total_count = totalCount;
  7934. return response;
  7935. }
  7936. // pkg/dist-src/iterator.js
  7937. function iterator(octokit, route, parameters) {
  7938. const options = typeof route === "function" ? route.endpoint(parameters) : octokit.request.endpoint(route, parameters);
  7939. const requestMethod = typeof route === "function" ? route : octokit.request;
  7940. const method = options.method;
  7941. const headers = options.headers;
  7942. let url = options.url;
  7943. return {
  7944. [Symbol.asyncIterator]: () => ({
  7945. async next() {
  7946. if (!url)
  7947. return { done: true };
  7948. try {
  7949. const response = await requestMethod({ method, url, headers });
  7950. const normalizedResponse = normalizePaginatedListResponse(response);
  7951. url = ((normalizedResponse.headers.link || "").match(
  7952. /<([^>]+)>;\s*rel="next"/
  7953. ) || [])[1];
  7954. return { value: normalizedResponse };
  7955. } catch (error) {
  7956. if (error.status !== 409)
  7957. throw error;
  7958. url = "";
  7959. return {
  7960. value: {
  7961. status: 200,
  7962. headers: {},
  7963. data: []
  7964. }
  7965. };
  7966. }
  7967. }
  7968. })
  7969. };
  7970. }
  7971. // pkg/dist-src/paginate.js
  7972. function paginate(octokit, route, parameters, mapFn) {
  7973. if (typeof parameters === "function") {
  7974. mapFn = parameters;
  7975. parameters = void 0;
  7976. }
  7977. return gather(
  7978. octokit,
  7979. [],
  7980. iterator(octokit, route, parameters)[Symbol.asyncIterator](),
  7981. mapFn
  7982. );
  7983. }
  7984. function gather(octokit, results, iterator2, mapFn) {
  7985. return iterator2.next().then((result) => {
  7986. if (result.done) {
  7987. return results;
  7988. }
  7989. let earlyExit = false;
  7990. function done() {
  7991. earlyExit = true;
  7992. }
  7993. results = results.concat(
  7994. mapFn ? mapFn(result.value, done) : result.value.data
  7995. );
  7996. if (earlyExit) {
  7997. return results;
  7998. }
  7999. return gather(octokit, results, iterator2, mapFn);
  8000. });
  8001. }
  8002. // pkg/dist-src/compose-paginate.js
  8003. var composePaginateRest = Object.assign(paginate, {
  8004. iterator
  8005. });
  8006. // pkg/dist-src/generated/paginating-endpoints.js
  8007. var paginatingEndpoints = [
  8008. "GET /advisories",
  8009. "GET /app/hook/deliveries",
  8010. "GET /app/installation-requests",
  8011. "GET /app/installations",
  8012. "GET /assignments/{assignment_id}/accepted_assignments",
  8013. "GET /classrooms",
  8014. "GET /classrooms/{classroom_id}/assignments",
  8015. "GET /enterprises/{enterprise}/dependabot/alerts",
  8016. "GET /enterprises/{enterprise}/secret-scanning/alerts",
  8017. "GET /events",
  8018. "GET /gists",
  8019. "GET /gists/public",
  8020. "GET /gists/starred",
  8021. "GET /gists/{gist_id}/comments",
  8022. "GET /gists/{gist_id}/commits",
  8023. "GET /gists/{gist_id}/forks",
  8024. "GET /installation/repositories",
  8025. "GET /issues",
  8026. "GET /licenses",
  8027. "GET /marketplace_listing/plans",
  8028. "GET /marketplace_listing/plans/{plan_id}/accounts",
  8029. "GET /marketplace_listing/stubbed/plans",
  8030. "GET /marketplace_listing/stubbed/plans/{plan_id}/accounts",
  8031. "GET /networks/{owner}/{repo}/events",
  8032. "GET /notifications",
  8033. "GET /organizations",
  8034. "GET /orgs/{org}/actions/cache/usage-by-repository",
  8035. "GET /orgs/{org}/actions/permissions/repositories",
  8036. "GET /orgs/{org}/actions/runners",
  8037. "GET /orgs/{org}/actions/secrets",
  8038. "GET /orgs/{org}/actions/secrets/{secret_name}/repositories",
  8039. "GET /orgs/{org}/actions/variables",
  8040. "GET /orgs/{org}/actions/variables/{name}/repositories",
  8041. "GET /orgs/{org}/blocks",
  8042. "GET /orgs/{org}/code-scanning/alerts",
  8043. "GET /orgs/{org}/codespaces",
  8044. "GET /orgs/{org}/codespaces/secrets",
  8045. "GET /orgs/{org}/codespaces/secrets/{secret_name}/repositories",
  8046. "GET /orgs/{org}/copilot/billing/seats",
  8047. "GET /orgs/{org}/dependabot/alerts",
  8048. "GET /orgs/{org}/dependabot/secrets",
  8049. "GET /orgs/{org}/dependabot/secrets/{secret_name}/repositories",
  8050. "GET /orgs/{org}/events",
  8051. "GET /orgs/{org}/failed_invitations",
  8052. "GET /orgs/{org}/hooks",
  8053. "GET /orgs/{org}/hooks/{hook_id}/deliveries",
  8054. "GET /orgs/{org}/installations",
  8055. "GET /orgs/{org}/invitations",
  8056. "GET /orgs/{org}/invitations/{invitation_id}/teams",
  8057. "GET /orgs/{org}/issues",
  8058. "GET /orgs/{org}/members",
  8059. "GET /orgs/{org}/members/{username}/codespaces",
  8060. "GET /orgs/{org}/migrations",
  8061. "GET /orgs/{org}/migrations/{migration_id}/repositories",
  8062. "GET /orgs/{org}/organization-roles/{role_id}/teams",
  8063. "GET /orgs/{org}/organization-roles/{role_id}/users",
  8064. "GET /orgs/{org}/outside_collaborators",
  8065. "GET /orgs/{org}/packages",
  8066. "GET /orgs/{org}/packages/{package_type}/{package_name}/versions",
  8067. "GET /orgs/{org}/personal-access-token-requests",
  8068. "GET /orgs/{org}/personal-access-token-requests/{pat_request_id}/repositories",
  8069. "GET /orgs/{org}/personal-access-tokens",
  8070. "GET /orgs/{org}/personal-access-tokens/{pat_id}/repositories",
  8071. "GET /orgs/{org}/projects",
  8072. "GET /orgs/{org}/properties/values",
  8073. "GET /orgs/{org}/public_members",
  8074. "GET /orgs/{org}/repos",
  8075. "GET /orgs/{org}/rulesets",
  8076. "GET /orgs/{org}/rulesets/rule-suites",
  8077. "GET /orgs/{org}/secret-scanning/alerts",
  8078. "GET /orgs/{org}/security-advisories",
  8079. "GET /orgs/{org}/teams",
  8080. "GET /orgs/{org}/teams/{team_slug}/discussions",
  8081. "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments",
  8082. "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions",
  8083. "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions",
  8084. "GET /orgs/{org}/teams/{team_slug}/invitations",
  8085. "GET /orgs/{org}/teams/{team_slug}/members",
  8086. "GET /orgs/{org}/teams/{team_slug}/projects",
  8087. "GET /orgs/{org}/teams/{team_slug}/repos",
  8088. "GET /orgs/{org}/teams/{team_slug}/teams",
  8089. "GET /projects/columns/{column_id}/cards",
  8090. "GET /projects/{project_id}/collaborators",
  8091. "GET /projects/{project_id}/columns",
  8092. "GET /repos/{owner}/{repo}/actions/artifacts",
  8093. "GET /repos/{owner}/{repo}/actions/caches",
  8094. "GET /repos/{owner}/{repo}/actions/organization-secrets",
  8095. "GET /repos/{owner}/{repo}/actions/organization-variables",
  8096. "GET /repos/{owner}/{repo}/actions/runners",
  8097. "GET /repos/{owner}/{repo}/actions/runs",
  8098. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts",
  8099. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/jobs",
  8100. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs",
  8101. "GET /repos/{owner}/{repo}/actions/secrets",
  8102. "GET /repos/{owner}/{repo}/actions/variables",
  8103. "GET /repos/{owner}/{repo}/actions/workflows",
  8104. "GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs",
  8105. "GET /repos/{owner}/{repo}/activity",
  8106. "GET /repos/{owner}/{repo}/assignees",
  8107. "GET /repos/{owner}/{repo}/branches",
  8108. "GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations",
  8109. "GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs",
  8110. "GET /repos/{owner}/{repo}/code-scanning/alerts",
  8111. "GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances",
  8112. "GET /repos/{owner}/{repo}/code-scanning/analyses",
  8113. "GET /repos/{owner}/{repo}/codespaces",
  8114. "GET /repos/{owner}/{repo}/codespaces/devcontainers",
  8115. "GET /repos/{owner}/{repo}/codespaces/secrets",
  8116. "GET /repos/{owner}/{repo}/collaborators",
  8117. "GET /repos/{owner}/{repo}/comments",
  8118. "GET /repos/{owner}/{repo}/comments/{comment_id}/reactions",
  8119. "GET /repos/{owner}/{repo}/commits",
  8120. "GET /repos/{owner}/{repo}/commits/{commit_sha}/comments",
  8121. "GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls",
  8122. "GET /repos/{owner}/{repo}/commits/{ref}/check-runs",
  8123. "GET /repos/{owner}/{repo}/commits/{ref}/check-suites",
  8124. "GET /repos/{owner}/{repo}/commits/{ref}/status",
  8125. "GET /repos/{owner}/{repo}/commits/{ref}/statuses",
  8126. "GET /repos/{owner}/{repo}/contributors",
  8127. "GET /repos/{owner}/{repo}/dependabot/alerts",
  8128. "GET /repos/{owner}/{repo}/dependabot/secrets",
  8129. "GET /repos/{owner}/{repo}/deployments",
  8130. "GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses",
  8131. "GET /repos/{owner}/{repo}/environments",
  8132. "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies",
  8133. "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/apps",
  8134. "GET /repos/{owner}/{repo}/events",
  8135. "GET /repos/{owner}/{repo}/forks",
  8136. "GET /repos/{owner}/{repo}/hooks",
  8137. "GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries",
  8138. "GET /repos/{owner}/{repo}/invitations",
  8139. "GET /repos/{owner}/{repo}/issues",
  8140. "GET /repos/{owner}/{repo}/issues/comments",
  8141. "GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions",
  8142. "GET /repos/{owner}/{repo}/issues/events",
  8143. "GET /repos/{owner}/{repo}/issues/{issue_number}/comments",
  8144. "GET /repos/{owner}/{repo}/issues/{issue_number}/events",
  8145. "GET /repos/{owner}/{repo}/issues/{issue_number}/labels",
  8146. "GET /repos/{owner}/{repo}/issues/{issue_number}/reactions",
  8147. "GET /repos/{owner}/{repo}/issues/{issue_number}/timeline",
  8148. "GET /repos/{owner}/{repo}/keys",
  8149. "GET /repos/{owner}/{repo}/labels",
  8150. "GET /repos/{owner}/{repo}/milestones",
  8151. "GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels",
  8152. "GET /repos/{owner}/{repo}/notifications",
  8153. "GET /repos/{owner}/{repo}/pages/builds",
  8154. "GET /repos/{owner}/{repo}/projects",
  8155. "GET /repos/{owner}/{repo}/pulls",
  8156. "GET /repos/{owner}/{repo}/pulls/comments",
  8157. "GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions",
  8158. "GET /repos/{owner}/{repo}/pulls/{pull_number}/comments",
  8159. "GET /repos/{owner}/{repo}/pulls/{pull_number}/commits",
  8160. "GET /repos/{owner}/{repo}/pulls/{pull_number}/files",
  8161. "GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews",
  8162. "GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments",
  8163. "GET /repos/{owner}/{repo}/releases",
  8164. "GET /repos/{owner}/{repo}/releases/{release_id}/assets",
  8165. "GET /repos/{owner}/{repo}/releases/{release_id}/reactions",
  8166. "GET /repos/{owner}/{repo}/rules/branches/{branch}",
  8167. "GET /repos/{owner}/{repo}/rulesets",
  8168. "GET /repos/{owner}/{repo}/rulesets/rule-suites",
  8169. "GET /repos/{owner}/{repo}/secret-scanning/alerts",
  8170. "GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations",
  8171. "GET /repos/{owner}/{repo}/security-advisories",
  8172. "GET /repos/{owner}/{repo}/stargazers",
  8173. "GET /repos/{owner}/{repo}/subscribers",
  8174. "GET /repos/{owner}/{repo}/tags",
  8175. "GET /repos/{owner}/{repo}/teams",
  8176. "GET /repos/{owner}/{repo}/topics",
  8177. "GET /repositories",
  8178. "GET /repositories/{repository_id}/environments/{environment_name}/secrets",
  8179. "GET /repositories/{repository_id}/environments/{environment_name}/variables",
  8180. "GET /search/code",
  8181. "GET /search/commits",
  8182. "GET /search/issues",
  8183. "GET /search/labels",
  8184. "GET /search/repositories",
  8185. "GET /search/topics",
  8186. "GET /search/users",
  8187. "GET /teams/{team_id}/discussions",
  8188. "GET /teams/{team_id}/discussions/{discussion_number}/comments",
  8189. "GET /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions",
  8190. "GET /teams/{team_id}/discussions/{discussion_number}/reactions",
  8191. "GET /teams/{team_id}/invitations",
  8192. "GET /teams/{team_id}/members",
  8193. "GET /teams/{team_id}/projects",
  8194. "GET /teams/{team_id}/repos",
  8195. "GET /teams/{team_id}/teams",
  8196. "GET /user/blocks",
  8197. "GET /user/codespaces",
  8198. "GET /user/codespaces/secrets",
  8199. "GET /user/emails",
  8200. "GET /user/followers",
  8201. "GET /user/following",
  8202. "GET /user/gpg_keys",
  8203. "GET /user/installations",
  8204. "GET /user/installations/{installation_id}/repositories",
  8205. "GET /user/issues",
  8206. "GET /user/keys",
  8207. "GET /user/marketplace_purchases",
  8208. "GET /user/marketplace_purchases/stubbed",
  8209. "GET /user/memberships/orgs",
  8210. "GET /user/migrations",
  8211. "GET /user/migrations/{migration_id}/repositories",
  8212. "GET /user/orgs",
  8213. "GET /user/packages",
  8214. "GET /user/packages/{package_type}/{package_name}/versions",
  8215. "GET /user/public_emails",
  8216. "GET /user/repos",
  8217. "GET /user/repository_invitations",
  8218. "GET /user/social_accounts",
  8219. "GET /user/ssh_signing_keys",
  8220. "GET /user/starred",
  8221. "GET /user/subscriptions",
  8222. "GET /user/teams",
  8223. "GET /users",
  8224. "GET /users/{username}/events",
  8225. "GET /users/{username}/events/orgs/{org}",
  8226. "GET /users/{username}/events/public",
  8227. "GET /users/{username}/followers",
  8228. "GET /users/{username}/following",
  8229. "GET /users/{username}/gists",
  8230. "GET /users/{username}/gpg_keys",
  8231. "GET /users/{username}/keys",
  8232. "GET /users/{username}/orgs",
  8233. "GET /users/{username}/packages",
  8234. "GET /users/{username}/projects",
  8235. "GET /users/{username}/received_events",
  8236. "GET /users/{username}/received_events/public",
  8237. "GET /users/{username}/repos",
  8238. "GET /users/{username}/social_accounts",
  8239. "GET /users/{username}/ssh_signing_keys",
  8240. "GET /users/{username}/starred",
  8241. "GET /users/{username}/subscriptions"
  8242. ];
  8243. // pkg/dist-src/paginating-endpoints.js
  8244. function isPaginatingEndpoint(arg) {
  8245. if (typeof arg === "string") {
  8246. return paginatingEndpoints.includes(arg);
  8247. } else {
  8248. return false;
  8249. }
  8250. }
  8251. // pkg/dist-src/index.js
  8252. function paginateRest(octokit) {
  8253. return {
  8254. paginate: Object.assign(paginate.bind(null, octokit), {
  8255. iterator: iterator.bind(null, octokit)
  8256. })
  8257. };
  8258. }
  8259. paginateRest.VERSION = VERSION;
  8260. // Annotate the CommonJS export names for ESM import in node:
  8261. 0 && (0);
  8262. /***/ }),
  8263. /***/ 3044:
  8264. /***/ ((module) => {
  8265. "use strict";
  8266. var __defProp = Object.defineProperty;
  8267. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  8268. var __getOwnPropNames = Object.getOwnPropertyNames;
  8269. var __hasOwnProp = Object.prototype.hasOwnProperty;
  8270. var __export = (target, all) => {
  8271. for (var name in all)
  8272. __defProp(target, name, { get: all[name], enumerable: true });
  8273. };
  8274. var __copyProps = (to, from, except, desc) => {
  8275. if (from && typeof from === "object" || typeof from === "function") {
  8276. for (let key of __getOwnPropNames(from))
  8277. if (!__hasOwnProp.call(to, key) && key !== except)
  8278. __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  8279. }
  8280. return to;
  8281. };
  8282. var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
  8283. // pkg/dist-src/index.js
  8284. var dist_src_exports = {};
  8285. __export(dist_src_exports, {
  8286. legacyRestEndpointMethods: () => legacyRestEndpointMethods,
  8287. restEndpointMethods: () => restEndpointMethods
  8288. });
  8289. module.exports = __toCommonJS(dist_src_exports);
  8290. // pkg/dist-src/version.js
  8291. var VERSION = "10.4.1";
  8292. // pkg/dist-src/generated/endpoints.js
  8293. var Endpoints = {
  8294. actions: {
  8295. addCustomLabelsToSelfHostedRunnerForOrg: [
  8296. "POST /orgs/{org}/actions/runners/{runner_id}/labels"
  8297. ],
  8298. addCustomLabelsToSelfHostedRunnerForRepo: [
  8299. "POST /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"
  8300. ],
  8301. addSelectedRepoToOrgSecret: [
  8302. "PUT /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}"
  8303. ],
  8304. addSelectedRepoToOrgVariable: [
  8305. "PUT /orgs/{org}/actions/variables/{name}/repositories/{repository_id}"
  8306. ],
  8307. approveWorkflowRun: [
  8308. "POST /repos/{owner}/{repo}/actions/runs/{run_id}/approve"
  8309. ],
  8310. cancelWorkflowRun: [
  8311. "POST /repos/{owner}/{repo}/actions/runs/{run_id}/cancel"
  8312. ],
  8313. createEnvironmentVariable: [
  8314. "POST /repositories/{repository_id}/environments/{environment_name}/variables"
  8315. ],
  8316. createOrUpdateEnvironmentSecret: [
  8317. "PUT /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}"
  8318. ],
  8319. createOrUpdateOrgSecret: ["PUT /orgs/{org}/actions/secrets/{secret_name}"],
  8320. createOrUpdateRepoSecret: [
  8321. "PUT /repos/{owner}/{repo}/actions/secrets/{secret_name}"
  8322. ],
  8323. createOrgVariable: ["POST /orgs/{org}/actions/variables"],
  8324. createRegistrationTokenForOrg: [
  8325. "POST /orgs/{org}/actions/runners/registration-token"
  8326. ],
  8327. createRegistrationTokenForRepo: [
  8328. "POST /repos/{owner}/{repo}/actions/runners/registration-token"
  8329. ],
  8330. createRemoveTokenForOrg: ["POST /orgs/{org}/actions/runners/remove-token"],
  8331. createRemoveTokenForRepo: [
  8332. "POST /repos/{owner}/{repo}/actions/runners/remove-token"
  8333. ],
  8334. createRepoVariable: ["POST /repos/{owner}/{repo}/actions/variables"],
  8335. createWorkflowDispatch: [
  8336. "POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches"
  8337. ],
  8338. deleteActionsCacheById: [
  8339. "DELETE /repos/{owner}/{repo}/actions/caches/{cache_id}"
  8340. ],
  8341. deleteActionsCacheByKey: [
  8342. "DELETE /repos/{owner}/{repo}/actions/caches{?key,ref}"
  8343. ],
  8344. deleteArtifact: [
  8345. "DELETE /repos/{owner}/{repo}/actions/artifacts/{artifact_id}"
  8346. ],
  8347. deleteEnvironmentSecret: [
  8348. "DELETE /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}"
  8349. ],
  8350. deleteEnvironmentVariable: [
  8351. "DELETE /repositories/{repository_id}/environments/{environment_name}/variables/{name}"
  8352. ],
  8353. deleteOrgSecret: ["DELETE /orgs/{org}/actions/secrets/{secret_name}"],
  8354. deleteOrgVariable: ["DELETE /orgs/{org}/actions/variables/{name}"],
  8355. deleteRepoSecret: [
  8356. "DELETE /repos/{owner}/{repo}/actions/secrets/{secret_name}"
  8357. ],
  8358. deleteRepoVariable: [
  8359. "DELETE /repos/{owner}/{repo}/actions/variables/{name}"
  8360. ],
  8361. deleteSelfHostedRunnerFromOrg: [
  8362. "DELETE /orgs/{org}/actions/runners/{runner_id}"
  8363. ],
  8364. deleteSelfHostedRunnerFromRepo: [
  8365. "DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}"
  8366. ],
  8367. deleteWorkflowRun: ["DELETE /repos/{owner}/{repo}/actions/runs/{run_id}"],
  8368. deleteWorkflowRunLogs: [
  8369. "DELETE /repos/{owner}/{repo}/actions/runs/{run_id}/logs"
  8370. ],
  8371. disableSelectedRepositoryGithubActionsOrganization: [
  8372. "DELETE /orgs/{org}/actions/permissions/repositories/{repository_id}"
  8373. ],
  8374. disableWorkflow: [
  8375. "PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/disable"
  8376. ],
  8377. downloadArtifact: [
  8378. "GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}"
  8379. ],
  8380. downloadJobLogsForWorkflowRun: [
  8381. "GET /repos/{owner}/{repo}/actions/jobs/{job_id}/logs"
  8382. ],
  8383. downloadWorkflowRunAttemptLogs: [
  8384. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/logs"
  8385. ],
  8386. downloadWorkflowRunLogs: [
  8387. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/logs"
  8388. ],
  8389. enableSelectedRepositoryGithubActionsOrganization: [
  8390. "PUT /orgs/{org}/actions/permissions/repositories/{repository_id}"
  8391. ],
  8392. enableWorkflow: [
  8393. "PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/enable"
  8394. ],
  8395. forceCancelWorkflowRun: [
  8396. "POST /repos/{owner}/{repo}/actions/runs/{run_id}/force-cancel"
  8397. ],
  8398. generateRunnerJitconfigForOrg: [
  8399. "POST /orgs/{org}/actions/runners/generate-jitconfig"
  8400. ],
  8401. generateRunnerJitconfigForRepo: [
  8402. "POST /repos/{owner}/{repo}/actions/runners/generate-jitconfig"
  8403. ],
  8404. getActionsCacheList: ["GET /repos/{owner}/{repo}/actions/caches"],
  8405. getActionsCacheUsage: ["GET /repos/{owner}/{repo}/actions/cache/usage"],
  8406. getActionsCacheUsageByRepoForOrg: [
  8407. "GET /orgs/{org}/actions/cache/usage-by-repository"
  8408. ],
  8409. getActionsCacheUsageForOrg: ["GET /orgs/{org}/actions/cache/usage"],
  8410. getAllowedActionsOrganization: [
  8411. "GET /orgs/{org}/actions/permissions/selected-actions"
  8412. ],
  8413. getAllowedActionsRepository: [
  8414. "GET /repos/{owner}/{repo}/actions/permissions/selected-actions"
  8415. ],
  8416. getArtifact: ["GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}"],
  8417. getCustomOidcSubClaimForRepo: [
  8418. "GET /repos/{owner}/{repo}/actions/oidc/customization/sub"
  8419. ],
  8420. getEnvironmentPublicKey: [
  8421. "GET /repositories/{repository_id}/environments/{environment_name}/secrets/public-key"
  8422. ],
  8423. getEnvironmentSecret: [
  8424. "GET /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}"
  8425. ],
  8426. getEnvironmentVariable: [
  8427. "GET /repositories/{repository_id}/environments/{environment_name}/variables/{name}"
  8428. ],
  8429. getGithubActionsDefaultWorkflowPermissionsOrganization: [
  8430. "GET /orgs/{org}/actions/permissions/workflow"
  8431. ],
  8432. getGithubActionsDefaultWorkflowPermissionsRepository: [
  8433. "GET /repos/{owner}/{repo}/actions/permissions/workflow"
  8434. ],
  8435. getGithubActionsPermissionsOrganization: [
  8436. "GET /orgs/{org}/actions/permissions"
  8437. ],
  8438. getGithubActionsPermissionsRepository: [
  8439. "GET /repos/{owner}/{repo}/actions/permissions"
  8440. ],
  8441. getJobForWorkflowRun: ["GET /repos/{owner}/{repo}/actions/jobs/{job_id}"],
  8442. getOrgPublicKey: ["GET /orgs/{org}/actions/secrets/public-key"],
  8443. getOrgSecret: ["GET /orgs/{org}/actions/secrets/{secret_name}"],
  8444. getOrgVariable: ["GET /orgs/{org}/actions/variables/{name}"],
  8445. getPendingDeploymentsForRun: [
  8446. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments"
  8447. ],
  8448. getRepoPermissions: [
  8449. "GET /repos/{owner}/{repo}/actions/permissions",
  8450. {},
  8451. { renamed: ["actions", "getGithubActionsPermissionsRepository"] }
  8452. ],
  8453. getRepoPublicKey: ["GET /repos/{owner}/{repo}/actions/secrets/public-key"],
  8454. getRepoSecret: ["GET /repos/{owner}/{repo}/actions/secrets/{secret_name}"],
  8455. getRepoVariable: ["GET /repos/{owner}/{repo}/actions/variables/{name}"],
  8456. getReviewsForRun: [
  8457. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/approvals"
  8458. ],
  8459. getSelfHostedRunnerForOrg: ["GET /orgs/{org}/actions/runners/{runner_id}"],
  8460. getSelfHostedRunnerForRepo: [
  8461. "GET /repos/{owner}/{repo}/actions/runners/{runner_id}"
  8462. ],
  8463. getWorkflow: ["GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}"],
  8464. getWorkflowAccessToRepository: [
  8465. "GET /repos/{owner}/{repo}/actions/permissions/access"
  8466. ],
  8467. getWorkflowRun: ["GET /repos/{owner}/{repo}/actions/runs/{run_id}"],
  8468. getWorkflowRunAttempt: [
  8469. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}"
  8470. ],
  8471. getWorkflowRunUsage: [
  8472. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/timing"
  8473. ],
  8474. getWorkflowUsage: [
  8475. "GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/timing"
  8476. ],
  8477. listArtifactsForRepo: ["GET /repos/{owner}/{repo}/actions/artifacts"],
  8478. listEnvironmentSecrets: [
  8479. "GET /repositories/{repository_id}/environments/{environment_name}/secrets"
  8480. ],
  8481. listEnvironmentVariables: [
  8482. "GET /repositories/{repository_id}/environments/{environment_name}/variables"
  8483. ],
  8484. listJobsForWorkflowRun: [
  8485. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs"
  8486. ],
  8487. listJobsForWorkflowRunAttempt: [
  8488. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/jobs"
  8489. ],
  8490. listLabelsForSelfHostedRunnerForOrg: [
  8491. "GET /orgs/{org}/actions/runners/{runner_id}/labels"
  8492. ],
  8493. listLabelsForSelfHostedRunnerForRepo: [
  8494. "GET /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"
  8495. ],
  8496. listOrgSecrets: ["GET /orgs/{org}/actions/secrets"],
  8497. listOrgVariables: ["GET /orgs/{org}/actions/variables"],
  8498. listRepoOrganizationSecrets: [
  8499. "GET /repos/{owner}/{repo}/actions/organization-secrets"
  8500. ],
  8501. listRepoOrganizationVariables: [
  8502. "GET /repos/{owner}/{repo}/actions/organization-variables"
  8503. ],
  8504. listRepoSecrets: ["GET /repos/{owner}/{repo}/actions/secrets"],
  8505. listRepoVariables: ["GET /repos/{owner}/{repo}/actions/variables"],
  8506. listRepoWorkflows: ["GET /repos/{owner}/{repo}/actions/workflows"],
  8507. listRunnerApplicationsForOrg: ["GET /orgs/{org}/actions/runners/downloads"],
  8508. listRunnerApplicationsForRepo: [
  8509. "GET /repos/{owner}/{repo}/actions/runners/downloads"
  8510. ],
  8511. listSelectedReposForOrgSecret: [
  8512. "GET /orgs/{org}/actions/secrets/{secret_name}/repositories"
  8513. ],
  8514. listSelectedReposForOrgVariable: [
  8515. "GET /orgs/{org}/actions/variables/{name}/repositories"
  8516. ],
  8517. listSelectedRepositoriesEnabledGithubActionsOrganization: [
  8518. "GET /orgs/{org}/actions/permissions/repositories"
  8519. ],
  8520. listSelfHostedRunnersForOrg: ["GET /orgs/{org}/actions/runners"],
  8521. listSelfHostedRunnersForRepo: ["GET /repos/{owner}/{repo}/actions/runners"],
  8522. listWorkflowRunArtifacts: [
  8523. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts"
  8524. ],
  8525. listWorkflowRuns: [
  8526. "GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs"
  8527. ],
  8528. listWorkflowRunsForRepo: ["GET /repos/{owner}/{repo}/actions/runs"],
  8529. reRunJobForWorkflowRun: [
  8530. "POST /repos/{owner}/{repo}/actions/jobs/{job_id}/rerun"
  8531. ],
  8532. reRunWorkflow: ["POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun"],
  8533. reRunWorkflowFailedJobs: [
  8534. "POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun-failed-jobs"
  8535. ],
  8536. removeAllCustomLabelsFromSelfHostedRunnerForOrg: [
  8537. "DELETE /orgs/{org}/actions/runners/{runner_id}/labels"
  8538. ],
  8539. removeAllCustomLabelsFromSelfHostedRunnerForRepo: [
  8540. "DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"
  8541. ],
  8542. removeCustomLabelFromSelfHostedRunnerForOrg: [
  8543. "DELETE /orgs/{org}/actions/runners/{runner_id}/labels/{name}"
  8544. ],
  8545. removeCustomLabelFromSelfHostedRunnerForRepo: [
  8546. "DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}/labels/{name}"
  8547. ],
  8548. removeSelectedRepoFromOrgSecret: [
  8549. "DELETE /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}"
  8550. ],
  8551. removeSelectedRepoFromOrgVariable: [
  8552. "DELETE /orgs/{org}/actions/variables/{name}/repositories/{repository_id}"
  8553. ],
  8554. reviewCustomGatesForRun: [
  8555. "POST /repos/{owner}/{repo}/actions/runs/{run_id}/deployment_protection_rule"
  8556. ],
  8557. reviewPendingDeploymentsForRun: [
  8558. "POST /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments"
  8559. ],
  8560. setAllowedActionsOrganization: [
  8561. "PUT /orgs/{org}/actions/permissions/selected-actions"
  8562. ],
  8563. setAllowedActionsRepository: [
  8564. "PUT /repos/{owner}/{repo}/actions/permissions/selected-actions"
  8565. ],
  8566. setCustomLabelsForSelfHostedRunnerForOrg: [
  8567. "PUT /orgs/{org}/actions/runners/{runner_id}/labels"
  8568. ],
  8569. setCustomLabelsForSelfHostedRunnerForRepo: [
  8570. "PUT /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"
  8571. ],
  8572. setCustomOidcSubClaimForRepo: [
  8573. "PUT /repos/{owner}/{repo}/actions/oidc/customization/sub"
  8574. ],
  8575. setGithubActionsDefaultWorkflowPermissionsOrganization: [
  8576. "PUT /orgs/{org}/actions/permissions/workflow"
  8577. ],
  8578. setGithubActionsDefaultWorkflowPermissionsRepository: [
  8579. "PUT /repos/{owner}/{repo}/actions/permissions/workflow"
  8580. ],
  8581. setGithubActionsPermissionsOrganization: [
  8582. "PUT /orgs/{org}/actions/permissions"
  8583. ],
  8584. setGithubActionsPermissionsRepository: [
  8585. "PUT /repos/{owner}/{repo}/actions/permissions"
  8586. ],
  8587. setSelectedReposForOrgSecret: [
  8588. "PUT /orgs/{org}/actions/secrets/{secret_name}/repositories"
  8589. ],
  8590. setSelectedReposForOrgVariable: [
  8591. "PUT /orgs/{org}/actions/variables/{name}/repositories"
  8592. ],
  8593. setSelectedRepositoriesEnabledGithubActionsOrganization: [
  8594. "PUT /orgs/{org}/actions/permissions/repositories"
  8595. ],
  8596. setWorkflowAccessToRepository: [
  8597. "PUT /repos/{owner}/{repo}/actions/permissions/access"
  8598. ],
  8599. updateEnvironmentVariable: [
  8600. "PATCH /repositories/{repository_id}/environments/{environment_name}/variables/{name}"
  8601. ],
  8602. updateOrgVariable: ["PATCH /orgs/{org}/actions/variables/{name}"],
  8603. updateRepoVariable: [
  8604. "PATCH /repos/{owner}/{repo}/actions/variables/{name}"
  8605. ]
  8606. },
  8607. activity: {
  8608. checkRepoIsStarredByAuthenticatedUser: ["GET /user/starred/{owner}/{repo}"],
  8609. deleteRepoSubscription: ["DELETE /repos/{owner}/{repo}/subscription"],
  8610. deleteThreadSubscription: [
  8611. "DELETE /notifications/threads/{thread_id}/subscription"
  8612. ],
  8613. getFeeds: ["GET /feeds"],
  8614. getRepoSubscription: ["GET /repos/{owner}/{repo}/subscription"],
  8615. getThread: ["GET /notifications/threads/{thread_id}"],
  8616. getThreadSubscriptionForAuthenticatedUser: [
  8617. "GET /notifications/threads/{thread_id}/subscription"
  8618. ],
  8619. listEventsForAuthenticatedUser: ["GET /users/{username}/events"],
  8620. listNotificationsForAuthenticatedUser: ["GET /notifications"],
  8621. listOrgEventsForAuthenticatedUser: [
  8622. "GET /users/{username}/events/orgs/{org}"
  8623. ],
  8624. listPublicEvents: ["GET /events"],
  8625. listPublicEventsForRepoNetwork: ["GET /networks/{owner}/{repo}/events"],
  8626. listPublicEventsForUser: ["GET /users/{username}/events/public"],
  8627. listPublicOrgEvents: ["GET /orgs/{org}/events"],
  8628. listReceivedEventsForUser: ["GET /users/{username}/received_events"],
  8629. listReceivedPublicEventsForUser: [
  8630. "GET /users/{username}/received_events/public"
  8631. ],
  8632. listRepoEvents: ["GET /repos/{owner}/{repo}/events"],
  8633. listRepoNotificationsForAuthenticatedUser: [
  8634. "GET /repos/{owner}/{repo}/notifications"
  8635. ],
  8636. listReposStarredByAuthenticatedUser: ["GET /user/starred"],
  8637. listReposStarredByUser: ["GET /users/{username}/starred"],
  8638. listReposWatchedByUser: ["GET /users/{username}/subscriptions"],
  8639. listStargazersForRepo: ["GET /repos/{owner}/{repo}/stargazers"],
  8640. listWatchedReposForAuthenticatedUser: ["GET /user/subscriptions"],
  8641. listWatchersForRepo: ["GET /repos/{owner}/{repo}/subscribers"],
  8642. markNotificationsAsRead: ["PUT /notifications"],
  8643. markRepoNotificationsAsRead: ["PUT /repos/{owner}/{repo}/notifications"],
  8644. markThreadAsDone: ["DELETE /notifications/threads/{thread_id}"],
  8645. markThreadAsRead: ["PATCH /notifications/threads/{thread_id}"],
  8646. setRepoSubscription: ["PUT /repos/{owner}/{repo}/subscription"],
  8647. setThreadSubscription: [
  8648. "PUT /notifications/threads/{thread_id}/subscription"
  8649. ],
  8650. starRepoForAuthenticatedUser: ["PUT /user/starred/{owner}/{repo}"],
  8651. unstarRepoForAuthenticatedUser: ["DELETE /user/starred/{owner}/{repo}"]
  8652. },
  8653. apps: {
  8654. addRepoToInstallation: [
  8655. "PUT /user/installations/{installation_id}/repositories/{repository_id}",
  8656. {},
  8657. { renamed: ["apps", "addRepoToInstallationForAuthenticatedUser"] }
  8658. ],
  8659. addRepoToInstallationForAuthenticatedUser: [
  8660. "PUT /user/installations/{installation_id}/repositories/{repository_id}"
  8661. ],
  8662. checkToken: ["POST /applications/{client_id}/token"],
  8663. createFromManifest: ["POST /app-manifests/{code}/conversions"],
  8664. createInstallationAccessToken: [
  8665. "POST /app/installations/{installation_id}/access_tokens"
  8666. ],
  8667. deleteAuthorization: ["DELETE /applications/{client_id}/grant"],
  8668. deleteInstallation: ["DELETE /app/installations/{installation_id}"],
  8669. deleteToken: ["DELETE /applications/{client_id}/token"],
  8670. getAuthenticated: ["GET /app"],
  8671. getBySlug: ["GET /apps/{app_slug}"],
  8672. getInstallation: ["GET /app/installations/{installation_id}"],
  8673. getOrgInstallation: ["GET /orgs/{org}/installation"],
  8674. getRepoInstallation: ["GET /repos/{owner}/{repo}/installation"],
  8675. getSubscriptionPlanForAccount: [
  8676. "GET /marketplace_listing/accounts/{account_id}"
  8677. ],
  8678. getSubscriptionPlanForAccountStubbed: [
  8679. "GET /marketplace_listing/stubbed/accounts/{account_id}"
  8680. ],
  8681. getUserInstallation: ["GET /users/{username}/installation"],
  8682. getWebhookConfigForApp: ["GET /app/hook/config"],
  8683. getWebhookDelivery: ["GET /app/hook/deliveries/{delivery_id}"],
  8684. listAccountsForPlan: ["GET /marketplace_listing/plans/{plan_id}/accounts"],
  8685. listAccountsForPlanStubbed: [
  8686. "GET /marketplace_listing/stubbed/plans/{plan_id}/accounts"
  8687. ],
  8688. listInstallationReposForAuthenticatedUser: [
  8689. "GET /user/installations/{installation_id}/repositories"
  8690. ],
  8691. listInstallationRequestsForAuthenticatedApp: [
  8692. "GET /app/installation-requests"
  8693. ],
  8694. listInstallations: ["GET /app/installations"],
  8695. listInstallationsForAuthenticatedUser: ["GET /user/installations"],
  8696. listPlans: ["GET /marketplace_listing/plans"],
  8697. listPlansStubbed: ["GET /marketplace_listing/stubbed/plans"],
  8698. listReposAccessibleToInstallation: ["GET /installation/repositories"],
  8699. listSubscriptionsForAuthenticatedUser: ["GET /user/marketplace_purchases"],
  8700. listSubscriptionsForAuthenticatedUserStubbed: [
  8701. "GET /user/marketplace_purchases/stubbed"
  8702. ],
  8703. listWebhookDeliveries: ["GET /app/hook/deliveries"],
  8704. redeliverWebhookDelivery: [
  8705. "POST /app/hook/deliveries/{delivery_id}/attempts"
  8706. ],
  8707. removeRepoFromInstallation: [
  8708. "DELETE /user/installations/{installation_id}/repositories/{repository_id}",
  8709. {},
  8710. { renamed: ["apps", "removeRepoFromInstallationForAuthenticatedUser"] }
  8711. ],
  8712. removeRepoFromInstallationForAuthenticatedUser: [
  8713. "DELETE /user/installations/{installation_id}/repositories/{repository_id}"
  8714. ],
  8715. resetToken: ["PATCH /applications/{client_id}/token"],
  8716. revokeInstallationAccessToken: ["DELETE /installation/token"],
  8717. scopeToken: ["POST /applications/{client_id}/token/scoped"],
  8718. suspendInstallation: ["PUT /app/installations/{installation_id}/suspended"],
  8719. unsuspendInstallation: [
  8720. "DELETE /app/installations/{installation_id}/suspended"
  8721. ],
  8722. updateWebhookConfigForApp: ["PATCH /app/hook/config"]
  8723. },
  8724. billing: {
  8725. getGithubActionsBillingOrg: ["GET /orgs/{org}/settings/billing/actions"],
  8726. getGithubActionsBillingUser: [
  8727. "GET /users/{username}/settings/billing/actions"
  8728. ],
  8729. getGithubPackagesBillingOrg: ["GET /orgs/{org}/settings/billing/packages"],
  8730. getGithubPackagesBillingUser: [
  8731. "GET /users/{username}/settings/billing/packages"
  8732. ],
  8733. getSharedStorageBillingOrg: [
  8734. "GET /orgs/{org}/settings/billing/shared-storage"
  8735. ],
  8736. getSharedStorageBillingUser: [
  8737. "GET /users/{username}/settings/billing/shared-storage"
  8738. ]
  8739. },
  8740. checks: {
  8741. create: ["POST /repos/{owner}/{repo}/check-runs"],
  8742. createSuite: ["POST /repos/{owner}/{repo}/check-suites"],
  8743. get: ["GET /repos/{owner}/{repo}/check-runs/{check_run_id}"],
  8744. getSuite: ["GET /repos/{owner}/{repo}/check-suites/{check_suite_id}"],
  8745. listAnnotations: [
  8746. "GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations"
  8747. ],
  8748. listForRef: ["GET /repos/{owner}/{repo}/commits/{ref}/check-runs"],
  8749. listForSuite: [
  8750. "GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs"
  8751. ],
  8752. listSuitesForRef: ["GET /repos/{owner}/{repo}/commits/{ref}/check-suites"],
  8753. rerequestRun: [
  8754. "POST /repos/{owner}/{repo}/check-runs/{check_run_id}/rerequest"
  8755. ],
  8756. rerequestSuite: [
  8757. "POST /repos/{owner}/{repo}/check-suites/{check_suite_id}/rerequest"
  8758. ],
  8759. setSuitesPreferences: [
  8760. "PATCH /repos/{owner}/{repo}/check-suites/preferences"
  8761. ],
  8762. update: ["PATCH /repos/{owner}/{repo}/check-runs/{check_run_id}"]
  8763. },
  8764. codeScanning: {
  8765. deleteAnalysis: [
  8766. "DELETE /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}{?confirm_delete}"
  8767. ],
  8768. getAlert: [
  8769. "GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}",
  8770. {},
  8771. { renamedParameters: { alert_id: "alert_number" } }
  8772. ],
  8773. getAnalysis: [
  8774. "GET /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}"
  8775. ],
  8776. getCodeqlDatabase: [
  8777. "GET /repos/{owner}/{repo}/code-scanning/codeql/databases/{language}"
  8778. ],
  8779. getDefaultSetup: ["GET /repos/{owner}/{repo}/code-scanning/default-setup"],
  8780. getSarif: ["GET /repos/{owner}/{repo}/code-scanning/sarifs/{sarif_id}"],
  8781. listAlertInstances: [
  8782. "GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances"
  8783. ],
  8784. listAlertsForOrg: ["GET /orgs/{org}/code-scanning/alerts"],
  8785. listAlertsForRepo: ["GET /repos/{owner}/{repo}/code-scanning/alerts"],
  8786. listAlertsInstances: [
  8787. "GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances",
  8788. {},
  8789. { renamed: ["codeScanning", "listAlertInstances"] }
  8790. ],
  8791. listCodeqlDatabases: [
  8792. "GET /repos/{owner}/{repo}/code-scanning/codeql/databases"
  8793. ],
  8794. listRecentAnalyses: ["GET /repos/{owner}/{repo}/code-scanning/analyses"],
  8795. updateAlert: [
  8796. "PATCH /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}"
  8797. ],
  8798. updateDefaultSetup: [
  8799. "PATCH /repos/{owner}/{repo}/code-scanning/default-setup"
  8800. ],
  8801. uploadSarif: ["POST /repos/{owner}/{repo}/code-scanning/sarifs"]
  8802. },
  8803. codesOfConduct: {
  8804. getAllCodesOfConduct: ["GET /codes_of_conduct"],
  8805. getConductCode: ["GET /codes_of_conduct/{key}"]
  8806. },
  8807. codespaces: {
  8808. addRepositoryForSecretForAuthenticatedUser: [
  8809. "PUT /user/codespaces/secrets/{secret_name}/repositories/{repository_id}"
  8810. ],
  8811. addSelectedRepoToOrgSecret: [
  8812. "PUT /orgs/{org}/codespaces/secrets/{secret_name}/repositories/{repository_id}"
  8813. ],
  8814. checkPermissionsForDevcontainer: [
  8815. "GET /repos/{owner}/{repo}/codespaces/permissions_check"
  8816. ],
  8817. codespaceMachinesForAuthenticatedUser: [
  8818. "GET /user/codespaces/{codespace_name}/machines"
  8819. ],
  8820. createForAuthenticatedUser: ["POST /user/codespaces"],
  8821. createOrUpdateOrgSecret: [
  8822. "PUT /orgs/{org}/codespaces/secrets/{secret_name}"
  8823. ],
  8824. createOrUpdateRepoSecret: [
  8825. "PUT /repos/{owner}/{repo}/codespaces/secrets/{secret_name}"
  8826. ],
  8827. createOrUpdateSecretForAuthenticatedUser: [
  8828. "PUT /user/codespaces/secrets/{secret_name}"
  8829. ],
  8830. createWithPrForAuthenticatedUser: [
  8831. "POST /repos/{owner}/{repo}/pulls/{pull_number}/codespaces"
  8832. ],
  8833. createWithRepoForAuthenticatedUser: [
  8834. "POST /repos/{owner}/{repo}/codespaces"
  8835. ],
  8836. deleteForAuthenticatedUser: ["DELETE /user/codespaces/{codespace_name}"],
  8837. deleteFromOrganization: [
  8838. "DELETE /orgs/{org}/members/{username}/codespaces/{codespace_name}"
  8839. ],
  8840. deleteOrgSecret: ["DELETE /orgs/{org}/codespaces/secrets/{secret_name}"],
  8841. deleteRepoSecret: [
  8842. "DELETE /repos/{owner}/{repo}/codespaces/secrets/{secret_name}"
  8843. ],
  8844. deleteSecretForAuthenticatedUser: [
  8845. "DELETE /user/codespaces/secrets/{secret_name}"
  8846. ],
  8847. exportForAuthenticatedUser: [
  8848. "POST /user/codespaces/{codespace_name}/exports"
  8849. ],
  8850. getCodespacesForUserInOrg: [
  8851. "GET /orgs/{org}/members/{username}/codespaces"
  8852. ],
  8853. getExportDetailsForAuthenticatedUser: [
  8854. "GET /user/codespaces/{codespace_name}/exports/{export_id}"
  8855. ],
  8856. getForAuthenticatedUser: ["GET /user/codespaces/{codespace_name}"],
  8857. getOrgPublicKey: ["GET /orgs/{org}/codespaces/secrets/public-key"],
  8858. getOrgSecret: ["GET /orgs/{org}/codespaces/secrets/{secret_name}"],
  8859. getPublicKeyForAuthenticatedUser: [
  8860. "GET /user/codespaces/secrets/public-key"
  8861. ],
  8862. getRepoPublicKey: [
  8863. "GET /repos/{owner}/{repo}/codespaces/secrets/public-key"
  8864. ],
  8865. getRepoSecret: [
  8866. "GET /repos/{owner}/{repo}/codespaces/secrets/{secret_name}"
  8867. ],
  8868. getSecretForAuthenticatedUser: [
  8869. "GET /user/codespaces/secrets/{secret_name}"
  8870. ],
  8871. listDevcontainersInRepositoryForAuthenticatedUser: [
  8872. "GET /repos/{owner}/{repo}/codespaces/devcontainers"
  8873. ],
  8874. listForAuthenticatedUser: ["GET /user/codespaces"],
  8875. listInOrganization: [
  8876. "GET /orgs/{org}/codespaces",
  8877. {},
  8878. { renamedParameters: { org_id: "org" } }
  8879. ],
  8880. listInRepositoryForAuthenticatedUser: [
  8881. "GET /repos/{owner}/{repo}/codespaces"
  8882. ],
  8883. listOrgSecrets: ["GET /orgs/{org}/codespaces/secrets"],
  8884. listRepoSecrets: ["GET /repos/{owner}/{repo}/codespaces/secrets"],
  8885. listRepositoriesForSecretForAuthenticatedUser: [
  8886. "GET /user/codespaces/secrets/{secret_name}/repositories"
  8887. ],
  8888. listSecretsForAuthenticatedUser: ["GET /user/codespaces/secrets"],
  8889. listSelectedReposForOrgSecret: [
  8890. "GET /orgs/{org}/codespaces/secrets/{secret_name}/repositories"
  8891. ],
  8892. preFlightWithRepoForAuthenticatedUser: [
  8893. "GET /repos/{owner}/{repo}/codespaces/new"
  8894. ],
  8895. publishForAuthenticatedUser: [
  8896. "POST /user/codespaces/{codespace_name}/publish"
  8897. ],
  8898. removeRepositoryForSecretForAuthenticatedUser: [
  8899. "DELETE /user/codespaces/secrets/{secret_name}/repositories/{repository_id}"
  8900. ],
  8901. removeSelectedRepoFromOrgSecret: [
  8902. "DELETE /orgs/{org}/codespaces/secrets/{secret_name}/repositories/{repository_id}"
  8903. ],
  8904. repoMachinesForAuthenticatedUser: [
  8905. "GET /repos/{owner}/{repo}/codespaces/machines"
  8906. ],
  8907. setRepositoriesForSecretForAuthenticatedUser: [
  8908. "PUT /user/codespaces/secrets/{secret_name}/repositories"
  8909. ],
  8910. setSelectedReposForOrgSecret: [
  8911. "PUT /orgs/{org}/codespaces/secrets/{secret_name}/repositories"
  8912. ],
  8913. startForAuthenticatedUser: ["POST /user/codespaces/{codespace_name}/start"],
  8914. stopForAuthenticatedUser: ["POST /user/codespaces/{codespace_name}/stop"],
  8915. stopInOrganization: [
  8916. "POST /orgs/{org}/members/{username}/codespaces/{codespace_name}/stop"
  8917. ],
  8918. updateForAuthenticatedUser: ["PATCH /user/codespaces/{codespace_name}"]
  8919. },
  8920. copilot: {
  8921. addCopilotSeatsForTeams: [
  8922. "POST /orgs/{org}/copilot/billing/selected_teams"
  8923. ],
  8924. addCopilotSeatsForUsers: [
  8925. "POST /orgs/{org}/copilot/billing/selected_users"
  8926. ],
  8927. cancelCopilotSeatAssignmentForTeams: [
  8928. "DELETE /orgs/{org}/copilot/billing/selected_teams"
  8929. ],
  8930. cancelCopilotSeatAssignmentForUsers: [
  8931. "DELETE /orgs/{org}/copilot/billing/selected_users"
  8932. ],
  8933. getCopilotOrganizationDetails: ["GET /orgs/{org}/copilot/billing"],
  8934. getCopilotSeatDetailsForUser: [
  8935. "GET /orgs/{org}/members/{username}/copilot"
  8936. ],
  8937. listCopilotSeats: ["GET /orgs/{org}/copilot/billing/seats"]
  8938. },
  8939. dependabot: {
  8940. addSelectedRepoToOrgSecret: [
  8941. "PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id}"
  8942. ],
  8943. createOrUpdateOrgSecret: [
  8944. "PUT /orgs/{org}/dependabot/secrets/{secret_name}"
  8945. ],
  8946. createOrUpdateRepoSecret: [
  8947. "PUT /repos/{owner}/{repo}/dependabot/secrets/{secret_name}"
  8948. ],
  8949. deleteOrgSecret: ["DELETE /orgs/{org}/dependabot/secrets/{secret_name}"],
  8950. deleteRepoSecret: [
  8951. "DELETE /repos/{owner}/{repo}/dependabot/secrets/{secret_name}"
  8952. ],
  8953. getAlert: ["GET /repos/{owner}/{repo}/dependabot/alerts/{alert_number}"],
  8954. getOrgPublicKey: ["GET /orgs/{org}/dependabot/secrets/public-key"],
  8955. getOrgSecret: ["GET /orgs/{org}/dependabot/secrets/{secret_name}"],
  8956. getRepoPublicKey: [
  8957. "GET /repos/{owner}/{repo}/dependabot/secrets/public-key"
  8958. ],
  8959. getRepoSecret: [
  8960. "GET /repos/{owner}/{repo}/dependabot/secrets/{secret_name}"
  8961. ],
  8962. listAlertsForEnterprise: [
  8963. "GET /enterprises/{enterprise}/dependabot/alerts"
  8964. ],
  8965. listAlertsForOrg: ["GET /orgs/{org}/dependabot/alerts"],
  8966. listAlertsForRepo: ["GET /repos/{owner}/{repo}/dependabot/alerts"],
  8967. listOrgSecrets: ["GET /orgs/{org}/dependabot/secrets"],
  8968. listRepoSecrets: ["GET /repos/{owner}/{repo}/dependabot/secrets"],
  8969. listSelectedReposForOrgSecret: [
  8970. "GET /orgs/{org}/dependabot/secrets/{secret_name}/repositories"
  8971. ],
  8972. removeSelectedRepoFromOrgSecret: [
  8973. "DELETE /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id}"
  8974. ],
  8975. setSelectedReposForOrgSecret: [
  8976. "PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories"
  8977. ],
  8978. updateAlert: [
  8979. "PATCH /repos/{owner}/{repo}/dependabot/alerts/{alert_number}"
  8980. ]
  8981. },
  8982. dependencyGraph: {
  8983. createRepositorySnapshot: [
  8984. "POST /repos/{owner}/{repo}/dependency-graph/snapshots"
  8985. ],
  8986. diffRange: [
  8987. "GET /repos/{owner}/{repo}/dependency-graph/compare/{basehead}"
  8988. ],
  8989. exportSbom: ["GET /repos/{owner}/{repo}/dependency-graph/sbom"]
  8990. },
  8991. emojis: { get: ["GET /emojis"] },
  8992. gists: {
  8993. checkIsStarred: ["GET /gists/{gist_id}/star"],
  8994. create: ["POST /gists"],
  8995. createComment: ["POST /gists/{gist_id}/comments"],
  8996. delete: ["DELETE /gists/{gist_id}"],
  8997. deleteComment: ["DELETE /gists/{gist_id}/comments/{comment_id}"],
  8998. fork: ["POST /gists/{gist_id}/forks"],
  8999. get: ["GET /gists/{gist_id}"],
  9000. getComment: ["GET /gists/{gist_id}/comments/{comment_id}"],
  9001. getRevision: ["GET /gists/{gist_id}/{sha}"],
  9002. list: ["GET /gists"],
  9003. listComments: ["GET /gists/{gist_id}/comments"],
  9004. listCommits: ["GET /gists/{gist_id}/commits"],
  9005. listForUser: ["GET /users/{username}/gists"],
  9006. listForks: ["GET /gists/{gist_id}/forks"],
  9007. listPublic: ["GET /gists/public"],
  9008. listStarred: ["GET /gists/starred"],
  9009. star: ["PUT /gists/{gist_id}/star"],
  9010. unstar: ["DELETE /gists/{gist_id}/star"],
  9011. update: ["PATCH /gists/{gist_id}"],
  9012. updateComment: ["PATCH /gists/{gist_id}/comments/{comment_id}"]
  9013. },
  9014. git: {
  9015. createBlob: ["POST /repos/{owner}/{repo}/git/blobs"],
  9016. createCommit: ["POST /repos/{owner}/{repo}/git/commits"],
  9017. createRef: ["POST /repos/{owner}/{repo}/git/refs"],
  9018. createTag: ["POST /repos/{owner}/{repo}/git/tags"],
  9019. createTree: ["POST /repos/{owner}/{repo}/git/trees"],
  9020. deleteRef: ["DELETE /repos/{owner}/{repo}/git/refs/{ref}"],
  9021. getBlob: ["GET /repos/{owner}/{repo}/git/blobs/{file_sha}"],
  9022. getCommit: ["GET /repos/{owner}/{repo}/git/commits/{commit_sha}"],
  9023. getRef: ["GET /repos/{owner}/{repo}/git/ref/{ref}"],
  9024. getTag: ["GET /repos/{owner}/{repo}/git/tags/{tag_sha}"],
  9025. getTree: ["GET /repos/{owner}/{repo}/git/trees/{tree_sha}"],
  9026. listMatchingRefs: ["GET /repos/{owner}/{repo}/git/matching-refs/{ref}"],
  9027. updateRef: ["PATCH /repos/{owner}/{repo}/git/refs/{ref}"]
  9028. },
  9029. gitignore: {
  9030. getAllTemplates: ["GET /gitignore/templates"],
  9031. getTemplate: ["GET /gitignore/templates/{name}"]
  9032. },
  9033. interactions: {
  9034. getRestrictionsForAuthenticatedUser: ["GET /user/interaction-limits"],
  9035. getRestrictionsForOrg: ["GET /orgs/{org}/interaction-limits"],
  9036. getRestrictionsForRepo: ["GET /repos/{owner}/{repo}/interaction-limits"],
  9037. getRestrictionsForYourPublicRepos: [
  9038. "GET /user/interaction-limits",
  9039. {},
  9040. { renamed: ["interactions", "getRestrictionsForAuthenticatedUser"] }
  9041. ],
  9042. removeRestrictionsForAuthenticatedUser: ["DELETE /user/interaction-limits"],
  9043. removeRestrictionsForOrg: ["DELETE /orgs/{org}/interaction-limits"],
  9044. removeRestrictionsForRepo: [
  9045. "DELETE /repos/{owner}/{repo}/interaction-limits"
  9046. ],
  9047. removeRestrictionsForYourPublicRepos: [
  9048. "DELETE /user/interaction-limits",
  9049. {},
  9050. { renamed: ["interactions", "removeRestrictionsForAuthenticatedUser"] }
  9051. ],
  9052. setRestrictionsForAuthenticatedUser: ["PUT /user/interaction-limits"],
  9053. setRestrictionsForOrg: ["PUT /orgs/{org}/interaction-limits"],
  9054. setRestrictionsForRepo: ["PUT /repos/{owner}/{repo}/interaction-limits"],
  9055. setRestrictionsForYourPublicRepos: [
  9056. "PUT /user/interaction-limits",
  9057. {},
  9058. { renamed: ["interactions", "setRestrictionsForAuthenticatedUser"] }
  9059. ]
  9060. },
  9061. issues: {
  9062. addAssignees: [
  9063. "POST /repos/{owner}/{repo}/issues/{issue_number}/assignees"
  9064. ],
  9065. addLabels: ["POST /repos/{owner}/{repo}/issues/{issue_number}/labels"],
  9066. checkUserCanBeAssigned: ["GET /repos/{owner}/{repo}/assignees/{assignee}"],
  9067. checkUserCanBeAssignedToIssue: [
  9068. "GET /repos/{owner}/{repo}/issues/{issue_number}/assignees/{assignee}"
  9069. ],
  9070. create: ["POST /repos/{owner}/{repo}/issues"],
  9071. createComment: [
  9072. "POST /repos/{owner}/{repo}/issues/{issue_number}/comments"
  9073. ],
  9074. createLabel: ["POST /repos/{owner}/{repo}/labels"],
  9075. createMilestone: ["POST /repos/{owner}/{repo}/milestones"],
  9076. deleteComment: [
  9077. "DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}"
  9078. ],
  9079. deleteLabel: ["DELETE /repos/{owner}/{repo}/labels/{name}"],
  9080. deleteMilestone: [
  9081. "DELETE /repos/{owner}/{repo}/milestones/{milestone_number}"
  9082. ],
  9083. get: ["GET /repos/{owner}/{repo}/issues/{issue_number}"],
  9084. getComment: ["GET /repos/{owner}/{repo}/issues/comments/{comment_id}"],
  9085. getEvent: ["GET /repos/{owner}/{repo}/issues/events/{event_id}"],
  9086. getLabel: ["GET /repos/{owner}/{repo}/labels/{name}"],
  9087. getMilestone: ["GET /repos/{owner}/{repo}/milestones/{milestone_number}"],
  9088. list: ["GET /issues"],
  9089. listAssignees: ["GET /repos/{owner}/{repo}/assignees"],
  9090. listComments: ["GET /repos/{owner}/{repo}/issues/{issue_number}/comments"],
  9091. listCommentsForRepo: ["GET /repos/{owner}/{repo}/issues/comments"],
  9092. listEvents: ["GET /repos/{owner}/{repo}/issues/{issue_number}/events"],
  9093. listEventsForRepo: ["GET /repos/{owner}/{repo}/issues/events"],
  9094. listEventsForTimeline: [
  9095. "GET /repos/{owner}/{repo}/issues/{issue_number}/timeline"
  9096. ],
  9097. listForAuthenticatedUser: ["GET /user/issues"],
  9098. listForOrg: ["GET /orgs/{org}/issues"],
  9099. listForRepo: ["GET /repos/{owner}/{repo}/issues"],
  9100. listLabelsForMilestone: [
  9101. "GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels"
  9102. ],
  9103. listLabelsForRepo: ["GET /repos/{owner}/{repo}/labels"],
  9104. listLabelsOnIssue: [
  9105. "GET /repos/{owner}/{repo}/issues/{issue_number}/labels"
  9106. ],
  9107. listMilestones: ["GET /repos/{owner}/{repo}/milestones"],
  9108. lock: ["PUT /repos/{owner}/{repo}/issues/{issue_number}/lock"],
  9109. removeAllLabels: [
  9110. "DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels"
  9111. ],
  9112. removeAssignees: [
  9113. "DELETE /repos/{owner}/{repo}/issues/{issue_number}/assignees"
  9114. ],
  9115. removeLabel: [
  9116. "DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels/{name}"
  9117. ],
  9118. setLabels: ["PUT /repos/{owner}/{repo}/issues/{issue_number}/labels"],
  9119. unlock: ["DELETE /repos/{owner}/{repo}/issues/{issue_number}/lock"],
  9120. update: ["PATCH /repos/{owner}/{repo}/issues/{issue_number}"],
  9121. updateComment: ["PATCH /repos/{owner}/{repo}/issues/comments/{comment_id}"],
  9122. updateLabel: ["PATCH /repos/{owner}/{repo}/labels/{name}"],
  9123. updateMilestone: [
  9124. "PATCH /repos/{owner}/{repo}/milestones/{milestone_number}"
  9125. ]
  9126. },
  9127. licenses: {
  9128. get: ["GET /licenses/{license}"],
  9129. getAllCommonlyUsed: ["GET /licenses"],
  9130. getForRepo: ["GET /repos/{owner}/{repo}/license"]
  9131. },
  9132. markdown: {
  9133. render: ["POST /markdown"],
  9134. renderRaw: [
  9135. "POST /markdown/raw",
  9136. { headers: { "content-type": "text/plain; charset=utf-8" } }
  9137. ]
  9138. },
  9139. meta: {
  9140. get: ["GET /meta"],
  9141. getAllVersions: ["GET /versions"],
  9142. getOctocat: ["GET /octocat"],
  9143. getZen: ["GET /zen"],
  9144. root: ["GET /"]
  9145. },
  9146. migrations: {
  9147. cancelImport: [
  9148. "DELETE /repos/{owner}/{repo}/import",
  9149. {},
  9150. {
  9151. deprecated: "octokit.rest.migrations.cancelImport() is deprecated, see https://docs.github.com/rest/migrations/source-imports#cancel-an-import"
  9152. }
  9153. ],
  9154. deleteArchiveForAuthenticatedUser: [
  9155. "DELETE /user/migrations/{migration_id}/archive"
  9156. ],
  9157. deleteArchiveForOrg: [
  9158. "DELETE /orgs/{org}/migrations/{migration_id}/archive"
  9159. ],
  9160. downloadArchiveForOrg: [
  9161. "GET /orgs/{org}/migrations/{migration_id}/archive"
  9162. ],
  9163. getArchiveForAuthenticatedUser: [
  9164. "GET /user/migrations/{migration_id}/archive"
  9165. ],
  9166. getCommitAuthors: [
  9167. "GET /repos/{owner}/{repo}/import/authors",
  9168. {},
  9169. {
  9170. deprecated: "octokit.rest.migrations.getCommitAuthors() is deprecated, see https://docs.github.com/rest/migrations/source-imports#get-commit-authors"
  9171. }
  9172. ],
  9173. getImportStatus: [
  9174. "GET /repos/{owner}/{repo}/import",
  9175. {},
  9176. {
  9177. deprecated: "octokit.rest.migrations.getImportStatus() is deprecated, see https://docs.github.com/rest/migrations/source-imports#get-an-import-status"
  9178. }
  9179. ],
  9180. getLargeFiles: [
  9181. "GET /repos/{owner}/{repo}/import/large_files",
  9182. {},
  9183. {
  9184. deprecated: "octokit.rest.migrations.getLargeFiles() is deprecated, see https://docs.github.com/rest/migrations/source-imports#get-large-files"
  9185. }
  9186. ],
  9187. getStatusForAuthenticatedUser: ["GET /user/migrations/{migration_id}"],
  9188. getStatusForOrg: ["GET /orgs/{org}/migrations/{migration_id}"],
  9189. listForAuthenticatedUser: ["GET /user/migrations"],
  9190. listForOrg: ["GET /orgs/{org}/migrations"],
  9191. listReposForAuthenticatedUser: [
  9192. "GET /user/migrations/{migration_id}/repositories"
  9193. ],
  9194. listReposForOrg: ["GET /orgs/{org}/migrations/{migration_id}/repositories"],
  9195. listReposForUser: [
  9196. "GET /user/migrations/{migration_id}/repositories",
  9197. {},
  9198. { renamed: ["migrations", "listReposForAuthenticatedUser"] }
  9199. ],
  9200. mapCommitAuthor: [
  9201. "PATCH /repos/{owner}/{repo}/import/authors/{author_id}",
  9202. {},
  9203. {
  9204. deprecated: "octokit.rest.migrations.mapCommitAuthor() is deprecated, see https://docs.github.com/rest/migrations/source-imports#map-a-commit-author"
  9205. }
  9206. ],
  9207. setLfsPreference: [
  9208. "PATCH /repos/{owner}/{repo}/import/lfs",
  9209. {},
  9210. {
  9211. deprecated: "octokit.rest.migrations.setLfsPreference() is deprecated, see https://docs.github.com/rest/migrations/source-imports#update-git-lfs-preference"
  9212. }
  9213. ],
  9214. startForAuthenticatedUser: ["POST /user/migrations"],
  9215. startForOrg: ["POST /orgs/{org}/migrations"],
  9216. startImport: [
  9217. "PUT /repos/{owner}/{repo}/import",
  9218. {},
  9219. {
  9220. deprecated: "octokit.rest.migrations.startImport() is deprecated, see https://docs.github.com/rest/migrations/source-imports#start-an-import"
  9221. }
  9222. ],
  9223. unlockRepoForAuthenticatedUser: [
  9224. "DELETE /user/migrations/{migration_id}/repos/{repo_name}/lock"
  9225. ],
  9226. unlockRepoForOrg: [
  9227. "DELETE /orgs/{org}/migrations/{migration_id}/repos/{repo_name}/lock"
  9228. ],
  9229. updateImport: [
  9230. "PATCH /repos/{owner}/{repo}/import",
  9231. {},
  9232. {
  9233. deprecated: "octokit.rest.migrations.updateImport() is deprecated, see https://docs.github.com/rest/migrations/source-imports#update-an-import"
  9234. }
  9235. ]
  9236. },
  9237. oidc: {
  9238. getOidcCustomSubTemplateForOrg: [
  9239. "GET /orgs/{org}/actions/oidc/customization/sub"
  9240. ],
  9241. updateOidcCustomSubTemplateForOrg: [
  9242. "PUT /orgs/{org}/actions/oidc/customization/sub"
  9243. ]
  9244. },
  9245. orgs: {
  9246. addSecurityManagerTeam: [
  9247. "PUT /orgs/{org}/security-managers/teams/{team_slug}"
  9248. ],
  9249. assignTeamToOrgRole: [
  9250. "PUT /orgs/{org}/organization-roles/teams/{team_slug}/{role_id}"
  9251. ],
  9252. assignUserToOrgRole: [
  9253. "PUT /orgs/{org}/organization-roles/users/{username}/{role_id}"
  9254. ],
  9255. blockUser: ["PUT /orgs/{org}/blocks/{username}"],
  9256. cancelInvitation: ["DELETE /orgs/{org}/invitations/{invitation_id}"],
  9257. checkBlockedUser: ["GET /orgs/{org}/blocks/{username}"],
  9258. checkMembershipForUser: ["GET /orgs/{org}/members/{username}"],
  9259. checkPublicMembershipForUser: ["GET /orgs/{org}/public_members/{username}"],
  9260. convertMemberToOutsideCollaborator: [
  9261. "PUT /orgs/{org}/outside_collaborators/{username}"
  9262. ],
  9263. createCustomOrganizationRole: ["POST /orgs/{org}/organization-roles"],
  9264. createInvitation: ["POST /orgs/{org}/invitations"],
  9265. createOrUpdateCustomProperties: ["PATCH /orgs/{org}/properties/schema"],
  9266. createOrUpdateCustomPropertiesValuesForRepos: [
  9267. "PATCH /orgs/{org}/properties/values"
  9268. ],
  9269. createOrUpdateCustomProperty: [
  9270. "PUT /orgs/{org}/properties/schema/{custom_property_name}"
  9271. ],
  9272. createWebhook: ["POST /orgs/{org}/hooks"],
  9273. delete: ["DELETE /orgs/{org}"],
  9274. deleteCustomOrganizationRole: [
  9275. "DELETE /orgs/{org}/organization-roles/{role_id}"
  9276. ],
  9277. deleteWebhook: ["DELETE /orgs/{org}/hooks/{hook_id}"],
  9278. enableOrDisableSecurityProductOnAllOrgRepos: [
  9279. "POST /orgs/{org}/{security_product}/{enablement}"
  9280. ],
  9281. get: ["GET /orgs/{org}"],
  9282. getAllCustomProperties: ["GET /orgs/{org}/properties/schema"],
  9283. getCustomProperty: [
  9284. "GET /orgs/{org}/properties/schema/{custom_property_name}"
  9285. ],
  9286. getMembershipForAuthenticatedUser: ["GET /user/memberships/orgs/{org}"],
  9287. getMembershipForUser: ["GET /orgs/{org}/memberships/{username}"],
  9288. getOrgRole: ["GET /orgs/{org}/organization-roles/{role_id}"],
  9289. getWebhook: ["GET /orgs/{org}/hooks/{hook_id}"],
  9290. getWebhookConfigForOrg: ["GET /orgs/{org}/hooks/{hook_id}/config"],
  9291. getWebhookDelivery: [
  9292. "GET /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}"
  9293. ],
  9294. list: ["GET /organizations"],
  9295. listAppInstallations: ["GET /orgs/{org}/installations"],
  9296. listBlockedUsers: ["GET /orgs/{org}/blocks"],
  9297. listCustomPropertiesValuesForRepos: ["GET /orgs/{org}/properties/values"],
  9298. listFailedInvitations: ["GET /orgs/{org}/failed_invitations"],
  9299. listForAuthenticatedUser: ["GET /user/orgs"],
  9300. listForUser: ["GET /users/{username}/orgs"],
  9301. listInvitationTeams: ["GET /orgs/{org}/invitations/{invitation_id}/teams"],
  9302. listMembers: ["GET /orgs/{org}/members"],
  9303. listMembershipsForAuthenticatedUser: ["GET /user/memberships/orgs"],
  9304. listOrgRoleTeams: ["GET /orgs/{org}/organization-roles/{role_id}/teams"],
  9305. listOrgRoleUsers: ["GET /orgs/{org}/organization-roles/{role_id}/users"],
  9306. listOrgRoles: ["GET /orgs/{org}/organization-roles"],
  9307. listOrganizationFineGrainedPermissions: [
  9308. "GET /orgs/{org}/organization-fine-grained-permissions"
  9309. ],
  9310. listOutsideCollaborators: ["GET /orgs/{org}/outside_collaborators"],
  9311. listPatGrantRepositories: [
  9312. "GET /orgs/{org}/personal-access-tokens/{pat_id}/repositories"
  9313. ],
  9314. listPatGrantRequestRepositories: [
  9315. "GET /orgs/{org}/personal-access-token-requests/{pat_request_id}/repositories"
  9316. ],
  9317. listPatGrantRequests: ["GET /orgs/{org}/personal-access-token-requests"],
  9318. listPatGrants: ["GET /orgs/{org}/personal-access-tokens"],
  9319. listPendingInvitations: ["GET /orgs/{org}/invitations"],
  9320. listPublicMembers: ["GET /orgs/{org}/public_members"],
  9321. listSecurityManagerTeams: ["GET /orgs/{org}/security-managers"],
  9322. listWebhookDeliveries: ["GET /orgs/{org}/hooks/{hook_id}/deliveries"],
  9323. listWebhooks: ["GET /orgs/{org}/hooks"],
  9324. patchCustomOrganizationRole: [
  9325. "PATCH /orgs/{org}/organization-roles/{role_id}"
  9326. ],
  9327. pingWebhook: ["POST /orgs/{org}/hooks/{hook_id}/pings"],
  9328. redeliverWebhookDelivery: [
  9329. "POST /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts"
  9330. ],
  9331. removeCustomProperty: [
  9332. "DELETE /orgs/{org}/properties/schema/{custom_property_name}"
  9333. ],
  9334. removeMember: ["DELETE /orgs/{org}/members/{username}"],
  9335. removeMembershipForUser: ["DELETE /orgs/{org}/memberships/{username}"],
  9336. removeOutsideCollaborator: [
  9337. "DELETE /orgs/{org}/outside_collaborators/{username}"
  9338. ],
  9339. removePublicMembershipForAuthenticatedUser: [
  9340. "DELETE /orgs/{org}/public_members/{username}"
  9341. ],
  9342. removeSecurityManagerTeam: [
  9343. "DELETE /orgs/{org}/security-managers/teams/{team_slug}"
  9344. ],
  9345. reviewPatGrantRequest: [
  9346. "POST /orgs/{org}/personal-access-token-requests/{pat_request_id}"
  9347. ],
  9348. reviewPatGrantRequestsInBulk: [
  9349. "POST /orgs/{org}/personal-access-token-requests"
  9350. ],
  9351. revokeAllOrgRolesTeam: [
  9352. "DELETE /orgs/{org}/organization-roles/teams/{team_slug}"
  9353. ],
  9354. revokeAllOrgRolesUser: [
  9355. "DELETE /orgs/{org}/organization-roles/users/{username}"
  9356. ],
  9357. revokeOrgRoleTeam: [
  9358. "DELETE /orgs/{org}/organization-roles/teams/{team_slug}/{role_id}"
  9359. ],
  9360. revokeOrgRoleUser: [
  9361. "DELETE /orgs/{org}/organization-roles/users/{username}/{role_id}"
  9362. ],
  9363. setMembershipForUser: ["PUT /orgs/{org}/memberships/{username}"],
  9364. setPublicMembershipForAuthenticatedUser: [
  9365. "PUT /orgs/{org}/public_members/{username}"
  9366. ],
  9367. unblockUser: ["DELETE /orgs/{org}/blocks/{username}"],
  9368. update: ["PATCH /orgs/{org}"],
  9369. updateMembershipForAuthenticatedUser: [
  9370. "PATCH /user/memberships/orgs/{org}"
  9371. ],
  9372. updatePatAccess: ["POST /orgs/{org}/personal-access-tokens/{pat_id}"],
  9373. updatePatAccesses: ["POST /orgs/{org}/personal-access-tokens"],
  9374. updateWebhook: ["PATCH /orgs/{org}/hooks/{hook_id}"],
  9375. updateWebhookConfigForOrg: ["PATCH /orgs/{org}/hooks/{hook_id}/config"]
  9376. },
  9377. packages: {
  9378. deletePackageForAuthenticatedUser: [
  9379. "DELETE /user/packages/{package_type}/{package_name}"
  9380. ],
  9381. deletePackageForOrg: [
  9382. "DELETE /orgs/{org}/packages/{package_type}/{package_name}"
  9383. ],
  9384. deletePackageForUser: [
  9385. "DELETE /users/{username}/packages/{package_type}/{package_name}"
  9386. ],
  9387. deletePackageVersionForAuthenticatedUser: [
  9388. "DELETE /user/packages/{package_type}/{package_name}/versions/{package_version_id}"
  9389. ],
  9390. deletePackageVersionForOrg: [
  9391. "DELETE /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}"
  9392. ],
  9393. deletePackageVersionForUser: [
  9394. "DELETE /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}"
  9395. ],
  9396. getAllPackageVersionsForAPackageOwnedByAnOrg: [
  9397. "GET /orgs/{org}/packages/{package_type}/{package_name}/versions",
  9398. {},
  9399. { renamed: ["packages", "getAllPackageVersionsForPackageOwnedByOrg"] }
  9400. ],
  9401. getAllPackageVersionsForAPackageOwnedByTheAuthenticatedUser: [
  9402. "GET /user/packages/{package_type}/{package_name}/versions",
  9403. {},
  9404. {
  9405. renamed: [
  9406. "packages",
  9407. "getAllPackageVersionsForPackageOwnedByAuthenticatedUser"
  9408. ]
  9409. }
  9410. ],
  9411. getAllPackageVersionsForPackageOwnedByAuthenticatedUser: [
  9412. "GET /user/packages/{package_type}/{package_name}/versions"
  9413. ],
  9414. getAllPackageVersionsForPackageOwnedByOrg: [
  9415. "GET /orgs/{org}/packages/{package_type}/{package_name}/versions"
  9416. ],
  9417. getAllPackageVersionsForPackageOwnedByUser: [
  9418. "GET /users/{username}/packages/{package_type}/{package_name}/versions"
  9419. ],
  9420. getPackageForAuthenticatedUser: [
  9421. "GET /user/packages/{package_type}/{package_name}"
  9422. ],
  9423. getPackageForOrganization: [
  9424. "GET /orgs/{org}/packages/{package_type}/{package_name}"
  9425. ],
  9426. getPackageForUser: [
  9427. "GET /users/{username}/packages/{package_type}/{package_name}"
  9428. ],
  9429. getPackageVersionForAuthenticatedUser: [
  9430. "GET /user/packages/{package_type}/{package_name}/versions/{package_version_id}"
  9431. ],
  9432. getPackageVersionForOrganization: [
  9433. "GET /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}"
  9434. ],
  9435. getPackageVersionForUser: [
  9436. "GET /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}"
  9437. ],
  9438. listDockerMigrationConflictingPackagesForAuthenticatedUser: [
  9439. "GET /user/docker/conflicts"
  9440. ],
  9441. listDockerMigrationConflictingPackagesForOrganization: [
  9442. "GET /orgs/{org}/docker/conflicts"
  9443. ],
  9444. listDockerMigrationConflictingPackagesForUser: [
  9445. "GET /users/{username}/docker/conflicts"
  9446. ],
  9447. listPackagesForAuthenticatedUser: ["GET /user/packages"],
  9448. listPackagesForOrganization: ["GET /orgs/{org}/packages"],
  9449. listPackagesForUser: ["GET /users/{username}/packages"],
  9450. restorePackageForAuthenticatedUser: [
  9451. "POST /user/packages/{package_type}/{package_name}/restore{?token}"
  9452. ],
  9453. restorePackageForOrg: [
  9454. "POST /orgs/{org}/packages/{package_type}/{package_name}/restore{?token}"
  9455. ],
  9456. restorePackageForUser: [
  9457. "POST /users/{username}/packages/{package_type}/{package_name}/restore{?token}"
  9458. ],
  9459. restorePackageVersionForAuthenticatedUser: [
  9460. "POST /user/packages/{package_type}/{package_name}/versions/{package_version_id}/restore"
  9461. ],
  9462. restorePackageVersionForOrg: [
  9463. "POST /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore"
  9464. ],
  9465. restorePackageVersionForUser: [
  9466. "POST /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore"
  9467. ]
  9468. },
  9469. projects: {
  9470. addCollaborator: ["PUT /projects/{project_id}/collaborators/{username}"],
  9471. createCard: ["POST /projects/columns/{column_id}/cards"],
  9472. createColumn: ["POST /projects/{project_id}/columns"],
  9473. createForAuthenticatedUser: ["POST /user/projects"],
  9474. createForOrg: ["POST /orgs/{org}/projects"],
  9475. createForRepo: ["POST /repos/{owner}/{repo}/projects"],
  9476. delete: ["DELETE /projects/{project_id}"],
  9477. deleteCard: ["DELETE /projects/columns/cards/{card_id}"],
  9478. deleteColumn: ["DELETE /projects/columns/{column_id}"],
  9479. get: ["GET /projects/{project_id}"],
  9480. getCard: ["GET /projects/columns/cards/{card_id}"],
  9481. getColumn: ["GET /projects/columns/{column_id}"],
  9482. getPermissionForUser: [
  9483. "GET /projects/{project_id}/collaborators/{username}/permission"
  9484. ],
  9485. listCards: ["GET /projects/columns/{column_id}/cards"],
  9486. listCollaborators: ["GET /projects/{project_id}/collaborators"],
  9487. listColumns: ["GET /projects/{project_id}/columns"],
  9488. listForOrg: ["GET /orgs/{org}/projects"],
  9489. listForRepo: ["GET /repos/{owner}/{repo}/projects"],
  9490. listForUser: ["GET /users/{username}/projects"],
  9491. moveCard: ["POST /projects/columns/cards/{card_id}/moves"],
  9492. moveColumn: ["POST /projects/columns/{column_id}/moves"],
  9493. removeCollaborator: [
  9494. "DELETE /projects/{project_id}/collaborators/{username}"
  9495. ],
  9496. update: ["PATCH /projects/{project_id}"],
  9497. updateCard: ["PATCH /projects/columns/cards/{card_id}"],
  9498. updateColumn: ["PATCH /projects/columns/{column_id}"]
  9499. },
  9500. pulls: {
  9501. checkIfMerged: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/merge"],
  9502. create: ["POST /repos/{owner}/{repo}/pulls"],
  9503. createReplyForReviewComment: [
  9504. "POST /repos/{owner}/{repo}/pulls/{pull_number}/comments/{comment_id}/replies"
  9505. ],
  9506. createReview: ["POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews"],
  9507. createReviewComment: [
  9508. "POST /repos/{owner}/{repo}/pulls/{pull_number}/comments"
  9509. ],
  9510. deletePendingReview: [
  9511. "DELETE /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}"
  9512. ],
  9513. deleteReviewComment: [
  9514. "DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}"
  9515. ],
  9516. dismissReview: [
  9517. "PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/dismissals"
  9518. ],
  9519. get: ["GET /repos/{owner}/{repo}/pulls/{pull_number}"],
  9520. getReview: [
  9521. "GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}"
  9522. ],
  9523. getReviewComment: ["GET /repos/{owner}/{repo}/pulls/comments/{comment_id}"],
  9524. list: ["GET /repos/{owner}/{repo}/pulls"],
  9525. listCommentsForReview: [
  9526. "GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments"
  9527. ],
  9528. listCommits: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/commits"],
  9529. listFiles: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/files"],
  9530. listRequestedReviewers: [
  9531. "GET /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers"
  9532. ],
  9533. listReviewComments: [
  9534. "GET /repos/{owner}/{repo}/pulls/{pull_number}/comments"
  9535. ],
  9536. listReviewCommentsForRepo: ["GET /repos/{owner}/{repo}/pulls/comments"],
  9537. listReviews: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews"],
  9538. merge: ["PUT /repos/{owner}/{repo}/pulls/{pull_number}/merge"],
  9539. removeRequestedReviewers: [
  9540. "DELETE /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers"
  9541. ],
  9542. requestReviewers: [
  9543. "POST /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers"
  9544. ],
  9545. submitReview: [
  9546. "POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/events"
  9547. ],
  9548. update: ["PATCH /repos/{owner}/{repo}/pulls/{pull_number}"],
  9549. updateBranch: [
  9550. "PUT /repos/{owner}/{repo}/pulls/{pull_number}/update-branch"
  9551. ],
  9552. updateReview: [
  9553. "PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}"
  9554. ],
  9555. updateReviewComment: [
  9556. "PATCH /repos/{owner}/{repo}/pulls/comments/{comment_id}"
  9557. ]
  9558. },
  9559. rateLimit: { get: ["GET /rate_limit"] },
  9560. reactions: {
  9561. createForCommitComment: [
  9562. "POST /repos/{owner}/{repo}/comments/{comment_id}/reactions"
  9563. ],
  9564. createForIssue: [
  9565. "POST /repos/{owner}/{repo}/issues/{issue_number}/reactions"
  9566. ],
  9567. createForIssueComment: [
  9568. "POST /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions"
  9569. ],
  9570. createForPullRequestReviewComment: [
  9571. "POST /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions"
  9572. ],
  9573. createForRelease: [
  9574. "POST /repos/{owner}/{repo}/releases/{release_id}/reactions"
  9575. ],
  9576. createForTeamDiscussionCommentInOrg: [
  9577. "POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions"
  9578. ],
  9579. createForTeamDiscussionInOrg: [
  9580. "POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions"
  9581. ],
  9582. deleteForCommitComment: [
  9583. "DELETE /repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id}"
  9584. ],
  9585. deleteForIssue: [
  9586. "DELETE /repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id}"
  9587. ],
  9588. deleteForIssueComment: [
  9589. "DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/{reaction_id}"
  9590. ],
  9591. deleteForPullRequestComment: [
  9592. "DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/{reaction_id}"
  9593. ],
  9594. deleteForRelease: [
  9595. "DELETE /repos/{owner}/{repo}/releases/{release_id}/reactions/{reaction_id}"
  9596. ],
  9597. deleteForTeamDiscussion: [
  9598. "DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/{reaction_id}"
  9599. ],
  9600. deleteForTeamDiscussionComment: [
  9601. "DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/{reaction_id}"
  9602. ],
  9603. listForCommitComment: [
  9604. "GET /repos/{owner}/{repo}/comments/{comment_id}/reactions"
  9605. ],
  9606. listForIssue: ["GET /repos/{owner}/{repo}/issues/{issue_number}/reactions"],
  9607. listForIssueComment: [
  9608. "GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions"
  9609. ],
  9610. listForPullRequestReviewComment: [
  9611. "GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions"
  9612. ],
  9613. listForRelease: [
  9614. "GET /repos/{owner}/{repo}/releases/{release_id}/reactions"
  9615. ],
  9616. listForTeamDiscussionCommentInOrg: [
  9617. "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions"
  9618. ],
  9619. listForTeamDiscussionInOrg: [
  9620. "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions"
  9621. ]
  9622. },
  9623. repos: {
  9624. acceptInvitation: [
  9625. "PATCH /user/repository_invitations/{invitation_id}",
  9626. {},
  9627. { renamed: ["repos", "acceptInvitationForAuthenticatedUser"] }
  9628. ],
  9629. acceptInvitationForAuthenticatedUser: [
  9630. "PATCH /user/repository_invitations/{invitation_id}"
  9631. ],
  9632. addAppAccessRestrictions: [
  9633. "POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps",
  9634. {},
  9635. { mapToData: "apps" }
  9636. ],
  9637. addCollaborator: ["PUT /repos/{owner}/{repo}/collaborators/{username}"],
  9638. addStatusCheckContexts: [
  9639. "POST /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts",
  9640. {},
  9641. { mapToData: "contexts" }
  9642. ],
  9643. addTeamAccessRestrictions: [
  9644. "POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams",
  9645. {},
  9646. { mapToData: "teams" }
  9647. ],
  9648. addUserAccessRestrictions: [
  9649. "POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users",
  9650. {},
  9651. { mapToData: "users" }
  9652. ],
  9653. cancelPagesDeployment: [
  9654. "POST /repos/{owner}/{repo}/pages/deployments/{pages_deployment_id}/cancel"
  9655. ],
  9656. checkAutomatedSecurityFixes: [
  9657. "GET /repos/{owner}/{repo}/automated-security-fixes"
  9658. ],
  9659. checkCollaborator: ["GET /repos/{owner}/{repo}/collaborators/{username}"],
  9660. checkVulnerabilityAlerts: [
  9661. "GET /repos/{owner}/{repo}/vulnerability-alerts"
  9662. ],
  9663. codeownersErrors: ["GET /repos/{owner}/{repo}/codeowners/errors"],
  9664. compareCommits: ["GET /repos/{owner}/{repo}/compare/{base}...{head}"],
  9665. compareCommitsWithBasehead: [
  9666. "GET /repos/{owner}/{repo}/compare/{basehead}"
  9667. ],
  9668. createAutolink: ["POST /repos/{owner}/{repo}/autolinks"],
  9669. createCommitComment: [
  9670. "POST /repos/{owner}/{repo}/commits/{commit_sha}/comments"
  9671. ],
  9672. createCommitSignatureProtection: [
  9673. "POST /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures"
  9674. ],
  9675. createCommitStatus: ["POST /repos/{owner}/{repo}/statuses/{sha}"],
  9676. createDeployKey: ["POST /repos/{owner}/{repo}/keys"],
  9677. createDeployment: ["POST /repos/{owner}/{repo}/deployments"],
  9678. createDeploymentBranchPolicy: [
  9679. "POST /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies"
  9680. ],
  9681. createDeploymentProtectionRule: [
  9682. "POST /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules"
  9683. ],
  9684. createDeploymentStatus: [
  9685. "POST /repos/{owner}/{repo}/deployments/{deployment_id}/statuses"
  9686. ],
  9687. createDispatchEvent: ["POST /repos/{owner}/{repo}/dispatches"],
  9688. createForAuthenticatedUser: ["POST /user/repos"],
  9689. createFork: ["POST /repos/{owner}/{repo}/forks"],
  9690. createInOrg: ["POST /orgs/{org}/repos"],
  9691. createOrUpdateCustomPropertiesValues: [
  9692. "PATCH /repos/{owner}/{repo}/properties/values"
  9693. ],
  9694. createOrUpdateEnvironment: [
  9695. "PUT /repos/{owner}/{repo}/environments/{environment_name}"
  9696. ],
  9697. createOrUpdateFileContents: ["PUT /repos/{owner}/{repo}/contents/{path}"],
  9698. createOrgRuleset: ["POST /orgs/{org}/rulesets"],
  9699. createPagesDeployment: ["POST /repos/{owner}/{repo}/pages/deployments"],
  9700. createPagesSite: ["POST /repos/{owner}/{repo}/pages"],
  9701. createRelease: ["POST /repos/{owner}/{repo}/releases"],
  9702. createRepoRuleset: ["POST /repos/{owner}/{repo}/rulesets"],
  9703. createTagProtection: ["POST /repos/{owner}/{repo}/tags/protection"],
  9704. createUsingTemplate: [
  9705. "POST /repos/{template_owner}/{template_repo}/generate"
  9706. ],
  9707. createWebhook: ["POST /repos/{owner}/{repo}/hooks"],
  9708. declineInvitation: [
  9709. "DELETE /user/repository_invitations/{invitation_id}",
  9710. {},
  9711. { renamed: ["repos", "declineInvitationForAuthenticatedUser"] }
  9712. ],
  9713. declineInvitationForAuthenticatedUser: [
  9714. "DELETE /user/repository_invitations/{invitation_id}"
  9715. ],
  9716. delete: ["DELETE /repos/{owner}/{repo}"],
  9717. deleteAccessRestrictions: [
  9718. "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions"
  9719. ],
  9720. deleteAdminBranchProtection: [
  9721. "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins"
  9722. ],
  9723. deleteAnEnvironment: [
  9724. "DELETE /repos/{owner}/{repo}/environments/{environment_name}"
  9725. ],
  9726. deleteAutolink: ["DELETE /repos/{owner}/{repo}/autolinks/{autolink_id}"],
  9727. deleteBranchProtection: [
  9728. "DELETE /repos/{owner}/{repo}/branches/{branch}/protection"
  9729. ],
  9730. deleteCommitComment: ["DELETE /repos/{owner}/{repo}/comments/{comment_id}"],
  9731. deleteCommitSignatureProtection: [
  9732. "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures"
  9733. ],
  9734. deleteDeployKey: ["DELETE /repos/{owner}/{repo}/keys/{key_id}"],
  9735. deleteDeployment: [
  9736. "DELETE /repos/{owner}/{repo}/deployments/{deployment_id}"
  9737. ],
  9738. deleteDeploymentBranchPolicy: [
  9739. "DELETE /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}"
  9740. ],
  9741. deleteFile: ["DELETE /repos/{owner}/{repo}/contents/{path}"],
  9742. deleteInvitation: [
  9743. "DELETE /repos/{owner}/{repo}/invitations/{invitation_id}"
  9744. ],
  9745. deleteOrgRuleset: ["DELETE /orgs/{org}/rulesets/{ruleset_id}"],
  9746. deletePagesSite: ["DELETE /repos/{owner}/{repo}/pages"],
  9747. deletePullRequestReviewProtection: [
  9748. "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews"
  9749. ],
  9750. deleteRelease: ["DELETE /repos/{owner}/{repo}/releases/{release_id}"],
  9751. deleteReleaseAsset: [
  9752. "DELETE /repos/{owner}/{repo}/releases/assets/{asset_id}"
  9753. ],
  9754. deleteRepoRuleset: ["DELETE /repos/{owner}/{repo}/rulesets/{ruleset_id}"],
  9755. deleteTagProtection: [
  9756. "DELETE /repos/{owner}/{repo}/tags/protection/{tag_protection_id}"
  9757. ],
  9758. deleteWebhook: ["DELETE /repos/{owner}/{repo}/hooks/{hook_id}"],
  9759. disableAutomatedSecurityFixes: [
  9760. "DELETE /repos/{owner}/{repo}/automated-security-fixes"
  9761. ],
  9762. disableDeploymentProtectionRule: [
  9763. "DELETE /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/{protection_rule_id}"
  9764. ],
  9765. disablePrivateVulnerabilityReporting: [
  9766. "DELETE /repos/{owner}/{repo}/private-vulnerability-reporting"
  9767. ],
  9768. disableVulnerabilityAlerts: [
  9769. "DELETE /repos/{owner}/{repo}/vulnerability-alerts"
  9770. ],
  9771. downloadArchive: [
  9772. "GET /repos/{owner}/{repo}/zipball/{ref}",
  9773. {},
  9774. { renamed: ["repos", "downloadZipballArchive"] }
  9775. ],
  9776. downloadTarballArchive: ["GET /repos/{owner}/{repo}/tarball/{ref}"],
  9777. downloadZipballArchive: ["GET /repos/{owner}/{repo}/zipball/{ref}"],
  9778. enableAutomatedSecurityFixes: [
  9779. "PUT /repos/{owner}/{repo}/automated-security-fixes"
  9780. ],
  9781. enablePrivateVulnerabilityReporting: [
  9782. "PUT /repos/{owner}/{repo}/private-vulnerability-reporting"
  9783. ],
  9784. enableVulnerabilityAlerts: [
  9785. "PUT /repos/{owner}/{repo}/vulnerability-alerts"
  9786. ],
  9787. generateReleaseNotes: [
  9788. "POST /repos/{owner}/{repo}/releases/generate-notes"
  9789. ],
  9790. get: ["GET /repos/{owner}/{repo}"],
  9791. getAccessRestrictions: [
  9792. "GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions"
  9793. ],
  9794. getAdminBranchProtection: [
  9795. "GET /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins"
  9796. ],
  9797. getAllDeploymentProtectionRules: [
  9798. "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules"
  9799. ],
  9800. getAllEnvironments: ["GET /repos/{owner}/{repo}/environments"],
  9801. getAllStatusCheckContexts: [
  9802. "GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts"
  9803. ],
  9804. getAllTopics: ["GET /repos/{owner}/{repo}/topics"],
  9805. getAppsWithAccessToProtectedBranch: [
  9806. "GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps"
  9807. ],
  9808. getAutolink: ["GET /repos/{owner}/{repo}/autolinks/{autolink_id}"],
  9809. getBranch: ["GET /repos/{owner}/{repo}/branches/{branch}"],
  9810. getBranchProtection: [
  9811. "GET /repos/{owner}/{repo}/branches/{branch}/protection"
  9812. ],
  9813. getBranchRules: ["GET /repos/{owner}/{repo}/rules/branches/{branch}"],
  9814. getClones: ["GET /repos/{owner}/{repo}/traffic/clones"],
  9815. getCodeFrequencyStats: ["GET /repos/{owner}/{repo}/stats/code_frequency"],
  9816. getCollaboratorPermissionLevel: [
  9817. "GET /repos/{owner}/{repo}/collaborators/{username}/permission"
  9818. ],
  9819. getCombinedStatusForRef: ["GET /repos/{owner}/{repo}/commits/{ref}/status"],
  9820. getCommit: ["GET /repos/{owner}/{repo}/commits/{ref}"],
  9821. getCommitActivityStats: ["GET /repos/{owner}/{repo}/stats/commit_activity"],
  9822. getCommitComment: ["GET /repos/{owner}/{repo}/comments/{comment_id}"],
  9823. getCommitSignatureProtection: [
  9824. "GET /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures"
  9825. ],
  9826. getCommunityProfileMetrics: ["GET /repos/{owner}/{repo}/community/profile"],
  9827. getContent: ["GET /repos/{owner}/{repo}/contents/{path}"],
  9828. getContributorsStats: ["GET /repos/{owner}/{repo}/stats/contributors"],
  9829. getCustomDeploymentProtectionRule: [
  9830. "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/{protection_rule_id}"
  9831. ],
  9832. getCustomPropertiesValues: ["GET /repos/{owner}/{repo}/properties/values"],
  9833. getDeployKey: ["GET /repos/{owner}/{repo}/keys/{key_id}"],
  9834. getDeployment: ["GET /repos/{owner}/{repo}/deployments/{deployment_id}"],
  9835. getDeploymentBranchPolicy: [
  9836. "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}"
  9837. ],
  9838. getDeploymentStatus: [
  9839. "GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses/{status_id}"
  9840. ],
  9841. getEnvironment: [
  9842. "GET /repos/{owner}/{repo}/environments/{environment_name}"
  9843. ],
  9844. getLatestPagesBuild: ["GET /repos/{owner}/{repo}/pages/builds/latest"],
  9845. getLatestRelease: ["GET /repos/{owner}/{repo}/releases/latest"],
  9846. getOrgRuleSuite: ["GET /orgs/{org}/rulesets/rule-suites/{rule_suite_id}"],
  9847. getOrgRuleSuites: ["GET /orgs/{org}/rulesets/rule-suites"],
  9848. getOrgRuleset: ["GET /orgs/{org}/rulesets/{ruleset_id}"],
  9849. getOrgRulesets: ["GET /orgs/{org}/rulesets"],
  9850. getPages: ["GET /repos/{owner}/{repo}/pages"],
  9851. getPagesBuild: ["GET /repos/{owner}/{repo}/pages/builds/{build_id}"],
  9852. getPagesDeployment: [
  9853. "GET /repos/{owner}/{repo}/pages/deployments/{pages_deployment_id}"
  9854. ],
  9855. getPagesHealthCheck: ["GET /repos/{owner}/{repo}/pages/health"],
  9856. getParticipationStats: ["GET /repos/{owner}/{repo}/stats/participation"],
  9857. getPullRequestReviewProtection: [
  9858. "GET /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews"
  9859. ],
  9860. getPunchCardStats: ["GET /repos/{owner}/{repo}/stats/punch_card"],
  9861. getReadme: ["GET /repos/{owner}/{repo}/readme"],
  9862. getReadmeInDirectory: ["GET /repos/{owner}/{repo}/readme/{dir}"],
  9863. getRelease: ["GET /repos/{owner}/{repo}/releases/{release_id}"],
  9864. getReleaseAsset: ["GET /repos/{owner}/{repo}/releases/assets/{asset_id}"],
  9865. getReleaseByTag: ["GET /repos/{owner}/{repo}/releases/tags/{tag}"],
  9866. getRepoRuleSuite: [
  9867. "GET /repos/{owner}/{repo}/rulesets/rule-suites/{rule_suite_id}"
  9868. ],
  9869. getRepoRuleSuites: ["GET /repos/{owner}/{repo}/rulesets/rule-suites"],
  9870. getRepoRuleset: ["GET /repos/{owner}/{repo}/rulesets/{ruleset_id}"],
  9871. getRepoRulesets: ["GET /repos/{owner}/{repo}/rulesets"],
  9872. getStatusChecksProtection: [
  9873. "GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks"
  9874. ],
  9875. getTeamsWithAccessToProtectedBranch: [
  9876. "GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams"
  9877. ],
  9878. getTopPaths: ["GET /repos/{owner}/{repo}/traffic/popular/paths"],
  9879. getTopReferrers: ["GET /repos/{owner}/{repo}/traffic/popular/referrers"],
  9880. getUsersWithAccessToProtectedBranch: [
  9881. "GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users"
  9882. ],
  9883. getViews: ["GET /repos/{owner}/{repo}/traffic/views"],
  9884. getWebhook: ["GET /repos/{owner}/{repo}/hooks/{hook_id}"],
  9885. getWebhookConfigForRepo: [
  9886. "GET /repos/{owner}/{repo}/hooks/{hook_id}/config"
  9887. ],
  9888. getWebhookDelivery: [
  9889. "GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}"
  9890. ],
  9891. listActivities: ["GET /repos/{owner}/{repo}/activity"],
  9892. listAutolinks: ["GET /repos/{owner}/{repo}/autolinks"],
  9893. listBranches: ["GET /repos/{owner}/{repo}/branches"],
  9894. listBranchesForHeadCommit: [
  9895. "GET /repos/{owner}/{repo}/commits/{commit_sha}/branches-where-head"
  9896. ],
  9897. listCollaborators: ["GET /repos/{owner}/{repo}/collaborators"],
  9898. listCommentsForCommit: [
  9899. "GET /repos/{owner}/{repo}/commits/{commit_sha}/comments"
  9900. ],
  9901. listCommitCommentsForRepo: ["GET /repos/{owner}/{repo}/comments"],
  9902. listCommitStatusesForRef: [
  9903. "GET /repos/{owner}/{repo}/commits/{ref}/statuses"
  9904. ],
  9905. listCommits: ["GET /repos/{owner}/{repo}/commits"],
  9906. listContributors: ["GET /repos/{owner}/{repo}/contributors"],
  9907. listCustomDeploymentRuleIntegrations: [
  9908. "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/apps"
  9909. ],
  9910. listDeployKeys: ["GET /repos/{owner}/{repo}/keys"],
  9911. listDeploymentBranchPolicies: [
  9912. "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies"
  9913. ],
  9914. listDeploymentStatuses: [
  9915. "GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses"
  9916. ],
  9917. listDeployments: ["GET /repos/{owner}/{repo}/deployments"],
  9918. listForAuthenticatedUser: ["GET /user/repos"],
  9919. listForOrg: ["GET /orgs/{org}/repos"],
  9920. listForUser: ["GET /users/{username}/repos"],
  9921. listForks: ["GET /repos/{owner}/{repo}/forks"],
  9922. listInvitations: ["GET /repos/{owner}/{repo}/invitations"],
  9923. listInvitationsForAuthenticatedUser: ["GET /user/repository_invitations"],
  9924. listLanguages: ["GET /repos/{owner}/{repo}/languages"],
  9925. listPagesBuilds: ["GET /repos/{owner}/{repo}/pages/builds"],
  9926. listPublic: ["GET /repositories"],
  9927. listPullRequestsAssociatedWithCommit: [
  9928. "GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls"
  9929. ],
  9930. listReleaseAssets: [
  9931. "GET /repos/{owner}/{repo}/releases/{release_id}/assets"
  9932. ],
  9933. listReleases: ["GET /repos/{owner}/{repo}/releases"],
  9934. listTagProtection: ["GET /repos/{owner}/{repo}/tags/protection"],
  9935. listTags: ["GET /repos/{owner}/{repo}/tags"],
  9936. listTeams: ["GET /repos/{owner}/{repo}/teams"],
  9937. listWebhookDeliveries: [
  9938. "GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries"
  9939. ],
  9940. listWebhooks: ["GET /repos/{owner}/{repo}/hooks"],
  9941. merge: ["POST /repos/{owner}/{repo}/merges"],
  9942. mergeUpstream: ["POST /repos/{owner}/{repo}/merge-upstream"],
  9943. pingWebhook: ["POST /repos/{owner}/{repo}/hooks/{hook_id}/pings"],
  9944. redeliverWebhookDelivery: [
  9945. "POST /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}/attempts"
  9946. ],
  9947. removeAppAccessRestrictions: [
  9948. "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps",
  9949. {},
  9950. { mapToData: "apps" }
  9951. ],
  9952. removeCollaborator: [
  9953. "DELETE /repos/{owner}/{repo}/collaborators/{username}"
  9954. ],
  9955. removeStatusCheckContexts: [
  9956. "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts",
  9957. {},
  9958. { mapToData: "contexts" }
  9959. ],
  9960. removeStatusCheckProtection: [
  9961. "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks"
  9962. ],
  9963. removeTeamAccessRestrictions: [
  9964. "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams",
  9965. {},
  9966. { mapToData: "teams" }
  9967. ],
  9968. removeUserAccessRestrictions: [
  9969. "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users",
  9970. {},
  9971. { mapToData: "users" }
  9972. ],
  9973. renameBranch: ["POST /repos/{owner}/{repo}/branches/{branch}/rename"],
  9974. replaceAllTopics: ["PUT /repos/{owner}/{repo}/topics"],
  9975. requestPagesBuild: ["POST /repos/{owner}/{repo}/pages/builds"],
  9976. setAdminBranchProtection: [
  9977. "POST /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins"
  9978. ],
  9979. setAppAccessRestrictions: [
  9980. "PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps",
  9981. {},
  9982. { mapToData: "apps" }
  9983. ],
  9984. setStatusCheckContexts: [
  9985. "PUT /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts",
  9986. {},
  9987. { mapToData: "contexts" }
  9988. ],
  9989. setTeamAccessRestrictions: [
  9990. "PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams",
  9991. {},
  9992. { mapToData: "teams" }
  9993. ],
  9994. setUserAccessRestrictions: [
  9995. "PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users",
  9996. {},
  9997. { mapToData: "users" }
  9998. ],
  9999. testPushWebhook: ["POST /repos/{owner}/{repo}/hooks/{hook_id}/tests"],
  10000. transfer: ["POST /repos/{owner}/{repo}/transfer"],
  10001. update: ["PATCH /repos/{owner}/{repo}"],
  10002. updateBranchProtection: [
  10003. "PUT /repos/{owner}/{repo}/branches/{branch}/protection"
  10004. ],
  10005. updateCommitComment: ["PATCH /repos/{owner}/{repo}/comments/{comment_id}"],
  10006. updateDeploymentBranchPolicy: [
  10007. "PUT /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}"
  10008. ],
  10009. updateInformationAboutPagesSite: ["PUT /repos/{owner}/{repo}/pages"],
  10010. updateInvitation: [
  10011. "PATCH /repos/{owner}/{repo}/invitations/{invitation_id}"
  10012. ],
  10013. updateOrgRuleset: ["PUT /orgs/{org}/rulesets/{ruleset_id}"],
  10014. updatePullRequestReviewProtection: [
  10015. "PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews"
  10016. ],
  10017. updateRelease: ["PATCH /repos/{owner}/{repo}/releases/{release_id}"],
  10018. updateReleaseAsset: [
  10019. "PATCH /repos/{owner}/{repo}/releases/assets/{asset_id}"
  10020. ],
  10021. updateRepoRuleset: ["PUT /repos/{owner}/{repo}/rulesets/{ruleset_id}"],
  10022. updateStatusCheckPotection: [
  10023. "PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks",
  10024. {},
  10025. { renamed: ["repos", "updateStatusCheckProtection"] }
  10026. ],
  10027. updateStatusCheckProtection: [
  10028. "PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks"
  10029. ],
  10030. updateWebhook: ["PATCH /repos/{owner}/{repo}/hooks/{hook_id}"],
  10031. updateWebhookConfigForRepo: [
  10032. "PATCH /repos/{owner}/{repo}/hooks/{hook_id}/config"
  10033. ],
  10034. uploadReleaseAsset: [
  10035. "POST /repos/{owner}/{repo}/releases/{release_id}/assets{?name,label}",
  10036. { baseUrl: "https://uploads.github.com" }
  10037. ]
  10038. },
  10039. search: {
  10040. code: ["GET /search/code"],
  10041. commits: ["GET /search/commits"],
  10042. issuesAndPullRequests: ["GET /search/issues"],
  10043. labels: ["GET /search/labels"],
  10044. repos: ["GET /search/repositories"],
  10045. topics: ["GET /search/topics"],
  10046. users: ["GET /search/users"]
  10047. },
  10048. secretScanning: {
  10049. getAlert: [
  10050. "GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}"
  10051. ],
  10052. listAlertsForEnterprise: [
  10053. "GET /enterprises/{enterprise}/secret-scanning/alerts"
  10054. ],
  10055. listAlertsForOrg: ["GET /orgs/{org}/secret-scanning/alerts"],
  10056. listAlertsForRepo: ["GET /repos/{owner}/{repo}/secret-scanning/alerts"],
  10057. listLocationsForAlert: [
  10058. "GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations"
  10059. ],
  10060. updateAlert: [
  10061. "PATCH /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}"
  10062. ]
  10063. },
  10064. securityAdvisories: {
  10065. createFork: [
  10066. "POST /repos/{owner}/{repo}/security-advisories/{ghsa_id}/forks"
  10067. ],
  10068. createPrivateVulnerabilityReport: [
  10069. "POST /repos/{owner}/{repo}/security-advisories/reports"
  10070. ],
  10071. createRepositoryAdvisory: [
  10072. "POST /repos/{owner}/{repo}/security-advisories"
  10073. ],
  10074. createRepositoryAdvisoryCveRequest: [
  10075. "POST /repos/{owner}/{repo}/security-advisories/{ghsa_id}/cve"
  10076. ],
  10077. getGlobalAdvisory: ["GET /advisories/{ghsa_id}"],
  10078. getRepositoryAdvisory: [
  10079. "GET /repos/{owner}/{repo}/security-advisories/{ghsa_id}"
  10080. ],
  10081. listGlobalAdvisories: ["GET /advisories"],
  10082. listOrgRepositoryAdvisories: ["GET /orgs/{org}/security-advisories"],
  10083. listRepositoryAdvisories: ["GET /repos/{owner}/{repo}/security-advisories"],
  10084. updateRepositoryAdvisory: [
  10085. "PATCH /repos/{owner}/{repo}/security-advisories/{ghsa_id}"
  10086. ]
  10087. },
  10088. teams: {
  10089. addOrUpdateMembershipForUserInOrg: [
  10090. "PUT /orgs/{org}/teams/{team_slug}/memberships/{username}"
  10091. ],
  10092. addOrUpdateProjectPermissionsInOrg: [
  10093. "PUT /orgs/{org}/teams/{team_slug}/projects/{project_id}"
  10094. ],
  10095. addOrUpdateRepoPermissionsInOrg: [
  10096. "PUT /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"
  10097. ],
  10098. checkPermissionsForProjectInOrg: [
  10099. "GET /orgs/{org}/teams/{team_slug}/projects/{project_id}"
  10100. ],
  10101. checkPermissionsForRepoInOrg: [
  10102. "GET /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"
  10103. ],
  10104. create: ["POST /orgs/{org}/teams"],
  10105. createDiscussionCommentInOrg: [
  10106. "POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments"
  10107. ],
  10108. createDiscussionInOrg: ["POST /orgs/{org}/teams/{team_slug}/discussions"],
  10109. deleteDiscussionCommentInOrg: [
  10110. "DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}"
  10111. ],
  10112. deleteDiscussionInOrg: [
  10113. "DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}"
  10114. ],
  10115. deleteInOrg: ["DELETE /orgs/{org}/teams/{team_slug}"],
  10116. getByName: ["GET /orgs/{org}/teams/{team_slug}"],
  10117. getDiscussionCommentInOrg: [
  10118. "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}"
  10119. ],
  10120. getDiscussionInOrg: [
  10121. "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}"
  10122. ],
  10123. getMembershipForUserInOrg: [
  10124. "GET /orgs/{org}/teams/{team_slug}/memberships/{username}"
  10125. ],
  10126. list: ["GET /orgs/{org}/teams"],
  10127. listChildInOrg: ["GET /orgs/{org}/teams/{team_slug}/teams"],
  10128. listDiscussionCommentsInOrg: [
  10129. "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments"
  10130. ],
  10131. listDiscussionsInOrg: ["GET /orgs/{org}/teams/{team_slug}/discussions"],
  10132. listForAuthenticatedUser: ["GET /user/teams"],
  10133. listMembersInOrg: ["GET /orgs/{org}/teams/{team_slug}/members"],
  10134. listPendingInvitationsInOrg: [
  10135. "GET /orgs/{org}/teams/{team_slug}/invitations"
  10136. ],
  10137. listProjectsInOrg: ["GET /orgs/{org}/teams/{team_slug}/projects"],
  10138. listReposInOrg: ["GET /orgs/{org}/teams/{team_slug}/repos"],
  10139. removeMembershipForUserInOrg: [
  10140. "DELETE /orgs/{org}/teams/{team_slug}/memberships/{username}"
  10141. ],
  10142. removeProjectInOrg: [
  10143. "DELETE /orgs/{org}/teams/{team_slug}/projects/{project_id}"
  10144. ],
  10145. removeRepoInOrg: [
  10146. "DELETE /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"
  10147. ],
  10148. updateDiscussionCommentInOrg: [
  10149. "PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}"
  10150. ],
  10151. updateDiscussionInOrg: [
  10152. "PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}"
  10153. ],
  10154. updateInOrg: ["PATCH /orgs/{org}/teams/{team_slug}"]
  10155. },
  10156. users: {
  10157. addEmailForAuthenticated: [
  10158. "POST /user/emails",
  10159. {},
  10160. { renamed: ["users", "addEmailForAuthenticatedUser"] }
  10161. ],
  10162. addEmailForAuthenticatedUser: ["POST /user/emails"],
  10163. addSocialAccountForAuthenticatedUser: ["POST /user/social_accounts"],
  10164. block: ["PUT /user/blocks/{username}"],
  10165. checkBlocked: ["GET /user/blocks/{username}"],
  10166. checkFollowingForUser: ["GET /users/{username}/following/{target_user}"],
  10167. checkPersonIsFollowedByAuthenticated: ["GET /user/following/{username}"],
  10168. createGpgKeyForAuthenticated: [
  10169. "POST /user/gpg_keys",
  10170. {},
  10171. { renamed: ["users", "createGpgKeyForAuthenticatedUser"] }
  10172. ],
  10173. createGpgKeyForAuthenticatedUser: ["POST /user/gpg_keys"],
  10174. createPublicSshKeyForAuthenticated: [
  10175. "POST /user/keys",
  10176. {},
  10177. { renamed: ["users", "createPublicSshKeyForAuthenticatedUser"] }
  10178. ],
  10179. createPublicSshKeyForAuthenticatedUser: ["POST /user/keys"],
  10180. createSshSigningKeyForAuthenticatedUser: ["POST /user/ssh_signing_keys"],
  10181. deleteEmailForAuthenticated: [
  10182. "DELETE /user/emails",
  10183. {},
  10184. { renamed: ["users", "deleteEmailForAuthenticatedUser"] }
  10185. ],
  10186. deleteEmailForAuthenticatedUser: ["DELETE /user/emails"],
  10187. deleteGpgKeyForAuthenticated: [
  10188. "DELETE /user/gpg_keys/{gpg_key_id}",
  10189. {},
  10190. { renamed: ["users", "deleteGpgKeyForAuthenticatedUser"] }
  10191. ],
  10192. deleteGpgKeyForAuthenticatedUser: ["DELETE /user/gpg_keys/{gpg_key_id}"],
  10193. deletePublicSshKeyForAuthenticated: [
  10194. "DELETE /user/keys/{key_id}",
  10195. {},
  10196. { renamed: ["users", "deletePublicSshKeyForAuthenticatedUser"] }
  10197. ],
  10198. deletePublicSshKeyForAuthenticatedUser: ["DELETE /user/keys/{key_id}"],
  10199. deleteSocialAccountForAuthenticatedUser: ["DELETE /user/social_accounts"],
  10200. deleteSshSigningKeyForAuthenticatedUser: [
  10201. "DELETE /user/ssh_signing_keys/{ssh_signing_key_id}"
  10202. ],
  10203. follow: ["PUT /user/following/{username}"],
  10204. getAuthenticated: ["GET /user"],
  10205. getByUsername: ["GET /users/{username}"],
  10206. getContextForUser: ["GET /users/{username}/hovercard"],
  10207. getGpgKeyForAuthenticated: [
  10208. "GET /user/gpg_keys/{gpg_key_id}",
  10209. {},
  10210. { renamed: ["users", "getGpgKeyForAuthenticatedUser"] }
  10211. ],
  10212. getGpgKeyForAuthenticatedUser: ["GET /user/gpg_keys/{gpg_key_id}"],
  10213. getPublicSshKeyForAuthenticated: [
  10214. "GET /user/keys/{key_id}",
  10215. {},
  10216. { renamed: ["users", "getPublicSshKeyForAuthenticatedUser"] }
  10217. ],
  10218. getPublicSshKeyForAuthenticatedUser: ["GET /user/keys/{key_id}"],
  10219. getSshSigningKeyForAuthenticatedUser: [
  10220. "GET /user/ssh_signing_keys/{ssh_signing_key_id}"
  10221. ],
  10222. list: ["GET /users"],
  10223. listBlockedByAuthenticated: [
  10224. "GET /user/blocks",
  10225. {},
  10226. { renamed: ["users", "listBlockedByAuthenticatedUser"] }
  10227. ],
  10228. listBlockedByAuthenticatedUser: ["GET /user/blocks"],
  10229. listEmailsForAuthenticated: [
  10230. "GET /user/emails",
  10231. {},
  10232. { renamed: ["users", "listEmailsForAuthenticatedUser"] }
  10233. ],
  10234. listEmailsForAuthenticatedUser: ["GET /user/emails"],
  10235. listFollowedByAuthenticated: [
  10236. "GET /user/following",
  10237. {},
  10238. { renamed: ["users", "listFollowedByAuthenticatedUser"] }
  10239. ],
  10240. listFollowedByAuthenticatedUser: ["GET /user/following"],
  10241. listFollowersForAuthenticatedUser: ["GET /user/followers"],
  10242. listFollowersForUser: ["GET /users/{username}/followers"],
  10243. listFollowingForUser: ["GET /users/{username}/following"],
  10244. listGpgKeysForAuthenticated: [
  10245. "GET /user/gpg_keys",
  10246. {},
  10247. { renamed: ["users", "listGpgKeysForAuthenticatedUser"] }
  10248. ],
  10249. listGpgKeysForAuthenticatedUser: ["GET /user/gpg_keys"],
  10250. listGpgKeysForUser: ["GET /users/{username}/gpg_keys"],
  10251. listPublicEmailsForAuthenticated: [
  10252. "GET /user/public_emails",
  10253. {},
  10254. { renamed: ["users", "listPublicEmailsForAuthenticatedUser"] }
  10255. ],
  10256. listPublicEmailsForAuthenticatedUser: ["GET /user/public_emails"],
  10257. listPublicKeysForUser: ["GET /users/{username}/keys"],
  10258. listPublicSshKeysForAuthenticated: [
  10259. "GET /user/keys",
  10260. {},
  10261. { renamed: ["users", "listPublicSshKeysForAuthenticatedUser"] }
  10262. ],
  10263. listPublicSshKeysForAuthenticatedUser: ["GET /user/keys"],
  10264. listSocialAccountsForAuthenticatedUser: ["GET /user/social_accounts"],
  10265. listSocialAccountsForUser: ["GET /users/{username}/social_accounts"],
  10266. listSshSigningKeysForAuthenticatedUser: ["GET /user/ssh_signing_keys"],
  10267. listSshSigningKeysForUser: ["GET /users/{username}/ssh_signing_keys"],
  10268. setPrimaryEmailVisibilityForAuthenticated: [
  10269. "PATCH /user/email/visibility",
  10270. {},
  10271. { renamed: ["users", "setPrimaryEmailVisibilityForAuthenticatedUser"] }
  10272. ],
  10273. setPrimaryEmailVisibilityForAuthenticatedUser: [
  10274. "PATCH /user/email/visibility"
  10275. ],
  10276. unblock: ["DELETE /user/blocks/{username}"],
  10277. unfollow: ["DELETE /user/following/{username}"],
  10278. updateAuthenticated: ["PATCH /user"]
  10279. }
  10280. };
  10281. var endpoints_default = Endpoints;
  10282. // pkg/dist-src/endpoints-to-methods.js
  10283. var endpointMethodsMap = /* @__PURE__ */ new Map();
  10284. for (const [scope, endpoints] of Object.entries(endpoints_default)) {
  10285. for (const [methodName, endpoint] of Object.entries(endpoints)) {
  10286. const [route, defaults, decorations] = endpoint;
  10287. const [method, url] = route.split(/ /);
  10288. const endpointDefaults = Object.assign(
  10289. {
  10290. method,
  10291. url
  10292. },
  10293. defaults
  10294. );
  10295. if (!endpointMethodsMap.has(scope)) {
  10296. endpointMethodsMap.set(scope, /* @__PURE__ */ new Map());
  10297. }
  10298. endpointMethodsMap.get(scope).set(methodName, {
  10299. scope,
  10300. methodName,
  10301. endpointDefaults,
  10302. decorations
  10303. });
  10304. }
  10305. }
  10306. var handler = {
  10307. has({ scope }, methodName) {
  10308. return endpointMethodsMap.get(scope).has(methodName);
  10309. },
  10310. getOwnPropertyDescriptor(target, methodName) {
  10311. return {
  10312. value: this.get(target, methodName),
  10313. // ensures method is in the cache
  10314. configurable: true,
  10315. writable: true,
  10316. enumerable: true
  10317. };
  10318. },
  10319. defineProperty(target, methodName, descriptor) {
  10320. Object.defineProperty(target.cache, methodName, descriptor);
  10321. return true;
  10322. },
  10323. deleteProperty(target, methodName) {
  10324. delete target.cache[methodName];
  10325. return true;
  10326. },
  10327. ownKeys({ scope }) {
  10328. return [...endpointMethodsMap.get(scope).keys()];
  10329. },
  10330. set(target, methodName, value) {
  10331. return target.cache[methodName] = value;
  10332. },
  10333. get({ octokit, scope, cache }, methodName) {
  10334. if (cache[methodName]) {
  10335. return cache[methodName];
  10336. }
  10337. const method = endpointMethodsMap.get(scope).get(methodName);
  10338. if (!method) {
  10339. return void 0;
  10340. }
  10341. const { endpointDefaults, decorations } = method;
  10342. if (decorations) {
  10343. cache[methodName] = decorate(
  10344. octokit,
  10345. scope,
  10346. methodName,
  10347. endpointDefaults,
  10348. decorations
  10349. );
  10350. } else {
  10351. cache[methodName] = octokit.request.defaults(endpointDefaults);
  10352. }
  10353. return cache[methodName];
  10354. }
  10355. };
  10356. function endpointsToMethods(octokit) {
  10357. const newMethods = {};
  10358. for (const scope of endpointMethodsMap.keys()) {
  10359. newMethods[scope] = new Proxy({ octokit, scope, cache: {} }, handler);
  10360. }
  10361. return newMethods;
  10362. }
  10363. function decorate(octokit, scope, methodName, defaults, decorations) {
  10364. const requestWithDefaults = octokit.request.defaults(defaults);
  10365. function withDecorations(...args) {
  10366. let options = requestWithDefaults.endpoint.merge(...args);
  10367. if (decorations.mapToData) {
  10368. options = Object.assign({}, options, {
  10369. data: options[decorations.mapToData],
  10370. [decorations.mapToData]: void 0
  10371. });
  10372. return requestWithDefaults(options);
  10373. }
  10374. if (decorations.renamed) {
  10375. const [newScope, newMethodName] = decorations.renamed;
  10376. octokit.log.warn(
  10377. `octokit.${scope}.${methodName}() has been renamed to octokit.${newScope}.${newMethodName}()`
  10378. );
  10379. }
  10380. if (decorations.deprecated) {
  10381. octokit.log.warn(decorations.deprecated);
  10382. }
  10383. if (decorations.renamedParameters) {
  10384. const options2 = requestWithDefaults.endpoint.merge(...args);
  10385. for (const [name, alias] of Object.entries(
  10386. decorations.renamedParameters
  10387. )) {
  10388. if (name in options2) {
  10389. octokit.log.warn(
  10390. `"${name}" parameter is deprecated for "octokit.${scope}.${methodName}()". Use "${alias}" instead`
  10391. );
  10392. if (!(alias in options2)) {
  10393. options2[alias] = options2[name];
  10394. }
  10395. delete options2[name];
  10396. }
  10397. }
  10398. return requestWithDefaults(options2);
  10399. }
  10400. return requestWithDefaults(...args);
  10401. }
  10402. return Object.assign(withDecorations, requestWithDefaults);
  10403. }
  10404. // pkg/dist-src/index.js
  10405. function restEndpointMethods(octokit) {
  10406. const api = endpointsToMethods(octokit);
  10407. return {
  10408. rest: api
  10409. };
  10410. }
  10411. restEndpointMethods.VERSION = VERSION;
  10412. function legacyRestEndpointMethods(octokit) {
  10413. const api = endpointsToMethods(octokit);
  10414. return {
  10415. ...api,
  10416. rest: api
  10417. };
  10418. }
  10419. legacyRestEndpointMethods.VERSION = VERSION;
  10420. // Annotate the CommonJS export names for ESM import in node:
  10421. 0 && (0);
  10422. /***/ }),
  10423. /***/ 537:
  10424. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  10425. "use strict";
  10426. var __create = Object.create;
  10427. var __defProp = Object.defineProperty;
  10428. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  10429. var __getOwnPropNames = Object.getOwnPropertyNames;
  10430. var __getProtoOf = Object.getPrototypeOf;
  10431. var __hasOwnProp = Object.prototype.hasOwnProperty;
  10432. var __export = (target, all) => {
  10433. for (var name in all)
  10434. __defProp(target, name, { get: all[name], enumerable: true });
  10435. };
  10436. var __copyProps = (to, from, except, desc) => {
  10437. if (from && typeof from === "object" || typeof from === "function") {
  10438. for (let key of __getOwnPropNames(from))
  10439. if (!__hasOwnProp.call(to, key) && key !== except)
  10440. __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  10441. }
  10442. return to;
  10443. };
  10444. var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
  10445. // If the importer is in node compatibility mode or this is not an ESM
  10446. // file that has been converted to a CommonJS file using a Babel-
  10447. // compatible transform (i.e. "__esModule" has not been set), then set
  10448. // "default" to the CommonJS "module.exports" for node compatibility.
  10449. isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
  10450. mod
  10451. ));
  10452. var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
  10453. // pkg/dist-src/index.js
  10454. var dist_src_exports = {};
  10455. __export(dist_src_exports, {
  10456. RequestError: () => RequestError
  10457. });
  10458. module.exports = __toCommonJS(dist_src_exports);
  10459. var import_deprecation = __nccwpck_require__(8932);
  10460. var import_once = __toESM(__nccwpck_require__(1223));
  10461. var logOnceCode = (0, import_once.default)((deprecation) => console.warn(deprecation));
  10462. var logOnceHeaders = (0, import_once.default)((deprecation) => console.warn(deprecation));
  10463. var RequestError = class extends Error {
  10464. constructor(message, statusCode, options) {
  10465. super(message);
  10466. if (Error.captureStackTrace) {
  10467. Error.captureStackTrace(this, this.constructor);
  10468. }
  10469. this.name = "HttpError";
  10470. this.status = statusCode;
  10471. let headers;
  10472. if ("headers" in options && typeof options.headers !== "undefined") {
  10473. headers = options.headers;
  10474. }
  10475. if ("response" in options) {
  10476. this.response = options.response;
  10477. headers = options.response.headers;
  10478. }
  10479. const requestCopy = Object.assign({}, options.request);
  10480. if (options.request.headers.authorization) {
  10481. requestCopy.headers = Object.assign({}, options.request.headers, {
  10482. authorization: options.request.headers.authorization.replace(
  10483. / .*$/,
  10484. " [REDACTED]"
  10485. )
  10486. });
  10487. }
  10488. requestCopy.url = requestCopy.url.replace(/\bclient_secret=\w+/g, "client_secret=[REDACTED]").replace(/\baccess_token=\w+/g, "access_token=[REDACTED]");
  10489. this.request = requestCopy;
  10490. Object.defineProperty(this, "code", {
  10491. get() {
  10492. logOnceCode(
  10493. new import_deprecation.Deprecation(
  10494. "[@octokit/request-error] `error.code` is deprecated, use `error.status`."
  10495. )
  10496. );
  10497. return statusCode;
  10498. }
  10499. });
  10500. Object.defineProperty(this, "headers", {
  10501. get() {
  10502. logOnceHeaders(
  10503. new import_deprecation.Deprecation(
  10504. "[@octokit/request-error] `error.headers` is deprecated, use `error.response.headers`."
  10505. )
  10506. );
  10507. return headers || {};
  10508. }
  10509. });
  10510. }
  10511. };
  10512. // Annotate the CommonJS export names for ESM import in node:
  10513. 0 && (0);
  10514. /***/ }),
  10515. /***/ 6234:
  10516. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  10517. "use strict";
  10518. var __defProp = Object.defineProperty;
  10519. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  10520. var __getOwnPropNames = Object.getOwnPropertyNames;
  10521. var __hasOwnProp = Object.prototype.hasOwnProperty;
  10522. var __export = (target, all) => {
  10523. for (var name in all)
  10524. __defProp(target, name, { get: all[name], enumerable: true });
  10525. };
  10526. var __copyProps = (to, from, except, desc) => {
  10527. if (from && typeof from === "object" || typeof from === "function") {
  10528. for (let key of __getOwnPropNames(from))
  10529. if (!__hasOwnProp.call(to, key) && key !== except)
  10530. __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  10531. }
  10532. return to;
  10533. };
  10534. var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
  10535. // pkg/dist-src/index.js
  10536. var dist_src_exports = {};
  10537. __export(dist_src_exports, {
  10538. request: () => request
  10539. });
  10540. module.exports = __toCommonJS(dist_src_exports);
  10541. var import_endpoint = __nccwpck_require__(9440);
  10542. var import_universal_user_agent = __nccwpck_require__(5030);
  10543. // pkg/dist-src/version.js
  10544. var VERSION = "8.4.0";
  10545. // pkg/dist-src/is-plain-object.js
  10546. function isPlainObject(value) {
  10547. if (typeof value !== "object" || value === null)
  10548. return false;
  10549. if (Object.prototype.toString.call(value) !== "[object Object]")
  10550. return false;
  10551. const proto = Object.getPrototypeOf(value);
  10552. if (proto === null)
  10553. return true;
  10554. const Ctor = Object.prototype.hasOwnProperty.call(proto, "constructor") && proto.constructor;
  10555. return typeof Ctor === "function" && Ctor instanceof Ctor && Function.prototype.call(Ctor) === Function.prototype.call(value);
  10556. }
  10557. // pkg/dist-src/fetch-wrapper.js
  10558. var import_request_error = __nccwpck_require__(537);
  10559. // pkg/dist-src/get-buffer-response.js
  10560. function getBufferResponse(response) {
  10561. return response.arrayBuffer();
  10562. }
  10563. // pkg/dist-src/fetch-wrapper.js
  10564. function fetchWrapper(requestOptions) {
  10565. var _a, _b, _c, _d;
  10566. const log = requestOptions.request && requestOptions.request.log ? requestOptions.request.log : console;
  10567. const parseSuccessResponseBody = ((_a = requestOptions.request) == null ? void 0 : _a.parseSuccessResponseBody) !== false;
  10568. if (isPlainObject(requestOptions.body) || Array.isArray(requestOptions.body)) {
  10569. requestOptions.body = JSON.stringify(requestOptions.body);
  10570. }
  10571. let headers = {};
  10572. let status;
  10573. let url;
  10574. let { fetch } = globalThis;
  10575. if ((_b = requestOptions.request) == null ? void 0 : _b.fetch) {
  10576. fetch = requestOptions.request.fetch;
  10577. }
  10578. if (!fetch) {
  10579. throw new Error(
  10580. "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"
  10581. );
  10582. }
  10583. return fetch(requestOptions.url, {
  10584. method: requestOptions.method,
  10585. body: requestOptions.body,
  10586. redirect: (_c = requestOptions.request) == null ? void 0 : _c.redirect,
  10587. headers: requestOptions.headers,
  10588. signal: (_d = requestOptions.request) == null ? void 0 : _d.signal,
  10589. // duplex must be set if request.body is ReadableStream or Async Iterables.
  10590. // See https://fetch.spec.whatwg.org/#dom-requestinit-duplex.
  10591. ...requestOptions.body && { duplex: "half" }
  10592. }).then(async (response) => {
  10593. url = response.url;
  10594. status = response.status;
  10595. for (const keyAndValue of response.headers) {
  10596. headers[keyAndValue[0]] = keyAndValue[1];
  10597. }
  10598. if ("deprecation" in headers) {
  10599. const matches = headers.link && headers.link.match(/<([^>]+)>; rel="deprecation"/);
  10600. const deprecationLink = matches && matches.pop();
  10601. log.warn(
  10602. `[@octokit/request] "${requestOptions.method} ${requestOptions.url}" is deprecated. It is scheduled to be removed on ${headers.sunset}${deprecationLink ? `. See ${deprecationLink}` : ""}`
  10603. );
  10604. }
  10605. if (status === 204 || status === 205) {
  10606. return;
  10607. }
  10608. if (requestOptions.method === "HEAD") {
  10609. if (status < 400) {
  10610. return;
  10611. }
  10612. throw new import_request_error.RequestError(response.statusText, status, {
  10613. response: {
  10614. url,
  10615. status,
  10616. headers,
  10617. data: void 0
  10618. },
  10619. request: requestOptions
  10620. });
  10621. }
  10622. if (status === 304) {
  10623. throw new import_request_error.RequestError("Not modified", status, {
  10624. response: {
  10625. url,
  10626. status,
  10627. headers,
  10628. data: await getResponseData(response)
  10629. },
  10630. request: requestOptions
  10631. });
  10632. }
  10633. if (status >= 400) {
  10634. const data = await getResponseData(response);
  10635. const error = new import_request_error.RequestError(toErrorMessage(data), status, {
  10636. response: {
  10637. url,
  10638. status,
  10639. headers,
  10640. data
  10641. },
  10642. request: requestOptions
  10643. });
  10644. throw error;
  10645. }
  10646. return parseSuccessResponseBody ? await getResponseData(response) : response.body;
  10647. }).then((data) => {
  10648. return {
  10649. status,
  10650. url,
  10651. headers,
  10652. data
  10653. };
  10654. }).catch((error) => {
  10655. if (error instanceof import_request_error.RequestError)
  10656. throw error;
  10657. else if (error.name === "AbortError")
  10658. throw error;
  10659. let message = error.message;
  10660. if (error.name === "TypeError" && "cause" in error) {
  10661. if (error.cause instanceof Error) {
  10662. message = error.cause.message;
  10663. } else if (typeof error.cause === "string") {
  10664. message = error.cause;
  10665. }
  10666. }
  10667. throw new import_request_error.RequestError(message, 500, {
  10668. request: requestOptions
  10669. });
  10670. });
  10671. }
  10672. async function getResponseData(response) {
  10673. const contentType = response.headers.get("content-type");
  10674. if (/application\/json/.test(contentType)) {
  10675. return response.json().catch(() => response.text()).catch(() => "");
  10676. }
  10677. if (!contentType || /^text\/|charset=utf-8$/.test(contentType)) {
  10678. return response.text();
  10679. }
  10680. return getBufferResponse(response);
  10681. }
  10682. function toErrorMessage(data) {
  10683. if (typeof data === "string")
  10684. return data;
  10685. let suffix;
  10686. if ("documentation_url" in data) {
  10687. suffix = ` - ${data.documentation_url}`;
  10688. } else {
  10689. suffix = "";
  10690. }
  10691. if ("message" in data) {
  10692. if (Array.isArray(data.errors)) {
  10693. return `${data.message}: ${data.errors.map(JSON.stringify).join(", ")}${suffix}`;
  10694. }
  10695. return `${data.message}${suffix}`;
  10696. }
  10697. return `Unknown error: ${JSON.stringify(data)}`;
  10698. }
  10699. // pkg/dist-src/with-defaults.js
  10700. function withDefaults(oldEndpoint, newDefaults) {
  10701. const endpoint2 = oldEndpoint.defaults(newDefaults);
  10702. const newApi = function(route, parameters) {
  10703. const endpointOptions = endpoint2.merge(route, parameters);
  10704. if (!endpointOptions.request || !endpointOptions.request.hook) {
  10705. return fetchWrapper(endpoint2.parse(endpointOptions));
  10706. }
  10707. const request2 = (route2, parameters2) => {
  10708. return fetchWrapper(
  10709. endpoint2.parse(endpoint2.merge(route2, parameters2))
  10710. );
  10711. };
  10712. Object.assign(request2, {
  10713. endpoint: endpoint2,
  10714. defaults: withDefaults.bind(null, endpoint2)
  10715. });
  10716. return endpointOptions.request.hook(request2, endpointOptions);
  10717. };
  10718. return Object.assign(newApi, {
  10719. endpoint: endpoint2,
  10720. defaults: withDefaults.bind(null, endpoint2)
  10721. });
  10722. }
  10723. // pkg/dist-src/index.js
  10724. var request = withDefaults(import_endpoint.endpoint, {
  10725. headers: {
  10726. "user-agent": `octokit-request.js/${VERSION} ${(0, import_universal_user_agent.getUserAgent)()}`
  10727. }
  10728. });
  10729. // Annotate the CommonJS export names for ESM import in node:
  10730. 0 && (0);
  10731. /***/ }),
  10732. /***/ 3682:
  10733. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  10734. var register = __nccwpck_require__(4670);
  10735. var addHook = __nccwpck_require__(5549);
  10736. var removeHook = __nccwpck_require__(6819);
  10737. // bind with array of arguments: https://stackoverflow.com/a/21792913
  10738. var bind = Function.bind;
  10739. var bindable = bind.bind(bind);
  10740. function bindApi(hook, state, name) {
  10741. var removeHookRef = bindable(removeHook, null).apply(
  10742. null,
  10743. name ? [state, name] : [state]
  10744. );
  10745. hook.api = { remove: removeHookRef };
  10746. hook.remove = removeHookRef;
  10747. ["before", "error", "after", "wrap"].forEach(function (kind) {
  10748. var args = name ? [state, kind, name] : [state, kind];
  10749. hook[kind] = hook.api[kind] = bindable(addHook, null).apply(null, args);
  10750. });
  10751. }
  10752. function HookSingular() {
  10753. var singularHookName = "h";
  10754. var singularHookState = {
  10755. registry: {},
  10756. };
  10757. var singularHook = register.bind(null, singularHookState, singularHookName);
  10758. bindApi(singularHook, singularHookState, singularHookName);
  10759. return singularHook;
  10760. }
  10761. function HookCollection() {
  10762. var state = {
  10763. registry: {},
  10764. };
  10765. var hook = register.bind(null, state);
  10766. bindApi(hook, state);
  10767. return hook;
  10768. }
  10769. var collectionHookDeprecationMessageDisplayed = false;
  10770. function Hook() {
  10771. if (!collectionHookDeprecationMessageDisplayed) {
  10772. console.warn(
  10773. '[before-after-hook]: "Hook()" repurposing warning, use "Hook.Collection()". Read more: https://git.io/upgrade-before-after-hook-to-1.4'
  10774. );
  10775. collectionHookDeprecationMessageDisplayed = true;
  10776. }
  10777. return HookCollection();
  10778. }
  10779. Hook.Singular = HookSingular.bind();
  10780. Hook.Collection = HookCollection.bind();
  10781. module.exports = Hook;
  10782. // expose constructors as a named property for TypeScript
  10783. module.exports.Hook = Hook;
  10784. module.exports.Singular = Hook.Singular;
  10785. module.exports.Collection = Hook.Collection;
  10786. /***/ }),
  10787. /***/ 5549:
  10788. /***/ ((module) => {
  10789. module.exports = addHook;
  10790. function addHook(state, kind, name, hook) {
  10791. var orig = hook;
  10792. if (!state.registry[name]) {
  10793. state.registry[name] = [];
  10794. }
  10795. if (kind === "before") {
  10796. hook = function (method, options) {
  10797. return Promise.resolve()
  10798. .then(orig.bind(null, options))
  10799. .then(method.bind(null, options));
  10800. };
  10801. }
  10802. if (kind === "after") {
  10803. hook = function (method, options) {
  10804. var result;
  10805. return Promise.resolve()
  10806. .then(method.bind(null, options))
  10807. .then(function (result_) {
  10808. result = result_;
  10809. return orig(result, options);
  10810. })
  10811. .then(function () {
  10812. return result;
  10813. });
  10814. };
  10815. }
  10816. if (kind === "error") {
  10817. hook = function (method, options) {
  10818. return Promise.resolve()
  10819. .then(method.bind(null, options))
  10820. .catch(function (error) {
  10821. return orig(error, options);
  10822. });
  10823. };
  10824. }
  10825. state.registry[name].push({
  10826. hook: hook,
  10827. orig: orig,
  10828. });
  10829. }
  10830. /***/ }),
  10831. /***/ 4670:
  10832. /***/ ((module) => {
  10833. module.exports = register;
  10834. function register(state, name, method, options) {
  10835. if (typeof method !== "function") {
  10836. throw new Error("method for before hook must be a function");
  10837. }
  10838. if (!options) {
  10839. options = {};
  10840. }
  10841. if (Array.isArray(name)) {
  10842. return name.reverse().reduce(function (callback, name) {
  10843. return register.bind(null, state, name, callback, options);
  10844. }, method)();
  10845. }
  10846. return Promise.resolve().then(function () {
  10847. if (!state.registry[name]) {
  10848. return method(options);
  10849. }
  10850. return state.registry[name].reduce(function (method, registered) {
  10851. return registered.hook.bind(null, method, options);
  10852. }, method)();
  10853. });
  10854. }
  10855. /***/ }),
  10856. /***/ 6819:
  10857. /***/ ((module) => {
  10858. module.exports = removeHook;
  10859. function removeHook(state, name, method) {
  10860. if (!state.registry[name]) {
  10861. return;
  10862. }
  10863. var index = state.registry[name]
  10864. .map(function (registered) {
  10865. return registered.orig;
  10866. })
  10867. .indexOf(method);
  10868. if (index === -1) {
  10869. return;
  10870. }
  10871. state.registry[name].splice(index, 1);
  10872. }
  10873. /***/ }),
  10874. /***/ 8932:
  10875. /***/ ((__unused_webpack_module, exports) => {
  10876. "use strict";
  10877. Object.defineProperty(exports, "__esModule", ({ value: true }));
  10878. class Deprecation extends Error {
  10879. constructor(message) {
  10880. super(message); // Maintains proper stack trace (only available on V8)
  10881. /* istanbul ignore next */
  10882. if (Error.captureStackTrace) {
  10883. Error.captureStackTrace(this, this.constructor);
  10884. }
  10885. this.name = 'Deprecation';
  10886. }
  10887. }
  10888. exports.Deprecation = Deprecation;
  10889. /***/ }),
  10890. /***/ 1223:
  10891. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  10892. var wrappy = __nccwpck_require__(2940)
  10893. module.exports = wrappy(once)
  10894. module.exports.strict = wrappy(onceStrict)
  10895. once.proto = once(function () {
  10896. Object.defineProperty(Function.prototype, 'once', {
  10897. value: function () {
  10898. return once(this)
  10899. },
  10900. configurable: true
  10901. })
  10902. Object.defineProperty(Function.prototype, 'onceStrict', {
  10903. value: function () {
  10904. return onceStrict(this)
  10905. },
  10906. configurable: true
  10907. })
  10908. })
  10909. function once (fn) {
  10910. var f = function () {
  10911. if (f.called) return f.value
  10912. f.called = true
  10913. return f.value = fn.apply(this, arguments)
  10914. }
  10915. f.called = false
  10916. return f
  10917. }
  10918. function onceStrict (fn) {
  10919. var f = function () {
  10920. if (f.called)
  10921. throw new Error(f.onceError)
  10922. f.called = true
  10923. return f.value = fn.apply(this, arguments)
  10924. }
  10925. var name = fn.name || 'Function wrapped with `once`'
  10926. f.onceError = name + " shouldn't be called more than once"
  10927. f.called = false
  10928. return f
  10929. }
  10930. /***/ }),
  10931. /***/ 5911:
  10932. /***/ ((module, exports) => {
  10933. exports = module.exports = SemVer
  10934. var debug
  10935. /* istanbul ignore next */
  10936. if (typeof process === 'object' &&
  10937. process.env &&
  10938. process.env.NODE_DEBUG &&
  10939. /\bsemver\b/i.test(process.env.NODE_DEBUG)) {
  10940. debug = function () {
  10941. var args = Array.prototype.slice.call(arguments, 0)
  10942. args.unshift('SEMVER')
  10943. console.log.apply(console, args)
  10944. }
  10945. } else {
  10946. debug = function () {}
  10947. }
  10948. // Note: this is the semver.org version of the spec that it implements
  10949. // Not necessarily the package version of this code.
  10950. exports.SEMVER_SPEC_VERSION = '2.0.0'
  10951. var MAX_LENGTH = 256
  10952. var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER ||
  10953. /* istanbul ignore next */ 9007199254740991
  10954. // Max safe segment length for coercion.
  10955. var MAX_SAFE_COMPONENT_LENGTH = 16
  10956. var MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6
  10957. // The actual regexps go on exports.re
  10958. var re = exports.re = []
  10959. var safeRe = exports.safeRe = []
  10960. var src = exports.src = []
  10961. var t = exports.tokens = {}
  10962. var R = 0
  10963. function tok (n) {
  10964. t[n] = R++
  10965. }
  10966. var LETTERDASHNUMBER = '[a-zA-Z0-9-]'
  10967. // Replace some greedy regex tokens to prevent regex dos issues. These regex are
  10968. // used internally via the safeRe object since all inputs in this library get
  10969. // normalized first to trim and collapse all extra whitespace. The original
  10970. // regexes are exported for userland consumption and lower level usage. A
  10971. // future breaking change could export the safer regex only with a note that
  10972. // all input should have extra whitespace removed.
  10973. var safeRegexReplacements = [
  10974. ['\\s', 1],
  10975. ['\\d', MAX_LENGTH],
  10976. [LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH],
  10977. ]
  10978. function makeSafeRe (value) {
  10979. for (var i = 0; i < safeRegexReplacements.length; i++) {
  10980. var token = safeRegexReplacements[i][0]
  10981. var max = safeRegexReplacements[i][1]
  10982. value = value
  10983. .split(token + '*').join(token + '{0,' + max + '}')
  10984. .split(token + '+').join(token + '{1,' + max + '}')
  10985. }
  10986. return value
  10987. }
  10988. // The following Regular Expressions can be used for tokenizing,
  10989. // validating, and parsing SemVer version strings.
  10990. // ## Numeric Identifier
  10991. // A single `0`, or a non-zero digit followed by zero or more digits.
  10992. tok('NUMERICIDENTIFIER')
  10993. src[t.NUMERICIDENTIFIER] = '0|[1-9]\\d*'
  10994. tok('NUMERICIDENTIFIERLOOSE')
  10995. src[t.NUMERICIDENTIFIERLOOSE] = '\\d+'
  10996. // ## Non-numeric Identifier
  10997. // Zero or more digits, followed by a letter or hyphen, and then zero or
  10998. // more letters, digits, or hyphens.
  10999. tok('NONNUMERICIDENTIFIER')
  11000. src[t.NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-]' + LETTERDASHNUMBER + '*'
  11001. // ## Main Version
  11002. // Three dot-separated numeric identifiers.
  11003. tok('MAINVERSION')
  11004. src[t.MAINVERSION] = '(' + src[t.NUMERICIDENTIFIER] + ')\\.' +
  11005. '(' + src[t.NUMERICIDENTIFIER] + ')\\.' +
  11006. '(' + src[t.NUMERICIDENTIFIER] + ')'
  11007. tok('MAINVERSIONLOOSE')
  11008. src[t.MAINVERSIONLOOSE] = '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')\\.' +
  11009. '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')\\.' +
  11010. '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')'
  11011. // ## Pre-release Version Identifier
  11012. // A numeric identifier, or a non-numeric identifier.
  11013. tok('PRERELEASEIDENTIFIER')
  11014. src[t.PRERELEASEIDENTIFIER] = '(?:' + src[t.NUMERICIDENTIFIER] +
  11015. '|' + src[t.NONNUMERICIDENTIFIER] + ')'
  11016. tok('PRERELEASEIDENTIFIERLOOSE')
  11017. src[t.PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[t.NUMERICIDENTIFIERLOOSE] +
  11018. '|' + src[t.NONNUMERICIDENTIFIER] + ')'
  11019. // ## Pre-release Version
  11020. // Hyphen, followed by one or more dot-separated pre-release version
  11021. // identifiers.
  11022. tok('PRERELEASE')
  11023. src[t.PRERELEASE] = '(?:-(' + src[t.PRERELEASEIDENTIFIER] +
  11024. '(?:\\.' + src[t.PRERELEASEIDENTIFIER] + ')*))'
  11025. tok('PRERELEASELOOSE')
  11026. src[t.PRERELEASELOOSE] = '(?:-?(' + src[t.PRERELEASEIDENTIFIERLOOSE] +
  11027. '(?:\\.' + src[t.PRERELEASEIDENTIFIERLOOSE] + ')*))'
  11028. // ## Build Metadata Identifier
  11029. // Any combination of digits, letters, or hyphens.
  11030. tok('BUILDIDENTIFIER')
  11031. src[t.BUILDIDENTIFIER] = LETTERDASHNUMBER + '+'
  11032. // ## Build Metadata
  11033. // Plus sign, followed by one or more period-separated build metadata
  11034. // identifiers.
  11035. tok('BUILD')
  11036. src[t.BUILD] = '(?:\\+(' + src[t.BUILDIDENTIFIER] +
  11037. '(?:\\.' + src[t.BUILDIDENTIFIER] + ')*))'
  11038. // ## Full Version String
  11039. // A main version, followed optionally by a pre-release version and
  11040. // build metadata.
  11041. // Note that the only major, minor, patch, and pre-release sections of
  11042. // the version string are capturing groups. The build metadata is not a
  11043. // capturing group, because it should not ever be used in version
  11044. // comparison.
  11045. tok('FULL')
  11046. tok('FULLPLAIN')
  11047. src[t.FULLPLAIN] = 'v?' + src[t.MAINVERSION] +
  11048. src[t.PRERELEASE] + '?' +
  11049. src[t.BUILD] + '?'
  11050. src[t.FULL] = '^' + src[t.FULLPLAIN] + '$'
  11051. // like full, but allows v1.2.3 and =1.2.3, which people do sometimes.
  11052. // also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty
  11053. // common in the npm registry.
  11054. tok('LOOSEPLAIN')
  11055. src[t.LOOSEPLAIN] = '[v=\\s]*' + src[t.MAINVERSIONLOOSE] +
  11056. src[t.PRERELEASELOOSE] + '?' +
  11057. src[t.BUILD] + '?'
  11058. tok('LOOSE')
  11059. src[t.LOOSE] = '^' + src[t.LOOSEPLAIN] + '$'
  11060. tok('GTLT')
  11061. src[t.GTLT] = '((?:<|>)?=?)'
  11062. // Something like "2.*" or "1.2.x".
  11063. // Note that "x.x" is a valid xRange identifer, meaning "any version"
  11064. // Only the first item is strictly required.
  11065. tok('XRANGEIDENTIFIERLOOSE')
  11066. src[t.XRANGEIDENTIFIERLOOSE] = src[t.NUMERICIDENTIFIERLOOSE] + '|x|X|\\*'
  11067. tok('XRANGEIDENTIFIER')
  11068. src[t.XRANGEIDENTIFIER] = src[t.NUMERICIDENTIFIER] + '|x|X|\\*'
  11069. tok('XRANGEPLAIN')
  11070. src[t.XRANGEPLAIN] = '[v=\\s]*(' + src[t.XRANGEIDENTIFIER] + ')' +
  11071. '(?:\\.(' + src[t.XRANGEIDENTIFIER] + ')' +
  11072. '(?:\\.(' + src[t.XRANGEIDENTIFIER] + ')' +
  11073. '(?:' + src[t.PRERELEASE] + ')?' +
  11074. src[t.BUILD] + '?' +
  11075. ')?)?'
  11076. tok('XRANGEPLAINLOOSE')
  11077. src[t.XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +
  11078. '(?:\\.(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +
  11079. '(?:\\.(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +
  11080. '(?:' + src[t.PRERELEASELOOSE] + ')?' +
  11081. src[t.BUILD] + '?' +
  11082. ')?)?'
  11083. tok('XRANGE')
  11084. src[t.XRANGE] = '^' + src[t.GTLT] + '\\s*' + src[t.XRANGEPLAIN] + '$'
  11085. tok('XRANGELOOSE')
  11086. src[t.XRANGELOOSE] = '^' + src[t.GTLT] + '\\s*' + src[t.XRANGEPLAINLOOSE] + '$'
  11087. // Coercion.
  11088. // Extract anything that could conceivably be a part of a valid semver
  11089. tok('COERCE')
  11090. src[t.COERCE] = '(^|[^\\d])' +
  11091. '(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '})' +
  11092. '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
  11093. '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
  11094. '(?:$|[^\\d])'
  11095. tok('COERCERTL')
  11096. re[t.COERCERTL] = new RegExp(src[t.COERCE], 'g')
  11097. safeRe[t.COERCERTL] = new RegExp(makeSafeRe(src[t.COERCE]), 'g')
  11098. // Tilde ranges.
  11099. // Meaning is "reasonably at or greater than"
  11100. tok('LONETILDE')
  11101. src[t.LONETILDE] = '(?:~>?)'
  11102. tok('TILDETRIM')
  11103. src[t.TILDETRIM] = '(\\s*)' + src[t.LONETILDE] + '\\s+'
  11104. re[t.TILDETRIM] = new RegExp(src[t.TILDETRIM], 'g')
  11105. safeRe[t.TILDETRIM] = new RegExp(makeSafeRe(src[t.TILDETRIM]), 'g')
  11106. var tildeTrimReplace = '$1~'
  11107. tok('TILDE')
  11108. src[t.TILDE] = '^' + src[t.LONETILDE] + src[t.XRANGEPLAIN] + '$'
  11109. tok('TILDELOOSE')
  11110. src[t.TILDELOOSE] = '^' + src[t.LONETILDE] + src[t.XRANGEPLAINLOOSE] + '$'
  11111. // Caret ranges.
  11112. // Meaning is "at least and backwards compatible with"
  11113. tok('LONECARET')
  11114. src[t.LONECARET] = '(?:\\^)'
  11115. tok('CARETTRIM')
  11116. src[t.CARETTRIM] = '(\\s*)' + src[t.LONECARET] + '\\s+'
  11117. re[t.CARETTRIM] = new RegExp(src[t.CARETTRIM], 'g')
  11118. safeRe[t.CARETTRIM] = new RegExp(makeSafeRe(src[t.CARETTRIM]), 'g')
  11119. var caretTrimReplace = '$1^'
  11120. tok('CARET')
  11121. src[t.CARET] = '^' + src[t.LONECARET] + src[t.XRANGEPLAIN] + '$'
  11122. tok('CARETLOOSE')
  11123. src[t.CARETLOOSE] = '^' + src[t.LONECARET] + src[t.XRANGEPLAINLOOSE] + '$'
  11124. // A simple gt/lt/eq thing, or just "" to indicate "any version"
  11125. tok('COMPARATORLOOSE')
  11126. src[t.COMPARATORLOOSE] = '^' + src[t.GTLT] + '\\s*(' + src[t.LOOSEPLAIN] + ')$|^$'
  11127. tok('COMPARATOR')
  11128. src[t.COMPARATOR] = '^' + src[t.GTLT] + '\\s*(' + src[t.FULLPLAIN] + ')$|^$'
  11129. // An expression to strip any whitespace between the gtlt and the thing
  11130. // it modifies, so that `> 1.2.3` ==> `>1.2.3`
  11131. tok('COMPARATORTRIM')
  11132. src[t.COMPARATORTRIM] = '(\\s*)' + src[t.GTLT] +
  11133. '\\s*(' + src[t.LOOSEPLAIN] + '|' + src[t.XRANGEPLAIN] + ')'
  11134. // this one has to use the /g flag
  11135. re[t.COMPARATORTRIM] = new RegExp(src[t.COMPARATORTRIM], 'g')
  11136. safeRe[t.COMPARATORTRIM] = new RegExp(makeSafeRe(src[t.COMPARATORTRIM]), 'g')
  11137. var comparatorTrimReplace = '$1$2$3'
  11138. // Something like `1.2.3 - 1.2.4`
  11139. // Note that these all use the loose form, because they'll be
  11140. // checked against either the strict or loose comparator form
  11141. // later.
  11142. tok('HYPHENRANGE')
  11143. src[t.HYPHENRANGE] = '^\\s*(' + src[t.XRANGEPLAIN] + ')' +
  11144. '\\s+-\\s+' +
  11145. '(' + src[t.XRANGEPLAIN] + ')' +
  11146. '\\s*$'
  11147. tok('HYPHENRANGELOOSE')
  11148. src[t.HYPHENRANGELOOSE] = '^\\s*(' + src[t.XRANGEPLAINLOOSE] + ')' +
  11149. '\\s+-\\s+' +
  11150. '(' + src[t.XRANGEPLAINLOOSE] + ')' +
  11151. '\\s*$'
  11152. // Star ranges basically just allow anything at all.
  11153. tok('STAR')
  11154. src[t.STAR] = '(<|>)?=?\\s*\\*'
  11155. // Compile to actual regexp objects.
  11156. // All are flag-free, unless they were created above with a flag.
  11157. for (var i = 0; i < R; i++) {
  11158. debug(i, src[i])
  11159. if (!re[i]) {
  11160. re[i] = new RegExp(src[i])
  11161. // Replace all greedy whitespace to prevent regex dos issues. These regex are
  11162. // used internally via the safeRe object since all inputs in this library get
  11163. // normalized first to trim and collapse all extra whitespace. The original
  11164. // regexes are exported for userland consumption and lower level usage. A
  11165. // future breaking change could export the safer regex only with a note that
  11166. // all input should have extra whitespace removed.
  11167. safeRe[i] = new RegExp(makeSafeRe(src[i]))
  11168. }
  11169. }
  11170. exports.parse = parse
  11171. function parse (version, options) {
  11172. if (!options || typeof options !== 'object') {
  11173. options = {
  11174. loose: !!options,
  11175. includePrerelease: false
  11176. }
  11177. }
  11178. if (version instanceof SemVer) {
  11179. return version
  11180. }
  11181. if (typeof version !== 'string') {
  11182. return null
  11183. }
  11184. if (version.length > MAX_LENGTH) {
  11185. return null
  11186. }
  11187. var r = options.loose ? safeRe[t.LOOSE] : safeRe[t.FULL]
  11188. if (!r.test(version)) {
  11189. return null
  11190. }
  11191. try {
  11192. return new SemVer(version, options)
  11193. } catch (er) {
  11194. return null
  11195. }
  11196. }
  11197. exports.valid = valid
  11198. function valid (version, options) {
  11199. var v = parse(version, options)
  11200. return v ? v.version : null
  11201. }
  11202. exports.clean = clean
  11203. function clean (version, options) {
  11204. var s = parse(version.trim().replace(/^[=v]+/, ''), options)
  11205. return s ? s.version : null
  11206. }
  11207. exports.SemVer = SemVer
  11208. function SemVer (version, options) {
  11209. if (!options || typeof options !== 'object') {
  11210. options = {
  11211. loose: !!options,
  11212. includePrerelease: false
  11213. }
  11214. }
  11215. if (version instanceof SemVer) {
  11216. if (version.loose === options.loose) {
  11217. return version
  11218. } else {
  11219. version = version.version
  11220. }
  11221. } else if (typeof version !== 'string') {
  11222. throw new TypeError('Invalid Version: ' + version)
  11223. }
  11224. if (version.length > MAX_LENGTH) {
  11225. throw new TypeError('version is longer than ' + MAX_LENGTH + ' characters')
  11226. }
  11227. if (!(this instanceof SemVer)) {
  11228. return new SemVer(version, options)
  11229. }
  11230. debug('SemVer', version, options)
  11231. this.options = options
  11232. this.loose = !!options.loose
  11233. var m = version.trim().match(options.loose ? safeRe[t.LOOSE] : safeRe[t.FULL])
  11234. if (!m) {
  11235. throw new TypeError('Invalid Version: ' + version)
  11236. }
  11237. this.raw = version
  11238. // these are actually numbers
  11239. this.major = +m[1]
  11240. this.minor = +m[2]
  11241. this.patch = +m[3]
  11242. if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
  11243. throw new TypeError('Invalid major version')
  11244. }
  11245. if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
  11246. throw new TypeError('Invalid minor version')
  11247. }
  11248. if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
  11249. throw new TypeError('Invalid patch version')
  11250. }
  11251. // numberify any prerelease numeric ids
  11252. if (!m[4]) {
  11253. this.prerelease = []
  11254. } else {
  11255. this.prerelease = m[4].split('.').map(function (id) {
  11256. if (/^[0-9]+$/.test(id)) {
  11257. var num = +id
  11258. if (num >= 0 && num < MAX_SAFE_INTEGER) {
  11259. return num
  11260. }
  11261. }
  11262. return id
  11263. })
  11264. }
  11265. this.build = m[5] ? m[5].split('.') : []
  11266. this.format()
  11267. }
  11268. SemVer.prototype.format = function () {
  11269. this.version = this.major + '.' + this.minor + '.' + this.patch
  11270. if (this.prerelease.length) {
  11271. this.version += '-' + this.prerelease.join('.')
  11272. }
  11273. return this.version
  11274. }
  11275. SemVer.prototype.toString = function () {
  11276. return this.version
  11277. }
  11278. SemVer.prototype.compare = function (other) {
  11279. debug('SemVer.compare', this.version, this.options, other)
  11280. if (!(other instanceof SemVer)) {
  11281. other = new SemVer(other, this.options)
  11282. }
  11283. return this.compareMain(other) || this.comparePre(other)
  11284. }
  11285. SemVer.prototype.compareMain = function (other) {
  11286. if (!(other instanceof SemVer)) {
  11287. other = new SemVer(other, this.options)
  11288. }
  11289. return compareIdentifiers(this.major, other.major) ||
  11290. compareIdentifiers(this.minor, other.minor) ||
  11291. compareIdentifiers(this.patch, other.patch)
  11292. }
  11293. SemVer.prototype.comparePre = function (other) {
  11294. if (!(other instanceof SemVer)) {
  11295. other = new SemVer(other, this.options)
  11296. }
  11297. // NOT having a prerelease is > having one
  11298. if (this.prerelease.length && !other.prerelease.length) {
  11299. return -1
  11300. } else if (!this.prerelease.length && other.prerelease.length) {
  11301. return 1
  11302. } else if (!this.prerelease.length && !other.prerelease.length) {
  11303. return 0
  11304. }
  11305. var i = 0
  11306. do {
  11307. var a = this.prerelease[i]
  11308. var b = other.prerelease[i]
  11309. debug('prerelease compare', i, a, b)
  11310. if (a === undefined && b === undefined) {
  11311. return 0
  11312. } else if (b === undefined) {
  11313. return 1
  11314. } else if (a === undefined) {
  11315. return -1
  11316. } else if (a === b) {
  11317. continue
  11318. } else {
  11319. return compareIdentifiers(a, b)
  11320. }
  11321. } while (++i)
  11322. }
  11323. SemVer.prototype.compareBuild = function (other) {
  11324. if (!(other instanceof SemVer)) {
  11325. other = new SemVer(other, this.options)
  11326. }
  11327. var i = 0
  11328. do {
  11329. var a = this.build[i]
  11330. var b = other.build[i]
  11331. debug('prerelease compare', i, a, b)
  11332. if (a === undefined && b === undefined) {
  11333. return 0
  11334. } else if (b === undefined) {
  11335. return 1
  11336. } else if (a === undefined) {
  11337. return -1
  11338. } else if (a === b) {
  11339. continue
  11340. } else {
  11341. return compareIdentifiers(a, b)
  11342. }
  11343. } while (++i)
  11344. }
  11345. // preminor will bump the version up to the next minor release, and immediately
  11346. // down to pre-release. premajor and prepatch work the same way.
  11347. SemVer.prototype.inc = function (release, identifier) {
  11348. switch (release) {
  11349. case 'premajor':
  11350. this.prerelease.length = 0
  11351. this.patch = 0
  11352. this.minor = 0
  11353. this.major++
  11354. this.inc('pre', identifier)
  11355. break
  11356. case 'preminor':
  11357. this.prerelease.length = 0
  11358. this.patch = 0
  11359. this.minor++
  11360. this.inc('pre', identifier)
  11361. break
  11362. case 'prepatch':
  11363. // If this is already a prerelease, it will bump to the next version
  11364. // drop any prereleases that might already exist, since they are not
  11365. // relevant at this point.
  11366. this.prerelease.length = 0
  11367. this.inc('patch', identifier)
  11368. this.inc('pre', identifier)
  11369. break
  11370. // If the input is a non-prerelease version, this acts the same as
  11371. // prepatch.
  11372. case 'prerelease':
  11373. if (this.prerelease.length === 0) {
  11374. this.inc('patch', identifier)
  11375. }
  11376. this.inc('pre', identifier)
  11377. break
  11378. case 'major':
  11379. // If this is a pre-major version, bump up to the same major version.
  11380. // Otherwise increment major.
  11381. // 1.0.0-5 bumps to 1.0.0
  11382. // 1.1.0 bumps to 2.0.0
  11383. if (this.minor !== 0 ||
  11384. this.patch !== 0 ||
  11385. this.prerelease.length === 0) {
  11386. this.major++
  11387. }
  11388. this.minor = 0
  11389. this.patch = 0
  11390. this.prerelease = []
  11391. break
  11392. case 'minor':
  11393. // If this is a pre-minor version, bump up to the same minor version.
  11394. // Otherwise increment minor.
  11395. // 1.2.0-5 bumps to 1.2.0
  11396. // 1.2.1 bumps to 1.3.0
  11397. if (this.patch !== 0 || this.prerelease.length === 0) {
  11398. this.minor++
  11399. }
  11400. this.patch = 0
  11401. this.prerelease = []
  11402. break
  11403. case 'patch':
  11404. // If this is not a pre-release version, it will increment the patch.
  11405. // If it is a pre-release it will bump up to the same patch version.
  11406. // 1.2.0-5 patches to 1.2.0
  11407. // 1.2.0 patches to 1.2.1
  11408. if (this.prerelease.length === 0) {
  11409. this.patch++
  11410. }
  11411. this.prerelease = []
  11412. break
  11413. // This probably shouldn't be used publicly.
  11414. // 1.0.0 "pre" would become 1.0.0-0 which is the wrong direction.
  11415. case 'pre':
  11416. if (this.prerelease.length === 0) {
  11417. this.prerelease = [0]
  11418. } else {
  11419. var i = this.prerelease.length
  11420. while (--i >= 0) {
  11421. if (typeof this.prerelease[i] === 'number') {
  11422. this.prerelease[i]++
  11423. i = -2
  11424. }
  11425. }
  11426. if (i === -1) {
  11427. // didn't increment anything
  11428. this.prerelease.push(0)
  11429. }
  11430. }
  11431. if (identifier) {
  11432. // 1.2.0-beta.1 bumps to 1.2.0-beta.2,
  11433. // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0
  11434. if (this.prerelease[0] === identifier) {
  11435. if (isNaN(this.prerelease[1])) {
  11436. this.prerelease = [identifier, 0]
  11437. }
  11438. } else {
  11439. this.prerelease = [identifier, 0]
  11440. }
  11441. }
  11442. break
  11443. default:
  11444. throw new Error('invalid increment argument: ' + release)
  11445. }
  11446. this.format()
  11447. this.raw = this.version
  11448. return this
  11449. }
  11450. exports.inc = inc
  11451. function inc (version, release, loose, identifier) {
  11452. if (typeof (loose) === 'string') {
  11453. identifier = loose
  11454. loose = undefined
  11455. }
  11456. try {
  11457. return new SemVer(version, loose).inc(release, identifier).version
  11458. } catch (er) {
  11459. return null
  11460. }
  11461. }
  11462. exports.diff = diff
  11463. function diff (version1, version2) {
  11464. if (eq(version1, version2)) {
  11465. return null
  11466. } else {
  11467. var v1 = parse(version1)
  11468. var v2 = parse(version2)
  11469. var prefix = ''
  11470. if (v1.prerelease.length || v2.prerelease.length) {
  11471. prefix = 'pre'
  11472. var defaultResult = 'prerelease'
  11473. }
  11474. for (var key in v1) {
  11475. if (key === 'major' || key === 'minor' || key === 'patch') {
  11476. if (v1[key] !== v2[key]) {
  11477. return prefix + key
  11478. }
  11479. }
  11480. }
  11481. return defaultResult // may be undefined
  11482. }
  11483. }
  11484. exports.compareIdentifiers = compareIdentifiers
  11485. var numeric = /^[0-9]+$/
  11486. function compareIdentifiers (a, b) {
  11487. var anum = numeric.test(a)
  11488. var bnum = numeric.test(b)
  11489. if (anum && bnum) {
  11490. a = +a
  11491. b = +b
  11492. }
  11493. return a === b ? 0
  11494. : (anum && !bnum) ? -1
  11495. : (bnum && !anum) ? 1
  11496. : a < b ? -1
  11497. : 1
  11498. }
  11499. exports.rcompareIdentifiers = rcompareIdentifiers
  11500. function rcompareIdentifiers (a, b) {
  11501. return compareIdentifiers(b, a)
  11502. }
  11503. exports.major = major
  11504. function major (a, loose) {
  11505. return new SemVer(a, loose).major
  11506. }
  11507. exports.minor = minor
  11508. function minor (a, loose) {
  11509. return new SemVer(a, loose).minor
  11510. }
  11511. exports.patch = patch
  11512. function patch (a, loose) {
  11513. return new SemVer(a, loose).patch
  11514. }
  11515. exports.compare = compare
  11516. function compare (a, b, loose) {
  11517. return new SemVer(a, loose).compare(new SemVer(b, loose))
  11518. }
  11519. exports.compareLoose = compareLoose
  11520. function compareLoose (a, b) {
  11521. return compare(a, b, true)
  11522. }
  11523. exports.compareBuild = compareBuild
  11524. function compareBuild (a, b, loose) {
  11525. var versionA = new SemVer(a, loose)
  11526. var versionB = new SemVer(b, loose)
  11527. return versionA.compare(versionB) || versionA.compareBuild(versionB)
  11528. }
  11529. exports.rcompare = rcompare
  11530. function rcompare (a, b, loose) {
  11531. return compare(b, a, loose)
  11532. }
  11533. exports.sort = sort
  11534. function sort (list, loose) {
  11535. return list.sort(function (a, b) {
  11536. return exports.compareBuild(a, b, loose)
  11537. })
  11538. }
  11539. exports.rsort = rsort
  11540. function rsort (list, loose) {
  11541. return list.sort(function (a, b) {
  11542. return exports.compareBuild(b, a, loose)
  11543. })
  11544. }
  11545. exports.gt = gt
  11546. function gt (a, b, loose) {
  11547. return compare(a, b, loose) > 0
  11548. }
  11549. exports.lt = lt
  11550. function lt (a, b, loose) {
  11551. return compare(a, b, loose) < 0
  11552. }
  11553. exports.eq = eq
  11554. function eq (a, b, loose) {
  11555. return compare(a, b, loose) === 0
  11556. }
  11557. exports.neq = neq
  11558. function neq (a, b, loose) {
  11559. return compare(a, b, loose) !== 0
  11560. }
  11561. exports.gte = gte
  11562. function gte (a, b, loose) {
  11563. return compare(a, b, loose) >= 0
  11564. }
  11565. exports.lte = lte
  11566. function lte (a, b, loose) {
  11567. return compare(a, b, loose) <= 0
  11568. }
  11569. exports.cmp = cmp
  11570. function cmp (a, op, b, loose) {
  11571. switch (op) {
  11572. case '===':
  11573. if (typeof a === 'object')
  11574. a = a.version
  11575. if (typeof b === 'object')
  11576. b = b.version
  11577. return a === b
  11578. case '!==':
  11579. if (typeof a === 'object')
  11580. a = a.version
  11581. if (typeof b === 'object')
  11582. b = b.version
  11583. return a !== b
  11584. case '':
  11585. case '=':
  11586. case '==':
  11587. return eq(a, b, loose)
  11588. case '!=':
  11589. return neq(a, b, loose)
  11590. case '>':
  11591. return gt(a, b, loose)
  11592. case '>=':
  11593. return gte(a, b, loose)
  11594. case '<':
  11595. return lt(a, b, loose)
  11596. case '<=':
  11597. return lte(a, b, loose)
  11598. default:
  11599. throw new TypeError('Invalid operator: ' + op)
  11600. }
  11601. }
  11602. exports.Comparator = Comparator
  11603. function Comparator (comp, options) {
  11604. if (!options || typeof options !== 'object') {
  11605. options = {
  11606. loose: !!options,
  11607. includePrerelease: false
  11608. }
  11609. }
  11610. if (comp instanceof Comparator) {
  11611. if (comp.loose === !!options.loose) {
  11612. return comp
  11613. } else {
  11614. comp = comp.value
  11615. }
  11616. }
  11617. if (!(this instanceof Comparator)) {
  11618. return new Comparator(comp, options)
  11619. }
  11620. comp = comp.trim().split(/\s+/).join(' ')
  11621. debug('comparator', comp, options)
  11622. this.options = options
  11623. this.loose = !!options.loose
  11624. this.parse(comp)
  11625. if (this.semver === ANY) {
  11626. this.value = ''
  11627. } else {
  11628. this.value = this.operator + this.semver.version
  11629. }
  11630. debug('comp', this)
  11631. }
  11632. var ANY = {}
  11633. Comparator.prototype.parse = function (comp) {
  11634. var r = this.options.loose ? safeRe[t.COMPARATORLOOSE] : safeRe[t.COMPARATOR]
  11635. var m = comp.match(r)
  11636. if (!m) {
  11637. throw new TypeError('Invalid comparator: ' + comp)
  11638. }
  11639. this.operator = m[1] !== undefined ? m[1] : ''
  11640. if (this.operator === '=') {
  11641. this.operator = ''
  11642. }
  11643. // if it literally is just '>' or '' then allow anything.
  11644. if (!m[2]) {
  11645. this.semver = ANY
  11646. } else {
  11647. this.semver = new SemVer(m[2], this.options.loose)
  11648. }
  11649. }
  11650. Comparator.prototype.toString = function () {
  11651. return this.value
  11652. }
  11653. Comparator.prototype.test = function (version) {
  11654. debug('Comparator.test', version, this.options.loose)
  11655. if (this.semver === ANY || version === ANY) {
  11656. return true
  11657. }
  11658. if (typeof version === 'string') {
  11659. try {
  11660. version = new SemVer(version, this.options)
  11661. } catch (er) {
  11662. return false
  11663. }
  11664. }
  11665. return cmp(version, this.operator, this.semver, this.options)
  11666. }
  11667. Comparator.prototype.intersects = function (comp, options) {
  11668. if (!(comp instanceof Comparator)) {
  11669. throw new TypeError('a Comparator is required')
  11670. }
  11671. if (!options || typeof options !== 'object') {
  11672. options = {
  11673. loose: !!options,
  11674. includePrerelease: false
  11675. }
  11676. }
  11677. var rangeTmp
  11678. if (this.operator === '') {
  11679. if (this.value === '') {
  11680. return true
  11681. }
  11682. rangeTmp = new Range(comp.value, options)
  11683. return satisfies(this.value, rangeTmp, options)
  11684. } else if (comp.operator === '') {
  11685. if (comp.value === '') {
  11686. return true
  11687. }
  11688. rangeTmp = new Range(this.value, options)
  11689. return satisfies(comp.semver, rangeTmp, options)
  11690. }
  11691. var sameDirectionIncreasing =
  11692. (this.operator === '>=' || this.operator === '>') &&
  11693. (comp.operator === '>=' || comp.operator === '>')
  11694. var sameDirectionDecreasing =
  11695. (this.operator === '<=' || this.operator === '<') &&
  11696. (comp.operator === '<=' || comp.operator === '<')
  11697. var sameSemVer = this.semver.version === comp.semver.version
  11698. var differentDirectionsInclusive =
  11699. (this.operator === '>=' || this.operator === '<=') &&
  11700. (comp.operator === '>=' || comp.operator === '<=')
  11701. var oppositeDirectionsLessThan =
  11702. cmp(this.semver, '<', comp.semver, options) &&
  11703. ((this.operator === '>=' || this.operator === '>') &&
  11704. (comp.operator === '<=' || comp.operator === '<'))
  11705. var oppositeDirectionsGreaterThan =
  11706. cmp(this.semver, '>', comp.semver, options) &&
  11707. ((this.operator === '<=' || this.operator === '<') &&
  11708. (comp.operator === '>=' || comp.operator === '>'))
  11709. return sameDirectionIncreasing || sameDirectionDecreasing ||
  11710. (sameSemVer && differentDirectionsInclusive) ||
  11711. oppositeDirectionsLessThan || oppositeDirectionsGreaterThan
  11712. }
  11713. exports.Range = Range
  11714. function Range (range, options) {
  11715. if (!options || typeof options !== 'object') {
  11716. options = {
  11717. loose: !!options,
  11718. includePrerelease: false
  11719. }
  11720. }
  11721. if (range instanceof Range) {
  11722. if (range.loose === !!options.loose &&
  11723. range.includePrerelease === !!options.includePrerelease) {
  11724. return range
  11725. } else {
  11726. return new Range(range.raw, options)
  11727. }
  11728. }
  11729. if (range instanceof Comparator) {
  11730. return new Range(range.value, options)
  11731. }
  11732. if (!(this instanceof Range)) {
  11733. return new Range(range, options)
  11734. }
  11735. this.options = options
  11736. this.loose = !!options.loose
  11737. this.includePrerelease = !!options.includePrerelease
  11738. // First reduce all whitespace as much as possible so we do not have to rely
  11739. // on potentially slow regexes like \s*. This is then stored and used for
  11740. // future error messages as well.
  11741. this.raw = range
  11742. .trim()
  11743. .split(/\s+/)
  11744. .join(' ')
  11745. // First, split based on boolean or ||
  11746. this.set = this.raw.split('||').map(function (range) {
  11747. return this.parseRange(range.trim())
  11748. }, this).filter(function (c) {
  11749. // throw out any that are not relevant for whatever reason
  11750. return c.length
  11751. })
  11752. if (!this.set.length) {
  11753. throw new TypeError('Invalid SemVer Range: ' + this.raw)
  11754. }
  11755. this.format()
  11756. }
  11757. Range.prototype.format = function () {
  11758. this.range = this.set.map(function (comps) {
  11759. return comps.join(' ').trim()
  11760. }).join('||').trim()
  11761. return this.range
  11762. }
  11763. Range.prototype.toString = function () {
  11764. return this.range
  11765. }
  11766. Range.prototype.parseRange = function (range) {
  11767. var loose = this.options.loose
  11768. // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`
  11769. var hr = loose ? safeRe[t.HYPHENRANGELOOSE] : safeRe[t.HYPHENRANGE]
  11770. range = range.replace(hr, hyphenReplace)
  11771. debug('hyphen replace', range)
  11772. // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`
  11773. range = range.replace(safeRe[t.COMPARATORTRIM], comparatorTrimReplace)
  11774. debug('comparator trim', range, safeRe[t.COMPARATORTRIM])
  11775. // `~ 1.2.3` => `~1.2.3`
  11776. range = range.replace(safeRe[t.TILDETRIM], tildeTrimReplace)
  11777. // `^ 1.2.3` => `^1.2.3`
  11778. range = range.replace(safeRe[t.CARETTRIM], caretTrimReplace)
  11779. // normalize spaces
  11780. range = range.split(/\s+/).join(' ')
  11781. // At this point, the range is completely trimmed and
  11782. // ready to be split into comparators.
  11783. var compRe = loose ? safeRe[t.COMPARATORLOOSE] : safeRe[t.COMPARATOR]
  11784. var set = range.split(' ').map(function (comp) {
  11785. return parseComparator(comp, this.options)
  11786. }, this).join(' ').split(/\s+/)
  11787. if (this.options.loose) {
  11788. // in loose mode, throw out any that are not valid comparators
  11789. set = set.filter(function (comp) {
  11790. return !!comp.match(compRe)
  11791. })
  11792. }
  11793. set = set.map(function (comp) {
  11794. return new Comparator(comp, this.options)
  11795. }, this)
  11796. return set
  11797. }
  11798. Range.prototype.intersects = function (range, options) {
  11799. if (!(range instanceof Range)) {
  11800. throw new TypeError('a Range is required')
  11801. }
  11802. return this.set.some(function (thisComparators) {
  11803. return (
  11804. isSatisfiable(thisComparators, options) &&
  11805. range.set.some(function (rangeComparators) {
  11806. return (
  11807. isSatisfiable(rangeComparators, options) &&
  11808. thisComparators.every(function (thisComparator) {
  11809. return rangeComparators.every(function (rangeComparator) {
  11810. return thisComparator.intersects(rangeComparator, options)
  11811. })
  11812. })
  11813. )
  11814. })
  11815. )
  11816. })
  11817. }
  11818. // take a set of comparators and determine whether there
  11819. // exists a version which can satisfy it
  11820. function isSatisfiable (comparators, options) {
  11821. var result = true
  11822. var remainingComparators = comparators.slice()
  11823. var testComparator = remainingComparators.pop()
  11824. while (result && remainingComparators.length) {
  11825. result = remainingComparators.every(function (otherComparator) {
  11826. return testComparator.intersects(otherComparator, options)
  11827. })
  11828. testComparator = remainingComparators.pop()
  11829. }
  11830. return result
  11831. }
  11832. // Mostly just for testing and legacy API reasons
  11833. exports.toComparators = toComparators
  11834. function toComparators (range, options) {
  11835. return new Range(range, options).set.map(function (comp) {
  11836. return comp.map(function (c) {
  11837. return c.value
  11838. }).join(' ').trim().split(' ')
  11839. })
  11840. }
  11841. // comprised of xranges, tildes, stars, and gtlt's at this point.
  11842. // already replaced the hyphen ranges
  11843. // turn into a set of JUST comparators.
  11844. function parseComparator (comp, options) {
  11845. debug('comp', comp, options)
  11846. comp = replaceCarets(comp, options)
  11847. debug('caret', comp)
  11848. comp = replaceTildes(comp, options)
  11849. debug('tildes', comp)
  11850. comp = replaceXRanges(comp, options)
  11851. debug('xrange', comp)
  11852. comp = replaceStars(comp, options)
  11853. debug('stars', comp)
  11854. return comp
  11855. }
  11856. function isX (id) {
  11857. return !id || id.toLowerCase() === 'x' || id === '*'
  11858. }
  11859. // ~, ~> --> * (any, kinda silly)
  11860. // ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0
  11861. // ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0
  11862. // ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0
  11863. // ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0
  11864. // ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0
  11865. function replaceTildes (comp, options) {
  11866. return comp.trim().split(/\s+/).map(function (comp) {
  11867. return replaceTilde(comp, options)
  11868. }).join(' ')
  11869. }
  11870. function replaceTilde (comp, options) {
  11871. var r = options.loose ? safeRe[t.TILDELOOSE] : safeRe[t.TILDE]
  11872. return comp.replace(r, function (_, M, m, p, pr) {
  11873. debug('tilde', comp, _, M, m, p, pr)
  11874. var ret
  11875. if (isX(M)) {
  11876. ret = ''
  11877. } else if (isX(m)) {
  11878. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  11879. } else if (isX(p)) {
  11880. // ~1.2 == >=1.2.0 <1.3.0
  11881. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  11882. } else if (pr) {
  11883. debug('replaceTilde pr', pr)
  11884. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  11885. ' <' + M + '.' + (+m + 1) + '.0'
  11886. } else {
  11887. // ~1.2.3 == >=1.2.3 <1.3.0
  11888. ret = '>=' + M + '.' + m + '.' + p +
  11889. ' <' + M + '.' + (+m + 1) + '.0'
  11890. }
  11891. debug('tilde return', ret)
  11892. return ret
  11893. })
  11894. }
  11895. // ^ --> * (any, kinda silly)
  11896. // ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0
  11897. // ^2.0, ^2.0.x --> >=2.0.0 <3.0.0
  11898. // ^1.2, ^1.2.x --> >=1.2.0 <2.0.0
  11899. // ^1.2.3 --> >=1.2.3 <2.0.0
  11900. // ^1.2.0 --> >=1.2.0 <2.0.0
  11901. function replaceCarets (comp, options) {
  11902. return comp.trim().split(/\s+/).map(function (comp) {
  11903. return replaceCaret(comp, options)
  11904. }).join(' ')
  11905. }
  11906. function replaceCaret (comp, options) {
  11907. debug('caret', comp, options)
  11908. var r = options.loose ? safeRe[t.CARETLOOSE] : safeRe[t.CARET]
  11909. return comp.replace(r, function (_, M, m, p, pr) {
  11910. debug('caret', comp, _, M, m, p, pr)
  11911. var ret
  11912. if (isX(M)) {
  11913. ret = ''
  11914. } else if (isX(m)) {
  11915. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  11916. } else if (isX(p)) {
  11917. if (M === '0') {
  11918. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  11919. } else {
  11920. ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0'
  11921. }
  11922. } else if (pr) {
  11923. debug('replaceCaret pr', pr)
  11924. if (M === '0') {
  11925. if (m === '0') {
  11926. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  11927. ' <' + M + '.' + m + '.' + (+p + 1)
  11928. } else {
  11929. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  11930. ' <' + M + '.' + (+m + 1) + '.0'
  11931. }
  11932. } else {
  11933. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  11934. ' <' + (+M + 1) + '.0.0'
  11935. }
  11936. } else {
  11937. debug('no pr')
  11938. if (M === '0') {
  11939. if (m === '0') {
  11940. ret = '>=' + M + '.' + m + '.' + p +
  11941. ' <' + M + '.' + m + '.' + (+p + 1)
  11942. } else {
  11943. ret = '>=' + M + '.' + m + '.' + p +
  11944. ' <' + M + '.' + (+m + 1) + '.0'
  11945. }
  11946. } else {
  11947. ret = '>=' + M + '.' + m + '.' + p +
  11948. ' <' + (+M + 1) + '.0.0'
  11949. }
  11950. }
  11951. debug('caret return', ret)
  11952. return ret
  11953. })
  11954. }
  11955. function replaceXRanges (comp, options) {
  11956. debug('replaceXRanges', comp, options)
  11957. return comp.split(/\s+/).map(function (comp) {
  11958. return replaceXRange(comp, options)
  11959. }).join(' ')
  11960. }
  11961. function replaceXRange (comp, options) {
  11962. comp = comp.trim()
  11963. var r = options.loose ? safeRe[t.XRANGELOOSE] : safeRe[t.XRANGE]
  11964. return comp.replace(r, function (ret, gtlt, M, m, p, pr) {
  11965. debug('xRange', comp, ret, gtlt, M, m, p, pr)
  11966. var xM = isX(M)
  11967. var xm = xM || isX(m)
  11968. var xp = xm || isX(p)
  11969. var anyX = xp
  11970. if (gtlt === '=' && anyX) {
  11971. gtlt = ''
  11972. }
  11973. // if we're including prereleases in the match, then we need
  11974. // to fix this to -0, the lowest possible prerelease value
  11975. pr = options.includePrerelease ? '-0' : ''
  11976. if (xM) {
  11977. if (gtlt === '>' || gtlt === '<') {
  11978. // nothing is allowed
  11979. ret = '<0.0.0-0'
  11980. } else {
  11981. // nothing is forbidden
  11982. ret = '*'
  11983. }
  11984. } else if (gtlt && anyX) {
  11985. // we know patch is an x, because we have any x at all.
  11986. // replace X with 0
  11987. if (xm) {
  11988. m = 0
  11989. }
  11990. p = 0
  11991. if (gtlt === '>') {
  11992. // >1 => >=2.0.0
  11993. // >1.2 => >=1.3.0
  11994. // >1.2.3 => >= 1.2.4
  11995. gtlt = '>='
  11996. if (xm) {
  11997. M = +M + 1
  11998. m = 0
  11999. p = 0
  12000. } else {
  12001. m = +m + 1
  12002. p = 0
  12003. }
  12004. } else if (gtlt === '<=') {
  12005. // <=0.7.x is actually <0.8.0, since any 0.7.x should
  12006. // pass. Similarly, <=7.x is actually <8.0.0, etc.
  12007. gtlt = '<'
  12008. if (xm) {
  12009. M = +M + 1
  12010. } else {
  12011. m = +m + 1
  12012. }
  12013. }
  12014. ret = gtlt + M + '.' + m + '.' + p + pr
  12015. } else if (xm) {
  12016. ret = '>=' + M + '.0.0' + pr + ' <' + (+M + 1) + '.0.0' + pr
  12017. } else if (xp) {
  12018. ret = '>=' + M + '.' + m + '.0' + pr +
  12019. ' <' + M + '.' + (+m + 1) + '.0' + pr
  12020. }
  12021. debug('xRange return', ret)
  12022. return ret
  12023. })
  12024. }
  12025. // Because * is AND-ed with everything else in the comparator,
  12026. // and '' means "any version", just remove the *s entirely.
  12027. function replaceStars (comp, options) {
  12028. debug('replaceStars', comp, options)
  12029. // Looseness is ignored here. star is always as loose as it gets!
  12030. return comp.trim().replace(safeRe[t.STAR], '')
  12031. }
  12032. // This function is passed to string.replace(re[t.HYPHENRANGE])
  12033. // M, m, patch, prerelease, build
  12034. // 1.2 - 3.4.5 => >=1.2.0 <=3.4.5
  12035. // 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do
  12036. // 1.2 - 3.4 => >=1.2.0 <3.5.0
  12037. function hyphenReplace ($0,
  12038. from, fM, fm, fp, fpr, fb,
  12039. to, tM, tm, tp, tpr, tb) {
  12040. if (isX(fM)) {
  12041. from = ''
  12042. } else if (isX(fm)) {
  12043. from = '>=' + fM + '.0.0'
  12044. } else if (isX(fp)) {
  12045. from = '>=' + fM + '.' + fm + '.0'
  12046. } else {
  12047. from = '>=' + from
  12048. }
  12049. if (isX(tM)) {
  12050. to = ''
  12051. } else if (isX(tm)) {
  12052. to = '<' + (+tM + 1) + '.0.0'
  12053. } else if (isX(tp)) {
  12054. to = '<' + tM + '.' + (+tm + 1) + '.0'
  12055. } else if (tpr) {
  12056. to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr
  12057. } else {
  12058. to = '<=' + to
  12059. }
  12060. return (from + ' ' + to).trim()
  12061. }
  12062. // if ANY of the sets match ALL of its comparators, then pass
  12063. Range.prototype.test = function (version) {
  12064. if (!version) {
  12065. return false
  12066. }
  12067. if (typeof version === 'string') {
  12068. try {
  12069. version = new SemVer(version, this.options)
  12070. } catch (er) {
  12071. return false
  12072. }
  12073. }
  12074. for (var i = 0; i < this.set.length; i++) {
  12075. if (testSet(this.set[i], version, this.options)) {
  12076. return true
  12077. }
  12078. }
  12079. return false
  12080. }
  12081. function testSet (set, version, options) {
  12082. for (var i = 0; i < set.length; i++) {
  12083. if (!set[i].test(version)) {
  12084. return false
  12085. }
  12086. }
  12087. if (version.prerelease.length && !options.includePrerelease) {
  12088. // Find the set of versions that are allowed to have prereleases
  12089. // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0
  12090. // That should allow `1.2.3-pr.2` to pass.
  12091. // However, `1.2.4-alpha.notready` should NOT be allowed,
  12092. // even though it's within the range set by the comparators.
  12093. for (i = 0; i < set.length; i++) {
  12094. debug(set[i].semver)
  12095. if (set[i].semver === ANY) {
  12096. continue
  12097. }
  12098. if (set[i].semver.prerelease.length > 0) {
  12099. var allowed = set[i].semver
  12100. if (allowed.major === version.major &&
  12101. allowed.minor === version.minor &&
  12102. allowed.patch === version.patch) {
  12103. return true
  12104. }
  12105. }
  12106. }
  12107. // Version has a -pre, but it's not one of the ones we like.
  12108. return false
  12109. }
  12110. return true
  12111. }
  12112. exports.satisfies = satisfies
  12113. function satisfies (version, range, options) {
  12114. try {
  12115. range = new Range(range, options)
  12116. } catch (er) {
  12117. return false
  12118. }
  12119. return range.test(version)
  12120. }
  12121. exports.maxSatisfying = maxSatisfying
  12122. function maxSatisfying (versions, range, options) {
  12123. var max = null
  12124. var maxSV = null
  12125. try {
  12126. var rangeObj = new Range(range, options)
  12127. } catch (er) {
  12128. return null
  12129. }
  12130. versions.forEach(function (v) {
  12131. if (rangeObj.test(v)) {
  12132. // satisfies(v, range, options)
  12133. if (!max || maxSV.compare(v) === -1) {
  12134. // compare(max, v, true)
  12135. max = v
  12136. maxSV = new SemVer(max, options)
  12137. }
  12138. }
  12139. })
  12140. return max
  12141. }
  12142. exports.minSatisfying = minSatisfying
  12143. function minSatisfying (versions, range, options) {
  12144. var min = null
  12145. var minSV = null
  12146. try {
  12147. var rangeObj = new Range(range, options)
  12148. } catch (er) {
  12149. return null
  12150. }
  12151. versions.forEach(function (v) {
  12152. if (rangeObj.test(v)) {
  12153. // satisfies(v, range, options)
  12154. if (!min || minSV.compare(v) === 1) {
  12155. // compare(min, v, true)
  12156. min = v
  12157. minSV = new SemVer(min, options)
  12158. }
  12159. }
  12160. })
  12161. return min
  12162. }
  12163. exports.minVersion = minVersion
  12164. function minVersion (range, loose) {
  12165. range = new Range(range, loose)
  12166. var minver = new SemVer('0.0.0')
  12167. if (range.test(minver)) {
  12168. return minver
  12169. }
  12170. minver = new SemVer('0.0.0-0')
  12171. if (range.test(minver)) {
  12172. return minver
  12173. }
  12174. minver = null
  12175. for (var i = 0; i < range.set.length; ++i) {
  12176. var comparators = range.set[i]
  12177. comparators.forEach(function (comparator) {
  12178. // Clone to avoid manipulating the comparator's semver object.
  12179. var compver = new SemVer(comparator.semver.version)
  12180. switch (comparator.operator) {
  12181. case '>':
  12182. if (compver.prerelease.length === 0) {
  12183. compver.patch++
  12184. } else {
  12185. compver.prerelease.push(0)
  12186. }
  12187. compver.raw = compver.format()
  12188. /* fallthrough */
  12189. case '':
  12190. case '>=':
  12191. if (!minver || gt(minver, compver)) {
  12192. minver = compver
  12193. }
  12194. break
  12195. case '<':
  12196. case '<=':
  12197. /* Ignore maximum versions */
  12198. break
  12199. /* istanbul ignore next */
  12200. default:
  12201. throw new Error('Unexpected operation: ' + comparator.operator)
  12202. }
  12203. })
  12204. }
  12205. if (minver && range.test(minver)) {
  12206. return minver
  12207. }
  12208. return null
  12209. }
  12210. exports.validRange = validRange
  12211. function validRange (range, options) {
  12212. try {
  12213. // Return '*' instead of '' so that truthiness works.
  12214. // This will throw if it's invalid anyway
  12215. return new Range(range, options).range || '*'
  12216. } catch (er) {
  12217. return null
  12218. }
  12219. }
  12220. // Determine if version is less than all the versions possible in the range
  12221. exports.ltr = ltr
  12222. function ltr (version, range, options) {
  12223. return outside(version, range, '<', options)
  12224. }
  12225. // Determine if version is greater than all the versions possible in the range.
  12226. exports.gtr = gtr
  12227. function gtr (version, range, options) {
  12228. return outside(version, range, '>', options)
  12229. }
  12230. exports.outside = outside
  12231. function outside (version, range, hilo, options) {
  12232. version = new SemVer(version, options)
  12233. range = new Range(range, options)
  12234. var gtfn, ltefn, ltfn, comp, ecomp
  12235. switch (hilo) {
  12236. case '>':
  12237. gtfn = gt
  12238. ltefn = lte
  12239. ltfn = lt
  12240. comp = '>'
  12241. ecomp = '>='
  12242. break
  12243. case '<':
  12244. gtfn = lt
  12245. ltefn = gte
  12246. ltfn = gt
  12247. comp = '<'
  12248. ecomp = '<='
  12249. break
  12250. default:
  12251. throw new TypeError('Must provide a hilo val of "<" or ">"')
  12252. }
  12253. // If it satisifes the range it is not outside
  12254. if (satisfies(version, range, options)) {
  12255. return false
  12256. }
  12257. // From now on, variable terms are as if we're in "gtr" mode.
  12258. // but note that everything is flipped for the "ltr" function.
  12259. for (var i = 0; i < range.set.length; ++i) {
  12260. var comparators = range.set[i]
  12261. var high = null
  12262. var low = null
  12263. comparators.forEach(function (comparator) {
  12264. if (comparator.semver === ANY) {
  12265. comparator = new Comparator('>=0.0.0')
  12266. }
  12267. high = high || comparator
  12268. low = low || comparator
  12269. if (gtfn(comparator.semver, high.semver, options)) {
  12270. high = comparator
  12271. } else if (ltfn(comparator.semver, low.semver, options)) {
  12272. low = comparator
  12273. }
  12274. })
  12275. // If the edge version comparator has a operator then our version
  12276. // isn't outside it
  12277. if (high.operator === comp || high.operator === ecomp) {
  12278. return false
  12279. }
  12280. // If the lowest version comparator has an operator and our version
  12281. // is less than it then it isn't higher than the range
  12282. if ((!low.operator || low.operator === comp) &&
  12283. ltefn(version, low.semver)) {
  12284. return false
  12285. } else if (low.operator === ecomp && ltfn(version, low.semver)) {
  12286. return false
  12287. }
  12288. }
  12289. return true
  12290. }
  12291. exports.prerelease = prerelease
  12292. function prerelease (version, options) {
  12293. var parsed = parse(version, options)
  12294. return (parsed && parsed.prerelease.length) ? parsed.prerelease : null
  12295. }
  12296. exports.intersects = intersects
  12297. function intersects (r1, r2, options) {
  12298. r1 = new Range(r1, options)
  12299. r2 = new Range(r2, options)
  12300. return r1.intersects(r2)
  12301. }
  12302. exports.coerce = coerce
  12303. function coerce (version, options) {
  12304. if (version instanceof SemVer) {
  12305. return version
  12306. }
  12307. if (typeof version === 'number') {
  12308. version = String(version)
  12309. }
  12310. if (typeof version !== 'string') {
  12311. return null
  12312. }
  12313. options = options || {}
  12314. var match = null
  12315. if (!options.rtl) {
  12316. match = version.match(safeRe[t.COERCE])
  12317. } else {
  12318. // Find the right-most coercible string that does not share
  12319. // a terminus with a more left-ward coercible string.
  12320. // Eg, '1.2.3.4' wants to coerce '2.3.4', not '3.4' or '4'
  12321. //
  12322. // Walk through the string checking with a /g regexp
  12323. // Manually set the index so as to pick up overlapping matches.
  12324. // Stop when we get a match that ends at the string end, since no
  12325. // coercible string can be more right-ward without the same terminus.
  12326. var next
  12327. while ((next = safeRe[t.COERCERTL].exec(version)) &&
  12328. (!match || match.index + match[0].length !== version.length)
  12329. ) {
  12330. if (!match ||
  12331. next.index + next[0].length !== match.index + match[0].length) {
  12332. match = next
  12333. }
  12334. safeRe[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length
  12335. }
  12336. // leave it in a clean state
  12337. safeRe[t.COERCERTL].lastIndex = -1
  12338. }
  12339. if (match === null) {
  12340. return null
  12341. }
  12342. return parse(match[2] +
  12343. '.' + (match[3] || '0') +
  12344. '.' + (match[4] || '0'), options)
  12345. }
  12346. /***/ }),
  12347. /***/ 4294:
  12348. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  12349. module.exports = __nccwpck_require__(4219);
  12350. /***/ }),
  12351. /***/ 4219:
  12352. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  12353. "use strict";
  12354. var net = __nccwpck_require__(1808);
  12355. var tls = __nccwpck_require__(4404);
  12356. var http = __nccwpck_require__(3685);
  12357. var https = __nccwpck_require__(5687);
  12358. var events = __nccwpck_require__(2361);
  12359. var assert = __nccwpck_require__(9491);
  12360. var util = __nccwpck_require__(3837);
  12361. exports.httpOverHttp = httpOverHttp;
  12362. exports.httpsOverHttp = httpsOverHttp;
  12363. exports.httpOverHttps = httpOverHttps;
  12364. exports.httpsOverHttps = httpsOverHttps;
  12365. function httpOverHttp(options) {
  12366. var agent = new TunnelingAgent(options);
  12367. agent.request = http.request;
  12368. return agent;
  12369. }
  12370. function httpsOverHttp(options) {
  12371. var agent = new TunnelingAgent(options);
  12372. agent.request = http.request;
  12373. agent.createSocket = createSecureSocket;
  12374. agent.defaultPort = 443;
  12375. return agent;
  12376. }
  12377. function httpOverHttps(options) {
  12378. var agent = new TunnelingAgent(options);
  12379. agent.request = https.request;
  12380. return agent;
  12381. }
  12382. function httpsOverHttps(options) {
  12383. var agent = new TunnelingAgent(options);
  12384. agent.request = https.request;
  12385. agent.createSocket = createSecureSocket;
  12386. agent.defaultPort = 443;
  12387. return agent;
  12388. }
  12389. function TunnelingAgent(options) {
  12390. var self = this;
  12391. self.options = options || {};
  12392. self.proxyOptions = self.options.proxy || {};
  12393. self.maxSockets = self.options.maxSockets || http.Agent.defaultMaxSockets;
  12394. self.requests = [];
  12395. self.sockets = [];
  12396. self.on('free', function onFree(socket, host, port, localAddress) {
  12397. var options = toOptions(host, port, localAddress);
  12398. for (var i = 0, len = self.requests.length; i < len; ++i) {
  12399. var pending = self.requests[i];
  12400. if (pending.host === options.host && pending.port === options.port) {
  12401. // Detect the request to connect same origin server,
  12402. // reuse the connection.
  12403. self.requests.splice(i, 1);
  12404. pending.request.onSocket(socket);
  12405. return;
  12406. }
  12407. }
  12408. socket.destroy();
  12409. self.removeSocket(socket);
  12410. });
  12411. }
  12412. util.inherits(TunnelingAgent, events.EventEmitter);
  12413. TunnelingAgent.prototype.addRequest = function addRequest(req, host, port, localAddress) {
  12414. var self = this;
  12415. var options = mergeOptions({request: req}, self.options, toOptions(host, port, localAddress));
  12416. if (self.sockets.length >= this.maxSockets) {
  12417. // We are over limit so we'll add it to the queue.
  12418. self.requests.push(options);
  12419. return;
  12420. }
  12421. // If we are under maxSockets create a new one.
  12422. self.createSocket(options, function(socket) {
  12423. socket.on('free', onFree);
  12424. socket.on('close', onCloseOrRemove);
  12425. socket.on('agentRemove', onCloseOrRemove);
  12426. req.onSocket(socket);
  12427. function onFree() {
  12428. self.emit('free', socket, options);
  12429. }
  12430. function onCloseOrRemove(err) {
  12431. self.removeSocket(socket);
  12432. socket.removeListener('free', onFree);
  12433. socket.removeListener('close', onCloseOrRemove);
  12434. socket.removeListener('agentRemove', onCloseOrRemove);
  12435. }
  12436. });
  12437. };
  12438. TunnelingAgent.prototype.createSocket = function createSocket(options, cb) {
  12439. var self = this;
  12440. var placeholder = {};
  12441. self.sockets.push(placeholder);
  12442. var connectOptions = mergeOptions({}, self.proxyOptions, {
  12443. method: 'CONNECT',
  12444. path: options.host + ':' + options.port,
  12445. agent: false,
  12446. headers: {
  12447. host: options.host + ':' + options.port
  12448. }
  12449. });
  12450. if (options.localAddress) {
  12451. connectOptions.localAddress = options.localAddress;
  12452. }
  12453. if (connectOptions.proxyAuth) {
  12454. connectOptions.headers = connectOptions.headers || {};
  12455. connectOptions.headers['Proxy-Authorization'] = 'Basic ' +
  12456. new Buffer(connectOptions.proxyAuth).toString('base64');
  12457. }
  12458. debug('making CONNECT request');
  12459. var connectReq = self.request(connectOptions);
  12460. connectReq.useChunkedEncodingByDefault = false; // for v0.6
  12461. connectReq.once('response', onResponse); // for v0.6
  12462. connectReq.once('upgrade', onUpgrade); // for v0.6
  12463. connectReq.once('connect', onConnect); // for v0.7 or later
  12464. connectReq.once('error', onError);
  12465. connectReq.end();
  12466. function onResponse(res) {
  12467. // Very hacky. This is necessary to avoid http-parser leaks.
  12468. res.upgrade = true;
  12469. }
  12470. function onUpgrade(res, socket, head) {
  12471. // Hacky.
  12472. process.nextTick(function() {
  12473. onConnect(res, socket, head);
  12474. });
  12475. }
  12476. function onConnect(res, socket, head) {
  12477. connectReq.removeAllListeners();
  12478. socket.removeAllListeners();
  12479. if (res.statusCode !== 200) {
  12480. debug('tunneling socket could not be established, statusCode=%d',
  12481. res.statusCode);
  12482. socket.destroy();
  12483. var error = new Error('tunneling socket could not be established, ' +
  12484. 'statusCode=' + res.statusCode);
  12485. error.code = 'ECONNRESET';
  12486. options.request.emit('error', error);
  12487. self.removeSocket(placeholder);
  12488. return;
  12489. }
  12490. if (head.length > 0) {
  12491. debug('got illegal response body from proxy');
  12492. socket.destroy();
  12493. var error = new Error('got illegal response body from proxy');
  12494. error.code = 'ECONNRESET';
  12495. options.request.emit('error', error);
  12496. self.removeSocket(placeholder);
  12497. return;
  12498. }
  12499. debug('tunneling connection has established');
  12500. self.sockets[self.sockets.indexOf(placeholder)] = socket;
  12501. return cb(socket);
  12502. }
  12503. function onError(cause) {
  12504. connectReq.removeAllListeners();
  12505. debug('tunneling socket could not be established, cause=%s\n',
  12506. cause.message, cause.stack);
  12507. var error = new Error('tunneling socket could not be established, ' +
  12508. 'cause=' + cause.message);
  12509. error.code = 'ECONNRESET';
  12510. options.request.emit('error', error);
  12511. self.removeSocket(placeholder);
  12512. }
  12513. };
  12514. TunnelingAgent.prototype.removeSocket = function removeSocket(socket) {
  12515. var pos = this.sockets.indexOf(socket)
  12516. if (pos === -1) {
  12517. return;
  12518. }
  12519. this.sockets.splice(pos, 1);
  12520. var pending = this.requests.shift();
  12521. if (pending) {
  12522. // If we have pending requests and a socket gets closed a new one
  12523. // needs to be created to take over in the pool for the one that closed.
  12524. this.createSocket(pending, function(socket) {
  12525. pending.request.onSocket(socket);
  12526. });
  12527. }
  12528. };
  12529. function createSecureSocket(options, cb) {
  12530. var self = this;
  12531. TunnelingAgent.prototype.createSocket.call(self, options, function(socket) {
  12532. var hostHeader = options.request.getHeader('host');
  12533. var tlsOptions = mergeOptions({}, self.options, {
  12534. socket: socket,
  12535. servername: hostHeader ? hostHeader.replace(/:.*$/, '') : options.host
  12536. });
  12537. // 0 is dummy port for v0.6
  12538. var secureSocket = tls.connect(0, tlsOptions);
  12539. self.sockets[self.sockets.indexOf(socket)] = secureSocket;
  12540. cb(secureSocket);
  12541. });
  12542. }
  12543. function toOptions(host, port, localAddress) {
  12544. if (typeof host === 'string') { // since v0.10
  12545. return {
  12546. host: host,
  12547. port: port,
  12548. localAddress: localAddress
  12549. };
  12550. }
  12551. return host; // for v0.11 or later
  12552. }
  12553. function mergeOptions(target) {
  12554. for (var i = 1, len = arguments.length; i < len; ++i) {
  12555. var overrides = arguments[i];
  12556. if (typeof overrides === 'object') {
  12557. var keys = Object.keys(overrides);
  12558. for (var j = 0, keyLen = keys.length; j < keyLen; ++j) {
  12559. var k = keys[j];
  12560. if (overrides[k] !== undefined) {
  12561. target[k] = overrides[k];
  12562. }
  12563. }
  12564. }
  12565. }
  12566. return target;
  12567. }
  12568. var debug;
  12569. if (process.env.NODE_DEBUG && /\btunnel\b/.test(process.env.NODE_DEBUG)) {
  12570. debug = function() {
  12571. var args = Array.prototype.slice.call(arguments);
  12572. if (typeof args[0] === 'string') {
  12573. args[0] = 'TUNNEL: ' + args[0];
  12574. } else {
  12575. args.unshift('TUNNEL:');
  12576. }
  12577. console.error.apply(console, args);
  12578. }
  12579. } else {
  12580. debug = function() {};
  12581. }
  12582. exports.debug = debug; // for test
  12583. /***/ }),
  12584. /***/ 1773:
  12585. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  12586. "use strict";
  12587. const Client = __nccwpck_require__(3598)
  12588. const Dispatcher = __nccwpck_require__(412)
  12589. const errors = __nccwpck_require__(8045)
  12590. const Pool = __nccwpck_require__(4634)
  12591. const BalancedPool = __nccwpck_require__(7931)
  12592. const Agent = __nccwpck_require__(7890)
  12593. const util = __nccwpck_require__(3983)
  12594. const { InvalidArgumentError } = errors
  12595. const api = __nccwpck_require__(4059)
  12596. const buildConnector = __nccwpck_require__(2067)
  12597. const MockClient = __nccwpck_require__(8687)
  12598. const MockAgent = __nccwpck_require__(6771)
  12599. const MockPool = __nccwpck_require__(6193)
  12600. const mockErrors = __nccwpck_require__(888)
  12601. const ProxyAgent = __nccwpck_require__(7858)
  12602. const RetryHandler = __nccwpck_require__(2286)
  12603. const { getGlobalDispatcher, setGlobalDispatcher } = __nccwpck_require__(1892)
  12604. const DecoratorHandler = __nccwpck_require__(6930)
  12605. const RedirectHandler = __nccwpck_require__(2860)
  12606. const createRedirectInterceptor = __nccwpck_require__(8861)
  12607. let hasCrypto
  12608. try {
  12609. __nccwpck_require__(6113)
  12610. hasCrypto = true
  12611. } catch {
  12612. hasCrypto = false
  12613. }
  12614. Object.assign(Dispatcher.prototype, api)
  12615. module.exports.Dispatcher = Dispatcher
  12616. module.exports.Client = Client
  12617. module.exports.Pool = Pool
  12618. module.exports.BalancedPool = BalancedPool
  12619. module.exports.Agent = Agent
  12620. module.exports.ProxyAgent = ProxyAgent
  12621. module.exports.RetryHandler = RetryHandler
  12622. module.exports.DecoratorHandler = DecoratorHandler
  12623. module.exports.RedirectHandler = RedirectHandler
  12624. module.exports.createRedirectInterceptor = createRedirectInterceptor
  12625. module.exports.buildConnector = buildConnector
  12626. module.exports.errors = errors
  12627. function makeDispatcher (fn) {
  12628. return (url, opts, handler) => {
  12629. if (typeof opts === 'function') {
  12630. handler = opts
  12631. opts = null
  12632. }
  12633. if (!url || (typeof url !== 'string' && typeof url !== 'object' && !(url instanceof URL))) {
  12634. throw new InvalidArgumentError('invalid url')
  12635. }
  12636. if (opts != null && typeof opts !== 'object') {
  12637. throw new InvalidArgumentError('invalid opts')
  12638. }
  12639. if (opts && opts.path != null) {
  12640. if (typeof opts.path !== 'string') {
  12641. throw new InvalidArgumentError('invalid opts.path')
  12642. }
  12643. let path = opts.path
  12644. if (!opts.path.startsWith('/')) {
  12645. path = `/${path}`
  12646. }
  12647. url = new URL(util.parseOrigin(url).origin + path)
  12648. } else {
  12649. if (!opts) {
  12650. opts = typeof url === 'object' ? url : {}
  12651. }
  12652. url = util.parseURL(url)
  12653. }
  12654. const { agent, dispatcher = getGlobalDispatcher() } = opts
  12655. if (agent) {
  12656. throw new InvalidArgumentError('unsupported opts.agent. Did you mean opts.client?')
  12657. }
  12658. return fn.call(dispatcher, {
  12659. ...opts,
  12660. origin: url.origin,
  12661. path: url.search ? `${url.pathname}${url.search}` : url.pathname,
  12662. method: opts.method || (opts.body ? 'PUT' : 'GET')
  12663. }, handler)
  12664. }
  12665. }
  12666. module.exports.setGlobalDispatcher = setGlobalDispatcher
  12667. module.exports.getGlobalDispatcher = getGlobalDispatcher
  12668. if (util.nodeMajor > 16 || (util.nodeMajor === 16 && util.nodeMinor >= 8)) {
  12669. let fetchImpl = null
  12670. module.exports.fetch = async function fetch (resource) {
  12671. if (!fetchImpl) {
  12672. fetchImpl = (__nccwpck_require__(4881).fetch)
  12673. }
  12674. try {
  12675. return await fetchImpl(...arguments)
  12676. } catch (err) {
  12677. if (typeof err === 'object') {
  12678. Error.captureStackTrace(err, this)
  12679. }
  12680. throw err
  12681. }
  12682. }
  12683. module.exports.Headers = __nccwpck_require__(554).Headers
  12684. module.exports.Response = __nccwpck_require__(7823).Response
  12685. module.exports.Request = __nccwpck_require__(8359).Request
  12686. module.exports.FormData = __nccwpck_require__(2015).FormData
  12687. module.exports.File = __nccwpck_require__(8511).File
  12688. module.exports.FileReader = __nccwpck_require__(1446).FileReader
  12689. const { setGlobalOrigin, getGlobalOrigin } = __nccwpck_require__(1246)
  12690. module.exports.setGlobalOrigin = setGlobalOrigin
  12691. module.exports.getGlobalOrigin = getGlobalOrigin
  12692. const { CacheStorage } = __nccwpck_require__(7907)
  12693. const { kConstruct } = __nccwpck_require__(9174)
  12694. // Cache & CacheStorage are tightly coupled with fetch. Even if it may run
  12695. // in an older version of Node, it doesn't have any use without fetch.
  12696. module.exports.caches = new CacheStorage(kConstruct)
  12697. }
  12698. if (util.nodeMajor >= 16) {
  12699. const { deleteCookie, getCookies, getSetCookies, setCookie } = __nccwpck_require__(1724)
  12700. module.exports.deleteCookie = deleteCookie
  12701. module.exports.getCookies = getCookies
  12702. module.exports.getSetCookies = getSetCookies
  12703. module.exports.setCookie = setCookie
  12704. const { parseMIMEType, serializeAMimeType } = __nccwpck_require__(685)
  12705. module.exports.parseMIMEType = parseMIMEType
  12706. module.exports.serializeAMimeType = serializeAMimeType
  12707. }
  12708. if (util.nodeMajor >= 18 && hasCrypto) {
  12709. const { WebSocket } = __nccwpck_require__(4284)
  12710. module.exports.WebSocket = WebSocket
  12711. }
  12712. module.exports.request = makeDispatcher(api.request)
  12713. module.exports.stream = makeDispatcher(api.stream)
  12714. module.exports.pipeline = makeDispatcher(api.pipeline)
  12715. module.exports.connect = makeDispatcher(api.connect)
  12716. module.exports.upgrade = makeDispatcher(api.upgrade)
  12717. module.exports.MockClient = MockClient
  12718. module.exports.MockPool = MockPool
  12719. module.exports.MockAgent = MockAgent
  12720. module.exports.mockErrors = mockErrors
  12721. /***/ }),
  12722. /***/ 7890:
  12723. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  12724. "use strict";
  12725. const { InvalidArgumentError } = __nccwpck_require__(8045)
  12726. const { kClients, kRunning, kClose, kDestroy, kDispatch, kInterceptors } = __nccwpck_require__(2785)
  12727. const DispatcherBase = __nccwpck_require__(4839)
  12728. const Pool = __nccwpck_require__(4634)
  12729. const Client = __nccwpck_require__(3598)
  12730. const util = __nccwpck_require__(3983)
  12731. const createRedirectInterceptor = __nccwpck_require__(8861)
  12732. const { WeakRef, FinalizationRegistry } = __nccwpck_require__(6436)()
  12733. const kOnConnect = Symbol('onConnect')
  12734. const kOnDisconnect = Symbol('onDisconnect')
  12735. const kOnConnectionError = Symbol('onConnectionError')
  12736. const kMaxRedirections = Symbol('maxRedirections')
  12737. const kOnDrain = Symbol('onDrain')
  12738. const kFactory = Symbol('factory')
  12739. const kFinalizer = Symbol('finalizer')
  12740. const kOptions = Symbol('options')
  12741. function defaultFactory (origin, opts) {
  12742. return opts && opts.connections === 1
  12743. ? new Client(origin, opts)
  12744. : new Pool(origin, opts)
  12745. }
  12746. class Agent extends DispatcherBase {
  12747. constructor ({ factory = defaultFactory, maxRedirections = 0, connect, ...options } = {}) {
  12748. super()
  12749. if (typeof factory !== 'function') {
  12750. throw new InvalidArgumentError('factory must be a function.')
  12751. }
  12752. if (connect != null && typeof connect !== 'function' && typeof connect !== 'object') {
  12753. throw new InvalidArgumentError('connect must be a function or an object')
  12754. }
  12755. if (!Number.isInteger(maxRedirections) || maxRedirections < 0) {
  12756. throw new InvalidArgumentError('maxRedirections must be a positive number')
  12757. }
  12758. if (connect && typeof connect !== 'function') {
  12759. connect = { ...connect }
  12760. }
  12761. this[kInterceptors] = options.interceptors && options.interceptors.Agent && Array.isArray(options.interceptors.Agent)
  12762. ? options.interceptors.Agent
  12763. : [createRedirectInterceptor({ maxRedirections })]
  12764. this[kOptions] = { ...util.deepClone(options), connect }
  12765. this[kOptions].interceptors = options.interceptors
  12766. ? { ...options.interceptors }
  12767. : undefined
  12768. this[kMaxRedirections] = maxRedirections
  12769. this[kFactory] = factory
  12770. this[kClients] = new Map()
  12771. this[kFinalizer] = new FinalizationRegistry(/* istanbul ignore next: gc is undeterministic */ key => {
  12772. const ref = this[kClients].get(key)
  12773. if (ref !== undefined && ref.deref() === undefined) {
  12774. this[kClients].delete(key)
  12775. }
  12776. })
  12777. const agent = this
  12778. this[kOnDrain] = (origin, targets) => {
  12779. agent.emit('drain', origin, [agent, ...targets])
  12780. }
  12781. this[kOnConnect] = (origin, targets) => {
  12782. agent.emit('connect', origin, [agent, ...targets])
  12783. }
  12784. this[kOnDisconnect] = (origin, targets, err) => {
  12785. agent.emit('disconnect', origin, [agent, ...targets], err)
  12786. }
  12787. this[kOnConnectionError] = (origin, targets, err) => {
  12788. agent.emit('connectionError', origin, [agent, ...targets], err)
  12789. }
  12790. }
  12791. get [kRunning] () {
  12792. let ret = 0
  12793. for (const ref of this[kClients].values()) {
  12794. const client = ref.deref()
  12795. /* istanbul ignore next: gc is undeterministic */
  12796. if (client) {
  12797. ret += client[kRunning]
  12798. }
  12799. }
  12800. return ret
  12801. }
  12802. [kDispatch] (opts, handler) {
  12803. let key
  12804. if (opts.origin && (typeof opts.origin === 'string' || opts.origin instanceof URL)) {
  12805. key = String(opts.origin)
  12806. } else {
  12807. throw new InvalidArgumentError('opts.origin must be a non-empty string or URL.')
  12808. }
  12809. const ref = this[kClients].get(key)
  12810. let dispatcher = ref ? ref.deref() : null
  12811. if (!dispatcher) {
  12812. dispatcher = this[kFactory](opts.origin, this[kOptions])
  12813. .on('drain', this[kOnDrain])
  12814. .on('connect', this[kOnConnect])
  12815. .on('disconnect', this[kOnDisconnect])
  12816. .on('connectionError', this[kOnConnectionError])
  12817. this[kClients].set(key, new WeakRef(dispatcher))
  12818. this[kFinalizer].register(dispatcher, key)
  12819. }
  12820. return dispatcher.dispatch(opts, handler)
  12821. }
  12822. async [kClose] () {
  12823. const closePromises = []
  12824. for (const ref of this[kClients].values()) {
  12825. const client = ref.deref()
  12826. /* istanbul ignore else: gc is undeterministic */
  12827. if (client) {
  12828. closePromises.push(client.close())
  12829. }
  12830. }
  12831. await Promise.all(closePromises)
  12832. }
  12833. async [kDestroy] (err) {
  12834. const destroyPromises = []
  12835. for (const ref of this[kClients].values()) {
  12836. const client = ref.deref()
  12837. /* istanbul ignore else: gc is undeterministic */
  12838. if (client) {
  12839. destroyPromises.push(client.destroy(err))
  12840. }
  12841. }
  12842. await Promise.all(destroyPromises)
  12843. }
  12844. }
  12845. module.exports = Agent
  12846. /***/ }),
  12847. /***/ 7032:
  12848. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  12849. const { addAbortListener } = __nccwpck_require__(3983)
  12850. const { RequestAbortedError } = __nccwpck_require__(8045)
  12851. const kListener = Symbol('kListener')
  12852. const kSignal = Symbol('kSignal')
  12853. function abort (self) {
  12854. if (self.abort) {
  12855. self.abort()
  12856. } else {
  12857. self.onError(new RequestAbortedError())
  12858. }
  12859. }
  12860. function addSignal (self, signal) {
  12861. self[kSignal] = null
  12862. self[kListener] = null
  12863. if (!signal) {
  12864. return
  12865. }
  12866. if (signal.aborted) {
  12867. abort(self)
  12868. return
  12869. }
  12870. self[kSignal] = signal
  12871. self[kListener] = () => {
  12872. abort(self)
  12873. }
  12874. addAbortListener(self[kSignal], self[kListener])
  12875. }
  12876. function removeSignal (self) {
  12877. if (!self[kSignal]) {
  12878. return
  12879. }
  12880. if ('removeEventListener' in self[kSignal]) {
  12881. self[kSignal].removeEventListener('abort', self[kListener])
  12882. } else {
  12883. self[kSignal].removeListener('abort', self[kListener])
  12884. }
  12885. self[kSignal] = null
  12886. self[kListener] = null
  12887. }
  12888. module.exports = {
  12889. addSignal,
  12890. removeSignal
  12891. }
  12892. /***/ }),
  12893. /***/ 9744:
  12894. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  12895. "use strict";
  12896. const { AsyncResource } = __nccwpck_require__(852)
  12897. const { InvalidArgumentError, RequestAbortedError, SocketError } = __nccwpck_require__(8045)
  12898. const util = __nccwpck_require__(3983)
  12899. const { addSignal, removeSignal } = __nccwpck_require__(7032)
  12900. class ConnectHandler extends AsyncResource {
  12901. constructor (opts, callback) {
  12902. if (!opts || typeof opts !== 'object') {
  12903. throw new InvalidArgumentError('invalid opts')
  12904. }
  12905. if (typeof callback !== 'function') {
  12906. throw new InvalidArgumentError('invalid callback')
  12907. }
  12908. const { signal, opaque, responseHeaders } = opts
  12909. if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') {
  12910. throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget')
  12911. }
  12912. super('UNDICI_CONNECT')
  12913. this.opaque = opaque || null
  12914. this.responseHeaders = responseHeaders || null
  12915. this.callback = callback
  12916. this.abort = null
  12917. addSignal(this, signal)
  12918. }
  12919. onConnect (abort, context) {
  12920. if (!this.callback) {
  12921. throw new RequestAbortedError()
  12922. }
  12923. this.abort = abort
  12924. this.context = context
  12925. }
  12926. onHeaders () {
  12927. throw new SocketError('bad connect', null)
  12928. }
  12929. onUpgrade (statusCode, rawHeaders, socket) {
  12930. const { callback, opaque, context } = this
  12931. removeSignal(this)
  12932. this.callback = null
  12933. let headers = rawHeaders
  12934. // Indicates is an HTTP2Session
  12935. if (headers != null) {
  12936. headers = this.responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)
  12937. }
  12938. this.runInAsyncScope(callback, null, null, {
  12939. statusCode,
  12940. headers,
  12941. socket,
  12942. opaque,
  12943. context
  12944. })
  12945. }
  12946. onError (err) {
  12947. const { callback, opaque } = this
  12948. removeSignal(this)
  12949. if (callback) {
  12950. this.callback = null
  12951. queueMicrotask(() => {
  12952. this.runInAsyncScope(callback, null, err, { opaque })
  12953. })
  12954. }
  12955. }
  12956. }
  12957. function connect (opts, callback) {
  12958. if (callback === undefined) {
  12959. return new Promise((resolve, reject) => {
  12960. connect.call(this, opts, (err, data) => {
  12961. return err ? reject(err) : resolve(data)
  12962. })
  12963. })
  12964. }
  12965. try {
  12966. const connectHandler = new ConnectHandler(opts, callback)
  12967. this.dispatch({ ...opts, method: 'CONNECT' }, connectHandler)
  12968. } catch (err) {
  12969. if (typeof callback !== 'function') {
  12970. throw err
  12971. }
  12972. const opaque = opts && opts.opaque
  12973. queueMicrotask(() => callback(err, { opaque }))
  12974. }
  12975. }
  12976. module.exports = connect
  12977. /***/ }),
  12978. /***/ 8752:
  12979. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  12980. "use strict";
  12981. const {
  12982. Readable,
  12983. Duplex,
  12984. PassThrough
  12985. } = __nccwpck_require__(2781)
  12986. const {
  12987. InvalidArgumentError,
  12988. InvalidReturnValueError,
  12989. RequestAbortedError
  12990. } = __nccwpck_require__(8045)
  12991. const util = __nccwpck_require__(3983)
  12992. const { AsyncResource } = __nccwpck_require__(852)
  12993. const { addSignal, removeSignal } = __nccwpck_require__(7032)
  12994. const assert = __nccwpck_require__(9491)
  12995. const kResume = Symbol('resume')
  12996. class PipelineRequest extends Readable {
  12997. constructor () {
  12998. super({ autoDestroy: true })
  12999. this[kResume] = null
  13000. }
  13001. _read () {
  13002. const { [kResume]: resume } = this
  13003. if (resume) {
  13004. this[kResume] = null
  13005. resume()
  13006. }
  13007. }
  13008. _destroy (err, callback) {
  13009. this._read()
  13010. callback(err)
  13011. }
  13012. }
  13013. class PipelineResponse extends Readable {
  13014. constructor (resume) {
  13015. super({ autoDestroy: true })
  13016. this[kResume] = resume
  13017. }
  13018. _read () {
  13019. this[kResume]()
  13020. }
  13021. _destroy (err, callback) {
  13022. if (!err && !this._readableState.endEmitted) {
  13023. err = new RequestAbortedError()
  13024. }
  13025. callback(err)
  13026. }
  13027. }
  13028. class PipelineHandler extends AsyncResource {
  13029. constructor (opts, handler) {
  13030. if (!opts || typeof opts !== 'object') {
  13031. throw new InvalidArgumentError('invalid opts')
  13032. }
  13033. if (typeof handler !== 'function') {
  13034. throw new InvalidArgumentError('invalid handler')
  13035. }
  13036. const { signal, method, opaque, onInfo, responseHeaders } = opts
  13037. if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') {
  13038. throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget')
  13039. }
  13040. if (method === 'CONNECT') {
  13041. throw new InvalidArgumentError('invalid method')
  13042. }
  13043. if (onInfo && typeof onInfo !== 'function') {
  13044. throw new InvalidArgumentError('invalid onInfo callback')
  13045. }
  13046. super('UNDICI_PIPELINE')
  13047. this.opaque = opaque || null
  13048. this.responseHeaders = responseHeaders || null
  13049. this.handler = handler
  13050. this.abort = null
  13051. this.context = null
  13052. this.onInfo = onInfo || null
  13053. this.req = new PipelineRequest().on('error', util.nop)
  13054. this.ret = new Duplex({
  13055. readableObjectMode: opts.objectMode,
  13056. autoDestroy: true,
  13057. read: () => {
  13058. const { body } = this
  13059. if (body && body.resume) {
  13060. body.resume()
  13061. }
  13062. },
  13063. write: (chunk, encoding, callback) => {
  13064. const { req } = this
  13065. if (req.push(chunk, encoding) || req._readableState.destroyed) {
  13066. callback()
  13067. } else {
  13068. req[kResume] = callback
  13069. }
  13070. },
  13071. destroy: (err, callback) => {
  13072. const { body, req, res, ret, abort } = this
  13073. if (!err && !ret._readableState.endEmitted) {
  13074. err = new RequestAbortedError()
  13075. }
  13076. if (abort && err) {
  13077. abort()
  13078. }
  13079. util.destroy(body, err)
  13080. util.destroy(req, err)
  13081. util.destroy(res, err)
  13082. removeSignal(this)
  13083. callback(err)
  13084. }
  13085. }).on('prefinish', () => {
  13086. const { req } = this
  13087. // Node < 15 does not call _final in same tick.
  13088. req.push(null)
  13089. })
  13090. this.res = null
  13091. addSignal(this, signal)
  13092. }
  13093. onConnect (abort, context) {
  13094. const { ret, res } = this
  13095. assert(!res, 'pipeline cannot be retried')
  13096. if (ret.destroyed) {
  13097. throw new RequestAbortedError()
  13098. }
  13099. this.abort = abort
  13100. this.context = context
  13101. }
  13102. onHeaders (statusCode, rawHeaders, resume) {
  13103. const { opaque, handler, context } = this
  13104. if (statusCode < 200) {
  13105. if (this.onInfo) {
  13106. const headers = this.responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)
  13107. this.onInfo({ statusCode, headers })
  13108. }
  13109. return
  13110. }
  13111. this.res = new PipelineResponse(resume)
  13112. let body
  13113. try {
  13114. this.handler = null
  13115. const headers = this.responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)
  13116. body = this.runInAsyncScope(handler, null, {
  13117. statusCode,
  13118. headers,
  13119. opaque,
  13120. body: this.res,
  13121. context
  13122. })
  13123. } catch (err) {
  13124. this.res.on('error', util.nop)
  13125. throw err
  13126. }
  13127. if (!body || typeof body.on !== 'function') {
  13128. throw new InvalidReturnValueError('expected Readable')
  13129. }
  13130. body
  13131. .on('data', (chunk) => {
  13132. const { ret, body } = this
  13133. if (!ret.push(chunk) && body.pause) {
  13134. body.pause()
  13135. }
  13136. })
  13137. .on('error', (err) => {
  13138. const { ret } = this
  13139. util.destroy(ret, err)
  13140. })
  13141. .on('end', () => {
  13142. const { ret } = this
  13143. ret.push(null)
  13144. })
  13145. .on('close', () => {
  13146. const { ret } = this
  13147. if (!ret._readableState.ended) {
  13148. util.destroy(ret, new RequestAbortedError())
  13149. }
  13150. })
  13151. this.body = body
  13152. }
  13153. onData (chunk) {
  13154. const { res } = this
  13155. return res.push(chunk)
  13156. }
  13157. onComplete (trailers) {
  13158. const { res } = this
  13159. res.push(null)
  13160. }
  13161. onError (err) {
  13162. const { ret } = this
  13163. this.handler = null
  13164. util.destroy(ret, err)
  13165. }
  13166. }
  13167. function pipeline (opts, handler) {
  13168. try {
  13169. const pipelineHandler = new PipelineHandler(opts, handler)
  13170. this.dispatch({ ...opts, body: pipelineHandler.req }, pipelineHandler)
  13171. return pipelineHandler.ret
  13172. } catch (err) {
  13173. return new PassThrough().destroy(err)
  13174. }
  13175. }
  13176. module.exports = pipeline
  13177. /***/ }),
  13178. /***/ 5448:
  13179. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  13180. "use strict";
  13181. const Readable = __nccwpck_require__(3858)
  13182. const {
  13183. InvalidArgumentError,
  13184. RequestAbortedError
  13185. } = __nccwpck_require__(8045)
  13186. const util = __nccwpck_require__(3983)
  13187. const { getResolveErrorBodyCallback } = __nccwpck_require__(7474)
  13188. const { AsyncResource } = __nccwpck_require__(852)
  13189. const { addSignal, removeSignal } = __nccwpck_require__(7032)
  13190. class RequestHandler extends AsyncResource {
  13191. constructor (opts, callback) {
  13192. if (!opts || typeof opts !== 'object') {
  13193. throw new InvalidArgumentError('invalid opts')
  13194. }
  13195. const { signal, method, opaque, body, onInfo, responseHeaders, throwOnError, highWaterMark } = opts
  13196. try {
  13197. if (typeof callback !== 'function') {
  13198. throw new InvalidArgumentError('invalid callback')
  13199. }
  13200. if (highWaterMark && (typeof highWaterMark !== 'number' || highWaterMark < 0)) {
  13201. throw new InvalidArgumentError('invalid highWaterMark')
  13202. }
  13203. if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') {
  13204. throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget')
  13205. }
  13206. if (method === 'CONNECT') {
  13207. throw new InvalidArgumentError('invalid method')
  13208. }
  13209. if (onInfo && typeof onInfo !== 'function') {
  13210. throw new InvalidArgumentError('invalid onInfo callback')
  13211. }
  13212. super('UNDICI_REQUEST')
  13213. } catch (err) {
  13214. if (util.isStream(body)) {
  13215. util.destroy(body.on('error', util.nop), err)
  13216. }
  13217. throw err
  13218. }
  13219. this.responseHeaders = responseHeaders || null
  13220. this.opaque = opaque || null
  13221. this.callback = callback
  13222. this.res = null
  13223. this.abort = null
  13224. this.body = body
  13225. this.trailers = {}
  13226. this.context = null
  13227. this.onInfo = onInfo || null
  13228. this.throwOnError = throwOnError
  13229. this.highWaterMark = highWaterMark
  13230. if (util.isStream(body)) {
  13231. body.on('error', (err) => {
  13232. this.onError(err)
  13233. })
  13234. }
  13235. addSignal(this, signal)
  13236. }
  13237. onConnect (abort, context) {
  13238. if (!this.callback) {
  13239. throw new RequestAbortedError()
  13240. }
  13241. this.abort = abort
  13242. this.context = context
  13243. }
  13244. onHeaders (statusCode, rawHeaders, resume, statusMessage) {
  13245. const { callback, opaque, abort, context, responseHeaders, highWaterMark } = this
  13246. const headers = responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)
  13247. if (statusCode < 200) {
  13248. if (this.onInfo) {
  13249. this.onInfo({ statusCode, headers })
  13250. }
  13251. return
  13252. }
  13253. const parsedHeaders = responseHeaders === 'raw' ? util.parseHeaders(rawHeaders) : headers
  13254. const contentType = parsedHeaders['content-type']
  13255. const body = new Readable({ resume, abort, contentType, highWaterMark })
  13256. this.callback = null
  13257. this.res = body
  13258. if (callback !== null) {
  13259. if (this.throwOnError && statusCode >= 400) {
  13260. this.runInAsyncScope(getResolveErrorBodyCallback, null,
  13261. { callback, body, contentType, statusCode, statusMessage, headers }
  13262. )
  13263. } else {
  13264. this.runInAsyncScope(callback, null, null, {
  13265. statusCode,
  13266. headers,
  13267. trailers: this.trailers,
  13268. opaque,
  13269. body,
  13270. context
  13271. })
  13272. }
  13273. }
  13274. }
  13275. onData (chunk) {
  13276. const { res } = this
  13277. return res.push(chunk)
  13278. }
  13279. onComplete (trailers) {
  13280. const { res } = this
  13281. removeSignal(this)
  13282. util.parseHeaders(trailers, this.trailers)
  13283. res.push(null)
  13284. }
  13285. onError (err) {
  13286. const { res, callback, body, opaque } = this
  13287. removeSignal(this)
  13288. if (callback) {
  13289. // TODO: Does this need queueMicrotask?
  13290. this.callback = null
  13291. queueMicrotask(() => {
  13292. this.runInAsyncScope(callback, null, err, { opaque })
  13293. })
  13294. }
  13295. if (res) {
  13296. this.res = null
  13297. // Ensure all queued handlers are invoked before destroying res.
  13298. queueMicrotask(() => {
  13299. util.destroy(res, err)
  13300. })
  13301. }
  13302. if (body) {
  13303. this.body = null
  13304. util.destroy(body, err)
  13305. }
  13306. }
  13307. }
  13308. function request (opts, callback) {
  13309. if (callback === undefined) {
  13310. return new Promise((resolve, reject) => {
  13311. request.call(this, opts, (err, data) => {
  13312. return err ? reject(err) : resolve(data)
  13313. })
  13314. })
  13315. }
  13316. try {
  13317. this.dispatch(opts, new RequestHandler(opts, callback))
  13318. } catch (err) {
  13319. if (typeof callback !== 'function') {
  13320. throw err
  13321. }
  13322. const opaque = opts && opts.opaque
  13323. queueMicrotask(() => callback(err, { opaque }))
  13324. }
  13325. }
  13326. module.exports = request
  13327. module.exports.RequestHandler = RequestHandler
  13328. /***/ }),
  13329. /***/ 5395:
  13330. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  13331. "use strict";
  13332. const { finished, PassThrough } = __nccwpck_require__(2781)
  13333. const {
  13334. InvalidArgumentError,
  13335. InvalidReturnValueError,
  13336. RequestAbortedError
  13337. } = __nccwpck_require__(8045)
  13338. const util = __nccwpck_require__(3983)
  13339. const { getResolveErrorBodyCallback } = __nccwpck_require__(7474)
  13340. const { AsyncResource } = __nccwpck_require__(852)
  13341. const { addSignal, removeSignal } = __nccwpck_require__(7032)
  13342. class StreamHandler extends AsyncResource {
  13343. constructor (opts, factory, callback) {
  13344. if (!opts || typeof opts !== 'object') {
  13345. throw new InvalidArgumentError('invalid opts')
  13346. }
  13347. const { signal, method, opaque, body, onInfo, responseHeaders, throwOnError } = opts
  13348. try {
  13349. if (typeof callback !== 'function') {
  13350. throw new InvalidArgumentError('invalid callback')
  13351. }
  13352. if (typeof factory !== 'function') {
  13353. throw new InvalidArgumentError('invalid factory')
  13354. }
  13355. if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') {
  13356. throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget')
  13357. }
  13358. if (method === 'CONNECT') {
  13359. throw new InvalidArgumentError('invalid method')
  13360. }
  13361. if (onInfo && typeof onInfo !== 'function') {
  13362. throw new InvalidArgumentError('invalid onInfo callback')
  13363. }
  13364. super('UNDICI_STREAM')
  13365. } catch (err) {
  13366. if (util.isStream(body)) {
  13367. util.destroy(body.on('error', util.nop), err)
  13368. }
  13369. throw err
  13370. }
  13371. this.responseHeaders = responseHeaders || null
  13372. this.opaque = opaque || null
  13373. this.factory = factory
  13374. this.callback = callback
  13375. this.res = null
  13376. this.abort = null
  13377. this.context = null
  13378. this.trailers = null
  13379. this.body = body
  13380. this.onInfo = onInfo || null
  13381. this.throwOnError = throwOnError || false
  13382. if (util.isStream(body)) {
  13383. body.on('error', (err) => {
  13384. this.onError(err)
  13385. })
  13386. }
  13387. addSignal(this, signal)
  13388. }
  13389. onConnect (abort, context) {
  13390. if (!this.callback) {
  13391. throw new RequestAbortedError()
  13392. }
  13393. this.abort = abort
  13394. this.context = context
  13395. }
  13396. onHeaders (statusCode, rawHeaders, resume, statusMessage) {
  13397. const { factory, opaque, context, callback, responseHeaders } = this
  13398. const headers = responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)
  13399. if (statusCode < 200) {
  13400. if (this.onInfo) {
  13401. this.onInfo({ statusCode, headers })
  13402. }
  13403. return
  13404. }
  13405. this.factory = null
  13406. let res
  13407. if (this.throwOnError && statusCode >= 400) {
  13408. const parsedHeaders = responseHeaders === 'raw' ? util.parseHeaders(rawHeaders) : headers
  13409. const contentType = parsedHeaders['content-type']
  13410. res = new PassThrough()
  13411. this.callback = null
  13412. this.runInAsyncScope(getResolveErrorBodyCallback, null,
  13413. { callback, body: res, contentType, statusCode, statusMessage, headers }
  13414. )
  13415. } else {
  13416. if (factory === null) {
  13417. return
  13418. }
  13419. res = this.runInAsyncScope(factory, null, {
  13420. statusCode,
  13421. headers,
  13422. opaque,
  13423. context
  13424. })
  13425. if (
  13426. !res ||
  13427. typeof res.write !== 'function' ||
  13428. typeof res.end !== 'function' ||
  13429. typeof res.on !== 'function'
  13430. ) {
  13431. throw new InvalidReturnValueError('expected Writable')
  13432. }
  13433. // TODO: Avoid finished. It registers an unnecessary amount of listeners.
  13434. finished(res, { readable: false }, (err) => {
  13435. const { callback, res, opaque, trailers, abort } = this
  13436. this.res = null
  13437. if (err || !res.readable) {
  13438. util.destroy(res, err)
  13439. }
  13440. this.callback = null
  13441. this.runInAsyncScope(callback, null, err || null, { opaque, trailers })
  13442. if (err) {
  13443. abort()
  13444. }
  13445. })
  13446. }
  13447. res.on('drain', resume)
  13448. this.res = res
  13449. const needDrain = res.writableNeedDrain !== undefined
  13450. ? res.writableNeedDrain
  13451. : res._writableState && res._writableState.needDrain
  13452. return needDrain !== true
  13453. }
  13454. onData (chunk) {
  13455. const { res } = this
  13456. return res ? res.write(chunk) : true
  13457. }
  13458. onComplete (trailers) {
  13459. const { res } = this
  13460. removeSignal(this)
  13461. if (!res) {
  13462. return
  13463. }
  13464. this.trailers = util.parseHeaders(trailers)
  13465. res.end()
  13466. }
  13467. onError (err) {
  13468. const { res, callback, opaque, body } = this
  13469. removeSignal(this)
  13470. this.factory = null
  13471. if (res) {
  13472. this.res = null
  13473. util.destroy(res, err)
  13474. } else if (callback) {
  13475. this.callback = null
  13476. queueMicrotask(() => {
  13477. this.runInAsyncScope(callback, null, err, { opaque })
  13478. })
  13479. }
  13480. if (body) {
  13481. this.body = null
  13482. util.destroy(body, err)
  13483. }
  13484. }
  13485. }
  13486. function stream (opts, factory, callback) {
  13487. if (callback === undefined) {
  13488. return new Promise((resolve, reject) => {
  13489. stream.call(this, opts, factory, (err, data) => {
  13490. return err ? reject(err) : resolve(data)
  13491. })
  13492. })
  13493. }
  13494. try {
  13495. this.dispatch(opts, new StreamHandler(opts, factory, callback))
  13496. } catch (err) {
  13497. if (typeof callback !== 'function') {
  13498. throw err
  13499. }
  13500. const opaque = opts && opts.opaque
  13501. queueMicrotask(() => callback(err, { opaque }))
  13502. }
  13503. }
  13504. module.exports = stream
  13505. /***/ }),
  13506. /***/ 6923:
  13507. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  13508. "use strict";
  13509. const { InvalidArgumentError, RequestAbortedError, SocketError } = __nccwpck_require__(8045)
  13510. const { AsyncResource } = __nccwpck_require__(852)
  13511. const util = __nccwpck_require__(3983)
  13512. const { addSignal, removeSignal } = __nccwpck_require__(7032)
  13513. const assert = __nccwpck_require__(9491)
  13514. class UpgradeHandler extends AsyncResource {
  13515. constructor (opts, callback) {
  13516. if (!opts || typeof opts !== 'object') {
  13517. throw new InvalidArgumentError('invalid opts')
  13518. }
  13519. if (typeof callback !== 'function') {
  13520. throw new InvalidArgumentError('invalid callback')
  13521. }
  13522. const { signal, opaque, responseHeaders } = opts
  13523. if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') {
  13524. throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget')
  13525. }
  13526. super('UNDICI_UPGRADE')
  13527. this.responseHeaders = responseHeaders || null
  13528. this.opaque = opaque || null
  13529. this.callback = callback
  13530. this.abort = null
  13531. this.context = null
  13532. addSignal(this, signal)
  13533. }
  13534. onConnect (abort, context) {
  13535. if (!this.callback) {
  13536. throw new RequestAbortedError()
  13537. }
  13538. this.abort = abort
  13539. this.context = null
  13540. }
  13541. onHeaders () {
  13542. throw new SocketError('bad upgrade', null)
  13543. }
  13544. onUpgrade (statusCode, rawHeaders, socket) {
  13545. const { callback, opaque, context } = this
  13546. assert.strictEqual(statusCode, 101)
  13547. removeSignal(this)
  13548. this.callback = null
  13549. const headers = this.responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)
  13550. this.runInAsyncScope(callback, null, null, {
  13551. headers,
  13552. socket,
  13553. opaque,
  13554. context
  13555. })
  13556. }
  13557. onError (err) {
  13558. const { callback, opaque } = this
  13559. removeSignal(this)
  13560. if (callback) {
  13561. this.callback = null
  13562. queueMicrotask(() => {
  13563. this.runInAsyncScope(callback, null, err, { opaque })
  13564. })
  13565. }
  13566. }
  13567. }
  13568. function upgrade (opts, callback) {
  13569. if (callback === undefined) {
  13570. return new Promise((resolve, reject) => {
  13571. upgrade.call(this, opts, (err, data) => {
  13572. return err ? reject(err) : resolve(data)
  13573. })
  13574. })
  13575. }
  13576. try {
  13577. const upgradeHandler = new UpgradeHandler(opts, callback)
  13578. this.dispatch({
  13579. ...opts,
  13580. method: opts.method || 'GET',
  13581. upgrade: opts.protocol || 'Websocket'
  13582. }, upgradeHandler)
  13583. } catch (err) {
  13584. if (typeof callback !== 'function') {
  13585. throw err
  13586. }
  13587. const opaque = opts && opts.opaque
  13588. queueMicrotask(() => callback(err, { opaque }))
  13589. }
  13590. }
  13591. module.exports = upgrade
  13592. /***/ }),
  13593. /***/ 4059:
  13594. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  13595. "use strict";
  13596. module.exports.request = __nccwpck_require__(5448)
  13597. module.exports.stream = __nccwpck_require__(5395)
  13598. module.exports.pipeline = __nccwpck_require__(8752)
  13599. module.exports.upgrade = __nccwpck_require__(6923)
  13600. module.exports.connect = __nccwpck_require__(9744)
  13601. /***/ }),
  13602. /***/ 3858:
  13603. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  13604. "use strict";
  13605. // Ported from https://github.com/nodejs/undici/pull/907
  13606. const assert = __nccwpck_require__(9491)
  13607. const { Readable } = __nccwpck_require__(2781)
  13608. const { RequestAbortedError, NotSupportedError, InvalidArgumentError } = __nccwpck_require__(8045)
  13609. const util = __nccwpck_require__(3983)
  13610. const { ReadableStreamFrom, toUSVString } = __nccwpck_require__(3983)
  13611. let Blob
  13612. const kConsume = Symbol('kConsume')
  13613. const kReading = Symbol('kReading')
  13614. const kBody = Symbol('kBody')
  13615. const kAbort = Symbol('abort')
  13616. const kContentType = Symbol('kContentType')
  13617. const noop = () => {}
  13618. module.exports = class BodyReadable extends Readable {
  13619. constructor ({
  13620. resume,
  13621. abort,
  13622. contentType = '',
  13623. highWaterMark = 64 * 1024 // Same as nodejs fs streams.
  13624. }) {
  13625. super({
  13626. autoDestroy: true,
  13627. read: resume,
  13628. highWaterMark
  13629. })
  13630. this._readableState.dataEmitted = false
  13631. this[kAbort] = abort
  13632. this[kConsume] = null
  13633. this[kBody] = null
  13634. this[kContentType] = contentType
  13635. // Is stream being consumed through Readable API?
  13636. // This is an optimization so that we avoid checking
  13637. // for 'data' and 'readable' listeners in the hot path
  13638. // inside push().
  13639. this[kReading] = false
  13640. }
  13641. destroy (err) {
  13642. if (this.destroyed) {
  13643. // Node < 16
  13644. return this
  13645. }
  13646. if (!err && !this._readableState.endEmitted) {
  13647. err = new RequestAbortedError()
  13648. }
  13649. if (err) {
  13650. this[kAbort]()
  13651. }
  13652. return super.destroy(err)
  13653. }
  13654. emit (ev, ...args) {
  13655. if (ev === 'data') {
  13656. // Node < 16.7
  13657. this._readableState.dataEmitted = true
  13658. } else if (ev === 'error') {
  13659. // Node < 16
  13660. this._readableState.errorEmitted = true
  13661. }
  13662. return super.emit(ev, ...args)
  13663. }
  13664. on (ev, ...args) {
  13665. if (ev === 'data' || ev === 'readable') {
  13666. this[kReading] = true
  13667. }
  13668. return super.on(ev, ...args)
  13669. }
  13670. addListener (ev, ...args) {
  13671. return this.on(ev, ...args)
  13672. }
  13673. off (ev, ...args) {
  13674. const ret = super.off(ev, ...args)
  13675. if (ev === 'data' || ev === 'readable') {
  13676. this[kReading] = (
  13677. this.listenerCount('data') > 0 ||
  13678. this.listenerCount('readable') > 0
  13679. )
  13680. }
  13681. return ret
  13682. }
  13683. removeListener (ev, ...args) {
  13684. return this.off(ev, ...args)
  13685. }
  13686. push (chunk) {
  13687. if (this[kConsume] && chunk !== null && this.readableLength === 0) {
  13688. consumePush(this[kConsume], chunk)
  13689. return this[kReading] ? super.push(chunk) : true
  13690. }
  13691. return super.push(chunk)
  13692. }
  13693. // https://fetch.spec.whatwg.org/#dom-body-text
  13694. async text () {
  13695. return consume(this, 'text')
  13696. }
  13697. // https://fetch.spec.whatwg.org/#dom-body-json
  13698. async json () {
  13699. return consume(this, 'json')
  13700. }
  13701. // https://fetch.spec.whatwg.org/#dom-body-blob
  13702. async blob () {
  13703. return consume(this, 'blob')
  13704. }
  13705. // https://fetch.spec.whatwg.org/#dom-body-arraybuffer
  13706. async arrayBuffer () {
  13707. return consume(this, 'arrayBuffer')
  13708. }
  13709. // https://fetch.spec.whatwg.org/#dom-body-formdata
  13710. async formData () {
  13711. // TODO: Implement.
  13712. throw new NotSupportedError()
  13713. }
  13714. // https://fetch.spec.whatwg.org/#dom-body-bodyused
  13715. get bodyUsed () {
  13716. return util.isDisturbed(this)
  13717. }
  13718. // https://fetch.spec.whatwg.org/#dom-body-body
  13719. get body () {
  13720. if (!this[kBody]) {
  13721. this[kBody] = ReadableStreamFrom(this)
  13722. if (this[kConsume]) {
  13723. // TODO: Is this the best way to force a lock?
  13724. this[kBody].getReader() // Ensure stream is locked.
  13725. assert(this[kBody].locked)
  13726. }
  13727. }
  13728. return this[kBody]
  13729. }
  13730. dump (opts) {
  13731. let limit = opts && Number.isFinite(opts.limit) ? opts.limit : 262144
  13732. const signal = opts && opts.signal
  13733. if (signal) {
  13734. try {
  13735. if (typeof signal !== 'object' || !('aborted' in signal)) {
  13736. throw new InvalidArgumentError('signal must be an AbortSignal')
  13737. }
  13738. util.throwIfAborted(signal)
  13739. } catch (err) {
  13740. return Promise.reject(err)
  13741. }
  13742. }
  13743. if (this.closed) {
  13744. return Promise.resolve(null)
  13745. }
  13746. return new Promise((resolve, reject) => {
  13747. const signalListenerCleanup = signal
  13748. ? util.addAbortListener(signal, () => {
  13749. this.destroy()
  13750. })
  13751. : noop
  13752. this
  13753. .on('close', function () {
  13754. signalListenerCleanup()
  13755. if (signal && signal.aborted) {
  13756. reject(signal.reason || Object.assign(new Error('The operation was aborted'), { name: 'AbortError' }))
  13757. } else {
  13758. resolve(null)
  13759. }
  13760. })
  13761. .on('error', noop)
  13762. .on('data', function (chunk) {
  13763. limit -= chunk.length
  13764. if (limit <= 0) {
  13765. this.destroy()
  13766. }
  13767. })
  13768. .resume()
  13769. })
  13770. }
  13771. }
  13772. // https://streams.spec.whatwg.org/#readablestream-locked
  13773. function isLocked (self) {
  13774. // Consume is an implicit lock.
  13775. return (self[kBody] && self[kBody].locked === true) || self[kConsume]
  13776. }
  13777. // https://fetch.spec.whatwg.org/#body-unusable
  13778. function isUnusable (self) {
  13779. return util.isDisturbed(self) || isLocked(self)
  13780. }
  13781. async function consume (stream, type) {
  13782. if (isUnusable(stream)) {
  13783. throw new TypeError('unusable')
  13784. }
  13785. assert(!stream[kConsume])
  13786. return new Promise((resolve, reject) => {
  13787. stream[kConsume] = {
  13788. type,
  13789. stream,
  13790. resolve,
  13791. reject,
  13792. length: 0,
  13793. body: []
  13794. }
  13795. stream
  13796. .on('error', function (err) {
  13797. consumeFinish(this[kConsume], err)
  13798. })
  13799. .on('close', function () {
  13800. if (this[kConsume].body !== null) {
  13801. consumeFinish(this[kConsume], new RequestAbortedError())
  13802. }
  13803. })
  13804. process.nextTick(consumeStart, stream[kConsume])
  13805. })
  13806. }
  13807. function consumeStart (consume) {
  13808. if (consume.body === null) {
  13809. return
  13810. }
  13811. const { _readableState: state } = consume.stream
  13812. for (const chunk of state.buffer) {
  13813. consumePush(consume, chunk)
  13814. }
  13815. if (state.endEmitted) {
  13816. consumeEnd(this[kConsume])
  13817. } else {
  13818. consume.stream.on('end', function () {
  13819. consumeEnd(this[kConsume])
  13820. })
  13821. }
  13822. consume.stream.resume()
  13823. while (consume.stream.read() != null) {
  13824. // Loop
  13825. }
  13826. }
  13827. function consumeEnd (consume) {
  13828. const { type, body, resolve, stream, length } = consume
  13829. try {
  13830. if (type === 'text') {
  13831. resolve(toUSVString(Buffer.concat(body)))
  13832. } else if (type === 'json') {
  13833. resolve(JSON.parse(Buffer.concat(body)))
  13834. } else if (type === 'arrayBuffer') {
  13835. const dst = new Uint8Array(length)
  13836. let pos = 0
  13837. for (const buf of body) {
  13838. dst.set(buf, pos)
  13839. pos += buf.byteLength
  13840. }
  13841. resolve(dst.buffer)
  13842. } else if (type === 'blob') {
  13843. if (!Blob) {
  13844. Blob = (__nccwpck_require__(4300).Blob)
  13845. }
  13846. resolve(new Blob(body, { type: stream[kContentType] }))
  13847. }
  13848. consumeFinish(consume)
  13849. } catch (err) {
  13850. stream.destroy(err)
  13851. }
  13852. }
  13853. function consumePush (consume, chunk) {
  13854. consume.length += chunk.length
  13855. consume.body.push(chunk)
  13856. }
  13857. function consumeFinish (consume, err) {
  13858. if (consume.body === null) {
  13859. return
  13860. }
  13861. if (err) {
  13862. consume.reject(err)
  13863. } else {
  13864. consume.resolve()
  13865. }
  13866. consume.type = null
  13867. consume.stream = null
  13868. consume.resolve = null
  13869. consume.reject = null
  13870. consume.length = 0
  13871. consume.body = null
  13872. }
  13873. /***/ }),
  13874. /***/ 7474:
  13875. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  13876. const assert = __nccwpck_require__(9491)
  13877. const {
  13878. ResponseStatusCodeError
  13879. } = __nccwpck_require__(8045)
  13880. const { toUSVString } = __nccwpck_require__(3983)
  13881. async function getResolveErrorBodyCallback ({ callback, body, contentType, statusCode, statusMessage, headers }) {
  13882. assert(body)
  13883. let chunks = []
  13884. let limit = 0
  13885. for await (const chunk of body) {
  13886. chunks.push(chunk)
  13887. limit += chunk.length
  13888. if (limit > 128 * 1024) {
  13889. chunks = null
  13890. break
  13891. }
  13892. }
  13893. if (statusCode === 204 || !contentType || !chunks) {
  13894. process.nextTick(callback, new ResponseStatusCodeError(`Response status code ${statusCode}${statusMessage ? `: ${statusMessage}` : ''}`, statusCode, headers))
  13895. return
  13896. }
  13897. try {
  13898. if (contentType.startsWith('application/json')) {
  13899. const payload = JSON.parse(toUSVString(Buffer.concat(chunks)))
  13900. process.nextTick(callback, new ResponseStatusCodeError(`Response status code ${statusCode}${statusMessage ? `: ${statusMessage}` : ''}`, statusCode, headers, payload))
  13901. return
  13902. }
  13903. if (contentType.startsWith('text/')) {
  13904. const payload = toUSVString(Buffer.concat(chunks))
  13905. process.nextTick(callback, new ResponseStatusCodeError(`Response status code ${statusCode}${statusMessage ? `: ${statusMessage}` : ''}`, statusCode, headers, payload))
  13906. return
  13907. }
  13908. } catch (err) {
  13909. // Process in a fallback if error
  13910. }
  13911. process.nextTick(callback, new ResponseStatusCodeError(`Response status code ${statusCode}${statusMessage ? `: ${statusMessage}` : ''}`, statusCode, headers))
  13912. }
  13913. module.exports = { getResolveErrorBodyCallback }
  13914. /***/ }),
  13915. /***/ 7931:
  13916. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  13917. "use strict";
  13918. const {
  13919. BalancedPoolMissingUpstreamError,
  13920. InvalidArgumentError
  13921. } = __nccwpck_require__(8045)
  13922. const {
  13923. PoolBase,
  13924. kClients,
  13925. kNeedDrain,
  13926. kAddClient,
  13927. kRemoveClient,
  13928. kGetDispatcher
  13929. } = __nccwpck_require__(3198)
  13930. const Pool = __nccwpck_require__(4634)
  13931. const { kUrl, kInterceptors } = __nccwpck_require__(2785)
  13932. const { parseOrigin } = __nccwpck_require__(3983)
  13933. const kFactory = Symbol('factory')
  13934. const kOptions = Symbol('options')
  13935. const kGreatestCommonDivisor = Symbol('kGreatestCommonDivisor')
  13936. const kCurrentWeight = Symbol('kCurrentWeight')
  13937. const kIndex = Symbol('kIndex')
  13938. const kWeight = Symbol('kWeight')
  13939. const kMaxWeightPerServer = Symbol('kMaxWeightPerServer')
  13940. const kErrorPenalty = Symbol('kErrorPenalty')
  13941. function getGreatestCommonDivisor (a, b) {
  13942. if (b === 0) return a
  13943. return getGreatestCommonDivisor(b, a % b)
  13944. }
  13945. function defaultFactory (origin, opts) {
  13946. return new Pool(origin, opts)
  13947. }
  13948. class BalancedPool extends PoolBase {
  13949. constructor (upstreams = [], { factory = defaultFactory, ...opts } = {}) {
  13950. super()
  13951. this[kOptions] = opts
  13952. this[kIndex] = -1
  13953. this[kCurrentWeight] = 0
  13954. this[kMaxWeightPerServer] = this[kOptions].maxWeightPerServer || 100
  13955. this[kErrorPenalty] = this[kOptions].errorPenalty || 15
  13956. if (!Array.isArray(upstreams)) {
  13957. upstreams = [upstreams]
  13958. }
  13959. if (typeof factory !== 'function') {
  13960. throw new InvalidArgumentError('factory must be a function.')
  13961. }
  13962. this[kInterceptors] = opts.interceptors && opts.interceptors.BalancedPool && Array.isArray(opts.interceptors.BalancedPool)
  13963. ? opts.interceptors.BalancedPool
  13964. : []
  13965. this[kFactory] = factory
  13966. for (const upstream of upstreams) {
  13967. this.addUpstream(upstream)
  13968. }
  13969. this._updateBalancedPoolStats()
  13970. }
  13971. addUpstream (upstream) {
  13972. const upstreamOrigin = parseOrigin(upstream).origin
  13973. if (this[kClients].find((pool) => (
  13974. pool[kUrl].origin === upstreamOrigin &&
  13975. pool.closed !== true &&
  13976. pool.destroyed !== true
  13977. ))) {
  13978. return this
  13979. }
  13980. const pool = this[kFactory](upstreamOrigin, Object.assign({}, this[kOptions]))
  13981. this[kAddClient](pool)
  13982. pool.on('connect', () => {
  13983. pool[kWeight] = Math.min(this[kMaxWeightPerServer], pool[kWeight] + this[kErrorPenalty])
  13984. })
  13985. pool.on('connectionError', () => {
  13986. pool[kWeight] = Math.max(1, pool[kWeight] - this[kErrorPenalty])
  13987. this._updateBalancedPoolStats()
  13988. })
  13989. pool.on('disconnect', (...args) => {
  13990. const err = args[2]
  13991. if (err && err.code === 'UND_ERR_SOCKET') {
  13992. // decrease the weight of the pool.
  13993. pool[kWeight] = Math.max(1, pool[kWeight] - this[kErrorPenalty])
  13994. this._updateBalancedPoolStats()
  13995. }
  13996. })
  13997. for (const client of this[kClients]) {
  13998. client[kWeight] = this[kMaxWeightPerServer]
  13999. }
  14000. this._updateBalancedPoolStats()
  14001. return this
  14002. }
  14003. _updateBalancedPoolStats () {
  14004. this[kGreatestCommonDivisor] = this[kClients].map(p => p[kWeight]).reduce(getGreatestCommonDivisor, 0)
  14005. }
  14006. removeUpstream (upstream) {
  14007. const upstreamOrigin = parseOrigin(upstream).origin
  14008. const pool = this[kClients].find((pool) => (
  14009. pool[kUrl].origin === upstreamOrigin &&
  14010. pool.closed !== true &&
  14011. pool.destroyed !== true
  14012. ))
  14013. if (pool) {
  14014. this[kRemoveClient](pool)
  14015. }
  14016. return this
  14017. }
  14018. get upstreams () {
  14019. return this[kClients]
  14020. .filter(dispatcher => dispatcher.closed !== true && dispatcher.destroyed !== true)
  14021. .map((p) => p[kUrl].origin)
  14022. }
  14023. [kGetDispatcher] () {
  14024. // We validate that pools is greater than 0,
  14025. // otherwise we would have to wait until an upstream
  14026. // is added, which might never happen.
  14027. if (this[kClients].length === 0) {
  14028. throw new BalancedPoolMissingUpstreamError()
  14029. }
  14030. const dispatcher = this[kClients].find(dispatcher => (
  14031. !dispatcher[kNeedDrain] &&
  14032. dispatcher.closed !== true &&
  14033. dispatcher.destroyed !== true
  14034. ))
  14035. if (!dispatcher) {
  14036. return
  14037. }
  14038. const allClientsBusy = this[kClients].map(pool => pool[kNeedDrain]).reduce((a, b) => a && b, true)
  14039. if (allClientsBusy) {
  14040. return
  14041. }
  14042. let counter = 0
  14043. let maxWeightIndex = this[kClients].findIndex(pool => !pool[kNeedDrain])
  14044. while (counter++ < this[kClients].length) {
  14045. this[kIndex] = (this[kIndex] + 1) % this[kClients].length
  14046. const pool = this[kClients][this[kIndex]]
  14047. // find pool index with the largest weight
  14048. if (pool[kWeight] > this[kClients][maxWeightIndex][kWeight] && !pool[kNeedDrain]) {
  14049. maxWeightIndex = this[kIndex]
  14050. }
  14051. // decrease the current weight every `this[kClients].length`.
  14052. if (this[kIndex] === 0) {
  14053. // Set the current weight to the next lower weight.
  14054. this[kCurrentWeight] = this[kCurrentWeight] - this[kGreatestCommonDivisor]
  14055. if (this[kCurrentWeight] <= 0) {
  14056. this[kCurrentWeight] = this[kMaxWeightPerServer]
  14057. }
  14058. }
  14059. if (pool[kWeight] >= this[kCurrentWeight] && (!pool[kNeedDrain])) {
  14060. return pool
  14061. }
  14062. }
  14063. this[kCurrentWeight] = this[kClients][maxWeightIndex][kWeight]
  14064. this[kIndex] = maxWeightIndex
  14065. return this[kClients][maxWeightIndex]
  14066. }
  14067. }
  14068. module.exports = BalancedPool
  14069. /***/ }),
  14070. /***/ 6101:
  14071. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  14072. "use strict";
  14073. const { kConstruct } = __nccwpck_require__(9174)
  14074. const { urlEquals, fieldValues: getFieldValues } = __nccwpck_require__(2396)
  14075. const { kEnumerableProperty, isDisturbed } = __nccwpck_require__(3983)
  14076. const { kHeadersList } = __nccwpck_require__(2785)
  14077. const { webidl } = __nccwpck_require__(1744)
  14078. const { Response, cloneResponse } = __nccwpck_require__(7823)
  14079. const { Request } = __nccwpck_require__(8359)
  14080. const { kState, kHeaders, kGuard, kRealm } = __nccwpck_require__(5861)
  14081. const { fetching } = __nccwpck_require__(4881)
  14082. const { urlIsHttpHttpsScheme, createDeferredPromise, readAllBytes } = __nccwpck_require__(2538)
  14083. const assert = __nccwpck_require__(9491)
  14084. const { getGlobalDispatcher } = __nccwpck_require__(1892)
  14085. /**
  14086. * @see https://w3c.github.io/ServiceWorker/#dfn-cache-batch-operation
  14087. * @typedef {Object} CacheBatchOperation
  14088. * @property {'delete' | 'put'} type
  14089. * @property {any} request
  14090. * @property {any} response
  14091. * @property {import('../../types/cache').CacheQueryOptions} options
  14092. */
  14093. /**
  14094. * @see https://w3c.github.io/ServiceWorker/#dfn-request-response-list
  14095. * @typedef {[any, any][]} requestResponseList
  14096. */
  14097. class Cache {
  14098. /**
  14099. * @see https://w3c.github.io/ServiceWorker/#dfn-relevant-request-response-list
  14100. * @type {requestResponseList}
  14101. */
  14102. #relevantRequestResponseList
  14103. constructor () {
  14104. if (arguments[0] !== kConstruct) {
  14105. webidl.illegalConstructor()
  14106. }
  14107. this.#relevantRequestResponseList = arguments[1]
  14108. }
  14109. async match (request, options = {}) {
  14110. webidl.brandCheck(this, Cache)
  14111. webidl.argumentLengthCheck(arguments, 1, { header: 'Cache.match' })
  14112. request = webidl.converters.RequestInfo(request)
  14113. options = webidl.converters.CacheQueryOptions(options)
  14114. const p = await this.matchAll(request, options)
  14115. if (p.length === 0) {
  14116. return
  14117. }
  14118. return p[0]
  14119. }
  14120. async matchAll (request = undefined, options = {}) {
  14121. webidl.brandCheck(this, Cache)
  14122. if (request !== undefined) request = webidl.converters.RequestInfo(request)
  14123. options = webidl.converters.CacheQueryOptions(options)
  14124. // 1.
  14125. let r = null
  14126. // 2.
  14127. if (request !== undefined) {
  14128. if (request instanceof Request) {
  14129. // 2.1.1
  14130. r = request[kState]
  14131. // 2.1.2
  14132. if (r.method !== 'GET' && !options.ignoreMethod) {
  14133. return []
  14134. }
  14135. } else if (typeof request === 'string') {
  14136. // 2.2.1
  14137. r = new Request(request)[kState]
  14138. }
  14139. }
  14140. // 5.
  14141. // 5.1
  14142. const responses = []
  14143. // 5.2
  14144. if (request === undefined) {
  14145. // 5.2.1
  14146. for (const requestResponse of this.#relevantRequestResponseList) {
  14147. responses.push(requestResponse[1])
  14148. }
  14149. } else { // 5.3
  14150. // 5.3.1
  14151. const requestResponses = this.#queryCache(r, options)
  14152. // 5.3.2
  14153. for (const requestResponse of requestResponses) {
  14154. responses.push(requestResponse[1])
  14155. }
  14156. }
  14157. // 5.4
  14158. // We don't implement CORs so we don't need to loop over the responses, yay!
  14159. // 5.5.1
  14160. const responseList = []
  14161. // 5.5.2
  14162. for (const response of responses) {
  14163. // 5.5.2.1
  14164. const responseObject = new Response(response.body?.source ?? null)
  14165. const body = responseObject[kState].body
  14166. responseObject[kState] = response
  14167. responseObject[kState].body = body
  14168. responseObject[kHeaders][kHeadersList] = response.headersList
  14169. responseObject[kHeaders][kGuard] = 'immutable'
  14170. responseList.push(responseObject)
  14171. }
  14172. // 6.
  14173. return Object.freeze(responseList)
  14174. }
  14175. async add (request) {
  14176. webidl.brandCheck(this, Cache)
  14177. webidl.argumentLengthCheck(arguments, 1, { header: 'Cache.add' })
  14178. request = webidl.converters.RequestInfo(request)
  14179. // 1.
  14180. const requests = [request]
  14181. // 2.
  14182. const responseArrayPromise = this.addAll(requests)
  14183. // 3.
  14184. return await responseArrayPromise
  14185. }
  14186. async addAll (requests) {
  14187. webidl.brandCheck(this, Cache)
  14188. webidl.argumentLengthCheck(arguments, 1, { header: 'Cache.addAll' })
  14189. requests = webidl.converters['sequence<RequestInfo>'](requests)
  14190. // 1.
  14191. const responsePromises = []
  14192. // 2.
  14193. const requestList = []
  14194. // 3.
  14195. for (const request of requests) {
  14196. if (typeof request === 'string') {
  14197. continue
  14198. }
  14199. // 3.1
  14200. const r = request[kState]
  14201. // 3.2
  14202. if (!urlIsHttpHttpsScheme(r.url) || r.method !== 'GET') {
  14203. throw webidl.errors.exception({
  14204. header: 'Cache.addAll',
  14205. message: 'Expected http/s scheme when method is not GET.'
  14206. })
  14207. }
  14208. }
  14209. // 4.
  14210. /** @type {ReturnType<typeof fetching>[]} */
  14211. const fetchControllers = []
  14212. // 5.
  14213. for (const request of requests) {
  14214. // 5.1
  14215. const r = new Request(request)[kState]
  14216. // 5.2
  14217. if (!urlIsHttpHttpsScheme(r.url)) {
  14218. throw webidl.errors.exception({
  14219. header: 'Cache.addAll',
  14220. message: 'Expected http/s scheme.'
  14221. })
  14222. }
  14223. // 5.4
  14224. r.initiator = 'fetch'
  14225. r.destination = 'subresource'
  14226. // 5.5
  14227. requestList.push(r)
  14228. // 5.6
  14229. const responsePromise = createDeferredPromise()
  14230. // 5.7
  14231. fetchControllers.push(fetching({
  14232. request: r,
  14233. dispatcher: getGlobalDispatcher(),
  14234. processResponse (response) {
  14235. // 1.
  14236. if (response.type === 'error' || response.status === 206 || response.status < 200 || response.status > 299) {
  14237. responsePromise.reject(webidl.errors.exception({
  14238. header: 'Cache.addAll',
  14239. message: 'Received an invalid status code or the request failed.'
  14240. }))
  14241. } else if (response.headersList.contains('vary')) { // 2.
  14242. // 2.1
  14243. const fieldValues = getFieldValues(response.headersList.get('vary'))
  14244. // 2.2
  14245. for (const fieldValue of fieldValues) {
  14246. // 2.2.1
  14247. if (fieldValue === '*') {
  14248. responsePromise.reject(webidl.errors.exception({
  14249. header: 'Cache.addAll',
  14250. message: 'invalid vary field value'
  14251. }))
  14252. for (const controller of fetchControllers) {
  14253. controller.abort()
  14254. }
  14255. return
  14256. }
  14257. }
  14258. }
  14259. },
  14260. processResponseEndOfBody (response) {
  14261. // 1.
  14262. if (response.aborted) {
  14263. responsePromise.reject(new DOMException('aborted', 'AbortError'))
  14264. return
  14265. }
  14266. // 2.
  14267. responsePromise.resolve(response)
  14268. }
  14269. }))
  14270. // 5.8
  14271. responsePromises.push(responsePromise.promise)
  14272. }
  14273. // 6.
  14274. const p = Promise.all(responsePromises)
  14275. // 7.
  14276. const responses = await p
  14277. // 7.1
  14278. const operations = []
  14279. // 7.2
  14280. let index = 0
  14281. // 7.3
  14282. for (const response of responses) {
  14283. // 7.3.1
  14284. /** @type {CacheBatchOperation} */
  14285. const operation = {
  14286. type: 'put', // 7.3.2
  14287. request: requestList[index], // 7.3.3
  14288. response // 7.3.4
  14289. }
  14290. operations.push(operation) // 7.3.5
  14291. index++ // 7.3.6
  14292. }
  14293. // 7.5
  14294. const cacheJobPromise = createDeferredPromise()
  14295. // 7.6.1
  14296. let errorData = null
  14297. // 7.6.2
  14298. try {
  14299. this.#batchCacheOperations(operations)
  14300. } catch (e) {
  14301. errorData = e
  14302. }
  14303. // 7.6.3
  14304. queueMicrotask(() => {
  14305. // 7.6.3.1
  14306. if (errorData === null) {
  14307. cacheJobPromise.resolve(undefined)
  14308. } else {
  14309. // 7.6.3.2
  14310. cacheJobPromise.reject(errorData)
  14311. }
  14312. })
  14313. // 7.7
  14314. return cacheJobPromise.promise
  14315. }
  14316. async put (request, response) {
  14317. webidl.brandCheck(this, Cache)
  14318. webidl.argumentLengthCheck(arguments, 2, { header: 'Cache.put' })
  14319. request = webidl.converters.RequestInfo(request)
  14320. response = webidl.converters.Response(response)
  14321. // 1.
  14322. let innerRequest = null
  14323. // 2.
  14324. if (request instanceof Request) {
  14325. innerRequest = request[kState]
  14326. } else { // 3.
  14327. innerRequest = new Request(request)[kState]
  14328. }
  14329. // 4.
  14330. if (!urlIsHttpHttpsScheme(innerRequest.url) || innerRequest.method !== 'GET') {
  14331. throw webidl.errors.exception({
  14332. header: 'Cache.put',
  14333. message: 'Expected an http/s scheme when method is not GET'
  14334. })
  14335. }
  14336. // 5.
  14337. const innerResponse = response[kState]
  14338. // 6.
  14339. if (innerResponse.status === 206) {
  14340. throw webidl.errors.exception({
  14341. header: 'Cache.put',
  14342. message: 'Got 206 status'
  14343. })
  14344. }
  14345. // 7.
  14346. if (innerResponse.headersList.contains('vary')) {
  14347. // 7.1.
  14348. const fieldValues = getFieldValues(innerResponse.headersList.get('vary'))
  14349. // 7.2.
  14350. for (const fieldValue of fieldValues) {
  14351. // 7.2.1
  14352. if (fieldValue === '*') {
  14353. throw webidl.errors.exception({
  14354. header: 'Cache.put',
  14355. message: 'Got * vary field value'
  14356. })
  14357. }
  14358. }
  14359. }
  14360. // 8.
  14361. if (innerResponse.body && (isDisturbed(innerResponse.body.stream) || innerResponse.body.stream.locked)) {
  14362. throw webidl.errors.exception({
  14363. header: 'Cache.put',
  14364. message: 'Response body is locked or disturbed'
  14365. })
  14366. }
  14367. // 9.
  14368. const clonedResponse = cloneResponse(innerResponse)
  14369. // 10.
  14370. const bodyReadPromise = createDeferredPromise()
  14371. // 11.
  14372. if (innerResponse.body != null) {
  14373. // 11.1
  14374. const stream = innerResponse.body.stream
  14375. // 11.2
  14376. const reader = stream.getReader()
  14377. // 11.3
  14378. readAllBytes(reader).then(bodyReadPromise.resolve, bodyReadPromise.reject)
  14379. } else {
  14380. bodyReadPromise.resolve(undefined)
  14381. }
  14382. // 12.
  14383. /** @type {CacheBatchOperation[]} */
  14384. const operations = []
  14385. // 13.
  14386. /** @type {CacheBatchOperation} */
  14387. const operation = {
  14388. type: 'put', // 14.
  14389. request: innerRequest, // 15.
  14390. response: clonedResponse // 16.
  14391. }
  14392. // 17.
  14393. operations.push(operation)
  14394. // 19.
  14395. const bytes = await bodyReadPromise.promise
  14396. if (clonedResponse.body != null) {
  14397. clonedResponse.body.source = bytes
  14398. }
  14399. // 19.1
  14400. const cacheJobPromise = createDeferredPromise()
  14401. // 19.2.1
  14402. let errorData = null
  14403. // 19.2.2
  14404. try {
  14405. this.#batchCacheOperations(operations)
  14406. } catch (e) {
  14407. errorData = e
  14408. }
  14409. // 19.2.3
  14410. queueMicrotask(() => {
  14411. // 19.2.3.1
  14412. if (errorData === null) {
  14413. cacheJobPromise.resolve()
  14414. } else { // 19.2.3.2
  14415. cacheJobPromise.reject(errorData)
  14416. }
  14417. })
  14418. return cacheJobPromise.promise
  14419. }
  14420. async delete (request, options = {}) {
  14421. webidl.brandCheck(this, Cache)
  14422. webidl.argumentLengthCheck(arguments, 1, { header: 'Cache.delete' })
  14423. request = webidl.converters.RequestInfo(request)
  14424. options = webidl.converters.CacheQueryOptions(options)
  14425. /**
  14426. * @type {Request}
  14427. */
  14428. let r = null
  14429. if (request instanceof Request) {
  14430. r = request[kState]
  14431. if (r.method !== 'GET' && !options.ignoreMethod) {
  14432. return false
  14433. }
  14434. } else {
  14435. assert(typeof request === 'string')
  14436. r = new Request(request)[kState]
  14437. }
  14438. /** @type {CacheBatchOperation[]} */
  14439. const operations = []
  14440. /** @type {CacheBatchOperation} */
  14441. const operation = {
  14442. type: 'delete',
  14443. request: r,
  14444. options
  14445. }
  14446. operations.push(operation)
  14447. const cacheJobPromise = createDeferredPromise()
  14448. let errorData = null
  14449. let requestResponses
  14450. try {
  14451. requestResponses = this.#batchCacheOperations(operations)
  14452. } catch (e) {
  14453. errorData = e
  14454. }
  14455. queueMicrotask(() => {
  14456. if (errorData === null) {
  14457. cacheJobPromise.resolve(!!requestResponses?.length)
  14458. } else {
  14459. cacheJobPromise.reject(errorData)
  14460. }
  14461. })
  14462. return cacheJobPromise.promise
  14463. }
  14464. /**
  14465. * @see https://w3c.github.io/ServiceWorker/#dom-cache-keys
  14466. * @param {any} request
  14467. * @param {import('../../types/cache').CacheQueryOptions} options
  14468. * @returns {readonly Request[]}
  14469. */
  14470. async keys (request = undefined, options = {}) {
  14471. webidl.brandCheck(this, Cache)
  14472. if (request !== undefined) request = webidl.converters.RequestInfo(request)
  14473. options = webidl.converters.CacheQueryOptions(options)
  14474. // 1.
  14475. let r = null
  14476. // 2.
  14477. if (request !== undefined) {
  14478. // 2.1
  14479. if (request instanceof Request) {
  14480. // 2.1.1
  14481. r = request[kState]
  14482. // 2.1.2
  14483. if (r.method !== 'GET' && !options.ignoreMethod) {
  14484. return []
  14485. }
  14486. } else if (typeof request === 'string') { // 2.2
  14487. r = new Request(request)[kState]
  14488. }
  14489. }
  14490. // 4.
  14491. const promise = createDeferredPromise()
  14492. // 5.
  14493. // 5.1
  14494. const requests = []
  14495. // 5.2
  14496. if (request === undefined) {
  14497. // 5.2.1
  14498. for (const requestResponse of this.#relevantRequestResponseList) {
  14499. // 5.2.1.1
  14500. requests.push(requestResponse[0])
  14501. }
  14502. } else { // 5.3
  14503. // 5.3.1
  14504. const requestResponses = this.#queryCache(r, options)
  14505. // 5.3.2
  14506. for (const requestResponse of requestResponses) {
  14507. // 5.3.2.1
  14508. requests.push(requestResponse[0])
  14509. }
  14510. }
  14511. // 5.4
  14512. queueMicrotask(() => {
  14513. // 5.4.1
  14514. const requestList = []
  14515. // 5.4.2
  14516. for (const request of requests) {
  14517. const requestObject = new Request('https://a')
  14518. requestObject[kState] = request
  14519. requestObject[kHeaders][kHeadersList] = request.headersList
  14520. requestObject[kHeaders][kGuard] = 'immutable'
  14521. requestObject[kRealm] = request.client
  14522. // 5.4.2.1
  14523. requestList.push(requestObject)
  14524. }
  14525. // 5.4.3
  14526. promise.resolve(Object.freeze(requestList))
  14527. })
  14528. return promise.promise
  14529. }
  14530. /**
  14531. * @see https://w3c.github.io/ServiceWorker/#batch-cache-operations-algorithm
  14532. * @param {CacheBatchOperation[]} operations
  14533. * @returns {requestResponseList}
  14534. */
  14535. #batchCacheOperations (operations) {
  14536. // 1.
  14537. const cache = this.#relevantRequestResponseList
  14538. // 2.
  14539. const backupCache = [...cache]
  14540. // 3.
  14541. const addedItems = []
  14542. // 4.1
  14543. const resultList = []
  14544. try {
  14545. // 4.2
  14546. for (const operation of operations) {
  14547. // 4.2.1
  14548. if (operation.type !== 'delete' && operation.type !== 'put') {
  14549. throw webidl.errors.exception({
  14550. header: 'Cache.#batchCacheOperations',
  14551. message: 'operation type does not match "delete" or "put"'
  14552. })
  14553. }
  14554. // 4.2.2
  14555. if (operation.type === 'delete' && operation.response != null) {
  14556. throw webidl.errors.exception({
  14557. header: 'Cache.#batchCacheOperations',
  14558. message: 'delete operation should not have an associated response'
  14559. })
  14560. }
  14561. // 4.2.3
  14562. if (this.#queryCache(operation.request, operation.options, addedItems).length) {
  14563. throw new DOMException('???', 'InvalidStateError')
  14564. }
  14565. // 4.2.4
  14566. let requestResponses
  14567. // 4.2.5
  14568. if (operation.type === 'delete') {
  14569. // 4.2.5.1
  14570. requestResponses = this.#queryCache(operation.request, operation.options)
  14571. // TODO: the spec is wrong, this is needed to pass WPTs
  14572. if (requestResponses.length === 0) {
  14573. return []
  14574. }
  14575. // 4.2.5.2
  14576. for (const requestResponse of requestResponses) {
  14577. const idx = cache.indexOf(requestResponse)
  14578. assert(idx !== -1)
  14579. // 4.2.5.2.1
  14580. cache.splice(idx, 1)
  14581. }
  14582. } else if (operation.type === 'put') { // 4.2.6
  14583. // 4.2.6.1
  14584. if (operation.response == null) {
  14585. throw webidl.errors.exception({
  14586. header: 'Cache.#batchCacheOperations',
  14587. message: 'put operation should have an associated response'
  14588. })
  14589. }
  14590. // 4.2.6.2
  14591. const r = operation.request
  14592. // 4.2.6.3
  14593. if (!urlIsHttpHttpsScheme(r.url)) {
  14594. throw webidl.errors.exception({
  14595. header: 'Cache.#batchCacheOperations',
  14596. message: 'expected http or https scheme'
  14597. })
  14598. }
  14599. // 4.2.6.4
  14600. if (r.method !== 'GET') {
  14601. throw webidl.errors.exception({
  14602. header: 'Cache.#batchCacheOperations',
  14603. message: 'not get method'
  14604. })
  14605. }
  14606. // 4.2.6.5
  14607. if (operation.options != null) {
  14608. throw webidl.errors.exception({
  14609. header: 'Cache.#batchCacheOperations',
  14610. message: 'options must not be defined'
  14611. })
  14612. }
  14613. // 4.2.6.6
  14614. requestResponses = this.#queryCache(operation.request)
  14615. // 4.2.6.7
  14616. for (const requestResponse of requestResponses) {
  14617. const idx = cache.indexOf(requestResponse)
  14618. assert(idx !== -1)
  14619. // 4.2.6.7.1
  14620. cache.splice(idx, 1)
  14621. }
  14622. // 4.2.6.8
  14623. cache.push([operation.request, operation.response])
  14624. // 4.2.6.10
  14625. addedItems.push([operation.request, operation.response])
  14626. }
  14627. // 4.2.7
  14628. resultList.push([operation.request, operation.response])
  14629. }
  14630. // 4.3
  14631. return resultList
  14632. } catch (e) { // 5.
  14633. // 5.1
  14634. this.#relevantRequestResponseList.length = 0
  14635. // 5.2
  14636. this.#relevantRequestResponseList = backupCache
  14637. // 5.3
  14638. throw e
  14639. }
  14640. }
  14641. /**
  14642. * @see https://w3c.github.io/ServiceWorker/#query-cache
  14643. * @param {any} requestQuery
  14644. * @param {import('../../types/cache').CacheQueryOptions} options
  14645. * @param {requestResponseList} targetStorage
  14646. * @returns {requestResponseList}
  14647. */
  14648. #queryCache (requestQuery, options, targetStorage) {
  14649. /** @type {requestResponseList} */
  14650. const resultList = []
  14651. const storage = targetStorage ?? this.#relevantRequestResponseList
  14652. for (const requestResponse of storage) {
  14653. const [cachedRequest, cachedResponse] = requestResponse
  14654. if (this.#requestMatchesCachedItem(requestQuery, cachedRequest, cachedResponse, options)) {
  14655. resultList.push(requestResponse)
  14656. }
  14657. }
  14658. return resultList
  14659. }
  14660. /**
  14661. * @see https://w3c.github.io/ServiceWorker/#request-matches-cached-item-algorithm
  14662. * @param {any} requestQuery
  14663. * @param {any} request
  14664. * @param {any | null} response
  14665. * @param {import('../../types/cache').CacheQueryOptions | undefined} options
  14666. * @returns {boolean}
  14667. */
  14668. #requestMatchesCachedItem (requestQuery, request, response = null, options) {
  14669. // if (options?.ignoreMethod === false && request.method === 'GET') {
  14670. // return false
  14671. // }
  14672. const queryURL = new URL(requestQuery.url)
  14673. const cachedURL = new URL(request.url)
  14674. if (options?.ignoreSearch) {
  14675. cachedURL.search = ''
  14676. queryURL.search = ''
  14677. }
  14678. if (!urlEquals(queryURL, cachedURL, true)) {
  14679. return false
  14680. }
  14681. if (
  14682. response == null ||
  14683. options?.ignoreVary ||
  14684. !response.headersList.contains('vary')
  14685. ) {
  14686. return true
  14687. }
  14688. const fieldValues = getFieldValues(response.headersList.get('vary'))
  14689. for (const fieldValue of fieldValues) {
  14690. if (fieldValue === '*') {
  14691. return false
  14692. }
  14693. const requestValue = request.headersList.get(fieldValue)
  14694. const queryValue = requestQuery.headersList.get(fieldValue)
  14695. // If one has the header and the other doesn't, or one has
  14696. // a different value than the other, return false
  14697. if (requestValue !== queryValue) {
  14698. return false
  14699. }
  14700. }
  14701. return true
  14702. }
  14703. }
  14704. Object.defineProperties(Cache.prototype, {
  14705. [Symbol.toStringTag]: {
  14706. value: 'Cache',
  14707. configurable: true
  14708. },
  14709. match: kEnumerableProperty,
  14710. matchAll: kEnumerableProperty,
  14711. add: kEnumerableProperty,
  14712. addAll: kEnumerableProperty,
  14713. put: kEnumerableProperty,
  14714. delete: kEnumerableProperty,
  14715. keys: kEnumerableProperty
  14716. })
  14717. const cacheQueryOptionConverters = [
  14718. {
  14719. key: 'ignoreSearch',
  14720. converter: webidl.converters.boolean,
  14721. defaultValue: false
  14722. },
  14723. {
  14724. key: 'ignoreMethod',
  14725. converter: webidl.converters.boolean,
  14726. defaultValue: false
  14727. },
  14728. {
  14729. key: 'ignoreVary',
  14730. converter: webidl.converters.boolean,
  14731. defaultValue: false
  14732. }
  14733. ]
  14734. webidl.converters.CacheQueryOptions = webidl.dictionaryConverter(cacheQueryOptionConverters)
  14735. webidl.converters.MultiCacheQueryOptions = webidl.dictionaryConverter([
  14736. ...cacheQueryOptionConverters,
  14737. {
  14738. key: 'cacheName',
  14739. converter: webidl.converters.DOMString
  14740. }
  14741. ])
  14742. webidl.converters.Response = webidl.interfaceConverter(Response)
  14743. webidl.converters['sequence<RequestInfo>'] = webidl.sequenceConverter(
  14744. webidl.converters.RequestInfo
  14745. )
  14746. module.exports = {
  14747. Cache
  14748. }
  14749. /***/ }),
  14750. /***/ 7907:
  14751. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  14752. "use strict";
  14753. const { kConstruct } = __nccwpck_require__(9174)
  14754. const { Cache } = __nccwpck_require__(6101)
  14755. const { webidl } = __nccwpck_require__(1744)
  14756. const { kEnumerableProperty } = __nccwpck_require__(3983)
  14757. class CacheStorage {
  14758. /**
  14759. * @see https://w3c.github.io/ServiceWorker/#dfn-relevant-name-to-cache-map
  14760. * @type {Map<string, import('./cache').requestResponseList}
  14761. */
  14762. #caches = new Map()
  14763. constructor () {
  14764. if (arguments[0] !== kConstruct) {
  14765. webidl.illegalConstructor()
  14766. }
  14767. }
  14768. async match (request, options = {}) {
  14769. webidl.brandCheck(this, CacheStorage)
  14770. webidl.argumentLengthCheck(arguments, 1, { header: 'CacheStorage.match' })
  14771. request = webidl.converters.RequestInfo(request)
  14772. options = webidl.converters.MultiCacheQueryOptions(options)
  14773. // 1.
  14774. if (options.cacheName != null) {
  14775. // 1.1.1.1
  14776. if (this.#caches.has(options.cacheName)) {
  14777. // 1.1.1.1.1
  14778. const cacheList = this.#caches.get(options.cacheName)
  14779. const cache = new Cache(kConstruct, cacheList)
  14780. return await cache.match(request, options)
  14781. }
  14782. } else { // 2.
  14783. // 2.2
  14784. for (const cacheList of this.#caches.values()) {
  14785. const cache = new Cache(kConstruct, cacheList)
  14786. // 2.2.1.2
  14787. const response = await cache.match(request, options)
  14788. if (response !== undefined) {
  14789. return response
  14790. }
  14791. }
  14792. }
  14793. }
  14794. /**
  14795. * @see https://w3c.github.io/ServiceWorker/#cache-storage-has
  14796. * @param {string} cacheName
  14797. * @returns {Promise<boolean>}
  14798. */
  14799. async has (cacheName) {
  14800. webidl.brandCheck(this, CacheStorage)
  14801. webidl.argumentLengthCheck(arguments, 1, { header: 'CacheStorage.has' })
  14802. cacheName = webidl.converters.DOMString(cacheName)
  14803. // 2.1.1
  14804. // 2.2
  14805. return this.#caches.has(cacheName)
  14806. }
  14807. /**
  14808. * @see https://w3c.github.io/ServiceWorker/#dom-cachestorage-open
  14809. * @param {string} cacheName
  14810. * @returns {Promise<Cache>}
  14811. */
  14812. async open (cacheName) {
  14813. webidl.brandCheck(this, CacheStorage)
  14814. webidl.argumentLengthCheck(arguments, 1, { header: 'CacheStorage.open' })
  14815. cacheName = webidl.converters.DOMString(cacheName)
  14816. // 2.1
  14817. if (this.#caches.has(cacheName)) {
  14818. // await caches.open('v1') !== await caches.open('v1')
  14819. // 2.1.1
  14820. const cache = this.#caches.get(cacheName)
  14821. // 2.1.1.1
  14822. return new Cache(kConstruct, cache)
  14823. }
  14824. // 2.2
  14825. const cache = []
  14826. // 2.3
  14827. this.#caches.set(cacheName, cache)
  14828. // 2.4
  14829. return new Cache(kConstruct, cache)
  14830. }
  14831. /**
  14832. * @see https://w3c.github.io/ServiceWorker/#cache-storage-delete
  14833. * @param {string} cacheName
  14834. * @returns {Promise<boolean>}
  14835. */
  14836. async delete (cacheName) {
  14837. webidl.brandCheck(this, CacheStorage)
  14838. webidl.argumentLengthCheck(arguments, 1, { header: 'CacheStorage.delete' })
  14839. cacheName = webidl.converters.DOMString(cacheName)
  14840. return this.#caches.delete(cacheName)
  14841. }
  14842. /**
  14843. * @see https://w3c.github.io/ServiceWorker/#cache-storage-keys
  14844. * @returns {string[]}
  14845. */
  14846. async keys () {
  14847. webidl.brandCheck(this, CacheStorage)
  14848. // 2.1
  14849. const keys = this.#caches.keys()
  14850. // 2.2
  14851. return [...keys]
  14852. }
  14853. }
  14854. Object.defineProperties(CacheStorage.prototype, {
  14855. [Symbol.toStringTag]: {
  14856. value: 'CacheStorage',
  14857. configurable: true
  14858. },
  14859. match: kEnumerableProperty,
  14860. has: kEnumerableProperty,
  14861. open: kEnumerableProperty,
  14862. delete: kEnumerableProperty,
  14863. keys: kEnumerableProperty
  14864. })
  14865. module.exports = {
  14866. CacheStorage
  14867. }
  14868. /***/ }),
  14869. /***/ 9174:
  14870. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  14871. "use strict";
  14872. module.exports = {
  14873. kConstruct: (__nccwpck_require__(2785).kConstruct)
  14874. }
  14875. /***/ }),
  14876. /***/ 2396:
  14877. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  14878. "use strict";
  14879. const assert = __nccwpck_require__(9491)
  14880. const { URLSerializer } = __nccwpck_require__(685)
  14881. const { isValidHeaderName } = __nccwpck_require__(2538)
  14882. /**
  14883. * @see https://url.spec.whatwg.org/#concept-url-equals
  14884. * @param {URL} A
  14885. * @param {URL} B
  14886. * @param {boolean | undefined} excludeFragment
  14887. * @returns {boolean}
  14888. */
  14889. function urlEquals (A, B, excludeFragment = false) {
  14890. const serializedA = URLSerializer(A, excludeFragment)
  14891. const serializedB = URLSerializer(B, excludeFragment)
  14892. return serializedA === serializedB
  14893. }
  14894. /**
  14895. * @see https://github.com/chromium/chromium/blob/694d20d134cb553d8d89e5500b9148012b1ba299/content/browser/cache_storage/cache_storage_cache.cc#L260-L262
  14896. * @param {string} header
  14897. */
  14898. function fieldValues (header) {
  14899. assert(header !== null)
  14900. const values = []
  14901. for (let value of header.split(',')) {
  14902. value = value.trim()
  14903. if (!value.length) {
  14904. continue
  14905. } else if (!isValidHeaderName(value)) {
  14906. continue
  14907. }
  14908. values.push(value)
  14909. }
  14910. return values
  14911. }
  14912. module.exports = {
  14913. urlEquals,
  14914. fieldValues
  14915. }
  14916. /***/ }),
  14917. /***/ 3598:
  14918. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  14919. "use strict";
  14920. // @ts-check
  14921. /* global WebAssembly */
  14922. const assert = __nccwpck_require__(9491)
  14923. const net = __nccwpck_require__(1808)
  14924. const http = __nccwpck_require__(3685)
  14925. const { pipeline } = __nccwpck_require__(2781)
  14926. const util = __nccwpck_require__(3983)
  14927. const timers = __nccwpck_require__(9459)
  14928. const Request = __nccwpck_require__(2905)
  14929. const DispatcherBase = __nccwpck_require__(4839)
  14930. const {
  14931. RequestContentLengthMismatchError,
  14932. ResponseContentLengthMismatchError,
  14933. InvalidArgumentError,
  14934. RequestAbortedError,
  14935. HeadersTimeoutError,
  14936. HeadersOverflowError,
  14937. SocketError,
  14938. InformationalError,
  14939. BodyTimeoutError,
  14940. HTTPParserError,
  14941. ResponseExceededMaxSizeError,
  14942. ClientDestroyedError
  14943. } = __nccwpck_require__(8045)
  14944. const buildConnector = __nccwpck_require__(2067)
  14945. const {
  14946. kUrl,
  14947. kReset,
  14948. kServerName,
  14949. kClient,
  14950. kBusy,
  14951. kParser,
  14952. kConnect,
  14953. kBlocking,
  14954. kResuming,
  14955. kRunning,
  14956. kPending,
  14957. kSize,
  14958. kWriting,
  14959. kQueue,
  14960. kConnected,
  14961. kConnecting,
  14962. kNeedDrain,
  14963. kNoRef,
  14964. kKeepAliveDefaultTimeout,
  14965. kHostHeader,
  14966. kPendingIdx,
  14967. kRunningIdx,
  14968. kError,
  14969. kPipelining,
  14970. kSocket,
  14971. kKeepAliveTimeoutValue,
  14972. kMaxHeadersSize,
  14973. kKeepAliveMaxTimeout,
  14974. kKeepAliveTimeoutThreshold,
  14975. kHeadersTimeout,
  14976. kBodyTimeout,
  14977. kStrictContentLength,
  14978. kConnector,
  14979. kMaxRedirections,
  14980. kMaxRequests,
  14981. kCounter,
  14982. kClose,
  14983. kDestroy,
  14984. kDispatch,
  14985. kInterceptors,
  14986. kLocalAddress,
  14987. kMaxResponseSize,
  14988. kHTTPConnVersion,
  14989. // HTTP2
  14990. kHost,
  14991. kHTTP2Session,
  14992. kHTTP2SessionState,
  14993. kHTTP2BuildRequest,
  14994. kHTTP2CopyHeaders,
  14995. kHTTP1BuildRequest
  14996. } = __nccwpck_require__(2785)
  14997. /** @type {import('http2')} */
  14998. let http2
  14999. try {
  15000. http2 = __nccwpck_require__(5158)
  15001. } catch {
  15002. // @ts-ignore
  15003. http2 = { constants: {} }
  15004. }
  15005. const {
  15006. constants: {
  15007. HTTP2_HEADER_AUTHORITY,
  15008. HTTP2_HEADER_METHOD,
  15009. HTTP2_HEADER_PATH,
  15010. HTTP2_HEADER_SCHEME,
  15011. HTTP2_HEADER_CONTENT_LENGTH,
  15012. HTTP2_HEADER_EXPECT,
  15013. HTTP2_HEADER_STATUS
  15014. }
  15015. } = http2
  15016. // Experimental
  15017. let h2ExperimentalWarned = false
  15018. const FastBuffer = Buffer[Symbol.species]
  15019. const kClosedResolve = Symbol('kClosedResolve')
  15020. const channels = {}
  15021. try {
  15022. const diagnosticsChannel = __nccwpck_require__(7643)
  15023. channels.sendHeaders = diagnosticsChannel.channel('undici:client:sendHeaders')
  15024. channels.beforeConnect = diagnosticsChannel.channel('undici:client:beforeConnect')
  15025. channels.connectError = diagnosticsChannel.channel('undici:client:connectError')
  15026. channels.connected = diagnosticsChannel.channel('undici:client:connected')
  15027. } catch {
  15028. channels.sendHeaders = { hasSubscribers: false }
  15029. channels.beforeConnect = { hasSubscribers: false }
  15030. channels.connectError = { hasSubscribers: false }
  15031. channels.connected = { hasSubscribers: false }
  15032. }
  15033. /**
  15034. * @type {import('../types/client').default}
  15035. */
  15036. class Client extends DispatcherBase {
  15037. /**
  15038. *
  15039. * @param {string|URL} url
  15040. * @param {import('../types/client').Client.Options} options
  15041. */
  15042. constructor (url, {
  15043. interceptors,
  15044. maxHeaderSize,
  15045. headersTimeout,
  15046. socketTimeout,
  15047. requestTimeout,
  15048. connectTimeout,
  15049. bodyTimeout,
  15050. idleTimeout,
  15051. keepAlive,
  15052. keepAliveTimeout,
  15053. maxKeepAliveTimeout,
  15054. keepAliveMaxTimeout,
  15055. keepAliveTimeoutThreshold,
  15056. socketPath,
  15057. pipelining,
  15058. tls,
  15059. strictContentLength,
  15060. maxCachedSessions,
  15061. maxRedirections,
  15062. connect,
  15063. maxRequestsPerClient,
  15064. localAddress,
  15065. maxResponseSize,
  15066. autoSelectFamily,
  15067. autoSelectFamilyAttemptTimeout,
  15068. // h2
  15069. allowH2,
  15070. maxConcurrentStreams
  15071. } = {}) {
  15072. super()
  15073. if (keepAlive !== undefined) {
  15074. throw new InvalidArgumentError('unsupported keepAlive, use pipelining=0 instead')
  15075. }
  15076. if (socketTimeout !== undefined) {
  15077. throw new InvalidArgumentError('unsupported socketTimeout, use headersTimeout & bodyTimeout instead')
  15078. }
  15079. if (requestTimeout !== undefined) {
  15080. throw new InvalidArgumentError('unsupported requestTimeout, use headersTimeout & bodyTimeout instead')
  15081. }
  15082. if (idleTimeout !== undefined) {
  15083. throw new InvalidArgumentError('unsupported idleTimeout, use keepAliveTimeout instead')
  15084. }
  15085. if (maxKeepAliveTimeout !== undefined) {
  15086. throw new InvalidArgumentError('unsupported maxKeepAliveTimeout, use keepAliveMaxTimeout instead')
  15087. }
  15088. if (maxHeaderSize != null && !Number.isFinite(maxHeaderSize)) {
  15089. throw new InvalidArgumentError('invalid maxHeaderSize')
  15090. }
  15091. if (socketPath != null && typeof socketPath !== 'string') {
  15092. throw new InvalidArgumentError('invalid socketPath')
  15093. }
  15094. if (connectTimeout != null && (!Number.isFinite(connectTimeout) || connectTimeout < 0)) {
  15095. throw new InvalidArgumentError('invalid connectTimeout')
  15096. }
  15097. if (keepAliveTimeout != null && (!Number.isFinite(keepAliveTimeout) || keepAliveTimeout <= 0)) {
  15098. throw new InvalidArgumentError('invalid keepAliveTimeout')
  15099. }
  15100. if (keepAliveMaxTimeout != null && (!Number.isFinite(keepAliveMaxTimeout) || keepAliveMaxTimeout <= 0)) {
  15101. throw new InvalidArgumentError('invalid keepAliveMaxTimeout')
  15102. }
  15103. if (keepAliveTimeoutThreshold != null && !Number.isFinite(keepAliveTimeoutThreshold)) {
  15104. throw new InvalidArgumentError('invalid keepAliveTimeoutThreshold')
  15105. }
  15106. if (headersTimeout != null && (!Number.isInteger(headersTimeout) || headersTimeout < 0)) {
  15107. throw new InvalidArgumentError('headersTimeout must be a positive integer or zero')
  15108. }
  15109. if (bodyTimeout != null && (!Number.isInteger(bodyTimeout) || bodyTimeout < 0)) {
  15110. throw new InvalidArgumentError('bodyTimeout must be a positive integer or zero')
  15111. }
  15112. if (connect != null && typeof connect !== 'function' && typeof connect !== 'object') {
  15113. throw new InvalidArgumentError('connect must be a function or an object')
  15114. }
  15115. if (maxRedirections != null && (!Number.isInteger(maxRedirections) || maxRedirections < 0)) {
  15116. throw new InvalidArgumentError('maxRedirections must be a positive number')
  15117. }
  15118. if (maxRequestsPerClient != null && (!Number.isInteger(maxRequestsPerClient) || maxRequestsPerClient < 0)) {
  15119. throw new InvalidArgumentError('maxRequestsPerClient must be a positive number')
  15120. }
  15121. if (localAddress != null && (typeof localAddress !== 'string' || net.isIP(localAddress) === 0)) {
  15122. throw new InvalidArgumentError('localAddress must be valid string IP address')
  15123. }
  15124. if (maxResponseSize != null && (!Number.isInteger(maxResponseSize) || maxResponseSize < -1)) {
  15125. throw new InvalidArgumentError('maxResponseSize must be a positive number')
  15126. }
  15127. if (
  15128. autoSelectFamilyAttemptTimeout != null &&
  15129. (!Number.isInteger(autoSelectFamilyAttemptTimeout) || autoSelectFamilyAttemptTimeout < -1)
  15130. ) {
  15131. throw new InvalidArgumentError('autoSelectFamilyAttemptTimeout must be a positive number')
  15132. }
  15133. // h2
  15134. if (allowH2 != null && typeof allowH2 !== 'boolean') {
  15135. throw new InvalidArgumentError('allowH2 must be a valid boolean value')
  15136. }
  15137. if (maxConcurrentStreams != null && (typeof maxConcurrentStreams !== 'number' || maxConcurrentStreams < 1)) {
  15138. throw new InvalidArgumentError('maxConcurrentStreams must be a possitive integer, greater than 0')
  15139. }
  15140. if (typeof connect !== 'function') {
  15141. connect = buildConnector({
  15142. ...tls,
  15143. maxCachedSessions,
  15144. allowH2,
  15145. socketPath,
  15146. timeout: connectTimeout,
  15147. ...(util.nodeHasAutoSelectFamily && autoSelectFamily ? { autoSelectFamily, autoSelectFamilyAttemptTimeout } : undefined),
  15148. ...connect
  15149. })
  15150. }
  15151. this[kInterceptors] = interceptors && interceptors.Client && Array.isArray(interceptors.Client)
  15152. ? interceptors.Client
  15153. : [createRedirectInterceptor({ maxRedirections })]
  15154. this[kUrl] = util.parseOrigin(url)
  15155. this[kConnector] = connect
  15156. this[kSocket] = null
  15157. this[kPipelining] = pipelining != null ? pipelining : 1
  15158. this[kMaxHeadersSize] = maxHeaderSize || http.maxHeaderSize
  15159. this[kKeepAliveDefaultTimeout] = keepAliveTimeout == null ? 4e3 : keepAliveTimeout
  15160. this[kKeepAliveMaxTimeout] = keepAliveMaxTimeout == null ? 600e3 : keepAliveMaxTimeout
  15161. this[kKeepAliveTimeoutThreshold] = keepAliveTimeoutThreshold == null ? 1e3 : keepAliveTimeoutThreshold
  15162. this[kKeepAliveTimeoutValue] = this[kKeepAliveDefaultTimeout]
  15163. this[kServerName] = null
  15164. this[kLocalAddress] = localAddress != null ? localAddress : null
  15165. this[kResuming] = 0 // 0, idle, 1, scheduled, 2 resuming
  15166. this[kNeedDrain] = 0 // 0, idle, 1, scheduled, 2 resuming
  15167. this[kHostHeader] = `host: ${this[kUrl].hostname}${this[kUrl].port ? `:${this[kUrl].port}` : ''}\r\n`
  15168. this[kBodyTimeout] = bodyTimeout != null ? bodyTimeout : 300e3
  15169. this[kHeadersTimeout] = headersTimeout != null ? headersTimeout : 300e3
  15170. this[kStrictContentLength] = strictContentLength == null ? true : strictContentLength
  15171. this[kMaxRedirections] = maxRedirections
  15172. this[kMaxRequests] = maxRequestsPerClient
  15173. this[kClosedResolve] = null
  15174. this[kMaxResponseSize] = maxResponseSize > -1 ? maxResponseSize : -1
  15175. this[kHTTPConnVersion] = 'h1'
  15176. // HTTP/2
  15177. this[kHTTP2Session] = null
  15178. this[kHTTP2SessionState] = !allowH2
  15179. ? null
  15180. : {
  15181. // streams: null, // Fixed queue of streams - For future support of `push`
  15182. openStreams: 0, // Keep track of them to decide wether or not unref the session
  15183. maxConcurrentStreams: maxConcurrentStreams != null ? maxConcurrentStreams : 100 // Max peerConcurrentStreams for a Node h2 server
  15184. }
  15185. this[kHost] = `${this[kUrl].hostname}${this[kUrl].port ? `:${this[kUrl].port}` : ''}`
  15186. // kQueue is built up of 3 sections separated by
  15187. // the kRunningIdx and kPendingIdx indices.
  15188. // | complete | running | pending |
  15189. // ^ kRunningIdx ^ kPendingIdx ^ kQueue.length
  15190. // kRunningIdx points to the first running element.
  15191. // kPendingIdx points to the first pending element.
  15192. // This implements a fast queue with an amortized
  15193. // time of O(1).
  15194. this[kQueue] = []
  15195. this[kRunningIdx] = 0
  15196. this[kPendingIdx] = 0
  15197. }
  15198. get pipelining () {
  15199. return this[kPipelining]
  15200. }
  15201. set pipelining (value) {
  15202. this[kPipelining] = value
  15203. resume(this, true)
  15204. }
  15205. get [kPending] () {
  15206. return this[kQueue].length - this[kPendingIdx]
  15207. }
  15208. get [kRunning] () {
  15209. return this[kPendingIdx] - this[kRunningIdx]
  15210. }
  15211. get [kSize] () {
  15212. return this[kQueue].length - this[kRunningIdx]
  15213. }
  15214. get [kConnected] () {
  15215. return !!this[kSocket] && !this[kConnecting] && !this[kSocket].destroyed
  15216. }
  15217. get [kBusy] () {
  15218. const socket = this[kSocket]
  15219. return (
  15220. (socket && (socket[kReset] || socket[kWriting] || socket[kBlocking])) ||
  15221. (this[kSize] >= (this[kPipelining] || 1)) ||
  15222. this[kPending] > 0
  15223. )
  15224. }
  15225. /* istanbul ignore: only used for test */
  15226. [kConnect] (cb) {
  15227. connect(this)
  15228. this.once('connect', cb)
  15229. }
  15230. [kDispatch] (opts, handler) {
  15231. const origin = opts.origin || this[kUrl].origin
  15232. const request = this[kHTTPConnVersion] === 'h2'
  15233. ? Request[kHTTP2BuildRequest](origin, opts, handler)
  15234. : Request[kHTTP1BuildRequest](origin, opts, handler)
  15235. this[kQueue].push(request)
  15236. if (this[kResuming]) {
  15237. // Do nothing.
  15238. } else if (util.bodyLength(request.body) == null && util.isIterable(request.body)) {
  15239. // Wait a tick in case stream/iterator is ended in the same tick.
  15240. this[kResuming] = 1
  15241. process.nextTick(resume, this)
  15242. } else {
  15243. resume(this, true)
  15244. }
  15245. if (this[kResuming] && this[kNeedDrain] !== 2 && this[kBusy]) {
  15246. this[kNeedDrain] = 2
  15247. }
  15248. return this[kNeedDrain] < 2
  15249. }
  15250. async [kClose] () {
  15251. // TODO: for H2 we need to gracefully flush the remaining enqueued
  15252. // request and close each stream.
  15253. return new Promise((resolve) => {
  15254. if (!this[kSize]) {
  15255. resolve(null)
  15256. } else {
  15257. this[kClosedResolve] = resolve
  15258. }
  15259. })
  15260. }
  15261. async [kDestroy] (err) {
  15262. return new Promise((resolve) => {
  15263. const requests = this[kQueue].splice(this[kPendingIdx])
  15264. for (let i = 0; i < requests.length; i++) {
  15265. const request = requests[i]
  15266. errorRequest(this, request, err)
  15267. }
  15268. const callback = () => {
  15269. if (this[kClosedResolve]) {
  15270. // TODO (fix): Should we error here with ClientDestroyedError?
  15271. this[kClosedResolve]()
  15272. this[kClosedResolve] = null
  15273. }
  15274. resolve()
  15275. }
  15276. if (this[kHTTP2Session] != null) {
  15277. util.destroy(this[kHTTP2Session], err)
  15278. this[kHTTP2Session] = null
  15279. this[kHTTP2SessionState] = null
  15280. }
  15281. if (!this[kSocket]) {
  15282. queueMicrotask(callback)
  15283. } else {
  15284. util.destroy(this[kSocket].on('close', callback), err)
  15285. }
  15286. resume(this)
  15287. })
  15288. }
  15289. }
  15290. function onHttp2SessionError (err) {
  15291. assert(err.code !== 'ERR_TLS_CERT_ALTNAME_INVALID')
  15292. this[kSocket][kError] = err
  15293. onError(this[kClient], err)
  15294. }
  15295. function onHttp2FrameError (type, code, id) {
  15296. const err = new InformationalError(`HTTP/2: "frameError" received - type ${type}, code ${code}`)
  15297. if (id === 0) {
  15298. this[kSocket][kError] = err
  15299. onError(this[kClient], err)
  15300. }
  15301. }
  15302. function onHttp2SessionEnd () {
  15303. util.destroy(this, new SocketError('other side closed'))
  15304. util.destroy(this[kSocket], new SocketError('other side closed'))
  15305. }
  15306. function onHTTP2GoAway (code) {
  15307. const client = this[kClient]
  15308. const err = new InformationalError(`HTTP/2: "GOAWAY" frame received with code ${code}`)
  15309. client[kSocket] = null
  15310. client[kHTTP2Session] = null
  15311. if (client.destroyed) {
  15312. assert(this[kPending] === 0)
  15313. // Fail entire queue.
  15314. const requests = client[kQueue].splice(client[kRunningIdx])
  15315. for (let i = 0; i < requests.length; i++) {
  15316. const request = requests[i]
  15317. errorRequest(this, request, err)
  15318. }
  15319. } else if (client[kRunning] > 0) {
  15320. // Fail head of pipeline.
  15321. const request = client[kQueue][client[kRunningIdx]]
  15322. client[kQueue][client[kRunningIdx]++] = null
  15323. errorRequest(client, request, err)
  15324. }
  15325. client[kPendingIdx] = client[kRunningIdx]
  15326. assert(client[kRunning] === 0)
  15327. client.emit('disconnect',
  15328. client[kUrl],
  15329. [client],
  15330. err
  15331. )
  15332. resume(client)
  15333. }
  15334. const constants = __nccwpck_require__(953)
  15335. const createRedirectInterceptor = __nccwpck_require__(8861)
  15336. const EMPTY_BUF = Buffer.alloc(0)
  15337. async function lazyllhttp () {
  15338. const llhttpWasmData = process.env.JEST_WORKER_ID ? __nccwpck_require__(1145) : undefined
  15339. let mod
  15340. try {
  15341. mod = await WebAssembly.compile(Buffer.from(__nccwpck_require__(5627), 'base64'))
  15342. } catch (e) {
  15343. /* istanbul ignore next */
  15344. // We could check if the error was caused by the simd option not
  15345. // being enabled, but the occurring of this other error
  15346. // * https://github.com/emscripten-core/emscripten/issues/11495
  15347. // got me to remove that check to avoid breaking Node 12.
  15348. mod = await WebAssembly.compile(Buffer.from(llhttpWasmData || __nccwpck_require__(1145), 'base64'))
  15349. }
  15350. return await WebAssembly.instantiate(mod, {
  15351. env: {
  15352. /* eslint-disable camelcase */
  15353. wasm_on_url: (p, at, len) => {
  15354. /* istanbul ignore next */
  15355. return 0
  15356. },
  15357. wasm_on_status: (p, at, len) => {
  15358. assert.strictEqual(currentParser.ptr, p)
  15359. const start = at - currentBufferPtr + currentBufferRef.byteOffset
  15360. return currentParser.onStatus(new FastBuffer(currentBufferRef.buffer, start, len)) || 0
  15361. },
  15362. wasm_on_message_begin: (p) => {
  15363. assert.strictEqual(currentParser.ptr, p)
  15364. return currentParser.onMessageBegin() || 0
  15365. },
  15366. wasm_on_header_field: (p, at, len) => {
  15367. assert.strictEqual(currentParser.ptr, p)
  15368. const start = at - currentBufferPtr + currentBufferRef.byteOffset
  15369. return currentParser.onHeaderField(new FastBuffer(currentBufferRef.buffer, start, len)) || 0
  15370. },
  15371. wasm_on_header_value: (p, at, len) => {
  15372. assert.strictEqual(currentParser.ptr, p)
  15373. const start = at - currentBufferPtr + currentBufferRef.byteOffset
  15374. return currentParser.onHeaderValue(new FastBuffer(currentBufferRef.buffer, start, len)) || 0
  15375. },
  15376. wasm_on_headers_complete: (p, statusCode, upgrade, shouldKeepAlive) => {
  15377. assert.strictEqual(currentParser.ptr, p)
  15378. return currentParser.onHeadersComplete(statusCode, Boolean(upgrade), Boolean(shouldKeepAlive)) || 0
  15379. },
  15380. wasm_on_body: (p, at, len) => {
  15381. assert.strictEqual(currentParser.ptr, p)
  15382. const start = at - currentBufferPtr + currentBufferRef.byteOffset
  15383. return currentParser.onBody(new FastBuffer(currentBufferRef.buffer, start, len)) || 0
  15384. },
  15385. wasm_on_message_complete: (p) => {
  15386. assert.strictEqual(currentParser.ptr, p)
  15387. return currentParser.onMessageComplete() || 0
  15388. }
  15389. /* eslint-enable camelcase */
  15390. }
  15391. })
  15392. }
  15393. let llhttpInstance = null
  15394. let llhttpPromise = lazyllhttp()
  15395. llhttpPromise.catch()
  15396. let currentParser = null
  15397. let currentBufferRef = null
  15398. let currentBufferSize = 0
  15399. let currentBufferPtr = null
  15400. const TIMEOUT_HEADERS = 1
  15401. const TIMEOUT_BODY = 2
  15402. const TIMEOUT_IDLE = 3
  15403. class Parser {
  15404. constructor (client, socket, { exports }) {
  15405. assert(Number.isFinite(client[kMaxHeadersSize]) && client[kMaxHeadersSize] > 0)
  15406. this.llhttp = exports
  15407. this.ptr = this.llhttp.llhttp_alloc(constants.TYPE.RESPONSE)
  15408. this.client = client
  15409. this.socket = socket
  15410. this.timeout = null
  15411. this.timeoutValue = null
  15412. this.timeoutType = null
  15413. this.statusCode = null
  15414. this.statusText = ''
  15415. this.upgrade = false
  15416. this.headers = []
  15417. this.headersSize = 0
  15418. this.headersMaxSize = client[kMaxHeadersSize]
  15419. this.shouldKeepAlive = false
  15420. this.paused = false
  15421. this.resume = this.resume.bind(this)
  15422. this.bytesRead = 0
  15423. this.keepAlive = ''
  15424. this.contentLength = ''
  15425. this.connection = ''
  15426. this.maxResponseSize = client[kMaxResponseSize]
  15427. }
  15428. setTimeout (value, type) {
  15429. this.timeoutType = type
  15430. if (value !== this.timeoutValue) {
  15431. timers.clearTimeout(this.timeout)
  15432. if (value) {
  15433. this.timeout = timers.setTimeout(onParserTimeout, value, this)
  15434. // istanbul ignore else: only for jest
  15435. if (this.timeout.unref) {
  15436. this.timeout.unref()
  15437. }
  15438. } else {
  15439. this.timeout = null
  15440. }
  15441. this.timeoutValue = value
  15442. } else if (this.timeout) {
  15443. // istanbul ignore else: only for jest
  15444. if (this.timeout.refresh) {
  15445. this.timeout.refresh()
  15446. }
  15447. }
  15448. }
  15449. resume () {
  15450. if (this.socket.destroyed || !this.paused) {
  15451. return
  15452. }
  15453. assert(this.ptr != null)
  15454. assert(currentParser == null)
  15455. this.llhttp.llhttp_resume(this.ptr)
  15456. assert(this.timeoutType === TIMEOUT_BODY)
  15457. if (this.timeout) {
  15458. // istanbul ignore else: only for jest
  15459. if (this.timeout.refresh) {
  15460. this.timeout.refresh()
  15461. }
  15462. }
  15463. this.paused = false
  15464. this.execute(this.socket.read() || EMPTY_BUF) // Flush parser.
  15465. this.readMore()
  15466. }
  15467. readMore () {
  15468. while (!this.paused && this.ptr) {
  15469. const chunk = this.socket.read()
  15470. if (chunk === null) {
  15471. break
  15472. }
  15473. this.execute(chunk)
  15474. }
  15475. }
  15476. execute (data) {
  15477. assert(this.ptr != null)
  15478. assert(currentParser == null)
  15479. assert(!this.paused)
  15480. const { socket, llhttp } = this
  15481. if (data.length > currentBufferSize) {
  15482. if (currentBufferPtr) {
  15483. llhttp.free(currentBufferPtr)
  15484. }
  15485. currentBufferSize = Math.ceil(data.length / 4096) * 4096
  15486. currentBufferPtr = llhttp.malloc(currentBufferSize)
  15487. }
  15488. new Uint8Array(llhttp.memory.buffer, currentBufferPtr, currentBufferSize).set(data)
  15489. // Call `execute` on the wasm parser.
  15490. // We pass the `llhttp_parser` pointer address, the pointer address of buffer view data,
  15491. // and finally the length of bytes to parse.
  15492. // The return value is an error code or `constants.ERROR.OK`.
  15493. try {
  15494. let ret
  15495. try {
  15496. currentBufferRef = data
  15497. currentParser = this
  15498. ret = llhttp.llhttp_execute(this.ptr, currentBufferPtr, data.length)
  15499. /* eslint-disable-next-line no-useless-catch */
  15500. } catch (err) {
  15501. /* istanbul ignore next: difficult to make a test case for */
  15502. throw err
  15503. } finally {
  15504. currentParser = null
  15505. currentBufferRef = null
  15506. }
  15507. const offset = llhttp.llhttp_get_error_pos(this.ptr) - currentBufferPtr
  15508. if (ret === constants.ERROR.PAUSED_UPGRADE) {
  15509. this.onUpgrade(data.slice(offset))
  15510. } else if (ret === constants.ERROR.PAUSED) {
  15511. this.paused = true
  15512. socket.unshift(data.slice(offset))
  15513. } else if (ret !== constants.ERROR.OK) {
  15514. const ptr = llhttp.llhttp_get_error_reason(this.ptr)
  15515. let message = ''
  15516. /* istanbul ignore else: difficult to make a test case for */
  15517. if (ptr) {
  15518. const len = new Uint8Array(llhttp.memory.buffer, ptr).indexOf(0)
  15519. message =
  15520. 'Response does not match the HTTP/1.1 protocol (' +
  15521. Buffer.from(llhttp.memory.buffer, ptr, len).toString() +
  15522. ')'
  15523. }
  15524. throw new HTTPParserError(message, constants.ERROR[ret], data.slice(offset))
  15525. }
  15526. } catch (err) {
  15527. util.destroy(socket, err)
  15528. }
  15529. }
  15530. destroy () {
  15531. assert(this.ptr != null)
  15532. assert(currentParser == null)
  15533. this.llhttp.llhttp_free(this.ptr)
  15534. this.ptr = null
  15535. timers.clearTimeout(this.timeout)
  15536. this.timeout = null
  15537. this.timeoutValue = null
  15538. this.timeoutType = null
  15539. this.paused = false
  15540. }
  15541. onStatus (buf) {
  15542. this.statusText = buf.toString()
  15543. }
  15544. onMessageBegin () {
  15545. const { socket, client } = this
  15546. /* istanbul ignore next: difficult to make a test case for */
  15547. if (socket.destroyed) {
  15548. return -1
  15549. }
  15550. const request = client[kQueue][client[kRunningIdx]]
  15551. if (!request) {
  15552. return -1
  15553. }
  15554. }
  15555. onHeaderField (buf) {
  15556. const len = this.headers.length
  15557. if ((len & 1) === 0) {
  15558. this.headers.push(buf)
  15559. } else {
  15560. this.headers[len - 1] = Buffer.concat([this.headers[len - 1], buf])
  15561. }
  15562. this.trackHeader(buf.length)
  15563. }
  15564. onHeaderValue (buf) {
  15565. let len = this.headers.length
  15566. if ((len & 1) === 1) {
  15567. this.headers.push(buf)
  15568. len += 1
  15569. } else {
  15570. this.headers[len - 1] = Buffer.concat([this.headers[len - 1], buf])
  15571. }
  15572. const key = this.headers[len - 2]
  15573. if (key.length === 10 && key.toString().toLowerCase() === 'keep-alive') {
  15574. this.keepAlive += buf.toString()
  15575. } else if (key.length === 10 && key.toString().toLowerCase() === 'connection') {
  15576. this.connection += buf.toString()
  15577. } else if (key.length === 14 && key.toString().toLowerCase() === 'content-length') {
  15578. this.contentLength += buf.toString()
  15579. }
  15580. this.trackHeader(buf.length)
  15581. }
  15582. trackHeader (len) {
  15583. this.headersSize += len
  15584. if (this.headersSize >= this.headersMaxSize) {
  15585. util.destroy(this.socket, new HeadersOverflowError())
  15586. }
  15587. }
  15588. onUpgrade (head) {
  15589. const { upgrade, client, socket, headers, statusCode } = this
  15590. assert(upgrade)
  15591. const request = client[kQueue][client[kRunningIdx]]
  15592. assert(request)
  15593. assert(!socket.destroyed)
  15594. assert(socket === client[kSocket])
  15595. assert(!this.paused)
  15596. assert(request.upgrade || request.method === 'CONNECT')
  15597. this.statusCode = null
  15598. this.statusText = ''
  15599. this.shouldKeepAlive = null
  15600. assert(this.headers.length % 2 === 0)
  15601. this.headers = []
  15602. this.headersSize = 0
  15603. socket.unshift(head)
  15604. socket[kParser].destroy()
  15605. socket[kParser] = null
  15606. socket[kClient] = null
  15607. socket[kError] = null
  15608. socket
  15609. .removeListener('error', onSocketError)
  15610. .removeListener('readable', onSocketReadable)
  15611. .removeListener('end', onSocketEnd)
  15612. .removeListener('close', onSocketClose)
  15613. client[kSocket] = null
  15614. client[kQueue][client[kRunningIdx]++] = null
  15615. client.emit('disconnect', client[kUrl], [client], new InformationalError('upgrade'))
  15616. try {
  15617. request.onUpgrade(statusCode, headers, socket)
  15618. } catch (err) {
  15619. util.destroy(socket, err)
  15620. }
  15621. resume(client)
  15622. }
  15623. onHeadersComplete (statusCode, upgrade, shouldKeepAlive) {
  15624. const { client, socket, headers, statusText } = this
  15625. /* istanbul ignore next: difficult to make a test case for */
  15626. if (socket.destroyed) {
  15627. return -1
  15628. }
  15629. const request = client[kQueue][client[kRunningIdx]]
  15630. /* istanbul ignore next: difficult to make a test case for */
  15631. if (!request) {
  15632. return -1
  15633. }
  15634. assert(!this.upgrade)
  15635. assert(this.statusCode < 200)
  15636. if (statusCode === 100) {
  15637. util.destroy(socket, new SocketError('bad response', util.getSocketInfo(socket)))
  15638. return -1
  15639. }
  15640. /* this can only happen if server is misbehaving */
  15641. if (upgrade && !request.upgrade) {
  15642. util.destroy(socket, new SocketError('bad upgrade', util.getSocketInfo(socket)))
  15643. return -1
  15644. }
  15645. assert.strictEqual(this.timeoutType, TIMEOUT_HEADERS)
  15646. this.statusCode = statusCode
  15647. this.shouldKeepAlive = (
  15648. shouldKeepAlive ||
  15649. // Override llhttp value which does not allow keepAlive for HEAD.
  15650. (request.method === 'HEAD' && !socket[kReset] && this.connection.toLowerCase() === 'keep-alive')
  15651. )
  15652. if (this.statusCode >= 200) {
  15653. const bodyTimeout = request.bodyTimeout != null
  15654. ? request.bodyTimeout
  15655. : client[kBodyTimeout]
  15656. this.setTimeout(bodyTimeout, TIMEOUT_BODY)
  15657. } else if (this.timeout) {
  15658. // istanbul ignore else: only for jest
  15659. if (this.timeout.refresh) {
  15660. this.timeout.refresh()
  15661. }
  15662. }
  15663. if (request.method === 'CONNECT') {
  15664. assert(client[kRunning] === 1)
  15665. this.upgrade = true
  15666. return 2
  15667. }
  15668. if (upgrade) {
  15669. assert(client[kRunning] === 1)
  15670. this.upgrade = true
  15671. return 2
  15672. }
  15673. assert(this.headers.length % 2 === 0)
  15674. this.headers = []
  15675. this.headersSize = 0
  15676. if (this.shouldKeepAlive && client[kPipelining]) {
  15677. const keepAliveTimeout = this.keepAlive ? util.parseKeepAliveTimeout(this.keepAlive) : null
  15678. if (keepAliveTimeout != null) {
  15679. const timeout = Math.min(
  15680. keepAliveTimeout - client[kKeepAliveTimeoutThreshold],
  15681. client[kKeepAliveMaxTimeout]
  15682. )
  15683. if (timeout <= 0) {
  15684. socket[kReset] = true
  15685. } else {
  15686. client[kKeepAliveTimeoutValue] = timeout
  15687. }
  15688. } else {
  15689. client[kKeepAliveTimeoutValue] = client[kKeepAliveDefaultTimeout]
  15690. }
  15691. } else {
  15692. // Stop more requests from being dispatched.
  15693. socket[kReset] = true
  15694. }
  15695. const pause = request.onHeaders(statusCode, headers, this.resume, statusText) === false
  15696. if (request.aborted) {
  15697. return -1
  15698. }
  15699. if (request.method === 'HEAD') {
  15700. return 1
  15701. }
  15702. if (statusCode < 200) {
  15703. return 1
  15704. }
  15705. if (socket[kBlocking]) {
  15706. socket[kBlocking] = false
  15707. resume(client)
  15708. }
  15709. return pause ? constants.ERROR.PAUSED : 0
  15710. }
  15711. onBody (buf) {
  15712. const { client, socket, statusCode, maxResponseSize } = this
  15713. if (socket.destroyed) {
  15714. return -1
  15715. }
  15716. const request = client[kQueue][client[kRunningIdx]]
  15717. assert(request)
  15718. assert.strictEqual(this.timeoutType, TIMEOUT_BODY)
  15719. if (this.timeout) {
  15720. // istanbul ignore else: only for jest
  15721. if (this.timeout.refresh) {
  15722. this.timeout.refresh()
  15723. }
  15724. }
  15725. assert(statusCode >= 200)
  15726. if (maxResponseSize > -1 && this.bytesRead + buf.length > maxResponseSize) {
  15727. util.destroy(socket, new ResponseExceededMaxSizeError())
  15728. return -1
  15729. }
  15730. this.bytesRead += buf.length
  15731. if (request.onData(buf) === false) {
  15732. return constants.ERROR.PAUSED
  15733. }
  15734. }
  15735. onMessageComplete () {
  15736. const { client, socket, statusCode, upgrade, headers, contentLength, bytesRead, shouldKeepAlive } = this
  15737. if (socket.destroyed && (!statusCode || shouldKeepAlive)) {
  15738. return -1
  15739. }
  15740. if (upgrade) {
  15741. return
  15742. }
  15743. const request = client[kQueue][client[kRunningIdx]]
  15744. assert(request)
  15745. assert(statusCode >= 100)
  15746. this.statusCode = null
  15747. this.statusText = ''
  15748. this.bytesRead = 0
  15749. this.contentLength = ''
  15750. this.keepAlive = ''
  15751. this.connection = ''
  15752. assert(this.headers.length % 2 === 0)
  15753. this.headers = []
  15754. this.headersSize = 0
  15755. if (statusCode < 200) {
  15756. return
  15757. }
  15758. /* istanbul ignore next: should be handled by llhttp? */
  15759. if (request.method !== 'HEAD' && contentLength && bytesRead !== parseInt(contentLength, 10)) {
  15760. util.destroy(socket, new ResponseContentLengthMismatchError())
  15761. return -1
  15762. }
  15763. request.onComplete(headers)
  15764. client[kQueue][client[kRunningIdx]++] = null
  15765. if (socket[kWriting]) {
  15766. assert.strictEqual(client[kRunning], 0)
  15767. // Response completed before request.
  15768. util.destroy(socket, new InformationalError('reset'))
  15769. return constants.ERROR.PAUSED
  15770. } else if (!shouldKeepAlive) {
  15771. util.destroy(socket, new InformationalError('reset'))
  15772. return constants.ERROR.PAUSED
  15773. } else if (socket[kReset] && client[kRunning] === 0) {
  15774. // Destroy socket once all requests have completed.
  15775. // The request at the tail of the pipeline is the one
  15776. // that requested reset and no further requests should
  15777. // have been queued since then.
  15778. util.destroy(socket, new InformationalError('reset'))
  15779. return constants.ERROR.PAUSED
  15780. } else if (client[kPipelining] === 1) {
  15781. // We must wait a full event loop cycle to reuse this socket to make sure
  15782. // that non-spec compliant servers are not closing the connection even if they
  15783. // said they won't.
  15784. setImmediate(resume, client)
  15785. } else {
  15786. resume(client)
  15787. }
  15788. }
  15789. }
  15790. function onParserTimeout (parser) {
  15791. const { socket, timeoutType, client } = parser
  15792. /* istanbul ignore else */
  15793. if (timeoutType === TIMEOUT_HEADERS) {
  15794. if (!socket[kWriting] || socket.writableNeedDrain || client[kRunning] > 1) {
  15795. assert(!parser.paused, 'cannot be paused while waiting for headers')
  15796. util.destroy(socket, new HeadersTimeoutError())
  15797. }
  15798. } else if (timeoutType === TIMEOUT_BODY) {
  15799. if (!parser.paused) {
  15800. util.destroy(socket, new BodyTimeoutError())
  15801. }
  15802. } else if (timeoutType === TIMEOUT_IDLE) {
  15803. assert(client[kRunning] === 0 && client[kKeepAliveTimeoutValue])
  15804. util.destroy(socket, new InformationalError('socket idle timeout'))
  15805. }
  15806. }
  15807. function onSocketReadable () {
  15808. const { [kParser]: parser } = this
  15809. if (parser) {
  15810. parser.readMore()
  15811. }
  15812. }
  15813. function onSocketError (err) {
  15814. const { [kClient]: client, [kParser]: parser } = this
  15815. assert(err.code !== 'ERR_TLS_CERT_ALTNAME_INVALID')
  15816. if (client[kHTTPConnVersion] !== 'h2') {
  15817. // On Mac OS, we get an ECONNRESET even if there is a full body to be forwarded
  15818. // to the user.
  15819. if (err.code === 'ECONNRESET' && parser.statusCode && !parser.shouldKeepAlive) {
  15820. // We treat all incoming data so for as a valid response.
  15821. parser.onMessageComplete()
  15822. return
  15823. }
  15824. }
  15825. this[kError] = err
  15826. onError(this[kClient], err)
  15827. }
  15828. function onError (client, err) {
  15829. if (
  15830. client[kRunning] === 0 &&
  15831. err.code !== 'UND_ERR_INFO' &&
  15832. err.code !== 'UND_ERR_SOCKET'
  15833. ) {
  15834. // Error is not caused by running request and not a recoverable
  15835. // socket error.
  15836. assert(client[kPendingIdx] === client[kRunningIdx])
  15837. const requests = client[kQueue].splice(client[kRunningIdx])
  15838. for (let i = 0; i < requests.length; i++) {
  15839. const request = requests[i]
  15840. errorRequest(client, request, err)
  15841. }
  15842. assert(client[kSize] === 0)
  15843. }
  15844. }
  15845. function onSocketEnd () {
  15846. const { [kParser]: parser, [kClient]: client } = this
  15847. if (client[kHTTPConnVersion] !== 'h2') {
  15848. if (parser.statusCode && !parser.shouldKeepAlive) {
  15849. // We treat all incoming data so far as a valid response.
  15850. parser.onMessageComplete()
  15851. return
  15852. }
  15853. }
  15854. util.destroy(this, new SocketError('other side closed', util.getSocketInfo(this)))
  15855. }
  15856. function onSocketClose () {
  15857. const { [kClient]: client, [kParser]: parser } = this
  15858. if (client[kHTTPConnVersion] === 'h1' && parser) {
  15859. if (!this[kError] && parser.statusCode && !parser.shouldKeepAlive) {
  15860. // We treat all incoming data so far as a valid response.
  15861. parser.onMessageComplete()
  15862. }
  15863. this[kParser].destroy()
  15864. this[kParser] = null
  15865. }
  15866. const err = this[kError] || new SocketError('closed', util.getSocketInfo(this))
  15867. client[kSocket] = null
  15868. if (client.destroyed) {
  15869. assert(client[kPending] === 0)
  15870. // Fail entire queue.
  15871. const requests = client[kQueue].splice(client[kRunningIdx])
  15872. for (let i = 0; i < requests.length; i++) {
  15873. const request = requests[i]
  15874. errorRequest(client, request, err)
  15875. }
  15876. } else if (client[kRunning] > 0 && err.code !== 'UND_ERR_INFO') {
  15877. // Fail head of pipeline.
  15878. const request = client[kQueue][client[kRunningIdx]]
  15879. client[kQueue][client[kRunningIdx]++] = null
  15880. errorRequest(client, request, err)
  15881. }
  15882. client[kPendingIdx] = client[kRunningIdx]
  15883. assert(client[kRunning] === 0)
  15884. client.emit('disconnect', client[kUrl], [client], err)
  15885. resume(client)
  15886. }
  15887. async function connect (client) {
  15888. assert(!client[kConnecting])
  15889. assert(!client[kSocket])
  15890. let { host, hostname, protocol, port } = client[kUrl]
  15891. // Resolve ipv6
  15892. if (hostname[0] === '[') {
  15893. const idx = hostname.indexOf(']')
  15894. assert(idx !== -1)
  15895. const ip = hostname.substring(1, idx)
  15896. assert(net.isIP(ip))
  15897. hostname = ip
  15898. }
  15899. client[kConnecting] = true
  15900. if (channels.beforeConnect.hasSubscribers) {
  15901. channels.beforeConnect.publish({
  15902. connectParams: {
  15903. host,
  15904. hostname,
  15905. protocol,
  15906. port,
  15907. servername: client[kServerName],
  15908. localAddress: client[kLocalAddress]
  15909. },
  15910. connector: client[kConnector]
  15911. })
  15912. }
  15913. try {
  15914. const socket = await new Promise((resolve, reject) => {
  15915. client[kConnector]({
  15916. host,
  15917. hostname,
  15918. protocol,
  15919. port,
  15920. servername: client[kServerName],
  15921. localAddress: client[kLocalAddress]
  15922. }, (err, socket) => {
  15923. if (err) {
  15924. reject(err)
  15925. } else {
  15926. resolve(socket)
  15927. }
  15928. })
  15929. })
  15930. if (client.destroyed) {
  15931. util.destroy(socket.on('error', () => {}), new ClientDestroyedError())
  15932. return
  15933. }
  15934. client[kConnecting] = false
  15935. assert(socket)
  15936. const isH2 = socket.alpnProtocol === 'h2'
  15937. if (isH2) {
  15938. if (!h2ExperimentalWarned) {
  15939. h2ExperimentalWarned = true
  15940. process.emitWarning('H2 support is experimental, expect them to change at any time.', {
  15941. code: 'UNDICI-H2'
  15942. })
  15943. }
  15944. const session = http2.connect(client[kUrl], {
  15945. createConnection: () => socket,
  15946. peerMaxConcurrentStreams: client[kHTTP2SessionState].maxConcurrentStreams
  15947. })
  15948. client[kHTTPConnVersion] = 'h2'
  15949. session[kClient] = client
  15950. session[kSocket] = socket
  15951. session.on('error', onHttp2SessionError)
  15952. session.on('frameError', onHttp2FrameError)
  15953. session.on('end', onHttp2SessionEnd)
  15954. session.on('goaway', onHTTP2GoAway)
  15955. session.on('close', onSocketClose)
  15956. session.unref()
  15957. client[kHTTP2Session] = session
  15958. socket[kHTTP2Session] = session
  15959. } else {
  15960. if (!llhttpInstance) {
  15961. llhttpInstance = await llhttpPromise
  15962. llhttpPromise = null
  15963. }
  15964. socket[kNoRef] = false
  15965. socket[kWriting] = false
  15966. socket[kReset] = false
  15967. socket[kBlocking] = false
  15968. socket[kParser] = new Parser(client, socket, llhttpInstance)
  15969. }
  15970. socket[kCounter] = 0
  15971. socket[kMaxRequests] = client[kMaxRequests]
  15972. socket[kClient] = client
  15973. socket[kError] = null
  15974. socket
  15975. .on('error', onSocketError)
  15976. .on('readable', onSocketReadable)
  15977. .on('end', onSocketEnd)
  15978. .on('close', onSocketClose)
  15979. client[kSocket] = socket
  15980. if (channels.connected.hasSubscribers) {
  15981. channels.connected.publish({
  15982. connectParams: {
  15983. host,
  15984. hostname,
  15985. protocol,
  15986. port,
  15987. servername: client[kServerName],
  15988. localAddress: client[kLocalAddress]
  15989. },
  15990. connector: client[kConnector],
  15991. socket
  15992. })
  15993. }
  15994. client.emit('connect', client[kUrl], [client])
  15995. } catch (err) {
  15996. if (client.destroyed) {
  15997. return
  15998. }
  15999. client[kConnecting] = false
  16000. if (channels.connectError.hasSubscribers) {
  16001. channels.connectError.publish({
  16002. connectParams: {
  16003. host,
  16004. hostname,
  16005. protocol,
  16006. port,
  16007. servername: client[kServerName],
  16008. localAddress: client[kLocalAddress]
  16009. },
  16010. connector: client[kConnector],
  16011. error: err
  16012. })
  16013. }
  16014. if (err.code === 'ERR_TLS_CERT_ALTNAME_INVALID') {
  16015. assert(client[kRunning] === 0)
  16016. while (client[kPending] > 0 && client[kQueue][client[kPendingIdx]].servername === client[kServerName]) {
  16017. const request = client[kQueue][client[kPendingIdx]++]
  16018. errorRequest(client, request, err)
  16019. }
  16020. } else {
  16021. onError(client, err)
  16022. }
  16023. client.emit('connectionError', client[kUrl], [client], err)
  16024. }
  16025. resume(client)
  16026. }
  16027. function emitDrain (client) {
  16028. client[kNeedDrain] = 0
  16029. client.emit('drain', client[kUrl], [client])
  16030. }
  16031. function resume (client, sync) {
  16032. if (client[kResuming] === 2) {
  16033. return
  16034. }
  16035. client[kResuming] = 2
  16036. _resume(client, sync)
  16037. client[kResuming] = 0
  16038. if (client[kRunningIdx] > 256) {
  16039. client[kQueue].splice(0, client[kRunningIdx])
  16040. client[kPendingIdx] -= client[kRunningIdx]
  16041. client[kRunningIdx] = 0
  16042. }
  16043. }
  16044. function _resume (client, sync) {
  16045. while (true) {
  16046. if (client.destroyed) {
  16047. assert(client[kPending] === 0)
  16048. return
  16049. }
  16050. if (client[kClosedResolve] && !client[kSize]) {
  16051. client[kClosedResolve]()
  16052. client[kClosedResolve] = null
  16053. return
  16054. }
  16055. const socket = client[kSocket]
  16056. if (socket && !socket.destroyed && socket.alpnProtocol !== 'h2') {
  16057. if (client[kSize] === 0) {
  16058. if (!socket[kNoRef] && socket.unref) {
  16059. socket.unref()
  16060. socket[kNoRef] = true
  16061. }
  16062. } else if (socket[kNoRef] && socket.ref) {
  16063. socket.ref()
  16064. socket[kNoRef] = false
  16065. }
  16066. if (client[kSize] === 0) {
  16067. if (socket[kParser].timeoutType !== TIMEOUT_IDLE) {
  16068. socket[kParser].setTimeout(client[kKeepAliveTimeoutValue], TIMEOUT_IDLE)
  16069. }
  16070. } else if (client[kRunning] > 0 && socket[kParser].statusCode < 200) {
  16071. if (socket[kParser].timeoutType !== TIMEOUT_HEADERS) {
  16072. const request = client[kQueue][client[kRunningIdx]]
  16073. const headersTimeout = request.headersTimeout != null
  16074. ? request.headersTimeout
  16075. : client[kHeadersTimeout]
  16076. socket[kParser].setTimeout(headersTimeout, TIMEOUT_HEADERS)
  16077. }
  16078. }
  16079. }
  16080. if (client[kBusy]) {
  16081. client[kNeedDrain] = 2
  16082. } else if (client[kNeedDrain] === 2) {
  16083. if (sync) {
  16084. client[kNeedDrain] = 1
  16085. process.nextTick(emitDrain, client)
  16086. } else {
  16087. emitDrain(client)
  16088. }
  16089. continue
  16090. }
  16091. if (client[kPending] === 0) {
  16092. return
  16093. }
  16094. if (client[kRunning] >= (client[kPipelining] || 1)) {
  16095. return
  16096. }
  16097. const request = client[kQueue][client[kPendingIdx]]
  16098. if (client[kUrl].protocol === 'https:' && client[kServerName] !== request.servername) {
  16099. if (client[kRunning] > 0) {
  16100. return
  16101. }
  16102. client[kServerName] = request.servername
  16103. if (socket && socket.servername !== request.servername) {
  16104. util.destroy(socket, new InformationalError('servername changed'))
  16105. return
  16106. }
  16107. }
  16108. if (client[kConnecting]) {
  16109. return
  16110. }
  16111. if (!socket && !client[kHTTP2Session]) {
  16112. connect(client)
  16113. return
  16114. }
  16115. if (socket.destroyed || socket[kWriting] || socket[kReset] || socket[kBlocking]) {
  16116. return
  16117. }
  16118. if (client[kRunning] > 0 && !request.idempotent) {
  16119. // Non-idempotent request cannot be retried.
  16120. // Ensure that no other requests are inflight and
  16121. // could cause failure.
  16122. return
  16123. }
  16124. if (client[kRunning] > 0 && (request.upgrade || request.method === 'CONNECT')) {
  16125. // Don't dispatch an upgrade until all preceding requests have completed.
  16126. // A misbehaving server might upgrade the connection before all pipelined
  16127. // request has completed.
  16128. return
  16129. }
  16130. if (client[kRunning] > 0 && util.bodyLength(request.body) !== 0 &&
  16131. (util.isStream(request.body) || util.isAsyncIterable(request.body))) {
  16132. // Request with stream or iterator body can error while other requests
  16133. // are inflight and indirectly error those as well.
  16134. // Ensure this doesn't happen by waiting for inflight
  16135. // to complete before dispatching.
  16136. // Request with stream or iterator body cannot be retried.
  16137. // Ensure that no other requests are inflight and
  16138. // could cause failure.
  16139. return
  16140. }
  16141. if (!request.aborted && write(client, request)) {
  16142. client[kPendingIdx]++
  16143. } else {
  16144. client[kQueue].splice(client[kPendingIdx], 1)
  16145. }
  16146. }
  16147. }
  16148. // https://www.rfc-editor.org/rfc/rfc7230#section-3.3.2
  16149. function shouldSendContentLength (method) {
  16150. return method !== 'GET' && method !== 'HEAD' && method !== 'OPTIONS' && method !== 'TRACE' && method !== 'CONNECT'
  16151. }
  16152. function write (client, request) {
  16153. if (client[kHTTPConnVersion] === 'h2') {
  16154. writeH2(client, client[kHTTP2Session], request)
  16155. return
  16156. }
  16157. const { body, method, path, host, upgrade, headers, blocking, reset } = request
  16158. // https://tools.ietf.org/html/rfc7231#section-4.3.1
  16159. // https://tools.ietf.org/html/rfc7231#section-4.3.2
  16160. // https://tools.ietf.org/html/rfc7231#section-4.3.5
  16161. // Sending a payload body on a request that does not
  16162. // expect it can cause undefined behavior on some
  16163. // servers and corrupt connection state. Do not
  16164. // re-use the connection for further requests.
  16165. const expectsPayload = (
  16166. method === 'PUT' ||
  16167. method === 'POST' ||
  16168. method === 'PATCH'
  16169. )
  16170. if (body && typeof body.read === 'function') {
  16171. // Try to read EOF in order to get length.
  16172. body.read(0)
  16173. }
  16174. const bodyLength = util.bodyLength(body)
  16175. let contentLength = bodyLength
  16176. if (contentLength === null) {
  16177. contentLength = request.contentLength
  16178. }
  16179. if (contentLength === 0 && !expectsPayload) {
  16180. // https://tools.ietf.org/html/rfc7230#section-3.3.2
  16181. // A user agent SHOULD NOT send a Content-Length header field when
  16182. // the request message does not contain a payload body and the method
  16183. // semantics do not anticipate such a body.
  16184. contentLength = null
  16185. }
  16186. // https://github.com/nodejs/undici/issues/2046
  16187. // A user agent may send a Content-Length header with 0 value, this should be allowed.
  16188. if (shouldSendContentLength(method) && contentLength > 0 && request.contentLength !== null && request.contentLength !== contentLength) {
  16189. if (client[kStrictContentLength]) {
  16190. errorRequest(client, request, new RequestContentLengthMismatchError())
  16191. return false
  16192. }
  16193. process.emitWarning(new RequestContentLengthMismatchError())
  16194. }
  16195. const socket = client[kSocket]
  16196. try {
  16197. request.onConnect((err) => {
  16198. if (request.aborted || request.completed) {
  16199. return
  16200. }
  16201. errorRequest(client, request, err || new RequestAbortedError())
  16202. util.destroy(socket, new InformationalError('aborted'))
  16203. })
  16204. } catch (err) {
  16205. errorRequest(client, request, err)
  16206. }
  16207. if (request.aborted) {
  16208. return false
  16209. }
  16210. if (method === 'HEAD') {
  16211. // https://github.com/mcollina/undici/issues/258
  16212. // Close after a HEAD request to interop with misbehaving servers
  16213. // that may send a body in the response.
  16214. socket[kReset] = true
  16215. }
  16216. if (upgrade || method === 'CONNECT') {
  16217. // On CONNECT or upgrade, block pipeline from dispatching further
  16218. // requests on this connection.
  16219. socket[kReset] = true
  16220. }
  16221. if (reset != null) {
  16222. socket[kReset] = reset
  16223. }
  16224. if (client[kMaxRequests] && socket[kCounter]++ >= client[kMaxRequests]) {
  16225. socket[kReset] = true
  16226. }
  16227. if (blocking) {
  16228. socket[kBlocking] = true
  16229. }
  16230. let header = `${method} ${path} HTTP/1.1\r\n`
  16231. if (typeof host === 'string') {
  16232. header += `host: ${host}\r\n`
  16233. } else {
  16234. header += client[kHostHeader]
  16235. }
  16236. if (upgrade) {
  16237. header += `connection: upgrade\r\nupgrade: ${upgrade}\r\n`
  16238. } else if (client[kPipelining] && !socket[kReset]) {
  16239. header += 'connection: keep-alive\r\n'
  16240. } else {
  16241. header += 'connection: close\r\n'
  16242. }
  16243. if (headers) {
  16244. header += headers
  16245. }
  16246. if (channels.sendHeaders.hasSubscribers) {
  16247. channels.sendHeaders.publish({ request, headers: header, socket })
  16248. }
  16249. /* istanbul ignore else: assertion */
  16250. if (!body || bodyLength === 0) {
  16251. if (contentLength === 0) {
  16252. socket.write(`${header}content-length: 0\r\n\r\n`, 'latin1')
  16253. } else {
  16254. assert(contentLength === null, 'no body must not have content length')
  16255. socket.write(`${header}\r\n`, 'latin1')
  16256. }
  16257. request.onRequestSent()
  16258. } else if (util.isBuffer(body)) {
  16259. assert(contentLength === body.byteLength, 'buffer body must have content length')
  16260. socket.cork()
  16261. socket.write(`${header}content-length: ${contentLength}\r\n\r\n`, 'latin1')
  16262. socket.write(body)
  16263. socket.uncork()
  16264. request.onBodySent(body)
  16265. request.onRequestSent()
  16266. if (!expectsPayload) {
  16267. socket[kReset] = true
  16268. }
  16269. } else if (util.isBlobLike(body)) {
  16270. if (typeof body.stream === 'function') {
  16271. writeIterable({ body: body.stream(), client, request, socket, contentLength, header, expectsPayload })
  16272. } else {
  16273. writeBlob({ body, client, request, socket, contentLength, header, expectsPayload })
  16274. }
  16275. } else if (util.isStream(body)) {
  16276. writeStream({ body, client, request, socket, contentLength, header, expectsPayload })
  16277. } else if (util.isIterable(body)) {
  16278. writeIterable({ body, client, request, socket, contentLength, header, expectsPayload })
  16279. } else {
  16280. assert(false)
  16281. }
  16282. return true
  16283. }
  16284. function writeH2 (client, session, request) {
  16285. const { body, method, path, host, upgrade, expectContinue, signal, headers: reqHeaders } = request
  16286. let headers
  16287. if (typeof reqHeaders === 'string') headers = Request[kHTTP2CopyHeaders](reqHeaders.trim())
  16288. else headers = reqHeaders
  16289. if (upgrade) {
  16290. errorRequest(client, request, new Error('Upgrade not supported for H2'))
  16291. return false
  16292. }
  16293. try {
  16294. // TODO(HTTP/2): Should we call onConnect immediately or on stream ready event?
  16295. request.onConnect((err) => {
  16296. if (request.aborted || request.completed) {
  16297. return
  16298. }
  16299. errorRequest(client, request, err || new RequestAbortedError())
  16300. })
  16301. } catch (err) {
  16302. errorRequest(client, request, err)
  16303. }
  16304. if (request.aborted) {
  16305. return false
  16306. }
  16307. /** @type {import('node:http2').ClientHttp2Stream} */
  16308. let stream
  16309. const h2State = client[kHTTP2SessionState]
  16310. headers[HTTP2_HEADER_AUTHORITY] = host || client[kHost]
  16311. headers[HTTP2_HEADER_METHOD] = method
  16312. if (method === 'CONNECT') {
  16313. session.ref()
  16314. // we are already connected, streams are pending, first request
  16315. // will create a new stream. We trigger a request to create the stream and wait until
  16316. // `ready` event is triggered
  16317. // We disabled endStream to allow the user to write to the stream
  16318. stream = session.request(headers, { endStream: false, signal })
  16319. if (stream.id && !stream.pending) {
  16320. request.onUpgrade(null, null, stream)
  16321. ++h2State.openStreams
  16322. } else {
  16323. stream.once('ready', () => {
  16324. request.onUpgrade(null, null, stream)
  16325. ++h2State.openStreams
  16326. })
  16327. }
  16328. stream.once('close', () => {
  16329. h2State.openStreams -= 1
  16330. // TODO(HTTP/2): unref only if current streams count is 0
  16331. if (h2State.openStreams === 0) session.unref()
  16332. })
  16333. return true
  16334. }
  16335. // https://tools.ietf.org/html/rfc7540#section-8.3
  16336. // :path and :scheme headers must be omited when sending CONNECT
  16337. headers[HTTP2_HEADER_PATH] = path
  16338. headers[HTTP2_HEADER_SCHEME] = 'https'
  16339. // https://tools.ietf.org/html/rfc7231#section-4.3.1
  16340. // https://tools.ietf.org/html/rfc7231#section-4.3.2
  16341. // https://tools.ietf.org/html/rfc7231#section-4.3.5
  16342. // Sending a payload body on a request that does not
  16343. // expect it can cause undefined behavior on some
  16344. // servers and corrupt connection state. Do not
  16345. // re-use the connection for further requests.
  16346. const expectsPayload = (
  16347. method === 'PUT' ||
  16348. method === 'POST' ||
  16349. method === 'PATCH'
  16350. )
  16351. if (body && typeof body.read === 'function') {
  16352. // Try to read EOF in order to get length.
  16353. body.read(0)
  16354. }
  16355. let contentLength = util.bodyLength(body)
  16356. if (contentLength == null) {
  16357. contentLength = request.contentLength
  16358. }
  16359. if (contentLength === 0 || !expectsPayload) {
  16360. // https://tools.ietf.org/html/rfc7230#section-3.3.2
  16361. // A user agent SHOULD NOT send a Content-Length header field when
  16362. // the request message does not contain a payload body and the method
  16363. // semantics do not anticipate such a body.
  16364. contentLength = null
  16365. }
  16366. // https://github.com/nodejs/undici/issues/2046
  16367. // A user agent may send a Content-Length header with 0 value, this should be allowed.
  16368. if (shouldSendContentLength(method) && contentLength > 0 && request.contentLength != null && request.contentLength !== contentLength) {
  16369. if (client[kStrictContentLength]) {
  16370. errorRequest(client, request, new RequestContentLengthMismatchError())
  16371. return false
  16372. }
  16373. process.emitWarning(new RequestContentLengthMismatchError())
  16374. }
  16375. if (contentLength != null) {
  16376. assert(body, 'no body must not have content length')
  16377. headers[HTTP2_HEADER_CONTENT_LENGTH] = `${contentLength}`
  16378. }
  16379. session.ref()
  16380. const shouldEndStream = method === 'GET' || method === 'HEAD'
  16381. if (expectContinue) {
  16382. headers[HTTP2_HEADER_EXPECT] = '100-continue'
  16383. stream = session.request(headers, { endStream: shouldEndStream, signal })
  16384. stream.once('continue', writeBodyH2)
  16385. } else {
  16386. stream = session.request(headers, {
  16387. endStream: shouldEndStream,
  16388. signal
  16389. })
  16390. writeBodyH2()
  16391. }
  16392. // Increment counter as we have new several streams open
  16393. ++h2State.openStreams
  16394. stream.once('response', headers => {
  16395. const { [HTTP2_HEADER_STATUS]: statusCode, ...realHeaders } = headers
  16396. if (request.onHeaders(Number(statusCode), realHeaders, stream.resume.bind(stream), '') === false) {
  16397. stream.pause()
  16398. }
  16399. })
  16400. stream.once('end', () => {
  16401. request.onComplete([])
  16402. })
  16403. stream.on('data', (chunk) => {
  16404. if (request.onData(chunk) === false) {
  16405. stream.pause()
  16406. }
  16407. })
  16408. stream.once('close', () => {
  16409. h2State.openStreams -= 1
  16410. // TODO(HTTP/2): unref only if current streams count is 0
  16411. if (h2State.openStreams === 0) {
  16412. session.unref()
  16413. }
  16414. })
  16415. stream.once('error', function (err) {
  16416. if (client[kHTTP2Session] && !client[kHTTP2Session].destroyed && !this.closed && !this.destroyed) {
  16417. h2State.streams -= 1
  16418. util.destroy(stream, err)
  16419. }
  16420. })
  16421. stream.once('frameError', (type, code) => {
  16422. const err = new InformationalError(`HTTP/2: "frameError" received - type ${type}, code ${code}`)
  16423. errorRequest(client, request, err)
  16424. if (client[kHTTP2Session] && !client[kHTTP2Session].destroyed && !this.closed && !this.destroyed) {
  16425. h2State.streams -= 1
  16426. util.destroy(stream, err)
  16427. }
  16428. })
  16429. // stream.on('aborted', () => {
  16430. // // TODO(HTTP/2): Support aborted
  16431. // })
  16432. // stream.on('timeout', () => {
  16433. // // TODO(HTTP/2): Support timeout
  16434. // })
  16435. // stream.on('push', headers => {
  16436. // // TODO(HTTP/2): Suppor push
  16437. // })
  16438. // stream.on('trailers', headers => {
  16439. // // TODO(HTTP/2): Support trailers
  16440. // })
  16441. return true
  16442. function writeBodyH2 () {
  16443. /* istanbul ignore else: assertion */
  16444. if (!body) {
  16445. request.onRequestSent()
  16446. } else if (util.isBuffer(body)) {
  16447. assert(contentLength === body.byteLength, 'buffer body must have content length')
  16448. stream.cork()
  16449. stream.write(body)
  16450. stream.uncork()
  16451. stream.end()
  16452. request.onBodySent(body)
  16453. request.onRequestSent()
  16454. } else if (util.isBlobLike(body)) {
  16455. if (typeof body.stream === 'function') {
  16456. writeIterable({
  16457. client,
  16458. request,
  16459. contentLength,
  16460. h2stream: stream,
  16461. expectsPayload,
  16462. body: body.stream(),
  16463. socket: client[kSocket],
  16464. header: ''
  16465. })
  16466. } else {
  16467. writeBlob({
  16468. body,
  16469. client,
  16470. request,
  16471. contentLength,
  16472. expectsPayload,
  16473. h2stream: stream,
  16474. header: '',
  16475. socket: client[kSocket]
  16476. })
  16477. }
  16478. } else if (util.isStream(body)) {
  16479. writeStream({
  16480. body,
  16481. client,
  16482. request,
  16483. contentLength,
  16484. expectsPayload,
  16485. socket: client[kSocket],
  16486. h2stream: stream,
  16487. header: ''
  16488. })
  16489. } else if (util.isIterable(body)) {
  16490. writeIterable({
  16491. body,
  16492. client,
  16493. request,
  16494. contentLength,
  16495. expectsPayload,
  16496. header: '',
  16497. h2stream: stream,
  16498. socket: client[kSocket]
  16499. })
  16500. } else {
  16501. assert(false)
  16502. }
  16503. }
  16504. }
  16505. function writeStream ({ h2stream, body, client, request, socket, contentLength, header, expectsPayload }) {
  16506. assert(contentLength !== 0 || client[kRunning] === 0, 'stream body cannot be pipelined')
  16507. if (client[kHTTPConnVersion] === 'h2') {
  16508. // For HTTP/2, is enough to pipe the stream
  16509. const pipe = pipeline(
  16510. body,
  16511. h2stream,
  16512. (err) => {
  16513. if (err) {
  16514. util.destroy(body, err)
  16515. util.destroy(h2stream, err)
  16516. } else {
  16517. request.onRequestSent()
  16518. }
  16519. }
  16520. )
  16521. pipe.on('data', onPipeData)
  16522. pipe.once('end', () => {
  16523. pipe.removeListener('data', onPipeData)
  16524. util.destroy(pipe)
  16525. })
  16526. function onPipeData (chunk) {
  16527. request.onBodySent(chunk)
  16528. }
  16529. return
  16530. }
  16531. let finished = false
  16532. const writer = new AsyncWriter({ socket, request, contentLength, client, expectsPayload, header })
  16533. const onData = function (chunk) {
  16534. if (finished) {
  16535. return
  16536. }
  16537. try {
  16538. if (!writer.write(chunk) && this.pause) {
  16539. this.pause()
  16540. }
  16541. } catch (err) {
  16542. util.destroy(this, err)
  16543. }
  16544. }
  16545. const onDrain = function () {
  16546. if (finished) {
  16547. return
  16548. }
  16549. if (body.resume) {
  16550. body.resume()
  16551. }
  16552. }
  16553. const onAbort = function () {
  16554. if (finished) {
  16555. return
  16556. }
  16557. const err = new RequestAbortedError()
  16558. queueMicrotask(() => onFinished(err))
  16559. }
  16560. const onFinished = function (err) {
  16561. if (finished) {
  16562. return
  16563. }
  16564. finished = true
  16565. assert(socket.destroyed || (socket[kWriting] && client[kRunning] <= 1))
  16566. socket
  16567. .off('drain', onDrain)
  16568. .off('error', onFinished)
  16569. body
  16570. .removeListener('data', onData)
  16571. .removeListener('end', onFinished)
  16572. .removeListener('error', onFinished)
  16573. .removeListener('close', onAbort)
  16574. if (!err) {
  16575. try {
  16576. writer.end()
  16577. } catch (er) {
  16578. err = er
  16579. }
  16580. }
  16581. writer.destroy(err)
  16582. if (err && (err.code !== 'UND_ERR_INFO' || err.message !== 'reset')) {
  16583. util.destroy(body, err)
  16584. } else {
  16585. util.destroy(body)
  16586. }
  16587. }
  16588. body
  16589. .on('data', onData)
  16590. .on('end', onFinished)
  16591. .on('error', onFinished)
  16592. .on('close', onAbort)
  16593. if (body.resume) {
  16594. body.resume()
  16595. }
  16596. socket
  16597. .on('drain', onDrain)
  16598. .on('error', onFinished)
  16599. }
  16600. async function writeBlob ({ h2stream, body, client, request, socket, contentLength, header, expectsPayload }) {
  16601. assert(contentLength === body.size, 'blob body must have content length')
  16602. const isH2 = client[kHTTPConnVersion] === 'h2'
  16603. try {
  16604. if (contentLength != null && contentLength !== body.size) {
  16605. throw new RequestContentLengthMismatchError()
  16606. }
  16607. const buffer = Buffer.from(await body.arrayBuffer())
  16608. if (isH2) {
  16609. h2stream.cork()
  16610. h2stream.write(buffer)
  16611. h2stream.uncork()
  16612. } else {
  16613. socket.cork()
  16614. socket.write(`${header}content-length: ${contentLength}\r\n\r\n`, 'latin1')
  16615. socket.write(buffer)
  16616. socket.uncork()
  16617. }
  16618. request.onBodySent(buffer)
  16619. request.onRequestSent()
  16620. if (!expectsPayload) {
  16621. socket[kReset] = true
  16622. }
  16623. resume(client)
  16624. } catch (err) {
  16625. util.destroy(isH2 ? h2stream : socket, err)
  16626. }
  16627. }
  16628. async function writeIterable ({ h2stream, body, client, request, socket, contentLength, header, expectsPayload }) {
  16629. assert(contentLength !== 0 || client[kRunning] === 0, 'iterator body cannot be pipelined')
  16630. let callback = null
  16631. function onDrain () {
  16632. if (callback) {
  16633. const cb = callback
  16634. callback = null
  16635. cb()
  16636. }
  16637. }
  16638. const waitForDrain = () => new Promise((resolve, reject) => {
  16639. assert(callback === null)
  16640. if (socket[kError]) {
  16641. reject(socket[kError])
  16642. } else {
  16643. callback = resolve
  16644. }
  16645. })
  16646. if (client[kHTTPConnVersion] === 'h2') {
  16647. h2stream
  16648. .on('close', onDrain)
  16649. .on('drain', onDrain)
  16650. try {
  16651. // It's up to the user to somehow abort the async iterable.
  16652. for await (const chunk of body) {
  16653. if (socket[kError]) {
  16654. throw socket[kError]
  16655. }
  16656. const res = h2stream.write(chunk)
  16657. request.onBodySent(chunk)
  16658. if (!res) {
  16659. await waitForDrain()
  16660. }
  16661. }
  16662. } catch (err) {
  16663. h2stream.destroy(err)
  16664. } finally {
  16665. request.onRequestSent()
  16666. h2stream.end()
  16667. h2stream
  16668. .off('close', onDrain)
  16669. .off('drain', onDrain)
  16670. }
  16671. return
  16672. }
  16673. socket
  16674. .on('close', onDrain)
  16675. .on('drain', onDrain)
  16676. const writer = new AsyncWriter({ socket, request, contentLength, client, expectsPayload, header })
  16677. try {
  16678. // It's up to the user to somehow abort the async iterable.
  16679. for await (const chunk of body) {
  16680. if (socket[kError]) {
  16681. throw socket[kError]
  16682. }
  16683. if (!writer.write(chunk)) {
  16684. await waitForDrain()
  16685. }
  16686. }
  16687. writer.end()
  16688. } catch (err) {
  16689. writer.destroy(err)
  16690. } finally {
  16691. socket
  16692. .off('close', onDrain)
  16693. .off('drain', onDrain)
  16694. }
  16695. }
  16696. class AsyncWriter {
  16697. constructor ({ socket, request, contentLength, client, expectsPayload, header }) {
  16698. this.socket = socket
  16699. this.request = request
  16700. this.contentLength = contentLength
  16701. this.client = client
  16702. this.bytesWritten = 0
  16703. this.expectsPayload = expectsPayload
  16704. this.header = header
  16705. socket[kWriting] = true
  16706. }
  16707. write (chunk) {
  16708. const { socket, request, contentLength, client, bytesWritten, expectsPayload, header } = this
  16709. if (socket[kError]) {
  16710. throw socket[kError]
  16711. }
  16712. if (socket.destroyed) {
  16713. return false
  16714. }
  16715. const len = Buffer.byteLength(chunk)
  16716. if (!len) {
  16717. return true
  16718. }
  16719. // We should defer writing chunks.
  16720. if (contentLength !== null && bytesWritten + len > contentLength) {
  16721. if (client[kStrictContentLength]) {
  16722. throw new RequestContentLengthMismatchError()
  16723. }
  16724. process.emitWarning(new RequestContentLengthMismatchError())
  16725. }
  16726. socket.cork()
  16727. if (bytesWritten === 0) {
  16728. if (!expectsPayload) {
  16729. socket[kReset] = true
  16730. }
  16731. if (contentLength === null) {
  16732. socket.write(`${header}transfer-encoding: chunked\r\n`, 'latin1')
  16733. } else {
  16734. socket.write(`${header}content-length: ${contentLength}\r\n\r\n`, 'latin1')
  16735. }
  16736. }
  16737. if (contentLength === null) {
  16738. socket.write(`\r\n${len.toString(16)}\r\n`, 'latin1')
  16739. }
  16740. this.bytesWritten += len
  16741. const ret = socket.write(chunk)
  16742. socket.uncork()
  16743. request.onBodySent(chunk)
  16744. if (!ret) {
  16745. if (socket[kParser].timeout && socket[kParser].timeoutType === TIMEOUT_HEADERS) {
  16746. // istanbul ignore else: only for jest
  16747. if (socket[kParser].timeout.refresh) {
  16748. socket[kParser].timeout.refresh()
  16749. }
  16750. }
  16751. }
  16752. return ret
  16753. }
  16754. end () {
  16755. const { socket, contentLength, client, bytesWritten, expectsPayload, header, request } = this
  16756. request.onRequestSent()
  16757. socket[kWriting] = false
  16758. if (socket[kError]) {
  16759. throw socket[kError]
  16760. }
  16761. if (socket.destroyed) {
  16762. return
  16763. }
  16764. if (bytesWritten === 0) {
  16765. if (expectsPayload) {
  16766. // https://tools.ietf.org/html/rfc7230#section-3.3.2
  16767. // A user agent SHOULD send a Content-Length in a request message when
  16768. // no Transfer-Encoding is sent and the request method defines a meaning
  16769. // for an enclosed payload body.
  16770. socket.write(`${header}content-length: 0\r\n\r\n`, 'latin1')
  16771. } else {
  16772. socket.write(`${header}\r\n`, 'latin1')
  16773. }
  16774. } else if (contentLength === null) {
  16775. socket.write('\r\n0\r\n\r\n', 'latin1')
  16776. }
  16777. if (contentLength !== null && bytesWritten !== contentLength) {
  16778. if (client[kStrictContentLength]) {
  16779. throw new RequestContentLengthMismatchError()
  16780. } else {
  16781. process.emitWarning(new RequestContentLengthMismatchError())
  16782. }
  16783. }
  16784. if (socket[kParser].timeout && socket[kParser].timeoutType === TIMEOUT_HEADERS) {
  16785. // istanbul ignore else: only for jest
  16786. if (socket[kParser].timeout.refresh) {
  16787. socket[kParser].timeout.refresh()
  16788. }
  16789. }
  16790. resume(client)
  16791. }
  16792. destroy (err) {
  16793. const { socket, client } = this
  16794. socket[kWriting] = false
  16795. if (err) {
  16796. assert(client[kRunning] <= 1, 'pipeline should only contain this request')
  16797. util.destroy(socket, err)
  16798. }
  16799. }
  16800. }
  16801. function errorRequest (client, request, err) {
  16802. try {
  16803. request.onError(err)
  16804. assert(request.aborted)
  16805. } catch (err) {
  16806. client.emit('error', err)
  16807. }
  16808. }
  16809. module.exports = Client
  16810. /***/ }),
  16811. /***/ 6436:
  16812. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  16813. "use strict";
  16814. /* istanbul ignore file: only for Node 12 */
  16815. const { kConnected, kSize } = __nccwpck_require__(2785)
  16816. class CompatWeakRef {
  16817. constructor (value) {
  16818. this.value = value
  16819. }
  16820. deref () {
  16821. return this.value[kConnected] === 0 && this.value[kSize] === 0
  16822. ? undefined
  16823. : this.value
  16824. }
  16825. }
  16826. class CompatFinalizer {
  16827. constructor (finalizer) {
  16828. this.finalizer = finalizer
  16829. }
  16830. register (dispatcher, key) {
  16831. if (dispatcher.on) {
  16832. dispatcher.on('disconnect', () => {
  16833. if (dispatcher[kConnected] === 0 && dispatcher[kSize] === 0) {
  16834. this.finalizer(key)
  16835. }
  16836. })
  16837. }
  16838. }
  16839. }
  16840. module.exports = function () {
  16841. // FIXME: remove workaround when the Node bug is fixed
  16842. // https://github.com/nodejs/node/issues/49344#issuecomment-1741776308
  16843. if (process.env.NODE_V8_COVERAGE) {
  16844. return {
  16845. WeakRef: CompatWeakRef,
  16846. FinalizationRegistry: CompatFinalizer
  16847. }
  16848. }
  16849. return {
  16850. WeakRef: global.WeakRef || CompatWeakRef,
  16851. FinalizationRegistry: global.FinalizationRegistry || CompatFinalizer
  16852. }
  16853. }
  16854. /***/ }),
  16855. /***/ 663:
  16856. /***/ ((module) => {
  16857. "use strict";
  16858. // https://wicg.github.io/cookie-store/#cookie-maximum-attribute-value-size
  16859. const maxAttributeValueSize = 1024
  16860. // https://wicg.github.io/cookie-store/#cookie-maximum-name-value-pair-size
  16861. const maxNameValuePairSize = 4096
  16862. module.exports = {
  16863. maxAttributeValueSize,
  16864. maxNameValuePairSize
  16865. }
  16866. /***/ }),
  16867. /***/ 1724:
  16868. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  16869. "use strict";
  16870. const { parseSetCookie } = __nccwpck_require__(4408)
  16871. const { stringify, getHeadersList } = __nccwpck_require__(3121)
  16872. const { webidl } = __nccwpck_require__(1744)
  16873. const { Headers } = __nccwpck_require__(554)
  16874. /**
  16875. * @typedef {Object} Cookie
  16876. * @property {string} name
  16877. * @property {string} value
  16878. * @property {Date|number|undefined} expires
  16879. * @property {number|undefined} maxAge
  16880. * @property {string|undefined} domain
  16881. * @property {string|undefined} path
  16882. * @property {boolean|undefined} secure
  16883. * @property {boolean|undefined} httpOnly
  16884. * @property {'Strict'|'Lax'|'None'} sameSite
  16885. * @property {string[]} unparsed
  16886. */
  16887. /**
  16888. * @param {Headers} headers
  16889. * @returns {Record<string, string>}
  16890. */
  16891. function getCookies (headers) {
  16892. webidl.argumentLengthCheck(arguments, 1, { header: 'getCookies' })
  16893. webidl.brandCheck(headers, Headers, { strict: false })
  16894. const cookie = headers.get('cookie')
  16895. const out = {}
  16896. if (!cookie) {
  16897. return out
  16898. }
  16899. for (const piece of cookie.split(';')) {
  16900. const [name, ...value] = piece.split('=')
  16901. out[name.trim()] = value.join('=')
  16902. }
  16903. return out
  16904. }
  16905. /**
  16906. * @param {Headers} headers
  16907. * @param {string} name
  16908. * @param {{ path?: string, domain?: string }|undefined} attributes
  16909. * @returns {void}
  16910. */
  16911. function deleteCookie (headers, name, attributes) {
  16912. webidl.argumentLengthCheck(arguments, 2, { header: 'deleteCookie' })
  16913. webidl.brandCheck(headers, Headers, { strict: false })
  16914. name = webidl.converters.DOMString(name)
  16915. attributes = webidl.converters.DeleteCookieAttributes(attributes)
  16916. // Matches behavior of
  16917. // https://github.com/denoland/deno_std/blob/63827b16330b82489a04614027c33b7904e08be5/http/cookie.ts#L278
  16918. setCookie(headers, {
  16919. name,
  16920. value: '',
  16921. expires: new Date(0),
  16922. ...attributes
  16923. })
  16924. }
  16925. /**
  16926. * @param {Headers} headers
  16927. * @returns {Cookie[]}
  16928. */
  16929. function getSetCookies (headers) {
  16930. webidl.argumentLengthCheck(arguments, 1, { header: 'getSetCookies' })
  16931. webidl.brandCheck(headers, Headers, { strict: false })
  16932. const cookies = getHeadersList(headers).cookies
  16933. if (!cookies) {
  16934. return []
  16935. }
  16936. // In older versions of undici, cookies is a list of name:value.
  16937. return cookies.map((pair) => parseSetCookie(Array.isArray(pair) ? pair[1] : pair))
  16938. }
  16939. /**
  16940. * @param {Headers} headers
  16941. * @param {Cookie} cookie
  16942. * @returns {void}
  16943. */
  16944. function setCookie (headers, cookie) {
  16945. webidl.argumentLengthCheck(arguments, 2, { header: 'setCookie' })
  16946. webidl.brandCheck(headers, Headers, { strict: false })
  16947. cookie = webidl.converters.Cookie(cookie)
  16948. const str = stringify(cookie)
  16949. if (str) {
  16950. headers.append('Set-Cookie', stringify(cookie))
  16951. }
  16952. }
  16953. webidl.converters.DeleteCookieAttributes = webidl.dictionaryConverter([
  16954. {
  16955. converter: webidl.nullableConverter(webidl.converters.DOMString),
  16956. key: 'path',
  16957. defaultValue: null
  16958. },
  16959. {
  16960. converter: webidl.nullableConverter(webidl.converters.DOMString),
  16961. key: 'domain',
  16962. defaultValue: null
  16963. }
  16964. ])
  16965. webidl.converters.Cookie = webidl.dictionaryConverter([
  16966. {
  16967. converter: webidl.converters.DOMString,
  16968. key: 'name'
  16969. },
  16970. {
  16971. converter: webidl.converters.DOMString,
  16972. key: 'value'
  16973. },
  16974. {
  16975. converter: webidl.nullableConverter((value) => {
  16976. if (typeof value === 'number') {
  16977. return webidl.converters['unsigned long long'](value)
  16978. }
  16979. return new Date(value)
  16980. }),
  16981. key: 'expires',
  16982. defaultValue: null
  16983. },
  16984. {
  16985. converter: webidl.nullableConverter(webidl.converters['long long']),
  16986. key: 'maxAge',
  16987. defaultValue: null
  16988. },
  16989. {
  16990. converter: webidl.nullableConverter(webidl.converters.DOMString),
  16991. key: 'domain',
  16992. defaultValue: null
  16993. },
  16994. {
  16995. converter: webidl.nullableConverter(webidl.converters.DOMString),
  16996. key: 'path',
  16997. defaultValue: null
  16998. },
  16999. {
  17000. converter: webidl.nullableConverter(webidl.converters.boolean),
  17001. key: 'secure',
  17002. defaultValue: null
  17003. },
  17004. {
  17005. converter: webidl.nullableConverter(webidl.converters.boolean),
  17006. key: 'httpOnly',
  17007. defaultValue: null
  17008. },
  17009. {
  17010. converter: webidl.converters.USVString,
  17011. key: 'sameSite',
  17012. allowedValues: ['Strict', 'Lax', 'None']
  17013. },
  17014. {
  17015. converter: webidl.sequenceConverter(webidl.converters.DOMString),
  17016. key: 'unparsed',
  17017. defaultValue: []
  17018. }
  17019. ])
  17020. module.exports = {
  17021. getCookies,
  17022. deleteCookie,
  17023. getSetCookies,
  17024. setCookie
  17025. }
  17026. /***/ }),
  17027. /***/ 4408:
  17028. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  17029. "use strict";
  17030. const { maxNameValuePairSize, maxAttributeValueSize } = __nccwpck_require__(663)
  17031. const { isCTLExcludingHtab } = __nccwpck_require__(3121)
  17032. const { collectASequenceOfCodePointsFast } = __nccwpck_require__(685)
  17033. const assert = __nccwpck_require__(9491)
  17034. /**
  17035. * @description Parses the field-value attributes of a set-cookie header string.
  17036. * @see https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4
  17037. * @param {string} header
  17038. * @returns if the header is invalid, null will be returned
  17039. */
  17040. function parseSetCookie (header) {
  17041. // 1. If the set-cookie-string contains a %x00-08 / %x0A-1F / %x7F
  17042. // character (CTL characters excluding HTAB): Abort these steps and
  17043. // ignore the set-cookie-string entirely.
  17044. if (isCTLExcludingHtab(header)) {
  17045. return null
  17046. }
  17047. let nameValuePair = ''
  17048. let unparsedAttributes = ''
  17049. let name = ''
  17050. let value = ''
  17051. // 2. If the set-cookie-string contains a %x3B (";") character:
  17052. if (header.includes(';')) {
  17053. // 1. The name-value-pair string consists of the characters up to,
  17054. // but not including, the first %x3B (";"), and the unparsed-
  17055. // attributes consist of the remainder of the set-cookie-string
  17056. // (including the %x3B (";") in question).
  17057. const position = { position: 0 }
  17058. nameValuePair = collectASequenceOfCodePointsFast(';', header, position)
  17059. unparsedAttributes = header.slice(position.position)
  17060. } else {
  17061. // Otherwise:
  17062. // 1. The name-value-pair string consists of all the characters
  17063. // contained in the set-cookie-string, and the unparsed-
  17064. // attributes is the empty string.
  17065. nameValuePair = header
  17066. }
  17067. // 3. If the name-value-pair string lacks a %x3D ("=") character, then
  17068. // the name string is empty, and the value string is the value of
  17069. // name-value-pair.
  17070. if (!nameValuePair.includes('=')) {
  17071. value = nameValuePair
  17072. } else {
  17073. // Otherwise, the name string consists of the characters up to, but
  17074. // not including, the first %x3D ("=") character, and the (possibly
  17075. // empty) value string consists of the characters after the first
  17076. // %x3D ("=") character.
  17077. const position = { position: 0 }
  17078. name = collectASequenceOfCodePointsFast(
  17079. '=',
  17080. nameValuePair,
  17081. position
  17082. )
  17083. value = nameValuePair.slice(position.position + 1)
  17084. }
  17085. // 4. Remove any leading or trailing WSP characters from the name
  17086. // string and the value string.
  17087. name = name.trim()
  17088. value = value.trim()
  17089. // 5. If the sum of the lengths of the name string and the value string
  17090. // is more than 4096 octets, abort these steps and ignore the set-
  17091. // cookie-string entirely.
  17092. if (name.length + value.length > maxNameValuePairSize) {
  17093. return null
  17094. }
  17095. // 6. The cookie-name is the name string, and the cookie-value is the
  17096. // value string.
  17097. return {
  17098. name, value, ...parseUnparsedAttributes(unparsedAttributes)
  17099. }
  17100. }
  17101. /**
  17102. * Parses the remaining attributes of a set-cookie header
  17103. * @see https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4
  17104. * @param {string} unparsedAttributes
  17105. * @param {[Object.<string, unknown>]={}} cookieAttributeList
  17106. */
  17107. function parseUnparsedAttributes (unparsedAttributes, cookieAttributeList = {}) {
  17108. // 1. If the unparsed-attributes string is empty, skip the rest of
  17109. // these steps.
  17110. if (unparsedAttributes.length === 0) {
  17111. return cookieAttributeList
  17112. }
  17113. // 2. Discard the first character of the unparsed-attributes (which
  17114. // will be a %x3B (";") character).
  17115. assert(unparsedAttributes[0] === ';')
  17116. unparsedAttributes = unparsedAttributes.slice(1)
  17117. let cookieAv = ''
  17118. // 3. If the remaining unparsed-attributes contains a %x3B (";")
  17119. // character:
  17120. if (unparsedAttributes.includes(';')) {
  17121. // 1. Consume the characters of the unparsed-attributes up to, but
  17122. // not including, the first %x3B (";") character.
  17123. cookieAv = collectASequenceOfCodePointsFast(
  17124. ';',
  17125. unparsedAttributes,
  17126. { position: 0 }
  17127. )
  17128. unparsedAttributes = unparsedAttributes.slice(cookieAv.length)
  17129. } else {
  17130. // Otherwise:
  17131. // 1. Consume the remainder of the unparsed-attributes.
  17132. cookieAv = unparsedAttributes
  17133. unparsedAttributes = ''
  17134. }
  17135. // Let the cookie-av string be the characters consumed in this step.
  17136. let attributeName = ''
  17137. let attributeValue = ''
  17138. // 4. If the cookie-av string contains a %x3D ("=") character:
  17139. if (cookieAv.includes('=')) {
  17140. // 1. The (possibly empty) attribute-name string consists of the
  17141. // characters up to, but not including, the first %x3D ("=")
  17142. // character, and the (possibly empty) attribute-value string
  17143. // consists of the characters after the first %x3D ("=")
  17144. // character.
  17145. const position = { position: 0 }
  17146. attributeName = collectASequenceOfCodePointsFast(
  17147. '=',
  17148. cookieAv,
  17149. position
  17150. )
  17151. attributeValue = cookieAv.slice(position.position + 1)
  17152. } else {
  17153. // Otherwise:
  17154. // 1. The attribute-name string consists of the entire cookie-av
  17155. // string, and the attribute-value string is empty.
  17156. attributeName = cookieAv
  17157. }
  17158. // 5. Remove any leading or trailing WSP characters from the attribute-
  17159. // name string and the attribute-value string.
  17160. attributeName = attributeName.trim()
  17161. attributeValue = attributeValue.trim()
  17162. // 6. If the attribute-value is longer than 1024 octets, ignore the
  17163. // cookie-av string and return to Step 1 of this algorithm.
  17164. if (attributeValue.length > maxAttributeValueSize) {
  17165. return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList)
  17166. }
  17167. // 7. Process the attribute-name and attribute-value according to the
  17168. // requirements in the following subsections. (Notice that
  17169. // attributes with unrecognized attribute-names are ignored.)
  17170. const attributeNameLowercase = attributeName.toLowerCase()
  17171. // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.1
  17172. // If the attribute-name case-insensitively matches the string
  17173. // "Expires", the user agent MUST process the cookie-av as follows.
  17174. if (attributeNameLowercase === 'expires') {
  17175. // 1. Let the expiry-time be the result of parsing the attribute-value
  17176. // as cookie-date (see Section 5.1.1).
  17177. const expiryTime = new Date(attributeValue)
  17178. // 2. If the attribute-value failed to parse as a cookie date, ignore
  17179. // the cookie-av.
  17180. cookieAttributeList.expires = expiryTime
  17181. } else if (attributeNameLowercase === 'max-age') {
  17182. // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.2
  17183. // If the attribute-name case-insensitively matches the string "Max-
  17184. // Age", the user agent MUST process the cookie-av as follows.
  17185. // 1. If the first character of the attribute-value is not a DIGIT or a
  17186. // "-" character, ignore the cookie-av.
  17187. const charCode = attributeValue.charCodeAt(0)
  17188. if ((charCode < 48 || charCode > 57) && attributeValue[0] !== '-') {
  17189. return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList)
  17190. }
  17191. // 2. If the remainder of attribute-value contains a non-DIGIT
  17192. // character, ignore the cookie-av.
  17193. if (!/^\d+$/.test(attributeValue)) {
  17194. return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList)
  17195. }
  17196. // 3. Let delta-seconds be the attribute-value converted to an integer.
  17197. const deltaSeconds = Number(attributeValue)
  17198. // 4. Let cookie-age-limit be the maximum age of the cookie (which
  17199. // SHOULD be 400 days or less, see Section 4.1.2.2).
  17200. // 5. Set delta-seconds to the smaller of its present value and cookie-
  17201. // age-limit.
  17202. // deltaSeconds = Math.min(deltaSeconds * 1000, maxExpiresMs)
  17203. // 6. If delta-seconds is less than or equal to zero (0), let expiry-
  17204. // time be the earliest representable date and time. Otherwise, let
  17205. // the expiry-time be the current date and time plus delta-seconds
  17206. // seconds.
  17207. // const expiryTime = deltaSeconds <= 0 ? Date.now() : Date.now() + deltaSeconds
  17208. // 7. Append an attribute to the cookie-attribute-list with an
  17209. // attribute-name of Max-Age and an attribute-value of expiry-time.
  17210. cookieAttributeList.maxAge = deltaSeconds
  17211. } else if (attributeNameLowercase === 'domain') {
  17212. // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.3
  17213. // If the attribute-name case-insensitively matches the string "Domain",
  17214. // the user agent MUST process the cookie-av as follows.
  17215. // 1. Let cookie-domain be the attribute-value.
  17216. let cookieDomain = attributeValue
  17217. // 2. If cookie-domain starts with %x2E ("."), let cookie-domain be
  17218. // cookie-domain without its leading %x2E (".").
  17219. if (cookieDomain[0] === '.') {
  17220. cookieDomain = cookieDomain.slice(1)
  17221. }
  17222. // 3. Convert the cookie-domain to lower case.
  17223. cookieDomain = cookieDomain.toLowerCase()
  17224. // 4. Append an attribute to the cookie-attribute-list with an
  17225. // attribute-name of Domain and an attribute-value of cookie-domain.
  17226. cookieAttributeList.domain = cookieDomain
  17227. } else if (attributeNameLowercase === 'path') {
  17228. // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.4
  17229. // If the attribute-name case-insensitively matches the string "Path",
  17230. // the user agent MUST process the cookie-av as follows.
  17231. // 1. If the attribute-value is empty or if the first character of the
  17232. // attribute-value is not %x2F ("/"):
  17233. let cookiePath = ''
  17234. if (attributeValue.length === 0 || attributeValue[0] !== '/') {
  17235. // 1. Let cookie-path be the default-path.
  17236. cookiePath = '/'
  17237. } else {
  17238. // Otherwise:
  17239. // 1. Let cookie-path be the attribute-value.
  17240. cookiePath = attributeValue
  17241. }
  17242. // 2. Append an attribute to the cookie-attribute-list with an
  17243. // attribute-name of Path and an attribute-value of cookie-path.
  17244. cookieAttributeList.path = cookiePath
  17245. } else if (attributeNameLowercase === 'secure') {
  17246. // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.5
  17247. // If the attribute-name case-insensitively matches the string "Secure",
  17248. // the user agent MUST append an attribute to the cookie-attribute-list
  17249. // with an attribute-name of Secure and an empty attribute-value.
  17250. cookieAttributeList.secure = true
  17251. } else if (attributeNameLowercase === 'httponly') {
  17252. // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.6
  17253. // If the attribute-name case-insensitively matches the string
  17254. // "HttpOnly", the user agent MUST append an attribute to the cookie-
  17255. // attribute-list with an attribute-name of HttpOnly and an empty
  17256. // attribute-value.
  17257. cookieAttributeList.httpOnly = true
  17258. } else if (attributeNameLowercase === 'samesite') {
  17259. // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.7
  17260. // If the attribute-name case-insensitively matches the string
  17261. // "SameSite", the user agent MUST process the cookie-av as follows:
  17262. // 1. Let enforcement be "Default".
  17263. let enforcement = 'Default'
  17264. const attributeValueLowercase = attributeValue.toLowerCase()
  17265. // 2. If cookie-av's attribute-value is a case-insensitive match for
  17266. // "None", set enforcement to "None".
  17267. if (attributeValueLowercase.includes('none')) {
  17268. enforcement = 'None'
  17269. }
  17270. // 3. If cookie-av's attribute-value is a case-insensitive match for
  17271. // "Strict", set enforcement to "Strict".
  17272. if (attributeValueLowercase.includes('strict')) {
  17273. enforcement = 'Strict'
  17274. }
  17275. // 4. If cookie-av's attribute-value is a case-insensitive match for
  17276. // "Lax", set enforcement to "Lax".
  17277. if (attributeValueLowercase.includes('lax')) {
  17278. enforcement = 'Lax'
  17279. }
  17280. // 5. Append an attribute to the cookie-attribute-list with an
  17281. // attribute-name of "SameSite" and an attribute-value of
  17282. // enforcement.
  17283. cookieAttributeList.sameSite = enforcement
  17284. } else {
  17285. cookieAttributeList.unparsed ??= []
  17286. cookieAttributeList.unparsed.push(`${attributeName}=${attributeValue}`)
  17287. }
  17288. // 8. Return to Step 1 of this algorithm.
  17289. return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList)
  17290. }
  17291. module.exports = {
  17292. parseSetCookie,
  17293. parseUnparsedAttributes
  17294. }
  17295. /***/ }),
  17296. /***/ 3121:
  17297. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  17298. "use strict";
  17299. const assert = __nccwpck_require__(9491)
  17300. const { kHeadersList } = __nccwpck_require__(2785)
  17301. function isCTLExcludingHtab (value) {
  17302. if (value.length === 0) {
  17303. return false
  17304. }
  17305. for (const char of value) {
  17306. const code = char.charCodeAt(0)
  17307. if (
  17308. (code >= 0x00 || code <= 0x08) ||
  17309. (code >= 0x0A || code <= 0x1F) ||
  17310. code === 0x7F
  17311. ) {
  17312. return false
  17313. }
  17314. }
  17315. }
  17316. /**
  17317. CHAR = <any US-ASCII character (octets 0 - 127)>
  17318. token = 1*<any CHAR except CTLs or separators>
  17319. separators = "(" | ")" | "<" | ">" | "@"
  17320. | "," | ";" | ":" | "\" | <">
  17321. | "/" | "[" | "]" | "?" | "="
  17322. | "{" | "}" | SP | HT
  17323. * @param {string} name
  17324. */
  17325. function validateCookieName (name) {
  17326. for (const char of name) {
  17327. const code = char.charCodeAt(0)
  17328. if (
  17329. (code <= 0x20 || code > 0x7F) ||
  17330. char === '(' ||
  17331. char === ')' ||
  17332. char === '>' ||
  17333. char === '<' ||
  17334. char === '@' ||
  17335. char === ',' ||
  17336. char === ';' ||
  17337. char === ':' ||
  17338. char === '\\' ||
  17339. char === '"' ||
  17340. char === '/' ||
  17341. char === '[' ||
  17342. char === ']' ||
  17343. char === '?' ||
  17344. char === '=' ||
  17345. char === '{' ||
  17346. char === '}'
  17347. ) {
  17348. throw new Error('Invalid cookie name')
  17349. }
  17350. }
  17351. }
  17352. /**
  17353. cookie-value = *cookie-octet / ( DQUOTE *cookie-octet DQUOTE )
  17354. cookie-octet = %x21 / %x23-2B / %x2D-3A / %x3C-5B / %x5D-7E
  17355. ; US-ASCII characters excluding CTLs,
  17356. ; whitespace DQUOTE, comma, semicolon,
  17357. ; and backslash
  17358. * @param {string} value
  17359. */
  17360. function validateCookieValue (value) {
  17361. for (const char of value) {
  17362. const code = char.charCodeAt(0)
  17363. if (
  17364. code < 0x21 || // exclude CTLs (0-31)
  17365. code === 0x22 ||
  17366. code === 0x2C ||
  17367. code === 0x3B ||
  17368. code === 0x5C ||
  17369. code > 0x7E // non-ascii
  17370. ) {
  17371. throw new Error('Invalid header value')
  17372. }
  17373. }
  17374. }
  17375. /**
  17376. * path-value = <any CHAR except CTLs or ";">
  17377. * @param {string} path
  17378. */
  17379. function validateCookiePath (path) {
  17380. for (const char of path) {
  17381. const code = char.charCodeAt(0)
  17382. if (code < 0x21 || char === ';') {
  17383. throw new Error('Invalid cookie path')
  17384. }
  17385. }
  17386. }
  17387. /**
  17388. * I have no idea why these values aren't allowed to be honest,
  17389. * but Deno tests these. - Khafra
  17390. * @param {string} domain
  17391. */
  17392. function validateCookieDomain (domain) {
  17393. if (
  17394. domain.startsWith('-') ||
  17395. domain.endsWith('.') ||
  17396. domain.endsWith('-')
  17397. ) {
  17398. throw new Error('Invalid cookie domain')
  17399. }
  17400. }
  17401. /**
  17402. * @see https://www.rfc-editor.org/rfc/rfc7231#section-7.1.1.1
  17403. * @param {number|Date} date
  17404. IMF-fixdate = day-name "," SP date1 SP time-of-day SP GMT
  17405. ; fixed length/zone/capitalization subset of the format
  17406. ; see Section 3.3 of [RFC5322]
  17407. day-name = %x4D.6F.6E ; "Mon", case-sensitive
  17408. / %x54.75.65 ; "Tue", case-sensitive
  17409. / %x57.65.64 ; "Wed", case-sensitive
  17410. / %x54.68.75 ; "Thu", case-sensitive
  17411. / %x46.72.69 ; "Fri", case-sensitive
  17412. / %x53.61.74 ; "Sat", case-sensitive
  17413. / %x53.75.6E ; "Sun", case-sensitive
  17414. date1 = day SP month SP year
  17415. ; e.g., 02 Jun 1982
  17416. day = 2DIGIT
  17417. month = %x4A.61.6E ; "Jan", case-sensitive
  17418. / %x46.65.62 ; "Feb", case-sensitive
  17419. / %x4D.61.72 ; "Mar", case-sensitive
  17420. / %x41.70.72 ; "Apr", case-sensitive
  17421. / %x4D.61.79 ; "May", case-sensitive
  17422. / %x4A.75.6E ; "Jun", case-sensitive
  17423. / %x4A.75.6C ; "Jul", case-sensitive
  17424. / %x41.75.67 ; "Aug", case-sensitive
  17425. / %x53.65.70 ; "Sep", case-sensitive
  17426. / %x4F.63.74 ; "Oct", case-sensitive
  17427. / %x4E.6F.76 ; "Nov", case-sensitive
  17428. / %x44.65.63 ; "Dec", case-sensitive
  17429. year = 4DIGIT
  17430. GMT = %x47.4D.54 ; "GMT", case-sensitive
  17431. time-of-day = hour ":" minute ":" second
  17432. ; 00:00:00 - 23:59:60 (leap second)
  17433. hour = 2DIGIT
  17434. minute = 2DIGIT
  17435. second = 2DIGIT
  17436. */
  17437. function toIMFDate (date) {
  17438. if (typeof date === 'number') {
  17439. date = new Date(date)
  17440. }
  17441. const days = [
  17442. 'Sun', 'Mon', 'Tue', 'Wed',
  17443. 'Thu', 'Fri', 'Sat'
  17444. ]
  17445. const months = [
  17446. 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
  17447. 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'
  17448. ]
  17449. const dayName = days[date.getUTCDay()]
  17450. const day = date.getUTCDate().toString().padStart(2, '0')
  17451. const month = months[date.getUTCMonth()]
  17452. const year = date.getUTCFullYear()
  17453. const hour = date.getUTCHours().toString().padStart(2, '0')
  17454. const minute = date.getUTCMinutes().toString().padStart(2, '0')
  17455. const second = date.getUTCSeconds().toString().padStart(2, '0')
  17456. return `${dayName}, ${day} ${month} ${year} ${hour}:${minute}:${second} GMT`
  17457. }
  17458. /**
  17459. max-age-av = "Max-Age=" non-zero-digit *DIGIT
  17460. ; In practice, both expires-av and max-age-av
  17461. ; are limited to dates representable by the
  17462. ; user agent.
  17463. * @param {number} maxAge
  17464. */
  17465. function validateCookieMaxAge (maxAge) {
  17466. if (maxAge < 0) {
  17467. throw new Error('Invalid cookie max-age')
  17468. }
  17469. }
  17470. /**
  17471. * @see https://www.rfc-editor.org/rfc/rfc6265#section-4.1.1
  17472. * @param {import('./index').Cookie} cookie
  17473. */
  17474. function stringify (cookie) {
  17475. if (cookie.name.length === 0) {
  17476. return null
  17477. }
  17478. validateCookieName(cookie.name)
  17479. validateCookieValue(cookie.value)
  17480. const out = [`${cookie.name}=${cookie.value}`]
  17481. // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-cookie-prefixes-00#section-3.1
  17482. // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-cookie-prefixes-00#section-3.2
  17483. if (cookie.name.startsWith('__Secure-')) {
  17484. cookie.secure = true
  17485. }
  17486. if (cookie.name.startsWith('__Host-')) {
  17487. cookie.secure = true
  17488. cookie.domain = null
  17489. cookie.path = '/'
  17490. }
  17491. if (cookie.secure) {
  17492. out.push('Secure')
  17493. }
  17494. if (cookie.httpOnly) {
  17495. out.push('HttpOnly')
  17496. }
  17497. if (typeof cookie.maxAge === 'number') {
  17498. validateCookieMaxAge(cookie.maxAge)
  17499. out.push(`Max-Age=${cookie.maxAge}`)
  17500. }
  17501. if (cookie.domain) {
  17502. validateCookieDomain(cookie.domain)
  17503. out.push(`Domain=${cookie.domain}`)
  17504. }
  17505. if (cookie.path) {
  17506. validateCookiePath(cookie.path)
  17507. out.push(`Path=${cookie.path}`)
  17508. }
  17509. if (cookie.expires && cookie.expires.toString() !== 'Invalid Date') {
  17510. out.push(`Expires=${toIMFDate(cookie.expires)}`)
  17511. }
  17512. if (cookie.sameSite) {
  17513. out.push(`SameSite=${cookie.sameSite}`)
  17514. }
  17515. for (const part of cookie.unparsed) {
  17516. if (!part.includes('=')) {
  17517. throw new Error('Invalid unparsed')
  17518. }
  17519. const [key, ...value] = part.split('=')
  17520. out.push(`${key.trim()}=${value.join('=')}`)
  17521. }
  17522. return out.join('; ')
  17523. }
  17524. let kHeadersListNode
  17525. function getHeadersList (headers) {
  17526. if (headers[kHeadersList]) {
  17527. return headers[kHeadersList]
  17528. }
  17529. if (!kHeadersListNode) {
  17530. kHeadersListNode = Object.getOwnPropertySymbols(headers).find(
  17531. (symbol) => symbol.description === 'headers list'
  17532. )
  17533. assert(kHeadersListNode, 'Headers cannot be parsed')
  17534. }
  17535. const headersList = headers[kHeadersListNode]
  17536. assert(headersList)
  17537. return headersList
  17538. }
  17539. module.exports = {
  17540. isCTLExcludingHtab,
  17541. stringify,
  17542. getHeadersList
  17543. }
  17544. /***/ }),
  17545. /***/ 2067:
  17546. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  17547. "use strict";
  17548. const net = __nccwpck_require__(1808)
  17549. const assert = __nccwpck_require__(9491)
  17550. const util = __nccwpck_require__(3983)
  17551. const { InvalidArgumentError, ConnectTimeoutError } = __nccwpck_require__(8045)
  17552. let tls // include tls conditionally since it is not always available
  17553. // TODO: session re-use does not wait for the first
  17554. // connection to resolve the session and might therefore
  17555. // resolve the same servername multiple times even when
  17556. // re-use is enabled.
  17557. let SessionCache
  17558. // FIXME: remove workaround when the Node bug is fixed
  17559. // https://github.com/nodejs/node/issues/49344#issuecomment-1741776308
  17560. if (global.FinalizationRegistry && !process.env.NODE_V8_COVERAGE) {
  17561. SessionCache = class WeakSessionCache {
  17562. constructor (maxCachedSessions) {
  17563. this._maxCachedSessions = maxCachedSessions
  17564. this._sessionCache = new Map()
  17565. this._sessionRegistry = new global.FinalizationRegistry((key) => {
  17566. if (this._sessionCache.size < this._maxCachedSessions) {
  17567. return
  17568. }
  17569. const ref = this._sessionCache.get(key)
  17570. if (ref !== undefined && ref.deref() === undefined) {
  17571. this._sessionCache.delete(key)
  17572. }
  17573. })
  17574. }
  17575. get (sessionKey) {
  17576. const ref = this._sessionCache.get(sessionKey)
  17577. return ref ? ref.deref() : null
  17578. }
  17579. set (sessionKey, session) {
  17580. if (this._maxCachedSessions === 0) {
  17581. return
  17582. }
  17583. this._sessionCache.set(sessionKey, new WeakRef(session))
  17584. this._sessionRegistry.register(session, sessionKey)
  17585. }
  17586. }
  17587. } else {
  17588. SessionCache = class SimpleSessionCache {
  17589. constructor (maxCachedSessions) {
  17590. this._maxCachedSessions = maxCachedSessions
  17591. this._sessionCache = new Map()
  17592. }
  17593. get (sessionKey) {
  17594. return this._sessionCache.get(sessionKey)
  17595. }
  17596. set (sessionKey, session) {
  17597. if (this._maxCachedSessions === 0) {
  17598. return
  17599. }
  17600. if (this._sessionCache.size >= this._maxCachedSessions) {
  17601. // remove the oldest session
  17602. const { value: oldestKey } = this._sessionCache.keys().next()
  17603. this._sessionCache.delete(oldestKey)
  17604. }
  17605. this._sessionCache.set(sessionKey, session)
  17606. }
  17607. }
  17608. }
  17609. function buildConnector ({ allowH2, maxCachedSessions, socketPath, timeout, ...opts }) {
  17610. if (maxCachedSessions != null && (!Number.isInteger(maxCachedSessions) || maxCachedSessions < 0)) {
  17611. throw new InvalidArgumentError('maxCachedSessions must be a positive integer or zero')
  17612. }
  17613. const options = { path: socketPath, ...opts }
  17614. const sessionCache = new SessionCache(maxCachedSessions == null ? 100 : maxCachedSessions)
  17615. timeout = timeout == null ? 10e3 : timeout
  17616. allowH2 = allowH2 != null ? allowH2 : false
  17617. return function connect ({ hostname, host, protocol, port, servername, localAddress, httpSocket }, callback) {
  17618. let socket
  17619. if (protocol === 'https:') {
  17620. if (!tls) {
  17621. tls = __nccwpck_require__(4404)
  17622. }
  17623. servername = servername || options.servername || util.getServerName(host) || null
  17624. const sessionKey = servername || hostname
  17625. const session = sessionCache.get(sessionKey) || null
  17626. assert(sessionKey)
  17627. socket = tls.connect({
  17628. highWaterMark: 16384, // TLS in node can't have bigger HWM anyway...
  17629. ...options,
  17630. servername,
  17631. session,
  17632. localAddress,
  17633. // TODO(HTTP/2): Add support for h2c
  17634. ALPNProtocols: allowH2 ? ['http/1.1', 'h2'] : ['http/1.1'],
  17635. socket: httpSocket, // upgrade socket connection
  17636. port: port || 443,
  17637. host: hostname
  17638. })
  17639. socket
  17640. .on('session', function (session) {
  17641. // TODO (fix): Can a session become invalid once established? Don't think so?
  17642. sessionCache.set(sessionKey, session)
  17643. })
  17644. } else {
  17645. assert(!httpSocket, 'httpSocket can only be sent on TLS update')
  17646. socket = net.connect({
  17647. highWaterMark: 64 * 1024, // Same as nodejs fs streams.
  17648. ...options,
  17649. localAddress,
  17650. port: port || 80,
  17651. host: hostname
  17652. })
  17653. }
  17654. // Set TCP keep alive options on the socket here instead of in connect() for the case of assigning the socket
  17655. if (options.keepAlive == null || options.keepAlive) {
  17656. const keepAliveInitialDelay = options.keepAliveInitialDelay === undefined ? 60e3 : options.keepAliveInitialDelay
  17657. socket.setKeepAlive(true, keepAliveInitialDelay)
  17658. }
  17659. const cancelTimeout = setupTimeout(() => onConnectTimeout(socket), timeout)
  17660. socket
  17661. .setNoDelay(true)
  17662. .once(protocol === 'https:' ? 'secureConnect' : 'connect', function () {
  17663. cancelTimeout()
  17664. if (callback) {
  17665. const cb = callback
  17666. callback = null
  17667. cb(null, this)
  17668. }
  17669. })
  17670. .on('error', function (err) {
  17671. cancelTimeout()
  17672. if (callback) {
  17673. const cb = callback
  17674. callback = null
  17675. cb(err)
  17676. }
  17677. })
  17678. return socket
  17679. }
  17680. }
  17681. function setupTimeout (onConnectTimeout, timeout) {
  17682. if (!timeout) {
  17683. return () => {}
  17684. }
  17685. let s1 = null
  17686. let s2 = null
  17687. const timeoutId = setTimeout(() => {
  17688. // setImmediate is added to make sure that we priotorise socket error events over timeouts
  17689. s1 = setImmediate(() => {
  17690. if (process.platform === 'win32') {
  17691. // Windows needs an extra setImmediate probably due to implementation differences in the socket logic
  17692. s2 = setImmediate(() => onConnectTimeout())
  17693. } else {
  17694. onConnectTimeout()
  17695. }
  17696. })
  17697. }, timeout)
  17698. return () => {
  17699. clearTimeout(timeoutId)
  17700. clearImmediate(s1)
  17701. clearImmediate(s2)
  17702. }
  17703. }
  17704. function onConnectTimeout (socket) {
  17705. util.destroy(socket, new ConnectTimeoutError())
  17706. }
  17707. module.exports = buildConnector
  17708. /***/ }),
  17709. /***/ 4462:
  17710. /***/ ((module) => {
  17711. "use strict";
  17712. /** @type {Record<string, string | undefined>} */
  17713. const headerNameLowerCasedRecord = {}
  17714. // https://developer.mozilla.org/docs/Web/HTTP/Headers
  17715. const wellknownHeaderNames = [
  17716. 'Accept',
  17717. 'Accept-Encoding',
  17718. 'Accept-Language',
  17719. 'Accept-Ranges',
  17720. 'Access-Control-Allow-Credentials',
  17721. 'Access-Control-Allow-Headers',
  17722. 'Access-Control-Allow-Methods',
  17723. 'Access-Control-Allow-Origin',
  17724. 'Access-Control-Expose-Headers',
  17725. 'Access-Control-Max-Age',
  17726. 'Access-Control-Request-Headers',
  17727. 'Access-Control-Request-Method',
  17728. 'Age',
  17729. 'Allow',
  17730. 'Alt-Svc',
  17731. 'Alt-Used',
  17732. 'Authorization',
  17733. 'Cache-Control',
  17734. 'Clear-Site-Data',
  17735. 'Connection',
  17736. 'Content-Disposition',
  17737. 'Content-Encoding',
  17738. 'Content-Language',
  17739. 'Content-Length',
  17740. 'Content-Location',
  17741. 'Content-Range',
  17742. 'Content-Security-Policy',
  17743. 'Content-Security-Policy-Report-Only',
  17744. 'Content-Type',
  17745. 'Cookie',
  17746. 'Cross-Origin-Embedder-Policy',
  17747. 'Cross-Origin-Opener-Policy',
  17748. 'Cross-Origin-Resource-Policy',
  17749. 'Date',
  17750. 'Device-Memory',
  17751. 'Downlink',
  17752. 'ECT',
  17753. 'ETag',
  17754. 'Expect',
  17755. 'Expect-CT',
  17756. 'Expires',
  17757. 'Forwarded',
  17758. 'From',
  17759. 'Host',
  17760. 'If-Match',
  17761. 'If-Modified-Since',
  17762. 'If-None-Match',
  17763. 'If-Range',
  17764. 'If-Unmodified-Since',
  17765. 'Keep-Alive',
  17766. 'Last-Modified',
  17767. 'Link',
  17768. 'Location',
  17769. 'Max-Forwards',
  17770. 'Origin',
  17771. 'Permissions-Policy',
  17772. 'Pragma',
  17773. 'Proxy-Authenticate',
  17774. 'Proxy-Authorization',
  17775. 'RTT',
  17776. 'Range',
  17777. 'Referer',
  17778. 'Referrer-Policy',
  17779. 'Refresh',
  17780. 'Retry-After',
  17781. 'Sec-WebSocket-Accept',
  17782. 'Sec-WebSocket-Extensions',
  17783. 'Sec-WebSocket-Key',
  17784. 'Sec-WebSocket-Protocol',
  17785. 'Sec-WebSocket-Version',
  17786. 'Server',
  17787. 'Server-Timing',
  17788. 'Service-Worker-Allowed',
  17789. 'Service-Worker-Navigation-Preload',
  17790. 'Set-Cookie',
  17791. 'SourceMap',
  17792. 'Strict-Transport-Security',
  17793. 'Supports-Loading-Mode',
  17794. 'TE',
  17795. 'Timing-Allow-Origin',
  17796. 'Trailer',
  17797. 'Transfer-Encoding',
  17798. 'Upgrade',
  17799. 'Upgrade-Insecure-Requests',
  17800. 'User-Agent',
  17801. 'Vary',
  17802. 'Via',
  17803. 'WWW-Authenticate',
  17804. 'X-Content-Type-Options',
  17805. 'X-DNS-Prefetch-Control',
  17806. 'X-Frame-Options',
  17807. 'X-Permitted-Cross-Domain-Policies',
  17808. 'X-Powered-By',
  17809. 'X-Requested-With',
  17810. 'X-XSS-Protection'
  17811. ]
  17812. for (let i = 0; i < wellknownHeaderNames.length; ++i) {
  17813. const key = wellknownHeaderNames[i]
  17814. const lowerCasedKey = key.toLowerCase()
  17815. headerNameLowerCasedRecord[key] = headerNameLowerCasedRecord[lowerCasedKey] =
  17816. lowerCasedKey
  17817. }
  17818. // Note: object prototypes should not be able to be referenced. e.g. `Object#hasOwnProperty`.
  17819. Object.setPrototypeOf(headerNameLowerCasedRecord, null)
  17820. module.exports = {
  17821. wellknownHeaderNames,
  17822. headerNameLowerCasedRecord
  17823. }
  17824. /***/ }),
  17825. /***/ 8045:
  17826. /***/ ((module) => {
  17827. "use strict";
  17828. class UndiciError extends Error {
  17829. constructor (message) {
  17830. super(message)
  17831. this.name = 'UndiciError'
  17832. this.code = 'UND_ERR'
  17833. }
  17834. }
  17835. class ConnectTimeoutError extends UndiciError {
  17836. constructor (message) {
  17837. super(message)
  17838. Error.captureStackTrace(this, ConnectTimeoutError)
  17839. this.name = 'ConnectTimeoutError'
  17840. this.message = message || 'Connect Timeout Error'
  17841. this.code = 'UND_ERR_CONNECT_TIMEOUT'
  17842. }
  17843. }
  17844. class HeadersTimeoutError extends UndiciError {
  17845. constructor (message) {
  17846. super(message)
  17847. Error.captureStackTrace(this, HeadersTimeoutError)
  17848. this.name = 'HeadersTimeoutError'
  17849. this.message = message || 'Headers Timeout Error'
  17850. this.code = 'UND_ERR_HEADERS_TIMEOUT'
  17851. }
  17852. }
  17853. class HeadersOverflowError extends UndiciError {
  17854. constructor (message) {
  17855. super(message)
  17856. Error.captureStackTrace(this, HeadersOverflowError)
  17857. this.name = 'HeadersOverflowError'
  17858. this.message = message || 'Headers Overflow Error'
  17859. this.code = 'UND_ERR_HEADERS_OVERFLOW'
  17860. }
  17861. }
  17862. class BodyTimeoutError extends UndiciError {
  17863. constructor (message) {
  17864. super(message)
  17865. Error.captureStackTrace(this, BodyTimeoutError)
  17866. this.name = 'BodyTimeoutError'
  17867. this.message = message || 'Body Timeout Error'
  17868. this.code = 'UND_ERR_BODY_TIMEOUT'
  17869. }
  17870. }
  17871. class ResponseStatusCodeError extends UndiciError {
  17872. constructor (message, statusCode, headers, body) {
  17873. super(message)
  17874. Error.captureStackTrace(this, ResponseStatusCodeError)
  17875. this.name = 'ResponseStatusCodeError'
  17876. this.message = message || 'Response Status Code Error'
  17877. this.code = 'UND_ERR_RESPONSE_STATUS_CODE'
  17878. this.body = body
  17879. this.status = statusCode
  17880. this.statusCode = statusCode
  17881. this.headers = headers
  17882. }
  17883. }
  17884. class InvalidArgumentError extends UndiciError {
  17885. constructor (message) {
  17886. super(message)
  17887. Error.captureStackTrace(this, InvalidArgumentError)
  17888. this.name = 'InvalidArgumentError'
  17889. this.message = message || 'Invalid Argument Error'
  17890. this.code = 'UND_ERR_INVALID_ARG'
  17891. }
  17892. }
  17893. class InvalidReturnValueError extends UndiciError {
  17894. constructor (message) {
  17895. super(message)
  17896. Error.captureStackTrace(this, InvalidReturnValueError)
  17897. this.name = 'InvalidReturnValueError'
  17898. this.message = message || 'Invalid Return Value Error'
  17899. this.code = 'UND_ERR_INVALID_RETURN_VALUE'
  17900. }
  17901. }
  17902. class RequestAbortedError extends UndiciError {
  17903. constructor (message) {
  17904. super(message)
  17905. Error.captureStackTrace(this, RequestAbortedError)
  17906. this.name = 'AbortError'
  17907. this.message = message || 'Request aborted'
  17908. this.code = 'UND_ERR_ABORTED'
  17909. }
  17910. }
  17911. class InformationalError extends UndiciError {
  17912. constructor (message) {
  17913. super(message)
  17914. Error.captureStackTrace(this, InformationalError)
  17915. this.name = 'InformationalError'
  17916. this.message = message || 'Request information'
  17917. this.code = 'UND_ERR_INFO'
  17918. }
  17919. }
  17920. class RequestContentLengthMismatchError extends UndiciError {
  17921. constructor (message) {
  17922. super(message)
  17923. Error.captureStackTrace(this, RequestContentLengthMismatchError)
  17924. this.name = 'RequestContentLengthMismatchError'
  17925. this.message = message || 'Request body length does not match content-length header'
  17926. this.code = 'UND_ERR_REQ_CONTENT_LENGTH_MISMATCH'
  17927. }
  17928. }
  17929. class ResponseContentLengthMismatchError extends UndiciError {
  17930. constructor (message) {
  17931. super(message)
  17932. Error.captureStackTrace(this, ResponseContentLengthMismatchError)
  17933. this.name = 'ResponseContentLengthMismatchError'
  17934. this.message = message || 'Response body length does not match content-length header'
  17935. this.code = 'UND_ERR_RES_CONTENT_LENGTH_MISMATCH'
  17936. }
  17937. }
  17938. class ClientDestroyedError extends UndiciError {
  17939. constructor (message) {
  17940. super(message)
  17941. Error.captureStackTrace(this, ClientDestroyedError)
  17942. this.name = 'ClientDestroyedError'
  17943. this.message = message || 'The client is destroyed'
  17944. this.code = 'UND_ERR_DESTROYED'
  17945. }
  17946. }
  17947. class ClientClosedError extends UndiciError {
  17948. constructor (message) {
  17949. super(message)
  17950. Error.captureStackTrace(this, ClientClosedError)
  17951. this.name = 'ClientClosedError'
  17952. this.message = message || 'The client is closed'
  17953. this.code = 'UND_ERR_CLOSED'
  17954. }
  17955. }
  17956. class SocketError extends UndiciError {
  17957. constructor (message, socket) {
  17958. super(message)
  17959. Error.captureStackTrace(this, SocketError)
  17960. this.name = 'SocketError'
  17961. this.message = message || 'Socket error'
  17962. this.code = 'UND_ERR_SOCKET'
  17963. this.socket = socket
  17964. }
  17965. }
  17966. class NotSupportedError extends UndiciError {
  17967. constructor (message) {
  17968. super(message)
  17969. Error.captureStackTrace(this, NotSupportedError)
  17970. this.name = 'NotSupportedError'
  17971. this.message = message || 'Not supported error'
  17972. this.code = 'UND_ERR_NOT_SUPPORTED'
  17973. }
  17974. }
  17975. class BalancedPoolMissingUpstreamError extends UndiciError {
  17976. constructor (message) {
  17977. super(message)
  17978. Error.captureStackTrace(this, NotSupportedError)
  17979. this.name = 'MissingUpstreamError'
  17980. this.message = message || 'No upstream has been added to the BalancedPool'
  17981. this.code = 'UND_ERR_BPL_MISSING_UPSTREAM'
  17982. }
  17983. }
  17984. class HTTPParserError extends Error {
  17985. constructor (message, code, data) {
  17986. super(message)
  17987. Error.captureStackTrace(this, HTTPParserError)
  17988. this.name = 'HTTPParserError'
  17989. this.code = code ? `HPE_${code}` : undefined
  17990. this.data = data ? data.toString() : undefined
  17991. }
  17992. }
  17993. class ResponseExceededMaxSizeError extends UndiciError {
  17994. constructor (message) {
  17995. super(message)
  17996. Error.captureStackTrace(this, ResponseExceededMaxSizeError)
  17997. this.name = 'ResponseExceededMaxSizeError'
  17998. this.message = message || 'Response content exceeded max size'
  17999. this.code = 'UND_ERR_RES_EXCEEDED_MAX_SIZE'
  18000. }
  18001. }
  18002. class RequestRetryError extends UndiciError {
  18003. constructor (message, code, { headers, data }) {
  18004. super(message)
  18005. Error.captureStackTrace(this, RequestRetryError)
  18006. this.name = 'RequestRetryError'
  18007. this.message = message || 'Request retry error'
  18008. this.code = 'UND_ERR_REQ_RETRY'
  18009. this.statusCode = code
  18010. this.data = data
  18011. this.headers = headers
  18012. }
  18013. }
  18014. module.exports = {
  18015. HTTPParserError,
  18016. UndiciError,
  18017. HeadersTimeoutError,
  18018. HeadersOverflowError,
  18019. BodyTimeoutError,
  18020. RequestContentLengthMismatchError,
  18021. ConnectTimeoutError,
  18022. ResponseStatusCodeError,
  18023. InvalidArgumentError,
  18024. InvalidReturnValueError,
  18025. RequestAbortedError,
  18026. ClientDestroyedError,
  18027. ClientClosedError,
  18028. InformationalError,
  18029. SocketError,
  18030. NotSupportedError,
  18031. ResponseContentLengthMismatchError,
  18032. BalancedPoolMissingUpstreamError,
  18033. ResponseExceededMaxSizeError,
  18034. RequestRetryError
  18035. }
  18036. /***/ }),
  18037. /***/ 2905:
  18038. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  18039. "use strict";
  18040. const {
  18041. InvalidArgumentError,
  18042. NotSupportedError
  18043. } = __nccwpck_require__(8045)
  18044. const assert = __nccwpck_require__(9491)
  18045. const { kHTTP2BuildRequest, kHTTP2CopyHeaders, kHTTP1BuildRequest } = __nccwpck_require__(2785)
  18046. const util = __nccwpck_require__(3983)
  18047. // tokenRegExp and headerCharRegex have been lifted from
  18048. // https://github.com/nodejs/node/blob/main/lib/_http_common.js
  18049. /**
  18050. * Verifies that the given val is a valid HTTP token
  18051. * per the rules defined in RFC 7230
  18052. * See https://tools.ietf.org/html/rfc7230#section-3.2.6
  18053. */
  18054. const tokenRegExp = /^[\^_`a-zA-Z\-0-9!#$%&'*+.|~]+$/
  18055. /**
  18056. * Matches if val contains an invalid field-vchar
  18057. * field-value = *( field-content / obs-fold )
  18058. * field-content = field-vchar [ 1*( SP / HTAB ) field-vchar ]
  18059. * field-vchar = VCHAR / obs-text
  18060. */
  18061. const headerCharRegex = /[^\t\x20-\x7e\x80-\xff]/
  18062. // Verifies that a given path is valid does not contain control chars \x00 to \x20
  18063. const invalidPathRegex = /[^\u0021-\u00ff]/
  18064. const kHandler = Symbol('handler')
  18065. const channels = {}
  18066. let extractBody
  18067. try {
  18068. const diagnosticsChannel = __nccwpck_require__(7643)
  18069. channels.create = diagnosticsChannel.channel('undici:request:create')
  18070. channels.bodySent = diagnosticsChannel.channel('undici:request:bodySent')
  18071. channels.headers = diagnosticsChannel.channel('undici:request:headers')
  18072. channels.trailers = diagnosticsChannel.channel('undici:request:trailers')
  18073. channels.error = diagnosticsChannel.channel('undici:request:error')
  18074. } catch {
  18075. channels.create = { hasSubscribers: false }
  18076. channels.bodySent = { hasSubscribers: false }
  18077. channels.headers = { hasSubscribers: false }
  18078. channels.trailers = { hasSubscribers: false }
  18079. channels.error = { hasSubscribers: false }
  18080. }
  18081. class Request {
  18082. constructor (origin, {
  18083. path,
  18084. method,
  18085. body,
  18086. headers,
  18087. query,
  18088. idempotent,
  18089. blocking,
  18090. upgrade,
  18091. headersTimeout,
  18092. bodyTimeout,
  18093. reset,
  18094. throwOnError,
  18095. expectContinue
  18096. }, handler) {
  18097. if (typeof path !== 'string') {
  18098. throw new InvalidArgumentError('path must be a string')
  18099. } else if (
  18100. path[0] !== '/' &&
  18101. !(path.startsWith('http://') || path.startsWith('https://')) &&
  18102. method !== 'CONNECT'
  18103. ) {
  18104. throw new InvalidArgumentError('path must be an absolute URL or start with a slash')
  18105. } else if (invalidPathRegex.exec(path) !== null) {
  18106. throw new InvalidArgumentError('invalid request path')
  18107. }
  18108. if (typeof method !== 'string') {
  18109. throw new InvalidArgumentError('method must be a string')
  18110. } else if (tokenRegExp.exec(method) === null) {
  18111. throw new InvalidArgumentError('invalid request method')
  18112. }
  18113. if (upgrade && typeof upgrade !== 'string') {
  18114. throw new InvalidArgumentError('upgrade must be a string')
  18115. }
  18116. if (headersTimeout != null && (!Number.isFinite(headersTimeout) || headersTimeout < 0)) {
  18117. throw new InvalidArgumentError('invalid headersTimeout')
  18118. }
  18119. if (bodyTimeout != null && (!Number.isFinite(bodyTimeout) || bodyTimeout < 0)) {
  18120. throw new InvalidArgumentError('invalid bodyTimeout')
  18121. }
  18122. if (reset != null && typeof reset !== 'boolean') {
  18123. throw new InvalidArgumentError('invalid reset')
  18124. }
  18125. if (expectContinue != null && typeof expectContinue !== 'boolean') {
  18126. throw new InvalidArgumentError('invalid expectContinue')
  18127. }
  18128. this.headersTimeout = headersTimeout
  18129. this.bodyTimeout = bodyTimeout
  18130. this.throwOnError = throwOnError === true
  18131. this.method = method
  18132. this.abort = null
  18133. if (body == null) {
  18134. this.body = null
  18135. } else if (util.isStream(body)) {
  18136. this.body = body
  18137. const rState = this.body._readableState
  18138. if (!rState || !rState.autoDestroy) {
  18139. this.endHandler = function autoDestroy () {
  18140. util.destroy(this)
  18141. }
  18142. this.body.on('end', this.endHandler)
  18143. }
  18144. this.errorHandler = err => {
  18145. if (this.abort) {
  18146. this.abort(err)
  18147. } else {
  18148. this.error = err
  18149. }
  18150. }
  18151. this.body.on('error', this.errorHandler)
  18152. } else if (util.isBuffer(body)) {
  18153. this.body = body.byteLength ? body : null
  18154. } else if (ArrayBuffer.isView(body)) {
  18155. this.body = body.buffer.byteLength ? Buffer.from(body.buffer, body.byteOffset, body.byteLength) : null
  18156. } else if (body instanceof ArrayBuffer) {
  18157. this.body = body.byteLength ? Buffer.from(body) : null
  18158. } else if (typeof body === 'string') {
  18159. this.body = body.length ? Buffer.from(body) : null
  18160. } else if (util.isFormDataLike(body) || util.isIterable(body) || util.isBlobLike(body)) {
  18161. this.body = body
  18162. } else {
  18163. throw new InvalidArgumentError('body must be a string, a Buffer, a Readable stream, an iterable, or an async iterable')
  18164. }
  18165. this.completed = false
  18166. this.aborted = false
  18167. this.upgrade = upgrade || null
  18168. this.path = query ? util.buildURL(path, query) : path
  18169. this.origin = origin
  18170. this.idempotent = idempotent == null
  18171. ? method === 'HEAD' || method === 'GET'
  18172. : idempotent
  18173. this.blocking = blocking == null ? false : blocking
  18174. this.reset = reset == null ? null : reset
  18175. this.host = null
  18176. this.contentLength = null
  18177. this.contentType = null
  18178. this.headers = ''
  18179. // Only for H2
  18180. this.expectContinue = expectContinue != null ? expectContinue : false
  18181. if (Array.isArray(headers)) {
  18182. if (headers.length % 2 !== 0) {
  18183. throw new InvalidArgumentError('headers array must be even')
  18184. }
  18185. for (let i = 0; i < headers.length; i += 2) {
  18186. processHeader(this, headers[i], headers[i + 1])
  18187. }
  18188. } else if (headers && typeof headers === 'object') {
  18189. const keys = Object.keys(headers)
  18190. for (let i = 0; i < keys.length; i++) {
  18191. const key = keys[i]
  18192. processHeader(this, key, headers[key])
  18193. }
  18194. } else if (headers != null) {
  18195. throw new InvalidArgumentError('headers must be an object or an array')
  18196. }
  18197. if (util.isFormDataLike(this.body)) {
  18198. if (util.nodeMajor < 16 || (util.nodeMajor === 16 && util.nodeMinor < 8)) {
  18199. throw new InvalidArgumentError('Form-Data bodies are only supported in node v16.8 and newer.')
  18200. }
  18201. if (!extractBody) {
  18202. extractBody = (__nccwpck_require__(9990).extractBody)
  18203. }
  18204. const [bodyStream, contentType] = extractBody(body)
  18205. if (this.contentType == null) {
  18206. this.contentType = contentType
  18207. this.headers += `content-type: ${contentType}\r\n`
  18208. }
  18209. this.body = bodyStream.stream
  18210. this.contentLength = bodyStream.length
  18211. } else if (util.isBlobLike(body) && this.contentType == null && body.type) {
  18212. this.contentType = body.type
  18213. this.headers += `content-type: ${body.type}\r\n`
  18214. }
  18215. util.validateHandler(handler, method, upgrade)
  18216. this.servername = util.getServerName(this.host)
  18217. this[kHandler] = handler
  18218. if (channels.create.hasSubscribers) {
  18219. channels.create.publish({ request: this })
  18220. }
  18221. }
  18222. onBodySent (chunk) {
  18223. if (this[kHandler].onBodySent) {
  18224. try {
  18225. return this[kHandler].onBodySent(chunk)
  18226. } catch (err) {
  18227. this.abort(err)
  18228. }
  18229. }
  18230. }
  18231. onRequestSent () {
  18232. if (channels.bodySent.hasSubscribers) {
  18233. channels.bodySent.publish({ request: this })
  18234. }
  18235. if (this[kHandler].onRequestSent) {
  18236. try {
  18237. return this[kHandler].onRequestSent()
  18238. } catch (err) {
  18239. this.abort(err)
  18240. }
  18241. }
  18242. }
  18243. onConnect (abort) {
  18244. assert(!this.aborted)
  18245. assert(!this.completed)
  18246. if (this.error) {
  18247. abort(this.error)
  18248. } else {
  18249. this.abort = abort
  18250. return this[kHandler].onConnect(abort)
  18251. }
  18252. }
  18253. onHeaders (statusCode, headers, resume, statusText) {
  18254. assert(!this.aborted)
  18255. assert(!this.completed)
  18256. if (channels.headers.hasSubscribers) {
  18257. channels.headers.publish({ request: this, response: { statusCode, headers, statusText } })
  18258. }
  18259. try {
  18260. return this[kHandler].onHeaders(statusCode, headers, resume, statusText)
  18261. } catch (err) {
  18262. this.abort(err)
  18263. }
  18264. }
  18265. onData (chunk) {
  18266. assert(!this.aborted)
  18267. assert(!this.completed)
  18268. try {
  18269. return this[kHandler].onData(chunk)
  18270. } catch (err) {
  18271. this.abort(err)
  18272. return false
  18273. }
  18274. }
  18275. onUpgrade (statusCode, headers, socket) {
  18276. assert(!this.aborted)
  18277. assert(!this.completed)
  18278. return this[kHandler].onUpgrade(statusCode, headers, socket)
  18279. }
  18280. onComplete (trailers) {
  18281. this.onFinally()
  18282. assert(!this.aborted)
  18283. this.completed = true
  18284. if (channels.trailers.hasSubscribers) {
  18285. channels.trailers.publish({ request: this, trailers })
  18286. }
  18287. try {
  18288. return this[kHandler].onComplete(trailers)
  18289. } catch (err) {
  18290. // TODO (fix): This might be a bad idea?
  18291. this.onError(err)
  18292. }
  18293. }
  18294. onError (error) {
  18295. this.onFinally()
  18296. if (channels.error.hasSubscribers) {
  18297. channels.error.publish({ request: this, error })
  18298. }
  18299. if (this.aborted) {
  18300. return
  18301. }
  18302. this.aborted = true
  18303. return this[kHandler].onError(error)
  18304. }
  18305. onFinally () {
  18306. if (this.errorHandler) {
  18307. this.body.off('error', this.errorHandler)
  18308. this.errorHandler = null
  18309. }
  18310. if (this.endHandler) {
  18311. this.body.off('end', this.endHandler)
  18312. this.endHandler = null
  18313. }
  18314. }
  18315. // TODO: adjust to support H2
  18316. addHeader (key, value) {
  18317. processHeader(this, key, value)
  18318. return this
  18319. }
  18320. static [kHTTP1BuildRequest] (origin, opts, handler) {
  18321. // TODO: Migrate header parsing here, to make Requests
  18322. // HTTP agnostic
  18323. return new Request(origin, opts, handler)
  18324. }
  18325. static [kHTTP2BuildRequest] (origin, opts, handler) {
  18326. const headers = opts.headers
  18327. opts = { ...opts, headers: null }
  18328. const request = new Request(origin, opts, handler)
  18329. request.headers = {}
  18330. if (Array.isArray(headers)) {
  18331. if (headers.length % 2 !== 0) {
  18332. throw new InvalidArgumentError('headers array must be even')
  18333. }
  18334. for (let i = 0; i < headers.length; i += 2) {
  18335. processHeader(request, headers[i], headers[i + 1], true)
  18336. }
  18337. } else if (headers && typeof headers === 'object') {
  18338. const keys = Object.keys(headers)
  18339. for (let i = 0; i < keys.length; i++) {
  18340. const key = keys[i]
  18341. processHeader(request, key, headers[key], true)
  18342. }
  18343. } else if (headers != null) {
  18344. throw new InvalidArgumentError('headers must be an object or an array')
  18345. }
  18346. return request
  18347. }
  18348. static [kHTTP2CopyHeaders] (raw) {
  18349. const rawHeaders = raw.split('\r\n')
  18350. const headers = {}
  18351. for (const header of rawHeaders) {
  18352. const [key, value] = header.split(': ')
  18353. if (value == null || value.length === 0) continue
  18354. if (headers[key]) headers[key] += `,${value}`
  18355. else headers[key] = value
  18356. }
  18357. return headers
  18358. }
  18359. }
  18360. function processHeaderValue (key, val, skipAppend) {
  18361. if (val && typeof val === 'object') {
  18362. throw new InvalidArgumentError(`invalid ${key} header`)
  18363. }
  18364. val = val != null ? `${val}` : ''
  18365. if (headerCharRegex.exec(val) !== null) {
  18366. throw new InvalidArgumentError(`invalid ${key} header`)
  18367. }
  18368. return skipAppend ? val : `${key}: ${val}\r\n`
  18369. }
  18370. function processHeader (request, key, val, skipAppend = false) {
  18371. if (val && (typeof val === 'object' && !Array.isArray(val))) {
  18372. throw new InvalidArgumentError(`invalid ${key} header`)
  18373. } else if (val === undefined) {
  18374. return
  18375. }
  18376. if (
  18377. request.host === null &&
  18378. key.length === 4 &&
  18379. key.toLowerCase() === 'host'
  18380. ) {
  18381. if (headerCharRegex.exec(val) !== null) {
  18382. throw new InvalidArgumentError(`invalid ${key} header`)
  18383. }
  18384. // Consumed by Client
  18385. request.host = val
  18386. } else if (
  18387. request.contentLength === null &&
  18388. key.length === 14 &&
  18389. key.toLowerCase() === 'content-length'
  18390. ) {
  18391. request.contentLength = parseInt(val, 10)
  18392. if (!Number.isFinite(request.contentLength)) {
  18393. throw new InvalidArgumentError('invalid content-length header')
  18394. }
  18395. } else if (
  18396. request.contentType === null &&
  18397. key.length === 12 &&
  18398. key.toLowerCase() === 'content-type'
  18399. ) {
  18400. request.contentType = val
  18401. if (skipAppend) request.headers[key] = processHeaderValue(key, val, skipAppend)
  18402. else request.headers += processHeaderValue(key, val)
  18403. } else if (
  18404. key.length === 17 &&
  18405. key.toLowerCase() === 'transfer-encoding'
  18406. ) {
  18407. throw new InvalidArgumentError('invalid transfer-encoding header')
  18408. } else if (
  18409. key.length === 10 &&
  18410. key.toLowerCase() === 'connection'
  18411. ) {
  18412. const value = typeof val === 'string' ? val.toLowerCase() : null
  18413. if (value !== 'close' && value !== 'keep-alive') {
  18414. throw new InvalidArgumentError('invalid connection header')
  18415. } else if (value === 'close') {
  18416. request.reset = true
  18417. }
  18418. } else if (
  18419. key.length === 10 &&
  18420. key.toLowerCase() === 'keep-alive'
  18421. ) {
  18422. throw new InvalidArgumentError('invalid keep-alive header')
  18423. } else if (
  18424. key.length === 7 &&
  18425. key.toLowerCase() === 'upgrade'
  18426. ) {
  18427. throw new InvalidArgumentError('invalid upgrade header')
  18428. } else if (
  18429. key.length === 6 &&
  18430. key.toLowerCase() === 'expect'
  18431. ) {
  18432. throw new NotSupportedError('expect header not supported')
  18433. } else if (tokenRegExp.exec(key) === null) {
  18434. throw new InvalidArgumentError('invalid header key')
  18435. } else {
  18436. if (Array.isArray(val)) {
  18437. for (let i = 0; i < val.length; i++) {
  18438. if (skipAppend) {
  18439. if (request.headers[key]) request.headers[key] += `,${processHeaderValue(key, val[i], skipAppend)}`
  18440. else request.headers[key] = processHeaderValue(key, val[i], skipAppend)
  18441. } else {
  18442. request.headers += processHeaderValue(key, val[i])
  18443. }
  18444. }
  18445. } else {
  18446. if (skipAppend) request.headers[key] = processHeaderValue(key, val, skipAppend)
  18447. else request.headers += processHeaderValue(key, val)
  18448. }
  18449. }
  18450. }
  18451. module.exports = Request
  18452. /***/ }),
  18453. /***/ 2785:
  18454. /***/ ((module) => {
  18455. module.exports = {
  18456. kClose: Symbol('close'),
  18457. kDestroy: Symbol('destroy'),
  18458. kDispatch: Symbol('dispatch'),
  18459. kUrl: Symbol('url'),
  18460. kWriting: Symbol('writing'),
  18461. kResuming: Symbol('resuming'),
  18462. kQueue: Symbol('queue'),
  18463. kConnect: Symbol('connect'),
  18464. kConnecting: Symbol('connecting'),
  18465. kHeadersList: Symbol('headers list'),
  18466. kKeepAliveDefaultTimeout: Symbol('default keep alive timeout'),
  18467. kKeepAliveMaxTimeout: Symbol('max keep alive timeout'),
  18468. kKeepAliveTimeoutThreshold: Symbol('keep alive timeout threshold'),
  18469. kKeepAliveTimeoutValue: Symbol('keep alive timeout'),
  18470. kKeepAlive: Symbol('keep alive'),
  18471. kHeadersTimeout: Symbol('headers timeout'),
  18472. kBodyTimeout: Symbol('body timeout'),
  18473. kServerName: Symbol('server name'),
  18474. kLocalAddress: Symbol('local address'),
  18475. kHost: Symbol('host'),
  18476. kNoRef: Symbol('no ref'),
  18477. kBodyUsed: Symbol('used'),
  18478. kRunning: Symbol('running'),
  18479. kBlocking: Symbol('blocking'),
  18480. kPending: Symbol('pending'),
  18481. kSize: Symbol('size'),
  18482. kBusy: Symbol('busy'),
  18483. kQueued: Symbol('queued'),
  18484. kFree: Symbol('free'),
  18485. kConnected: Symbol('connected'),
  18486. kClosed: Symbol('closed'),
  18487. kNeedDrain: Symbol('need drain'),
  18488. kReset: Symbol('reset'),
  18489. kDestroyed: Symbol.for('nodejs.stream.destroyed'),
  18490. kMaxHeadersSize: Symbol('max headers size'),
  18491. kRunningIdx: Symbol('running index'),
  18492. kPendingIdx: Symbol('pending index'),
  18493. kError: Symbol('error'),
  18494. kClients: Symbol('clients'),
  18495. kClient: Symbol('client'),
  18496. kParser: Symbol('parser'),
  18497. kOnDestroyed: Symbol('destroy callbacks'),
  18498. kPipelining: Symbol('pipelining'),
  18499. kSocket: Symbol('socket'),
  18500. kHostHeader: Symbol('host header'),
  18501. kConnector: Symbol('connector'),
  18502. kStrictContentLength: Symbol('strict content length'),
  18503. kMaxRedirections: Symbol('maxRedirections'),
  18504. kMaxRequests: Symbol('maxRequestsPerClient'),
  18505. kProxy: Symbol('proxy agent options'),
  18506. kCounter: Symbol('socket request counter'),
  18507. kInterceptors: Symbol('dispatch interceptors'),
  18508. kMaxResponseSize: Symbol('max response size'),
  18509. kHTTP2Session: Symbol('http2Session'),
  18510. kHTTP2SessionState: Symbol('http2Session state'),
  18511. kHTTP2BuildRequest: Symbol('http2 build request'),
  18512. kHTTP1BuildRequest: Symbol('http1 build request'),
  18513. kHTTP2CopyHeaders: Symbol('http2 copy headers'),
  18514. kHTTPConnVersion: Symbol('http connection version'),
  18515. kRetryHandlerDefaultRetry: Symbol('retry agent default retry'),
  18516. kConstruct: Symbol('constructable')
  18517. }
  18518. /***/ }),
  18519. /***/ 3983:
  18520. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  18521. "use strict";
  18522. const assert = __nccwpck_require__(9491)
  18523. const { kDestroyed, kBodyUsed } = __nccwpck_require__(2785)
  18524. const { IncomingMessage } = __nccwpck_require__(3685)
  18525. const stream = __nccwpck_require__(2781)
  18526. const net = __nccwpck_require__(1808)
  18527. const { InvalidArgumentError } = __nccwpck_require__(8045)
  18528. const { Blob } = __nccwpck_require__(4300)
  18529. const nodeUtil = __nccwpck_require__(3837)
  18530. const { stringify } = __nccwpck_require__(3477)
  18531. const { headerNameLowerCasedRecord } = __nccwpck_require__(4462)
  18532. const [nodeMajor, nodeMinor] = process.versions.node.split('.').map(v => Number(v))
  18533. function nop () {}
  18534. function isStream (obj) {
  18535. return obj && typeof obj === 'object' && typeof obj.pipe === 'function' && typeof obj.on === 'function'
  18536. }
  18537. // based on https://github.com/node-fetch/fetch-blob/blob/8ab587d34080de94140b54f07168451e7d0b655e/index.js#L229-L241 (MIT License)
  18538. function isBlobLike (object) {
  18539. return (Blob && object instanceof Blob) || (
  18540. object &&
  18541. typeof object === 'object' &&
  18542. (typeof object.stream === 'function' ||
  18543. typeof object.arrayBuffer === 'function') &&
  18544. /^(Blob|File)$/.test(object[Symbol.toStringTag])
  18545. )
  18546. }
  18547. function buildURL (url, queryParams) {
  18548. if (url.includes('?') || url.includes('#')) {
  18549. throw new Error('Query params cannot be passed when url already contains "?" or "#".')
  18550. }
  18551. const stringified = stringify(queryParams)
  18552. if (stringified) {
  18553. url += '?' + stringified
  18554. }
  18555. return url
  18556. }
  18557. function parseURL (url) {
  18558. if (typeof url === 'string') {
  18559. url = new URL(url)
  18560. if (!/^https?:/.test(url.origin || url.protocol)) {
  18561. throw new InvalidArgumentError('Invalid URL protocol: the URL must start with `http:` or `https:`.')
  18562. }
  18563. return url
  18564. }
  18565. if (!url || typeof url !== 'object') {
  18566. throw new InvalidArgumentError('Invalid URL: The URL argument must be a non-null object.')
  18567. }
  18568. if (!/^https?:/.test(url.origin || url.protocol)) {
  18569. throw new InvalidArgumentError('Invalid URL protocol: the URL must start with `http:` or `https:`.')
  18570. }
  18571. if (!(url instanceof URL)) {
  18572. if (url.port != null && url.port !== '' && !Number.isFinite(parseInt(url.port))) {
  18573. throw new InvalidArgumentError('Invalid URL: port must be a valid integer or a string representation of an integer.')
  18574. }
  18575. if (url.path != null && typeof url.path !== 'string') {
  18576. throw new InvalidArgumentError('Invalid URL path: the path must be a string or null/undefined.')
  18577. }
  18578. if (url.pathname != null && typeof url.pathname !== 'string') {
  18579. throw new InvalidArgumentError('Invalid URL pathname: the pathname must be a string or null/undefined.')
  18580. }
  18581. if (url.hostname != null && typeof url.hostname !== 'string') {
  18582. throw new InvalidArgumentError('Invalid URL hostname: the hostname must be a string or null/undefined.')
  18583. }
  18584. if (url.origin != null && typeof url.origin !== 'string') {
  18585. throw new InvalidArgumentError('Invalid URL origin: the origin must be a string or null/undefined.')
  18586. }
  18587. const port = url.port != null
  18588. ? url.port
  18589. : (url.protocol === 'https:' ? 443 : 80)
  18590. let origin = url.origin != null
  18591. ? url.origin
  18592. : `${url.protocol}//${url.hostname}:${port}`
  18593. let path = url.path != null
  18594. ? url.path
  18595. : `${url.pathname || ''}${url.search || ''}`
  18596. if (origin.endsWith('/')) {
  18597. origin = origin.substring(0, origin.length - 1)
  18598. }
  18599. if (path && !path.startsWith('/')) {
  18600. path = `/${path}`
  18601. }
  18602. // new URL(path, origin) is unsafe when `path` contains an absolute URL
  18603. // From https://developer.mozilla.org/en-US/docs/Web/API/URL/URL:
  18604. // If first parameter is a relative URL, second param is required, and will be used as the base URL.
  18605. // If first parameter is an absolute URL, a given second param will be ignored.
  18606. url = new URL(origin + path)
  18607. }
  18608. return url
  18609. }
  18610. function parseOrigin (url) {
  18611. url = parseURL(url)
  18612. if (url.pathname !== '/' || url.search || url.hash) {
  18613. throw new InvalidArgumentError('invalid url')
  18614. }
  18615. return url
  18616. }
  18617. function getHostname (host) {
  18618. if (host[0] === '[') {
  18619. const idx = host.indexOf(']')
  18620. assert(idx !== -1)
  18621. return host.substring(1, idx)
  18622. }
  18623. const idx = host.indexOf(':')
  18624. if (idx === -1) return host
  18625. return host.substring(0, idx)
  18626. }
  18627. // IP addresses are not valid server names per RFC6066
  18628. // > Currently, the only server names supported are DNS hostnames
  18629. function getServerName (host) {
  18630. if (!host) {
  18631. return null
  18632. }
  18633. assert.strictEqual(typeof host, 'string')
  18634. const servername = getHostname(host)
  18635. if (net.isIP(servername)) {
  18636. return ''
  18637. }
  18638. return servername
  18639. }
  18640. function deepClone (obj) {
  18641. return JSON.parse(JSON.stringify(obj))
  18642. }
  18643. function isAsyncIterable (obj) {
  18644. return !!(obj != null && typeof obj[Symbol.asyncIterator] === 'function')
  18645. }
  18646. function isIterable (obj) {
  18647. return !!(obj != null && (typeof obj[Symbol.iterator] === 'function' || typeof obj[Symbol.asyncIterator] === 'function'))
  18648. }
  18649. function bodyLength (body) {
  18650. if (body == null) {
  18651. return 0
  18652. } else if (isStream(body)) {
  18653. const state = body._readableState
  18654. return state && state.objectMode === false && state.ended === true && Number.isFinite(state.length)
  18655. ? state.length
  18656. : null
  18657. } else if (isBlobLike(body)) {
  18658. return body.size != null ? body.size : null
  18659. } else if (isBuffer(body)) {
  18660. return body.byteLength
  18661. }
  18662. return null
  18663. }
  18664. function isDestroyed (stream) {
  18665. return !stream || !!(stream.destroyed || stream[kDestroyed])
  18666. }
  18667. function isReadableAborted (stream) {
  18668. const state = stream && stream._readableState
  18669. return isDestroyed(stream) && state && !state.endEmitted
  18670. }
  18671. function destroy (stream, err) {
  18672. if (stream == null || !isStream(stream) || isDestroyed(stream)) {
  18673. return
  18674. }
  18675. if (typeof stream.destroy === 'function') {
  18676. if (Object.getPrototypeOf(stream).constructor === IncomingMessage) {
  18677. // See: https://github.com/nodejs/node/pull/38505/files
  18678. stream.socket = null
  18679. }
  18680. stream.destroy(err)
  18681. } else if (err) {
  18682. process.nextTick((stream, err) => {
  18683. stream.emit('error', err)
  18684. }, stream, err)
  18685. }
  18686. if (stream.destroyed !== true) {
  18687. stream[kDestroyed] = true
  18688. }
  18689. }
  18690. const KEEPALIVE_TIMEOUT_EXPR = /timeout=(\d+)/
  18691. function parseKeepAliveTimeout (val) {
  18692. const m = val.toString().match(KEEPALIVE_TIMEOUT_EXPR)
  18693. return m ? parseInt(m[1], 10) * 1000 : null
  18694. }
  18695. /**
  18696. * Retrieves a header name and returns its lowercase value.
  18697. * @param {string | Buffer} value Header name
  18698. * @returns {string}
  18699. */
  18700. function headerNameToString (value) {
  18701. return headerNameLowerCasedRecord[value] || value.toLowerCase()
  18702. }
  18703. function parseHeaders (headers, obj = {}) {
  18704. // For H2 support
  18705. if (!Array.isArray(headers)) return headers
  18706. for (let i = 0; i < headers.length; i += 2) {
  18707. const key = headers[i].toString().toLowerCase()
  18708. let val = obj[key]
  18709. if (!val) {
  18710. if (Array.isArray(headers[i + 1])) {
  18711. obj[key] = headers[i + 1].map(x => x.toString('utf8'))
  18712. } else {
  18713. obj[key] = headers[i + 1].toString('utf8')
  18714. }
  18715. } else {
  18716. if (!Array.isArray(val)) {
  18717. val = [val]
  18718. obj[key] = val
  18719. }
  18720. val.push(headers[i + 1].toString('utf8'))
  18721. }
  18722. }
  18723. // See https://github.com/nodejs/node/pull/46528
  18724. if ('content-length' in obj && 'content-disposition' in obj) {
  18725. obj['content-disposition'] = Buffer.from(obj['content-disposition']).toString('latin1')
  18726. }
  18727. return obj
  18728. }
  18729. function parseRawHeaders (headers) {
  18730. const ret = []
  18731. let hasContentLength = false
  18732. let contentDispositionIdx = -1
  18733. for (let n = 0; n < headers.length; n += 2) {
  18734. const key = headers[n + 0].toString()
  18735. const val = headers[n + 1].toString('utf8')
  18736. if (key.length === 14 && (key === 'content-length' || key.toLowerCase() === 'content-length')) {
  18737. ret.push(key, val)
  18738. hasContentLength = true
  18739. } else if (key.length === 19 && (key === 'content-disposition' || key.toLowerCase() === 'content-disposition')) {
  18740. contentDispositionIdx = ret.push(key, val) - 1
  18741. } else {
  18742. ret.push(key, val)
  18743. }
  18744. }
  18745. // See https://github.com/nodejs/node/pull/46528
  18746. if (hasContentLength && contentDispositionIdx !== -1) {
  18747. ret[contentDispositionIdx] = Buffer.from(ret[contentDispositionIdx]).toString('latin1')
  18748. }
  18749. return ret
  18750. }
  18751. function isBuffer (buffer) {
  18752. // See, https://github.com/mcollina/undici/pull/319
  18753. return buffer instanceof Uint8Array || Buffer.isBuffer(buffer)
  18754. }
  18755. function validateHandler (handler, method, upgrade) {
  18756. if (!handler || typeof handler !== 'object') {
  18757. throw new InvalidArgumentError('handler must be an object')
  18758. }
  18759. if (typeof handler.onConnect !== 'function') {
  18760. throw new InvalidArgumentError('invalid onConnect method')
  18761. }
  18762. if (typeof handler.onError !== 'function') {
  18763. throw new InvalidArgumentError('invalid onError method')
  18764. }
  18765. if (typeof handler.onBodySent !== 'function' && handler.onBodySent !== undefined) {
  18766. throw new InvalidArgumentError('invalid onBodySent method')
  18767. }
  18768. if (upgrade || method === 'CONNECT') {
  18769. if (typeof handler.onUpgrade !== 'function') {
  18770. throw new InvalidArgumentError('invalid onUpgrade method')
  18771. }
  18772. } else {
  18773. if (typeof handler.onHeaders !== 'function') {
  18774. throw new InvalidArgumentError('invalid onHeaders method')
  18775. }
  18776. if (typeof handler.onData !== 'function') {
  18777. throw new InvalidArgumentError('invalid onData method')
  18778. }
  18779. if (typeof handler.onComplete !== 'function') {
  18780. throw new InvalidArgumentError('invalid onComplete method')
  18781. }
  18782. }
  18783. }
  18784. // A body is disturbed if it has been read from and it cannot
  18785. // be re-used without losing state or data.
  18786. function isDisturbed (body) {
  18787. return !!(body && (
  18788. stream.isDisturbed
  18789. ? stream.isDisturbed(body) || body[kBodyUsed] // TODO (fix): Why is body[kBodyUsed] needed?
  18790. : body[kBodyUsed] ||
  18791. body.readableDidRead ||
  18792. (body._readableState && body._readableState.dataEmitted) ||
  18793. isReadableAborted(body)
  18794. ))
  18795. }
  18796. function isErrored (body) {
  18797. return !!(body && (
  18798. stream.isErrored
  18799. ? stream.isErrored(body)
  18800. : /state: 'errored'/.test(nodeUtil.inspect(body)
  18801. )))
  18802. }
  18803. function isReadable (body) {
  18804. return !!(body && (
  18805. stream.isReadable
  18806. ? stream.isReadable(body)
  18807. : /state: 'readable'/.test(nodeUtil.inspect(body)
  18808. )))
  18809. }
  18810. function getSocketInfo (socket) {
  18811. return {
  18812. localAddress: socket.localAddress,
  18813. localPort: socket.localPort,
  18814. remoteAddress: socket.remoteAddress,
  18815. remotePort: socket.remotePort,
  18816. remoteFamily: socket.remoteFamily,
  18817. timeout: socket.timeout,
  18818. bytesWritten: socket.bytesWritten,
  18819. bytesRead: socket.bytesRead
  18820. }
  18821. }
  18822. async function * convertIterableToBuffer (iterable) {
  18823. for await (const chunk of iterable) {
  18824. yield Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk)
  18825. }
  18826. }
  18827. let ReadableStream
  18828. function ReadableStreamFrom (iterable) {
  18829. if (!ReadableStream) {
  18830. ReadableStream = (__nccwpck_require__(5356).ReadableStream)
  18831. }
  18832. if (ReadableStream.from) {
  18833. return ReadableStream.from(convertIterableToBuffer(iterable))
  18834. }
  18835. let iterator
  18836. return new ReadableStream(
  18837. {
  18838. async start () {
  18839. iterator = iterable[Symbol.asyncIterator]()
  18840. },
  18841. async pull (controller) {
  18842. const { done, value } = await iterator.next()
  18843. if (done) {
  18844. queueMicrotask(() => {
  18845. controller.close()
  18846. })
  18847. } else {
  18848. const buf = Buffer.isBuffer(value) ? value : Buffer.from(value)
  18849. controller.enqueue(new Uint8Array(buf))
  18850. }
  18851. return controller.desiredSize > 0
  18852. },
  18853. async cancel (reason) {
  18854. await iterator.return()
  18855. }
  18856. },
  18857. 0
  18858. )
  18859. }
  18860. // The chunk should be a FormData instance and contains
  18861. // all the required methods.
  18862. function isFormDataLike (object) {
  18863. return (
  18864. object &&
  18865. typeof object === 'object' &&
  18866. typeof object.append === 'function' &&
  18867. typeof object.delete === 'function' &&
  18868. typeof object.get === 'function' &&
  18869. typeof object.getAll === 'function' &&
  18870. typeof object.has === 'function' &&
  18871. typeof object.set === 'function' &&
  18872. object[Symbol.toStringTag] === 'FormData'
  18873. )
  18874. }
  18875. function throwIfAborted (signal) {
  18876. if (!signal) { return }
  18877. if (typeof signal.throwIfAborted === 'function') {
  18878. signal.throwIfAborted()
  18879. } else {
  18880. if (signal.aborted) {
  18881. // DOMException not available < v17.0.0
  18882. const err = new Error('The operation was aborted')
  18883. err.name = 'AbortError'
  18884. throw err
  18885. }
  18886. }
  18887. }
  18888. function addAbortListener (signal, listener) {
  18889. if ('addEventListener' in signal) {
  18890. signal.addEventListener('abort', listener, { once: true })
  18891. return () => signal.removeEventListener('abort', listener)
  18892. }
  18893. signal.addListener('abort', listener)
  18894. return () => signal.removeListener('abort', listener)
  18895. }
  18896. const hasToWellFormed = !!String.prototype.toWellFormed
  18897. /**
  18898. * @param {string} val
  18899. */
  18900. function toUSVString (val) {
  18901. if (hasToWellFormed) {
  18902. return `${val}`.toWellFormed()
  18903. } else if (nodeUtil.toUSVString) {
  18904. return nodeUtil.toUSVString(val)
  18905. }
  18906. return `${val}`
  18907. }
  18908. // Parsed accordingly to RFC 9110
  18909. // https://www.rfc-editor.org/rfc/rfc9110#field.content-range
  18910. function parseRangeHeader (range) {
  18911. if (range == null || range === '') return { start: 0, end: null, size: null }
  18912. const m = range ? range.match(/^bytes (\d+)-(\d+)\/(\d+)?$/) : null
  18913. return m
  18914. ? {
  18915. start: parseInt(m[1]),
  18916. end: m[2] ? parseInt(m[2]) : null,
  18917. size: m[3] ? parseInt(m[3]) : null
  18918. }
  18919. : null
  18920. }
  18921. const kEnumerableProperty = Object.create(null)
  18922. kEnumerableProperty.enumerable = true
  18923. module.exports = {
  18924. kEnumerableProperty,
  18925. nop,
  18926. isDisturbed,
  18927. isErrored,
  18928. isReadable,
  18929. toUSVString,
  18930. isReadableAborted,
  18931. isBlobLike,
  18932. parseOrigin,
  18933. parseURL,
  18934. getServerName,
  18935. isStream,
  18936. isIterable,
  18937. isAsyncIterable,
  18938. isDestroyed,
  18939. headerNameToString,
  18940. parseRawHeaders,
  18941. parseHeaders,
  18942. parseKeepAliveTimeout,
  18943. destroy,
  18944. bodyLength,
  18945. deepClone,
  18946. ReadableStreamFrom,
  18947. isBuffer,
  18948. validateHandler,
  18949. getSocketInfo,
  18950. isFormDataLike,
  18951. buildURL,
  18952. throwIfAborted,
  18953. addAbortListener,
  18954. parseRangeHeader,
  18955. nodeMajor,
  18956. nodeMinor,
  18957. nodeHasAutoSelectFamily: nodeMajor > 18 || (nodeMajor === 18 && nodeMinor >= 13),
  18958. safeHTTPMethods: ['GET', 'HEAD', 'OPTIONS', 'TRACE']
  18959. }
  18960. /***/ }),
  18961. /***/ 4839:
  18962. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  18963. "use strict";
  18964. const Dispatcher = __nccwpck_require__(412)
  18965. const {
  18966. ClientDestroyedError,
  18967. ClientClosedError,
  18968. InvalidArgumentError
  18969. } = __nccwpck_require__(8045)
  18970. const { kDestroy, kClose, kDispatch, kInterceptors } = __nccwpck_require__(2785)
  18971. const kDestroyed = Symbol('destroyed')
  18972. const kClosed = Symbol('closed')
  18973. const kOnDestroyed = Symbol('onDestroyed')
  18974. const kOnClosed = Symbol('onClosed')
  18975. const kInterceptedDispatch = Symbol('Intercepted Dispatch')
  18976. class DispatcherBase extends Dispatcher {
  18977. constructor () {
  18978. super()
  18979. this[kDestroyed] = false
  18980. this[kOnDestroyed] = null
  18981. this[kClosed] = false
  18982. this[kOnClosed] = []
  18983. }
  18984. get destroyed () {
  18985. return this[kDestroyed]
  18986. }
  18987. get closed () {
  18988. return this[kClosed]
  18989. }
  18990. get interceptors () {
  18991. return this[kInterceptors]
  18992. }
  18993. set interceptors (newInterceptors) {
  18994. if (newInterceptors) {
  18995. for (let i = newInterceptors.length - 1; i >= 0; i--) {
  18996. const interceptor = this[kInterceptors][i]
  18997. if (typeof interceptor !== 'function') {
  18998. throw new InvalidArgumentError('interceptor must be an function')
  18999. }
  19000. }
  19001. }
  19002. this[kInterceptors] = newInterceptors
  19003. }
  19004. close (callback) {
  19005. if (callback === undefined) {
  19006. return new Promise((resolve, reject) => {
  19007. this.close((err, data) => {
  19008. return err ? reject(err) : resolve(data)
  19009. })
  19010. })
  19011. }
  19012. if (typeof callback !== 'function') {
  19013. throw new InvalidArgumentError('invalid callback')
  19014. }
  19015. if (this[kDestroyed]) {
  19016. queueMicrotask(() => callback(new ClientDestroyedError(), null))
  19017. return
  19018. }
  19019. if (this[kClosed]) {
  19020. if (this[kOnClosed]) {
  19021. this[kOnClosed].push(callback)
  19022. } else {
  19023. queueMicrotask(() => callback(null, null))
  19024. }
  19025. return
  19026. }
  19027. this[kClosed] = true
  19028. this[kOnClosed].push(callback)
  19029. const onClosed = () => {
  19030. const callbacks = this[kOnClosed]
  19031. this[kOnClosed] = null
  19032. for (let i = 0; i < callbacks.length; i++) {
  19033. callbacks[i](null, null)
  19034. }
  19035. }
  19036. // Should not error.
  19037. this[kClose]()
  19038. .then(() => this.destroy())
  19039. .then(() => {
  19040. queueMicrotask(onClosed)
  19041. })
  19042. }
  19043. destroy (err, callback) {
  19044. if (typeof err === 'function') {
  19045. callback = err
  19046. err = null
  19047. }
  19048. if (callback === undefined) {
  19049. return new Promise((resolve, reject) => {
  19050. this.destroy(err, (err, data) => {
  19051. return err ? /* istanbul ignore next: should never error */ reject(err) : resolve(data)
  19052. })
  19053. })
  19054. }
  19055. if (typeof callback !== 'function') {
  19056. throw new InvalidArgumentError('invalid callback')
  19057. }
  19058. if (this[kDestroyed]) {
  19059. if (this[kOnDestroyed]) {
  19060. this[kOnDestroyed].push(callback)
  19061. } else {
  19062. queueMicrotask(() => callback(null, null))
  19063. }
  19064. return
  19065. }
  19066. if (!err) {
  19067. err = new ClientDestroyedError()
  19068. }
  19069. this[kDestroyed] = true
  19070. this[kOnDestroyed] = this[kOnDestroyed] || []
  19071. this[kOnDestroyed].push(callback)
  19072. const onDestroyed = () => {
  19073. const callbacks = this[kOnDestroyed]
  19074. this[kOnDestroyed] = null
  19075. for (let i = 0; i < callbacks.length; i++) {
  19076. callbacks[i](null, null)
  19077. }
  19078. }
  19079. // Should not error.
  19080. this[kDestroy](err).then(() => {
  19081. queueMicrotask(onDestroyed)
  19082. })
  19083. }
  19084. [kInterceptedDispatch] (opts, handler) {
  19085. if (!this[kInterceptors] || this[kInterceptors].length === 0) {
  19086. this[kInterceptedDispatch] = this[kDispatch]
  19087. return this[kDispatch](opts, handler)
  19088. }
  19089. let dispatch = this[kDispatch].bind(this)
  19090. for (let i = this[kInterceptors].length - 1; i >= 0; i--) {
  19091. dispatch = this[kInterceptors][i](dispatch)
  19092. }
  19093. this[kInterceptedDispatch] = dispatch
  19094. return dispatch(opts, handler)
  19095. }
  19096. dispatch (opts, handler) {
  19097. if (!handler || typeof handler !== 'object') {
  19098. throw new InvalidArgumentError('handler must be an object')
  19099. }
  19100. try {
  19101. if (!opts || typeof opts !== 'object') {
  19102. throw new InvalidArgumentError('opts must be an object.')
  19103. }
  19104. if (this[kDestroyed] || this[kOnDestroyed]) {
  19105. throw new ClientDestroyedError()
  19106. }
  19107. if (this[kClosed]) {
  19108. throw new ClientClosedError()
  19109. }
  19110. return this[kInterceptedDispatch](opts, handler)
  19111. } catch (err) {
  19112. if (typeof handler.onError !== 'function') {
  19113. throw new InvalidArgumentError('invalid onError method')
  19114. }
  19115. handler.onError(err)
  19116. return false
  19117. }
  19118. }
  19119. }
  19120. module.exports = DispatcherBase
  19121. /***/ }),
  19122. /***/ 412:
  19123. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  19124. "use strict";
  19125. const EventEmitter = __nccwpck_require__(2361)
  19126. class Dispatcher extends EventEmitter {
  19127. dispatch () {
  19128. throw new Error('not implemented')
  19129. }
  19130. close () {
  19131. throw new Error('not implemented')
  19132. }
  19133. destroy () {
  19134. throw new Error('not implemented')
  19135. }
  19136. }
  19137. module.exports = Dispatcher
  19138. /***/ }),
  19139. /***/ 9990:
  19140. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  19141. "use strict";
  19142. const Busboy = __nccwpck_require__(727)
  19143. const util = __nccwpck_require__(3983)
  19144. const {
  19145. ReadableStreamFrom,
  19146. isBlobLike,
  19147. isReadableStreamLike,
  19148. readableStreamClose,
  19149. createDeferredPromise,
  19150. fullyReadBody
  19151. } = __nccwpck_require__(2538)
  19152. const { FormData } = __nccwpck_require__(2015)
  19153. const { kState } = __nccwpck_require__(5861)
  19154. const { webidl } = __nccwpck_require__(1744)
  19155. const { DOMException, structuredClone } = __nccwpck_require__(1037)
  19156. const { Blob, File: NativeFile } = __nccwpck_require__(4300)
  19157. const { kBodyUsed } = __nccwpck_require__(2785)
  19158. const assert = __nccwpck_require__(9491)
  19159. const { isErrored } = __nccwpck_require__(3983)
  19160. const { isUint8Array, isArrayBuffer } = __nccwpck_require__(9830)
  19161. const { File: UndiciFile } = __nccwpck_require__(8511)
  19162. const { parseMIMEType, serializeAMimeType } = __nccwpck_require__(685)
  19163. let ReadableStream = globalThis.ReadableStream
  19164. /** @type {globalThis['File']} */
  19165. const File = NativeFile ?? UndiciFile
  19166. const textEncoder = new TextEncoder()
  19167. const textDecoder = new TextDecoder()
  19168. // https://fetch.spec.whatwg.org/#concept-bodyinit-extract
  19169. function extractBody (object, keepalive = false) {
  19170. if (!ReadableStream) {
  19171. ReadableStream = (__nccwpck_require__(5356).ReadableStream)
  19172. }
  19173. // 1. Let stream be null.
  19174. let stream = null
  19175. // 2. If object is a ReadableStream object, then set stream to object.
  19176. if (object instanceof ReadableStream) {
  19177. stream = object
  19178. } else if (isBlobLike(object)) {
  19179. // 3. Otherwise, if object is a Blob object, set stream to the
  19180. // result of running object’s get stream.
  19181. stream = object.stream()
  19182. } else {
  19183. // 4. Otherwise, set stream to a new ReadableStream object, and set
  19184. // up stream.
  19185. stream = new ReadableStream({
  19186. async pull (controller) {
  19187. controller.enqueue(
  19188. typeof source === 'string' ? textEncoder.encode(source) : source
  19189. )
  19190. queueMicrotask(() => readableStreamClose(controller))
  19191. },
  19192. start () {},
  19193. type: undefined
  19194. })
  19195. }
  19196. // 5. Assert: stream is a ReadableStream object.
  19197. assert(isReadableStreamLike(stream))
  19198. // 6. Let action be null.
  19199. let action = null
  19200. // 7. Let source be null.
  19201. let source = null
  19202. // 8. Let length be null.
  19203. let length = null
  19204. // 9. Let type be null.
  19205. let type = null
  19206. // 10. Switch on object:
  19207. if (typeof object === 'string') {
  19208. // Set source to the UTF-8 encoding of object.
  19209. // Note: setting source to a Uint8Array here breaks some mocking assumptions.
  19210. source = object
  19211. // Set type to `text/plain;charset=UTF-8`.
  19212. type = 'text/plain;charset=UTF-8'
  19213. } else if (object instanceof URLSearchParams) {
  19214. // URLSearchParams
  19215. // spec says to run application/x-www-form-urlencoded on body.list
  19216. // this is implemented in Node.js as apart of an URLSearchParams instance toString method
  19217. // See: https://github.com/nodejs/node/blob/e46c680bf2b211bbd52cf959ca17ee98c7f657f5/lib/internal/url.js#L490
  19218. // and https://github.com/nodejs/node/blob/e46c680bf2b211bbd52cf959ca17ee98c7f657f5/lib/internal/url.js#L1100
  19219. // Set source to the result of running the application/x-www-form-urlencoded serializer with object’s list.
  19220. source = object.toString()
  19221. // Set type to `application/x-www-form-urlencoded;charset=UTF-8`.
  19222. type = 'application/x-www-form-urlencoded;charset=UTF-8'
  19223. } else if (isArrayBuffer(object)) {
  19224. // BufferSource/ArrayBuffer
  19225. // Set source to a copy of the bytes held by object.
  19226. source = new Uint8Array(object.slice())
  19227. } else if (ArrayBuffer.isView(object)) {
  19228. // BufferSource/ArrayBufferView
  19229. // Set source to a copy of the bytes held by object.
  19230. source = new Uint8Array(object.buffer.slice(object.byteOffset, object.byteOffset + object.byteLength))
  19231. } else if (util.isFormDataLike(object)) {
  19232. const boundary = `----formdata-undici-0${`${Math.floor(Math.random() * 1e11)}`.padStart(11, '0')}`
  19233. const prefix = `--${boundary}\r\nContent-Disposition: form-data`
  19234. /*! formdata-polyfill. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> */
  19235. const escape = (str) =>
  19236. str.replace(/\n/g, '%0A').replace(/\r/g, '%0D').replace(/"/g, '%22')
  19237. const normalizeLinefeeds = (value) => value.replace(/\r?\n|\r/g, '\r\n')
  19238. // Set action to this step: run the multipart/form-data
  19239. // encoding algorithm, with object’s entry list and UTF-8.
  19240. // - This ensures that the body is immutable and can't be changed afterwords
  19241. // - That the content-length is calculated in advance.
  19242. // - And that all parts are pre-encoded and ready to be sent.
  19243. const blobParts = []
  19244. const rn = new Uint8Array([13, 10]) // '\r\n'
  19245. length = 0
  19246. let hasUnknownSizeValue = false
  19247. for (const [name, value] of object) {
  19248. if (typeof value === 'string') {
  19249. const chunk = textEncoder.encode(prefix +
  19250. `; name="${escape(normalizeLinefeeds(name))}"` +
  19251. `\r\n\r\n${normalizeLinefeeds(value)}\r\n`)
  19252. blobParts.push(chunk)
  19253. length += chunk.byteLength
  19254. } else {
  19255. const chunk = textEncoder.encode(`${prefix}; name="${escape(normalizeLinefeeds(name))}"` +
  19256. (value.name ? `; filename="${escape(value.name)}"` : '') + '\r\n' +
  19257. `Content-Type: ${
  19258. value.type || 'application/octet-stream'
  19259. }\r\n\r\n`)
  19260. blobParts.push(chunk, value, rn)
  19261. if (typeof value.size === 'number') {
  19262. length += chunk.byteLength + value.size + rn.byteLength
  19263. } else {
  19264. hasUnknownSizeValue = true
  19265. }
  19266. }
  19267. }
  19268. const chunk = textEncoder.encode(`--${boundary}--`)
  19269. blobParts.push(chunk)
  19270. length += chunk.byteLength
  19271. if (hasUnknownSizeValue) {
  19272. length = null
  19273. }
  19274. // Set source to object.
  19275. source = object
  19276. action = async function * () {
  19277. for (const part of blobParts) {
  19278. if (part.stream) {
  19279. yield * part.stream()
  19280. } else {
  19281. yield part
  19282. }
  19283. }
  19284. }
  19285. // Set type to `multipart/form-data; boundary=`,
  19286. // followed by the multipart/form-data boundary string generated
  19287. // by the multipart/form-data encoding algorithm.
  19288. type = 'multipart/form-data; boundary=' + boundary
  19289. } else if (isBlobLike(object)) {
  19290. // Blob
  19291. // Set source to object.
  19292. source = object
  19293. // Set length to object’s size.
  19294. length = object.size
  19295. // If object’s type attribute is not the empty byte sequence, set
  19296. // type to its value.
  19297. if (object.type) {
  19298. type = object.type
  19299. }
  19300. } else if (typeof object[Symbol.asyncIterator] === 'function') {
  19301. // If keepalive is true, then throw a TypeError.
  19302. if (keepalive) {
  19303. throw new TypeError('keepalive')
  19304. }
  19305. // If object is disturbed or locked, then throw a TypeError.
  19306. if (util.isDisturbed(object) || object.locked) {
  19307. throw new TypeError(
  19308. 'Response body object should not be disturbed or locked'
  19309. )
  19310. }
  19311. stream =
  19312. object instanceof ReadableStream ? object : ReadableStreamFrom(object)
  19313. }
  19314. // 11. If source is a byte sequence, then set action to a
  19315. // step that returns source and length to source’s length.
  19316. if (typeof source === 'string' || util.isBuffer(source)) {
  19317. length = Buffer.byteLength(source)
  19318. }
  19319. // 12. If action is non-null, then run these steps in in parallel:
  19320. if (action != null) {
  19321. // Run action.
  19322. let iterator
  19323. stream = new ReadableStream({
  19324. async start () {
  19325. iterator = action(object)[Symbol.asyncIterator]()
  19326. },
  19327. async pull (controller) {
  19328. const { value, done } = await iterator.next()
  19329. if (done) {
  19330. // When running action is done, close stream.
  19331. queueMicrotask(() => {
  19332. controller.close()
  19333. })
  19334. } else {
  19335. // Whenever one or more bytes are available and stream is not errored,
  19336. // enqueue a Uint8Array wrapping an ArrayBuffer containing the available
  19337. // bytes into stream.
  19338. if (!isErrored(stream)) {
  19339. controller.enqueue(new Uint8Array(value))
  19340. }
  19341. }
  19342. return controller.desiredSize > 0
  19343. },
  19344. async cancel (reason) {
  19345. await iterator.return()
  19346. },
  19347. type: undefined
  19348. })
  19349. }
  19350. // 13. Let body be a body whose stream is stream, source is source,
  19351. // and length is length.
  19352. const body = { stream, source, length }
  19353. // 14. Return (body, type).
  19354. return [body, type]
  19355. }
  19356. // https://fetch.spec.whatwg.org/#bodyinit-safely-extract
  19357. function safelyExtractBody (object, keepalive = false) {
  19358. if (!ReadableStream) {
  19359. // istanbul ignore next
  19360. ReadableStream = (__nccwpck_require__(5356).ReadableStream)
  19361. }
  19362. // To safely extract a body and a `Content-Type` value from
  19363. // a byte sequence or BodyInit object object, run these steps:
  19364. // 1. If object is a ReadableStream object, then:
  19365. if (object instanceof ReadableStream) {
  19366. // Assert: object is neither disturbed nor locked.
  19367. // istanbul ignore next
  19368. assert(!util.isDisturbed(object), 'The body has already been consumed.')
  19369. // istanbul ignore next
  19370. assert(!object.locked, 'The stream is locked.')
  19371. }
  19372. // 2. Return the results of extracting object.
  19373. return extractBody(object, keepalive)
  19374. }
  19375. function cloneBody (body) {
  19376. // To clone a body body, run these steps:
  19377. // https://fetch.spec.whatwg.org/#concept-body-clone
  19378. // 1. Let « out1, out2 » be the result of teeing body’s stream.
  19379. const [out1, out2] = body.stream.tee()
  19380. const out2Clone = structuredClone(out2, { transfer: [out2] })
  19381. // This, for whatever reasons, unrefs out2Clone which allows
  19382. // the process to exit by itself.
  19383. const [, finalClone] = out2Clone.tee()
  19384. // 2. Set body’s stream to out1.
  19385. body.stream = out1
  19386. // 3. Return a body whose stream is out2 and other members are copied from body.
  19387. return {
  19388. stream: finalClone,
  19389. length: body.length,
  19390. source: body.source
  19391. }
  19392. }
  19393. async function * consumeBody (body) {
  19394. if (body) {
  19395. if (isUint8Array(body)) {
  19396. yield body
  19397. } else {
  19398. const stream = body.stream
  19399. if (util.isDisturbed(stream)) {
  19400. throw new TypeError('The body has already been consumed.')
  19401. }
  19402. if (stream.locked) {
  19403. throw new TypeError('The stream is locked.')
  19404. }
  19405. // Compat.
  19406. stream[kBodyUsed] = true
  19407. yield * stream
  19408. }
  19409. }
  19410. }
  19411. function throwIfAborted (state) {
  19412. if (state.aborted) {
  19413. throw new DOMException('The operation was aborted.', 'AbortError')
  19414. }
  19415. }
  19416. function bodyMixinMethods (instance) {
  19417. const methods = {
  19418. blob () {
  19419. // The blob() method steps are to return the result of
  19420. // running consume body with this and the following step
  19421. // given a byte sequence bytes: return a Blob whose
  19422. // contents are bytes and whose type attribute is this’s
  19423. // MIME type.
  19424. return specConsumeBody(this, (bytes) => {
  19425. let mimeType = bodyMimeType(this)
  19426. if (mimeType === 'failure') {
  19427. mimeType = ''
  19428. } else if (mimeType) {
  19429. mimeType = serializeAMimeType(mimeType)
  19430. }
  19431. // Return a Blob whose contents are bytes and type attribute
  19432. // is mimeType.
  19433. return new Blob([bytes], { type: mimeType })
  19434. }, instance)
  19435. },
  19436. arrayBuffer () {
  19437. // The arrayBuffer() method steps are to return the result
  19438. // of running consume body with this and the following step
  19439. // given a byte sequence bytes: return a new ArrayBuffer
  19440. // whose contents are bytes.
  19441. return specConsumeBody(this, (bytes) => {
  19442. return new Uint8Array(bytes).buffer
  19443. }, instance)
  19444. },
  19445. text () {
  19446. // The text() method steps are to return the result of running
  19447. // consume body with this and UTF-8 decode.
  19448. return specConsumeBody(this, utf8DecodeBytes, instance)
  19449. },
  19450. json () {
  19451. // The json() method steps are to return the result of running
  19452. // consume body with this and parse JSON from bytes.
  19453. return specConsumeBody(this, parseJSONFromBytes, instance)
  19454. },
  19455. async formData () {
  19456. webidl.brandCheck(this, instance)
  19457. throwIfAborted(this[kState])
  19458. const contentType = this.headers.get('Content-Type')
  19459. // If mimeType’s essence is "multipart/form-data", then:
  19460. if (/multipart\/form-data/.test(contentType)) {
  19461. const headers = {}
  19462. for (const [key, value] of this.headers) headers[key.toLowerCase()] = value
  19463. const responseFormData = new FormData()
  19464. let busboy
  19465. try {
  19466. busboy = new Busboy({
  19467. headers,
  19468. preservePath: true
  19469. })
  19470. } catch (err) {
  19471. throw new DOMException(`${err}`, 'AbortError')
  19472. }
  19473. busboy.on('field', (name, value) => {
  19474. responseFormData.append(name, value)
  19475. })
  19476. busboy.on('file', (name, value, filename, encoding, mimeType) => {
  19477. const chunks = []
  19478. if (encoding === 'base64' || encoding.toLowerCase() === 'base64') {
  19479. let base64chunk = ''
  19480. value.on('data', (chunk) => {
  19481. base64chunk += chunk.toString().replace(/[\r\n]/gm, '')
  19482. const end = base64chunk.length - base64chunk.length % 4
  19483. chunks.push(Buffer.from(base64chunk.slice(0, end), 'base64'))
  19484. base64chunk = base64chunk.slice(end)
  19485. })
  19486. value.on('end', () => {
  19487. chunks.push(Buffer.from(base64chunk, 'base64'))
  19488. responseFormData.append(name, new File(chunks, filename, { type: mimeType }))
  19489. })
  19490. } else {
  19491. value.on('data', (chunk) => {
  19492. chunks.push(chunk)
  19493. })
  19494. value.on('end', () => {
  19495. responseFormData.append(name, new File(chunks, filename, { type: mimeType }))
  19496. })
  19497. }
  19498. })
  19499. const busboyResolve = new Promise((resolve, reject) => {
  19500. busboy.on('finish', resolve)
  19501. busboy.on('error', (err) => reject(new TypeError(err)))
  19502. })
  19503. if (this.body !== null) for await (const chunk of consumeBody(this[kState].body)) busboy.write(chunk)
  19504. busboy.end()
  19505. await busboyResolve
  19506. return responseFormData
  19507. } else if (/application\/x-www-form-urlencoded/.test(contentType)) {
  19508. // Otherwise, if mimeType’s essence is "application/x-www-form-urlencoded", then:
  19509. // 1. Let entries be the result of parsing bytes.
  19510. let entries
  19511. try {
  19512. let text = ''
  19513. // application/x-www-form-urlencoded parser will keep the BOM.
  19514. // https://url.spec.whatwg.org/#concept-urlencoded-parser
  19515. // Note that streaming decoder is stateful and cannot be reused
  19516. const streamingDecoder = new TextDecoder('utf-8', { ignoreBOM: true })
  19517. for await (const chunk of consumeBody(this[kState].body)) {
  19518. if (!isUint8Array(chunk)) {
  19519. throw new TypeError('Expected Uint8Array chunk')
  19520. }
  19521. text += streamingDecoder.decode(chunk, { stream: true })
  19522. }
  19523. text += streamingDecoder.decode()
  19524. entries = new URLSearchParams(text)
  19525. } catch (err) {
  19526. // istanbul ignore next: Unclear when new URLSearchParams can fail on a string.
  19527. // 2. If entries is failure, then throw a TypeError.
  19528. throw Object.assign(new TypeError(), { cause: err })
  19529. }
  19530. // 3. Return a new FormData object whose entries are entries.
  19531. const formData = new FormData()
  19532. for (const [name, value] of entries) {
  19533. formData.append(name, value)
  19534. }
  19535. return formData
  19536. } else {
  19537. // Wait a tick before checking if the request has been aborted.
  19538. // Otherwise, a TypeError can be thrown when an AbortError should.
  19539. await Promise.resolve()
  19540. throwIfAborted(this[kState])
  19541. // Otherwise, throw a TypeError.
  19542. throw webidl.errors.exception({
  19543. header: `${instance.name}.formData`,
  19544. message: 'Could not parse content as FormData.'
  19545. })
  19546. }
  19547. }
  19548. }
  19549. return methods
  19550. }
  19551. function mixinBody (prototype) {
  19552. Object.assign(prototype.prototype, bodyMixinMethods(prototype))
  19553. }
  19554. /**
  19555. * @see https://fetch.spec.whatwg.org/#concept-body-consume-body
  19556. * @param {Response|Request} object
  19557. * @param {(value: unknown) => unknown} convertBytesToJSValue
  19558. * @param {Response|Request} instance
  19559. */
  19560. async function specConsumeBody (object, convertBytesToJSValue, instance) {
  19561. webidl.brandCheck(object, instance)
  19562. throwIfAborted(object[kState])
  19563. // 1. If object is unusable, then return a promise rejected
  19564. // with a TypeError.
  19565. if (bodyUnusable(object[kState].body)) {
  19566. throw new TypeError('Body is unusable')
  19567. }
  19568. // 2. Let promise be a new promise.
  19569. const promise = createDeferredPromise()
  19570. // 3. Let errorSteps given error be to reject promise with error.
  19571. const errorSteps = (error) => promise.reject(error)
  19572. // 4. Let successSteps given a byte sequence data be to resolve
  19573. // promise with the result of running convertBytesToJSValue
  19574. // with data. If that threw an exception, then run errorSteps
  19575. // with that exception.
  19576. const successSteps = (data) => {
  19577. try {
  19578. promise.resolve(convertBytesToJSValue(data))
  19579. } catch (e) {
  19580. errorSteps(e)
  19581. }
  19582. }
  19583. // 5. If object’s body is null, then run successSteps with an
  19584. // empty byte sequence.
  19585. if (object[kState].body == null) {
  19586. successSteps(new Uint8Array())
  19587. return promise.promise
  19588. }
  19589. // 6. Otherwise, fully read object’s body given successSteps,
  19590. // errorSteps, and object’s relevant global object.
  19591. await fullyReadBody(object[kState].body, successSteps, errorSteps)
  19592. // 7. Return promise.
  19593. return promise.promise
  19594. }
  19595. // https://fetch.spec.whatwg.org/#body-unusable
  19596. function bodyUnusable (body) {
  19597. // An object including the Body interface mixin is
  19598. // said to be unusable if its body is non-null and
  19599. // its body’s stream is disturbed or locked.
  19600. return body != null && (body.stream.locked || util.isDisturbed(body.stream))
  19601. }
  19602. /**
  19603. * @see https://encoding.spec.whatwg.org/#utf-8-decode
  19604. * @param {Buffer} buffer
  19605. */
  19606. function utf8DecodeBytes (buffer) {
  19607. if (buffer.length === 0) {
  19608. return ''
  19609. }
  19610. // 1. Let buffer be the result of peeking three bytes from
  19611. // ioQueue, converted to a byte sequence.
  19612. // 2. If buffer is 0xEF 0xBB 0xBF, then read three
  19613. // bytes from ioQueue. (Do nothing with those bytes.)
  19614. if (buffer[0] === 0xEF && buffer[1] === 0xBB && buffer[2] === 0xBF) {
  19615. buffer = buffer.subarray(3)
  19616. }
  19617. // 3. Process a queue with an instance of UTF-8’s
  19618. // decoder, ioQueue, output, and "replacement".
  19619. const output = textDecoder.decode(buffer)
  19620. // 4. Return output.
  19621. return output
  19622. }
  19623. /**
  19624. * @see https://infra.spec.whatwg.org/#parse-json-bytes-to-a-javascript-value
  19625. * @param {Uint8Array} bytes
  19626. */
  19627. function parseJSONFromBytes (bytes) {
  19628. return JSON.parse(utf8DecodeBytes(bytes))
  19629. }
  19630. /**
  19631. * @see https://fetch.spec.whatwg.org/#concept-body-mime-type
  19632. * @param {import('./response').Response|import('./request').Request} object
  19633. */
  19634. function bodyMimeType (object) {
  19635. const { headersList } = object[kState]
  19636. const contentType = headersList.get('content-type')
  19637. if (contentType === null) {
  19638. return 'failure'
  19639. }
  19640. return parseMIMEType(contentType)
  19641. }
  19642. module.exports = {
  19643. extractBody,
  19644. safelyExtractBody,
  19645. cloneBody,
  19646. mixinBody
  19647. }
  19648. /***/ }),
  19649. /***/ 1037:
  19650. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  19651. "use strict";
  19652. const { MessageChannel, receiveMessageOnPort } = __nccwpck_require__(1267)
  19653. const corsSafeListedMethods = ['GET', 'HEAD', 'POST']
  19654. const corsSafeListedMethodsSet = new Set(corsSafeListedMethods)
  19655. const nullBodyStatus = [101, 204, 205, 304]
  19656. const redirectStatus = [301, 302, 303, 307, 308]
  19657. const redirectStatusSet = new Set(redirectStatus)
  19658. // https://fetch.spec.whatwg.org/#block-bad-port
  19659. const badPorts = [
  19660. '1', '7', '9', '11', '13', '15', '17', '19', '20', '21', '22', '23', '25', '37', '42', '43', '53', '69', '77', '79',
  19661. '87', '95', '101', '102', '103', '104', '109', '110', '111', '113', '115', '117', '119', '123', '135', '137',
  19662. '139', '143', '161', '179', '389', '427', '465', '512', '513', '514', '515', '526', '530', '531', '532',
  19663. '540', '548', '554', '556', '563', '587', '601', '636', '989', '990', '993', '995', '1719', '1720', '1723',
  19664. '2049', '3659', '4045', '5060', '5061', '6000', '6566', '6665', '6666', '6667', '6668', '6669', '6697',
  19665. '10080'
  19666. ]
  19667. const badPortsSet = new Set(badPorts)
  19668. // https://w3c.github.io/webappsec-referrer-policy/#referrer-policies
  19669. const referrerPolicy = [
  19670. '',
  19671. 'no-referrer',
  19672. 'no-referrer-when-downgrade',
  19673. 'same-origin',
  19674. 'origin',
  19675. 'strict-origin',
  19676. 'origin-when-cross-origin',
  19677. 'strict-origin-when-cross-origin',
  19678. 'unsafe-url'
  19679. ]
  19680. const referrerPolicySet = new Set(referrerPolicy)
  19681. const requestRedirect = ['follow', 'manual', 'error']
  19682. const safeMethods = ['GET', 'HEAD', 'OPTIONS', 'TRACE']
  19683. const safeMethodsSet = new Set(safeMethods)
  19684. const requestMode = ['navigate', 'same-origin', 'no-cors', 'cors']
  19685. const requestCredentials = ['omit', 'same-origin', 'include']
  19686. const requestCache = [
  19687. 'default',
  19688. 'no-store',
  19689. 'reload',
  19690. 'no-cache',
  19691. 'force-cache',
  19692. 'only-if-cached'
  19693. ]
  19694. // https://fetch.spec.whatwg.org/#request-body-header-name
  19695. const requestBodyHeader = [
  19696. 'content-encoding',
  19697. 'content-language',
  19698. 'content-location',
  19699. 'content-type',
  19700. // See https://github.com/nodejs/undici/issues/2021
  19701. // 'Content-Length' is a forbidden header name, which is typically
  19702. // removed in the Headers implementation. However, undici doesn't
  19703. // filter out headers, so we add it here.
  19704. 'content-length'
  19705. ]
  19706. // https://fetch.spec.whatwg.org/#enumdef-requestduplex
  19707. const requestDuplex = [
  19708. 'half'
  19709. ]
  19710. // http://fetch.spec.whatwg.org/#forbidden-method
  19711. const forbiddenMethods = ['CONNECT', 'TRACE', 'TRACK']
  19712. const forbiddenMethodsSet = new Set(forbiddenMethods)
  19713. const subresource = [
  19714. 'audio',
  19715. 'audioworklet',
  19716. 'font',
  19717. 'image',
  19718. 'manifest',
  19719. 'paintworklet',
  19720. 'script',
  19721. 'style',
  19722. 'track',
  19723. 'video',
  19724. 'xslt',
  19725. ''
  19726. ]
  19727. const subresourceSet = new Set(subresource)
  19728. /** @type {globalThis['DOMException']} */
  19729. const DOMException = globalThis.DOMException ?? (() => {
  19730. // DOMException was only made a global in Node v17.0.0,
  19731. // but fetch supports >= v16.8.
  19732. try {
  19733. atob('~')
  19734. } catch (err) {
  19735. return Object.getPrototypeOf(err).constructor
  19736. }
  19737. })()
  19738. let channel
  19739. /** @type {globalThis['structuredClone']} */
  19740. const structuredClone =
  19741. globalThis.structuredClone ??
  19742. // https://github.com/nodejs/node/blob/b27ae24dcc4251bad726d9d84baf678d1f707fed/lib/internal/structured_clone.js
  19743. // structuredClone was added in v17.0.0, but fetch supports v16.8
  19744. function structuredClone (value, options = undefined) {
  19745. if (arguments.length === 0) {
  19746. throw new TypeError('missing argument')
  19747. }
  19748. if (!channel) {
  19749. channel = new MessageChannel()
  19750. }
  19751. channel.port1.unref()
  19752. channel.port2.unref()
  19753. channel.port1.postMessage(value, options?.transfer)
  19754. return receiveMessageOnPort(channel.port2).message
  19755. }
  19756. module.exports = {
  19757. DOMException,
  19758. structuredClone,
  19759. subresource,
  19760. forbiddenMethods,
  19761. requestBodyHeader,
  19762. referrerPolicy,
  19763. requestRedirect,
  19764. requestMode,
  19765. requestCredentials,
  19766. requestCache,
  19767. redirectStatus,
  19768. corsSafeListedMethods,
  19769. nullBodyStatus,
  19770. safeMethods,
  19771. badPorts,
  19772. requestDuplex,
  19773. subresourceSet,
  19774. badPortsSet,
  19775. redirectStatusSet,
  19776. corsSafeListedMethodsSet,
  19777. safeMethodsSet,
  19778. forbiddenMethodsSet,
  19779. referrerPolicySet
  19780. }
  19781. /***/ }),
  19782. /***/ 685:
  19783. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  19784. const assert = __nccwpck_require__(9491)
  19785. const { atob } = __nccwpck_require__(4300)
  19786. const { isomorphicDecode } = __nccwpck_require__(2538)
  19787. const encoder = new TextEncoder()
  19788. /**
  19789. * @see https://mimesniff.spec.whatwg.org/#http-token-code-point
  19790. */
  19791. const HTTP_TOKEN_CODEPOINTS = /^[!#$%&'*+-.^_|~A-Za-z0-9]+$/
  19792. const HTTP_WHITESPACE_REGEX = /(\u000A|\u000D|\u0009|\u0020)/ // eslint-disable-line
  19793. /**
  19794. * @see https://mimesniff.spec.whatwg.org/#http-quoted-string-token-code-point
  19795. */
  19796. const HTTP_QUOTED_STRING_TOKENS = /[\u0009|\u0020-\u007E|\u0080-\u00FF]/ // eslint-disable-line
  19797. // https://fetch.spec.whatwg.org/#data-url-processor
  19798. /** @param {URL} dataURL */
  19799. function dataURLProcessor (dataURL) {
  19800. // 1. Assert: dataURL’s scheme is "data".
  19801. assert(dataURL.protocol === 'data:')
  19802. // 2. Let input be the result of running the URL
  19803. // serializer on dataURL with exclude fragment
  19804. // set to true.
  19805. let input = URLSerializer(dataURL, true)
  19806. // 3. Remove the leading "data:" string from input.
  19807. input = input.slice(5)
  19808. // 4. Let position point at the start of input.
  19809. const position = { position: 0 }
  19810. // 5. Let mimeType be the result of collecting a
  19811. // sequence of code points that are not equal
  19812. // to U+002C (,), given position.
  19813. let mimeType = collectASequenceOfCodePointsFast(
  19814. ',',
  19815. input,
  19816. position
  19817. )
  19818. // 6. Strip leading and trailing ASCII whitespace
  19819. // from mimeType.
  19820. // Undici implementation note: we need to store the
  19821. // length because if the mimetype has spaces removed,
  19822. // the wrong amount will be sliced from the input in
  19823. // step #9
  19824. const mimeTypeLength = mimeType.length
  19825. mimeType = removeASCIIWhitespace(mimeType, true, true)
  19826. // 7. If position is past the end of input, then
  19827. // return failure
  19828. if (position.position >= input.length) {
  19829. return 'failure'
  19830. }
  19831. // 8. Advance position by 1.
  19832. position.position++
  19833. // 9. Let encodedBody be the remainder of input.
  19834. const encodedBody = input.slice(mimeTypeLength + 1)
  19835. // 10. Let body be the percent-decoding of encodedBody.
  19836. let body = stringPercentDecode(encodedBody)
  19837. // 11. If mimeType ends with U+003B (;), followed by
  19838. // zero or more U+0020 SPACE, followed by an ASCII
  19839. // case-insensitive match for "base64", then:
  19840. if (/;(\u0020){0,}base64$/i.test(mimeType)) {
  19841. // 1. Let stringBody be the isomorphic decode of body.
  19842. const stringBody = isomorphicDecode(body)
  19843. // 2. Set body to the forgiving-base64 decode of
  19844. // stringBody.
  19845. body = forgivingBase64(stringBody)
  19846. // 3. If body is failure, then return failure.
  19847. if (body === 'failure') {
  19848. return 'failure'
  19849. }
  19850. // 4. Remove the last 6 code points from mimeType.
  19851. mimeType = mimeType.slice(0, -6)
  19852. // 5. Remove trailing U+0020 SPACE code points from mimeType,
  19853. // if any.
  19854. mimeType = mimeType.replace(/(\u0020)+$/, '')
  19855. // 6. Remove the last U+003B (;) code point from mimeType.
  19856. mimeType = mimeType.slice(0, -1)
  19857. }
  19858. // 12. If mimeType starts with U+003B (;), then prepend
  19859. // "text/plain" to mimeType.
  19860. if (mimeType.startsWith(';')) {
  19861. mimeType = 'text/plain' + mimeType
  19862. }
  19863. // 13. Let mimeTypeRecord be the result of parsing
  19864. // mimeType.
  19865. let mimeTypeRecord = parseMIMEType(mimeType)
  19866. // 14. If mimeTypeRecord is failure, then set
  19867. // mimeTypeRecord to text/plain;charset=US-ASCII.
  19868. if (mimeTypeRecord === 'failure') {
  19869. mimeTypeRecord = parseMIMEType('text/plain;charset=US-ASCII')
  19870. }
  19871. // 15. Return a new data: URL struct whose MIME
  19872. // type is mimeTypeRecord and body is body.
  19873. // https://fetch.spec.whatwg.org/#data-url-struct
  19874. return { mimeType: mimeTypeRecord, body }
  19875. }
  19876. // https://url.spec.whatwg.org/#concept-url-serializer
  19877. /**
  19878. * @param {URL} url
  19879. * @param {boolean} excludeFragment
  19880. */
  19881. function URLSerializer (url, excludeFragment = false) {
  19882. if (!excludeFragment) {
  19883. return url.href
  19884. }
  19885. const href = url.href
  19886. const hashLength = url.hash.length
  19887. return hashLength === 0 ? href : href.substring(0, href.length - hashLength)
  19888. }
  19889. // https://infra.spec.whatwg.org/#collect-a-sequence-of-code-points
  19890. /**
  19891. * @param {(char: string) => boolean} condition
  19892. * @param {string} input
  19893. * @param {{ position: number }} position
  19894. */
  19895. function collectASequenceOfCodePoints (condition, input, position) {
  19896. // 1. Let result be the empty string.
  19897. let result = ''
  19898. // 2. While position doesn’t point past the end of input and the
  19899. // code point at position within input meets the condition condition:
  19900. while (position.position < input.length && condition(input[position.position])) {
  19901. // 1. Append that code point to the end of result.
  19902. result += input[position.position]
  19903. // 2. Advance position by 1.
  19904. position.position++
  19905. }
  19906. // 3. Return result.
  19907. return result
  19908. }
  19909. /**
  19910. * A faster collectASequenceOfCodePoints that only works when comparing a single character.
  19911. * @param {string} char
  19912. * @param {string} input
  19913. * @param {{ position: number }} position
  19914. */
  19915. function collectASequenceOfCodePointsFast (char, input, position) {
  19916. const idx = input.indexOf(char, position.position)
  19917. const start = position.position
  19918. if (idx === -1) {
  19919. position.position = input.length
  19920. return input.slice(start)
  19921. }
  19922. position.position = idx
  19923. return input.slice(start, position.position)
  19924. }
  19925. // https://url.spec.whatwg.org/#string-percent-decode
  19926. /** @param {string} input */
  19927. function stringPercentDecode (input) {
  19928. // 1. Let bytes be the UTF-8 encoding of input.
  19929. const bytes = encoder.encode(input)
  19930. // 2. Return the percent-decoding of bytes.
  19931. return percentDecode(bytes)
  19932. }
  19933. // https://url.spec.whatwg.org/#percent-decode
  19934. /** @param {Uint8Array} input */
  19935. function percentDecode (input) {
  19936. // 1. Let output be an empty byte sequence.
  19937. /** @type {number[]} */
  19938. const output = []
  19939. // 2. For each byte byte in input:
  19940. for (let i = 0; i < input.length; i++) {
  19941. const byte = input[i]
  19942. // 1. If byte is not 0x25 (%), then append byte to output.
  19943. if (byte !== 0x25) {
  19944. output.push(byte)
  19945. // 2. Otherwise, if byte is 0x25 (%) and the next two bytes
  19946. // after byte in input are not in the ranges
  19947. // 0x30 (0) to 0x39 (9), 0x41 (A) to 0x46 (F),
  19948. // and 0x61 (a) to 0x66 (f), all inclusive, append byte
  19949. // to output.
  19950. } else if (
  19951. byte === 0x25 &&
  19952. !/^[0-9A-Fa-f]{2}$/i.test(String.fromCharCode(input[i + 1], input[i + 2]))
  19953. ) {
  19954. output.push(0x25)
  19955. // 3. Otherwise:
  19956. } else {
  19957. // 1. Let bytePoint be the two bytes after byte in input,
  19958. // decoded, and then interpreted as hexadecimal number.
  19959. const nextTwoBytes = String.fromCharCode(input[i + 1], input[i + 2])
  19960. const bytePoint = Number.parseInt(nextTwoBytes, 16)
  19961. // 2. Append a byte whose value is bytePoint to output.
  19962. output.push(bytePoint)
  19963. // 3. Skip the next two bytes in input.
  19964. i += 2
  19965. }
  19966. }
  19967. // 3. Return output.
  19968. return Uint8Array.from(output)
  19969. }
  19970. // https://mimesniff.spec.whatwg.org/#parse-a-mime-type
  19971. /** @param {string} input */
  19972. function parseMIMEType (input) {
  19973. // 1. Remove any leading and trailing HTTP whitespace
  19974. // from input.
  19975. input = removeHTTPWhitespace(input, true, true)
  19976. // 2. Let position be a position variable for input,
  19977. // initially pointing at the start of input.
  19978. const position = { position: 0 }
  19979. // 3. Let type be the result of collecting a sequence
  19980. // of code points that are not U+002F (/) from
  19981. // input, given position.
  19982. const type = collectASequenceOfCodePointsFast(
  19983. '/',
  19984. input,
  19985. position
  19986. )
  19987. // 4. If type is the empty string or does not solely
  19988. // contain HTTP token code points, then return failure.
  19989. // https://mimesniff.spec.whatwg.org/#http-token-code-point
  19990. if (type.length === 0 || !HTTP_TOKEN_CODEPOINTS.test(type)) {
  19991. return 'failure'
  19992. }
  19993. // 5. If position is past the end of input, then return
  19994. // failure
  19995. if (position.position > input.length) {
  19996. return 'failure'
  19997. }
  19998. // 6. Advance position by 1. (This skips past U+002F (/).)
  19999. position.position++
  20000. // 7. Let subtype be the result of collecting a sequence of
  20001. // code points that are not U+003B (;) from input, given
  20002. // position.
  20003. let subtype = collectASequenceOfCodePointsFast(
  20004. ';',
  20005. input,
  20006. position
  20007. )
  20008. // 8. Remove any trailing HTTP whitespace from subtype.
  20009. subtype = removeHTTPWhitespace(subtype, false, true)
  20010. // 9. If subtype is the empty string or does not solely
  20011. // contain HTTP token code points, then return failure.
  20012. if (subtype.length === 0 || !HTTP_TOKEN_CODEPOINTS.test(subtype)) {
  20013. return 'failure'
  20014. }
  20015. const typeLowercase = type.toLowerCase()
  20016. const subtypeLowercase = subtype.toLowerCase()
  20017. // 10. Let mimeType be a new MIME type record whose type
  20018. // is type, in ASCII lowercase, and subtype is subtype,
  20019. // in ASCII lowercase.
  20020. // https://mimesniff.spec.whatwg.org/#mime-type
  20021. const mimeType = {
  20022. type: typeLowercase,
  20023. subtype: subtypeLowercase,
  20024. /** @type {Map<string, string>} */
  20025. parameters: new Map(),
  20026. // https://mimesniff.spec.whatwg.org/#mime-type-essence
  20027. essence: `${typeLowercase}/${subtypeLowercase}`
  20028. }
  20029. // 11. While position is not past the end of input:
  20030. while (position.position < input.length) {
  20031. // 1. Advance position by 1. (This skips past U+003B (;).)
  20032. position.position++
  20033. // 2. Collect a sequence of code points that are HTTP
  20034. // whitespace from input given position.
  20035. collectASequenceOfCodePoints(
  20036. // https://fetch.spec.whatwg.org/#http-whitespace
  20037. char => HTTP_WHITESPACE_REGEX.test(char),
  20038. input,
  20039. position
  20040. )
  20041. // 3. Let parameterName be the result of collecting a
  20042. // sequence of code points that are not U+003B (;)
  20043. // or U+003D (=) from input, given position.
  20044. let parameterName = collectASequenceOfCodePoints(
  20045. (char) => char !== ';' && char !== '=',
  20046. input,
  20047. position
  20048. )
  20049. // 4. Set parameterName to parameterName, in ASCII
  20050. // lowercase.
  20051. parameterName = parameterName.toLowerCase()
  20052. // 5. If position is not past the end of input, then:
  20053. if (position.position < input.length) {
  20054. // 1. If the code point at position within input is
  20055. // U+003B (;), then continue.
  20056. if (input[position.position] === ';') {
  20057. continue
  20058. }
  20059. // 2. Advance position by 1. (This skips past U+003D (=).)
  20060. position.position++
  20061. }
  20062. // 6. If position is past the end of input, then break.
  20063. if (position.position > input.length) {
  20064. break
  20065. }
  20066. // 7. Let parameterValue be null.
  20067. let parameterValue = null
  20068. // 8. If the code point at position within input is
  20069. // U+0022 ("), then:
  20070. if (input[position.position] === '"') {
  20071. // 1. Set parameterValue to the result of collecting
  20072. // an HTTP quoted string from input, given position
  20073. // and the extract-value flag.
  20074. parameterValue = collectAnHTTPQuotedString(input, position, true)
  20075. // 2. Collect a sequence of code points that are not
  20076. // U+003B (;) from input, given position.
  20077. collectASequenceOfCodePointsFast(
  20078. ';',
  20079. input,
  20080. position
  20081. )
  20082. // 9. Otherwise:
  20083. } else {
  20084. // 1. Set parameterValue to the result of collecting
  20085. // a sequence of code points that are not U+003B (;)
  20086. // from input, given position.
  20087. parameterValue = collectASequenceOfCodePointsFast(
  20088. ';',
  20089. input,
  20090. position
  20091. )
  20092. // 2. Remove any trailing HTTP whitespace from parameterValue.
  20093. parameterValue = removeHTTPWhitespace(parameterValue, false, true)
  20094. // 3. If parameterValue is the empty string, then continue.
  20095. if (parameterValue.length === 0) {
  20096. continue
  20097. }
  20098. }
  20099. // 10. If all of the following are true
  20100. // - parameterName is not the empty string
  20101. // - parameterName solely contains HTTP token code points
  20102. // - parameterValue solely contains HTTP quoted-string token code points
  20103. // - mimeType’s parameters[parameterName] does not exist
  20104. // then set mimeType’s parameters[parameterName] to parameterValue.
  20105. if (
  20106. parameterName.length !== 0 &&
  20107. HTTP_TOKEN_CODEPOINTS.test(parameterName) &&
  20108. (parameterValue.length === 0 || HTTP_QUOTED_STRING_TOKENS.test(parameterValue)) &&
  20109. !mimeType.parameters.has(parameterName)
  20110. ) {
  20111. mimeType.parameters.set(parameterName, parameterValue)
  20112. }
  20113. }
  20114. // 12. Return mimeType.
  20115. return mimeType
  20116. }
  20117. // https://infra.spec.whatwg.org/#forgiving-base64-decode
  20118. /** @param {string} data */
  20119. function forgivingBase64 (data) {
  20120. // 1. Remove all ASCII whitespace from data.
  20121. data = data.replace(/[\u0009\u000A\u000C\u000D\u0020]/g, '') // eslint-disable-line
  20122. // 2. If data’s code point length divides by 4 leaving
  20123. // no remainder, then:
  20124. if (data.length % 4 === 0) {
  20125. // 1. If data ends with one or two U+003D (=) code points,
  20126. // then remove them from data.
  20127. data = data.replace(/=?=$/, '')
  20128. }
  20129. // 3. If data’s code point length divides by 4 leaving
  20130. // a remainder of 1, then return failure.
  20131. if (data.length % 4 === 1) {
  20132. return 'failure'
  20133. }
  20134. // 4. If data contains a code point that is not one of
  20135. // U+002B (+)
  20136. // U+002F (/)
  20137. // ASCII alphanumeric
  20138. // then return failure.
  20139. if (/[^+/0-9A-Za-z]/.test(data)) {
  20140. return 'failure'
  20141. }
  20142. const binary = atob(data)
  20143. const bytes = new Uint8Array(binary.length)
  20144. for (let byte = 0; byte < binary.length; byte++) {
  20145. bytes[byte] = binary.charCodeAt(byte)
  20146. }
  20147. return bytes
  20148. }
  20149. // https://fetch.spec.whatwg.org/#collect-an-http-quoted-string
  20150. // tests: https://fetch.spec.whatwg.org/#example-http-quoted-string
  20151. /**
  20152. * @param {string} input
  20153. * @param {{ position: number }} position
  20154. * @param {boolean?} extractValue
  20155. */
  20156. function collectAnHTTPQuotedString (input, position, extractValue) {
  20157. // 1. Let positionStart be position.
  20158. const positionStart = position.position
  20159. // 2. Let value be the empty string.
  20160. let value = ''
  20161. // 3. Assert: the code point at position within input
  20162. // is U+0022 (").
  20163. assert(input[position.position] === '"')
  20164. // 4. Advance position by 1.
  20165. position.position++
  20166. // 5. While true:
  20167. while (true) {
  20168. // 1. Append the result of collecting a sequence of code points
  20169. // that are not U+0022 (") or U+005C (\) from input, given
  20170. // position, to value.
  20171. value += collectASequenceOfCodePoints(
  20172. (char) => char !== '"' && char !== '\\',
  20173. input,
  20174. position
  20175. )
  20176. // 2. If position is past the end of input, then break.
  20177. if (position.position >= input.length) {
  20178. break
  20179. }
  20180. // 3. Let quoteOrBackslash be the code point at position within
  20181. // input.
  20182. const quoteOrBackslash = input[position.position]
  20183. // 4. Advance position by 1.
  20184. position.position++
  20185. // 5. If quoteOrBackslash is U+005C (\), then:
  20186. if (quoteOrBackslash === '\\') {
  20187. // 1. If position is past the end of input, then append
  20188. // U+005C (\) to value and break.
  20189. if (position.position >= input.length) {
  20190. value += '\\'
  20191. break
  20192. }
  20193. // 2. Append the code point at position within input to value.
  20194. value += input[position.position]
  20195. // 3. Advance position by 1.
  20196. position.position++
  20197. // 6. Otherwise:
  20198. } else {
  20199. // 1. Assert: quoteOrBackslash is U+0022 (").
  20200. assert(quoteOrBackslash === '"')
  20201. // 2. Break.
  20202. break
  20203. }
  20204. }
  20205. // 6. If the extract-value flag is set, then return value.
  20206. if (extractValue) {
  20207. return value
  20208. }
  20209. // 7. Return the code points from positionStart to position,
  20210. // inclusive, within input.
  20211. return input.slice(positionStart, position.position)
  20212. }
  20213. /**
  20214. * @see https://mimesniff.spec.whatwg.org/#serialize-a-mime-type
  20215. */
  20216. function serializeAMimeType (mimeType) {
  20217. assert(mimeType !== 'failure')
  20218. const { parameters, essence } = mimeType
  20219. // 1. Let serialization be the concatenation of mimeType’s
  20220. // type, U+002F (/), and mimeType’s subtype.
  20221. let serialization = essence
  20222. // 2. For each name → value of mimeType’s parameters:
  20223. for (let [name, value] of parameters.entries()) {
  20224. // 1. Append U+003B (;) to serialization.
  20225. serialization += ';'
  20226. // 2. Append name to serialization.
  20227. serialization += name
  20228. // 3. Append U+003D (=) to serialization.
  20229. serialization += '='
  20230. // 4. If value does not solely contain HTTP token code
  20231. // points or value is the empty string, then:
  20232. if (!HTTP_TOKEN_CODEPOINTS.test(value)) {
  20233. // 1. Precede each occurence of U+0022 (") or
  20234. // U+005C (\) in value with U+005C (\).
  20235. value = value.replace(/(\\|")/g, '\\$1')
  20236. // 2. Prepend U+0022 (") to value.
  20237. value = '"' + value
  20238. // 3. Append U+0022 (") to value.
  20239. value += '"'
  20240. }
  20241. // 5. Append value to serialization.
  20242. serialization += value
  20243. }
  20244. // 3. Return serialization.
  20245. return serialization
  20246. }
  20247. /**
  20248. * @see https://fetch.spec.whatwg.org/#http-whitespace
  20249. * @param {string} char
  20250. */
  20251. function isHTTPWhiteSpace (char) {
  20252. return char === '\r' || char === '\n' || char === '\t' || char === ' '
  20253. }
  20254. /**
  20255. * @see https://fetch.spec.whatwg.org/#http-whitespace
  20256. * @param {string} str
  20257. */
  20258. function removeHTTPWhitespace (str, leading = true, trailing = true) {
  20259. let lead = 0
  20260. let trail = str.length - 1
  20261. if (leading) {
  20262. for (; lead < str.length && isHTTPWhiteSpace(str[lead]); lead++);
  20263. }
  20264. if (trailing) {
  20265. for (; trail > 0 && isHTTPWhiteSpace(str[trail]); trail--);
  20266. }
  20267. return str.slice(lead, trail + 1)
  20268. }
  20269. /**
  20270. * @see https://infra.spec.whatwg.org/#ascii-whitespace
  20271. * @param {string} char
  20272. */
  20273. function isASCIIWhitespace (char) {
  20274. return char === '\r' || char === '\n' || char === '\t' || char === '\f' || char === ' '
  20275. }
  20276. /**
  20277. * @see https://infra.spec.whatwg.org/#strip-leading-and-trailing-ascii-whitespace
  20278. */
  20279. function removeASCIIWhitespace (str, leading = true, trailing = true) {
  20280. let lead = 0
  20281. let trail = str.length - 1
  20282. if (leading) {
  20283. for (; lead < str.length && isASCIIWhitespace(str[lead]); lead++);
  20284. }
  20285. if (trailing) {
  20286. for (; trail > 0 && isASCIIWhitespace(str[trail]); trail--);
  20287. }
  20288. return str.slice(lead, trail + 1)
  20289. }
  20290. module.exports = {
  20291. dataURLProcessor,
  20292. URLSerializer,
  20293. collectASequenceOfCodePoints,
  20294. collectASequenceOfCodePointsFast,
  20295. stringPercentDecode,
  20296. parseMIMEType,
  20297. collectAnHTTPQuotedString,
  20298. serializeAMimeType
  20299. }
  20300. /***/ }),
  20301. /***/ 8511:
  20302. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  20303. "use strict";
  20304. const { Blob, File: NativeFile } = __nccwpck_require__(4300)
  20305. const { types } = __nccwpck_require__(3837)
  20306. const { kState } = __nccwpck_require__(5861)
  20307. const { isBlobLike } = __nccwpck_require__(2538)
  20308. const { webidl } = __nccwpck_require__(1744)
  20309. const { parseMIMEType, serializeAMimeType } = __nccwpck_require__(685)
  20310. const { kEnumerableProperty } = __nccwpck_require__(3983)
  20311. const encoder = new TextEncoder()
  20312. class File extends Blob {
  20313. constructor (fileBits, fileName, options = {}) {
  20314. // The File constructor is invoked with two or three parameters, depending
  20315. // on whether the optional dictionary parameter is used. When the File()
  20316. // constructor is invoked, user agents must run the following steps:
  20317. webidl.argumentLengthCheck(arguments, 2, { header: 'File constructor' })
  20318. fileBits = webidl.converters['sequence<BlobPart>'](fileBits)
  20319. fileName = webidl.converters.USVString(fileName)
  20320. options = webidl.converters.FilePropertyBag(options)
  20321. // 1. Let bytes be the result of processing blob parts given fileBits and
  20322. // options.
  20323. // Note: Blob handles this for us
  20324. // 2. Let n be the fileName argument to the constructor.
  20325. const n = fileName
  20326. // 3. Process FilePropertyBag dictionary argument by running the following
  20327. // substeps:
  20328. // 1. If the type member is provided and is not the empty string, let t
  20329. // be set to the type dictionary member. If t contains any characters
  20330. // outside the range U+0020 to U+007E, then set t to the empty string
  20331. // and return from these substeps.
  20332. // 2. Convert every character in t to ASCII lowercase.
  20333. let t = options.type
  20334. let d
  20335. // eslint-disable-next-line no-labels
  20336. substep: {
  20337. if (t) {
  20338. t = parseMIMEType(t)
  20339. if (t === 'failure') {
  20340. t = ''
  20341. // eslint-disable-next-line no-labels
  20342. break substep
  20343. }
  20344. t = serializeAMimeType(t).toLowerCase()
  20345. }
  20346. // 3. If the lastModified member is provided, let d be set to the
  20347. // lastModified dictionary member. If it is not provided, set d to the
  20348. // current date and time represented as the number of milliseconds since
  20349. // the Unix Epoch (which is the equivalent of Date.now() [ECMA-262]).
  20350. d = options.lastModified
  20351. }
  20352. // 4. Return a new File object F such that:
  20353. // F refers to the bytes byte sequence.
  20354. // F.size is set to the number of total bytes in bytes.
  20355. // F.name is set to n.
  20356. // F.type is set to t.
  20357. // F.lastModified is set to d.
  20358. super(processBlobParts(fileBits, options), { type: t })
  20359. this[kState] = {
  20360. name: n,
  20361. lastModified: d,
  20362. type: t
  20363. }
  20364. }
  20365. get name () {
  20366. webidl.brandCheck(this, File)
  20367. return this[kState].name
  20368. }
  20369. get lastModified () {
  20370. webidl.brandCheck(this, File)
  20371. return this[kState].lastModified
  20372. }
  20373. get type () {
  20374. webidl.brandCheck(this, File)
  20375. return this[kState].type
  20376. }
  20377. }
  20378. class FileLike {
  20379. constructor (blobLike, fileName, options = {}) {
  20380. // TODO: argument idl type check
  20381. // The File constructor is invoked with two or three parameters, depending
  20382. // on whether the optional dictionary parameter is used. When the File()
  20383. // constructor is invoked, user agents must run the following steps:
  20384. // 1. Let bytes be the result of processing blob parts given fileBits and
  20385. // options.
  20386. // 2. Let n be the fileName argument to the constructor.
  20387. const n = fileName
  20388. // 3. Process FilePropertyBag dictionary argument by running the following
  20389. // substeps:
  20390. // 1. If the type member is provided and is not the empty string, let t
  20391. // be set to the type dictionary member. If t contains any characters
  20392. // outside the range U+0020 to U+007E, then set t to the empty string
  20393. // and return from these substeps.
  20394. // TODO
  20395. const t = options.type
  20396. // 2. Convert every character in t to ASCII lowercase.
  20397. // TODO
  20398. // 3. If the lastModified member is provided, let d be set to the
  20399. // lastModified dictionary member. If it is not provided, set d to the
  20400. // current date and time represented as the number of milliseconds since
  20401. // the Unix Epoch (which is the equivalent of Date.now() [ECMA-262]).
  20402. const d = options.lastModified ?? Date.now()
  20403. // 4. Return a new File object F such that:
  20404. // F refers to the bytes byte sequence.
  20405. // F.size is set to the number of total bytes in bytes.
  20406. // F.name is set to n.
  20407. // F.type is set to t.
  20408. // F.lastModified is set to d.
  20409. this[kState] = {
  20410. blobLike,
  20411. name: n,
  20412. type: t,
  20413. lastModified: d
  20414. }
  20415. }
  20416. stream (...args) {
  20417. webidl.brandCheck(this, FileLike)
  20418. return this[kState].blobLike.stream(...args)
  20419. }
  20420. arrayBuffer (...args) {
  20421. webidl.brandCheck(this, FileLike)
  20422. return this[kState].blobLike.arrayBuffer(...args)
  20423. }
  20424. slice (...args) {
  20425. webidl.brandCheck(this, FileLike)
  20426. return this[kState].blobLike.slice(...args)
  20427. }
  20428. text (...args) {
  20429. webidl.brandCheck(this, FileLike)
  20430. return this[kState].blobLike.text(...args)
  20431. }
  20432. get size () {
  20433. webidl.brandCheck(this, FileLike)
  20434. return this[kState].blobLike.size
  20435. }
  20436. get type () {
  20437. webidl.brandCheck(this, FileLike)
  20438. return this[kState].blobLike.type
  20439. }
  20440. get name () {
  20441. webidl.brandCheck(this, FileLike)
  20442. return this[kState].name
  20443. }
  20444. get lastModified () {
  20445. webidl.brandCheck(this, FileLike)
  20446. return this[kState].lastModified
  20447. }
  20448. get [Symbol.toStringTag] () {
  20449. return 'File'
  20450. }
  20451. }
  20452. Object.defineProperties(File.prototype, {
  20453. [Symbol.toStringTag]: {
  20454. value: 'File',
  20455. configurable: true
  20456. },
  20457. name: kEnumerableProperty,
  20458. lastModified: kEnumerableProperty
  20459. })
  20460. webidl.converters.Blob = webidl.interfaceConverter(Blob)
  20461. webidl.converters.BlobPart = function (V, opts) {
  20462. if (webidl.util.Type(V) === 'Object') {
  20463. if (isBlobLike(V)) {
  20464. return webidl.converters.Blob(V, { strict: false })
  20465. }
  20466. if (
  20467. ArrayBuffer.isView(V) ||
  20468. types.isAnyArrayBuffer(V)
  20469. ) {
  20470. return webidl.converters.BufferSource(V, opts)
  20471. }
  20472. }
  20473. return webidl.converters.USVString(V, opts)
  20474. }
  20475. webidl.converters['sequence<BlobPart>'] = webidl.sequenceConverter(
  20476. webidl.converters.BlobPart
  20477. )
  20478. // https://www.w3.org/TR/FileAPI/#dfn-FilePropertyBag
  20479. webidl.converters.FilePropertyBag = webidl.dictionaryConverter([
  20480. {
  20481. key: 'lastModified',
  20482. converter: webidl.converters['long long'],
  20483. get defaultValue () {
  20484. return Date.now()
  20485. }
  20486. },
  20487. {
  20488. key: 'type',
  20489. converter: webidl.converters.DOMString,
  20490. defaultValue: ''
  20491. },
  20492. {
  20493. key: 'endings',
  20494. converter: (value) => {
  20495. value = webidl.converters.DOMString(value)
  20496. value = value.toLowerCase()
  20497. if (value !== 'native') {
  20498. value = 'transparent'
  20499. }
  20500. return value
  20501. },
  20502. defaultValue: 'transparent'
  20503. }
  20504. ])
  20505. /**
  20506. * @see https://www.w3.org/TR/FileAPI/#process-blob-parts
  20507. * @param {(NodeJS.TypedArray|Blob|string)[]} parts
  20508. * @param {{ type: string, endings: string }} options
  20509. */
  20510. function processBlobParts (parts, options) {
  20511. // 1. Let bytes be an empty sequence of bytes.
  20512. /** @type {NodeJS.TypedArray[]} */
  20513. const bytes = []
  20514. // 2. For each element in parts:
  20515. for (const element of parts) {
  20516. // 1. If element is a USVString, run the following substeps:
  20517. if (typeof element === 'string') {
  20518. // 1. Let s be element.
  20519. let s = element
  20520. // 2. If the endings member of options is "native", set s
  20521. // to the result of converting line endings to native
  20522. // of element.
  20523. if (options.endings === 'native') {
  20524. s = convertLineEndingsNative(s)
  20525. }
  20526. // 3. Append the result of UTF-8 encoding s to bytes.
  20527. bytes.push(encoder.encode(s))
  20528. } else if (
  20529. types.isAnyArrayBuffer(element) ||
  20530. types.isTypedArray(element)
  20531. ) {
  20532. // 2. If element is a BufferSource, get a copy of the
  20533. // bytes held by the buffer source, and append those
  20534. // bytes to bytes.
  20535. if (!element.buffer) { // ArrayBuffer
  20536. bytes.push(new Uint8Array(element))
  20537. } else {
  20538. bytes.push(
  20539. new Uint8Array(element.buffer, element.byteOffset, element.byteLength)
  20540. )
  20541. }
  20542. } else if (isBlobLike(element)) {
  20543. // 3. If element is a Blob, append the bytes it represents
  20544. // to bytes.
  20545. bytes.push(element)
  20546. }
  20547. }
  20548. // 3. Return bytes.
  20549. return bytes
  20550. }
  20551. /**
  20552. * @see https://www.w3.org/TR/FileAPI/#convert-line-endings-to-native
  20553. * @param {string} s
  20554. */
  20555. function convertLineEndingsNative (s) {
  20556. // 1. Let native line ending be be the code point U+000A LF.
  20557. let nativeLineEnding = '\n'
  20558. // 2. If the underlying platform’s conventions are to
  20559. // represent newlines as a carriage return and line feed
  20560. // sequence, set native line ending to the code point
  20561. // U+000D CR followed by the code point U+000A LF.
  20562. if (process.platform === 'win32') {
  20563. nativeLineEnding = '\r\n'
  20564. }
  20565. return s.replace(/\r?\n/g, nativeLineEnding)
  20566. }
  20567. // If this function is moved to ./util.js, some tools (such as
  20568. // rollup) will warn about circular dependencies. See:
  20569. // https://github.com/nodejs/undici/issues/1629
  20570. function isFileLike (object) {
  20571. return (
  20572. (NativeFile && object instanceof NativeFile) ||
  20573. object instanceof File || (
  20574. object &&
  20575. (typeof object.stream === 'function' ||
  20576. typeof object.arrayBuffer === 'function') &&
  20577. object[Symbol.toStringTag] === 'File'
  20578. )
  20579. )
  20580. }
  20581. module.exports = { File, FileLike, isFileLike }
  20582. /***/ }),
  20583. /***/ 2015:
  20584. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  20585. "use strict";
  20586. const { isBlobLike, toUSVString, makeIterator } = __nccwpck_require__(2538)
  20587. const { kState } = __nccwpck_require__(5861)
  20588. const { File: UndiciFile, FileLike, isFileLike } = __nccwpck_require__(8511)
  20589. const { webidl } = __nccwpck_require__(1744)
  20590. const { Blob, File: NativeFile } = __nccwpck_require__(4300)
  20591. /** @type {globalThis['File']} */
  20592. const File = NativeFile ?? UndiciFile
  20593. // https://xhr.spec.whatwg.org/#formdata
  20594. class FormData {
  20595. constructor (form) {
  20596. if (form !== undefined) {
  20597. throw webidl.errors.conversionFailed({
  20598. prefix: 'FormData constructor',
  20599. argument: 'Argument 1',
  20600. types: ['undefined']
  20601. })
  20602. }
  20603. this[kState] = []
  20604. }
  20605. append (name, value, filename = undefined) {
  20606. webidl.brandCheck(this, FormData)
  20607. webidl.argumentLengthCheck(arguments, 2, { header: 'FormData.append' })
  20608. if (arguments.length === 3 && !isBlobLike(value)) {
  20609. throw new TypeError(
  20610. "Failed to execute 'append' on 'FormData': parameter 2 is not of type 'Blob'"
  20611. )
  20612. }
  20613. // 1. Let value be value if given; otherwise blobValue.
  20614. name = webidl.converters.USVString(name)
  20615. value = isBlobLike(value)
  20616. ? webidl.converters.Blob(value, { strict: false })
  20617. : webidl.converters.USVString(value)
  20618. filename = arguments.length === 3
  20619. ? webidl.converters.USVString(filename)
  20620. : undefined
  20621. // 2. Let entry be the result of creating an entry with
  20622. // name, value, and filename if given.
  20623. const entry = makeEntry(name, value, filename)
  20624. // 3. Append entry to this’s entry list.
  20625. this[kState].push(entry)
  20626. }
  20627. delete (name) {
  20628. webidl.brandCheck(this, FormData)
  20629. webidl.argumentLengthCheck(arguments, 1, { header: 'FormData.delete' })
  20630. name = webidl.converters.USVString(name)
  20631. // The delete(name) method steps are to remove all entries whose name
  20632. // is name from this’s entry list.
  20633. this[kState] = this[kState].filter(entry => entry.name !== name)
  20634. }
  20635. get (name) {
  20636. webidl.brandCheck(this, FormData)
  20637. webidl.argumentLengthCheck(arguments, 1, { header: 'FormData.get' })
  20638. name = webidl.converters.USVString(name)
  20639. // 1. If there is no entry whose name is name in this’s entry list,
  20640. // then return null.
  20641. const idx = this[kState].findIndex((entry) => entry.name === name)
  20642. if (idx === -1) {
  20643. return null
  20644. }
  20645. // 2. Return the value of the first entry whose name is name from
  20646. // this’s entry list.
  20647. return this[kState][idx].value
  20648. }
  20649. getAll (name) {
  20650. webidl.brandCheck(this, FormData)
  20651. webidl.argumentLengthCheck(arguments, 1, { header: 'FormData.getAll' })
  20652. name = webidl.converters.USVString(name)
  20653. // 1. If there is no entry whose name is name in this’s entry list,
  20654. // then return the empty list.
  20655. // 2. Return the values of all entries whose name is name, in order,
  20656. // from this’s entry list.
  20657. return this[kState]
  20658. .filter((entry) => entry.name === name)
  20659. .map((entry) => entry.value)
  20660. }
  20661. has (name) {
  20662. webidl.brandCheck(this, FormData)
  20663. webidl.argumentLengthCheck(arguments, 1, { header: 'FormData.has' })
  20664. name = webidl.converters.USVString(name)
  20665. // The has(name) method steps are to return true if there is an entry
  20666. // whose name is name in this’s entry list; otherwise false.
  20667. return this[kState].findIndex((entry) => entry.name === name) !== -1
  20668. }
  20669. set (name, value, filename = undefined) {
  20670. webidl.brandCheck(this, FormData)
  20671. webidl.argumentLengthCheck(arguments, 2, { header: 'FormData.set' })
  20672. if (arguments.length === 3 && !isBlobLike(value)) {
  20673. throw new TypeError(
  20674. "Failed to execute 'set' on 'FormData': parameter 2 is not of type 'Blob'"
  20675. )
  20676. }
  20677. // The set(name, value) and set(name, blobValue, filename) method steps
  20678. // are:
  20679. // 1. Let value be value if given; otherwise blobValue.
  20680. name = webidl.converters.USVString(name)
  20681. value = isBlobLike(value)
  20682. ? webidl.converters.Blob(value, { strict: false })
  20683. : webidl.converters.USVString(value)
  20684. filename = arguments.length === 3
  20685. ? toUSVString(filename)
  20686. : undefined
  20687. // 2. Let entry be the result of creating an entry with name, value, and
  20688. // filename if given.
  20689. const entry = makeEntry(name, value, filename)
  20690. // 3. If there are entries in this’s entry list whose name is name, then
  20691. // replace the first such entry with entry and remove the others.
  20692. const idx = this[kState].findIndex((entry) => entry.name === name)
  20693. if (idx !== -1) {
  20694. this[kState] = [
  20695. ...this[kState].slice(0, idx),
  20696. entry,
  20697. ...this[kState].slice(idx + 1).filter((entry) => entry.name !== name)
  20698. ]
  20699. } else {
  20700. // 4. Otherwise, append entry to this’s entry list.
  20701. this[kState].push(entry)
  20702. }
  20703. }
  20704. entries () {
  20705. webidl.brandCheck(this, FormData)
  20706. return makeIterator(
  20707. () => this[kState].map(pair => [pair.name, pair.value]),
  20708. 'FormData',
  20709. 'key+value'
  20710. )
  20711. }
  20712. keys () {
  20713. webidl.brandCheck(this, FormData)
  20714. return makeIterator(
  20715. () => this[kState].map(pair => [pair.name, pair.value]),
  20716. 'FormData',
  20717. 'key'
  20718. )
  20719. }
  20720. values () {
  20721. webidl.brandCheck(this, FormData)
  20722. return makeIterator(
  20723. () => this[kState].map(pair => [pair.name, pair.value]),
  20724. 'FormData',
  20725. 'value'
  20726. )
  20727. }
  20728. /**
  20729. * @param {(value: string, key: string, self: FormData) => void} callbackFn
  20730. * @param {unknown} thisArg
  20731. */
  20732. forEach (callbackFn, thisArg = globalThis) {
  20733. webidl.brandCheck(this, FormData)
  20734. webidl.argumentLengthCheck(arguments, 1, { header: 'FormData.forEach' })
  20735. if (typeof callbackFn !== 'function') {
  20736. throw new TypeError(
  20737. "Failed to execute 'forEach' on 'FormData': parameter 1 is not of type 'Function'."
  20738. )
  20739. }
  20740. for (const [key, value] of this) {
  20741. callbackFn.apply(thisArg, [value, key, this])
  20742. }
  20743. }
  20744. }
  20745. FormData.prototype[Symbol.iterator] = FormData.prototype.entries
  20746. Object.defineProperties(FormData.prototype, {
  20747. [Symbol.toStringTag]: {
  20748. value: 'FormData',
  20749. configurable: true
  20750. }
  20751. })
  20752. /**
  20753. * @see https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#create-an-entry
  20754. * @param {string} name
  20755. * @param {string|Blob} value
  20756. * @param {?string} filename
  20757. * @returns
  20758. */
  20759. function makeEntry (name, value, filename) {
  20760. // 1. Set name to the result of converting name into a scalar value string.
  20761. // "To convert a string into a scalar value string, replace any surrogates
  20762. // with U+FFFD."
  20763. // see: https://nodejs.org/dist/latest-v18.x/docs/api/buffer.html#buftostringencoding-start-end
  20764. name = Buffer.from(name).toString('utf8')
  20765. // 2. If value is a string, then set value to the result of converting
  20766. // value into a scalar value string.
  20767. if (typeof value === 'string') {
  20768. value = Buffer.from(value).toString('utf8')
  20769. } else {
  20770. // 3. Otherwise:
  20771. // 1. If value is not a File object, then set value to a new File object,
  20772. // representing the same bytes, whose name attribute value is "blob"
  20773. if (!isFileLike(value)) {
  20774. value = value instanceof Blob
  20775. ? new File([value], 'blob', { type: value.type })
  20776. : new FileLike(value, 'blob', { type: value.type })
  20777. }
  20778. // 2. If filename is given, then set value to a new File object,
  20779. // representing the same bytes, whose name attribute is filename.
  20780. if (filename !== undefined) {
  20781. /** @type {FilePropertyBag} */
  20782. const options = {
  20783. type: value.type,
  20784. lastModified: value.lastModified
  20785. }
  20786. value = (NativeFile && value instanceof NativeFile) || value instanceof UndiciFile
  20787. ? new File([value], filename, options)
  20788. : new FileLike(value, filename, options)
  20789. }
  20790. }
  20791. // 4. Return an entry whose name is name and whose value is value.
  20792. return { name, value }
  20793. }
  20794. module.exports = { FormData }
  20795. /***/ }),
  20796. /***/ 1246:
  20797. /***/ ((module) => {
  20798. "use strict";
  20799. // In case of breaking changes, increase the version
  20800. // number to avoid conflicts.
  20801. const globalOrigin = Symbol.for('undici.globalOrigin.1')
  20802. function getGlobalOrigin () {
  20803. return globalThis[globalOrigin]
  20804. }
  20805. function setGlobalOrigin (newOrigin) {
  20806. if (newOrigin === undefined) {
  20807. Object.defineProperty(globalThis, globalOrigin, {
  20808. value: undefined,
  20809. writable: true,
  20810. enumerable: false,
  20811. configurable: false
  20812. })
  20813. return
  20814. }
  20815. const parsedURL = new URL(newOrigin)
  20816. if (parsedURL.protocol !== 'http:' && parsedURL.protocol !== 'https:') {
  20817. throw new TypeError(`Only http & https urls are allowed, received ${parsedURL.protocol}`)
  20818. }
  20819. Object.defineProperty(globalThis, globalOrigin, {
  20820. value: parsedURL,
  20821. writable: true,
  20822. enumerable: false,
  20823. configurable: false
  20824. })
  20825. }
  20826. module.exports = {
  20827. getGlobalOrigin,
  20828. setGlobalOrigin
  20829. }
  20830. /***/ }),
  20831. /***/ 554:
  20832. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  20833. "use strict";
  20834. // https://github.com/Ethan-Arrowood/undici-fetch
  20835. const { kHeadersList, kConstruct } = __nccwpck_require__(2785)
  20836. const { kGuard } = __nccwpck_require__(5861)
  20837. const { kEnumerableProperty } = __nccwpck_require__(3983)
  20838. const {
  20839. makeIterator,
  20840. isValidHeaderName,
  20841. isValidHeaderValue
  20842. } = __nccwpck_require__(2538)
  20843. const { webidl } = __nccwpck_require__(1744)
  20844. const assert = __nccwpck_require__(9491)
  20845. const kHeadersMap = Symbol('headers map')
  20846. const kHeadersSortedMap = Symbol('headers map sorted')
  20847. /**
  20848. * @param {number} code
  20849. */
  20850. function isHTTPWhiteSpaceCharCode (code) {
  20851. return code === 0x00a || code === 0x00d || code === 0x009 || code === 0x020
  20852. }
  20853. /**
  20854. * @see https://fetch.spec.whatwg.org/#concept-header-value-normalize
  20855. * @param {string} potentialValue
  20856. */
  20857. function headerValueNormalize (potentialValue) {
  20858. // To normalize a byte sequence potentialValue, remove
  20859. // any leading and trailing HTTP whitespace bytes from
  20860. // potentialValue.
  20861. let i = 0; let j = potentialValue.length
  20862. while (j > i && isHTTPWhiteSpaceCharCode(potentialValue.charCodeAt(j - 1))) --j
  20863. while (j > i && isHTTPWhiteSpaceCharCode(potentialValue.charCodeAt(i))) ++i
  20864. return i === 0 && j === potentialValue.length ? potentialValue : potentialValue.substring(i, j)
  20865. }
  20866. function fill (headers, object) {
  20867. // To fill a Headers object headers with a given object object, run these steps:
  20868. // 1. If object is a sequence, then for each header in object:
  20869. // Note: webidl conversion to array has already been done.
  20870. if (Array.isArray(object)) {
  20871. for (let i = 0; i < object.length; ++i) {
  20872. const header = object[i]
  20873. // 1. If header does not contain exactly two items, then throw a TypeError.
  20874. if (header.length !== 2) {
  20875. throw webidl.errors.exception({
  20876. header: 'Headers constructor',
  20877. message: `expected name/value pair to be length 2, found ${header.length}.`
  20878. })
  20879. }
  20880. // 2. Append (header’s first item, header’s second item) to headers.
  20881. appendHeader(headers, header[0], header[1])
  20882. }
  20883. } else if (typeof object === 'object' && object !== null) {
  20884. // Note: null should throw
  20885. // 2. Otherwise, object is a record, then for each key → value in object,
  20886. // append (key, value) to headers
  20887. const keys = Object.keys(object)
  20888. for (let i = 0; i < keys.length; ++i) {
  20889. appendHeader(headers, keys[i], object[keys[i]])
  20890. }
  20891. } else {
  20892. throw webidl.errors.conversionFailed({
  20893. prefix: 'Headers constructor',
  20894. argument: 'Argument 1',
  20895. types: ['sequence<sequence<ByteString>>', 'record<ByteString, ByteString>']
  20896. })
  20897. }
  20898. }
  20899. /**
  20900. * @see https://fetch.spec.whatwg.org/#concept-headers-append
  20901. */
  20902. function appendHeader (headers, name, value) {
  20903. // 1. Normalize value.
  20904. value = headerValueNormalize(value)
  20905. // 2. If name is not a header name or value is not a
  20906. // header value, then throw a TypeError.
  20907. if (!isValidHeaderName(name)) {
  20908. throw webidl.errors.invalidArgument({
  20909. prefix: 'Headers.append',
  20910. value: name,
  20911. type: 'header name'
  20912. })
  20913. } else if (!isValidHeaderValue(value)) {
  20914. throw webidl.errors.invalidArgument({
  20915. prefix: 'Headers.append',
  20916. value,
  20917. type: 'header value'
  20918. })
  20919. }
  20920. // 3. If headers’s guard is "immutable", then throw a TypeError.
  20921. // 4. Otherwise, if headers’s guard is "request" and name is a
  20922. // forbidden header name, return.
  20923. // Note: undici does not implement forbidden header names
  20924. if (headers[kGuard] === 'immutable') {
  20925. throw new TypeError('immutable')
  20926. } else if (headers[kGuard] === 'request-no-cors') {
  20927. // 5. Otherwise, if headers’s guard is "request-no-cors":
  20928. // TODO
  20929. }
  20930. // 6. Otherwise, if headers’s guard is "response" and name is a
  20931. // forbidden response-header name, return.
  20932. // 7. Append (name, value) to headers’s header list.
  20933. return headers[kHeadersList].append(name, value)
  20934. // 8. If headers’s guard is "request-no-cors", then remove
  20935. // privileged no-CORS request headers from headers
  20936. }
  20937. class HeadersList {
  20938. /** @type {[string, string][]|null} */
  20939. cookies = null
  20940. constructor (init) {
  20941. if (init instanceof HeadersList) {
  20942. this[kHeadersMap] = new Map(init[kHeadersMap])
  20943. this[kHeadersSortedMap] = init[kHeadersSortedMap]
  20944. this.cookies = init.cookies === null ? null : [...init.cookies]
  20945. } else {
  20946. this[kHeadersMap] = new Map(init)
  20947. this[kHeadersSortedMap] = null
  20948. }
  20949. }
  20950. // https://fetch.spec.whatwg.org/#header-list-contains
  20951. contains (name) {
  20952. // A header list list contains a header name name if list
  20953. // contains a header whose name is a byte-case-insensitive
  20954. // match for name.
  20955. name = name.toLowerCase()
  20956. return this[kHeadersMap].has(name)
  20957. }
  20958. clear () {
  20959. this[kHeadersMap].clear()
  20960. this[kHeadersSortedMap] = null
  20961. this.cookies = null
  20962. }
  20963. // https://fetch.spec.whatwg.org/#concept-header-list-append
  20964. append (name, value) {
  20965. this[kHeadersSortedMap] = null
  20966. // 1. If list contains name, then set name to the first such
  20967. // header’s name.
  20968. const lowercaseName = name.toLowerCase()
  20969. const exists = this[kHeadersMap].get(lowercaseName)
  20970. // 2. Append (name, value) to list.
  20971. if (exists) {
  20972. const delimiter = lowercaseName === 'cookie' ? '; ' : ', '
  20973. this[kHeadersMap].set(lowercaseName, {
  20974. name: exists.name,
  20975. value: `${exists.value}${delimiter}${value}`
  20976. })
  20977. } else {
  20978. this[kHeadersMap].set(lowercaseName, { name, value })
  20979. }
  20980. if (lowercaseName === 'set-cookie') {
  20981. this.cookies ??= []
  20982. this.cookies.push(value)
  20983. }
  20984. }
  20985. // https://fetch.spec.whatwg.org/#concept-header-list-set
  20986. set (name, value) {
  20987. this[kHeadersSortedMap] = null
  20988. const lowercaseName = name.toLowerCase()
  20989. if (lowercaseName === 'set-cookie') {
  20990. this.cookies = [value]
  20991. }
  20992. // 1. If list contains name, then set the value of
  20993. // the first such header to value and remove the
  20994. // others.
  20995. // 2. Otherwise, append header (name, value) to list.
  20996. this[kHeadersMap].set(lowercaseName, { name, value })
  20997. }
  20998. // https://fetch.spec.whatwg.org/#concept-header-list-delete
  20999. delete (name) {
  21000. this[kHeadersSortedMap] = null
  21001. name = name.toLowerCase()
  21002. if (name === 'set-cookie') {
  21003. this.cookies = null
  21004. }
  21005. this[kHeadersMap].delete(name)
  21006. }
  21007. // https://fetch.spec.whatwg.org/#concept-header-list-get
  21008. get (name) {
  21009. const value = this[kHeadersMap].get(name.toLowerCase())
  21010. // 1. If list does not contain name, then return null.
  21011. // 2. Return the values of all headers in list whose name
  21012. // is a byte-case-insensitive match for name,
  21013. // separated from each other by 0x2C 0x20, in order.
  21014. return value === undefined ? null : value.value
  21015. }
  21016. * [Symbol.iterator] () {
  21017. // use the lowercased name
  21018. for (const [name, { value }] of this[kHeadersMap]) {
  21019. yield [name, value]
  21020. }
  21021. }
  21022. get entries () {
  21023. const headers = {}
  21024. if (this[kHeadersMap].size) {
  21025. for (const { name, value } of this[kHeadersMap].values()) {
  21026. headers[name] = value
  21027. }
  21028. }
  21029. return headers
  21030. }
  21031. }
  21032. // https://fetch.spec.whatwg.org/#headers-class
  21033. class Headers {
  21034. constructor (init = undefined) {
  21035. if (init === kConstruct) {
  21036. return
  21037. }
  21038. this[kHeadersList] = new HeadersList()
  21039. // The new Headers(init) constructor steps are:
  21040. // 1. Set this’s guard to "none".
  21041. this[kGuard] = 'none'
  21042. // 2. If init is given, then fill this with init.
  21043. if (init !== undefined) {
  21044. init = webidl.converters.HeadersInit(init)
  21045. fill(this, init)
  21046. }
  21047. }
  21048. // https://fetch.spec.whatwg.org/#dom-headers-append
  21049. append (name, value) {
  21050. webidl.brandCheck(this, Headers)
  21051. webidl.argumentLengthCheck(arguments, 2, { header: 'Headers.append' })
  21052. name = webidl.converters.ByteString(name)
  21053. value = webidl.converters.ByteString(value)
  21054. return appendHeader(this, name, value)
  21055. }
  21056. // https://fetch.spec.whatwg.org/#dom-headers-delete
  21057. delete (name) {
  21058. webidl.brandCheck(this, Headers)
  21059. webidl.argumentLengthCheck(arguments, 1, { header: 'Headers.delete' })
  21060. name = webidl.converters.ByteString(name)
  21061. // 1. If name is not a header name, then throw a TypeError.
  21062. if (!isValidHeaderName(name)) {
  21063. throw webidl.errors.invalidArgument({
  21064. prefix: 'Headers.delete',
  21065. value: name,
  21066. type: 'header name'
  21067. })
  21068. }
  21069. // 2. If this’s guard is "immutable", then throw a TypeError.
  21070. // 3. Otherwise, if this’s guard is "request" and name is a
  21071. // forbidden header name, return.
  21072. // 4. Otherwise, if this’s guard is "request-no-cors", name
  21073. // is not a no-CORS-safelisted request-header name, and
  21074. // name is not a privileged no-CORS request-header name,
  21075. // return.
  21076. // 5. Otherwise, if this’s guard is "response" and name is
  21077. // a forbidden response-header name, return.
  21078. // Note: undici does not implement forbidden header names
  21079. if (this[kGuard] === 'immutable') {
  21080. throw new TypeError('immutable')
  21081. } else if (this[kGuard] === 'request-no-cors') {
  21082. // TODO
  21083. }
  21084. // 6. If this’s header list does not contain name, then
  21085. // return.
  21086. if (!this[kHeadersList].contains(name)) {
  21087. return
  21088. }
  21089. // 7. Delete name from this’s header list.
  21090. // 8. If this’s guard is "request-no-cors", then remove
  21091. // privileged no-CORS request headers from this.
  21092. this[kHeadersList].delete(name)
  21093. }
  21094. // https://fetch.spec.whatwg.org/#dom-headers-get
  21095. get (name) {
  21096. webidl.brandCheck(this, Headers)
  21097. webidl.argumentLengthCheck(arguments, 1, { header: 'Headers.get' })
  21098. name = webidl.converters.ByteString(name)
  21099. // 1. If name is not a header name, then throw a TypeError.
  21100. if (!isValidHeaderName(name)) {
  21101. throw webidl.errors.invalidArgument({
  21102. prefix: 'Headers.get',
  21103. value: name,
  21104. type: 'header name'
  21105. })
  21106. }
  21107. // 2. Return the result of getting name from this’s header
  21108. // list.
  21109. return this[kHeadersList].get(name)
  21110. }
  21111. // https://fetch.spec.whatwg.org/#dom-headers-has
  21112. has (name) {
  21113. webidl.brandCheck(this, Headers)
  21114. webidl.argumentLengthCheck(arguments, 1, { header: 'Headers.has' })
  21115. name = webidl.converters.ByteString(name)
  21116. // 1. If name is not a header name, then throw a TypeError.
  21117. if (!isValidHeaderName(name)) {
  21118. throw webidl.errors.invalidArgument({
  21119. prefix: 'Headers.has',
  21120. value: name,
  21121. type: 'header name'
  21122. })
  21123. }
  21124. // 2. Return true if this’s header list contains name;
  21125. // otherwise false.
  21126. return this[kHeadersList].contains(name)
  21127. }
  21128. // https://fetch.spec.whatwg.org/#dom-headers-set
  21129. set (name, value) {
  21130. webidl.brandCheck(this, Headers)
  21131. webidl.argumentLengthCheck(arguments, 2, { header: 'Headers.set' })
  21132. name = webidl.converters.ByteString(name)
  21133. value = webidl.converters.ByteString(value)
  21134. // 1. Normalize value.
  21135. value = headerValueNormalize(value)
  21136. // 2. If name is not a header name or value is not a
  21137. // header value, then throw a TypeError.
  21138. if (!isValidHeaderName(name)) {
  21139. throw webidl.errors.invalidArgument({
  21140. prefix: 'Headers.set',
  21141. value: name,
  21142. type: 'header name'
  21143. })
  21144. } else if (!isValidHeaderValue(value)) {
  21145. throw webidl.errors.invalidArgument({
  21146. prefix: 'Headers.set',
  21147. value,
  21148. type: 'header value'
  21149. })
  21150. }
  21151. // 3. If this’s guard is "immutable", then throw a TypeError.
  21152. // 4. Otherwise, if this’s guard is "request" and name is a
  21153. // forbidden header name, return.
  21154. // 5. Otherwise, if this’s guard is "request-no-cors" and
  21155. // name/value is not a no-CORS-safelisted request-header,
  21156. // return.
  21157. // 6. Otherwise, if this’s guard is "response" and name is a
  21158. // forbidden response-header name, return.
  21159. // Note: undici does not implement forbidden header names
  21160. if (this[kGuard] === 'immutable') {
  21161. throw new TypeError('immutable')
  21162. } else if (this[kGuard] === 'request-no-cors') {
  21163. // TODO
  21164. }
  21165. // 7. Set (name, value) in this’s header list.
  21166. // 8. If this’s guard is "request-no-cors", then remove
  21167. // privileged no-CORS request headers from this
  21168. this[kHeadersList].set(name, value)
  21169. }
  21170. // https://fetch.spec.whatwg.org/#dom-headers-getsetcookie
  21171. getSetCookie () {
  21172. webidl.brandCheck(this, Headers)
  21173. // 1. If this’s header list does not contain `Set-Cookie`, then return « ».
  21174. // 2. Return the values of all headers in this’s header list whose name is
  21175. // a byte-case-insensitive match for `Set-Cookie`, in order.
  21176. const list = this[kHeadersList].cookies
  21177. if (list) {
  21178. return [...list]
  21179. }
  21180. return []
  21181. }
  21182. // https://fetch.spec.whatwg.org/#concept-header-list-sort-and-combine
  21183. get [kHeadersSortedMap] () {
  21184. if (this[kHeadersList][kHeadersSortedMap]) {
  21185. return this[kHeadersList][kHeadersSortedMap]
  21186. }
  21187. // 1. Let headers be an empty list of headers with the key being the name
  21188. // and value the value.
  21189. const headers = []
  21190. // 2. Let names be the result of convert header names to a sorted-lowercase
  21191. // set with all the names of the headers in list.
  21192. const names = [...this[kHeadersList]].sort((a, b) => a[0] < b[0] ? -1 : 1)
  21193. const cookies = this[kHeadersList].cookies
  21194. // 3. For each name of names:
  21195. for (let i = 0; i < names.length; ++i) {
  21196. const [name, value] = names[i]
  21197. // 1. If name is `set-cookie`, then:
  21198. if (name === 'set-cookie') {
  21199. // 1. Let values be a list of all values of headers in list whose name
  21200. // is a byte-case-insensitive match for name, in order.
  21201. // 2. For each value of values:
  21202. // 1. Append (name, value) to headers.
  21203. for (let j = 0; j < cookies.length; ++j) {
  21204. headers.push([name, cookies[j]])
  21205. }
  21206. } else {
  21207. // 2. Otherwise:
  21208. // 1. Let value be the result of getting name from list.
  21209. // 2. Assert: value is non-null.
  21210. assert(value !== null)
  21211. // 3. Append (name, value) to headers.
  21212. headers.push([name, value])
  21213. }
  21214. }
  21215. this[kHeadersList][kHeadersSortedMap] = headers
  21216. // 4. Return headers.
  21217. return headers
  21218. }
  21219. keys () {
  21220. webidl.brandCheck(this, Headers)
  21221. if (this[kGuard] === 'immutable') {
  21222. const value = this[kHeadersSortedMap]
  21223. return makeIterator(() => value, 'Headers',
  21224. 'key')
  21225. }
  21226. return makeIterator(
  21227. () => [...this[kHeadersSortedMap].values()],
  21228. 'Headers',
  21229. 'key'
  21230. )
  21231. }
  21232. values () {
  21233. webidl.brandCheck(this, Headers)
  21234. if (this[kGuard] === 'immutable') {
  21235. const value = this[kHeadersSortedMap]
  21236. return makeIterator(() => value, 'Headers',
  21237. 'value')
  21238. }
  21239. return makeIterator(
  21240. () => [...this[kHeadersSortedMap].values()],
  21241. 'Headers',
  21242. 'value'
  21243. )
  21244. }
  21245. entries () {
  21246. webidl.brandCheck(this, Headers)
  21247. if (this[kGuard] === 'immutable') {
  21248. const value = this[kHeadersSortedMap]
  21249. return makeIterator(() => value, 'Headers',
  21250. 'key+value')
  21251. }
  21252. return makeIterator(
  21253. () => [...this[kHeadersSortedMap].values()],
  21254. 'Headers',
  21255. 'key+value'
  21256. )
  21257. }
  21258. /**
  21259. * @param {(value: string, key: string, self: Headers) => void} callbackFn
  21260. * @param {unknown} thisArg
  21261. */
  21262. forEach (callbackFn, thisArg = globalThis) {
  21263. webidl.brandCheck(this, Headers)
  21264. webidl.argumentLengthCheck(arguments, 1, { header: 'Headers.forEach' })
  21265. if (typeof callbackFn !== 'function') {
  21266. throw new TypeError(
  21267. "Failed to execute 'forEach' on 'Headers': parameter 1 is not of type 'Function'."
  21268. )
  21269. }
  21270. for (const [key, value] of this) {
  21271. callbackFn.apply(thisArg, [value, key, this])
  21272. }
  21273. }
  21274. [Symbol.for('nodejs.util.inspect.custom')] () {
  21275. webidl.brandCheck(this, Headers)
  21276. return this[kHeadersList]
  21277. }
  21278. }
  21279. Headers.prototype[Symbol.iterator] = Headers.prototype.entries
  21280. Object.defineProperties(Headers.prototype, {
  21281. append: kEnumerableProperty,
  21282. delete: kEnumerableProperty,
  21283. get: kEnumerableProperty,
  21284. has: kEnumerableProperty,
  21285. set: kEnumerableProperty,
  21286. getSetCookie: kEnumerableProperty,
  21287. keys: kEnumerableProperty,
  21288. values: kEnumerableProperty,
  21289. entries: kEnumerableProperty,
  21290. forEach: kEnumerableProperty,
  21291. [Symbol.iterator]: { enumerable: false },
  21292. [Symbol.toStringTag]: {
  21293. value: 'Headers',
  21294. configurable: true
  21295. }
  21296. })
  21297. webidl.converters.HeadersInit = function (V) {
  21298. if (webidl.util.Type(V) === 'Object') {
  21299. if (V[Symbol.iterator]) {
  21300. return webidl.converters['sequence<sequence<ByteString>>'](V)
  21301. }
  21302. return webidl.converters['record<ByteString, ByteString>'](V)
  21303. }
  21304. throw webidl.errors.conversionFailed({
  21305. prefix: 'Headers constructor',
  21306. argument: 'Argument 1',
  21307. types: ['sequence<sequence<ByteString>>', 'record<ByteString, ByteString>']
  21308. })
  21309. }
  21310. module.exports = {
  21311. fill,
  21312. Headers,
  21313. HeadersList
  21314. }
  21315. /***/ }),
  21316. /***/ 4881:
  21317. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  21318. "use strict";
  21319. // https://github.com/Ethan-Arrowood/undici-fetch
  21320. const {
  21321. Response,
  21322. makeNetworkError,
  21323. makeAppropriateNetworkError,
  21324. filterResponse,
  21325. makeResponse
  21326. } = __nccwpck_require__(7823)
  21327. const { Headers } = __nccwpck_require__(554)
  21328. const { Request, makeRequest } = __nccwpck_require__(8359)
  21329. const zlib = __nccwpck_require__(9796)
  21330. const {
  21331. bytesMatch,
  21332. makePolicyContainer,
  21333. clonePolicyContainer,
  21334. requestBadPort,
  21335. TAOCheck,
  21336. appendRequestOriginHeader,
  21337. responseLocationURL,
  21338. requestCurrentURL,
  21339. setRequestReferrerPolicyOnRedirect,
  21340. tryUpgradeRequestToAPotentiallyTrustworthyURL,
  21341. createOpaqueTimingInfo,
  21342. appendFetchMetadata,
  21343. corsCheck,
  21344. crossOriginResourcePolicyCheck,
  21345. determineRequestsReferrer,
  21346. coarsenedSharedCurrentTime,
  21347. createDeferredPromise,
  21348. isBlobLike,
  21349. sameOrigin,
  21350. isCancelled,
  21351. isAborted,
  21352. isErrorLike,
  21353. fullyReadBody,
  21354. readableStreamClose,
  21355. isomorphicEncode,
  21356. urlIsLocal,
  21357. urlIsHttpHttpsScheme,
  21358. urlHasHttpsScheme
  21359. } = __nccwpck_require__(2538)
  21360. const { kState, kHeaders, kGuard, kRealm } = __nccwpck_require__(5861)
  21361. const assert = __nccwpck_require__(9491)
  21362. const { safelyExtractBody } = __nccwpck_require__(9990)
  21363. const {
  21364. redirectStatusSet,
  21365. nullBodyStatus,
  21366. safeMethodsSet,
  21367. requestBodyHeader,
  21368. subresourceSet,
  21369. DOMException
  21370. } = __nccwpck_require__(1037)
  21371. const { kHeadersList } = __nccwpck_require__(2785)
  21372. const EE = __nccwpck_require__(2361)
  21373. const { Readable, pipeline } = __nccwpck_require__(2781)
  21374. const { addAbortListener, isErrored, isReadable, nodeMajor, nodeMinor } = __nccwpck_require__(3983)
  21375. const { dataURLProcessor, serializeAMimeType } = __nccwpck_require__(685)
  21376. const { TransformStream } = __nccwpck_require__(5356)
  21377. const { getGlobalDispatcher } = __nccwpck_require__(1892)
  21378. const { webidl } = __nccwpck_require__(1744)
  21379. const { STATUS_CODES } = __nccwpck_require__(3685)
  21380. const GET_OR_HEAD = ['GET', 'HEAD']
  21381. /** @type {import('buffer').resolveObjectURL} */
  21382. let resolveObjectURL
  21383. let ReadableStream = globalThis.ReadableStream
  21384. class Fetch extends EE {
  21385. constructor (dispatcher) {
  21386. super()
  21387. this.dispatcher = dispatcher
  21388. this.connection = null
  21389. this.dump = false
  21390. this.state = 'ongoing'
  21391. // 2 terminated listeners get added per request,
  21392. // but only 1 gets removed. If there are 20 redirects,
  21393. // 21 listeners will be added.
  21394. // See https://github.com/nodejs/undici/issues/1711
  21395. // TODO (fix): Find and fix root cause for leaked listener.
  21396. this.setMaxListeners(21)
  21397. }
  21398. terminate (reason) {
  21399. if (this.state !== 'ongoing') {
  21400. return
  21401. }
  21402. this.state = 'terminated'
  21403. this.connection?.destroy(reason)
  21404. this.emit('terminated', reason)
  21405. }
  21406. // https://fetch.spec.whatwg.org/#fetch-controller-abort
  21407. abort (error) {
  21408. if (this.state !== 'ongoing') {
  21409. return
  21410. }
  21411. // 1. Set controller’s state to "aborted".
  21412. this.state = 'aborted'
  21413. // 2. Let fallbackError be an "AbortError" DOMException.
  21414. // 3. Set error to fallbackError if it is not given.
  21415. if (!error) {
  21416. error = new DOMException('The operation was aborted.', 'AbortError')
  21417. }
  21418. // 4. Let serializedError be StructuredSerialize(error).
  21419. // If that threw an exception, catch it, and let
  21420. // serializedError be StructuredSerialize(fallbackError).
  21421. // 5. Set controller’s serialized abort reason to serializedError.
  21422. this.serializedAbortReason = error
  21423. this.connection?.destroy(error)
  21424. this.emit('terminated', error)
  21425. }
  21426. }
  21427. // https://fetch.spec.whatwg.org/#fetch-method
  21428. function fetch (input, init = {}) {
  21429. webidl.argumentLengthCheck(arguments, 1, { header: 'globalThis.fetch' })
  21430. // 1. Let p be a new promise.
  21431. const p = createDeferredPromise()
  21432. // 2. Let requestObject be the result of invoking the initial value of
  21433. // Request as constructor with input and init as arguments. If this throws
  21434. // an exception, reject p with it and return p.
  21435. let requestObject
  21436. try {
  21437. requestObject = new Request(input, init)
  21438. } catch (e) {
  21439. p.reject(e)
  21440. return p.promise
  21441. }
  21442. // 3. Let request be requestObject’s request.
  21443. const request = requestObject[kState]
  21444. // 4. If requestObject’s signal’s aborted flag is set, then:
  21445. if (requestObject.signal.aborted) {
  21446. // 1. Abort the fetch() call with p, request, null, and
  21447. // requestObject’s signal’s abort reason.
  21448. abortFetch(p, request, null, requestObject.signal.reason)
  21449. // 2. Return p.
  21450. return p.promise
  21451. }
  21452. // 5. Let globalObject be request’s client’s global object.
  21453. const globalObject = request.client.globalObject
  21454. // 6. If globalObject is a ServiceWorkerGlobalScope object, then set
  21455. // request’s service-workers mode to "none".
  21456. if (globalObject?.constructor?.name === 'ServiceWorkerGlobalScope') {
  21457. request.serviceWorkers = 'none'
  21458. }
  21459. // 7. Let responseObject be null.
  21460. let responseObject = null
  21461. // 8. Let relevantRealm be this’s relevant Realm.
  21462. const relevantRealm = null
  21463. // 9. Let locallyAborted be false.
  21464. let locallyAborted = false
  21465. // 10. Let controller be null.
  21466. let controller = null
  21467. // 11. Add the following abort steps to requestObject’s signal:
  21468. addAbortListener(
  21469. requestObject.signal,
  21470. () => {
  21471. // 1. Set locallyAborted to true.
  21472. locallyAborted = true
  21473. // 2. Assert: controller is non-null.
  21474. assert(controller != null)
  21475. // 3. Abort controller with requestObject’s signal’s abort reason.
  21476. controller.abort(requestObject.signal.reason)
  21477. // 4. Abort the fetch() call with p, request, responseObject,
  21478. // and requestObject’s signal’s abort reason.
  21479. abortFetch(p, request, responseObject, requestObject.signal.reason)
  21480. }
  21481. )
  21482. // 12. Let handleFetchDone given response response be to finalize and
  21483. // report timing with response, globalObject, and "fetch".
  21484. const handleFetchDone = (response) =>
  21485. finalizeAndReportTiming(response, 'fetch')
  21486. // 13. Set controller to the result of calling fetch given request,
  21487. // with processResponseEndOfBody set to handleFetchDone, and processResponse
  21488. // given response being these substeps:
  21489. const processResponse = (response) => {
  21490. // 1. If locallyAborted is true, terminate these substeps.
  21491. if (locallyAborted) {
  21492. return Promise.resolve()
  21493. }
  21494. // 2. If response’s aborted flag is set, then:
  21495. if (response.aborted) {
  21496. // 1. Let deserializedError be the result of deserialize a serialized
  21497. // abort reason given controller’s serialized abort reason and
  21498. // relevantRealm.
  21499. // 2. Abort the fetch() call with p, request, responseObject, and
  21500. // deserializedError.
  21501. abortFetch(p, request, responseObject, controller.serializedAbortReason)
  21502. return Promise.resolve()
  21503. }
  21504. // 3. If response is a network error, then reject p with a TypeError
  21505. // and terminate these substeps.
  21506. if (response.type === 'error') {
  21507. p.reject(
  21508. Object.assign(new TypeError('fetch failed'), { cause: response.error })
  21509. )
  21510. return Promise.resolve()
  21511. }
  21512. // 4. Set responseObject to the result of creating a Response object,
  21513. // given response, "immutable", and relevantRealm.
  21514. responseObject = new Response()
  21515. responseObject[kState] = response
  21516. responseObject[kRealm] = relevantRealm
  21517. responseObject[kHeaders][kHeadersList] = response.headersList
  21518. responseObject[kHeaders][kGuard] = 'immutable'
  21519. responseObject[kHeaders][kRealm] = relevantRealm
  21520. // 5. Resolve p with responseObject.
  21521. p.resolve(responseObject)
  21522. }
  21523. controller = fetching({
  21524. request,
  21525. processResponseEndOfBody: handleFetchDone,
  21526. processResponse,
  21527. dispatcher: init.dispatcher ?? getGlobalDispatcher() // undici
  21528. })
  21529. // 14. Return p.
  21530. return p.promise
  21531. }
  21532. // https://fetch.spec.whatwg.org/#finalize-and-report-timing
  21533. function finalizeAndReportTiming (response, initiatorType = 'other') {
  21534. // 1. If response is an aborted network error, then return.
  21535. if (response.type === 'error' && response.aborted) {
  21536. return
  21537. }
  21538. // 2. If response’s URL list is null or empty, then return.
  21539. if (!response.urlList?.length) {
  21540. return
  21541. }
  21542. // 3. Let originalURL be response’s URL list[0].
  21543. const originalURL = response.urlList[0]
  21544. // 4. Let timingInfo be response’s timing info.
  21545. let timingInfo = response.timingInfo
  21546. // 5. Let cacheState be response’s cache state.
  21547. let cacheState = response.cacheState
  21548. // 6. If originalURL’s scheme is not an HTTP(S) scheme, then return.
  21549. if (!urlIsHttpHttpsScheme(originalURL)) {
  21550. return
  21551. }
  21552. // 7. If timingInfo is null, then return.
  21553. if (timingInfo === null) {
  21554. return
  21555. }
  21556. // 8. If response’s timing allow passed flag is not set, then:
  21557. if (!response.timingAllowPassed) {
  21558. // 1. Set timingInfo to a the result of creating an opaque timing info for timingInfo.
  21559. timingInfo = createOpaqueTimingInfo({
  21560. startTime: timingInfo.startTime
  21561. })
  21562. // 2. Set cacheState to the empty string.
  21563. cacheState = ''
  21564. }
  21565. // 9. Set timingInfo’s end time to the coarsened shared current time
  21566. // given global’s relevant settings object’s cross-origin isolated
  21567. // capability.
  21568. // TODO: given global’s relevant settings object’s cross-origin isolated
  21569. // capability?
  21570. timingInfo.endTime = coarsenedSharedCurrentTime()
  21571. // 10. Set response’s timing info to timingInfo.
  21572. response.timingInfo = timingInfo
  21573. // 11. Mark resource timing for timingInfo, originalURL, initiatorType,
  21574. // global, and cacheState.
  21575. markResourceTiming(
  21576. timingInfo,
  21577. originalURL,
  21578. initiatorType,
  21579. globalThis,
  21580. cacheState
  21581. )
  21582. }
  21583. // https://w3c.github.io/resource-timing/#dfn-mark-resource-timing
  21584. function markResourceTiming (timingInfo, originalURL, initiatorType, globalThis, cacheState) {
  21585. if (nodeMajor > 18 || (nodeMajor === 18 && nodeMinor >= 2)) {
  21586. performance.markResourceTiming(timingInfo, originalURL.href, initiatorType, globalThis, cacheState)
  21587. }
  21588. }
  21589. // https://fetch.spec.whatwg.org/#abort-fetch
  21590. function abortFetch (p, request, responseObject, error) {
  21591. // Note: AbortSignal.reason was added in node v17.2.0
  21592. // which would give us an undefined error to reject with.
  21593. // Remove this once node v16 is no longer supported.
  21594. if (!error) {
  21595. error = new DOMException('The operation was aborted.', 'AbortError')
  21596. }
  21597. // 1. Reject promise with error.
  21598. p.reject(error)
  21599. // 2. If request’s body is not null and is readable, then cancel request’s
  21600. // body with error.
  21601. if (request.body != null && isReadable(request.body?.stream)) {
  21602. request.body.stream.cancel(error).catch((err) => {
  21603. if (err.code === 'ERR_INVALID_STATE') {
  21604. // Node bug?
  21605. return
  21606. }
  21607. throw err
  21608. })
  21609. }
  21610. // 3. If responseObject is null, then return.
  21611. if (responseObject == null) {
  21612. return
  21613. }
  21614. // 4. Let response be responseObject’s response.
  21615. const response = responseObject[kState]
  21616. // 5. If response’s body is not null and is readable, then error response’s
  21617. // body with error.
  21618. if (response.body != null && isReadable(response.body?.stream)) {
  21619. response.body.stream.cancel(error).catch((err) => {
  21620. if (err.code === 'ERR_INVALID_STATE') {
  21621. // Node bug?
  21622. return
  21623. }
  21624. throw err
  21625. })
  21626. }
  21627. }
  21628. // https://fetch.spec.whatwg.org/#fetching
  21629. function fetching ({
  21630. request,
  21631. processRequestBodyChunkLength,
  21632. processRequestEndOfBody,
  21633. processResponse,
  21634. processResponseEndOfBody,
  21635. processResponseConsumeBody,
  21636. useParallelQueue = false,
  21637. dispatcher // undici
  21638. }) {
  21639. // 1. Let taskDestination be null.
  21640. let taskDestination = null
  21641. // 2. Let crossOriginIsolatedCapability be false.
  21642. let crossOriginIsolatedCapability = false
  21643. // 3. If request’s client is non-null, then:
  21644. if (request.client != null) {
  21645. // 1. Set taskDestination to request’s client’s global object.
  21646. taskDestination = request.client.globalObject
  21647. // 2. Set crossOriginIsolatedCapability to request’s client’s cross-origin
  21648. // isolated capability.
  21649. crossOriginIsolatedCapability =
  21650. request.client.crossOriginIsolatedCapability
  21651. }
  21652. // 4. If useParallelQueue is true, then set taskDestination to the result of
  21653. // starting a new parallel queue.
  21654. // TODO
  21655. // 5. Let timingInfo be a new fetch timing info whose start time and
  21656. // post-redirect start time are the coarsened shared current time given
  21657. // crossOriginIsolatedCapability.
  21658. const currenTime = coarsenedSharedCurrentTime(crossOriginIsolatedCapability)
  21659. const timingInfo = createOpaqueTimingInfo({
  21660. startTime: currenTime
  21661. })
  21662. // 6. Let fetchParams be a new fetch params whose
  21663. // request is request,
  21664. // timing info is timingInfo,
  21665. // process request body chunk length is processRequestBodyChunkLength,
  21666. // process request end-of-body is processRequestEndOfBody,
  21667. // process response is processResponse,
  21668. // process response consume body is processResponseConsumeBody,
  21669. // process response end-of-body is processResponseEndOfBody,
  21670. // task destination is taskDestination,
  21671. // and cross-origin isolated capability is crossOriginIsolatedCapability.
  21672. const fetchParams = {
  21673. controller: new Fetch(dispatcher),
  21674. request,
  21675. timingInfo,
  21676. processRequestBodyChunkLength,
  21677. processRequestEndOfBody,
  21678. processResponse,
  21679. processResponseConsumeBody,
  21680. processResponseEndOfBody,
  21681. taskDestination,
  21682. crossOriginIsolatedCapability
  21683. }
  21684. // 7. If request’s body is a byte sequence, then set request’s body to
  21685. // request’s body as a body.
  21686. // NOTE: Since fetching is only called from fetch, body should already be
  21687. // extracted.
  21688. assert(!request.body || request.body.stream)
  21689. // 8. If request’s window is "client", then set request’s window to request’s
  21690. // client, if request’s client’s global object is a Window object; otherwise
  21691. // "no-window".
  21692. if (request.window === 'client') {
  21693. // TODO: What if request.client is null?
  21694. request.window =
  21695. request.client?.globalObject?.constructor?.name === 'Window'
  21696. ? request.client
  21697. : 'no-window'
  21698. }
  21699. // 9. If request’s origin is "client", then set request’s origin to request’s
  21700. // client’s origin.
  21701. if (request.origin === 'client') {
  21702. // TODO: What if request.client is null?
  21703. request.origin = request.client?.origin
  21704. }
  21705. // 10. If all of the following conditions are true:
  21706. // TODO
  21707. // 11. If request’s policy container is "client", then:
  21708. if (request.policyContainer === 'client') {
  21709. // 1. If request’s client is non-null, then set request’s policy
  21710. // container to a clone of request’s client’s policy container. [HTML]
  21711. if (request.client != null) {
  21712. request.policyContainer = clonePolicyContainer(
  21713. request.client.policyContainer
  21714. )
  21715. } else {
  21716. // 2. Otherwise, set request’s policy container to a new policy
  21717. // container.
  21718. request.policyContainer = makePolicyContainer()
  21719. }
  21720. }
  21721. // 12. If request’s header list does not contain `Accept`, then:
  21722. if (!request.headersList.contains('accept')) {
  21723. // 1. Let value be `*/*`.
  21724. const value = '*/*'
  21725. // 2. A user agent should set value to the first matching statement, if
  21726. // any, switching on request’s destination:
  21727. // "document"
  21728. // "frame"
  21729. // "iframe"
  21730. // `text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8`
  21731. // "image"
  21732. // `image/png,image/svg+xml,image/*;q=0.8,*/*;q=0.5`
  21733. // "style"
  21734. // `text/css,*/*;q=0.1`
  21735. // TODO
  21736. // 3. Append `Accept`/value to request’s header list.
  21737. request.headersList.append('accept', value)
  21738. }
  21739. // 13. If request’s header list does not contain `Accept-Language`, then
  21740. // user agents should append `Accept-Language`/an appropriate value to
  21741. // request’s header list.
  21742. if (!request.headersList.contains('accept-language')) {
  21743. request.headersList.append('accept-language', '*')
  21744. }
  21745. // 14. If request’s priority is null, then use request’s initiator and
  21746. // destination appropriately in setting request’s priority to a
  21747. // user-agent-defined object.
  21748. if (request.priority === null) {
  21749. // TODO
  21750. }
  21751. // 15. If request is a subresource request, then:
  21752. if (subresourceSet.has(request.destination)) {
  21753. // TODO
  21754. }
  21755. // 16. Run main fetch given fetchParams.
  21756. mainFetch(fetchParams)
  21757. .catch(err => {
  21758. fetchParams.controller.terminate(err)
  21759. })
  21760. // 17. Return fetchParam's controller
  21761. return fetchParams.controller
  21762. }
  21763. // https://fetch.spec.whatwg.org/#concept-main-fetch
  21764. async function mainFetch (fetchParams, recursive = false) {
  21765. // 1. Let request be fetchParams’s request.
  21766. const request = fetchParams.request
  21767. // 2. Let response be null.
  21768. let response = null
  21769. // 3. If request’s local-URLs-only flag is set and request’s current URL is
  21770. // not local, then set response to a network error.
  21771. if (request.localURLsOnly && !urlIsLocal(requestCurrentURL(request))) {
  21772. response = makeNetworkError('local URLs only')
  21773. }
  21774. // 4. Run report Content Security Policy violations for request.
  21775. // TODO
  21776. // 5. Upgrade request to a potentially trustworthy URL, if appropriate.
  21777. tryUpgradeRequestToAPotentiallyTrustworthyURL(request)
  21778. // 6. If should request be blocked due to a bad port, should fetching request
  21779. // be blocked as mixed content, or should request be blocked by Content
  21780. // Security Policy returns blocked, then set response to a network error.
  21781. if (requestBadPort(request) === 'blocked') {
  21782. response = makeNetworkError('bad port')
  21783. }
  21784. // TODO: should fetching request be blocked as mixed content?
  21785. // TODO: should request be blocked by Content Security Policy?
  21786. // 7. If request’s referrer policy is the empty string, then set request’s
  21787. // referrer policy to request’s policy container’s referrer policy.
  21788. if (request.referrerPolicy === '') {
  21789. request.referrerPolicy = request.policyContainer.referrerPolicy
  21790. }
  21791. // 8. If request’s referrer is not "no-referrer", then set request’s
  21792. // referrer to the result of invoking determine request’s referrer.
  21793. if (request.referrer !== 'no-referrer') {
  21794. request.referrer = determineRequestsReferrer(request)
  21795. }
  21796. // 9. Set request’s current URL’s scheme to "https" if all of the following
  21797. // conditions are true:
  21798. // - request’s current URL’s scheme is "http"
  21799. // - request’s current URL’s host is a domain
  21800. // - Matching request’s current URL’s host per Known HSTS Host Domain Name
  21801. // Matching results in either a superdomain match with an asserted
  21802. // includeSubDomains directive or a congruent match (with or without an
  21803. // asserted includeSubDomains directive). [HSTS]
  21804. // TODO
  21805. // 10. If recursive is false, then run the remaining steps in parallel.
  21806. // TODO
  21807. // 11. If response is null, then set response to the result of running
  21808. // the steps corresponding to the first matching statement:
  21809. if (response === null) {
  21810. response = await (async () => {
  21811. const currentURL = requestCurrentURL(request)
  21812. if (
  21813. // - request’s current URL’s origin is same origin with request’s origin,
  21814. // and request’s response tainting is "basic"
  21815. (sameOrigin(currentURL, request.url) && request.responseTainting === 'basic') ||
  21816. // request’s current URL’s scheme is "data"
  21817. (currentURL.protocol === 'data:') ||
  21818. // - request’s mode is "navigate" or "websocket"
  21819. (request.mode === 'navigate' || request.mode === 'websocket')
  21820. ) {
  21821. // 1. Set request’s response tainting to "basic".
  21822. request.responseTainting = 'basic'
  21823. // 2. Return the result of running scheme fetch given fetchParams.
  21824. return await schemeFetch(fetchParams)
  21825. }
  21826. // request’s mode is "same-origin"
  21827. if (request.mode === 'same-origin') {
  21828. // 1. Return a network error.
  21829. return makeNetworkError('request mode cannot be "same-origin"')
  21830. }
  21831. // request’s mode is "no-cors"
  21832. if (request.mode === 'no-cors') {
  21833. // 1. If request’s redirect mode is not "follow", then return a network
  21834. // error.
  21835. if (request.redirect !== 'follow') {
  21836. return makeNetworkError(
  21837. 'redirect mode cannot be "follow" for "no-cors" request'
  21838. )
  21839. }
  21840. // 2. Set request’s response tainting to "opaque".
  21841. request.responseTainting = 'opaque'
  21842. // 3. Return the result of running scheme fetch given fetchParams.
  21843. return await schemeFetch(fetchParams)
  21844. }
  21845. // request’s current URL’s scheme is not an HTTP(S) scheme
  21846. if (!urlIsHttpHttpsScheme(requestCurrentURL(request))) {
  21847. // Return a network error.
  21848. return makeNetworkError('URL scheme must be a HTTP(S) scheme')
  21849. }
  21850. // - request’s use-CORS-preflight flag is set
  21851. // - request’s unsafe-request flag is set and either request’s method is
  21852. // not a CORS-safelisted method or CORS-unsafe request-header names with
  21853. // request’s header list is not empty
  21854. // 1. Set request’s response tainting to "cors".
  21855. // 2. Let corsWithPreflightResponse be the result of running HTTP fetch
  21856. // given fetchParams and true.
  21857. // 3. If corsWithPreflightResponse is a network error, then clear cache
  21858. // entries using request.
  21859. // 4. Return corsWithPreflightResponse.
  21860. // TODO
  21861. // Otherwise
  21862. // 1. Set request’s response tainting to "cors".
  21863. request.responseTainting = 'cors'
  21864. // 2. Return the result of running HTTP fetch given fetchParams.
  21865. return await httpFetch(fetchParams)
  21866. })()
  21867. }
  21868. // 12. If recursive is true, then return response.
  21869. if (recursive) {
  21870. return response
  21871. }
  21872. // 13. If response is not a network error and response is not a filtered
  21873. // response, then:
  21874. if (response.status !== 0 && !response.internalResponse) {
  21875. // If request’s response tainting is "cors", then:
  21876. if (request.responseTainting === 'cors') {
  21877. // 1. Let headerNames be the result of extracting header list values
  21878. // given `Access-Control-Expose-Headers` and response’s header list.
  21879. // TODO
  21880. // 2. If request’s credentials mode is not "include" and headerNames
  21881. // contains `*`, then set response’s CORS-exposed header-name list to
  21882. // all unique header names in response’s header list.
  21883. // TODO
  21884. // 3. Otherwise, if headerNames is not null or failure, then set
  21885. // response’s CORS-exposed header-name list to headerNames.
  21886. // TODO
  21887. }
  21888. // Set response to the following filtered response with response as its
  21889. // internal response, depending on request’s response tainting:
  21890. if (request.responseTainting === 'basic') {
  21891. response = filterResponse(response, 'basic')
  21892. } else if (request.responseTainting === 'cors') {
  21893. response = filterResponse(response, 'cors')
  21894. } else if (request.responseTainting === 'opaque') {
  21895. response = filterResponse(response, 'opaque')
  21896. } else {
  21897. assert(false)
  21898. }
  21899. }
  21900. // 14. Let internalResponse be response, if response is a network error,
  21901. // and response’s internal response otherwise.
  21902. let internalResponse =
  21903. response.status === 0 ? response : response.internalResponse
  21904. // 15. If internalResponse’s URL list is empty, then set it to a clone of
  21905. // request’s URL list.
  21906. if (internalResponse.urlList.length === 0) {
  21907. internalResponse.urlList.push(...request.urlList)
  21908. }
  21909. // 16. If request’s timing allow failed flag is unset, then set
  21910. // internalResponse’s timing allow passed flag.
  21911. if (!request.timingAllowFailed) {
  21912. response.timingAllowPassed = true
  21913. }
  21914. // 17. If response is not a network error and any of the following returns
  21915. // blocked
  21916. // - should internalResponse to request be blocked as mixed content
  21917. // - should internalResponse to request be blocked by Content Security Policy
  21918. // - should internalResponse to request be blocked due to its MIME type
  21919. // - should internalResponse to request be blocked due to nosniff
  21920. // TODO
  21921. // 18. If response’s type is "opaque", internalResponse’s status is 206,
  21922. // internalResponse’s range-requested flag is set, and request’s header
  21923. // list does not contain `Range`, then set response and internalResponse
  21924. // to a network error.
  21925. if (
  21926. response.type === 'opaque' &&
  21927. internalResponse.status === 206 &&
  21928. internalResponse.rangeRequested &&
  21929. !request.headers.contains('range')
  21930. ) {
  21931. response = internalResponse = makeNetworkError()
  21932. }
  21933. // 19. If response is not a network error and either request’s method is
  21934. // `HEAD` or `CONNECT`, or internalResponse’s status is a null body status,
  21935. // set internalResponse’s body to null and disregard any enqueuing toward
  21936. // it (if any).
  21937. if (
  21938. response.status !== 0 &&
  21939. (request.method === 'HEAD' ||
  21940. request.method === 'CONNECT' ||
  21941. nullBodyStatus.includes(internalResponse.status))
  21942. ) {
  21943. internalResponse.body = null
  21944. fetchParams.controller.dump = true
  21945. }
  21946. // 20. If request’s integrity metadata is not the empty string, then:
  21947. if (request.integrity) {
  21948. // 1. Let processBodyError be this step: run fetch finale given fetchParams
  21949. // and a network error.
  21950. const processBodyError = (reason) =>
  21951. fetchFinale(fetchParams, makeNetworkError(reason))
  21952. // 2. If request’s response tainting is "opaque", or response’s body is null,
  21953. // then run processBodyError and abort these steps.
  21954. if (request.responseTainting === 'opaque' || response.body == null) {
  21955. processBodyError(response.error)
  21956. return
  21957. }
  21958. // 3. Let processBody given bytes be these steps:
  21959. const processBody = (bytes) => {
  21960. // 1. If bytes do not match request’s integrity metadata,
  21961. // then run processBodyError and abort these steps. [SRI]
  21962. if (!bytesMatch(bytes, request.integrity)) {
  21963. processBodyError('integrity mismatch')
  21964. return
  21965. }
  21966. // 2. Set response’s body to bytes as a body.
  21967. response.body = safelyExtractBody(bytes)[0]
  21968. // 3. Run fetch finale given fetchParams and response.
  21969. fetchFinale(fetchParams, response)
  21970. }
  21971. // 4. Fully read response’s body given processBody and processBodyError.
  21972. await fullyReadBody(response.body, processBody, processBodyError)
  21973. } else {
  21974. // 21. Otherwise, run fetch finale given fetchParams and response.
  21975. fetchFinale(fetchParams, response)
  21976. }
  21977. }
  21978. // https://fetch.spec.whatwg.org/#concept-scheme-fetch
  21979. // given a fetch params fetchParams
  21980. function schemeFetch (fetchParams) {
  21981. // Note: since the connection is destroyed on redirect, which sets fetchParams to a
  21982. // cancelled state, we do not want this condition to trigger *unless* there have been
  21983. // no redirects. See https://github.com/nodejs/undici/issues/1776
  21984. // 1. If fetchParams is canceled, then return the appropriate network error for fetchParams.
  21985. if (isCancelled(fetchParams) && fetchParams.request.redirectCount === 0) {
  21986. return Promise.resolve(makeAppropriateNetworkError(fetchParams))
  21987. }
  21988. // 2. Let request be fetchParams’s request.
  21989. const { request } = fetchParams
  21990. const { protocol: scheme } = requestCurrentURL(request)
  21991. // 3. Switch on request’s current URL’s scheme and run the associated steps:
  21992. switch (scheme) {
  21993. case 'about:': {
  21994. // If request’s current URL’s path is the string "blank", then return a new response
  21995. // whose status message is `OK`, header list is « (`Content-Type`, `text/html;charset=utf-8`) »,
  21996. // and body is the empty byte sequence as a body.
  21997. // Otherwise, return a network error.
  21998. return Promise.resolve(makeNetworkError('about scheme is not supported'))
  21999. }
  22000. case 'blob:': {
  22001. if (!resolveObjectURL) {
  22002. resolveObjectURL = (__nccwpck_require__(4300).resolveObjectURL)
  22003. }
  22004. // 1. Let blobURLEntry be request’s current URL’s blob URL entry.
  22005. const blobURLEntry = requestCurrentURL(request)
  22006. // https://github.com/web-platform-tests/wpt/blob/7b0ebaccc62b566a1965396e5be7bb2bc06f841f/FileAPI/url/resources/fetch-tests.js#L52-L56
  22007. // Buffer.resolveObjectURL does not ignore URL queries.
  22008. if (blobURLEntry.search.length !== 0) {
  22009. return Promise.resolve(makeNetworkError('NetworkError when attempting to fetch resource.'))
  22010. }
  22011. const blobURLEntryObject = resolveObjectURL(blobURLEntry.toString())
  22012. // 2. If request’s method is not `GET`, blobURLEntry is null, or blobURLEntry’s
  22013. // object is not a Blob object, then return a network error.
  22014. if (request.method !== 'GET' || !isBlobLike(blobURLEntryObject)) {
  22015. return Promise.resolve(makeNetworkError('invalid method'))
  22016. }
  22017. // 3. Let bodyWithType be the result of safely extracting blobURLEntry’s object.
  22018. const bodyWithType = safelyExtractBody(blobURLEntryObject)
  22019. // 4. Let body be bodyWithType’s body.
  22020. const body = bodyWithType[0]
  22021. // 5. Let length be body’s length, serialized and isomorphic encoded.
  22022. const length = isomorphicEncode(`${body.length}`)
  22023. // 6. Let type be bodyWithType’s type if it is non-null; otherwise the empty byte sequence.
  22024. const type = bodyWithType[1] ?? ''
  22025. // 7. Return a new response whose status message is `OK`, header list is
  22026. // « (`Content-Length`, length), (`Content-Type`, type) », and body is body.
  22027. const response = makeResponse({
  22028. statusText: 'OK',
  22029. headersList: [
  22030. ['content-length', { name: 'Content-Length', value: length }],
  22031. ['content-type', { name: 'Content-Type', value: type }]
  22032. ]
  22033. })
  22034. response.body = body
  22035. return Promise.resolve(response)
  22036. }
  22037. case 'data:': {
  22038. // 1. Let dataURLStruct be the result of running the
  22039. // data: URL processor on request’s current URL.
  22040. const currentURL = requestCurrentURL(request)
  22041. const dataURLStruct = dataURLProcessor(currentURL)
  22042. // 2. If dataURLStruct is failure, then return a
  22043. // network error.
  22044. if (dataURLStruct === 'failure') {
  22045. return Promise.resolve(makeNetworkError('failed to fetch the data URL'))
  22046. }
  22047. // 3. Let mimeType be dataURLStruct’s MIME type, serialized.
  22048. const mimeType = serializeAMimeType(dataURLStruct.mimeType)
  22049. // 4. Return a response whose status message is `OK`,
  22050. // header list is « (`Content-Type`, mimeType) »,
  22051. // and body is dataURLStruct’s body as a body.
  22052. return Promise.resolve(makeResponse({
  22053. statusText: 'OK',
  22054. headersList: [
  22055. ['content-type', { name: 'Content-Type', value: mimeType }]
  22056. ],
  22057. body: safelyExtractBody(dataURLStruct.body)[0]
  22058. }))
  22059. }
  22060. case 'file:': {
  22061. // For now, unfortunate as it is, file URLs are left as an exercise for the reader.
  22062. // When in doubt, return a network error.
  22063. return Promise.resolve(makeNetworkError('not implemented... yet...'))
  22064. }
  22065. case 'http:':
  22066. case 'https:': {
  22067. // Return the result of running HTTP fetch given fetchParams.
  22068. return httpFetch(fetchParams)
  22069. .catch((err) => makeNetworkError(err))
  22070. }
  22071. default: {
  22072. return Promise.resolve(makeNetworkError('unknown scheme'))
  22073. }
  22074. }
  22075. }
  22076. // https://fetch.spec.whatwg.org/#finalize-response
  22077. function finalizeResponse (fetchParams, response) {
  22078. // 1. Set fetchParams’s request’s done flag.
  22079. fetchParams.request.done = true
  22080. // 2, If fetchParams’s process response done is not null, then queue a fetch
  22081. // task to run fetchParams’s process response done given response, with
  22082. // fetchParams’s task destination.
  22083. if (fetchParams.processResponseDone != null) {
  22084. queueMicrotask(() => fetchParams.processResponseDone(response))
  22085. }
  22086. }
  22087. // https://fetch.spec.whatwg.org/#fetch-finale
  22088. function fetchFinale (fetchParams, response) {
  22089. // 1. If response is a network error, then:
  22090. if (response.type === 'error') {
  22091. // 1. Set response’s URL list to « fetchParams’s request’s URL list[0] ».
  22092. response.urlList = [fetchParams.request.urlList[0]]
  22093. // 2. Set response’s timing info to the result of creating an opaque timing
  22094. // info for fetchParams’s timing info.
  22095. response.timingInfo = createOpaqueTimingInfo({
  22096. startTime: fetchParams.timingInfo.startTime
  22097. })
  22098. }
  22099. // 2. Let processResponseEndOfBody be the following steps:
  22100. const processResponseEndOfBody = () => {
  22101. // 1. Set fetchParams’s request’s done flag.
  22102. fetchParams.request.done = true
  22103. // If fetchParams’s process response end-of-body is not null,
  22104. // then queue a fetch task to run fetchParams’s process response
  22105. // end-of-body given response with fetchParams’s task destination.
  22106. if (fetchParams.processResponseEndOfBody != null) {
  22107. queueMicrotask(() => fetchParams.processResponseEndOfBody(response))
  22108. }
  22109. }
  22110. // 3. If fetchParams’s process response is non-null, then queue a fetch task
  22111. // to run fetchParams’s process response given response, with fetchParams’s
  22112. // task destination.
  22113. if (fetchParams.processResponse != null) {
  22114. queueMicrotask(() => fetchParams.processResponse(response))
  22115. }
  22116. // 4. If response’s body is null, then run processResponseEndOfBody.
  22117. if (response.body == null) {
  22118. processResponseEndOfBody()
  22119. } else {
  22120. // 5. Otherwise:
  22121. // 1. Let transformStream be a new a TransformStream.
  22122. // 2. Let identityTransformAlgorithm be an algorithm which, given chunk,
  22123. // enqueues chunk in transformStream.
  22124. const identityTransformAlgorithm = (chunk, controller) => {
  22125. controller.enqueue(chunk)
  22126. }
  22127. // 3. Set up transformStream with transformAlgorithm set to identityTransformAlgorithm
  22128. // and flushAlgorithm set to processResponseEndOfBody.
  22129. const transformStream = new TransformStream({
  22130. start () {},
  22131. transform: identityTransformAlgorithm,
  22132. flush: processResponseEndOfBody
  22133. }, {
  22134. size () {
  22135. return 1
  22136. }
  22137. }, {
  22138. size () {
  22139. return 1
  22140. }
  22141. })
  22142. // 4. Set response’s body to the result of piping response’s body through transformStream.
  22143. response.body = { stream: response.body.stream.pipeThrough(transformStream) }
  22144. }
  22145. // 6. If fetchParams’s process response consume body is non-null, then:
  22146. if (fetchParams.processResponseConsumeBody != null) {
  22147. // 1. Let processBody given nullOrBytes be this step: run fetchParams’s
  22148. // process response consume body given response and nullOrBytes.
  22149. const processBody = (nullOrBytes) => fetchParams.processResponseConsumeBody(response, nullOrBytes)
  22150. // 2. Let processBodyError be this step: run fetchParams’s process
  22151. // response consume body given response and failure.
  22152. const processBodyError = (failure) => fetchParams.processResponseConsumeBody(response, failure)
  22153. // 3. If response’s body is null, then queue a fetch task to run processBody
  22154. // given null, with fetchParams’s task destination.
  22155. if (response.body == null) {
  22156. queueMicrotask(() => processBody(null))
  22157. } else {
  22158. // 4. Otherwise, fully read response’s body given processBody, processBodyError,
  22159. // and fetchParams’s task destination.
  22160. return fullyReadBody(response.body, processBody, processBodyError)
  22161. }
  22162. return Promise.resolve()
  22163. }
  22164. }
  22165. // https://fetch.spec.whatwg.org/#http-fetch
  22166. async function httpFetch (fetchParams) {
  22167. // 1. Let request be fetchParams’s request.
  22168. const request = fetchParams.request
  22169. // 2. Let response be null.
  22170. let response = null
  22171. // 3. Let actualResponse be null.
  22172. let actualResponse = null
  22173. // 4. Let timingInfo be fetchParams’s timing info.
  22174. const timingInfo = fetchParams.timingInfo
  22175. // 5. If request’s service-workers mode is "all", then:
  22176. if (request.serviceWorkers === 'all') {
  22177. // TODO
  22178. }
  22179. // 6. If response is null, then:
  22180. if (response === null) {
  22181. // 1. If makeCORSPreflight is true and one of these conditions is true:
  22182. // TODO
  22183. // 2. If request’s redirect mode is "follow", then set request’s
  22184. // service-workers mode to "none".
  22185. if (request.redirect === 'follow') {
  22186. request.serviceWorkers = 'none'
  22187. }
  22188. // 3. Set response and actualResponse to the result of running
  22189. // HTTP-network-or-cache fetch given fetchParams.
  22190. actualResponse = response = await httpNetworkOrCacheFetch(fetchParams)
  22191. // 4. If request’s response tainting is "cors" and a CORS check
  22192. // for request and response returns failure, then return a network error.
  22193. if (
  22194. request.responseTainting === 'cors' &&
  22195. corsCheck(request, response) === 'failure'
  22196. ) {
  22197. return makeNetworkError('cors failure')
  22198. }
  22199. // 5. If the TAO check for request and response returns failure, then set
  22200. // request’s timing allow failed flag.
  22201. if (TAOCheck(request, response) === 'failure') {
  22202. request.timingAllowFailed = true
  22203. }
  22204. }
  22205. // 7. If either request’s response tainting or response’s type
  22206. // is "opaque", and the cross-origin resource policy check with
  22207. // request’s origin, request’s client, request’s destination,
  22208. // and actualResponse returns blocked, then return a network error.
  22209. if (
  22210. (request.responseTainting === 'opaque' || response.type === 'opaque') &&
  22211. crossOriginResourcePolicyCheck(
  22212. request.origin,
  22213. request.client,
  22214. request.destination,
  22215. actualResponse
  22216. ) === 'blocked'
  22217. ) {
  22218. return makeNetworkError('blocked')
  22219. }
  22220. // 8. If actualResponse’s status is a redirect status, then:
  22221. if (redirectStatusSet.has(actualResponse.status)) {
  22222. // 1. If actualResponse’s status is not 303, request’s body is not null,
  22223. // and the connection uses HTTP/2, then user agents may, and are even
  22224. // encouraged to, transmit an RST_STREAM frame.
  22225. // See, https://github.com/whatwg/fetch/issues/1288
  22226. if (request.redirect !== 'manual') {
  22227. fetchParams.controller.connection.destroy()
  22228. }
  22229. // 2. Switch on request’s redirect mode:
  22230. if (request.redirect === 'error') {
  22231. // Set response to a network error.
  22232. response = makeNetworkError('unexpected redirect')
  22233. } else if (request.redirect === 'manual') {
  22234. // Set response to an opaque-redirect filtered response whose internal
  22235. // response is actualResponse.
  22236. // NOTE(spec): On the web this would return an `opaqueredirect` response,
  22237. // but that doesn't make sense server side.
  22238. // See https://github.com/nodejs/undici/issues/1193.
  22239. response = actualResponse
  22240. } else if (request.redirect === 'follow') {
  22241. // Set response to the result of running HTTP-redirect fetch given
  22242. // fetchParams and response.
  22243. response = await httpRedirectFetch(fetchParams, response)
  22244. } else {
  22245. assert(false)
  22246. }
  22247. }
  22248. // 9. Set response’s timing info to timingInfo.
  22249. response.timingInfo = timingInfo
  22250. // 10. Return response.
  22251. return response
  22252. }
  22253. // https://fetch.spec.whatwg.org/#http-redirect-fetch
  22254. function httpRedirectFetch (fetchParams, response) {
  22255. // 1. Let request be fetchParams’s request.
  22256. const request = fetchParams.request
  22257. // 2. Let actualResponse be response, if response is not a filtered response,
  22258. // and response’s internal response otherwise.
  22259. const actualResponse = response.internalResponse
  22260. ? response.internalResponse
  22261. : response
  22262. // 3. Let locationURL be actualResponse’s location URL given request’s current
  22263. // URL’s fragment.
  22264. let locationURL
  22265. try {
  22266. locationURL = responseLocationURL(
  22267. actualResponse,
  22268. requestCurrentURL(request).hash
  22269. )
  22270. // 4. If locationURL is null, then return response.
  22271. if (locationURL == null) {
  22272. return response
  22273. }
  22274. } catch (err) {
  22275. // 5. If locationURL is failure, then return a network error.
  22276. return Promise.resolve(makeNetworkError(err))
  22277. }
  22278. // 6. If locationURL’s scheme is not an HTTP(S) scheme, then return a network
  22279. // error.
  22280. if (!urlIsHttpHttpsScheme(locationURL)) {
  22281. return Promise.resolve(makeNetworkError('URL scheme must be a HTTP(S) scheme'))
  22282. }
  22283. // 7. If request’s redirect count is 20, then return a network error.
  22284. if (request.redirectCount === 20) {
  22285. return Promise.resolve(makeNetworkError('redirect count exceeded'))
  22286. }
  22287. // 8. Increase request’s redirect count by 1.
  22288. request.redirectCount += 1
  22289. // 9. If request’s mode is "cors", locationURL includes credentials, and
  22290. // request’s origin is not same origin with locationURL’s origin, then return
  22291. // a network error.
  22292. if (
  22293. request.mode === 'cors' &&
  22294. (locationURL.username || locationURL.password) &&
  22295. !sameOrigin(request, locationURL)
  22296. ) {
  22297. return Promise.resolve(makeNetworkError('cross origin not allowed for request mode "cors"'))
  22298. }
  22299. // 10. If request’s response tainting is "cors" and locationURL includes
  22300. // credentials, then return a network error.
  22301. if (
  22302. request.responseTainting === 'cors' &&
  22303. (locationURL.username || locationURL.password)
  22304. ) {
  22305. return Promise.resolve(makeNetworkError(
  22306. 'URL cannot contain credentials for request mode "cors"'
  22307. ))
  22308. }
  22309. // 11. If actualResponse’s status is not 303, request’s body is non-null,
  22310. // and request’s body’s source is null, then return a network error.
  22311. if (
  22312. actualResponse.status !== 303 &&
  22313. request.body != null &&
  22314. request.body.source == null
  22315. ) {
  22316. return Promise.resolve(makeNetworkError())
  22317. }
  22318. // 12. If one of the following is true
  22319. // - actualResponse’s status is 301 or 302 and request’s method is `POST`
  22320. // - actualResponse’s status is 303 and request’s method is not `GET` or `HEAD`
  22321. if (
  22322. ([301, 302].includes(actualResponse.status) && request.method === 'POST') ||
  22323. (actualResponse.status === 303 &&
  22324. !GET_OR_HEAD.includes(request.method))
  22325. ) {
  22326. // then:
  22327. // 1. Set request’s method to `GET` and request’s body to null.
  22328. request.method = 'GET'
  22329. request.body = null
  22330. // 2. For each headerName of request-body-header name, delete headerName from
  22331. // request’s header list.
  22332. for (const headerName of requestBodyHeader) {
  22333. request.headersList.delete(headerName)
  22334. }
  22335. }
  22336. // 13. If request’s current URL’s origin is not same origin with locationURL’s
  22337. // origin, then for each headerName of CORS non-wildcard request-header name,
  22338. // delete headerName from request’s header list.
  22339. if (!sameOrigin(requestCurrentURL(request), locationURL)) {
  22340. // https://fetch.spec.whatwg.org/#cors-non-wildcard-request-header-name
  22341. request.headersList.delete('authorization')
  22342. // https://fetch.spec.whatwg.org/#authentication-entries
  22343. request.headersList.delete('proxy-authorization', true)
  22344. // "Cookie" and "Host" are forbidden request-headers, which undici doesn't implement.
  22345. request.headersList.delete('cookie')
  22346. request.headersList.delete('host')
  22347. }
  22348. // 14. If request’s body is non-null, then set request’s body to the first return
  22349. // value of safely extracting request’s body’s source.
  22350. if (request.body != null) {
  22351. assert(request.body.source != null)
  22352. request.body = safelyExtractBody(request.body.source)[0]
  22353. }
  22354. // 15. Let timingInfo be fetchParams’s timing info.
  22355. const timingInfo = fetchParams.timingInfo
  22356. // 16. Set timingInfo’s redirect end time and post-redirect start time to the
  22357. // coarsened shared current time given fetchParams’s cross-origin isolated
  22358. // capability.
  22359. timingInfo.redirectEndTime = timingInfo.postRedirectStartTime =
  22360. coarsenedSharedCurrentTime(fetchParams.crossOriginIsolatedCapability)
  22361. // 17. If timingInfo’s redirect start time is 0, then set timingInfo’s
  22362. // redirect start time to timingInfo’s start time.
  22363. if (timingInfo.redirectStartTime === 0) {
  22364. timingInfo.redirectStartTime = timingInfo.startTime
  22365. }
  22366. // 18. Append locationURL to request’s URL list.
  22367. request.urlList.push(locationURL)
  22368. // 19. Invoke set request’s referrer policy on redirect on request and
  22369. // actualResponse.
  22370. setRequestReferrerPolicyOnRedirect(request, actualResponse)
  22371. // 20. Return the result of running main fetch given fetchParams and true.
  22372. return mainFetch(fetchParams, true)
  22373. }
  22374. // https://fetch.spec.whatwg.org/#http-network-or-cache-fetch
  22375. async function httpNetworkOrCacheFetch (
  22376. fetchParams,
  22377. isAuthenticationFetch = false,
  22378. isNewConnectionFetch = false
  22379. ) {
  22380. // 1. Let request be fetchParams’s request.
  22381. const request = fetchParams.request
  22382. // 2. Let httpFetchParams be null.
  22383. let httpFetchParams = null
  22384. // 3. Let httpRequest be null.
  22385. let httpRequest = null
  22386. // 4. Let response be null.
  22387. let response = null
  22388. // 5. Let storedResponse be null.
  22389. // TODO: cache
  22390. // 6. Let httpCache be null.
  22391. const httpCache = null
  22392. // 7. Let the revalidatingFlag be unset.
  22393. const revalidatingFlag = false
  22394. // 8. Run these steps, but abort when the ongoing fetch is terminated:
  22395. // 1. If request’s window is "no-window" and request’s redirect mode is
  22396. // "error", then set httpFetchParams to fetchParams and httpRequest to
  22397. // request.
  22398. if (request.window === 'no-window' && request.redirect === 'error') {
  22399. httpFetchParams = fetchParams
  22400. httpRequest = request
  22401. } else {
  22402. // Otherwise:
  22403. // 1. Set httpRequest to a clone of request.
  22404. httpRequest = makeRequest(request)
  22405. // 2. Set httpFetchParams to a copy of fetchParams.
  22406. httpFetchParams = { ...fetchParams }
  22407. // 3. Set httpFetchParams’s request to httpRequest.
  22408. httpFetchParams.request = httpRequest
  22409. }
  22410. // 3. Let includeCredentials be true if one of
  22411. const includeCredentials =
  22412. request.credentials === 'include' ||
  22413. (request.credentials === 'same-origin' &&
  22414. request.responseTainting === 'basic')
  22415. // 4. Let contentLength be httpRequest’s body’s length, if httpRequest’s
  22416. // body is non-null; otherwise null.
  22417. const contentLength = httpRequest.body ? httpRequest.body.length : null
  22418. // 5. Let contentLengthHeaderValue be null.
  22419. let contentLengthHeaderValue = null
  22420. // 6. If httpRequest’s body is null and httpRequest’s method is `POST` or
  22421. // `PUT`, then set contentLengthHeaderValue to `0`.
  22422. if (
  22423. httpRequest.body == null &&
  22424. ['POST', 'PUT'].includes(httpRequest.method)
  22425. ) {
  22426. contentLengthHeaderValue = '0'
  22427. }
  22428. // 7. If contentLength is non-null, then set contentLengthHeaderValue to
  22429. // contentLength, serialized and isomorphic encoded.
  22430. if (contentLength != null) {
  22431. contentLengthHeaderValue = isomorphicEncode(`${contentLength}`)
  22432. }
  22433. // 8. If contentLengthHeaderValue is non-null, then append
  22434. // `Content-Length`/contentLengthHeaderValue to httpRequest’s header
  22435. // list.
  22436. if (contentLengthHeaderValue != null) {
  22437. httpRequest.headersList.append('content-length', contentLengthHeaderValue)
  22438. }
  22439. // 9. If contentLengthHeaderValue is non-null, then append (`Content-Length`,
  22440. // contentLengthHeaderValue) to httpRequest’s header list.
  22441. // 10. If contentLength is non-null and httpRequest’s keepalive is true,
  22442. // then:
  22443. if (contentLength != null && httpRequest.keepalive) {
  22444. // NOTE: keepalive is a noop outside of browser context.
  22445. }
  22446. // 11. If httpRequest’s referrer is a URL, then append
  22447. // `Referer`/httpRequest’s referrer, serialized and isomorphic encoded,
  22448. // to httpRequest’s header list.
  22449. if (httpRequest.referrer instanceof URL) {
  22450. httpRequest.headersList.append('referer', isomorphicEncode(httpRequest.referrer.href))
  22451. }
  22452. // 12. Append a request `Origin` header for httpRequest.
  22453. appendRequestOriginHeader(httpRequest)
  22454. // 13. Append the Fetch metadata headers for httpRequest. [FETCH-METADATA]
  22455. appendFetchMetadata(httpRequest)
  22456. // 14. If httpRequest’s header list does not contain `User-Agent`, then
  22457. // user agents should append `User-Agent`/default `User-Agent` value to
  22458. // httpRequest’s header list.
  22459. if (!httpRequest.headersList.contains('user-agent')) {
  22460. httpRequest.headersList.append('user-agent', typeof esbuildDetection === 'undefined' ? 'undici' : 'node')
  22461. }
  22462. // 15. If httpRequest’s cache mode is "default" and httpRequest’s header
  22463. // list contains `If-Modified-Since`, `If-None-Match`,
  22464. // `If-Unmodified-Since`, `If-Match`, or `If-Range`, then set
  22465. // httpRequest’s cache mode to "no-store".
  22466. if (
  22467. httpRequest.cache === 'default' &&
  22468. (httpRequest.headersList.contains('if-modified-since') ||
  22469. httpRequest.headersList.contains('if-none-match') ||
  22470. httpRequest.headersList.contains('if-unmodified-since') ||
  22471. httpRequest.headersList.contains('if-match') ||
  22472. httpRequest.headersList.contains('if-range'))
  22473. ) {
  22474. httpRequest.cache = 'no-store'
  22475. }
  22476. // 16. If httpRequest’s cache mode is "no-cache", httpRequest’s prevent
  22477. // no-cache cache-control header modification flag is unset, and
  22478. // httpRequest’s header list does not contain `Cache-Control`, then append
  22479. // `Cache-Control`/`max-age=0` to httpRequest’s header list.
  22480. if (
  22481. httpRequest.cache === 'no-cache' &&
  22482. !httpRequest.preventNoCacheCacheControlHeaderModification &&
  22483. !httpRequest.headersList.contains('cache-control')
  22484. ) {
  22485. httpRequest.headersList.append('cache-control', 'max-age=0')
  22486. }
  22487. // 17. If httpRequest’s cache mode is "no-store" or "reload", then:
  22488. if (httpRequest.cache === 'no-store' || httpRequest.cache === 'reload') {
  22489. // 1. If httpRequest’s header list does not contain `Pragma`, then append
  22490. // `Pragma`/`no-cache` to httpRequest’s header list.
  22491. if (!httpRequest.headersList.contains('pragma')) {
  22492. httpRequest.headersList.append('pragma', 'no-cache')
  22493. }
  22494. // 2. If httpRequest’s header list does not contain `Cache-Control`,
  22495. // then append `Cache-Control`/`no-cache` to httpRequest’s header list.
  22496. if (!httpRequest.headersList.contains('cache-control')) {
  22497. httpRequest.headersList.append('cache-control', 'no-cache')
  22498. }
  22499. }
  22500. // 18. If httpRequest’s header list contains `Range`, then append
  22501. // `Accept-Encoding`/`identity` to httpRequest’s header list.
  22502. if (httpRequest.headersList.contains('range')) {
  22503. httpRequest.headersList.append('accept-encoding', 'identity')
  22504. }
  22505. // 19. Modify httpRequest’s header list per HTTP. Do not append a given
  22506. // header if httpRequest’s header list contains that header’s name.
  22507. // TODO: https://github.com/whatwg/fetch/issues/1285#issuecomment-896560129
  22508. if (!httpRequest.headersList.contains('accept-encoding')) {
  22509. if (urlHasHttpsScheme(requestCurrentURL(httpRequest))) {
  22510. httpRequest.headersList.append('accept-encoding', 'br, gzip, deflate')
  22511. } else {
  22512. httpRequest.headersList.append('accept-encoding', 'gzip, deflate')
  22513. }
  22514. }
  22515. httpRequest.headersList.delete('host')
  22516. // 20. If includeCredentials is true, then:
  22517. if (includeCredentials) {
  22518. // 1. If the user agent is not configured to block cookies for httpRequest
  22519. // (see section 7 of [COOKIES]), then:
  22520. // TODO: credentials
  22521. // 2. If httpRequest’s header list does not contain `Authorization`, then:
  22522. // TODO: credentials
  22523. }
  22524. // 21. If there’s a proxy-authentication entry, use it as appropriate.
  22525. // TODO: proxy-authentication
  22526. // 22. Set httpCache to the result of determining the HTTP cache
  22527. // partition, given httpRequest.
  22528. // TODO: cache
  22529. // 23. If httpCache is null, then set httpRequest’s cache mode to
  22530. // "no-store".
  22531. if (httpCache == null) {
  22532. httpRequest.cache = 'no-store'
  22533. }
  22534. // 24. If httpRequest’s cache mode is neither "no-store" nor "reload",
  22535. // then:
  22536. if (httpRequest.mode !== 'no-store' && httpRequest.mode !== 'reload') {
  22537. // TODO: cache
  22538. }
  22539. // 9. If aborted, then return the appropriate network error for fetchParams.
  22540. // TODO
  22541. // 10. If response is null, then:
  22542. if (response == null) {
  22543. // 1. If httpRequest’s cache mode is "only-if-cached", then return a
  22544. // network error.
  22545. if (httpRequest.mode === 'only-if-cached') {
  22546. return makeNetworkError('only if cached')
  22547. }
  22548. // 2. Let forwardResponse be the result of running HTTP-network fetch
  22549. // given httpFetchParams, includeCredentials, and isNewConnectionFetch.
  22550. const forwardResponse = await httpNetworkFetch(
  22551. httpFetchParams,
  22552. includeCredentials,
  22553. isNewConnectionFetch
  22554. )
  22555. // 3. If httpRequest’s method is unsafe and forwardResponse’s status is
  22556. // in the range 200 to 399, inclusive, invalidate appropriate stored
  22557. // responses in httpCache, as per the "Invalidation" chapter of HTTP
  22558. // Caching, and set storedResponse to null. [HTTP-CACHING]
  22559. if (
  22560. !safeMethodsSet.has(httpRequest.method) &&
  22561. forwardResponse.status >= 200 &&
  22562. forwardResponse.status <= 399
  22563. ) {
  22564. // TODO: cache
  22565. }
  22566. // 4. If the revalidatingFlag is set and forwardResponse’s status is 304,
  22567. // then:
  22568. if (revalidatingFlag && forwardResponse.status === 304) {
  22569. // TODO: cache
  22570. }
  22571. // 5. If response is null, then:
  22572. if (response == null) {
  22573. // 1. Set response to forwardResponse.
  22574. response = forwardResponse
  22575. // 2. Store httpRequest and forwardResponse in httpCache, as per the
  22576. // "Storing Responses in Caches" chapter of HTTP Caching. [HTTP-CACHING]
  22577. // TODO: cache
  22578. }
  22579. }
  22580. // 11. Set response’s URL list to a clone of httpRequest’s URL list.
  22581. response.urlList = [...httpRequest.urlList]
  22582. // 12. If httpRequest’s header list contains `Range`, then set response’s
  22583. // range-requested flag.
  22584. if (httpRequest.headersList.contains('range')) {
  22585. response.rangeRequested = true
  22586. }
  22587. // 13. Set response’s request-includes-credentials to includeCredentials.
  22588. response.requestIncludesCredentials = includeCredentials
  22589. // 14. If response’s status is 401, httpRequest’s response tainting is not
  22590. // "cors", includeCredentials is true, and request’s window is an environment
  22591. // settings object, then:
  22592. // TODO
  22593. // 15. If response’s status is 407, then:
  22594. if (response.status === 407) {
  22595. // 1. If request’s window is "no-window", then return a network error.
  22596. if (request.window === 'no-window') {
  22597. return makeNetworkError()
  22598. }
  22599. // 2. ???
  22600. // 3. If fetchParams is canceled, then return the appropriate network error for fetchParams.
  22601. if (isCancelled(fetchParams)) {
  22602. return makeAppropriateNetworkError(fetchParams)
  22603. }
  22604. // 4. Prompt the end user as appropriate in request’s window and store
  22605. // the result as a proxy-authentication entry. [HTTP-AUTH]
  22606. // TODO: Invoke some kind of callback?
  22607. // 5. Set response to the result of running HTTP-network-or-cache fetch given
  22608. // fetchParams.
  22609. // TODO
  22610. return makeNetworkError('proxy authentication required')
  22611. }
  22612. // 16. If all of the following are true
  22613. if (
  22614. // response’s status is 421
  22615. response.status === 421 &&
  22616. // isNewConnectionFetch is false
  22617. !isNewConnectionFetch &&
  22618. // request’s body is null, or request’s body is non-null and request’s body’s source is non-null
  22619. (request.body == null || request.body.source != null)
  22620. ) {
  22621. // then:
  22622. // 1. If fetchParams is canceled, then return the appropriate network error for fetchParams.
  22623. if (isCancelled(fetchParams)) {
  22624. return makeAppropriateNetworkError(fetchParams)
  22625. }
  22626. // 2. Set response to the result of running HTTP-network-or-cache
  22627. // fetch given fetchParams, isAuthenticationFetch, and true.
  22628. // TODO (spec): The spec doesn't specify this but we need to cancel
  22629. // the active response before we can start a new one.
  22630. // https://github.com/whatwg/fetch/issues/1293
  22631. fetchParams.controller.connection.destroy()
  22632. response = await httpNetworkOrCacheFetch(
  22633. fetchParams,
  22634. isAuthenticationFetch,
  22635. true
  22636. )
  22637. }
  22638. // 17. If isAuthenticationFetch is true, then create an authentication entry
  22639. if (isAuthenticationFetch) {
  22640. // TODO
  22641. }
  22642. // 18. Return response.
  22643. return response
  22644. }
  22645. // https://fetch.spec.whatwg.org/#http-network-fetch
  22646. async function httpNetworkFetch (
  22647. fetchParams,
  22648. includeCredentials = false,
  22649. forceNewConnection = false
  22650. ) {
  22651. assert(!fetchParams.controller.connection || fetchParams.controller.connection.destroyed)
  22652. fetchParams.controller.connection = {
  22653. abort: null,
  22654. destroyed: false,
  22655. destroy (err) {
  22656. if (!this.destroyed) {
  22657. this.destroyed = true
  22658. this.abort?.(err ?? new DOMException('The operation was aborted.', 'AbortError'))
  22659. }
  22660. }
  22661. }
  22662. // 1. Let request be fetchParams’s request.
  22663. const request = fetchParams.request
  22664. // 2. Let response be null.
  22665. let response = null
  22666. // 3. Let timingInfo be fetchParams’s timing info.
  22667. const timingInfo = fetchParams.timingInfo
  22668. // 4. Let httpCache be the result of determining the HTTP cache partition,
  22669. // given request.
  22670. // TODO: cache
  22671. const httpCache = null
  22672. // 5. If httpCache is null, then set request’s cache mode to "no-store".
  22673. if (httpCache == null) {
  22674. request.cache = 'no-store'
  22675. }
  22676. // 6. Let networkPartitionKey be the result of determining the network
  22677. // partition key given request.
  22678. // TODO
  22679. // 7. Let newConnection be "yes" if forceNewConnection is true; otherwise
  22680. // "no".
  22681. const newConnection = forceNewConnection ? 'yes' : 'no' // eslint-disable-line no-unused-vars
  22682. // 8. Switch on request’s mode:
  22683. if (request.mode === 'websocket') {
  22684. // Let connection be the result of obtaining a WebSocket connection,
  22685. // given request’s current URL.
  22686. // TODO
  22687. } else {
  22688. // Let connection be the result of obtaining a connection, given
  22689. // networkPartitionKey, request’s current URL’s origin,
  22690. // includeCredentials, and forceNewConnection.
  22691. // TODO
  22692. }
  22693. // 9. Run these steps, but abort when the ongoing fetch is terminated:
  22694. // 1. If connection is failure, then return a network error.
  22695. // 2. Set timingInfo’s final connection timing info to the result of
  22696. // calling clamp and coarsen connection timing info with connection’s
  22697. // timing info, timingInfo’s post-redirect start time, and fetchParams’s
  22698. // cross-origin isolated capability.
  22699. // 3. If connection is not an HTTP/2 connection, request’s body is non-null,
  22700. // and request’s body’s source is null, then append (`Transfer-Encoding`,
  22701. // `chunked`) to request’s header list.
  22702. // 4. Set timingInfo’s final network-request start time to the coarsened
  22703. // shared current time given fetchParams’s cross-origin isolated
  22704. // capability.
  22705. // 5. Set response to the result of making an HTTP request over connection
  22706. // using request with the following caveats:
  22707. // - Follow the relevant requirements from HTTP. [HTTP] [HTTP-SEMANTICS]
  22708. // [HTTP-COND] [HTTP-CACHING] [HTTP-AUTH]
  22709. // - If request’s body is non-null, and request’s body’s source is null,
  22710. // then the user agent may have a buffer of up to 64 kibibytes and store
  22711. // a part of request’s body in that buffer. If the user agent reads from
  22712. // request’s body beyond that buffer’s size and the user agent needs to
  22713. // resend request, then instead return a network error.
  22714. // - Set timingInfo’s final network-response start time to the coarsened
  22715. // shared current time given fetchParams’s cross-origin isolated capability,
  22716. // immediately after the user agent’s HTTP parser receives the first byte
  22717. // of the response (e.g., frame header bytes for HTTP/2 or response status
  22718. // line for HTTP/1.x).
  22719. // - Wait until all the headers are transmitted.
  22720. // - Any responses whose status is in the range 100 to 199, inclusive,
  22721. // and is not 101, are to be ignored, except for the purposes of setting
  22722. // timingInfo’s final network-response start time above.
  22723. // - If request’s header list contains `Transfer-Encoding`/`chunked` and
  22724. // response is transferred via HTTP/1.0 or older, then return a network
  22725. // error.
  22726. // - If the HTTP request results in a TLS client certificate dialog, then:
  22727. // 1. If request’s window is an environment settings object, make the
  22728. // dialog available in request’s window.
  22729. // 2. Otherwise, return a network error.
  22730. // To transmit request’s body body, run these steps:
  22731. let requestBody = null
  22732. // 1. If body is null and fetchParams’s process request end-of-body is
  22733. // non-null, then queue a fetch task given fetchParams’s process request
  22734. // end-of-body and fetchParams’s task destination.
  22735. if (request.body == null && fetchParams.processRequestEndOfBody) {
  22736. queueMicrotask(() => fetchParams.processRequestEndOfBody())
  22737. } else if (request.body != null) {
  22738. // 2. Otherwise, if body is non-null:
  22739. // 1. Let processBodyChunk given bytes be these steps:
  22740. const processBodyChunk = async function * (bytes) {
  22741. // 1. If the ongoing fetch is terminated, then abort these steps.
  22742. if (isCancelled(fetchParams)) {
  22743. return
  22744. }
  22745. // 2. Run this step in parallel: transmit bytes.
  22746. yield bytes
  22747. // 3. If fetchParams’s process request body is non-null, then run
  22748. // fetchParams’s process request body given bytes’s length.
  22749. fetchParams.processRequestBodyChunkLength?.(bytes.byteLength)
  22750. }
  22751. // 2. Let processEndOfBody be these steps:
  22752. const processEndOfBody = () => {
  22753. // 1. If fetchParams is canceled, then abort these steps.
  22754. if (isCancelled(fetchParams)) {
  22755. return
  22756. }
  22757. // 2. If fetchParams’s process request end-of-body is non-null,
  22758. // then run fetchParams’s process request end-of-body.
  22759. if (fetchParams.processRequestEndOfBody) {
  22760. fetchParams.processRequestEndOfBody()
  22761. }
  22762. }
  22763. // 3. Let processBodyError given e be these steps:
  22764. const processBodyError = (e) => {
  22765. // 1. If fetchParams is canceled, then abort these steps.
  22766. if (isCancelled(fetchParams)) {
  22767. return
  22768. }
  22769. // 2. If e is an "AbortError" DOMException, then abort fetchParams’s controller.
  22770. if (e.name === 'AbortError') {
  22771. fetchParams.controller.abort()
  22772. } else {
  22773. fetchParams.controller.terminate(e)
  22774. }
  22775. }
  22776. // 4. Incrementally read request’s body given processBodyChunk, processEndOfBody,
  22777. // processBodyError, and fetchParams’s task destination.
  22778. requestBody = (async function * () {
  22779. try {
  22780. for await (const bytes of request.body.stream) {
  22781. yield * processBodyChunk(bytes)
  22782. }
  22783. processEndOfBody()
  22784. } catch (err) {
  22785. processBodyError(err)
  22786. }
  22787. })()
  22788. }
  22789. try {
  22790. // socket is only provided for websockets
  22791. const { body, status, statusText, headersList, socket } = await dispatch({ body: requestBody })
  22792. if (socket) {
  22793. response = makeResponse({ status, statusText, headersList, socket })
  22794. } else {
  22795. const iterator = body[Symbol.asyncIterator]()
  22796. fetchParams.controller.next = () => iterator.next()
  22797. response = makeResponse({ status, statusText, headersList })
  22798. }
  22799. } catch (err) {
  22800. // 10. If aborted, then:
  22801. if (err.name === 'AbortError') {
  22802. // 1. If connection uses HTTP/2, then transmit an RST_STREAM frame.
  22803. fetchParams.controller.connection.destroy()
  22804. // 2. Return the appropriate network error for fetchParams.
  22805. return makeAppropriateNetworkError(fetchParams, err)
  22806. }
  22807. return makeNetworkError(err)
  22808. }
  22809. // 11. Let pullAlgorithm be an action that resumes the ongoing fetch
  22810. // if it is suspended.
  22811. const pullAlgorithm = () => {
  22812. fetchParams.controller.resume()
  22813. }
  22814. // 12. Let cancelAlgorithm be an algorithm that aborts fetchParams’s
  22815. // controller with reason, given reason.
  22816. const cancelAlgorithm = (reason) => {
  22817. fetchParams.controller.abort(reason)
  22818. }
  22819. // 13. Let highWaterMark be a non-negative, non-NaN number, chosen by
  22820. // the user agent.
  22821. // TODO
  22822. // 14. Let sizeAlgorithm be an algorithm that accepts a chunk object
  22823. // and returns a non-negative, non-NaN, non-infinite number, chosen by the user agent.
  22824. // TODO
  22825. // 15. Let stream be a new ReadableStream.
  22826. // 16. Set up stream with pullAlgorithm set to pullAlgorithm,
  22827. // cancelAlgorithm set to cancelAlgorithm, highWaterMark set to
  22828. // highWaterMark, and sizeAlgorithm set to sizeAlgorithm.
  22829. if (!ReadableStream) {
  22830. ReadableStream = (__nccwpck_require__(5356).ReadableStream)
  22831. }
  22832. const stream = new ReadableStream(
  22833. {
  22834. async start (controller) {
  22835. fetchParams.controller.controller = controller
  22836. },
  22837. async pull (controller) {
  22838. await pullAlgorithm(controller)
  22839. },
  22840. async cancel (reason) {
  22841. await cancelAlgorithm(reason)
  22842. }
  22843. },
  22844. {
  22845. highWaterMark: 0,
  22846. size () {
  22847. return 1
  22848. }
  22849. }
  22850. )
  22851. // 17. Run these steps, but abort when the ongoing fetch is terminated:
  22852. // 1. Set response’s body to a new body whose stream is stream.
  22853. response.body = { stream }
  22854. // 2. If response is not a network error and request’s cache mode is
  22855. // not "no-store", then update response in httpCache for request.
  22856. // TODO
  22857. // 3. If includeCredentials is true and the user agent is not configured
  22858. // to block cookies for request (see section 7 of [COOKIES]), then run the
  22859. // "set-cookie-string" parsing algorithm (see section 5.2 of [COOKIES]) on
  22860. // the value of each header whose name is a byte-case-insensitive match for
  22861. // `Set-Cookie` in response’s header list, if any, and request’s current URL.
  22862. // TODO
  22863. // 18. If aborted, then:
  22864. // TODO
  22865. // 19. Run these steps in parallel:
  22866. // 1. Run these steps, but abort when fetchParams is canceled:
  22867. fetchParams.controller.on('terminated', onAborted)
  22868. fetchParams.controller.resume = async () => {
  22869. // 1. While true
  22870. while (true) {
  22871. // 1-3. See onData...
  22872. // 4. Set bytes to the result of handling content codings given
  22873. // codings and bytes.
  22874. let bytes
  22875. let isFailure
  22876. try {
  22877. const { done, value } = await fetchParams.controller.next()
  22878. if (isAborted(fetchParams)) {
  22879. break
  22880. }
  22881. bytes = done ? undefined : value
  22882. } catch (err) {
  22883. if (fetchParams.controller.ended && !timingInfo.encodedBodySize) {
  22884. // zlib doesn't like empty streams.
  22885. bytes = undefined
  22886. } else {
  22887. bytes = err
  22888. // err may be propagated from the result of calling readablestream.cancel,
  22889. // which might not be an error. https://github.com/nodejs/undici/issues/2009
  22890. isFailure = true
  22891. }
  22892. }
  22893. if (bytes === undefined) {
  22894. // 2. Otherwise, if the bytes transmission for response’s message
  22895. // body is done normally and stream is readable, then close
  22896. // stream, finalize response for fetchParams and response, and
  22897. // abort these in-parallel steps.
  22898. readableStreamClose(fetchParams.controller.controller)
  22899. finalizeResponse(fetchParams, response)
  22900. return
  22901. }
  22902. // 5. Increase timingInfo’s decoded body size by bytes’s length.
  22903. timingInfo.decodedBodySize += bytes?.byteLength ?? 0
  22904. // 6. If bytes is failure, then terminate fetchParams’s controller.
  22905. if (isFailure) {
  22906. fetchParams.controller.terminate(bytes)
  22907. return
  22908. }
  22909. // 7. Enqueue a Uint8Array wrapping an ArrayBuffer containing bytes
  22910. // into stream.
  22911. fetchParams.controller.controller.enqueue(new Uint8Array(bytes))
  22912. // 8. If stream is errored, then terminate the ongoing fetch.
  22913. if (isErrored(stream)) {
  22914. fetchParams.controller.terminate()
  22915. return
  22916. }
  22917. // 9. If stream doesn’t need more data ask the user agent to suspend
  22918. // the ongoing fetch.
  22919. if (!fetchParams.controller.controller.desiredSize) {
  22920. return
  22921. }
  22922. }
  22923. }
  22924. // 2. If aborted, then:
  22925. function onAborted (reason) {
  22926. // 2. If fetchParams is aborted, then:
  22927. if (isAborted(fetchParams)) {
  22928. // 1. Set response’s aborted flag.
  22929. response.aborted = true
  22930. // 2. If stream is readable, then error stream with the result of
  22931. // deserialize a serialized abort reason given fetchParams’s
  22932. // controller’s serialized abort reason and an
  22933. // implementation-defined realm.
  22934. if (isReadable(stream)) {
  22935. fetchParams.controller.controller.error(
  22936. fetchParams.controller.serializedAbortReason
  22937. )
  22938. }
  22939. } else {
  22940. // 3. Otherwise, if stream is readable, error stream with a TypeError.
  22941. if (isReadable(stream)) {
  22942. fetchParams.controller.controller.error(new TypeError('terminated', {
  22943. cause: isErrorLike(reason) ? reason : undefined
  22944. }))
  22945. }
  22946. }
  22947. // 4. If connection uses HTTP/2, then transmit an RST_STREAM frame.
  22948. // 5. Otherwise, the user agent should close connection unless it would be bad for performance to do so.
  22949. fetchParams.controller.connection.destroy()
  22950. }
  22951. // 20. Return response.
  22952. return response
  22953. async function dispatch ({ body }) {
  22954. const url = requestCurrentURL(request)
  22955. /** @type {import('../..').Agent} */
  22956. const agent = fetchParams.controller.dispatcher
  22957. return new Promise((resolve, reject) => agent.dispatch(
  22958. {
  22959. path: url.pathname + url.search,
  22960. origin: url.origin,
  22961. method: request.method,
  22962. body: fetchParams.controller.dispatcher.isMockActive ? request.body && (request.body.source || request.body.stream) : body,
  22963. headers: request.headersList.entries,
  22964. maxRedirections: 0,
  22965. upgrade: request.mode === 'websocket' ? 'websocket' : undefined
  22966. },
  22967. {
  22968. body: null,
  22969. abort: null,
  22970. onConnect (abort) {
  22971. // TODO (fix): Do we need connection here?
  22972. const { connection } = fetchParams.controller
  22973. if (connection.destroyed) {
  22974. abort(new DOMException('The operation was aborted.', 'AbortError'))
  22975. } else {
  22976. fetchParams.controller.on('terminated', abort)
  22977. this.abort = connection.abort = abort
  22978. }
  22979. },
  22980. onHeaders (status, headersList, resume, statusText) {
  22981. if (status < 200) {
  22982. return
  22983. }
  22984. let codings = []
  22985. let location = ''
  22986. const headers = new Headers()
  22987. // For H2, the headers are a plain JS object
  22988. // We distinguish between them and iterate accordingly
  22989. if (Array.isArray(headersList)) {
  22990. for (let n = 0; n < headersList.length; n += 2) {
  22991. const key = headersList[n + 0].toString('latin1')
  22992. const val = headersList[n + 1].toString('latin1')
  22993. if (key.toLowerCase() === 'content-encoding') {
  22994. // https://www.rfc-editor.org/rfc/rfc7231#section-3.1.2.1
  22995. // "All content-coding values are case-insensitive..."
  22996. codings = val.toLowerCase().split(',').map((x) => x.trim())
  22997. } else if (key.toLowerCase() === 'location') {
  22998. location = val
  22999. }
  23000. headers[kHeadersList].append(key, val)
  23001. }
  23002. } else {
  23003. const keys = Object.keys(headersList)
  23004. for (const key of keys) {
  23005. const val = headersList[key]
  23006. if (key.toLowerCase() === 'content-encoding') {
  23007. // https://www.rfc-editor.org/rfc/rfc7231#section-3.1.2.1
  23008. // "All content-coding values are case-insensitive..."
  23009. codings = val.toLowerCase().split(',').map((x) => x.trim()).reverse()
  23010. } else if (key.toLowerCase() === 'location') {
  23011. location = val
  23012. }
  23013. headers[kHeadersList].append(key, val)
  23014. }
  23015. }
  23016. this.body = new Readable({ read: resume })
  23017. const decoders = []
  23018. const willFollow = request.redirect === 'follow' &&
  23019. location &&
  23020. redirectStatusSet.has(status)
  23021. // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Encoding
  23022. if (request.method !== 'HEAD' && request.method !== 'CONNECT' && !nullBodyStatus.includes(status) && !willFollow) {
  23023. for (const coding of codings) {
  23024. // https://www.rfc-editor.org/rfc/rfc9112.html#section-7.2
  23025. if (coding === 'x-gzip' || coding === 'gzip') {
  23026. decoders.push(zlib.createGunzip({
  23027. // Be less strict when decoding compressed responses, since sometimes
  23028. // servers send slightly invalid responses that are still accepted
  23029. // by common browsers.
  23030. // Always using Z_SYNC_FLUSH is what cURL does.
  23031. flush: zlib.constants.Z_SYNC_FLUSH,
  23032. finishFlush: zlib.constants.Z_SYNC_FLUSH
  23033. }))
  23034. } else if (coding === 'deflate') {
  23035. decoders.push(zlib.createInflate())
  23036. } else if (coding === 'br') {
  23037. decoders.push(zlib.createBrotliDecompress())
  23038. } else {
  23039. decoders.length = 0
  23040. break
  23041. }
  23042. }
  23043. }
  23044. resolve({
  23045. status,
  23046. statusText,
  23047. headersList: headers[kHeadersList],
  23048. body: decoders.length
  23049. ? pipeline(this.body, ...decoders, () => { })
  23050. : this.body.on('error', () => {})
  23051. })
  23052. return true
  23053. },
  23054. onData (chunk) {
  23055. if (fetchParams.controller.dump) {
  23056. return
  23057. }
  23058. // 1. If one or more bytes have been transmitted from response’s
  23059. // message body, then:
  23060. // 1. Let bytes be the transmitted bytes.
  23061. const bytes = chunk
  23062. // 2. Let codings be the result of extracting header list values
  23063. // given `Content-Encoding` and response’s header list.
  23064. // See pullAlgorithm.
  23065. // 3. Increase timingInfo’s encoded body size by bytes’s length.
  23066. timingInfo.encodedBodySize += bytes.byteLength
  23067. // 4. See pullAlgorithm...
  23068. return this.body.push(bytes)
  23069. },
  23070. onComplete () {
  23071. if (this.abort) {
  23072. fetchParams.controller.off('terminated', this.abort)
  23073. }
  23074. fetchParams.controller.ended = true
  23075. this.body.push(null)
  23076. },
  23077. onError (error) {
  23078. if (this.abort) {
  23079. fetchParams.controller.off('terminated', this.abort)
  23080. }
  23081. this.body?.destroy(error)
  23082. fetchParams.controller.terminate(error)
  23083. reject(error)
  23084. },
  23085. onUpgrade (status, headersList, socket) {
  23086. if (status !== 101) {
  23087. return
  23088. }
  23089. const headers = new Headers()
  23090. for (let n = 0; n < headersList.length; n += 2) {
  23091. const key = headersList[n + 0].toString('latin1')
  23092. const val = headersList[n + 1].toString('latin1')
  23093. headers[kHeadersList].append(key, val)
  23094. }
  23095. resolve({
  23096. status,
  23097. statusText: STATUS_CODES[status],
  23098. headersList: headers[kHeadersList],
  23099. socket
  23100. })
  23101. return true
  23102. }
  23103. }
  23104. ))
  23105. }
  23106. }
  23107. module.exports = {
  23108. fetch,
  23109. Fetch,
  23110. fetching,
  23111. finalizeAndReportTiming
  23112. }
  23113. /***/ }),
  23114. /***/ 8359:
  23115. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  23116. "use strict";
  23117. /* globals AbortController */
  23118. const { extractBody, mixinBody, cloneBody } = __nccwpck_require__(9990)
  23119. const { Headers, fill: fillHeaders, HeadersList } = __nccwpck_require__(554)
  23120. const { FinalizationRegistry } = __nccwpck_require__(6436)()
  23121. const util = __nccwpck_require__(3983)
  23122. const {
  23123. isValidHTTPToken,
  23124. sameOrigin,
  23125. normalizeMethod,
  23126. makePolicyContainer,
  23127. normalizeMethodRecord
  23128. } = __nccwpck_require__(2538)
  23129. const {
  23130. forbiddenMethodsSet,
  23131. corsSafeListedMethodsSet,
  23132. referrerPolicy,
  23133. requestRedirect,
  23134. requestMode,
  23135. requestCredentials,
  23136. requestCache,
  23137. requestDuplex
  23138. } = __nccwpck_require__(1037)
  23139. const { kEnumerableProperty } = util
  23140. const { kHeaders, kSignal, kState, kGuard, kRealm } = __nccwpck_require__(5861)
  23141. const { webidl } = __nccwpck_require__(1744)
  23142. const { getGlobalOrigin } = __nccwpck_require__(1246)
  23143. const { URLSerializer } = __nccwpck_require__(685)
  23144. const { kHeadersList, kConstruct } = __nccwpck_require__(2785)
  23145. const assert = __nccwpck_require__(9491)
  23146. const { getMaxListeners, setMaxListeners, getEventListeners, defaultMaxListeners } = __nccwpck_require__(2361)
  23147. let TransformStream = globalThis.TransformStream
  23148. const kAbortController = Symbol('abortController')
  23149. const requestFinalizer = new FinalizationRegistry(({ signal, abort }) => {
  23150. signal.removeEventListener('abort', abort)
  23151. })
  23152. // https://fetch.spec.whatwg.org/#request-class
  23153. class Request {
  23154. // https://fetch.spec.whatwg.org/#dom-request
  23155. constructor (input, init = {}) {
  23156. if (input === kConstruct) {
  23157. return
  23158. }
  23159. webidl.argumentLengthCheck(arguments, 1, { header: 'Request constructor' })
  23160. input = webidl.converters.RequestInfo(input)
  23161. init = webidl.converters.RequestInit(init)
  23162. // https://html.spec.whatwg.org/multipage/webappapis.html#environment-settings-object
  23163. this[kRealm] = {
  23164. settingsObject: {
  23165. baseUrl: getGlobalOrigin(),
  23166. get origin () {
  23167. return this.baseUrl?.origin
  23168. },
  23169. policyContainer: makePolicyContainer()
  23170. }
  23171. }
  23172. // 1. Let request be null.
  23173. let request = null
  23174. // 2. Let fallbackMode be null.
  23175. let fallbackMode = null
  23176. // 3. Let baseURL be this’s relevant settings object’s API base URL.
  23177. const baseUrl = this[kRealm].settingsObject.baseUrl
  23178. // 4. Let signal be null.
  23179. let signal = null
  23180. // 5. If input is a string, then:
  23181. if (typeof input === 'string') {
  23182. // 1. Let parsedURL be the result of parsing input with baseURL.
  23183. // 2. If parsedURL is failure, then throw a TypeError.
  23184. let parsedURL
  23185. try {
  23186. parsedURL = new URL(input, baseUrl)
  23187. } catch (err) {
  23188. throw new TypeError('Failed to parse URL from ' + input, { cause: err })
  23189. }
  23190. // 3. If parsedURL includes credentials, then throw a TypeError.
  23191. if (parsedURL.username || parsedURL.password) {
  23192. throw new TypeError(
  23193. 'Request cannot be constructed from a URL that includes credentials: ' +
  23194. input
  23195. )
  23196. }
  23197. // 4. Set request to a new request whose URL is parsedURL.
  23198. request = makeRequest({ urlList: [parsedURL] })
  23199. // 5. Set fallbackMode to "cors".
  23200. fallbackMode = 'cors'
  23201. } else {
  23202. // 6. Otherwise:
  23203. // 7. Assert: input is a Request object.
  23204. assert(input instanceof Request)
  23205. // 8. Set request to input’s request.
  23206. request = input[kState]
  23207. // 9. Set signal to input’s signal.
  23208. signal = input[kSignal]
  23209. }
  23210. // 7. Let origin be this’s relevant settings object’s origin.
  23211. const origin = this[kRealm].settingsObject.origin
  23212. // 8. Let window be "client".
  23213. let window = 'client'
  23214. // 9. If request’s window is an environment settings object and its origin
  23215. // is same origin with origin, then set window to request’s window.
  23216. if (
  23217. request.window?.constructor?.name === 'EnvironmentSettingsObject' &&
  23218. sameOrigin(request.window, origin)
  23219. ) {
  23220. window = request.window
  23221. }
  23222. // 10. If init["window"] exists and is non-null, then throw a TypeError.
  23223. if (init.window != null) {
  23224. throw new TypeError(`'window' option '${window}' must be null`)
  23225. }
  23226. // 11. If init["window"] exists, then set window to "no-window".
  23227. if ('window' in init) {
  23228. window = 'no-window'
  23229. }
  23230. // 12. Set request to a new request with the following properties:
  23231. request = makeRequest({
  23232. // URL request’s URL.
  23233. // undici implementation note: this is set as the first item in request's urlList in makeRequest
  23234. // method request’s method.
  23235. method: request.method,
  23236. // header list A copy of request’s header list.
  23237. // undici implementation note: headersList is cloned in makeRequest
  23238. headersList: request.headersList,
  23239. // unsafe-request flag Set.
  23240. unsafeRequest: request.unsafeRequest,
  23241. // client This’s relevant settings object.
  23242. client: this[kRealm].settingsObject,
  23243. // window window.
  23244. window,
  23245. // priority request’s priority.
  23246. priority: request.priority,
  23247. // origin request’s origin. The propagation of the origin is only significant for navigation requests
  23248. // being handled by a service worker. In this scenario a request can have an origin that is different
  23249. // from the current client.
  23250. origin: request.origin,
  23251. // referrer request’s referrer.
  23252. referrer: request.referrer,
  23253. // referrer policy request’s referrer policy.
  23254. referrerPolicy: request.referrerPolicy,
  23255. // mode request’s mode.
  23256. mode: request.mode,
  23257. // credentials mode request’s credentials mode.
  23258. credentials: request.credentials,
  23259. // cache mode request’s cache mode.
  23260. cache: request.cache,
  23261. // redirect mode request’s redirect mode.
  23262. redirect: request.redirect,
  23263. // integrity metadata request’s integrity metadata.
  23264. integrity: request.integrity,
  23265. // keepalive request’s keepalive.
  23266. keepalive: request.keepalive,
  23267. // reload-navigation flag request’s reload-navigation flag.
  23268. reloadNavigation: request.reloadNavigation,
  23269. // history-navigation flag request’s history-navigation flag.
  23270. historyNavigation: request.historyNavigation,
  23271. // URL list A clone of request’s URL list.
  23272. urlList: [...request.urlList]
  23273. })
  23274. const initHasKey = Object.keys(init).length !== 0
  23275. // 13. If init is not empty, then:
  23276. if (initHasKey) {
  23277. // 1. If request’s mode is "navigate", then set it to "same-origin".
  23278. if (request.mode === 'navigate') {
  23279. request.mode = 'same-origin'
  23280. }
  23281. // 2. Unset request’s reload-navigation flag.
  23282. request.reloadNavigation = false
  23283. // 3. Unset request’s history-navigation flag.
  23284. request.historyNavigation = false
  23285. // 4. Set request’s origin to "client".
  23286. request.origin = 'client'
  23287. // 5. Set request’s referrer to "client"
  23288. request.referrer = 'client'
  23289. // 6. Set request’s referrer policy to the empty string.
  23290. request.referrerPolicy = ''
  23291. // 7. Set request’s URL to request’s current URL.
  23292. request.url = request.urlList[request.urlList.length - 1]
  23293. // 8. Set request’s URL list to « request’s URL ».
  23294. request.urlList = [request.url]
  23295. }
  23296. // 14. If init["referrer"] exists, then:
  23297. if (init.referrer !== undefined) {
  23298. // 1. Let referrer be init["referrer"].
  23299. const referrer = init.referrer
  23300. // 2. If referrer is the empty string, then set request’s referrer to "no-referrer".
  23301. if (referrer === '') {
  23302. request.referrer = 'no-referrer'
  23303. } else {
  23304. // 1. Let parsedReferrer be the result of parsing referrer with
  23305. // baseURL.
  23306. // 2. If parsedReferrer is failure, then throw a TypeError.
  23307. let parsedReferrer
  23308. try {
  23309. parsedReferrer = new URL(referrer, baseUrl)
  23310. } catch (err) {
  23311. throw new TypeError(`Referrer "${referrer}" is not a valid URL.`, { cause: err })
  23312. }
  23313. // 3. If one of the following is true
  23314. // - parsedReferrer’s scheme is "about" and path is the string "client"
  23315. // - parsedReferrer’s origin is not same origin with origin
  23316. // then set request’s referrer to "client".
  23317. if (
  23318. (parsedReferrer.protocol === 'about:' && parsedReferrer.hostname === 'client') ||
  23319. (origin && !sameOrigin(parsedReferrer, this[kRealm].settingsObject.baseUrl))
  23320. ) {
  23321. request.referrer = 'client'
  23322. } else {
  23323. // 4. Otherwise, set request’s referrer to parsedReferrer.
  23324. request.referrer = parsedReferrer
  23325. }
  23326. }
  23327. }
  23328. // 15. If init["referrerPolicy"] exists, then set request’s referrer policy
  23329. // to it.
  23330. if (init.referrerPolicy !== undefined) {
  23331. request.referrerPolicy = init.referrerPolicy
  23332. }
  23333. // 16. Let mode be init["mode"] if it exists, and fallbackMode otherwise.
  23334. let mode
  23335. if (init.mode !== undefined) {
  23336. mode = init.mode
  23337. } else {
  23338. mode = fallbackMode
  23339. }
  23340. // 17. If mode is "navigate", then throw a TypeError.
  23341. if (mode === 'navigate') {
  23342. throw webidl.errors.exception({
  23343. header: 'Request constructor',
  23344. message: 'invalid request mode navigate.'
  23345. })
  23346. }
  23347. // 18. If mode is non-null, set request’s mode to mode.
  23348. if (mode != null) {
  23349. request.mode = mode
  23350. }
  23351. // 19. If init["credentials"] exists, then set request’s credentials mode
  23352. // to it.
  23353. if (init.credentials !== undefined) {
  23354. request.credentials = init.credentials
  23355. }
  23356. // 18. If init["cache"] exists, then set request’s cache mode to it.
  23357. if (init.cache !== undefined) {
  23358. request.cache = init.cache
  23359. }
  23360. // 21. If request’s cache mode is "only-if-cached" and request’s mode is
  23361. // not "same-origin", then throw a TypeError.
  23362. if (request.cache === 'only-if-cached' && request.mode !== 'same-origin') {
  23363. throw new TypeError(
  23364. "'only-if-cached' can be set only with 'same-origin' mode"
  23365. )
  23366. }
  23367. // 22. If init["redirect"] exists, then set request’s redirect mode to it.
  23368. if (init.redirect !== undefined) {
  23369. request.redirect = init.redirect
  23370. }
  23371. // 23. If init["integrity"] exists, then set request’s integrity metadata to it.
  23372. if (init.integrity != null) {
  23373. request.integrity = String(init.integrity)
  23374. }
  23375. // 24. If init["keepalive"] exists, then set request’s keepalive to it.
  23376. if (init.keepalive !== undefined) {
  23377. request.keepalive = Boolean(init.keepalive)
  23378. }
  23379. // 25. If init["method"] exists, then:
  23380. if (init.method !== undefined) {
  23381. // 1. Let method be init["method"].
  23382. let method = init.method
  23383. // 2. If method is not a method or method is a forbidden method, then
  23384. // throw a TypeError.
  23385. if (!isValidHTTPToken(method)) {
  23386. throw new TypeError(`'${method}' is not a valid HTTP method.`)
  23387. }
  23388. if (forbiddenMethodsSet.has(method.toUpperCase())) {
  23389. throw new TypeError(`'${method}' HTTP method is unsupported.`)
  23390. }
  23391. // 3. Normalize method.
  23392. method = normalizeMethodRecord[method] ?? normalizeMethod(method)
  23393. // 4. Set request’s method to method.
  23394. request.method = method
  23395. }
  23396. // 26. If init["signal"] exists, then set signal to it.
  23397. if (init.signal !== undefined) {
  23398. signal = init.signal
  23399. }
  23400. // 27. Set this’s request to request.
  23401. this[kState] = request
  23402. // 28. Set this’s signal to a new AbortSignal object with this’s relevant
  23403. // Realm.
  23404. // TODO: could this be simplified with AbortSignal.any
  23405. // (https://dom.spec.whatwg.org/#dom-abortsignal-any)
  23406. const ac = new AbortController()
  23407. this[kSignal] = ac.signal
  23408. this[kSignal][kRealm] = this[kRealm]
  23409. // 29. If signal is not null, then make this’s signal follow signal.
  23410. if (signal != null) {
  23411. if (
  23412. !signal ||
  23413. typeof signal.aborted !== 'boolean' ||
  23414. typeof signal.addEventListener !== 'function'
  23415. ) {
  23416. throw new TypeError(
  23417. "Failed to construct 'Request': member signal is not of type AbortSignal."
  23418. )
  23419. }
  23420. if (signal.aborted) {
  23421. ac.abort(signal.reason)
  23422. } else {
  23423. // Keep a strong ref to ac while request object
  23424. // is alive. This is needed to prevent AbortController
  23425. // from being prematurely garbage collected.
  23426. // See, https://github.com/nodejs/undici/issues/1926.
  23427. this[kAbortController] = ac
  23428. const acRef = new WeakRef(ac)
  23429. const abort = function () {
  23430. const ac = acRef.deref()
  23431. if (ac !== undefined) {
  23432. ac.abort(this.reason)
  23433. }
  23434. }
  23435. // Third-party AbortControllers may not work with these.
  23436. // See, https://github.com/nodejs/undici/pull/1910#issuecomment-1464495619.
  23437. try {
  23438. // If the max amount of listeners is equal to the default, increase it
  23439. // This is only available in node >= v19.9.0
  23440. if (typeof getMaxListeners === 'function' && getMaxListeners(signal) === defaultMaxListeners) {
  23441. setMaxListeners(100, signal)
  23442. } else if (getEventListeners(signal, 'abort').length >= defaultMaxListeners) {
  23443. setMaxListeners(100, signal)
  23444. }
  23445. } catch {}
  23446. util.addAbortListener(signal, abort)
  23447. requestFinalizer.register(ac, { signal, abort })
  23448. }
  23449. }
  23450. // 30. Set this’s headers to a new Headers object with this’s relevant
  23451. // Realm, whose header list is request’s header list and guard is
  23452. // "request".
  23453. this[kHeaders] = new Headers(kConstruct)
  23454. this[kHeaders][kHeadersList] = request.headersList
  23455. this[kHeaders][kGuard] = 'request'
  23456. this[kHeaders][kRealm] = this[kRealm]
  23457. // 31. If this’s request’s mode is "no-cors", then:
  23458. if (mode === 'no-cors') {
  23459. // 1. If this’s request’s method is not a CORS-safelisted method,
  23460. // then throw a TypeError.
  23461. if (!corsSafeListedMethodsSet.has(request.method)) {
  23462. throw new TypeError(
  23463. `'${request.method} is unsupported in no-cors mode.`
  23464. )
  23465. }
  23466. // 2. Set this’s headers’s guard to "request-no-cors".
  23467. this[kHeaders][kGuard] = 'request-no-cors'
  23468. }
  23469. // 32. If init is not empty, then:
  23470. if (initHasKey) {
  23471. /** @type {HeadersList} */
  23472. const headersList = this[kHeaders][kHeadersList]
  23473. // 1. Let headers be a copy of this’s headers and its associated header
  23474. // list.
  23475. // 2. If init["headers"] exists, then set headers to init["headers"].
  23476. const headers = init.headers !== undefined ? init.headers : new HeadersList(headersList)
  23477. // 3. Empty this’s headers’s header list.
  23478. headersList.clear()
  23479. // 4. If headers is a Headers object, then for each header in its header
  23480. // list, append header’s name/header’s value to this’s headers.
  23481. if (headers instanceof HeadersList) {
  23482. for (const [key, val] of headers) {
  23483. headersList.append(key, val)
  23484. }
  23485. // Note: Copy the `set-cookie` meta-data.
  23486. headersList.cookies = headers.cookies
  23487. } else {
  23488. // 5. Otherwise, fill this’s headers with headers.
  23489. fillHeaders(this[kHeaders], headers)
  23490. }
  23491. }
  23492. // 33. Let inputBody be input’s request’s body if input is a Request
  23493. // object; otherwise null.
  23494. const inputBody = input instanceof Request ? input[kState].body : null
  23495. // 34. If either init["body"] exists and is non-null or inputBody is
  23496. // non-null, and request’s method is `GET` or `HEAD`, then throw a
  23497. // TypeError.
  23498. if (
  23499. (init.body != null || inputBody != null) &&
  23500. (request.method === 'GET' || request.method === 'HEAD')
  23501. ) {
  23502. throw new TypeError('Request with GET/HEAD method cannot have body.')
  23503. }
  23504. // 35. Let initBody be null.
  23505. let initBody = null
  23506. // 36. If init["body"] exists and is non-null, then:
  23507. if (init.body != null) {
  23508. // 1. Let Content-Type be null.
  23509. // 2. Set initBody and Content-Type to the result of extracting
  23510. // init["body"], with keepalive set to request’s keepalive.
  23511. const [extractedBody, contentType] = extractBody(
  23512. init.body,
  23513. request.keepalive
  23514. )
  23515. initBody = extractedBody
  23516. // 3, If Content-Type is non-null and this’s headers’s header list does
  23517. // not contain `Content-Type`, then append `Content-Type`/Content-Type to
  23518. // this’s headers.
  23519. if (contentType && !this[kHeaders][kHeadersList].contains('content-type')) {
  23520. this[kHeaders].append('content-type', contentType)
  23521. }
  23522. }
  23523. // 37. Let inputOrInitBody be initBody if it is non-null; otherwise
  23524. // inputBody.
  23525. const inputOrInitBody = initBody ?? inputBody
  23526. // 38. If inputOrInitBody is non-null and inputOrInitBody’s source is
  23527. // null, then:
  23528. if (inputOrInitBody != null && inputOrInitBody.source == null) {
  23529. // 1. If initBody is non-null and init["duplex"] does not exist,
  23530. // then throw a TypeError.
  23531. if (initBody != null && init.duplex == null) {
  23532. throw new TypeError('RequestInit: duplex option is required when sending a body.')
  23533. }
  23534. // 2. If this’s request’s mode is neither "same-origin" nor "cors",
  23535. // then throw a TypeError.
  23536. if (request.mode !== 'same-origin' && request.mode !== 'cors') {
  23537. throw new TypeError(
  23538. 'If request is made from ReadableStream, mode should be "same-origin" or "cors"'
  23539. )
  23540. }
  23541. // 3. Set this’s request’s use-CORS-preflight flag.
  23542. request.useCORSPreflightFlag = true
  23543. }
  23544. // 39. Let finalBody be inputOrInitBody.
  23545. let finalBody = inputOrInitBody
  23546. // 40. If initBody is null and inputBody is non-null, then:
  23547. if (initBody == null && inputBody != null) {
  23548. // 1. If input is unusable, then throw a TypeError.
  23549. if (util.isDisturbed(inputBody.stream) || inputBody.stream.locked) {
  23550. throw new TypeError(
  23551. 'Cannot construct a Request with a Request object that has already been used.'
  23552. )
  23553. }
  23554. // 2. Set finalBody to the result of creating a proxy for inputBody.
  23555. if (!TransformStream) {
  23556. TransformStream = (__nccwpck_require__(5356).TransformStream)
  23557. }
  23558. // https://streams.spec.whatwg.org/#readablestream-create-a-proxy
  23559. const identityTransform = new TransformStream()
  23560. inputBody.stream.pipeThrough(identityTransform)
  23561. finalBody = {
  23562. source: inputBody.source,
  23563. length: inputBody.length,
  23564. stream: identityTransform.readable
  23565. }
  23566. }
  23567. // 41. Set this’s request’s body to finalBody.
  23568. this[kState].body = finalBody
  23569. }
  23570. // Returns request’s HTTP method, which is "GET" by default.
  23571. get method () {
  23572. webidl.brandCheck(this, Request)
  23573. // The method getter steps are to return this’s request’s method.
  23574. return this[kState].method
  23575. }
  23576. // Returns the URL of request as a string.
  23577. get url () {
  23578. webidl.brandCheck(this, Request)
  23579. // The url getter steps are to return this’s request’s URL, serialized.
  23580. return URLSerializer(this[kState].url)
  23581. }
  23582. // Returns a Headers object consisting of the headers associated with request.
  23583. // Note that headers added in the network layer by the user agent will not
  23584. // be accounted for in this object, e.g., the "Host" header.
  23585. get headers () {
  23586. webidl.brandCheck(this, Request)
  23587. // The headers getter steps are to return this’s headers.
  23588. return this[kHeaders]
  23589. }
  23590. // Returns the kind of resource requested by request, e.g., "document"
  23591. // or "script".
  23592. get destination () {
  23593. webidl.brandCheck(this, Request)
  23594. // The destination getter are to return this’s request’s destination.
  23595. return this[kState].destination
  23596. }
  23597. // Returns the referrer of request. Its value can be a same-origin URL if
  23598. // explicitly set in init, the empty string to indicate no referrer, and
  23599. // "about:client" when defaulting to the global’s default. This is used
  23600. // during fetching to determine the value of the `Referer` header of the
  23601. // request being made.
  23602. get referrer () {
  23603. webidl.brandCheck(this, Request)
  23604. // 1. If this’s request’s referrer is "no-referrer", then return the
  23605. // empty string.
  23606. if (this[kState].referrer === 'no-referrer') {
  23607. return ''
  23608. }
  23609. // 2. If this’s request’s referrer is "client", then return
  23610. // "about:client".
  23611. if (this[kState].referrer === 'client') {
  23612. return 'about:client'
  23613. }
  23614. // Return this’s request’s referrer, serialized.
  23615. return this[kState].referrer.toString()
  23616. }
  23617. // Returns the referrer policy associated with request.
  23618. // This is used during fetching to compute the value of the request’s
  23619. // referrer.
  23620. get referrerPolicy () {
  23621. webidl.brandCheck(this, Request)
  23622. // The referrerPolicy getter steps are to return this’s request’s referrer policy.
  23623. return this[kState].referrerPolicy
  23624. }
  23625. // Returns the mode associated with request, which is a string indicating
  23626. // whether the request will use CORS, or will be restricted to same-origin
  23627. // URLs.
  23628. get mode () {
  23629. webidl.brandCheck(this, Request)
  23630. // The mode getter steps are to return this’s request’s mode.
  23631. return this[kState].mode
  23632. }
  23633. // Returns the credentials mode associated with request,
  23634. // which is a string indicating whether credentials will be sent with the
  23635. // request always, never, or only when sent to a same-origin URL.
  23636. get credentials () {
  23637. // The credentials getter steps are to return this’s request’s credentials mode.
  23638. return this[kState].credentials
  23639. }
  23640. // Returns the cache mode associated with request,
  23641. // which is a string indicating how the request will
  23642. // interact with the browser’s cache when fetching.
  23643. get cache () {
  23644. webidl.brandCheck(this, Request)
  23645. // The cache getter steps are to return this’s request’s cache mode.
  23646. return this[kState].cache
  23647. }
  23648. // Returns the redirect mode associated with request,
  23649. // which is a string indicating how redirects for the
  23650. // request will be handled during fetching. A request
  23651. // will follow redirects by default.
  23652. get redirect () {
  23653. webidl.brandCheck(this, Request)
  23654. // The redirect getter steps are to return this’s request’s redirect mode.
  23655. return this[kState].redirect
  23656. }
  23657. // Returns request’s subresource integrity metadata, which is a
  23658. // cryptographic hash of the resource being fetched. Its value
  23659. // consists of multiple hashes separated by whitespace. [SRI]
  23660. get integrity () {
  23661. webidl.brandCheck(this, Request)
  23662. // The integrity getter steps are to return this’s request’s integrity
  23663. // metadata.
  23664. return this[kState].integrity
  23665. }
  23666. // Returns a boolean indicating whether or not request can outlive the
  23667. // global in which it was created.
  23668. get keepalive () {
  23669. webidl.brandCheck(this, Request)
  23670. // The keepalive getter steps are to return this’s request’s keepalive.
  23671. return this[kState].keepalive
  23672. }
  23673. // Returns a boolean indicating whether or not request is for a reload
  23674. // navigation.
  23675. get isReloadNavigation () {
  23676. webidl.brandCheck(this, Request)
  23677. // The isReloadNavigation getter steps are to return true if this’s
  23678. // request’s reload-navigation flag is set; otherwise false.
  23679. return this[kState].reloadNavigation
  23680. }
  23681. // Returns a boolean indicating whether or not request is for a history
  23682. // navigation (a.k.a. back-foward navigation).
  23683. get isHistoryNavigation () {
  23684. webidl.brandCheck(this, Request)
  23685. // The isHistoryNavigation getter steps are to return true if this’s request’s
  23686. // history-navigation flag is set; otherwise false.
  23687. return this[kState].historyNavigation
  23688. }
  23689. // Returns the signal associated with request, which is an AbortSignal
  23690. // object indicating whether or not request has been aborted, and its
  23691. // abort event handler.
  23692. get signal () {
  23693. webidl.brandCheck(this, Request)
  23694. // The signal getter steps are to return this’s signal.
  23695. return this[kSignal]
  23696. }
  23697. get body () {
  23698. webidl.brandCheck(this, Request)
  23699. return this[kState].body ? this[kState].body.stream : null
  23700. }
  23701. get bodyUsed () {
  23702. webidl.brandCheck(this, Request)
  23703. return !!this[kState].body && util.isDisturbed(this[kState].body.stream)
  23704. }
  23705. get duplex () {
  23706. webidl.brandCheck(this, Request)
  23707. return 'half'
  23708. }
  23709. // Returns a clone of request.
  23710. clone () {
  23711. webidl.brandCheck(this, Request)
  23712. // 1. If this is unusable, then throw a TypeError.
  23713. if (this.bodyUsed || this.body?.locked) {
  23714. throw new TypeError('unusable')
  23715. }
  23716. // 2. Let clonedRequest be the result of cloning this’s request.
  23717. const clonedRequest = cloneRequest(this[kState])
  23718. // 3. Let clonedRequestObject be the result of creating a Request object,
  23719. // given clonedRequest, this’s headers’s guard, and this’s relevant Realm.
  23720. const clonedRequestObject = new Request(kConstruct)
  23721. clonedRequestObject[kState] = clonedRequest
  23722. clonedRequestObject[kRealm] = this[kRealm]
  23723. clonedRequestObject[kHeaders] = new Headers(kConstruct)
  23724. clonedRequestObject[kHeaders][kHeadersList] = clonedRequest.headersList
  23725. clonedRequestObject[kHeaders][kGuard] = this[kHeaders][kGuard]
  23726. clonedRequestObject[kHeaders][kRealm] = this[kHeaders][kRealm]
  23727. // 4. Make clonedRequestObject’s signal follow this’s signal.
  23728. const ac = new AbortController()
  23729. if (this.signal.aborted) {
  23730. ac.abort(this.signal.reason)
  23731. } else {
  23732. util.addAbortListener(
  23733. this.signal,
  23734. () => {
  23735. ac.abort(this.signal.reason)
  23736. }
  23737. )
  23738. }
  23739. clonedRequestObject[kSignal] = ac.signal
  23740. // 4. Return clonedRequestObject.
  23741. return clonedRequestObject
  23742. }
  23743. }
  23744. mixinBody(Request)
  23745. function makeRequest (init) {
  23746. // https://fetch.spec.whatwg.org/#requests
  23747. const request = {
  23748. method: 'GET',
  23749. localURLsOnly: false,
  23750. unsafeRequest: false,
  23751. body: null,
  23752. client: null,
  23753. reservedClient: null,
  23754. replacesClientId: '',
  23755. window: 'client',
  23756. keepalive: false,
  23757. serviceWorkers: 'all',
  23758. initiator: '',
  23759. destination: '',
  23760. priority: null,
  23761. origin: 'client',
  23762. policyContainer: 'client',
  23763. referrer: 'client',
  23764. referrerPolicy: '',
  23765. mode: 'no-cors',
  23766. useCORSPreflightFlag: false,
  23767. credentials: 'same-origin',
  23768. useCredentials: false,
  23769. cache: 'default',
  23770. redirect: 'follow',
  23771. integrity: '',
  23772. cryptoGraphicsNonceMetadata: '',
  23773. parserMetadata: '',
  23774. reloadNavigation: false,
  23775. historyNavigation: false,
  23776. userActivation: false,
  23777. taintedOrigin: false,
  23778. redirectCount: 0,
  23779. responseTainting: 'basic',
  23780. preventNoCacheCacheControlHeaderModification: false,
  23781. done: false,
  23782. timingAllowFailed: false,
  23783. ...init,
  23784. headersList: init.headersList
  23785. ? new HeadersList(init.headersList)
  23786. : new HeadersList()
  23787. }
  23788. request.url = request.urlList[0]
  23789. return request
  23790. }
  23791. // https://fetch.spec.whatwg.org/#concept-request-clone
  23792. function cloneRequest (request) {
  23793. // To clone a request request, run these steps:
  23794. // 1. Let newRequest be a copy of request, except for its body.
  23795. const newRequest = makeRequest({ ...request, body: null })
  23796. // 2. If request’s body is non-null, set newRequest’s body to the
  23797. // result of cloning request’s body.
  23798. if (request.body != null) {
  23799. newRequest.body = cloneBody(request.body)
  23800. }
  23801. // 3. Return newRequest.
  23802. return newRequest
  23803. }
  23804. Object.defineProperties(Request.prototype, {
  23805. method: kEnumerableProperty,
  23806. url: kEnumerableProperty,
  23807. headers: kEnumerableProperty,
  23808. redirect: kEnumerableProperty,
  23809. clone: kEnumerableProperty,
  23810. signal: kEnumerableProperty,
  23811. duplex: kEnumerableProperty,
  23812. destination: kEnumerableProperty,
  23813. body: kEnumerableProperty,
  23814. bodyUsed: kEnumerableProperty,
  23815. isHistoryNavigation: kEnumerableProperty,
  23816. isReloadNavigation: kEnumerableProperty,
  23817. keepalive: kEnumerableProperty,
  23818. integrity: kEnumerableProperty,
  23819. cache: kEnumerableProperty,
  23820. credentials: kEnumerableProperty,
  23821. attribute: kEnumerableProperty,
  23822. referrerPolicy: kEnumerableProperty,
  23823. referrer: kEnumerableProperty,
  23824. mode: kEnumerableProperty,
  23825. [Symbol.toStringTag]: {
  23826. value: 'Request',
  23827. configurable: true
  23828. }
  23829. })
  23830. webidl.converters.Request = webidl.interfaceConverter(
  23831. Request
  23832. )
  23833. // https://fetch.spec.whatwg.org/#requestinfo
  23834. webidl.converters.RequestInfo = function (V) {
  23835. if (typeof V === 'string') {
  23836. return webidl.converters.USVString(V)
  23837. }
  23838. if (V instanceof Request) {
  23839. return webidl.converters.Request(V)
  23840. }
  23841. return webidl.converters.USVString(V)
  23842. }
  23843. webidl.converters.AbortSignal = webidl.interfaceConverter(
  23844. AbortSignal
  23845. )
  23846. // https://fetch.spec.whatwg.org/#requestinit
  23847. webidl.converters.RequestInit = webidl.dictionaryConverter([
  23848. {
  23849. key: 'method',
  23850. converter: webidl.converters.ByteString
  23851. },
  23852. {
  23853. key: 'headers',
  23854. converter: webidl.converters.HeadersInit
  23855. },
  23856. {
  23857. key: 'body',
  23858. converter: webidl.nullableConverter(
  23859. webidl.converters.BodyInit
  23860. )
  23861. },
  23862. {
  23863. key: 'referrer',
  23864. converter: webidl.converters.USVString
  23865. },
  23866. {
  23867. key: 'referrerPolicy',
  23868. converter: webidl.converters.DOMString,
  23869. // https://w3c.github.io/webappsec-referrer-policy/#referrer-policy
  23870. allowedValues: referrerPolicy
  23871. },
  23872. {
  23873. key: 'mode',
  23874. converter: webidl.converters.DOMString,
  23875. // https://fetch.spec.whatwg.org/#concept-request-mode
  23876. allowedValues: requestMode
  23877. },
  23878. {
  23879. key: 'credentials',
  23880. converter: webidl.converters.DOMString,
  23881. // https://fetch.spec.whatwg.org/#requestcredentials
  23882. allowedValues: requestCredentials
  23883. },
  23884. {
  23885. key: 'cache',
  23886. converter: webidl.converters.DOMString,
  23887. // https://fetch.spec.whatwg.org/#requestcache
  23888. allowedValues: requestCache
  23889. },
  23890. {
  23891. key: 'redirect',
  23892. converter: webidl.converters.DOMString,
  23893. // https://fetch.spec.whatwg.org/#requestredirect
  23894. allowedValues: requestRedirect
  23895. },
  23896. {
  23897. key: 'integrity',
  23898. converter: webidl.converters.DOMString
  23899. },
  23900. {
  23901. key: 'keepalive',
  23902. converter: webidl.converters.boolean
  23903. },
  23904. {
  23905. key: 'signal',
  23906. converter: webidl.nullableConverter(
  23907. (signal) => webidl.converters.AbortSignal(
  23908. signal,
  23909. { strict: false }
  23910. )
  23911. )
  23912. },
  23913. {
  23914. key: 'window',
  23915. converter: webidl.converters.any
  23916. },
  23917. {
  23918. key: 'duplex',
  23919. converter: webidl.converters.DOMString,
  23920. allowedValues: requestDuplex
  23921. }
  23922. ])
  23923. module.exports = { Request, makeRequest }
  23924. /***/ }),
  23925. /***/ 7823:
  23926. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  23927. "use strict";
  23928. const { Headers, HeadersList, fill } = __nccwpck_require__(554)
  23929. const { extractBody, cloneBody, mixinBody } = __nccwpck_require__(9990)
  23930. const util = __nccwpck_require__(3983)
  23931. const { kEnumerableProperty } = util
  23932. const {
  23933. isValidReasonPhrase,
  23934. isCancelled,
  23935. isAborted,
  23936. isBlobLike,
  23937. serializeJavascriptValueToJSONString,
  23938. isErrorLike,
  23939. isomorphicEncode
  23940. } = __nccwpck_require__(2538)
  23941. const {
  23942. redirectStatusSet,
  23943. nullBodyStatus,
  23944. DOMException
  23945. } = __nccwpck_require__(1037)
  23946. const { kState, kHeaders, kGuard, kRealm } = __nccwpck_require__(5861)
  23947. const { webidl } = __nccwpck_require__(1744)
  23948. const { FormData } = __nccwpck_require__(2015)
  23949. const { getGlobalOrigin } = __nccwpck_require__(1246)
  23950. const { URLSerializer } = __nccwpck_require__(685)
  23951. const { kHeadersList, kConstruct } = __nccwpck_require__(2785)
  23952. const assert = __nccwpck_require__(9491)
  23953. const { types } = __nccwpck_require__(3837)
  23954. const ReadableStream = globalThis.ReadableStream || (__nccwpck_require__(5356).ReadableStream)
  23955. const textEncoder = new TextEncoder('utf-8')
  23956. // https://fetch.spec.whatwg.org/#response-class
  23957. class Response {
  23958. // Creates network error Response.
  23959. static error () {
  23960. // TODO
  23961. const relevantRealm = { settingsObject: {} }
  23962. // The static error() method steps are to return the result of creating a
  23963. // Response object, given a new network error, "immutable", and this’s
  23964. // relevant Realm.
  23965. const responseObject = new Response()
  23966. responseObject[kState] = makeNetworkError()
  23967. responseObject[kRealm] = relevantRealm
  23968. responseObject[kHeaders][kHeadersList] = responseObject[kState].headersList
  23969. responseObject[kHeaders][kGuard] = 'immutable'
  23970. responseObject[kHeaders][kRealm] = relevantRealm
  23971. return responseObject
  23972. }
  23973. // https://fetch.spec.whatwg.org/#dom-response-json
  23974. static json (data, init = {}) {
  23975. webidl.argumentLengthCheck(arguments, 1, { header: 'Response.json' })
  23976. if (init !== null) {
  23977. init = webidl.converters.ResponseInit(init)
  23978. }
  23979. // 1. Let bytes the result of running serialize a JavaScript value to JSON bytes on data.
  23980. const bytes = textEncoder.encode(
  23981. serializeJavascriptValueToJSONString(data)
  23982. )
  23983. // 2. Let body be the result of extracting bytes.
  23984. const body = extractBody(bytes)
  23985. // 3. Let responseObject be the result of creating a Response object, given a new response,
  23986. // "response", and this’s relevant Realm.
  23987. const relevantRealm = { settingsObject: {} }
  23988. const responseObject = new Response()
  23989. responseObject[kRealm] = relevantRealm
  23990. responseObject[kHeaders][kGuard] = 'response'
  23991. responseObject[kHeaders][kRealm] = relevantRealm
  23992. // 4. Perform initialize a response given responseObject, init, and (body, "application/json").
  23993. initializeResponse(responseObject, init, { body: body[0], type: 'application/json' })
  23994. // 5. Return responseObject.
  23995. return responseObject
  23996. }
  23997. // Creates a redirect Response that redirects to url with status status.
  23998. static redirect (url, status = 302) {
  23999. const relevantRealm = { settingsObject: {} }
  24000. webidl.argumentLengthCheck(arguments, 1, { header: 'Response.redirect' })
  24001. url = webidl.converters.USVString(url)
  24002. status = webidl.converters['unsigned short'](status)
  24003. // 1. Let parsedURL be the result of parsing url with current settings
  24004. // object’s API base URL.
  24005. // 2. If parsedURL is failure, then throw a TypeError.
  24006. // TODO: base-URL?
  24007. let parsedURL
  24008. try {
  24009. parsedURL = new URL(url, getGlobalOrigin())
  24010. } catch (err) {
  24011. throw Object.assign(new TypeError('Failed to parse URL from ' + url), {
  24012. cause: err
  24013. })
  24014. }
  24015. // 3. If status is not a redirect status, then throw a RangeError.
  24016. if (!redirectStatusSet.has(status)) {
  24017. throw new RangeError('Invalid status code ' + status)
  24018. }
  24019. // 4. Let responseObject be the result of creating a Response object,
  24020. // given a new response, "immutable", and this’s relevant Realm.
  24021. const responseObject = new Response()
  24022. responseObject[kRealm] = relevantRealm
  24023. responseObject[kHeaders][kGuard] = 'immutable'
  24024. responseObject[kHeaders][kRealm] = relevantRealm
  24025. // 5. Set responseObject’s response’s status to status.
  24026. responseObject[kState].status = status
  24027. // 6. Let value be parsedURL, serialized and isomorphic encoded.
  24028. const value = isomorphicEncode(URLSerializer(parsedURL))
  24029. // 7. Append `Location`/value to responseObject’s response’s header list.
  24030. responseObject[kState].headersList.append('location', value)
  24031. // 8. Return responseObject.
  24032. return responseObject
  24033. }
  24034. // https://fetch.spec.whatwg.org/#dom-response
  24035. constructor (body = null, init = {}) {
  24036. if (body !== null) {
  24037. body = webidl.converters.BodyInit(body)
  24038. }
  24039. init = webidl.converters.ResponseInit(init)
  24040. // TODO
  24041. this[kRealm] = { settingsObject: {} }
  24042. // 1. Set this’s response to a new response.
  24043. this[kState] = makeResponse({})
  24044. // 2. Set this’s headers to a new Headers object with this’s relevant
  24045. // Realm, whose header list is this’s response’s header list and guard
  24046. // is "response".
  24047. this[kHeaders] = new Headers(kConstruct)
  24048. this[kHeaders][kGuard] = 'response'
  24049. this[kHeaders][kHeadersList] = this[kState].headersList
  24050. this[kHeaders][kRealm] = this[kRealm]
  24051. // 3. Let bodyWithType be null.
  24052. let bodyWithType = null
  24053. // 4. If body is non-null, then set bodyWithType to the result of extracting body.
  24054. if (body != null) {
  24055. const [extractedBody, type] = extractBody(body)
  24056. bodyWithType = { body: extractedBody, type }
  24057. }
  24058. // 5. Perform initialize a response given this, init, and bodyWithType.
  24059. initializeResponse(this, init, bodyWithType)
  24060. }
  24061. // Returns response’s type, e.g., "cors".
  24062. get type () {
  24063. webidl.brandCheck(this, Response)
  24064. // The type getter steps are to return this’s response’s type.
  24065. return this[kState].type
  24066. }
  24067. // Returns response’s URL, if it has one; otherwise the empty string.
  24068. get url () {
  24069. webidl.brandCheck(this, Response)
  24070. const urlList = this[kState].urlList
  24071. // The url getter steps are to return the empty string if this’s
  24072. // response’s URL is null; otherwise this’s response’s URL,
  24073. // serialized with exclude fragment set to true.
  24074. const url = urlList[urlList.length - 1] ?? null
  24075. if (url === null) {
  24076. return ''
  24077. }
  24078. return URLSerializer(url, true)
  24079. }
  24080. // Returns whether response was obtained through a redirect.
  24081. get redirected () {
  24082. webidl.brandCheck(this, Response)
  24083. // The redirected getter steps are to return true if this’s response’s URL
  24084. // list has more than one item; otherwise false.
  24085. return this[kState].urlList.length > 1
  24086. }
  24087. // Returns response’s status.
  24088. get status () {
  24089. webidl.brandCheck(this, Response)
  24090. // The status getter steps are to return this’s response’s status.
  24091. return this[kState].status
  24092. }
  24093. // Returns whether response’s status is an ok status.
  24094. get ok () {
  24095. webidl.brandCheck(this, Response)
  24096. // The ok getter steps are to return true if this’s response’s status is an
  24097. // ok status; otherwise false.
  24098. return this[kState].status >= 200 && this[kState].status <= 299
  24099. }
  24100. // Returns response’s status message.
  24101. get statusText () {
  24102. webidl.brandCheck(this, Response)
  24103. // The statusText getter steps are to return this’s response’s status
  24104. // message.
  24105. return this[kState].statusText
  24106. }
  24107. // Returns response’s headers as Headers.
  24108. get headers () {
  24109. webidl.brandCheck(this, Response)
  24110. // The headers getter steps are to return this’s headers.
  24111. return this[kHeaders]
  24112. }
  24113. get body () {
  24114. webidl.brandCheck(this, Response)
  24115. return this[kState].body ? this[kState].body.stream : null
  24116. }
  24117. get bodyUsed () {
  24118. webidl.brandCheck(this, Response)
  24119. return !!this[kState].body && util.isDisturbed(this[kState].body.stream)
  24120. }
  24121. // Returns a clone of response.
  24122. clone () {
  24123. webidl.brandCheck(this, Response)
  24124. // 1. If this is unusable, then throw a TypeError.
  24125. if (this.bodyUsed || (this.body && this.body.locked)) {
  24126. throw webidl.errors.exception({
  24127. header: 'Response.clone',
  24128. message: 'Body has already been consumed.'
  24129. })
  24130. }
  24131. // 2. Let clonedResponse be the result of cloning this’s response.
  24132. const clonedResponse = cloneResponse(this[kState])
  24133. // 3. Return the result of creating a Response object, given
  24134. // clonedResponse, this’s headers’s guard, and this’s relevant Realm.
  24135. const clonedResponseObject = new Response()
  24136. clonedResponseObject[kState] = clonedResponse
  24137. clonedResponseObject[kRealm] = this[kRealm]
  24138. clonedResponseObject[kHeaders][kHeadersList] = clonedResponse.headersList
  24139. clonedResponseObject[kHeaders][kGuard] = this[kHeaders][kGuard]
  24140. clonedResponseObject[kHeaders][kRealm] = this[kHeaders][kRealm]
  24141. return clonedResponseObject
  24142. }
  24143. }
  24144. mixinBody(Response)
  24145. Object.defineProperties(Response.prototype, {
  24146. type: kEnumerableProperty,
  24147. url: kEnumerableProperty,
  24148. status: kEnumerableProperty,
  24149. ok: kEnumerableProperty,
  24150. redirected: kEnumerableProperty,
  24151. statusText: kEnumerableProperty,
  24152. headers: kEnumerableProperty,
  24153. clone: kEnumerableProperty,
  24154. body: kEnumerableProperty,
  24155. bodyUsed: kEnumerableProperty,
  24156. [Symbol.toStringTag]: {
  24157. value: 'Response',
  24158. configurable: true
  24159. }
  24160. })
  24161. Object.defineProperties(Response, {
  24162. json: kEnumerableProperty,
  24163. redirect: kEnumerableProperty,
  24164. error: kEnumerableProperty
  24165. })
  24166. // https://fetch.spec.whatwg.org/#concept-response-clone
  24167. function cloneResponse (response) {
  24168. // To clone a response response, run these steps:
  24169. // 1. If response is a filtered response, then return a new identical
  24170. // filtered response whose internal response is a clone of response’s
  24171. // internal response.
  24172. if (response.internalResponse) {
  24173. return filterResponse(
  24174. cloneResponse(response.internalResponse),
  24175. response.type
  24176. )
  24177. }
  24178. // 2. Let newResponse be a copy of response, except for its body.
  24179. const newResponse = makeResponse({ ...response, body: null })
  24180. // 3. If response’s body is non-null, then set newResponse’s body to the
  24181. // result of cloning response’s body.
  24182. if (response.body != null) {
  24183. newResponse.body = cloneBody(response.body)
  24184. }
  24185. // 4. Return newResponse.
  24186. return newResponse
  24187. }
  24188. function makeResponse (init) {
  24189. return {
  24190. aborted: false,
  24191. rangeRequested: false,
  24192. timingAllowPassed: false,
  24193. requestIncludesCredentials: false,
  24194. type: 'default',
  24195. status: 200,
  24196. timingInfo: null,
  24197. cacheState: '',
  24198. statusText: '',
  24199. ...init,
  24200. headersList: init.headersList
  24201. ? new HeadersList(init.headersList)
  24202. : new HeadersList(),
  24203. urlList: init.urlList ? [...init.urlList] : []
  24204. }
  24205. }
  24206. function makeNetworkError (reason) {
  24207. const isError = isErrorLike(reason)
  24208. return makeResponse({
  24209. type: 'error',
  24210. status: 0,
  24211. error: isError
  24212. ? reason
  24213. : new Error(reason ? String(reason) : reason),
  24214. aborted: reason && reason.name === 'AbortError'
  24215. })
  24216. }
  24217. function makeFilteredResponse (response, state) {
  24218. state = {
  24219. internalResponse: response,
  24220. ...state
  24221. }
  24222. return new Proxy(response, {
  24223. get (target, p) {
  24224. return p in state ? state[p] : target[p]
  24225. },
  24226. set (target, p, value) {
  24227. assert(!(p in state))
  24228. target[p] = value
  24229. return true
  24230. }
  24231. })
  24232. }
  24233. // https://fetch.spec.whatwg.org/#concept-filtered-response
  24234. function filterResponse (response, type) {
  24235. // Set response to the following filtered response with response as its
  24236. // internal response, depending on request’s response tainting:
  24237. if (type === 'basic') {
  24238. // A basic filtered response is a filtered response whose type is "basic"
  24239. // and header list excludes any headers in internal response’s header list
  24240. // whose name is a forbidden response-header name.
  24241. // Note: undici does not implement forbidden response-header names
  24242. return makeFilteredResponse(response, {
  24243. type: 'basic',
  24244. headersList: response.headersList
  24245. })
  24246. } else if (type === 'cors') {
  24247. // A CORS filtered response is a filtered response whose type is "cors"
  24248. // and header list excludes any headers in internal response’s header
  24249. // list whose name is not a CORS-safelisted response-header name, given
  24250. // internal response’s CORS-exposed header-name list.
  24251. // Note: undici does not implement CORS-safelisted response-header names
  24252. return makeFilteredResponse(response, {
  24253. type: 'cors',
  24254. headersList: response.headersList
  24255. })
  24256. } else if (type === 'opaque') {
  24257. // An opaque filtered response is a filtered response whose type is
  24258. // "opaque", URL list is the empty list, status is 0, status message
  24259. // is the empty byte sequence, header list is empty, and body is null.
  24260. return makeFilteredResponse(response, {
  24261. type: 'opaque',
  24262. urlList: Object.freeze([]),
  24263. status: 0,
  24264. statusText: '',
  24265. body: null
  24266. })
  24267. } else if (type === 'opaqueredirect') {
  24268. // An opaque-redirect filtered response is a filtered response whose type
  24269. // is "opaqueredirect", status is 0, status message is the empty byte
  24270. // sequence, header list is empty, and body is null.
  24271. return makeFilteredResponse(response, {
  24272. type: 'opaqueredirect',
  24273. status: 0,
  24274. statusText: '',
  24275. headersList: [],
  24276. body: null
  24277. })
  24278. } else {
  24279. assert(false)
  24280. }
  24281. }
  24282. // https://fetch.spec.whatwg.org/#appropriate-network-error
  24283. function makeAppropriateNetworkError (fetchParams, err = null) {
  24284. // 1. Assert: fetchParams is canceled.
  24285. assert(isCancelled(fetchParams))
  24286. // 2. Return an aborted network error if fetchParams is aborted;
  24287. // otherwise return a network error.
  24288. return isAborted(fetchParams)
  24289. ? makeNetworkError(Object.assign(new DOMException('The operation was aborted.', 'AbortError'), { cause: err }))
  24290. : makeNetworkError(Object.assign(new DOMException('Request was cancelled.'), { cause: err }))
  24291. }
  24292. // https://whatpr.org/fetch/1392.html#initialize-a-response
  24293. function initializeResponse (response, init, body) {
  24294. // 1. If init["status"] is not in the range 200 to 599, inclusive, then
  24295. // throw a RangeError.
  24296. if (init.status !== null && (init.status < 200 || init.status > 599)) {
  24297. throw new RangeError('init["status"] must be in the range of 200 to 599, inclusive.')
  24298. }
  24299. // 2. If init["statusText"] does not match the reason-phrase token production,
  24300. // then throw a TypeError.
  24301. if ('statusText' in init && init.statusText != null) {
  24302. // See, https://datatracker.ietf.org/doc/html/rfc7230#section-3.1.2:
  24303. // reason-phrase = *( HTAB / SP / VCHAR / obs-text )
  24304. if (!isValidReasonPhrase(String(init.statusText))) {
  24305. throw new TypeError('Invalid statusText')
  24306. }
  24307. }
  24308. // 3. Set response’s response’s status to init["status"].
  24309. if ('status' in init && init.status != null) {
  24310. response[kState].status = init.status
  24311. }
  24312. // 4. Set response’s response’s status message to init["statusText"].
  24313. if ('statusText' in init && init.statusText != null) {
  24314. response[kState].statusText = init.statusText
  24315. }
  24316. // 5. If init["headers"] exists, then fill response’s headers with init["headers"].
  24317. if ('headers' in init && init.headers != null) {
  24318. fill(response[kHeaders], init.headers)
  24319. }
  24320. // 6. If body was given, then:
  24321. if (body) {
  24322. // 1. If response's status is a null body status, then throw a TypeError.
  24323. if (nullBodyStatus.includes(response.status)) {
  24324. throw webidl.errors.exception({
  24325. header: 'Response constructor',
  24326. message: 'Invalid response status code ' + response.status
  24327. })
  24328. }
  24329. // 2. Set response's body to body's body.
  24330. response[kState].body = body.body
  24331. // 3. If body's type is non-null and response's header list does not contain
  24332. // `Content-Type`, then append (`Content-Type`, body's type) to response's header list.
  24333. if (body.type != null && !response[kState].headersList.contains('Content-Type')) {
  24334. response[kState].headersList.append('content-type', body.type)
  24335. }
  24336. }
  24337. }
  24338. webidl.converters.ReadableStream = webidl.interfaceConverter(
  24339. ReadableStream
  24340. )
  24341. webidl.converters.FormData = webidl.interfaceConverter(
  24342. FormData
  24343. )
  24344. webidl.converters.URLSearchParams = webidl.interfaceConverter(
  24345. URLSearchParams
  24346. )
  24347. // https://fetch.spec.whatwg.org/#typedefdef-xmlhttprequestbodyinit
  24348. webidl.converters.XMLHttpRequestBodyInit = function (V) {
  24349. if (typeof V === 'string') {
  24350. return webidl.converters.USVString(V)
  24351. }
  24352. if (isBlobLike(V)) {
  24353. return webidl.converters.Blob(V, { strict: false })
  24354. }
  24355. if (types.isArrayBuffer(V) || types.isTypedArray(V) || types.isDataView(V)) {
  24356. return webidl.converters.BufferSource(V)
  24357. }
  24358. if (util.isFormDataLike(V)) {
  24359. return webidl.converters.FormData(V, { strict: false })
  24360. }
  24361. if (V instanceof URLSearchParams) {
  24362. return webidl.converters.URLSearchParams(V)
  24363. }
  24364. return webidl.converters.DOMString(V)
  24365. }
  24366. // https://fetch.spec.whatwg.org/#bodyinit
  24367. webidl.converters.BodyInit = function (V) {
  24368. if (V instanceof ReadableStream) {
  24369. return webidl.converters.ReadableStream(V)
  24370. }
  24371. // Note: the spec doesn't include async iterables,
  24372. // this is an undici extension.
  24373. if (V?.[Symbol.asyncIterator]) {
  24374. return V
  24375. }
  24376. return webidl.converters.XMLHttpRequestBodyInit(V)
  24377. }
  24378. webidl.converters.ResponseInit = webidl.dictionaryConverter([
  24379. {
  24380. key: 'status',
  24381. converter: webidl.converters['unsigned short'],
  24382. defaultValue: 200
  24383. },
  24384. {
  24385. key: 'statusText',
  24386. converter: webidl.converters.ByteString,
  24387. defaultValue: ''
  24388. },
  24389. {
  24390. key: 'headers',
  24391. converter: webidl.converters.HeadersInit
  24392. }
  24393. ])
  24394. module.exports = {
  24395. makeNetworkError,
  24396. makeResponse,
  24397. makeAppropriateNetworkError,
  24398. filterResponse,
  24399. Response,
  24400. cloneResponse
  24401. }
  24402. /***/ }),
  24403. /***/ 5861:
  24404. /***/ ((module) => {
  24405. "use strict";
  24406. module.exports = {
  24407. kUrl: Symbol('url'),
  24408. kHeaders: Symbol('headers'),
  24409. kSignal: Symbol('signal'),
  24410. kState: Symbol('state'),
  24411. kGuard: Symbol('guard'),
  24412. kRealm: Symbol('realm')
  24413. }
  24414. /***/ }),
  24415. /***/ 2538:
  24416. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  24417. "use strict";
  24418. const { redirectStatusSet, referrerPolicySet: referrerPolicyTokens, badPortsSet } = __nccwpck_require__(1037)
  24419. const { getGlobalOrigin } = __nccwpck_require__(1246)
  24420. const { performance } = __nccwpck_require__(4074)
  24421. const { isBlobLike, toUSVString, ReadableStreamFrom } = __nccwpck_require__(3983)
  24422. const assert = __nccwpck_require__(9491)
  24423. const { isUint8Array } = __nccwpck_require__(9830)
  24424. let supportedHashes = []
  24425. // https://nodejs.org/api/crypto.html#determining-if-crypto-support-is-unavailable
  24426. /** @type {import('crypto')|undefined} */
  24427. let crypto
  24428. try {
  24429. crypto = __nccwpck_require__(6113)
  24430. const possibleRelevantHashes = ['sha256', 'sha384', 'sha512']
  24431. supportedHashes = crypto.getHashes().filter((hash) => possibleRelevantHashes.includes(hash))
  24432. /* c8 ignore next 3 */
  24433. } catch {
  24434. }
  24435. function responseURL (response) {
  24436. // https://fetch.spec.whatwg.org/#responses
  24437. // A response has an associated URL. It is a pointer to the last URL
  24438. // in response’s URL list and null if response’s URL list is empty.
  24439. const urlList = response.urlList
  24440. const length = urlList.length
  24441. return length === 0 ? null : urlList[length - 1].toString()
  24442. }
  24443. // https://fetch.spec.whatwg.org/#concept-response-location-url
  24444. function responseLocationURL (response, requestFragment) {
  24445. // 1. If response’s status is not a redirect status, then return null.
  24446. if (!redirectStatusSet.has(response.status)) {
  24447. return null
  24448. }
  24449. // 2. Let location be the result of extracting header list values given
  24450. // `Location` and response’s header list.
  24451. let location = response.headersList.get('location')
  24452. // 3. If location is a header value, then set location to the result of
  24453. // parsing location with response’s URL.
  24454. if (location !== null && isValidHeaderValue(location)) {
  24455. location = new URL(location, responseURL(response))
  24456. }
  24457. // 4. If location is a URL whose fragment is null, then set location’s
  24458. // fragment to requestFragment.
  24459. if (location && !location.hash) {
  24460. location.hash = requestFragment
  24461. }
  24462. // 5. Return location.
  24463. return location
  24464. }
  24465. /** @returns {URL} */
  24466. function requestCurrentURL (request) {
  24467. return request.urlList[request.urlList.length - 1]
  24468. }
  24469. function requestBadPort (request) {
  24470. // 1. Let url be request’s current URL.
  24471. const url = requestCurrentURL(request)
  24472. // 2. If url’s scheme is an HTTP(S) scheme and url’s port is a bad port,
  24473. // then return blocked.
  24474. if (urlIsHttpHttpsScheme(url) && badPortsSet.has(url.port)) {
  24475. return 'blocked'
  24476. }
  24477. // 3. Return allowed.
  24478. return 'allowed'
  24479. }
  24480. function isErrorLike (object) {
  24481. return object instanceof Error || (
  24482. object?.constructor?.name === 'Error' ||
  24483. object?.constructor?.name === 'DOMException'
  24484. )
  24485. }
  24486. // Check whether |statusText| is a ByteString and
  24487. // matches the Reason-Phrase token production.
  24488. // RFC 2616: https://tools.ietf.org/html/rfc2616
  24489. // RFC 7230: https://tools.ietf.org/html/rfc7230
  24490. // "reason-phrase = *( HTAB / SP / VCHAR / obs-text )"
  24491. // https://github.com/chromium/chromium/blob/94.0.4604.1/third_party/blink/renderer/core/fetch/response.cc#L116
  24492. function isValidReasonPhrase (statusText) {
  24493. for (let i = 0; i < statusText.length; ++i) {
  24494. const c = statusText.charCodeAt(i)
  24495. if (
  24496. !(
  24497. (
  24498. c === 0x09 || // HTAB
  24499. (c >= 0x20 && c <= 0x7e) || // SP / VCHAR
  24500. (c >= 0x80 && c <= 0xff)
  24501. ) // obs-text
  24502. )
  24503. ) {
  24504. return false
  24505. }
  24506. }
  24507. return true
  24508. }
  24509. /**
  24510. * @see https://tools.ietf.org/html/rfc7230#section-3.2.6
  24511. * @param {number} c
  24512. */
  24513. function isTokenCharCode (c) {
  24514. switch (c) {
  24515. case 0x22:
  24516. case 0x28:
  24517. case 0x29:
  24518. case 0x2c:
  24519. case 0x2f:
  24520. case 0x3a:
  24521. case 0x3b:
  24522. case 0x3c:
  24523. case 0x3d:
  24524. case 0x3e:
  24525. case 0x3f:
  24526. case 0x40:
  24527. case 0x5b:
  24528. case 0x5c:
  24529. case 0x5d:
  24530. case 0x7b:
  24531. case 0x7d:
  24532. // DQUOTE and "(),/:;<=>?@[\]{}"
  24533. return false
  24534. default:
  24535. // VCHAR %x21-7E
  24536. return c >= 0x21 && c <= 0x7e
  24537. }
  24538. }
  24539. /**
  24540. * @param {string} characters
  24541. */
  24542. function isValidHTTPToken (characters) {
  24543. if (characters.length === 0) {
  24544. return false
  24545. }
  24546. for (let i = 0; i < characters.length; ++i) {
  24547. if (!isTokenCharCode(characters.charCodeAt(i))) {
  24548. return false
  24549. }
  24550. }
  24551. return true
  24552. }
  24553. /**
  24554. * @see https://fetch.spec.whatwg.org/#header-name
  24555. * @param {string} potentialValue
  24556. */
  24557. function isValidHeaderName (potentialValue) {
  24558. return isValidHTTPToken(potentialValue)
  24559. }
  24560. /**
  24561. * @see https://fetch.spec.whatwg.org/#header-value
  24562. * @param {string} potentialValue
  24563. */
  24564. function isValidHeaderValue (potentialValue) {
  24565. // - Has no leading or trailing HTTP tab or space bytes.
  24566. // - Contains no 0x00 (NUL) or HTTP newline bytes.
  24567. if (
  24568. potentialValue.startsWith('\t') ||
  24569. potentialValue.startsWith(' ') ||
  24570. potentialValue.endsWith('\t') ||
  24571. potentialValue.endsWith(' ')
  24572. ) {
  24573. return false
  24574. }
  24575. if (
  24576. potentialValue.includes('\0') ||
  24577. potentialValue.includes('\r') ||
  24578. potentialValue.includes('\n')
  24579. ) {
  24580. return false
  24581. }
  24582. return true
  24583. }
  24584. // https://w3c.github.io/webappsec-referrer-policy/#set-requests-referrer-policy-on-redirect
  24585. function setRequestReferrerPolicyOnRedirect (request, actualResponse) {
  24586. // Given a request request and a response actualResponse, this algorithm
  24587. // updates request’s referrer policy according to the Referrer-Policy
  24588. // header (if any) in actualResponse.
  24589. // 1. Let policy be the result of executing § 8.1 Parse a referrer policy
  24590. // from a Referrer-Policy header on actualResponse.
  24591. // 8.1 Parse a referrer policy from a Referrer-Policy header
  24592. // 1. Let policy-tokens be the result of extracting header list values given `Referrer-Policy` and response’s header list.
  24593. const { headersList } = actualResponse
  24594. // 2. Let policy be the empty string.
  24595. // 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.
  24596. // 4. Return policy.
  24597. const policyHeader = (headersList.get('referrer-policy') ?? '').split(',')
  24598. // Note: As the referrer-policy can contain multiple policies
  24599. // separated by comma, we need to loop through all of them
  24600. // and pick the first valid one.
  24601. // Ref: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Referrer-Policy#specify_a_fallback_policy
  24602. let policy = ''
  24603. if (policyHeader.length > 0) {
  24604. // The right-most policy takes precedence.
  24605. // The left-most policy is the fallback.
  24606. for (let i = policyHeader.length; i !== 0; i--) {
  24607. const token = policyHeader[i - 1].trim()
  24608. if (referrerPolicyTokens.has(token)) {
  24609. policy = token
  24610. break
  24611. }
  24612. }
  24613. }
  24614. // 2. If policy is not the empty string, then set request’s referrer policy to policy.
  24615. if (policy !== '') {
  24616. request.referrerPolicy = policy
  24617. }
  24618. }
  24619. // https://fetch.spec.whatwg.org/#cross-origin-resource-policy-check
  24620. function crossOriginResourcePolicyCheck () {
  24621. // TODO
  24622. return 'allowed'
  24623. }
  24624. // https://fetch.spec.whatwg.org/#concept-cors-check
  24625. function corsCheck () {
  24626. // TODO
  24627. return 'success'
  24628. }
  24629. // https://fetch.spec.whatwg.org/#concept-tao-check
  24630. function TAOCheck () {
  24631. // TODO
  24632. return 'success'
  24633. }
  24634. function appendFetchMetadata (httpRequest) {
  24635. // https://w3c.github.io/webappsec-fetch-metadata/#sec-fetch-dest-header
  24636. // TODO
  24637. // https://w3c.github.io/webappsec-fetch-metadata/#sec-fetch-mode-header
  24638. // 1. Assert: r’s url is a potentially trustworthy URL.
  24639. // TODO
  24640. // 2. Let header be a Structured Header whose value is a token.
  24641. let header = null
  24642. // 3. Set header’s value to r’s mode.
  24643. header = httpRequest.mode
  24644. // 4. Set a structured field value `Sec-Fetch-Mode`/header in r’s header list.
  24645. httpRequest.headersList.set('sec-fetch-mode', header)
  24646. // https://w3c.github.io/webappsec-fetch-metadata/#sec-fetch-site-header
  24647. // TODO
  24648. // https://w3c.github.io/webappsec-fetch-metadata/#sec-fetch-user-header
  24649. // TODO
  24650. }
  24651. // https://fetch.spec.whatwg.org/#append-a-request-origin-header
  24652. function appendRequestOriginHeader (request) {
  24653. // 1. Let serializedOrigin be the result of byte-serializing a request origin with request.
  24654. let serializedOrigin = request.origin
  24655. // 2. If request’s response tainting is "cors" or request’s mode is "websocket", then append (`Origin`, serializedOrigin) to request’s header list.
  24656. if (request.responseTainting === 'cors' || request.mode === 'websocket') {
  24657. if (serializedOrigin) {
  24658. request.headersList.append('origin', serializedOrigin)
  24659. }
  24660. // 3. Otherwise, if request’s method is neither `GET` nor `HEAD`, then:
  24661. } else if (request.method !== 'GET' && request.method !== 'HEAD') {
  24662. // 1. Switch on request’s referrer policy:
  24663. switch (request.referrerPolicy) {
  24664. case 'no-referrer':
  24665. // Set serializedOrigin to `null`.
  24666. serializedOrigin = null
  24667. break
  24668. case 'no-referrer-when-downgrade':
  24669. case 'strict-origin':
  24670. case 'strict-origin-when-cross-origin':
  24671. // 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`.
  24672. if (request.origin && urlHasHttpsScheme(request.origin) && !urlHasHttpsScheme(requestCurrentURL(request))) {
  24673. serializedOrigin = null
  24674. }
  24675. break
  24676. case 'same-origin':
  24677. // If request’s origin is not same origin with request’s current URL’s origin, then set serializedOrigin to `null`.
  24678. if (!sameOrigin(request, requestCurrentURL(request))) {
  24679. serializedOrigin = null
  24680. }
  24681. break
  24682. default:
  24683. // Do nothing.
  24684. }
  24685. if (serializedOrigin) {
  24686. // 2. Append (`Origin`, serializedOrigin) to request’s header list.
  24687. request.headersList.append('origin', serializedOrigin)
  24688. }
  24689. }
  24690. }
  24691. function coarsenedSharedCurrentTime (crossOriginIsolatedCapability) {
  24692. // TODO
  24693. return performance.now()
  24694. }
  24695. // https://fetch.spec.whatwg.org/#create-an-opaque-timing-info
  24696. function createOpaqueTimingInfo (timingInfo) {
  24697. return {
  24698. startTime: timingInfo.startTime ?? 0,
  24699. redirectStartTime: 0,
  24700. redirectEndTime: 0,
  24701. postRedirectStartTime: timingInfo.startTime ?? 0,
  24702. finalServiceWorkerStartTime: 0,
  24703. finalNetworkResponseStartTime: 0,
  24704. finalNetworkRequestStartTime: 0,
  24705. endTime: 0,
  24706. encodedBodySize: 0,
  24707. decodedBodySize: 0,
  24708. finalConnectionTimingInfo: null
  24709. }
  24710. }
  24711. // https://html.spec.whatwg.org/multipage/origin.html#policy-container
  24712. function makePolicyContainer () {
  24713. // Note: the fetch spec doesn't make use of embedder policy or CSP list
  24714. return {
  24715. referrerPolicy: 'strict-origin-when-cross-origin'
  24716. }
  24717. }
  24718. // https://html.spec.whatwg.org/multipage/origin.html#clone-a-policy-container
  24719. function clonePolicyContainer (policyContainer) {
  24720. return {
  24721. referrerPolicy: policyContainer.referrerPolicy
  24722. }
  24723. }
  24724. // https://w3c.github.io/webappsec-referrer-policy/#determine-requests-referrer
  24725. function determineRequestsReferrer (request) {
  24726. // 1. Let policy be request's referrer policy.
  24727. const policy = request.referrerPolicy
  24728. // Note: policy cannot (shouldn't) be null or an empty string.
  24729. assert(policy)
  24730. // 2. Let environment be request’s client.
  24731. let referrerSource = null
  24732. // 3. Switch on request’s referrer:
  24733. if (request.referrer === 'client') {
  24734. // Note: node isn't a browser and doesn't implement document/iframes,
  24735. // so we bypass this step and replace it with our own.
  24736. const globalOrigin = getGlobalOrigin()
  24737. if (!globalOrigin || globalOrigin.origin === 'null') {
  24738. return 'no-referrer'
  24739. }
  24740. // note: we need to clone it as it's mutated
  24741. referrerSource = new URL(globalOrigin)
  24742. } else if (request.referrer instanceof URL) {
  24743. // Let referrerSource be request’s referrer.
  24744. referrerSource = request.referrer
  24745. }
  24746. // 4. Let request’s referrerURL be the result of stripping referrerSource for
  24747. // use as a referrer.
  24748. let referrerURL = stripURLForReferrer(referrerSource)
  24749. // 5. Let referrerOrigin be the result of stripping referrerSource for use as
  24750. // a referrer, with the origin-only flag set to true.
  24751. const referrerOrigin = stripURLForReferrer(referrerSource, true)
  24752. // 6. If the result of serializing referrerURL is a string whose length is
  24753. // greater than 4096, set referrerURL to referrerOrigin.
  24754. if (referrerURL.toString().length > 4096) {
  24755. referrerURL = referrerOrigin
  24756. }
  24757. const areSameOrigin = sameOrigin(request, referrerURL)
  24758. const isNonPotentiallyTrustWorthy = isURLPotentiallyTrustworthy(referrerURL) &&
  24759. !isURLPotentiallyTrustworthy(request.url)
  24760. // 8. Execute the switch statements corresponding to the value of policy:
  24761. switch (policy) {
  24762. case 'origin': return referrerOrigin != null ? referrerOrigin : stripURLForReferrer(referrerSource, true)
  24763. case 'unsafe-url': return referrerURL
  24764. case 'same-origin':
  24765. return areSameOrigin ? referrerOrigin : 'no-referrer'
  24766. case 'origin-when-cross-origin':
  24767. return areSameOrigin ? referrerURL : referrerOrigin
  24768. case 'strict-origin-when-cross-origin': {
  24769. const currentURL = requestCurrentURL(request)
  24770. // 1. If the origin of referrerURL and the origin of request’s current
  24771. // URL are the same, then return referrerURL.
  24772. if (sameOrigin(referrerURL, currentURL)) {
  24773. return referrerURL
  24774. }
  24775. // 2. If referrerURL is a potentially trustworthy URL and request’s
  24776. // current URL is not a potentially trustworthy URL, then return no
  24777. // referrer.
  24778. if (isURLPotentiallyTrustworthy(referrerURL) && !isURLPotentiallyTrustworthy(currentURL)) {
  24779. return 'no-referrer'
  24780. }
  24781. // 3. Return referrerOrigin.
  24782. return referrerOrigin
  24783. }
  24784. case 'strict-origin': // eslint-disable-line
  24785. /**
  24786. * 1. If referrerURL is a potentially trustworthy URL and
  24787. * request’s current URL is not a potentially trustworthy URL,
  24788. * then return no referrer.
  24789. * 2. Return referrerOrigin
  24790. */
  24791. case 'no-referrer-when-downgrade': // eslint-disable-line
  24792. /**
  24793. * 1. If referrerURL is a potentially trustworthy URL and
  24794. * request’s current URL is not a potentially trustworthy URL,
  24795. * then return no referrer.
  24796. * 2. Return referrerOrigin
  24797. */
  24798. default: // eslint-disable-line
  24799. return isNonPotentiallyTrustWorthy ? 'no-referrer' : referrerOrigin
  24800. }
  24801. }
  24802. /**
  24803. * @see https://w3c.github.io/webappsec-referrer-policy/#strip-url
  24804. * @param {URL} url
  24805. * @param {boolean|undefined} originOnly
  24806. */
  24807. function stripURLForReferrer (url, originOnly) {
  24808. // 1. Assert: url is a URL.
  24809. assert(url instanceof URL)
  24810. // 2. If url’s scheme is a local scheme, then return no referrer.
  24811. if (url.protocol === 'file:' || url.protocol === 'about:' || url.protocol === 'blank:') {
  24812. return 'no-referrer'
  24813. }
  24814. // 3. Set url’s username to the empty string.
  24815. url.username = ''
  24816. // 4. Set url’s password to the empty string.
  24817. url.password = ''
  24818. // 5. Set url’s fragment to null.
  24819. url.hash = ''
  24820. // 6. If the origin-only flag is true, then:
  24821. if (originOnly) {
  24822. // 1. Set url’s path to « the empty string ».
  24823. url.pathname = ''
  24824. // 2. Set url’s query to null.
  24825. url.search = ''
  24826. }
  24827. // 7. Return url.
  24828. return url
  24829. }
  24830. function isURLPotentiallyTrustworthy (url) {
  24831. if (!(url instanceof URL)) {
  24832. return false
  24833. }
  24834. // If child of about, return true
  24835. if (url.href === 'about:blank' || url.href === 'about:srcdoc') {
  24836. return true
  24837. }
  24838. // If scheme is data, return true
  24839. if (url.protocol === 'data:') return true
  24840. // If file, return true
  24841. if (url.protocol === 'file:') return true
  24842. return isOriginPotentiallyTrustworthy(url.origin)
  24843. function isOriginPotentiallyTrustworthy (origin) {
  24844. // If origin is explicitly null, return false
  24845. if (origin == null || origin === 'null') return false
  24846. const originAsURL = new URL(origin)
  24847. // If secure, return true
  24848. if (originAsURL.protocol === 'https:' || originAsURL.protocol === 'wss:') {
  24849. return true
  24850. }
  24851. // If localhost or variants, return true
  24852. if (/^127(?:\.[0-9]+){0,2}\.[0-9]+$|^\[(?:0*:)*?:?0*1\]$/.test(originAsURL.hostname) ||
  24853. (originAsURL.hostname === 'localhost' || originAsURL.hostname.includes('localhost.')) ||
  24854. (originAsURL.hostname.endsWith('.localhost'))) {
  24855. return true
  24856. }
  24857. // If any other, return false
  24858. return false
  24859. }
  24860. }
  24861. /**
  24862. * @see https://w3c.github.io/webappsec-subresource-integrity/#does-response-match-metadatalist
  24863. * @param {Uint8Array} bytes
  24864. * @param {string} metadataList
  24865. */
  24866. function bytesMatch (bytes, metadataList) {
  24867. // If node is not built with OpenSSL support, we cannot check
  24868. // a request's integrity, so allow it by default (the spec will
  24869. // allow requests if an invalid hash is given, as precedence).
  24870. /* istanbul ignore if: only if node is built with --without-ssl */
  24871. if (crypto === undefined) {
  24872. return true
  24873. }
  24874. // 1. Let parsedMetadata be the result of parsing metadataList.
  24875. const parsedMetadata = parseMetadata(metadataList)
  24876. // 2. If parsedMetadata is no metadata, return true.
  24877. if (parsedMetadata === 'no metadata') {
  24878. return true
  24879. }
  24880. // 3. If response is not eligible for integrity validation, return false.
  24881. // TODO
  24882. // 4. If parsedMetadata is the empty set, return true.
  24883. if (parsedMetadata.length === 0) {
  24884. return true
  24885. }
  24886. // 5. Let metadata be the result of getting the strongest
  24887. // metadata from parsedMetadata.
  24888. const strongest = getStrongestMetadata(parsedMetadata)
  24889. const metadata = filterMetadataListByAlgorithm(parsedMetadata, strongest)
  24890. // 6. For each item in metadata:
  24891. for (const item of metadata) {
  24892. // 1. Let algorithm be the alg component of item.
  24893. const algorithm = item.algo
  24894. // 2. Let expectedValue be the val component of item.
  24895. const expectedValue = item.hash
  24896. // See https://github.com/web-platform-tests/wpt/commit/e4c5cc7a5e48093220528dfdd1c4012dc3837a0e
  24897. // "be liberal with padding". This is annoying, and it's not even in the spec.
  24898. // 3. Let actualValue be the result of applying algorithm to bytes.
  24899. let actualValue = crypto.createHash(algorithm).update(bytes).digest('base64')
  24900. if (actualValue[actualValue.length - 1] === '=') {
  24901. if (actualValue[actualValue.length - 2] === '=') {
  24902. actualValue = actualValue.slice(0, -2)
  24903. } else {
  24904. actualValue = actualValue.slice(0, -1)
  24905. }
  24906. }
  24907. // 4. If actualValue is a case-sensitive match for expectedValue,
  24908. // return true.
  24909. if (compareBase64Mixed(actualValue, expectedValue)) {
  24910. return true
  24911. }
  24912. }
  24913. // 7. Return false.
  24914. return false
  24915. }
  24916. // https://w3c.github.io/webappsec-subresource-integrity/#grammardef-hash-with-options
  24917. // https://www.w3.org/TR/CSP2/#source-list-syntax
  24918. // https://www.rfc-editor.org/rfc/rfc5234#appendix-B.1
  24919. const parseHashWithOptions = /(?<algo>sha256|sha384|sha512)-((?<hash>[A-Za-z0-9+/]+|[A-Za-z0-9_-]+)={0,2}(?:\s|$)( +[!-~]*)?)?/i
  24920. /**
  24921. * @see https://w3c.github.io/webappsec-subresource-integrity/#parse-metadata
  24922. * @param {string} metadata
  24923. */
  24924. function parseMetadata (metadata) {
  24925. // 1. Let result be the empty set.
  24926. /** @type {{ algo: string, hash: string }[]} */
  24927. const result = []
  24928. // 2. Let empty be equal to true.
  24929. let empty = true
  24930. // 3. For each token returned by splitting metadata on spaces:
  24931. for (const token of metadata.split(' ')) {
  24932. // 1. Set empty to false.
  24933. empty = false
  24934. // 2. Parse token as a hash-with-options.
  24935. const parsedToken = parseHashWithOptions.exec(token)
  24936. // 3. If token does not parse, continue to the next token.
  24937. if (
  24938. parsedToken === null ||
  24939. parsedToken.groups === undefined ||
  24940. parsedToken.groups.algo === undefined
  24941. ) {
  24942. // Note: Chromium blocks the request at this point, but Firefox
  24943. // gives a warning that an invalid integrity was given. The
  24944. // correct behavior is to ignore these, and subsequently not
  24945. // check the integrity of the resource.
  24946. continue
  24947. }
  24948. // 4. Let algorithm be the hash-algo component of token.
  24949. const algorithm = parsedToken.groups.algo.toLowerCase()
  24950. // 5. If algorithm is a hash function recognized by the user
  24951. // agent, add the parsed token to result.
  24952. if (supportedHashes.includes(algorithm)) {
  24953. result.push(parsedToken.groups)
  24954. }
  24955. }
  24956. // 4. Return no metadata if empty is true, otherwise return result.
  24957. if (empty === true) {
  24958. return 'no metadata'
  24959. }
  24960. return result
  24961. }
  24962. /**
  24963. * @param {{ algo: 'sha256' | 'sha384' | 'sha512' }[]} metadataList
  24964. */
  24965. function getStrongestMetadata (metadataList) {
  24966. // Let algorithm be the algo component of the first item in metadataList.
  24967. // Can be sha256
  24968. let algorithm = metadataList[0].algo
  24969. // If the algorithm is sha512, then it is the strongest
  24970. // and we can return immediately
  24971. if (algorithm[3] === '5') {
  24972. return algorithm
  24973. }
  24974. for (let i = 1; i < metadataList.length; ++i) {
  24975. const metadata = metadataList[i]
  24976. // If the algorithm is sha512, then it is the strongest
  24977. // and we can break the loop immediately
  24978. if (metadata.algo[3] === '5') {
  24979. algorithm = 'sha512'
  24980. break
  24981. // If the algorithm is sha384, then a potential sha256 or sha384 is ignored
  24982. } else if (algorithm[3] === '3') {
  24983. continue
  24984. // algorithm is sha256, check if algorithm is sha384 and if so, set it as
  24985. // the strongest
  24986. } else if (metadata.algo[3] === '3') {
  24987. algorithm = 'sha384'
  24988. }
  24989. }
  24990. return algorithm
  24991. }
  24992. function filterMetadataListByAlgorithm (metadataList, algorithm) {
  24993. if (metadataList.length === 1) {
  24994. return metadataList
  24995. }
  24996. let pos = 0
  24997. for (let i = 0; i < metadataList.length; ++i) {
  24998. if (metadataList[i].algo === algorithm) {
  24999. metadataList[pos++] = metadataList[i]
  25000. }
  25001. }
  25002. metadataList.length = pos
  25003. return metadataList
  25004. }
  25005. /**
  25006. * Compares two base64 strings, allowing for base64url
  25007. * in the second string.
  25008. *
  25009. * @param {string} actualValue always base64
  25010. * @param {string} expectedValue base64 or base64url
  25011. * @returns {boolean}
  25012. */
  25013. function compareBase64Mixed (actualValue, expectedValue) {
  25014. if (actualValue.length !== expectedValue.length) {
  25015. return false
  25016. }
  25017. for (let i = 0; i < actualValue.length; ++i) {
  25018. if (actualValue[i] !== expectedValue[i]) {
  25019. if (
  25020. (actualValue[i] === '+' && expectedValue[i] === '-') ||
  25021. (actualValue[i] === '/' && expectedValue[i] === '_')
  25022. ) {
  25023. continue
  25024. }
  25025. return false
  25026. }
  25027. }
  25028. return true
  25029. }
  25030. // https://w3c.github.io/webappsec-upgrade-insecure-requests/#upgrade-request
  25031. function tryUpgradeRequestToAPotentiallyTrustworthyURL (request) {
  25032. // TODO
  25033. }
  25034. /**
  25035. * @link {https://html.spec.whatwg.org/multipage/origin.html#same-origin}
  25036. * @param {URL} A
  25037. * @param {URL} B
  25038. */
  25039. function sameOrigin (A, B) {
  25040. // 1. If A and B are the same opaque origin, then return true.
  25041. if (A.origin === B.origin && A.origin === 'null') {
  25042. return true
  25043. }
  25044. // 2. If A and B are both tuple origins and their schemes,
  25045. // hosts, and port are identical, then return true.
  25046. if (A.protocol === B.protocol && A.hostname === B.hostname && A.port === B.port) {
  25047. return true
  25048. }
  25049. // 3. Return false.
  25050. return false
  25051. }
  25052. function createDeferredPromise () {
  25053. let res
  25054. let rej
  25055. const promise = new Promise((resolve, reject) => {
  25056. res = resolve
  25057. rej = reject
  25058. })
  25059. return { promise, resolve: res, reject: rej }
  25060. }
  25061. function isAborted (fetchParams) {
  25062. return fetchParams.controller.state === 'aborted'
  25063. }
  25064. function isCancelled (fetchParams) {
  25065. return fetchParams.controller.state === 'aborted' ||
  25066. fetchParams.controller.state === 'terminated'
  25067. }
  25068. const normalizeMethodRecord = {
  25069. delete: 'DELETE',
  25070. DELETE: 'DELETE',
  25071. get: 'GET',
  25072. GET: 'GET',
  25073. head: 'HEAD',
  25074. HEAD: 'HEAD',
  25075. options: 'OPTIONS',
  25076. OPTIONS: 'OPTIONS',
  25077. post: 'POST',
  25078. POST: 'POST',
  25079. put: 'PUT',
  25080. PUT: 'PUT'
  25081. }
  25082. // Note: object prototypes should not be able to be referenced. e.g. `Object#hasOwnProperty`.
  25083. Object.setPrototypeOf(normalizeMethodRecord, null)
  25084. /**
  25085. * @see https://fetch.spec.whatwg.org/#concept-method-normalize
  25086. * @param {string} method
  25087. */
  25088. function normalizeMethod (method) {
  25089. return normalizeMethodRecord[method.toLowerCase()] ?? method
  25090. }
  25091. // https://infra.spec.whatwg.org/#serialize-a-javascript-value-to-a-json-string
  25092. function serializeJavascriptValueToJSONString (value) {
  25093. // 1. Let result be ? Call(%JSON.stringify%, undefined, « value »).
  25094. const result = JSON.stringify(value)
  25095. // 2. If result is undefined, then throw a TypeError.
  25096. if (result === undefined) {
  25097. throw new TypeError('Value is not JSON serializable')
  25098. }
  25099. // 3. Assert: result is a string.
  25100. assert(typeof result === 'string')
  25101. // 4. Return result.
  25102. return result
  25103. }
  25104. // https://tc39.es/ecma262/#sec-%25iteratorprototype%25-object
  25105. const esIteratorPrototype = Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]()))
  25106. /**
  25107. * @see https://webidl.spec.whatwg.org/#dfn-iterator-prototype-object
  25108. * @param {() => unknown[]} iterator
  25109. * @param {string} name name of the instance
  25110. * @param {'key'|'value'|'key+value'} kind
  25111. */
  25112. function makeIterator (iterator, name, kind) {
  25113. const object = {
  25114. index: 0,
  25115. kind,
  25116. target: iterator
  25117. }
  25118. const i = {
  25119. next () {
  25120. // 1. Let interface be the interface for which the iterator prototype object exists.
  25121. // 2. Let thisValue be the this value.
  25122. // 3. Let object be ? ToObject(thisValue).
  25123. // 4. If object is a platform object, then perform a security
  25124. // check, passing:
  25125. // 5. If object is not a default iterator object for interface,
  25126. // then throw a TypeError.
  25127. if (Object.getPrototypeOf(this) !== i) {
  25128. throw new TypeError(
  25129. `'next' called on an object that does not implement interface ${name} Iterator.`
  25130. )
  25131. }
  25132. // 6. Let index be object’s index.
  25133. // 7. Let kind be object’s kind.
  25134. // 8. Let values be object’s target's value pairs to iterate over.
  25135. const { index, kind, target } = object
  25136. const values = target()
  25137. // 9. Let len be the length of values.
  25138. const len = values.length
  25139. // 10. If index is greater than or equal to len, then return
  25140. // CreateIterResultObject(undefined, true).
  25141. if (index >= len) {
  25142. return { value: undefined, done: true }
  25143. }
  25144. // 11. Let pair be the entry in values at index index.
  25145. const pair = values[index]
  25146. // 12. Set object’s index to index + 1.
  25147. object.index = index + 1
  25148. // 13. Return the iterator result for pair and kind.
  25149. return iteratorResult(pair, kind)
  25150. },
  25151. // The class string of an iterator prototype object for a given interface is the
  25152. // result of concatenating the identifier of the interface and the string " Iterator".
  25153. [Symbol.toStringTag]: `${name} Iterator`
  25154. }
  25155. // The [[Prototype]] internal slot of an iterator prototype object must be %IteratorPrototype%.
  25156. Object.setPrototypeOf(i, esIteratorPrototype)
  25157. // esIteratorPrototype needs to be the prototype of i
  25158. // which is the prototype of an empty object. Yes, it's confusing.
  25159. return Object.setPrototypeOf({}, i)
  25160. }
  25161. // https://webidl.spec.whatwg.org/#iterator-result
  25162. function iteratorResult (pair, kind) {
  25163. let result
  25164. // 1. Let result be a value determined by the value of kind:
  25165. switch (kind) {
  25166. case 'key': {
  25167. // 1. Let idlKey be pair’s key.
  25168. // 2. Let key be the result of converting idlKey to an
  25169. // ECMAScript value.
  25170. // 3. result is key.
  25171. result = pair[0]
  25172. break
  25173. }
  25174. case 'value': {
  25175. // 1. Let idlValue be pair’s value.
  25176. // 2. Let value be the result of converting idlValue to
  25177. // an ECMAScript value.
  25178. // 3. result is value.
  25179. result = pair[1]
  25180. break
  25181. }
  25182. case 'key+value': {
  25183. // 1. Let idlKey be pair’s key.
  25184. // 2. Let idlValue be pair’s value.
  25185. // 3. Let key be the result of converting idlKey to an
  25186. // ECMAScript value.
  25187. // 4. Let value be the result of converting idlValue to
  25188. // an ECMAScript value.
  25189. // 5. Let array be ! ArrayCreate(2).
  25190. // 6. Call ! CreateDataProperty(array, "0", key).
  25191. // 7. Call ! CreateDataProperty(array, "1", value).
  25192. // 8. result is array.
  25193. result = pair
  25194. break
  25195. }
  25196. }
  25197. // 2. Return CreateIterResultObject(result, false).
  25198. return { value: result, done: false }
  25199. }
  25200. /**
  25201. * @see https://fetch.spec.whatwg.org/#body-fully-read
  25202. */
  25203. async function fullyReadBody (body, processBody, processBodyError) {
  25204. // 1. If taskDestination is null, then set taskDestination to
  25205. // the result of starting a new parallel queue.
  25206. // 2. Let successSteps given a byte sequence bytes be to queue a
  25207. // fetch task to run processBody given bytes, with taskDestination.
  25208. const successSteps = processBody
  25209. // 3. Let errorSteps be to queue a fetch task to run processBodyError,
  25210. // with taskDestination.
  25211. const errorSteps = processBodyError
  25212. // 4. Let reader be the result of getting a reader for body’s stream.
  25213. // If that threw an exception, then run errorSteps with that
  25214. // exception and return.
  25215. let reader
  25216. try {
  25217. reader = body.stream.getReader()
  25218. } catch (e) {
  25219. errorSteps(e)
  25220. return
  25221. }
  25222. // 5. Read all bytes from reader, given successSteps and errorSteps.
  25223. try {
  25224. const result = await readAllBytes(reader)
  25225. successSteps(result)
  25226. } catch (e) {
  25227. errorSteps(e)
  25228. }
  25229. }
  25230. /** @type {ReadableStream} */
  25231. let ReadableStream = globalThis.ReadableStream
  25232. function isReadableStreamLike (stream) {
  25233. if (!ReadableStream) {
  25234. ReadableStream = (__nccwpck_require__(5356).ReadableStream)
  25235. }
  25236. return stream instanceof ReadableStream || (
  25237. stream[Symbol.toStringTag] === 'ReadableStream' &&
  25238. typeof stream.tee === 'function'
  25239. )
  25240. }
  25241. const MAXIMUM_ARGUMENT_LENGTH = 65535
  25242. /**
  25243. * @see https://infra.spec.whatwg.org/#isomorphic-decode
  25244. * @param {number[]|Uint8Array} input
  25245. */
  25246. function isomorphicDecode (input) {
  25247. // 1. To isomorphic decode a byte sequence input, return a string whose code point
  25248. // length is equal to input’s length and whose code points have the same values
  25249. // as the values of input’s bytes, in the same order.
  25250. if (input.length < MAXIMUM_ARGUMENT_LENGTH) {
  25251. return String.fromCharCode(...input)
  25252. }
  25253. return input.reduce((previous, current) => previous + String.fromCharCode(current), '')
  25254. }
  25255. /**
  25256. * @param {ReadableStreamController<Uint8Array>} controller
  25257. */
  25258. function readableStreamClose (controller) {
  25259. try {
  25260. controller.close()
  25261. } catch (err) {
  25262. // TODO: add comment explaining why this error occurs.
  25263. if (!err.message.includes('Controller is already closed')) {
  25264. throw err
  25265. }
  25266. }
  25267. }
  25268. /**
  25269. * @see https://infra.spec.whatwg.org/#isomorphic-encode
  25270. * @param {string} input
  25271. */
  25272. function isomorphicEncode (input) {
  25273. // 1. Assert: input contains no code points greater than U+00FF.
  25274. for (let i = 0; i < input.length; i++) {
  25275. assert(input.charCodeAt(i) <= 0xFF)
  25276. }
  25277. // 2. Return a byte sequence whose length is equal to input’s code
  25278. // point length and whose bytes have the same values as the
  25279. // values of input’s code points, in the same order
  25280. return input
  25281. }
  25282. /**
  25283. * @see https://streams.spec.whatwg.org/#readablestreamdefaultreader-read-all-bytes
  25284. * @see https://streams.spec.whatwg.org/#read-loop
  25285. * @param {ReadableStreamDefaultReader} reader
  25286. */
  25287. async function readAllBytes (reader) {
  25288. const bytes = []
  25289. let byteLength = 0
  25290. while (true) {
  25291. const { done, value: chunk } = await reader.read()
  25292. if (done) {
  25293. // 1. Call successSteps with bytes.
  25294. return Buffer.concat(bytes, byteLength)
  25295. }
  25296. // 1. If chunk is not a Uint8Array object, call failureSteps
  25297. // with a TypeError and abort these steps.
  25298. if (!isUint8Array(chunk)) {
  25299. throw new TypeError('Received non-Uint8Array chunk')
  25300. }
  25301. // 2. Append the bytes represented by chunk to bytes.
  25302. bytes.push(chunk)
  25303. byteLength += chunk.length
  25304. // 3. Read-loop given reader, bytes, successSteps, and failureSteps.
  25305. }
  25306. }
  25307. /**
  25308. * @see https://fetch.spec.whatwg.org/#is-local
  25309. * @param {URL} url
  25310. */
  25311. function urlIsLocal (url) {
  25312. assert('protocol' in url) // ensure it's a url object
  25313. const protocol = url.protocol
  25314. return protocol === 'about:' || protocol === 'blob:' || protocol === 'data:'
  25315. }
  25316. /**
  25317. * @param {string|URL} url
  25318. */
  25319. function urlHasHttpsScheme (url) {
  25320. if (typeof url === 'string') {
  25321. return url.startsWith('https:')
  25322. }
  25323. return url.protocol === 'https:'
  25324. }
  25325. /**
  25326. * @see https://fetch.spec.whatwg.org/#http-scheme
  25327. * @param {URL} url
  25328. */
  25329. function urlIsHttpHttpsScheme (url) {
  25330. assert('protocol' in url) // ensure it's a url object
  25331. const protocol = url.protocol
  25332. return protocol === 'http:' || protocol === 'https:'
  25333. }
  25334. /**
  25335. * Fetch supports node >= 16.8.0, but Object.hasOwn was added in v16.9.0.
  25336. */
  25337. const hasOwn = Object.hasOwn || ((dict, key) => Object.prototype.hasOwnProperty.call(dict, key))
  25338. module.exports = {
  25339. isAborted,
  25340. isCancelled,
  25341. createDeferredPromise,
  25342. ReadableStreamFrom,
  25343. toUSVString,
  25344. tryUpgradeRequestToAPotentiallyTrustworthyURL,
  25345. coarsenedSharedCurrentTime,
  25346. determineRequestsReferrer,
  25347. makePolicyContainer,
  25348. clonePolicyContainer,
  25349. appendFetchMetadata,
  25350. appendRequestOriginHeader,
  25351. TAOCheck,
  25352. corsCheck,
  25353. crossOriginResourcePolicyCheck,
  25354. createOpaqueTimingInfo,
  25355. setRequestReferrerPolicyOnRedirect,
  25356. isValidHTTPToken,
  25357. requestBadPort,
  25358. requestCurrentURL,
  25359. responseURL,
  25360. responseLocationURL,
  25361. isBlobLike,
  25362. isURLPotentiallyTrustworthy,
  25363. isValidReasonPhrase,
  25364. sameOrigin,
  25365. normalizeMethod,
  25366. serializeJavascriptValueToJSONString,
  25367. makeIterator,
  25368. isValidHeaderName,
  25369. isValidHeaderValue,
  25370. hasOwn,
  25371. isErrorLike,
  25372. fullyReadBody,
  25373. bytesMatch,
  25374. isReadableStreamLike,
  25375. readableStreamClose,
  25376. isomorphicEncode,
  25377. isomorphicDecode,
  25378. urlIsLocal,
  25379. urlHasHttpsScheme,
  25380. urlIsHttpHttpsScheme,
  25381. readAllBytes,
  25382. normalizeMethodRecord,
  25383. parseMetadata
  25384. }
  25385. /***/ }),
  25386. /***/ 1744:
  25387. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  25388. "use strict";
  25389. const { types } = __nccwpck_require__(3837)
  25390. const { hasOwn, toUSVString } = __nccwpck_require__(2538)
  25391. /** @type {import('../../types/webidl').Webidl} */
  25392. const webidl = {}
  25393. webidl.converters = {}
  25394. webidl.util = {}
  25395. webidl.errors = {}
  25396. webidl.errors.exception = function (message) {
  25397. return new TypeError(`${message.header}: ${message.message}`)
  25398. }
  25399. webidl.errors.conversionFailed = function (context) {
  25400. const plural = context.types.length === 1 ? '' : ' one of'
  25401. const message =
  25402. `${context.argument} could not be converted to` +
  25403. `${plural}: ${context.types.join(', ')}.`
  25404. return webidl.errors.exception({
  25405. header: context.prefix,
  25406. message
  25407. })
  25408. }
  25409. webidl.errors.invalidArgument = function (context) {
  25410. return webidl.errors.exception({
  25411. header: context.prefix,
  25412. message: `"${context.value}" is an invalid ${context.type}.`
  25413. })
  25414. }
  25415. // https://webidl.spec.whatwg.org/#implements
  25416. webidl.brandCheck = function (V, I, opts = undefined) {
  25417. if (opts?.strict !== false && !(V instanceof I)) {
  25418. throw new TypeError('Illegal invocation')
  25419. } else {
  25420. return V?.[Symbol.toStringTag] === I.prototype[Symbol.toStringTag]
  25421. }
  25422. }
  25423. webidl.argumentLengthCheck = function ({ length }, min, ctx) {
  25424. if (length < min) {
  25425. throw webidl.errors.exception({
  25426. message: `${min} argument${min !== 1 ? 's' : ''} required, ` +
  25427. `but${length ? ' only' : ''} ${length} found.`,
  25428. ...ctx
  25429. })
  25430. }
  25431. }
  25432. webidl.illegalConstructor = function () {
  25433. throw webidl.errors.exception({
  25434. header: 'TypeError',
  25435. message: 'Illegal constructor'
  25436. })
  25437. }
  25438. // https://tc39.es/ecma262/#sec-ecmascript-data-types-and-values
  25439. webidl.util.Type = function (V) {
  25440. switch (typeof V) {
  25441. case 'undefined': return 'Undefined'
  25442. case 'boolean': return 'Boolean'
  25443. case 'string': return 'String'
  25444. case 'symbol': return 'Symbol'
  25445. case 'number': return 'Number'
  25446. case 'bigint': return 'BigInt'
  25447. case 'function':
  25448. case 'object': {
  25449. if (V === null) {
  25450. return 'Null'
  25451. }
  25452. return 'Object'
  25453. }
  25454. }
  25455. }
  25456. // https://webidl.spec.whatwg.org/#abstract-opdef-converttoint
  25457. webidl.util.ConvertToInt = function (V, bitLength, signedness, opts = {}) {
  25458. let upperBound
  25459. let lowerBound
  25460. // 1. If bitLength is 64, then:
  25461. if (bitLength === 64) {
  25462. // 1. Let upperBound be 2^53 − 1.
  25463. upperBound = Math.pow(2, 53) - 1
  25464. // 2. If signedness is "unsigned", then let lowerBound be 0.
  25465. if (signedness === 'unsigned') {
  25466. lowerBound = 0
  25467. } else {
  25468. // 3. Otherwise let lowerBound be −2^53 + 1.
  25469. lowerBound = Math.pow(-2, 53) + 1
  25470. }
  25471. } else if (signedness === 'unsigned') {
  25472. // 2. Otherwise, if signedness is "unsigned", then:
  25473. // 1. Let lowerBound be 0.
  25474. lowerBound = 0
  25475. // 2. Let upperBound be 2^bitLength − 1.
  25476. upperBound = Math.pow(2, bitLength) - 1
  25477. } else {
  25478. // 3. Otherwise:
  25479. // 1. Let lowerBound be -2^bitLength − 1.
  25480. lowerBound = Math.pow(-2, bitLength) - 1
  25481. // 2. Let upperBound be 2^bitLength − 1 − 1.
  25482. upperBound = Math.pow(2, bitLength - 1) - 1
  25483. }
  25484. // 4. Let x be ? ToNumber(V).
  25485. let x = Number(V)
  25486. // 5. If x is −0, then set x to +0.
  25487. if (x === 0) {
  25488. x = 0
  25489. }
  25490. // 6. If the conversion is to an IDL type associated
  25491. // with the [EnforceRange] extended attribute, then:
  25492. if (opts.enforceRange === true) {
  25493. // 1. If x is NaN, +∞, or −∞, then throw a TypeError.
  25494. if (
  25495. Number.isNaN(x) ||
  25496. x === Number.POSITIVE_INFINITY ||
  25497. x === Number.NEGATIVE_INFINITY
  25498. ) {
  25499. throw webidl.errors.exception({
  25500. header: 'Integer conversion',
  25501. message: `Could not convert ${V} to an integer.`
  25502. })
  25503. }
  25504. // 2. Set x to IntegerPart(x).
  25505. x = webidl.util.IntegerPart(x)
  25506. // 3. If x < lowerBound or x > upperBound, then
  25507. // throw a TypeError.
  25508. if (x < lowerBound || x > upperBound) {
  25509. throw webidl.errors.exception({
  25510. header: 'Integer conversion',
  25511. message: `Value must be between ${lowerBound}-${upperBound}, got ${x}.`
  25512. })
  25513. }
  25514. // 4. Return x.
  25515. return x
  25516. }
  25517. // 7. If x is not NaN and the conversion is to an IDL
  25518. // type associated with the [Clamp] extended
  25519. // attribute, then:
  25520. if (!Number.isNaN(x) && opts.clamp === true) {
  25521. // 1. Set x to min(max(x, lowerBound), upperBound).
  25522. x = Math.min(Math.max(x, lowerBound), upperBound)
  25523. // 2. Round x to the nearest integer, choosing the
  25524. // even integer if it lies halfway between two,
  25525. // and choosing +0 rather than −0.
  25526. if (Math.floor(x) % 2 === 0) {
  25527. x = Math.floor(x)
  25528. } else {
  25529. x = Math.ceil(x)
  25530. }
  25531. // 3. Return x.
  25532. return x
  25533. }
  25534. // 8. If x is NaN, +0, +∞, or −∞, then return +0.
  25535. if (
  25536. Number.isNaN(x) ||
  25537. (x === 0 && Object.is(0, x)) ||
  25538. x === Number.POSITIVE_INFINITY ||
  25539. x === Number.NEGATIVE_INFINITY
  25540. ) {
  25541. return 0
  25542. }
  25543. // 9. Set x to IntegerPart(x).
  25544. x = webidl.util.IntegerPart(x)
  25545. // 10. Set x to x modulo 2^bitLength.
  25546. x = x % Math.pow(2, bitLength)
  25547. // 11. If signedness is "signed" and x ≥ 2^bitLength − 1,
  25548. // then return x − 2^bitLength.
  25549. if (signedness === 'signed' && x >= Math.pow(2, bitLength) - 1) {
  25550. return x - Math.pow(2, bitLength)
  25551. }
  25552. // 12. Otherwise, return x.
  25553. return x
  25554. }
  25555. // https://webidl.spec.whatwg.org/#abstract-opdef-integerpart
  25556. webidl.util.IntegerPart = function (n) {
  25557. // 1. Let r be floor(abs(n)).
  25558. const r = Math.floor(Math.abs(n))
  25559. // 2. If n < 0, then return -1 × r.
  25560. if (n < 0) {
  25561. return -1 * r
  25562. }
  25563. // 3. Otherwise, return r.
  25564. return r
  25565. }
  25566. // https://webidl.spec.whatwg.org/#es-sequence
  25567. webidl.sequenceConverter = function (converter) {
  25568. return (V) => {
  25569. // 1. If Type(V) is not Object, throw a TypeError.
  25570. if (webidl.util.Type(V) !== 'Object') {
  25571. throw webidl.errors.exception({
  25572. header: 'Sequence',
  25573. message: `Value of type ${webidl.util.Type(V)} is not an Object.`
  25574. })
  25575. }
  25576. // 2. Let method be ? GetMethod(V, @@iterator).
  25577. /** @type {Generator} */
  25578. const method = V?.[Symbol.iterator]?.()
  25579. const seq = []
  25580. // 3. If method is undefined, throw a TypeError.
  25581. if (
  25582. method === undefined ||
  25583. typeof method.next !== 'function'
  25584. ) {
  25585. throw webidl.errors.exception({
  25586. header: 'Sequence',
  25587. message: 'Object is not an iterator.'
  25588. })
  25589. }
  25590. // https://webidl.spec.whatwg.org/#create-sequence-from-iterable
  25591. while (true) {
  25592. const { done, value } = method.next()
  25593. if (done) {
  25594. break
  25595. }
  25596. seq.push(converter(value))
  25597. }
  25598. return seq
  25599. }
  25600. }
  25601. // https://webidl.spec.whatwg.org/#es-to-record
  25602. webidl.recordConverter = function (keyConverter, valueConverter) {
  25603. return (O) => {
  25604. // 1. If Type(O) is not Object, throw a TypeError.
  25605. if (webidl.util.Type(O) !== 'Object') {
  25606. throw webidl.errors.exception({
  25607. header: 'Record',
  25608. message: `Value of type ${webidl.util.Type(O)} is not an Object.`
  25609. })
  25610. }
  25611. // 2. Let result be a new empty instance of record<K, V>.
  25612. const result = {}
  25613. if (!types.isProxy(O)) {
  25614. // Object.keys only returns enumerable properties
  25615. const keys = Object.keys(O)
  25616. for (const key of keys) {
  25617. // 1. Let typedKey be key converted to an IDL value of type K.
  25618. const typedKey = keyConverter(key)
  25619. // 2. Let value be ? Get(O, key).
  25620. // 3. Let typedValue be value converted to an IDL value of type V.
  25621. const typedValue = valueConverter(O[key])
  25622. // 4. Set result[typedKey] to typedValue.
  25623. result[typedKey] = typedValue
  25624. }
  25625. // 5. Return result.
  25626. return result
  25627. }
  25628. // 3. Let keys be ? O.[[OwnPropertyKeys]]().
  25629. const keys = Reflect.ownKeys(O)
  25630. // 4. For each key of keys.
  25631. for (const key of keys) {
  25632. // 1. Let desc be ? O.[[GetOwnProperty]](key).
  25633. const desc = Reflect.getOwnPropertyDescriptor(O, key)
  25634. // 2. If desc is not undefined and desc.[[Enumerable]] is true:
  25635. if (desc?.enumerable) {
  25636. // 1. Let typedKey be key converted to an IDL value of type K.
  25637. const typedKey = keyConverter(key)
  25638. // 2. Let value be ? Get(O, key).
  25639. // 3. Let typedValue be value converted to an IDL value of type V.
  25640. const typedValue = valueConverter(O[key])
  25641. // 4. Set result[typedKey] to typedValue.
  25642. result[typedKey] = typedValue
  25643. }
  25644. }
  25645. // 5. Return result.
  25646. return result
  25647. }
  25648. }
  25649. webidl.interfaceConverter = function (i) {
  25650. return (V, opts = {}) => {
  25651. if (opts.strict !== false && !(V instanceof i)) {
  25652. throw webidl.errors.exception({
  25653. header: i.name,
  25654. message: `Expected ${V} to be an instance of ${i.name}.`
  25655. })
  25656. }
  25657. return V
  25658. }
  25659. }
  25660. webidl.dictionaryConverter = function (converters) {
  25661. return (dictionary) => {
  25662. const type = webidl.util.Type(dictionary)
  25663. const dict = {}
  25664. if (type === 'Null' || type === 'Undefined') {
  25665. return dict
  25666. } else if (type !== 'Object') {
  25667. throw webidl.errors.exception({
  25668. header: 'Dictionary',
  25669. message: `Expected ${dictionary} to be one of: Null, Undefined, Object.`
  25670. })
  25671. }
  25672. for (const options of converters) {
  25673. const { key, defaultValue, required, converter } = options
  25674. if (required === true) {
  25675. if (!hasOwn(dictionary, key)) {
  25676. throw webidl.errors.exception({
  25677. header: 'Dictionary',
  25678. message: `Missing required key "${key}".`
  25679. })
  25680. }
  25681. }
  25682. let value = dictionary[key]
  25683. const hasDefault = hasOwn(options, 'defaultValue')
  25684. // Only use defaultValue if value is undefined and
  25685. // a defaultValue options was provided.
  25686. if (hasDefault && value !== null) {
  25687. value = value ?? defaultValue
  25688. }
  25689. // A key can be optional and have no default value.
  25690. // When this happens, do not perform a conversion,
  25691. // and do not assign the key a value.
  25692. if (required || hasDefault || value !== undefined) {
  25693. value = converter(value)
  25694. if (
  25695. options.allowedValues &&
  25696. !options.allowedValues.includes(value)
  25697. ) {
  25698. throw webidl.errors.exception({
  25699. header: 'Dictionary',
  25700. message: `${value} is not an accepted type. Expected one of ${options.allowedValues.join(', ')}.`
  25701. })
  25702. }
  25703. dict[key] = value
  25704. }
  25705. }
  25706. return dict
  25707. }
  25708. }
  25709. webidl.nullableConverter = function (converter) {
  25710. return (V) => {
  25711. if (V === null) {
  25712. return V
  25713. }
  25714. return converter(V)
  25715. }
  25716. }
  25717. // https://webidl.spec.whatwg.org/#es-DOMString
  25718. webidl.converters.DOMString = function (V, opts = {}) {
  25719. // 1. If V is null and the conversion is to an IDL type
  25720. // associated with the [LegacyNullToEmptyString]
  25721. // extended attribute, then return the DOMString value
  25722. // that represents the empty string.
  25723. if (V === null && opts.legacyNullToEmptyString) {
  25724. return ''
  25725. }
  25726. // 2. Let x be ? ToString(V).
  25727. if (typeof V === 'symbol') {
  25728. throw new TypeError('Could not convert argument of type symbol to string.')
  25729. }
  25730. // 3. Return the IDL DOMString value that represents the
  25731. // same sequence of code units as the one the
  25732. // ECMAScript String value x represents.
  25733. return String(V)
  25734. }
  25735. // https://webidl.spec.whatwg.org/#es-ByteString
  25736. webidl.converters.ByteString = function (V) {
  25737. // 1. Let x be ? ToString(V).
  25738. // Note: DOMString converter perform ? ToString(V)
  25739. const x = webidl.converters.DOMString(V)
  25740. // 2. If the value of any element of x is greater than
  25741. // 255, then throw a TypeError.
  25742. for (let index = 0; index < x.length; index++) {
  25743. if (x.charCodeAt(index) > 255) {
  25744. throw new TypeError(
  25745. 'Cannot convert argument to a ByteString because the character at ' +
  25746. `index ${index} has a value of ${x.charCodeAt(index)} which is greater than 255.`
  25747. )
  25748. }
  25749. }
  25750. // 3. Return an IDL ByteString value whose length is the
  25751. // length of x, and where the value of each element is
  25752. // the value of the corresponding element of x.
  25753. return x
  25754. }
  25755. // https://webidl.spec.whatwg.org/#es-USVString
  25756. webidl.converters.USVString = toUSVString
  25757. // https://webidl.spec.whatwg.org/#es-boolean
  25758. webidl.converters.boolean = function (V) {
  25759. // 1. Let x be the result of computing ToBoolean(V).
  25760. const x = Boolean(V)
  25761. // 2. Return the IDL boolean value that is the one that represents
  25762. // the same truth value as the ECMAScript Boolean value x.
  25763. return x
  25764. }
  25765. // https://webidl.spec.whatwg.org/#es-any
  25766. webidl.converters.any = function (V) {
  25767. return V
  25768. }
  25769. // https://webidl.spec.whatwg.org/#es-long-long
  25770. webidl.converters['long long'] = function (V) {
  25771. // 1. Let x be ? ConvertToInt(V, 64, "signed").
  25772. const x = webidl.util.ConvertToInt(V, 64, 'signed')
  25773. // 2. Return the IDL long long value that represents
  25774. // the same numeric value as x.
  25775. return x
  25776. }
  25777. // https://webidl.spec.whatwg.org/#es-unsigned-long-long
  25778. webidl.converters['unsigned long long'] = function (V) {
  25779. // 1. Let x be ? ConvertToInt(V, 64, "unsigned").
  25780. const x = webidl.util.ConvertToInt(V, 64, 'unsigned')
  25781. // 2. Return the IDL unsigned long long value that
  25782. // represents the same numeric value as x.
  25783. return x
  25784. }
  25785. // https://webidl.spec.whatwg.org/#es-unsigned-long
  25786. webidl.converters['unsigned long'] = function (V) {
  25787. // 1. Let x be ? ConvertToInt(V, 32, "unsigned").
  25788. const x = webidl.util.ConvertToInt(V, 32, 'unsigned')
  25789. // 2. Return the IDL unsigned long value that
  25790. // represents the same numeric value as x.
  25791. return x
  25792. }
  25793. // https://webidl.spec.whatwg.org/#es-unsigned-short
  25794. webidl.converters['unsigned short'] = function (V, opts) {
  25795. // 1. Let x be ? ConvertToInt(V, 16, "unsigned").
  25796. const x = webidl.util.ConvertToInt(V, 16, 'unsigned', opts)
  25797. // 2. Return the IDL unsigned short value that represents
  25798. // the same numeric value as x.
  25799. return x
  25800. }
  25801. // https://webidl.spec.whatwg.org/#idl-ArrayBuffer
  25802. webidl.converters.ArrayBuffer = function (V, opts = {}) {
  25803. // 1. If Type(V) is not Object, or V does not have an
  25804. // [[ArrayBufferData]] internal slot, then throw a
  25805. // TypeError.
  25806. // see: https://tc39.es/ecma262/#sec-properties-of-the-arraybuffer-instances
  25807. // see: https://tc39.es/ecma262/#sec-properties-of-the-sharedarraybuffer-instances
  25808. if (
  25809. webidl.util.Type(V) !== 'Object' ||
  25810. !types.isAnyArrayBuffer(V)
  25811. ) {
  25812. throw webidl.errors.conversionFailed({
  25813. prefix: `${V}`,
  25814. argument: `${V}`,
  25815. types: ['ArrayBuffer']
  25816. })
  25817. }
  25818. // 2. If the conversion is not to an IDL type associated
  25819. // with the [AllowShared] extended attribute, and
  25820. // IsSharedArrayBuffer(V) is true, then throw a
  25821. // TypeError.
  25822. if (opts.allowShared === false && types.isSharedArrayBuffer(V)) {
  25823. throw webidl.errors.exception({
  25824. header: 'ArrayBuffer',
  25825. message: 'SharedArrayBuffer is not allowed.'
  25826. })
  25827. }
  25828. // 3. If the conversion is not to an IDL type associated
  25829. // with the [AllowResizable] extended attribute, and
  25830. // IsResizableArrayBuffer(V) is true, then throw a
  25831. // TypeError.
  25832. // Note: resizable ArrayBuffers are currently a proposal.
  25833. // 4. Return the IDL ArrayBuffer value that is a
  25834. // reference to the same object as V.
  25835. return V
  25836. }
  25837. webidl.converters.TypedArray = function (V, T, opts = {}) {
  25838. // 1. Let T be the IDL type V is being converted to.
  25839. // 2. If Type(V) is not Object, or V does not have a
  25840. // [[TypedArrayName]] internal slot with a value
  25841. // equal to T’s name, then throw a TypeError.
  25842. if (
  25843. webidl.util.Type(V) !== 'Object' ||
  25844. !types.isTypedArray(V) ||
  25845. V.constructor.name !== T.name
  25846. ) {
  25847. throw webidl.errors.conversionFailed({
  25848. prefix: `${T.name}`,
  25849. argument: `${V}`,
  25850. types: [T.name]
  25851. })
  25852. }
  25853. // 3. If the conversion is not to an IDL type associated
  25854. // with the [AllowShared] extended attribute, and
  25855. // IsSharedArrayBuffer(V.[[ViewedArrayBuffer]]) is
  25856. // true, then throw a TypeError.
  25857. if (opts.allowShared === false && types.isSharedArrayBuffer(V.buffer)) {
  25858. throw webidl.errors.exception({
  25859. header: 'ArrayBuffer',
  25860. message: 'SharedArrayBuffer is not allowed.'
  25861. })
  25862. }
  25863. // 4. If the conversion is not to an IDL type associated
  25864. // with the [AllowResizable] extended attribute, and
  25865. // IsResizableArrayBuffer(V.[[ViewedArrayBuffer]]) is
  25866. // true, then throw a TypeError.
  25867. // Note: resizable array buffers are currently a proposal
  25868. // 5. Return the IDL value of type T that is a reference
  25869. // to the same object as V.
  25870. return V
  25871. }
  25872. webidl.converters.DataView = function (V, opts = {}) {
  25873. // 1. If Type(V) is not Object, or V does not have a
  25874. // [[DataView]] internal slot, then throw a TypeError.
  25875. if (webidl.util.Type(V) !== 'Object' || !types.isDataView(V)) {
  25876. throw webidl.errors.exception({
  25877. header: 'DataView',
  25878. message: 'Object is not a DataView.'
  25879. })
  25880. }
  25881. // 2. If the conversion is not to an IDL type associated
  25882. // with the [AllowShared] extended attribute, and
  25883. // IsSharedArrayBuffer(V.[[ViewedArrayBuffer]]) is true,
  25884. // then throw a TypeError.
  25885. if (opts.allowShared === false && types.isSharedArrayBuffer(V.buffer)) {
  25886. throw webidl.errors.exception({
  25887. header: 'ArrayBuffer',
  25888. message: 'SharedArrayBuffer is not allowed.'
  25889. })
  25890. }
  25891. // 3. If the conversion is not to an IDL type associated
  25892. // with the [AllowResizable] extended attribute, and
  25893. // IsResizableArrayBuffer(V.[[ViewedArrayBuffer]]) is
  25894. // true, then throw a TypeError.
  25895. // Note: resizable ArrayBuffers are currently a proposal
  25896. // 4. Return the IDL DataView value that is a reference
  25897. // to the same object as V.
  25898. return V
  25899. }
  25900. // https://webidl.spec.whatwg.org/#BufferSource
  25901. webidl.converters.BufferSource = function (V, opts = {}) {
  25902. if (types.isAnyArrayBuffer(V)) {
  25903. return webidl.converters.ArrayBuffer(V, opts)
  25904. }
  25905. if (types.isTypedArray(V)) {
  25906. return webidl.converters.TypedArray(V, V.constructor)
  25907. }
  25908. if (types.isDataView(V)) {
  25909. return webidl.converters.DataView(V, opts)
  25910. }
  25911. throw new TypeError(`Could not convert ${V} to a BufferSource.`)
  25912. }
  25913. webidl.converters['sequence<ByteString>'] = webidl.sequenceConverter(
  25914. webidl.converters.ByteString
  25915. )
  25916. webidl.converters['sequence<sequence<ByteString>>'] = webidl.sequenceConverter(
  25917. webidl.converters['sequence<ByteString>']
  25918. )
  25919. webidl.converters['record<ByteString, ByteString>'] = webidl.recordConverter(
  25920. webidl.converters.ByteString,
  25921. webidl.converters.ByteString
  25922. )
  25923. module.exports = {
  25924. webidl
  25925. }
  25926. /***/ }),
  25927. /***/ 4854:
  25928. /***/ ((module) => {
  25929. "use strict";
  25930. /**
  25931. * @see https://encoding.spec.whatwg.org/#concept-encoding-get
  25932. * @param {string|undefined} label
  25933. */
  25934. function getEncoding (label) {
  25935. if (!label) {
  25936. return 'failure'
  25937. }
  25938. // 1. Remove any leading and trailing ASCII whitespace from label.
  25939. // 2. If label is an ASCII case-insensitive match for any of the
  25940. // labels listed in the table below, then return the
  25941. // corresponding encoding; otherwise return failure.
  25942. switch (label.trim().toLowerCase()) {
  25943. case 'unicode-1-1-utf-8':
  25944. case 'unicode11utf8':
  25945. case 'unicode20utf8':
  25946. case 'utf-8':
  25947. case 'utf8':
  25948. case 'x-unicode20utf8':
  25949. return 'UTF-8'
  25950. case '866':
  25951. case 'cp866':
  25952. case 'csibm866':
  25953. case 'ibm866':
  25954. return 'IBM866'
  25955. case 'csisolatin2':
  25956. case 'iso-8859-2':
  25957. case 'iso-ir-101':
  25958. case 'iso8859-2':
  25959. case 'iso88592':
  25960. case 'iso_8859-2':
  25961. case 'iso_8859-2:1987':
  25962. case 'l2':
  25963. case 'latin2':
  25964. return 'ISO-8859-2'
  25965. case 'csisolatin3':
  25966. case 'iso-8859-3':
  25967. case 'iso-ir-109':
  25968. case 'iso8859-3':
  25969. case 'iso88593':
  25970. case 'iso_8859-3':
  25971. case 'iso_8859-3:1988':
  25972. case 'l3':
  25973. case 'latin3':
  25974. return 'ISO-8859-3'
  25975. case 'csisolatin4':
  25976. case 'iso-8859-4':
  25977. case 'iso-ir-110':
  25978. case 'iso8859-4':
  25979. case 'iso88594':
  25980. case 'iso_8859-4':
  25981. case 'iso_8859-4:1988':
  25982. case 'l4':
  25983. case 'latin4':
  25984. return 'ISO-8859-4'
  25985. case 'csisolatincyrillic':
  25986. case 'cyrillic':
  25987. case 'iso-8859-5':
  25988. case 'iso-ir-144':
  25989. case 'iso8859-5':
  25990. case 'iso88595':
  25991. case 'iso_8859-5':
  25992. case 'iso_8859-5:1988':
  25993. return 'ISO-8859-5'
  25994. case 'arabic':
  25995. case 'asmo-708':
  25996. case 'csiso88596e':
  25997. case 'csiso88596i':
  25998. case 'csisolatinarabic':
  25999. case 'ecma-114':
  26000. case 'iso-8859-6':
  26001. case 'iso-8859-6-e':
  26002. case 'iso-8859-6-i':
  26003. case 'iso-ir-127':
  26004. case 'iso8859-6':
  26005. case 'iso88596':
  26006. case 'iso_8859-6':
  26007. case 'iso_8859-6:1987':
  26008. return 'ISO-8859-6'
  26009. case 'csisolatingreek':
  26010. case 'ecma-118':
  26011. case 'elot_928':
  26012. case 'greek':
  26013. case 'greek8':
  26014. case 'iso-8859-7':
  26015. case 'iso-ir-126':
  26016. case 'iso8859-7':
  26017. case 'iso88597':
  26018. case 'iso_8859-7':
  26019. case 'iso_8859-7:1987':
  26020. case 'sun_eu_greek':
  26021. return 'ISO-8859-7'
  26022. case 'csiso88598e':
  26023. case 'csisolatinhebrew':
  26024. case 'hebrew':
  26025. case 'iso-8859-8':
  26026. case 'iso-8859-8-e':
  26027. case 'iso-ir-138':
  26028. case 'iso8859-8':
  26029. case 'iso88598':
  26030. case 'iso_8859-8':
  26031. case 'iso_8859-8:1988':
  26032. case 'visual':
  26033. return 'ISO-8859-8'
  26034. case 'csiso88598i':
  26035. case 'iso-8859-8-i':
  26036. case 'logical':
  26037. return 'ISO-8859-8-I'
  26038. case 'csisolatin6':
  26039. case 'iso-8859-10':
  26040. case 'iso-ir-157':
  26041. case 'iso8859-10':
  26042. case 'iso885910':
  26043. case 'l6':
  26044. case 'latin6':
  26045. return 'ISO-8859-10'
  26046. case 'iso-8859-13':
  26047. case 'iso8859-13':
  26048. case 'iso885913':
  26049. return 'ISO-8859-13'
  26050. case 'iso-8859-14':
  26051. case 'iso8859-14':
  26052. case 'iso885914':
  26053. return 'ISO-8859-14'
  26054. case 'csisolatin9':
  26055. case 'iso-8859-15':
  26056. case 'iso8859-15':
  26057. case 'iso885915':
  26058. case 'iso_8859-15':
  26059. case 'l9':
  26060. return 'ISO-8859-15'
  26061. case 'iso-8859-16':
  26062. return 'ISO-8859-16'
  26063. case 'cskoi8r':
  26064. case 'koi':
  26065. case 'koi8':
  26066. case 'koi8-r':
  26067. case 'koi8_r':
  26068. return 'KOI8-R'
  26069. case 'koi8-ru':
  26070. case 'koi8-u':
  26071. return 'KOI8-U'
  26072. case 'csmacintosh':
  26073. case 'mac':
  26074. case 'macintosh':
  26075. case 'x-mac-roman':
  26076. return 'macintosh'
  26077. case 'iso-8859-11':
  26078. case 'iso8859-11':
  26079. case 'iso885911':
  26080. case 'tis-620':
  26081. case 'windows-874':
  26082. return 'windows-874'
  26083. case 'cp1250':
  26084. case 'windows-1250':
  26085. case 'x-cp1250':
  26086. return 'windows-1250'
  26087. case 'cp1251':
  26088. case 'windows-1251':
  26089. case 'x-cp1251':
  26090. return 'windows-1251'
  26091. case 'ansi_x3.4-1968':
  26092. case 'ascii':
  26093. case 'cp1252':
  26094. case 'cp819':
  26095. case 'csisolatin1':
  26096. case 'ibm819':
  26097. case 'iso-8859-1':
  26098. case 'iso-ir-100':
  26099. case 'iso8859-1':
  26100. case 'iso88591':
  26101. case 'iso_8859-1':
  26102. case 'iso_8859-1:1987':
  26103. case 'l1':
  26104. case 'latin1':
  26105. case 'us-ascii':
  26106. case 'windows-1252':
  26107. case 'x-cp1252':
  26108. return 'windows-1252'
  26109. case 'cp1253':
  26110. case 'windows-1253':
  26111. case 'x-cp1253':
  26112. return 'windows-1253'
  26113. case 'cp1254':
  26114. case 'csisolatin5':
  26115. case 'iso-8859-9':
  26116. case 'iso-ir-148':
  26117. case 'iso8859-9':
  26118. case 'iso88599':
  26119. case 'iso_8859-9':
  26120. case 'iso_8859-9:1989':
  26121. case 'l5':
  26122. case 'latin5':
  26123. case 'windows-1254':
  26124. case 'x-cp1254':
  26125. return 'windows-1254'
  26126. case 'cp1255':
  26127. case 'windows-1255':
  26128. case 'x-cp1255':
  26129. return 'windows-1255'
  26130. case 'cp1256':
  26131. case 'windows-1256':
  26132. case 'x-cp1256':
  26133. return 'windows-1256'
  26134. case 'cp1257':
  26135. case 'windows-1257':
  26136. case 'x-cp1257':
  26137. return 'windows-1257'
  26138. case 'cp1258':
  26139. case 'windows-1258':
  26140. case 'x-cp1258':
  26141. return 'windows-1258'
  26142. case 'x-mac-cyrillic':
  26143. case 'x-mac-ukrainian':
  26144. return 'x-mac-cyrillic'
  26145. case 'chinese':
  26146. case 'csgb2312':
  26147. case 'csiso58gb231280':
  26148. case 'gb2312':
  26149. case 'gb_2312':
  26150. case 'gb_2312-80':
  26151. case 'gbk':
  26152. case 'iso-ir-58':
  26153. case 'x-gbk':
  26154. return 'GBK'
  26155. case 'gb18030':
  26156. return 'gb18030'
  26157. case 'big5':
  26158. case 'big5-hkscs':
  26159. case 'cn-big5':
  26160. case 'csbig5':
  26161. case 'x-x-big5':
  26162. return 'Big5'
  26163. case 'cseucpkdfmtjapanese':
  26164. case 'euc-jp':
  26165. case 'x-euc-jp':
  26166. return 'EUC-JP'
  26167. case 'csiso2022jp':
  26168. case 'iso-2022-jp':
  26169. return 'ISO-2022-JP'
  26170. case 'csshiftjis':
  26171. case 'ms932':
  26172. case 'ms_kanji':
  26173. case 'shift-jis':
  26174. case 'shift_jis':
  26175. case 'sjis':
  26176. case 'windows-31j':
  26177. case 'x-sjis':
  26178. return 'Shift_JIS'
  26179. case 'cseuckr':
  26180. case 'csksc56011987':
  26181. case 'euc-kr':
  26182. case 'iso-ir-149':
  26183. case 'korean':
  26184. case 'ks_c_5601-1987':
  26185. case 'ks_c_5601-1989':
  26186. case 'ksc5601':
  26187. case 'ksc_5601':
  26188. case 'windows-949':
  26189. return 'EUC-KR'
  26190. case 'csiso2022kr':
  26191. case 'hz-gb-2312':
  26192. case 'iso-2022-cn':
  26193. case 'iso-2022-cn-ext':
  26194. case 'iso-2022-kr':
  26195. case 'replacement':
  26196. return 'replacement'
  26197. case 'unicodefffe':
  26198. case 'utf-16be':
  26199. return 'UTF-16BE'
  26200. case 'csunicode':
  26201. case 'iso-10646-ucs-2':
  26202. case 'ucs-2':
  26203. case 'unicode':
  26204. case 'unicodefeff':
  26205. case 'utf-16':
  26206. case 'utf-16le':
  26207. return 'UTF-16LE'
  26208. case 'x-user-defined':
  26209. return 'x-user-defined'
  26210. default: return 'failure'
  26211. }
  26212. }
  26213. module.exports = {
  26214. getEncoding
  26215. }
  26216. /***/ }),
  26217. /***/ 1446:
  26218. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  26219. "use strict";
  26220. const {
  26221. staticPropertyDescriptors,
  26222. readOperation,
  26223. fireAProgressEvent
  26224. } = __nccwpck_require__(7530)
  26225. const {
  26226. kState,
  26227. kError,
  26228. kResult,
  26229. kEvents,
  26230. kAborted
  26231. } = __nccwpck_require__(9054)
  26232. const { webidl } = __nccwpck_require__(1744)
  26233. const { kEnumerableProperty } = __nccwpck_require__(3983)
  26234. class FileReader extends EventTarget {
  26235. constructor () {
  26236. super()
  26237. this[kState] = 'empty'
  26238. this[kResult] = null
  26239. this[kError] = null
  26240. this[kEvents] = {
  26241. loadend: null,
  26242. error: null,
  26243. abort: null,
  26244. load: null,
  26245. progress: null,
  26246. loadstart: null
  26247. }
  26248. }
  26249. /**
  26250. * @see https://w3c.github.io/FileAPI/#dfn-readAsArrayBuffer
  26251. * @param {import('buffer').Blob} blob
  26252. */
  26253. readAsArrayBuffer (blob) {
  26254. webidl.brandCheck(this, FileReader)
  26255. webidl.argumentLengthCheck(arguments, 1, { header: 'FileReader.readAsArrayBuffer' })
  26256. blob = webidl.converters.Blob(blob, { strict: false })
  26257. // The readAsArrayBuffer(blob) method, when invoked,
  26258. // must initiate a read operation for blob with ArrayBuffer.
  26259. readOperation(this, blob, 'ArrayBuffer')
  26260. }
  26261. /**
  26262. * @see https://w3c.github.io/FileAPI/#readAsBinaryString
  26263. * @param {import('buffer').Blob} blob
  26264. */
  26265. readAsBinaryString (blob) {
  26266. webidl.brandCheck(this, FileReader)
  26267. webidl.argumentLengthCheck(arguments, 1, { header: 'FileReader.readAsBinaryString' })
  26268. blob = webidl.converters.Blob(blob, { strict: false })
  26269. // The readAsBinaryString(blob) method, when invoked,
  26270. // must initiate a read operation for blob with BinaryString.
  26271. readOperation(this, blob, 'BinaryString')
  26272. }
  26273. /**
  26274. * @see https://w3c.github.io/FileAPI/#readAsDataText
  26275. * @param {import('buffer').Blob} blob
  26276. * @param {string?} encoding
  26277. */
  26278. readAsText (blob, encoding = undefined) {
  26279. webidl.brandCheck(this, FileReader)
  26280. webidl.argumentLengthCheck(arguments, 1, { header: 'FileReader.readAsText' })
  26281. blob = webidl.converters.Blob(blob, { strict: false })
  26282. if (encoding !== undefined) {
  26283. encoding = webidl.converters.DOMString(encoding)
  26284. }
  26285. // The readAsText(blob, encoding) method, when invoked,
  26286. // must initiate a read operation for blob with Text and encoding.
  26287. readOperation(this, blob, 'Text', encoding)
  26288. }
  26289. /**
  26290. * @see https://w3c.github.io/FileAPI/#dfn-readAsDataURL
  26291. * @param {import('buffer').Blob} blob
  26292. */
  26293. readAsDataURL (blob) {
  26294. webidl.brandCheck(this, FileReader)
  26295. webidl.argumentLengthCheck(arguments, 1, { header: 'FileReader.readAsDataURL' })
  26296. blob = webidl.converters.Blob(blob, { strict: false })
  26297. // The readAsDataURL(blob) method, when invoked, must
  26298. // initiate a read operation for blob with DataURL.
  26299. readOperation(this, blob, 'DataURL')
  26300. }
  26301. /**
  26302. * @see https://w3c.github.io/FileAPI/#dfn-abort
  26303. */
  26304. abort () {
  26305. // 1. If this's state is "empty" or if this's state is
  26306. // "done" set this's result to null and terminate
  26307. // this algorithm.
  26308. if (this[kState] === 'empty' || this[kState] === 'done') {
  26309. this[kResult] = null
  26310. return
  26311. }
  26312. // 2. If this's state is "loading" set this's state to
  26313. // "done" and set this's result to null.
  26314. if (this[kState] === 'loading') {
  26315. this[kState] = 'done'
  26316. this[kResult] = null
  26317. }
  26318. // 3. If there are any tasks from this on the file reading
  26319. // task source in an affiliated task queue, then remove
  26320. // those tasks from that task queue.
  26321. this[kAborted] = true
  26322. // 4. Terminate the algorithm for the read method being processed.
  26323. // TODO
  26324. // 5. Fire a progress event called abort at this.
  26325. fireAProgressEvent('abort', this)
  26326. // 6. If this's state is not "loading", fire a progress
  26327. // event called loadend at this.
  26328. if (this[kState] !== 'loading') {
  26329. fireAProgressEvent('loadend', this)
  26330. }
  26331. }
  26332. /**
  26333. * @see https://w3c.github.io/FileAPI/#dom-filereader-readystate
  26334. */
  26335. get readyState () {
  26336. webidl.brandCheck(this, FileReader)
  26337. switch (this[kState]) {
  26338. case 'empty': return this.EMPTY
  26339. case 'loading': return this.LOADING
  26340. case 'done': return this.DONE
  26341. }
  26342. }
  26343. /**
  26344. * @see https://w3c.github.io/FileAPI/#dom-filereader-result
  26345. */
  26346. get result () {
  26347. webidl.brandCheck(this, FileReader)
  26348. // The result attribute’s getter, when invoked, must return
  26349. // this's result.
  26350. return this[kResult]
  26351. }
  26352. /**
  26353. * @see https://w3c.github.io/FileAPI/#dom-filereader-error
  26354. */
  26355. get error () {
  26356. webidl.brandCheck(this, FileReader)
  26357. // The error attribute’s getter, when invoked, must return
  26358. // this's error.
  26359. return this[kError]
  26360. }
  26361. get onloadend () {
  26362. webidl.brandCheck(this, FileReader)
  26363. return this[kEvents].loadend
  26364. }
  26365. set onloadend (fn) {
  26366. webidl.brandCheck(this, FileReader)
  26367. if (this[kEvents].loadend) {
  26368. this.removeEventListener('loadend', this[kEvents].loadend)
  26369. }
  26370. if (typeof fn === 'function') {
  26371. this[kEvents].loadend = fn
  26372. this.addEventListener('loadend', fn)
  26373. } else {
  26374. this[kEvents].loadend = null
  26375. }
  26376. }
  26377. get onerror () {
  26378. webidl.brandCheck(this, FileReader)
  26379. return this[kEvents].error
  26380. }
  26381. set onerror (fn) {
  26382. webidl.brandCheck(this, FileReader)
  26383. if (this[kEvents].error) {
  26384. this.removeEventListener('error', this[kEvents].error)
  26385. }
  26386. if (typeof fn === 'function') {
  26387. this[kEvents].error = fn
  26388. this.addEventListener('error', fn)
  26389. } else {
  26390. this[kEvents].error = null
  26391. }
  26392. }
  26393. get onloadstart () {
  26394. webidl.brandCheck(this, FileReader)
  26395. return this[kEvents].loadstart
  26396. }
  26397. set onloadstart (fn) {
  26398. webidl.brandCheck(this, FileReader)
  26399. if (this[kEvents].loadstart) {
  26400. this.removeEventListener('loadstart', this[kEvents].loadstart)
  26401. }
  26402. if (typeof fn === 'function') {
  26403. this[kEvents].loadstart = fn
  26404. this.addEventListener('loadstart', fn)
  26405. } else {
  26406. this[kEvents].loadstart = null
  26407. }
  26408. }
  26409. get onprogress () {
  26410. webidl.brandCheck(this, FileReader)
  26411. return this[kEvents].progress
  26412. }
  26413. set onprogress (fn) {
  26414. webidl.brandCheck(this, FileReader)
  26415. if (this[kEvents].progress) {
  26416. this.removeEventListener('progress', this[kEvents].progress)
  26417. }
  26418. if (typeof fn === 'function') {
  26419. this[kEvents].progress = fn
  26420. this.addEventListener('progress', fn)
  26421. } else {
  26422. this[kEvents].progress = null
  26423. }
  26424. }
  26425. get onload () {
  26426. webidl.brandCheck(this, FileReader)
  26427. return this[kEvents].load
  26428. }
  26429. set onload (fn) {
  26430. webidl.brandCheck(this, FileReader)
  26431. if (this[kEvents].load) {
  26432. this.removeEventListener('load', this[kEvents].load)
  26433. }
  26434. if (typeof fn === 'function') {
  26435. this[kEvents].load = fn
  26436. this.addEventListener('load', fn)
  26437. } else {
  26438. this[kEvents].load = null
  26439. }
  26440. }
  26441. get onabort () {
  26442. webidl.brandCheck(this, FileReader)
  26443. return this[kEvents].abort
  26444. }
  26445. set onabort (fn) {
  26446. webidl.brandCheck(this, FileReader)
  26447. if (this[kEvents].abort) {
  26448. this.removeEventListener('abort', this[kEvents].abort)
  26449. }
  26450. if (typeof fn === 'function') {
  26451. this[kEvents].abort = fn
  26452. this.addEventListener('abort', fn)
  26453. } else {
  26454. this[kEvents].abort = null
  26455. }
  26456. }
  26457. }
  26458. // https://w3c.github.io/FileAPI/#dom-filereader-empty
  26459. FileReader.EMPTY = FileReader.prototype.EMPTY = 0
  26460. // https://w3c.github.io/FileAPI/#dom-filereader-loading
  26461. FileReader.LOADING = FileReader.prototype.LOADING = 1
  26462. // https://w3c.github.io/FileAPI/#dom-filereader-done
  26463. FileReader.DONE = FileReader.prototype.DONE = 2
  26464. Object.defineProperties(FileReader.prototype, {
  26465. EMPTY: staticPropertyDescriptors,
  26466. LOADING: staticPropertyDescriptors,
  26467. DONE: staticPropertyDescriptors,
  26468. readAsArrayBuffer: kEnumerableProperty,
  26469. readAsBinaryString: kEnumerableProperty,
  26470. readAsText: kEnumerableProperty,
  26471. readAsDataURL: kEnumerableProperty,
  26472. abort: kEnumerableProperty,
  26473. readyState: kEnumerableProperty,
  26474. result: kEnumerableProperty,
  26475. error: kEnumerableProperty,
  26476. onloadstart: kEnumerableProperty,
  26477. onprogress: kEnumerableProperty,
  26478. onload: kEnumerableProperty,
  26479. onabort: kEnumerableProperty,
  26480. onerror: kEnumerableProperty,
  26481. onloadend: kEnumerableProperty,
  26482. [Symbol.toStringTag]: {
  26483. value: 'FileReader',
  26484. writable: false,
  26485. enumerable: false,
  26486. configurable: true
  26487. }
  26488. })
  26489. Object.defineProperties(FileReader, {
  26490. EMPTY: staticPropertyDescriptors,
  26491. LOADING: staticPropertyDescriptors,
  26492. DONE: staticPropertyDescriptors
  26493. })
  26494. module.exports = {
  26495. FileReader
  26496. }
  26497. /***/ }),
  26498. /***/ 5504:
  26499. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  26500. "use strict";
  26501. const { webidl } = __nccwpck_require__(1744)
  26502. const kState = Symbol('ProgressEvent state')
  26503. /**
  26504. * @see https://xhr.spec.whatwg.org/#progressevent
  26505. */
  26506. class ProgressEvent extends Event {
  26507. constructor (type, eventInitDict = {}) {
  26508. type = webidl.converters.DOMString(type)
  26509. eventInitDict = webidl.converters.ProgressEventInit(eventInitDict ?? {})
  26510. super(type, eventInitDict)
  26511. this[kState] = {
  26512. lengthComputable: eventInitDict.lengthComputable,
  26513. loaded: eventInitDict.loaded,
  26514. total: eventInitDict.total
  26515. }
  26516. }
  26517. get lengthComputable () {
  26518. webidl.brandCheck(this, ProgressEvent)
  26519. return this[kState].lengthComputable
  26520. }
  26521. get loaded () {
  26522. webidl.brandCheck(this, ProgressEvent)
  26523. return this[kState].loaded
  26524. }
  26525. get total () {
  26526. webidl.brandCheck(this, ProgressEvent)
  26527. return this[kState].total
  26528. }
  26529. }
  26530. webidl.converters.ProgressEventInit = webidl.dictionaryConverter([
  26531. {
  26532. key: 'lengthComputable',
  26533. converter: webidl.converters.boolean,
  26534. defaultValue: false
  26535. },
  26536. {
  26537. key: 'loaded',
  26538. converter: webidl.converters['unsigned long long'],
  26539. defaultValue: 0
  26540. },
  26541. {
  26542. key: 'total',
  26543. converter: webidl.converters['unsigned long long'],
  26544. defaultValue: 0
  26545. },
  26546. {
  26547. key: 'bubbles',
  26548. converter: webidl.converters.boolean,
  26549. defaultValue: false
  26550. },
  26551. {
  26552. key: 'cancelable',
  26553. converter: webidl.converters.boolean,
  26554. defaultValue: false
  26555. },
  26556. {
  26557. key: 'composed',
  26558. converter: webidl.converters.boolean,
  26559. defaultValue: false
  26560. }
  26561. ])
  26562. module.exports = {
  26563. ProgressEvent
  26564. }
  26565. /***/ }),
  26566. /***/ 9054:
  26567. /***/ ((module) => {
  26568. "use strict";
  26569. module.exports = {
  26570. kState: Symbol('FileReader state'),
  26571. kResult: Symbol('FileReader result'),
  26572. kError: Symbol('FileReader error'),
  26573. kLastProgressEventFired: Symbol('FileReader last progress event fired timestamp'),
  26574. kEvents: Symbol('FileReader events'),
  26575. kAborted: Symbol('FileReader aborted')
  26576. }
  26577. /***/ }),
  26578. /***/ 7530:
  26579. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  26580. "use strict";
  26581. const {
  26582. kState,
  26583. kError,
  26584. kResult,
  26585. kAborted,
  26586. kLastProgressEventFired
  26587. } = __nccwpck_require__(9054)
  26588. const { ProgressEvent } = __nccwpck_require__(5504)
  26589. const { getEncoding } = __nccwpck_require__(4854)
  26590. const { DOMException } = __nccwpck_require__(1037)
  26591. const { serializeAMimeType, parseMIMEType } = __nccwpck_require__(685)
  26592. const { types } = __nccwpck_require__(3837)
  26593. const { StringDecoder } = __nccwpck_require__(1576)
  26594. const { btoa } = __nccwpck_require__(4300)
  26595. /** @type {PropertyDescriptor} */
  26596. const staticPropertyDescriptors = {
  26597. enumerable: true,
  26598. writable: false,
  26599. configurable: false
  26600. }
  26601. /**
  26602. * @see https://w3c.github.io/FileAPI/#readOperation
  26603. * @param {import('./filereader').FileReader} fr
  26604. * @param {import('buffer').Blob} blob
  26605. * @param {string} type
  26606. * @param {string?} encodingName
  26607. */
  26608. function readOperation (fr, blob, type, encodingName) {
  26609. // 1. If fr’s state is "loading", throw an InvalidStateError
  26610. // DOMException.
  26611. if (fr[kState] === 'loading') {
  26612. throw new DOMException('Invalid state', 'InvalidStateError')
  26613. }
  26614. // 2. Set fr’s state to "loading".
  26615. fr[kState] = 'loading'
  26616. // 3. Set fr’s result to null.
  26617. fr[kResult] = null
  26618. // 4. Set fr’s error to null.
  26619. fr[kError] = null
  26620. // 5. Let stream be the result of calling get stream on blob.
  26621. /** @type {import('stream/web').ReadableStream} */
  26622. const stream = blob.stream()
  26623. // 6. Let reader be the result of getting a reader from stream.
  26624. const reader = stream.getReader()
  26625. // 7. Let bytes be an empty byte sequence.
  26626. /** @type {Uint8Array[]} */
  26627. const bytes = []
  26628. // 8. Let chunkPromise be the result of reading a chunk from
  26629. // stream with reader.
  26630. let chunkPromise = reader.read()
  26631. // 9. Let isFirstChunk be true.
  26632. let isFirstChunk = true
  26633. // 10. In parallel, while true:
  26634. // Note: "In parallel" just means non-blocking
  26635. // Note 2: readOperation itself cannot be async as double
  26636. // reading the body would then reject the promise, instead
  26637. // of throwing an error.
  26638. ;(async () => {
  26639. while (!fr[kAborted]) {
  26640. // 1. Wait for chunkPromise to be fulfilled or rejected.
  26641. try {
  26642. const { done, value } = await chunkPromise
  26643. // 2. If chunkPromise is fulfilled, and isFirstChunk is
  26644. // true, queue a task to fire a progress event called
  26645. // loadstart at fr.
  26646. if (isFirstChunk && !fr[kAborted]) {
  26647. queueMicrotask(() => {
  26648. fireAProgressEvent('loadstart', fr)
  26649. })
  26650. }
  26651. // 3. Set isFirstChunk to false.
  26652. isFirstChunk = false
  26653. // 4. If chunkPromise is fulfilled with an object whose
  26654. // done property is false and whose value property is
  26655. // a Uint8Array object, run these steps:
  26656. if (!done && types.isUint8Array(value)) {
  26657. // 1. Let bs be the byte sequence represented by the
  26658. // Uint8Array object.
  26659. // 2. Append bs to bytes.
  26660. bytes.push(value)
  26661. // 3. If roughly 50ms have passed since these steps
  26662. // were last invoked, queue a task to fire a
  26663. // progress event called progress at fr.
  26664. if (
  26665. (
  26666. fr[kLastProgressEventFired] === undefined ||
  26667. Date.now() - fr[kLastProgressEventFired] >= 50
  26668. ) &&
  26669. !fr[kAborted]
  26670. ) {
  26671. fr[kLastProgressEventFired] = Date.now()
  26672. queueMicrotask(() => {
  26673. fireAProgressEvent('progress', fr)
  26674. })
  26675. }
  26676. // 4. Set chunkPromise to the result of reading a
  26677. // chunk from stream with reader.
  26678. chunkPromise = reader.read()
  26679. } else if (done) {
  26680. // 5. Otherwise, if chunkPromise is fulfilled with an
  26681. // object whose done property is true, queue a task
  26682. // to run the following steps and abort this algorithm:
  26683. queueMicrotask(() => {
  26684. // 1. Set fr’s state to "done".
  26685. fr[kState] = 'done'
  26686. // 2. Let result be the result of package data given
  26687. // bytes, type, blob’s type, and encodingName.
  26688. try {
  26689. const result = packageData(bytes, type, blob.type, encodingName)
  26690. // 4. Else:
  26691. if (fr[kAborted]) {
  26692. return
  26693. }
  26694. // 1. Set fr’s result to result.
  26695. fr[kResult] = result
  26696. // 2. Fire a progress event called load at the fr.
  26697. fireAProgressEvent('load', fr)
  26698. } catch (error) {
  26699. // 3. If package data threw an exception error:
  26700. // 1. Set fr’s error to error.
  26701. fr[kError] = error
  26702. // 2. Fire a progress event called error at fr.
  26703. fireAProgressEvent('error', fr)
  26704. }
  26705. // 5. If fr’s state is not "loading", fire a progress
  26706. // event called loadend at the fr.
  26707. if (fr[kState] !== 'loading') {
  26708. fireAProgressEvent('loadend', fr)
  26709. }
  26710. })
  26711. break
  26712. }
  26713. } catch (error) {
  26714. if (fr[kAborted]) {
  26715. return
  26716. }
  26717. // 6. Otherwise, if chunkPromise is rejected with an
  26718. // error error, queue a task to run the following
  26719. // steps and abort this algorithm:
  26720. queueMicrotask(() => {
  26721. // 1. Set fr’s state to "done".
  26722. fr[kState] = 'done'
  26723. // 2. Set fr’s error to error.
  26724. fr[kError] = error
  26725. // 3. Fire a progress event called error at fr.
  26726. fireAProgressEvent('error', fr)
  26727. // 4. If fr’s state is not "loading", fire a progress
  26728. // event called loadend at fr.
  26729. if (fr[kState] !== 'loading') {
  26730. fireAProgressEvent('loadend', fr)
  26731. }
  26732. })
  26733. break
  26734. }
  26735. }
  26736. })()
  26737. }
  26738. /**
  26739. * @see https://w3c.github.io/FileAPI/#fire-a-progress-event
  26740. * @see https://dom.spec.whatwg.org/#concept-event-fire
  26741. * @param {string} e The name of the event
  26742. * @param {import('./filereader').FileReader} reader
  26743. */
  26744. function fireAProgressEvent (e, reader) {
  26745. // The progress event e does not bubble. e.bubbles must be false
  26746. // The progress event e is NOT cancelable. e.cancelable must be false
  26747. const event = new ProgressEvent(e, {
  26748. bubbles: false,
  26749. cancelable: false
  26750. })
  26751. reader.dispatchEvent(event)
  26752. }
  26753. /**
  26754. * @see https://w3c.github.io/FileAPI/#blob-package-data
  26755. * @param {Uint8Array[]} bytes
  26756. * @param {string} type
  26757. * @param {string?} mimeType
  26758. * @param {string?} encodingName
  26759. */
  26760. function packageData (bytes, type, mimeType, encodingName) {
  26761. // 1. A Blob has an associated package data algorithm, given
  26762. // bytes, a type, a optional mimeType, and a optional
  26763. // encodingName, which switches on type and runs the
  26764. // associated steps:
  26765. switch (type) {
  26766. case 'DataURL': {
  26767. // 1. Return bytes as a DataURL [RFC2397] subject to
  26768. // the considerations below:
  26769. // * Use mimeType as part of the Data URL if it is
  26770. // available in keeping with the Data URL
  26771. // specification [RFC2397].
  26772. // * If mimeType is not available return a Data URL
  26773. // without a media-type. [RFC2397].
  26774. // https://datatracker.ietf.org/doc/html/rfc2397#section-3
  26775. // dataurl := "data:" [ mediatype ] [ ";base64" ] "," data
  26776. // mediatype := [ type "/" subtype ] *( ";" parameter )
  26777. // data := *urlchar
  26778. // parameter := attribute "=" value
  26779. let dataURL = 'data:'
  26780. const parsed = parseMIMEType(mimeType || 'application/octet-stream')
  26781. if (parsed !== 'failure') {
  26782. dataURL += serializeAMimeType(parsed)
  26783. }
  26784. dataURL += ';base64,'
  26785. const decoder = new StringDecoder('latin1')
  26786. for (const chunk of bytes) {
  26787. dataURL += btoa(decoder.write(chunk))
  26788. }
  26789. dataURL += btoa(decoder.end())
  26790. return dataURL
  26791. }
  26792. case 'Text': {
  26793. // 1. Let encoding be failure
  26794. let encoding = 'failure'
  26795. // 2. If the encodingName is present, set encoding to the
  26796. // result of getting an encoding from encodingName.
  26797. if (encodingName) {
  26798. encoding = getEncoding(encodingName)
  26799. }
  26800. // 3. If encoding is failure, and mimeType is present:
  26801. if (encoding === 'failure' && mimeType) {
  26802. // 1. Let type be the result of parse a MIME type
  26803. // given mimeType.
  26804. const type = parseMIMEType(mimeType)
  26805. // 2. If type is not failure, set encoding to the result
  26806. // of getting an encoding from type’s parameters["charset"].
  26807. if (type !== 'failure') {
  26808. encoding = getEncoding(type.parameters.get('charset'))
  26809. }
  26810. }
  26811. // 4. If encoding is failure, then set encoding to UTF-8.
  26812. if (encoding === 'failure') {
  26813. encoding = 'UTF-8'
  26814. }
  26815. // 5. Decode bytes using fallback encoding encoding, and
  26816. // return the result.
  26817. return decode(bytes, encoding)
  26818. }
  26819. case 'ArrayBuffer': {
  26820. // Return a new ArrayBuffer whose contents are bytes.
  26821. const sequence = combineByteSequences(bytes)
  26822. return sequence.buffer
  26823. }
  26824. case 'BinaryString': {
  26825. // Return bytes as a binary string, in which every byte
  26826. // is represented by a code unit of equal value [0..255].
  26827. let binaryString = ''
  26828. const decoder = new StringDecoder('latin1')
  26829. for (const chunk of bytes) {
  26830. binaryString += decoder.write(chunk)
  26831. }
  26832. binaryString += decoder.end()
  26833. return binaryString
  26834. }
  26835. }
  26836. }
  26837. /**
  26838. * @see https://encoding.spec.whatwg.org/#decode
  26839. * @param {Uint8Array[]} ioQueue
  26840. * @param {string} encoding
  26841. */
  26842. function decode (ioQueue, encoding) {
  26843. const bytes = combineByteSequences(ioQueue)
  26844. // 1. Let BOMEncoding be the result of BOM sniffing ioQueue.
  26845. const BOMEncoding = BOMSniffing(bytes)
  26846. let slice = 0
  26847. // 2. If BOMEncoding is non-null:
  26848. if (BOMEncoding !== null) {
  26849. // 1. Set encoding to BOMEncoding.
  26850. encoding = BOMEncoding
  26851. // 2. Read three bytes from ioQueue, if BOMEncoding is
  26852. // UTF-8; otherwise read two bytes.
  26853. // (Do nothing with those bytes.)
  26854. slice = BOMEncoding === 'UTF-8' ? 3 : 2
  26855. }
  26856. // 3. Process a queue with an instance of encoding’s
  26857. // decoder, ioQueue, output, and "replacement".
  26858. // 4. Return output.
  26859. const sliced = bytes.slice(slice)
  26860. return new TextDecoder(encoding).decode(sliced)
  26861. }
  26862. /**
  26863. * @see https://encoding.spec.whatwg.org/#bom-sniff
  26864. * @param {Uint8Array} ioQueue
  26865. */
  26866. function BOMSniffing (ioQueue) {
  26867. // 1. Let BOM be the result of peeking 3 bytes from ioQueue,
  26868. // converted to a byte sequence.
  26869. const [a, b, c] = ioQueue
  26870. // 2. For each of the rows in the table below, starting with
  26871. // the first one and going down, if BOM starts with the
  26872. // bytes given in the first column, then return the
  26873. // encoding given in the cell in the second column of that
  26874. // row. Otherwise, return null.
  26875. if (a === 0xEF && b === 0xBB && c === 0xBF) {
  26876. return 'UTF-8'
  26877. } else if (a === 0xFE && b === 0xFF) {
  26878. return 'UTF-16BE'
  26879. } else if (a === 0xFF && b === 0xFE) {
  26880. return 'UTF-16LE'
  26881. }
  26882. return null
  26883. }
  26884. /**
  26885. * @param {Uint8Array[]} sequences
  26886. */
  26887. function combineByteSequences (sequences) {
  26888. const size = sequences.reduce((a, b) => {
  26889. return a + b.byteLength
  26890. }, 0)
  26891. let offset = 0
  26892. return sequences.reduce((a, b) => {
  26893. a.set(b, offset)
  26894. offset += b.byteLength
  26895. return a
  26896. }, new Uint8Array(size))
  26897. }
  26898. module.exports = {
  26899. staticPropertyDescriptors,
  26900. readOperation,
  26901. fireAProgressEvent
  26902. }
  26903. /***/ }),
  26904. /***/ 1892:
  26905. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  26906. "use strict";
  26907. // We include a version number for the Dispatcher API. In case of breaking changes,
  26908. // this version number must be increased to avoid conflicts.
  26909. const globalDispatcher = Symbol.for('undici.globalDispatcher.1')
  26910. const { InvalidArgumentError } = __nccwpck_require__(8045)
  26911. const Agent = __nccwpck_require__(7890)
  26912. if (getGlobalDispatcher() === undefined) {
  26913. setGlobalDispatcher(new Agent())
  26914. }
  26915. function setGlobalDispatcher (agent) {
  26916. if (!agent || typeof agent.dispatch !== 'function') {
  26917. throw new InvalidArgumentError('Argument agent must implement Agent')
  26918. }
  26919. Object.defineProperty(globalThis, globalDispatcher, {
  26920. value: agent,
  26921. writable: true,
  26922. enumerable: false,
  26923. configurable: false
  26924. })
  26925. }
  26926. function getGlobalDispatcher () {
  26927. return globalThis[globalDispatcher]
  26928. }
  26929. module.exports = {
  26930. setGlobalDispatcher,
  26931. getGlobalDispatcher
  26932. }
  26933. /***/ }),
  26934. /***/ 6930:
  26935. /***/ ((module) => {
  26936. "use strict";
  26937. module.exports = class DecoratorHandler {
  26938. constructor (handler) {
  26939. this.handler = handler
  26940. }
  26941. onConnect (...args) {
  26942. return this.handler.onConnect(...args)
  26943. }
  26944. onError (...args) {
  26945. return this.handler.onError(...args)
  26946. }
  26947. onUpgrade (...args) {
  26948. return this.handler.onUpgrade(...args)
  26949. }
  26950. onHeaders (...args) {
  26951. return this.handler.onHeaders(...args)
  26952. }
  26953. onData (...args) {
  26954. return this.handler.onData(...args)
  26955. }
  26956. onComplete (...args) {
  26957. return this.handler.onComplete(...args)
  26958. }
  26959. onBodySent (...args) {
  26960. return this.handler.onBodySent(...args)
  26961. }
  26962. }
  26963. /***/ }),
  26964. /***/ 2860:
  26965. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  26966. "use strict";
  26967. const util = __nccwpck_require__(3983)
  26968. const { kBodyUsed } = __nccwpck_require__(2785)
  26969. const assert = __nccwpck_require__(9491)
  26970. const { InvalidArgumentError } = __nccwpck_require__(8045)
  26971. const EE = __nccwpck_require__(2361)
  26972. const redirectableStatusCodes = [300, 301, 302, 303, 307, 308]
  26973. const kBody = Symbol('body')
  26974. class BodyAsyncIterable {
  26975. constructor (body) {
  26976. this[kBody] = body
  26977. this[kBodyUsed] = false
  26978. }
  26979. async * [Symbol.asyncIterator] () {
  26980. assert(!this[kBodyUsed], 'disturbed')
  26981. this[kBodyUsed] = true
  26982. yield * this[kBody]
  26983. }
  26984. }
  26985. class RedirectHandler {
  26986. constructor (dispatch, maxRedirections, opts, handler) {
  26987. if (maxRedirections != null && (!Number.isInteger(maxRedirections) || maxRedirections < 0)) {
  26988. throw new InvalidArgumentError('maxRedirections must be a positive number')
  26989. }
  26990. util.validateHandler(handler, opts.method, opts.upgrade)
  26991. this.dispatch = dispatch
  26992. this.location = null
  26993. this.abort = null
  26994. this.opts = { ...opts, maxRedirections: 0 } // opts must be a copy
  26995. this.maxRedirections = maxRedirections
  26996. this.handler = handler
  26997. this.history = []
  26998. if (util.isStream(this.opts.body)) {
  26999. // TODO (fix): Provide some way for the user to cache the file to e.g. /tmp
  27000. // so that it can be dispatched again?
  27001. // TODO (fix): Do we need 100-expect support to provide a way to do this properly?
  27002. if (util.bodyLength(this.opts.body) === 0) {
  27003. this.opts.body
  27004. .on('data', function () {
  27005. assert(false)
  27006. })
  27007. }
  27008. if (typeof this.opts.body.readableDidRead !== 'boolean') {
  27009. this.opts.body[kBodyUsed] = false
  27010. EE.prototype.on.call(this.opts.body, 'data', function () {
  27011. this[kBodyUsed] = true
  27012. })
  27013. }
  27014. } else if (this.opts.body && typeof this.opts.body.pipeTo === 'function') {
  27015. // TODO (fix): We can't access ReadableStream internal state
  27016. // to determine whether or not it has been disturbed. This is just
  27017. // a workaround.
  27018. this.opts.body = new BodyAsyncIterable(this.opts.body)
  27019. } else if (
  27020. this.opts.body &&
  27021. typeof this.opts.body !== 'string' &&
  27022. !ArrayBuffer.isView(this.opts.body) &&
  27023. util.isIterable(this.opts.body)
  27024. ) {
  27025. // TODO: Should we allow re-using iterable if !this.opts.idempotent
  27026. // or through some other flag?
  27027. this.opts.body = new BodyAsyncIterable(this.opts.body)
  27028. }
  27029. }
  27030. onConnect (abort) {
  27031. this.abort = abort
  27032. this.handler.onConnect(abort, { history: this.history })
  27033. }
  27034. onUpgrade (statusCode, headers, socket) {
  27035. this.handler.onUpgrade(statusCode, headers, socket)
  27036. }
  27037. onError (error) {
  27038. this.handler.onError(error)
  27039. }
  27040. onHeaders (statusCode, headers, resume, statusText) {
  27041. this.location = this.history.length >= this.maxRedirections || util.isDisturbed(this.opts.body)
  27042. ? null
  27043. : parseLocation(statusCode, headers)
  27044. if (this.opts.origin) {
  27045. this.history.push(new URL(this.opts.path, this.opts.origin))
  27046. }
  27047. if (!this.location) {
  27048. return this.handler.onHeaders(statusCode, headers, resume, statusText)
  27049. }
  27050. const { origin, pathname, search } = util.parseURL(new URL(this.location, this.opts.origin && new URL(this.opts.path, this.opts.origin)))
  27051. const path = search ? `${pathname}${search}` : pathname
  27052. // Remove headers referring to the original URL.
  27053. // By default it is Host only, unless it's a 303 (see below), which removes also all Content-* headers.
  27054. // https://tools.ietf.org/html/rfc7231#section-6.4
  27055. this.opts.headers = cleanRequestHeaders(this.opts.headers, statusCode === 303, this.opts.origin !== origin)
  27056. this.opts.path = path
  27057. this.opts.origin = origin
  27058. this.opts.maxRedirections = 0
  27059. this.opts.query = null
  27060. // https://tools.ietf.org/html/rfc7231#section-6.4.4
  27061. // In case of HTTP 303, always replace method to be either HEAD or GET
  27062. if (statusCode === 303 && this.opts.method !== 'HEAD') {
  27063. this.opts.method = 'GET'
  27064. this.opts.body = null
  27065. }
  27066. }
  27067. onData (chunk) {
  27068. if (this.location) {
  27069. /*
  27070. https://tools.ietf.org/html/rfc7231#section-6.4
  27071. TLDR: undici always ignores 3xx response bodies.
  27072. Redirection is used to serve the requested resource from another URL, so it is assumes that
  27073. no body is generated (and thus can be ignored). Even though generating a body is not prohibited.
  27074. For status 301, 302, 303, 307 and 308 (the latter from RFC 7238), the specs mention that the body usually
  27075. (which means it's optional and not mandated) contain just an hyperlink to the value of
  27076. the Location response header, so the body can be ignored safely.
  27077. For status 300, which is "Multiple Choices", the spec mentions both generating a Location
  27078. response header AND a response body with the other possible location to follow.
  27079. Since the spec explicitily chooses not to specify a format for such body and leave it to
  27080. servers and browsers implementors, we ignore the body as there is no specified way to eventually parse it.
  27081. */
  27082. } else {
  27083. return this.handler.onData(chunk)
  27084. }
  27085. }
  27086. onComplete (trailers) {
  27087. if (this.location) {
  27088. /*
  27089. https://tools.ietf.org/html/rfc7231#section-6.4
  27090. TLDR: undici always ignores 3xx response trailers as they are not expected in case of redirections
  27091. and neither are useful if present.
  27092. See comment on onData method above for more detailed informations.
  27093. */
  27094. this.location = null
  27095. this.abort = null
  27096. this.dispatch(this.opts, this)
  27097. } else {
  27098. this.handler.onComplete(trailers)
  27099. }
  27100. }
  27101. onBodySent (chunk) {
  27102. if (this.handler.onBodySent) {
  27103. this.handler.onBodySent(chunk)
  27104. }
  27105. }
  27106. }
  27107. function parseLocation (statusCode, headers) {
  27108. if (redirectableStatusCodes.indexOf(statusCode) === -1) {
  27109. return null
  27110. }
  27111. for (let i = 0; i < headers.length; i += 2) {
  27112. if (headers[i].toString().toLowerCase() === 'location') {
  27113. return headers[i + 1]
  27114. }
  27115. }
  27116. }
  27117. // https://tools.ietf.org/html/rfc7231#section-6.4.4
  27118. function shouldRemoveHeader (header, removeContent, unknownOrigin) {
  27119. if (header.length === 4) {
  27120. return util.headerNameToString(header) === 'host'
  27121. }
  27122. if (removeContent && util.headerNameToString(header).startsWith('content-')) {
  27123. return true
  27124. }
  27125. if (unknownOrigin && (header.length === 13 || header.length === 6 || header.length === 19)) {
  27126. const name = util.headerNameToString(header)
  27127. return name === 'authorization' || name === 'cookie' || name === 'proxy-authorization'
  27128. }
  27129. return false
  27130. }
  27131. // https://tools.ietf.org/html/rfc7231#section-6.4
  27132. function cleanRequestHeaders (headers, removeContent, unknownOrigin) {
  27133. const ret = []
  27134. if (Array.isArray(headers)) {
  27135. for (let i = 0; i < headers.length; i += 2) {
  27136. if (!shouldRemoveHeader(headers[i], removeContent, unknownOrigin)) {
  27137. ret.push(headers[i], headers[i + 1])
  27138. }
  27139. }
  27140. } else if (headers && typeof headers === 'object') {
  27141. for (const key of Object.keys(headers)) {
  27142. if (!shouldRemoveHeader(key, removeContent, unknownOrigin)) {
  27143. ret.push(key, headers[key])
  27144. }
  27145. }
  27146. } else {
  27147. assert(headers == null, 'headers must be an object or an array')
  27148. }
  27149. return ret
  27150. }
  27151. module.exports = RedirectHandler
  27152. /***/ }),
  27153. /***/ 2286:
  27154. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  27155. const assert = __nccwpck_require__(9491)
  27156. const { kRetryHandlerDefaultRetry } = __nccwpck_require__(2785)
  27157. const { RequestRetryError } = __nccwpck_require__(8045)
  27158. const { isDisturbed, parseHeaders, parseRangeHeader } = __nccwpck_require__(3983)
  27159. function calculateRetryAfterHeader (retryAfter) {
  27160. const current = Date.now()
  27161. const diff = new Date(retryAfter).getTime() - current
  27162. return diff
  27163. }
  27164. class RetryHandler {
  27165. constructor (opts, handlers) {
  27166. const { retryOptions, ...dispatchOpts } = opts
  27167. const {
  27168. // Retry scoped
  27169. retry: retryFn,
  27170. maxRetries,
  27171. maxTimeout,
  27172. minTimeout,
  27173. timeoutFactor,
  27174. // Response scoped
  27175. methods,
  27176. errorCodes,
  27177. retryAfter,
  27178. statusCodes
  27179. } = retryOptions ?? {}
  27180. this.dispatch = handlers.dispatch
  27181. this.handler = handlers.handler
  27182. this.opts = dispatchOpts
  27183. this.abort = null
  27184. this.aborted = false
  27185. this.retryOpts = {
  27186. retry: retryFn ?? RetryHandler[kRetryHandlerDefaultRetry],
  27187. retryAfter: retryAfter ?? true,
  27188. maxTimeout: maxTimeout ?? 30 * 1000, // 30s,
  27189. timeout: minTimeout ?? 500, // .5s
  27190. timeoutFactor: timeoutFactor ?? 2,
  27191. maxRetries: maxRetries ?? 5,
  27192. // What errors we should retry
  27193. methods: methods ?? ['GET', 'HEAD', 'OPTIONS', 'PUT', 'DELETE', 'TRACE'],
  27194. // Indicates which errors to retry
  27195. statusCodes: statusCodes ?? [500, 502, 503, 504, 429],
  27196. // List of errors to retry
  27197. errorCodes: errorCodes ?? [
  27198. 'ECONNRESET',
  27199. 'ECONNREFUSED',
  27200. 'ENOTFOUND',
  27201. 'ENETDOWN',
  27202. 'ENETUNREACH',
  27203. 'EHOSTDOWN',
  27204. 'EHOSTUNREACH',
  27205. 'EPIPE'
  27206. ]
  27207. }
  27208. this.retryCount = 0
  27209. this.start = 0
  27210. this.end = null
  27211. this.etag = null
  27212. this.resume = null
  27213. // Handle possible onConnect duplication
  27214. this.handler.onConnect(reason => {
  27215. this.aborted = true
  27216. if (this.abort) {
  27217. this.abort(reason)
  27218. } else {
  27219. this.reason = reason
  27220. }
  27221. })
  27222. }
  27223. onRequestSent () {
  27224. if (this.handler.onRequestSent) {
  27225. this.handler.onRequestSent()
  27226. }
  27227. }
  27228. onUpgrade (statusCode, headers, socket) {
  27229. if (this.handler.onUpgrade) {
  27230. this.handler.onUpgrade(statusCode, headers, socket)
  27231. }
  27232. }
  27233. onConnect (abort) {
  27234. if (this.aborted) {
  27235. abort(this.reason)
  27236. } else {
  27237. this.abort = abort
  27238. }
  27239. }
  27240. onBodySent (chunk) {
  27241. if (this.handler.onBodySent) return this.handler.onBodySent(chunk)
  27242. }
  27243. static [kRetryHandlerDefaultRetry] (err, { state, opts }, cb) {
  27244. const { statusCode, code, headers } = err
  27245. const { method, retryOptions } = opts
  27246. const {
  27247. maxRetries,
  27248. timeout,
  27249. maxTimeout,
  27250. timeoutFactor,
  27251. statusCodes,
  27252. errorCodes,
  27253. methods
  27254. } = retryOptions
  27255. let { counter, currentTimeout } = state
  27256. currentTimeout =
  27257. currentTimeout != null && currentTimeout > 0 ? currentTimeout : timeout
  27258. // Any code that is not a Undici's originated and allowed to retry
  27259. if (
  27260. code &&
  27261. code !== 'UND_ERR_REQ_RETRY' &&
  27262. code !== 'UND_ERR_SOCKET' &&
  27263. !errorCodes.includes(code)
  27264. ) {
  27265. cb(err)
  27266. return
  27267. }
  27268. // If a set of method are provided and the current method is not in the list
  27269. if (Array.isArray(methods) && !methods.includes(method)) {
  27270. cb(err)
  27271. return
  27272. }
  27273. // If a set of status code are provided and the current status code is not in the list
  27274. if (
  27275. statusCode != null &&
  27276. Array.isArray(statusCodes) &&
  27277. !statusCodes.includes(statusCode)
  27278. ) {
  27279. cb(err)
  27280. return
  27281. }
  27282. // If we reached the max number of retries
  27283. if (counter > maxRetries) {
  27284. cb(err)
  27285. return
  27286. }
  27287. let retryAfterHeader = headers != null && headers['retry-after']
  27288. if (retryAfterHeader) {
  27289. retryAfterHeader = Number(retryAfterHeader)
  27290. retryAfterHeader = isNaN(retryAfterHeader)
  27291. ? calculateRetryAfterHeader(retryAfterHeader)
  27292. : retryAfterHeader * 1e3 // Retry-After is in seconds
  27293. }
  27294. const retryTimeout =
  27295. retryAfterHeader > 0
  27296. ? Math.min(retryAfterHeader, maxTimeout)
  27297. : Math.min(currentTimeout * timeoutFactor ** counter, maxTimeout)
  27298. state.currentTimeout = retryTimeout
  27299. setTimeout(() => cb(null), retryTimeout)
  27300. }
  27301. onHeaders (statusCode, rawHeaders, resume, statusMessage) {
  27302. const headers = parseHeaders(rawHeaders)
  27303. this.retryCount += 1
  27304. if (statusCode >= 300) {
  27305. this.abort(
  27306. new RequestRetryError('Request failed', statusCode, {
  27307. headers,
  27308. count: this.retryCount
  27309. })
  27310. )
  27311. return false
  27312. }
  27313. // Checkpoint for resume from where we left it
  27314. if (this.resume != null) {
  27315. this.resume = null
  27316. if (statusCode !== 206) {
  27317. return true
  27318. }
  27319. const contentRange = parseRangeHeader(headers['content-range'])
  27320. // If no content range
  27321. if (!contentRange) {
  27322. this.abort(
  27323. new RequestRetryError('Content-Range mismatch', statusCode, {
  27324. headers,
  27325. count: this.retryCount
  27326. })
  27327. )
  27328. return false
  27329. }
  27330. // Let's start with a weak etag check
  27331. if (this.etag != null && this.etag !== headers.etag) {
  27332. this.abort(
  27333. new RequestRetryError('ETag mismatch', statusCode, {
  27334. headers,
  27335. count: this.retryCount
  27336. })
  27337. )
  27338. return false
  27339. }
  27340. const { start, size, end = size } = contentRange
  27341. assert(this.start === start, 'content-range mismatch')
  27342. assert(this.end == null || this.end === end, 'content-range mismatch')
  27343. this.resume = resume
  27344. return true
  27345. }
  27346. if (this.end == null) {
  27347. if (statusCode === 206) {
  27348. // First time we receive 206
  27349. const range = parseRangeHeader(headers['content-range'])
  27350. if (range == null) {
  27351. return this.handler.onHeaders(
  27352. statusCode,
  27353. rawHeaders,
  27354. resume,
  27355. statusMessage
  27356. )
  27357. }
  27358. const { start, size, end = size } = range
  27359. assert(
  27360. start != null && Number.isFinite(start) && this.start !== start,
  27361. 'content-range mismatch'
  27362. )
  27363. assert(Number.isFinite(start))
  27364. assert(
  27365. end != null && Number.isFinite(end) && this.end !== end,
  27366. 'invalid content-length'
  27367. )
  27368. this.start = start
  27369. this.end = end
  27370. }
  27371. // We make our best to checkpoint the body for further range headers
  27372. if (this.end == null) {
  27373. const contentLength = headers['content-length']
  27374. this.end = contentLength != null ? Number(contentLength) : null
  27375. }
  27376. assert(Number.isFinite(this.start))
  27377. assert(
  27378. this.end == null || Number.isFinite(this.end),
  27379. 'invalid content-length'
  27380. )
  27381. this.resume = resume
  27382. this.etag = headers.etag != null ? headers.etag : null
  27383. return this.handler.onHeaders(
  27384. statusCode,
  27385. rawHeaders,
  27386. resume,
  27387. statusMessage
  27388. )
  27389. }
  27390. const err = new RequestRetryError('Request failed', statusCode, {
  27391. headers,
  27392. count: this.retryCount
  27393. })
  27394. this.abort(err)
  27395. return false
  27396. }
  27397. onData (chunk) {
  27398. this.start += chunk.length
  27399. return this.handler.onData(chunk)
  27400. }
  27401. onComplete (rawTrailers) {
  27402. this.retryCount = 0
  27403. return this.handler.onComplete(rawTrailers)
  27404. }
  27405. onError (err) {
  27406. if (this.aborted || isDisturbed(this.opts.body)) {
  27407. return this.handler.onError(err)
  27408. }
  27409. this.retryOpts.retry(
  27410. err,
  27411. {
  27412. state: { counter: this.retryCount++, currentTimeout: this.retryAfter },
  27413. opts: { retryOptions: this.retryOpts, ...this.opts }
  27414. },
  27415. onRetry.bind(this)
  27416. )
  27417. function onRetry (err) {
  27418. if (err != null || this.aborted || isDisturbed(this.opts.body)) {
  27419. return this.handler.onError(err)
  27420. }
  27421. if (this.start !== 0) {
  27422. this.opts = {
  27423. ...this.opts,
  27424. headers: {
  27425. ...this.opts.headers,
  27426. range: `bytes=${this.start}-${this.end ?? ''}`
  27427. }
  27428. }
  27429. }
  27430. try {
  27431. this.dispatch(this.opts, this)
  27432. } catch (err) {
  27433. this.handler.onError(err)
  27434. }
  27435. }
  27436. }
  27437. }
  27438. module.exports = RetryHandler
  27439. /***/ }),
  27440. /***/ 8861:
  27441. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  27442. "use strict";
  27443. const RedirectHandler = __nccwpck_require__(2860)
  27444. function createRedirectInterceptor ({ maxRedirections: defaultMaxRedirections }) {
  27445. return (dispatch) => {
  27446. return function Intercept (opts, handler) {
  27447. const { maxRedirections = defaultMaxRedirections } = opts
  27448. if (!maxRedirections) {
  27449. return dispatch(opts, handler)
  27450. }
  27451. const redirectHandler = new RedirectHandler(dispatch, maxRedirections, opts, handler)
  27452. opts = { ...opts, maxRedirections: 0 } // Stop sub dispatcher from also redirecting.
  27453. return dispatch(opts, redirectHandler)
  27454. }
  27455. }
  27456. }
  27457. module.exports = createRedirectInterceptor
  27458. /***/ }),
  27459. /***/ 953:
  27460. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  27461. "use strict";
  27462. Object.defineProperty(exports, "__esModule", ({ value: true }));
  27463. 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;
  27464. const utils_1 = __nccwpck_require__(1891);
  27465. // C headers
  27466. var ERROR;
  27467. (function (ERROR) {
  27468. ERROR[ERROR["OK"] = 0] = "OK";
  27469. ERROR[ERROR["INTERNAL"] = 1] = "INTERNAL";
  27470. ERROR[ERROR["STRICT"] = 2] = "STRICT";
  27471. ERROR[ERROR["LF_EXPECTED"] = 3] = "LF_EXPECTED";
  27472. ERROR[ERROR["UNEXPECTED_CONTENT_LENGTH"] = 4] = "UNEXPECTED_CONTENT_LENGTH";
  27473. ERROR[ERROR["CLOSED_CONNECTION"] = 5] = "CLOSED_CONNECTION";
  27474. ERROR[ERROR["INVALID_METHOD"] = 6] = "INVALID_METHOD";
  27475. ERROR[ERROR["INVALID_URL"] = 7] = "INVALID_URL";
  27476. ERROR[ERROR["INVALID_CONSTANT"] = 8] = "INVALID_CONSTANT";
  27477. ERROR[ERROR["INVALID_VERSION"] = 9] = "INVALID_VERSION";
  27478. ERROR[ERROR["INVALID_HEADER_TOKEN"] = 10] = "INVALID_HEADER_TOKEN";
  27479. ERROR[ERROR["INVALID_CONTENT_LENGTH"] = 11] = "INVALID_CONTENT_LENGTH";
  27480. ERROR[ERROR["INVALID_CHUNK_SIZE"] = 12] = "INVALID_CHUNK_SIZE";
  27481. ERROR[ERROR["INVALID_STATUS"] = 13] = "INVALID_STATUS";
  27482. ERROR[ERROR["INVALID_EOF_STATE"] = 14] = "INVALID_EOF_STATE";
  27483. ERROR[ERROR["INVALID_TRANSFER_ENCODING"] = 15] = "INVALID_TRANSFER_ENCODING";
  27484. ERROR[ERROR["CB_MESSAGE_BEGIN"] = 16] = "CB_MESSAGE_BEGIN";
  27485. ERROR[ERROR["CB_HEADERS_COMPLETE"] = 17] = "CB_HEADERS_COMPLETE";
  27486. ERROR[ERROR["CB_MESSAGE_COMPLETE"] = 18] = "CB_MESSAGE_COMPLETE";
  27487. ERROR[ERROR["CB_CHUNK_HEADER"] = 19] = "CB_CHUNK_HEADER";
  27488. ERROR[ERROR["CB_CHUNK_COMPLETE"] = 20] = "CB_CHUNK_COMPLETE";
  27489. ERROR[ERROR["PAUSED"] = 21] = "PAUSED";
  27490. ERROR[ERROR["PAUSED_UPGRADE"] = 22] = "PAUSED_UPGRADE";
  27491. ERROR[ERROR["PAUSED_H2_UPGRADE"] = 23] = "PAUSED_H2_UPGRADE";
  27492. ERROR[ERROR["USER"] = 24] = "USER";
  27493. })(ERROR = exports.ERROR || (exports.ERROR = {}));
  27494. var TYPE;
  27495. (function (TYPE) {
  27496. TYPE[TYPE["BOTH"] = 0] = "BOTH";
  27497. TYPE[TYPE["REQUEST"] = 1] = "REQUEST";
  27498. TYPE[TYPE["RESPONSE"] = 2] = "RESPONSE";
  27499. })(TYPE = exports.TYPE || (exports.TYPE = {}));
  27500. var FLAGS;
  27501. (function (FLAGS) {
  27502. FLAGS[FLAGS["CONNECTION_KEEP_ALIVE"] = 1] = "CONNECTION_KEEP_ALIVE";
  27503. FLAGS[FLAGS["CONNECTION_CLOSE"] = 2] = "CONNECTION_CLOSE";
  27504. FLAGS[FLAGS["CONNECTION_UPGRADE"] = 4] = "CONNECTION_UPGRADE";
  27505. FLAGS[FLAGS["CHUNKED"] = 8] = "CHUNKED";
  27506. FLAGS[FLAGS["UPGRADE"] = 16] = "UPGRADE";
  27507. FLAGS[FLAGS["CONTENT_LENGTH"] = 32] = "CONTENT_LENGTH";
  27508. FLAGS[FLAGS["SKIPBODY"] = 64] = "SKIPBODY";
  27509. FLAGS[FLAGS["TRAILING"] = 128] = "TRAILING";
  27510. // 1 << 8 is unused
  27511. FLAGS[FLAGS["TRANSFER_ENCODING"] = 512] = "TRANSFER_ENCODING";
  27512. })(FLAGS = exports.FLAGS || (exports.FLAGS = {}));
  27513. var LENIENT_FLAGS;
  27514. (function (LENIENT_FLAGS) {
  27515. LENIENT_FLAGS[LENIENT_FLAGS["HEADERS"] = 1] = "HEADERS";
  27516. LENIENT_FLAGS[LENIENT_FLAGS["CHUNKED_LENGTH"] = 2] = "CHUNKED_LENGTH";
  27517. LENIENT_FLAGS[LENIENT_FLAGS["KEEP_ALIVE"] = 4] = "KEEP_ALIVE";
  27518. })(LENIENT_FLAGS = exports.LENIENT_FLAGS || (exports.LENIENT_FLAGS = {}));
  27519. var METHODS;
  27520. (function (METHODS) {
  27521. METHODS[METHODS["DELETE"] = 0] = "DELETE";
  27522. METHODS[METHODS["GET"] = 1] = "GET";
  27523. METHODS[METHODS["HEAD"] = 2] = "HEAD";
  27524. METHODS[METHODS["POST"] = 3] = "POST";
  27525. METHODS[METHODS["PUT"] = 4] = "PUT";
  27526. /* pathological */
  27527. METHODS[METHODS["CONNECT"] = 5] = "CONNECT";
  27528. METHODS[METHODS["OPTIONS"] = 6] = "OPTIONS";
  27529. METHODS[METHODS["TRACE"] = 7] = "TRACE";
  27530. /* WebDAV */
  27531. METHODS[METHODS["COPY"] = 8] = "COPY";
  27532. METHODS[METHODS["LOCK"] = 9] = "LOCK";
  27533. METHODS[METHODS["MKCOL"] = 10] = "MKCOL";
  27534. METHODS[METHODS["MOVE"] = 11] = "MOVE";
  27535. METHODS[METHODS["PROPFIND"] = 12] = "PROPFIND";
  27536. METHODS[METHODS["PROPPATCH"] = 13] = "PROPPATCH";
  27537. METHODS[METHODS["SEARCH"] = 14] = "SEARCH";
  27538. METHODS[METHODS["UNLOCK"] = 15] = "UNLOCK";
  27539. METHODS[METHODS["BIND"] = 16] = "BIND";
  27540. METHODS[METHODS["REBIND"] = 17] = "REBIND";
  27541. METHODS[METHODS["UNBIND"] = 18] = "UNBIND";
  27542. METHODS[METHODS["ACL"] = 19] = "ACL";
  27543. /* subversion */
  27544. METHODS[METHODS["REPORT"] = 20] = "REPORT";
  27545. METHODS[METHODS["MKACTIVITY"] = 21] = "MKACTIVITY";
  27546. METHODS[METHODS["CHECKOUT"] = 22] = "CHECKOUT";
  27547. METHODS[METHODS["MERGE"] = 23] = "MERGE";
  27548. /* upnp */
  27549. METHODS[METHODS["M-SEARCH"] = 24] = "M-SEARCH";
  27550. METHODS[METHODS["NOTIFY"] = 25] = "NOTIFY";
  27551. METHODS[METHODS["SUBSCRIBE"] = 26] = "SUBSCRIBE";
  27552. METHODS[METHODS["UNSUBSCRIBE"] = 27] = "UNSUBSCRIBE";
  27553. /* RFC-5789 */
  27554. METHODS[METHODS["PATCH"] = 28] = "PATCH";
  27555. METHODS[METHODS["PURGE"] = 29] = "PURGE";
  27556. /* CalDAV */
  27557. METHODS[METHODS["MKCALENDAR"] = 30] = "MKCALENDAR";
  27558. /* RFC-2068, section 19.6.1.2 */
  27559. METHODS[METHODS["LINK"] = 31] = "LINK";
  27560. METHODS[METHODS["UNLINK"] = 32] = "UNLINK";
  27561. /* icecast */
  27562. METHODS[METHODS["SOURCE"] = 33] = "SOURCE";
  27563. /* RFC-7540, section 11.6 */
  27564. METHODS[METHODS["PRI"] = 34] = "PRI";
  27565. /* RFC-2326 RTSP */
  27566. METHODS[METHODS["DESCRIBE"] = 35] = "DESCRIBE";
  27567. METHODS[METHODS["ANNOUNCE"] = 36] = "ANNOUNCE";
  27568. METHODS[METHODS["SETUP"] = 37] = "SETUP";
  27569. METHODS[METHODS["PLAY"] = 38] = "PLAY";
  27570. METHODS[METHODS["PAUSE"] = 39] = "PAUSE";
  27571. METHODS[METHODS["TEARDOWN"] = 40] = "TEARDOWN";
  27572. METHODS[METHODS["GET_PARAMETER"] = 41] = "GET_PARAMETER";
  27573. METHODS[METHODS["SET_PARAMETER"] = 42] = "SET_PARAMETER";
  27574. METHODS[METHODS["REDIRECT"] = 43] = "REDIRECT";
  27575. METHODS[METHODS["RECORD"] = 44] = "RECORD";
  27576. /* RAOP */
  27577. METHODS[METHODS["FLUSH"] = 45] = "FLUSH";
  27578. })(METHODS = exports.METHODS || (exports.METHODS = {}));
  27579. exports.METHODS_HTTP = [
  27580. METHODS.DELETE,
  27581. METHODS.GET,
  27582. METHODS.HEAD,
  27583. METHODS.POST,
  27584. METHODS.PUT,
  27585. METHODS.CONNECT,
  27586. METHODS.OPTIONS,
  27587. METHODS.TRACE,
  27588. METHODS.COPY,
  27589. METHODS.LOCK,
  27590. METHODS.MKCOL,
  27591. METHODS.MOVE,
  27592. METHODS.PROPFIND,
  27593. METHODS.PROPPATCH,
  27594. METHODS.SEARCH,
  27595. METHODS.UNLOCK,
  27596. METHODS.BIND,
  27597. METHODS.REBIND,
  27598. METHODS.UNBIND,
  27599. METHODS.ACL,
  27600. METHODS.REPORT,
  27601. METHODS.MKACTIVITY,
  27602. METHODS.CHECKOUT,
  27603. METHODS.MERGE,
  27604. METHODS['M-SEARCH'],
  27605. METHODS.NOTIFY,
  27606. METHODS.SUBSCRIBE,
  27607. METHODS.UNSUBSCRIBE,
  27608. METHODS.PATCH,
  27609. METHODS.PURGE,
  27610. METHODS.MKCALENDAR,
  27611. METHODS.LINK,
  27612. METHODS.UNLINK,
  27613. METHODS.PRI,
  27614. // TODO(indutny): should we allow it with HTTP?
  27615. METHODS.SOURCE,
  27616. ];
  27617. exports.METHODS_ICE = [
  27618. METHODS.SOURCE,
  27619. ];
  27620. exports.METHODS_RTSP = [
  27621. METHODS.OPTIONS,
  27622. METHODS.DESCRIBE,
  27623. METHODS.ANNOUNCE,
  27624. METHODS.SETUP,
  27625. METHODS.PLAY,
  27626. METHODS.PAUSE,
  27627. METHODS.TEARDOWN,
  27628. METHODS.GET_PARAMETER,
  27629. METHODS.SET_PARAMETER,
  27630. METHODS.REDIRECT,
  27631. METHODS.RECORD,
  27632. METHODS.FLUSH,
  27633. // For AirPlay
  27634. METHODS.GET,
  27635. METHODS.POST,
  27636. ];
  27637. exports.METHOD_MAP = utils_1.enumToMap(METHODS);
  27638. exports.H_METHOD_MAP = {};
  27639. Object.keys(exports.METHOD_MAP).forEach((key) => {
  27640. if (/^H/.test(key)) {
  27641. exports.H_METHOD_MAP[key] = exports.METHOD_MAP[key];
  27642. }
  27643. });
  27644. var FINISH;
  27645. (function (FINISH) {
  27646. FINISH[FINISH["SAFE"] = 0] = "SAFE";
  27647. FINISH[FINISH["SAFE_WITH_CB"] = 1] = "SAFE_WITH_CB";
  27648. FINISH[FINISH["UNSAFE"] = 2] = "UNSAFE";
  27649. })(FINISH = exports.FINISH || (exports.FINISH = {}));
  27650. exports.ALPHA = [];
  27651. for (let i = 'A'.charCodeAt(0); i <= 'Z'.charCodeAt(0); i++) {
  27652. // Upper case
  27653. exports.ALPHA.push(String.fromCharCode(i));
  27654. // Lower case
  27655. exports.ALPHA.push(String.fromCharCode(i + 0x20));
  27656. }
  27657. exports.NUM_MAP = {
  27658. 0: 0, 1: 1, 2: 2, 3: 3, 4: 4,
  27659. 5: 5, 6: 6, 7: 7, 8: 8, 9: 9,
  27660. };
  27661. exports.HEX_MAP = {
  27662. 0: 0, 1: 1, 2: 2, 3: 3, 4: 4,
  27663. 5: 5, 6: 6, 7: 7, 8: 8, 9: 9,
  27664. A: 0XA, B: 0XB, C: 0XC, D: 0XD, E: 0XE, F: 0XF,
  27665. a: 0xa, b: 0xb, c: 0xc, d: 0xd, e: 0xe, f: 0xf,
  27666. };
  27667. exports.NUM = [
  27668. '0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
  27669. ];
  27670. exports.ALPHANUM = exports.ALPHA.concat(exports.NUM);
  27671. exports.MARK = ['-', '_', '.', '!', '~', '*', '\'', '(', ')'];
  27672. exports.USERINFO_CHARS = exports.ALPHANUM
  27673. .concat(exports.MARK)
  27674. .concat(['%', ';', ':', '&', '=', '+', '$', ',']);
  27675. // TODO(indutny): use RFC
  27676. exports.STRICT_URL_CHAR = [
  27677. '!', '"', '$', '%', '&', '\'',
  27678. '(', ')', '*', '+', ',', '-', '.', '/',
  27679. ':', ';', '<', '=', '>',
  27680. '@', '[', '\\', ']', '^', '_',
  27681. '`',
  27682. '{', '|', '}', '~',
  27683. ].concat(exports.ALPHANUM);
  27684. exports.URL_CHAR = exports.STRICT_URL_CHAR
  27685. .concat(['\t', '\f']);
  27686. // All characters with 0x80 bit set to 1
  27687. for (let i = 0x80; i <= 0xff; i++) {
  27688. exports.URL_CHAR.push(i);
  27689. }
  27690. exports.HEX = exports.NUM.concat(['a', 'b', 'c', 'd', 'e', 'f', 'A', 'B', 'C', 'D', 'E', 'F']);
  27691. /* Tokens as defined by rfc 2616. Also lowercases them.
  27692. * token = 1*<any CHAR except CTLs or separators>
  27693. * separators = "(" | ")" | "<" | ">" | "@"
  27694. * | "," | ";" | ":" | "\" | <">
  27695. * | "/" | "[" | "]" | "?" | "="
  27696. * | "{" | "}" | SP | HT
  27697. */
  27698. exports.STRICT_TOKEN = [
  27699. '!', '#', '$', '%', '&', '\'',
  27700. '*', '+', '-', '.',
  27701. '^', '_', '`',
  27702. '|', '~',
  27703. ].concat(exports.ALPHANUM);
  27704. exports.TOKEN = exports.STRICT_TOKEN.concat([' ']);
  27705. /*
  27706. * Verify that a char is a valid visible (printable) US-ASCII
  27707. * character or %x80-FF
  27708. */
  27709. exports.HEADER_CHARS = ['\t'];
  27710. for (let i = 32; i <= 255; i++) {
  27711. if (i !== 127) {
  27712. exports.HEADER_CHARS.push(i);
  27713. }
  27714. }
  27715. // ',' = \x44
  27716. exports.CONNECTION_TOKEN_CHARS = exports.HEADER_CHARS.filter((c) => c !== 44);
  27717. exports.MAJOR = exports.NUM_MAP;
  27718. exports.MINOR = exports.MAJOR;
  27719. var HEADER_STATE;
  27720. (function (HEADER_STATE) {
  27721. HEADER_STATE[HEADER_STATE["GENERAL"] = 0] = "GENERAL";
  27722. HEADER_STATE[HEADER_STATE["CONNECTION"] = 1] = "CONNECTION";
  27723. HEADER_STATE[HEADER_STATE["CONTENT_LENGTH"] = 2] = "CONTENT_LENGTH";
  27724. HEADER_STATE[HEADER_STATE["TRANSFER_ENCODING"] = 3] = "TRANSFER_ENCODING";
  27725. HEADER_STATE[HEADER_STATE["UPGRADE"] = 4] = "UPGRADE";
  27726. HEADER_STATE[HEADER_STATE["CONNECTION_KEEP_ALIVE"] = 5] = "CONNECTION_KEEP_ALIVE";
  27727. HEADER_STATE[HEADER_STATE["CONNECTION_CLOSE"] = 6] = "CONNECTION_CLOSE";
  27728. HEADER_STATE[HEADER_STATE["CONNECTION_UPGRADE"] = 7] = "CONNECTION_UPGRADE";
  27729. HEADER_STATE[HEADER_STATE["TRANSFER_ENCODING_CHUNKED"] = 8] = "TRANSFER_ENCODING_CHUNKED";
  27730. })(HEADER_STATE = exports.HEADER_STATE || (exports.HEADER_STATE = {}));
  27731. exports.SPECIAL_HEADERS = {
  27732. 'connection': HEADER_STATE.CONNECTION,
  27733. 'content-length': HEADER_STATE.CONTENT_LENGTH,
  27734. 'proxy-connection': HEADER_STATE.CONNECTION,
  27735. 'transfer-encoding': HEADER_STATE.TRANSFER_ENCODING,
  27736. 'upgrade': HEADER_STATE.UPGRADE,
  27737. };
  27738. //# sourceMappingURL=constants.js.map
  27739. /***/ }),
  27740. /***/ 1145:
  27741. /***/ ((module) => {
  27742. module.exports = 'AGFzbQEAAAABMAhgAX8Bf2ADf39/AX9gBH9/f38Bf2AAAGADf39/AGABfwBgAn9/AGAGf39/f39/AALLAQgDZW52GHdhc21fb25faGVhZGVyc19jb21wbGV0ZQACA2VudhV3YXNtX29uX21lc3NhZ2VfYmVnaW4AAANlbnYLd2FzbV9vbl91cmwAAQNlbnYOd2FzbV9vbl9zdGF0dXMAAQNlbnYUd2FzbV9vbl9oZWFkZXJfZmllbGQAAQNlbnYUd2FzbV9vbl9oZWFkZXJfdmFsdWUAAQNlbnYMd2FzbV9vbl9ib2R5AAEDZW52GHdhc21fb25fbWVzc2FnZV9jb21wbGV0ZQAAA0ZFAwMEAAAFAAAAAAAABQEFAAUFBQAABgAAAAAGBgYGAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAAABAQcAAAUFAwABBAUBcAESEgUDAQACBggBfwFBgNQECwfRBSIGbWVtb3J5AgALX2luaXRpYWxpemUACRlfX2luZGlyZWN0X2Z1bmN0aW9uX3RhYmxlAQALbGxodHRwX2luaXQAChhsbGh0dHBfc2hvdWxkX2tlZXBfYWxpdmUAQQxsbGh0dHBfYWxsb2MADAZtYWxsb2MARgtsbGh0dHBfZnJlZQANBGZyZWUASA9sbGh0dHBfZ2V0X3R5cGUADhVsbGh0dHBfZ2V0X2h0dHBfbWFqb3IADxVsbGh0dHBfZ2V0X2h0dHBfbWlub3IAEBFsbGh0dHBfZ2V0X21ldGhvZAARFmxsaHR0cF9nZXRfc3Rhd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ASEQDAoLQboBIRAMCQtBuwEhEAwIC0HGASEQDAcLQbwBIRAMBgtBvQEhEAwFC0G+ASEQDAQLQb8BIRAMAwtBwAEhEAwCC0HCASEQDAELQcEBIRALA0ACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJ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E2AhQgAEH9koCAADYCECAAQQc2AgwMqAELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDEILIABB0gA2AhwgACABNgIUIAAgEDYCDEEAIRAMpwELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDEILIABB0wA2AhwgACABNgIUIAAgEDYCDEEAIRAMpgELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDEYLIABB5QA2AhwgACABNgIUIAAgEDYCDEEAIRAMpQELIAAoAgQhASAAQQA2AgQCQCAAIAEgFBCngICAACIBDQAgFCEBDD8LIABB0gA2AhwgACAUNgIUIAAgATYCDEEAIRAMpAELIAAoAgQhASAAQQA2AgQCQCAAIAEgFBCngICAACIBDQAgFCEBDD8LIABB0wA2AhwgACAUNgIUIAAgATYCDEEAIRAMowELIAAoAgQhASAAQQA2AgQCQCAAIAEgFBCngICAACIBDQAgFCEBDEMLIABB5QA2AhwgACAUNgIUIAAgATYCDEEAIRAMogELIABBADYCHCAAIBQ2AhQgAEHDj4CAADYCECAAQQc2AgxBACEQDKEBCyAAQQA2AhwgACABNgIUIABBw4+AgAA2AhAgAEEHNgIMQQAhEAygAQtBACEQIABBADYCHCAAIBQ2AhQgAEGMnICAADYCECAAQQc2AgwMnwELIABBADYCHCAAIBQ2AhQgAEGMnICAADYCECAAQQc2AgxBACEQDJ4BCyAAQQA2AhwgACAUNgIUIABB/pGAgAA2AhAgAEEHNgIMQQAhEAydAQsgAEEANgIcIAAgATYCFCAAQY6bgIAANgIQIABBBjYCDEEAIRAMnAELIBBBFUYNVyAAQQA2AhwgACABNgIUIABBzI6AgAA2AhAgAEEgNgIMQQAhEAybAQsgAEEANgIAIBBBAWohAUEkIRALIAAgEDoAKSAAKAIEIRAgAEEANgIEIAAgECABEKuAgIAAIhANVCABIQEMPgsgAEEANgIAC0EAIRAgAEEANgIcIAAgBDYCFCAAQfGbgIAANgIQIABBBjYCDAyXAQsgAUEVRg1QIAB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AkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIBAOxwEAAQIDBAUGBwgJCgsMDQ4PEBESExQVFhcYGRobHB4fICEjJSg/QEFERUZHSElKS0xNT1BRUlPeA1dZW1xdYGJlZmdoaWprbG1vcHFyc3R1dnd4eXp7fH1+gAGCAYUBhgGHAYkBiwGMAY0BjgGPAZABkQGUAZUBlgGXAZgBmQGaA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AAAAADAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwAAAAAAAAMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAE5PVU5DRUVDS09VVE5FQ1RFVEVDUklCRUxVU0hFVEVBRFNFQVJDSFJHRUNUSVZJVFlMRU5EQVJWRU9USUZZUFRJT05TQ0hTRUFZU1RBVENIR0VPUkRJUkVDVE9SVFJDSFBBUkFNRVRFUlVSQ0VCU0NSSUJFQVJET1dOQUNFSU5ETktDS1VCU0NSSUJFSFRUUC9BRFRQLw=='
  27747. /***/ }),
  27748. /***/ 1891:
  27749. /***/ ((__unused_webpack_module, exports) => {
  27750. "use strict";
  27751. Object.defineProperty(exports, "__esModule", ({ value: true }));
  27752. exports.enumToMap = void 0;
  27753. function enumToMap(obj) {
  27754. const res = {};
  27755. Object.keys(obj).forEach((key) => {
  27756. const value = obj[key];
  27757. if (typeof value === 'number') {
  27758. res[key] = value;
  27759. }
  27760. });
  27761. return res;
  27762. }
  27763. exports.enumToMap = enumToMap;
  27764. //# sourceMappingURL=utils.js.map
  27765. /***/ }),
  27766. /***/ 6771:
  27767. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  27768. "use strict";
  27769. const { kClients } = __nccwpck_require__(2785)
  27770. const Agent = __nccwpck_require__(7890)
  27771. const {
  27772. kAgent,
  27773. kMockAgentSet,
  27774. kMockAgentGet,
  27775. kDispatches,
  27776. kIsMockActive,
  27777. kNetConnect,
  27778. kGetNetConnect,
  27779. kOptions,
  27780. kFactory
  27781. } = __nccwpck_require__(4347)
  27782. const MockClient = __nccwpck_require__(8687)
  27783. const MockPool = __nccwpck_require__(6193)
  27784. const { matchValue, buildMockOptions } = __nccwpck_require__(9323)
  27785. const { InvalidArgumentError, UndiciError } = __nccwpck_require__(8045)
  27786. const Dispatcher = __nccwpck_require__(412)
  27787. const Pluralizer = __nccwpck_require__(8891)
  27788. const PendingInterceptorsFormatter = __nccwpck_require__(6823)
  27789. class FakeWeakRef {
  27790. constructor (value) {
  27791. this.value = value
  27792. }
  27793. deref () {
  27794. return this.value
  27795. }
  27796. }
  27797. class MockAgent extends Dispatcher {
  27798. constructor (opts) {
  27799. super(opts)
  27800. this[kNetConnect] = true
  27801. this[kIsMockActive] = true
  27802. // Instantiate Agent and encapsulate
  27803. if ((opts && opts.agent && typeof opts.agent.dispatch !== 'function')) {
  27804. throw new InvalidArgumentError('Argument opts.agent must implement Agent')
  27805. }
  27806. const agent = opts && opts.agent ? opts.agent : new Agent(opts)
  27807. this[kAgent] = agent
  27808. this[kClients] = agent[kClients]
  27809. this[kOptions] = buildMockOptions(opts)
  27810. }
  27811. get (origin) {
  27812. let dispatcher = this[kMockAgentGet](origin)
  27813. if (!dispatcher) {
  27814. dispatcher = this[kFactory](origin)
  27815. this[kMockAgentSet](origin, dispatcher)
  27816. }
  27817. return dispatcher
  27818. }
  27819. dispatch (opts, handler) {
  27820. // Call MockAgent.get to perform additional setup before dispatching as normal
  27821. this.get(opts.origin)
  27822. return this[kAgent].dispatch(opts, handler)
  27823. }
  27824. async close () {
  27825. await this[kAgent].close()
  27826. this[kClients].clear()
  27827. }
  27828. deactivate () {
  27829. this[kIsMockActive] = false
  27830. }
  27831. activate () {
  27832. this[kIsMockActive] = true
  27833. }
  27834. enableNetConnect (matcher) {
  27835. if (typeof matcher === 'string' || typeof matcher === 'function' || matcher instanceof RegExp) {
  27836. if (Array.isArray(this[kNetConnect])) {
  27837. this[kNetConnect].push(matcher)
  27838. } else {
  27839. this[kNetConnect] = [matcher]
  27840. }
  27841. } else if (typeof matcher === 'undefined') {
  27842. this[kNetConnect] = true
  27843. } else {
  27844. throw new InvalidArgumentError('Unsupported matcher. Must be one of String|Function|RegExp.')
  27845. }
  27846. }
  27847. disableNetConnect () {
  27848. this[kNetConnect] = false
  27849. }
  27850. // This is required to bypass issues caused by using global symbols - see:
  27851. // https://github.com/nodejs/undici/issues/1447
  27852. get isMockActive () {
  27853. return this[kIsMockActive]
  27854. }
  27855. [kMockAgentSet] (origin, dispatcher) {
  27856. this[kClients].set(origin, new FakeWeakRef(dispatcher))
  27857. }
  27858. [kFactory] (origin) {
  27859. const mockOptions = Object.assign({ agent: this }, this[kOptions])
  27860. return this[kOptions] && this[kOptions].connections === 1
  27861. ? new MockClient(origin, mockOptions)
  27862. : new MockPool(origin, mockOptions)
  27863. }
  27864. [kMockAgentGet] (origin) {
  27865. // First check if we can immediately find it
  27866. const ref = this[kClients].get(origin)
  27867. if (ref) {
  27868. return ref.deref()
  27869. }
  27870. // If the origin is not a string create a dummy parent pool and return to user
  27871. if (typeof origin !== 'string') {
  27872. const dispatcher = this[kFactory]('http://localhost:9999')
  27873. this[kMockAgentSet](origin, dispatcher)
  27874. return dispatcher
  27875. }
  27876. // If we match, create a pool and assign the same dispatches
  27877. for (const [keyMatcher, nonExplicitRef] of Array.from(this[kClients])) {
  27878. const nonExplicitDispatcher = nonExplicitRef.deref()
  27879. if (nonExplicitDispatcher && typeof keyMatcher !== 'string' && matchValue(keyMatcher, origin)) {
  27880. const dispatcher = this[kFactory](origin)
  27881. this[kMockAgentSet](origin, dispatcher)
  27882. dispatcher[kDispatches] = nonExplicitDispatcher[kDispatches]
  27883. return dispatcher
  27884. }
  27885. }
  27886. }
  27887. [kGetNetConnect] () {
  27888. return this[kNetConnect]
  27889. }
  27890. pendingInterceptors () {
  27891. const mockAgentClients = this[kClients]
  27892. return Array.from(mockAgentClients.entries())
  27893. .flatMap(([origin, scope]) => scope.deref()[kDispatches].map(dispatch => ({ ...dispatch, origin })))
  27894. .filter(({ pending }) => pending)
  27895. }
  27896. assertNoPendingInterceptors ({ pendingInterceptorsFormatter = new PendingInterceptorsFormatter() } = {}) {
  27897. const pending = this.pendingInterceptors()
  27898. if (pending.length === 0) {
  27899. return
  27900. }
  27901. const pluralizer = new Pluralizer('interceptor', 'interceptors').pluralize(pending.length)
  27902. throw new UndiciError(`
  27903. ${pluralizer.count} ${pluralizer.noun} ${pluralizer.is} pending:
  27904. ${pendingInterceptorsFormatter.format(pending)}
  27905. `.trim())
  27906. }
  27907. }
  27908. module.exports = MockAgent
  27909. /***/ }),
  27910. /***/ 8687:
  27911. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  27912. "use strict";
  27913. const { promisify } = __nccwpck_require__(3837)
  27914. const Client = __nccwpck_require__(3598)
  27915. const { buildMockDispatch } = __nccwpck_require__(9323)
  27916. const {
  27917. kDispatches,
  27918. kMockAgent,
  27919. kClose,
  27920. kOriginalClose,
  27921. kOrigin,
  27922. kOriginalDispatch,
  27923. kConnected
  27924. } = __nccwpck_require__(4347)
  27925. const { MockInterceptor } = __nccwpck_require__(410)
  27926. const Symbols = __nccwpck_require__(2785)
  27927. const { InvalidArgumentError } = __nccwpck_require__(8045)
  27928. /**
  27929. * MockClient provides an API that extends the Client to influence the mockDispatches.
  27930. */
  27931. class MockClient extends Client {
  27932. constructor (origin, opts) {
  27933. super(origin, opts)
  27934. if (!opts || !opts.agent || typeof opts.agent.dispatch !== 'function') {
  27935. throw new InvalidArgumentError('Argument opts.agent must implement Agent')
  27936. }
  27937. this[kMockAgent] = opts.agent
  27938. this[kOrigin] = origin
  27939. this[kDispatches] = []
  27940. this[kConnected] = 1
  27941. this[kOriginalDispatch] = this.dispatch
  27942. this[kOriginalClose] = this.close.bind(this)
  27943. this.dispatch = buildMockDispatch.call(this)
  27944. this.close = this[kClose]
  27945. }
  27946. get [Symbols.kConnected] () {
  27947. return this[kConnected]
  27948. }
  27949. /**
  27950. * Sets up the base interceptor for mocking replies from undici.
  27951. */
  27952. intercept (opts) {
  27953. return new MockInterceptor(opts, this[kDispatches])
  27954. }
  27955. async [kClose] () {
  27956. await promisify(this[kOriginalClose])()
  27957. this[kConnected] = 0
  27958. this[kMockAgent][Symbols.kClients].delete(this[kOrigin])
  27959. }
  27960. }
  27961. module.exports = MockClient
  27962. /***/ }),
  27963. /***/ 888:
  27964. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  27965. "use strict";
  27966. const { UndiciError } = __nccwpck_require__(8045)
  27967. class MockNotMatchedError extends UndiciError {
  27968. constructor (message) {
  27969. super(message)
  27970. Error.captureStackTrace(this, MockNotMatchedError)
  27971. this.name = 'MockNotMatchedError'
  27972. this.message = message || 'The request does not match any registered mock dispatches'
  27973. this.code = 'UND_MOCK_ERR_MOCK_NOT_MATCHED'
  27974. }
  27975. }
  27976. module.exports = {
  27977. MockNotMatchedError
  27978. }
  27979. /***/ }),
  27980. /***/ 410:
  27981. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  27982. "use strict";
  27983. const { getResponseData, buildKey, addMockDispatch } = __nccwpck_require__(9323)
  27984. const {
  27985. kDispatches,
  27986. kDispatchKey,
  27987. kDefaultHeaders,
  27988. kDefaultTrailers,
  27989. kContentLength,
  27990. kMockDispatch
  27991. } = __nccwpck_require__(4347)
  27992. const { InvalidArgumentError } = __nccwpck_require__(8045)
  27993. const { buildURL } = __nccwpck_require__(3983)
  27994. /**
  27995. * Defines the scope API for an interceptor reply
  27996. */
  27997. class MockScope {
  27998. constructor (mockDispatch) {
  27999. this[kMockDispatch] = mockDispatch
  28000. }
  28001. /**
  28002. * Delay a reply by a set amount in ms.
  28003. */
  28004. delay (waitInMs) {
  28005. if (typeof waitInMs !== 'number' || !Number.isInteger(waitInMs) || waitInMs <= 0) {
  28006. throw new InvalidArgumentError('waitInMs must be a valid integer > 0')
  28007. }
  28008. this[kMockDispatch].delay = waitInMs
  28009. return this
  28010. }
  28011. /**
  28012. * For a defined reply, never mark as consumed.
  28013. */
  28014. persist () {
  28015. this[kMockDispatch].persist = true
  28016. return this
  28017. }
  28018. /**
  28019. * Allow one to define a reply for a set amount of matching requests.
  28020. */
  28021. times (repeatTimes) {
  28022. if (typeof repeatTimes !== 'number' || !Number.isInteger(repeatTimes) || repeatTimes <= 0) {
  28023. throw new InvalidArgumentError('repeatTimes must be a valid integer > 0')
  28024. }
  28025. this[kMockDispatch].times = repeatTimes
  28026. return this
  28027. }
  28028. }
  28029. /**
  28030. * Defines an interceptor for a Mock
  28031. */
  28032. class MockInterceptor {
  28033. constructor (opts, mockDispatches) {
  28034. if (typeof opts !== 'object') {
  28035. throw new InvalidArgumentError('opts must be an object')
  28036. }
  28037. if (typeof opts.path === 'undefined') {
  28038. throw new InvalidArgumentError('opts.path must be defined')
  28039. }
  28040. if (typeof opts.method === 'undefined') {
  28041. opts.method = 'GET'
  28042. }
  28043. // See https://github.com/nodejs/undici/issues/1245
  28044. // As per RFC 3986, clients are not supposed to send URI
  28045. // fragments to servers when they retrieve a document,
  28046. if (typeof opts.path === 'string') {
  28047. if (opts.query) {
  28048. opts.path = buildURL(opts.path, opts.query)
  28049. } else {
  28050. // Matches https://github.com/nodejs/undici/blob/main/lib/fetch/index.js#L1811
  28051. const parsedURL = new URL(opts.path, 'data://')
  28052. opts.path = parsedURL.pathname + parsedURL.search
  28053. }
  28054. }
  28055. if (typeof opts.method === 'string') {
  28056. opts.method = opts.method.toUpperCase()
  28057. }
  28058. this[kDispatchKey] = buildKey(opts)
  28059. this[kDispatches] = mockDispatches
  28060. this[kDefaultHeaders] = {}
  28061. this[kDefaultTrailers] = {}
  28062. this[kContentLength] = false
  28063. }
  28064. createMockScopeDispatchData (statusCode, data, responseOptions = {}) {
  28065. const responseData = getResponseData(data)
  28066. const contentLength = this[kContentLength] ? { 'content-length': responseData.length } : {}
  28067. const headers = { ...this[kDefaultHeaders], ...contentLength, ...responseOptions.headers }
  28068. const trailers = { ...this[kDefaultTrailers], ...responseOptions.trailers }
  28069. return { statusCode, data, headers, trailers }
  28070. }
  28071. validateReplyParameters (statusCode, data, responseOptions) {
  28072. if (typeof statusCode === 'undefined') {
  28073. throw new InvalidArgumentError('statusCode must be defined')
  28074. }
  28075. if (typeof data === 'undefined') {
  28076. throw new InvalidArgumentError('data must be defined')
  28077. }
  28078. if (typeof responseOptions !== 'object') {
  28079. throw new InvalidArgumentError('responseOptions must be an object')
  28080. }
  28081. }
  28082. /**
  28083. * Mock an undici request with a defined reply.
  28084. */
  28085. reply (replyData) {
  28086. // Values of reply aren't available right now as they
  28087. // can only be available when the reply callback is invoked.
  28088. if (typeof replyData === 'function') {
  28089. // We'll first wrap the provided callback in another function,
  28090. // this function will properly resolve the data from the callback
  28091. // when invoked.
  28092. const wrappedDefaultsCallback = (opts) => {
  28093. // Our reply options callback contains the parameter for statusCode, data and options.
  28094. const resolvedData = replyData(opts)
  28095. // Check if it is in the right format
  28096. if (typeof resolvedData !== 'object') {
  28097. throw new InvalidArgumentError('reply options callback must return an object')
  28098. }
  28099. const { statusCode, data = '', responseOptions = {} } = resolvedData
  28100. this.validateReplyParameters(statusCode, data, responseOptions)
  28101. // Since the values can be obtained immediately we return them
  28102. // from this higher order function that will be resolved later.
  28103. return {
  28104. ...this.createMockScopeDispatchData(statusCode, data, responseOptions)
  28105. }
  28106. }
  28107. // Add usual dispatch data, but this time set the data parameter to function that will eventually provide data.
  28108. const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], wrappedDefaultsCallback)
  28109. return new MockScope(newMockDispatch)
  28110. }
  28111. // We can have either one or three parameters, if we get here,
  28112. // we should have 1-3 parameters. So we spread the arguments of
  28113. // this function to obtain the parameters, since replyData will always
  28114. // just be the statusCode.
  28115. const [statusCode, data = '', responseOptions = {}] = [...arguments]
  28116. this.validateReplyParameters(statusCode, data, responseOptions)
  28117. // Send in-already provided data like usual
  28118. const dispatchData = this.createMockScopeDispatchData(statusCode, data, responseOptions)
  28119. const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], dispatchData)
  28120. return new MockScope(newMockDispatch)
  28121. }
  28122. /**
  28123. * Mock an undici request with a defined error.
  28124. */
  28125. replyWithError (error) {
  28126. if (typeof error === 'undefined') {
  28127. throw new InvalidArgumentError('error must be defined')
  28128. }
  28129. const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], { error })
  28130. return new MockScope(newMockDispatch)
  28131. }
  28132. /**
  28133. * Set default reply headers on the interceptor for subsequent replies
  28134. */
  28135. defaultReplyHeaders (headers) {
  28136. if (typeof headers === 'undefined') {
  28137. throw new InvalidArgumentError('headers must be defined')
  28138. }
  28139. this[kDefaultHeaders] = headers
  28140. return this
  28141. }
  28142. /**
  28143. * Set default reply trailers on the interceptor for subsequent replies
  28144. */
  28145. defaultReplyTrailers (trailers) {
  28146. if (typeof trailers === 'undefined') {
  28147. throw new InvalidArgumentError('trailers must be defined')
  28148. }
  28149. this[kDefaultTrailers] = trailers
  28150. return this
  28151. }
  28152. /**
  28153. * Set reply content length header for replies on the interceptor
  28154. */
  28155. replyContentLength () {
  28156. this[kContentLength] = true
  28157. return this
  28158. }
  28159. }
  28160. module.exports.MockInterceptor = MockInterceptor
  28161. module.exports.MockScope = MockScope
  28162. /***/ }),
  28163. /***/ 6193:
  28164. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  28165. "use strict";
  28166. const { promisify } = __nccwpck_require__(3837)
  28167. const Pool = __nccwpck_require__(4634)
  28168. const { buildMockDispatch } = __nccwpck_require__(9323)
  28169. const {
  28170. kDispatches,
  28171. kMockAgent,
  28172. kClose,
  28173. kOriginalClose,
  28174. kOrigin,
  28175. kOriginalDispatch,
  28176. kConnected
  28177. } = __nccwpck_require__(4347)
  28178. const { MockInterceptor } = __nccwpck_require__(410)
  28179. const Symbols = __nccwpck_require__(2785)
  28180. const { InvalidArgumentError } = __nccwpck_require__(8045)
  28181. /**
  28182. * MockPool provides an API that extends the Pool to influence the mockDispatches.
  28183. */
  28184. class MockPool extends Pool {
  28185. constructor (origin, opts) {
  28186. super(origin, opts)
  28187. if (!opts || !opts.agent || typeof opts.agent.dispatch !== 'function') {
  28188. throw new InvalidArgumentError('Argument opts.agent must implement Agent')
  28189. }
  28190. this[kMockAgent] = opts.agent
  28191. this[kOrigin] = origin
  28192. this[kDispatches] = []
  28193. this[kConnected] = 1
  28194. this[kOriginalDispatch] = this.dispatch
  28195. this[kOriginalClose] = this.close.bind(this)
  28196. this.dispatch = buildMockDispatch.call(this)
  28197. this.close = this[kClose]
  28198. }
  28199. get [Symbols.kConnected] () {
  28200. return this[kConnected]
  28201. }
  28202. /**
  28203. * Sets up the base interceptor for mocking replies from undici.
  28204. */
  28205. intercept (opts) {
  28206. return new MockInterceptor(opts, this[kDispatches])
  28207. }
  28208. async [kClose] () {
  28209. await promisify(this[kOriginalClose])()
  28210. this[kConnected] = 0
  28211. this[kMockAgent][Symbols.kClients].delete(this[kOrigin])
  28212. }
  28213. }
  28214. module.exports = MockPool
  28215. /***/ }),
  28216. /***/ 4347:
  28217. /***/ ((module) => {
  28218. "use strict";
  28219. module.exports = {
  28220. kAgent: Symbol('agent'),
  28221. kOptions: Symbol('options'),
  28222. kFactory: Symbol('factory'),
  28223. kDispatches: Symbol('dispatches'),
  28224. kDispatchKey: Symbol('dispatch key'),
  28225. kDefaultHeaders: Symbol('default headers'),
  28226. kDefaultTrailers: Symbol('default trailers'),
  28227. kContentLength: Symbol('content length'),
  28228. kMockAgent: Symbol('mock agent'),
  28229. kMockAgentSet: Symbol('mock agent set'),
  28230. kMockAgentGet: Symbol('mock agent get'),
  28231. kMockDispatch: Symbol('mock dispatch'),
  28232. kClose: Symbol('close'),
  28233. kOriginalClose: Symbol('original agent close'),
  28234. kOrigin: Symbol('origin'),
  28235. kIsMockActive: Symbol('is mock active'),
  28236. kNetConnect: Symbol('net connect'),
  28237. kGetNetConnect: Symbol('get net connect'),
  28238. kConnected: Symbol('connected')
  28239. }
  28240. /***/ }),
  28241. /***/ 9323:
  28242. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  28243. "use strict";
  28244. const { MockNotMatchedError } = __nccwpck_require__(888)
  28245. const {
  28246. kDispatches,
  28247. kMockAgent,
  28248. kOriginalDispatch,
  28249. kOrigin,
  28250. kGetNetConnect
  28251. } = __nccwpck_require__(4347)
  28252. const { buildURL, nop } = __nccwpck_require__(3983)
  28253. const { STATUS_CODES } = __nccwpck_require__(3685)
  28254. const {
  28255. types: {
  28256. isPromise
  28257. }
  28258. } = __nccwpck_require__(3837)
  28259. function matchValue (match, value) {
  28260. if (typeof match === 'string') {
  28261. return match === value
  28262. }
  28263. if (match instanceof RegExp) {
  28264. return match.test(value)
  28265. }
  28266. if (typeof match === 'function') {
  28267. return match(value) === true
  28268. }
  28269. return false
  28270. }
  28271. function lowerCaseEntries (headers) {
  28272. return Object.fromEntries(
  28273. Object.entries(headers).map(([headerName, headerValue]) => {
  28274. return [headerName.toLocaleLowerCase(), headerValue]
  28275. })
  28276. )
  28277. }
  28278. /**
  28279. * @param {import('../../index').Headers|string[]|Record<string, string>} headers
  28280. * @param {string} key
  28281. */
  28282. function getHeaderByName (headers, key) {
  28283. if (Array.isArray(headers)) {
  28284. for (let i = 0; i < headers.length; i += 2) {
  28285. if (headers[i].toLocaleLowerCase() === key.toLocaleLowerCase()) {
  28286. return headers[i + 1]
  28287. }
  28288. }
  28289. return undefined
  28290. } else if (typeof headers.get === 'function') {
  28291. return headers.get(key)
  28292. } else {
  28293. return lowerCaseEntries(headers)[key.toLocaleLowerCase()]
  28294. }
  28295. }
  28296. /** @param {string[]} headers */
  28297. function buildHeadersFromArray (headers) { // fetch HeadersList
  28298. const clone = headers.slice()
  28299. const entries = []
  28300. for (let index = 0; index < clone.length; index += 2) {
  28301. entries.push([clone[index], clone[index + 1]])
  28302. }
  28303. return Object.fromEntries(entries)
  28304. }
  28305. function matchHeaders (mockDispatch, headers) {
  28306. if (typeof mockDispatch.headers === 'function') {
  28307. if (Array.isArray(headers)) { // fetch HeadersList
  28308. headers = buildHeadersFromArray(headers)
  28309. }
  28310. return mockDispatch.headers(headers ? lowerCaseEntries(headers) : {})
  28311. }
  28312. if (typeof mockDispatch.headers === 'undefined') {
  28313. return true
  28314. }
  28315. if (typeof headers !== 'object' || typeof mockDispatch.headers !== 'object') {
  28316. return false
  28317. }
  28318. for (const [matchHeaderName, matchHeaderValue] of Object.entries(mockDispatch.headers)) {
  28319. const headerValue = getHeaderByName(headers, matchHeaderName)
  28320. if (!matchValue(matchHeaderValue, headerValue)) {
  28321. return false
  28322. }
  28323. }
  28324. return true
  28325. }
  28326. function safeUrl (path) {
  28327. if (typeof path !== 'string') {
  28328. return path
  28329. }
  28330. const pathSegments = path.split('?')
  28331. if (pathSegments.length !== 2) {
  28332. return path
  28333. }
  28334. const qp = new URLSearchParams(pathSegments.pop())
  28335. qp.sort()
  28336. return [...pathSegments, qp.toString()].join('?')
  28337. }
  28338. function matchKey (mockDispatch, { path, method, body, headers }) {
  28339. const pathMatch = matchValue(mockDispatch.path, path)
  28340. const methodMatch = matchValue(mockDispatch.method, method)
  28341. const bodyMatch = typeof mockDispatch.body !== 'undefined' ? matchValue(mockDispatch.body, body) : true
  28342. const headersMatch = matchHeaders(mockDispatch, headers)
  28343. return pathMatch && methodMatch && bodyMatch && headersMatch
  28344. }
  28345. function getResponseData (data) {
  28346. if (Buffer.isBuffer(data)) {
  28347. return data
  28348. } else if (typeof data === 'object') {
  28349. return JSON.stringify(data)
  28350. } else {
  28351. return data.toString()
  28352. }
  28353. }
  28354. function getMockDispatch (mockDispatches, key) {
  28355. const basePath = key.query ? buildURL(key.path, key.query) : key.path
  28356. const resolvedPath = typeof basePath === 'string' ? safeUrl(basePath) : basePath
  28357. // Match path
  28358. let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path }) => matchValue(safeUrl(path), resolvedPath))
  28359. if (matchedMockDispatches.length === 0) {
  28360. throw new MockNotMatchedError(`Mock dispatch not matched for path '${resolvedPath}'`)
  28361. }
  28362. // Match method
  28363. matchedMockDispatches = matchedMockDispatches.filter(({ method }) => matchValue(method, key.method))
  28364. if (matchedMockDispatches.length === 0) {
  28365. throw new MockNotMatchedError(`Mock dispatch not matched for method '${key.method}'`)
  28366. }
  28367. // Match body
  28368. matchedMockDispatches = matchedMockDispatches.filter(({ body }) => typeof body !== 'undefined' ? matchValue(body, key.body) : true)
  28369. if (matchedMockDispatches.length === 0) {
  28370. throw new MockNotMatchedError(`Mock dispatch not matched for body '${key.body}'`)
  28371. }
  28372. // Match headers
  28373. matchedMockDispatches = matchedMockDispatches.filter((mockDispatch) => matchHeaders(mockDispatch, key.headers))
  28374. if (matchedMockDispatches.length === 0) {
  28375. throw new MockNotMatchedError(`Mock dispatch not matched for headers '${typeof key.headers === 'object' ? JSON.stringify(key.headers) : key.headers}'`)
  28376. }
  28377. return matchedMockDispatches[0]
  28378. }
  28379. function addMockDispatch (mockDispatches, key, data) {
  28380. const baseData = { timesInvoked: 0, times: 1, persist: false, consumed: false }
  28381. const replyData = typeof data === 'function' ? { callback: data } : { ...data }
  28382. const newMockDispatch = { ...baseData, ...key, pending: true, data: { error: null, ...replyData } }
  28383. mockDispatches.push(newMockDispatch)
  28384. return newMockDispatch
  28385. }
  28386. function deleteMockDispatch (mockDispatches, key) {
  28387. const index = mockDispatches.findIndex(dispatch => {
  28388. if (!dispatch.consumed) {
  28389. return false
  28390. }
  28391. return matchKey(dispatch, key)
  28392. })
  28393. if (index !== -1) {
  28394. mockDispatches.splice(index, 1)
  28395. }
  28396. }
  28397. function buildKey (opts) {
  28398. const { path, method, body, headers, query } = opts
  28399. return {
  28400. path,
  28401. method,
  28402. body,
  28403. headers,
  28404. query
  28405. }
  28406. }
  28407. function generateKeyValues (data) {
  28408. return Object.entries(data).reduce((keyValuePairs, [key, value]) => [
  28409. ...keyValuePairs,
  28410. Buffer.from(`${key}`),
  28411. Array.isArray(value) ? value.map(x => Buffer.from(`${x}`)) : Buffer.from(`${value}`)
  28412. ], [])
  28413. }
  28414. /**
  28415. * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Status
  28416. * @param {number} statusCode
  28417. */
  28418. function getStatusText (statusCode) {
  28419. return STATUS_CODES[statusCode] || 'unknown'
  28420. }
  28421. async function getResponse (body) {
  28422. const buffers = []
  28423. for await (const data of body) {
  28424. buffers.push(data)
  28425. }
  28426. return Buffer.concat(buffers).toString('utf8')
  28427. }
  28428. /**
  28429. * Mock dispatch function used to simulate undici dispatches
  28430. */
  28431. function mockDispatch (opts, handler) {
  28432. // Get mock dispatch from built key
  28433. const key = buildKey(opts)
  28434. const mockDispatch = getMockDispatch(this[kDispatches], key)
  28435. mockDispatch.timesInvoked++
  28436. // Here's where we resolve a callback if a callback is present for the dispatch data.
  28437. if (mockDispatch.data.callback) {
  28438. mockDispatch.data = { ...mockDispatch.data, ...mockDispatch.data.callback(opts) }
  28439. }
  28440. // Parse mockDispatch data
  28441. const { data: { statusCode, data, headers, trailers, error }, delay, persist } = mockDispatch
  28442. const { timesInvoked, times } = mockDispatch
  28443. // If it's used up and not persistent, mark as consumed
  28444. mockDispatch.consumed = !persist && timesInvoked >= times
  28445. mockDispatch.pending = timesInvoked < times
  28446. // If specified, trigger dispatch error
  28447. if (error !== null) {
  28448. deleteMockDispatch(this[kDispatches], key)
  28449. handler.onError(error)
  28450. return true
  28451. }
  28452. // Handle the request with a delay if necessary
  28453. if (typeof delay === 'number' && delay > 0) {
  28454. setTimeout(() => {
  28455. handleReply(this[kDispatches])
  28456. }, delay)
  28457. } else {
  28458. handleReply(this[kDispatches])
  28459. }
  28460. function handleReply (mockDispatches, _data = data) {
  28461. // fetch's HeadersList is a 1D string array
  28462. const optsHeaders = Array.isArray(opts.headers)
  28463. ? buildHeadersFromArray(opts.headers)
  28464. : opts.headers
  28465. const body = typeof _data === 'function'
  28466. ? _data({ ...opts, headers: optsHeaders })
  28467. : _data
  28468. // util.types.isPromise is likely needed for jest.
  28469. if (isPromise(body)) {
  28470. // If handleReply is asynchronous, throwing an error
  28471. // in the callback will reject the promise, rather than
  28472. // synchronously throw the error, which breaks some tests.
  28473. // Rather, we wait for the callback to resolve if it is a
  28474. // promise, and then re-run handleReply with the new body.
  28475. body.then((newData) => handleReply(mockDispatches, newData))
  28476. return
  28477. }
  28478. const responseData = getResponseData(body)
  28479. const responseHeaders = generateKeyValues(headers)
  28480. const responseTrailers = generateKeyValues(trailers)
  28481. handler.abort = nop
  28482. handler.onHeaders(statusCode, responseHeaders, resume, getStatusText(statusCode))
  28483. handler.onData(Buffer.from(responseData))
  28484. handler.onComplete(responseTrailers)
  28485. deleteMockDispatch(mockDispatches, key)
  28486. }
  28487. function resume () {}
  28488. return true
  28489. }
  28490. function buildMockDispatch () {
  28491. const agent = this[kMockAgent]
  28492. const origin = this[kOrigin]
  28493. const originalDispatch = this[kOriginalDispatch]
  28494. return function dispatch (opts, handler) {
  28495. if (agent.isMockActive) {
  28496. try {
  28497. mockDispatch.call(this, opts, handler)
  28498. } catch (error) {
  28499. if (error instanceof MockNotMatchedError) {
  28500. const netConnect = agent[kGetNetConnect]()
  28501. if (netConnect === false) {
  28502. throw new MockNotMatchedError(`${error.message}: subsequent request to origin ${origin} was not allowed (net.connect disabled)`)
  28503. }
  28504. if (checkNetConnect(netConnect, origin)) {
  28505. originalDispatch.call(this, opts, handler)
  28506. } else {
  28507. throw new MockNotMatchedError(`${error.message}: subsequent request to origin ${origin} was not allowed (net.connect is not enabled for this origin)`)
  28508. }
  28509. } else {
  28510. throw error
  28511. }
  28512. }
  28513. } else {
  28514. originalDispatch.call(this, opts, handler)
  28515. }
  28516. }
  28517. }
  28518. function checkNetConnect (netConnect, origin) {
  28519. const url = new URL(origin)
  28520. if (netConnect === true) {
  28521. return true
  28522. } else if (Array.isArray(netConnect) && netConnect.some((matcher) => matchValue(matcher, url.host))) {
  28523. return true
  28524. }
  28525. return false
  28526. }
  28527. function buildMockOptions (opts) {
  28528. if (opts) {
  28529. const { agent, ...mockOptions } = opts
  28530. return mockOptions
  28531. }
  28532. }
  28533. module.exports = {
  28534. getResponseData,
  28535. getMockDispatch,
  28536. addMockDispatch,
  28537. deleteMockDispatch,
  28538. buildKey,
  28539. generateKeyValues,
  28540. matchValue,
  28541. getResponse,
  28542. getStatusText,
  28543. mockDispatch,
  28544. buildMockDispatch,
  28545. checkNetConnect,
  28546. buildMockOptions,
  28547. getHeaderByName
  28548. }
  28549. /***/ }),
  28550. /***/ 6823:
  28551. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  28552. "use strict";
  28553. const { Transform } = __nccwpck_require__(2781)
  28554. const { Console } = __nccwpck_require__(6206)
  28555. /**
  28556. * Gets the output of `console.table(…)` as a string.
  28557. */
  28558. module.exports = class PendingInterceptorsFormatter {
  28559. constructor ({ disableColors } = {}) {
  28560. this.transform = new Transform({
  28561. transform (chunk, _enc, cb) {
  28562. cb(null, chunk)
  28563. }
  28564. })
  28565. this.logger = new Console({
  28566. stdout: this.transform,
  28567. inspectOptions: {
  28568. colors: !disableColors && !process.env.CI
  28569. }
  28570. })
  28571. }
  28572. format (pendingInterceptors) {
  28573. const withPrettyHeaders = pendingInterceptors.map(
  28574. ({ method, path, data: { statusCode }, persist, times, timesInvoked, origin }) => ({
  28575. Method: method,
  28576. Origin: origin,
  28577. Path: path,
  28578. 'Status code': statusCode,
  28579. Persistent: persist ? '✅' : '❌',
  28580. Invocations: timesInvoked,
  28581. Remaining: persist ? Infinity : times - timesInvoked
  28582. }))
  28583. this.logger.table(withPrettyHeaders)
  28584. return this.transform.read().toString()
  28585. }
  28586. }
  28587. /***/ }),
  28588. /***/ 8891:
  28589. /***/ ((module) => {
  28590. "use strict";
  28591. const singulars = {
  28592. pronoun: 'it',
  28593. is: 'is',
  28594. was: 'was',
  28595. this: 'this'
  28596. }
  28597. const plurals = {
  28598. pronoun: 'they',
  28599. is: 'are',
  28600. was: 'were',
  28601. this: 'these'
  28602. }
  28603. module.exports = class Pluralizer {
  28604. constructor (singular, plural) {
  28605. this.singular = singular
  28606. this.plural = plural
  28607. }
  28608. pluralize (count) {
  28609. const one = count === 1
  28610. const keys = one ? singulars : plurals
  28611. const noun = one ? this.singular : this.plural
  28612. return { ...keys, count, noun }
  28613. }
  28614. }
  28615. /***/ }),
  28616. /***/ 8266:
  28617. /***/ ((module) => {
  28618. "use strict";
  28619. /* eslint-disable */
  28620. // Extracted from node/lib/internal/fixed_queue.js
  28621. // Currently optimal queue size, tested on V8 6.0 - 6.6. Must be power of two.
  28622. const kSize = 2048;
  28623. const kMask = kSize - 1;
  28624. // The FixedQueue is implemented as a singly-linked list of fixed-size
  28625. // circular buffers. It looks something like this:
  28626. //
  28627. // head tail
  28628. // | |
  28629. // v v
  28630. // +-----------+ <-----\ +-----------+ <------\ +-----------+
  28631. // | [null] | \----- | next | \------- | next |
  28632. // +-----------+ +-----------+ +-----------+
  28633. // | item | <-- bottom | item | <-- bottom | [empty] |
  28634. // | item | | item | | [empty] |
  28635. // | item | | item | | [empty] |
  28636. // | item | | item | | [empty] |
  28637. // | item | | item | bottom --> | item |
  28638. // | item | | item | | item |
  28639. // | ... | | ... | | ... |
  28640. // | item | | item | | item |
  28641. // | item | | item | | item |
  28642. // | [empty] | <-- top | item | | item |
  28643. // | [empty] | | item | | item |
  28644. // | [empty] | | [empty] | <-- top top --> | [empty] |
  28645. // +-----------+ +-----------+ +-----------+
  28646. //
  28647. // Or, if there is only one circular buffer, it looks something
  28648. // like either of these:
  28649. //
  28650. // head tail head tail
  28651. // | | | |
  28652. // v v v v
  28653. // +-----------+ +-----------+
  28654. // | [null] | | [null] |
  28655. // +-----------+ +-----------+
  28656. // | [empty] | | item |
  28657. // | [empty] | | item |
  28658. // | item | <-- bottom top --> | [empty] |
  28659. // | item | | [empty] |
  28660. // | [empty] | <-- top bottom --> | item |
  28661. // | [empty] | | item |
  28662. // +-----------+ +-----------+
  28663. //
  28664. // Adding a value means moving `top` forward by one, removing means
  28665. // moving `bottom` forward by one. After reaching the end, the queue
  28666. // wraps around.
  28667. //
  28668. // When `top === bottom` the current queue is empty and when
  28669. // `top + 1 === bottom` it's full. This wastes a single space of storage
  28670. // but allows much quicker checks.
  28671. class FixedCircularBuffer {
  28672. constructor() {
  28673. this.bottom = 0;
  28674. this.top = 0;
  28675. this.list = new Array(kSize);
  28676. this.next = null;
  28677. }
  28678. isEmpty() {
  28679. return this.top === this.bottom;
  28680. }
  28681. isFull() {
  28682. return ((this.top + 1) & kMask) === this.bottom;
  28683. }
  28684. push(data) {
  28685. this.list[this.top] = data;
  28686. this.top = (this.top + 1) & kMask;
  28687. }
  28688. shift() {
  28689. const nextItem = this.list[this.bottom];
  28690. if (nextItem === undefined)
  28691. return null;
  28692. this.list[this.bottom] = undefined;
  28693. this.bottom = (this.bottom + 1) & kMask;
  28694. return nextItem;
  28695. }
  28696. }
  28697. module.exports = class FixedQueue {
  28698. constructor() {
  28699. this.head = this.tail = new FixedCircularBuffer();
  28700. }
  28701. isEmpty() {
  28702. return this.head.isEmpty();
  28703. }
  28704. push(data) {
  28705. if (this.head.isFull()) {
  28706. // Head is full: Creates a new queue, sets the old queue's `.next` to it,
  28707. // and sets it as the new main queue.
  28708. this.head = this.head.next = new FixedCircularBuffer();
  28709. }
  28710. this.head.push(data);
  28711. }
  28712. shift() {
  28713. const tail = this.tail;
  28714. const next = tail.shift();
  28715. if (tail.isEmpty() && tail.next !== null) {
  28716. // If there is another queue, it forms the new tail.
  28717. this.tail = tail.next;
  28718. }
  28719. return next;
  28720. }
  28721. };
  28722. /***/ }),
  28723. /***/ 3198:
  28724. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  28725. "use strict";
  28726. const DispatcherBase = __nccwpck_require__(4839)
  28727. const FixedQueue = __nccwpck_require__(8266)
  28728. const { kConnected, kSize, kRunning, kPending, kQueued, kBusy, kFree, kUrl, kClose, kDestroy, kDispatch } = __nccwpck_require__(2785)
  28729. const PoolStats = __nccwpck_require__(9689)
  28730. const kClients = Symbol('clients')
  28731. const kNeedDrain = Symbol('needDrain')
  28732. const kQueue = Symbol('queue')
  28733. const kClosedResolve = Symbol('closed resolve')
  28734. const kOnDrain = Symbol('onDrain')
  28735. const kOnConnect = Symbol('onConnect')
  28736. const kOnDisconnect = Symbol('onDisconnect')
  28737. const kOnConnectionError = Symbol('onConnectionError')
  28738. const kGetDispatcher = Symbol('get dispatcher')
  28739. const kAddClient = Symbol('add client')
  28740. const kRemoveClient = Symbol('remove client')
  28741. const kStats = Symbol('stats')
  28742. class PoolBase extends DispatcherBase {
  28743. constructor () {
  28744. super()
  28745. this[kQueue] = new FixedQueue()
  28746. this[kClients] = []
  28747. this[kQueued] = 0
  28748. const pool = this
  28749. this[kOnDrain] = function onDrain (origin, targets) {
  28750. const queue = pool[kQueue]
  28751. let needDrain = false
  28752. while (!needDrain) {
  28753. const item = queue.shift()
  28754. if (!item) {
  28755. break
  28756. }
  28757. pool[kQueued]--
  28758. needDrain = !this.dispatch(item.opts, item.handler)
  28759. }
  28760. this[kNeedDrain] = needDrain
  28761. if (!this[kNeedDrain] && pool[kNeedDrain]) {
  28762. pool[kNeedDrain] = false
  28763. pool.emit('drain', origin, [pool, ...targets])
  28764. }
  28765. if (pool[kClosedResolve] && queue.isEmpty()) {
  28766. Promise
  28767. .all(pool[kClients].map(c => c.close()))
  28768. .then(pool[kClosedResolve])
  28769. }
  28770. }
  28771. this[kOnConnect] = (origin, targets) => {
  28772. pool.emit('connect', origin, [pool, ...targets])
  28773. }
  28774. this[kOnDisconnect] = (origin, targets, err) => {
  28775. pool.emit('disconnect', origin, [pool, ...targets], err)
  28776. }
  28777. this[kOnConnectionError] = (origin, targets, err) => {
  28778. pool.emit('connectionError', origin, [pool, ...targets], err)
  28779. }
  28780. this[kStats] = new PoolStats(this)
  28781. }
  28782. get [kBusy] () {
  28783. return this[kNeedDrain]
  28784. }
  28785. get [kConnected] () {
  28786. return this[kClients].filter(client => client[kConnected]).length
  28787. }
  28788. get [kFree] () {
  28789. return this[kClients].filter(client => client[kConnected] && !client[kNeedDrain]).length
  28790. }
  28791. get [kPending] () {
  28792. let ret = this[kQueued]
  28793. for (const { [kPending]: pending } of this[kClients]) {
  28794. ret += pending
  28795. }
  28796. return ret
  28797. }
  28798. get [kRunning] () {
  28799. let ret = 0
  28800. for (const { [kRunning]: running } of this[kClients]) {
  28801. ret += running
  28802. }
  28803. return ret
  28804. }
  28805. get [kSize] () {
  28806. let ret = this[kQueued]
  28807. for (const { [kSize]: size } of this[kClients]) {
  28808. ret += size
  28809. }
  28810. return ret
  28811. }
  28812. get stats () {
  28813. return this[kStats]
  28814. }
  28815. async [kClose] () {
  28816. if (this[kQueue].isEmpty()) {
  28817. return Promise.all(this[kClients].map(c => c.close()))
  28818. } else {
  28819. return new Promise((resolve) => {
  28820. this[kClosedResolve] = resolve
  28821. })
  28822. }
  28823. }
  28824. async [kDestroy] (err) {
  28825. while (true) {
  28826. const item = this[kQueue].shift()
  28827. if (!item) {
  28828. break
  28829. }
  28830. item.handler.onError(err)
  28831. }
  28832. return Promise.all(this[kClients].map(c => c.destroy(err)))
  28833. }
  28834. [kDispatch] (opts, handler) {
  28835. const dispatcher = this[kGetDispatcher]()
  28836. if (!dispatcher) {
  28837. this[kNeedDrain] = true
  28838. this[kQueue].push({ opts, handler })
  28839. this[kQueued]++
  28840. } else if (!dispatcher.dispatch(opts, handler)) {
  28841. dispatcher[kNeedDrain] = true
  28842. this[kNeedDrain] = !this[kGetDispatcher]()
  28843. }
  28844. return !this[kNeedDrain]
  28845. }
  28846. [kAddClient] (client) {
  28847. client
  28848. .on('drain', this[kOnDrain])
  28849. .on('connect', this[kOnConnect])
  28850. .on('disconnect', this[kOnDisconnect])
  28851. .on('connectionError', this[kOnConnectionError])
  28852. this[kClients].push(client)
  28853. if (this[kNeedDrain]) {
  28854. process.nextTick(() => {
  28855. if (this[kNeedDrain]) {
  28856. this[kOnDrain](client[kUrl], [this, client])
  28857. }
  28858. })
  28859. }
  28860. return this
  28861. }
  28862. [kRemoveClient] (client) {
  28863. client.close(() => {
  28864. const idx = this[kClients].indexOf(client)
  28865. if (idx !== -1) {
  28866. this[kClients].splice(idx, 1)
  28867. }
  28868. })
  28869. this[kNeedDrain] = this[kClients].some(dispatcher => (
  28870. !dispatcher[kNeedDrain] &&
  28871. dispatcher.closed !== true &&
  28872. dispatcher.destroyed !== true
  28873. ))
  28874. }
  28875. }
  28876. module.exports = {
  28877. PoolBase,
  28878. kClients,
  28879. kNeedDrain,
  28880. kAddClient,
  28881. kRemoveClient,
  28882. kGetDispatcher
  28883. }
  28884. /***/ }),
  28885. /***/ 9689:
  28886. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  28887. const { kFree, kConnected, kPending, kQueued, kRunning, kSize } = __nccwpck_require__(2785)
  28888. const kPool = Symbol('pool')
  28889. class PoolStats {
  28890. constructor (pool) {
  28891. this[kPool] = pool
  28892. }
  28893. get connected () {
  28894. return this[kPool][kConnected]
  28895. }
  28896. get free () {
  28897. return this[kPool][kFree]
  28898. }
  28899. get pending () {
  28900. return this[kPool][kPending]
  28901. }
  28902. get queued () {
  28903. return this[kPool][kQueued]
  28904. }
  28905. get running () {
  28906. return this[kPool][kRunning]
  28907. }
  28908. get size () {
  28909. return this[kPool][kSize]
  28910. }
  28911. }
  28912. module.exports = PoolStats
  28913. /***/ }),
  28914. /***/ 4634:
  28915. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  28916. "use strict";
  28917. const {
  28918. PoolBase,
  28919. kClients,
  28920. kNeedDrain,
  28921. kAddClient,
  28922. kGetDispatcher
  28923. } = __nccwpck_require__(3198)
  28924. const Client = __nccwpck_require__(3598)
  28925. const {
  28926. InvalidArgumentError
  28927. } = __nccwpck_require__(8045)
  28928. const util = __nccwpck_require__(3983)
  28929. const { kUrl, kInterceptors } = __nccwpck_require__(2785)
  28930. const buildConnector = __nccwpck_require__(2067)
  28931. const kOptions = Symbol('options')
  28932. const kConnections = Symbol('connections')
  28933. const kFactory = Symbol('factory')
  28934. function defaultFactory (origin, opts) {
  28935. return new Client(origin, opts)
  28936. }
  28937. class Pool extends PoolBase {
  28938. constructor (origin, {
  28939. connections,
  28940. factory = defaultFactory,
  28941. connect,
  28942. connectTimeout,
  28943. tls,
  28944. maxCachedSessions,
  28945. socketPath,
  28946. autoSelectFamily,
  28947. autoSelectFamilyAttemptTimeout,
  28948. allowH2,
  28949. ...options
  28950. } = {}) {
  28951. super()
  28952. if (connections != null && (!Number.isFinite(connections) || connections < 0)) {
  28953. throw new InvalidArgumentError('invalid connections')
  28954. }
  28955. if (typeof factory !== 'function') {
  28956. throw new InvalidArgumentError('factory must be a function.')
  28957. }
  28958. if (connect != null && typeof connect !== 'function' && typeof connect !== 'object') {
  28959. throw new InvalidArgumentError('connect must be a function or an object')
  28960. }
  28961. if (typeof connect !== 'function') {
  28962. connect = buildConnector({
  28963. ...tls,
  28964. maxCachedSessions,
  28965. allowH2,
  28966. socketPath,
  28967. timeout: connectTimeout,
  28968. ...(util.nodeHasAutoSelectFamily && autoSelectFamily ? { autoSelectFamily, autoSelectFamilyAttemptTimeout } : undefined),
  28969. ...connect
  28970. })
  28971. }
  28972. this[kInterceptors] = options.interceptors && options.interceptors.Pool && Array.isArray(options.interceptors.Pool)
  28973. ? options.interceptors.Pool
  28974. : []
  28975. this[kConnections] = connections || null
  28976. this[kUrl] = util.parseOrigin(origin)
  28977. this[kOptions] = { ...util.deepClone(options), connect, allowH2 }
  28978. this[kOptions].interceptors = options.interceptors
  28979. ? { ...options.interceptors }
  28980. : undefined
  28981. this[kFactory] = factory
  28982. }
  28983. [kGetDispatcher] () {
  28984. let dispatcher = this[kClients].find(dispatcher => !dispatcher[kNeedDrain])
  28985. if (dispatcher) {
  28986. return dispatcher
  28987. }
  28988. if (!this[kConnections] || this[kClients].length < this[kConnections]) {
  28989. dispatcher = this[kFactory](this[kUrl], this[kOptions])
  28990. this[kAddClient](dispatcher)
  28991. }
  28992. return dispatcher
  28993. }
  28994. }
  28995. module.exports = Pool
  28996. /***/ }),
  28997. /***/ 7858:
  28998. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  28999. "use strict";
  29000. const { kProxy, kClose, kDestroy, kInterceptors } = __nccwpck_require__(2785)
  29001. const { URL } = __nccwpck_require__(7310)
  29002. const Agent = __nccwpck_require__(7890)
  29003. const Pool = __nccwpck_require__(4634)
  29004. const DispatcherBase = __nccwpck_require__(4839)
  29005. const { InvalidArgumentError, RequestAbortedError } = __nccwpck_require__(8045)
  29006. const buildConnector = __nccwpck_require__(2067)
  29007. const kAgent = Symbol('proxy agent')
  29008. const kClient = Symbol('proxy client')
  29009. const kProxyHeaders = Symbol('proxy headers')
  29010. const kRequestTls = Symbol('request tls settings')
  29011. const kProxyTls = Symbol('proxy tls settings')
  29012. const kConnectEndpoint = Symbol('connect endpoint function')
  29013. function defaultProtocolPort (protocol) {
  29014. return protocol === 'https:' ? 443 : 80
  29015. }
  29016. function buildProxyOptions (opts) {
  29017. if (typeof opts === 'string') {
  29018. opts = { uri: opts }
  29019. }
  29020. if (!opts || !opts.uri) {
  29021. throw new InvalidArgumentError('Proxy opts.uri is mandatory')
  29022. }
  29023. return {
  29024. uri: opts.uri,
  29025. protocol: opts.protocol || 'https'
  29026. }
  29027. }
  29028. function defaultFactory (origin, opts) {
  29029. return new Pool(origin, opts)
  29030. }
  29031. class ProxyAgent extends DispatcherBase {
  29032. constructor (opts) {
  29033. super(opts)
  29034. this[kProxy] = buildProxyOptions(opts)
  29035. this[kAgent] = new Agent(opts)
  29036. this[kInterceptors] = opts.interceptors && opts.interceptors.ProxyAgent && Array.isArray(opts.interceptors.ProxyAgent)
  29037. ? opts.interceptors.ProxyAgent
  29038. : []
  29039. if (typeof opts === 'string') {
  29040. opts = { uri: opts }
  29041. }
  29042. if (!opts || !opts.uri) {
  29043. throw new InvalidArgumentError('Proxy opts.uri is mandatory')
  29044. }
  29045. const { clientFactory = defaultFactory } = opts
  29046. if (typeof clientFactory !== 'function') {
  29047. throw new InvalidArgumentError('Proxy opts.clientFactory must be a function.')
  29048. }
  29049. this[kRequestTls] = opts.requestTls
  29050. this[kProxyTls] = opts.proxyTls
  29051. this[kProxyHeaders] = opts.headers || {}
  29052. const resolvedUrl = new URL(opts.uri)
  29053. const { origin, port, host, username, password } = resolvedUrl
  29054. if (opts.auth && opts.token) {
  29055. throw new InvalidArgumentError('opts.auth cannot be used in combination with opts.token')
  29056. } else if (opts.auth) {
  29057. /* @deprecated in favour of opts.token */
  29058. this[kProxyHeaders]['proxy-authorization'] = `Basic ${opts.auth}`
  29059. } else if (opts.token) {
  29060. this[kProxyHeaders]['proxy-authorization'] = opts.token
  29061. } else if (username && password) {
  29062. this[kProxyHeaders]['proxy-authorization'] = `Basic ${Buffer.from(`${decodeURIComponent(username)}:${decodeURIComponent(password)}`).toString('base64')}`
  29063. }
  29064. const connect = buildConnector({ ...opts.proxyTls })
  29065. this[kConnectEndpoint] = buildConnector({ ...opts.requestTls })
  29066. this[kClient] = clientFactory(resolvedUrl, { connect })
  29067. this[kAgent] = new Agent({
  29068. ...opts,
  29069. connect: async (opts, callback) => {
  29070. let requestedHost = opts.host
  29071. if (!opts.port) {
  29072. requestedHost += `:${defaultProtocolPort(opts.protocol)}`
  29073. }
  29074. try {
  29075. const { socket, statusCode } = await this[kClient].connect({
  29076. origin,
  29077. port,
  29078. path: requestedHost,
  29079. signal: opts.signal,
  29080. headers: {
  29081. ...this[kProxyHeaders],
  29082. host
  29083. }
  29084. })
  29085. if (statusCode !== 200) {
  29086. socket.on('error', () => {}).destroy()
  29087. callback(new RequestAbortedError(`Proxy response (${statusCode}) !== 200 when HTTP Tunneling`))
  29088. }
  29089. if (opts.protocol !== 'https:') {
  29090. callback(null, socket)
  29091. return
  29092. }
  29093. let servername
  29094. if (this[kRequestTls]) {
  29095. servername = this[kRequestTls].servername
  29096. } else {
  29097. servername = opts.servername
  29098. }
  29099. this[kConnectEndpoint]({ ...opts, servername, httpSocket: socket }, callback)
  29100. } catch (err) {
  29101. callback(err)
  29102. }
  29103. }
  29104. })
  29105. }
  29106. dispatch (opts, handler) {
  29107. const { host } = new URL(opts.origin)
  29108. const headers = buildHeaders(opts.headers)
  29109. throwIfProxyAuthIsSent(headers)
  29110. return this[kAgent].dispatch(
  29111. {
  29112. ...opts,
  29113. headers: {
  29114. ...headers,
  29115. host
  29116. }
  29117. },
  29118. handler
  29119. )
  29120. }
  29121. async [kClose] () {
  29122. await this[kAgent].close()
  29123. await this[kClient].close()
  29124. }
  29125. async [kDestroy] () {
  29126. await this[kAgent].destroy()
  29127. await this[kClient].destroy()
  29128. }
  29129. }
  29130. /**
  29131. * @param {string[] | Record<string, string>} headers
  29132. * @returns {Record<string, string>}
  29133. */
  29134. function buildHeaders (headers) {
  29135. // When using undici.fetch, the headers list is stored
  29136. // as an array.
  29137. if (Array.isArray(headers)) {
  29138. /** @type {Record<string, string>} */
  29139. const headersPair = {}
  29140. for (let i = 0; i < headers.length; i += 2) {
  29141. headersPair[headers[i]] = headers[i + 1]
  29142. }
  29143. return headersPair
  29144. }
  29145. return headers
  29146. }
  29147. /**
  29148. * @param {Record<string, string>} headers
  29149. *
  29150. * Previous versions of ProxyAgent suggests the Proxy-Authorization in request headers
  29151. * Nevertheless, it was changed and to avoid a security vulnerability by end users
  29152. * this check was created.
  29153. * It should be removed in the next major version for performance reasons
  29154. */
  29155. function throwIfProxyAuthIsSent (headers) {
  29156. const existProxyAuth = headers && Object.keys(headers)
  29157. .find((key) => key.toLowerCase() === 'proxy-authorization')
  29158. if (existProxyAuth) {
  29159. throw new InvalidArgumentError('Proxy-Authorization should be sent in ProxyAgent constructor')
  29160. }
  29161. }
  29162. module.exports = ProxyAgent
  29163. /***/ }),
  29164. /***/ 9459:
  29165. /***/ ((module) => {
  29166. "use strict";
  29167. let fastNow = Date.now()
  29168. let fastNowTimeout
  29169. const fastTimers = []
  29170. function onTimeout () {
  29171. fastNow = Date.now()
  29172. let len = fastTimers.length
  29173. let idx = 0
  29174. while (idx < len) {
  29175. const timer = fastTimers[idx]
  29176. if (timer.state === 0) {
  29177. timer.state = fastNow + timer.delay
  29178. } else if (timer.state > 0 && fastNow >= timer.state) {
  29179. timer.state = -1
  29180. timer.callback(timer.opaque)
  29181. }
  29182. if (timer.state === -1) {
  29183. timer.state = -2
  29184. if (idx !== len - 1) {
  29185. fastTimers[idx] = fastTimers.pop()
  29186. } else {
  29187. fastTimers.pop()
  29188. }
  29189. len -= 1
  29190. } else {
  29191. idx += 1
  29192. }
  29193. }
  29194. if (fastTimers.length > 0) {
  29195. refreshTimeout()
  29196. }
  29197. }
  29198. function refreshTimeout () {
  29199. if (fastNowTimeout && fastNowTimeout.refresh) {
  29200. fastNowTimeout.refresh()
  29201. } else {
  29202. clearTimeout(fastNowTimeout)
  29203. fastNowTimeout = setTimeout(onTimeout, 1e3)
  29204. if (fastNowTimeout.unref) {
  29205. fastNowTimeout.unref()
  29206. }
  29207. }
  29208. }
  29209. class Timeout {
  29210. constructor (callback, delay, opaque) {
  29211. this.callback = callback
  29212. this.delay = delay
  29213. this.opaque = opaque
  29214. // -2 not in timer list
  29215. // -1 in timer list but inactive
  29216. // 0 in timer list waiting for time
  29217. // > 0 in timer list waiting for time to expire
  29218. this.state = -2
  29219. this.refresh()
  29220. }
  29221. refresh () {
  29222. if (this.state === -2) {
  29223. fastTimers.push(this)
  29224. if (!fastNowTimeout || fastTimers.length === 1) {
  29225. refreshTimeout()
  29226. }
  29227. }
  29228. this.state = 0
  29229. }
  29230. clear () {
  29231. this.state = -1
  29232. }
  29233. }
  29234. module.exports = {
  29235. setTimeout (callback, delay, opaque) {
  29236. return delay < 1e3
  29237. ? setTimeout(callback, delay, opaque)
  29238. : new Timeout(callback, delay, opaque)
  29239. },
  29240. clearTimeout (timeout) {
  29241. if (timeout instanceof Timeout) {
  29242. timeout.clear()
  29243. } else {
  29244. clearTimeout(timeout)
  29245. }
  29246. }
  29247. }
  29248. /***/ }),
  29249. /***/ 5354:
  29250. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  29251. "use strict";
  29252. const diagnosticsChannel = __nccwpck_require__(7643)
  29253. const { uid, states } = __nccwpck_require__(9188)
  29254. const {
  29255. kReadyState,
  29256. kSentClose,
  29257. kByteParser,
  29258. kReceivedClose
  29259. } = __nccwpck_require__(7578)
  29260. const { fireEvent, failWebsocketConnection } = __nccwpck_require__(5515)
  29261. const { CloseEvent } = __nccwpck_require__(2611)
  29262. const { makeRequest } = __nccwpck_require__(8359)
  29263. const { fetching } = __nccwpck_require__(4881)
  29264. const { Headers } = __nccwpck_require__(554)
  29265. const { getGlobalDispatcher } = __nccwpck_require__(1892)
  29266. const { kHeadersList } = __nccwpck_require__(2785)
  29267. const channels = {}
  29268. channels.open = diagnosticsChannel.channel('undici:websocket:open')
  29269. channels.close = diagnosticsChannel.channel('undici:websocket:close')
  29270. channels.socketError = diagnosticsChannel.channel('undici:websocket:socket_error')
  29271. /** @type {import('crypto')} */
  29272. let crypto
  29273. try {
  29274. crypto = __nccwpck_require__(6113)
  29275. } catch {
  29276. }
  29277. /**
  29278. * @see https://websockets.spec.whatwg.org/#concept-websocket-establish
  29279. * @param {URL} url
  29280. * @param {string|string[]} protocols
  29281. * @param {import('./websocket').WebSocket} ws
  29282. * @param {(response: any) => void} onEstablish
  29283. * @param {Partial<import('../../types/websocket').WebSocketInit>} options
  29284. */
  29285. function establishWebSocketConnection (url, protocols, ws, onEstablish, options) {
  29286. // 1. Let requestURL be a copy of url, with its scheme set to "http", if url’s
  29287. // scheme is "ws", and to "https" otherwise.
  29288. const requestURL = url
  29289. requestURL.protocol = url.protocol === 'ws:' ? 'http:' : 'https:'
  29290. // 2. Let request be a new request, whose URL is requestURL, client is client,
  29291. // service-workers mode is "none", referrer is "no-referrer", mode is
  29292. // "websocket", credentials mode is "include", cache mode is "no-store" ,
  29293. // and redirect mode is "error".
  29294. const request = makeRequest({
  29295. urlList: [requestURL],
  29296. serviceWorkers: 'none',
  29297. referrer: 'no-referrer',
  29298. mode: 'websocket',
  29299. credentials: 'include',
  29300. cache: 'no-store',
  29301. redirect: 'error'
  29302. })
  29303. // Note: undici extension, allow setting custom headers.
  29304. if (options.headers) {
  29305. const headersList = new Headers(options.headers)[kHeadersList]
  29306. request.headersList = headersList
  29307. }
  29308. // 3. Append (`Upgrade`, `websocket`) to request’s header list.
  29309. // 4. Append (`Connection`, `Upgrade`) to request’s header list.
  29310. // Note: both of these are handled by undici currently.
  29311. // https://github.com/nodejs/undici/blob/68c269c4144c446f3f1220951338daef4a6b5ec4/lib/client.js#L1397
  29312. // 5. Let keyValue be a nonce consisting of a randomly selected
  29313. // 16-byte value that has been forgiving-base64-encoded and
  29314. // isomorphic encoded.
  29315. const keyValue = crypto.randomBytes(16).toString('base64')
  29316. // 6. Append (`Sec-WebSocket-Key`, keyValue) to request’s
  29317. // header list.
  29318. request.headersList.append('sec-websocket-key', keyValue)
  29319. // 7. Append (`Sec-WebSocket-Version`, `13`) to request’s
  29320. // header list.
  29321. request.headersList.append('sec-websocket-version', '13')
  29322. // 8. For each protocol in protocols, combine
  29323. // (`Sec-WebSocket-Protocol`, protocol) in request’s header
  29324. // list.
  29325. for (const protocol of protocols) {
  29326. request.headersList.append('sec-websocket-protocol', protocol)
  29327. }
  29328. // 9. Let permessageDeflate be a user-agent defined
  29329. // "permessage-deflate" extension header value.
  29330. // https://github.com/mozilla/gecko-dev/blob/ce78234f5e653a5d3916813ff990f053510227bc/netwerk/protocol/websocket/WebSocketChannel.cpp#L2673
  29331. // TODO: enable once permessage-deflate is supported
  29332. const permessageDeflate = '' // 'permessage-deflate; 15'
  29333. // 10. Append (`Sec-WebSocket-Extensions`, permessageDeflate) to
  29334. // request’s header list.
  29335. // request.headersList.append('sec-websocket-extensions', permessageDeflate)
  29336. // 11. Fetch request with useParallelQueue set to true, and
  29337. // processResponse given response being these steps:
  29338. const controller = fetching({
  29339. request,
  29340. useParallelQueue: true,
  29341. dispatcher: options.dispatcher ?? getGlobalDispatcher(),
  29342. processResponse (response) {
  29343. // 1. If response is a network error or its status is not 101,
  29344. // fail the WebSocket connection.
  29345. if (response.type === 'error' || response.status !== 101) {
  29346. failWebsocketConnection(ws, 'Received network error or non-101 status code.')
  29347. return
  29348. }
  29349. // 2. If protocols is not the empty list and extracting header
  29350. // list values given `Sec-WebSocket-Protocol` and response’s
  29351. // header list results in null, failure, or the empty byte
  29352. // sequence, then fail the WebSocket connection.
  29353. if (protocols.length !== 0 && !response.headersList.get('Sec-WebSocket-Protocol')) {
  29354. failWebsocketConnection(ws, 'Server did not respond with sent protocols.')
  29355. return
  29356. }
  29357. // 3. Follow the requirements stated step 2 to step 6, inclusive,
  29358. // of the last set of steps in section 4.1 of The WebSocket
  29359. // Protocol to validate response. This either results in fail
  29360. // the WebSocket connection or the WebSocket connection is
  29361. // established.
  29362. // 2. If the response lacks an |Upgrade| header field or the |Upgrade|
  29363. // header field contains a value that is not an ASCII case-
  29364. // insensitive match for the value "websocket", the client MUST
  29365. // _Fail the WebSocket Connection_.
  29366. if (response.headersList.get('Upgrade')?.toLowerCase() !== 'websocket') {
  29367. failWebsocketConnection(ws, 'Server did not set Upgrade header to "websocket".')
  29368. return
  29369. }
  29370. // 3. If the response lacks a |Connection| header field or the
  29371. // |Connection| header field doesn't contain a token that is an
  29372. // ASCII case-insensitive match for the value "Upgrade", the client
  29373. // MUST _Fail the WebSocket Connection_.
  29374. if (response.headersList.get('Connection')?.toLowerCase() !== 'upgrade') {
  29375. failWebsocketConnection(ws, 'Server did not set Connection header to "upgrade".')
  29376. return
  29377. }
  29378. // 4. If the response lacks a |Sec-WebSocket-Accept| header field or
  29379. // the |Sec-WebSocket-Accept| contains a value other than the
  29380. // base64-encoded SHA-1 of the concatenation of the |Sec-WebSocket-
  29381. // Key| (as a string, not base64-decoded) with the string "258EAFA5-
  29382. // E914-47DA-95CA-C5AB0DC85B11" but ignoring any leading and
  29383. // trailing whitespace, the client MUST _Fail the WebSocket
  29384. // Connection_.
  29385. const secWSAccept = response.headersList.get('Sec-WebSocket-Accept')
  29386. const digest = crypto.createHash('sha1').update(keyValue + uid).digest('base64')
  29387. if (secWSAccept !== digest) {
  29388. failWebsocketConnection(ws, 'Incorrect hash received in Sec-WebSocket-Accept header.')
  29389. return
  29390. }
  29391. // 5. If the response includes a |Sec-WebSocket-Extensions| header
  29392. // field and this header field indicates the use of an extension
  29393. // that was not present in the client's handshake (the server has
  29394. // indicated an extension not requested by the client), the client
  29395. // MUST _Fail the WebSocket Connection_. (The parsing of this
  29396. // header field to determine which extensions are requested is
  29397. // discussed in Section 9.1.)
  29398. const secExtension = response.headersList.get('Sec-WebSocket-Extensions')
  29399. if (secExtension !== null && secExtension !== permessageDeflate) {
  29400. failWebsocketConnection(ws, 'Received different permessage-deflate than the one set.')
  29401. return
  29402. }
  29403. // 6. If the response includes a |Sec-WebSocket-Protocol| header field
  29404. // and this header field indicates the use of a subprotocol that was
  29405. // not present in the client's handshake (the server has indicated a
  29406. // subprotocol not requested by the client), the client MUST _Fail
  29407. // the WebSocket Connection_.
  29408. const secProtocol = response.headersList.get('Sec-WebSocket-Protocol')
  29409. if (secProtocol !== null && secProtocol !== request.headersList.get('Sec-WebSocket-Protocol')) {
  29410. failWebsocketConnection(ws, 'Protocol was not set in the opening handshake.')
  29411. return
  29412. }
  29413. response.socket.on('data', onSocketData)
  29414. response.socket.on('close', onSocketClose)
  29415. response.socket.on('error', onSocketError)
  29416. if (channels.open.hasSubscribers) {
  29417. channels.open.publish({
  29418. address: response.socket.address(),
  29419. protocol: secProtocol,
  29420. extensions: secExtension
  29421. })
  29422. }
  29423. onEstablish(response)
  29424. }
  29425. })
  29426. return controller
  29427. }
  29428. /**
  29429. * @param {Buffer} chunk
  29430. */
  29431. function onSocketData (chunk) {
  29432. if (!this.ws[kByteParser].write(chunk)) {
  29433. this.pause()
  29434. }
  29435. }
  29436. /**
  29437. * @see https://websockets.spec.whatwg.org/#feedback-from-the-protocol
  29438. * @see https://datatracker.ietf.org/doc/html/rfc6455#section-7.1.4
  29439. */
  29440. function onSocketClose () {
  29441. const { ws } = this
  29442. // If the TCP connection was closed after the
  29443. // WebSocket closing handshake was completed, the WebSocket connection
  29444. // is said to have been closed _cleanly_.
  29445. const wasClean = ws[kSentClose] && ws[kReceivedClose]
  29446. let code = 1005
  29447. let reason = ''
  29448. const result = ws[kByteParser].closingInfo
  29449. if (result) {
  29450. code = result.code ?? 1005
  29451. reason = result.reason
  29452. } else if (!ws[kSentClose]) {
  29453. // If _The WebSocket
  29454. // Connection is Closed_ and no Close control frame was received by the
  29455. // endpoint (such as could occur if the underlying transport connection
  29456. // is lost), _The WebSocket Connection Close Code_ is considered to be
  29457. // 1006.
  29458. code = 1006
  29459. }
  29460. // 1. Change the ready state to CLOSED (3).
  29461. ws[kReadyState] = states.CLOSED
  29462. // 2. If the user agent was required to fail the WebSocket
  29463. // connection, or if the WebSocket connection was closed
  29464. // after being flagged as full, fire an event named error
  29465. // at the WebSocket object.
  29466. // TODO
  29467. // 3. Fire an event named close at the WebSocket object,
  29468. // using CloseEvent, with the wasClean attribute
  29469. // initialized to true if the connection closed cleanly
  29470. // and false otherwise, the code attribute initialized to
  29471. // the WebSocket connection close code, and the reason
  29472. // attribute initialized to the result of applying UTF-8
  29473. // decode without BOM to the WebSocket connection close
  29474. // reason.
  29475. fireEvent('close', ws, CloseEvent, {
  29476. wasClean, code, reason
  29477. })
  29478. if (channels.close.hasSubscribers) {
  29479. channels.close.publish({
  29480. websocket: ws,
  29481. code,
  29482. reason
  29483. })
  29484. }
  29485. }
  29486. function onSocketError (error) {
  29487. const { ws } = this
  29488. ws[kReadyState] = states.CLOSING
  29489. if (channels.socketError.hasSubscribers) {
  29490. channels.socketError.publish(error)
  29491. }
  29492. this.destroy()
  29493. }
  29494. module.exports = {
  29495. establishWebSocketConnection
  29496. }
  29497. /***/ }),
  29498. /***/ 9188:
  29499. /***/ ((module) => {
  29500. "use strict";
  29501. // This is a Globally Unique Identifier unique used
  29502. // to validate that the endpoint accepts websocket
  29503. // connections.
  29504. // See https://www.rfc-editor.org/rfc/rfc6455.html#section-1.3
  29505. const uid = '258EAFA5-E914-47DA-95CA-C5AB0DC85B11'
  29506. /** @type {PropertyDescriptor} */
  29507. const staticPropertyDescriptors = {
  29508. enumerable: true,
  29509. writable: false,
  29510. configurable: false
  29511. }
  29512. const states = {
  29513. CONNECTING: 0,
  29514. OPEN: 1,
  29515. CLOSING: 2,
  29516. CLOSED: 3
  29517. }
  29518. const opcodes = {
  29519. CONTINUATION: 0x0,
  29520. TEXT: 0x1,
  29521. BINARY: 0x2,
  29522. CLOSE: 0x8,
  29523. PING: 0x9,
  29524. PONG: 0xA
  29525. }
  29526. const maxUnsigned16Bit = 2 ** 16 - 1 // 65535
  29527. const parserStates = {
  29528. INFO: 0,
  29529. PAYLOADLENGTH_16: 2,
  29530. PAYLOADLENGTH_64: 3,
  29531. READ_DATA: 4
  29532. }
  29533. const emptyBuffer = Buffer.allocUnsafe(0)
  29534. module.exports = {
  29535. uid,
  29536. staticPropertyDescriptors,
  29537. states,
  29538. opcodes,
  29539. maxUnsigned16Bit,
  29540. parserStates,
  29541. emptyBuffer
  29542. }
  29543. /***/ }),
  29544. /***/ 2611:
  29545. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  29546. "use strict";
  29547. const { webidl } = __nccwpck_require__(1744)
  29548. const { kEnumerableProperty } = __nccwpck_require__(3983)
  29549. const { MessagePort } = __nccwpck_require__(1267)
  29550. /**
  29551. * @see https://html.spec.whatwg.org/multipage/comms.html#messageevent
  29552. */
  29553. class MessageEvent extends Event {
  29554. #eventInit
  29555. constructor (type, eventInitDict = {}) {
  29556. webidl.argumentLengthCheck(arguments, 1, { header: 'MessageEvent constructor' })
  29557. type = webidl.converters.DOMString(type)
  29558. eventInitDict = webidl.converters.MessageEventInit(eventInitDict)
  29559. super(type, eventInitDict)
  29560. this.#eventInit = eventInitDict
  29561. }
  29562. get data () {
  29563. webidl.brandCheck(this, MessageEvent)
  29564. return this.#eventInit.data
  29565. }
  29566. get origin () {
  29567. webidl.brandCheck(this, MessageEvent)
  29568. return this.#eventInit.origin
  29569. }
  29570. get lastEventId () {
  29571. webidl.brandCheck(this, MessageEvent)
  29572. return this.#eventInit.lastEventId
  29573. }
  29574. get source () {
  29575. webidl.brandCheck(this, MessageEvent)
  29576. return this.#eventInit.source
  29577. }
  29578. get ports () {
  29579. webidl.brandCheck(this, MessageEvent)
  29580. if (!Object.isFrozen(this.#eventInit.ports)) {
  29581. Object.freeze(this.#eventInit.ports)
  29582. }
  29583. return this.#eventInit.ports
  29584. }
  29585. initMessageEvent (
  29586. type,
  29587. bubbles = false,
  29588. cancelable = false,
  29589. data = null,
  29590. origin = '',
  29591. lastEventId = '',
  29592. source = null,
  29593. ports = []
  29594. ) {
  29595. webidl.brandCheck(this, MessageEvent)
  29596. webidl.argumentLengthCheck(arguments, 1, { header: 'MessageEvent.initMessageEvent' })
  29597. return new MessageEvent(type, {
  29598. bubbles, cancelable, data, origin, lastEventId, source, ports
  29599. })
  29600. }
  29601. }
  29602. /**
  29603. * @see https://websockets.spec.whatwg.org/#the-closeevent-interface
  29604. */
  29605. class CloseEvent extends Event {
  29606. #eventInit
  29607. constructor (type, eventInitDict = {}) {
  29608. webidl.argumentLengthCheck(arguments, 1, { header: 'CloseEvent constructor' })
  29609. type = webidl.converters.DOMString(type)
  29610. eventInitDict = webidl.converters.CloseEventInit(eventInitDict)
  29611. super(type, eventInitDict)
  29612. this.#eventInit = eventInitDict
  29613. }
  29614. get wasClean () {
  29615. webidl.brandCheck(this, CloseEvent)
  29616. return this.#eventInit.wasClean
  29617. }
  29618. get code () {
  29619. webidl.brandCheck(this, CloseEvent)
  29620. return this.#eventInit.code
  29621. }
  29622. get reason () {
  29623. webidl.brandCheck(this, CloseEvent)
  29624. return this.#eventInit.reason
  29625. }
  29626. }
  29627. // https://html.spec.whatwg.org/multipage/webappapis.html#the-errorevent-interface
  29628. class ErrorEvent extends Event {
  29629. #eventInit
  29630. constructor (type, eventInitDict) {
  29631. webidl.argumentLengthCheck(arguments, 1, { header: 'ErrorEvent constructor' })
  29632. super(type, eventInitDict)
  29633. type = webidl.converters.DOMString(type)
  29634. eventInitDict = webidl.converters.ErrorEventInit(eventInitDict ?? {})
  29635. this.#eventInit = eventInitDict
  29636. }
  29637. get message () {
  29638. webidl.brandCheck(this, ErrorEvent)
  29639. return this.#eventInit.message
  29640. }
  29641. get filename () {
  29642. webidl.brandCheck(this, ErrorEvent)
  29643. return this.#eventInit.filename
  29644. }
  29645. get lineno () {
  29646. webidl.brandCheck(this, ErrorEvent)
  29647. return this.#eventInit.lineno
  29648. }
  29649. get colno () {
  29650. webidl.brandCheck(this, ErrorEvent)
  29651. return this.#eventInit.colno
  29652. }
  29653. get error () {
  29654. webidl.brandCheck(this, ErrorEvent)
  29655. return this.#eventInit.error
  29656. }
  29657. }
  29658. Object.defineProperties(MessageEvent.prototype, {
  29659. [Symbol.toStringTag]: {
  29660. value: 'MessageEvent',
  29661. configurable: true
  29662. },
  29663. data: kEnumerableProperty,
  29664. origin: kEnumerableProperty,
  29665. lastEventId: kEnumerableProperty,
  29666. source: kEnumerableProperty,
  29667. ports: kEnumerableProperty,
  29668. initMessageEvent: kEnumerableProperty
  29669. })
  29670. Object.defineProperties(CloseEvent.prototype, {
  29671. [Symbol.toStringTag]: {
  29672. value: 'CloseEvent',
  29673. configurable: true
  29674. },
  29675. reason: kEnumerableProperty,
  29676. code: kEnumerableProperty,
  29677. wasClean: kEnumerableProperty
  29678. })
  29679. Object.defineProperties(ErrorEvent.prototype, {
  29680. [Symbol.toStringTag]: {
  29681. value: 'ErrorEvent',
  29682. configurable: true
  29683. },
  29684. message: kEnumerableProperty,
  29685. filename: kEnumerableProperty,
  29686. lineno: kEnumerableProperty,
  29687. colno: kEnumerableProperty,
  29688. error: kEnumerableProperty
  29689. })
  29690. webidl.converters.MessagePort = webidl.interfaceConverter(MessagePort)
  29691. webidl.converters['sequence<MessagePort>'] = webidl.sequenceConverter(
  29692. webidl.converters.MessagePort
  29693. )
  29694. const eventInit = [
  29695. {
  29696. key: 'bubbles',
  29697. converter: webidl.converters.boolean,
  29698. defaultValue: false
  29699. },
  29700. {
  29701. key: 'cancelable',
  29702. converter: webidl.converters.boolean,
  29703. defaultValue: false
  29704. },
  29705. {
  29706. key: 'composed',
  29707. converter: webidl.converters.boolean,
  29708. defaultValue: false
  29709. }
  29710. ]
  29711. webidl.converters.MessageEventInit = webidl.dictionaryConverter([
  29712. ...eventInit,
  29713. {
  29714. key: 'data',
  29715. converter: webidl.converters.any,
  29716. defaultValue: null
  29717. },
  29718. {
  29719. key: 'origin',
  29720. converter: webidl.converters.USVString,
  29721. defaultValue: ''
  29722. },
  29723. {
  29724. key: 'lastEventId',
  29725. converter: webidl.converters.DOMString,
  29726. defaultValue: ''
  29727. },
  29728. {
  29729. key: 'source',
  29730. // Node doesn't implement WindowProxy or ServiceWorker, so the only
  29731. // valid value for source is a MessagePort.
  29732. converter: webidl.nullableConverter(webidl.converters.MessagePort),
  29733. defaultValue: null
  29734. },
  29735. {
  29736. key: 'ports',
  29737. converter: webidl.converters['sequence<MessagePort>'],
  29738. get defaultValue () {
  29739. return []
  29740. }
  29741. }
  29742. ])
  29743. webidl.converters.CloseEventInit = webidl.dictionaryConverter([
  29744. ...eventInit,
  29745. {
  29746. key: 'wasClean',
  29747. converter: webidl.converters.boolean,
  29748. defaultValue: false
  29749. },
  29750. {
  29751. key: 'code',
  29752. converter: webidl.converters['unsigned short'],
  29753. defaultValue: 0
  29754. },
  29755. {
  29756. key: 'reason',
  29757. converter: webidl.converters.USVString,
  29758. defaultValue: ''
  29759. }
  29760. ])
  29761. webidl.converters.ErrorEventInit = webidl.dictionaryConverter([
  29762. ...eventInit,
  29763. {
  29764. key: 'message',
  29765. converter: webidl.converters.DOMString,
  29766. defaultValue: ''
  29767. },
  29768. {
  29769. key: 'filename',
  29770. converter: webidl.converters.USVString,
  29771. defaultValue: ''
  29772. },
  29773. {
  29774. key: 'lineno',
  29775. converter: webidl.converters['unsigned long'],
  29776. defaultValue: 0
  29777. },
  29778. {
  29779. key: 'colno',
  29780. converter: webidl.converters['unsigned long'],
  29781. defaultValue: 0
  29782. },
  29783. {
  29784. key: 'error',
  29785. converter: webidl.converters.any
  29786. }
  29787. ])
  29788. module.exports = {
  29789. MessageEvent,
  29790. CloseEvent,
  29791. ErrorEvent
  29792. }
  29793. /***/ }),
  29794. /***/ 5444:
  29795. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  29796. "use strict";
  29797. const { maxUnsigned16Bit } = __nccwpck_require__(9188)
  29798. /** @type {import('crypto')} */
  29799. let crypto
  29800. try {
  29801. crypto = __nccwpck_require__(6113)
  29802. } catch {
  29803. }
  29804. class WebsocketFrameSend {
  29805. /**
  29806. * @param {Buffer|undefined} data
  29807. */
  29808. constructor (data) {
  29809. this.frameData = data
  29810. this.maskKey = crypto.randomBytes(4)
  29811. }
  29812. createFrame (opcode) {
  29813. const bodyLength = this.frameData?.byteLength ?? 0
  29814. /** @type {number} */
  29815. let payloadLength = bodyLength // 0-125
  29816. let offset = 6
  29817. if (bodyLength > maxUnsigned16Bit) {
  29818. offset += 8 // payload length is next 8 bytes
  29819. payloadLength = 127
  29820. } else if (bodyLength > 125) {
  29821. offset += 2 // payload length is next 2 bytes
  29822. payloadLength = 126
  29823. }
  29824. const buffer = Buffer.allocUnsafe(bodyLength + offset)
  29825. // Clear first 2 bytes, everything else is overwritten
  29826. buffer[0] = buffer[1] = 0
  29827. buffer[0] |= 0x80 // FIN
  29828. buffer[0] = (buffer[0] & 0xF0) + opcode // opcode
  29829. /*! ws. MIT License. Einar Otto Stangvik <einaros@gmail.com> */
  29830. buffer[offset - 4] = this.maskKey[0]
  29831. buffer[offset - 3] = this.maskKey[1]
  29832. buffer[offset - 2] = this.maskKey[2]
  29833. buffer[offset - 1] = this.maskKey[3]
  29834. buffer[1] = payloadLength
  29835. if (payloadLength === 126) {
  29836. buffer.writeUInt16BE(bodyLength, 2)
  29837. } else if (payloadLength === 127) {
  29838. // Clear extended payload length
  29839. buffer[2] = buffer[3] = 0
  29840. buffer.writeUIntBE(bodyLength, 4, 6)
  29841. }
  29842. buffer[1] |= 0x80 // MASK
  29843. // mask body
  29844. for (let i = 0; i < bodyLength; i++) {
  29845. buffer[offset + i] = this.frameData[i] ^ this.maskKey[i % 4]
  29846. }
  29847. return buffer
  29848. }
  29849. }
  29850. module.exports = {
  29851. WebsocketFrameSend
  29852. }
  29853. /***/ }),
  29854. /***/ 1688:
  29855. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  29856. "use strict";
  29857. const { Writable } = __nccwpck_require__(2781)
  29858. const diagnosticsChannel = __nccwpck_require__(7643)
  29859. const { parserStates, opcodes, states, emptyBuffer } = __nccwpck_require__(9188)
  29860. const { kReadyState, kSentClose, kResponse, kReceivedClose } = __nccwpck_require__(7578)
  29861. const { isValidStatusCode, failWebsocketConnection, websocketMessageReceived } = __nccwpck_require__(5515)
  29862. const { WebsocketFrameSend } = __nccwpck_require__(5444)
  29863. // This code was influenced by ws released under the MIT license.
  29864. // Copyright (c) 2011 Einar Otto Stangvik <einaros@gmail.com>
  29865. // Copyright (c) 2013 Arnout Kazemier and contributors
  29866. // Copyright (c) 2016 Luigi Pinca and contributors
  29867. const channels = {}
  29868. channels.ping = diagnosticsChannel.channel('undici:websocket:ping')
  29869. channels.pong = diagnosticsChannel.channel('undici:websocket:pong')
  29870. class ByteParser extends Writable {
  29871. #buffers = []
  29872. #byteOffset = 0
  29873. #state = parserStates.INFO
  29874. #info = {}
  29875. #fragments = []
  29876. constructor (ws) {
  29877. super()
  29878. this.ws = ws
  29879. }
  29880. /**
  29881. * @param {Buffer} chunk
  29882. * @param {() => void} callback
  29883. */
  29884. _write (chunk, _, callback) {
  29885. this.#buffers.push(chunk)
  29886. this.#byteOffset += chunk.length
  29887. this.run(callback)
  29888. }
  29889. /**
  29890. * Runs whenever a new chunk is received.
  29891. * Callback is called whenever there are no more chunks buffering,
  29892. * or not enough bytes are buffered to parse.
  29893. */
  29894. run (callback) {
  29895. while (true) {
  29896. if (this.#state === parserStates.INFO) {
  29897. // If there aren't enough bytes to parse the payload length, etc.
  29898. if (this.#byteOffset < 2) {
  29899. return callback()
  29900. }
  29901. const buffer = this.consume(2)
  29902. this.#info.fin = (buffer[0] & 0x80) !== 0
  29903. this.#info.opcode = buffer[0] & 0x0F
  29904. // If we receive a fragmented message, we use the type of the first
  29905. // frame to parse the full message as binary/text, when it's terminated
  29906. this.#info.originalOpcode ??= this.#info.opcode
  29907. this.#info.fragmented = !this.#info.fin && this.#info.opcode !== opcodes.CONTINUATION
  29908. if (this.#info.fragmented && this.#info.opcode !== opcodes.BINARY && this.#info.opcode !== opcodes.TEXT) {
  29909. // Only text and binary frames can be fragmented
  29910. failWebsocketConnection(this.ws, 'Invalid frame type was fragmented.')
  29911. return
  29912. }
  29913. const payloadLength = buffer[1] & 0x7F
  29914. if (payloadLength <= 125) {
  29915. this.#info.payloadLength = payloadLength
  29916. this.#state = parserStates.READ_DATA
  29917. } else if (payloadLength === 126) {
  29918. this.#state = parserStates.PAYLOADLENGTH_16
  29919. } else if (payloadLength === 127) {
  29920. this.#state = parserStates.PAYLOADLENGTH_64
  29921. }
  29922. if (this.#info.fragmented && payloadLength > 125) {
  29923. // A fragmented frame can't be fragmented itself
  29924. failWebsocketConnection(this.ws, 'Fragmented frame exceeded 125 bytes.')
  29925. return
  29926. } else if (
  29927. (this.#info.opcode === opcodes.PING ||
  29928. this.#info.opcode === opcodes.PONG ||
  29929. this.#info.opcode === opcodes.CLOSE) &&
  29930. payloadLength > 125
  29931. ) {
  29932. // Control frames can have a payload length of 125 bytes MAX
  29933. failWebsocketConnection(this.ws, 'Payload length for control frame exceeded 125 bytes.')
  29934. return
  29935. } else if (this.#info.opcode === opcodes.CLOSE) {
  29936. if (payloadLength === 1) {
  29937. failWebsocketConnection(this.ws, 'Received close frame with a 1-byte body.')
  29938. return
  29939. }
  29940. const body = this.consume(payloadLength)
  29941. this.#info.closeInfo = this.parseCloseBody(false, body)
  29942. if (!this.ws[kSentClose]) {
  29943. // If an endpoint receives a Close frame and did not previously send a
  29944. // Close frame, the endpoint MUST send a Close frame in response. (When
  29945. // sending a Close frame in response, the endpoint typically echos the
  29946. // status code it received.)
  29947. const body = Buffer.allocUnsafe(2)
  29948. body.writeUInt16BE(this.#info.closeInfo.code, 0)
  29949. const closeFrame = new WebsocketFrameSend(body)
  29950. this.ws[kResponse].socket.write(
  29951. closeFrame.createFrame(opcodes.CLOSE),
  29952. (err) => {
  29953. if (!err) {
  29954. this.ws[kSentClose] = true
  29955. }
  29956. }
  29957. )
  29958. }
  29959. // Upon either sending or receiving a Close control frame, it is said
  29960. // that _The WebSocket Closing Handshake is Started_ and that the
  29961. // WebSocket connection is in the CLOSING state.
  29962. this.ws[kReadyState] = states.CLOSING
  29963. this.ws[kReceivedClose] = true
  29964. this.end()
  29965. return
  29966. } else if (this.#info.opcode === opcodes.PING) {
  29967. // Upon receipt of a Ping frame, an endpoint MUST send a Pong frame in
  29968. // response, unless it already received a Close frame.
  29969. // A Pong frame sent in response to a Ping frame must have identical
  29970. // "Application data"
  29971. const body = this.consume(payloadLength)
  29972. if (!this.ws[kReceivedClose]) {
  29973. const frame = new WebsocketFrameSend(body)
  29974. this.ws[kResponse].socket.write(frame.createFrame(opcodes.PONG))
  29975. if (channels.ping.hasSubscribers) {
  29976. channels.ping.publish({
  29977. payload: body
  29978. })
  29979. }
  29980. }
  29981. this.#state = parserStates.INFO
  29982. if (this.#byteOffset > 0) {
  29983. continue
  29984. } else {
  29985. callback()
  29986. return
  29987. }
  29988. } else if (this.#info.opcode === opcodes.PONG) {
  29989. // A Pong frame MAY be sent unsolicited. This serves as a
  29990. // unidirectional heartbeat. A response to an unsolicited Pong frame is
  29991. // not expected.
  29992. const body = this.consume(payloadLength)
  29993. if (channels.pong.hasSubscribers) {
  29994. channels.pong.publish({
  29995. payload: body
  29996. })
  29997. }
  29998. if (this.#byteOffset > 0) {
  29999. continue
  30000. } else {
  30001. callback()
  30002. return
  30003. }
  30004. }
  30005. } else if (this.#state === parserStates.PAYLOADLENGTH_16) {
  30006. if (this.#byteOffset < 2) {
  30007. return callback()
  30008. }
  30009. const buffer = this.consume(2)
  30010. this.#info.payloadLength = buffer.readUInt16BE(0)
  30011. this.#state = parserStates.READ_DATA
  30012. } else if (this.#state === parserStates.PAYLOADLENGTH_64) {
  30013. if (this.#byteOffset < 8) {
  30014. return callback()
  30015. }
  30016. const buffer = this.consume(8)
  30017. const upper = buffer.readUInt32BE(0)
  30018. // 2^31 is the maxinimum bytes an arraybuffer can contain
  30019. // on 32-bit systems. Although, on 64-bit systems, this is
  30020. // 2^53-1 bytes.
  30021. // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Invalid_array_length
  30022. // https://source.chromium.org/chromium/chromium/src/+/main:v8/src/common/globals.h;drc=1946212ac0100668f14eb9e2843bdd846e510a1e;bpv=1;bpt=1;l=1275
  30023. // https://source.chromium.org/chromium/chromium/src/+/main:v8/src/objects/js-array-buffer.h;l=34;drc=1946212ac0100668f14eb9e2843bdd846e510a1e
  30024. if (upper > 2 ** 31 - 1) {
  30025. failWebsocketConnection(this.ws, 'Received payload length > 2^31 bytes.')
  30026. return
  30027. }
  30028. const lower = buffer.readUInt32BE(4)
  30029. this.#info.payloadLength = (upper << 8) + lower
  30030. this.#state = parserStates.READ_DATA
  30031. } else if (this.#state === parserStates.READ_DATA) {
  30032. if (this.#byteOffset < this.#info.payloadLength) {
  30033. // If there is still more data in this chunk that needs to be read
  30034. return callback()
  30035. } else if (this.#byteOffset >= this.#info.payloadLength) {
  30036. // If the server sent multiple frames in a single chunk
  30037. const body = this.consume(this.#info.payloadLength)
  30038. this.#fragments.push(body)
  30039. // If the frame is unfragmented, or a fragmented frame was terminated,
  30040. // a message was received
  30041. if (!this.#info.fragmented || (this.#info.fin && this.#info.opcode === opcodes.CONTINUATION)) {
  30042. const fullMessage = Buffer.concat(this.#fragments)
  30043. websocketMessageReceived(this.ws, this.#info.originalOpcode, fullMessage)
  30044. this.#info = {}
  30045. this.#fragments.length = 0
  30046. }
  30047. this.#state = parserStates.INFO
  30048. }
  30049. }
  30050. if (this.#byteOffset > 0) {
  30051. continue
  30052. } else {
  30053. callback()
  30054. break
  30055. }
  30056. }
  30057. }
  30058. /**
  30059. * Take n bytes from the buffered Buffers
  30060. * @param {number} n
  30061. * @returns {Buffer|null}
  30062. */
  30063. consume (n) {
  30064. if (n > this.#byteOffset) {
  30065. return null
  30066. } else if (n === 0) {
  30067. return emptyBuffer
  30068. }
  30069. if (this.#buffers[0].length === n) {
  30070. this.#byteOffset -= this.#buffers[0].length
  30071. return this.#buffers.shift()
  30072. }
  30073. const buffer = Buffer.allocUnsafe(n)
  30074. let offset = 0
  30075. while (offset !== n) {
  30076. const next = this.#buffers[0]
  30077. const { length } = next
  30078. if (length + offset === n) {
  30079. buffer.set(this.#buffers.shift(), offset)
  30080. break
  30081. } else if (length + offset > n) {
  30082. buffer.set(next.subarray(0, n - offset), offset)
  30083. this.#buffers[0] = next.subarray(n - offset)
  30084. break
  30085. } else {
  30086. buffer.set(this.#buffers.shift(), offset)
  30087. offset += next.length
  30088. }
  30089. }
  30090. this.#byteOffset -= n
  30091. return buffer
  30092. }
  30093. parseCloseBody (onlyCode, data) {
  30094. // https://datatracker.ietf.org/doc/html/rfc6455#section-7.1.5
  30095. /** @type {number|undefined} */
  30096. let code
  30097. if (data.length >= 2) {
  30098. // _The WebSocket Connection Close Code_ is
  30099. // defined as the status code (Section 7.4) contained in the first Close
  30100. // control frame received by the application
  30101. code = data.readUInt16BE(0)
  30102. }
  30103. if (onlyCode) {
  30104. if (!isValidStatusCode(code)) {
  30105. return null
  30106. }
  30107. return { code }
  30108. }
  30109. // https://datatracker.ietf.org/doc/html/rfc6455#section-7.1.6
  30110. /** @type {Buffer} */
  30111. let reason = data.subarray(2)
  30112. // Remove BOM
  30113. if (reason[0] === 0xEF && reason[1] === 0xBB && reason[2] === 0xBF) {
  30114. reason = reason.subarray(3)
  30115. }
  30116. if (code !== undefined && !isValidStatusCode(code)) {
  30117. return null
  30118. }
  30119. try {
  30120. // TODO: optimize this
  30121. reason = new TextDecoder('utf-8', { fatal: true }).decode(reason)
  30122. } catch {
  30123. return null
  30124. }
  30125. return { code, reason }
  30126. }
  30127. get closingInfo () {
  30128. return this.#info.closeInfo
  30129. }
  30130. }
  30131. module.exports = {
  30132. ByteParser
  30133. }
  30134. /***/ }),
  30135. /***/ 7578:
  30136. /***/ ((module) => {
  30137. "use strict";
  30138. module.exports = {
  30139. kWebSocketURL: Symbol('url'),
  30140. kReadyState: Symbol('ready state'),
  30141. kController: Symbol('controller'),
  30142. kResponse: Symbol('response'),
  30143. kBinaryType: Symbol('binary type'),
  30144. kSentClose: Symbol('sent close'),
  30145. kReceivedClose: Symbol('received close'),
  30146. kByteParser: Symbol('byte parser')
  30147. }
  30148. /***/ }),
  30149. /***/ 5515:
  30150. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  30151. "use strict";
  30152. const { kReadyState, kController, kResponse, kBinaryType, kWebSocketURL } = __nccwpck_require__(7578)
  30153. const { states, opcodes } = __nccwpck_require__(9188)
  30154. const { MessageEvent, ErrorEvent } = __nccwpck_require__(2611)
  30155. /* globals Blob */
  30156. /**
  30157. * @param {import('./websocket').WebSocket} ws
  30158. */
  30159. function isEstablished (ws) {
  30160. // If the server's response is validated as provided for above, it is
  30161. // said that _The WebSocket Connection is Established_ and that the
  30162. // WebSocket Connection is in the OPEN state.
  30163. return ws[kReadyState] === states.OPEN
  30164. }
  30165. /**
  30166. * @param {import('./websocket').WebSocket} ws
  30167. */
  30168. function isClosing (ws) {
  30169. // Upon either sending or receiving a Close control frame, it is said
  30170. // that _The WebSocket Closing Handshake is Started_ and that the
  30171. // WebSocket connection is in the CLOSING state.
  30172. return ws[kReadyState] === states.CLOSING
  30173. }
  30174. /**
  30175. * @param {import('./websocket').WebSocket} ws
  30176. */
  30177. function isClosed (ws) {
  30178. return ws[kReadyState] === states.CLOSED
  30179. }
  30180. /**
  30181. * @see https://dom.spec.whatwg.org/#concept-event-fire
  30182. * @param {string} e
  30183. * @param {EventTarget} target
  30184. * @param {EventInit | undefined} eventInitDict
  30185. */
  30186. function fireEvent (e, target, eventConstructor = Event, eventInitDict) {
  30187. // 1. If eventConstructor is not given, then let eventConstructor be Event.
  30188. // 2. Let event be the result of creating an event given eventConstructor,
  30189. // in the relevant realm of target.
  30190. // 3. Initialize event’s type attribute to e.
  30191. const event = new eventConstructor(e, eventInitDict) // eslint-disable-line new-cap
  30192. // 4. Initialize any other IDL attributes of event as described in the
  30193. // invocation of this algorithm.
  30194. // 5. Return the result of dispatching event at target, with legacy target
  30195. // override flag set if set.
  30196. target.dispatchEvent(event)
  30197. }
  30198. /**
  30199. * @see https://websockets.spec.whatwg.org/#feedback-from-the-protocol
  30200. * @param {import('./websocket').WebSocket} ws
  30201. * @param {number} type Opcode
  30202. * @param {Buffer} data application data
  30203. */
  30204. function websocketMessageReceived (ws, type, data) {
  30205. // 1. If ready state is not OPEN (1), then return.
  30206. if (ws[kReadyState] !== states.OPEN) {
  30207. return
  30208. }
  30209. // 2. Let dataForEvent be determined by switching on type and binary type:
  30210. let dataForEvent
  30211. if (type === opcodes.TEXT) {
  30212. // -> type indicates that the data is Text
  30213. // a new DOMString containing data
  30214. try {
  30215. dataForEvent = new TextDecoder('utf-8', { fatal: true }).decode(data)
  30216. } catch {
  30217. failWebsocketConnection(ws, 'Received invalid UTF-8 in text frame.')
  30218. return
  30219. }
  30220. } else if (type === opcodes.BINARY) {
  30221. if (ws[kBinaryType] === 'blob') {
  30222. // -> type indicates that the data is Binary and binary type is "blob"
  30223. // a new Blob object, created in the relevant Realm of the WebSocket
  30224. // object, that represents data as its raw data
  30225. dataForEvent = new Blob([data])
  30226. } else {
  30227. // -> type indicates that the data is Binary and binary type is "arraybuffer"
  30228. // a new ArrayBuffer object, created in the relevant Realm of the
  30229. // WebSocket object, whose contents are data
  30230. dataForEvent = new Uint8Array(data).buffer
  30231. }
  30232. }
  30233. // 3. Fire an event named message at the WebSocket object, using MessageEvent,
  30234. // with the origin attribute initialized to the serialization of the WebSocket
  30235. // object’s url's origin, and the data attribute initialized to dataForEvent.
  30236. fireEvent('message', ws, MessageEvent, {
  30237. origin: ws[kWebSocketURL].origin,
  30238. data: dataForEvent
  30239. })
  30240. }
  30241. /**
  30242. * @see https://datatracker.ietf.org/doc/html/rfc6455
  30243. * @see https://datatracker.ietf.org/doc/html/rfc2616
  30244. * @see https://bugs.chromium.org/p/chromium/issues/detail?id=398407
  30245. * @param {string} protocol
  30246. */
  30247. function isValidSubprotocol (protocol) {
  30248. // If present, this value indicates one
  30249. // or more comma-separated subprotocol the client wishes to speak,
  30250. // ordered by preference. The elements that comprise this value
  30251. // MUST be non-empty strings with characters in the range U+0021 to
  30252. // U+007E not including separator characters as defined in
  30253. // [RFC2616] and MUST all be unique strings.
  30254. if (protocol.length === 0) {
  30255. return false
  30256. }
  30257. for (const char of protocol) {
  30258. const code = char.charCodeAt(0)
  30259. if (
  30260. code < 0x21 ||
  30261. code > 0x7E ||
  30262. char === '(' ||
  30263. char === ')' ||
  30264. char === '<' ||
  30265. char === '>' ||
  30266. char === '@' ||
  30267. char === ',' ||
  30268. char === ';' ||
  30269. char === ':' ||
  30270. char === '\\' ||
  30271. char === '"' ||
  30272. char === '/' ||
  30273. char === '[' ||
  30274. char === ']' ||
  30275. char === '?' ||
  30276. char === '=' ||
  30277. char === '{' ||
  30278. char === '}' ||
  30279. code === 32 || // SP
  30280. code === 9 // HT
  30281. ) {
  30282. return false
  30283. }
  30284. }
  30285. return true
  30286. }
  30287. /**
  30288. * @see https://datatracker.ietf.org/doc/html/rfc6455#section-7-4
  30289. * @param {number} code
  30290. */
  30291. function isValidStatusCode (code) {
  30292. if (code >= 1000 && code < 1015) {
  30293. return (
  30294. code !== 1004 && // reserved
  30295. code !== 1005 && // "MUST NOT be set as a status code"
  30296. code !== 1006 // "MUST NOT be set as a status code"
  30297. )
  30298. }
  30299. return code >= 3000 && code <= 4999
  30300. }
  30301. /**
  30302. * @param {import('./websocket').WebSocket} ws
  30303. * @param {string|undefined} reason
  30304. */
  30305. function failWebsocketConnection (ws, reason) {
  30306. const { [kController]: controller, [kResponse]: response } = ws
  30307. controller.abort()
  30308. if (response?.socket && !response.socket.destroyed) {
  30309. response.socket.destroy()
  30310. }
  30311. if (reason) {
  30312. fireEvent('error', ws, ErrorEvent, {
  30313. error: new Error(reason)
  30314. })
  30315. }
  30316. }
  30317. module.exports = {
  30318. isEstablished,
  30319. isClosing,
  30320. isClosed,
  30321. fireEvent,
  30322. isValidSubprotocol,
  30323. isValidStatusCode,
  30324. failWebsocketConnection,
  30325. websocketMessageReceived
  30326. }
  30327. /***/ }),
  30328. /***/ 4284:
  30329. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  30330. "use strict";
  30331. const { webidl } = __nccwpck_require__(1744)
  30332. const { DOMException } = __nccwpck_require__(1037)
  30333. const { URLSerializer } = __nccwpck_require__(685)
  30334. const { getGlobalOrigin } = __nccwpck_require__(1246)
  30335. const { staticPropertyDescriptors, states, opcodes, emptyBuffer } = __nccwpck_require__(9188)
  30336. const {
  30337. kWebSocketURL,
  30338. kReadyState,
  30339. kController,
  30340. kBinaryType,
  30341. kResponse,
  30342. kSentClose,
  30343. kByteParser
  30344. } = __nccwpck_require__(7578)
  30345. const { isEstablished, isClosing, isValidSubprotocol, failWebsocketConnection, fireEvent } = __nccwpck_require__(5515)
  30346. const { establishWebSocketConnection } = __nccwpck_require__(5354)
  30347. const { WebsocketFrameSend } = __nccwpck_require__(5444)
  30348. const { ByteParser } = __nccwpck_require__(1688)
  30349. const { kEnumerableProperty, isBlobLike } = __nccwpck_require__(3983)
  30350. const { getGlobalDispatcher } = __nccwpck_require__(1892)
  30351. const { types } = __nccwpck_require__(3837)
  30352. let experimentalWarned = false
  30353. // https://websockets.spec.whatwg.org/#interface-definition
  30354. class WebSocket extends EventTarget {
  30355. #events = {
  30356. open: null,
  30357. error: null,
  30358. close: null,
  30359. message: null
  30360. }
  30361. #bufferedAmount = 0
  30362. #protocol = ''
  30363. #extensions = ''
  30364. /**
  30365. * @param {string} url
  30366. * @param {string|string[]} protocols
  30367. */
  30368. constructor (url, protocols = []) {
  30369. super()
  30370. webidl.argumentLengthCheck(arguments, 1, { header: 'WebSocket constructor' })
  30371. if (!experimentalWarned) {
  30372. experimentalWarned = true
  30373. process.emitWarning('WebSockets are experimental, expect them to change at any time.', {
  30374. code: 'UNDICI-WS'
  30375. })
  30376. }
  30377. const options = webidl.converters['DOMString or sequence<DOMString> or WebSocketInit'](protocols)
  30378. url = webidl.converters.USVString(url)
  30379. protocols = options.protocols
  30380. // 1. Let baseURL be this's relevant settings object's API base URL.
  30381. const baseURL = getGlobalOrigin()
  30382. // 1. Let urlRecord be the result of applying the URL parser to url with baseURL.
  30383. let urlRecord
  30384. try {
  30385. urlRecord = new URL(url, baseURL)
  30386. } catch (e) {
  30387. // 3. If urlRecord is failure, then throw a "SyntaxError" DOMException.
  30388. throw new DOMException(e, 'SyntaxError')
  30389. }
  30390. // 4. If urlRecord’s scheme is "http", then set urlRecord’s scheme to "ws".
  30391. if (urlRecord.protocol === 'http:') {
  30392. urlRecord.protocol = 'ws:'
  30393. } else if (urlRecord.protocol === 'https:') {
  30394. // 5. Otherwise, if urlRecord’s scheme is "https", set urlRecord’s scheme to "wss".
  30395. urlRecord.protocol = 'wss:'
  30396. }
  30397. // 6. If urlRecord’s scheme is not "ws" or "wss", then throw a "SyntaxError" DOMException.
  30398. if (urlRecord.protocol !== 'ws:' && urlRecord.protocol !== 'wss:') {
  30399. throw new DOMException(
  30400. `Expected a ws: or wss: protocol, got ${urlRecord.protocol}`,
  30401. 'SyntaxError'
  30402. )
  30403. }
  30404. // 7. If urlRecord’s fragment is non-null, then throw a "SyntaxError"
  30405. // DOMException.
  30406. if (urlRecord.hash || urlRecord.href.endsWith('#')) {
  30407. throw new DOMException('Got fragment', 'SyntaxError')
  30408. }
  30409. // 8. If protocols is a string, set protocols to a sequence consisting
  30410. // of just that string.
  30411. if (typeof protocols === 'string') {
  30412. protocols = [protocols]
  30413. }
  30414. // 9. If any of the values in protocols occur more than once or otherwise
  30415. // fail to match the requirements for elements that comprise the value
  30416. // of `Sec-WebSocket-Protocol` fields as defined by The WebSocket
  30417. // protocol, then throw a "SyntaxError" DOMException.
  30418. if (protocols.length !== new Set(protocols.map(p => p.toLowerCase())).size) {
  30419. throw new DOMException('Invalid Sec-WebSocket-Protocol value', 'SyntaxError')
  30420. }
  30421. if (protocols.length > 0 && !protocols.every(p => isValidSubprotocol(p))) {
  30422. throw new DOMException('Invalid Sec-WebSocket-Protocol value', 'SyntaxError')
  30423. }
  30424. // 10. Set this's url to urlRecord.
  30425. this[kWebSocketURL] = new URL(urlRecord.href)
  30426. // 11. Let client be this's relevant settings object.
  30427. // 12. Run this step in parallel:
  30428. // 1. Establish a WebSocket connection given urlRecord, protocols,
  30429. // and client.
  30430. this[kController] = establishWebSocketConnection(
  30431. urlRecord,
  30432. protocols,
  30433. this,
  30434. (response) => this.#onConnectionEstablished(response),
  30435. options
  30436. )
  30437. // Each WebSocket object has an associated ready state, which is a
  30438. // number representing the state of the connection. Initially it must
  30439. // be CONNECTING (0).
  30440. this[kReadyState] = WebSocket.CONNECTING
  30441. // The extensions attribute must initially return the empty string.
  30442. // The protocol attribute must initially return the empty string.
  30443. // Each WebSocket object has an associated binary type, which is a
  30444. // BinaryType. Initially it must be "blob".
  30445. this[kBinaryType] = 'blob'
  30446. }
  30447. /**
  30448. * @see https://websockets.spec.whatwg.org/#dom-websocket-close
  30449. * @param {number|undefined} code
  30450. * @param {string|undefined} reason
  30451. */
  30452. close (code = undefined, reason = undefined) {
  30453. webidl.brandCheck(this, WebSocket)
  30454. if (code !== undefined) {
  30455. code = webidl.converters['unsigned short'](code, { clamp: true })
  30456. }
  30457. if (reason !== undefined) {
  30458. reason = webidl.converters.USVString(reason)
  30459. }
  30460. // 1. If code is present, but is neither an integer equal to 1000 nor an
  30461. // integer in the range 3000 to 4999, inclusive, throw an
  30462. // "InvalidAccessError" DOMException.
  30463. if (code !== undefined) {
  30464. if (code !== 1000 && (code < 3000 || code > 4999)) {
  30465. throw new DOMException('invalid code', 'InvalidAccessError')
  30466. }
  30467. }
  30468. let reasonByteLength = 0
  30469. // 2. If reason is present, then run these substeps:
  30470. if (reason !== undefined) {
  30471. // 1. Let reasonBytes be the result of encoding reason.
  30472. // 2. If reasonBytes is longer than 123 bytes, then throw a
  30473. // "SyntaxError" DOMException.
  30474. reasonByteLength = Buffer.byteLength(reason)
  30475. if (reasonByteLength > 123) {
  30476. throw new DOMException(
  30477. `Reason must be less than 123 bytes; received ${reasonByteLength}`,
  30478. 'SyntaxError'
  30479. )
  30480. }
  30481. }
  30482. // 3. Run the first matching steps from the following list:
  30483. if (this[kReadyState] === WebSocket.CLOSING || this[kReadyState] === WebSocket.CLOSED) {
  30484. // If this's ready state is CLOSING (2) or CLOSED (3)
  30485. // Do nothing.
  30486. } else if (!isEstablished(this)) {
  30487. // If the WebSocket connection is not yet established
  30488. // Fail the WebSocket connection and set this's ready state
  30489. // to CLOSING (2).
  30490. failWebsocketConnection(this, 'Connection was closed before it was established.')
  30491. this[kReadyState] = WebSocket.CLOSING
  30492. } else if (!isClosing(this)) {
  30493. // If the WebSocket closing handshake has not yet been started
  30494. // Start the WebSocket closing handshake and set this's ready
  30495. // state to CLOSING (2).
  30496. // - If neither code nor reason is present, the WebSocket Close
  30497. // message must not have a body.
  30498. // - If code is present, then the status code to use in the
  30499. // WebSocket Close message must be the integer given by code.
  30500. // - If reason is also present, then reasonBytes must be
  30501. // provided in the Close message after the status code.
  30502. const frame = new WebsocketFrameSend()
  30503. // If neither code nor reason is present, the WebSocket Close
  30504. // message must not have a body.
  30505. // If code is present, then the status code to use in the
  30506. // WebSocket Close message must be the integer given by code.
  30507. if (code !== undefined && reason === undefined) {
  30508. frame.frameData = Buffer.allocUnsafe(2)
  30509. frame.frameData.writeUInt16BE(code, 0)
  30510. } else if (code !== undefined && reason !== undefined) {
  30511. // If reason is also present, then reasonBytes must be
  30512. // provided in the Close message after the status code.
  30513. frame.frameData = Buffer.allocUnsafe(2 + reasonByteLength)
  30514. frame.frameData.writeUInt16BE(code, 0)
  30515. // the body MAY contain UTF-8-encoded data with value /reason/
  30516. frame.frameData.write(reason, 2, 'utf-8')
  30517. } else {
  30518. frame.frameData = emptyBuffer
  30519. }
  30520. /** @type {import('stream').Duplex} */
  30521. const socket = this[kResponse].socket
  30522. socket.write(frame.createFrame(opcodes.CLOSE), (err) => {
  30523. if (!err) {
  30524. this[kSentClose] = true
  30525. }
  30526. })
  30527. // Upon either sending or receiving a Close control frame, it is said
  30528. // that _The WebSocket Closing Handshake is Started_ and that the
  30529. // WebSocket connection is in the CLOSING state.
  30530. this[kReadyState] = states.CLOSING
  30531. } else {
  30532. // Otherwise
  30533. // Set this's ready state to CLOSING (2).
  30534. this[kReadyState] = WebSocket.CLOSING
  30535. }
  30536. }
  30537. /**
  30538. * @see https://websockets.spec.whatwg.org/#dom-websocket-send
  30539. * @param {NodeJS.TypedArray|ArrayBuffer|Blob|string} data
  30540. */
  30541. send (data) {
  30542. webidl.brandCheck(this, WebSocket)
  30543. webidl.argumentLengthCheck(arguments, 1, { header: 'WebSocket.send' })
  30544. data = webidl.converters.WebSocketSendData(data)
  30545. // 1. If this's ready state is CONNECTING, then throw an
  30546. // "InvalidStateError" DOMException.
  30547. if (this[kReadyState] === WebSocket.CONNECTING) {
  30548. throw new DOMException('Sent before connected.', 'InvalidStateError')
  30549. }
  30550. // 2. Run the appropriate set of steps from the following list:
  30551. // https://datatracker.ietf.org/doc/html/rfc6455#section-6.1
  30552. // https://datatracker.ietf.org/doc/html/rfc6455#section-5.2
  30553. if (!isEstablished(this) || isClosing(this)) {
  30554. return
  30555. }
  30556. /** @type {import('stream').Duplex} */
  30557. const socket = this[kResponse].socket
  30558. // If data is a string
  30559. if (typeof data === 'string') {
  30560. // If the WebSocket connection is established and the WebSocket
  30561. // closing handshake has not yet started, then the user agent
  30562. // must send a WebSocket Message comprised of the data argument
  30563. // using a text frame opcode; if the data cannot be sent, e.g.
  30564. // because it would need to be buffered but the buffer is full,
  30565. // the user agent must flag the WebSocket as full and then close
  30566. // the WebSocket connection. Any invocation of this method with a
  30567. // string argument that does not throw an exception must increase
  30568. // the bufferedAmount attribute by the number of bytes needed to
  30569. // express the argument as UTF-8.
  30570. const value = Buffer.from(data)
  30571. const frame = new WebsocketFrameSend(value)
  30572. const buffer = frame.createFrame(opcodes.TEXT)
  30573. this.#bufferedAmount += value.byteLength
  30574. socket.write(buffer, () => {
  30575. this.#bufferedAmount -= value.byteLength
  30576. })
  30577. } else if (types.isArrayBuffer(data)) {
  30578. // If the WebSocket connection is established, and the WebSocket
  30579. // closing handshake has not yet started, then the user agent must
  30580. // send a WebSocket Message comprised of data using a binary frame
  30581. // opcode; if the data cannot be sent, e.g. because it would need
  30582. // to be buffered but the buffer is full, the user agent must flag
  30583. // the WebSocket as full and then close the WebSocket connection.
  30584. // The data to be sent is the data stored in the buffer described
  30585. // by the ArrayBuffer object. Any invocation of this method with an
  30586. // ArrayBuffer argument that does not throw an exception must
  30587. // increase the bufferedAmount attribute by the length of the
  30588. // ArrayBuffer in bytes.
  30589. const value = Buffer.from(data)
  30590. const frame = new WebsocketFrameSend(value)
  30591. const buffer = frame.createFrame(opcodes.BINARY)
  30592. this.#bufferedAmount += value.byteLength
  30593. socket.write(buffer, () => {
  30594. this.#bufferedAmount -= value.byteLength
  30595. })
  30596. } else if (ArrayBuffer.isView(data)) {
  30597. // If the WebSocket connection is established, and the WebSocket
  30598. // closing handshake has not yet started, then the user agent must
  30599. // send a WebSocket Message comprised of data using a binary frame
  30600. // opcode; if the data cannot be sent, e.g. because it would need to
  30601. // be buffered but the buffer is full, the user agent must flag the
  30602. // WebSocket as full and then close the WebSocket connection. The
  30603. // data to be sent is the data stored in the section of the buffer
  30604. // described by the ArrayBuffer object that data references. Any
  30605. // invocation of this method with this kind of argument that does
  30606. // not throw an exception must increase the bufferedAmount attribute
  30607. // by the length of data’s buffer in bytes.
  30608. const ab = Buffer.from(data, data.byteOffset, data.byteLength)
  30609. const frame = new WebsocketFrameSend(ab)
  30610. const buffer = frame.createFrame(opcodes.BINARY)
  30611. this.#bufferedAmount += ab.byteLength
  30612. socket.write(buffer, () => {
  30613. this.#bufferedAmount -= ab.byteLength
  30614. })
  30615. } else if (isBlobLike(data)) {
  30616. // If the WebSocket connection is established, and the WebSocket
  30617. // closing handshake has not yet started, then the user agent must
  30618. // send a WebSocket Message comprised of data using a binary frame
  30619. // opcode; if the data cannot be sent, e.g. because it would need to
  30620. // be buffered but the buffer is full, the user agent must flag the
  30621. // WebSocket as full and then close the WebSocket connection. The data
  30622. // to be sent is the raw data represented by the Blob object. Any
  30623. // invocation of this method with a Blob argument that does not throw
  30624. // an exception must increase the bufferedAmount attribute by the size
  30625. // of the Blob object’s raw data, in bytes.
  30626. const frame = new WebsocketFrameSend()
  30627. data.arrayBuffer().then((ab) => {
  30628. const value = Buffer.from(ab)
  30629. frame.frameData = value
  30630. const buffer = frame.createFrame(opcodes.BINARY)
  30631. this.#bufferedAmount += value.byteLength
  30632. socket.write(buffer, () => {
  30633. this.#bufferedAmount -= value.byteLength
  30634. })
  30635. })
  30636. }
  30637. }
  30638. get readyState () {
  30639. webidl.brandCheck(this, WebSocket)
  30640. // The readyState getter steps are to return this's ready state.
  30641. return this[kReadyState]
  30642. }
  30643. get bufferedAmount () {
  30644. webidl.brandCheck(this, WebSocket)
  30645. return this.#bufferedAmount
  30646. }
  30647. get url () {
  30648. webidl.brandCheck(this, WebSocket)
  30649. // The url getter steps are to return this's url, serialized.
  30650. return URLSerializer(this[kWebSocketURL])
  30651. }
  30652. get extensions () {
  30653. webidl.brandCheck(this, WebSocket)
  30654. return this.#extensions
  30655. }
  30656. get protocol () {
  30657. webidl.brandCheck(this, WebSocket)
  30658. return this.#protocol
  30659. }
  30660. get onopen () {
  30661. webidl.brandCheck(this, WebSocket)
  30662. return this.#events.open
  30663. }
  30664. set onopen (fn) {
  30665. webidl.brandCheck(this, WebSocket)
  30666. if (this.#events.open) {
  30667. this.removeEventListener('open', this.#events.open)
  30668. }
  30669. if (typeof fn === 'function') {
  30670. this.#events.open = fn
  30671. this.addEventListener('open', fn)
  30672. } else {
  30673. this.#events.open = null
  30674. }
  30675. }
  30676. get onerror () {
  30677. webidl.brandCheck(this, WebSocket)
  30678. return this.#events.error
  30679. }
  30680. set onerror (fn) {
  30681. webidl.brandCheck(this, WebSocket)
  30682. if (this.#events.error) {
  30683. this.removeEventListener('error', this.#events.error)
  30684. }
  30685. if (typeof fn === 'function') {
  30686. this.#events.error = fn
  30687. this.addEventListener('error', fn)
  30688. } else {
  30689. this.#events.error = null
  30690. }
  30691. }
  30692. get onclose () {
  30693. webidl.brandCheck(this, WebSocket)
  30694. return this.#events.close
  30695. }
  30696. set onclose (fn) {
  30697. webidl.brandCheck(this, WebSocket)
  30698. if (this.#events.close) {
  30699. this.removeEventListener('close', this.#events.close)
  30700. }
  30701. if (typeof fn === 'function') {
  30702. this.#events.close = fn
  30703. this.addEventListener('close', fn)
  30704. } else {
  30705. this.#events.close = null
  30706. }
  30707. }
  30708. get onmessage () {
  30709. webidl.brandCheck(this, WebSocket)
  30710. return this.#events.message
  30711. }
  30712. set onmessage (fn) {
  30713. webidl.brandCheck(this, WebSocket)
  30714. if (this.#events.message) {
  30715. this.removeEventListener('message', this.#events.message)
  30716. }
  30717. if (typeof fn === 'function') {
  30718. this.#events.message = fn
  30719. this.addEventListener('message', fn)
  30720. } else {
  30721. this.#events.message = null
  30722. }
  30723. }
  30724. get binaryType () {
  30725. webidl.brandCheck(this, WebSocket)
  30726. return this[kBinaryType]
  30727. }
  30728. set binaryType (type) {
  30729. webidl.brandCheck(this, WebSocket)
  30730. if (type !== 'blob' && type !== 'arraybuffer') {
  30731. this[kBinaryType] = 'blob'
  30732. } else {
  30733. this[kBinaryType] = type
  30734. }
  30735. }
  30736. /**
  30737. * @see https://websockets.spec.whatwg.org/#feedback-from-the-protocol
  30738. */
  30739. #onConnectionEstablished (response) {
  30740. // processResponse is called when the "response’s header list has been received and initialized."
  30741. // once this happens, the connection is open
  30742. this[kResponse] = response
  30743. const parser = new ByteParser(this)
  30744. parser.on('drain', function onParserDrain () {
  30745. this.ws[kResponse].socket.resume()
  30746. })
  30747. response.socket.ws = this
  30748. this[kByteParser] = parser
  30749. // 1. Change the ready state to OPEN (1).
  30750. this[kReadyState] = states.OPEN
  30751. // 2. Change the extensions attribute’s value to the extensions in use, if
  30752. // it is not the null value.
  30753. // https://datatracker.ietf.org/doc/html/rfc6455#section-9.1
  30754. const extensions = response.headersList.get('sec-websocket-extensions')
  30755. if (extensions !== null) {
  30756. this.#extensions = extensions
  30757. }
  30758. // 3. Change the protocol attribute’s value to the subprotocol in use, if
  30759. // it is not the null value.
  30760. // https://datatracker.ietf.org/doc/html/rfc6455#section-1.9
  30761. const protocol = response.headersList.get('sec-websocket-protocol')
  30762. if (protocol !== null) {
  30763. this.#protocol = protocol
  30764. }
  30765. // 4. Fire an event named open at the WebSocket object.
  30766. fireEvent('open', this)
  30767. }
  30768. }
  30769. // https://websockets.spec.whatwg.org/#dom-websocket-connecting
  30770. WebSocket.CONNECTING = WebSocket.prototype.CONNECTING = states.CONNECTING
  30771. // https://websockets.spec.whatwg.org/#dom-websocket-open
  30772. WebSocket.OPEN = WebSocket.prototype.OPEN = states.OPEN
  30773. // https://websockets.spec.whatwg.org/#dom-websocket-closing
  30774. WebSocket.CLOSING = WebSocket.prototype.CLOSING = states.CLOSING
  30775. // https://websockets.spec.whatwg.org/#dom-websocket-closed
  30776. WebSocket.CLOSED = WebSocket.prototype.CLOSED = states.CLOSED
  30777. Object.defineProperties(WebSocket.prototype, {
  30778. CONNECTING: staticPropertyDescriptors,
  30779. OPEN: staticPropertyDescriptors,
  30780. CLOSING: staticPropertyDescriptors,
  30781. CLOSED: staticPropertyDescriptors,
  30782. url: kEnumerableProperty,
  30783. readyState: kEnumerableProperty,
  30784. bufferedAmount: kEnumerableProperty,
  30785. onopen: kEnumerableProperty,
  30786. onerror: kEnumerableProperty,
  30787. onclose: kEnumerableProperty,
  30788. close: kEnumerableProperty,
  30789. onmessage: kEnumerableProperty,
  30790. binaryType: kEnumerableProperty,
  30791. send: kEnumerableProperty,
  30792. extensions: kEnumerableProperty,
  30793. protocol: kEnumerableProperty,
  30794. [Symbol.toStringTag]: {
  30795. value: 'WebSocket',
  30796. writable: false,
  30797. enumerable: false,
  30798. configurable: true
  30799. }
  30800. })
  30801. Object.defineProperties(WebSocket, {
  30802. CONNECTING: staticPropertyDescriptors,
  30803. OPEN: staticPropertyDescriptors,
  30804. CLOSING: staticPropertyDescriptors,
  30805. CLOSED: staticPropertyDescriptors
  30806. })
  30807. webidl.converters['sequence<DOMString>'] = webidl.sequenceConverter(
  30808. webidl.converters.DOMString
  30809. )
  30810. webidl.converters['DOMString or sequence<DOMString>'] = function (V) {
  30811. if (webidl.util.Type(V) === 'Object' && Symbol.iterator in V) {
  30812. return webidl.converters['sequence<DOMString>'](V)
  30813. }
  30814. return webidl.converters.DOMString(V)
  30815. }
  30816. // This implements the propsal made in https://github.com/whatwg/websockets/issues/42
  30817. webidl.converters.WebSocketInit = webidl.dictionaryConverter([
  30818. {
  30819. key: 'protocols',
  30820. converter: webidl.converters['DOMString or sequence<DOMString>'],
  30821. get defaultValue () {
  30822. return []
  30823. }
  30824. },
  30825. {
  30826. key: 'dispatcher',
  30827. converter: (V) => V,
  30828. get defaultValue () {
  30829. return getGlobalDispatcher()
  30830. }
  30831. },
  30832. {
  30833. key: 'headers',
  30834. converter: webidl.nullableConverter(webidl.converters.HeadersInit)
  30835. }
  30836. ])
  30837. webidl.converters['DOMString or sequence<DOMString> or WebSocketInit'] = function (V) {
  30838. if (webidl.util.Type(V) === 'Object' && !(Symbol.iterator in V)) {
  30839. return webidl.converters.WebSocketInit(V)
  30840. }
  30841. return { protocols: webidl.converters['DOMString or sequence<DOMString>'](V) }
  30842. }
  30843. webidl.converters.WebSocketSendData = function (V) {
  30844. if (webidl.util.Type(V) === 'Object') {
  30845. if (isBlobLike(V)) {
  30846. return webidl.converters.Blob(V, { strict: false })
  30847. }
  30848. if (ArrayBuffer.isView(V) || types.isAnyArrayBuffer(V)) {
  30849. return webidl.converters.BufferSource(V)
  30850. }
  30851. }
  30852. return webidl.converters.USVString(V)
  30853. }
  30854. module.exports = {
  30855. WebSocket
  30856. }
  30857. /***/ }),
  30858. /***/ 5030:
  30859. /***/ ((__unused_webpack_module, exports) => {
  30860. "use strict";
  30861. Object.defineProperty(exports, "__esModule", ({ value: true }));
  30862. function getUserAgent() {
  30863. if (typeof navigator === "object" && "userAgent" in navigator) {
  30864. return navigator.userAgent;
  30865. }
  30866. if (typeof process === "object" && process.version !== undefined) {
  30867. return `Node.js/${process.version.substr(1)} (${process.platform}; ${process.arch})`;
  30868. }
  30869. return "<environment undetectable>";
  30870. }
  30871. exports.getUserAgent = getUserAgent;
  30872. //# sourceMappingURL=index.js.map
  30873. /***/ }),
  30874. /***/ 5840:
  30875. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  30876. "use strict";
  30877. Object.defineProperty(exports, "__esModule", ({
  30878. value: true
  30879. }));
  30880. Object.defineProperty(exports, "NIL", ({
  30881. enumerable: true,
  30882. get: function () {
  30883. return _nil.default;
  30884. }
  30885. }));
  30886. Object.defineProperty(exports, "parse", ({
  30887. enumerable: true,
  30888. get: function () {
  30889. return _parse.default;
  30890. }
  30891. }));
  30892. Object.defineProperty(exports, "stringify", ({
  30893. enumerable: true,
  30894. get: function () {
  30895. return _stringify.default;
  30896. }
  30897. }));
  30898. Object.defineProperty(exports, "v1", ({
  30899. enumerable: true,
  30900. get: function () {
  30901. return _v.default;
  30902. }
  30903. }));
  30904. Object.defineProperty(exports, "v3", ({
  30905. enumerable: true,
  30906. get: function () {
  30907. return _v2.default;
  30908. }
  30909. }));
  30910. Object.defineProperty(exports, "v4", ({
  30911. enumerable: true,
  30912. get: function () {
  30913. return _v3.default;
  30914. }
  30915. }));
  30916. Object.defineProperty(exports, "v5", ({
  30917. enumerable: true,
  30918. get: function () {
  30919. return _v4.default;
  30920. }
  30921. }));
  30922. Object.defineProperty(exports, "validate", ({
  30923. enumerable: true,
  30924. get: function () {
  30925. return _validate.default;
  30926. }
  30927. }));
  30928. Object.defineProperty(exports, "version", ({
  30929. enumerable: true,
  30930. get: function () {
  30931. return _version.default;
  30932. }
  30933. }));
  30934. var _v = _interopRequireDefault(__nccwpck_require__(8628));
  30935. var _v2 = _interopRequireDefault(__nccwpck_require__(6409));
  30936. var _v3 = _interopRequireDefault(__nccwpck_require__(5122));
  30937. var _v4 = _interopRequireDefault(__nccwpck_require__(9120));
  30938. var _nil = _interopRequireDefault(__nccwpck_require__(5332));
  30939. var _version = _interopRequireDefault(__nccwpck_require__(2414));
  30940. var _validate = _interopRequireDefault(__nccwpck_require__(6900));
  30941. var _stringify = _interopRequireDefault(__nccwpck_require__(8950));
  30942. var _parse = _interopRequireDefault(__nccwpck_require__(2746));
  30943. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  30944. /***/ }),
  30945. /***/ 4569:
  30946. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  30947. "use strict";
  30948. Object.defineProperty(exports, "__esModule", ({
  30949. value: true
  30950. }));
  30951. exports["default"] = void 0;
  30952. var _crypto = _interopRequireDefault(__nccwpck_require__(6113));
  30953. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  30954. function md5(bytes) {
  30955. if (Array.isArray(bytes)) {
  30956. bytes = Buffer.from(bytes);
  30957. } else if (typeof bytes === 'string') {
  30958. bytes = Buffer.from(bytes, 'utf8');
  30959. }
  30960. return _crypto.default.createHash('md5').update(bytes).digest();
  30961. }
  30962. var _default = md5;
  30963. exports["default"] = _default;
  30964. /***/ }),
  30965. /***/ 2054:
  30966. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  30967. "use strict";
  30968. Object.defineProperty(exports, "__esModule", ({
  30969. value: true
  30970. }));
  30971. exports["default"] = void 0;
  30972. var _crypto = _interopRequireDefault(__nccwpck_require__(6113));
  30973. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  30974. var _default = {
  30975. randomUUID: _crypto.default.randomUUID
  30976. };
  30977. exports["default"] = _default;
  30978. /***/ }),
  30979. /***/ 5332:
  30980. /***/ ((__unused_webpack_module, exports) => {
  30981. "use strict";
  30982. Object.defineProperty(exports, "__esModule", ({
  30983. value: true
  30984. }));
  30985. exports["default"] = void 0;
  30986. var _default = '00000000-0000-0000-0000-000000000000';
  30987. exports["default"] = _default;
  30988. /***/ }),
  30989. /***/ 2746:
  30990. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  30991. "use strict";
  30992. Object.defineProperty(exports, "__esModule", ({
  30993. value: true
  30994. }));
  30995. exports["default"] = void 0;
  30996. var _validate = _interopRequireDefault(__nccwpck_require__(6900));
  30997. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  30998. function parse(uuid) {
  30999. if (!(0, _validate.default)(uuid)) {
  31000. throw TypeError('Invalid UUID');
  31001. }
  31002. let v;
  31003. const arr = new Uint8Array(16); // Parse ########-....-....-....-............
  31004. arr[0] = (v = parseInt(uuid.slice(0, 8), 16)) >>> 24;
  31005. arr[1] = v >>> 16 & 0xff;
  31006. arr[2] = v >>> 8 & 0xff;
  31007. arr[3] = v & 0xff; // Parse ........-####-....-....-............
  31008. arr[4] = (v = parseInt(uuid.slice(9, 13), 16)) >>> 8;
  31009. arr[5] = v & 0xff; // Parse ........-....-####-....-............
  31010. arr[6] = (v = parseInt(uuid.slice(14, 18), 16)) >>> 8;
  31011. arr[7] = v & 0xff; // Parse ........-....-....-####-............
  31012. arr[8] = (v = parseInt(uuid.slice(19, 23), 16)) >>> 8;
  31013. arr[9] = v & 0xff; // Parse ........-....-....-....-############
  31014. // (Use "/" to avoid 32-bit truncation when bit-shifting high-order bytes)
  31015. arr[10] = (v = parseInt(uuid.slice(24, 36), 16)) / 0x10000000000 & 0xff;
  31016. arr[11] = v / 0x100000000 & 0xff;
  31017. arr[12] = v >>> 24 & 0xff;
  31018. arr[13] = v >>> 16 & 0xff;
  31019. arr[14] = v >>> 8 & 0xff;
  31020. arr[15] = v & 0xff;
  31021. return arr;
  31022. }
  31023. var _default = parse;
  31024. exports["default"] = _default;
  31025. /***/ }),
  31026. /***/ 814:
  31027. /***/ ((__unused_webpack_module, exports) => {
  31028. "use strict";
  31029. Object.defineProperty(exports, "__esModule", ({
  31030. value: true
  31031. }));
  31032. exports["default"] = void 0;
  31033. 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;
  31034. exports["default"] = _default;
  31035. /***/ }),
  31036. /***/ 807:
  31037. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31038. "use strict";
  31039. Object.defineProperty(exports, "__esModule", ({
  31040. value: true
  31041. }));
  31042. exports["default"] = rng;
  31043. var _crypto = _interopRequireDefault(__nccwpck_require__(6113));
  31044. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31045. const rnds8Pool = new Uint8Array(256); // # of random values to pre-allocate
  31046. let poolPtr = rnds8Pool.length;
  31047. function rng() {
  31048. if (poolPtr > rnds8Pool.length - 16) {
  31049. _crypto.default.randomFillSync(rnds8Pool);
  31050. poolPtr = 0;
  31051. }
  31052. return rnds8Pool.slice(poolPtr, poolPtr += 16);
  31053. }
  31054. /***/ }),
  31055. /***/ 5274:
  31056. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31057. "use strict";
  31058. Object.defineProperty(exports, "__esModule", ({
  31059. value: true
  31060. }));
  31061. exports["default"] = void 0;
  31062. var _crypto = _interopRequireDefault(__nccwpck_require__(6113));
  31063. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31064. function sha1(bytes) {
  31065. if (Array.isArray(bytes)) {
  31066. bytes = Buffer.from(bytes);
  31067. } else if (typeof bytes === 'string') {
  31068. bytes = Buffer.from(bytes, 'utf8');
  31069. }
  31070. return _crypto.default.createHash('sha1').update(bytes).digest();
  31071. }
  31072. var _default = sha1;
  31073. exports["default"] = _default;
  31074. /***/ }),
  31075. /***/ 8950:
  31076. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31077. "use strict";
  31078. Object.defineProperty(exports, "__esModule", ({
  31079. value: true
  31080. }));
  31081. exports["default"] = void 0;
  31082. exports.unsafeStringify = unsafeStringify;
  31083. var _validate = _interopRequireDefault(__nccwpck_require__(6900));
  31084. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31085. /**
  31086. * Convert array of 16 byte values to UUID string format of the form:
  31087. * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
  31088. */
  31089. const byteToHex = [];
  31090. for (let i = 0; i < 256; ++i) {
  31091. byteToHex.push((i + 0x100).toString(16).slice(1));
  31092. }
  31093. function unsafeStringify(arr, offset = 0) {
  31094. // Note: Be careful editing this code! It's been tuned for performance
  31095. // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
  31096. 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]];
  31097. }
  31098. function stringify(arr, offset = 0) {
  31099. const uuid = unsafeStringify(arr, offset); // Consistency check for valid UUID. If this throws, it's likely due to one
  31100. // of the following:
  31101. // - One or more input array values don't map to a hex octet (leading to
  31102. // "undefined" in the uuid)
  31103. // - Invalid input values for the RFC `version` or `variant` fields
  31104. if (!(0, _validate.default)(uuid)) {
  31105. throw TypeError('Stringified UUID is invalid');
  31106. }
  31107. return uuid;
  31108. }
  31109. var _default = stringify;
  31110. exports["default"] = _default;
  31111. /***/ }),
  31112. /***/ 8628:
  31113. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31114. "use strict";
  31115. Object.defineProperty(exports, "__esModule", ({
  31116. value: true
  31117. }));
  31118. exports["default"] = void 0;
  31119. var _rng = _interopRequireDefault(__nccwpck_require__(807));
  31120. var _stringify = __nccwpck_require__(8950);
  31121. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31122. // **`v1()` - Generate time-based UUID**
  31123. //
  31124. // Inspired by https://github.com/LiosK/UUID.js
  31125. // and http://docs.python.org/library/uuid.html
  31126. let _nodeId;
  31127. let _clockseq; // Previous uuid creation time
  31128. let _lastMSecs = 0;
  31129. let _lastNSecs = 0; // See https://github.com/uuidjs/uuid for API details
  31130. function v1(options, buf, offset) {
  31131. let i = buf && offset || 0;
  31132. const b = buf || new Array(16);
  31133. options = options || {};
  31134. let node = options.node || _nodeId;
  31135. let clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq; // node and clockseq need to be initialized to random values if they're not
  31136. // specified. We do this lazily to minimize issues related to insufficient
  31137. // system entropy. See #189
  31138. if (node == null || clockseq == null) {
  31139. const seedBytes = options.random || (options.rng || _rng.default)();
  31140. if (node == null) {
  31141. // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1)
  31142. node = _nodeId = [seedBytes[0] | 0x01, seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]];
  31143. }
  31144. if (clockseq == null) {
  31145. // Per 4.2.2, randomize (14 bit) clockseq
  31146. clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff;
  31147. }
  31148. } // UUID timestamps are 100 nano-second units since the Gregorian epoch,
  31149. // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so
  31150. // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs'
  31151. // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00.
  31152. let msecs = options.msecs !== undefined ? options.msecs : Date.now(); // Per 4.2.1.2, use count of uuid's generated during the current clock
  31153. // cycle to simulate higher resolution clock
  31154. let nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1; // Time since last uuid creation (in msecs)
  31155. const dt = msecs - _lastMSecs + (nsecs - _lastNSecs) / 10000; // Per 4.2.1.2, Bump clockseq on clock regression
  31156. if (dt < 0 && options.clockseq === undefined) {
  31157. clockseq = clockseq + 1 & 0x3fff;
  31158. } // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new
  31159. // time interval
  31160. if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) {
  31161. nsecs = 0;
  31162. } // Per 4.2.1.2 Throw error if too many uuids are requested
  31163. if (nsecs >= 10000) {
  31164. throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");
  31165. }
  31166. _lastMSecs = msecs;
  31167. _lastNSecs = nsecs;
  31168. _clockseq = clockseq; // Per 4.1.4 - Convert from unix epoch to Gregorian epoch
  31169. msecs += 12219292800000; // `time_low`
  31170. const tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000;
  31171. b[i++] = tl >>> 24 & 0xff;
  31172. b[i++] = tl >>> 16 & 0xff;
  31173. b[i++] = tl >>> 8 & 0xff;
  31174. b[i++] = tl & 0xff; // `time_mid`
  31175. const tmh = msecs / 0x100000000 * 10000 & 0xfffffff;
  31176. b[i++] = tmh >>> 8 & 0xff;
  31177. b[i++] = tmh & 0xff; // `time_high_and_version`
  31178. b[i++] = tmh >>> 24 & 0xf | 0x10; // include version
  31179. b[i++] = tmh >>> 16 & 0xff; // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant)
  31180. b[i++] = clockseq >>> 8 | 0x80; // `clock_seq_low`
  31181. b[i++] = clockseq & 0xff; // `node`
  31182. for (let n = 0; n < 6; ++n) {
  31183. b[i + n] = node[n];
  31184. }
  31185. return buf || (0, _stringify.unsafeStringify)(b);
  31186. }
  31187. var _default = v1;
  31188. exports["default"] = _default;
  31189. /***/ }),
  31190. /***/ 6409:
  31191. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31192. "use strict";
  31193. Object.defineProperty(exports, "__esModule", ({
  31194. value: true
  31195. }));
  31196. exports["default"] = void 0;
  31197. var _v = _interopRequireDefault(__nccwpck_require__(5998));
  31198. var _md = _interopRequireDefault(__nccwpck_require__(4569));
  31199. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31200. const v3 = (0, _v.default)('v3', 0x30, _md.default);
  31201. var _default = v3;
  31202. exports["default"] = _default;
  31203. /***/ }),
  31204. /***/ 5998:
  31205. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31206. "use strict";
  31207. Object.defineProperty(exports, "__esModule", ({
  31208. value: true
  31209. }));
  31210. exports.URL = exports.DNS = void 0;
  31211. exports["default"] = v35;
  31212. var _stringify = __nccwpck_require__(8950);
  31213. var _parse = _interopRequireDefault(__nccwpck_require__(2746));
  31214. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31215. function stringToBytes(str) {
  31216. str = unescape(encodeURIComponent(str)); // UTF8 escape
  31217. const bytes = [];
  31218. for (let i = 0; i < str.length; ++i) {
  31219. bytes.push(str.charCodeAt(i));
  31220. }
  31221. return bytes;
  31222. }
  31223. const DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8';
  31224. exports.DNS = DNS;
  31225. const URL = '6ba7b811-9dad-11d1-80b4-00c04fd430c8';
  31226. exports.URL = URL;
  31227. function v35(name, version, hashfunc) {
  31228. function generateUUID(value, namespace, buf, offset) {
  31229. var _namespace;
  31230. if (typeof value === 'string') {
  31231. value = stringToBytes(value);
  31232. }
  31233. if (typeof namespace === 'string') {
  31234. namespace = (0, _parse.default)(namespace);
  31235. }
  31236. if (((_namespace = namespace) === null || _namespace === void 0 ? void 0 : _namespace.length) !== 16) {
  31237. throw TypeError('Namespace must be array-like (16 iterable integer values, 0-255)');
  31238. } // Compute hash of namespace and value, Per 4.3
  31239. // Future: Use spread syntax when supported on all platforms, e.g. `bytes =
  31240. // hashfunc([...namespace, ... value])`
  31241. let bytes = new Uint8Array(16 + value.length);
  31242. bytes.set(namespace);
  31243. bytes.set(value, namespace.length);
  31244. bytes = hashfunc(bytes);
  31245. bytes[6] = bytes[6] & 0x0f | version;
  31246. bytes[8] = bytes[8] & 0x3f | 0x80;
  31247. if (buf) {
  31248. offset = offset || 0;
  31249. for (let i = 0; i < 16; ++i) {
  31250. buf[offset + i] = bytes[i];
  31251. }
  31252. return buf;
  31253. }
  31254. return (0, _stringify.unsafeStringify)(bytes);
  31255. } // Function#name is not settable on some platforms (#270)
  31256. try {
  31257. generateUUID.name = name; // eslint-disable-next-line no-empty
  31258. } catch (err) {} // For CommonJS default export support
  31259. generateUUID.DNS = DNS;
  31260. generateUUID.URL = URL;
  31261. return generateUUID;
  31262. }
  31263. /***/ }),
  31264. /***/ 5122:
  31265. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31266. "use strict";
  31267. Object.defineProperty(exports, "__esModule", ({
  31268. value: true
  31269. }));
  31270. exports["default"] = void 0;
  31271. var _native = _interopRequireDefault(__nccwpck_require__(2054));
  31272. var _rng = _interopRequireDefault(__nccwpck_require__(807));
  31273. var _stringify = __nccwpck_require__(8950);
  31274. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31275. function v4(options, buf, offset) {
  31276. if (_native.default.randomUUID && !buf && !options) {
  31277. return _native.default.randomUUID();
  31278. }
  31279. options = options || {};
  31280. const rnds = options.random || (options.rng || _rng.default)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
  31281. rnds[6] = rnds[6] & 0x0f | 0x40;
  31282. rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided
  31283. if (buf) {
  31284. offset = offset || 0;
  31285. for (let i = 0; i < 16; ++i) {
  31286. buf[offset + i] = rnds[i];
  31287. }
  31288. return buf;
  31289. }
  31290. return (0, _stringify.unsafeStringify)(rnds);
  31291. }
  31292. var _default = v4;
  31293. exports["default"] = _default;
  31294. /***/ }),
  31295. /***/ 9120:
  31296. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31297. "use strict";
  31298. Object.defineProperty(exports, "__esModule", ({
  31299. value: true
  31300. }));
  31301. exports["default"] = void 0;
  31302. var _v = _interopRequireDefault(__nccwpck_require__(5998));
  31303. var _sha = _interopRequireDefault(__nccwpck_require__(5274));
  31304. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31305. const v5 = (0, _v.default)('v5', 0x50, _sha.default);
  31306. var _default = v5;
  31307. exports["default"] = _default;
  31308. /***/ }),
  31309. /***/ 6900:
  31310. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31311. "use strict";
  31312. Object.defineProperty(exports, "__esModule", ({
  31313. value: true
  31314. }));
  31315. exports["default"] = void 0;
  31316. var _regex = _interopRequireDefault(__nccwpck_require__(814));
  31317. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31318. function validate(uuid) {
  31319. return typeof uuid === 'string' && _regex.default.test(uuid);
  31320. }
  31321. var _default = validate;
  31322. exports["default"] = _default;
  31323. /***/ }),
  31324. /***/ 2414:
  31325. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31326. "use strict";
  31327. Object.defineProperty(exports, "__esModule", ({
  31328. value: true
  31329. }));
  31330. exports["default"] = void 0;
  31331. var _validate = _interopRequireDefault(__nccwpck_require__(6900));
  31332. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31333. function version(uuid) {
  31334. if (!(0, _validate.default)(uuid)) {
  31335. throw TypeError('Invalid UUID');
  31336. }
  31337. return parseInt(uuid.slice(14, 15), 16);
  31338. }
  31339. var _default = version;
  31340. exports["default"] = _default;
  31341. /***/ }),
  31342. /***/ 2940:
  31343. /***/ ((module) => {
  31344. // Returns a wrapper function that returns a wrapped callback
  31345. // The wrapper function should do some stuff, and return a
  31346. // presumably different callback function.
  31347. // This makes sure that own properties are retained, so that
  31348. // decorations and such are not lost along the way.
  31349. module.exports = wrappy
  31350. function wrappy (fn, cb) {
  31351. if (fn && cb) return wrappy(fn)(cb)
  31352. if (typeof fn !== 'function')
  31353. throw new TypeError('need wrapper function')
  31354. Object.keys(fn).forEach(function (k) {
  31355. wrapper[k] = fn[k]
  31356. })
  31357. return wrapper
  31358. function wrapper() {
  31359. var args = new Array(arguments.length)
  31360. for (var i = 0; i < args.length; i++) {
  31361. args[i] = arguments[i]
  31362. }
  31363. var ret = fn.apply(this, args)
  31364. var cb = args[args.length-1]
  31365. if (typeof ret === 'function' && ret !== cb) {
  31366. Object.keys(cb).forEach(function (k) {
  31367. ret[k] = cb[k]
  31368. })
  31369. }
  31370. return ret
  31371. }
  31372. }
  31373. /***/ }),
  31374. /***/ 9491:
  31375. /***/ ((module) => {
  31376. "use strict";
  31377. module.exports = require("assert");
  31378. /***/ }),
  31379. /***/ 852:
  31380. /***/ ((module) => {
  31381. "use strict";
  31382. module.exports = require("async_hooks");
  31383. /***/ }),
  31384. /***/ 4300:
  31385. /***/ ((module) => {
  31386. "use strict";
  31387. module.exports = require("buffer");
  31388. /***/ }),
  31389. /***/ 2081:
  31390. /***/ ((module) => {
  31391. "use strict";
  31392. module.exports = require("child_process");
  31393. /***/ }),
  31394. /***/ 6206:
  31395. /***/ ((module) => {
  31396. "use strict";
  31397. module.exports = require("console");
  31398. /***/ }),
  31399. /***/ 6113:
  31400. /***/ ((module) => {
  31401. "use strict";
  31402. module.exports = require("crypto");
  31403. /***/ }),
  31404. /***/ 7643:
  31405. /***/ ((module) => {
  31406. "use strict";
  31407. module.exports = require("diagnostics_channel");
  31408. /***/ }),
  31409. /***/ 2361:
  31410. /***/ ((module) => {
  31411. "use strict";
  31412. module.exports = require("events");
  31413. /***/ }),
  31414. /***/ 7147:
  31415. /***/ ((module) => {
  31416. "use strict";
  31417. module.exports = require("fs");
  31418. /***/ }),
  31419. /***/ 3685:
  31420. /***/ ((module) => {
  31421. "use strict";
  31422. module.exports = require("http");
  31423. /***/ }),
  31424. /***/ 5158:
  31425. /***/ ((module) => {
  31426. "use strict";
  31427. module.exports = require("http2");
  31428. /***/ }),
  31429. /***/ 5687:
  31430. /***/ ((module) => {
  31431. "use strict";
  31432. module.exports = require("https");
  31433. /***/ }),
  31434. /***/ 1808:
  31435. /***/ ((module) => {
  31436. "use strict";
  31437. module.exports = require("net");
  31438. /***/ }),
  31439. /***/ 5673:
  31440. /***/ ((module) => {
  31441. "use strict";
  31442. module.exports = require("node:events");
  31443. /***/ }),
  31444. /***/ 4492:
  31445. /***/ ((module) => {
  31446. "use strict";
  31447. module.exports = require("node:stream");
  31448. /***/ }),
  31449. /***/ 7261:
  31450. /***/ ((module) => {
  31451. "use strict";
  31452. module.exports = require("node:util");
  31453. /***/ }),
  31454. /***/ 2037:
  31455. /***/ ((module) => {
  31456. "use strict";
  31457. module.exports = require("os");
  31458. /***/ }),
  31459. /***/ 1017:
  31460. /***/ ((module) => {
  31461. "use strict";
  31462. module.exports = require("path");
  31463. /***/ }),
  31464. /***/ 4074:
  31465. /***/ ((module) => {
  31466. "use strict";
  31467. module.exports = require("perf_hooks");
  31468. /***/ }),
  31469. /***/ 3477:
  31470. /***/ ((module) => {
  31471. "use strict";
  31472. module.exports = require("querystring");
  31473. /***/ }),
  31474. /***/ 2781:
  31475. /***/ ((module) => {
  31476. "use strict";
  31477. module.exports = require("stream");
  31478. /***/ }),
  31479. /***/ 5356:
  31480. /***/ ((module) => {
  31481. "use strict";
  31482. module.exports = require("stream/web");
  31483. /***/ }),
  31484. /***/ 1576:
  31485. /***/ ((module) => {
  31486. "use strict";
  31487. module.exports = require("string_decoder");
  31488. /***/ }),
  31489. /***/ 9512:
  31490. /***/ ((module) => {
  31491. "use strict";
  31492. module.exports = require("timers");
  31493. /***/ }),
  31494. /***/ 4404:
  31495. /***/ ((module) => {
  31496. "use strict";
  31497. module.exports = require("tls");
  31498. /***/ }),
  31499. /***/ 7310:
  31500. /***/ ((module) => {
  31501. "use strict";
  31502. module.exports = require("url");
  31503. /***/ }),
  31504. /***/ 3837:
  31505. /***/ ((module) => {
  31506. "use strict";
  31507. module.exports = require("util");
  31508. /***/ }),
  31509. /***/ 9830:
  31510. /***/ ((module) => {
  31511. "use strict";
  31512. module.exports = require("util/types");
  31513. /***/ }),
  31514. /***/ 1267:
  31515. /***/ ((module) => {
  31516. "use strict";
  31517. module.exports = require("worker_threads");
  31518. /***/ }),
  31519. /***/ 9796:
  31520. /***/ ((module) => {
  31521. "use strict";
  31522. module.exports = require("zlib");
  31523. /***/ }),
  31524. /***/ 2960:
  31525. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  31526. "use strict";
  31527. const WritableStream = (__nccwpck_require__(4492).Writable)
  31528. const inherits = (__nccwpck_require__(7261).inherits)
  31529. const StreamSearch = __nccwpck_require__(1142)
  31530. const PartStream = __nccwpck_require__(1620)
  31531. const HeaderParser = __nccwpck_require__(2032)
  31532. const DASH = 45
  31533. const B_ONEDASH = Buffer.from('-')
  31534. const B_CRLF = Buffer.from('\r\n')
  31535. const EMPTY_FN = function () {}
  31536. function Dicer (cfg) {
  31537. if (!(this instanceof Dicer)) { return new Dicer(cfg) }
  31538. WritableStream.call(this, cfg)
  31539. if (!cfg || (!cfg.headerFirst && typeof cfg.boundary !== 'string')) { throw new TypeError('Boundary required') }
  31540. if (typeof cfg.boundary === 'string') { this.setBoundary(cfg.boundary) } else { this._bparser = undefined }
  31541. this._headerFirst = cfg.headerFirst
  31542. this._dashes = 0
  31543. this._parts = 0
  31544. this._finished = false
  31545. this._realFinish = false
  31546. this._isPreamble = true
  31547. this._justMatched = false
  31548. this._firstWrite = true
  31549. this._inHeader = true
  31550. this._part = undefined
  31551. this._cb = undefined
  31552. this._ignoreData = false
  31553. this._partOpts = { highWaterMark: cfg.partHwm }
  31554. this._pause = false
  31555. const self = this
  31556. this._hparser = new HeaderParser(cfg)
  31557. this._hparser.on('header', function (header) {
  31558. self._inHeader = false
  31559. self._part.emit('header', header)
  31560. })
  31561. }
  31562. inherits(Dicer, WritableStream)
  31563. Dicer.prototype.emit = function (ev) {
  31564. if (ev === 'finish' && !this._realFinish) {
  31565. if (!this._finished) {
  31566. const self = this
  31567. process.nextTick(function () {
  31568. self.emit('error', new Error('Unexpected end of multipart data'))
  31569. if (self._part && !self._ignoreData) {
  31570. const type = (self._isPreamble ? 'Preamble' : 'Part')
  31571. self._part.emit('error', new Error(type + ' terminated early due to unexpected end of multipart data'))
  31572. self._part.push(null)
  31573. process.nextTick(function () {
  31574. self._realFinish = true
  31575. self.emit('finish')
  31576. self._realFinish = false
  31577. })
  31578. return
  31579. }
  31580. self._realFinish = true
  31581. self.emit('finish')
  31582. self._realFinish = false
  31583. })
  31584. }
  31585. } else { WritableStream.prototype.emit.apply(this, arguments) }
  31586. }
  31587. Dicer.prototype._write = function (data, encoding, cb) {
  31588. // ignore unexpected data (e.g. extra trailer data after finished)
  31589. if (!this._hparser && !this._bparser) { return cb() }
  31590. if (this._headerFirst && this._isPreamble) {
  31591. if (!this._part) {
  31592. this._part = new PartStream(this._partOpts)
  31593. if (this.listenerCount('preamble') !== 0) { this.emit('preamble', this._part) } else { this._ignore() }
  31594. }
  31595. const r = this._hparser.push(data)
  31596. if (!this._inHeader && r !== undefined && r < data.length) { data = data.slice(r) } else { return cb() }
  31597. }
  31598. // allows for "easier" testing
  31599. if (this._firstWrite) {
  31600. this._bparser.push(B_CRLF)
  31601. this._firstWrite = false
  31602. }
  31603. this._bparser.push(data)
  31604. if (this._pause) { this._cb = cb } else { cb() }
  31605. }
  31606. Dicer.prototype.reset = function () {
  31607. this._part = undefined
  31608. this._bparser = undefined
  31609. this._hparser = undefined
  31610. }
  31611. Dicer.prototype.setBoundary = function (boundary) {
  31612. const self = this
  31613. this._bparser = new StreamSearch('\r\n--' + boundary)
  31614. this._bparser.on('info', function (isMatch, data, start, end) {
  31615. self._oninfo(isMatch, data, start, end)
  31616. })
  31617. }
  31618. Dicer.prototype._ignore = function () {
  31619. if (this._part && !this._ignoreData) {
  31620. this._ignoreData = true
  31621. this._part.on('error', EMPTY_FN)
  31622. // we must perform some kind of read on the stream even though we are
  31623. // ignoring the data, otherwise node's Readable stream will not emit 'end'
  31624. // after pushing null to the stream
  31625. this._part.resume()
  31626. }
  31627. }
  31628. Dicer.prototype._oninfo = function (isMatch, data, start, end) {
  31629. let buf; const self = this; let i = 0; let r; let shouldWriteMore = true
  31630. if (!this._part && this._justMatched && data) {
  31631. while (this._dashes < 2 && (start + i) < end) {
  31632. if (data[start + i] === DASH) {
  31633. ++i
  31634. ++this._dashes
  31635. } else {
  31636. if (this._dashes) { buf = B_ONEDASH }
  31637. this._dashes = 0
  31638. break
  31639. }
  31640. }
  31641. if (this._dashes === 2) {
  31642. if ((start + i) < end && this.listenerCount('trailer') !== 0) { this.emit('trailer', data.slice(start + i, end)) }
  31643. this.reset()
  31644. this._finished = true
  31645. // no more parts will be added
  31646. if (self._parts === 0) {
  31647. self._realFinish = true
  31648. self.emit('finish')
  31649. self._realFinish = false
  31650. }
  31651. }
  31652. if (this._dashes) { return }
  31653. }
  31654. if (this._justMatched) { this._justMatched = false }
  31655. if (!this._part) {
  31656. this._part = new PartStream(this._partOpts)
  31657. this._part._read = function (n) {
  31658. self._unpause()
  31659. }
  31660. if (this._isPreamble && this.listenerCount('preamble') !== 0) {
  31661. this.emit('preamble', this._part)
  31662. } else if (this._isPreamble !== true && this.listenerCount('part') !== 0) {
  31663. this.emit('part', this._part)
  31664. } else {
  31665. this._ignore()
  31666. }
  31667. if (!this._isPreamble) { this._inHeader = true }
  31668. }
  31669. if (data && start < end && !this._ignoreData) {
  31670. if (this._isPreamble || !this._inHeader) {
  31671. if (buf) { shouldWriteMore = this._part.push(buf) }
  31672. shouldWriteMore = this._part.push(data.slice(start, end))
  31673. if (!shouldWriteMore) { this._pause = true }
  31674. } else if (!this._isPreamble && this._inHeader) {
  31675. if (buf) { this._hparser.push(buf) }
  31676. r = this._hparser.push(data.slice(start, end))
  31677. if (!this._inHeader && r !== undefined && r < end) { this._oninfo(false, data, start + r, end) }
  31678. }
  31679. }
  31680. if (isMatch) {
  31681. this._hparser.reset()
  31682. if (this._isPreamble) { this._isPreamble = false } else {
  31683. if (start !== end) {
  31684. ++this._parts
  31685. this._part.on('end', function () {
  31686. if (--self._parts === 0) {
  31687. if (self._finished) {
  31688. self._realFinish = true
  31689. self.emit('finish')
  31690. self._realFinish = false
  31691. } else {
  31692. self._unpause()
  31693. }
  31694. }
  31695. })
  31696. }
  31697. }
  31698. this._part.push(null)
  31699. this._part = undefined
  31700. this._ignoreData = false
  31701. this._justMatched = true
  31702. this._dashes = 0
  31703. }
  31704. }
  31705. Dicer.prototype._unpause = function () {
  31706. if (!this._pause) { return }
  31707. this._pause = false
  31708. if (this._cb) {
  31709. const cb = this._cb
  31710. this._cb = undefined
  31711. cb()
  31712. }
  31713. }
  31714. module.exports = Dicer
  31715. /***/ }),
  31716. /***/ 2032:
  31717. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  31718. "use strict";
  31719. const EventEmitter = (__nccwpck_require__(5673).EventEmitter)
  31720. const inherits = (__nccwpck_require__(7261).inherits)
  31721. const getLimit = __nccwpck_require__(1467)
  31722. const StreamSearch = __nccwpck_require__(1142)
  31723. const B_DCRLF = Buffer.from('\r\n\r\n')
  31724. const RE_CRLF = /\r\n/g
  31725. const RE_HDR = /^([^:]+):[ \t]?([\x00-\xFF]+)?$/ // eslint-disable-line no-control-regex
  31726. function HeaderParser (cfg) {
  31727. EventEmitter.call(this)
  31728. cfg = cfg || {}
  31729. const self = this
  31730. this.nread = 0
  31731. this.maxed = false
  31732. this.npairs = 0
  31733. this.maxHeaderPairs = getLimit(cfg, 'maxHeaderPairs', 2000)
  31734. this.maxHeaderSize = getLimit(cfg, 'maxHeaderSize', 80 * 1024)
  31735. this.buffer = ''
  31736. this.header = {}
  31737. this.finished = false
  31738. this.ss = new StreamSearch(B_DCRLF)
  31739. this.ss.on('info', function (isMatch, data, start, end) {
  31740. if (data && !self.maxed) {
  31741. if (self.nread + end - start >= self.maxHeaderSize) {
  31742. end = self.maxHeaderSize - self.nread + start
  31743. self.nread = self.maxHeaderSize
  31744. self.maxed = true
  31745. } else { self.nread += (end - start) }
  31746. self.buffer += data.toString('binary', start, end)
  31747. }
  31748. if (isMatch) { self._finish() }
  31749. })
  31750. }
  31751. inherits(HeaderParser, EventEmitter)
  31752. HeaderParser.prototype.push = function (data) {
  31753. const r = this.ss.push(data)
  31754. if (this.finished) { return r }
  31755. }
  31756. HeaderParser.prototype.reset = function () {
  31757. this.finished = false
  31758. this.buffer = ''
  31759. this.header = {}
  31760. this.ss.reset()
  31761. }
  31762. HeaderParser.prototype._finish = function () {
  31763. if (this.buffer) { this._parseHeader() }
  31764. this.ss.matches = this.ss.maxMatches
  31765. const header = this.header
  31766. this.header = {}
  31767. this.buffer = ''
  31768. this.finished = true
  31769. this.nread = this.npairs = 0
  31770. this.maxed = false
  31771. this.emit('header', header)
  31772. }
  31773. HeaderParser.prototype._parseHeader = function () {
  31774. if (this.npairs === this.maxHeaderPairs) { return }
  31775. const lines = this.buffer.split(RE_CRLF)
  31776. const len = lines.length
  31777. let m, h
  31778. for (var i = 0; i < len; ++i) { // eslint-disable-line no-var
  31779. if (lines[i].length === 0) { continue }
  31780. if (lines[i][0] === '\t' || lines[i][0] === ' ') {
  31781. // folded header content
  31782. // RFC2822 says to just remove the CRLF and not the whitespace following
  31783. // it, so we follow the RFC and include the leading whitespace ...
  31784. if (h) {
  31785. this.header[h][this.header[h].length - 1] += lines[i]
  31786. continue
  31787. }
  31788. }
  31789. const posColon = lines[i].indexOf(':')
  31790. if (
  31791. posColon === -1 ||
  31792. posColon === 0
  31793. ) {
  31794. return
  31795. }
  31796. m = RE_HDR.exec(lines[i])
  31797. h = m[1].toLowerCase()
  31798. this.header[h] = this.header[h] || []
  31799. this.header[h].push((m[2] || ''))
  31800. if (++this.npairs === this.maxHeaderPairs) { break }
  31801. }
  31802. }
  31803. module.exports = HeaderParser
  31804. /***/ }),
  31805. /***/ 1620:
  31806. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  31807. "use strict";
  31808. const inherits = (__nccwpck_require__(7261).inherits)
  31809. const ReadableStream = (__nccwpck_require__(4492).Readable)
  31810. function PartStream (opts) {
  31811. ReadableStream.call(this, opts)
  31812. }
  31813. inherits(PartStream, ReadableStream)
  31814. PartStream.prototype._read = function (n) {}
  31815. module.exports = PartStream
  31816. /***/ }),
  31817. /***/ 1142:
  31818. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  31819. "use strict";
  31820. /**
  31821. * Copyright Brian White. All rights reserved.
  31822. *
  31823. * @see https://github.com/mscdex/streamsearch
  31824. *
  31825. * Permission is hereby granted, free of charge, to any person obtaining a copy
  31826. * of this software and associated documentation files (the "Software"), to
  31827. * deal in the Software without restriction, including without limitation the
  31828. * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
  31829. * sell copies of the Software, and to permit persons to whom the Software is
  31830. * furnished to do so, subject to the following conditions:
  31831. *
  31832. * The above copyright notice and this permission notice shall be included in
  31833. * all copies or substantial portions of the Software.
  31834. *
  31835. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  31836. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  31837. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  31838. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  31839. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  31840. * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
  31841. * IN THE SOFTWARE.
  31842. *
  31843. * Based heavily on the Streaming Boyer-Moore-Horspool C++ implementation
  31844. * by Hongli Lai at: https://github.com/FooBarWidget/boyer-moore-horspool
  31845. */
  31846. const EventEmitter = (__nccwpck_require__(5673).EventEmitter)
  31847. const inherits = (__nccwpck_require__(7261).inherits)
  31848. function SBMH (needle) {
  31849. if (typeof needle === 'string') {
  31850. needle = Buffer.from(needle)
  31851. }
  31852. if (!Buffer.isBuffer(needle)) {
  31853. throw new TypeError('The needle has to be a String or a Buffer.')
  31854. }
  31855. const needleLength = needle.length
  31856. if (needleLength === 0) {
  31857. throw new Error('The needle cannot be an empty String/Buffer.')
  31858. }
  31859. if (needleLength > 256) {
  31860. throw new Error('The needle cannot have a length bigger than 256.')
  31861. }
  31862. this.maxMatches = Infinity
  31863. this.matches = 0
  31864. this._occ = new Array(256)
  31865. .fill(needleLength) // Initialize occurrence table.
  31866. this._lookbehind_size = 0
  31867. this._needle = needle
  31868. this._bufpos = 0
  31869. this._lookbehind = Buffer.alloc(needleLength)
  31870. // Populate occurrence table with analysis of the needle,
  31871. // ignoring last letter.
  31872. for (var i = 0; i < needleLength - 1; ++i) { // eslint-disable-line no-var
  31873. this._occ[needle[i]] = needleLength - 1 - i
  31874. }
  31875. }
  31876. inherits(SBMH, EventEmitter)
  31877. SBMH.prototype.reset = function () {
  31878. this._lookbehind_size = 0
  31879. this.matches = 0
  31880. this._bufpos = 0
  31881. }
  31882. SBMH.prototype.push = function (chunk, pos) {
  31883. if (!Buffer.isBuffer(chunk)) {
  31884. chunk = Buffer.from(chunk, 'binary')
  31885. }
  31886. const chlen = chunk.length
  31887. this._bufpos = pos || 0
  31888. let r
  31889. while (r !== chlen && this.matches < this.maxMatches) { r = this._sbmh_feed(chunk) }
  31890. return r
  31891. }
  31892. SBMH.prototype._sbmh_feed = function (data) {
  31893. const len = data.length
  31894. const needle = this._needle
  31895. const needleLength = needle.length
  31896. const lastNeedleChar = needle[needleLength - 1]
  31897. // Positive: points to a position in `data`
  31898. // pos == 3 points to data[3]
  31899. // Negative: points to a position in the lookbehind buffer
  31900. // pos == -2 points to lookbehind[lookbehind_size - 2]
  31901. let pos = -this._lookbehind_size
  31902. let ch
  31903. if (pos < 0) {
  31904. // Lookbehind buffer is not empty. Perform Boyer-Moore-Horspool
  31905. // search with character lookup code that considers both the
  31906. // lookbehind buffer and the current round's haystack data.
  31907. //
  31908. // Loop until
  31909. // there is a match.
  31910. // or until
  31911. // we've moved past the position that requires the
  31912. // lookbehind buffer. In this case we switch to the
  31913. // optimized loop.
  31914. // or until
  31915. // the character to look at lies outside the haystack.
  31916. while (pos < 0 && pos <= len - needleLength) {
  31917. ch = this._sbmh_lookup_char(data, pos + needleLength - 1)
  31918. if (
  31919. ch === lastNeedleChar &&
  31920. this._sbmh_memcmp(data, pos, needleLength - 1)
  31921. ) {
  31922. this._lookbehind_size = 0
  31923. ++this.matches
  31924. this.emit('info', true)
  31925. return (this._bufpos = pos + needleLength)
  31926. }
  31927. pos += this._occ[ch]
  31928. }
  31929. // No match.
  31930. if (pos < 0) {
  31931. // There's too few data for Boyer-Moore-Horspool to run,
  31932. // so let's use a different algorithm to skip as much as
  31933. // we can.
  31934. // Forward pos until
  31935. // the trailing part of lookbehind + data
  31936. // looks like the beginning of the needle
  31937. // or until
  31938. // pos == 0
  31939. while (pos < 0 && !this._sbmh_memcmp(data, pos, len - pos)) { ++pos }
  31940. }
  31941. if (pos >= 0) {
  31942. // Discard lookbehind buffer.
  31943. this.emit('info', false, this._lookbehind, 0, this._lookbehind_size)
  31944. this._lookbehind_size = 0
  31945. } else {
  31946. // Cut off part of the lookbehind buffer that has
  31947. // been processed and append the entire haystack
  31948. // into it.
  31949. const bytesToCutOff = this._lookbehind_size + pos
  31950. if (bytesToCutOff > 0) {
  31951. // The cut off data is guaranteed not to contain the needle.
  31952. this.emit('info', false, this._lookbehind, 0, bytesToCutOff)
  31953. }
  31954. this._lookbehind.copy(this._lookbehind, 0, bytesToCutOff,
  31955. this._lookbehind_size - bytesToCutOff)
  31956. this._lookbehind_size -= bytesToCutOff
  31957. data.copy(this._lookbehind, this._lookbehind_size)
  31958. this._lookbehind_size += len
  31959. this._bufpos = len
  31960. return len
  31961. }
  31962. }
  31963. pos += (pos >= 0) * this._bufpos
  31964. // Lookbehind buffer is now empty. We only need to check if the
  31965. // needle is in the haystack.
  31966. if (data.indexOf(needle, pos) !== -1) {
  31967. pos = data.indexOf(needle, pos)
  31968. ++this.matches
  31969. if (pos > 0) { this.emit('info', true, data, this._bufpos, pos) } else { this.emit('info', true) }
  31970. return (this._bufpos = pos + needleLength)
  31971. } else {
  31972. pos = len - needleLength
  31973. }
  31974. // There was no match. If there's trailing haystack data that we cannot
  31975. // match yet using the Boyer-Moore-Horspool algorithm (because the trailing
  31976. // data is less than the needle size) then match using a modified
  31977. // algorithm that starts matching from the beginning instead of the end.
  31978. // Whatever trailing data is left after running this algorithm is added to
  31979. // the lookbehind buffer.
  31980. while (
  31981. pos < len &&
  31982. (
  31983. data[pos] !== needle[0] ||
  31984. (
  31985. (Buffer.compare(
  31986. data.subarray(pos, pos + len - pos),
  31987. needle.subarray(0, len - pos)
  31988. ) !== 0)
  31989. )
  31990. )
  31991. ) {
  31992. ++pos
  31993. }
  31994. if (pos < len) {
  31995. data.copy(this._lookbehind, 0, pos, pos + (len - pos))
  31996. this._lookbehind_size = len - pos
  31997. }
  31998. // Everything until pos is guaranteed not to contain needle data.
  31999. if (pos > 0) { this.emit('info', false, data, this._bufpos, pos < len ? pos : len) }
  32000. this._bufpos = len
  32001. return len
  32002. }
  32003. SBMH.prototype._sbmh_lookup_char = function (data, pos) {
  32004. return (pos < 0)
  32005. ? this._lookbehind[this._lookbehind_size + pos]
  32006. : data[pos]
  32007. }
  32008. SBMH.prototype._sbmh_memcmp = function (data, pos, len) {
  32009. for (var i = 0; i < len; ++i) { // eslint-disable-line no-var
  32010. if (this._sbmh_lookup_char(data, pos + i) !== this._needle[i]) { return false }
  32011. }
  32012. return true
  32013. }
  32014. module.exports = SBMH
  32015. /***/ }),
  32016. /***/ 727:
  32017. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  32018. "use strict";
  32019. const WritableStream = (__nccwpck_require__(4492).Writable)
  32020. const { inherits } = __nccwpck_require__(7261)
  32021. const Dicer = __nccwpck_require__(2960)
  32022. const MultipartParser = __nccwpck_require__(2183)
  32023. const UrlencodedParser = __nccwpck_require__(8306)
  32024. const parseParams = __nccwpck_require__(1854)
  32025. function Busboy (opts) {
  32026. if (!(this instanceof Busboy)) { return new Busboy(opts) }
  32027. if (typeof opts !== 'object') {
  32028. throw new TypeError('Busboy expected an options-Object.')
  32029. }
  32030. if (typeof opts.headers !== 'object') {
  32031. throw new TypeError('Busboy expected an options-Object with headers-attribute.')
  32032. }
  32033. if (typeof opts.headers['content-type'] !== 'string') {
  32034. throw new TypeError('Missing Content-Type-header.')
  32035. }
  32036. const {
  32037. headers,
  32038. ...streamOptions
  32039. } = opts
  32040. this.opts = {
  32041. autoDestroy: false,
  32042. ...streamOptions
  32043. }
  32044. WritableStream.call(this, this.opts)
  32045. this._done = false
  32046. this._parser = this.getParserByHeaders(headers)
  32047. this._finished = false
  32048. }
  32049. inherits(Busboy, WritableStream)
  32050. Busboy.prototype.emit = function (ev) {
  32051. if (ev === 'finish') {
  32052. if (!this._done) {
  32053. this._parser?.end()
  32054. return
  32055. } else if (this._finished) {
  32056. return
  32057. }
  32058. this._finished = true
  32059. }
  32060. WritableStream.prototype.emit.apply(this, arguments)
  32061. }
  32062. Busboy.prototype.getParserByHeaders = function (headers) {
  32063. const parsed = parseParams(headers['content-type'])
  32064. const cfg = {
  32065. defCharset: this.opts.defCharset,
  32066. fileHwm: this.opts.fileHwm,
  32067. headers,
  32068. highWaterMark: this.opts.highWaterMark,
  32069. isPartAFile: this.opts.isPartAFile,
  32070. limits: this.opts.limits,
  32071. parsedConType: parsed,
  32072. preservePath: this.opts.preservePath
  32073. }
  32074. if (MultipartParser.detect.test(parsed[0])) {
  32075. return new MultipartParser(this, cfg)
  32076. }
  32077. if (UrlencodedParser.detect.test(parsed[0])) {
  32078. return new UrlencodedParser(this, cfg)
  32079. }
  32080. throw new Error('Unsupported Content-Type.')
  32081. }
  32082. Busboy.prototype._write = function (chunk, encoding, cb) {
  32083. this._parser.write(chunk, cb)
  32084. }
  32085. module.exports = Busboy
  32086. module.exports["default"] = Busboy
  32087. module.exports.Busboy = Busboy
  32088. module.exports.Dicer = Dicer
  32089. /***/ }),
  32090. /***/ 2183:
  32091. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  32092. "use strict";
  32093. // TODO:
  32094. // * support 1 nested multipart level
  32095. // (see second multipart example here:
  32096. // http://www.w3.org/TR/html401/interact/forms.html#didx-multipartform-data)
  32097. // * support limits.fieldNameSize
  32098. // -- this will require modifications to utils.parseParams
  32099. const { Readable } = __nccwpck_require__(4492)
  32100. const { inherits } = __nccwpck_require__(7261)
  32101. const Dicer = __nccwpck_require__(2960)
  32102. const parseParams = __nccwpck_require__(1854)
  32103. const decodeText = __nccwpck_require__(4619)
  32104. const basename = __nccwpck_require__(8647)
  32105. const getLimit = __nccwpck_require__(1467)
  32106. const RE_BOUNDARY = /^boundary$/i
  32107. const RE_FIELD = /^form-data$/i
  32108. const RE_CHARSET = /^charset$/i
  32109. const RE_FILENAME = /^filename$/i
  32110. const RE_NAME = /^name$/i
  32111. Multipart.detect = /^multipart\/form-data/i
  32112. function Multipart (boy, cfg) {
  32113. let i
  32114. let len
  32115. const self = this
  32116. let boundary
  32117. const limits = cfg.limits
  32118. const isPartAFile = cfg.isPartAFile || ((fieldName, contentType, fileName) => (contentType === 'application/octet-stream' || fileName !== undefined))
  32119. const parsedConType = cfg.parsedConType || []
  32120. const defCharset = cfg.defCharset || 'utf8'
  32121. const preservePath = cfg.preservePath
  32122. const fileOpts = { highWaterMark: cfg.fileHwm }
  32123. for (i = 0, len = parsedConType.length; i < len; ++i) {
  32124. if (Array.isArray(parsedConType[i]) &&
  32125. RE_BOUNDARY.test(parsedConType[i][0])) {
  32126. boundary = parsedConType[i][1]
  32127. break
  32128. }
  32129. }
  32130. function checkFinished () {
  32131. if (nends === 0 && finished && !boy._done) {
  32132. finished = false
  32133. self.end()
  32134. }
  32135. }
  32136. if (typeof boundary !== 'string') { throw new Error('Multipart: Boundary not found') }
  32137. const fieldSizeLimit = getLimit(limits, 'fieldSize', 1 * 1024 * 1024)
  32138. const fileSizeLimit = getLimit(limits, 'fileSize', Infinity)
  32139. const filesLimit = getLimit(limits, 'files', Infinity)
  32140. const fieldsLimit = getLimit(limits, 'fields', Infinity)
  32141. const partsLimit = getLimit(limits, 'parts', Infinity)
  32142. const headerPairsLimit = getLimit(limits, 'headerPairs', 2000)
  32143. const headerSizeLimit = getLimit(limits, 'headerSize', 80 * 1024)
  32144. let nfiles = 0
  32145. let nfields = 0
  32146. let nends = 0
  32147. let curFile
  32148. let curField
  32149. let finished = false
  32150. this._needDrain = false
  32151. this._pause = false
  32152. this._cb = undefined
  32153. this._nparts = 0
  32154. this._boy = boy
  32155. const parserCfg = {
  32156. boundary,
  32157. maxHeaderPairs: headerPairsLimit,
  32158. maxHeaderSize: headerSizeLimit,
  32159. partHwm: fileOpts.highWaterMark,
  32160. highWaterMark: cfg.highWaterMark
  32161. }
  32162. this.parser = new Dicer(parserCfg)
  32163. this.parser.on('drain', function () {
  32164. self._needDrain = false
  32165. if (self._cb && !self._pause) {
  32166. const cb = self._cb
  32167. self._cb = undefined
  32168. cb()
  32169. }
  32170. }).on('part', function onPart (part) {
  32171. if (++self._nparts > partsLimit) {
  32172. self.parser.removeListener('part', onPart)
  32173. self.parser.on('part', skipPart)
  32174. boy.hitPartsLimit = true
  32175. boy.emit('partsLimit')
  32176. return skipPart(part)
  32177. }
  32178. // hack because streams2 _always_ doesn't emit 'end' until nextTick, so let
  32179. // us emit 'end' early since we know the part has ended if we are already
  32180. // seeing the next part
  32181. if (curField) {
  32182. const field = curField
  32183. field.emit('end')
  32184. field.removeAllListeners('end')
  32185. }
  32186. part.on('header', function (header) {
  32187. let contype
  32188. let fieldname
  32189. let parsed
  32190. let charset
  32191. let encoding
  32192. let filename
  32193. let nsize = 0
  32194. if (header['content-type']) {
  32195. parsed = parseParams(header['content-type'][0])
  32196. if (parsed[0]) {
  32197. contype = parsed[0].toLowerCase()
  32198. for (i = 0, len = parsed.length; i < len; ++i) {
  32199. if (RE_CHARSET.test(parsed[i][0])) {
  32200. charset = parsed[i][1].toLowerCase()
  32201. break
  32202. }
  32203. }
  32204. }
  32205. }
  32206. if (contype === undefined) { contype = 'text/plain' }
  32207. if (charset === undefined) { charset = defCharset }
  32208. if (header['content-disposition']) {
  32209. parsed = parseParams(header['content-disposition'][0])
  32210. if (!RE_FIELD.test(parsed[0])) { return skipPart(part) }
  32211. for (i = 0, len = parsed.length; i < len; ++i) {
  32212. if (RE_NAME.test(parsed[i][0])) {
  32213. fieldname = parsed[i][1]
  32214. } else if (RE_FILENAME.test(parsed[i][0])) {
  32215. filename = parsed[i][1]
  32216. if (!preservePath) { filename = basename(filename) }
  32217. }
  32218. }
  32219. } else { return skipPart(part) }
  32220. if (header['content-transfer-encoding']) { encoding = header['content-transfer-encoding'][0].toLowerCase() } else { encoding = '7bit' }
  32221. let onData,
  32222. onEnd
  32223. if (isPartAFile(fieldname, contype, filename)) {
  32224. // file/binary field
  32225. if (nfiles === filesLimit) {
  32226. if (!boy.hitFilesLimit) {
  32227. boy.hitFilesLimit = true
  32228. boy.emit('filesLimit')
  32229. }
  32230. return skipPart(part)
  32231. }
  32232. ++nfiles
  32233. if (boy.listenerCount('file') === 0) {
  32234. self.parser._ignore()
  32235. return
  32236. }
  32237. ++nends
  32238. const file = new FileStream(fileOpts)
  32239. curFile = file
  32240. file.on('end', function () {
  32241. --nends
  32242. self._pause = false
  32243. checkFinished()
  32244. if (self._cb && !self._needDrain) {
  32245. const cb = self._cb
  32246. self._cb = undefined
  32247. cb()
  32248. }
  32249. })
  32250. file._read = function (n) {
  32251. if (!self._pause) { return }
  32252. self._pause = false
  32253. if (self._cb && !self._needDrain) {
  32254. const cb = self._cb
  32255. self._cb = undefined
  32256. cb()
  32257. }
  32258. }
  32259. boy.emit('file', fieldname, file, filename, encoding, contype)
  32260. onData = function (data) {
  32261. if ((nsize += data.length) > fileSizeLimit) {
  32262. const extralen = fileSizeLimit - nsize + data.length
  32263. if (extralen > 0) { file.push(data.slice(0, extralen)) }
  32264. file.truncated = true
  32265. file.bytesRead = fileSizeLimit
  32266. part.removeAllListeners('data')
  32267. file.emit('limit')
  32268. return
  32269. } else if (!file.push(data)) { self._pause = true }
  32270. file.bytesRead = nsize
  32271. }
  32272. onEnd = function () {
  32273. curFile = undefined
  32274. file.push(null)
  32275. }
  32276. } else {
  32277. // non-file field
  32278. if (nfields === fieldsLimit) {
  32279. if (!boy.hitFieldsLimit) {
  32280. boy.hitFieldsLimit = true
  32281. boy.emit('fieldsLimit')
  32282. }
  32283. return skipPart(part)
  32284. }
  32285. ++nfields
  32286. ++nends
  32287. let buffer = ''
  32288. let truncated = false
  32289. curField = part
  32290. onData = function (data) {
  32291. if ((nsize += data.length) > fieldSizeLimit) {
  32292. const extralen = (fieldSizeLimit - (nsize - data.length))
  32293. buffer += data.toString('binary', 0, extralen)
  32294. truncated = true
  32295. part.removeAllListeners('data')
  32296. } else { buffer += data.toString('binary') }
  32297. }
  32298. onEnd = function () {
  32299. curField = undefined
  32300. if (buffer.length) { buffer = decodeText(buffer, 'binary', charset) }
  32301. boy.emit('field', fieldname, buffer, false, truncated, encoding, contype)
  32302. --nends
  32303. checkFinished()
  32304. }
  32305. }
  32306. /* As of node@2efe4ab761666 (v0.10.29+/v0.11.14+), busboy had become
  32307. broken. Streams2/streams3 is a huge black box of confusion, but
  32308. somehow overriding the sync state seems to fix things again (and still
  32309. seems to work for previous node versions).
  32310. */
  32311. part._readableState.sync = false
  32312. part.on('data', onData)
  32313. part.on('end', onEnd)
  32314. }).on('error', function (err) {
  32315. if (curFile) { curFile.emit('error', err) }
  32316. })
  32317. }).on('error', function (err) {
  32318. boy.emit('error', err)
  32319. }).on('finish', function () {
  32320. finished = true
  32321. checkFinished()
  32322. })
  32323. }
  32324. Multipart.prototype.write = function (chunk, cb) {
  32325. const r = this.parser.write(chunk)
  32326. if (r && !this._pause) {
  32327. cb()
  32328. } else {
  32329. this._needDrain = !r
  32330. this._cb = cb
  32331. }
  32332. }
  32333. Multipart.prototype.end = function () {
  32334. const self = this
  32335. if (self.parser.writable) {
  32336. self.parser.end()
  32337. } else if (!self._boy._done) {
  32338. process.nextTick(function () {
  32339. self._boy._done = true
  32340. self._boy.emit('finish')
  32341. })
  32342. }
  32343. }
  32344. function skipPart (part) {
  32345. part.resume()
  32346. }
  32347. function FileStream (opts) {
  32348. Readable.call(this, opts)
  32349. this.bytesRead = 0
  32350. this.truncated = false
  32351. }
  32352. inherits(FileStream, Readable)
  32353. FileStream.prototype._read = function (n) {}
  32354. module.exports = Multipart
  32355. /***/ }),
  32356. /***/ 8306:
  32357. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  32358. "use strict";
  32359. const Decoder = __nccwpck_require__(7100)
  32360. const decodeText = __nccwpck_require__(4619)
  32361. const getLimit = __nccwpck_require__(1467)
  32362. const RE_CHARSET = /^charset$/i
  32363. UrlEncoded.detect = /^application\/x-www-form-urlencoded/i
  32364. function UrlEncoded (boy, cfg) {
  32365. const limits = cfg.limits
  32366. const parsedConType = cfg.parsedConType
  32367. this.boy = boy
  32368. this.fieldSizeLimit = getLimit(limits, 'fieldSize', 1 * 1024 * 1024)
  32369. this.fieldNameSizeLimit = getLimit(limits, 'fieldNameSize', 100)
  32370. this.fieldsLimit = getLimit(limits, 'fields', Infinity)
  32371. let charset
  32372. for (var i = 0, len = parsedConType.length; i < len; ++i) { // eslint-disable-line no-var
  32373. if (Array.isArray(parsedConType[i]) &&
  32374. RE_CHARSET.test(parsedConType[i][0])) {
  32375. charset = parsedConType[i][1].toLowerCase()
  32376. break
  32377. }
  32378. }
  32379. if (charset === undefined) { charset = cfg.defCharset || 'utf8' }
  32380. this.decoder = new Decoder()
  32381. this.charset = charset
  32382. this._fields = 0
  32383. this._state = 'key'
  32384. this._checkingBytes = true
  32385. this._bytesKey = 0
  32386. this._bytesVal = 0
  32387. this._key = ''
  32388. this._val = ''
  32389. this._keyTrunc = false
  32390. this._valTrunc = false
  32391. this._hitLimit = false
  32392. }
  32393. UrlEncoded.prototype.write = function (data, cb) {
  32394. if (this._fields === this.fieldsLimit) {
  32395. if (!this.boy.hitFieldsLimit) {
  32396. this.boy.hitFieldsLimit = true
  32397. this.boy.emit('fieldsLimit')
  32398. }
  32399. return cb()
  32400. }
  32401. let idxeq; let idxamp; let i; let p = 0; const len = data.length
  32402. while (p < len) {
  32403. if (this._state === 'key') {
  32404. idxeq = idxamp = undefined
  32405. for (i = p; i < len; ++i) {
  32406. if (!this._checkingBytes) { ++p }
  32407. if (data[i] === 0x3D/* = */) {
  32408. idxeq = i
  32409. break
  32410. } else if (data[i] === 0x26/* & */) {
  32411. idxamp = i
  32412. break
  32413. }
  32414. if (this._checkingBytes && this._bytesKey === this.fieldNameSizeLimit) {
  32415. this._hitLimit = true
  32416. break
  32417. } else if (this._checkingBytes) { ++this._bytesKey }
  32418. }
  32419. if (idxeq !== undefined) {
  32420. // key with assignment
  32421. if (idxeq > p) { this._key += this.decoder.write(data.toString('binary', p, idxeq)) }
  32422. this._state = 'val'
  32423. this._hitLimit = false
  32424. this._checkingBytes = true
  32425. this._val = ''
  32426. this._bytesVal = 0
  32427. this._valTrunc = false
  32428. this.decoder.reset()
  32429. p = idxeq + 1
  32430. } else if (idxamp !== undefined) {
  32431. // key with no assignment
  32432. ++this._fields
  32433. let key; const keyTrunc = this._keyTrunc
  32434. if (idxamp > p) { key = (this._key += this.decoder.write(data.toString('binary', p, idxamp))) } else { key = this._key }
  32435. this._hitLimit = false
  32436. this._checkingBytes = true
  32437. this._key = ''
  32438. this._bytesKey = 0
  32439. this._keyTrunc = false
  32440. this.decoder.reset()
  32441. if (key.length) {
  32442. this.boy.emit('field', decodeText(key, 'binary', this.charset),
  32443. '',
  32444. keyTrunc,
  32445. false)
  32446. }
  32447. p = idxamp + 1
  32448. if (this._fields === this.fieldsLimit) { return cb() }
  32449. } else if (this._hitLimit) {
  32450. // we may not have hit the actual limit if there are encoded bytes...
  32451. if (i > p) { this._key += this.decoder.write(data.toString('binary', p, i)) }
  32452. p = i
  32453. if ((this._bytesKey = this._key.length) === this.fieldNameSizeLimit) {
  32454. // yep, we actually did hit the limit
  32455. this._checkingBytes = false
  32456. this._keyTrunc = true
  32457. }
  32458. } else {
  32459. if (p < len) { this._key += this.decoder.write(data.toString('binary', p)) }
  32460. p = len
  32461. }
  32462. } else {
  32463. idxamp = undefined
  32464. for (i = p; i < len; ++i) {
  32465. if (!this._checkingBytes) { ++p }
  32466. if (data[i] === 0x26/* & */) {
  32467. idxamp = i
  32468. break
  32469. }
  32470. if (this._checkingBytes && this._bytesVal === this.fieldSizeLimit) {
  32471. this._hitLimit = true
  32472. break
  32473. } else if (this._checkingBytes) { ++this._bytesVal }
  32474. }
  32475. if (idxamp !== undefined) {
  32476. ++this._fields
  32477. if (idxamp > p) { this._val += this.decoder.write(data.toString('binary', p, idxamp)) }
  32478. this.boy.emit('field', decodeText(this._key, 'binary', this.charset),
  32479. decodeText(this._val, 'binary', this.charset),
  32480. this._keyTrunc,
  32481. this._valTrunc)
  32482. this._state = 'key'
  32483. this._hitLimit = false
  32484. this._checkingBytes = true
  32485. this._key = ''
  32486. this._bytesKey = 0
  32487. this._keyTrunc = false
  32488. this.decoder.reset()
  32489. p = idxamp + 1
  32490. if (this._fields === this.fieldsLimit) { return cb() }
  32491. } else if (this._hitLimit) {
  32492. // we may not have hit the actual limit if there are encoded bytes...
  32493. if (i > p) { this._val += this.decoder.write(data.toString('binary', p, i)) }
  32494. p = i
  32495. if ((this._val === '' && this.fieldSizeLimit === 0) ||
  32496. (this._bytesVal = this._val.length) === this.fieldSizeLimit) {
  32497. // yep, we actually did hit the limit
  32498. this._checkingBytes = false
  32499. this._valTrunc = true
  32500. }
  32501. } else {
  32502. if (p < len) { this._val += this.decoder.write(data.toString('binary', p)) }
  32503. p = len
  32504. }
  32505. }
  32506. }
  32507. cb()
  32508. }
  32509. UrlEncoded.prototype.end = function () {
  32510. if (this.boy._done) { return }
  32511. if (this._state === 'key' && this._key.length > 0) {
  32512. this.boy.emit('field', decodeText(this._key, 'binary', this.charset),
  32513. '',
  32514. this._keyTrunc,
  32515. false)
  32516. } else if (this._state === 'val') {
  32517. this.boy.emit('field', decodeText(this._key, 'binary', this.charset),
  32518. decodeText(this._val, 'binary', this.charset),
  32519. this._keyTrunc,
  32520. this._valTrunc)
  32521. }
  32522. this.boy._done = true
  32523. this.boy.emit('finish')
  32524. }
  32525. module.exports = UrlEncoded
  32526. /***/ }),
  32527. /***/ 7100:
  32528. /***/ ((module) => {
  32529. "use strict";
  32530. const RE_PLUS = /\+/g
  32531. const HEX = [
  32532. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  32533. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  32534. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  32535. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0,
  32536. 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  32537. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  32538. 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  32539. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
  32540. ]
  32541. function Decoder () {
  32542. this.buffer = undefined
  32543. }
  32544. Decoder.prototype.write = function (str) {
  32545. // Replace '+' with ' ' before decoding
  32546. str = str.replace(RE_PLUS, ' ')
  32547. let res = ''
  32548. let i = 0; let p = 0; const len = str.length
  32549. for (; i < len; ++i) {
  32550. if (this.buffer !== undefined) {
  32551. if (!HEX[str.charCodeAt(i)]) {
  32552. res += '%' + this.buffer
  32553. this.buffer = undefined
  32554. --i // retry character
  32555. } else {
  32556. this.buffer += str[i]
  32557. ++p
  32558. if (this.buffer.length === 2) {
  32559. res += String.fromCharCode(parseInt(this.buffer, 16))
  32560. this.buffer = undefined
  32561. }
  32562. }
  32563. } else if (str[i] === '%') {
  32564. if (i > p) {
  32565. res += str.substring(p, i)
  32566. p = i
  32567. }
  32568. this.buffer = ''
  32569. ++p
  32570. }
  32571. }
  32572. if (p < len && this.buffer === undefined) { res += str.substring(p) }
  32573. return res
  32574. }
  32575. Decoder.prototype.reset = function () {
  32576. this.buffer = undefined
  32577. }
  32578. module.exports = Decoder
  32579. /***/ }),
  32580. /***/ 8647:
  32581. /***/ ((module) => {
  32582. "use strict";
  32583. module.exports = function basename (path) {
  32584. if (typeof path !== 'string') { return '' }
  32585. for (var i = path.length - 1; i >= 0; --i) { // eslint-disable-line no-var
  32586. switch (path.charCodeAt(i)) {
  32587. case 0x2F: // '/'
  32588. case 0x5C: // '\'
  32589. path = path.slice(i + 1)
  32590. return (path === '..' || path === '.' ? '' : path)
  32591. }
  32592. }
  32593. return (path === '..' || path === '.' ? '' : path)
  32594. }
  32595. /***/ }),
  32596. /***/ 4619:
  32597. /***/ (function(module) {
  32598. "use strict";
  32599. // Node has always utf-8
  32600. const utf8Decoder = new TextDecoder('utf-8')
  32601. const textDecoders = new Map([
  32602. ['utf-8', utf8Decoder],
  32603. ['utf8', utf8Decoder]
  32604. ])
  32605. function getDecoder (charset) {
  32606. let lc
  32607. while (true) {
  32608. switch (charset) {
  32609. case 'utf-8':
  32610. case 'utf8':
  32611. return decoders.utf8
  32612. case 'latin1':
  32613. case 'ascii': // TODO: Make these a separate, strict decoder?
  32614. case 'us-ascii':
  32615. case 'iso-8859-1':
  32616. case 'iso8859-1':
  32617. case 'iso88591':
  32618. case 'iso_8859-1':
  32619. case 'windows-1252':
  32620. case 'iso_8859-1:1987':
  32621. case 'cp1252':
  32622. case 'x-cp1252':
  32623. return decoders.latin1
  32624. case 'utf16le':
  32625. case 'utf-16le':
  32626. case 'ucs2':
  32627. case 'ucs-2':
  32628. return decoders.utf16le
  32629. case 'base64':
  32630. return decoders.base64
  32631. default:
  32632. if (lc === undefined) {
  32633. lc = true
  32634. charset = charset.toLowerCase()
  32635. continue
  32636. }
  32637. return decoders.other.bind(charset)
  32638. }
  32639. }
  32640. }
  32641. const decoders = {
  32642. utf8: (data, sourceEncoding) => {
  32643. if (data.length === 0) {
  32644. return ''
  32645. }
  32646. if (typeof data === 'string') {
  32647. data = Buffer.from(data, sourceEncoding)
  32648. }
  32649. return data.utf8Slice(0, data.length)
  32650. },
  32651. latin1: (data, sourceEncoding) => {
  32652. if (data.length === 0) {
  32653. return ''
  32654. }
  32655. if (typeof data === 'string') {
  32656. return data
  32657. }
  32658. return data.latin1Slice(0, data.length)
  32659. },
  32660. utf16le: (data, sourceEncoding) => {
  32661. if (data.length === 0) {
  32662. return ''
  32663. }
  32664. if (typeof data === 'string') {
  32665. data = Buffer.from(data, sourceEncoding)
  32666. }
  32667. return data.ucs2Slice(0, data.length)
  32668. },
  32669. base64: (data, sourceEncoding) => {
  32670. if (data.length === 0) {
  32671. return ''
  32672. }
  32673. if (typeof data === 'string') {
  32674. data = Buffer.from(data, sourceEncoding)
  32675. }
  32676. return data.base64Slice(0, data.length)
  32677. },
  32678. other: (data, sourceEncoding) => {
  32679. if (data.length === 0) {
  32680. return ''
  32681. }
  32682. if (typeof data === 'string') {
  32683. data = Buffer.from(data, sourceEncoding)
  32684. }
  32685. if (textDecoders.has(this.toString())) {
  32686. try {
  32687. return textDecoders.get(this).decode(data)
  32688. } catch {}
  32689. }
  32690. return typeof data === 'string'
  32691. ? data
  32692. : data.toString()
  32693. }
  32694. }
  32695. function decodeText (text, sourceEncoding, destEncoding) {
  32696. if (text) {
  32697. return getDecoder(destEncoding)(text, sourceEncoding)
  32698. }
  32699. return text
  32700. }
  32701. module.exports = decodeText
  32702. /***/ }),
  32703. /***/ 1467:
  32704. /***/ ((module) => {
  32705. "use strict";
  32706. module.exports = function getLimit (limits, name, defaultLimit) {
  32707. if (
  32708. !limits ||
  32709. limits[name] === undefined ||
  32710. limits[name] === null
  32711. ) { return defaultLimit }
  32712. if (
  32713. typeof limits[name] !== 'number' ||
  32714. isNaN(limits[name])
  32715. ) { throw new TypeError('Limit ' + name + ' is not a valid number') }
  32716. return limits[name]
  32717. }
  32718. /***/ }),
  32719. /***/ 1854:
  32720. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  32721. "use strict";
  32722. /* eslint-disable object-property-newline */
  32723. const decodeText = __nccwpck_require__(4619)
  32724. const RE_ENCODED = /%[a-fA-F0-9][a-fA-F0-9]/g
  32725. const EncodedLookup = {
  32726. '%00': '\x00', '%01': '\x01', '%02': '\x02', '%03': '\x03', '%04': '\x04',
  32727. '%05': '\x05', '%06': '\x06', '%07': '\x07', '%08': '\x08', '%09': '\x09',
  32728. '%0a': '\x0a', '%0A': '\x0a', '%0b': '\x0b', '%0B': '\x0b', '%0c': '\x0c',
  32729. '%0C': '\x0c', '%0d': '\x0d', '%0D': '\x0d', '%0e': '\x0e', '%0E': '\x0e',
  32730. '%0f': '\x0f', '%0F': '\x0f', '%10': '\x10', '%11': '\x11', '%12': '\x12',
  32731. '%13': '\x13', '%14': '\x14', '%15': '\x15', '%16': '\x16', '%17': '\x17',
  32732. '%18': '\x18', '%19': '\x19', '%1a': '\x1a', '%1A': '\x1a', '%1b': '\x1b',
  32733. '%1B': '\x1b', '%1c': '\x1c', '%1C': '\x1c', '%1d': '\x1d', '%1D': '\x1d',
  32734. '%1e': '\x1e', '%1E': '\x1e', '%1f': '\x1f', '%1F': '\x1f', '%20': '\x20',
  32735. '%21': '\x21', '%22': '\x22', '%23': '\x23', '%24': '\x24', '%25': '\x25',
  32736. '%26': '\x26', '%27': '\x27', '%28': '\x28', '%29': '\x29', '%2a': '\x2a',
  32737. '%2A': '\x2a', '%2b': '\x2b', '%2B': '\x2b', '%2c': '\x2c', '%2C': '\x2c',
  32738. '%2d': '\x2d', '%2D': '\x2d', '%2e': '\x2e', '%2E': '\x2e', '%2f': '\x2f',
  32739. '%2F': '\x2f', '%30': '\x30', '%31': '\x31', '%32': '\x32', '%33': '\x33',
  32740. '%34': '\x34', '%35': '\x35', '%36': '\x36', '%37': '\x37', '%38': '\x38',
  32741. '%39': '\x39', '%3a': '\x3a', '%3A': '\x3a', '%3b': '\x3b', '%3B': '\x3b',
  32742. '%3c': '\x3c', '%3C': '\x3c', '%3d': '\x3d', '%3D': '\x3d', '%3e': '\x3e',
  32743. '%3E': '\x3e', '%3f': '\x3f', '%3F': '\x3f', '%40': '\x40', '%41': '\x41',
  32744. '%42': '\x42', '%43': '\x43', '%44': '\x44', '%45': '\x45', '%46': '\x46',
  32745. '%47': '\x47', '%48': '\x48', '%49': '\x49', '%4a': '\x4a', '%4A': '\x4a',
  32746. '%4b': '\x4b', '%4B': '\x4b', '%4c': '\x4c', '%4C': '\x4c', '%4d': '\x4d',
  32747. '%4D': '\x4d', '%4e': '\x4e', '%4E': '\x4e', '%4f': '\x4f', '%4F': '\x4f',
  32748. '%50': '\x50', '%51': '\x51', '%52': '\x52', '%53': '\x53', '%54': '\x54',
  32749. '%55': '\x55', '%56': '\x56', '%57': '\x57', '%58': '\x58', '%59': '\x59',
  32750. '%5a': '\x5a', '%5A': '\x5a', '%5b': '\x5b', '%5B': '\x5b', '%5c': '\x5c',
  32751. '%5C': '\x5c', '%5d': '\x5d', '%5D': '\x5d', '%5e': '\x5e', '%5E': '\x5e',
  32752. '%5f': '\x5f', '%5F': '\x5f', '%60': '\x60', '%61': '\x61', '%62': '\x62',
  32753. '%63': '\x63', '%64': '\x64', '%65': '\x65', '%66': '\x66', '%67': '\x67',
  32754. '%68': '\x68', '%69': '\x69', '%6a': '\x6a', '%6A': '\x6a', '%6b': '\x6b',
  32755. '%6B': '\x6b', '%6c': '\x6c', '%6C': '\x6c', '%6d': '\x6d', '%6D': '\x6d',
  32756. '%6e': '\x6e', '%6E': '\x6e', '%6f': '\x6f', '%6F': '\x6f', '%70': '\x70',
  32757. '%71': '\x71', '%72': '\x72', '%73': '\x73', '%74': '\x74', '%75': '\x75',
  32758. '%76': '\x76', '%77': '\x77', '%78': '\x78', '%79': '\x79', '%7a': '\x7a',
  32759. '%7A': '\x7a', '%7b': '\x7b', '%7B': '\x7b', '%7c': '\x7c', '%7C': '\x7c',
  32760. '%7d': '\x7d', '%7D': '\x7d', '%7e': '\x7e', '%7E': '\x7e', '%7f': '\x7f',
  32761. '%7F': '\x7f', '%80': '\x80', '%81': '\x81', '%82': '\x82', '%83': '\x83',
  32762. '%84': '\x84', '%85': '\x85', '%86': '\x86', '%87': '\x87', '%88': '\x88',
  32763. '%89': '\x89', '%8a': '\x8a', '%8A': '\x8a', '%8b': '\x8b', '%8B': '\x8b',
  32764. '%8c': '\x8c', '%8C': '\x8c', '%8d': '\x8d', '%8D': '\x8d', '%8e': '\x8e',
  32765. '%8E': '\x8e', '%8f': '\x8f', '%8F': '\x8f', '%90': '\x90', '%91': '\x91',
  32766. '%92': '\x92', '%93': '\x93', '%94': '\x94', '%95': '\x95', '%96': '\x96',
  32767. '%97': '\x97', '%98': '\x98', '%99': '\x99', '%9a': '\x9a', '%9A': '\x9a',
  32768. '%9b': '\x9b', '%9B': '\x9b', '%9c': '\x9c', '%9C': '\x9c', '%9d': '\x9d',
  32769. '%9D': '\x9d', '%9e': '\x9e', '%9E': '\x9e', '%9f': '\x9f', '%9F': '\x9f',
  32770. '%a0': '\xa0', '%A0': '\xa0', '%a1': '\xa1', '%A1': '\xa1', '%a2': '\xa2',
  32771. '%A2': '\xa2', '%a3': '\xa3', '%A3': '\xa3', '%a4': '\xa4', '%A4': '\xa4',
  32772. '%a5': '\xa5', '%A5': '\xa5', '%a6': '\xa6', '%A6': '\xa6', '%a7': '\xa7',
  32773. '%A7': '\xa7', '%a8': '\xa8', '%A8': '\xa8', '%a9': '\xa9', '%A9': '\xa9',
  32774. '%aa': '\xaa', '%Aa': '\xaa', '%aA': '\xaa', '%AA': '\xaa', '%ab': '\xab',
  32775. '%Ab': '\xab', '%aB': '\xab', '%AB': '\xab', '%ac': '\xac', '%Ac': '\xac',
  32776. '%aC': '\xac', '%AC': '\xac', '%ad': '\xad', '%Ad': '\xad', '%aD': '\xad',
  32777. '%AD': '\xad', '%ae': '\xae', '%Ae': '\xae', '%aE': '\xae', '%AE': '\xae',
  32778. '%af': '\xaf', '%Af': '\xaf', '%aF': '\xaf', '%AF': '\xaf', '%b0': '\xb0',
  32779. '%B0': '\xb0', '%b1': '\xb1', '%B1': '\xb1', '%b2': '\xb2', '%B2': '\xb2',
  32780. '%b3': '\xb3', '%B3': '\xb3', '%b4': '\xb4', '%B4': '\xb4', '%b5': '\xb5',
  32781. '%B5': '\xb5', '%b6': '\xb6', '%B6': '\xb6', '%b7': '\xb7', '%B7': '\xb7',
  32782. '%b8': '\xb8', '%B8': '\xb8', '%b9': '\xb9', '%B9': '\xb9', '%ba': '\xba',
  32783. '%Ba': '\xba', '%bA': '\xba', '%BA': '\xba', '%bb': '\xbb', '%Bb': '\xbb',
  32784. '%bB': '\xbb', '%BB': '\xbb', '%bc': '\xbc', '%Bc': '\xbc', '%bC': '\xbc',
  32785. '%BC': '\xbc', '%bd': '\xbd', '%Bd': '\xbd', '%bD': '\xbd', '%BD': '\xbd',
  32786. '%be': '\xbe', '%Be': '\xbe', '%bE': '\xbe', '%BE': '\xbe', '%bf': '\xbf',
  32787. '%Bf': '\xbf', '%bF': '\xbf', '%BF': '\xbf', '%c0': '\xc0', '%C0': '\xc0',
  32788. '%c1': '\xc1', '%C1': '\xc1', '%c2': '\xc2', '%C2': '\xc2', '%c3': '\xc3',
  32789. '%C3': '\xc3', '%c4': '\xc4', '%C4': '\xc4', '%c5': '\xc5', '%C5': '\xc5',
  32790. '%c6': '\xc6', '%C6': '\xc6', '%c7': '\xc7', '%C7': '\xc7', '%c8': '\xc8',
  32791. '%C8': '\xc8', '%c9': '\xc9', '%C9': '\xc9', '%ca': '\xca', '%Ca': '\xca',
  32792. '%cA': '\xca', '%CA': '\xca', '%cb': '\xcb', '%Cb': '\xcb', '%cB': '\xcb',
  32793. '%CB': '\xcb', '%cc': '\xcc', '%Cc': '\xcc', '%cC': '\xcc', '%CC': '\xcc',
  32794. '%cd': '\xcd', '%Cd': '\xcd', '%cD': '\xcd', '%CD': '\xcd', '%ce': '\xce',
  32795. '%Ce': '\xce', '%cE': '\xce', '%CE': '\xce', '%cf': '\xcf', '%Cf': '\xcf',
  32796. '%cF': '\xcf', '%CF': '\xcf', '%d0': '\xd0', '%D0': '\xd0', '%d1': '\xd1',
  32797. '%D1': '\xd1', '%d2': '\xd2', '%D2': '\xd2', '%d3': '\xd3', '%D3': '\xd3',
  32798. '%d4': '\xd4', '%D4': '\xd4', '%d5': '\xd5', '%D5': '\xd5', '%d6': '\xd6',
  32799. '%D6': '\xd6', '%d7': '\xd7', '%D7': '\xd7', '%d8': '\xd8', '%D8': '\xd8',
  32800. '%d9': '\xd9', '%D9': '\xd9', '%da': '\xda', '%Da': '\xda', '%dA': '\xda',
  32801. '%DA': '\xda', '%db': '\xdb', '%Db': '\xdb', '%dB': '\xdb', '%DB': '\xdb',
  32802. '%dc': '\xdc', '%Dc': '\xdc', '%dC': '\xdc', '%DC': '\xdc', '%dd': '\xdd',
  32803. '%Dd': '\xdd', '%dD': '\xdd', '%DD': '\xdd', '%de': '\xde', '%De': '\xde',
  32804. '%dE': '\xde', '%DE': '\xde', '%df': '\xdf', '%Df': '\xdf', '%dF': '\xdf',
  32805. '%DF': '\xdf', '%e0': '\xe0', '%E0': '\xe0', '%e1': '\xe1', '%E1': '\xe1',
  32806. '%e2': '\xe2', '%E2': '\xe2', '%e3': '\xe3', '%E3': '\xe3', '%e4': '\xe4',
  32807. '%E4': '\xe4', '%e5': '\xe5', '%E5': '\xe5', '%e6': '\xe6', '%E6': '\xe6',
  32808. '%e7': '\xe7', '%E7': '\xe7', '%e8': '\xe8', '%E8': '\xe8', '%e9': '\xe9',
  32809. '%E9': '\xe9', '%ea': '\xea', '%Ea': '\xea', '%eA': '\xea', '%EA': '\xea',
  32810. '%eb': '\xeb', '%Eb': '\xeb', '%eB': '\xeb', '%EB': '\xeb', '%ec': '\xec',
  32811. '%Ec': '\xec', '%eC': '\xec', '%EC': '\xec', '%ed': '\xed', '%Ed': '\xed',
  32812. '%eD': '\xed', '%ED': '\xed', '%ee': '\xee', '%Ee': '\xee', '%eE': '\xee',
  32813. '%EE': '\xee', '%ef': '\xef', '%Ef': '\xef', '%eF': '\xef', '%EF': '\xef',
  32814. '%f0': '\xf0', '%F0': '\xf0', '%f1': '\xf1', '%F1': '\xf1', '%f2': '\xf2',
  32815. '%F2': '\xf2', '%f3': '\xf3', '%F3': '\xf3', '%f4': '\xf4', '%F4': '\xf4',
  32816. '%f5': '\xf5', '%F5': '\xf5', '%f6': '\xf6', '%F6': '\xf6', '%f7': '\xf7',
  32817. '%F7': '\xf7', '%f8': '\xf8', '%F8': '\xf8', '%f9': '\xf9', '%F9': '\xf9',
  32818. '%fa': '\xfa', '%Fa': '\xfa', '%fA': '\xfa', '%FA': '\xfa', '%fb': '\xfb',
  32819. '%Fb': '\xfb', '%fB': '\xfb', '%FB': '\xfb', '%fc': '\xfc', '%Fc': '\xfc',
  32820. '%fC': '\xfc', '%FC': '\xfc', '%fd': '\xfd', '%Fd': '\xfd', '%fD': '\xfd',
  32821. '%FD': '\xfd', '%fe': '\xfe', '%Fe': '\xfe', '%fE': '\xfe', '%FE': '\xfe',
  32822. '%ff': '\xff', '%Ff': '\xff', '%fF': '\xff', '%FF': '\xff'
  32823. }
  32824. function encodedReplacer (match) {
  32825. return EncodedLookup[match]
  32826. }
  32827. const STATE_KEY = 0
  32828. const STATE_VALUE = 1
  32829. const STATE_CHARSET = 2
  32830. const STATE_LANG = 3
  32831. function parseParams (str) {
  32832. const res = []
  32833. let state = STATE_KEY
  32834. let charset = ''
  32835. let inquote = false
  32836. let escaping = false
  32837. let p = 0
  32838. let tmp = ''
  32839. const len = str.length
  32840. for (var i = 0; i < len; ++i) { // eslint-disable-line no-var
  32841. const char = str[i]
  32842. if (char === '\\' && inquote) {
  32843. if (escaping) { escaping = false } else {
  32844. escaping = true
  32845. continue
  32846. }
  32847. } else if (char === '"') {
  32848. if (!escaping) {
  32849. if (inquote) {
  32850. inquote = false
  32851. state = STATE_KEY
  32852. } else { inquote = true }
  32853. continue
  32854. } else { escaping = false }
  32855. } else {
  32856. if (escaping && inquote) { tmp += '\\' }
  32857. escaping = false
  32858. if ((state === STATE_CHARSET || state === STATE_LANG) && char === "'") {
  32859. if (state === STATE_CHARSET) {
  32860. state = STATE_LANG
  32861. charset = tmp.substring(1)
  32862. } else { state = STATE_VALUE }
  32863. tmp = ''
  32864. continue
  32865. } else if (state === STATE_KEY &&
  32866. (char === '*' || char === '=') &&
  32867. res.length) {
  32868. state = char === '*'
  32869. ? STATE_CHARSET
  32870. : STATE_VALUE
  32871. res[p] = [tmp, undefined]
  32872. tmp = ''
  32873. continue
  32874. } else if (!inquote && char === ';') {
  32875. state = STATE_KEY
  32876. if (charset) {
  32877. if (tmp.length) {
  32878. tmp = decodeText(tmp.replace(RE_ENCODED, encodedReplacer),
  32879. 'binary',
  32880. charset)
  32881. }
  32882. charset = ''
  32883. } else if (tmp.length) {
  32884. tmp = decodeText(tmp, 'binary', 'utf8')
  32885. }
  32886. if (res[p] === undefined) { res[p] = tmp } else { res[p][1] = tmp }
  32887. tmp = ''
  32888. ++p
  32889. continue
  32890. } else if (!inquote && (char === ' ' || char === '\t')) { continue }
  32891. }
  32892. tmp += char
  32893. }
  32894. if (charset && tmp.length) {
  32895. tmp = decodeText(tmp.replace(RE_ENCODED, encodedReplacer),
  32896. 'binary',
  32897. charset)
  32898. } else if (tmp) {
  32899. tmp = decodeText(tmp, 'binary', 'utf8')
  32900. }
  32901. if (res[p] === undefined) {
  32902. if (tmp) { res[p] = tmp }
  32903. } else { res[p][1] = tmp }
  32904. return res
  32905. }
  32906. module.exports = parseParams
  32907. /***/ })
  32908. /******/ });
  32909. /************************************************************************/
  32910. /******/ // The module cache
  32911. /******/ var __webpack_module_cache__ = {};
  32912. /******/
  32913. /******/ // The require function
  32914. /******/ function __nccwpck_require__(moduleId) {
  32915. /******/ // Check if module is in cache
  32916. /******/ var cachedModule = __webpack_module_cache__[moduleId];
  32917. /******/ if (cachedModule !== undefined) {
  32918. /******/ return cachedModule.exports;
  32919. /******/ }
  32920. /******/ // Create a new module (and put it into the cache)
  32921. /******/ var module = __webpack_module_cache__[moduleId] = {
  32922. /******/ // no module.id needed
  32923. /******/ // no module.loaded needed
  32924. /******/ exports: {}
  32925. /******/ };
  32926. /******/
  32927. /******/ // Execute the module function
  32928. /******/ var threw = true;
  32929. /******/ try {
  32930. /******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __nccwpck_require__);
  32931. /******/ threw = false;
  32932. /******/ } finally {
  32933. /******/ if(threw) delete __webpack_module_cache__[moduleId];
  32934. /******/ }
  32935. /******/
  32936. /******/ // Return the exports of the module
  32937. /******/ return module.exports;
  32938. /******/ }
  32939. /******/
  32940. /************************************************************************/
  32941. /******/ /* webpack/runtime/compat */
  32942. /******/
  32943. /******/ if (typeof __nccwpck_require__ !== 'undefined') __nccwpck_require__.ab = __dirname + "/";
  32944. /******/
  32945. /************************************************************************/
  32946. /******/
  32947. /******/ // startup
  32948. /******/ // Load entry module and return exports
  32949. /******/ // This entry module is referenced by other modules so it can't be inlined
  32950. /******/ var __webpack_exports__ = __nccwpck_require__(3109);
  32951. /******/ module.exports = __webpack_exports__;
  32952. /******/
  32953. /******/ })()
  32954. ;