index.js 1.3 MB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604206052060620607206082060920610206112061220613206142061520616206172061820619206202062120622206232062420625206262062720628206292063020631206322063320634206352063620637206382063920640206412064220643206442064520646206472064820649206502065120652206532065420655206562065720658206592066020661206622066320664206652066620667206682066920670206712067220673206742067520676206772067820679206802068120682206832068420685206862068720688206892069020691206922069320694206952069620697206982069920700207012070220703207042070520706207072070820709207102071120712207132071420715207162071720718207192072020721207222072320724207252072620727207282072920730207312073220733207342073520736207372073820739207402074120742207432074420745207462074720748207492075020751207522075320754207552075620757207582075920760207612076220763207642076520766207672076820769207702077120772207732077420775207762077720778207792078020781207822078320784207852078620787207882078920790207912079220793207942079520796207972079820799208002080120802208032080420805208062080720808208092081020811208122081320814208152081620817208182081920820208212082220823208242082520826208272082820829208302083120832208332083420835208362083720838208392084020841208422084320844208452084620847208482084920850208512085220853208542085520856208572085820859208602086120862208632086420865208662086720868208692087020871208722087320874208752087620877208782087920880208812088220883208842088520886208872088820889208902089120892208932089420895208962089720898208992090020901209022090320904209052090620907209082090920910209112091220913209142091520916209172091820919209202092120922209232092420925209262092720928209292093020931209322093320934209352093620937209382093920940209412094220943209442094520946209472094820949209502095120952209532095420955209562095720958209592096020961209622096320964209652096620967209682096920970209712097220973209742097520976209772097820979209802098120982209832098420985209862098720988209892099020991209922099320994209952099620997209982099921000210012100221003210042100521006210072100821009210102101121012210132101421015210162101721018210192102021021210222102321024210252102621027210282102921030210312103221033210342103521036210372103821039210402104121042210432104421045210462104721048210492105021051210522105321054210552105621057210582105921060210612106221063210642106521066210672106821069210702107121072210732107421075210762107721078210792108021081210822108321084210852108621087210882108921090210912109221093210942109521096210972109821099211002110121102211032110421105211062110721108211092111021111211122111321114211152111621117211182111921120211212112221123211242112521126211272112821129211302113121132211332113421135211362113721138211392114021141211422114321144211452114621147211482114921150211512115221153211542115521156211572115821159211602116121162211632116421165211662116721168211692117021171211722117321174211752117621177211782117921180211812118221183211842118521186211872118821189211902119121192211932119421195211962119721198211992120021201212022120321204212052120621207212082120921210212112121221213212142121521216212172121821219212202122121222212232122421225212262122721228212292123021231212322123321234212352123621237212382123921240212412124221243212442124521246212472124821249212502125121252212532125421255212562125721258212592126021261212622126321264212652126621267212682126921270212712127221273212742127521276212772127821279212802128121282212832128421285212862128721288212892129021291212922129321294212952129621297212982129921300213012130221303213042130521306213072130821309213102131121312213132131421315213162131721318213192132021321213222132321324213252132621327213282132921330213312133221333213342133521336213372133821339213402134121342213432134421345213462134721348213492135021351213522135321354213552135621357213582135921360213612136221363213642136521366213672136821369213702137121372213732137421375213762137721378213792138021381213822138321384213852138621387213882138921390213912139221393213942139521396213972139821399214002140121402214032140421405214062140721408214092141021411214122141321414214152141621417214182141921420214212142221423214242142521426214272142821429214302143121432214332143421435214362143721438214392144021441214422144321444214452144621447214482144921450214512145221453214542145521456214572145821459214602146121462214632146421465214662146721468214692147021471214722147321474214752147621477214782147921480214812148221483214842148521486214872148821489214902149121492214932149421495214962149721498214992150021501215022150321504215052150621507215082150921510215112151221513215142151521516215172151821519215202152121522215232152421525215262152721528215292153021531215322153321534215352153621537215382153921540215412154221543215442154521546215472154821549215502155121552215532155421555215562155721558215592156021561215622156321564215652156621567215682156921570215712157221573215742157521576215772157821579215802158121582215832158421585215862158721588215892159021591215922159321594215952159621597215982159921600216012160221603216042160521606216072160821609216102161121612216132161421615216162161721618216192162021621216222162321624216252162621627216282162921630216312163221633216342163521636216372163821639216402164121642216432164421645216462164721648216492165021651216522165321654216552165621657216582165921660216612166221663216642166521666216672166821669216702167121672216732167421675216762167721678216792168021681216822168321684216852168621687216882168921690216912169221693216942169521696216972169821699217002170121702217032170421705217062170721708217092171021711217122171321714217152171621717217182171921720217212172221723217242172521726217272172821729217302173121732217332173421735217362173721738217392174021741217422174321744217452174621747217482174921750217512175221753217542175521756217572175821759217602176121762217632176421765217662176721768217692177021771217722177321774217752177621777217782177921780217812178221783217842178521786217872178821789217902179121792217932179421795217962179721798217992180021801218022180321804218052180621807218082180921810218112181221813218142181521816218172181821819218202182121822218232182421825218262182721828218292183021831218322183321834218352183621837218382183921840218412184221843218442184521846218472184821849218502185121852218532185421855218562185721858218592186021861218622186321864218652186621867218682186921870218712187221873218742187521876218772187821879218802188121882218832188421885218862188721888218892189021891218922189321894218952189621897218982189921900219012190221903219042190521906219072190821909219102191121912219132191421915219162191721918219192192021921219222192321924219252192621927219282192921930219312193221933219342193521936219372193821939219402194121942219432194421945219462194721948219492195021951219522195321954219552195621957219582195921960219612196221963219642196521966219672196821969219702197121972219732197421975219762197721978219792198021981219822198321984219852198621987219882198921990219912199221993219942199521996219972199821999220002200122002220032200422005220062200722008220092201022011220122201322014220152201622017220182201922020220212202222023220242202522026220272202822029220302203122032220332203422035220362203722038220392204022041220422204322044220452204622047220482204922050220512205222053220542205522056220572205822059220602206122062220632206422065220662206722068220692207022071220722207322074220752207622077220782207922080220812208222083220842208522086220872208822089220902209122092220932209422095220962209722098220992210022101221022210322104221052210622107221082210922110221112211222113221142211522116221172211822119221202212122122221232212422125221262212722128221292213022131221322213322134221352213622137221382213922140221412214222143221442214522146221472214822149221502215122152221532215422155221562215722158221592216022161221622216322164221652216622167221682216922170221712217222173221742217522176221772217822179221802218122182221832218422185221862218722188221892219022191221922219322194221952219622197221982219922200222012220222203222042220522206222072220822209222102221122212222132221422215222162221722218222192222022221222222222322224222252222622227222282222922230222312223222233222342223522236222372223822239222402224122242222432224422245222462224722248222492225022251222522225322254222552225622257222582225922260222612226222263222642226522266222672226822269222702227122272222732227422275222762227722278222792228022281222822228322284222852228622287222882228922290222912229222293222942229522296222972229822299223002230122302223032230422305223062230722308223092231022311223122231322314223152231622317223182231922320223212232222323223242232522326223272232822329223302233122332223332233422335223362233722338223392234022341223422234322344223452234622347223482234922350223512235222353223542235522356223572235822359223602236122362223632236422365223662236722368223692237022371223722237322374223752237622377223782237922380223812238222383223842238522386223872238822389223902239122392223932239422395223962239722398223992240022401224022240322404224052240622407224082240922410224112241222413224142241522416224172241822419224202242122422224232242422425224262242722428224292243022431224322243322434224352243622437224382243922440224412244222443224442244522446224472244822449224502245122452224532245422455224562245722458224592246022461224622246322464224652246622467224682246922470224712247222473224742247522476224772247822479224802248122482224832248422485224862248722488224892249022491224922249322494224952249622497224982249922500225012250222503225042250522506225072250822509225102251122512225132251422515225162251722518225192252022521225222252322524225252252622527225282252922530225312253222533225342253522536225372253822539225402254122542225432254422545225462254722548225492255022551225522255322554225552255622557225582255922560225612256222563225642256522566225672256822569225702257122572225732257422575225762257722578225792258022581225822258322584225852258622587225882258922590225912259222593225942259522596225972259822599226002260122602226032260422605226062260722608226092261022611226122261322614226152261622617226182261922620226212262222623226242262522626226272262822629226302263122632226332263422635226362263722638226392264022641226422264322644226452264622647226482264922650226512265222653226542265522656226572265822659226602266122662226632266422665226662266722668226692267022671226722267322674226752267622677226782267922680226812268222683226842268522686226872268822689226902269122692226932269422695226962269722698226992270022701227022270322704227052270622707227082270922710227112271222713227142271522716227172271822719227202272122722227232272422725227262272722728227292273022731227322273322734227352273622737227382273922740227412274222743227442274522746227472274822749227502275122752227532275422755227562275722758227592276022761227622276322764227652276622767227682276922770227712277222773227742277522776227772277822779227802278122782227832278422785227862278722788227892279022791227922279322794227952279622797227982279922800228012280222803228042280522806228072280822809228102281122812228132281422815228162281722818228192282022821228222282322824228252282622827228282282922830228312283222833228342283522836228372283822839228402284122842228432284422845228462284722848228492285022851228522285322854228552285622857228582285922860228612286222863228642286522866228672286822869228702287122872228732287422875228762287722878228792288022881228822288322884228852288622887228882288922890228912289222893228942289522896228972289822899229002290122902229032290422905229062290722908229092291022911229122291322914229152291622917229182291922920229212292222923229242292522926229272292822929229302293122932229332293422935229362293722938229392294022941229422294322944229452294622947229482294922950229512295222953229542295522956229572295822959229602296122962229632296422965229662296722968229692297022971229722297322974229752297622977229782297922980229812298222983229842298522986229872298822989229902299122992229932299422995229962299722998229992300023001230022300323004230052300623007230082300923010230112301223013230142301523016230172301823019230202302123022230232302423025230262302723028230292303023031230322303323034230352303623037230382303923040230412304223043230442304523046230472304823049230502305123052230532305423055230562305723058230592306023061230622306323064230652306623067230682306923070230712307223073230742307523076230772307823079230802308123082230832308423085230862308723088230892309023091230922309323094230952309623097230982309923100231012310223103231042310523106231072310823109231102311123112231132311423115231162311723118231192312023121231222312323124231252312623127231282312923130231312313223133231342313523136231372313823139231402314123142231432314423145231462314723148231492315023151231522315323154231552315623157231582315923160231612316223163231642316523166231672316823169231702317123172231732317423175231762317723178231792318023181231822318323184231852318623187231882318923190231912319223193231942319523196231972319823199232002320123202232032320423205232062320723208232092321023211232122321323214232152321623217232182321923220232212322223223232242322523226232272322823229232302323123232232332323423235232362323723238232392324023241232422324323244232452324623247232482324923250232512325223253232542325523256232572325823259232602326123262232632326423265232662326723268232692327023271232722327323274232752327623277232782327923280232812328223283232842328523286232872328823289232902329123292232932329423295232962329723298232992330023301233022330323304233052330623307233082330923310233112331223313233142331523316233172331823319233202332123322233232332423325233262332723328233292333023331233322333323334233352333623337233382333923340233412334223343233442334523346233472334823349233502335123352233532335423355233562335723358233592336023361233622336323364233652336623367233682336923370233712337223373233742337523376233772337823379233802338123382233832338423385233862338723388233892339023391233922339323394233952339623397233982339923400234012340223403234042340523406234072340823409234102341123412234132341423415234162341723418234192342023421234222342323424234252342623427234282342923430234312343223433234342343523436234372343823439234402344123442234432344423445234462344723448234492345023451234522345323454234552345623457234582345923460234612346223463234642346523466234672346823469234702347123472234732347423475234762347723478234792348023481234822348323484234852348623487234882348923490234912349223493234942349523496234972349823499235002350123502235032350423505235062350723508235092351023511235122351323514235152351623517235182351923520235212352223523235242352523526235272352823529235302353123532235332353423535235362353723538235392354023541235422354323544235452354623547235482354923550235512355223553235542355523556235572355823559235602356123562235632356423565235662356723568235692357023571235722357323574235752357623577235782357923580235812358223583235842358523586235872358823589235902359123592235932359423595235962359723598235992360023601236022360323604236052360623607236082360923610236112361223613236142361523616236172361823619236202362123622236232362423625236262362723628236292363023631236322363323634236352363623637236382363923640236412364223643236442364523646236472364823649236502365123652236532365423655236562365723658236592366023661236622366323664236652366623667236682366923670236712367223673236742367523676236772367823679236802368123682236832368423685236862368723688236892369023691236922369323694236952369623697236982369923700237012370223703237042370523706237072370823709237102371123712237132371423715237162371723718237192372023721237222372323724237252372623727237282372923730237312373223733237342373523736237372373823739237402374123742237432374423745237462374723748237492375023751237522375323754237552375623757237582375923760237612376223763237642376523766237672376823769237702377123772237732377423775237762377723778237792378023781237822378323784237852378623787237882378923790237912379223793237942379523796237972379823799238002380123802238032380423805238062380723808238092381023811238122381323814238152381623817238182381923820238212382223823238242382523826238272382823829238302383123832238332383423835238362383723838238392384023841238422384323844238452384623847238482384923850238512385223853238542385523856238572385823859238602386123862238632386423865238662386723868238692387023871238722387323874238752387623877238782387923880238812388223883238842388523886238872388823889238902389123892238932389423895238962389723898238992390023901239022390323904239052390623907239082390923910239112391223913239142391523916239172391823919239202392123922239232392423925239262392723928239292393023931239322393323934239352393623937239382393923940239412394223943239442394523946239472394823949239502395123952239532395423955239562395723958239592396023961239622396323964239652396623967239682396923970239712397223973239742397523976239772397823979239802398123982239832398423985239862398723988239892399023991239922399323994239952399623997239982399924000240012400224003240042400524006240072400824009240102401124012240132401424015240162401724018240192402024021240222402324024240252402624027240282402924030240312403224033240342403524036240372403824039240402404124042240432404424045240462404724048240492405024051240522405324054240552405624057240582405924060240612406224063240642406524066240672406824069240702407124072240732407424075240762407724078240792408024081240822408324084240852408624087240882408924090240912409224093240942409524096240972409824099241002410124102241032410424105241062410724108241092411024111241122411324114241152411624117241182411924120241212412224123241242412524126241272412824129241302413124132241332413424135241362413724138241392414024141241422414324144241452414624147241482414924150241512415224153241542415524156241572415824159241602416124162241632416424165241662416724168241692417024171241722417324174241752417624177241782417924180241812418224183241842418524186241872418824189241902419124192241932419424195241962419724198241992420024201242022420324204242052420624207242082420924210242112421224213242142421524216242172421824219242202422124222242232422424225242262422724228242292423024231242322423324234242352423624237242382423924240242412424224243242442424524246242472424824249242502425124252242532425424255242562425724258242592426024261242622426324264242652426624267242682426924270242712427224273242742427524276242772427824279242802428124282242832428424285242862428724288242892429024291242922429324294242952429624297242982429924300243012430224303243042430524306243072430824309243102431124312243132431424315243162431724318243192432024321243222432324324243252432624327243282432924330243312433224333243342433524336243372433824339243402434124342243432434424345243462434724348243492435024351243522435324354243552435624357243582435924360243612436224363243642436524366243672436824369243702437124372243732437424375243762437724378243792438024381243822438324384243852438624387243882438924390243912439224393243942439524396243972439824399244002440124402244032440424405244062440724408244092441024411244122441324414244152441624417244182441924420244212442224423244242442524426244272442824429244302443124432244332443424435244362443724438244392444024441244422444324444244452444624447244482444924450244512445224453244542445524456244572445824459244602446124462244632446424465244662446724468244692447024471244722447324474244752447624477244782447924480244812448224483244842448524486244872448824489244902449124492244932449424495244962449724498244992450024501245022450324504245052450624507245082450924510245112451224513245142451524516245172451824519245202452124522245232452424525245262452724528245292453024531245322453324534245352453624537245382453924540245412454224543245442454524546245472454824549245502455124552245532455424555245562455724558245592456024561245622456324564245652456624567245682456924570245712457224573245742457524576245772457824579245802458124582245832458424585245862458724588245892459024591245922459324594245952459624597245982459924600246012460224603246042460524606246072460824609246102461124612246132461424615246162461724618246192462024621246222462324624246252462624627246282462924630246312463224633246342463524636246372463824639246402464124642246432464424645246462464724648246492465024651246522465324654246552465624657246582465924660246612466224663246642466524666246672466824669246702467124672246732467424675246762467724678246792468024681246822468324684246852468624687246882468924690246912469224693246942469524696246972469824699247002470124702247032470424705247062470724708247092471024711247122471324714247152471624717247182471924720247212472224723247242472524726247272472824729247302473124732247332473424735247362473724738247392474024741247422474324744247452474624747247482474924750247512475224753247542475524756247572475824759247602476124762247632476424765247662476724768247692477024771247722477324774247752477624777247782477924780247812478224783247842478524786247872478824789247902479124792247932479424795247962479724798247992480024801248022480324804248052480624807248082480924810248112481224813248142481524816248172481824819248202482124822248232482424825248262482724828248292483024831248322483324834248352483624837248382483924840248412484224843248442484524846248472484824849248502485124852248532485424855248562485724858248592486024861248622486324864248652486624867248682486924870248712487224873248742487524876248772487824879248802488124882248832488424885248862488724888248892489024891248922489324894248952489624897248982489924900249012490224903249042490524906249072490824909249102491124912249132491424915249162491724918249192492024921249222492324924249252492624927249282492924930249312493224933249342493524936249372493824939249402494124942249432494424945249462494724948249492495024951249522495324954249552495624957249582495924960249612496224963249642496524966249672496824969249702497124972249732497424975249762497724978249792498024981249822498324984249852498624987249882498924990249912499224993249942499524996249972499824999250002500125002250032500425005250062500725008250092501025011250122501325014250152501625017250182501925020250212502225023250242502525026250272502825029250302503125032250332503425035250362503725038250392504025041250422504325044250452504625047250482504925050250512505225053250542505525056250572505825059250602506125062250632506425065250662506725068250692507025071250722507325074250752507625077250782507925080250812508225083250842508525086250872508825089250902509125092250932509425095250962509725098250992510025101251022510325104251052510625107251082510925110251112511225113251142511525116251172511825119251202512125122251232512425125251262512725128251292513025131251322513325134251352513625137251382513925140251412514225143251442514525146251472514825149251502515125152251532515425155251562515725158251592516025161251622516325164251652516625167251682516925170251712517225173251742517525176251772517825179251802518125182251832518425185251862518725188251892519025191251922519325194251952519625197251982519925200252012520225203252042520525206252072520825209252102521125212252132521425215252162521725218252192522025221252222522325224252252522625227252282522925230252312523225233252342523525236252372523825239252402524125242252432524425245252462524725248252492525025251252522525325254252552525625257252582525925260252612526225263252642526525266252672526825269252702527125272252732527425275252762527725278252792528025281252822528325284252852528625287252882528925290252912529225293252942529525296252972529825299253002530125302253032530425305253062530725308253092531025311253122531325314253152531625317253182531925320253212532225323253242532525326253272532825329253302533125332253332533425335253362533725338253392534025341253422534325344253452534625347253482534925350253512535225353253542535525356253572535825359253602536125362253632536425365253662536725368253692537025371253722537325374253752537625377253782537925380253812538225383253842538525386253872538825389253902539125392253932539425395253962539725398253992540025401254022540325404254052540625407254082540925410254112541225413254142541525416254172541825419254202542125422254232542425425254262542725428254292543025431254322543325434254352543625437254382543925440254412544225443254442544525446254472544825449254502545125452254532545425455254562545725458254592546025461254622546325464254652546625467254682546925470254712547225473254742547525476254772547825479254802548125482254832548425485254862548725488254892549025491254922549325494254952549625497254982549925500255012550225503255042550525506255072550825509255102551125512255132551425515255162551725518255192552025521255222552325524255252552625527255282552925530255312553225533255342553525536255372553825539255402554125542255432554425545255462554725548255492555025551255522555325554255552555625557255582555925560255612556225563255642556525566255672556825569255702557125572255732557425575255762557725578255792558025581255822558325584255852558625587255882558925590255912559225593255942559525596255972559825599256002560125602256032560425605256062560725608256092561025611256122561325614256152561625617256182561925620256212562225623256242562525626256272562825629256302563125632256332563425635256362563725638256392564025641256422564325644256452564625647256482564925650256512565225653256542565525656256572565825659256602566125662256632566425665256662566725668256692567025671256722567325674256752567625677256782567925680256812568225683256842568525686256872568825689256902569125692256932569425695256962569725698256992570025701257022570325704257052570625707257082570925710257112571225713257142571525716257172571825719257202572125722257232572425725257262572725728257292573025731257322573325734257352573625737257382573925740257412574225743257442574525746257472574825749257502575125752257532575425755257562575725758257592576025761257622576325764257652576625767257682576925770257712577225773257742577525776257772577825779257802578125782257832578425785257862578725788257892579025791257922579325794257952579625797257982579925800258012580225803258042580525806258072580825809258102581125812258132581425815258162581725818258192582025821258222582325824258252582625827258282582925830258312583225833258342583525836258372583825839258402584125842258432584425845258462584725848258492585025851258522585325854258552585625857258582585925860258612586225863258642586525866258672586825869258702587125872258732587425875258762587725878258792588025881258822588325884258852588625887258882588925890258912589225893258942589525896258972589825899259002590125902259032590425905259062590725908259092591025911259122591325914259152591625917259182591925920259212592225923259242592525926259272592825929259302593125932259332593425935259362593725938259392594025941259422594325944259452594625947259482594925950259512595225953259542595525956259572595825959259602596125962259632596425965259662596725968259692597025971259722597325974259752597625977259782597925980259812598225983259842598525986259872598825989259902599125992259932599425995259962599725998259992600026001260022600326004260052600626007260082600926010260112601226013260142601526016260172601826019260202602126022260232602426025260262602726028260292603026031260322603326034260352603626037260382603926040260412604226043260442604526046260472604826049260502605126052260532605426055260562605726058260592606026061260622606326064260652606626067260682606926070260712607226073260742607526076260772607826079260802608126082260832608426085260862608726088260892609026091260922609326094260952609626097260982609926100261012610226103261042610526106261072610826109261102611126112261132611426115261162611726118261192612026121261222612326124261252612626127261282612926130261312613226133261342613526136261372613826139261402614126142261432614426145261462614726148261492615026151261522615326154261552615626157261582615926160261612616226163261642616526166261672616826169261702617126172261732617426175261762617726178261792618026181261822618326184261852618626187261882618926190261912619226193261942619526196261972619826199262002620126202262032620426205262062620726208262092621026211262122621326214262152621626217262182621926220262212622226223262242622526226262272622826229262302623126232262332623426235262362623726238262392624026241262422624326244262452624626247262482624926250262512625226253262542625526256262572625826259262602626126262262632626426265262662626726268262692627026271262722627326274262752627626277262782627926280262812628226283262842628526286262872628826289262902629126292262932629426295262962629726298262992630026301263022630326304263052630626307263082630926310263112631226313263142631526316263172631826319263202632126322263232632426325263262632726328263292633026331263322633326334263352633626337263382633926340263412634226343263442634526346263472634826349263502635126352263532635426355263562635726358263592636026361263622636326364263652636626367263682636926370263712637226373263742637526376263772637826379263802638126382263832638426385263862638726388263892639026391263922639326394263952639626397263982639926400264012640226403264042640526406264072640826409264102641126412264132641426415264162641726418264192642026421264222642326424264252642626427264282642926430264312643226433264342643526436264372643826439264402644126442264432644426445264462644726448264492645026451264522645326454264552645626457264582645926460264612646226463264642646526466264672646826469264702647126472264732647426475264762647726478264792648026481264822648326484264852648626487264882648926490264912649226493264942649526496264972649826499265002650126502265032650426505265062650726508265092651026511265122651326514265152651626517265182651926520265212652226523265242652526526265272652826529265302653126532265332653426535265362653726538265392654026541265422654326544265452654626547265482654926550265512655226553265542655526556265572655826559265602656126562265632656426565265662656726568265692657026571265722657326574265752657626577265782657926580265812658226583265842658526586265872658826589265902659126592265932659426595265962659726598265992660026601266022660326604266052660626607266082660926610266112661226613266142661526616266172661826619266202662126622266232662426625266262662726628266292663026631266322663326634266352663626637266382663926640266412664226643266442664526646266472664826649266502665126652266532665426655266562665726658266592666026661266622666326664266652666626667266682666926670266712667226673266742667526676266772667826679266802668126682266832668426685266862668726688266892669026691266922669326694266952669626697266982669926700267012670226703267042670526706267072670826709267102671126712267132671426715267162671726718267192672026721267222672326724267252672626727267282672926730267312673226733267342673526736267372673826739267402674126742267432674426745267462674726748267492675026751267522675326754267552675626757267582675926760267612676226763267642676526766267672676826769267702677126772267732677426775267762677726778267792678026781267822678326784267852678626787267882678926790267912679226793267942679526796267972679826799268002680126802268032680426805268062680726808268092681026811268122681326814268152681626817268182681926820268212682226823268242682526826268272682826829268302683126832268332683426835268362683726838268392684026841268422684326844268452684626847268482684926850268512685226853268542685526856268572685826859268602686126862268632686426865268662686726868268692687026871268722687326874268752687626877268782687926880268812688226883268842688526886268872688826889268902689126892268932689426895268962689726898268992690026901269022690326904269052690626907269082690926910269112691226913269142691526916269172691826919269202692126922269232692426925269262692726928269292693026931269322693326934269352693626937269382693926940269412694226943269442694526946269472694826949269502695126952269532695426955269562695726958269592696026961269622696326964269652696626967269682696926970269712697226973269742697526976269772697826979269802698126982269832698426985269862698726988269892699026991269922699326994269952699626997269982699927000270012700227003270042700527006270072700827009270102701127012270132701427015270162701727018270192702027021270222702327024270252702627027270282702927030270312703227033270342703527036270372703827039270402704127042270432704427045270462704727048270492705027051270522705327054270552705627057270582705927060270612706227063270642706527066270672706827069270702707127072270732707427075270762707727078270792708027081270822708327084270852708627087270882708927090270912709227093270942709527096270972709827099271002710127102271032710427105271062710727108271092711027111271122711327114271152711627117271182711927120271212712227123271242712527126271272712827129271302713127132271332713427135271362713727138271392714027141271422714327144271452714627147271482714927150271512715227153271542715527156271572715827159271602716127162271632716427165271662716727168271692717027171271722717327174271752717627177271782717927180271812718227183271842718527186271872718827189271902719127192271932719427195271962719727198271992720027201272022720327204272052720627207272082720927210272112721227213272142721527216272172721827219272202722127222272232722427225272262722727228272292723027231272322723327234272352723627237272382723927240272412724227243272442724527246272472724827249272502725127252272532725427255272562725727258272592726027261272622726327264272652726627267272682726927270272712727227273272742727527276272772727827279272802728127282272832728427285272862728727288272892729027291272922729327294272952729627297272982729927300273012730227303273042730527306273072730827309273102731127312273132731427315273162731727318273192732027321273222732327324273252732627327273282732927330273312733227333273342733527336273372733827339273402734127342273432734427345273462734727348273492735027351273522735327354273552735627357273582735927360273612736227363273642736527366273672736827369273702737127372273732737427375273762737727378273792738027381273822738327384273852738627387273882738927390273912739227393273942739527396273972739827399274002740127402274032740427405274062740727408274092741027411274122741327414274152741627417274182741927420274212742227423274242742527426274272742827429274302743127432274332743427435274362743727438274392744027441274422744327444274452744627447274482744927450274512745227453274542745527456274572745827459274602746127462274632746427465274662746727468274692747027471274722747327474274752747627477274782747927480274812748227483274842748527486274872748827489274902749127492274932749427495274962749727498274992750027501275022750327504275052750627507275082750927510275112751227513275142751527516275172751827519275202752127522275232752427525275262752727528275292753027531275322753327534275352753627537275382753927540275412754227543275442754527546275472754827549275502755127552275532755427555275562755727558275592756027561275622756327564275652756627567275682756927570275712757227573275742757527576275772757827579275802758127582275832758427585275862758727588275892759027591275922759327594275952759627597275982759927600276012760227603276042760527606276072760827609276102761127612276132761427615276162761727618276192762027621276222762327624276252762627627276282762927630276312763227633276342763527636276372763827639276402764127642276432764427645276462764727648276492765027651276522765327654276552765627657276582765927660276612766227663276642766527666276672766827669276702767127672276732767427675276762767727678276792768027681276822768327684276852768627687276882768927690276912769227693276942769527696276972769827699277002770127702277032770427705277062770727708277092771027711277122771327714277152771627717277182771927720277212772227723277242772527726277272772827729277302773127732277332773427735277362773727738277392774027741277422774327744277452774627747277482774927750277512775227753277542775527756277572775827759277602776127762277632776427765277662776727768277692777027771277722777327774277752777627777277782777927780277812778227783277842778527786277872778827789277902779127792277932779427795277962779727798277992780027801278022780327804278052780627807278082780927810278112781227813278142781527816278172781827819278202782127822278232782427825278262782727828278292783027831278322783327834278352783627837278382783927840278412784227843278442784527846278472784827849278502785127852278532785427855278562785727858278592786027861278622786327864278652786627867278682786927870278712787227873278742787527876278772787827879278802788127882278832788427885278862788727888278892789027891278922789327894278952789627897278982789927900279012790227903279042790527906279072790827909279102791127912279132791427915279162791727918279192792027921279222792327924279252792627927279282792927930279312793227933279342793527936279372793827939279402794127942279432794427945279462794727948279492795027951279522795327954279552795627957279582795927960279612796227963279642796527966279672796827969279702797127972279732797427975279762797727978279792798027981279822798327984279852798627987279882798927990279912799227993279942799527996279972799827999280002800128002280032800428005280062800728008280092801028011280122801328014280152801628017280182801928020280212802228023280242802528026280272802828029280302803128032280332803428035280362803728038280392804028041280422804328044280452804628047280482804928050280512805228053280542805528056280572805828059280602806128062280632806428065280662806728068280692807028071280722807328074280752807628077280782807928080280812808228083280842808528086280872808828089280902809128092280932809428095280962809728098280992810028101281022810328104281052810628107281082810928110281112811228113281142811528116281172811828119281202812128122281232812428125281262812728128281292813028131281322813328134281352813628137281382813928140281412814228143281442814528146281472814828149281502815128152281532815428155281562815728158281592816028161281622816328164281652816628167281682816928170281712817228173281742817528176281772817828179281802818128182281832818428185281862818728188281892819028191281922819328194281952819628197281982819928200282012820228203282042820528206282072820828209282102821128212282132821428215282162821728218282192822028221282222822328224282252822628227282282822928230282312823228233282342823528236282372823828239282402824128242282432824428245282462824728248282492825028251282522825328254282552825628257282582825928260282612826228263282642826528266282672826828269282702827128272282732827428275282762827728278282792828028281282822828328284282852828628287282882828928290282912829228293282942829528296282972829828299283002830128302283032830428305283062830728308283092831028311283122831328314283152831628317283182831928320283212832228323283242832528326283272832828329283302833128332283332833428335283362833728338283392834028341283422834328344283452834628347283482834928350283512835228353283542835528356283572835828359283602836128362283632836428365283662836728368283692837028371283722837328374283752837628377283782837928380283812838228383283842838528386283872838828389283902839128392283932839428395283962839728398283992840028401284022840328404284052840628407284082840928410284112841228413284142841528416284172841828419284202842128422284232842428425284262842728428284292843028431284322843328434284352843628437284382843928440284412844228443284442844528446284472844828449284502845128452284532845428455284562845728458284592846028461284622846328464284652846628467284682846928470284712847228473284742847528476284772847828479284802848128482284832848428485284862848728488284892849028491284922849328494284952849628497284982849928500285012850228503285042850528506285072850828509285102851128512285132851428515285162851728518285192852028521285222852328524285252852628527285282852928530285312853228533285342853528536285372853828539285402854128542285432854428545285462854728548285492855028551285522855328554285552855628557285582855928560285612856228563285642856528566285672856828569285702857128572285732857428575285762857728578285792858028581285822858328584285852858628587285882858928590285912859228593285942859528596285972859828599286002860128602286032860428605286062860728608286092861028611286122861328614286152861628617286182861928620286212862228623286242862528626286272862828629286302863128632286332863428635286362863728638286392864028641286422864328644286452864628647286482864928650286512865228653286542865528656286572865828659286602866128662286632866428665286662866728668286692867028671286722867328674286752867628677286782867928680286812868228683286842868528686286872868828689286902869128692286932869428695286962869728698286992870028701287022870328704287052870628707287082870928710287112871228713287142871528716287172871828719287202872128722287232872428725287262872728728287292873028731287322873328734287352873628737287382873928740287412874228743287442874528746287472874828749287502875128752287532875428755287562875728758287592876028761287622876328764287652876628767287682876928770287712877228773287742877528776287772877828779287802878128782287832878428785287862878728788287892879028791287922879328794287952879628797287982879928800288012880228803288042880528806288072880828809288102881128812288132881428815288162881728818288192882028821288222882328824288252882628827288282882928830288312883228833288342883528836288372883828839288402884128842288432884428845288462884728848288492885028851288522885328854288552885628857288582885928860288612886228863288642886528866288672886828869288702887128872288732887428875288762887728878288792888028881288822888328884288852888628887288882888928890288912889228893288942889528896288972889828899289002890128902289032890428905289062890728908289092891028911289122891328914289152891628917289182891928920289212892228923289242892528926289272892828929289302893128932289332893428935289362893728938289392894028941289422894328944289452894628947289482894928950289512895228953289542895528956289572895828959289602896128962289632896428965289662896728968289692897028971289722897328974289752897628977289782897928980289812898228983289842898528986289872898828989289902899128992289932899428995289962899728998289992900029001290022900329004290052900629007290082900929010290112901229013290142901529016290172901829019290202902129022290232902429025290262902729028290292903029031290322903329034290352903629037290382903929040290412904229043290442904529046290472904829049290502905129052290532905429055290562905729058290592906029061290622906329064290652906629067290682906929070290712907229073290742907529076290772907829079290802908129082290832908429085290862908729088290892909029091290922909329094290952909629097290982909929100291012910229103291042910529106291072910829109291102911129112291132911429115291162911729118291192912029121291222912329124291252912629127291282912929130291312913229133291342913529136291372913829139291402914129142291432914429145291462914729148291492915029151291522915329154291552915629157291582915929160291612916229163291642916529166291672916829169291702917129172291732917429175291762917729178291792918029181291822918329184291852918629187291882918929190291912919229193291942919529196291972919829199292002920129202292032920429205292062920729208292092921029211292122921329214292152921629217292182921929220292212922229223292242922529226292272922829229292302923129232292332923429235292362923729238292392924029241292422924329244292452924629247292482924929250292512925229253292542925529256292572925829259292602926129262292632926429265292662926729268292692927029271292722927329274292752927629277292782927929280292812928229283292842928529286292872928829289292902929129292292932929429295292962929729298292992930029301293022930329304293052930629307293082930929310293112931229313293142931529316293172931829319293202932129322293232932429325293262932729328293292933029331293322933329334293352933629337293382933929340293412934229343293442934529346293472934829349293502935129352293532935429355293562935729358293592936029361293622936329364293652936629367293682936929370293712937229373293742937529376293772937829379293802938129382293832938429385293862938729388293892939029391293922939329394293952939629397293982939929400294012940229403294042940529406294072940829409294102941129412294132941429415294162941729418294192942029421294222942329424294252942629427294282942929430294312943229433294342943529436294372943829439294402944129442294432944429445294462944729448294492945029451294522945329454294552945629457294582945929460294612946229463294642946529466294672946829469294702947129472294732947429475294762947729478294792948029481294822948329484294852948629487294882948929490294912949229493294942949529496294972949829499295002950129502295032950429505295062950729508295092951029511295122951329514295152951629517295182951929520295212952229523295242952529526295272952829529295302953129532295332953429535295362953729538295392954029541295422954329544295452954629547295482954929550295512955229553295542955529556295572955829559295602956129562295632956429565295662956729568295692957029571295722957329574295752957629577295782957929580295812958229583295842958529586295872958829589295902959129592295932959429595295962959729598295992960029601296022960329604296052960629607296082960929610296112961229613296142961529616296172961829619296202962129622296232962429625296262962729628296292963029631296322963329634296352963629637296382963929640296412964229643296442964529646296472964829649296502965129652296532965429655296562965729658296592966029661296622966329664296652966629667296682966929670296712967229673296742967529676296772967829679296802968129682296832968429685296862968729688296892969029691296922969329694296952969629697296982969929700297012970229703297042970529706297072970829709297102971129712297132971429715297162971729718297192972029721297222972329724297252972629727297282972929730297312973229733297342973529736297372973829739297402974129742297432974429745297462974729748297492975029751297522975329754297552975629757297582975929760297612976229763297642976529766297672976829769297702977129772297732977429775297762977729778297792978029781297822978329784297852978629787297882978929790297912979229793297942979529796297972979829799298002980129802298032980429805298062980729808298092981029811298122981329814298152981629817298182981929820298212982229823298242982529826298272982829829298302983129832298332983429835298362983729838298392984029841298422984329844298452984629847298482984929850298512985229853298542985529856298572985829859298602986129862298632986429865298662986729868298692987029871298722987329874298752987629877298782987929880298812988229883298842988529886298872988829889298902989129892298932989429895298962989729898298992990029901299022990329904299052990629907299082990929910299112991229913299142991529916299172991829919299202992129922299232992429925299262992729928299292993029931299322993329934299352993629937299382993929940299412994229943299442994529946299472994829949299502995129952299532995429955299562995729958299592996029961299622996329964299652996629967299682996929970299712997229973299742997529976299772997829979299802998129982299832998429985299862998729988299892999029991299922999329994299952999629997299982999930000300013000230003300043000530006300073000830009300103001130012300133001430015300163001730018300193002030021300223002330024300253002630027300283002930030300313003230033300343003530036300373003830039300403004130042300433004430045300463004730048300493005030051300523005330054300553005630057300583005930060300613006230063300643006530066300673006830069300703007130072300733007430075300763007730078300793008030081300823008330084300853008630087300883008930090300913009230093300943009530096300973009830099301003010130102301033010430105301063010730108301093011030111301123011330114301153011630117301183011930120301213012230123301243012530126301273012830129301303013130132301333013430135301363013730138301393014030141301423014330144301453014630147301483014930150301513015230153301543015530156301573015830159301603016130162301633016430165301663016730168301693017030171301723017330174301753017630177301783017930180301813018230183301843018530186301873018830189301903019130192301933019430195301963019730198301993020030201302023020330204302053020630207302083020930210302113021230213302143021530216302173021830219302203022130222302233022430225302263022730228302293023030231302323023330234302353023630237302383023930240302413024230243302443024530246302473024830249302503025130252302533025430255302563025730258302593026030261302623026330264302653026630267302683026930270302713027230273302743027530276302773027830279302803028130282302833028430285302863028730288302893029030291302923029330294302953029630297302983029930300303013030230303303043030530306303073030830309303103031130312303133031430315303163031730318303193032030321303223032330324303253032630327303283032930330303313033230333303343033530336303373033830339303403034130342303433034430345303463034730348303493035030351303523035330354303553035630357303583035930360303613036230363303643036530366303673036830369303703037130372303733037430375303763037730378303793038030381303823038330384303853038630387303883038930390303913039230393303943039530396303973039830399304003040130402304033040430405304063040730408304093041030411304123041330414304153041630417304183041930420304213042230423304243042530426304273042830429304303043130432304333043430435304363043730438304393044030441304423044330444304453044630447304483044930450304513045230453304543045530456304573045830459304603046130462304633046430465304663046730468304693047030471304723047330474304753047630477304783047930480304813048230483304843048530486304873048830489304903049130492304933049430495304963049730498304993050030501305023050330504305053050630507305083050930510305113051230513305143051530516305173051830519305203052130522305233052430525305263052730528305293053030531305323053330534305353053630537305383053930540305413054230543305443054530546305473054830549305503055130552305533055430555305563055730558305593056030561305623056330564305653056630567305683056930570305713057230573305743057530576305773057830579305803058130582305833058430585305863058730588305893059030591305923059330594305953059630597305983059930600306013060230603306043060530606306073060830609306103061130612306133061430615306163061730618306193062030621306223062330624306253062630627306283062930630306313063230633306343063530636306373063830639306403064130642306433064430645306463064730648306493065030651306523065330654306553065630657306583065930660306613066230663306643066530666306673066830669306703067130672306733067430675306763067730678306793068030681306823068330684306853068630687306883068930690306913069230693306943069530696306973069830699307003070130702307033070430705307063070730708307093071030711307123071330714307153071630717307183071930720307213072230723307243072530726307273072830729307303073130732307333073430735307363073730738307393074030741307423074330744307453074630747307483074930750307513075230753307543075530756307573075830759307603076130762307633076430765307663076730768307693077030771307723077330774307753077630777307783077930780307813078230783307843078530786307873078830789307903079130792307933079430795307963079730798307993080030801308023080330804308053080630807308083080930810308113081230813308143081530816308173081830819308203082130822308233082430825308263082730828308293083030831308323083330834308353083630837308383083930840308413084230843308443084530846308473084830849308503085130852308533085430855308563085730858308593086030861308623086330864308653086630867308683086930870308713087230873308743087530876308773087830879308803088130882308833088430885308863088730888308893089030891308923089330894308953089630897308983089930900309013090230903309043090530906309073090830909309103091130912309133091430915309163091730918309193092030921309223092330924309253092630927309283092930930309313093230933309343093530936309373093830939309403094130942309433094430945309463094730948309493095030951309523095330954309553095630957309583095930960309613096230963309643096530966309673096830969309703097130972309733097430975309763097730978309793098030981309823098330984309853098630987309883098930990309913099230993309943099530996309973099830999310003100131002310033100431005310063100731008310093101031011310123101331014310153101631017310183101931020310213102231023310243102531026310273102831029310303103131032310333103431035310363103731038310393104031041310423104331044310453104631047310483104931050310513105231053310543105531056310573105831059310603106131062310633106431065310663106731068310693107031071310723107331074310753107631077310783107931080310813108231083310843108531086310873108831089310903109131092310933109431095310963109731098310993110031101311023110331104311053110631107311083110931110311113111231113311143111531116311173111831119311203112131122311233112431125311263112731128311293113031131311323113331134311353113631137311383113931140311413114231143311443114531146311473114831149311503115131152311533115431155311563115731158311593116031161311623116331164311653116631167311683116931170311713117231173311743117531176311773117831179311803118131182311833118431185311863118731188311893119031191311923119331194311953119631197311983119931200312013120231203312043120531206312073120831209312103121131212312133121431215312163121731218312193122031221312223122331224312253122631227312283122931230312313123231233312343123531236312373123831239312403124131242312433124431245312463124731248312493125031251312523125331254312553125631257312583125931260312613126231263312643126531266312673126831269312703127131272312733127431275312763127731278312793128031281312823128331284312853128631287312883128931290312913129231293312943129531296312973129831299313003130131302313033130431305313063130731308313093131031311313123131331314313153131631317313183131931320313213132231323313243132531326313273132831329313303133131332313333133431335313363133731338313393134031341313423134331344313453134631347313483134931350313513135231353313543135531356313573135831359313603136131362313633136431365313663136731368313693137031371313723137331374313753137631377313783137931380313813138231383313843138531386313873138831389313903139131392313933139431395313963139731398313993140031401314023140331404314053140631407314083140931410314113141231413314143141531416314173141831419314203142131422314233142431425314263142731428314293143031431314323143331434314353143631437314383143931440314413144231443314443144531446314473144831449314503145131452314533145431455314563145731458314593146031461314623146331464314653146631467314683146931470314713147231473314743147531476314773147831479314803148131482314833148431485314863148731488314893149031491314923149331494314953149631497314983149931500315013150231503315043150531506315073150831509315103151131512315133151431515315163151731518315193152031521315223152331524315253152631527315283152931530315313153231533315343153531536315373153831539315403154131542315433154431545315463154731548315493155031551315523155331554315553155631557315583155931560315613156231563315643156531566315673156831569315703157131572315733157431575315763157731578315793158031581315823158331584315853158631587315883158931590315913159231593315943159531596315973159831599316003160131602316033160431605316063160731608316093161031611316123161331614316153161631617316183161931620316213162231623316243162531626316273162831629316303163131632316333163431635316363163731638316393164031641316423164331644316453164631647316483164931650316513165231653316543165531656316573165831659316603166131662316633166431665316663166731668316693167031671316723167331674316753167631677316783167931680316813168231683316843168531686316873168831689316903169131692316933169431695316963169731698316993170031701317023170331704317053170631707317083170931710317113171231713317143171531716317173171831719317203172131722317233172431725317263172731728317293173031731317323173331734317353173631737317383173931740317413174231743317443174531746317473174831749317503175131752317533175431755317563175731758317593176031761317623176331764317653176631767317683176931770317713177231773317743177531776317773177831779317803178131782317833178431785317863178731788317893179031791317923179331794317953179631797317983179931800318013180231803318043180531806318073180831809318103181131812318133181431815318163181731818318193182031821318223182331824318253182631827318283182931830318313183231833318343183531836318373183831839318403184131842318433184431845318463184731848318493185031851318523185331854318553185631857318583185931860318613186231863318643186531866318673186831869318703187131872318733187431875318763187731878318793188031881318823188331884318853188631887318883188931890318913189231893318943189531896318973189831899319003190131902319033190431905319063190731908319093191031911319123191331914319153191631917319183191931920319213192231923319243192531926319273192831929319303193131932319333193431935319363193731938319393194031941319423194331944319453194631947319483194931950319513195231953319543195531956319573195831959319603196131962319633196431965319663196731968319693197031971319723197331974319753197631977319783197931980319813198231983319843198531986319873198831989319903199131992319933199431995319963199731998319993200032001320023200332004320053200632007320083200932010320113201232013320143201532016320173201832019320203202132022320233202432025320263202732028320293203032031320323203332034320353203632037320383203932040320413204232043320443204532046320473204832049320503205132052320533205432055320563205732058320593206032061320623206332064320653206632067320683206932070320713207232073320743207532076320773207832079320803208132082320833208432085320863208732088320893209032091320923209332094320953209632097320983209932100321013210232103321043210532106321073210832109321103211132112321133211432115321163211732118321193212032121321223212332124321253212632127321283212932130321313213232133321343213532136321373213832139321403214132142321433214432145321463214732148321493215032151321523215332154321553215632157321583215932160321613216232163321643216532166321673216832169321703217132172321733217432175321763217732178321793218032181321823218332184321853218632187321883218932190321913219232193321943219532196321973219832199322003220132202322033220432205322063220732208322093221032211322123221332214322153221632217322183221932220322213222232223322243222532226322273222832229322303223132232322333223432235322363223732238322393224032241322423224332244322453224632247322483224932250322513225232253322543225532256322573225832259322603226132262322633226432265322663226732268322693227032271322723227332274322753227632277322783227932280322813228232283322843228532286322873228832289322903229132292322933229432295322963229732298322993230032301323023230332304323053230632307323083230932310323113231232313323143231532316323173231832319323203232132322323233232432325323263232732328323293233032331323323233332334323353233632337323383233932340323413234232343323443234532346323473234832349323503235132352323533235432355323563235732358323593236032361323623236332364323653236632367323683236932370323713237232373323743237532376323773237832379323803238132382323833238432385323863238732388323893239032391323923239332394323953239632397323983239932400324013240232403324043240532406324073240832409324103241132412324133241432415324163241732418324193242032421324223242332424324253242632427324283242932430324313243232433324343243532436324373243832439324403244132442324433244432445324463244732448324493245032451324523245332454324553245632457324583245932460324613246232463324643246532466324673246832469324703247132472324733247432475324763247732478324793248032481324823248332484324853248632487324883248932490324913249232493324943249532496324973249832499325003250132502325033250432505325063250732508325093251032511325123251332514325153251632517325183251932520325213252232523325243252532526325273252832529325303253132532325333253432535325363253732538325393254032541325423254332544325453254632547325483254932550325513255232553325543255532556325573255832559325603256132562325633256432565325663256732568325693257032571325723257332574325753257632577325783257932580325813258232583325843258532586325873258832589325903259132592325933259432595325963259732598325993260032601326023260332604326053260632607326083260932610326113261232613326143261532616326173261832619326203262132622326233262432625326263262732628326293263032631326323263332634326353263632637326383263932640326413264232643326443264532646326473264832649326503265132652326533265432655326563265732658326593266032661326623266332664326653266632667326683266932670326713267232673326743267532676326773267832679326803268132682326833268432685326863268732688326893269032691326923269332694326953269632697326983269932700327013270232703327043270532706327073270832709327103271132712327133271432715327163271732718327193272032721327223272332724327253272632727327283272932730327313273232733327343273532736327373273832739327403274132742327433274432745327463274732748327493275032751327523275332754327553275632757327583275932760327613276232763327643276532766327673276832769327703277132772327733277432775327763277732778327793278032781327823278332784327853278632787327883278932790327913279232793327943279532796327973279832799328003280132802328033280432805328063280732808328093281032811328123281332814328153281632817328183281932820328213282232823328243282532826328273282832829328303283132832328333283432835328363283732838328393284032841328423284332844328453284632847328483284932850328513285232853328543285532856328573285832859328603286132862328633286432865328663286732868328693287032871328723287332874328753287632877328783287932880328813288232883328843288532886328873288832889328903289132892328933289432895328963289732898328993290032901329023290332904329053290632907329083290932910329113291232913329143291532916329173291832919329203292132922329233292432925329263292732928329293293032931329323293332934329353293632937329383293932940329413294232943329443294532946329473294832949329503295132952329533295432955329563295732958329593296032961329623296332964329653296632967329683296932970329713297232973329743297532976329773297832979329803298132982329833298432985329863298732988329893299032991329923299332994329953299632997329983299933000330013300233003330043300533006330073300833009330103301133012330133301433015330163301733018330193302033021330223302333024330253302633027330283302933030330313303233033330343303533036330373303833039330403304133042330433304433045330463304733048330493305033051330523305333054330553305633057330583305933060330613306233063330643306533066330673306833069330703307133072330733307433075330763307733078330793308033081330823308333084330853308633087330883308933090330913309233093330943309533096330973309833099331003310133102331033310433105331063310733108331093311033111331123311333114331153311633117331183311933120331213312233123331243312533126331273312833129331303313133132331333313433135331363313733138331393314033141331423314333144331453314633147331483314933150331513315233153331543315533156331573315833159331603316133162331633316433165331663316733168331693317033171331723317333174331753317633177331783317933180331813318233183331843318533186331873318833189331903319133192331933319433195331963319733198331993320033201332023320333204332053320633207332083320933210332113321233213332143321533216332173321833219332203322133222332233322433225332263322733228332293323033231332323323333234332353323633237332383323933240332413324233243332443324533246332473324833249332503325133252332533325433255332563325733258332593326033261332623326333264332653326633267332683326933270332713327233273332743327533276332773327833279332803328133282332833328433285332863328733288332893329033291332923329333294332953329633297332983329933300333013330233303333043330533306333073330833309333103331133312333133331433315333163331733318333193332033321333223332333324333253332633327333283332933330333313333233333333343333533336333373333833339333403334133342333433334433345333463334733348333493335033351333523335333354333553335633357333583335933360333613336233363333643336533366333673336833369333703337133372333733337433375333763337733378333793338033381333823338333384333853338633387333883338933390333913339233393333943339533396333973339833399334003340133402334033340433405334063340733408334093341033411334123341333414334153341633417334183341933420334213342233423334243342533426334273342833429334303343133432334333343433435334363343733438334393344033441334423344333444334453344633447334483344933450334513345233453334543345533456334573345833459334603346133462334633346433465334663346733468334693347033471334723347333474334753347633477334783347933480334813348233483334843348533486334873348833489334903349133492334933349433495334963349733498334993350033501335023350333504335053350633507335083350933510335113351233513335143351533516335173351833519335203352133522335233352433525335263352733528335293353033531335323353333534335353353633537335383353933540335413354233543335443354533546335473354833549335503355133552335533355433555335563355733558335593356033561335623356333564335653356633567335683356933570335713357233573335743357533576335773357833579335803358133582335833358433585335863358733588335893359033591335923359333594335953359633597335983359933600336013360233603336043360533606336073360833609336103361133612336133361433615336163361733618336193362033621336223362333624336253362633627336283362933630336313363233633336343363533636336373363833639336403364133642336433364433645336463364733648336493365033651336523365333654336553365633657336583365933660336613366233663336643366533666336673366833669336703367133672336733367433675336763367733678336793368033681336823368333684336853368633687336883368933690336913369233693336943369533696336973369833699337003370133702337033370433705337063370733708337093371033711337123371333714337153371633717337183371933720337213372233723337243372533726337273372833729337303373133732337333373433735337363373733738337393374033741337423374333744337453374633747337483374933750337513375233753337543375533756337573375833759337603376133762337633376433765337663376733768337693377033771337723377333774337753377633777337783377933780337813378233783337843378533786337873378833789337903379133792337933379433795337963379733798337993380033801338023380333804338053380633807338083380933810338113381233813338143381533816338173381833819338203382133822338233382433825338263382733828338293383033831338323383333834338353383633837338383383933840338413384233843338443384533846338473384833849338503385133852338533385433855338563385733858338593386033861338623386333864338653386633867338683386933870338713387233873338743387533876338773387833879338803388133882338833388433885338863388733888338893389033891338923389333894338953389633897338983389933900339013390233903339043390533906339073390833909339103391133912339133391433915339163391733918339193392033921339223392333924339253392633927339283392933930339313393233933339343393533936339373393833939339403394133942339433394433945339463394733948339493395033951339523395333954339553395633957339583395933960339613396233963339643396533966339673396833969339703397133972339733397433975339763397733978339793398033981339823398333984339853398633987339883398933990339913399233993339943399533996339973399833999340003400134002340033400434005340063400734008340093401034011340123401334014340153401634017340183401934020340213402234023340243402534026340273402834029340303403134032340333403434035340363403734038340393404034041340423404334044340453404634047340483404934050340513405234053340543405534056340573405834059340603406134062340633406434065340663406734068340693407034071340723407334074340753407634077340783407934080340813408234083340843408534086340873408834089340903409134092340933409434095340963409734098340993410034101341023410334104341053410634107341083410934110341113411234113341143411534116341173411834119341203412134122341233412434125341263412734128341293413034131341323413334134341353413634137341383413934140341413414234143341443414534146341473414834149341503415134152341533415434155341563415734158341593416034161341623416334164341653416634167341683416934170341713417234173341743417534176341773417834179341803418134182341833418434185341863418734188341893419034191341923419334194341953419634197341983419934200342013420234203342043420534206342073420834209342103421134212342133421434215342163421734218342193422034221342223422334224342253422634227342283422934230342313423234233342343423534236342373423834239342403424134242342433424434245342463424734248342493425034251342523425334254342553425634257342583425934260342613426234263342643426534266342673426834269342703427134272342733427434275342763427734278342793428034281342823428334284342853428634287342883428934290342913429234293342943429534296342973429834299343003430134302343033430434305343063430734308343093431034311343123431334314343153431634317343183431934320343213432234323343243432534326343273432834329343303433134332343333433434335343363433734338343393434034341343423434334344343453434634347343483434934350343513435234353343543435534356343573435834359343603436134362343633436434365343663436734368343693437034371343723437334374343753437634377343783437934380343813438234383343843438534386343873438834389343903439134392343933439434395343963439734398343993440034401344023440334404344053440634407344083440934410344113441234413344143441534416344173441834419344203442134422344233442434425344263442734428344293443034431344323443334434344353443634437344383443934440344413444234443344443444534446344473444834449344503445134452344533445434455344563445734458344593446034461344623446334464344653446634467344683446934470344713447234473344743447534476344773447834479344803448134482344833448434485344863448734488344893449034491344923449334494344953449634497344983449934500345013450234503345043450534506345073450834509345103451134512345133451434515345163451734518345193452034521345223452334524345253452634527345283452934530345313453234533345343453534536345373453834539345403454134542345433454434545345463454734548345493455034551345523455334554345553455634557345583455934560345613456234563345643456534566345673456834569345703457134572345733457434575345763457734578345793458034581345823458334584345853458634587345883458934590345913459234593345943459534596345973459834599346003460134602346033460434605346063460734608346093461034611346123461334614346153461634617346183461934620346213462234623346243462534626346273462834629346303463134632346333463434635346363463734638346393464034641346423464334644346453464634647346483464934650346513465234653346543465534656346573465834659346603466134662346633466434665346663466734668346693467034671346723467334674346753467634677346783467934680346813468234683346843468534686346873468834689346903469134692346933469434695346963469734698346993470034701347023470334704347053470634707347083470934710347113471234713347143471534716347173471834719347203472134722347233472434725347263472734728347293473034731347323473334734347353473634737347383473934740347413474234743347443474534746347473474834749347503475134752347533475434755347563475734758347593476034761347623476334764347653476634767347683476934770347713477234773347743477534776347773477834779347803478134782347833478434785347863478734788347893479034791347923479334794347953479634797347983479934800348013480234803348043480534806348073480834809348103481134812348133481434815348163481734818348193482034821348223482334824348253482634827348283482934830348313483234833348343483534836348373483834839348403484134842348433484434845348463484734848348493485034851348523485334854348553485634857348583485934860348613486234863348643486534866348673486834869348703487134872348733487434875348763487734878348793488034881348823488334884348853488634887348883488934890348913489234893348943489534896348973489834899349003490134902349033490434905349063490734908349093491034911349123491334914349153491634917349183491934920349213492234923349243492534926349273492834929349303493134932349333493434935349363493734938349393494034941349423494334944349453494634947349483494934950349513495234953349543495534956349573495834959349603496134962349633496434965349663496734968349693497034971349723497334974349753497634977349783497934980349813498234983349843498534986349873498834989349903499134992349933499434995349963499734998349993500035001350023500335004350053500635007350083500935010350113501235013350143501535016350173501835019350203502135022350233502435025350263502735028350293503035031350323503335034350353503635037350383503935040350413504235043350443504535046350473504835049350503505135052350533505435055350563505735058350593506035061350623506335064350653506635067350683506935070350713507235073350743507535076350773507835079350803508135082350833508435085350863508735088350893509035091350923509335094350953509635097350983509935100351013510235103351043510535106351073510835109351103511135112351133511435115351163511735118351193512035121351223512335124351253512635127351283512935130351313513235133351343513535136351373513835139351403514135142351433514435145351463514735148351493515035151351523515335154351553515635157351583515935160351613516235163351643516535166351673516835169351703517135172351733517435175351763517735178351793518035181351823518335184351853518635187351883518935190351913519235193351943519535196351973519835199352003520135202352033520435205352063520735208352093521035211352123521335214352153521635217352183521935220352213522235223352243522535226352273522835229352303523135232352333523435235352363523735238352393524035241352423524335244352453524635247352483524935250352513525235253352543525535256352573525835259352603526135262352633526435265352663526735268352693527035271352723527335274352753527635277352783527935280352813528235283352843528535286352873528835289352903529135292352933529435295352963529735298352993530035301353023530335304353053530635307353083530935310353113531235313353143531535316353173531835319353203532135322353233532435325353263532735328353293533035331353323533335334353353533635337353383533935340353413534235343353443534535346353473534835349353503535135352353533535435355353563535735358353593536035361353623536335364353653536635367353683536935370353713537235373353743537535376353773537835379353803538135382353833538435385353863538735388353893539035391353923539335394353953539635397353983539935400354013540235403354043540535406354073540835409354103541135412354133541435415354163541735418354193542035421354223542335424354253542635427354283542935430354313543235433354343543535436354373543835439354403544135442354433544435445354463544735448354493545035451354523545335454354553545635457354583545935460354613546235463354643546535466354673546835469354703547135472354733547435475354763547735478354793548035481354823548335484354853548635487354883548935490354913549235493354943549535496354973549835499355003550135502355033550435505355063550735508355093551035511355123551335514355153551635517355183551935520355213552235523355243552535526355273552835529355303553135532355333553435535355363553735538355393554035541355423554335544355453554635547355483554935550355513555235553355543555535556355573555835559355603556135562355633556435565355663556735568355693557035571355723557335574355753557635577355783557935580355813558235583355843558535586355873558835589355903559135592355933559435595355963559735598355993560035601356023560335604356053560635607356083560935610356113561235613356143561535616356173561835619356203562135622356233562435625356263562735628356293563035631356323563335634356353563635637356383563935640356413564235643356443564535646356473564835649356503565135652356533565435655356563565735658356593566035661356623566335664356653566635667356683566935670356713567235673356743567535676356773567835679356803568135682356833568435685356863568735688356893569035691356923569335694356953569635697356983569935700357013570235703357043570535706357073570835709357103571135712357133571435715357163571735718357193572035721357223572335724357253572635727357283572935730357313573235733357343573535736357373573835739357403574135742357433574435745357463574735748357493575035751357523575335754357553575635757357583575935760357613576235763357643576535766357673576835769357703577135772357733577435775357763577735778357793578035781357823578335784357853578635787357883578935790357913579235793357943579535796357973579835799358003580135802358033580435805358063580735808358093581035811358123581335814358153581635817358183581935820358213582235823358243582535826358273582835829358303583135832358333583435835358363583735838358393584035841358423584335844358453584635847358483584935850358513585235853358543585535856358573585835859358603586135862358633586435865358663586735868358693587035871358723587335874358753587635877358783587935880358813588235883358843588535886358873588835889358903589135892358933589435895358963589735898358993590035901359023590335904359053590635907359083590935910359113591235913359143591535916359173591835919359203592135922359233592435925359263592735928359293593035931359323593335934359353593635937359383593935940359413594235943359443594535946359473594835949359503595135952359533595435955359563595735958359593596035961359623596335964359653596635967359683596935970359713597235973359743597535976359773597835979359803598135982359833598435985359863598735988359893599035991359923599335994359953599635997359983599936000360013600236003360043600536006360073600836009360103601136012360133601436015360163601736018360193602036021360223602336024360253602636027360283602936030360313603236033360343603536036360373603836039360403604136042360433604436045360463604736048360493605036051360523605336054360553605636057360583605936060360613606236063360643606536066360673606836069360703607136072360733607436075360763607736078360793608036081360823608336084360853608636087360883608936090360913609236093360943609536096360973609836099361003610136102361033610436105361063610736108361093611036111361123611336114361153611636117361183611936120361213612236123361243612536126361273612836129361303613136132361333613436135361363613736138361393614036141361423614336144361453614636147361483614936150361513615236153361543615536156361573615836159361603616136162361633616436165361663616736168361693617036171361723617336174361753617636177361783617936180361813618236183361843618536186361873618836189361903619136192361933619436195361963619736198361993620036201362023620336204362053620636207362083620936210362113621236213362143621536216362173621836219362203622136222362233622436225362263622736228362293623036231362323623336234362353623636237362383623936240362413624236243362443624536246362473624836249362503625136252362533625436255362563625736258362593626036261362623626336264362653626636267362683626936270362713627236273362743627536276362773627836279362803628136282362833628436285362863628736288362893629036291362923629336294362953629636297362983629936300363013630236303363043630536306363073630836309363103631136312363133631436315363163631736318363193632036321363223632336324363253632636327363283632936330363313633236333363343633536336363373633836339363403634136342363433634436345363463634736348363493635036351363523635336354363553635636357363583635936360363613636236363363643636536366363673636836369363703637136372363733637436375363763637736378363793638036381363823638336384363853638636387363883638936390363913639236393363943639536396363973639836399364003640136402364033640436405364063640736408364093641036411364123641336414364153641636417364183641936420364213642236423364243642536426364273642836429364303643136432364333643436435364363643736438364393644036441364423644336444364453644636447364483644936450364513645236453364543645536456364573645836459364603646136462364633646436465364663646736468364693647036471364723647336474364753647636477364783647936480364813648236483364843648536486364873648836489364903649136492364933649436495364963649736498364993650036501365023650336504365053650636507365083650936510365113651236513365143651536516365173651836519365203652136522365233652436525365263652736528365293653036531365323653336534365353653636537365383653936540365413654236543365443654536546365473654836549365503655136552365533655436555365563655736558365593656036561365623656336564365653656636567365683656936570365713657236573365743657536576365773657836579365803658136582365833658436585365863658736588365893659036591365923659336594365953659636597365983659936600366013660236603366043660536606366073660836609366103661136612366133661436615366163661736618366193662036621366223662336624366253662636627366283662936630366313663236633366343663536636366373663836639366403664136642366433664436645366463664736648366493665036651366523665336654366553665636657366583665936660366613666236663366643666536666366673666836669366703667136672366733667436675366763667736678366793668036681366823668336684366853668636687366883668936690366913669236693366943669536696366973669836699367003670136702367033670436705367063670736708367093671036711367123671336714367153671636717367183671936720367213672236723367243672536726367273672836729367303673136732367333673436735367363673736738367393674036741367423674336744367453674636747367483674936750367513675236753367543675536756367573675836759367603676136762367633676436765367663676736768367693677036771367723677336774367753677636777367783677936780367813678236783367843678536786367873678836789367903679136792367933679436795367963679736798367993680036801368023680336804368053680636807368083680936810368113681236813368143681536816368173681836819368203682136822368233682436825368263682736828368293683036831368323683336834368353683636837368383683936840368413684236843368443684536846368473684836849368503685136852368533685436855368563685736858368593686036861368623686336864368653686636867368683686936870368713687236873368743687536876368773687836879368803688136882368833688436885368863688736888368893689036891368923689336894368953689636897368983689936900369013690236903369043690536906369073690836909369103691136912369133691436915369163691736918369193692036921369223692336924369253692636927369283692936930369313693236933369343693536936369373693836939369403694136942369433694436945369463694736948369493695036951369523695336954369553695636957369583695936960369613696236963369643696536966369673696836969369703697136972369733697436975369763697736978369793698036981369823698336984369853698636987369883698936990369913699236993369943699536996369973699836999370003700137002370033700437005370063700737008370093701037011370123701337014370153701637017370183701937020370213702237023370243702537026370273702837029370303703137032370333703437035370363703737038370393704037041370423704337044370453704637047370483704937050370513705237053370543705537056370573705837059370603706137062370633706437065370663706737068370693707037071370723707337074370753707637077370783707937080370813708237083370843708537086370873708837089370903709137092370933709437095370963709737098370993710037101371023710337104371053710637107371083710937110371113711237113371143711537116371173711837119371203712137122371233712437125371263712737128371293713037131371323713337134371353713637137371383713937140371413714237143371443714537146371473714837149371503715137152371533715437155371563715737158371593716037161371623716337164371653716637167371683716937170371713717237173371743717537176371773717837179371803718137182371833718437185371863718737188371893719037191371923719337194371953719637197371983719937200372013720237203372043720537206372073720837209372103721137212372133721437215372163721737218372193722037221372223722337224372253722637227372283722937230372313723237233372343723537236372373723837239372403724137242372433724437245372463724737248372493725037251372523725337254372553725637257372583725937260372613726237263372643726537266372673726837269372703727137272372733727437275372763727737278372793728037281372823728337284372853728637287372883728937290372913729237293372943729537296372973729837299373003730137302373033730437305373063730737308373093731037311373123731337314373153731637317373183731937320373213732237323373243732537326373273732837329373303733137332373333733437335373363733737338373393734037341373423734337344373453734637347373483734937350373513735237353373543735537356373573735837359373603736137362373633736437365373663736737368373693737037371373723737337374373753737637377373783737937380373813738237383373843738537386373873738837389373903739137392373933739437395373963739737398373993740037401374023740337404374053740637407374083740937410374113741237413374143741537416374173741837419374203742137422374233742437425374263742737428374293743037431374323743337434374353743637437374383743937440374413744237443374443744537446374473744837449374503745137452374533745437455374563745737458374593746037461374623746337464374653746637467374683746937470374713747237473374743747537476374773747837479374803748137482374833748437485374863748737488374893749037491374923749337494374953749637497374983749937500375013750237503375043750537506375073750837509375103751137512375133751437515375163751737518375193752037521375223752337524375253752637527375283752937530375313753237533375343753537536375373753837539375403754137542375433754437545375463754737548375493755037551375523755337554375553755637557375583755937560375613756237563375643756537566375673756837569375703757137572375733757437575375763757737578375793758037581375823758337584375853758637587375883758937590375913759237593375943759537596375973759837599376003760137602376033760437605376063760737608376093761037611376123761337614376153761637617376183761937620376213762237623376243762537626376273762837629376303763137632376333763437635376363763737638376393764037641376423764337644376453764637647376483764937650376513765237653376543765537656376573765837659376603766137662376633766437665376663766737668376693767037671376723767337674376753767637677376783767937680376813768237683376843768537686376873768837689376903769137692376933769437695376963769737698376993770037701377023770337704377053770637707377083770937710377113771237713377143771537716377173771837719377203772137722377233772437725377263772737728377293773037731377323773337734377353773637737377383773937740377413774237743377443774537746377473774837749377503775137752377533775437755377563775737758377593776037761377623776337764377653776637767377683776937770377713777237773377743777537776377773777837779377803778137782377833778437785377863778737788377893779037791377923779337794377953779637797377983779937800378013780237803378043780537806378073780837809378103781137812378133781437815378163781737818378193782037821378223782337824378253782637827378283782937830378313783237833378343783537836378373783837839378403784137842378433784437845378463784737848378493785037851378523785337854378553785637857378583785937860378613786237863378643786537866378673786837869378703787137872378733787437875378763787737878378793788037881378823788337884378853788637887378883788937890378913789237893378943789537896378973789837899379003790137902379033790437905379063790737908379093791037911379123791337914379153791637917379183791937920379213792237923379243792537926379273792837929379303793137932379333793437935379363793737938379393794037941379423794337944379453794637947379483794937950379513795237953379543795537956379573795837959379603796137962379633796437965379663796737968379693797037971379723797337974379753797637977379783797937980379813798237983379843798537986379873798837989379903799137992379933799437995379963799737998379993800038001380023800338004380053800638007380083800938010380113801238013380143801538016380173801838019380203802138022380233802438025380263802738028380293803038031380323803338034380353803638037380383803938040380413804238043380443804538046380473804838049380503805138052380533805438055380563805738058380593806038061380623806338064380653806638067380683806938070380713807238073380743807538076380773807838079380803808138082380833808438085380863808738088380893809038091380923809338094380953809638097380983809938100381013810238103381043810538106381073810838109381103811138112381133811438115381163811738118381193812038121381223812338124381253812638127381283812938130381313813238133381343813538136381373813838139381403814138142381433814438145381463814738148381493815038151381523815338154381553815638157381583815938160381613816238163381643816538166381673816838169381703817138172381733817438175381763817738178381793818038181381823818338184381853818638187381883818938190381913819238193
  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.fileExistsSync = exports.existsSync = exports.directoryExistsSync = void 0;
  31. const fs = __importStar(__nccwpck_require__(7147));
  32. function directoryExistsSync(path, required) {
  33. var _a;
  34. if (!path) {
  35. throw new Error("Arg 'path' must not be empty");
  36. }
  37. let stats;
  38. try {
  39. stats = fs.statSync(path);
  40. }
  41. catch (error) {
  42. if ((error === null || error === void 0 ? void 0 : error.code) === 'ENOENT') {
  43. if (!required) {
  44. return false;
  45. }
  46. throw new Error(`Directory '${path}' does not exist`);
  47. }
  48. 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}`);
  49. }
  50. if (stats.isDirectory()) {
  51. return true;
  52. }
  53. else if (!required) {
  54. return false;
  55. }
  56. throw new Error(`Directory '${path}' does not exist`);
  57. }
  58. exports.directoryExistsSync = directoryExistsSync;
  59. function existsSync(path) {
  60. var _a;
  61. if (!path) {
  62. throw new Error("Arg 'path' must not be empty");
  63. }
  64. try {
  65. fs.statSync(path);
  66. }
  67. catch (error) {
  68. if ((error === null || error === void 0 ? void 0 : error.code) === 'ENOENT') {
  69. return false;
  70. }
  71. 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}`);
  72. }
  73. return true;
  74. }
  75. exports.existsSync = existsSync;
  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. exports.fileExistsSync = fileExistsSync;
  97. /***/ }),
  98. /***/ 2565:
  99. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  100. "use strict";
  101. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  102. if (k2 === undefined) k2 = k;
  103. var desc = Object.getOwnPropertyDescriptor(m, k);
  104. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  105. desc = { enumerable: true, get: function() { return m[k]; } };
  106. }
  107. Object.defineProperty(o, k2, desc);
  108. }) : (function(o, m, k, k2) {
  109. if (k2 === undefined) k2 = k;
  110. o[k2] = m[k];
  111. }));
  112. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  113. Object.defineProperty(o, "default", { enumerable: true, value: v });
  114. }) : function(o, v) {
  115. o["default"] = v;
  116. });
  117. var __importStar = (this && this.__importStar) || function (mod) {
  118. if (mod && mod.__esModule) return mod;
  119. var result = {};
  120. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  121. __setModuleDefault(result, mod);
  122. return result;
  123. };
  124. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  125. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  126. return new (P || (P = Promise))(function (resolve, reject) {
  127. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  128. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  129. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  130. step((generator = generator.apply(thisArg, _arguments || [])).next());
  131. });
  132. };
  133. Object.defineProperty(exports, "__esModule", ({ value: true }));
  134. exports.createAuthHelper = void 0;
  135. const assert = __importStar(__nccwpck_require__(9491));
  136. const core = __importStar(__nccwpck_require__(2186));
  137. const exec = __importStar(__nccwpck_require__(1514));
  138. const fs = __importStar(__nccwpck_require__(7147));
  139. const io = __importStar(__nccwpck_require__(7436));
  140. const os = __importStar(__nccwpck_require__(2037));
  141. const path = __importStar(__nccwpck_require__(1017));
  142. const regexpHelper = __importStar(__nccwpck_require__(3120));
  143. const stateHelper = __importStar(__nccwpck_require__(4866));
  144. const urlHelper = __importStar(__nccwpck_require__(9437));
  145. const uuid_1 = __nccwpck_require__(5840);
  146. const IS_WINDOWS = process.platform === 'win32';
  147. const SSH_COMMAND_KEY = 'core.sshCommand';
  148. function createAuthHelper(git, settings) {
  149. return new GitAuthHelper(git, settings);
  150. }
  151. exports.createAuthHelper = createAuthHelper;
  152. class GitAuthHelper {
  153. constructor(gitCommandManager, gitSourceSettings) {
  154. this.insteadOfValues = [];
  155. this.sshCommand = '';
  156. this.sshKeyPath = '';
  157. this.sshKnownHostsPath = '';
  158. this.temporaryHomePath = '';
  159. this.git = gitCommandManager;
  160. this.settings = gitSourceSettings || {};
  161. // Token auth header
  162. const serverUrl = urlHelper.getServerUrl(this.settings.githubServerUrl);
  163. this.tokenConfigKey = `http.${serverUrl.origin}/.extraheader`; // "origin" is SCHEME://HOSTNAME[:PORT]
  164. const basicCredential = Buffer.from(`x-access-token:${this.settings.authToken}`, 'utf8').toString('base64');
  165. core.setSecret(basicCredential);
  166. this.tokenPlaceholderConfigValue = `AUTHORIZATION: basic ***`;
  167. this.tokenConfigValue = `AUTHORIZATION: basic ${basicCredential}`;
  168. // Instead of SSH URL
  169. this.insteadOfKey = `url.${serverUrl.origin}/.insteadOf`; // "origin" is SCHEME://HOSTNAME[:PORT]
  170. this.insteadOfValues.push(`git@${serverUrl.hostname}:`);
  171. if (this.settings.workflowOrganizationId) {
  172. this.insteadOfValues.push(`org-${this.settings.workflowOrganizationId}@github.com:`);
  173. }
  174. }
  175. configureAuth() {
  176. return __awaiter(this, void 0, void 0, function* () {
  177. // Remove possible previous values
  178. yield this.removeAuth();
  179. // Configure new values
  180. yield this.configureSsh();
  181. yield this.configureToken();
  182. });
  183. }
  184. configureTempGlobalConfig() {
  185. return __awaiter(this, void 0, void 0, function* () {
  186. var _a;
  187. // Already setup global config
  188. if (((_a = this.temporaryHomePath) === null || _a === void 0 ? void 0 : _a.length) > 0) {
  189. return path.join(this.temporaryHomePath, '.gitconfig');
  190. }
  191. // Create a temp home directory
  192. const runnerTemp = process.env['RUNNER_TEMP'] || '';
  193. assert.ok(runnerTemp, 'RUNNER_TEMP is not defined');
  194. const uniqueId = (0, uuid_1.v4)();
  195. this.temporaryHomePath = path.join(runnerTemp, uniqueId);
  196. yield fs.promises.mkdir(this.temporaryHomePath, { recursive: true });
  197. // Copy the global git config
  198. const gitConfigPath = path.join(process.env['HOME'] || os.homedir(), '.gitconfig');
  199. const newGitConfigPath = path.join(this.temporaryHomePath, '.gitconfig');
  200. let configExists = false;
  201. try {
  202. yield fs.promises.stat(gitConfigPath);
  203. configExists = true;
  204. }
  205. catch (err) {
  206. if ((err === null || err === void 0 ? void 0 : err.code) !== 'ENOENT') {
  207. throw err;
  208. }
  209. }
  210. if (configExists) {
  211. core.info(`Copying '${gitConfigPath}' to '${newGitConfigPath}'`);
  212. yield io.cp(gitConfigPath, newGitConfigPath);
  213. }
  214. else {
  215. yield fs.promises.writeFile(newGitConfigPath, '');
  216. }
  217. // Override HOME
  218. core.info(`Temporarily overriding HOME='${this.temporaryHomePath}' before making global git config changes`);
  219. this.git.setEnvironmentVariable('HOME', this.temporaryHomePath);
  220. return newGitConfigPath;
  221. });
  222. }
  223. configureGlobalAuth() {
  224. return __awaiter(this, void 0, void 0, function* () {
  225. // 'configureTempGlobalConfig' noops if already set, just returns the path
  226. const newGitConfigPath = yield this.configureTempGlobalConfig();
  227. try {
  228. // Configure the token
  229. yield this.configureToken(newGitConfigPath, true);
  230. // Configure HTTPS instead of SSH
  231. yield this.git.tryConfigUnset(this.insteadOfKey, true);
  232. if (!this.settings.sshKey) {
  233. for (const insteadOfValue of this.insteadOfValues) {
  234. yield this.git.config(this.insteadOfKey, insteadOfValue, true, true);
  235. }
  236. }
  237. }
  238. catch (err) {
  239. // Unset in case somehow written to the real global config
  240. core.info('Encountered an error when attempting to configure token. Attempting unconfigure.');
  241. yield this.git.tryConfigUnset(this.tokenConfigKey, true);
  242. throw err;
  243. }
  244. });
  245. }
  246. configureSubmoduleAuth() {
  247. return __awaiter(this, void 0, void 0, function* () {
  248. // Remove possible previous HTTPS instead of SSH
  249. yield this.removeGitConfig(this.insteadOfKey, true);
  250. if (this.settings.persistCredentials) {
  251. // Configure a placeholder value. This approach avoids the credential being captured
  252. // by process creation audit events, which are commonly logged. For more information,
  253. // refer to https://docs.microsoft.com/en-us/windows-server/identity/ad-ds/manage/component-updates/command-line-process-auditing
  254. const output = yield this.git.submoduleForeach(
  255. // wrap the pipeline in quotes to make sure it's handled properly by submoduleForeach, rather than just the first part of the pipeline
  256. `sh -c "git config --local '${this.tokenConfigKey}' '${this.tokenPlaceholderConfigValue}' && git config --local --show-origin --name-only --get-regexp remote.origin.url"`, this.settings.nestedSubmodules);
  257. // Replace the placeholder
  258. const configPaths = output.match(/(?<=(^|\n)file:)[^\t]+(?=\tremote\.origin\.url)/g) || [];
  259. for (const configPath of configPaths) {
  260. core.debug(`Replacing token placeholder in '${configPath}'`);
  261. yield this.replaceTokenPlaceholder(configPath);
  262. }
  263. if (this.settings.sshKey) {
  264. // Configure core.sshCommand
  265. yield this.git.submoduleForeach(`git config --local '${SSH_COMMAND_KEY}' '${this.sshCommand}'`, this.settings.nestedSubmodules);
  266. }
  267. else {
  268. // Configure HTTPS instead of SSH
  269. for (const insteadOfValue of this.insteadOfValues) {
  270. yield this.git.submoduleForeach(`git config --local --add '${this.insteadOfKey}' '${insteadOfValue}'`, this.settings.nestedSubmodules);
  271. }
  272. }
  273. }
  274. });
  275. }
  276. removeAuth() {
  277. return __awaiter(this, void 0, void 0, function* () {
  278. yield this.removeSsh();
  279. yield this.removeToken();
  280. });
  281. }
  282. removeGlobalConfig() {
  283. return __awaiter(this, void 0, void 0, function* () {
  284. var _a;
  285. if (((_a = this.temporaryHomePath) === null || _a === void 0 ? void 0 : _a.length) > 0) {
  286. core.debug(`Unsetting HOME override`);
  287. this.git.removeEnvironmentVariable('HOME');
  288. yield io.rmRF(this.temporaryHomePath);
  289. }
  290. });
  291. }
  292. configureSsh() {
  293. return __awaiter(this, void 0, void 0, function* () {
  294. if (!this.settings.sshKey) {
  295. return;
  296. }
  297. // Write key
  298. const runnerTemp = process.env['RUNNER_TEMP'] || '';
  299. assert.ok(runnerTemp, 'RUNNER_TEMP is not defined');
  300. const uniqueId = (0, uuid_1.v4)();
  301. this.sshKeyPath = path.join(runnerTemp, uniqueId);
  302. stateHelper.setSshKeyPath(this.sshKeyPath);
  303. yield fs.promises.mkdir(runnerTemp, { recursive: true });
  304. yield fs.promises.writeFile(this.sshKeyPath, this.settings.sshKey.trim() + '\n', { mode: 0o600 });
  305. // Remove inherited permissions on Windows
  306. if (IS_WINDOWS) {
  307. const icacls = yield io.which('icacls.exe');
  308. yield exec.exec(`"${icacls}" "${this.sshKeyPath}" /grant:r "${process.env['USERDOMAIN']}\\${process.env['USERNAME']}:F"`);
  309. yield exec.exec(`"${icacls}" "${this.sshKeyPath}" /inheritance:r`);
  310. }
  311. // Write known hosts
  312. const userKnownHostsPath = path.join(os.homedir(), '.ssh', 'known_hosts');
  313. let userKnownHosts = '';
  314. try {
  315. userKnownHosts = (yield fs.promises.readFile(userKnownHostsPath)).toString();
  316. }
  317. catch (err) {
  318. if ((err === null || err === void 0 ? void 0 : err.code) !== 'ENOENT') {
  319. throw err;
  320. }
  321. }
  322. let knownHosts = '';
  323. if (userKnownHosts) {
  324. knownHosts += `# Begin from ${userKnownHostsPath}\n${userKnownHosts}\n# End from ${userKnownHostsPath}\n`;
  325. }
  326. if (this.settings.sshKnownHosts) {
  327. knownHosts += `# Begin from input known hosts\n${this.settings.sshKnownHosts}\n# end from input known hosts\n`;
  328. }
  329. 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`;
  330. this.sshKnownHostsPath = path.join(runnerTemp, `${uniqueId}_known_hosts`);
  331. stateHelper.setSshKnownHostsPath(this.sshKnownHostsPath);
  332. yield fs.promises.writeFile(this.sshKnownHostsPath, knownHosts);
  333. // Configure GIT_SSH_COMMAND
  334. const sshPath = yield io.which('ssh', true);
  335. this.sshCommand = `"${sshPath}" -i "$RUNNER_TEMP/${path.basename(this.sshKeyPath)}"`;
  336. if (this.settings.sshStrict) {
  337. this.sshCommand += ' -o StrictHostKeyChecking=yes -o CheckHostIP=no';
  338. }
  339. this.sshCommand += ` -o "UserKnownHostsFile=$RUNNER_TEMP/${path.basename(this.sshKnownHostsPath)}"`;
  340. core.info(`Temporarily overriding GIT_SSH_COMMAND=${this.sshCommand}`);
  341. this.git.setEnvironmentVariable('GIT_SSH_COMMAND', this.sshCommand);
  342. // Configure core.sshCommand
  343. if (this.settings.persistCredentials) {
  344. yield this.git.config(SSH_COMMAND_KEY, this.sshCommand);
  345. }
  346. });
  347. }
  348. configureToken(configPath, globalConfig) {
  349. return __awaiter(this, void 0, void 0, function* () {
  350. // Validate args
  351. assert.ok((configPath && globalConfig) || (!configPath && !globalConfig), 'Unexpected configureToken parameter combinations');
  352. // Default config path
  353. if (!configPath && !globalConfig) {
  354. configPath = path.join(this.git.getWorkingDirectory(), '.git', 'config');
  355. }
  356. // Configure a placeholder value. This approach avoids the credential being captured
  357. // by process creation audit events, which are commonly logged. For more information,
  358. // refer to https://docs.microsoft.com/en-us/windows-server/identity/ad-ds/manage/component-updates/command-line-process-auditing
  359. yield this.git.config(this.tokenConfigKey, this.tokenPlaceholderConfigValue, globalConfig);
  360. // Replace the placeholder
  361. yield this.replaceTokenPlaceholder(configPath || '');
  362. });
  363. }
  364. replaceTokenPlaceholder(configPath) {
  365. return __awaiter(this, void 0, void 0, function* () {
  366. assert.ok(configPath, 'configPath is not defined');
  367. let content = (yield fs.promises.readFile(configPath)).toString();
  368. const placeholderIndex = content.indexOf(this.tokenPlaceholderConfigValue);
  369. if (placeholderIndex < 0 ||
  370. placeholderIndex != content.lastIndexOf(this.tokenPlaceholderConfigValue)) {
  371. throw new Error(`Unable to replace auth placeholder in ${configPath}`);
  372. }
  373. assert.ok(this.tokenConfigValue, 'tokenConfigValue is not defined');
  374. content = content.replace(this.tokenPlaceholderConfigValue, this.tokenConfigValue);
  375. yield fs.promises.writeFile(configPath, content);
  376. });
  377. }
  378. removeSsh() {
  379. return __awaiter(this, void 0, void 0, function* () {
  380. var _a;
  381. // SSH key
  382. const keyPath = this.sshKeyPath || stateHelper.SshKeyPath;
  383. if (keyPath) {
  384. try {
  385. yield io.rmRF(keyPath);
  386. }
  387. catch (err) {
  388. core.debug(`${(_a = err === null || err === void 0 ? void 0 : err.message) !== null && _a !== void 0 ? _a : err}`);
  389. core.warning(`Failed to remove SSH key '${keyPath}'`);
  390. }
  391. }
  392. // SSH known hosts
  393. const knownHostsPath = this.sshKnownHostsPath || stateHelper.SshKnownHostsPath;
  394. if (knownHostsPath) {
  395. try {
  396. yield io.rmRF(knownHostsPath);
  397. }
  398. catch (_b) {
  399. // Intentionally empty
  400. }
  401. }
  402. // SSH command
  403. yield this.removeGitConfig(SSH_COMMAND_KEY);
  404. });
  405. }
  406. removeToken() {
  407. return __awaiter(this, void 0, void 0, function* () {
  408. // HTTP extra header
  409. yield this.removeGitConfig(this.tokenConfigKey);
  410. });
  411. }
  412. removeGitConfig(configKey_1) {
  413. return __awaiter(this, arguments, void 0, function* (configKey, submoduleOnly = false) {
  414. if (!submoduleOnly) {
  415. if ((yield this.git.configExists(configKey)) &&
  416. !(yield this.git.tryConfigUnset(configKey))) {
  417. // Load the config contents
  418. core.warning(`Failed to remove '${configKey}' from the git config`);
  419. }
  420. }
  421. const pattern = regexpHelper.escape(configKey);
  422. yield this.git.submoduleForeach(
  423. // wrap the pipeline in quotes to make sure it's handled properly by submoduleForeach, rather than just the first part of the pipeline
  424. `sh -c "git config --local --name-only --get-regexp '${pattern}' && git config --local --unset-all '${configKey}' || :"`, true);
  425. });
  426. }
  427. }
  428. /***/ }),
  429. /***/ 738:
  430. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  431. "use strict";
  432. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  433. if (k2 === undefined) k2 = k;
  434. var desc = Object.getOwnPropertyDescriptor(m, k);
  435. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  436. desc = { enumerable: true, get: function() { return m[k]; } };
  437. }
  438. Object.defineProperty(o, k2, desc);
  439. }) : (function(o, m, k, k2) {
  440. if (k2 === undefined) k2 = k;
  441. o[k2] = m[k];
  442. }));
  443. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  444. Object.defineProperty(o, "default", { enumerable: true, value: v });
  445. }) : function(o, v) {
  446. o["default"] = v;
  447. });
  448. var __importStar = (this && this.__importStar) || function (mod) {
  449. if (mod && mod.__esModule) return mod;
  450. var result = {};
  451. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  452. __setModuleDefault(result, mod);
  453. return result;
  454. };
  455. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  456. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  457. return new (P || (P = Promise))(function (resolve, reject) {
  458. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  459. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  460. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  461. step((generator = generator.apply(thisArg, _arguments || [])).next());
  462. });
  463. };
  464. Object.defineProperty(exports, "__esModule", ({ value: true }));
  465. exports.createCommandManager = exports.MinimumGitSparseCheckoutVersion = exports.MinimumGitVersion = void 0;
  466. const core = __importStar(__nccwpck_require__(2186));
  467. const exec = __importStar(__nccwpck_require__(1514));
  468. const fs = __importStar(__nccwpck_require__(7147));
  469. const fshelper = __importStar(__nccwpck_require__(7219));
  470. const io = __importStar(__nccwpck_require__(7436));
  471. const path = __importStar(__nccwpck_require__(1017));
  472. const refHelper = __importStar(__nccwpck_require__(8601));
  473. const regexpHelper = __importStar(__nccwpck_require__(3120));
  474. const retryHelper = __importStar(__nccwpck_require__(2155));
  475. const git_version_1 = __nccwpck_require__(3142);
  476. // Auth header not supported before 2.9
  477. // Wire protocol v2 not supported before 2.18
  478. // sparse-checkout not [well-]supported before 2.28 (see https://github.com/actions/checkout/issues/1386)
  479. exports.MinimumGitVersion = new git_version_1.GitVersion('2.18');
  480. exports.MinimumGitSparseCheckoutVersion = new git_version_1.GitVersion('2.28');
  481. function createCommandManager(workingDirectory, lfs, doSparseCheckout) {
  482. return __awaiter(this, void 0, void 0, function* () {
  483. return yield GitCommandManager.createCommandManager(workingDirectory, lfs, doSparseCheckout);
  484. });
  485. }
  486. exports.createCommandManager = createCommandManager;
  487. class GitCommandManager {
  488. // Private constructor; use createCommandManager()
  489. constructor() {
  490. this.gitEnv = {
  491. GIT_TERMINAL_PROMPT: '0', // Disable git prompt
  492. GCM_INTERACTIVE: 'Never' // Disable prompting for git credential manager
  493. };
  494. this.gitPath = '';
  495. this.lfs = false;
  496. this.doSparseCheckout = false;
  497. this.workingDirectory = '';
  498. this.gitVersion = new git_version_1.GitVersion();
  499. }
  500. branchDelete(remote, branch) {
  501. return __awaiter(this, void 0, void 0, function* () {
  502. const args = ['branch', '--delete', '--force'];
  503. if (remote) {
  504. args.push('--remote');
  505. }
  506. args.push(branch);
  507. yield this.execGit(args);
  508. });
  509. }
  510. branchExists(remote, pattern) {
  511. return __awaiter(this, void 0, void 0, function* () {
  512. const args = ['branch', '--list'];
  513. if (remote) {
  514. args.push('--remote');
  515. }
  516. args.push(pattern);
  517. const output = yield this.execGit(args);
  518. return !!output.stdout.trim();
  519. });
  520. }
  521. branchList(remote) {
  522. return __awaiter(this, void 0, void 0, function* () {
  523. const result = [];
  524. // Note, this implementation uses "rev-parse --symbolic-full-name" because the output from
  525. // "branch --list" is more difficult when in a detached HEAD state.
  526. // TODO(https://github.com/actions/checkout/issues/786): this implementation uses
  527. // "rev-parse --symbolic-full-name" because there is a bug
  528. // in Git 2.18 that causes "rev-parse --symbolic" to output symbolic full names. When
  529. // 2.18 is no longer supported, we can switch back to --symbolic.
  530. const args = ['rev-parse', '--symbolic-full-name'];
  531. if (remote) {
  532. args.push('--remotes=origin');
  533. }
  534. else {
  535. args.push('--branches');
  536. }
  537. const stderr = [];
  538. const errline = [];
  539. const stdout = [];
  540. const stdline = [];
  541. const listeners = {
  542. stderr: (data) => {
  543. stderr.push(data.toString());
  544. },
  545. errline: (data) => {
  546. errline.push(data.toString());
  547. },
  548. stdout: (data) => {
  549. stdout.push(data.toString());
  550. },
  551. stdline: (data) => {
  552. stdline.push(data.toString());
  553. }
  554. };
  555. // Suppress the output in order to avoid flooding annotations with innocuous errors.
  556. yield this.execGit(args, false, true, listeners);
  557. core.debug(`stderr callback is: ${stderr}`);
  558. core.debug(`errline callback is: ${errline}`);
  559. core.debug(`stdout callback is: ${stdout}`);
  560. core.debug(`stdline callback is: ${stdline}`);
  561. for (let branch of stdline) {
  562. branch = branch.trim();
  563. if (!branch) {
  564. continue;
  565. }
  566. if (branch.startsWith('refs/heads/')) {
  567. branch = branch.substring('refs/heads/'.length);
  568. }
  569. else if (branch.startsWith('refs/remotes/')) {
  570. branch = branch.substring('refs/remotes/'.length);
  571. }
  572. result.push(branch);
  573. }
  574. return result;
  575. });
  576. }
  577. disableSparseCheckout() {
  578. return __awaiter(this, void 0, void 0, function* () {
  579. yield this.execGit(['sparse-checkout', 'disable']);
  580. // Disabling 'sparse-checkout` leaves behind an undesirable side-effect in config (even in a pristine environment).
  581. yield this.tryConfigUnset('extensions.worktreeConfig', false);
  582. });
  583. }
  584. sparseCheckout(sparseCheckout) {
  585. return __awaiter(this, void 0, void 0, function* () {
  586. yield this.execGit(['sparse-checkout', 'set', ...sparseCheckout]);
  587. });
  588. }
  589. sparseCheckoutNonConeMode(sparseCheckout) {
  590. return __awaiter(this, void 0, void 0, function* () {
  591. yield this.execGit(['config', 'core.sparseCheckout', 'true']);
  592. const output = yield this.execGit([
  593. 'rev-parse',
  594. '--git-path',
  595. 'info/sparse-checkout'
  596. ]);
  597. const sparseCheckoutPath = path.join(this.workingDirectory, output.stdout.trimRight());
  598. yield fs.promises.appendFile(sparseCheckoutPath, `\n${sparseCheckout.join('\n')}\n`);
  599. });
  600. }
  601. checkout(ref, startPoint) {
  602. return __awaiter(this, void 0, void 0, function* () {
  603. const args = ['checkout', '--progress', '--force'];
  604. if (startPoint) {
  605. args.push('-B', ref, startPoint);
  606. }
  607. else {
  608. args.push(ref);
  609. }
  610. yield this.execGit(args);
  611. });
  612. }
  613. checkoutDetach() {
  614. return __awaiter(this, void 0, void 0, function* () {
  615. const args = ['checkout', '--detach'];
  616. yield this.execGit(args);
  617. });
  618. }
  619. config(configKey, configValue, globalConfig, add) {
  620. return __awaiter(this, void 0, void 0, function* () {
  621. const args = ['config', globalConfig ? '--global' : '--local'];
  622. if (add) {
  623. args.push('--add');
  624. }
  625. args.push(...[configKey, configValue]);
  626. yield this.execGit(args);
  627. });
  628. }
  629. configExists(configKey, globalConfig) {
  630. return __awaiter(this, void 0, void 0, function* () {
  631. const pattern = regexpHelper.escape(configKey);
  632. const output = yield this.execGit([
  633. 'config',
  634. globalConfig ? '--global' : '--local',
  635. '--name-only',
  636. '--get-regexp',
  637. pattern
  638. ], true);
  639. return output.exitCode === 0;
  640. });
  641. }
  642. fetch(refSpec, options) {
  643. return __awaiter(this, void 0, void 0, function* () {
  644. const args = ['-c', 'protocol.version=2', 'fetch'];
  645. if (!refSpec.some(x => x === refHelper.tagsRefSpec) && !options.fetchTags) {
  646. args.push('--no-tags');
  647. }
  648. args.push('--prune', '--no-recurse-submodules');
  649. if (options.showProgress) {
  650. args.push('--progress');
  651. }
  652. if (options.filter) {
  653. args.push(`--filter=${options.filter}`);
  654. }
  655. if (options.fetchDepth && options.fetchDepth > 0) {
  656. args.push(`--depth=${options.fetchDepth}`);
  657. }
  658. else if (fshelper.fileExistsSync(path.join(this.workingDirectory, '.git', 'shallow'))) {
  659. args.push('--unshallow');
  660. }
  661. args.push('origin');
  662. for (const arg of refSpec) {
  663. args.push(arg);
  664. }
  665. const that = this;
  666. yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  667. yield that.execGit(args);
  668. }));
  669. });
  670. }
  671. getDefaultBranch(repositoryUrl) {
  672. return __awaiter(this, void 0, void 0, function* () {
  673. let output;
  674. yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  675. output = yield this.execGit([
  676. 'ls-remote',
  677. '--quiet',
  678. '--exit-code',
  679. '--symref',
  680. repositoryUrl,
  681. 'HEAD'
  682. ]);
  683. }));
  684. if (output) {
  685. // Satisfy compiler, will always be set
  686. for (let line of output.stdout.trim().split('\n')) {
  687. line = line.trim();
  688. if (line.startsWith('ref:') || line.endsWith('HEAD')) {
  689. return line
  690. .substr('ref:'.length, line.length - 'ref:'.length - 'HEAD'.length)
  691. .trim();
  692. }
  693. }
  694. }
  695. throw new Error('Unexpected output when retrieving default branch');
  696. });
  697. }
  698. getWorkingDirectory() {
  699. return this.workingDirectory;
  700. }
  701. init() {
  702. return __awaiter(this, void 0, void 0, function* () {
  703. yield this.execGit(['init', this.workingDirectory]);
  704. });
  705. }
  706. isDetached() {
  707. return __awaiter(this, void 0, void 0, function* () {
  708. // Note, "branch --show-current" would be simpler but isn't available until Git 2.22
  709. const output = yield this.execGit(['rev-parse', '--symbolic-full-name', '--verify', '--quiet', 'HEAD'], true);
  710. return !output.stdout.trim().startsWith('refs/heads/');
  711. });
  712. }
  713. lfsFetch(ref) {
  714. return __awaiter(this, void 0, void 0, function* () {
  715. const args = ['lfs', 'fetch', 'origin', ref];
  716. const that = this;
  717. yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  718. yield that.execGit(args);
  719. }));
  720. });
  721. }
  722. lfsInstall() {
  723. return __awaiter(this, void 0, void 0, function* () {
  724. yield this.execGit(['lfs', 'install', '--local']);
  725. });
  726. }
  727. log1(format) {
  728. return __awaiter(this, void 0, void 0, function* () {
  729. const args = format ? ['log', '-1', format] : ['log', '-1'];
  730. const silent = format ? false : true;
  731. const output = yield this.execGit(args, false, silent);
  732. return output.stdout;
  733. });
  734. }
  735. remoteAdd(remoteName, remoteUrl) {
  736. return __awaiter(this, void 0, void 0, function* () {
  737. yield this.execGit(['remote', 'add', remoteName, remoteUrl]);
  738. });
  739. }
  740. removeEnvironmentVariable(name) {
  741. delete this.gitEnv[name];
  742. }
  743. /**
  744. * Resolves a ref to a SHA. For a branch or lightweight tag, the commit SHA is returned.
  745. * For an annotated tag, the tag SHA is returned.
  746. * @param {string} ref For example: 'refs/heads/main' or '/refs/tags/v1'
  747. * @returns {Promise<string>}
  748. */
  749. revParse(ref) {
  750. return __awaiter(this, void 0, void 0, function* () {
  751. const output = yield this.execGit(['rev-parse', ref]);
  752. return output.stdout.trim();
  753. });
  754. }
  755. setEnvironmentVariable(name, value) {
  756. this.gitEnv[name] = value;
  757. }
  758. shaExists(sha) {
  759. return __awaiter(this, void 0, void 0, function* () {
  760. const args = ['rev-parse', '--verify', '--quiet', `${sha}^{object}`];
  761. const output = yield this.execGit(args, true);
  762. return output.exitCode === 0;
  763. });
  764. }
  765. submoduleForeach(command, recursive) {
  766. return __awaiter(this, void 0, void 0, function* () {
  767. const args = ['submodule', 'foreach'];
  768. if (recursive) {
  769. args.push('--recursive');
  770. }
  771. args.push(command);
  772. const output = yield this.execGit(args);
  773. return output.stdout;
  774. });
  775. }
  776. submoduleSync(recursive) {
  777. return __awaiter(this, void 0, void 0, function* () {
  778. const args = ['submodule', 'sync'];
  779. if (recursive) {
  780. args.push('--recursive');
  781. }
  782. yield this.execGit(args);
  783. });
  784. }
  785. submoduleUpdate(fetchDepth, recursive) {
  786. return __awaiter(this, void 0, void 0, function* () {
  787. const args = ['-c', 'protocol.version=2'];
  788. args.push('submodule', 'update', '--init', '--force');
  789. if (fetchDepth > 0) {
  790. args.push(`--depth=${fetchDepth}`);
  791. }
  792. if (recursive) {
  793. args.push('--recursive');
  794. }
  795. yield this.execGit(args);
  796. });
  797. }
  798. submoduleStatus() {
  799. return __awaiter(this, void 0, void 0, function* () {
  800. const output = yield this.execGit(['submodule', 'status'], true);
  801. core.debug(output.stdout);
  802. return output.exitCode === 0;
  803. });
  804. }
  805. tagExists(pattern) {
  806. return __awaiter(this, void 0, void 0, function* () {
  807. const output = yield this.execGit(['tag', '--list', pattern]);
  808. return !!output.stdout.trim();
  809. });
  810. }
  811. tryClean() {
  812. return __awaiter(this, void 0, void 0, function* () {
  813. const output = yield this.execGit(['clean', '-ffdx'], true);
  814. return output.exitCode === 0;
  815. });
  816. }
  817. tryConfigUnset(configKey, globalConfig) {
  818. return __awaiter(this, void 0, void 0, function* () {
  819. const output = yield this.execGit([
  820. 'config',
  821. globalConfig ? '--global' : '--local',
  822. '--unset-all',
  823. configKey
  824. ], true);
  825. return output.exitCode === 0;
  826. });
  827. }
  828. tryDisableAutomaticGarbageCollection() {
  829. return __awaiter(this, void 0, void 0, function* () {
  830. const output = yield this.execGit(['config', '--local', 'gc.auto', '0'], true);
  831. return output.exitCode === 0;
  832. });
  833. }
  834. tryGetFetchUrl() {
  835. return __awaiter(this, void 0, void 0, function* () {
  836. const output = yield this.execGit(['config', '--local', '--get', 'remote.origin.url'], true);
  837. if (output.exitCode !== 0) {
  838. return '';
  839. }
  840. const stdout = output.stdout.trim();
  841. if (stdout.includes('\n')) {
  842. return '';
  843. }
  844. return stdout;
  845. });
  846. }
  847. tryReset() {
  848. return __awaiter(this, void 0, void 0, function* () {
  849. const output = yield this.execGit(['reset', '--hard', 'HEAD'], true);
  850. return output.exitCode === 0;
  851. });
  852. }
  853. version() {
  854. return __awaiter(this, void 0, void 0, function* () {
  855. return this.gitVersion;
  856. });
  857. }
  858. static createCommandManager(workingDirectory, lfs, doSparseCheckout) {
  859. return __awaiter(this, void 0, void 0, function* () {
  860. const result = new GitCommandManager();
  861. yield result.initializeCommandManager(workingDirectory, lfs, doSparseCheckout);
  862. return result;
  863. });
  864. }
  865. execGit(args_1) {
  866. return __awaiter(this, arguments, void 0, function* (args, allowAllExitCodes = false, silent = false, customListeners = {}) {
  867. fshelper.directoryExistsSync(this.workingDirectory, true);
  868. const result = new GitOutput();
  869. const env = {};
  870. for (const key of Object.keys(process.env)) {
  871. env[key] = process.env[key];
  872. }
  873. for (const key of Object.keys(this.gitEnv)) {
  874. env[key] = this.gitEnv[key];
  875. }
  876. const defaultListener = {
  877. stdout: (data) => {
  878. stdout.push(data.toString());
  879. }
  880. };
  881. const mergedListeners = Object.assign(Object.assign({}, defaultListener), customListeners);
  882. const stdout = [];
  883. const options = {
  884. cwd: this.workingDirectory,
  885. env,
  886. silent,
  887. ignoreReturnCode: allowAllExitCodes,
  888. listeners: mergedListeners
  889. };
  890. result.exitCode = yield exec.exec(`"${this.gitPath}"`, args, options);
  891. result.stdout = stdout.join('');
  892. core.debug(result.exitCode.toString());
  893. core.debug(result.stdout);
  894. return result;
  895. });
  896. }
  897. initializeCommandManager(workingDirectory, lfs, doSparseCheckout) {
  898. return __awaiter(this, void 0, void 0, function* () {
  899. this.workingDirectory = workingDirectory;
  900. // Git-lfs will try to pull down assets if any of the local/user/system setting exist.
  901. // If the user didn't enable `LFS` in their pipeline definition, disable LFS fetch/checkout.
  902. this.lfs = lfs;
  903. if (!this.lfs) {
  904. this.gitEnv['GIT_LFS_SKIP_SMUDGE'] = '1';
  905. }
  906. this.gitPath = yield io.which('git', true);
  907. // Git version
  908. core.debug('Getting git version');
  909. this.gitVersion = new git_version_1.GitVersion();
  910. let gitOutput = yield this.execGit(['version']);
  911. let stdout = gitOutput.stdout.trim();
  912. if (!stdout.includes('\n')) {
  913. const match = stdout.match(/\d+\.\d+(\.\d+)?/);
  914. if (match) {
  915. this.gitVersion = new git_version_1.GitVersion(match[0]);
  916. }
  917. }
  918. if (!this.gitVersion.isValid()) {
  919. throw new Error('Unable to determine git version');
  920. }
  921. // Minimum git version
  922. if (!this.gitVersion.checkMinimum(exports.MinimumGitVersion)) {
  923. throw new Error(`Minimum required git version is ${exports.MinimumGitVersion}. Your git ('${this.gitPath}') is ${this.gitVersion}`);
  924. }
  925. if (this.lfs) {
  926. // Git-lfs version
  927. core.debug('Getting git-lfs version');
  928. let gitLfsVersion = new git_version_1.GitVersion();
  929. const gitLfsPath = yield io.which('git-lfs', true);
  930. gitOutput = yield this.execGit(['lfs', 'version']);
  931. stdout = gitOutput.stdout.trim();
  932. if (!stdout.includes('\n')) {
  933. const match = stdout.match(/\d+\.\d+(\.\d+)?/);
  934. if (match) {
  935. gitLfsVersion = new git_version_1.GitVersion(match[0]);
  936. }
  937. }
  938. if (!gitLfsVersion.isValid()) {
  939. throw new Error('Unable to determine git-lfs version');
  940. }
  941. // Minimum git-lfs version
  942. // Note:
  943. // - Auth header not supported before 2.1
  944. const minimumGitLfsVersion = new git_version_1.GitVersion('2.1');
  945. if (!gitLfsVersion.checkMinimum(minimumGitLfsVersion)) {
  946. throw new Error(`Minimum required git-lfs version is ${minimumGitLfsVersion}. Your git-lfs ('${gitLfsPath}') is ${gitLfsVersion}`);
  947. }
  948. }
  949. this.doSparseCheckout = doSparseCheckout;
  950. if (this.doSparseCheckout) {
  951. if (!this.gitVersion.checkMinimum(exports.MinimumGitSparseCheckoutVersion)) {
  952. throw new Error(`Minimum Git version required for sparse checkout is ${exports.MinimumGitSparseCheckoutVersion}. Your git ('${this.gitPath}') is ${this.gitVersion}`);
  953. }
  954. }
  955. // Set the user agent
  956. const gitHttpUserAgent = `git/${this.gitVersion} (github-actions-checkout)`;
  957. core.debug(`Set git useragent to: ${gitHttpUserAgent}`);
  958. this.gitEnv['GIT_HTTP_USER_AGENT'] = gitHttpUserAgent;
  959. });
  960. }
  961. }
  962. class GitOutput {
  963. constructor() {
  964. this.stdout = '';
  965. this.exitCode = 0;
  966. }
  967. }
  968. /***/ }),
  969. /***/ 8609:
  970. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  971. "use strict";
  972. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  973. if (k2 === undefined) k2 = k;
  974. var desc = Object.getOwnPropertyDescriptor(m, k);
  975. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  976. desc = { enumerable: true, get: function() { return m[k]; } };
  977. }
  978. Object.defineProperty(o, k2, desc);
  979. }) : (function(o, m, k, k2) {
  980. if (k2 === undefined) k2 = k;
  981. o[k2] = m[k];
  982. }));
  983. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  984. Object.defineProperty(o, "default", { enumerable: true, value: v });
  985. }) : function(o, v) {
  986. o["default"] = v;
  987. });
  988. var __importStar = (this && this.__importStar) || function (mod) {
  989. if (mod && mod.__esModule) return mod;
  990. var result = {};
  991. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  992. __setModuleDefault(result, mod);
  993. return result;
  994. };
  995. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  996. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  997. return new (P || (P = Promise))(function (resolve, reject) {
  998. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  999. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  1000. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  1001. step((generator = generator.apply(thisArg, _arguments || [])).next());
  1002. });
  1003. };
  1004. Object.defineProperty(exports, "__esModule", ({ value: true }));
  1005. exports.prepareExistingDirectory = void 0;
  1006. const assert = __importStar(__nccwpck_require__(9491));
  1007. const core = __importStar(__nccwpck_require__(2186));
  1008. const fs = __importStar(__nccwpck_require__(7147));
  1009. const fsHelper = __importStar(__nccwpck_require__(7219));
  1010. const io = __importStar(__nccwpck_require__(7436));
  1011. const path = __importStar(__nccwpck_require__(1017));
  1012. function prepareExistingDirectory(git, repositoryPath, repositoryUrl, clean, ref) {
  1013. return __awaiter(this, void 0, void 0, function* () {
  1014. var _a;
  1015. assert.ok(repositoryPath, 'Expected repositoryPath to be defined');
  1016. assert.ok(repositoryUrl, 'Expected repositoryUrl to be defined');
  1017. // Indicates whether to delete the directory contents
  1018. let remove = false;
  1019. // Check whether using git or REST API
  1020. if (!git) {
  1021. remove = true;
  1022. }
  1023. // Fetch URL does not match
  1024. else if (!fsHelper.directoryExistsSync(path.join(repositoryPath, '.git')) ||
  1025. repositoryUrl !== (yield git.tryGetFetchUrl())) {
  1026. remove = true;
  1027. }
  1028. else {
  1029. // Delete any index.lock and shallow.lock left by a previously canceled run or crashed git process
  1030. const lockPaths = [
  1031. path.join(repositoryPath, '.git', 'index.lock'),
  1032. path.join(repositoryPath, '.git', 'shallow.lock')
  1033. ];
  1034. for (const lockPath of lockPaths) {
  1035. try {
  1036. yield io.rmRF(lockPath);
  1037. }
  1038. catch (error) {
  1039. core.debug(`Unable to delete '${lockPath}'. ${(_a = error === null || error === void 0 ? void 0 : error.message) !== null && _a !== void 0 ? _a : error}`);
  1040. }
  1041. }
  1042. try {
  1043. core.startGroup('Removing previously created refs, to avoid conflicts');
  1044. // Checkout detached HEAD
  1045. if (!(yield git.isDetached())) {
  1046. yield git.checkoutDetach();
  1047. }
  1048. // Remove all refs/heads/*
  1049. let branches = yield git.branchList(false);
  1050. for (const branch of branches) {
  1051. yield git.branchDelete(false, branch);
  1052. }
  1053. // Remove any conflicting refs/remotes/origin/*
  1054. // Example 1: Consider ref is refs/heads/foo and previously fetched refs/remotes/origin/foo/bar
  1055. // Example 2: Consider ref is refs/heads/foo/bar and previously fetched refs/remotes/origin/foo
  1056. if (ref) {
  1057. ref = ref.startsWith('refs/') ? ref : `refs/heads/${ref}`;
  1058. if (ref.startsWith('refs/heads/')) {
  1059. const upperName1 = ref.toUpperCase().substr('REFS/HEADS/'.length);
  1060. const upperName1Slash = `${upperName1}/`;
  1061. branches = yield git.branchList(true);
  1062. for (const branch of branches) {
  1063. const upperName2 = branch.substr('origin/'.length).toUpperCase();
  1064. const upperName2Slash = `${upperName2}/`;
  1065. if (upperName1.startsWith(upperName2Slash) ||
  1066. upperName2.startsWith(upperName1Slash)) {
  1067. yield git.branchDelete(true, branch);
  1068. }
  1069. }
  1070. }
  1071. }
  1072. core.endGroup();
  1073. // Check for submodules and delete any existing files if submodules are present
  1074. if (!(yield git.submoduleStatus())) {
  1075. remove = true;
  1076. core.info('Bad Submodules found, removing existing files');
  1077. }
  1078. // Clean
  1079. if (clean) {
  1080. core.startGroup('Cleaning the repository');
  1081. if (!(yield git.tryClean())) {
  1082. 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}'.`);
  1083. remove = true;
  1084. }
  1085. else if (!(yield git.tryReset())) {
  1086. remove = true;
  1087. }
  1088. core.endGroup();
  1089. if (remove) {
  1090. core.warning(`Unable to clean or reset the repository. The repository will be recreated instead.`);
  1091. }
  1092. }
  1093. }
  1094. catch (error) {
  1095. core.warning(`Unable to prepare the existing repository. The repository will be recreated instead.`);
  1096. remove = true;
  1097. }
  1098. }
  1099. if (remove) {
  1100. // Delete the contents of the directory. Don't delete the directory itself
  1101. // since it might be the current working directory.
  1102. core.info(`Deleting the contents of '${repositoryPath}'`);
  1103. for (const file of yield fs.promises.readdir(repositoryPath)) {
  1104. yield io.rmRF(path.join(repositoryPath, file));
  1105. }
  1106. }
  1107. });
  1108. }
  1109. exports.prepareExistingDirectory = prepareExistingDirectory;
  1110. /***/ }),
  1111. /***/ 9210:
  1112. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  1113. "use strict";
  1114. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  1115. if (k2 === undefined) k2 = k;
  1116. var desc = Object.getOwnPropertyDescriptor(m, k);
  1117. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  1118. desc = { enumerable: true, get: function() { return m[k]; } };
  1119. }
  1120. Object.defineProperty(o, k2, desc);
  1121. }) : (function(o, m, k, k2) {
  1122. if (k2 === undefined) k2 = k;
  1123. o[k2] = m[k];
  1124. }));
  1125. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  1126. Object.defineProperty(o, "default", { enumerable: true, value: v });
  1127. }) : function(o, v) {
  1128. o["default"] = v;
  1129. });
  1130. var __importStar = (this && this.__importStar) || function (mod) {
  1131. if (mod && mod.__esModule) return mod;
  1132. var result = {};
  1133. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  1134. __setModuleDefault(result, mod);
  1135. return result;
  1136. };
  1137. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  1138. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  1139. return new (P || (P = Promise))(function (resolve, reject) {
  1140. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  1141. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  1142. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  1143. step((generator = generator.apply(thisArg, _arguments || [])).next());
  1144. });
  1145. };
  1146. Object.defineProperty(exports, "__esModule", ({ value: true }));
  1147. exports.cleanup = exports.getSource = void 0;
  1148. const core = __importStar(__nccwpck_require__(2186));
  1149. const fsHelper = __importStar(__nccwpck_require__(7219));
  1150. const gitAuthHelper = __importStar(__nccwpck_require__(2565));
  1151. const gitCommandManager = __importStar(__nccwpck_require__(738));
  1152. const gitDirectoryHelper = __importStar(__nccwpck_require__(8609));
  1153. const githubApiHelper = __importStar(__nccwpck_require__(138));
  1154. const io = __importStar(__nccwpck_require__(7436));
  1155. const path = __importStar(__nccwpck_require__(1017));
  1156. const refHelper = __importStar(__nccwpck_require__(8601));
  1157. const stateHelper = __importStar(__nccwpck_require__(4866));
  1158. const urlHelper = __importStar(__nccwpck_require__(9437));
  1159. const git_command_manager_1 = __nccwpck_require__(738);
  1160. function getSource(settings) {
  1161. return __awaiter(this, void 0, void 0, function* () {
  1162. // Repository URL
  1163. core.info(`Syncing repository: ${settings.repositoryOwner}/${settings.repositoryName}`);
  1164. const repositoryUrl = urlHelper.getFetchUrl(settings);
  1165. // Remove conflicting file path
  1166. if (fsHelper.fileExistsSync(settings.repositoryPath)) {
  1167. yield io.rmRF(settings.repositoryPath);
  1168. }
  1169. // Create directory
  1170. let isExisting = true;
  1171. if (!fsHelper.directoryExistsSync(settings.repositoryPath)) {
  1172. isExisting = false;
  1173. yield io.mkdirP(settings.repositoryPath);
  1174. }
  1175. // Git command manager
  1176. core.startGroup('Getting Git version info');
  1177. const git = yield getGitCommandManager(settings);
  1178. core.endGroup();
  1179. let authHelper = null;
  1180. try {
  1181. if (git) {
  1182. authHelper = gitAuthHelper.createAuthHelper(git, settings);
  1183. if (settings.setSafeDirectory) {
  1184. // 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
  1185. // Otherwise all git commands we run in a container fail
  1186. yield authHelper.configureTempGlobalConfig();
  1187. core.info(`Adding repository directory to the temporary git global config as a safe directory`);
  1188. yield git
  1189. .config('safe.directory', settings.repositoryPath, true, true)
  1190. .catch(error => {
  1191. core.info(`Failed to initialize safe directory with error: ${error}`);
  1192. });
  1193. stateHelper.setSafeDirectory();
  1194. }
  1195. }
  1196. // Prepare existing directory, otherwise recreate
  1197. if (isExisting) {
  1198. yield gitDirectoryHelper.prepareExistingDirectory(git, settings.repositoryPath, repositoryUrl, settings.clean, settings.ref);
  1199. }
  1200. if (!git) {
  1201. // Downloading using REST API
  1202. core.info(`The repository will be downloaded using the GitHub REST API`);
  1203. core.info(`To create a local Git repository instead, add Git ${gitCommandManager.MinimumGitVersion} or higher to the PATH`);
  1204. if (settings.submodules) {
  1205. 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.`);
  1206. }
  1207. else if (settings.sshKey) {
  1208. 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.`);
  1209. }
  1210. yield githubApiHelper.downloadRepository(settings.authToken, settings.repositoryOwner, settings.repositoryName, settings.ref, settings.commit, settings.repositoryPath, settings.githubServerUrl);
  1211. return;
  1212. }
  1213. // Save state for POST action
  1214. stateHelper.setRepositoryPath(settings.repositoryPath);
  1215. // Initialize the repository
  1216. if (!fsHelper.directoryExistsSync(path.join(settings.repositoryPath, '.git'))) {
  1217. core.startGroup('Initializing the repository');
  1218. yield git.init();
  1219. yield git.remoteAdd('origin', repositoryUrl);
  1220. core.endGroup();
  1221. }
  1222. // Disable automatic garbage collection
  1223. core.startGroup('Disabling automatic garbage collection');
  1224. if (!(yield git.tryDisableAutomaticGarbageCollection())) {
  1225. core.warning(`Unable to turn off git automatic garbage collection. The git fetch operation may trigger garbage collection and cause a delay.`);
  1226. }
  1227. core.endGroup();
  1228. // If we didn't initialize it above, do it now
  1229. if (!authHelper) {
  1230. authHelper = gitAuthHelper.createAuthHelper(git, settings);
  1231. }
  1232. // Configure auth
  1233. core.startGroup('Setting up auth');
  1234. yield authHelper.configureAuth();
  1235. core.endGroup();
  1236. // Determine the default branch
  1237. if (!settings.ref && !settings.commit) {
  1238. core.startGroup('Determining the default branch');
  1239. if (settings.sshKey) {
  1240. settings.ref = yield git.getDefaultBranch(repositoryUrl);
  1241. }
  1242. else {
  1243. settings.ref = yield githubApiHelper.getDefaultBranch(settings.authToken, settings.repositoryOwner, settings.repositoryName, settings.githubServerUrl);
  1244. }
  1245. core.endGroup();
  1246. }
  1247. // LFS install
  1248. if (settings.lfs) {
  1249. yield git.lfsInstall();
  1250. }
  1251. // Fetch
  1252. core.startGroup('Fetching the repository');
  1253. const fetchOptions = {};
  1254. if (settings.filter) {
  1255. fetchOptions.filter = settings.filter;
  1256. }
  1257. else if (settings.sparseCheckout) {
  1258. fetchOptions.filter = 'blob:none';
  1259. }
  1260. if (settings.fetchDepth <= 0) {
  1261. // Fetch all branches and tags
  1262. let refSpec = refHelper.getRefSpecForAllHistory(settings.ref, settings.commit);
  1263. yield git.fetch(refSpec, fetchOptions);
  1264. // When all history is fetched, the ref we're interested in may have moved to a different
  1265. // commit (push or force push). If so, fetch again with a targeted refspec.
  1266. if (!(yield refHelper.testRef(git, settings.ref, settings.commit))) {
  1267. refSpec = refHelper.getRefSpec(settings.ref, settings.commit);
  1268. yield git.fetch(refSpec, fetchOptions);
  1269. }
  1270. }
  1271. else {
  1272. fetchOptions.fetchDepth = settings.fetchDepth;
  1273. fetchOptions.fetchTags = settings.fetchTags;
  1274. const refSpec = refHelper.getRefSpec(settings.ref, settings.commit);
  1275. yield git.fetch(refSpec, fetchOptions);
  1276. }
  1277. core.endGroup();
  1278. // Checkout info
  1279. core.startGroup('Determining the checkout info');
  1280. const checkoutInfo = yield refHelper.getCheckoutInfo(git, settings.ref, settings.commit);
  1281. core.endGroup();
  1282. // LFS fetch
  1283. // Explicit lfs-fetch to avoid slow checkout (fetches one lfs object at a time).
  1284. // Explicit lfs fetch will fetch lfs objects in parallel.
  1285. // For sparse checkouts, let `checkout` fetch the needed objects lazily.
  1286. if (settings.lfs && !settings.sparseCheckout) {
  1287. core.startGroup('Fetching LFS objects');
  1288. yield git.lfsFetch(checkoutInfo.startPoint || checkoutInfo.ref);
  1289. core.endGroup();
  1290. }
  1291. // Sparse checkout
  1292. if (!settings.sparseCheckout) {
  1293. let gitVersion = yield git.version();
  1294. // no need to disable sparse-checkout if the installed git runtime doesn't even support it.
  1295. if (gitVersion.checkMinimum(git_command_manager_1.MinimumGitSparseCheckoutVersion)) {
  1296. yield git.disableSparseCheckout();
  1297. }
  1298. }
  1299. else {
  1300. core.startGroup('Setting up sparse checkout');
  1301. if (settings.sparseCheckoutConeMode) {
  1302. yield git.sparseCheckout(settings.sparseCheckout);
  1303. }
  1304. else {
  1305. yield git.sparseCheckoutNonConeMode(settings.sparseCheckout);
  1306. }
  1307. core.endGroup();
  1308. }
  1309. // Checkout
  1310. core.startGroup('Checking out the ref');
  1311. yield git.checkout(checkoutInfo.ref, checkoutInfo.startPoint);
  1312. core.endGroup();
  1313. // Submodules
  1314. if (settings.submodules) {
  1315. // Temporarily override global config
  1316. core.startGroup('Setting up auth for fetching submodules');
  1317. yield authHelper.configureGlobalAuth();
  1318. core.endGroup();
  1319. // Checkout submodules
  1320. core.startGroup('Fetching submodules');
  1321. yield git.submoduleSync(settings.nestedSubmodules);
  1322. yield git.submoduleUpdate(settings.fetchDepth, settings.nestedSubmodules);
  1323. yield git.submoduleForeach('git config --local gc.auto 0', settings.nestedSubmodules);
  1324. core.endGroup();
  1325. // Persist credentials
  1326. if (settings.persistCredentials) {
  1327. core.startGroup('Persisting credentials for submodules');
  1328. yield authHelper.configureSubmoduleAuth();
  1329. core.endGroup();
  1330. }
  1331. }
  1332. // Get commit information
  1333. const commitInfo = yield git.log1();
  1334. // Log commit sha
  1335. yield git.log1("--format='%H'");
  1336. // Check for incorrect pull request merge commit
  1337. yield refHelper.checkCommitInfo(settings.authToken, commitInfo, settings.repositoryOwner, settings.repositoryName, settings.ref, settings.commit, settings.githubServerUrl);
  1338. }
  1339. finally {
  1340. // Remove auth
  1341. if (authHelper) {
  1342. if (!settings.persistCredentials) {
  1343. core.startGroup('Removing auth');
  1344. yield authHelper.removeAuth();
  1345. core.endGroup();
  1346. }
  1347. authHelper.removeGlobalConfig();
  1348. }
  1349. }
  1350. });
  1351. }
  1352. exports.getSource = getSource;
  1353. function cleanup(repositoryPath) {
  1354. return __awaiter(this, void 0, void 0, function* () {
  1355. // Repo exists?
  1356. if (!repositoryPath ||
  1357. !fsHelper.fileExistsSync(path.join(repositoryPath, '.git', 'config'))) {
  1358. return;
  1359. }
  1360. let git;
  1361. try {
  1362. git = yield gitCommandManager.createCommandManager(repositoryPath, false, false);
  1363. }
  1364. catch (_a) {
  1365. return;
  1366. }
  1367. // Remove auth
  1368. const authHelper = gitAuthHelper.createAuthHelper(git);
  1369. try {
  1370. if (stateHelper.PostSetSafeDirectory) {
  1371. // 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
  1372. // Otherwise all git commands we run in a container fail
  1373. yield authHelper.configureTempGlobalConfig();
  1374. core.info(`Adding repository directory to the temporary git global config as a safe directory`);
  1375. yield git
  1376. .config('safe.directory', repositoryPath, true, true)
  1377. .catch(error => {
  1378. core.info(`Failed to initialize safe directory with error: ${error}`);
  1379. });
  1380. }
  1381. yield authHelper.removeAuth();
  1382. }
  1383. finally {
  1384. yield authHelper.removeGlobalConfig();
  1385. }
  1386. });
  1387. }
  1388. exports.cleanup = cleanup;
  1389. function getGitCommandManager(settings) {
  1390. return __awaiter(this, void 0, void 0, function* () {
  1391. core.info(`Working directory is '${settings.repositoryPath}'`);
  1392. try {
  1393. return yield gitCommandManager.createCommandManager(settings.repositoryPath, settings.lfs, settings.sparseCheckout != null);
  1394. }
  1395. catch (err) {
  1396. // Git is required for LFS
  1397. if (settings.lfs) {
  1398. throw err;
  1399. }
  1400. // Otherwise fallback to REST API
  1401. return undefined;
  1402. }
  1403. });
  1404. }
  1405. /***/ }),
  1406. /***/ 3142:
  1407. /***/ ((__unused_webpack_module, exports) => {
  1408. "use strict";
  1409. Object.defineProperty(exports, "__esModule", ({ value: true }));
  1410. exports.GitVersion = void 0;
  1411. class GitVersion {
  1412. /**
  1413. * Used for comparing the version of git and git-lfs against the minimum required version
  1414. * @param version the version string, e.g. 1.2 or 1.2.3
  1415. */
  1416. constructor(version) {
  1417. this.major = NaN;
  1418. this.minor = NaN;
  1419. this.patch = NaN;
  1420. if (version) {
  1421. const match = version.match(/^(\d+)\.(\d+)(\.(\d+))?$/);
  1422. if (match) {
  1423. this.major = Number(match[1]);
  1424. this.minor = Number(match[2]);
  1425. if (match[4]) {
  1426. this.patch = Number(match[4]);
  1427. }
  1428. }
  1429. }
  1430. }
  1431. /**
  1432. * Compares the instance against a minimum required version
  1433. * @param minimum Minimum version
  1434. */
  1435. checkMinimum(minimum) {
  1436. if (!minimum.isValid()) {
  1437. throw new Error('Arg minimum is not a valid version');
  1438. }
  1439. // Major is insufficient
  1440. if (this.major < minimum.major) {
  1441. return false;
  1442. }
  1443. // Major is equal
  1444. if (this.major === minimum.major) {
  1445. // Minor is insufficient
  1446. if (this.minor < minimum.minor) {
  1447. return false;
  1448. }
  1449. // Minor is equal
  1450. if (this.minor === minimum.minor) {
  1451. // Patch is insufficient
  1452. if (this.patch && this.patch < (minimum.patch || 0)) {
  1453. return false;
  1454. }
  1455. }
  1456. }
  1457. return true;
  1458. }
  1459. /**
  1460. * Indicates whether the instance was constructed from a valid version string
  1461. */
  1462. isValid() {
  1463. return !isNaN(this.major);
  1464. }
  1465. /**
  1466. * Returns the version as a string, e.g. 1.2 or 1.2.3
  1467. */
  1468. toString() {
  1469. let result = '';
  1470. if (this.isValid()) {
  1471. result = `${this.major}.${this.minor}`;
  1472. if (!isNaN(this.patch)) {
  1473. result += `.${this.patch}`;
  1474. }
  1475. }
  1476. return result;
  1477. }
  1478. }
  1479. exports.GitVersion = GitVersion;
  1480. /***/ }),
  1481. /***/ 138:
  1482. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  1483. "use strict";
  1484. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  1485. if (k2 === undefined) k2 = k;
  1486. var desc = Object.getOwnPropertyDescriptor(m, k);
  1487. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  1488. desc = { enumerable: true, get: function() { return m[k]; } };
  1489. }
  1490. Object.defineProperty(o, k2, desc);
  1491. }) : (function(o, m, k, k2) {
  1492. if (k2 === undefined) k2 = k;
  1493. o[k2] = m[k];
  1494. }));
  1495. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  1496. Object.defineProperty(o, "default", { enumerable: true, value: v });
  1497. }) : function(o, v) {
  1498. o["default"] = v;
  1499. });
  1500. var __importStar = (this && this.__importStar) || function (mod) {
  1501. if (mod && mod.__esModule) return mod;
  1502. var result = {};
  1503. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  1504. __setModuleDefault(result, mod);
  1505. return result;
  1506. };
  1507. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  1508. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  1509. return new (P || (P = Promise))(function (resolve, reject) {
  1510. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  1511. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  1512. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  1513. step((generator = generator.apply(thisArg, _arguments || [])).next());
  1514. });
  1515. };
  1516. Object.defineProperty(exports, "__esModule", ({ value: true }));
  1517. exports.getDefaultBranch = exports.downloadRepository = void 0;
  1518. const assert = __importStar(__nccwpck_require__(9491));
  1519. const core = __importStar(__nccwpck_require__(2186));
  1520. const fs = __importStar(__nccwpck_require__(7147));
  1521. const github = __importStar(__nccwpck_require__(5438));
  1522. const io = __importStar(__nccwpck_require__(7436));
  1523. const path = __importStar(__nccwpck_require__(1017));
  1524. const retryHelper = __importStar(__nccwpck_require__(2155));
  1525. const toolCache = __importStar(__nccwpck_require__(7784));
  1526. const uuid_1 = __nccwpck_require__(5840);
  1527. const url_helper_1 = __nccwpck_require__(9437);
  1528. const IS_WINDOWS = process.platform === 'win32';
  1529. function downloadRepository(authToken, owner, repo, ref, commit, repositoryPath, baseUrl) {
  1530. return __awaiter(this, void 0, void 0, function* () {
  1531. // Determine the default branch
  1532. if (!ref && !commit) {
  1533. core.info('Determining the default branch');
  1534. ref = yield getDefaultBranch(authToken, owner, repo, baseUrl);
  1535. }
  1536. // Download the archive
  1537. let archiveData = yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  1538. core.info('Downloading the archive');
  1539. return yield downloadArchive(authToken, owner, repo, ref, commit, baseUrl);
  1540. }));
  1541. // Write archive to disk
  1542. core.info('Writing archive to disk');
  1543. const uniqueId = (0, uuid_1.v4)();
  1544. const archivePath = IS_WINDOWS
  1545. ? path.join(repositoryPath, `${uniqueId}.zip`)
  1546. : path.join(repositoryPath, `${uniqueId}.tar.gz`);
  1547. yield fs.promises.writeFile(archivePath, archiveData);
  1548. archiveData = Buffer.from(''); // Free memory
  1549. // Extract archive
  1550. core.info('Extracting the archive');
  1551. const extractPath = path.join(repositoryPath, uniqueId);
  1552. yield io.mkdirP(extractPath);
  1553. if (IS_WINDOWS) {
  1554. yield toolCache.extractZip(archivePath, extractPath);
  1555. }
  1556. else {
  1557. yield toolCache.extractTar(archivePath, extractPath);
  1558. }
  1559. yield io.rmRF(archivePath);
  1560. // Determine the path of the repository content. The archive contains
  1561. // a top-level folder and the repository content is inside.
  1562. const archiveFileNames = yield fs.promises.readdir(extractPath);
  1563. assert.ok(archiveFileNames.length == 1, 'Expected exactly one directory inside archive');
  1564. const archiveVersion = archiveFileNames[0]; // The top-level folder name includes the short SHA
  1565. core.info(`Resolved version ${archiveVersion}`);
  1566. const tempRepositoryPath = path.join(extractPath, archiveVersion);
  1567. // Move the files
  1568. for (const fileName of yield fs.promises.readdir(tempRepositoryPath)) {
  1569. const sourcePath = path.join(tempRepositoryPath, fileName);
  1570. const targetPath = path.join(repositoryPath, fileName);
  1571. if (IS_WINDOWS) {
  1572. yield io.cp(sourcePath, targetPath, { recursive: true }); // Copy on Windows (Windows Defender may have a lock)
  1573. }
  1574. else {
  1575. yield io.mv(sourcePath, targetPath);
  1576. }
  1577. }
  1578. yield io.rmRF(extractPath);
  1579. });
  1580. }
  1581. exports.downloadRepository = downloadRepository;
  1582. /**
  1583. * Looks up the default branch name
  1584. */
  1585. function getDefaultBranch(authToken, owner, repo, baseUrl) {
  1586. return __awaiter(this, void 0, void 0, function* () {
  1587. return yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  1588. core.info('Retrieving the default branch name');
  1589. const octokit = github.getOctokit(authToken, {
  1590. baseUrl: (0, url_helper_1.getServerApiUrl)(baseUrl)
  1591. });
  1592. let result;
  1593. try {
  1594. // Get the default branch from the repo info
  1595. const response = yield octokit.rest.repos.get({ owner, repo });
  1596. result = response.data.default_branch;
  1597. assert.ok(result, 'default_branch cannot be empty');
  1598. }
  1599. catch (err) {
  1600. // Handle .wiki repo
  1601. if ((err === null || err === void 0 ? void 0 : err.status) === 404 &&
  1602. repo.toUpperCase().endsWith('.WIKI')) {
  1603. result = 'master';
  1604. }
  1605. // Otherwise error
  1606. else {
  1607. throw err;
  1608. }
  1609. }
  1610. // Print the default branch
  1611. core.info(`Default branch '${result}'`);
  1612. // Prefix with 'refs/heads'
  1613. if (!result.startsWith('refs/')) {
  1614. result = `refs/heads/${result}`;
  1615. }
  1616. return result;
  1617. }));
  1618. });
  1619. }
  1620. exports.getDefaultBranch = getDefaultBranch;
  1621. function downloadArchive(authToken, owner, repo, ref, commit, baseUrl) {
  1622. return __awaiter(this, void 0, void 0, function* () {
  1623. const octokit = github.getOctokit(authToken, {
  1624. baseUrl: (0, url_helper_1.getServerApiUrl)(baseUrl)
  1625. });
  1626. const download = IS_WINDOWS
  1627. ? octokit.rest.repos.downloadZipballArchive
  1628. : octokit.rest.repos.downloadTarballArchive;
  1629. const response = yield download({
  1630. owner: owner,
  1631. repo: repo,
  1632. ref: commit || ref
  1633. });
  1634. return Buffer.from(response.data); // response.data is ArrayBuffer
  1635. });
  1636. }
  1637. /***/ }),
  1638. /***/ 5480:
  1639. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  1640. "use strict";
  1641. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  1642. if (k2 === undefined) k2 = k;
  1643. var desc = Object.getOwnPropertyDescriptor(m, k);
  1644. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  1645. desc = { enumerable: true, get: function() { return m[k]; } };
  1646. }
  1647. Object.defineProperty(o, k2, desc);
  1648. }) : (function(o, m, k, k2) {
  1649. if (k2 === undefined) k2 = k;
  1650. o[k2] = m[k];
  1651. }));
  1652. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  1653. Object.defineProperty(o, "default", { enumerable: true, value: v });
  1654. }) : function(o, v) {
  1655. o["default"] = v;
  1656. });
  1657. var __importStar = (this && this.__importStar) || function (mod) {
  1658. if (mod && mod.__esModule) return mod;
  1659. var result = {};
  1660. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  1661. __setModuleDefault(result, mod);
  1662. return result;
  1663. };
  1664. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  1665. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  1666. return new (P || (P = Promise))(function (resolve, reject) {
  1667. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  1668. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  1669. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  1670. step((generator = generator.apply(thisArg, _arguments || [])).next());
  1671. });
  1672. };
  1673. Object.defineProperty(exports, "__esModule", ({ value: true }));
  1674. exports.getInputs = void 0;
  1675. const core = __importStar(__nccwpck_require__(2186));
  1676. const fsHelper = __importStar(__nccwpck_require__(7219));
  1677. const github = __importStar(__nccwpck_require__(5438));
  1678. const path = __importStar(__nccwpck_require__(1017));
  1679. const workflowContextHelper = __importStar(__nccwpck_require__(9568));
  1680. function getInputs() {
  1681. return __awaiter(this, void 0, void 0, function* () {
  1682. const result = {};
  1683. // GitHub workspace
  1684. let githubWorkspacePath = process.env['GITHUB_WORKSPACE'];
  1685. if (!githubWorkspacePath) {
  1686. throw new Error('GITHUB_WORKSPACE not defined');
  1687. }
  1688. githubWorkspacePath = path.resolve(githubWorkspacePath);
  1689. core.debug(`GITHUB_WORKSPACE = '${githubWorkspacePath}'`);
  1690. fsHelper.directoryExistsSync(githubWorkspacePath, true);
  1691. // Qualified repository
  1692. const qualifiedRepository = core.getInput('repository') ||
  1693. `${github.context.repo.owner}/${github.context.repo.repo}`;
  1694. core.debug(`qualified repository = '${qualifiedRepository}'`);
  1695. const splitRepository = qualifiedRepository.split('/');
  1696. if (splitRepository.length !== 2 ||
  1697. !splitRepository[0] ||
  1698. !splitRepository[1]) {
  1699. throw new Error(`Invalid repository '${qualifiedRepository}'. Expected format {owner}/{repo}.`);
  1700. }
  1701. result.repositoryOwner = splitRepository[0];
  1702. result.repositoryName = splitRepository[1];
  1703. // Repository path
  1704. result.repositoryPath = core.getInput('path') || '.';
  1705. result.repositoryPath = path.resolve(githubWorkspacePath, result.repositoryPath);
  1706. if (!(result.repositoryPath + path.sep).startsWith(githubWorkspacePath + path.sep)) {
  1707. throw new Error(`Repository path '${result.repositoryPath}' is not under '${githubWorkspacePath}'`);
  1708. }
  1709. // Workflow repository?
  1710. const isWorkflowRepository = qualifiedRepository.toUpperCase() ===
  1711. `${github.context.repo.owner}/${github.context.repo.repo}`.toUpperCase();
  1712. // Source branch, source version
  1713. result.ref = core.getInput('ref');
  1714. if (!result.ref) {
  1715. if (isWorkflowRepository) {
  1716. result.ref = github.context.ref;
  1717. result.commit = github.context.sha;
  1718. // Some events have an unqualifed ref. For example when a PR is merged (pull_request closed event),
  1719. // the ref is unqualifed like "main" instead of "refs/heads/main".
  1720. if (result.commit && result.ref && !result.ref.startsWith('refs/')) {
  1721. result.ref = `refs/heads/${result.ref}`;
  1722. }
  1723. }
  1724. }
  1725. // SHA?
  1726. else if (result.ref.match(/^[0-9a-fA-F]{40}$/)) {
  1727. result.commit = result.ref;
  1728. result.ref = '';
  1729. }
  1730. core.debug(`ref = '${result.ref}'`);
  1731. core.debug(`commit = '${result.commit}'`);
  1732. // Clean
  1733. result.clean = (core.getInput('clean') || 'true').toUpperCase() === 'TRUE';
  1734. core.debug(`clean = ${result.clean}`);
  1735. // Filter
  1736. const filter = core.getInput('filter');
  1737. if (filter) {
  1738. result.filter = filter;
  1739. }
  1740. core.debug(`filter = ${result.filter}`);
  1741. // Sparse checkout
  1742. const sparseCheckout = core.getMultilineInput('sparse-checkout');
  1743. if (sparseCheckout.length) {
  1744. result.sparseCheckout = sparseCheckout;
  1745. core.debug(`sparse checkout = ${result.sparseCheckout}`);
  1746. }
  1747. result.sparseCheckoutConeMode =
  1748. (core.getInput('sparse-checkout-cone-mode') || 'true').toUpperCase() ===
  1749. 'TRUE';
  1750. // Fetch depth
  1751. result.fetchDepth = Math.floor(Number(core.getInput('fetch-depth') || '1'));
  1752. if (isNaN(result.fetchDepth) || result.fetchDepth < 0) {
  1753. result.fetchDepth = 0;
  1754. }
  1755. core.debug(`fetch depth = ${result.fetchDepth}`);
  1756. // Fetch tags
  1757. result.fetchTags =
  1758. (core.getInput('fetch-tags') || 'false').toUpperCase() === 'TRUE';
  1759. core.debug(`fetch tags = ${result.fetchTags}`);
  1760. // Show fetch progress
  1761. result.showProgress =
  1762. (core.getInput('show-progress') || 'true').toUpperCase() === 'TRUE';
  1763. core.debug(`show progress = ${result.showProgress}`);
  1764. // LFS
  1765. result.lfs = (core.getInput('lfs') || 'false').toUpperCase() === 'TRUE';
  1766. core.debug(`lfs = ${result.lfs}`);
  1767. // Submodules
  1768. result.submodules = false;
  1769. result.nestedSubmodules = false;
  1770. const submodulesString = (core.getInput('submodules') || '').toUpperCase();
  1771. if (submodulesString == 'RECURSIVE') {
  1772. result.submodules = true;
  1773. result.nestedSubmodules = true;
  1774. }
  1775. else if (submodulesString == 'TRUE') {
  1776. result.submodules = true;
  1777. }
  1778. core.debug(`submodules = ${result.submodules}`);
  1779. core.debug(`recursive submodules = ${result.nestedSubmodules}`);
  1780. // Auth token
  1781. result.authToken = core.getInput('token', { required: true });
  1782. // SSH
  1783. result.sshKey = core.getInput('ssh-key');
  1784. result.sshKnownHosts = core.getInput('ssh-known-hosts');
  1785. result.sshStrict =
  1786. (core.getInput('ssh-strict') || 'true').toUpperCase() === 'TRUE';
  1787. result.sshUser = core.getInput('ssh-user');
  1788. // Persist credentials
  1789. result.persistCredentials =
  1790. (core.getInput('persist-credentials') || 'false').toUpperCase() === 'TRUE';
  1791. // Workflow organization ID
  1792. result.workflowOrganizationId =
  1793. yield workflowContextHelper.getOrganizationId();
  1794. // Set safe.directory in git global config.
  1795. result.setSafeDirectory =
  1796. (core.getInput('set-safe-directory') || 'true').toUpperCase() === 'TRUE';
  1797. // Determine the GitHub URL that the repository is being hosted from
  1798. result.githubServerUrl = core.getInput('github-server-url');
  1799. core.debug(`GitHub Host URL = ${result.githubServerUrl}`);
  1800. return result;
  1801. });
  1802. }
  1803. exports.getInputs = getInputs;
  1804. /***/ }),
  1805. /***/ 3109:
  1806. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  1807. "use strict";
  1808. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  1809. if (k2 === undefined) k2 = k;
  1810. var desc = Object.getOwnPropertyDescriptor(m, k);
  1811. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  1812. desc = { enumerable: true, get: function() { return m[k]; } };
  1813. }
  1814. Object.defineProperty(o, k2, desc);
  1815. }) : (function(o, m, k, k2) {
  1816. if (k2 === undefined) k2 = k;
  1817. o[k2] = m[k];
  1818. }));
  1819. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  1820. Object.defineProperty(o, "default", { enumerable: true, value: v });
  1821. }) : function(o, v) {
  1822. o["default"] = v;
  1823. });
  1824. var __importStar = (this && this.__importStar) || function (mod) {
  1825. if (mod && mod.__esModule) return mod;
  1826. var result = {};
  1827. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  1828. __setModuleDefault(result, mod);
  1829. return result;
  1830. };
  1831. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  1832. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  1833. return new (P || (P = Promise))(function (resolve, reject) {
  1834. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  1835. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  1836. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  1837. step((generator = generator.apply(thisArg, _arguments || [])).next());
  1838. });
  1839. };
  1840. Object.defineProperty(exports, "__esModule", ({ value: true }));
  1841. const core = __importStar(__nccwpck_require__(2186));
  1842. const coreCommand = __importStar(__nccwpck_require__(7351));
  1843. const gitSourceProvider = __importStar(__nccwpck_require__(9210));
  1844. const inputHelper = __importStar(__nccwpck_require__(5480));
  1845. const path = __importStar(__nccwpck_require__(1017));
  1846. const stateHelper = __importStar(__nccwpck_require__(4866));
  1847. function run() {
  1848. return __awaiter(this, void 0, void 0, function* () {
  1849. var _a;
  1850. try {
  1851. const sourceSettings = yield inputHelper.getInputs();
  1852. try {
  1853. // Register problem matcher
  1854. coreCommand.issueCommand('add-matcher', {}, path.join(__dirname, 'problem-matcher.json'));
  1855. // Get sources
  1856. yield gitSourceProvider.getSource(sourceSettings);
  1857. }
  1858. finally {
  1859. // Unregister problem matcher
  1860. coreCommand.issueCommand('remove-matcher', { owner: 'checkout-git' }, '');
  1861. }
  1862. }
  1863. catch (error) {
  1864. core.setFailed(`${(_a = error === null || error === void 0 ? void 0 : error.message) !== null && _a !== void 0 ? _a : error}`);
  1865. }
  1866. });
  1867. }
  1868. function cleanup() {
  1869. return __awaiter(this, void 0, void 0, function* () {
  1870. var _a;
  1871. try {
  1872. yield gitSourceProvider.cleanup(stateHelper.RepositoryPath);
  1873. }
  1874. catch (error) {
  1875. core.warning(`${(_a = error === null || error === void 0 ? void 0 : error.message) !== null && _a !== void 0 ? _a : error}`);
  1876. }
  1877. });
  1878. }
  1879. // Main
  1880. if (!stateHelper.IsPost) {
  1881. run();
  1882. }
  1883. // Post
  1884. else {
  1885. cleanup();
  1886. }
  1887. /***/ }),
  1888. /***/ 8601:
  1889. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  1890. "use strict";
  1891. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  1892. if (k2 === undefined) k2 = k;
  1893. var desc = Object.getOwnPropertyDescriptor(m, k);
  1894. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  1895. desc = { enumerable: true, get: function() { return m[k]; } };
  1896. }
  1897. Object.defineProperty(o, k2, desc);
  1898. }) : (function(o, m, k, k2) {
  1899. if (k2 === undefined) k2 = k;
  1900. o[k2] = m[k];
  1901. }));
  1902. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  1903. Object.defineProperty(o, "default", { enumerable: true, value: v });
  1904. }) : function(o, v) {
  1905. o["default"] = v;
  1906. });
  1907. var __importStar = (this && this.__importStar) || function (mod) {
  1908. if (mod && mod.__esModule) return mod;
  1909. var result = {};
  1910. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  1911. __setModuleDefault(result, mod);
  1912. return result;
  1913. };
  1914. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  1915. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  1916. return new (P || (P = Promise))(function (resolve, reject) {
  1917. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  1918. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  1919. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  1920. step((generator = generator.apply(thisArg, _arguments || [])).next());
  1921. });
  1922. };
  1923. Object.defineProperty(exports, "__esModule", ({ value: true }));
  1924. exports.checkCommitInfo = exports.testRef = exports.getRefSpec = exports.getRefSpecForAllHistory = exports.getCheckoutInfo = exports.tagsRefSpec = void 0;
  1925. const core = __importStar(__nccwpck_require__(2186));
  1926. const github = __importStar(__nccwpck_require__(5438));
  1927. const url_helper_1 = __nccwpck_require__(9437);
  1928. exports.tagsRefSpec = '+refs/tags/*:refs/tags/*';
  1929. function getCheckoutInfo(git, ref, commit) {
  1930. return __awaiter(this, void 0, void 0, function* () {
  1931. if (!git) {
  1932. throw new Error('Arg git cannot be empty');
  1933. }
  1934. if (!ref && !commit) {
  1935. throw new Error('Args ref and commit cannot both be empty');
  1936. }
  1937. const result = {};
  1938. const upperRef = (ref || '').toUpperCase();
  1939. // SHA only
  1940. if (!ref) {
  1941. result.ref = commit;
  1942. }
  1943. // refs/heads/
  1944. else if (upperRef.startsWith('REFS/HEADS/')) {
  1945. const branch = ref.substring('refs/heads/'.length);
  1946. result.ref = branch;
  1947. result.startPoint = `refs/remotes/origin/${branch}`;
  1948. }
  1949. // refs/pull/
  1950. else if (upperRef.startsWith('REFS/PULL/')) {
  1951. const branch = ref.substring('refs/pull/'.length);
  1952. result.ref = `refs/remotes/pull/${branch}`;
  1953. }
  1954. // refs/tags/
  1955. else if (upperRef.startsWith('REFS/')) {
  1956. result.ref = ref;
  1957. }
  1958. // Unqualified ref, check for a matching branch or tag
  1959. else {
  1960. if (yield git.branchExists(true, `origin/${ref}`)) {
  1961. result.ref = ref;
  1962. result.startPoint = `refs/remotes/origin/${ref}`;
  1963. }
  1964. else if (yield git.tagExists(`${ref}`)) {
  1965. result.ref = `refs/tags/${ref}`;
  1966. }
  1967. else {
  1968. throw new Error(`A branch or tag with the name '${ref}' could not be found`);
  1969. }
  1970. }
  1971. return result;
  1972. });
  1973. }
  1974. exports.getCheckoutInfo = getCheckoutInfo;
  1975. function getRefSpecForAllHistory(ref, commit) {
  1976. const result = ['+refs/heads/*:refs/remotes/origin/*', exports.tagsRefSpec];
  1977. if (ref && ref.toUpperCase().startsWith('REFS/PULL/')) {
  1978. const branch = ref.substring('refs/pull/'.length);
  1979. result.push(`+${commit || ref}:refs/remotes/pull/${branch}`);
  1980. }
  1981. return result;
  1982. }
  1983. exports.getRefSpecForAllHistory = getRefSpecForAllHistory;
  1984. function getRefSpec(ref, commit) {
  1985. if (!ref && !commit) {
  1986. throw new Error('Args ref and commit cannot both be empty');
  1987. }
  1988. const upperRef = (ref || '').toUpperCase();
  1989. // SHA
  1990. if (commit) {
  1991. // refs/heads
  1992. if (upperRef.startsWith('REFS/HEADS/')) {
  1993. const branch = ref.substring('refs/heads/'.length);
  1994. return [`+${commit}:refs/remotes/origin/${branch}`];
  1995. }
  1996. // refs/pull/
  1997. else if (upperRef.startsWith('REFS/PULL/')) {
  1998. const branch = ref.substring('refs/pull/'.length);
  1999. return [`+${commit}:refs/remotes/pull/${branch}`];
  2000. }
  2001. // refs/tags/
  2002. else if (upperRef.startsWith('REFS/TAGS/')) {
  2003. return [`+${commit}:${ref}`];
  2004. }
  2005. // Otherwise no destination ref
  2006. else {
  2007. return [commit];
  2008. }
  2009. }
  2010. // Unqualified ref, check for a matching branch or tag
  2011. else if (!upperRef.startsWith('REFS/')) {
  2012. return [
  2013. `+refs/heads/${ref}*:refs/remotes/origin/${ref}*`,
  2014. `+refs/tags/${ref}*:refs/tags/${ref}*`
  2015. ];
  2016. }
  2017. // refs/heads/
  2018. else if (upperRef.startsWith('REFS/HEADS/')) {
  2019. const branch = ref.substring('refs/heads/'.length);
  2020. return [`+${ref}:refs/remotes/origin/${branch}`];
  2021. }
  2022. // refs/pull/
  2023. else if (upperRef.startsWith('REFS/PULL/')) {
  2024. const branch = ref.substring('refs/pull/'.length);
  2025. return [`+${ref}:refs/remotes/pull/${branch}`];
  2026. }
  2027. // refs/tags/
  2028. else {
  2029. return [`+${ref}:${ref}`];
  2030. }
  2031. }
  2032. exports.getRefSpec = getRefSpec;
  2033. /**
  2034. * Tests whether the initial fetch created the ref at the expected commit
  2035. */
  2036. function testRef(git, ref, commit) {
  2037. return __awaiter(this, void 0, void 0, function* () {
  2038. if (!git) {
  2039. throw new Error('Arg git cannot be empty');
  2040. }
  2041. if (!ref && !commit) {
  2042. throw new Error('Args ref and commit cannot both be empty');
  2043. }
  2044. // No SHA? Nothing to test
  2045. if (!commit) {
  2046. return true;
  2047. }
  2048. // SHA only?
  2049. else if (!ref) {
  2050. return yield git.shaExists(commit);
  2051. }
  2052. const upperRef = ref.toUpperCase();
  2053. // refs/heads/
  2054. if (upperRef.startsWith('REFS/HEADS/')) {
  2055. const branch = ref.substring('refs/heads/'.length);
  2056. return ((yield git.branchExists(true, `origin/${branch}`)) &&
  2057. commit === (yield git.revParse(`refs/remotes/origin/${branch}`)));
  2058. }
  2059. // refs/pull/
  2060. else if (upperRef.startsWith('REFS/PULL/')) {
  2061. // Assume matches because fetched using the commit
  2062. return true;
  2063. }
  2064. // refs/tags/
  2065. else if (upperRef.startsWith('REFS/TAGS/')) {
  2066. const tagName = ref.substring('refs/tags/'.length);
  2067. return ((yield git.tagExists(tagName)) && commit === (yield git.revParse(ref)));
  2068. }
  2069. // Unexpected
  2070. else {
  2071. core.debug(`Unexpected ref format '${ref}' when testing ref info`);
  2072. return true;
  2073. }
  2074. });
  2075. }
  2076. exports.testRef = testRef;
  2077. function checkCommitInfo(token, commitInfo, repositoryOwner, repositoryName, ref, commit, baseUrl) {
  2078. return __awaiter(this, void 0, void 0, function* () {
  2079. var _a;
  2080. try {
  2081. // GHES?
  2082. if ((0, url_helper_1.isGhes)(baseUrl)) {
  2083. return;
  2084. }
  2085. // Auth token?
  2086. if (!token) {
  2087. return;
  2088. }
  2089. // Public PR synchronize, for workflow repo?
  2090. if (fromPayload('repository.private') !== false ||
  2091. github.context.eventName !== 'pull_request' ||
  2092. fromPayload('action') !== 'synchronize' ||
  2093. repositoryOwner !== github.context.repo.owner ||
  2094. repositoryName !== github.context.repo.repo ||
  2095. ref !== github.context.ref ||
  2096. !ref.startsWith('refs/pull/') ||
  2097. commit !== github.context.sha) {
  2098. return;
  2099. }
  2100. // Head SHA
  2101. const expectedHeadSha = fromPayload('after');
  2102. if (!expectedHeadSha) {
  2103. core.debug('Unable to determine head sha');
  2104. return;
  2105. }
  2106. // Base SHA
  2107. const expectedBaseSha = fromPayload('pull_request.base.sha');
  2108. if (!expectedBaseSha) {
  2109. core.debug('Unable to determine base sha');
  2110. return;
  2111. }
  2112. // Expected message?
  2113. const expectedMessage = `Merge ${expectedHeadSha} into ${expectedBaseSha}`;
  2114. if (commitInfo.indexOf(expectedMessage) >= 0) {
  2115. return;
  2116. }
  2117. // Extract details from message
  2118. const match = commitInfo.match(/Merge ([0-9a-f]{40}) into ([0-9a-f]{40})/);
  2119. if (!match) {
  2120. core.debug('Unexpected message format');
  2121. return;
  2122. }
  2123. // Post telemetry
  2124. const actualHeadSha = match[1];
  2125. if (actualHeadSha !== expectedHeadSha) {
  2126. core.debug(`Expected head sha ${expectedHeadSha}; actual head sha ${actualHeadSha}`);
  2127. const octokit = github.getOctokit(token, {
  2128. baseUrl: (0, url_helper_1.getServerApiUrl)(baseUrl),
  2129. 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})`
  2130. });
  2131. yield octokit.rest.repos.get({
  2132. owner: repositoryOwner,
  2133. repo: repositoryName
  2134. });
  2135. }
  2136. }
  2137. catch (err) {
  2138. core.debug(`Error when validating commit info: ${(_a = err === null || err === void 0 ? void 0 : err.stack) !== null && _a !== void 0 ? _a : err}`);
  2139. }
  2140. });
  2141. }
  2142. exports.checkCommitInfo = checkCommitInfo;
  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 = void 0;
  2163. function escape(value) {
  2164. return value.replace(/[^a-zA-Z0-9_]/g, x => {
  2165. return `\\${x}`;
  2166. });
  2167. }
  2168. exports.escape = escape;
  2169. /***/ }),
  2170. /***/ 2155:
  2171. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  2172. "use strict";
  2173. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  2174. if (k2 === undefined) k2 = k;
  2175. var desc = Object.getOwnPropertyDescriptor(m, k);
  2176. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  2177. desc = { enumerable: true, get: function() { return m[k]; } };
  2178. }
  2179. Object.defineProperty(o, k2, desc);
  2180. }) : (function(o, m, k, k2) {
  2181. if (k2 === undefined) k2 = k;
  2182. o[k2] = m[k];
  2183. }));
  2184. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  2185. Object.defineProperty(o, "default", { enumerable: true, value: v });
  2186. }) : function(o, v) {
  2187. o["default"] = v;
  2188. });
  2189. var __importStar = (this && this.__importStar) || function (mod) {
  2190. if (mod && mod.__esModule) return mod;
  2191. var result = {};
  2192. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  2193. __setModuleDefault(result, mod);
  2194. return result;
  2195. };
  2196. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  2197. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  2198. return new (P || (P = Promise))(function (resolve, reject) {
  2199. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  2200. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  2201. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  2202. step((generator = generator.apply(thisArg, _arguments || [])).next());
  2203. });
  2204. };
  2205. Object.defineProperty(exports, "__esModule", ({ value: true }));
  2206. exports.execute = exports.RetryHelper = void 0;
  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. exports.execute = execute;
  2259. /***/ }),
  2260. /***/ 4866:
  2261. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  2262. "use strict";
  2263. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  2264. if (k2 === undefined) k2 = k;
  2265. var desc = Object.getOwnPropertyDescriptor(m, k);
  2266. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  2267. desc = { enumerable: true, get: function() { return m[k]; } };
  2268. }
  2269. Object.defineProperty(o, k2, desc);
  2270. }) : (function(o, m, k, k2) {
  2271. if (k2 === undefined) k2 = k;
  2272. o[k2] = m[k];
  2273. }));
  2274. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  2275. Object.defineProperty(o, "default", { enumerable: true, value: v });
  2276. }) : function(o, v) {
  2277. o["default"] = v;
  2278. });
  2279. var __importStar = (this && this.__importStar) || function (mod) {
  2280. if (mod && mod.__esModule) return mod;
  2281. var result = {};
  2282. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  2283. __setModuleDefault(result, mod);
  2284. return result;
  2285. };
  2286. Object.defineProperty(exports, "__esModule", ({ value: true }));
  2287. exports.setSafeDirectory = exports.setSshKnownHostsPath = exports.setSshKeyPath = exports.setRepositoryPath = exports.SshKnownHostsPath = exports.SshKeyPath = exports.PostSetSafeDirectory = exports.RepositoryPath = exports.IsPost = void 0;
  2288. const core = __importStar(__nccwpck_require__(2186));
  2289. /**
  2290. * Indicates whether the POST action is running
  2291. */
  2292. exports.IsPost = !!core.getState('isPost');
  2293. /**
  2294. * The repository path for the POST action. The value is empty during the MAIN action.
  2295. */
  2296. exports.RepositoryPath = core.getState('repositoryPath');
  2297. /**
  2298. * The set-safe-directory for the POST action. The value is set if input: 'safe-directory' is set during the MAIN action.
  2299. */
  2300. exports.PostSetSafeDirectory = core.getState('setSafeDirectory') === 'true';
  2301. /**
  2302. * The SSH key path for the POST action. The value is empty during the MAIN action.
  2303. */
  2304. exports.SshKeyPath = core.getState('sshKeyPath');
  2305. /**
  2306. * The SSH known hosts path for the POST action. The value is empty during the MAIN action.
  2307. */
  2308. exports.SshKnownHostsPath = core.getState('sshKnownHostsPath');
  2309. /**
  2310. * Save the repository path so the POST action can retrieve the value.
  2311. */
  2312. function setRepositoryPath(repositoryPath) {
  2313. core.saveState('repositoryPath', repositoryPath);
  2314. }
  2315. exports.setRepositoryPath = setRepositoryPath;
  2316. /**
  2317. * Save the SSH key path so the POST action can retrieve the value.
  2318. */
  2319. function setSshKeyPath(sshKeyPath) {
  2320. core.saveState('sshKeyPath', sshKeyPath);
  2321. }
  2322. exports.setSshKeyPath = setSshKeyPath;
  2323. /**
  2324. * Save the SSH known hosts path so the POST action can retrieve the value.
  2325. */
  2326. function setSshKnownHostsPath(sshKnownHostsPath) {
  2327. core.saveState('sshKnownHostsPath', sshKnownHostsPath);
  2328. }
  2329. exports.setSshKnownHostsPath = setSshKnownHostsPath;
  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. exports.setSafeDirectory = setSafeDirectory;
  2337. // Publish a variable so that when the POST action runs, it can determine it should run the cleanup logic.
  2338. // This is necessary since we don't have a separate entry point.
  2339. if (!exports.IsPost) {
  2340. core.saveState('isPost', 'true');
  2341. }
  2342. /***/ }),
  2343. /***/ 9437:
  2344. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  2345. "use strict";
  2346. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  2347. if (k2 === undefined) k2 = k;
  2348. var desc = Object.getOwnPropertyDescriptor(m, k);
  2349. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  2350. desc = { enumerable: true, get: function() { return m[k]; } };
  2351. }
  2352. Object.defineProperty(o, k2, desc);
  2353. }) : (function(o, m, k, k2) {
  2354. if (k2 === undefined) k2 = k;
  2355. o[k2] = m[k];
  2356. }));
  2357. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  2358. Object.defineProperty(o, "default", { enumerable: true, value: v });
  2359. }) : function(o, v) {
  2360. o["default"] = v;
  2361. });
  2362. var __importStar = (this && this.__importStar) || function (mod) {
  2363. if (mod && mod.__esModule) return mod;
  2364. var result = {};
  2365. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  2366. __setModuleDefault(result, mod);
  2367. return result;
  2368. };
  2369. Object.defineProperty(exports, "__esModule", ({ value: true }));
  2370. exports.isGhes = exports.getServerApiUrl = exports.getServerUrl = exports.getFetchUrl = void 0;
  2371. const assert = __importStar(__nccwpck_require__(9491));
  2372. const url_1 = __nccwpck_require__(7310);
  2373. function getFetchUrl(settings) {
  2374. assert.ok(settings.repositoryOwner, 'settings.repositoryOwner must be defined');
  2375. assert.ok(settings.repositoryName, 'settings.repositoryName must be defined');
  2376. const serviceUrl = getServerUrl(settings.githubServerUrl);
  2377. const encodedOwner = encodeURIComponent(settings.repositoryOwner);
  2378. const encodedName = encodeURIComponent(settings.repositoryName);
  2379. if (settings.sshKey) {
  2380. const user = settings.sshUser.length > 0 ? settings.sshUser : 'git';
  2381. return `${user}@${serviceUrl.hostname}:${encodedOwner}/${encodedName}.git`;
  2382. }
  2383. // "origin" is SCHEME://HOSTNAME[:PORT]
  2384. return `${serviceUrl.origin}/${encodedOwner}/${encodedName}`;
  2385. }
  2386. exports.getFetchUrl = getFetchUrl;
  2387. function getServerUrl(url) {
  2388. let urlValue = url && url.trim().length > 0
  2389. ? url
  2390. : process.env['GITHUB_SERVER_URL'] || 'https://github.com';
  2391. return new url_1.URL(urlValue);
  2392. }
  2393. exports.getServerUrl = getServerUrl;
  2394. function getServerApiUrl(url) {
  2395. let apiUrl = 'https://api.github.com';
  2396. if (isGhes(url)) {
  2397. const serverUrl = getServerUrl(url);
  2398. apiUrl = new url_1.URL(`${serverUrl.origin}/api/v3`).toString();
  2399. }
  2400. return apiUrl;
  2401. }
  2402. exports.getServerApiUrl = getServerApiUrl;
  2403. function isGhes(url) {
  2404. const ghUrl = getServerUrl(url);
  2405. return ghUrl.hostname.toUpperCase() !== 'GITHUB.COM';
  2406. }
  2407. exports.isGhes = isGhes;
  2408. /***/ }),
  2409. /***/ 9568:
  2410. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  2411. "use strict";
  2412. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  2413. if (k2 === undefined) k2 = k;
  2414. var desc = Object.getOwnPropertyDescriptor(m, k);
  2415. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  2416. desc = { enumerable: true, get: function() { return m[k]; } };
  2417. }
  2418. Object.defineProperty(o, k2, desc);
  2419. }) : (function(o, m, k, k2) {
  2420. if (k2 === undefined) k2 = k;
  2421. o[k2] = m[k];
  2422. }));
  2423. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  2424. Object.defineProperty(o, "default", { enumerable: true, value: v });
  2425. }) : function(o, v) {
  2426. o["default"] = v;
  2427. });
  2428. var __importStar = (this && this.__importStar) || function (mod) {
  2429. if (mod && mod.__esModule) return mod;
  2430. var result = {};
  2431. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  2432. __setModuleDefault(result, mod);
  2433. return result;
  2434. };
  2435. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  2436. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  2437. return new (P || (P = Promise))(function (resolve, reject) {
  2438. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  2439. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  2440. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  2441. step((generator = generator.apply(thisArg, _arguments || [])).next());
  2442. });
  2443. };
  2444. Object.defineProperty(exports, "__esModule", ({ value: true }));
  2445. exports.getOrganizationId = void 0;
  2446. const core = __importStar(__nccwpck_require__(2186));
  2447. const fs = __importStar(__nccwpck_require__(7147));
  2448. /**
  2449. * Gets the organization ID of the running workflow or undefined if the value cannot be loaded from the GITHUB_EVENT_PATH
  2450. */
  2451. function getOrganizationId() {
  2452. return __awaiter(this, void 0, void 0, function* () {
  2453. var _a, _b;
  2454. try {
  2455. const eventPath = process.env.GITHUB_EVENT_PATH;
  2456. if (!eventPath) {
  2457. core.debug(`GITHUB_EVENT_PATH is not defined`);
  2458. return;
  2459. }
  2460. const content = yield fs.promises.readFile(eventPath, { encoding: 'utf8' });
  2461. const event = JSON.parse(content);
  2462. 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;
  2463. if (typeof id !== 'number') {
  2464. core.debug('Repository owner ID not found within GITHUB event info');
  2465. return;
  2466. }
  2467. return id;
  2468. }
  2469. catch (err) {
  2470. core.debug(`Unable to load organization ID from GITHUB_EVENT_PATH: ${err.message || err}`);
  2471. }
  2472. });
  2473. }
  2474. exports.getOrganizationId = getOrganizationId;
  2475. /***/ }),
  2476. /***/ 7351:
  2477. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  2478. "use strict";
  2479. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  2480. if (k2 === undefined) k2 = k;
  2481. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  2482. }) : (function(o, m, k, k2) {
  2483. if (k2 === undefined) k2 = k;
  2484. o[k2] = m[k];
  2485. }));
  2486. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  2487. Object.defineProperty(o, "default", { enumerable: true, value: v });
  2488. }) : function(o, v) {
  2489. o["default"] = v;
  2490. });
  2491. var __importStar = (this && this.__importStar) || function (mod) {
  2492. if (mod && mod.__esModule) return mod;
  2493. var result = {};
  2494. if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  2495. __setModuleDefault(result, mod);
  2496. return result;
  2497. };
  2498. Object.defineProperty(exports, "__esModule", ({ value: true }));
  2499. exports.issue = exports.issueCommand = void 0;
  2500. const os = __importStar(__nccwpck_require__(2037));
  2501. const utils_1 = __nccwpck_require__(5278);
  2502. /**
  2503. * Commands
  2504. *
  2505. * Command Format:
  2506. * ::name key=value,key=value::message
  2507. *
  2508. * Examples:
  2509. * ::warning::This is the message
  2510. * ::set-env name=MY_VAR::some value
  2511. */
  2512. function issueCommand(command, properties, message) {
  2513. const cmd = new Command(command, properties, message);
  2514. process.stdout.write(cmd.toString() + os.EOL);
  2515. }
  2516. exports.issueCommand = issueCommand;
  2517. function issue(name, message = '') {
  2518. issueCommand(name, {}, message);
  2519. }
  2520. exports.issue = issue;
  2521. const CMD_STRING = '::';
  2522. class Command {
  2523. constructor(command, properties, message) {
  2524. if (!command) {
  2525. command = 'missing.command';
  2526. }
  2527. this.command = command;
  2528. this.properties = properties;
  2529. this.message = message;
  2530. }
  2531. toString() {
  2532. let cmdStr = CMD_STRING + this.command;
  2533. if (this.properties && Object.keys(this.properties).length > 0) {
  2534. cmdStr += ' ';
  2535. let first = true;
  2536. for (const key in this.properties) {
  2537. if (this.properties.hasOwnProperty(key)) {
  2538. const val = this.properties[key];
  2539. if (val) {
  2540. if (first) {
  2541. first = false;
  2542. }
  2543. else {
  2544. cmdStr += ',';
  2545. }
  2546. cmdStr += `${key}=${escapeProperty(val)}`;
  2547. }
  2548. }
  2549. }
  2550. }
  2551. cmdStr += `${CMD_STRING}${escapeData(this.message)}`;
  2552. return cmdStr;
  2553. }
  2554. }
  2555. function escapeData(s) {
  2556. return utils_1.toCommandValue(s)
  2557. .replace(/%/g, '%25')
  2558. .replace(/\r/g, '%0D')
  2559. .replace(/\n/g, '%0A');
  2560. }
  2561. function escapeProperty(s) {
  2562. return utils_1.toCommandValue(s)
  2563. .replace(/%/g, '%25')
  2564. .replace(/\r/g, '%0D')
  2565. .replace(/\n/g, '%0A')
  2566. .replace(/:/g, '%3A')
  2567. .replace(/,/g, '%2C');
  2568. }
  2569. //# sourceMappingURL=command.js.map
  2570. /***/ }),
  2571. /***/ 2186:
  2572. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  2573. "use strict";
  2574. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  2575. if (k2 === undefined) k2 = k;
  2576. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  2577. }) : (function(o, m, k, k2) {
  2578. if (k2 === undefined) k2 = k;
  2579. o[k2] = m[k];
  2580. }));
  2581. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  2582. Object.defineProperty(o, "default", { enumerable: true, value: v });
  2583. }) : function(o, v) {
  2584. o["default"] = v;
  2585. });
  2586. var __importStar = (this && this.__importStar) || function (mod) {
  2587. if (mod && mod.__esModule) return mod;
  2588. var result = {};
  2589. if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  2590. __setModuleDefault(result, mod);
  2591. return result;
  2592. };
  2593. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  2594. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  2595. return new (P || (P = Promise))(function (resolve, reject) {
  2596. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  2597. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  2598. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  2599. step((generator = generator.apply(thisArg, _arguments || [])).next());
  2600. });
  2601. };
  2602. Object.defineProperty(exports, "__esModule", ({ value: true }));
  2603. 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;
  2604. const command_1 = __nccwpck_require__(7351);
  2605. const file_command_1 = __nccwpck_require__(717);
  2606. const utils_1 = __nccwpck_require__(5278);
  2607. const os = __importStar(__nccwpck_require__(2037));
  2608. const path = __importStar(__nccwpck_require__(1017));
  2609. const oidc_utils_1 = __nccwpck_require__(8041);
  2610. /**
  2611. * The code to exit an action
  2612. */
  2613. var ExitCode;
  2614. (function (ExitCode) {
  2615. /**
  2616. * A code indicating that the action was successful
  2617. */
  2618. ExitCode[ExitCode["Success"] = 0] = "Success";
  2619. /**
  2620. * A code indicating that the action was a failure
  2621. */
  2622. ExitCode[ExitCode["Failure"] = 1] = "Failure";
  2623. })(ExitCode = exports.ExitCode || (exports.ExitCode = {}));
  2624. //-----------------------------------------------------------------------
  2625. // Variables
  2626. //-----------------------------------------------------------------------
  2627. /**
  2628. * Sets env variable for this action and future actions in the job
  2629. * @param name the name of the variable to set
  2630. * @param val the value of the variable. Non-string values will be converted to a string via JSON.stringify
  2631. */
  2632. // eslint-disable-next-line @typescript-eslint/no-explicit-any
  2633. function exportVariable(name, val) {
  2634. const convertedVal = utils_1.toCommandValue(val);
  2635. process.env[name] = convertedVal;
  2636. const filePath = process.env['GITHUB_ENV'] || '';
  2637. if (filePath) {
  2638. return file_command_1.issueFileCommand('ENV', file_command_1.prepareKeyValueMessage(name, val));
  2639. }
  2640. command_1.issueCommand('set-env', { name }, convertedVal);
  2641. }
  2642. exports.exportVariable = exportVariable;
  2643. /**
  2644. * Registers a secret which will get masked from logs
  2645. * @param secret value of the secret
  2646. */
  2647. function setSecret(secret) {
  2648. command_1.issueCommand('add-mask', {}, secret);
  2649. }
  2650. exports.setSecret = setSecret;
  2651. /**
  2652. * Prepends inputPath to the PATH (for this action and future actions)
  2653. * @param inputPath
  2654. */
  2655. function addPath(inputPath) {
  2656. const filePath = process.env['GITHUB_PATH'] || '';
  2657. if (filePath) {
  2658. file_command_1.issueFileCommand('PATH', inputPath);
  2659. }
  2660. else {
  2661. command_1.issueCommand('add-path', {}, inputPath);
  2662. }
  2663. process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`;
  2664. }
  2665. exports.addPath = addPath;
  2666. /**
  2667. * Gets the value of an input.
  2668. * Unless trimWhitespace is set to false in InputOptions, the value is also trimmed.
  2669. * Returns an empty string if the value is not defined.
  2670. *
  2671. * @param name name of the input to get
  2672. * @param options optional. See InputOptions.
  2673. * @returns string
  2674. */
  2675. function getInput(name, options) {
  2676. const val = process.env[`INPUT_${name.replace(/ /g, '_').toUpperCase()}`] || '';
  2677. if (options && options.required && !val) {
  2678. throw new Error(`Input required and not supplied: ${name}`);
  2679. }
  2680. if (options && options.trimWhitespace === false) {
  2681. return val;
  2682. }
  2683. return val.trim();
  2684. }
  2685. exports.getInput = getInput;
  2686. /**
  2687. * Gets the values of an multiline input. Each value is also trimmed.
  2688. *
  2689. * @param name name of the input to get
  2690. * @param options optional. See InputOptions.
  2691. * @returns string[]
  2692. *
  2693. */
  2694. function getMultilineInput(name, options) {
  2695. const inputs = getInput(name, options)
  2696. .split('\n')
  2697. .filter(x => x !== '');
  2698. if (options && options.trimWhitespace === false) {
  2699. return inputs;
  2700. }
  2701. return inputs.map(input => input.trim());
  2702. }
  2703. exports.getMultilineInput = getMultilineInput;
  2704. /**
  2705. * Gets the input value of the boolean type in the YAML 1.2 "core schema" specification.
  2706. * Support boolean input list: `true | True | TRUE | false | False | FALSE` .
  2707. * The return value is also in boolean type.
  2708. * ref: https://yaml.org/spec/1.2/spec.html#id2804923
  2709. *
  2710. * @param name name of the input to get
  2711. * @param options optional. See InputOptions.
  2712. * @returns boolean
  2713. */
  2714. function getBooleanInput(name, options) {
  2715. const trueValue = ['true', 'True', 'TRUE'];
  2716. const falseValue = ['false', 'False', 'FALSE'];
  2717. const val = getInput(name, options);
  2718. if (trueValue.includes(val))
  2719. return true;
  2720. if (falseValue.includes(val))
  2721. return false;
  2722. throw new TypeError(`Input does not meet YAML 1.2 "Core Schema" specification: ${name}\n` +
  2723. `Support boolean input list: \`true | True | TRUE | false | False | FALSE\``);
  2724. }
  2725. exports.getBooleanInput = getBooleanInput;
  2726. /**
  2727. * Sets the value of an output.
  2728. *
  2729. * @param name name of the output to set
  2730. * @param value value to store. Non-string values will be converted to a string via JSON.stringify
  2731. */
  2732. // eslint-disable-next-line @typescript-eslint/no-explicit-any
  2733. function setOutput(name, value) {
  2734. const filePath = process.env['GITHUB_OUTPUT'] || '';
  2735. if (filePath) {
  2736. return file_command_1.issueFileCommand('OUTPUT', file_command_1.prepareKeyValueMessage(name, value));
  2737. }
  2738. process.stdout.write(os.EOL);
  2739. command_1.issueCommand('set-output', { name }, utils_1.toCommandValue(value));
  2740. }
  2741. exports.setOutput = setOutput;
  2742. /**
  2743. * Enables or disables the echoing of commands into stdout for the rest of the step.
  2744. * Echoing is disabled by default if ACTIONS_STEP_DEBUG is not set.
  2745. *
  2746. */
  2747. function setCommandEcho(enabled) {
  2748. command_1.issue('echo', enabled ? 'on' : 'off');
  2749. }
  2750. exports.setCommandEcho = setCommandEcho;
  2751. //-----------------------------------------------------------------------
  2752. // Results
  2753. //-----------------------------------------------------------------------
  2754. /**
  2755. * Sets the action status to failed.
  2756. * When the action exits it will be with an exit code of 1
  2757. * @param message add error issue message
  2758. */
  2759. function setFailed(message) {
  2760. process.exitCode = ExitCode.Failure;
  2761. error(message);
  2762. }
  2763. exports.setFailed = setFailed;
  2764. //-----------------------------------------------------------------------
  2765. // Logging Commands
  2766. //-----------------------------------------------------------------------
  2767. /**
  2768. * Gets whether Actions Step Debug is on or not
  2769. */
  2770. function isDebug() {
  2771. return process.env['RUNNER_DEBUG'] === '1';
  2772. }
  2773. exports.isDebug = isDebug;
  2774. /**
  2775. * Writes debug message to user log
  2776. * @param message debug message
  2777. */
  2778. function debug(message) {
  2779. command_1.issueCommand('debug', {}, message);
  2780. }
  2781. exports.debug = debug;
  2782. /**
  2783. * Adds an error issue
  2784. * @param message error issue message. Errors will be converted to string via toString()
  2785. * @param properties optional properties to add to the annotation.
  2786. */
  2787. function error(message, properties = {}) {
  2788. command_1.issueCommand('error', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message);
  2789. }
  2790. exports.error = error;
  2791. /**
  2792. * Adds a warning issue
  2793. * @param message warning issue message. Errors will be converted to string via toString()
  2794. * @param properties optional properties to add to the annotation.
  2795. */
  2796. function warning(message, properties = {}) {
  2797. command_1.issueCommand('warning', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message);
  2798. }
  2799. exports.warning = warning;
  2800. /**
  2801. * Adds a notice issue
  2802. * @param message notice issue message. Errors will be converted to string via toString()
  2803. * @param properties optional properties to add to the annotation.
  2804. */
  2805. function notice(message, properties = {}) {
  2806. command_1.issueCommand('notice', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message);
  2807. }
  2808. exports.notice = notice;
  2809. /**
  2810. * Writes info to log with console.log.
  2811. * @param message info message
  2812. */
  2813. function info(message) {
  2814. process.stdout.write(message + os.EOL);
  2815. }
  2816. exports.info = info;
  2817. /**
  2818. * Begin an output group.
  2819. *
  2820. * Output until the next `groupEnd` will be foldable in this group
  2821. *
  2822. * @param name The name of the output group
  2823. */
  2824. function startGroup(name) {
  2825. command_1.issue('group', name);
  2826. }
  2827. exports.startGroup = startGroup;
  2828. /**
  2829. * End an output group.
  2830. */
  2831. function endGroup() {
  2832. command_1.issue('endgroup');
  2833. }
  2834. exports.endGroup = endGroup;
  2835. /**
  2836. * Wrap an asynchronous function call in a group.
  2837. *
  2838. * Returns the same type as the function itself.
  2839. *
  2840. * @param name The name of the group
  2841. * @param fn The function to wrap in the group
  2842. */
  2843. function group(name, fn) {
  2844. return __awaiter(this, void 0, void 0, function* () {
  2845. startGroup(name);
  2846. let result;
  2847. try {
  2848. result = yield fn();
  2849. }
  2850. finally {
  2851. endGroup();
  2852. }
  2853. return result;
  2854. });
  2855. }
  2856. exports.group = group;
  2857. //-----------------------------------------------------------------------
  2858. // Wrapper action state
  2859. //-----------------------------------------------------------------------
  2860. /**
  2861. * Saves state for current action, the state can only be retrieved by this action's post job execution.
  2862. *
  2863. * @param name name of the state to store
  2864. * @param value value to store. Non-string values will be converted to a string via JSON.stringify
  2865. */
  2866. // eslint-disable-next-line @typescript-eslint/no-explicit-any
  2867. function saveState(name, value) {
  2868. const filePath = process.env['GITHUB_STATE'] || '';
  2869. if (filePath) {
  2870. return file_command_1.issueFileCommand('STATE', file_command_1.prepareKeyValueMessage(name, value));
  2871. }
  2872. command_1.issueCommand('save-state', { name }, utils_1.toCommandValue(value));
  2873. }
  2874. exports.saveState = saveState;
  2875. /**
  2876. * Gets the value of an state set by this action's main execution.
  2877. *
  2878. * @param name name of the state to get
  2879. * @returns string
  2880. */
  2881. function getState(name) {
  2882. return process.env[`STATE_${name}`] || '';
  2883. }
  2884. exports.getState = getState;
  2885. function getIDToken(aud) {
  2886. return __awaiter(this, void 0, void 0, function* () {
  2887. return yield oidc_utils_1.OidcClient.getIDToken(aud);
  2888. });
  2889. }
  2890. exports.getIDToken = getIDToken;
  2891. /**
  2892. * Summary exports
  2893. */
  2894. var summary_1 = __nccwpck_require__(1327);
  2895. Object.defineProperty(exports, "summary", ({ enumerable: true, get: function () { return summary_1.summary; } }));
  2896. /**
  2897. * @deprecated use core.summary
  2898. */
  2899. var summary_2 = __nccwpck_require__(1327);
  2900. Object.defineProperty(exports, "markdownSummary", ({ enumerable: true, get: function () { return summary_2.markdownSummary; } }));
  2901. /**
  2902. * Path exports
  2903. */
  2904. var path_utils_1 = __nccwpck_require__(2981);
  2905. Object.defineProperty(exports, "toPosixPath", ({ enumerable: true, get: function () { return path_utils_1.toPosixPath; } }));
  2906. Object.defineProperty(exports, "toWin32Path", ({ enumerable: true, get: function () { return path_utils_1.toWin32Path; } }));
  2907. Object.defineProperty(exports, "toPlatformPath", ({ enumerable: true, get: function () { return path_utils_1.toPlatformPath; } }));
  2908. //# sourceMappingURL=core.js.map
  2909. /***/ }),
  2910. /***/ 717:
  2911. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  2912. "use strict";
  2913. // For internal use, subject to change.
  2914. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  2915. if (k2 === undefined) k2 = k;
  2916. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  2917. }) : (function(o, m, k, k2) {
  2918. if (k2 === undefined) k2 = k;
  2919. o[k2] = m[k];
  2920. }));
  2921. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  2922. Object.defineProperty(o, "default", { enumerable: true, value: v });
  2923. }) : function(o, v) {
  2924. o["default"] = v;
  2925. });
  2926. var __importStar = (this && this.__importStar) || function (mod) {
  2927. if (mod && mod.__esModule) return mod;
  2928. var result = {};
  2929. if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  2930. __setModuleDefault(result, mod);
  2931. return result;
  2932. };
  2933. Object.defineProperty(exports, "__esModule", ({ value: true }));
  2934. exports.prepareKeyValueMessage = exports.issueFileCommand = void 0;
  2935. // We use any as a valid input type
  2936. /* eslint-disable @typescript-eslint/no-explicit-any */
  2937. const fs = __importStar(__nccwpck_require__(7147));
  2938. const os = __importStar(__nccwpck_require__(2037));
  2939. const uuid_1 = __nccwpck_require__(8974);
  2940. const utils_1 = __nccwpck_require__(5278);
  2941. function issueFileCommand(command, message) {
  2942. const filePath = process.env[`GITHUB_${command}`];
  2943. if (!filePath) {
  2944. throw new Error(`Unable to find environment variable for file command ${command}`);
  2945. }
  2946. if (!fs.existsSync(filePath)) {
  2947. throw new Error(`Missing file at path: ${filePath}`);
  2948. }
  2949. fs.appendFileSync(filePath, `${utils_1.toCommandValue(message)}${os.EOL}`, {
  2950. encoding: 'utf8'
  2951. });
  2952. }
  2953. exports.issueFileCommand = issueFileCommand;
  2954. function prepareKeyValueMessage(key, value) {
  2955. const delimiter = `ghadelimiter_${uuid_1.v4()}`;
  2956. const convertedValue = utils_1.toCommandValue(value);
  2957. // These should realistically never happen, but just in case someone finds a
  2958. // way to exploit uuid generation let's not allow keys or values that contain
  2959. // the delimiter.
  2960. if (key.includes(delimiter)) {
  2961. throw new Error(`Unexpected input: name should not contain the delimiter "${delimiter}"`);
  2962. }
  2963. if (convertedValue.includes(delimiter)) {
  2964. throw new Error(`Unexpected input: value should not contain the delimiter "${delimiter}"`);
  2965. }
  2966. return `${key}<<${delimiter}${os.EOL}${convertedValue}${os.EOL}${delimiter}`;
  2967. }
  2968. exports.prepareKeyValueMessage = prepareKeyValueMessage;
  2969. //# sourceMappingURL=file-command.js.map
  2970. /***/ }),
  2971. /***/ 8041:
  2972. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  2973. "use strict";
  2974. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  2975. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  2976. return new (P || (P = Promise))(function (resolve, reject) {
  2977. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  2978. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  2979. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  2980. step((generator = generator.apply(thisArg, _arguments || [])).next());
  2981. });
  2982. };
  2983. Object.defineProperty(exports, "__esModule", ({ value: true }));
  2984. exports.OidcClient = void 0;
  2985. const http_client_1 = __nccwpck_require__(6255);
  2986. const auth_1 = __nccwpck_require__(5526);
  2987. const core_1 = __nccwpck_require__(2186);
  2988. class OidcClient {
  2989. static createHttpClient(allowRetry = true, maxRetry = 10) {
  2990. const requestOptions = {
  2991. allowRetries: allowRetry,
  2992. maxRetries: maxRetry
  2993. };
  2994. return new http_client_1.HttpClient('actions/oidc-client', [new auth_1.BearerCredentialHandler(OidcClient.getRequestToken())], requestOptions);
  2995. }
  2996. static getRequestToken() {
  2997. const token = process.env['ACTIONS_ID_TOKEN_REQUEST_TOKEN'];
  2998. if (!token) {
  2999. throw new Error('Unable to get ACTIONS_ID_TOKEN_REQUEST_TOKEN env variable');
  3000. }
  3001. return token;
  3002. }
  3003. static getIDTokenUrl() {
  3004. const runtimeUrl = process.env['ACTIONS_ID_TOKEN_REQUEST_URL'];
  3005. if (!runtimeUrl) {
  3006. throw new Error('Unable to get ACTIONS_ID_TOKEN_REQUEST_URL env variable');
  3007. }
  3008. return runtimeUrl;
  3009. }
  3010. static getCall(id_token_url) {
  3011. var _a;
  3012. return __awaiter(this, void 0, void 0, function* () {
  3013. const httpclient = OidcClient.createHttpClient();
  3014. const res = yield httpclient
  3015. .getJson(id_token_url)
  3016. .catch(error => {
  3017. throw new Error(`Failed to get ID Token. \n
  3018. Error Code : ${error.statusCode}\n
  3019. Error Message: ${error.message}`);
  3020. });
  3021. const id_token = (_a = res.result) === null || _a === void 0 ? void 0 : _a.value;
  3022. if (!id_token) {
  3023. throw new Error('Response json body do not have ID Token field');
  3024. }
  3025. return id_token;
  3026. });
  3027. }
  3028. static getIDToken(audience) {
  3029. return __awaiter(this, void 0, void 0, function* () {
  3030. try {
  3031. // New ID Token is requested from action service
  3032. let id_token_url = OidcClient.getIDTokenUrl();
  3033. if (audience) {
  3034. const encodedAudience = encodeURIComponent(audience);
  3035. id_token_url = `${id_token_url}&audience=${encodedAudience}`;
  3036. }
  3037. core_1.debug(`ID token url is ${id_token_url}`);
  3038. const id_token = yield OidcClient.getCall(id_token_url);
  3039. core_1.setSecret(id_token);
  3040. return id_token;
  3041. }
  3042. catch (error) {
  3043. throw new Error(`Error message: ${error.message}`);
  3044. }
  3045. });
  3046. }
  3047. }
  3048. exports.OidcClient = OidcClient;
  3049. //# sourceMappingURL=oidc-utils.js.map
  3050. /***/ }),
  3051. /***/ 2981:
  3052. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  3053. "use strict";
  3054. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  3055. if (k2 === undefined) k2 = k;
  3056. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  3057. }) : (function(o, m, k, k2) {
  3058. if (k2 === undefined) k2 = k;
  3059. o[k2] = m[k];
  3060. }));
  3061. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  3062. Object.defineProperty(o, "default", { enumerable: true, value: v });
  3063. }) : function(o, v) {
  3064. o["default"] = v;
  3065. });
  3066. var __importStar = (this && this.__importStar) || function (mod) {
  3067. if (mod && mod.__esModule) return mod;
  3068. var result = {};
  3069. if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  3070. __setModuleDefault(result, mod);
  3071. return result;
  3072. };
  3073. Object.defineProperty(exports, "__esModule", ({ value: true }));
  3074. exports.toPlatformPath = exports.toWin32Path = exports.toPosixPath = void 0;
  3075. const path = __importStar(__nccwpck_require__(1017));
  3076. /**
  3077. * toPosixPath converts the given path to the posix form. On Windows, \\ will be
  3078. * replaced with /.
  3079. *
  3080. * @param pth. Path to transform.
  3081. * @return string Posix path.
  3082. */
  3083. function toPosixPath(pth) {
  3084. return pth.replace(/[\\]/g, '/');
  3085. }
  3086. exports.toPosixPath = toPosixPath;
  3087. /**
  3088. * toWin32Path converts the given path to the win32 form. On Linux, / will be
  3089. * replaced with \\.
  3090. *
  3091. * @param pth. Path to transform.
  3092. * @return string Win32 path.
  3093. */
  3094. function toWin32Path(pth) {
  3095. return pth.replace(/[/]/g, '\\');
  3096. }
  3097. exports.toWin32Path = toWin32Path;
  3098. /**
  3099. * toPlatformPath converts the given path to a platform-specific path. It does
  3100. * this by replacing instances of / and \ with the platform-specific path
  3101. * separator.
  3102. *
  3103. * @param pth The path to platformize.
  3104. * @return string The platform-specific path.
  3105. */
  3106. function toPlatformPath(pth) {
  3107. return pth.replace(/[/\\]/g, path.sep);
  3108. }
  3109. exports.toPlatformPath = toPlatformPath;
  3110. //# sourceMappingURL=path-utils.js.map
  3111. /***/ }),
  3112. /***/ 1327:
  3113. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  3114. "use strict";
  3115. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  3116. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  3117. return new (P || (P = Promise))(function (resolve, reject) {
  3118. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  3119. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  3120. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  3121. step((generator = generator.apply(thisArg, _arguments || [])).next());
  3122. });
  3123. };
  3124. Object.defineProperty(exports, "__esModule", ({ value: true }));
  3125. exports.summary = exports.markdownSummary = exports.SUMMARY_DOCS_URL = exports.SUMMARY_ENV_VAR = void 0;
  3126. const os_1 = __nccwpck_require__(2037);
  3127. const fs_1 = __nccwpck_require__(7147);
  3128. const { access, appendFile, writeFile } = fs_1.promises;
  3129. exports.SUMMARY_ENV_VAR = 'GITHUB_STEP_SUMMARY';
  3130. exports.SUMMARY_DOCS_URL = 'https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#adding-a-job-summary';
  3131. class Summary {
  3132. constructor() {
  3133. this._buffer = '';
  3134. }
  3135. /**
  3136. * Finds the summary file path from the environment, rejects if env var is not found or file does not exist
  3137. * Also checks r/w permissions.
  3138. *
  3139. * @returns step summary file path
  3140. */
  3141. filePath() {
  3142. return __awaiter(this, void 0, void 0, function* () {
  3143. if (this._filePath) {
  3144. return this._filePath;
  3145. }
  3146. const pathFromEnv = process.env[exports.SUMMARY_ENV_VAR];
  3147. if (!pathFromEnv) {
  3148. throw new Error(`Unable to find environment variable for $${exports.SUMMARY_ENV_VAR}. Check if your runtime environment supports job summaries.`);
  3149. }
  3150. try {
  3151. yield access(pathFromEnv, fs_1.constants.R_OK | fs_1.constants.W_OK);
  3152. }
  3153. catch (_a) {
  3154. throw new Error(`Unable to access summary file: '${pathFromEnv}'. Check if the file has correct read/write permissions.`);
  3155. }
  3156. this._filePath = pathFromEnv;
  3157. return this._filePath;
  3158. });
  3159. }
  3160. /**
  3161. * Wraps content in an HTML tag, adding any HTML attributes
  3162. *
  3163. * @param {string} tag HTML tag to wrap
  3164. * @param {string | null} content content within the tag
  3165. * @param {[attribute: string]: string} attrs key-value list of HTML attributes to add
  3166. *
  3167. * @returns {string} content wrapped in HTML element
  3168. */
  3169. wrap(tag, content, attrs = {}) {
  3170. const htmlAttrs = Object.entries(attrs)
  3171. .map(([key, value]) => ` ${key}="${value}"`)
  3172. .join('');
  3173. if (!content) {
  3174. return `<${tag}${htmlAttrs}>`;
  3175. }
  3176. return `<${tag}${htmlAttrs}>${content}</${tag}>`;
  3177. }
  3178. /**
  3179. * Writes text in the buffer to the summary buffer file and empties buffer. Will append by default.
  3180. *
  3181. * @param {SummaryWriteOptions} [options] (optional) options for write operation
  3182. *
  3183. * @returns {Promise<Summary>} summary instance
  3184. */
  3185. write(options) {
  3186. return __awaiter(this, void 0, void 0, function* () {
  3187. const overwrite = !!(options === null || options === void 0 ? void 0 : options.overwrite);
  3188. const filePath = yield this.filePath();
  3189. const writeFunc = overwrite ? writeFile : appendFile;
  3190. yield writeFunc(filePath, this._buffer, { encoding: 'utf8' });
  3191. return this.emptyBuffer();
  3192. });
  3193. }
  3194. /**
  3195. * Clears the summary buffer and wipes the summary file
  3196. *
  3197. * @returns {Summary} summary instance
  3198. */
  3199. clear() {
  3200. return __awaiter(this, void 0, void 0, function* () {
  3201. return this.emptyBuffer().write({ overwrite: true });
  3202. });
  3203. }
  3204. /**
  3205. * Returns the current summary buffer as a string
  3206. *
  3207. * @returns {string} string of summary buffer
  3208. */
  3209. stringify() {
  3210. return this._buffer;
  3211. }
  3212. /**
  3213. * If the summary buffer is empty
  3214. *
  3215. * @returns {boolen} true if the buffer is empty
  3216. */
  3217. isEmptyBuffer() {
  3218. return this._buffer.length === 0;
  3219. }
  3220. /**
  3221. * Resets the summary buffer without writing to summary file
  3222. *
  3223. * @returns {Summary} summary instance
  3224. */
  3225. emptyBuffer() {
  3226. this._buffer = '';
  3227. return this;
  3228. }
  3229. /**
  3230. * Adds raw text to the summary buffer
  3231. *
  3232. * @param {string} text content to add
  3233. * @param {boolean} [addEOL=false] (optional) append an EOL to the raw text (default: false)
  3234. *
  3235. * @returns {Summary} summary instance
  3236. */
  3237. addRaw(text, addEOL = false) {
  3238. this._buffer += text;
  3239. return addEOL ? this.addEOL() : this;
  3240. }
  3241. /**
  3242. * Adds the operating system-specific end-of-line marker to the buffer
  3243. *
  3244. * @returns {Summary} summary instance
  3245. */
  3246. addEOL() {
  3247. return this.addRaw(os_1.EOL);
  3248. }
  3249. /**
  3250. * Adds an HTML codeblock to the summary buffer
  3251. *
  3252. * @param {string} code content to render within fenced code block
  3253. * @param {string} lang (optional) language to syntax highlight code
  3254. *
  3255. * @returns {Summary} summary instance
  3256. */
  3257. addCodeBlock(code, lang) {
  3258. const attrs = Object.assign({}, (lang && { lang }));
  3259. const element = this.wrap('pre', this.wrap('code', code), attrs);
  3260. return this.addRaw(element).addEOL();
  3261. }
  3262. /**
  3263. * Adds an HTML list to the summary buffer
  3264. *
  3265. * @param {string[]} items list of items to render
  3266. * @param {boolean} [ordered=false] (optional) if the rendered list should be ordered or not (default: false)
  3267. *
  3268. * @returns {Summary} summary instance
  3269. */
  3270. addList(items, ordered = false) {
  3271. const tag = ordered ? 'ol' : 'ul';
  3272. const listItems = items.map(item => this.wrap('li', item)).join('');
  3273. const element = this.wrap(tag, listItems);
  3274. return this.addRaw(element).addEOL();
  3275. }
  3276. /**
  3277. * Adds an HTML table to the summary buffer
  3278. *
  3279. * @param {SummaryTableCell[]} rows table rows
  3280. *
  3281. * @returns {Summary} summary instance
  3282. */
  3283. addTable(rows) {
  3284. const tableBody = rows
  3285. .map(row => {
  3286. const cells = row
  3287. .map(cell => {
  3288. if (typeof cell === 'string') {
  3289. return this.wrap('td', cell);
  3290. }
  3291. const { header, data, colspan, rowspan } = cell;
  3292. const tag = header ? 'th' : 'td';
  3293. const attrs = Object.assign(Object.assign({}, (colspan && { colspan })), (rowspan && { rowspan }));
  3294. return this.wrap(tag, data, attrs);
  3295. })
  3296. .join('');
  3297. return this.wrap('tr', cells);
  3298. })
  3299. .join('');
  3300. const element = this.wrap('table', tableBody);
  3301. return this.addRaw(element).addEOL();
  3302. }
  3303. /**
  3304. * Adds a collapsable HTML details element to the summary buffer
  3305. *
  3306. * @param {string} label text for the closed state
  3307. * @param {string} content collapsable content
  3308. *
  3309. * @returns {Summary} summary instance
  3310. */
  3311. addDetails(label, content) {
  3312. const element = this.wrap('details', this.wrap('summary', label) + content);
  3313. return this.addRaw(element).addEOL();
  3314. }
  3315. /**
  3316. * Adds an HTML image tag to the summary buffer
  3317. *
  3318. * @param {string} src path to the image you to embed
  3319. * @param {string} alt text description of the image
  3320. * @param {SummaryImageOptions} options (optional) addition image attributes
  3321. *
  3322. * @returns {Summary} summary instance
  3323. */
  3324. addImage(src, alt, options) {
  3325. const { width, height } = options || {};
  3326. const attrs = Object.assign(Object.assign({}, (width && { width })), (height && { height }));
  3327. const element = this.wrap('img', null, Object.assign({ src, alt }, attrs));
  3328. return this.addRaw(element).addEOL();
  3329. }
  3330. /**
  3331. * Adds an HTML section heading element
  3332. *
  3333. * @param {string} text heading text
  3334. * @param {number | string} [level=1] (optional) the heading level, default: 1
  3335. *
  3336. * @returns {Summary} summary instance
  3337. */
  3338. addHeading(text, level) {
  3339. const tag = `h${level}`;
  3340. const allowedTag = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'].includes(tag)
  3341. ? tag
  3342. : 'h1';
  3343. const element = this.wrap(allowedTag, text);
  3344. return this.addRaw(element).addEOL();
  3345. }
  3346. /**
  3347. * Adds an HTML thematic break (<hr>) to the summary buffer
  3348. *
  3349. * @returns {Summary} summary instance
  3350. */
  3351. addSeparator() {
  3352. const element = this.wrap('hr', null);
  3353. return this.addRaw(element).addEOL();
  3354. }
  3355. /**
  3356. * Adds an HTML line break (<br>) to the summary buffer
  3357. *
  3358. * @returns {Summary} summary instance
  3359. */
  3360. addBreak() {
  3361. const element = this.wrap('br', null);
  3362. return this.addRaw(element).addEOL();
  3363. }
  3364. /**
  3365. * Adds an HTML blockquote to the summary buffer
  3366. *
  3367. * @param {string} text quote text
  3368. * @param {string} cite (optional) citation url
  3369. *
  3370. * @returns {Summary} summary instance
  3371. */
  3372. addQuote(text, cite) {
  3373. const attrs = Object.assign({}, (cite && { cite }));
  3374. const element = this.wrap('blockquote', text, attrs);
  3375. return this.addRaw(element).addEOL();
  3376. }
  3377. /**
  3378. * Adds an HTML anchor tag to the summary buffer
  3379. *
  3380. * @param {string} text link text/content
  3381. * @param {string} href hyperlink
  3382. *
  3383. * @returns {Summary} summary instance
  3384. */
  3385. addLink(text, href) {
  3386. const element = this.wrap('a', text, { href });
  3387. return this.addRaw(element).addEOL();
  3388. }
  3389. }
  3390. const _summary = new Summary();
  3391. /**
  3392. * @deprecated use `core.summary`
  3393. */
  3394. exports.markdownSummary = _summary;
  3395. exports.summary = _summary;
  3396. //# sourceMappingURL=summary.js.map
  3397. /***/ }),
  3398. /***/ 5278:
  3399. /***/ ((__unused_webpack_module, exports) => {
  3400. "use strict";
  3401. // We use any as a valid input type
  3402. /* eslint-disable @typescript-eslint/no-explicit-any */
  3403. Object.defineProperty(exports, "__esModule", ({ value: true }));
  3404. exports.toCommandProperties = exports.toCommandValue = void 0;
  3405. /**
  3406. * Sanitizes an input into a string so it can be passed into issueCommand safely
  3407. * @param input input to sanitize into a string
  3408. */
  3409. function toCommandValue(input) {
  3410. if (input === null || input === undefined) {
  3411. return '';
  3412. }
  3413. else if (typeof input === 'string' || input instanceof String) {
  3414. return input;
  3415. }
  3416. return JSON.stringify(input);
  3417. }
  3418. exports.toCommandValue = toCommandValue;
  3419. /**
  3420. *
  3421. * @param annotationProperties
  3422. * @returns The command properties to send with the actual annotation command
  3423. * See IssueCommandProperties: https://github.com/actions/runner/blob/main/src/Runner.Worker/ActionCommandManager.cs#L646
  3424. */
  3425. function toCommandProperties(annotationProperties) {
  3426. if (!Object.keys(annotationProperties).length) {
  3427. return {};
  3428. }
  3429. return {
  3430. title: annotationProperties.title,
  3431. file: annotationProperties.file,
  3432. line: annotationProperties.startLine,
  3433. endLine: annotationProperties.endLine,
  3434. col: annotationProperties.startColumn,
  3435. endColumn: annotationProperties.endColumn
  3436. };
  3437. }
  3438. exports.toCommandProperties = toCommandProperties;
  3439. //# sourceMappingURL=utils.js.map
  3440. /***/ }),
  3441. /***/ 8974:
  3442. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  3443. "use strict";
  3444. Object.defineProperty(exports, "__esModule", ({
  3445. value: true
  3446. }));
  3447. Object.defineProperty(exports, "v1", ({
  3448. enumerable: true,
  3449. get: function () {
  3450. return _v.default;
  3451. }
  3452. }));
  3453. Object.defineProperty(exports, "v3", ({
  3454. enumerable: true,
  3455. get: function () {
  3456. return _v2.default;
  3457. }
  3458. }));
  3459. Object.defineProperty(exports, "v4", ({
  3460. enumerable: true,
  3461. get: function () {
  3462. return _v3.default;
  3463. }
  3464. }));
  3465. Object.defineProperty(exports, "v5", ({
  3466. enumerable: true,
  3467. get: function () {
  3468. return _v4.default;
  3469. }
  3470. }));
  3471. Object.defineProperty(exports, "NIL", ({
  3472. enumerable: true,
  3473. get: function () {
  3474. return _nil.default;
  3475. }
  3476. }));
  3477. Object.defineProperty(exports, "version", ({
  3478. enumerable: true,
  3479. get: function () {
  3480. return _version.default;
  3481. }
  3482. }));
  3483. Object.defineProperty(exports, "validate", ({
  3484. enumerable: true,
  3485. get: function () {
  3486. return _validate.default;
  3487. }
  3488. }));
  3489. Object.defineProperty(exports, "stringify", ({
  3490. enumerable: true,
  3491. get: function () {
  3492. return _stringify.default;
  3493. }
  3494. }));
  3495. Object.defineProperty(exports, "parse", ({
  3496. enumerable: true,
  3497. get: function () {
  3498. return _parse.default;
  3499. }
  3500. }));
  3501. var _v = _interopRequireDefault(__nccwpck_require__(1595));
  3502. var _v2 = _interopRequireDefault(__nccwpck_require__(6993));
  3503. var _v3 = _interopRequireDefault(__nccwpck_require__(1472));
  3504. var _v4 = _interopRequireDefault(__nccwpck_require__(6217));
  3505. var _nil = _interopRequireDefault(__nccwpck_require__(2381));
  3506. var _version = _interopRequireDefault(__nccwpck_require__(427));
  3507. var _validate = _interopRequireDefault(__nccwpck_require__(2609));
  3508. var _stringify = _interopRequireDefault(__nccwpck_require__(1458));
  3509. var _parse = _interopRequireDefault(__nccwpck_require__(6385));
  3510. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  3511. /***/ }),
  3512. /***/ 5842:
  3513. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  3514. "use strict";
  3515. Object.defineProperty(exports, "__esModule", ({
  3516. value: true
  3517. }));
  3518. exports["default"] = void 0;
  3519. var _crypto = _interopRequireDefault(__nccwpck_require__(6113));
  3520. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  3521. function md5(bytes) {
  3522. if (Array.isArray(bytes)) {
  3523. bytes = Buffer.from(bytes);
  3524. } else if (typeof bytes === 'string') {
  3525. bytes = Buffer.from(bytes, 'utf8');
  3526. }
  3527. return _crypto.default.createHash('md5').update(bytes).digest();
  3528. }
  3529. var _default = md5;
  3530. exports["default"] = _default;
  3531. /***/ }),
  3532. /***/ 2381:
  3533. /***/ ((__unused_webpack_module, exports) => {
  3534. "use strict";
  3535. Object.defineProperty(exports, "__esModule", ({
  3536. value: true
  3537. }));
  3538. exports["default"] = void 0;
  3539. var _default = '00000000-0000-0000-0000-000000000000';
  3540. exports["default"] = _default;
  3541. /***/ }),
  3542. /***/ 6385:
  3543. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  3544. "use strict";
  3545. Object.defineProperty(exports, "__esModule", ({
  3546. value: true
  3547. }));
  3548. exports["default"] = void 0;
  3549. var _validate = _interopRequireDefault(__nccwpck_require__(2609));
  3550. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  3551. function parse(uuid) {
  3552. if (!(0, _validate.default)(uuid)) {
  3553. throw TypeError('Invalid UUID');
  3554. }
  3555. let v;
  3556. const arr = new Uint8Array(16); // Parse ########-....-....-....-............
  3557. arr[0] = (v = parseInt(uuid.slice(0, 8), 16)) >>> 24;
  3558. arr[1] = v >>> 16 & 0xff;
  3559. arr[2] = v >>> 8 & 0xff;
  3560. arr[3] = v & 0xff; // Parse ........-####-....-....-............
  3561. arr[4] = (v = parseInt(uuid.slice(9, 13), 16)) >>> 8;
  3562. arr[5] = v & 0xff; // Parse ........-....-####-....-............
  3563. arr[6] = (v = parseInt(uuid.slice(14, 18), 16)) >>> 8;
  3564. arr[7] = v & 0xff; // Parse ........-....-....-####-............
  3565. arr[8] = (v = parseInt(uuid.slice(19, 23), 16)) >>> 8;
  3566. arr[9] = v & 0xff; // Parse ........-....-....-....-############
  3567. // (Use "/" to avoid 32-bit truncation when bit-shifting high-order bytes)
  3568. arr[10] = (v = parseInt(uuid.slice(24, 36), 16)) / 0x10000000000 & 0xff;
  3569. arr[11] = v / 0x100000000 & 0xff;
  3570. arr[12] = v >>> 24 & 0xff;
  3571. arr[13] = v >>> 16 & 0xff;
  3572. arr[14] = v >>> 8 & 0xff;
  3573. arr[15] = v & 0xff;
  3574. return arr;
  3575. }
  3576. var _default = parse;
  3577. exports["default"] = _default;
  3578. /***/ }),
  3579. /***/ 6230:
  3580. /***/ ((__unused_webpack_module, exports) => {
  3581. "use strict";
  3582. Object.defineProperty(exports, "__esModule", ({
  3583. value: true
  3584. }));
  3585. exports["default"] = void 0;
  3586. 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;
  3587. exports["default"] = _default;
  3588. /***/ }),
  3589. /***/ 9784:
  3590. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  3591. "use strict";
  3592. Object.defineProperty(exports, "__esModule", ({
  3593. value: true
  3594. }));
  3595. exports["default"] = rng;
  3596. var _crypto = _interopRequireDefault(__nccwpck_require__(6113));
  3597. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  3598. const rnds8Pool = new Uint8Array(256); // # of random values to pre-allocate
  3599. let poolPtr = rnds8Pool.length;
  3600. function rng() {
  3601. if (poolPtr > rnds8Pool.length - 16) {
  3602. _crypto.default.randomFillSync(rnds8Pool);
  3603. poolPtr = 0;
  3604. }
  3605. return rnds8Pool.slice(poolPtr, poolPtr += 16);
  3606. }
  3607. /***/ }),
  3608. /***/ 8844:
  3609. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  3610. "use strict";
  3611. Object.defineProperty(exports, "__esModule", ({
  3612. value: true
  3613. }));
  3614. exports["default"] = void 0;
  3615. var _crypto = _interopRequireDefault(__nccwpck_require__(6113));
  3616. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  3617. function sha1(bytes) {
  3618. if (Array.isArray(bytes)) {
  3619. bytes = Buffer.from(bytes);
  3620. } else if (typeof bytes === 'string') {
  3621. bytes = Buffer.from(bytes, 'utf8');
  3622. }
  3623. return _crypto.default.createHash('sha1').update(bytes).digest();
  3624. }
  3625. var _default = sha1;
  3626. exports["default"] = _default;
  3627. /***/ }),
  3628. /***/ 1458:
  3629. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  3630. "use strict";
  3631. Object.defineProperty(exports, "__esModule", ({
  3632. value: true
  3633. }));
  3634. exports["default"] = void 0;
  3635. var _validate = _interopRequireDefault(__nccwpck_require__(2609));
  3636. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  3637. /**
  3638. * Convert array of 16 byte values to UUID string format of the form:
  3639. * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
  3640. */
  3641. const byteToHex = [];
  3642. for (let i = 0; i < 256; ++i) {
  3643. byteToHex.push((i + 0x100).toString(16).substr(1));
  3644. }
  3645. function stringify(arr, offset = 0) {
  3646. // Note: Be careful editing this code! It's been tuned for performance
  3647. // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
  3648. 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
  3649. // of the following:
  3650. // - One or more input array values don't map to a hex octet (leading to
  3651. // "undefined" in the uuid)
  3652. // - Invalid input values for the RFC `version` or `variant` fields
  3653. if (!(0, _validate.default)(uuid)) {
  3654. throw TypeError('Stringified UUID is invalid');
  3655. }
  3656. return uuid;
  3657. }
  3658. var _default = stringify;
  3659. exports["default"] = _default;
  3660. /***/ }),
  3661. /***/ 1595:
  3662. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  3663. "use strict";
  3664. Object.defineProperty(exports, "__esModule", ({
  3665. value: true
  3666. }));
  3667. exports["default"] = void 0;
  3668. var _rng = _interopRequireDefault(__nccwpck_require__(9784));
  3669. var _stringify = _interopRequireDefault(__nccwpck_require__(1458));
  3670. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  3671. // **`v1()` - Generate time-based UUID**
  3672. //
  3673. // Inspired by https://github.com/LiosK/UUID.js
  3674. // and http://docs.python.org/library/uuid.html
  3675. let _nodeId;
  3676. let _clockseq; // Previous uuid creation time
  3677. let _lastMSecs = 0;
  3678. let _lastNSecs = 0; // See https://github.com/uuidjs/uuid for API details
  3679. function v1(options, buf, offset) {
  3680. let i = buf && offset || 0;
  3681. const b = buf || new Array(16);
  3682. options = options || {};
  3683. let node = options.node || _nodeId;
  3684. let clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq; // node and clockseq need to be initialized to random values if they're not
  3685. // specified. We do this lazily to minimize issues related to insufficient
  3686. // system entropy. See #189
  3687. if (node == null || clockseq == null) {
  3688. const seedBytes = options.random || (options.rng || _rng.default)();
  3689. if (node == null) {
  3690. // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1)
  3691. node = _nodeId = [seedBytes[0] | 0x01, seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]];
  3692. }
  3693. if (clockseq == null) {
  3694. // Per 4.2.2, randomize (14 bit) clockseq
  3695. clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff;
  3696. }
  3697. } // UUID timestamps are 100 nano-second units since the Gregorian epoch,
  3698. // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so
  3699. // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs'
  3700. // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00.
  3701. let msecs = options.msecs !== undefined ? options.msecs : Date.now(); // Per 4.2.1.2, use count of uuid's generated during the current clock
  3702. // cycle to simulate higher resolution clock
  3703. let nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1; // Time since last uuid creation (in msecs)
  3704. const dt = msecs - _lastMSecs + (nsecs - _lastNSecs) / 10000; // Per 4.2.1.2, Bump clockseq on clock regression
  3705. if (dt < 0 && options.clockseq === undefined) {
  3706. clockseq = clockseq + 1 & 0x3fff;
  3707. } // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new
  3708. // time interval
  3709. if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) {
  3710. nsecs = 0;
  3711. } // Per 4.2.1.2 Throw error if too many uuids are requested
  3712. if (nsecs >= 10000) {
  3713. throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");
  3714. }
  3715. _lastMSecs = msecs;
  3716. _lastNSecs = nsecs;
  3717. _clockseq = clockseq; // Per 4.1.4 - Convert from unix epoch to Gregorian epoch
  3718. msecs += 12219292800000; // `time_low`
  3719. const tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000;
  3720. b[i++] = tl >>> 24 & 0xff;
  3721. b[i++] = tl >>> 16 & 0xff;
  3722. b[i++] = tl >>> 8 & 0xff;
  3723. b[i++] = tl & 0xff; // `time_mid`
  3724. const tmh = msecs / 0x100000000 * 10000 & 0xfffffff;
  3725. b[i++] = tmh >>> 8 & 0xff;
  3726. b[i++] = tmh & 0xff; // `time_high_and_version`
  3727. b[i++] = tmh >>> 24 & 0xf | 0x10; // include version
  3728. b[i++] = tmh >>> 16 & 0xff; // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant)
  3729. b[i++] = clockseq >>> 8 | 0x80; // `clock_seq_low`
  3730. b[i++] = clockseq & 0xff; // `node`
  3731. for (let n = 0; n < 6; ++n) {
  3732. b[i + n] = node[n];
  3733. }
  3734. return buf || (0, _stringify.default)(b);
  3735. }
  3736. var _default = v1;
  3737. exports["default"] = _default;
  3738. /***/ }),
  3739. /***/ 6993:
  3740. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  3741. "use strict";
  3742. Object.defineProperty(exports, "__esModule", ({
  3743. value: true
  3744. }));
  3745. exports["default"] = void 0;
  3746. var _v = _interopRequireDefault(__nccwpck_require__(5920));
  3747. var _md = _interopRequireDefault(__nccwpck_require__(5842));
  3748. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  3749. const v3 = (0, _v.default)('v3', 0x30, _md.default);
  3750. var _default = v3;
  3751. exports["default"] = _default;
  3752. /***/ }),
  3753. /***/ 5920:
  3754. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  3755. "use strict";
  3756. Object.defineProperty(exports, "__esModule", ({
  3757. value: true
  3758. }));
  3759. exports["default"] = _default;
  3760. exports.URL = exports.DNS = void 0;
  3761. var _stringify = _interopRequireDefault(__nccwpck_require__(1458));
  3762. var _parse = _interopRequireDefault(__nccwpck_require__(6385));
  3763. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  3764. function stringToBytes(str) {
  3765. str = unescape(encodeURIComponent(str)); // UTF8 escape
  3766. const bytes = [];
  3767. for (let i = 0; i < str.length; ++i) {
  3768. bytes.push(str.charCodeAt(i));
  3769. }
  3770. return bytes;
  3771. }
  3772. const DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8';
  3773. exports.DNS = DNS;
  3774. const URL = '6ba7b811-9dad-11d1-80b4-00c04fd430c8';
  3775. exports.URL = URL;
  3776. function _default(name, version, hashfunc) {
  3777. function generateUUID(value, namespace, buf, offset) {
  3778. if (typeof value === 'string') {
  3779. value = stringToBytes(value);
  3780. }
  3781. if (typeof namespace === 'string') {
  3782. namespace = (0, _parse.default)(namespace);
  3783. }
  3784. if (namespace.length !== 16) {
  3785. throw TypeError('Namespace must be array-like (16 iterable integer values, 0-255)');
  3786. } // Compute hash of namespace and value, Per 4.3
  3787. // Future: Use spread syntax when supported on all platforms, e.g. `bytes =
  3788. // hashfunc([...namespace, ... value])`
  3789. let bytes = new Uint8Array(16 + value.length);
  3790. bytes.set(namespace);
  3791. bytes.set(value, namespace.length);
  3792. bytes = hashfunc(bytes);
  3793. bytes[6] = bytes[6] & 0x0f | version;
  3794. bytes[8] = bytes[8] & 0x3f | 0x80;
  3795. if (buf) {
  3796. offset = offset || 0;
  3797. for (let i = 0; i < 16; ++i) {
  3798. buf[offset + i] = bytes[i];
  3799. }
  3800. return buf;
  3801. }
  3802. return (0, _stringify.default)(bytes);
  3803. } // Function#name is not settable on some platforms (#270)
  3804. try {
  3805. generateUUID.name = name; // eslint-disable-next-line no-empty
  3806. } catch (err) {} // For CommonJS default export support
  3807. generateUUID.DNS = DNS;
  3808. generateUUID.URL = URL;
  3809. return generateUUID;
  3810. }
  3811. /***/ }),
  3812. /***/ 1472:
  3813. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  3814. "use strict";
  3815. Object.defineProperty(exports, "__esModule", ({
  3816. value: true
  3817. }));
  3818. exports["default"] = void 0;
  3819. var _rng = _interopRequireDefault(__nccwpck_require__(9784));
  3820. var _stringify = _interopRequireDefault(__nccwpck_require__(1458));
  3821. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  3822. function v4(options, buf, offset) {
  3823. options = options || {};
  3824. const rnds = options.random || (options.rng || _rng.default)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
  3825. rnds[6] = rnds[6] & 0x0f | 0x40;
  3826. rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided
  3827. if (buf) {
  3828. offset = offset || 0;
  3829. for (let i = 0; i < 16; ++i) {
  3830. buf[offset + i] = rnds[i];
  3831. }
  3832. return buf;
  3833. }
  3834. return (0, _stringify.default)(rnds);
  3835. }
  3836. var _default = v4;
  3837. exports["default"] = _default;
  3838. /***/ }),
  3839. /***/ 6217:
  3840. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  3841. "use strict";
  3842. Object.defineProperty(exports, "__esModule", ({
  3843. value: true
  3844. }));
  3845. exports["default"] = void 0;
  3846. var _v = _interopRequireDefault(__nccwpck_require__(5920));
  3847. var _sha = _interopRequireDefault(__nccwpck_require__(8844));
  3848. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  3849. const v5 = (0, _v.default)('v5', 0x50, _sha.default);
  3850. var _default = v5;
  3851. exports["default"] = _default;
  3852. /***/ }),
  3853. /***/ 2609:
  3854. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  3855. "use strict";
  3856. Object.defineProperty(exports, "__esModule", ({
  3857. value: true
  3858. }));
  3859. exports["default"] = void 0;
  3860. var _regex = _interopRequireDefault(__nccwpck_require__(6230));
  3861. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  3862. function validate(uuid) {
  3863. return typeof uuid === 'string' && _regex.default.test(uuid);
  3864. }
  3865. var _default = validate;
  3866. exports["default"] = _default;
  3867. /***/ }),
  3868. /***/ 427:
  3869. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  3870. "use strict";
  3871. Object.defineProperty(exports, "__esModule", ({
  3872. value: true
  3873. }));
  3874. exports["default"] = void 0;
  3875. var _validate = _interopRequireDefault(__nccwpck_require__(2609));
  3876. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  3877. function version(uuid) {
  3878. if (!(0, _validate.default)(uuid)) {
  3879. throw TypeError('Invalid UUID');
  3880. }
  3881. return parseInt(uuid.substr(14, 1), 16);
  3882. }
  3883. var _default = version;
  3884. exports["default"] = _default;
  3885. /***/ }),
  3886. /***/ 1514:
  3887. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  3888. "use strict";
  3889. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  3890. if (k2 === undefined) k2 = k;
  3891. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  3892. }) : (function(o, m, k, k2) {
  3893. if (k2 === undefined) k2 = k;
  3894. o[k2] = m[k];
  3895. }));
  3896. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  3897. Object.defineProperty(o, "default", { enumerable: true, value: v });
  3898. }) : function(o, v) {
  3899. o["default"] = v;
  3900. });
  3901. var __importStar = (this && this.__importStar) || function (mod) {
  3902. if (mod && mod.__esModule) return mod;
  3903. var result = {};
  3904. if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  3905. __setModuleDefault(result, mod);
  3906. return result;
  3907. };
  3908. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  3909. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  3910. return new (P || (P = Promise))(function (resolve, reject) {
  3911. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  3912. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  3913. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  3914. step((generator = generator.apply(thisArg, _arguments || [])).next());
  3915. });
  3916. };
  3917. Object.defineProperty(exports, "__esModule", ({ value: true }));
  3918. exports.getExecOutput = exports.exec = void 0;
  3919. const string_decoder_1 = __nccwpck_require__(1576);
  3920. const tr = __importStar(__nccwpck_require__(8159));
  3921. /**
  3922. * Exec a command.
  3923. * Output will be streamed to the live console.
  3924. * Returns promise with return code
  3925. *
  3926. * @param commandLine command to execute (can include additional args). Must be correctly escaped.
  3927. * @param args optional arguments for tool. Escaping is handled by the lib.
  3928. * @param options optional exec options. See ExecOptions
  3929. * @returns Promise<number> exit code
  3930. */
  3931. function exec(commandLine, args, options) {
  3932. return __awaiter(this, void 0, void 0, function* () {
  3933. const commandArgs = tr.argStringToArray(commandLine);
  3934. if (commandArgs.length === 0) {
  3935. throw new Error(`Parameter 'commandLine' cannot be null or empty.`);
  3936. }
  3937. // Path to tool to execute should be first arg
  3938. const toolPath = commandArgs[0];
  3939. args = commandArgs.slice(1).concat(args || []);
  3940. const runner = new tr.ToolRunner(toolPath, args, options);
  3941. return runner.exec();
  3942. });
  3943. }
  3944. exports.exec = exec;
  3945. /**
  3946. * Exec a command and get the output.
  3947. * Output will be streamed to the live console.
  3948. * Returns promise with the exit code and collected stdout and stderr
  3949. *
  3950. * @param commandLine command to execute (can include additional args). Must be correctly escaped.
  3951. * @param args optional arguments for tool. Escaping is handled by the lib.
  3952. * @param options optional exec options. See ExecOptions
  3953. * @returns Promise<ExecOutput> exit code, stdout, and stderr
  3954. */
  3955. function getExecOutput(commandLine, args, options) {
  3956. var _a, _b;
  3957. return __awaiter(this, void 0, void 0, function* () {
  3958. let stdout = '';
  3959. let stderr = '';
  3960. //Using string decoder covers the case where a mult-byte character is split
  3961. const stdoutDecoder = new string_decoder_1.StringDecoder('utf8');
  3962. const stderrDecoder = new string_decoder_1.StringDecoder('utf8');
  3963. const originalStdoutListener = (_a = options === null || options === void 0 ? void 0 : options.listeners) === null || _a === void 0 ? void 0 : _a.stdout;
  3964. const originalStdErrListener = (_b = options === null || options === void 0 ? void 0 : options.listeners) === null || _b === void 0 ? void 0 : _b.stderr;
  3965. const stdErrListener = (data) => {
  3966. stderr += stderrDecoder.write(data);
  3967. if (originalStdErrListener) {
  3968. originalStdErrListener(data);
  3969. }
  3970. };
  3971. const stdOutListener = (data) => {
  3972. stdout += stdoutDecoder.write(data);
  3973. if (originalStdoutListener) {
  3974. originalStdoutListener(data);
  3975. }
  3976. };
  3977. const listeners = Object.assign(Object.assign({}, options === null || options === void 0 ? void 0 : options.listeners), { stdout: stdOutListener, stderr: stdErrListener });
  3978. const exitCode = yield exec(commandLine, args, Object.assign(Object.assign({}, options), { listeners }));
  3979. //flush any remaining characters
  3980. stdout += stdoutDecoder.end();
  3981. stderr += stderrDecoder.end();
  3982. return {
  3983. exitCode,
  3984. stdout,
  3985. stderr
  3986. };
  3987. });
  3988. }
  3989. exports.getExecOutput = getExecOutput;
  3990. //# sourceMappingURL=exec.js.map
  3991. /***/ }),
  3992. /***/ 8159:
  3993. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  3994. "use strict";
  3995. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  3996. if (k2 === undefined) k2 = k;
  3997. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  3998. }) : (function(o, m, k, k2) {
  3999. if (k2 === undefined) k2 = k;
  4000. o[k2] = m[k];
  4001. }));
  4002. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  4003. Object.defineProperty(o, "default", { enumerable: true, value: v });
  4004. }) : function(o, v) {
  4005. o["default"] = v;
  4006. });
  4007. var __importStar = (this && this.__importStar) || function (mod) {
  4008. if (mod && mod.__esModule) return mod;
  4009. var result = {};
  4010. if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  4011. __setModuleDefault(result, mod);
  4012. return result;
  4013. };
  4014. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  4015. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  4016. return new (P || (P = Promise))(function (resolve, reject) {
  4017. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  4018. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  4019. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  4020. step((generator = generator.apply(thisArg, _arguments || [])).next());
  4021. });
  4022. };
  4023. Object.defineProperty(exports, "__esModule", ({ value: true }));
  4024. exports.argStringToArray = exports.ToolRunner = void 0;
  4025. const os = __importStar(__nccwpck_require__(2037));
  4026. const events = __importStar(__nccwpck_require__(2361));
  4027. const child = __importStar(__nccwpck_require__(2081));
  4028. const path = __importStar(__nccwpck_require__(1017));
  4029. const io = __importStar(__nccwpck_require__(7436));
  4030. const ioUtil = __importStar(__nccwpck_require__(1962));
  4031. const timers_1 = __nccwpck_require__(9512);
  4032. /* eslint-disable @typescript-eslint/unbound-method */
  4033. const IS_WINDOWS = process.platform === 'win32';
  4034. /*
  4035. * Class for running command line tools. Handles quoting and arg parsing in a platform agnostic way.
  4036. */
  4037. class ToolRunner extends events.EventEmitter {
  4038. constructor(toolPath, args, options) {
  4039. super();
  4040. if (!toolPath) {
  4041. throw new Error("Parameter 'toolPath' cannot be null or empty.");
  4042. }
  4043. this.toolPath = toolPath;
  4044. this.args = args || [];
  4045. this.options = options || {};
  4046. }
  4047. _debug(message) {
  4048. if (this.options.listeners && this.options.listeners.debug) {
  4049. this.options.listeners.debug(message);
  4050. }
  4051. }
  4052. _getCommandString(options, noPrefix) {
  4053. const toolPath = this._getSpawnFileName();
  4054. const args = this._getSpawnArgs(options);
  4055. let cmd = noPrefix ? '' : '[command]'; // omit prefix when piped to a second tool
  4056. if (IS_WINDOWS) {
  4057. // Windows + cmd file
  4058. if (this._isCmdFile()) {
  4059. cmd += toolPath;
  4060. for (const a of args) {
  4061. cmd += ` ${a}`;
  4062. }
  4063. }
  4064. // Windows + verbatim
  4065. else if (options.windowsVerbatimArguments) {
  4066. cmd += `"${toolPath}"`;
  4067. for (const a of args) {
  4068. cmd += ` ${a}`;
  4069. }
  4070. }
  4071. // Windows (regular)
  4072. else {
  4073. cmd += this._windowsQuoteCmdArg(toolPath);
  4074. for (const a of args) {
  4075. cmd += ` ${this._windowsQuoteCmdArg(a)}`;
  4076. }
  4077. }
  4078. }
  4079. else {
  4080. // OSX/Linux - this can likely be improved with some form of quoting.
  4081. // creating processes on Unix is fundamentally different than Windows.
  4082. // on Unix, execvp() takes an arg array.
  4083. cmd += toolPath;
  4084. for (const a of args) {
  4085. cmd += ` ${a}`;
  4086. }
  4087. }
  4088. return cmd;
  4089. }
  4090. _processLineBuffer(data, strBuffer, onLine) {
  4091. try {
  4092. let s = strBuffer + data.toString();
  4093. let n = s.indexOf(os.EOL);
  4094. while (n > -1) {
  4095. const line = s.substring(0, n);
  4096. onLine(line);
  4097. // the rest of the string ...
  4098. s = s.substring(n + os.EOL.length);
  4099. n = s.indexOf(os.EOL);
  4100. }
  4101. return s;
  4102. }
  4103. catch (err) {
  4104. // streaming lines to console is best effort. Don't fail a build.
  4105. this._debug(`error processing line. Failed with error ${err}`);
  4106. return '';
  4107. }
  4108. }
  4109. _getSpawnFileName() {
  4110. if (IS_WINDOWS) {
  4111. if (this._isCmdFile()) {
  4112. return process.env['COMSPEC'] || 'cmd.exe';
  4113. }
  4114. }
  4115. return this.toolPath;
  4116. }
  4117. _getSpawnArgs(options) {
  4118. if (IS_WINDOWS) {
  4119. if (this._isCmdFile()) {
  4120. let argline = `/D /S /C "${this._windowsQuoteCmdArg(this.toolPath)}`;
  4121. for (const a of this.args) {
  4122. argline += ' ';
  4123. argline += options.windowsVerbatimArguments
  4124. ? a
  4125. : this._windowsQuoteCmdArg(a);
  4126. }
  4127. argline += '"';
  4128. return [argline];
  4129. }
  4130. }
  4131. return this.args;
  4132. }
  4133. _endsWith(str, end) {
  4134. return str.endsWith(end);
  4135. }
  4136. _isCmdFile() {
  4137. const upperToolPath = this.toolPath.toUpperCase();
  4138. return (this._endsWith(upperToolPath, '.CMD') ||
  4139. this._endsWith(upperToolPath, '.BAT'));
  4140. }
  4141. _windowsQuoteCmdArg(arg) {
  4142. // for .exe, apply the normal quoting rules that libuv applies
  4143. if (!this._isCmdFile()) {
  4144. return this._uvQuoteCmdArg(arg);
  4145. }
  4146. // otherwise apply quoting rules specific to the cmd.exe command line parser.
  4147. // the libuv rules are generic and are not designed specifically for cmd.exe
  4148. // command line parser.
  4149. //
  4150. // for a detailed description of the cmd.exe command line parser, refer to
  4151. // http://stackoverflow.com/questions/4094699/how-does-the-windows-command-interpreter-cmd-exe-parse-scripts/7970912#7970912
  4152. // need quotes for empty arg
  4153. if (!arg) {
  4154. return '""';
  4155. }
  4156. // determine whether the arg needs to be quoted
  4157. const cmdSpecialChars = [
  4158. ' ',
  4159. '\t',
  4160. '&',
  4161. '(',
  4162. ')',
  4163. '[',
  4164. ']',
  4165. '{',
  4166. '}',
  4167. '^',
  4168. '=',
  4169. ';',
  4170. '!',
  4171. "'",
  4172. '+',
  4173. ',',
  4174. '`',
  4175. '~',
  4176. '|',
  4177. '<',
  4178. '>',
  4179. '"'
  4180. ];
  4181. let needsQuotes = false;
  4182. for (const char of arg) {
  4183. if (cmdSpecialChars.some(x => x === char)) {
  4184. needsQuotes = true;
  4185. break;
  4186. }
  4187. }
  4188. // short-circuit if quotes not needed
  4189. if (!needsQuotes) {
  4190. return arg;
  4191. }
  4192. // the following quoting rules are very similar to the rules that by libuv applies.
  4193. //
  4194. // 1) wrap the string in quotes
  4195. //
  4196. // 2) double-up quotes - i.e. " => ""
  4197. //
  4198. // this is different from the libuv quoting rules. libuv replaces " with \", which unfortunately
  4199. // doesn't work well with a cmd.exe command line.
  4200. //
  4201. // note, replacing " with "" also works well if the arg is passed to a downstream .NET console app.
  4202. // for example, the command line:
  4203. // foo.exe "myarg:""my val"""
  4204. // is parsed by a .NET console app into an arg array:
  4205. // [ "myarg:\"my val\"" ]
  4206. // which is the same end result when applying libuv quoting rules. although the actual
  4207. // command line from libuv quoting rules would look like:
  4208. // foo.exe "myarg:\"my val\""
  4209. //
  4210. // 3) double-up slashes that precede a quote,
  4211. // e.g. hello \world => "hello \world"
  4212. // hello\"world => "hello\\""world"
  4213. // hello\\"world => "hello\\\\""world"
  4214. // hello world\ => "hello world\\"
  4215. //
  4216. // technically this is not required for a cmd.exe command line, or the batch argument parser.
  4217. // the reasons for including this as a .cmd quoting rule are:
  4218. //
  4219. // a) this is optimized for the scenario where the argument is passed from the .cmd file to an
  4220. // external program. many programs (e.g. .NET console apps) rely on the slash-doubling rule.
  4221. //
  4222. // b) it's what we've been doing previously (by deferring to node default behavior) and we
  4223. // haven't heard any complaints about that aspect.
  4224. //
  4225. // note, a weakness of the quoting rules chosen here, is that % is not escaped. in fact, % cannot be
  4226. // escaped when used on the command line directly - even though within a .cmd file % can be escaped
  4227. // by using %%.
  4228. //
  4229. // the saving grace is, on the command line, %var% is left as-is if var is not defined. this contrasts
  4230. // the line parsing rules within a .cmd file, where if var is not defined it is replaced with nothing.
  4231. //
  4232. // one option that was explored was replacing % with ^% - i.e. %var% => ^%var^%. this hack would
  4233. // often work, since it is unlikely that var^ would exist, and the ^ character is removed when the
  4234. // variable is used. the problem, however, is that ^ is not removed when %* is used to pass the args
  4235. // to an external program.
  4236. //
  4237. // an unexplored potential solution for the % escaping problem, is to create a wrapper .cmd file.
  4238. // % can be escaped within a .cmd file.
  4239. let reverse = '"';
  4240. let quoteHit = true;
  4241. for (let i = arg.length; i > 0; i--) {
  4242. // walk the string in reverse
  4243. reverse += arg[i - 1];
  4244. if (quoteHit && arg[i - 1] === '\\') {
  4245. reverse += '\\'; // double the slash
  4246. }
  4247. else if (arg[i - 1] === '"') {
  4248. quoteHit = true;
  4249. reverse += '"'; // double the quote
  4250. }
  4251. else {
  4252. quoteHit = false;
  4253. }
  4254. }
  4255. reverse += '"';
  4256. return reverse
  4257. .split('')
  4258. .reverse()
  4259. .join('');
  4260. }
  4261. _uvQuoteCmdArg(arg) {
  4262. // Tool runner wraps child_process.spawn() and needs to apply the same quoting as
  4263. // Node in certain cases where the undocumented spawn option windowsVerbatimArguments
  4264. // is used.
  4265. //
  4266. // Since this function is a port of quote_cmd_arg from Node 4.x (technically, lib UV,
  4267. // see https://github.com/nodejs/node/blob/v4.x/deps/uv/src/win/process.c for details),
  4268. // pasting copyright notice from Node within this function:
  4269. //
  4270. // Copyright Joyent, Inc. and other Node contributors. All rights reserved.
  4271. //
  4272. // Permission is hereby granted, free of charge, to any person obtaining a copy
  4273. // of this software and associated documentation files (the "Software"), to
  4274. // deal in the Software without restriction, including without limitation the
  4275. // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
  4276. // sell copies of the Software, and to permit persons to whom the Software is
  4277. // furnished to do so, subject to the following conditions:
  4278. //
  4279. // The above copyright notice and this permission notice shall be included in
  4280. // all copies or substantial portions of the Software.
  4281. //
  4282. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  4283. // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  4284. // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  4285. // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  4286. // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  4287. // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
  4288. // IN THE SOFTWARE.
  4289. if (!arg) {
  4290. // Need double quotation for empty argument
  4291. return '""';
  4292. }
  4293. if (!arg.includes(' ') && !arg.includes('\t') && !arg.includes('"')) {
  4294. // No quotation needed
  4295. return arg;
  4296. }
  4297. if (!arg.includes('"') && !arg.includes('\\')) {
  4298. // No embedded double quotes or backslashes, so I can just wrap
  4299. // quote marks around the whole thing.
  4300. return `"${arg}"`;
  4301. }
  4302. // Expected input/output:
  4303. // input : hello"world
  4304. // output: "hello\"world"
  4305. // input : hello""world
  4306. // output: "hello\"\"world"
  4307. // input : hello\world
  4308. // output: hello\world
  4309. // input : hello\\world
  4310. // output: hello\\world
  4311. // input : hello\"world
  4312. // output: "hello\\\"world"
  4313. // input : hello\\"world
  4314. // output: "hello\\\\\"world"
  4315. // input : hello world\
  4316. // output: "hello world\\" - note the comment in libuv actually reads "hello world\"
  4317. // but it appears the comment is wrong, it should be "hello world\\"
  4318. let reverse = '"';
  4319. let quoteHit = true;
  4320. for (let i = arg.length; i > 0; i--) {
  4321. // walk the string in reverse
  4322. reverse += arg[i - 1];
  4323. if (quoteHit && arg[i - 1] === '\\') {
  4324. reverse += '\\';
  4325. }
  4326. else if (arg[i - 1] === '"') {
  4327. quoteHit = true;
  4328. reverse += '\\';
  4329. }
  4330. else {
  4331. quoteHit = false;
  4332. }
  4333. }
  4334. reverse += '"';
  4335. return reverse
  4336. .split('')
  4337. .reverse()
  4338. .join('');
  4339. }
  4340. _cloneExecOptions(options) {
  4341. options = options || {};
  4342. const result = {
  4343. cwd: options.cwd || process.cwd(),
  4344. env: options.env || process.env,
  4345. silent: options.silent || false,
  4346. windowsVerbatimArguments: options.windowsVerbatimArguments || false,
  4347. failOnStdErr: options.failOnStdErr || false,
  4348. ignoreReturnCode: options.ignoreReturnCode || false,
  4349. delay: options.delay || 10000
  4350. };
  4351. result.outStream = options.outStream || process.stdout;
  4352. result.errStream = options.errStream || process.stderr;
  4353. return result;
  4354. }
  4355. _getSpawnOptions(options, toolPath) {
  4356. options = options || {};
  4357. const result = {};
  4358. result.cwd = options.cwd;
  4359. result.env = options.env;
  4360. result['windowsVerbatimArguments'] =
  4361. options.windowsVerbatimArguments || this._isCmdFile();
  4362. if (options.windowsVerbatimArguments) {
  4363. result.argv0 = `"${toolPath}"`;
  4364. }
  4365. return result;
  4366. }
  4367. /**
  4368. * Exec a tool.
  4369. * Output will be streamed to the live console.
  4370. * Returns promise with return code
  4371. *
  4372. * @param tool path to tool to exec
  4373. * @param options optional exec options. See ExecOptions
  4374. * @returns number
  4375. */
  4376. exec() {
  4377. return __awaiter(this, void 0, void 0, function* () {
  4378. // root the tool path if it is unrooted and contains relative pathing
  4379. if (!ioUtil.isRooted(this.toolPath) &&
  4380. (this.toolPath.includes('/') ||
  4381. (IS_WINDOWS && this.toolPath.includes('\\')))) {
  4382. // prefer options.cwd if it is specified, however options.cwd may also need to be rooted
  4383. this.toolPath = path.resolve(process.cwd(), this.options.cwd || process.cwd(), this.toolPath);
  4384. }
  4385. // if the tool is only a file name, then resolve it from the PATH
  4386. // otherwise verify it exists (add extension on Windows if necessary)
  4387. this.toolPath = yield io.which(this.toolPath, true);
  4388. return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
  4389. this._debug(`exec tool: ${this.toolPath}`);
  4390. this._debug('arguments:');
  4391. for (const arg of this.args) {
  4392. this._debug(` ${arg}`);
  4393. }
  4394. const optionsNonNull = this._cloneExecOptions(this.options);
  4395. if (!optionsNonNull.silent && optionsNonNull.outStream) {
  4396. optionsNonNull.outStream.write(this._getCommandString(optionsNonNull) + os.EOL);
  4397. }
  4398. const state = new ExecState(optionsNonNull, this.toolPath);
  4399. state.on('debug', (message) => {
  4400. this._debug(message);
  4401. });
  4402. if (this.options.cwd && !(yield ioUtil.exists(this.options.cwd))) {
  4403. return reject(new Error(`The cwd: ${this.options.cwd} does not exist!`));
  4404. }
  4405. const fileName = this._getSpawnFileName();
  4406. const cp = child.spawn(fileName, this._getSpawnArgs(optionsNonNull), this._getSpawnOptions(this.options, fileName));
  4407. let stdbuffer = '';
  4408. if (cp.stdout) {
  4409. cp.stdout.on('data', (data) => {
  4410. if (this.options.listeners && this.options.listeners.stdout) {
  4411. this.options.listeners.stdout(data);
  4412. }
  4413. if (!optionsNonNull.silent && optionsNonNull.outStream) {
  4414. optionsNonNull.outStream.write(data);
  4415. }
  4416. stdbuffer = this._processLineBuffer(data, stdbuffer, (line) => {
  4417. if (this.options.listeners && this.options.listeners.stdline) {
  4418. this.options.listeners.stdline(line);
  4419. }
  4420. });
  4421. });
  4422. }
  4423. let errbuffer = '';
  4424. if (cp.stderr) {
  4425. cp.stderr.on('data', (data) => {
  4426. state.processStderr = true;
  4427. if (this.options.listeners && this.options.listeners.stderr) {
  4428. this.options.listeners.stderr(data);
  4429. }
  4430. if (!optionsNonNull.silent &&
  4431. optionsNonNull.errStream &&
  4432. optionsNonNull.outStream) {
  4433. const s = optionsNonNull.failOnStdErr
  4434. ? optionsNonNull.errStream
  4435. : optionsNonNull.outStream;
  4436. s.write(data);
  4437. }
  4438. errbuffer = this._processLineBuffer(data, errbuffer, (line) => {
  4439. if (this.options.listeners && this.options.listeners.errline) {
  4440. this.options.listeners.errline(line);
  4441. }
  4442. });
  4443. });
  4444. }
  4445. cp.on('error', (err) => {
  4446. state.processError = err.message;
  4447. state.processExited = true;
  4448. state.processClosed = true;
  4449. state.CheckComplete();
  4450. });
  4451. cp.on('exit', (code) => {
  4452. state.processExitCode = code;
  4453. state.processExited = true;
  4454. this._debug(`Exit code ${code} received from tool '${this.toolPath}'`);
  4455. state.CheckComplete();
  4456. });
  4457. cp.on('close', (code) => {
  4458. state.processExitCode = code;
  4459. state.processExited = true;
  4460. state.processClosed = true;
  4461. this._debug(`STDIO streams have closed for tool '${this.toolPath}'`);
  4462. state.CheckComplete();
  4463. });
  4464. state.on('done', (error, exitCode) => {
  4465. if (stdbuffer.length > 0) {
  4466. this.emit('stdline', stdbuffer);
  4467. }
  4468. if (errbuffer.length > 0) {
  4469. this.emit('errline', errbuffer);
  4470. }
  4471. cp.removeAllListeners();
  4472. if (error) {
  4473. reject(error);
  4474. }
  4475. else {
  4476. resolve(exitCode);
  4477. }
  4478. });
  4479. if (this.options.input) {
  4480. if (!cp.stdin) {
  4481. throw new Error('child process missing stdin');
  4482. }
  4483. cp.stdin.end(this.options.input);
  4484. }
  4485. }));
  4486. });
  4487. }
  4488. }
  4489. exports.ToolRunner = ToolRunner;
  4490. /**
  4491. * Convert an arg string to an array of args. Handles escaping
  4492. *
  4493. * @param argString string of arguments
  4494. * @returns string[] array of arguments
  4495. */
  4496. function argStringToArray(argString) {
  4497. const args = [];
  4498. let inQuotes = false;
  4499. let escaped = false;
  4500. let arg = '';
  4501. function append(c) {
  4502. // we only escape double quotes.
  4503. if (escaped && c !== '"') {
  4504. arg += '\\';
  4505. }
  4506. arg += c;
  4507. escaped = false;
  4508. }
  4509. for (let i = 0; i < argString.length; i++) {
  4510. const c = argString.charAt(i);
  4511. if (c === '"') {
  4512. if (!escaped) {
  4513. inQuotes = !inQuotes;
  4514. }
  4515. else {
  4516. append(c);
  4517. }
  4518. continue;
  4519. }
  4520. if (c === '\\' && escaped) {
  4521. append(c);
  4522. continue;
  4523. }
  4524. if (c === '\\' && inQuotes) {
  4525. escaped = true;
  4526. continue;
  4527. }
  4528. if (c === ' ' && !inQuotes) {
  4529. if (arg.length > 0) {
  4530. args.push(arg);
  4531. arg = '';
  4532. }
  4533. continue;
  4534. }
  4535. append(c);
  4536. }
  4537. if (arg.length > 0) {
  4538. args.push(arg.trim());
  4539. }
  4540. return args;
  4541. }
  4542. exports.argStringToArray = argStringToArray;
  4543. class ExecState extends events.EventEmitter {
  4544. constructor(options, toolPath) {
  4545. super();
  4546. this.processClosed = false; // tracks whether the process has exited and stdio is closed
  4547. this.processError = '';
  4548. this.processExitCode = 0;
  4549. this.processExited = false; // tracks whether the process has exited
  4550. this.processStderr = false; // tracks whether stderr was written to
  4551. this.delay = 10000; // 10 seconds
  4552. this.done = false;
  4553. this.timeout = null;
  4554. if (!toolPath) {
  4555. throw new Error('toolPath must not be empty');
  4556. }
  4557. this.options = options;
  4558. this.toolPath = toolPath;
  4559. if (options.delay) {
  4560. this.delay = options.delay;
  4561. }
  4562. }
  4563. CheckComplete() {
  4564. if (this.done) {
  4565. return;
  4566. }
  4567. if (this.processClosed) {
  4568. this._setResult();
  4569. }
  4570. else if (this.processExited) {
  4571. this.timeout = timers_1.setTimeout(ExecState.HandleTimeout, this.delay, this);
  4572. }
  4573. }
  4574. _debug(message) {
  4575. this.emit('debug', message);
  4576. }
  4577. _setResult() {
  4578. // determine whether there is an error
  4579. let error;
  4580. if (this.processExited) {
  4581. if (this.processError) {
  4582. 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}`);
  4583. }
  4584. else if (this.processExitCode !== 0 && !this.options.ignoreReturnCode) {
  4585. error = new Error(`The process '${this.toolPath}' failed with exit code ${this.processExitCode}`);
  4586. }
  4587. else if (this.processStderr && this.options.failOnStdErr) {
  4588. error = new Error(`The process '${this.toolPath}' failed because one or more lines were written to the STDERR stream`);
  4589. }
  4590. }
  4591. // clear the timeout
  4592. if (this.timeout) {
  4593. clearTimeout(this.timeout);
  4594. this.timeout = null;
  4595. }
  4596. this.done = true;
  4597. this.emit('done', error, this.processExitCode);
  4598. }
  4599. static HandleTimeout(state) {
  4600. if (state.done) {
  4601. return;
  4602. }
  4603. if (!state.processClosed && state.processExited) {
  4604. const message = `The STDIO streams did not close within ${state.delay /
  4605. 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.`;
  4606. state._debug(message);
  4607. }
  4608. state._setResult();
  4609. }
  4610. }
  4611. //# sourceMappingURL=toolrunner.js.map
  4612. /***/ }),
  4613. /***/ 4087:
  4614. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  4615. "use strict";
  4616. Object.defineProperty(exports, "__esModule", ({ value: true }));
  4617. exports.Context = void 0;
  4618. const fs_1 = __nccwpck_require__(7147);
  4619. const os_1 = __nccwpck_require__(2037);
  4620. class Context {
  4621. /**
  4622. * Hydrate the context from the environment
  4623. */
  4624. constructor() {
  4625. var _a, _b, _c;
  4626. this.payload = {};
  4627. if (process.env.GITHUB_EVENT_PATH) {
  4628. if ((0, fs_1.existsSync)(process.env.GITHUB_EVENT_PATH)) {
  4629. this.payload = JSON.parse((0, fs_1.readFileSync)(process.env.GITHUB_EVENT_PATH, { encoding: 'utf8' }));
  4630. }
  4631. else {
  4632. const path = process.env.GITHUB_EVENT_PATH;
  4633. process.stdout.write(`GITHUB_EVENT_PATH ${path} does not exist${os_1.EOL}`);
  4634. }
  4635. }
  4636. this.eventName = process.env.GITHUB_EVENT_NAME;
  4637. this.sha = process.env.GITHUB_SHA;
  4638. this.ref = process.env.GITHUB_REF;
  4639. this.workflow = process.env.GITHUB_WORKFLOW;
  4640. this.action = process.env.GITHUB_ACTION;
  4641. this.actor = process.env.GITHUB_ACTOR;
  4642. this.job = process.env.GITHUB_JOB;
  4643. this.runNumber = parseInt(process.env.GITHUB_RUN_NUMBER, 10);
  4644. this.runId = parseInt(process.env.GITHUB_RUN_ID, 10);
  4645. this.apiUrl = (_a = process.env.GITHUB_API_URL) !== null && _a !== void 0 ? _a : `https://api.github.com`;
  4646. this.serverUrl = (_b = process.env.GITHUB_SERVER_URL) !== null && _b !== void 0 ? _b : `https://github.com`;
  4647. this.graphqlUrl =
  4648. (_c = process.env.GITHUB_GRAPHQL_URL) !== null && _c !== void 0 ? _c : `https://api.github.com/graphql`;
  4649. }
  4650. get issue() {
  4651. const payload = this.payload;
  4652. return Object.assign(Object.assign({}, this.repo), { number: (payload.issue || payload.pull_request || payload).number });
  4653. }
  4654. get repo() {
  4655. if (process.env.GITHUB_REPOSITORY) {
  4656. const [owner, repo] = process.env.GITHUB_REPOSITORY.split('/');
  4657. return { owner, repo };
  4658. }
  4659. if (this.payload.repository) {
  4660. return {
  4661. owner: this.payload.repository.owner.login,
  4662. repo: this.payload.repository.name
  4663. };
  4664. }
  4665. throw new Error("context.repo requires a GITHUB_REPOSITORY environment variable like 'owner/repo'");
  4666. }
  4667. }
  4668. exports.Context = Context;
  4669. //# sourceMappingURL=context.js.map
  4670. /***/ }),
  4671. /***/ 5438:
  4672. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  4673. "use strict";
  4674. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  4675. if (k2 === undefined) k2 = k;
  4676. var desc = Object.getOwnPropertyDescriptor(m, k);
  4677. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  4678. desc = { enumerable: true, get: function() { return m[k]; } };
  4679. }
  4680. Object.defineProperty(o, k2, desc);
  4681. }) : (function(o, m, k, k2) {
  4682. if (k2 === undefined) k2 = k;
  4683. o[k2] = m[k];
  4684. }));
  4685. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  4686. Object.defineProperty(o, "default", { enumerable: true, value: v });
  4687. }) : function(o, v) {
  4688. o["default"] = v;
  4689. });
  4690. var __importStar = (this && this.__importStar) || function (mod) {
  4691. if (mod && mod.__esModule) return mod;
  4692. var result = {};
  4693. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  4694. __setModuleDefault(result, mod);
  4695. return result;
  4696. };
  4697. Object.defineProperty(exports, "__esModule", ({ value: true }));
  4698. exports.getOctokit = exports.context = void 0;
  4699. const Context = __importStar(__nccwpck_require__(4087));
  4700. const utils_1 = __nccwpck_require__(3030);
  4701. exports.context = new Context.Context();
  4702. /**
  4703. * Returns a hydrated octokit ready to use for GitHub Actions
  4704. *
  4705. * @param token the repo PAT or GITHUB_TOKEN
  4706. * @param options other options to set
  4707. */
  4708. function getOctokit(token, options, ...additionalPlugins) {
  4709. const GitHubWithPlugins = utils_1.GitHub.plugin(...additionalPlugins);
  4710. return new GitHubWithPlugins((0, utils_1.getOctokitOptions)(token, options));
  4711. }
  4712. exports.getOctokit = getOctokit;
  4713. //# sourceMappingURL=github.js.map
  4714. /***/ }),
  4715. /***/ 7914:
  4716. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  4717. "use strict";
  4718. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  4719. if (k2 === undefined) k2 = k;
  4720. var desc = Object.getOwnPropertyDescriptor(m, k);
  4721. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  4722. desc = { enumerable: true, get: function() { return m[k]; } };
  4723. }
  4724. Object.defineProperty(o, k2, desc);
  4725. }) : (function(o, m, k, k2) {
  4726. if (k2 === undefined) k2 = k;
  4727. o[k2] = m[k];
  4728. }));
  4729. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  4730. Object.defineProperty(o, "default", { enumerable: true, value: v });
  4731. }) : function(o, v) {
  4732. o["default"] = v;
  4733. });
  4734. var __importStar = (this && this.__importStar) || function (mod) {
  4735. if (mod && mod.__esModule) return mod;
  4736. var result = {};
  4737. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  4738. __setModuleDefault(result, mod);
  4739. return result;
  4740. };
  4741. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  4742. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  4743. return new (P || (P = Promise))(function (resolve, reject) {
  4744. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  4745. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  4746. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  4747. step((generator = generator.apply(thisArg, _arguments || [])).next());
  4748. });
  4749. };
  4750. Object.defineProperty(exports, "__esModule", ({ value: true }));
  4751. exports.getApiBaseUrl = exports.getProxyFetch = exports.getProxyAgentDispatcher = exports.getProxyAgent = exports.getAuthString = void 0;
  4752. const httpClient = __importStar(__nccwpck_require__(6255));
  4753. const undici_1 = __nccwpck_require__(1773);
  4754. function getAuthString(token, options) {
  4755. if (!token && !options.auth) {
  4756. throw new Error('Parameter token or opts.auth is required');
  4757. }
  4758. else if (token && options.auth) {
  4759. throw new Error('Parameters token and opts.auth may not both be specified');
  4760. }
  4761. return typeof options.auth === 'string' ? options.auth : `token ${token}`;
  4762. }
  4763. exports.getAuthString = getAuthString;
  4764. function getProxyAgent(destinationUrl) {
  4765. const hc = new httpClient.HttpClient();
  4766. return hc.getAgent(destinationUrl);
  4767. }
  4768. exports.getProxyAgent = getProxyAgent;
  4769. function getProxyAgentDispatcher(destinationUrl) {
  4770. const hc = new httpClient.HttpClient();
  4771. return hc.getAgentDispatcher(destinationUrl);
  4772. }
  4773. exports.getProxyAgentDispatcher = getProxyAgentDispatcher;
  4774. function getProxyFetch(destinationUrl) {
  4775. const httpDispatcher = getProxyAgentDispatcher(destinationUrl);
  4776. const proxyFetch = (url, opts) => __awaiter(this, void 0, void 0, function* () {
  4777. return (0, undici_1.fetch)(url, Object.assign(Object.assign({}, opts), { dispatcher: httpDispatcher }));
  4778. });
  4779. return proxyFetch;
  4780. }
  4781. exports.getProxyFetch = getProxyFetch;
  4782. function getApiBaseUrl() {
  4783. return process.env['GITHUB_API_URL'] || 'https://api.github.com';
  4784. }
  4785. exports.getApiBaseUrl = getApiBaseUrl;
  4786. //# sourceMappingURL=utils.js.map
  4787. /***/ }),
  4788. /***/ 3030:
  4789. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  4790. "use strict";
  4791. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  4792. if (k2 === undefined) k2 = k;
  4793. var desc = Object.getOwnPropertyDescriptor(m, k);
  4794. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  4795. desc = { enumerable: true, get: function() { return m[k]; } };
  4796. }
  4797. Object.defineProperty(o, k2, desc);
  4798. }) : (function(o, m, k, k2) {
  4799. if (k2 === undefined) k2 = k;
  4800. o[k2] = m[k];
  4801. }));
  4802. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  4803. Object.defineProperty(o, "default", { enumerable: true, value: v });
  4804. }) : function(o, v) {
  4805. o["default"] = v;
  4806. });
  4807. var __importStar = (this && this.__importStar) || function (mod) {
  4808. if (mod && mod.__esModule) return mod;
  4809. var result = {};
  4810. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  4811. __setModuleDefault(result, mod);
  4812. return result;
  4813. };
  4814. Object.defineProperty(exports, "__esModule", ({ value: true }));
  4815. exports.getOctokitOptions = exports.GitHub = exports.defaults = exports.context = void 0;
  4816. const Context = __importStar(__nccwpck_require__(4087));
  4817. const Utils = __importStar(__nccwpck_require__(7914));
  4818. // octokit + plugins
  4819. const core_1 = __nccwpck_require__(6762);
  4820. const plugin_rest_endpoint_methods_1 = __nccwpck_require__(3044);
  4821. const plugin_paginate_rest_1 = __nccwpck_require__(4193);
  4822. exports.context = new Context.Context();
  4823. const baseUrl = Utils.getApiBaseUrl();
  4824. exports.defaults = {
  4825. baseUrl,
  4826. request: {
  4827. agent: Utils.getProxyAgent(baseUrl),
  4828. fetch: Utils.getProxyFetch(baseUrl)
  4829. }
  4830. };
  4831. exports.GitHub = core_1.Octokit.plugin(plugin_rest_endpoint_methods_1.restEndpointMethods, plugin_paginate_rest_1.paginateRest).defaults(exports.defaults);
  4832. /**
  4833. * Convience function to correctly format Octokit Options to pass into the constructor.
  4834. *
  4835. * @param token the repo PAT or GITHUB_TOKEN
  4836. * @param options other options to set
  4837. */
  4838. function getOctokitOptions(token, options) {
  4839. const opts = Object.assign({}, options || {}); // Shallow clone - don't mutate the object provided by the caller
  4840. // Auth
  4841. const auth = Utils.getAuthString(token, opts);
  4842. if (auth) {
  4843. opts.auth = auth;
  4844. }
  4845. return opts;
  4846. }
  4847. exports.getOctokitOptions = getOctokitOptions;
  4848. //# sourceMappingURL=utils.js.map
  4849. /***/ }),
  4850. /***/ 5526:
  4851. /***/ (function(__unused_webpack_module, exports) {
  4852. "use strict";
  4853. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  4854. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  4855. return new (P || (P = Promise))(function (resolve, reject) {
  4856. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  4857. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  4858. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  4859. step((generator = generator.apply(thisArg, _arguments || [])).next());
  4860. });
  4861. };
  4862. Object.defineProperty(exports, "__esModule", ({ value: true }));
  4863. exports.PersonalAccessTokenCredentialHandler = exports.BearerCredentialHandler = exports.BasicCredentialHandler = void 0;
  4864. class BasicCredentialHandler {
  4865. constructor(username, password) {
  4866. this.username = username;
  4867. this.password = password;
  4868. }
  4869. prepareRequest(options) {
  4870. if (!options.headers) {
  4871. throw Error('The request has no headers');
  4872. }
  4873. options.headers['Authorization'] = `Basic ${Buffer.from(`${this.username}:${this.password}`).toString('base64')}`;
  4874. }
  4875. // This handler cannot handle 401
  4876. canHandleAuthentication() {
  4877. return false;
  4878. }
  4879. handleAuthentication() {
  4880. return __awaiter(this, void 0, void 0, function* () {
  4881. throw new Error('not implemented');
  4882. });
  4883. }
  4884. }
  4885. exports.BasicCredentialHandler = BasicCredentialHandler;
  4886. class BearerCredentialHandler {
  4887. constructor(token) {
  4888. this.token = token;
  4889. }
  4890. // currently implements pre-authorization
  4891. // TODO: support preAuth = false where it hooks on 401
  4892. prepareRequest(options) {
  4893. if (!options.headers) {
  4894. throw Error('The request has no headers');
  4895. }
  4896. options.headers['Authorization'] = `Bearer ${this.token}`;
  4897. }
  4898. // This handler cannot handle 401
  4899. canHandleAuthentication() {
  4900. return false;
  4901. }
  4902. handleAuthentication() {
  4903. return __awaiter(this, void 0, void 0, function* () {
  4904. throw new Error('not implemented');
  4905. });
  4906. }
  4907. }
  4908. exports.BearerCredentialHandler = BearerCredentialHandler;
  4909. class PersonalAccessTokenCredentialHandler {
  4910. constructor(token) {
  4911. this.token = token;
  4912. }
  4913. // currently implements pre-authorization
  4914. // TODO: support preAuth = false where it hooks on 401
  4915. prepareRequest(options) {
  4916. if (!options.headers) {
  4917. throw Error('The request has no headers');
  4918. }
  4919. options.headers['Authorization'] = `Basic ${Buffer.from(`PAT:${this.token}`).toString('base64')}`;
  4920. }
  4921. // This handler cannot handle 401
  4922. canHandleAuthentication() {
  4923. return false;
  4924. }
  4925. handleAuthentication() {
  4926. return __awaiter(this, void 0, void 0, function* () {
  4927. throw new Error('not implemented');
  4928. });
  4929. }
  4930. }
  4931. exports.PersonalAccessTokenCredentialHandler = PersonalAccessTokenCredentialHandler;
  4932. //# sourceMappingURL=auth.js.map
  4933. /***/ }),
  4934. /***/ 6255:
  4935. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  4936. "use strict";
  4937. /* eslint-disable @typescript-eslint/no-explicit-any */
  4938. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  4939. if (k2 === undefined) k2 = k;
  4940. var desc = Object.getOwnPropertyDescriptor(m, k);
  4941. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  4942. desc = { enumerable: true, get: function() { return m[k]; } };
  4943. }
  4944. Object.defineProperty(o, k2, desc);
  4945. }) : (function(o, m, k, k2) {
  4946. if (k2 === undefined) k2 = k;
  4947. o[k2] = m[k];
  4948. }));
  4949. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  4950. Object.defineProperty(o, "default", { enumerable: true, value: v });
  4951. }) : function(o, v) {
  4952. o["default"] = v;
  4953. });
  4954. var __importStar = (this && this.__importStar) || function (mod) {
  4955. if (mod && mod.__esModule) return mod;
  4956. var result = {};
  4957. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  4958. __setModuleDefault(result, mod);
  4959. return result;
  4960. };
  4961. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  4962. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  4963. return new (P || (P = Promise))(function (resolve, reject) {
  4964. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  4965. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  4966. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  4967. step((generator = generator.apply(thisArg, _arguments || [])).next());
  4968. });
  4969. };
  4970. Object.defineProperty(exports, "__esModule", ({ value: true }));
  4971. exports.HttpClient = exports.isHttps = exports.HttpClientResponse = exports.HttpClientError = exports.getProxyUrl = exports.MediaTypes = exports.Headers = exports.HttpCodes = void 0;
  4972. const http = __importStar(__nccwpck_require__(3685));
  4973. const https = __importStar(__nccwpck_require__(5687));
  4974. const pm = __importStar(__nccwpck_require__(9835));
  4975. const tunnel = __importStar(__nccwpck_require__(4294));
  4976. const undici_1 = __nccwpck_require__(1773);
  4977. var HttpCodes;
  4978. (function (HttpCodes) {
  4979. HttpCodes[HttpCodes["OK"] = 200] = "OK";
  4980. HttpCodes[HttpCodes["MultipleChoices"] = 300] = "MultipleChoices";
  4981. HttpCodes[HttpCodes["MovedPermanently"] = 301] = "MovedPermanently";
  4982. HttpCodes[HttpCodes["ResourceMoved"] = 302] = "ResourceMoved";
  4983. HttpCodes[HttpCodes["SeeOther"] = 303] = "SeeOther";
  4984. HttpCodes[HttpCodes["NotModified"] = 304] = "NotModified";
  4985. HttpCodes[HttpCodes["UseProxy"] = 305] = "UseProxy";
  4986. HttpCodes[HttpCodes["SwitchProxy"] = 306] = "SwitchProxy";
  4987. HttpCodes[HttpCodes["TemporaryRedirect"] = 307] = "TemporaryRedirect";
  4988. HttpCodes[HttpCodes["PermanentRedirect"] = 308] = "PermanentRedirect";
  4989. HttpCodes[HttpCodes["BadRequest"] = 400] = "BadRequest";
  4990. HttpCodes[HttpCodes["Unauthorized"] = 401] = "Unauthorized";
  4991. HttpCodes[HttpCodes["PaymentRequired"] = 402] = "PaymentRequired";
  4992. HttpCodes[HttpCodes["Forbidden"] = 403] = "Forbidden";
  4993. HttpCodes[HttpCodes["NotFound"] = 404] = "NotFound";
  4994. HttpCodes[HttpCodes["MethodNotAllowed"] = 405] = "MethodNotAllowed";
  4995. HttpCodes[HttpCodes["NotAcceptable"] = 406] = "NotAcceptable";
  4996. HttpCodes[HttpCodes["ProxyAuthenticationRequired"] = 407] = "ProxyAuthenticationRequired";
  4997. HttpCodes[HttpCodes["RequestTimeout"] = 408] = "RequestTimeout";
  4998. HttpCodes[HttpCodes["Conflict"] = 409] = "Conflict";
  4999. HttpCodes[HttpCodes["Gone"] = 410] = "Gone";
  5000. HttpCodes[HttpCodes["TooManyRequests"] = 429] = "TooManyRequests";
  5001. HttpCodes[HttpCodes["InternalServerError"] = 500] = "InternalServerError";
  5002. HttpCodes[HttpCodes["NotImplemented"] = 501] = "NotImplemented";
  5003. HttpCodes[HttpCodes["BadGateway"] = 502] = "BadGateway";
  5004. HttpCodes[HttpCodes["ServiceUnavailable"] = 503] = "ServiceUnavailable";
  5005. HttpCodes[HttpCodes["GatewayTimeout"] = 504] = "GatewayTimeout";
  5006. })(HttpCodes || (exports.HttpCodes = HttpCodes = {}));
  5007. var Headers;
  5008. (function (Headers) {
  5009. Headers["Accept"] = "accept";
  5010. Headers["ContentType"] = "content-type";
  5011. })(Headers || (exports.Headers = Headers = {}));
  5012. var MediaTypes;
  5013. (function (MediaTypes) {
  5014. MediaTypes["ApplicationJson"] = "application/json";
  5015. })(MediaTypes || (exports.MediaTypes = MediaTypes = {}));
  5016. /**
  5017. * Returns the proxy URL, depending upon the supplied url and proxy environment variables.
  5018. * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com
  5019. */
  5020. function getProxyUrl(serverUrl) {
  5021. const proxyUrl = pm.getProxyUrl(new URL(serverUrl));
  5022. return proxyUrl ? proxyUrl.href : '';
  5023. }
  5024. exports.getProxyUrl = getProxyUrl;
  5025. const HttpRedirectCodes = [
  5026. HttpCodes.MovedPermanently,
  5027. HttpCodes.ResourceMoved,
  5028. HttpCodes.SeeOther,
  5029. HttpCodes.TemporaryRedirect,
  5030. HttpCodes.PermanentRedirect
  5031. ];
  5032. const HttpResponseRetryCodes = [
  5033. HttpCodes.BadGateway,
  5034. HttpCodes.ServiceUnavailable,
  5035. HttpCodes.GatewayTimeout
  5036. ];
  5037. const RetryableHttpVerbs = ['OPTIONS', 'GET', 'DELETE', 'HEAD'];
  5038. const ExponentialBackoffCeiling = 10;
  5039. const ExponentialBackoffTimeSlice = 5;
  5040. class HttpClientError extends Error {
  5041. constructor(message, statusCode) {
  5042. super(message);
  5043. this.name = 'HttpClientError';
  5044. this.statusCode = statusCode;
  5045. Object.setPrototypeOf(this, HttpClientError.prototype);
  5046. }
  5047. }
  5048. exports.HttpClientError = HttpClientError;
  5049. class HttpClientResponse {
  5050. constructor(message) {
  5051. this.message = message;
  5052. }
  5053. readBody() {
  5054. return __awaiter(this, void 0, void 0, function* () {
  5055. return new Promise((resolve) => __awaiter(this, void 0, void 0, function* () {
  5056. let output = Buffer.alloc(0);
  5057. this.message.on('data', (chunk) => {
  5058. output = Buffer.concat([output, chunk]);
  5059. });
  5060. this.message.on('end', () => {
  5061. resolve(output.toString());
  5062. });
  5063. }));
  5064. });
  5065. }
  5066. readBodyBuffer() {
  5067. return __awaiter(this, void 0, void 0, function* () {
  5068. return new Promise((resolve) => __awaiter(this, void 0, void 0, function* () {
  5069. const chunks = [];
  5070. this.message.on('data', (chunk) => {
  5071. chunks.push(chunk);
  5072. });
  5073. this.message.on('end', () => {
  5074. resolve(Buffer.concat(chunks));
  5075. });
  5076. }));
  5077. });
  5078. }
  5079. }
  5080. exports.HttpClientResponse = HttpClientResponse;
  5081. function isHttps(requestUrl) {
  5082. const parsedUrl = new URL(requestUrl);
  5083. return parsedUrl.protocol === 'https:';
  5084. }
  5085. exports.isHttps = isHttps;
  5086. class HttpClient {
  5087. constructor(userAgent, handlers, requestOptions) {
  5088. this._ignoreSslError = false;
  5089. this._allowRedirects = true;
  5090. this._allowRedirectDowngrade = false;
  5091. this._maxRedirects = 50;
  5092. this._allowRetries = false;
  5093. this._maxRetries = 1;
  5094. this._keepAlive = false;
  5095. this._disposed = false;
  5096. this.userAgent = userAgent;
  5097. this.handlers = handlers || [];
  5098. this.requestOptions = requestOptions;
  5099. if (requestOptions) {
  5100. if (requestOptions.ignoreSslError != null) {
  5101. this._ignoreSslError = requestOptions.ignoreSslError;
  5102. }
  5103. this._socketTimeout = requestOptions.socketTimeout;
  5104. if (requestOptions.allowRedirects != null) {
  5105. this._allowRedirects = requestOptions.allowRedirects;
  5106. }
  5107. if (requestOptions.allowRedirectDowngrade != null) {
  5108. this._allowRedirectDowngrade = requestOptions.allowRedirectDowngrade;
  5109. }
  5110. if (requestOptions.maxRedirects != null) {
  5111. this._maxRedirects = Math.max(requestOptions.maxRedirects, 0);
  5112. }
  5113. if (requestOptions.keepAlive != null) {
  5114. this._keepAlive = requestOptions.keepAlive;
  5115. }
  5116. if (requestOptions.allowRetries != null) {
  5117. this._allowRetries = requestOptions.allowRetries;
  5118. }
  5119. if (requestOptions.maxRetries != null) {
  5120. this._maxRetries = requestOptions.maxRetries;
  5121. }
  5122. }
  5123. }
  5124. options(requestUrl, additionalHeaders) {
  5125. return __awaiter(this, void 0, void 0, function* () {
  5126. return this.request('OPTIONS', requestUrl, null, additionalHeaders || {});
  5127. });
  5128. }
  5129. get(requestUrl, additionalHeaders) {
  5130. return __awaiter(this, void 0, void 0, function* () {
  5131. return this.request('GET', requestUrl, null, additionalHeaders || {});
  5132. });
  5133. }
  5134. del(requestUrl, additionalHeaders) {
  5135. return __awaiter(this, void 0, void 0, function* () {
  5136. return this.request('DELETE', requestUrl, null, additionalHeaders || {});
  5137. });
  5138. }
  5139. post(requestUrl, data, additionalHeaders) {
  5140. return __awaiter(this, void 0, void 0, function* () {
  5141. return this.request('POST', requestUrl, data, additionalHeaders || {});
  5142. });
  5143. }
  5144. patch(requestUrl, data, additionalHeaders) {
  5145. return __awaiter(this, void 0, void 0, function* () {
  5146. return this.request('PATCH', requestUrl, data, additionalHeaders || {});
  5147. });
  5148. }
  5149. put(requestUrl, data, additionalHeaders) {
  5150. return __awaiter(this, void 0, void 0, function* () {
  5151. return this.request('PUT', requestUrl, data, additionalHeaders || {});
  5152. });
  5153. }
  5154. head(requestUrl, additionalHeaders) {
  5155. return __awaiter(this, void 0, void 0, function* () {
  5156. return this.request('HEAD', requestUrl, null, additionalHeaders || {});
  5157. });
  5158. }
  5159. sendStream(verb, requestUrl, stream, additionalHeaders) {
  5160. return __awaiter(this, void 0, void 0, function* () {
  5161. return this.request(verb, requestUrl, stream, additionalHeaders);
  5162. });
  5163. }
  5164. /**
  5165. * Gets a typed object from an endpoint
  5166. * Be aware that not found returns a null. Other errors (4xx, 5xx) reject the promise
  5167. */
  5168. getJson(requestUrl, additionalHeaders = {}) {
  5169. return __awaiter(this, void 0, void 0, function* () {
  5170. additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
  5171. const res = yield this.get(requestUrl, additionalHeaders);
  5172. return this._processResponse(res, this.requestOptions);
  5173. });
  5174. }
  5175. postJson(requestUrl, obj, additionalHeaders = {}) {
  5176. return __awaiter(this, void 0, void 0, function* () {
  5177. const data = JSON.stringify(obj, null, 2);
  5178. additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
  5179. additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);
  5180. const res = yield this.post(requestUrl, data, additionalHeaders);
  5181. return this._processResponse(res, this.requestOptions);
  5182. });
  5183. }
  5184. putJson(requestUrl, obj, additionalHeaders = {}) {
  5185. return __awaiter(this, void 0, void 0, function* () {
  5186. const data = JSON.stringify(obj, null, 2);
  5187. additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
  5188. additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);
  5189. const res = yield this.put(requestUrl, data, additionalHeaders);
  5190. return this._processResponse(res, this.requestOptions);
  5191. });
  5192. }
  5193. patchJson(requestUrl, obj, additionalHeaders = {}) {
  5194. return __awaiter(this, void 0, void 0, function* () {
  5195. const data = JSON.stringify(obj, null, 2);
  5196. additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
  5197. additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);
  5198. const res = yield this.patch(requestUrl, data, additionalHeaders);
  5199. return this._processResponse(res, this.requestOptions);
  5200. });
  5201. }
  5202. /**
  5203. * Makes a raw http request.
  5204. * All other methods such as get, post, patch, and request ultimately call this.
  5205. * Prefer get, del, post and patch
  5206. */
  5207. request(verb, requestUrl, data, headers) {
  5208. return __awaiter(this, void 0, void 0, function* () {
  5209. if (this._disposed) {
  5210. throw new Error('Client has already been disposed.');
  5211. }
  5212. const parsedUrl = new URL(requestUrl);
  5213. let info = this._prepareRequest(verb, parsedUrl, headers);
  5214. // Only perform retries on reads since writes may not be idempotent.
  5215. const maxTries = this._allowRetries && RetryableHttpVerbs.includes(verb)
  5216. ? this._maxRetries + 1
  5217. : 1;
  5218. let numTries = 0;
  5219. let response;
  5220. do {
  5221. response = yield this.requestRaw(info, data);
  5222. // Check if it's an authentication challenge
  5223. if (response &&
  5224. response.message &&
  5225. response.message.statusCode === HttpCodes.Unauthorized) {
  5226. let authenticationHandler;
  5227. for (const handler of this.handlers) {
  5228. if (handler.canHandleAuthentication(response)) {
  5229. authenticationHandler = handler;
  5230. break;
  5231. }
  5232. }
  5233. if (authenticationHandler) {
  5234. return authenticationHandler.handleAuthentication(this, info, data);
  5235. }
  5236. else {
  5237. // We have received an unauthorized response but have no handlers to handle it.
  5238. // Let the response return to the caller.
  5239. return response;
  5240. }
  5241. }
  5242. let redirectsRemaining = this._maxRedirects;
  5243. while (response.message.statusCode &&
  5244. HttpRedirectCodes.includes(response.message.statusCode) &&
  5245. this._allowRedirects &&
  5246. redirectsRemaining > 0) {
  5247. const redirectUrl = response.message.headers['location'];
  5248. if (!redirectUrl) {
  5249. // if there's no location to redirect to, we won't
  5250. break;
  5251. }
  5252. const parsedRedirectUrl = new URL(redirectUrl);
  5253. if (parsedUrl.protocol === 'https:' &&
  5254. parsedUrl.protocol !== parsedRedirectUrl.protocol &&
  5255. !this._allowRedirectDowngrade) {
  5256. 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.');
  5257. }
  5258. // we need to finish reading the response before reassigning response
  5259. // which will leak the open socket.
  5260. yield response.readBody();
  5261. // strip authorization header if redirected to a different hostname
  5262. if (parsedRedirectUrl.hostname !== parsedUrl.hostname) {
  5263. for (const header in headers) {
  5264. // header names are case insensitive
  5265. if (header.toLowerCase() === 'authorization') {
  5266. delete headers[header];
  5267. }
  5268. }
  5269. }
  5270. // let's make the request with the new redirectUrl
  5271. info = this._prepareRequest(verb, parsedRedirectUrl, headers);
  5272. response = yield this.requestRaw(info, data);
  5273. redirectsRemaining--;
  5274. }
  5275. if (!response.message.statusCode ||
  5276. !HttpResponseRetryCodes.includes(response.message.statusCode)) {
  5277. // If not a retry code, return immediately instead of retrying
  5278. return response;
  5279. }
  5280. numTries += 1;
  5281. if (numTries < maxTries) {
  5282. yield response.readBody();
  5283. yield this._performExponentialBackoff(numTries);
  5284. }
  5285. } while (numTries < maxTries);
  5286. return response;
  5287. });
  5288. }
  5289. /**
  5290. * Needs to be called if keepAlive is set to true in request options.
  5291. */
  5292. dispose() {
  5293. if (this._agent) {
  5294. this._agent.destroy();
  5295. }
  5296. this._disposed = true;
  5297. }
  5298. /**
  5299. * Raw request.
  5300. * @param info
  5301. * @param data
  5302. */
  5303. requestRaw(info, data) {
  5304. return __awaiter(this, void 0, void 0, function* () {
  5305. return new Promise((resolve, reject) => {
  5306. function callbackForResult(err, res) {
  5307. if (err) {
  5308. reject(err);
  5309. }
  5310. else if (!res) {
  5311. // If `err` is not passed, then `res` must be passed.
  5312. reject(new Error('Unknown error'));
  5313. }
  5314. else {
  5315. resolve(res);
  5316. }
  5317. }
  5318. this.requestRawWithCallback(info, data, callbackForResult);
  5319. });
  5320. });
  5321. }
  5322. /**
  5323. * Raw request with callback.
  5324. * @param info
  5325. * @param data
  5326. * @param onResult
  5327. */
  5328. requestRawWithCallback(info, data, onResult) {
  5329. if (typeof data === 'string') {
  5330. if (!info.options.headers) {
  5331. info.options.headers = {};
  5332. }
  5333. info.options.headers['Content-Length'] = Buffer.byteLength(data, 'utf8');
  5334. }
  5335. let callbackCalled = false;
  5336. function handleResult(err, res) {
  5337. if (!callbackCalled) {
  5338. callbackCalled = true;
  5339. onResult(err, res);
  5340. }
  5341. }
  5342. const req = info.httpModule.request(info.options, (msg) => {
  5343. const res = new HttpClientResponse(msg);
  5344. handleResult(undefined, res);
  5345. });
  5346. let socket;
  5347. req.on('socket', sock => {
  5348. socket = sock;
  5349. });
  5350. // If we ever get disconnected, we want the socket to timeout eventually
  5351. req.setTimeout(this._socketTimeout || 3 * 60000, () => {
  5352. if (socket) {
  5353. socket.end();
  5354. }
  5355. handleResult(new Error(`Request timeout: ${info.options.path}`));
  5356. });
  5357. req.on('error', function (err) {
  5358. // err has statusCode property
  5359. // res should have headers
  5360. handleResult(err);
  5361. });
  5362. if (data && typeof data === 'string') {
  5363. req.write(data, 'utf8');
  5364. }
  5365. if (data && typeof data !== 'string') {
  5366. data.on('close', function () {
  5367. req.end();
  5368. });
  5369. data.pipe(req);
  5370. }
  5371. else {
  5372. req.end();
  5373. }
  5374. }
  5375. /**
  5376. * Gets an http agent. This function is useful when you need an http agent that handles
  5377. * routing through a proxy server - depending upon the url and proxy environment variables.
  5378. * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com
  5379. */
  5380. getAgent(serverUrl) {
  5381. const parsedUrl = new URL(serverUrl);
  5382. return this._getAgent(parsedUrl);
  5383. }
  5384. getAgentDispatcher(serverUrl) {
  5385. const parsedUrl = new URL(serverUrl);
  5386. const proxyUrl = pm.getProxyUrl(parsedUrl);
  5387. const useProxy = proxyUrl && proxyUrl.hostname;
  5388. if (!useProxy) {
  5389. return;
  5390. }
  5391. return this._getProxyAgentDispatcher(parsedUrl, proxyUrl);
  5392. }
  5393. _prepareRequest(method, requestUrl, headers) {
  5394. const info = {};
  5395. info.parsedUrl = requestUrl;
  5396. const usingSsl = info.parsedUrl.protocol === 'https:';
  5397. info.httpModule = usingSsl ? https : http;
  5398. const defaultPort = usingSsl ? 443 : 80;
  5399. info.options = {};
  5400. info.options.host = info.parsedUrl.hostname;
  5401. info.options.port = info.parsedUrl.port
  5402. ? parseInt(info.parsedUrl.port)
  5403. : defaultPort;
  5404. info.options.path =
  5405. (info.parsedUrl.pathname || '') + (info.parsedUrl.search || '');
  5406. info.options.method = method;
  5407. info.options.headers = this._mergeHeaders(headers);
  5408. if (this.userAgent != null) {
  5409. info.options.headers['user-agent'] = this.userAgent;
  5410. }
  5411. info.options.agent = this._getAgent(info.parsedUrl);
  5412. // gives handlers an opportunity to participate
  5413. if (this.handlers) {
  5414. for (const handler of this.handlers) {
  5415. handler.prepareRequest(info.options);
  5416. }
  5417. }
  5418. return info;
  5419. }
  5420. _mergeHeaders(headers) {
  5421. if (this.requestOptions && this.requestOptions.headers) {
  5422. return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers || {}));
  5423. }
  5424. return lowercaseKeys(headers || {});
  5425. }
  5426. _getExistingOrDefaultHeader(additionalHeaders, header, _default) {
  5427. let clientHeader;
  5428. if (this.requestOptions && this.requestOptions.headers) {
  5429. clientHeader = lowercaseKeys(this.requestOptions.headers)[header];
  5430. }
  5431. return additionalHeaders[header] || clientHeader || _default;
  5432. }
  5433. _getAgent(parsedUrl) {
  5434. let agent;
  5435. const proxyUrl = pm.getProxyUrl(parsedUrl);
  5436. const useProxy = proxyUrl && proxyUrl.hostname;
  5437. if (this._keepAlive && useProxy) {
  5438. agent = this._proxyAgent;
  5439. }
  5440. if (!useProxy) {
  5441. agent = this._agent;
  5442. }
  5443. // if agent is already assigned use that agent.
  5444. if (agent) {
  5445. return agent;
  5446. }
  5447. const usingSsl = parsedUrl.protocol === 'https:';
  5448. let maxSockets = 100;
  5449. if (this.requestOptions) {
  5450. maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets;
  5451. }
  5452. // This is `useProxy` again, but we need to check `proxyURl` directly for TypeScripts's flow analysis.
  5453. if (proxyUrl && proxyUrl.hostname) {
  5454. const agentOptions = {
  5455. maxSockets,
  5456. keepAlive: this._keepAlive,
  5457. proxy: Object.assign(Object.assign({}, ((proxyUrl.username || proxyUrl.password) && {
  5458. proxyAuth: `${proxyUrl.username}:${proxyUrl.password}`
  5459. })), { host: proxyUrl.hostname, port: proxyUrl.port })
  5460. };
  5461. let tunnelAgent;
  5462. const overHttps = proxyUrl.protocol === 'https:';
  5463. if (usingSsl) {
  5464. tunnelAgent = overHttps ? tunnel.httpsOverHttps : tunnel.httpsOverHttp;
  5465. }
  5466. else {
  5467. tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp;
  5468. }
  5469. agent = tunnelAgent(agentOptions);
  5470. this._proxyAgent = agent;
  5471. }
  5472. // if tunneling agent isn't assigned create a new agent
  5473. if (!agent) {
  5474. const options = { keepAlive: this._keepAlive, maxSockets };
  5475. agent = usingSsl ? new https.Agent(options) : new http.Agent(options);
  5476. this._agent = agent;
  5477. }
  5478. if (usingSsl && this._ignoreSslError) {
  5479. // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process
  5480. // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options
  5481. // we have to cast it to any and change it directly
  5482. agent.options = Object.assign(agent.options || {}, {
  5483. rejectUnauthorized: false
  5484. });
  5485. }
  5486. return agent;
  5487. }
  5488. _getProxyAgentDispatcher(parsedUrl, proxyUrl) {
  5489. let proxyAgent;
  5490. if (this._keepAlive) {
  5491. proxyAgent = this._proxyAgentDispatcher;
  5492. }
  5493. // if agent is already assigned use that agent.
  5494. if (proxyAgent) {
  5495. return proxyAgent;
  5496. }
  5497. const usingSsl = parsedUrl.protocol === 'https:';
  5498. proxyAgent = new undici_1.ProxyAgent(Object.assign({ uri: proxyUrl.href, pipelining: !this._keepAlive ? 0 : 1 }, ((proxyUrl.username || proxyUrl.password) && {
  5499. token: `${proxyUrl.username}:${proxyUrl.password}`
  5500. })));
  5501. this._proxyAgentDispatcher = proxyAgent;
  5502. if (usingSsl && this._ignoreSslError) {
  5503. // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process
  5504. // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options
  5505. // we have to cast it to any and change it directly
  5506. proxyAgent.options = Object.assign(proxyAgent.options.requestTls || {}, {
  5507. rejectUnauthorized: false
  5508. });
  5509. }
  5510. return proxyAgent;
  5511. }
  5512. _performExponentialBackoff(retryNumber) {
  5513. return __awaiter(this, void 0, void 0, function* () {
  5514. retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber);
  5515. const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber);
  5516. return new Promise(resolve => setTimeout(() => resolve(), ms));
  5517. });
  5518. }
  5519. _processResponse(res, options) {
  5520. return __awaiter(this, void 0, void 0, function* () {
  5521. return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
  5522. const statusCode = res.message.statusCode || 0;
  5523. const response = {
  5524. statusCode,
  5525. result: null,
  5526. headers: {}
  5527. };
  5528. // not found leads to null obj returned
  5529. if (statusCode === HttpCodes.NotFound) {
  5530. resolve(response);
  5531. }
  5532. // get the result from the body
  5533. function dateTimeDeserializer(key, value) {
  5534. if (typeof value === 'string') {
  5535. const a = new Date(value);
  5536. if (!isNaN(a.valueOf())) {
  5537. return a;
  5538. }
  5539. }
  5540. return value;
  5541. }
  5542. let obj;
  5543. let contents;
  5544. try {
  5545. contents = yield res.readBody();
  5546. if (contents && contents.length > 0) {
  5547. if (options && options.deserializeDates) {
  5548. obj = JSON.parse(contents, dateTimeDeserializer);
  5549. }
  5550. else {
  5551. obj = JSON.parse(contents);
  5552. }
  5553. response.result = obj;
  5554. }
  5555. response.headers = res.message.headers;
  5556. }
  5557. catch (err) {
  5558. // Invalid resource (contents not json); leaving result obj null
  5559. }
  5560. // note that 3xx redirects are handled by the http layer.
  5561. if (statusCode > 299) {
  5562. let msg;
  5563. // if exception/error in body, attempt to get better error
  5564. if (obj && obj.message) {
  5565. msg = obj.message;
  5566. }
  5567. else if (contents && contents.length > 0) {
  5568. // it may be the case that the exception is in the body message as string
  5569. msg = contents;
  5570. }
  5571. else {
  5572. msg = `Failed request: (${statusCode})`;
  5573. }
  5574. const err = new HttpClientError(msg, statusCode);
  5575. err.result = response.result;
  5576. reject(err);
  5577. }
  5578. else {
  5579. resolve(response);
  5580. }
  5581. }));
  5582. });
  5583. }
  5584. }
  5585. exports.HttpClient = HttpClient;
  5586. const lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCase()] = obj[k]), c), {});
  5587. //# sourceMappingURL=index.js.map
  5588. /***/ }),
  5589. /***/ 9835:
  5590. /***/ ((__unused_webpack_module, exports) => {
  5591. "use strict";
  5592. Object.defineProperty(exports, "__esModule", ({ value: true }));
  5593. exports.checkBypass = exports.getProxyUrl = void 0;
  5594. function getProxyUrl(reqUrl) {
  5595. const usingSsl = reqUrl.protocol === 'https:';
  5596. if (checkBypass(reqUrl)) {
  5597. return undefined;
  5598. }
  5599. const proxyVar = (() => {
  5600. if (usingSsl) {
  5601. return process.env['https_proxy'] || process.env['HTTPS_PROXY'];
  5602. }
  5603. else {
  5604. return process.env['http_proxy'] || process.env['HTTP_PROXY'];
  5605. }
  5606. })();
  5607. if (proxyVar) {
  5608. try {
  5609. return new URL(proxyVar);
  5610. }
  5611. catch (_a) {
  5612. if (!proxyVar.startsWith('http://') && !proxyVar.startsWith('https://'))
  5613. return new URL(`http://${proxyVar}`);
  5614. }
  5615. }
  5616. else {
  5617. return undefined;
  5618. }
  5619. }
  5620. exports.getProxyUrl = getProxyUrl;
  5621. function checkBypass(reqUrl) {
  5622. if (!reqUrl.hostname) {
  5623. return false;
  5624. }
  5625. const reqHost = reqUrl.hostname;
  5626. if (isLoopbackAddress(reqHost)) {
  5627. return true;
  5628. }
  5629. const noProxy = process.env['no_proxy'] || process.env['NO_PROXY'] || '';
  5630. if (!noProxy) {
  5631. return false;
  5632. }
  5633. // Determine the request port
  5634. let reqPort;
  5635. if (reqUrl.port) {
  5636. reqPort = Number(reqUrl.port);
  5637. }
  5638. else if (reqUrl.protocol === 'http:') {
  5639. reqPort = 80;
  5640. }
  5641. else if (reqUrl.protocol === 'https:') {
  5642. reqPort = 443;
  5643. }
  5644. // Format the request hostname and hostname with port
  5645. const upperReqHosts = [reqUrl.hostname.toUpperCase()];
  5646. if (typeof reqPort === 'number') {
  5647. upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`);
  5648. }
  5649. // Compare request host against noproxy
  5650. for (const upperNoProxyItem of noProxy
  5651. .split(',')
  5652. .map(x => x.trim().toUpperCase())
  5653. .filter(x => x)) {
  5654. if (upperNoProxyItem === '*' ||
  5655. upperReqHosts.some(x => x === upperNoProxyItem ||
  5656. x.endsWith(`.${upperNoProxyItem}`) ||
  5657. (upperNoProxyItem.startsWith('.') &&
  5658. x.endsWith(`${upperNoProxyItem}`)))) {
  5659. return true;
  5660. }
  5661. }
  5662. return false;
  5663. }
  5664. exports.checkBypass = checkBypass;
  5665. function isLoopbackAddress(host) {
  5666. const hostLower = host.toLowerCase();
  5667. return (hostLower === 'localhost' ||
  5668. hostLower.startsWith('127.') ||
  5669. hostLower.startsWith('[::1]') ||
  5670. hostLower.startsWith('[0:0:0:0:0:0:0:1]'));
  5671. }
  5672. //# sourceMappingURL=proxy.js.map
  5673. /***/ }),
  5674. /***/ 1962:
  5675. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  5676. "use strict";
  5677. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  5678. if (k2 === undefined) k2 = k;
  5679. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  5680. }) : (function(o, m, k, k2) {
  5681. if (k2 === undefined) k2 = k;
  5682. o[k2] = m[k];
  5683. }));
  5684. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  5685. Object.defineProperty(o, "default", { enumerable: true, value: v });
  5686. }) : function(o, v) {
  5687. o["default"] = v;
  5688. });
  5689. var __importStar = (this && this.__importStar) || function (mod) {
  5690. if (mod && mod.__esModule) return mod;
  5691. var result = {};
  5692. if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  5693. __setModuleDefault(result, mod);
  5694. return result;
  5695. };
  5696. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  5697. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  5698. return new (P || (P = Promise))(function (resolve, reject) {
  5699. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  5700. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  5701. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  5702. step((generator = generator.apply(thisArg, _arguments || [])).next());
  5703. });
  5704. };
  5705. var _a;
  5706. Object.defineProperty(exports, "__esModule", ({ value: true }));
  5707. 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;
  5708. const fs = __importStar(__nccwpck_require__(7147));
  5709. const path = __importStar(__nccwpck_require__(1017));
  5710. _a = fs.promises
  5711. // export const {open} = 'fs'
  5712. , 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;
  5713. // export const {open} = 'fs'
  5714. exports.IS_WINDOWS = process.platform === 'win32';
  5715. // See https://github.com/nodejs/node/blob/d0153aee367422d0858105abec186da4dff0a0c5/deps/uv/include/uv/win.h#L691
  5716. exports.UV_FS_O_EXLOCK = 0x10000000;
  5717. exports.READONLY = fs.constants.O_RDONLY;
  5718. function exists(fsPath) {
  5719. return __awaiter(this, void 0, void 0, function* () {
  5720. try {
  5721. yield exports.stat(fsPath);
  5722. }
  5723. catch (err) {
  5724. if (err.code === 'ENOENT') {
  5725. return false;
  5726. }
  5727. throw err;
  5728. }
  5729. return true;
  5730. });
  5731. }
  5732. exports.exists = exists;
  5733. function isDirectory(fsPath, useStat = false) {
  5734. return __awaiter(this, void 0, void 0, function* () {
  5735. const stats = useStat ? yield exports.stat(fsPath) : yield exports.lstat(fsPath);
  5736. return stats.isDirectory();
  5737. });
  5738. }
  5739. exports.isDirectory = isDirectory;
  5740. /**
  5741. * On OSX/Linux, true if path starts with '/'. On Windows, true for paths like:
  5742. * \, \hello, \\hello\share, C:, and C:\hello (and corresponding alternate separator cases).
  5743. */
  5744. function isRooted(p) {
  5745. p = normalizeSeparators(p);
  5746. if (!p) {
  5747. throw new Error('isRooted() parameter "p" cannot be empty');
  5748. }
  5749. if (exports.IS_WINDOWS) {
  5750. return (p.startsWith('\\') || /^[A-Z]:/i.test(p) // e.g. \ or \hello or \\hello
  5751. ); // e.g. C: or C:\hello
  5752. }
  5753. return p.startsWith('/');
  5754. }
  5755. exports.isRooted = isRooted;
  5756. /**
  5757. * Best effort attempt to determine whether a file exists and is executable.
  5758. * @param filePath file path to check
  5759. * @param extensions additional file extensions to try
  5760. * @return if file exists and is executable, returns the file path. otherwise empty string.
  5761. */
  5762. function tryGetExecutablePath(filePath, extensions) {
  5763. return __awaiter(this, void 0, void 0, function* () {
  5764. let stats = undefined;
  5765. try {
  5766. // test file exists
  5767. stats = yield exports.stat(filePath);
  5768. }
  5769. catch (err) {
  5770. if (err.code !== 'ENOENT') {
  5771. // eslint-disable-next-line no-console
  5772. console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`);
  5773. }
  5774. }
  5775. if (stats && stats.isFile()) {
  5776. if (exports.IS_WINDOWS) {
  5777. // on Windows, test for valid extension
  5778. const upperExt = path.extname(filePath).toUpperCase();
  5779. if (extensions.some(validExt => validExt.toUpperCase() === upperExt)) {
  5780. return filePath;
  5781. }
  5782. }
  5783. else {
  5784. if (isUnixExecutable(stats)) {
  5785. return filePath;
  5786. }
  5787. }
  5788. }
  5789. // try each extension
  5790. const originalFilePath = filePath;
  5791. for (const extension of extensions) {
  5792. filePath = originalFilePath + extension;
  5793. stats = undefined;
  5794. try {
  5795. stats = yield exports.stat(filePath);
  5796. }
  5797. catch (err) {
  5798. if (err.code !== 'ENOENT') {
  5799. // eslint-disable-next-line no-console
  5800. console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`);
  5801. }
  5802. }
  5803. if (stats && stats.isFile()) {
  5804. if (exports.IS_WINDOWS) {
  5805. // preserve the case of the actual file (since an extension was appended)
  5806. try {
  5807. const directory = path.dirname(filePath);
  5808. const upperName = path.basename(filePath).toUpperCase();
  5809. for (const actualName of yield exports.readdir(directory)) {
  5810. if (upperName === actualName.toUpperCase()) {
  5811. filePath = path.join(directory, actualName);
  5812. break;
  5813. }
  5814. }
  5815. }
  5816. catch (err) {
  5817. // eslint-disable-next-line no-console
  5818. console.log(`Unexpected error attempting to determine the actual case of the file '${filePath}': ${err}`);
  5819. }
  5820. return filePath;
  5821. }
  5822. else {
  5823. if (isUnixExecutable(stats)) {
  5824. return filePath;
  5825. }
  5826. }
  5827. }
  5828. }
  5829. return '';
  5830. });
  5831. }
  5832. exports.tryGetExecutablePath = tryGetExecutablePath;
  5833. function normalizeSeparators(p) {
  5834. p = p || '';
  5835. if (exports.IS_WINDOWS) {
  5836. // convert slashes on Windows
  5837. p = p.replace(/\//g, '\\');
  5838. // remove redundant slashes
  5839. return p.replace(/\\\\+/g, '\\');
  5840. }
  5841. // remove redundant slashes
  5842. return p.replace(/\/\/+/g, '/');
  5843. }
  5844. // on Mac/Linux, test the execute bit
  5845. // R W X R W X R W X
  5846. // 256 128 64 32 16 8 4 2 1
  5847. function isUnixExecutable(stats) {
  5848. return ((stats.mode & 1) > 0 ||
  5849. ((stats.mode & 8) > 0 && stats.gid === process.getgid()) ||
  5850. ((stats.mode & 64) > 0 && stats.uid === process.getuid()));
  5851. }
  5852. // Get the path of cmd.exe in windows
  5853. function getCmdPath() {
  5854. var _a;
  5855. return (_a = process.env['COMSPEC']) !== null && _a !== void 0 ? _a : `cmd.exe`;
  5856. }
  5857. exports.getCmdPath = getCmdPath;
  5858. //# sourceMappingURL=io-util.js.map
  5859. /***/ }),
  5860. /***/ 7436:
  5861. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  5862. "use strict";
  5863. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  5864. if (k2 === undefined) k2 = k;
  5865. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  5866. }) : (function(o, m, k, k2) {
  5867. if (k2 === undefined) k2 = k;
  5868. o[k2] = m[k];
  5869. }));
  5870. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  5871. Object.defineProperty(o, "default", { enumerable: true, value: v });
  5872. }) : function(o, v) {
  5873. o["default"] = v;
  5874. });
  5875. var __importStar = (this && this.__importStar) || function (mod) {
  5876. if (mod && mod.__esModule) return mod;
  5877. var result = {};
  5878. if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  5879. __setModuleDefault(result, mod);
  5880. return result;
  5881. };
  5882. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  5883. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  5884. return new (P || (P = Promise))(function (resolve, reject) {
  5885. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  5886. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  5887. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  5888. step((generator = generator.apply(thisArg, _arguments || [])).next());
  5889. });
  5890. };
  5891. Object.defineProperty(exports, "__esModule", ({ value: true }));
  5892. exports.findInPath = exports.which = exports.mkdirP = exports.rmRF = exports.mv = exports.cp = void 0;
  5893. const assert_1 = __nccwpck_require__(9491);
  5894. const path = __importStar(__nccwpck_require__(1017));
  5895. const ioUtil = __importStar(__nccwpck_require__(1962));
  5896. /**
  5897. * Copies a file or folder.
  5898. * Based off of shelljs - https://github.com/shelljs/shelljs/blob/9237f66c52e5daa40458f94f9565e18e8132f5a6/src/cp.js
  5899. *
  5900. * @param source source path
  5901. * @param dest destination path
  5902. * @param options optional. See CopyOptions.
  5903. */
  5904. function cp(source, dest, options = {}) {
  5905. return __awaiter(this, void 0, void 0, function* () {
  5906. const { force, recursive, copySourceDirectory } = readCopyOptions(options);
  5907. const destStat = (yield ioUtil.exists(dest)) ? yield ioUtil.stat(dest) : null;
  5908. // Dest is an existing file, but not forcing
  5909. if (destStat && destStat.isFile() && !force) {
  5910. return;
  5911. }
  5912. // If dest is an existing directory, should copy inside.
  5913. const newDest = destStat && destStat.isDirectory() && copySourceDirectory
  5914. ? path.join(dest, path.basename(source))
  5915. : dest;
  5916. if (!(yield ioUtil.exists(source))) {
  5917. throw new Error(`no such file or directory: ${source}`);
  5918. }
  5919. const sourceStat = yield ioUtil.stat(source);
  5920. if (sourceStat.isDirectory()) {
  5921. if (!recursive) {
  5922. throw new Error(`Failed to copy. ${source} is a directory, but tried to copy without recursive flag.`);
  5923. }
  5924. else {
  5925. yield cpDirRecursive(source, newDest, 0, force);
  5926. }
  5927. }
  5928. else {
  5929. if (path.relative(source, newDest) === '') {
  5930. // a file cannot be copied to itself
  5931. throw new Error(`'${newDest}' and '${source}' are the same file`);
  5932. }
  5933. yield copyFile(source, newDest, force);
  5934. }
  5935. });
  5936. }
  5937. exports.cp = cp;
  5938. /**
  5939. * Moves a path.
  5940. *
  5941. * @param source source path
  5942. * @param dest destination path
  5943. * @param options optional. See MoveOptions.
  5944. */
  5945. function mv(source, dest, options = {}) {
  5946. return __awaiter(this, void 0, void 0, function* () {
  5947. if (yield ioUtil.exists(dest)) {
  5948. let destExists = true;
  5949. if (yield ioUtil.isDirectory(dest)) {
  5950. // If dest is directory copy src into dest
  5951. dest = path.join(dest, path.basename(source));
  5952. destExists = yield ioUtil.exists(dest);
  5953. }
  5954. if (destExists) {
  5955. if (options.force == null || options.force) {
  5956. yield rmRF(dest);
  5957. }
  5958. else {
  5959. throw new Error('Destination already exists');
  5960. }
  5961. }
  5962. }
  5963. yield mkdirP(path.dirname(dest));
  5964. yield ioUtil.rename(source, dest);
  5965. });
  5966. }
  5967. exports.mv = mv;
  5968. /**
  5969. * Remove a path recursively with force
  5970. *
  5971. * @param inputPath path to remove
  5972. */
  5973. function rmRF(inputPath) {
  5974. return __awaiter(this, void 0, void 0, function* () {
  5975. if (ioUtil.IS_WINDOWS) {
  5976. // Check for invalid characters
  5977. // https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file
  5978. if (/[*"<>|]/.test(inputPath)) {
  5979. throw new Error('File path must not contain `*`, `"`, `<`, `>` or `|` on Windows');
  5980. }
  5981. }
  5982. try {
  5983. // note if path does not exist, error is silent
  5984. yield ioUtil.rm(inputPath, {
  5985. force: true,
  5986. maxRetries: 3,
  5987. recursive: true,
  5988. retryDelay: 300
  5989. });
  5990. }
  5991. catch (err) {
  5992. throw new Error(`File was unable to be removed ${err}`);
  5993. }
  5994. });
  5995. }
  5996. exports.rmRF = rmRF;
  5997. /**
  5998. * Make a directory. Creates the full path with folders in between
  5999. * Will throw if it fails
  6000. *
  6001. * @param fsPath path to create
  6002. * @returns Promise<void>
  6003. */
  6004. function mkdirP(fsPath) {
  6005. return __awaiter(this, void 0, void 0, function* () {
  6006. assert_1.ok(fsPath, 'a path argument must be provided');
  6007. yield ioUtil.mkdir(fsPath, { recursive: true });
  6008. });
  6009. }
  6010. exports.mkdirP = mkdirP;
  6011. /**
  6012. * Returns path of a tool had the tool actually been invoked. Resolves via paths.
  6013. * If you check and the tool does not exist, it will throw.
  6014. *
  6015. * @param tool name of the tool
  6016. * @param check whether to check if tool exists
  6017. * @returns Promise<string> path to tool
  6018. */
  6019. function which(tool, check) {
  6020. return __awaiter(this, void 0, void 0, function* () {
  6021. if (!tool) {
  6022. throw new Error("parameter 'tool' is required");
  6023. }
  6024. // recursive when check=true
  6025. if (check) {
  6026. const result = yield which(tool, false);
  6027. if (!result) {
  6028. if (ioUtil.IS_WINDOWS) {
  6029. 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.`);
  6030. }
  6031. else {
  6032. 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.`);
  6033. }
  6034. }
  6035. return result;
  6036. }
  6037. const matches = yield findInPath(tool);
  6038. if (matches && matches.length > 0) {
  6039. return matches[0];
  6040. }
  6041. return '';
  6042. });
  6043. }
  6044. exports.which = which;
  6045. /**
  6046. * Returns a list of all occurrences of the given tool on the system path.
  6047. *
  6048. * @returns Promise<string[]> the paths of the tool
  6049. */
  6050. function findInPath(tool) {
  6051. return __awaiter(this, void 0, void 0, function* () {
  6052. if (!tool) {
  6053. throw new Error("parameter 'tool' is required");
  6054. }
  6055. // build the list of extensions to try
  6056. const extensions = [];
  6057. if (ioUtil.IS_WINDOWS && process.env['PATHEXT']) {
  6058. for (const extension of process.env['PATHEXT'].split(path.delimiter)) {
  6059. if (extension) {
  6060. extensions.push(extension);
  6061. }
  6062. }
  6063. }
  6064. // if it's rooted, return it if exists. otherwise return empty.
  6065. if (ioUtil.isRooted(tool)) {
  6066. const filePath = yield ioUtil.tryGetExecutablePath(tool, extensions);
  6067. if (filePath) {
  6068. return [filePath];
  6069. }
  6070. return [];
  6071. }
  6072. // if any path separators, return empty
  6073. if (tool.includes(path.sep)) {
  6074. return [];
  6075. }
  6076. // build the list of directories
  6077. //
  6078. // Note, technically "where" checks the current directory on Windows. From a toolkit perspective,
  6079. // it feels like we should not do this. Checking the current directory seems like more of a use
  6080. // case of a shell, and the which() function exposed by the toolkit should strive for consistency
  6081. // across platforms.
  6082. const directories = [];
  6083. if (process.env.PATH) {
  6084. for (const p of process.env.PATH.split(path.delimiter)) {
  6085. if (p) {
  6086. directories.push(p);
  6087. }
  6088. }
  6089. }
  6090. // find all matches
  6091. const matches = [];
  6092. for (const directory of directories) {
  6093. const filePath = yield ioUtil.tryGetExecutablePath(path.join(directory, tool), extensions);
  6094. if (filePath) {
  6095. matches.push(filePath);
  6096. }
  6097. }
  6098. return matches;
  6099. });
  6100. }
  6101. exports.findInPath = findInPath;
  6102. function readCopyOptions(options) {
  6103. const force = options.force == null ? true : options.force;
  6104. const recursive = Boolean(options.recursive);
  6105. const copySourceDirectory = options.copySourceDirectory == null
  6106. ? true
  6107. : Boolean(options.copySourceDirectory);
  6108. return { force, recursive, copySourceDirectory };
  6109. }
  6110. function cpDirRecursive(sourceDir, destDir, currentDepth, force) {
  6111. return __awaiter(this, void 0, void 0, function* () {
  6112. // Ensure there is not a run away recursive copy
  6113. if (currentDepth >= 255)
  6114. return;
  6115. currentDepth++;
  6116. yield mkdirP(destDir);
  6117. const files = yield ioUtil.readdir(sourceDir);
  6118. for (const fileName of files) {
  6119. const srcFile = `${sourceDir}/${fileName}`;
  6120. const destFile = `${destDir}/${fileName}`;
  6121. const srcFileStat = yield ioUtil.lstat(srcFile);
  6122. if (srcFileStat.isDirectory()) {
  6123. // Recurse
  6124. yield cpDirRecursive(srcFile, destFile, currentDepth, force);
  6125. }
  6126. else {
  6127. yield copyFile(srcFile, destFile, force);
  6128. }
  6129. }
  6130. // Change the mode for the newly created directory
  6131. yield ioUtil.chmod(destDir, (yield ioUtil.stat(sourceDir)).mode);
  6132. });
  6133. }
  6134. // Buffered file copy
  6135. function copyFile(srcFile, destFile, force) {
  6136. return __awaiter(this, void 0, void 0, function* () {
  6137. if ((yield ioUtil.lstat(srcFile)).isSymbolicLink()) {
  6138. // unlink/re-link it
  6139. try {
  6140. yield ioUtil.lstat(destFile);
  6141. yield ioUtil.unlink(destFile);
  6142. }
  6143. catch (e) {
  6144. // Try to override file permission
  6145. if (e.code === 'EPERM') {
  6146. yield ioUtil.chmod(destFile, '0666');
  6147. yield ioUtil.unlink(destFile);
  6148. }
  6149. // other errors = it doesn't exist, no work to do
  6150. }
  6151. // Copy over symlink
  6152. const symlinkFull = yield ioUtil.readlink(srcFile);
  6153. yield ioUtil.symlink(symlinkFull, destFile, ioUtil.IS_WINDOWS ? 'junction' : null);
  6154. }
  6155. else if (!(yield ioUtil.exists(destFile)) || force) {
  6156. yield ioUtil.copyFile(srcFile, destFile);
  6157. }
  6158. });
  6159. }
  6160. //# sourceMappingURL=io.js.map
  6161. /***/ }),
  6162. /***/ 2473:
  6163. /***/ (function(module, exports, __nccwpck_require__) {
  6164. "use strict";
  6165. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  6166. if (k2 === undefined) k2 = k;
  6167. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  6168. }) : (function(o, m, k, k2) {
  6169. if (k2 === undefined) k2 = k;
  6170. o[k2] = m[k];
  6171. }));
  6172. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  6173. Object.defineProperty(o, "default", { enumerable: true, value: v });
  6174. }) : function(o, v) {
  6175. o["default"] = v;
  6176. });
  6177. var __importStar = (this && this.__importStar) || function (mod) {
  6178. if (mod && mod.__esModule) return mod;
  6179. var result = {};
  6180. if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  6181. __setModuleDefault(result, mod);
  6182. return result;
  6183. };
  6184. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  6185. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  6186. return new (P || (P = Promise))(function (resolve, reject) {
  6187. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  6188. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  6189. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  6190. step((generator = generator.apply(thisArg, _arguments || [])).next());
  6191. });
  6192. };
  6193. Object.defineProperty(exports, "__esModule", ({ value: true }));
  6194. exports._readLinuxVersionFile = exports._getOsVersion = exports._findMatch = void 0;
  6195. const semver = __importStar(__nccwpck_require__(5911));
  6196. const core_1 = __nccwpck_require__(2186);
  6197. // needs to be require for core node modules to be mocked
  6198. /* eslint @typescript-eslint/no-require-imports: 0 */
  6199. const os = __nccwpck_require__(2037);
  6200. const cp = __nccwpck_require__(2081);
  6201. const fs = __nccwpck_require__(7147);
  6202. function _findMatch(versionSpec, stable, candidates, archFilter) {
  6203. return __awaiter(this, void 0, void 0, function* () {
  6204. const platFilter = os.platform();
  6205. let result;
  6206. let match;
  6207. let file;
  6208. for (const candidate of candidates) {
  6209. const version = candidate.version;
  6210. core_1.debug(`check ${version} satisfies ${versionSpec}`);
  6211. if (semver.satisfies(version, versionSpec) &&
  6212. (!stable || candidate.stable === stable)) {
  6213. file = candidate.files.find(item => {
  6214. core_1.debug(`${item.arch}===${archFilter} && ${item.platform}===${platFilter}`);
  6215. let chk = item.arch === archFilter && item.platform === platFilter;
  6216. if (chk && item.platform_version) {
  6217. const osVersion = module.exports._getOsVersion();
  6218. if (osVersion === item.platform_version) {
  6219. chk = true;
  6220. }
  6221. else {
  6222. chk = semver.satisfies(osVersion, item.platform_version);
  6223. }
  6224. }
  6225. return chk;
  6226. });
  6227. if (file) {
  6228. core_1.debug(`matched ${candidate.version}`);
  6229. match = candidate;
  6230. break;
  6231. }
  6232. }
  6233. }
  6234. if (match && file) {
  6235. // clone since we're mutating the file list to be only the file that matches
  6236. result = Object.assign({}, match);
  6237. result.files = [file];
  6238. }
  6239. return result;
  6240. });
  6241. }
  6242. exports._findMatch = _findMatch;
  6243. function _getOsVersion() {
  6244. // TODO: add windows and other linux, arm variants
  6245. // right now filtering on version is only an ubuntu and macos scenario for tools we build for hosted (python)
  6246. const plat = os.platform();
  6247. let version = '';
  6248. if (plat === 'darwin') {
  6249. version = cp.execSync('sw_vers -productVersion').toString();
  6250. }
  6251. else if (plat === 'linux') {
  6252. // lsb_release process not in some containers, readfile
  6253. // Run cat /etc/lsb-release
  6254. // DISTRIB_ID=Ubuntu
  6255. // DISTRIB_RELEASE=18.04
  6256. // DISTRIB_CODENAME=bionic
  6257. // DISTRIB_DESCRIPTION="Ubuntu 18.04.4 LTS"
  6258. const lsbContents = module.exports._readLinuxVersionFile();
  6259. if (lsbContents) {
  6260. const lines = lsbContents.split('\n');
  6261. for (const line of lines) {
  6262. const parts = line.split('=');
  6263. if (parts.length === 2 &&
  6264. (parts[0].trim() === 'VERSION_ID' ||
  6265. parts[0].trim() === 'DISTRIB_RELEASE')) {
  6266. version = parts[1]
  6267. .trim()
  6268. .replace(/^"/, '')
  6269. .replace(/"$/, '');
  6270. break;
  6271. }
  6272. }
  6273. }
  6274. }
  6275. return version;
  6276. }
  6277. exports._getOsVersion = _getOsVersion;
  6278. function _readLinuxVersionFile() {
  6279. const lsbReleaseFile = '/etc/lsb-release';
  6280. const osReleaseFile = '/etc/os-release';
  6281. let contents = '';
  6282. if (fs.existsSync(lsbReleaseFile)) {
  6283. contents = fs.readFileSync(lsbReleaseFile).toString();
  6284. }
  6285. else if (fs.existsSync(osReleaseFile)) {
  6286. contents = fs.readFileSync(osReleaseFile).toString();
  6287. }
  6288. return contents;
  6289. }
  6290. exports._readLinuxVersionFile = _readLinuxVersionFile;
  6291. //# sourceMappingURL=manifest.js.map
  6292. /***/ }),
  6293. /***/ 8279:
  6294. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  6295. "use strict";
  6296. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  6297. if (k2 === undefined) k2 = k;
  6298. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  6299. }) : (function(o, m, k, k2) {
  6300. if (k2 === undefined) k2 = k;
  6301. o[k2] = m[k];
  6302. }));
  6303. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  6304. Object.defineProperty(o, "default", { enumerable: true, value: v });
  6305. }) : function(o, v) {
  6306. o["default"] = v;
  6307. });
  6308. var __importStar = (this && this.__importStar) || function (mod) {
  6309. if (mod && mod.__esModule) return mod;
  6310. var result = {};
  6311. if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  6312. __setModuleDefault(result, mod);
  6313. return result;
  6314. };
  6315. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  6316. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  6317. return new (P || (P = Promise))(function (resolve, reject) {
  6318. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  6319. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  6320. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  6321. step((generator = generator.apply(thisArg, _arguments || [])).next());
  6322. });
  6323. };
  6324. Object.defineProperty(exports, "__esModule", ({ value: true }));
  6325. exports.RetryHelper = void 0;
  6326. const core = __importStar(__nccwpck_require__(2186));
  6327. /**
  6328. * Internal class for retries
  6329. */
  6330. class RetryHelper {
  6331. constructor(maxAttempts, minSeconds, maxSeconds) {
  6332. if (maxAttempts < 1) {
  6333. throw new Error('max attempts should be greater than or equal to 1');
  6334. }
  6335. this.maxAttempts = maxAttempts;
  6336. this.minSeconds = Math.floor(minSeconds);
  6337. this.maxSeconds = Math.floor(maxSeconds);
  6338. if (this.minSeconds > this.maxSeconds) {
  6339. throw new Error('min seconds should be less than or equal to max seconds');
  6340. }
  6341. }
  6342. execute(action, isRetryable) {
  6343. return __awaiter(this, void 0, void 0, function* () {
  6344. let attempt = 1;
  6345. while (attempt < this.maxAttempts) {
  6346. // Try
  6347. try {
  6348. return yield action();
  6349. }
  6350. catch (err) {
  6351. if (isRetryable && !isRetryable(err)) {
  6352. throw err;
  6353. }
  6354. core.info(err.message);
  6355. }
  6356. // Sleep
  6357. const seconds = this.getSleepAmount();
  6358. core.info(`Waiting ${seconds} seconds before trying again`);
  6359. yield this.sleep(seconds);
  6360. attempt++;
  6361. }
  6362. // Last attempt
  6363. return yield action();
  6364. });
  6365. }
  6366. getSleepAmount() {
  6367. return (Math.floor(Math.random() * (this.maxSeconds - this.minSeconds + 1)) +
  6368. this.minSeconds);
  6369. }
  6370. sleep(seconds) {
  6371. return __awaiter(this, void 0, void 0, function* () {
  6372. return new Promise(resolve => setTimeout(resolve, seconds * 1000));
  6373. });
  6374. }
  6375. }
  6376. exports.RetryHelper = RetryHelper;
  6377. //# sourceMappingURL=retry-helper.js.map
  6378. /***/ }),
  6379. /***/ 7784:
  6380. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  6381. "use strict";
  6382. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  6383. if (k2 === undefined) k2 = k;
  6384. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  6385. }) : (function(o, m, k, k2) {
  6386. if (k2 === undefined) k2 = k;
  6387. o[k2] = m[k];
  6388. }));
  6389. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  6390. Object.defineProperty(o, "default", { enumerable: true, value: v });
  6391. }) : function(o, v) {
  6392. o["default"] = v;
  6393. });
  6394. var __importStar = (this && this.__importStar) || function (mod) {
  6395. if (mod && mod.__esModule) return mod;
  6396. var result = {};
  6397. if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  6398. __setModuleDefault(result, mod);
  6399. return result;
  6400. };
  6401. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  6402. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  6403. return new (P || (P = Promise))(function (resolve, reject) {
  6404. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  6405. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  6406. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  6407. step((generator = generator.apply(thisArg, _arguments || [])).next());
  6408. });
  6409. };
  6410. var __importDefault = (this && this.__importDefault) || function (mod) {
  6411. return (mod && mod.__esModule) ? mod : { "default": mod };
  6412. };
  6413. Object.defineProperty(exports, "__esModule", ({ value: true }));
  6414. 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;
  6415. const core = __importStar(__nccwpck_require__(2186));
  6416. const io = __importStar(__nccwpck_require__(7436));
  6417. const fs = __importStar(__nccwpck_require__(7147));
  6418. const mm = __importStar(__nccwpck_require__(2473));
  6419. const os = __importStar(__nccwpck_require__(2037));
  6420. const path = __importStar(__nccwpck_require__(1017));
  6421. const httpm = __importStar(__nccwpck_require__(6255));
  6422. const semver = __importStar(__nccwpck_require__(5911));
  6423. const stream = __importStar(__nccwpck_require__(2781));
  6424. const util = __importStar(__nccwpck_require__(3837));
  6425. const assert_1 = __nccwpck_require__(9491);
  6426. const v4_1 = __importDefault(__nccwpck_require__(7468));
  6427. const exec_1 = __nccwpck_require__(1514);
  6428. const retry_helper_1 = __nccwpck_require__(8279);
  6429. class HTTPError extends Error {
  6430. constructor(httpStatusCode) {
  6431. super(`Unexpected HTTP response: ${httpStatusCode}`);
  6432. this.httpStatusCode = httpStatusCode;
  6433. Object.setPrototypeOf(this, new.target.prototype);
  6434. }
  6435. }
  6436. exports.HTTPError = HTTPError;
  6437. const IS_WINDOWS = process.platform === 'win32';
  6438. const IS_MAC = process.platform === 'darwin';
  6439. const userAgent = 'actions/tool-cache';
  6440. /**
  6441. * Download a tool from an url and stream it into a file
  6442. *
  6443. * @param url url of tool to download
  6444. * @param dest path to download tool
  6445. * @param auth authorization header
  6446. * @param headers other headers
  6447. * @returns path to downloaded tool
  6448. */
  6449. function downloadTool(url, dest, auth, headers) {
  6450. return __awaiter(this, void 0, void 0, function* () {
  6451. dest = dest || path.join(_getTempDirectory(), v4_1.default());
  6452. yield io.mkdirP(path.dirname(dest));
  6453. core.debug(`Downloading ${url}`);
  6454. core.debug(`Destination ${dest}`);
  6455. const maxAttempts = 3;
  6456. const minSeconds = _getGlobal('TEST_DOWNLOAD_TOOL_RETRY_MIN_SECONDS', 10);
  6457. const maxSeconds = _getGlobal('TEST_DOWNLOAD_TOOL_RETRY_MAX_SECONDS', 20);
  6458. const retryHelper = new retry_helper_1.RetryHelper(maxAttempts, minSeconds, maxSeconds);
  6459. return yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  6460. return yield downloadToolAttempt(url, dest || '', auth, headers);
  6461. }), (err) => {
  6462. if (err instanceof HTTPError && err.httpStatusCode) {
  6463. // Don't retry anything less than 500, except 408 Request Timeout and 429 Too Many Requests
  6464. if (err.httpStatusCode < 500 &&
  6465. err.httpStatusCode !== 408 &&
  6466. err.httpStatusCode !== 429) {
  6467. return false;
  6468. }
  6469. }
  6470. // Otherwise retry
  6471. return true;
  6472. });
  6473. });
  6474. }
  6475. exports.downloadTool = downloadTool;
  6476. function downloadToolAttempt(url, dest, auth, headers) {
  6477. return __awaiter(this, void 0, void 0, function* () {
  6478. if (fs.existsSync(dest)) {
  6479. throw new Error(`Destination file path ${dest} already exists`);
  6480. }
  6481. // Get the response headers
  6482. const http = new httpm.HttpClient(userAgent, [], {
  6483. allowRetries: false
  6484. });
  6485. if (auth) {
  6486. core.debug('set auth');
  6487. if (headers === undefined) {
  6488. headers = {};
  6489. }
  6490. headers.authorization = auth;
  6491. }
  6492. const response = yield http.get(url, headers);
  6493. if (response.message.statusCode !== 200) {
  6494. const err = new HTTPError(response.message.statusCode);
  6495. core.debug(`Failed to download from "${url}". Code(${response.message.statusCode}) Message(${response.message.statusMessage})`);
  6496. throw err;
  6497. }
  6498. // Download the response body
  6499. const pipeline = util.promisify(stream.pipeline);
  6500. const responseMessageFactory = _getGlobal('TEST_DOWNLOAD_TOOL_RESPONSE_MESSAGE_FACTORY', () => response.message);
  6501. const readStream = responseMessageFactory();
  6502. let succeeded = false;
  6503. try {
  6504. yield pipeline(readStream, fs.createWriteStream(dest));
  6505. core.debug('download complete');
  6506. succeeded = true;
  6507. return dest;
  6508. }
  6509. finally {
  6510. // Error, delete dest before retry
  6511. if (!succeeded) {
  6512. core.debug('download failed');
  6513. try {
  6514. yield io.rmRF(dest);
  6515. }
  6516. catch (err) {
  6517. core.debug(`Failed to delete '${dest}'. ${err.message}`);
  6518. }
  6519. }
  6520. }
  6521. });
  6522. }
  6523. /**
  6524. * Extract a .7z file
  6525. *
  6526. * @param file path to the .7z file
  6527. * @param dest destination directory. Optional.
  6528. * @param _7zPath path to 7zr.exe. Optional, for long path support. Most .7z archives do not have this
  6529. * problem. If your .7z archive contains very long paths, you can pass the path to 7zr.exe which will
  6530. * gracefully handle long paths. By default 7zdec.exe is used because it is a very small program and is
  6531. * bundled with the tool lib. However it does not support long paths. 7zr.exe is the reduced command line
  6532. * interface, it is smaller than the full command line interface, and it does support long paths. At the
  6533. * time of this writing, it is freely available from the LZMA SDK that is available on the 7zip website.
  6534. * Be sure to check the current license agreement. If 7zr.exe is bundled with your action, then the path
  6535. * to 7zr.exe can be pass to this function.
  6536. * @returns path to the destination directory
  6537. */
  6538. function extract7z(file, dest, _7zPath) {
  6539. return __awaiter(this, void 0, void 0, function* () {
  6540. assert_1.ok(IS_WINDOWS, 'extract7z() not supported on current OS');
  6541. assert_1.ok(file, 'parameter "file" is required');
  6542. dest = yield _createExtractFolder(dest);
  6543. const originalCwd = process.cwd();
  6544. process.chdir(dest);
  6545. if (_7zPath) {
  6546. try {
  6547. const logLevel = core.isDebug() ? '-bb1' : '-bb0';
  6548. const args = [
  6549. 'x',
  6550. logLevel,
  6551. '-bd',
  6552. '-sccUTF-8',
  6553. file
  6554. ];
  6555. const options = {
  6556. silent: true
  6557. };
  6558. yield exec_1.exec(`"${_7zPath}"`, args, options);
  6559. }
  6560. finally {
  6561. process.chdir(originalCwd);
  6562. }
  6563. }
  6564. else {
  6565. const escapedScript = path
  6566. .join(__dirname, '..', 'scripts', 'Invoke-7zdec.ps1')
  6567. .replace(/'/g, "''")
  6568. .replace(/"|\n|\r/g, ''); // double-up single quotes, remove double quotes and newlines
  6569. const escapedFile = file.replace(/'/g, "''").replace(/"|\n|\r/g, '');
  6570. const escapedTarget = dest.replace(/'/g, "''").replace(/"|\n|\r/g, '');
  6571. const command = `& '${escapedScript}' -Source '${escapedFile}' -Target '${escapedTarget}'`;
  6572. const args = [
  6573. '-NoLogo',
  6574. '-Sta',
  6575. '-NoProfile',
  6576. '-NonInteractive',
  6577. '-ExecutionPolicy',
  6578. 'Unrestricted',
  6579. '-Command',
  6580. command
  6581. ];
  6582. const options = {
  6583. silent: true
  6584. };
  6585. try {
  6586. const powershellPath = yield io.which('powershell', true);
  6587. yield exec_1.exec(`"${powershellPath}"`, args, options);
  6588. }
  6589. finally {
  6590. process.chdir(originalCwd);
  6591. }
  6592. }
  6593. return dest;
  6594. });
  6595. }
  6596. exports.extract7z = extract7z;
  6597. /**
  6598. * Extract a compressed tar archive
  6599. *
  6600. * @param file path to the tar
  6601. * @param dest destination directory. Optional.
  6602. * @param flags flags for the tar command to use for extraction. Defaults to 'xz' (extracting gzipped tars). Optional.
  6603. * @returns path to the destination directory
  6604. */
  6605. function extractTar(file, dest, flags = 'xz') {
  6606. return __awaiter(this, void 0, void 0, function* () {
  6607. if (!file) {
  6608. throw new Error("parameter 'file' is required");
  6609. }
  6610. // Create dest
  6611. dest = yield _createExtractFolder(dest);
  6612. // Determine whether GNU tar
  6613. core.debug('Checking tar --version');
  6614. let versionOutput = '';
  6615. yield exec_1.exec('tar --version', [], {
  6616. ignoreReturnCode: true,
  6617. silent: true,
  6618. listeners: {
  6619. stdout: (data) => (versionOutput += data.toString()),
  6620. stderr: (data) => (versionOutput += data.toString())
  6621. }
  6622. });
  6623. core.debug(versionOutput.trim());
  6624. const isGnuTar = versionOutput.toUpperCase().includes('GNU TAR');
  6625. // Initialize args
  6626. let args;
  6627. if (flags instanceof Array) {
  6628. args = flags;
  6629. }
  6630. else {
  6631. args = [flags];
  6632. }
  6633. if (core.isDebug() && !flags.includes('v')) {
  6634. args.push('-v');
  6635. }
  6636. let destArg = dest;
  6637. let fileArg = file;
  6638. if (IS_WINDOWS && isGnuTar) {
  6639. args.push('--force-local');
  6640. destArg = dest.replace(/\\/g, '/');
  6641. // Technically only the dest needs to have `/` but for aesthetic consistency
  6642. // convert slashes in the file arg too.
  6643. fileArg = file.replace(/\\/g, '/');
  6644. }
  6645. if (isGnuTar) {
  6646. // Suppress warnings when using GNU tar to extract archives created by BSD tar
  6647. args.push('--warning=no-unknown-keyword');
  6648. args.push('--overwrite');
  6649. }
  6650. args.push('-C', destArg, '-f', fileArg);
  6651. yield exec_1.exec(`tar`, args);
  6652. return dest;
  6653. });
  6654. }
  6655. exports.extractTar = extractTar;
  6656. /**
  6657. * Extract a xar compatible archive
  6658. *
  6659. * @param file path to the archive
  6660. * @param dest destination directory. Optional.
  6661. * @param flags flags for the xar. Optional.
  6662. * @returns path to the destination directory
  6663. */
  6664. function extractXar(file, dest, flags = []) {
  6665. return __awaiter(this, void 0, void 0, function* () {
  6666. assert_1.ok(IS_MAC, 'extractXar() not supported on current OS');
  6667. assert_1.ok(file, 'parameter "file" is required');
  6668. dest = yield _createExtractFolder(dest);
  6669. let args;
  6670. if (flags instanceof Array) {
  6671. args = flags;
  6672. }
  6673. else {
  6674. args = [flags];
  6675. }
  6676. args.push('-x', '-C', dest, '-f', file);
  6677. if (core.isDebug()) {
  6678. args.push('-v');
  6679. }
  6680. const xarPath = yield io.which('xar', true);
  6681. yield exec_1.exec(`"${xarPath}"`, _unique(args));
  6682. return dest;
  6683. });
  6684. }
  6685. exports.extractXar = extractXar;
  6686. /**
  6687. * Extract a zip
  6688. *
  6689. * @param file path to the zip
  6690. * @param dest destination directory. Optional.
  6691. * @returns path to the destination directory
  6692. */
  6693. function extractZip(file, dest) {
  6694. return __awaiter(this, void 0, void 0, function* () {
  6695. if (!file) {
  6696. throw new Error("parameter 'file' is required");
  6697. }
  6698. dest = yield _createExtractFolder(dest);
  6699. if (IS_WINDOWS) {
  6700. yield extractZipWin(file, dest);
  6701. }
  6702. else {
  6703. yield extractZipNix(file, dest);
  6704. }
  6705. return dest;
  6706. });
  6707. }
  6708. exports.extractZip = extractZip;
  6709. function extractZipWin(file, dest) {
  6710. return __awaiter(this, void 0, void 0, function* () {
  6711. // build the powershell command
  6712. const escapedFile = file.replace(/'/g, "''").replace(/"|\n|\r/g, ''); // double-up single quotes, remove double quotes and newlines
  6713. const escapedDest = dest.replace(/'/g, "''").replace(/"|\n|\r/g, '');
  6714. const pwshPath = yield io.which('pwsh', false);
  6715. //To match the file overwrite behavior on nix systems, we use the overwrite = true flag for ExtractToDirectory
  6716. //and the -Force flag for Expand-Archive as a fallback
  6717. if (pwshPath) {
  6718. //attempt to use pwsh with ExtractToDirectory, if this fails attempt Expand-Archive
  6719. const pwshCommand = [
  6720. `$ErrorActionPreference = 'Stop' ;`,
  6721. `try { Add-Type -AssemblyName System.IO.Compression.ZipFile } catch { } ;`,
  6722. `try { [System.IO.Compression.ZipFile]::ExtractToDirectory('${escapedFile}', '${escapedDest}', $true) }`,
  6723. `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 $_ } } ;`
  6724. ].join(' ');
  6725. const args = [
  6726. '-NoLogo',
  6727. '-NoProfile',
  6728. '-NonInteractive',
  6729. '-ExecutionPolicy',
  6730. 'Unrestricted',
  6731. '-Command',
  6732. pwshCommand
  6733. ];
  6734. core.debug(`Using pwsh at path: ${pwshPath}`);
  6735. yield exec_1.exec(`"${pwshPath}"`, args);
  6736. }
  6737. else {
  6738. const powershellCommand = [
  6739. `$ErrorActionPreference = 'Stop' ;`,
  6740. `try { Add-Type -AssemblyName System.IO.Compression.FileSystem } catch { } ;`,
  6741. `if ((Get-Command -Name Expand-Archive -Module Microsoft.PowerShell.Archive -ErrorAction Ignore)) { Expand-Archive -LiteralPath '${escapedFile}' -DestinationPath '${escapedDest}' -Force }`,
  6742. `else {[System.IO.Compression.ZipFile]::ExtractToDirectory('${escapedFile}', '${escapedDest}', $true) }`
  6743. ].join(' ');
  6744. const args = [
  6745. '-NoLogo',
  6746. '-Sta',
  6747. '-NoProfile',
  6748. '-NonInteractive',
  6749. '-ExecutionPolicy',
  6750. 'Unrestricted',
  6751. '-Command',
  6752. powershellCommand
  6753. ];
  6754. const powershellPath = yield io.which('powershell', true);
  6755. core.debug(`Using powershell at path: ${powershellPath}`);
  6756. yield exec_1.exec(`"${powershellPath}"`, args);
  6757. }
  6758. });
  6759. }
  6760. function extractZipNix(file, dest) {
  6761. return __awaiter(this, void 0, void 0, function* () {
  6762. const unzipPath = yield io.which('unzip', true);
  6763. const args = [file];
  6764. if (!core.isDebug()) {
  6765. args.unshift('-q');
  6766. }
  6767. args.unshift('-o'); //overwrite with -o, otherwise a prompt is shown which freezes the run
  6768. yield exec_1.exec(`"${unzipPath}"`, args, { cwd: dest });
  6769. });
  6770. }
  6771. /**
  6772. * Caches a directory and installs it into the tool cacheDir
  6773. *
  6774. * @param sourceDir the directory to cache into tools
  6775. * @param tool tool name
  6776. * @param version version of the tool. semver format
  6777. * @param arch architecture of the tool. Optional. Defaults to machine architecture
  6778. */
  6779. function cacheDir(sourceDir, tool, version, arch) {
  6780. return __awaiter(this, void 0, void 0, function* () {
  6781. version = semver.clean(version) || version;
  6782. arch = arch || os.arch();
  6783. core.debug(`Caching tool ${tool} ${version} ${arch}`);
  6784. core.debug(`source dir: ${sourceDir}`);
  6785. if (!fs.statSync(sourceDir).isDirectory()) {
  6786. throw new Error('sourceDir is not a directory');
  6787. }
  6788. // Create the tool dir
  6789. const destPath = yield _createToolPath(tool, version, arch);
  6790. // copy each child item. do not move. move can fail on Windows
  6791. // due to anti-virus software having an open handle on a file.
  6792. for (const itemName of fs.readdirSync(sourceDir)) {
  6793. const s = path.join(sourceDir, itemName);
  6794. yield io.cp(s, destPath, { recursive: true });
  6795. }
  6796. // write .complete
  6797. _completeToolPath(tool, version, arch);
  6798. return destPath;
  6799. });
  6800. }
  6801. exports.cacheDir = cacheDir;
  6802. /**
  6803. * Caches a downloaded file (GUID) and installs it
  6804. * into the tool cache with a given targetName
  6805. *
  6806. * @param sourceFile the file to cache into tools. Typically a result of downloadTool which is a guid.
  6807. * @param targetFile the name of the file name in the tools directory
  6808. * @param tool tool name
  6809. * @param version version of the tool. semver format
  6810. * @param arch architecture of the tool. Optional. Defaults to machine architecture
  6811. */
  6812. function cacheFile(sourceFile, targetFile, tool, version, arch) {
  6813. return __awaiter(this, void 0, void 0, function* () {
  6814. version = semver.clean(version) || version;
  6815. arch = arch || os.arch();
  6816. core.debug(`Caching tool ${tool} ${version} ${arch}`);
  6817. core.debug(`source file: ${sourceFile}`);
  6818. if (!fs.statSync(sourceFile).isFile()) {
  6819. throw new Error('sourceFile is not a file');
  6820. }
  6821. // create the tool dir
  6822. const destFolder = yield _createToolPath(tool, version, arch);
  6823. // copy instead of move. move can fail on Windows due to
  6824. // anti-virus software having an open handle on a file.
  6825. const destPath = path.join(destFolder, targetFile);
  6826. core.debug(`destination file ${destPath}`);
  6827. yield io.cp(sourceFile, destPath);
  6828. // write .complete
  6829. _completeToolPath(tool, version, arch);
  6830. return destFolder;
  6831. });
  6832. }
  6833. exports.cacheFile = cacheFile;
  6834. /**
  6835. * Finds the path to a tool version in the local installed tool cache
  6836. *
  6837. * @param toolName name of the tool
  6838. * @param versionSpec version of the tool
  6839. * @param arch optional arch. defaults to arch of computer
  6840. */
  6841. function find(toolName, versionSpec, arch) {
  6842. if (!toolName) {
  6843. throw new Error('toolName parameter is required');
  6844. }
  6845. if (!versionSpec) {
  6846. throw new Error('versionSpec parameter is required');
  6847. }
  6848. arch = arch || os.arch();
  6849. // attempt to resolve an explicit version
  6850. if (!isExplicitVersion(versionSpec)) {
  6851. const localVersions = findAllVersions(toolName, arch);
  6852. const match = evaluateVersions(localVersions, versionSpec);
  6853. versionSpec = match;
  6854. }
  6855. // check for the explicit version in the cache
  6856. let toolPath = '';
  6857. if (versionSpec) {
  6858. versionSpec = semver.clean(versionSpec) || '';
  6859. const cachePath = path.join(_getCacheDirectory(), toolName, versionSpec, arch);
  6860. core.debug(`checking cache: ${cachePath}`);
  6861. if (fs.existsSync(cachePath) && fs.existsSync(`${cachePath}.complete`)) {
  6862. core.debug(`Found tool in cache ${toolName} ${versionSpec} ${arch}`);
  6863. toolPath = cachePath;
  6864. }
  6865. else {
  6866. core.debug('not found');
  6867. }
  6868. }
  6869. return toolPath;
  6870. }
  6871. exports.find = find;
  6872. /**
  6873. * Finds the paths to all versions of a tool that are installed in the local tool cache
  6874. *
  6875. * @param toolName name of the tool
  6876. * @param arch optional arch. defaults to arch of computer
  6877. */
  6878. function findAllVersions(toolName, arch) {
  6879. const versions = [];
  6880. arch = arch || os.arch();
  6881. const toolPath = path.join(_getCacheDirectory(), toolName);
  6882. if (fs.existsSync(toolPath)) {
  6883. const children = fs.readdirSync(toolPath);
  6884. for (const child of children) {
  6885. if (isExplicitVersion(child)) {
  6886. const fullPath = path.join(toolPath, child, arch || '');
  6887. if (fs.existsSync(fullPath) && fs.existsSync(`${fullPath}.complete`)) {
  6888. versions.push(child);
  6889. }
  6890. }
  6891. }
  6892. }
  6893. return versions;
  6894. }
  6895. exports.findAllVersions = findAllVersions;
  6896. function getManifestFromRepo(owner, repo, auth, branch = 'master') {
  6897. return __awaiter(this, void 0, void 0, function* () {
  6898. let releases = [];
  6899. const treeUrl = `https://api.github.com/repos/${owner}/${repo}/git/trees/${branch}`;
  6900. const http = new httpm.HttpClient('tool-cache');
  6901. const headers = {};
  6902. if (auth) {
  6903. core.debug('set auth');
  6904. headers.authorization = auth;
  6905. }
  6906. const response = yield http.getJson(treeUrl, headers);
  6907. if (!response.result) {
  6908. return releases;
  6909. }
  6910. let manifestUrl = '';
  6911. for (const item of response.result.tree) {
  6912. if (item.path === 'versions-manifest.json') {
  6913. manifestUrl = item.url;
  6914. break;
  6915. }
  6916. }
  6917. headers['accept'] = 'application/vnd.github.VERSION.raw';
  6918. let versionsRaw = yield (yield http.get(manifestUrl, headers)).readBody();
  6919. if (versionsRaw) {
  6920. // shouldn't be needed but protects against invalid json saved with BOM
  6921. versionsRaw = versionsRaw.replace(/^\uFEFF/, '');
  6922. try {
  6923. releases = JSON.parse(versionsRaw);
  6924. }
  6925. catch (_a) {
  6926. core.debug('Invalid json');
  6927. }
  6928. }
  6929. return releases;
  6930. });
  6931. }
  6932. exports.getManifestFromRepo = getManifestFromRepo;
  6933. function findFromManifest(versionSpec, stable, manifest, archFilter = os.arch()) {
  6934. return __awaiter(this, void 0, void 0, function* () {
  6935. // wrap the internal impl
  6936. const match = yield mm._findMatch(versionSpec, stable, manifest, archFilter);
  6937. return match;
  6938. });
  6939. }
  6940. exports.findFromManifest = findFromManifest;
  6941. function _createExtractFolder(dest) {
  6942. return __awaiter(this, void 0, void 0, function* () {
  6943. if (!dest) {
  6944. // create a temp dir
  6945. dest = path.join(_getTempDirectory(), v4_1.default());
  6946. }
  6947. yield io.mkdirP(dest);
  6948. return dest;
  6949. });
  6950. }
  6951. function _createToolPath(tool, version, arch) {
  6952. return __awaiter(this, void 0, void 0, function* () {
  6953. const folderPath = path.join(_getCacheDirectory(), tool, semver.clean(version) || version, arch || '');
  6954. core.debug(`destination ${folderPath}`);
  6955. const markerPath = `${folderPath}.complete`;
  6956. yield io.rmRF(folderPath);
  6957. yield io.rmRF(markerPath);
  6958. yield io.mkdirP(folderPath);
  6959. return folderPath;
  6960. });
  6961. }
  6962. function _completeToolPath(tool, version, arch) {
  6963. const folderPath = path.join(_getCacheDirectory(), tool, semver.clean(version) || version, arch || '');
  6964. const markerPath = `${folderPath}.complete`;
  6965. fs.writeFileSync(markerPath, '');
  6966. core.debug('finished caching tool');
  6967. }
  6968. /**
  6969. * Check if version string is explicit
  6970. *
  6971. * @param versionSpec version string to check
  6972. */
  6973. function isExplicitVersion(versionSpec) {
  6974. const c = semver.clean(versionSpec) || '';
  6975. core.debug(`isExplicit: ${c}`);
  6976. const valid = semver.valid(c) != null;
  6977. core.debug(`explicit? ${valid}`);
  6978. return valid;
  6979. }
  6980. exports.isExplicitVersion = isExplicitVersion;
  6981. /**
  6982. * Get the highest satisfiying semantic version in `versions` which satisfies `versionSpec`
  6983. *
  6984. * @param versions array of versions to evaluate
  6985. * @param versionSpec semantic version spec to satisfy
  6986. */
  6987. function evaluateVersions(versions, versionSpec) {
  6988. let version = '';
  6989. core.debug(`evaluating ${versions.length} versions`);
  6990. versions = versions.sort((a, b) => {
  6991. if (semver.gt(a, b)) {
  6992. return 1;
  6993. }
  6994. return -1;
  6995. });
  6996. for (let i = versions.length - 1; i >= 0; i--) {
  6997. const potential = versions[i];
  6998. const satisfied = semver.satisfies(potential, versionSpec);
  6999. if (satisfied) {
  7000. version = potential;
  7001. break;
  7002. }
  7003. }
  7004. if (version) {
  7005. core.debug(`matched: ${version}`);
  7006. }
  7007. else {
  7008. core.debug('match not found');
  7009. }
  7010. return version;
  7011. }
  7012. exports.evaluateVersions = evaluateVersions;
  7013. /**
  7014. * Gets RUNNER_TOOL_CACHE
  7015. */
  7016. function _getCacheDirectory() {
  7017. const cacheDirectory = process.env['RUNNER_TOOL_CACHE'] || '';
  7018. assert_1.ok(cacheDirectory, 'Expected RUNNER_TOOL_CACHE to be defined');
  7019. return cacheDirectory;
  7020. }
  7021. /**
  7022. * Gets RUNNER_TEMP
  7023. */
  7024. function _getTempDirectory() {
  7025. const tempDirectory = process.env['RUNNER_TEMP'] || '';
  7026. assert_1.ok(tempDirectory, 'Expected RUNNER_TEMP to be defined');
  7027. return tempDirectory;
  7028. }
  7029. /**
  7030. * Gets a global variable
  7031. */
  7032. function _getGlobal(key, defaultValue) {
  7033. /* eslint-disable @typescript-eslint/no-explicit-any */
  7034. const value = global[key];
  7035. /* eslint-enable @typescript-eslint/no-explicit-any */
  7036. return value !== undefined ? value : defaultValue;
  7037. }
  7038. /**
  7039. * Returns an array of unique values.
  7040. * @param values Values to make unique.
  7041. */
  7042. function _unique(values) {
  7043. return Array.from(new Set(values));
  7044. }
  7045. //# sourceMappingURL=tool-cache.js.map
  7046. /***/ }),
  7047. /***/ 7701:
  7048. /***/ ((module) => {
  7049. /**
  7050. * Convert array of 16 byte values to UUID string format of the form:
  7051. * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
  7052. */
  7053. var byteToHex = [];
  7054. for (var i = 0; i < 256; ++i) {
  7055. byteToHex[i] = (i + 0x100).toString(16).substr(1);
  7056. }
  7057. function bytesToUuid(buf, offset) {
  7058. var i = offset || 0;
  7059. var bth = byteToHex;
  7060. // join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4
  7061. return ([
  7062. bth[buf[i++]], bth[buf[i++]],
  7063. bth[buf[i++]], bth[buf[i++]], '-',
  7064. bth[buf[i++]], bth[buf[i++]], '-',
  7065. bth[buf[i++]], bth[buf[i++]], '-',
  7066. bth[buf[i++]], bth[buf[i++]], '-',
  7067. bth[buf[i++]], bth[buf[i++]],
  7068. bth[buf[i++]], bth[buf[i++]],
  7069. bth[buf[i++]], bth[buf[i++]]
  7070. ]).join('');
  7071. }
  7072. module.exports = bytesToUuid;
  7073. /***/ }),
  7074. /***/ 7269:
  7075. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  7076. // Unique ID creation requires a high quality random # generator. In node.js
  7077. // this is pretty straight-forward - we use the crypto API.
  7078. var crypto = __nccwpck_require__(6113);
  7079. module.exports = function nodeRNG() {
  7080. return crypto.randomBytes(16);
  7081. };
  7082. /***/ }),
  7083. /***/ 7468:
  7084. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  7085. var rng = __nccwpck_require__(7269);
  7086. var bytesToUuid = __nccwpck_require__(7701);
  7087. function v4(options, buf, offset) {
  7088. var i = buf && offset || 0;
  7089. if (typeof(options) == 'string') {
  7090. buf = options === 'binary' ? new Array(16) : null;
  7091. options = null;
  7092. }
  7093. options = options || {};
  7094. var rnds = options.random || (options.rng || rng)();
  7095. // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
  7096. rnds[6] = (rnds[6] & 0x0f) | 0x40;
  7097. rnds[8] = (rnds[8] & 0x3f) | 0x80;
  7098. // Copy bytes to buffer, if provided
  7099. if (buf) {
  7100. for (var ii = 0; ii < 16; ++ii) {
  7101. buf[i + ii] = rnds[ii];
  7102. }
  7103. }
  7104. return buf || bytesToUuid(rnds);
  7105. }
  7106. module.exports = v4;
  7107. /***/ }),
  7108. /***/ 334:
  7109. /***/ ((module) => {
  7110. "use strict";
  7111. var __defProp = Object.defineProperty;
  7112. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  7113. var __getOwnPropNames = Object.getOwnPropertyNames;
  7114. var __hasOwnProp = Object.prototype.hasOwnProperty;
  7115. var __export = (target, all) => {
  7116. for (var name in all)
  7117. __defProp(target, name, { get: all[name], enumerable: true });
  7118. };
  7119. var __copyProps = (to, from, except, desc) => {
  7120. if (from && typeof from === "object" || typeof from === "function") {
  7121. for (let key of __getOwnPropNames(from))
  7122. if (!__hasOwnProp.call(to, key) && key !== except)
  7123. __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  7124. }
  7125. return to;
  7126. };
  7127. var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
  7128. // pkg/dist-src/index.js
  7129. var dist_src_exports = {};
  7130. __export(dist_src_exports, {
  7131. createTokenAuth: () => createTokenAuth
  7132. });
  7133. module.exports = __toCommonJS(dist_src_exports);
  7134. // pkg/dist-src/auth.js
  7135. var REGEX_IS_INSTALLATION_LEGACY = /^v1\./;
  7136. var REGEX_IS_INSTALLATION = /^ghs_/;
  7137. var REGEX_IS_USER_TO_SERVER = /^ghu_/;
  7138. async function auth(token) {
  7139. const isApp = token.split(/\./).length === 3;
  7140. const isInstallation = REGEX_IS_INSTALLATION_LEGACY.test(token) || REGEX_IS_INSTALLATION.test(token);
  7141. const isUserToServer = REGEX_IS_USER_TO_SERVER.test(token);
  7142. const tokenType = isApp ? "app" : isInstallation ? "installation" : isUserToServer ? "user-to-server" : "oauth";
  7143. return {
  7144. type: "token",
  7145. token,
  7146. tokenType
  7147. };
  7148. }
  7149. // pkg/dist-src/with-authorization-prefix.js
  7150. function withAuthorizationPrefix(token) {
  7151. if (token.split(/\./).length === 3) {
  7152. return `bearer ${token}`;
  7153. }
  7154. return `token ${token}`;
  7155. }
  7156. // pkg/dist-src/hook.js
  7157. async function hook(token, request, route, parameters) {
  7158. const endpoint = request.endpoint.merge(
  7159. route,
  7160. parameters
  7161. );
  7162. endpoint.headers.authorization = withAuthorizationPrefix(token);
  7163. return request(endpoint);
  7164. }
  7165. // pkg/dist-src/index.js
  7166. var createTokenAuth = function createTokenAuth2(token) {
  7167. if (!token) {
  7168. throw new Error("[@octokit/auth-token] No token passed to createTokenAuth");
  7169. }
  7170. if (typeof token !== "string") {
  7171. throw new Error(
  7172. "[@octokit/auth-token] Token passed to createTokenAuth is not a string"
  7173. );
  7174. }
  7175. token = token.replace(/^(token|bearer) +/i, "");
  7176. return Object.assign(auth.bind(null, token), {
  7177. hook: hook.bind(null, token)
  7178. });
  7179. };
  7180. // Annotate the CommonJS export names for ESM import in node:
  7181. 0 && (0);
  7182. /***/ }),
  7183. /***/ 6762:
  7184. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  7185. "use strict";
  7186. var __defProp = Object.defineProperty;
  7187. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  7188. var __getOwnPropNames = Object.getOwnPropertyNames;
  7189. var __hasOwnProp = Object.prototype.hasOwnProperty;
  7190. var __export = (target, all) => {
  7191. for (var name in all)
  7192. __defProp(target, name, { get: all[name], enumerable: true });
  7193. };
  7194. var __copyProps = (to, from, except, desc) => {
  7195. if (from && typeof from === "object" || typeof from === "function") {
  7196. for (let key of __getOwnPropNames(from))
  7197. if (!__hasOwnProp.call(to, key) && key !== except)
  7198. __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  7199. }
  7200. return to;
  7201. };
  7202. var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
  7203. // pkg/dist-src/index.js
  7204. var dist_src_exports = {};
  7205. __export(dist_src_exports, {
  7206. Octokit: () => Octokit
  7207. });
  7208. module.exports = __toCommonJS(dist_src_exports);
  7209. var import_universal_user_agent = __nccwpck_require__(5030);
  7210. var import_before_after_hook = __nccwpck_require__(3682);
  7211. var import_request = __nccwpck_require__(6234);
  7212. var import_graphql = __nccwpck_require__(8467);
  7213. var import_auth_token = __nccwpck_require__(334);
  7214. // pkg/dist-src/version.js
  7215. var VERSION = "5.2.0";
  7216. // pkg/dist-src/index.js
  7217. var noop = () => {
  7218. };
  7219. var consoleWarn = console.warn.bind(console);
  7220. var consoleError = console.error.bind(console);
  7221. var userAgentTrail = `octokit-core.js/${VERSION} ${(0, import_universal_user_agent.getUserAgent)()}`;
  7222. var Octokit = class {
  7223. static {
  7224. this.VERSION = VERSION;
  7225. }
  7226. static defaults(defaults) {
  7227. const OctokitWithDefaults = class extends this {
  7228. constructor(...args) {
  7229. const options = args[0] || {};
  7230. if (typeof defaults === "function") {
  7231. super(defaults(options));
  7232. return;
  7233. }
  7234. super(
  7235. Object.assign(
  7236. {},
  7237. defaults,
  7238. options,
  7239. options.userAgent && defaults.userAgent ? {
  7240. userAgent: `${options.userAgent} ${defaults.userAgent}`
  7241. } : null
  7242. )
  7243. );
  7244. }
  7245. };
  7246. return OctokitWithDefaults;
  7247. }
  7248. static {
  7249. this.plugins = [];
  7250. }
  7251. /**
  7252. * Attach a plugin (or many) to your Octokit instance.
  7253. *
  7254. * @example
  7255. * const API = Octokit.plugin(plugin1, plugin2, plugin3, ...)
  7256. */
  7257. static plugin(...newPlugins) {
  7258. const currentPlugins = this.plugins;
  7259. const NewOctokit = class extends this {
  7260. static {
  7261. this.plugins = currentPlugins.concat(
  7262. newPlugins.filter((plugin) => !currentPlugins.includes(plugin))
  7263. );
  7264. }
  7265. };
  7266. return NewOctokit;
  7267. }
  7268. constructor(options = {}) {
  7269. const hook = new import_before_after_hook.Collection();
  7270. const requestDefaults = {
  7271. baseUrl: import_request.request.endpoint.DEFAULTS.baseUrl,
  7272. headers: {},
  7273. request: Object.assign({}, options.request, {
  7274. // @ts-ignore internal usage only, no need to type
  7275. hook: hook.bind(null, "request")
  7276. }),
  7277. mediaType: {
  7278. previews: [],
  7279. format: ""
  7280. }
  7281. };
  7282. requestDefaults.headers["user-agent"] = options.userAgent ? `${options.userAgent} ${userAgentTrail}` : userAgentTrail;
  7283. if (options.baseUrl) {
  7284. requestDefaults.baseUrl = options.baseUrl;
  7285. }
  7286. if (options.previews) {
  7287. requestDefaults.mediaType.previews = options.previews;
  7288. }
  7289. if (options.timeZone) {
  7290. requestDefaults.headers["time-zone"] = options.timeZone;
  7291. }
  7292. this.request = import_request.request.defaults(requestDefaults);
  7293. this.graphql = (0, import_graphql.withCustomRequest)(this.request).defaults(requestDefaults);
  7294. this.log = Object.assign(
  7295. {
  7296. debug: noop,
  7297. info: noop,
  7298. warn: consoleWarn,
  7299. error: consoleError
  7300. },
  7301. options.log
  7302. );
  7303. this.hook = hook;
  7304. if (!options.authStrategy) {
  7305. if (!options.auth) {
  7306. this.auth = async () => ({
  7307. type: "unauthenticated"
  7308. });
  7309. } else {
  7310. const auth = (0, import_auth_token.createTokenAuth)(options.auth);
  7311. hook.wrap("request", auth.hook);
  7312. this.auth = auth;
  7313. }
  7314. } else {
  7315. const { authStrategy, ...otherOptions } = options;
  7316. const auth = authStrategy(
  7317. Object.assign(
  7318. {
  7319. request: this.request,
  7320. log: this.log,
  7321. // we pass the current octokit instance as well as its constructor options
  7322. // to allow for authentication strategies that return a new octokit instance
  7323. // that shares the same internal state as the current one. The original
  7324. // requirement for this was the "event-octokit" authentication strategy
  7325. // of https://github.com/probot/octokit-auth-probot.
  7326. octokit: this,
  7327. octokitOptions: otherOptions
  7328. },
  7329. options.auth
  7330. )
  7331. );
  7332. hook.wrap("request", auth.hook);
  7333. this.auth = auth;
  7334. }
  7335. const classConstructor = this.constructor;
  7336. for (let i = 0; i < classConstructor.plugins.length; ++i) {
  7337. Object.assign(this, classConstructor.plugins[i](this, options));
  7338. }
  7339. }
  7340. };
  7341. // Annotate the CommonJS export names for ESM import in node:
  7342. 0 && (0);
  7343. /***/ }),
  7344. /***/ 9440:
  7345. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  7346. "use strict";
  7347. var __defProp = Object.defineProperty;
  7348. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  7349. var __getOwnPropNames = Object.getOwnPropertyNames;
  7350. var __hasOwnProp = Object.prototype.hasOwnProperty;
  7351. var __export = (target, all) => {
  7352. for (var name in all)
  7353. __defProp(target, name, { get: all[name], enumerable: true });
  7354. };
  7355. var __copyProps = (to, from, except, desc) => {
  7356. if (from && typeof from === "object" || typeof from === "function") {
  7357. for (let key of __getOwnPropNames(from))
  7358. if (!__hasOwnProp.call(to, key) && key !== except)
  7359. __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  7360. }
  7361. return to;
  7362. };
  7363. var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
  7364. // pkg/dist-src/index.js
  7365. var dist_src_exports = {};
  7366. __export(dist_src_exports, {
  7367. endpoint: () => endpoint
  7368. });
  7369. module.exports = __toCommonJS(dist_src_exports);
  7370. // pkg/dist-src/defaults.js
  7371. var import_universal_user_agent = __nccwpck_require__(5030);
  7372. // pkg/dist-src/version.js
  7373. var VERSION = "9.0.5";
  7374. // pkg/dist-src/defaults.js
  7375. var userAgent = `octokit-endpoint.js/${VERSION} ${(0, import_universal_user_agent.getUserAgent)()}`;
  7376. var DEFAULTS = {
  7377. method: "GET",
  7378. baseUrl: "https://api.github.com",
  7379. headers: {
  7380. accept: "application/vnd.github.v3+json",
  7381. "user-agent": userAgent
  7382. },
  7383. mediaType: {
  7384. format: ""
  7385. }
  7386. };
  7387. // pkg/dist-src/util/lowercase-keys.js
  7388. function lowercaseKeys(object) {
  7389. if (!object) {
  7390. return {};
  7391. }
  7392. return Object.keys(object).reduce((newObj, key) => {
  7393. newObj[key.toLowerCase()] = object[key];
  7394. return newObj;
  7395. }, {});
  7396. }
  7397. // pkg/dist-src/util/is-plain-object.js
  7398. function isPlainObject(value) {
  7399. if (typeof value !== "object" || value === null)
  7400. return false;
  7401. if (Object.prototype.toString.call(value) !== "[object Object]")
  7402. return false;
  7403. const proto = Object.getPrototypeOf(value);
  7404. if (proto === null)
  7405. return true;
  7406. const Ctor = Object.prototype.hasOwnProperty.call(proto, "constructor") && proto.constructor;
  7407. return typeof Ctor === "function" && Ctor instanceof Ctor && Function.prototype.call(Ctor) === Function.prototype.call(value);
  7408. }
  7409. // pkg/dist-src/util/merge-deep.js
  7410. function mergeDeep(defaults, options) {
  7411. const result = Object.assign({}, defaults);
  7412. Object.keys(options).forEach((key) => {
  7413. if (isPlainObject(options[key])) {
  7414. if (!(key in defaults))
  7415. Object.assign(result, { [key]: options[key] });
  7416. else
  7417. result[key] = mergeDeep(defaults[key], options[key]);
  7418. } else {
  7419. Object.assign(result, { [key]: options[key] });
  7420. }
  7421. });
  7422. return result;
  7423. }
  7424. // pkg/dist-src/util/remove-undefined-properties.js
  7425. function removeUndefinedProperties(obj) {
  7426. for (const key in obj) {
  7427. if (obj[key] === void 0) {
  7428. delete obj[key];
  7429. }
  7430. }
  7431. return obj;
  7432. }
  7433. // pkg/dist-src/merge.js
  7434. function merge(defaults, route, options) {
  7435. if (typeof route === "string") {
  7436. let [method, url] = route.split(" ");
  7437. options = Object.assign(url ? { method, url } : { url: method }, options);
  7438. } else {
  7439. options = Object.assign({}, route);
  7440. }
  7441. options.headers = lowercaseKeys(options.headers);
  7442. removeUndefinedProperties(options);
  7443. removeUndefinedProperties(options.headers);
  7444. const mergedOptions = mergeDeep(defaults || {}, options);
  7445. if (options.url === "/graphql") {
  7446. if (defaults && defaults.mediaType.previews?.length) {
  7447. mergedOptions.mediaType.previews = defaults.mediaType.previews.filter(
  7448. (preview) => !mergedOptions.mediaType.previews.includes(preview)
  7449. ).concat(mergedOptions.mediaType.previews);
  7450. }
  7451. mergedOptions.mediaType.previews = (mergedOptions.mediaType.previews || []).map((preview) => preview.replace(/-preview/, ""));
  7452. }
  7453. return mergedOptions;
  7454. }
  7455. // pkg/dist-src/util/add-query-parameters.js
  7456. function addQueryParameters(url, parameters) {
  7457. const separator = /\?/.test(url) ? "&" : "?";
  7458. const names = Object.keys(parameters);
  7459. if (names.length === 0) {
  7460. return url;
  7461. }
  7462. return url + separator + names.map((name) => {
  7463. if (name === "q") {
  7464. return "q=" + parameters.q.split("+").map(encodeURIComponent).join("+");
  7465. }
  7466. return `${name}=${encodeURIComponent(parameters[name])}`;
  7467. }).join("&");
  7468. }
  7469. // pkg/dist-src/util/extract-url-variable-names.js
  7470. var urlVariableRegex = /\{[^}]+\}/g;
  7471. function removeNonChars(variableName) {
  7472. return variableName.replace(/^\W+|\W+$/g, "").split(/,/);
  7473. }
  7474. function extractUrlVariableNames(url) {
  7475. const matches = url.match(urlVariableRegex);
  7476. if (!matches) {
  7477. return [];
  7478. }
  7479. return matches.map(removeNonChars).reduce((a, b) => a.concat(b), []);
  7480. }
  7481. // pkg/dist-src/util/omit.js
  7482. function omit(object, keysToOmit) {
  7483. const result = { __proto__: null };
  7484. for (const key of Object.keys(object)) {
  7485. if (keysToOmit.indexOf(key) === -1) {
  7486. result[key] = object[key];
  7487. }
  7488. }
  7489. return result;
  7490. }
  7491. // pkg/dist-src/util/url-template.js
  7492. function encodeReserved(str) {
  7493. return str.split(/(%[0-9A-Fa-f]{2})/g).map(function(part) {
  7494. if (!/%[0-9A-Fa-f]/.test(part)) {
  7495. part = encodeURI(part).replace(/%5B/g, "[").replace(/%5D/g, "]");
  7496. }
  7497. return part;
  7498. }).join("");
  7499. }
  7500. function encodeUnreserved(str) {
  7501. return encodeURIComponent(str).replace(/[!'()*]/g, function(c) {
  7502. return "%" + c.charCodeAt(0).toString(16).toUpperCase();
  7503. });
  7504. }
  7505. function encodeValue(operator, value, key) {
  7506. value = operator === "+" || operator === "#" ? encodeReserved(value) : encodeUnreserved(value);
  7507. if (key) {
  7508. return encodeUnreserved(key) + "=" + value;
  7509. } else {
  7510. return value;
  7511. }
  7512. }
  7513. function isDefined(value) {
  7514. return value !== void 0 && value !== null;
  7515. }
  7516. function isKeyOperator(operator) {
  7517. return operator === ";" || operator === "&" || operator === "?";
  7518. }
  7519. function getValues(context, operator, key, modifier) {
  7520. var value = context[key], result = [];
  7521. if (isDefined(value) && value !== "") {
  7522. if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
  7523. value = value.toString();
  7524. if (modifier && modifier !== "*") {
  7525. value = value.substring(0, parseInt(modifier, 10));
  7526. }
  7527. result.push(
  7528. encodeValue(operator, value, isKeyOperator(operator) ? key : "")
  7529. );
  7530. } else {
  7531. if (modifier === "*") {
  7532. if (Array.isArray(value)) {
  7533. value.filter(isDefined).forEach(function(value2) {
  7534. result.push(
  7535. encodeValue(operator, value2, isKeyOperator(operator) ? key : "")
  7536. );
  7537. });
  7538. } else {
  7539. Object.keys(value).forEach(function(k) {
  7540. if (isDefined(value[k])) {
  7541. result.push(encodeValue(operator, value[k], k));
  7542. }
  7543. });
  7544. }
  7545. } else {
  7546. const tmp = [];
  7547. if (Array.isArray(value)) {
  7548. value.filter(isDefined).forEach(function(value2) {
  7549. tmp.push(encodeValue(operator, value2));
  7550. });
  7551. } else {
  7552. Object.keys(value).forEach(function(k) {
  7553. if (isDefined(value[k])) {
  7554. tmp.push(encodeUnreserved(k));
  7555. tmp.push(encodeValue(operator, value[k].toString()));
  7556. }
  7557. });
  7558. }
  7559. if (isKeyOperator(operator)) {
  7560. result.push(encodeUnreserved(key) + "=" + tmp.join(","));
  7561. } else if (tmp.length !== 0) {
  7562. result.push(tmp.join(","));
  7563. }
  7564. }
  7565. }
  7566. } else {
  7567. if (operator === ";") {
  7568. if (isDefined(value)) {
  7569. result.push(encodeUnreserved(key));
  7570. }
  7571. } else if (value === "" && (operator === "&" || operator === "?")) {
  7572. result.push(encodeUnreserved(key) + "=");
  7573. } else if (value === "") {
  7574. result.push("");
  7575. }
  7576. }
  7577. return result;
  7578. }
  7579. function parseUrl(template) {
  7580. return {
  7581. expand: expand.bind(null, template)
  7582. };
  7583. }
  7584. function expand(template, context) {
  7585. var operators = ["+", "#", ".", "/", ";", "?", "&"];
  7586. template = template.replace(
  7587. /\{([^\{\}]+)\}|([^\{\}]+)/g,
  7588. function(_, expression, literal) {
  7589. if (expression) {
  7590. let operator = "";
  7591. const values = [];
  7592. if (operators.indexOf(expression.charAt(0)) !== -1) {
  7593. operator = expression.charAt(0);
  7594. expression = expression.substr(1);
  7595. }
  7596. expression.split(/,/g).forEach(function(variable) {
  7597. var tmp = /([^:\*]*)(?::(\d+)|(\*))?/.exec(variable);
  7598. values.push(getValues(context, operator, tmp[1], tmp[2] || tmp[3]));
  7599. });
  7600. if (operator && operator !== "+") {
  7601. var separator = ",";
  7602. if (operator === "?") {
  7603. separator = "&";
  7604. } else if (operator !== "#") {
  7605. separator = operator;
  7606. }
  7607. return (values.length !== 0 ? operator : "") + values.join(separator);
  7608. } else {
  7609. return values.join(",");
  7610. }
  7611. } else {
  7612. return encodeReserved(literal);
  7613. }
  7614. }
  7615. );
  7616. if (template === "/") {
  7617. return template;
  7618. } else {
  7619. return template.replace(/\/$/, "");
  7620. }
  7621. }
  7622. // pkg/dist-src/parse.js
  7623. function parse(options) {
  7624. let method = options.method.toUpperCase();
  7625. let url = (options.url || "/").replace(/:([a-z]\w+)/g, "{$1}");
  7626. let headers = Object.assign({}, options.headers);
  7627. let body;
  7628. let parameters = omit(options, [
  7629. "method",
  7630. "baseUrl",
  7631. "url",
  7632. "headers",
  7633. "request",
  7634. "mediaType"
  7635. ]);
  7636. const urlVariableNames = extractUrlVariableNames(url);
  7637. url = parseUrl(url).expand(parameters);
  7638. if (!/^http/.test(url)) {
  7639. url = options.baseUrl + url;
  7640. }
  7641. const omittedParameters = Object.keys(options).filter((option) => urlVariableNames.includes(option)).concat("baseUrl");
  7642. const remainingParameters = omit(parameters, omittedParameters);
  7643. const isBinaryRequest = /application\/octet-stream/i.test(headers.accept);
  7644. if (!isBinaryRequest) {
  7645. if (options.mediaType.format) {
  7646. headers.accept = headers.accept.split(/,/).map(
  7647. (format) => format.replace(
  7648. /application\/vnd(\.\w+)(\.v3)?(\.\w+)?(\+json)?$/,
  7649. `application/vnd$1$2.${options.mediaType.format}`
  7650. )
  7651. ).join(",");
  7652. }
  7653. if (url.endsWith("/graphql")) {
  7654. if (options.mediaType.previews?.length) {
  7655. const previewsFromAcceptHeader = headers.accept.match(/[\w-]+(?=-preview)/g) || [];
  7656. headers.accept = previewsFromAcceptHeader.concat(options.mediaType.previews).map((preview) => {
  7657. const format = options.mediaType.format ? `.${options.mediaType.format}` : "+json";
  7658. return `application/vnd.github.${preview}-preview${format}`;
  7659. }).join(",");
  7660. }
  7661. }
  7662. }
  7663. if (["GET", "HEAD"].includes(method)) {
  7664. url = addQueryParameters(url, remainingParameters);
  7665. } else {
  7666. if ("data" in remainingParameters) {
  7667. body = remainingParameters.data;
  7668. } else {
  7669. if (Object.keys(remainingParameters).length) {
  7670. body = remainingParameters;
  7671. }
  7672. }
  7673. }
  7674. if (!headers["content-type"] && typeof body !== "undefined") {
  7675. headers["content-type"] = "application/json; charset=utf-8";
  7676. }
  7677. if (["PATCH", "PUT"].includes(method) && typeof body === "undefined") {
  7678. body = "";
  7679. }
  7680. return Object.assign(
  7681. { method, url, headers },
  7682. typeof body !== "undefined" ? { body } : null,
  7683. options.request ? { request: options.request } : null
  7684. );
  7685. }
  7686. // pkg/dist-src/endpoint-with-defaults.js
  7687. function endpointWithDefaults(defaults, route, options) {
  7688. return parse(merge(defaults, route, options));
  7689. }
  7690. // pkg/dist-src/with-defaults.js
  7691. function withDefaults(oldDefaults, newDefaults) {
  7692. const DEFAULTS2 = merge(oldDefaults, newDefaults);
  7693. const endpoint2 = endpointWithDefaults.bind(null, DEFAULTS2);
  7694. return Object.assign(endpoint2, {
  7695. DEFAULTS: DEFAULTS2,
  7696. defaults: withDefaults.bind(null, DEFAULTS2),
  7697. merge: merge.bind(null, DEFAULTS2),
  7698. parse
  7699. });
  7700. }
  7701. // pkg/dist-src/index.js
  7702. var endpoint = withDefaults(null, DEFAULTS);
  7703. // Annotate the CommonJS export names for ESM import in node:
  7704. 0 && (0);
  7705. /***/ }),
  7706. /***/ 8467:
  7707. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  7708. "use strict";
  7709. var __defProp = Object.defineProperty;
  7710. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  7711. var __getOwnPropNames = Object.getOwnPropertyNames;
  7712. var __hasOwnProp = Object.prototype.hasOwnProperty;
  7713. var __export = (target, all) => {
  7714. for (var name in all)
  7715. __defProp(target, name, { get: all[name], enumerable: true });
  7716. };
  7717. var __copyProps = (to, from, except, desc) => {
  7718. if (from && typeof from === "object" || typeof from === "function") {
  7719. for (let key of __getOwnPropNames(from))
  7720. if (!__hasOwnProp.call(to, key) && key !== except)
  7721. __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  7722. }
  7723. return to;
  7724. };
  7725. var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
  7726. // pkg/dist-src/index.js
  7727. var dist_src_exports = {};
  7728. __export(dist_src_exports, {
  7729. GraphqlResponseError: () => GraphqlResponseError,
  7730. graphql: () => graphql2,
  7731. withCustomRequest: () => withCustomRequest
  7732. });
  7733. module.exports = __toCommonJS(dist_src_exports);
  7734. var import_request3 = __nccwpck_require__(6234);
  7735. var import_universal_user_agent = __nccwpck_require__(5030);
  7736. // pkg/dist-src/version.js
  7737. var VERSION = "7.1.0";
  7738. // pkg/dist-src/with-defaults.js
  7739. var import_request2 = __nccwpck_require__(6234);
  7740. // pkg/dist-src/graphql.js
  7741. var import_request = __nccwpck_require__(6234);
  7742. // pkg/dist-src/error.js
  7743. function _buildMessageForResponseErrors(data) {
  7744. return `Request failed due to following response errors:
  7745. ` + data.errors.map((e) => ` - ${e.message}`).join("\n");
  7746. }
  7747. var GraphqlResponseError = class extends Error {
  7748. constructor(request2, headers, response) {
  7749. super(_buildMessageForResponseErrors(response));
  7750. this.request = request2;
  7751. this.headers = headers;
  7752. this.response = response;
  7753. this.name = "GraphqlResponseError";
  7754. this.errors = response.errors;
  7755. this.data = response.data;
  7756. if (Error.captureStackTrace) {
  7757. Error.captureStackTrace(this, this.constructor);
  7758. }
  7759. }
  7760. };
  7761. // pkg/dist-src/graphql.js
  7762. var NON_VARIABLE_OPTIONS = [
  7763. "method",
  7764. "baseUrl",
  7765. "url",
  7766. "headers",
  7767. "request",
  7768. "query",
  7769. "mediaType"
  7770. ];
  7771. var FORBIDDEN_VARIABLE_OPTIONS = ["query", "method", "url"];
  7772. var GHES_V3_SUFFIX_REGEX = /\/api\/v3\/?$/;
  7773. function graphql(request2, query, options) {
  7774. if (options) {
  7775. if (typeof query === "string" && "query" in options) {
  7776. return Promise.reject(
  7777. new Error(`[@octokit/graphql] "query" cannot be used as variable name`)
  7778. );
  7779. }
  7780. for (const key in options) {
  7781. if (!FORBIDDEN_VARIABLE_OPTIONS.includes(key))
  7782. continue;
  7783. return Promise.reject(
  7784. new Error(
  7785. `[@octokit/graphql] "${key}" cannot be used as variable name`
  7786. )
  7787. );
  7788. }
  7789. }
  7790. const parsedOptions = typeof query === "string" ? Object.assign({ query }, options) : query;
  7791. const requestOptions = Object.keys(
  7792. parsedOptions
  7793. ).reduce((result, key) => {
  7794. if (NON_VARIABLE_OPTIONS.includes(key)) {
  7795. result[key] = parsedOptions[key];
  7796. return result;
  7797. }
  7798. if (!result.variables) {
  7799. result.variables = {};
  7800. }
  7801. result.variables[key] = parsedOptions[key];
  7802. return result;
  7803. }, {});
  7804. const baseUrl = parsedOptions.baseUrl || request2.endpoint.DEFAULTS.baseUrl;
  7805. if (GHES_V3_SUFFIX_REGEX.test(baseUrl)) {
  7806. requestOptions.url = baseUrl.replace(GHES_V3_SUFFIX_REGEX, "/api/graphql");
  7807. }
  7808. return request2(requestOptions).then((response) => {
  7809. if (response.data.errors) {
  7810. const headers = {};
  7811. for (const key of Object.keys(response.headers)) {
  7812. headers[key] = response.headers[key];
  7813. }
  7814. throw new GraphqlResponseError(
  7815. requestOptions,
  7816. headers,
  7817. response.data
  7818. );
  7819. }
  7820. return response.data.data;
  7821. });
  7822. }
  7823. // pkg/dist-src/with-defaults.js
  7824. function withDefaults(request2, newDefaults) {
  7825. const newRequest = request2.defaults(newDefaults);
  7826. const newApi = (query, options) => {
  7827. return graphql(newRequest, query, options);
  7828. };
  7829. return Object.assign(newApi, {
  7830. defaults: withDefaults.bind(null, newRequest),
  7831. endpoint: newRequest.endpoint
  7832. });
  7833. }
  7834. // pkg/dist-src/index.js
  7835. var graphql2 = withDefaults(import_request3.request, {
  7836. headers: {
  7837. "user-agent": `octokit-graphql.js/${VERSION} ${(0, import_universal_user_agent.getUserAgent)()}`
  7838. },
  7839. method: "POST",
  7840. url: "/graphql"
  7841. });
  7842. function withCustomRequest(customRequest) {
  7843. return withDefaults(customRequest, {
  7844. method: "POST",
  7845. url: "/graphql"
  7846. });
  7847. }
  7848. // Annotate the CommonJS export names for ESM import in node:
  7849. 0 && (0);
  7850. /***/ }),
  7851. /***/ 4193:
  7852. /***/ ((module) => {
  7853. "use strict";
  7854. var __defProp = Object.defineProperty;
  7855. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  7856. var __getOwnPropNames = Object.getOwnPropertyNames;
  7857. var __hasOwnProp = Object.prototype.hasOwnProperty;
  7858. var __export = (target, all) => {
  7859. for (var name in all)
  7860. __defProp(target, name, { get: all[name], enumerable: true });
  7861. };
  7862. var __copyProps = (to, from, except, desc) => {
  7863. if (from && typeof from === "object" || typeof from === "function") {
  7864. for (let key of __getOwnPropNames(from))
  7865. if (!__hasOwnProp.call(to, key) && key !== except)
  7866. __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  7867. }
  7868. return to;
  7869. };
  7870. var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
  7871. // pkg/dist-src/index.js
  7872. var dist_src_exports = {};
  7873. __export(dist_src_exports, {
  7874. composePaginateRest: () => composePaginateRest,
  7875. isPaginatingEndpoint: () => isPaginatingEndpoint,
  7876. paginateRest: () => paginateRest,
  7877. paginatingEndpoints: () => paginatingEndpoints
  7878. });
  7879. module.exports = __toCommonJS(dist_src_exports);
  7880. // pkg/dist-src/version.js
  7881. var VERSION = "9.2.1";
  7882. // pkg/dist-src/normalize-paginated-list-response.js
  7883. function normalizePaginatedListResponse(response) {
  7884. if (!response.data) {
  7885. return {
  7886. ...response,
  7887. data: []
  7888. };
  7889. }
  7890. const responseNeedsNormalization = "total_count" in response.data && !("url" in response.data);
  7891. if (!responseNeedsNormalization)
  7892. return response;
  7893. const incompleteResults = response.data.incomplete_results;
  7894. const repositorySelection = response.data.repository_selection;
  7895. const totalCount = response.data.total_count;
  7896. delete response.data.incomplete_results;
  7897. delete response.data.repository_selection;
  7898. delete response.data.total_count;
  7899. const namespaceKey = Object.keys(response.data)[0];
  7900. const data = response.data[namespaceKey];
  7901. response.data = data;
  7902. if (typeof incompleteResults !== "undefined") {
  7903. response.data.incomplete_results = incompleteResults;
  7904. }
  7905. if (typeof repositorySelection !== "undefined") {
  7906. response.data.repository_selection = repositorySelection;
  7907. }
  7908. response.data.total_count = totalCount;
  7909. return response;
  7910. }
  7911. // pkg/dist-src/iterator.js
  7912. function iterator(octokit, route, parameters) {
  7913. const options = typeof route === "function" ? route.endpoint(parameters) : octokit.request.endpoint(route, parameters);
  7914. const requestMethod = typeof route === "function" ? route : octokit.request;
  7915. const method = options.method;
  7916. const headers = options.headers;
  7917. let url = options.url;
  7918. return {
  7919. [Symbol.asyncIterator]: () => ({
  7920. async next() {
  7921. if (!url)
  7922. return { done: true };
  7923. try {
  7924. const response = await requestMethod({ method, url, headers });
  7925. const normalizedResponse = normalizePaginatedListResponse(response);
  7926. url = ((normalizedResponse.headers.link || "").match(
  7927. /<([^>]+)>;\s*rel="next"/
  7928. ) || [])[1];
  7929. return { value: normalizedResponse };
  7930. } catch (error) {
  7931. if (error.status !== 409)
  7932. throw error;
  7933. url = "";
  7934. return {
  7935. value: {
  7936. status: 200,
  7937. headers: {},
  7938. data: []
  7939. }
  7940. };
  7941. }
  7942. }
  7943. })
  7944. };
  7945. }
  7946. // pkg/dist-src/paginate.js
  7947. function paginate(octokit, route, parameters, mapFn) {
  7948. if (typeof parameters === "function") {
  7949. mapFn = parameters;
  7950. parameters = void 0;
  7951. }
  7952. return gather(
  7953. octokit,
  7954. [],
  7955. iterator(octokit, route, parameters)[Symbol.asyncIterator](),
  7956. mapFn
  7957. );
  7958. }
  7959. function gather(octokit, results, iterator2, mapFn) {
  7960. return iterator2.next().then((result) => {
  7961. if (result.done) {
  7962. return results;
  7963. }
  7964. let earlyExit = false;
  7965. function done() {
  7966. earlyExit = true;
  7967. }
  7968. results = results.concat(
  7969. mapFn ? mapFn(result.value, done) : result.value.data
  7970. );
  7971. if (earlyExit) {
  7972. return results;
  7973. }
  7974. return gather(octokit, results, iterator2, mapFn);
  7975. });
  7976. }
  7977. // pkg/dist-src/compose-paginate.js
  7978. var composePaginateRest = Object.assign(paginate, {
  7979. iterator
  7980. });
  7981. // pkg/dist-src/generated/paginating-endpoints.js
  7982. var paginatingEndpoints = [
  7983. "GET /advisories",
  7984. "GET /app/hook/deliveries",
  7985. "GET /app/installation-requests",
  7986. "GET /app/installations",
  7987. "GET /assignments/{assignment_id}/accepted_assignments",
  7988. "GET /classrooms",
  7989. "GET /classrooms/{classroom_id}/assignments",
  7990. "GET /enterprises/{enterprise}/dependabot/alerts",
  7991. "GET /enterprises/{enterprise}/secret-scanning/alerts",
  7992. "GET /events",
  7993. "GET /gists",
  7994. "GET /gists/public",
  7995. "GET /gists/starred",
  7996. "GET /gists/{gist_id}/comments",
  7997. "GET /gists/{gist_id}/commits",
  7998. "GET /gists/{gist_id}/forks",
  7999. "GET /installation/repositories",
  8000. "GET /issues",
  8001. "GET /licenses",
  8002. "GET /marketplace_listing/plans",
  8003. "GET /marketplace_listing/plans/{plan_id}/accounts",
  8004. "GET /marketplace_listing/stubbed/plans",
  8005. "GET /marketplace_listing/stubbed/plans/{plan_id}/accounts",
  8006. "GET /networks/{owner}/{repo}/events",
  8007. "GET /notifications",
  8008. "GET /organizations",
  8009. "GET /orgs/{org}/actions/cache/usage-by-repository",
  8010. "GET /orgs/{org}/actions/permissions/repositories",
  8011. "GET /orgs/{org}/actions/runners",
  8012. "GET /orgs/{org}/actions/secrets",
  8013. "GET /orgs/{org}/actions/secrets/{secret_name}/repositories",
  8014. "GET /orgs/{org}/actions/variables",
  8015. "GET /orgs/{org}/actions/variables/{name}/repositories",
  8016. "GET /orgs/{org}/blocks",
  8017. "GET /orgs/{org}/code-scanning/alerts",
  8018. "GET /orgs/{org}/codespaces",
  8019. "GET /orgs/{org}/codespaces/secrets",
  8020. "GET /orgs/{org}/codespaces/secrets/{secret_name}/repositories",
  8021. "GET /orgs/{org}/copilot/billing/seats",
  8022. "GET /orgs/{org}/dependabot/alerts",
  8023. "GET /orgs/{org}/dependabot/secrets",
  8024. "GET /orgs/{org}/dependabot/secrets/{secret_name}/repositories",
  8025. "GET /orgs/{org}/events",
  8026. "GET /orgs/{org}/failed_invitations",
  8027. "GET /orgs/{org}/hooks",
  8028. "GET /orgs/{org}/hooks/{hook_id}/deliveries",
  8029. "GET /orgs/{org}/installations",
  8030. "GET /orgs/{org}/invitations",
  8031. "GET /orgs/{org}/invitations/{invitation_id}/teams",
  8032. "GET /orgs/{org}/issues",
  8033. "GET /orgs/{org}/members",
  8034. "GET /orgs/{org}/members/{username}/codespaces",
  8035. "GET /orgs/{org}/migrations",
  8036. "GET /orgs/{org}/migrations/{migration_id}/repositories",
  8037. "GET /orgs/{org}/organization-roles/{role_id}/teams",
  8038. "GET /orgs/{org}/organization-roles/{role_id}/users",
  8039. "GET /orgs/{org}/outside_collaborators",
  8040. "GET /orgs/{org}/packages",
  8041. "GET /orgs/{org}/packages/{package_type}/{package_name}/versions",
  8042. "GET /orgs/{org}/personal-access-token-requests",
  8043. "GET /orgs/{org}/personal-access-token-requests/{pat_request_id}/repositories",
  8044. "GET /orgs/{org}/personal-access-tokens",
  8045. "GET /orgs/{org}/personal-access-tokens/{pat_id}/repositories",
  8046. "GET /orgs/{org}/projects",
  8047. "GET /orgs/{org}/properties/values",
  8048. "GET /orgs/{org}/public_members",
  8049. "GET /orgs/{org}/repos",
  8050. "GET /orgs/{org}/rulesets",
  8051. "GET /orgs/{org}/rulesets/rule-suites",
  8052. "GET /orgs/{org}/secret-scanning/alerts",
  8053. "GET /orgs/{org}/security-advisories",
  8054. "GET /orgs/{org}/teams",
  8055. "GET /orgs/{org}/teams/{team_slug}/discussions",
  8056. "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments",
  8057. "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions",
  8058. "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions",
  8059. "GET /orgs/{org}/teams/{team_slug}/invitations",
  8060. "GET /orgs/{org}/teams/{team_slug}/members",
  8061. "GET /orgs/{org}/teams/{team_slug}/projects",
  8062. "GET /orgs/{org}/teams/{team_slug}/repos",
  8063. "GET /orgs/{org}/teams/{team_slug}/teams",
  8064. "GET /projects/columns/{column_id}/cards",
  8065. "GET /projects/{project_id}/collaborators",
  8066. "GET /projects/{project_id}/columns",
  8067. "GET /repos/{owner}/{repo}/actions/artifacts",
  8068. "GET /repos/{owner}/{repo}/actions/caches",
  8069. "GET /repos/{owner}/{repo}/actions/organization-secrets",
  8070. "GET /repos/{owner}/{repo}/actions/organization-variables",
  8071. "GET /repos/{owner}/{repo}/actions/runners",
  8072. "GET /repos/{owner}/{repo}/actions/runs",
  8073. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts",
  8074. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/jobs",
  8075. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs",
  8076. "GET /repos/{owner}/{repo}/actions/secrets",
  8077. "GET /repos/{owner}/{repo}/actions/variables",
  8078. "GET /repos/{owner}/{repo}/actions/workflows",
  8079. "GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs",
  8080. "GET /repos/{owner}/{repo}/activity",
  8081. "GET /repos/{owner}/{repo}/assignees",
  8082. "GET /repos/{owner}/{repo}/branches",
  8083. "GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations",
  8084. "GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs",
  8085. "GET /repos/{owner}/{repo}/code-scanning/alerts",
  8086. "GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances",
  8087. "GET /repos/{owner}/{repo}/code-scanning/analyses",
  8088. "GET /repos/{owner}/{repo}/codespaces",
  8089. "GET /repos/{owner}/{repo}/codespaces/devcontainers",
  8090. "GET /repos/{owner}/{repo}/codespaces/secrets",
  8091. "GET /repos/{owner}/{repo}/collaborators",
  8092. "GET /repos/{owner}/{repo}/comments",
  8093. "GET /repos/{owner}/{repo}/comments/{comment_id}/reactions",
  8094. "GET /repos/{owner}/{repo}/commits",
  8095. "GET /repos/{owner}/{repo}/commits/{commit_sha}/comments",
  8096. "GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls",
  8097. "GET /repos/{owner}/{repo}/commits/{ref}/check-runs",
  8098. "GET /repos/{owner}/{repo}/commits/{ref}/check-suites",
  8099. "GET /repos/{owner}/{repo}/commits/{ref}/status",
  8100. "GET /repos/{owner}/{repo}/commits/{ref}/statuses",
  8101. "GET /repos/{owner}/{repo}/contributors",
  8102. "GET /repos/{owner}/{repo}/dependabot/alerts",
  8103. "GET /repos/{owner}/{repo}/dependabot/secrets",
  8104. "GET /repos/{owner}/{repo}/deployments",
  8105. "GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses",
  8106. "GET /repos/{owner}/{repo}/environments",
  8107. "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies",
  8108. "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/apps",
  8109. "GET /repos/{owner}/{repo}/events",
  8110. "GET /repos/{owner}/{repo}/forks",
  8111. "GET /repos/{owner}/{repo}/hooks",
  8112. "GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries",
  8113. "GET /repos/{owner}/{repo}/invitations",
  8114. "GET /repos/{owner}/{repo}/issues",
  8115. "GET /repos/{owner}/{repo}/issues/comments",
  8116. "GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions",
  8117. "GET /repos/{owner}/{repo}/issues/events",
  8118. "GET /repos/{owner}/{repo}/issues/{issue_number}/comments",
  8119. "GET /repos/{owner}/{repo}/issues/{issue_number}/events",
  8120. "GET /repos/{owner}/{repo}/issues/{issue_number}/labels",
  8121. "GET /repos/{owner}/{repo}/issues/{issue_number}/reactions",
  8122. "GET /repos/{owner}/{repo}/issues/{issue_number}/timeline",
  8123. "GET /repos/{owner}/{repo}/keys",
  8124. "GET /repos/{owner}/{repo}/labels",
  8125. "GET /repos/{owner}/{repo}/milestones",
  8126. "GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels",
  8127. "GET /repos/{owner}/{repo}/notifications",
  8128. "GET /repos/{owner}/{repo}/pages/builds",
  8129. "GET /repos/{owner}/{repo}/projects",
  8130. "GET /repos/{owner}/{repo}/pulls",
  8131. "GET /repos/{owner}/{repo}/pulls/comments",
  8132. "GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions",
  8133. "GET /repos/{owner}/{repo}/pulls/{pull_number}/comments",
  8134. "GET /repos/{owner}/{repo}/pulls/{pull_number}/commits",
  8135. "GET /repos/{owner}/{repo}/pulls/{pull_number}/files",
  8136. "GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews",
  8137. "GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments",
  8138. "GET /repos/{owner}/{repo}/releases",
  8139. "GET /repos/{owner}/{repo}/releases/{release_id}/assets",
  8140. "GET /repos/{owner}/{repo}/releases/{release_id}/reactions",
  8141. "GET /repos/{owner}/{repo}/rules/branches/{branch}",
  8142. "GET /repos/{owner}/{repo}/rulesets",
  8143. "GET /repos/{owner}/{repo}/rulesets/rule-suites",
  8144. "GET /repos/{owner}/{repo}/secret-scanning/alerts",
  8145. "GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations",
  8146. "GET /repos/{owner}/{repo}/security-advisories",
  8147. "GET /repos/{owner}/{repo}/stargazers",
  8148. "GET /repos/{owner}/{repo}/subscribers",
  8149. "GET /repos/{owner}/{repo}/tags",
  8150. "GET /repos/{owner}/{repo}/teams",
  8151. "GET /repos/{owner}/{repo}/topics",
  8152. "GET /repositories",
  8153. "GET /repositories/{repository_id}/environments/{environment_name}/secrets",
  8154. "GET /repositories/{repository_id}/environments/{environment_name}/variables",
  8155. "GET /search/code",
  8156. "GET /search/commits",
  8157. "GET /search/issues",
  8158. "GET /search/labels",
  8159. "GET /search/repositories",
  8160. "GET /search/topics",
  8161. "GET /search/users",
  8162. "GET /teams/{team_id}/discussions",
  8163. "GET /teams/{team_id}/discussions/{discussion_number}/comments",
  8164. "GET /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions",
  8165. "GET /teams/{team_id}/discussions/{discussion_number}/reactions",
  8166. "GET /teams/{team_id}/invitations",
  8167. "GET /teams/{team_id}/members",
  8168. "GET /teams/{team_id}/projects",
  8169. "GET /teams/{team_id}/repos",
  8170. "GET /teams/{team_id}/teams",
  8171. "GET /user/blocks",
  8172. "GET /user/codespaces",
  8173. "GET /user/codespaces/secrets",
  8174. "GET /user/emails",
  8175. "GET /user/followers",
  8176. "GET /user/following",
  8177. "GET /user/gpg_keys",
  8178. "GET /user/installations",
  8179. "GET /user/installations/{installation_id}/repositories",
  8180. "GET /user/issues",
  8181. "GET /user/keys",
  8182. "GET /user/marketplace_purchases",
  8183. "GET /user/marketplace_purchases/stubbed",
  8184. "GET /user/memberships/orgs",
  8185. "GET /user/migrations",
  8186. "GET /user/migrations/{migration_id}/repositories",
  8187. "GET /user/orgs",
  8188. "GET /user/packages",
  8189. "GET /user/packages/{package_type}/{package_name}/versions",
  8190. "GET /user/public_emails",
  8191. "GET /user/repos",
  8192. "GET /user/repository_invitations",
  8193. "GET /user/social_accounts",
  8194. "GET /user/ssh_signing_keys",
  8195. "GET /user/starred",
  8196. "GET /user/subscriptions",
  8197. "GET /user/teams",
  8198. "GET /users",
  8199. "GET /users/{username}/events",
  8200. "GET /users/{username}/events/orgs/{org}",
  8201. "GET /users/{username}/events/public",
  8202. "GET /users/{username}/followers",
  8203. "GET /users/{username}/following",
  8204. "GET /users/{username}/gists",
  8205. "GET /users/{username}/gpg_keys",
  8206. "GET /users/{username}/keys",
  8207. "GET /users/{username}/orgs",
  8208. "GET /users/{username}/packages",
  8209. "GET /users/{username}/projects",
  8210. "GET /users/{username}/received_events",
  8211. "GET /users/{username}/received_events/public",
  8212. "GET /users/{username}/repos",
  8213. "GET /users/{username}/social_accounts",
  8214. "GET /users/{username}/ssh_signing_keys",
  8215. "GET /users/{username}/starred",
  8216. "GET /users/{username}/subscriptions"
  8217. ];
  8218. // pkg/dist-src/paginating-endpoints.js
  8219. function isPaginatingEndpoint(arg) {
  8220. if (typeof arg === "string") {
  8221. return paginatingEndpoints.includes(arg);
  8222. } else {
  8223. return false;
  8224. }
  8225. }
  8226. // pkg/dist-src/index.js
  8227. function paginateRest(octokit) {
  8228. return {
  8229. paginate: Object.assign(paginate.bind(null, octokit), {
  8230. iterator: iterator.bind(null, octokit)
  8231. })
  8232. };
  8233. }
  8234. paginateRest.VERSION = VERSION;
  8235. // Annotate the CommonJS export names for ESM import in node:
  8236. 0 && (0);
  8237. /***/ }),
  8238. /***/ 3044:
  8239. /***/ ((module) => {
  8240. "use strict";
  8241. var __defProp = Object.defineProperty;
  8242. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  8243. var __getOwnPropNames = Object.getOwnPropertyNames;
  8244. var __hasOwnProp = Object.prototype.hasOwnProperty;
  8245. var __export = (target, all) => {
  8246. for (var name in all)
  8247. __defProp(target, name, { get: all[name], enumerable: true });
  8248. };
  8249. var __copyProps = (to, from, except, desc) => {
  8250. if (from && typeof from === "object" || typeof from === "function") {
  8251. for (let key of __getOwnPropNames(from))
  8252. if (!__hasOwnProp.call(to, key) && key !== except)
  8253. __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  8254. }
  8255. return to;
  8256. };
  8257. var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
  8258. // pkg/dist-src/index.js
  8259. var dist_src_exports = {};
  8260. __export(dist_src_exports, {
  8261. legacyRestEndpointMethods: () => legacyRestEndpointMethods,
  8262. restEndpointMethods: () => restEndpointMethods
  8263. });
  8264. module.exports = __toCommonJS(dist_src_exports);
  8265. // pkg/dist-src/version.js
  8266. var VERSION = "10.4.1";
  8267. // pkg/dist-src/generated/endpoints.js
  8268. var Endpoints = {
  8269. actions: {
  8270. addCustomLabelsToSelfHostedRunnerForOrg: [
  8271. "POST /orgs/{org}/actions/runners/{runner_id}/labels"
  8272. ],
  8273. addCustomLabelsToSelfHostedRunnerForRepo: [
  8274. "POST /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"
  8275. ],
  8276. addSelectedRepoToOrgSecret: [
  8277. "PUT /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}"
  8278. ],
  8279. addSelectedRepoToOrgVariable: [
  8280. "PUT /orgs/{org}/actions/variables/{name}/repositories/{repository_id}"
  8281. ],
  8282. approveWorkflowRun: [
  8283. "POST /repos/{owner}/{repo}/actions/runs/{run_id}/approve"
  8284. ],
  8285. cancelWorkflowRun: [
  8286. "POST /repos/{owner}/{repo}/actions/runs/{run_id}/cancel"
  8287. ],
  8288. createEnvironmentVariable: [
  8289. "POST /repositories/{repository_id}/environments/{environment_name}/variables"
  8290. ],
  8291. createOrUpdateEnvironmentSecret: [
  8292. "PUT /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}"
  8293. ],
  8294. createOrUpdateOrgSecret: ["PUT /orgs/{org}/actions/secrets/{secret_name}"],
  8295. createOrUpdateRepoSecret: [
  8296. "PUT /repos/{owner}/{repo}/actions/secrets/{secret_name}"
  8297. ],
  8298. createOrgVariable: ["POST /orgs/{org}/actions/variables"],
  8299. createRegistrationTokenForOrg: [
  8300. "POST /orgs/{org}/actions/runners/registration-token"
  8301. ],
  8302. createRegistrationTokenForRepo: [
  8303. "POST /repos/{owner}/{repo}/actions/runners/registration-token"
  8304. ],
  8305. createRemoveTokenForOrg: ["POST /orgs/{org}/actions/runners/remove-token"],
  8306. createRemoveTokenForRepo: [
  8307. "POST /repos/{owner}/{repo}/actions/runners/remove-token"
  8308. ],
  8309. createRepoVariable: ["POST /repos/{owner}/{repo}/actions/variables"],
  8310. createWorkflowDispatch: [
  8311. "POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches"
  8312. ],
  8313. deleteActionsCacheById: [
  8314. "DELETE /repos/{owner}/{repo}/actions/caches/{cache_id}"
  8315. ],
  8316. deleteActionsCacheByKey: [
  8317. "DELETE /repos/{owner}/{repo}/actions/caches{?key,ref}"
  8318. ],
  8319. deleteArtifact: [
  8320. "DELETE /repos/{owner}/{repo}/actions/artifacts/{artifact_id}"
  8321. ],
  8322. deleteEnvironmentSecret: [
  8323. "DELETE /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}"
  8324. ],
  8325. deleteEnvironmentVariable: [
  8326. "DELETE /repositories/{repository_id}/environments/{environment_name}/variables/{name}"
  8327. ],
  8328. deleteOrgSecret: ["DELETE /orgs/{org}/actions/secrets/{secret_name}"],
  8329. deleteOrgVariable: ["DELETE /orgs/{org}/actions/variables/{name}"],
  8330. deleteRepoSecret: [
  8331. "DELETE /repos/{owner}/{repo}/actions/secrets/{secret_name}"
  8332. ],
  8333. deleteRepoVariable: [
  8334. "DELETE /repos/{owner}/{repo}/actions/variables/{name}"
  8335. ],
  8336. deleteSelfHostedRunnerFromOrg: [
  8337. "DELETE /orgs/{org}/actions/runners/{runner_id}"
  8338. ],
  8339. deleteSelfHostedRunnerFromRepo: [
  8340. "DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}"
  8341. ],
  8342. deleteWorkflowRun: ["DELETE /repos/{owner}/{repo}/actions/runs/{run_id}"],
  8343. deleteWorkflowRunLogs: [
  8344. "DELETE /repos/{owner}/{repo}/actions/runs/{run_id}/logs"
  8345. ],
  8346. disableSelectedRepositoryGithubActionsOrganization: [
  8347. "DELETE /orgs/{org}/actions/permissions/repositories/{repository_id}"
  8348. ],
  8349. disableWorkflow: [
  8350. "PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/disable"
  8351. ],
  8352. downloadArtifact: [
  8353. "GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}"
  8354. ],
  8355. downloadJobLogsForWorkflowRun: [
  8356. "GET /repos/{owner}/{repo}/actions/jobs/{job_id}/logs"
  8357. ],
  8358. downloadWorkflowRunAttemptLogs: [
  8359. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/logs"
  8360. ],
  8361. downloadWorkflowRunLogs: [
  8362. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/logs"
  8363. ],
  8364. enableSelectedRepositoryGithubActionsOrganization: [
  8365. "PUT /orgs/{org}/actions/permissions/repositories/{repository_id}"
  8366. ],
  8367. enableWorkflow: [
  8368. "PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/enable"
  8369. ],
  8370. forceCancelWorkflowRun: [
  8371. "POST /repos/{owner}/{repo}/actions/runs/{run_id}/force-cancel"
  8372. ],
  8373. generateRunnerJitconfigForOrg: [
  8374. "POST /orgs/{org}/actions/runners/generate-jitconfig"
  8375. ],
  8376. generateRunnerJitconfigForRepo: [
  8377. "POST /repos/{owner}/{repo}/actions/runners/generate-jitconfig"
  8378. ],
  8379. getActionsCacheList: ["GET /repos/{owner}/{repo}/actions/caches"],
  8380. getActionsCacheUsage: ["GET /repos/{owner}/{repo}/actions/cache/usage"],
  8381. getActionsCacheUsageByRepoForOrg: [
  8382. "GET /orgs/{org}/actions/cache/usage-by-repository"
  8383. ],
  8384. getActionsCacheUsageForOrg: ["GET /orgs/{org}/actions/cache/usage"],
  8385. getAllowedActionsOrganization: [
  8386. "GET /orgs/{org}/actions/permissions/selected-actions"
  8387. ],
  8388. getAllowedActionsRepository: [
  8389. "GET /repos/{owner}/{repo}/actions/permissions/selected-actions"
  8390. ],
  8391. getArtifact: ["GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}"],
  8392. getCustomOidcSubClaimForRepo: [
  8393. "GET /repos/{owner}/{repo}/actions/oidc/customization/sub"
  8394. ],
  8395. getEnvironmentPublicKey: [
  8396. "GET /repositories/{repository_id}/environments/{environment_name}/secrets/public-key"
  8397. ],
  8398. getEnvironmentSecret: [
  8399. "GET /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}"
  8400. ],
  8401. getEnvironmentVariable: [
  8402. "GET /repositories/{repository_id}/environments/{environment_name}/variables/{name}"
  8403. ],
  8404. getGithubActionsDefaultWorkflowPermissionsOrganization: [
  8405. "GET /orgs/{org}/actions/permissions/workflow"
  8406. ],
  8407. getGithubActionsDefaultWorkflowPermissionsRepository: [
  8408. "GET /repos/{owner}/{repo}/actions/permissions/workflow"
  8409. ],
  8410. getGithubActionsPermissionsOrganization: [
  8411. "GET /orgs/{org}/actions/permissions"
  8412. ],
  8413. getGithubActionsPermissionsRepository: [
  8414. "GET /repos/{owner}/{repo}/actions/permissions"
  8415. ],
  8416. getJobForWorkflowRun: ["GET /repos/{owner}/{repo}/actions/jobs/{job_id}"],
  8417. getOrgPublicKey: ["GET /orgs/{org}/actions/secrets/public-key"],
  8418. getOrgSecret: ["GET /orgs/{org}/actions/secrets/{secret_name}"],
  8419. getOrgVariable: ["GET /orgs/{org}/actions/variables/{name}"],
  8420. getPendingDeploymentsForRun: [
  8421. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments"
  8422. ],
  8423. getRepoPermissions: [
  8424. "GET /repos/{owner}/{repo}/actions/permissions",
  8425. {},
  8426. { renamed: ["actions", "getGithubActionsPermissionsRepository"] }
  8427. ],
  8428. getRepoPublicKey: ["GET /repos/{owner}/{repo}/actions/secrets/public-key"],
  8429. getRepoSecret: ["GET /repos/{owner}/{repo}/actions/secrets/{secret_name}"],
  8430. getRepoVariable: ["GET /repos/{owner}/{repo}/actions/variables/{name}"],
  8431. getReviewsForRun: [
  8432. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/approvals"
  8433. ],
  8434. getSelfHostedRunnerForOrg: ["GET /orgs/{org}/actions/runners/{runner_id}"],
  8435. getSelfHostedRunnerForRepo: [
  8436. "GET /repos/{owner}/{repo}/actions/runners/{runner_id}"
  8437. ],
  8438. getWorkflow: ["GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}"],
  8439. getWorkflowAccessToRepository: [
  8440. "GET /repos/{owner}/{repo}/actions/permissions/access"
  8441. ],
  8442. getWorkflowRun: ["GET /repos/{owner}/{repo}/actions/runs/{run_id}"],
  8443. getWorkflowRunAttempt: [
  8444. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}"
  8445. ],
  8446. getWorkflowRunUsage: [
  8447. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/timing"
  8448. ],
  8449. getWorkflowUsage: [
  8450. "GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/timing"
  8451. ],
  8452. listArtifactsForRepo: ["GET /repos/{owner}/{repo}/actions/artifacts"],
  8453. listEnvironmentSecrets: [
  8454. "GET /repositories/{repository_id}/environments/{environment_name}/secrets"
  8455. ],
  8456. listEnvironmentVariables: [
  8457. "GET /repositories/{repository_id}/environments/{environment_name}/variables"
  8458. ],
  8459. listJobsForWorkflowRun: [
  8460. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs"
  8461. ],
  8462. listJobsForWorkflowRunAttempt: [
  8463. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/jobs"
  8464. ],
  8465. listLabelsForSelfHostedRunnerForOrg: [
  8466. "GET /orgs/{org}/actions/runners/{runner_id}/labels"
  8467. ],
  8468. listLabelsForSelfHostedRunnerForRepo: [
  8469. "GET /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"
  8470. ],
  8471. listOrgSecrets: ["GET /orgs/{org}/actions/secrets"],
  8472. listOrgVariables: ["GET /orgs/{org}/actions/variables"],
  8473. listRepoOrganizationSecrets: [
  8474. "GET /repos/{owner}/{repo}/actions/organization-secrets"
  8475. ],
  8476. listRepoOrganizationVariables: [
  8477. "GET /repos/{owner}/{repo}/actions/organization-variables"
  8478. ],
  8479. listRepoSecrets: ["GET /repos/{owner}/{repo}/actions/secrets"],
  8480. listRepoVariables: ["GET /repos/{owner}/{repo}/actions/variables"],
  8481. listRepoWorkflows: ["GET /repos/{owner}/{repo}/actions/workflows"],
  8482. listRunnerApplicationsForOrg: ["GET /orgs/{org}/actions/runners/downloads"],
  8483. listRunnerApplicationsForRepo: [
  8484. "GET /repos/{owner}/{repo}/actions/runners/downloads"
  8485. ],
  8486. listSelectedReposForOrgSecret: [
  8487. "GET /orgs/{org}/actions/secrets/{secret_name}/repositories"
  8488. ],
  8489. listSelectedReposForOrgVariable: [
  8490. "GET /orgs/{org}/actions/variables/{name}/repositories"
  8491. ],
  8492. listSelectedRepositoriesEnabledGithubActionsOrganization: [
  8493. "GET /orgs/{org}/actions/permissions/repositories"
  8494. ],
  8495. listSelfHostedRunnersForOrg: ["GET /orgs/{org}/actions/runners"],
  8496. listSelfHostedRunnersForRepo: ["GET /repos/{owner}/{repo}/actions/runners"],
  8497. listWorkflowRunArtifacts: [
  8498. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts"
  8499. ],
  8500. listWorkflowRuns: [
  8501. "GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs"
  8502. ],
  8503. listWorkflowRunsForRepo: ["GET /repos/{owner}/{repo}/actions/runs"],
  8504. reRunJobForWorkflowRun: [
  8505. "POST /repos/{owner}/{repo}/actions/jobs/{job_id}/rerun"
  8506. ],
  8507. reRunWorkflow: ["POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun"],
  8508. reRunWorkflowFailedJobs: [
  8509. "POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun-failed-jobs"
  8510. ],
  8511. removeAllCustomLabelsFromSelfHostedRunnerForOrg: [
  8512. "DELETE /orgs/{org}/actions/runners/{runner_id}/labels"
  8513. ],
  8514. removeAllCustomLabelsFromSelfHostedRunnerForRepo: [
  8515. "DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"
  8516. ],
  8517. removeCustomLabelFromSelfHostedRunnerForOrg: [
  8518. "DELETE /orgs/{org}/actions/runners/{runner_id}/labels/{name}"
  8519. ],
  8520. removeCustomLabelFromSelfHostedRunnerForRepo: [
  8521. "DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}/labels/{name}"
  8522. ],
  8523. removeSelectedRepoFromOrgSecret: [
  8524. "DELETE /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}"
  8525. ],
  8526. removeSelectedRepoFromOrgVariable: [
  8527. "DELETE /orgs/{org}/actions/variables/{name}/repositories/{repository_id}"
  8528. ],
  8529. reviewCustomGatesForRun: [
  8530. "POST /repos/{owner}/{repo}/actions/runs/{run_id}/deployment_protection_rule"
  8531. ],
  8532. reviewPendingDeploymentsForRun: [
  8533. "POST /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments"
  8534. ],
  8535. setAllowedActionsOrganization: [
  8536. "PUT /orgs/{org}/actions/permissions/selected-actions"
  8537. ],
  8538. setAllowedActionsRepository: [
  8539. "PUT /repos/{owner}/{repo}/actions/permissions/selected-actions"
  8540. ],
  8541. setCustomLabelsForSelfHostedRunnerForOrg: [
  8542. "PUT /orgs/{org}/actions/runners/{runner_id}/labels"
  8543. ],
  8544. setCustomLabelsForSelfHostedRunnerForRepo: [
  8545. "PUT /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"
  8546. ],
  8547. setCustomOidcSubClaimForRepo: [
  8548. "PUT /repos/{owner}/{repo}/actions/oidc/customization/sub"
  8549. ],
  8550. setGithubActionsDefaultWorkflowPermissionsOrganization: [
  8551. "PUT /orgs/{org}/actions/permissions/workflow"
  8552. ],
  8553. setGithubActionsDefaultWorkflowPermissionsRepository: [
  8554. "PUT /repos/{owner}/{repo}/actions/permissions/workflow"
  8555. ],
  8556. setGithubActionsPermissionsOrganization: [
  8557. "PUT /orgs/{org}/actions/permissions"
  8558. ],
  8559. setGithubActionsPermissionsRepository: [
  8560. "PUT /repos/{owner}/{repo}/actions/permissions"
  8561. ],
  8562. setSelectedReposForOrgSecret: [
  8563. "PUT /orgs/{org}/actions/secrets/{secret_name}/repositories"
  8564. ],
  8565. setSelectedReposForOrgVariable: [
  8566. "PUT /orgs/{org}/actions/variables/{name}/repositories"
  8567. ],
  8568. setSelectedRepositoriesEnabledGithubActionsOrganization: [
  8569. "PUT /orgs/{org}/actions/permissions/repositories"
  8570. ],
  8571. setWorkflowAccessToRepository: [
  8572. "PUT /repos/{owner}/{repo}/actions/permissions/access"
  8573. ],
  8574. updateEnvironmentVariable: [
  8575. "PATCH /repositories/{repository_id}/environments/{environment_name}/variables/{name}"
  8576. ],
  8577. updateOrgVariable: ["PATCH /orgs/{org}/actions/variables/{name}"],
  8578. updateRepoVariable: [
  8579. "PATCH /repos/{owner}/{repo}/actions/variables/{name}"
  8580. ]
  8581. },
  8582. activity: {
  8583. checkRepoIsStarredByAuthenticatedUser: ["GET /user/starred/{owner}/{repo}"],
  8584. deleteRepoSubscription: ["DELETE /repos/{owner}/{repo}/subscription"],
  8585. deleteThreadSubscription: [
  8586. "DELETE /notifications/threads/{thread_id}/subscription"
  8587. ],
  8588. getFeeds: ["GET /feeds"],
  8589. getRepoSubscription: ["GET /repos/{owner}/{repo}/subscription"],
  8590. getThread: ["GET /notifications/threads/{thread_id}"],
  8591. getThreadSubscriptionForAuthenticatedUser: [
  8592. "GET /notifications/threads/{thread_id}/subscription"
  8593. ],
  8594. listEventsForAuthenticatedUser: ["GET /users/{username}/events"],
  8595. listNotificationsForAuthenticatedUser: ["GET /notifications"],
  8596. listOrgEventsForAuthenticatedUser: [
  8597. "GET /users/{username}/events/orgs/{org}"
  8598. ],
  8599. listPublicEvents: ["GET /events"],
  8600. listPublicEventsForRepoNetwork: ["GET /networks/{owner}/{repo}/events"],
  8601. listPublicEventsForUser: ["GET /users/{username}/events/public"],
  8602. listPublicOrgEvents: ["GET /orgs/{org}/events"],
  8603. listReceivedEventsForUser: ["GET /users/{username}/received_events"],
  8604. listReceivedPublicEventsForUser: [
  8605. "GET /users/{username}/received_events/public"
  8606. ],
  8607. listRepoEvents: ["GET /repos/{owner}/{repo}/events"],
  8608. listRepoNotificationsForAuthenticatedUser: [
  8609. "GET /repos/{owner}/{repo}/notifications"
  8610. ],
  8611. listReposStarredByAuthenticatedUser: ["GET /user/starred"],
  8612. listReposStarredByUser: ["GET /users/{username}/starred"],
  8613. listReposWatchedByUser: ["GET /users/{username}/subscriptions"],
  8614. listStargazersForRepo: ["GET /repos/{owner}/{repo}/stargazers"],
  8615. listWatchedReposForAuthenticatedUser: ["GET /user/subscriptions"],
  8616. listWatchersForRepo: ["GET /repos/{owner}/{repo}/subscribers"],
  8617. markNotificationsAsRead: ["PUT /notifications"],
  8618. markRepoNotificationsAsRead: ["PUT /repos/{owner}/{repo}/notifications"],
  8619. markThreadAsDone: ["DELETE /notifications/threads/{thread_id}"],
  8620. markThreadAsRead: ["PATCH /notifications/threads/{thread_id}"],
  8621. setRepoSubscription: ["PUT /repos/{owner}/{repo}/subscription"],
  8622. setThreadSubscription: [
  8623. "PUT /notifications/threads/{thread_id}/subscription"
  8624. ],
  8625. starRepoForAuthenticatedUser: ["PUT /user/starred/{owner}/{repo}"],
  8626. unstarRepoForAuthenticatedUser: ["DELETE /user/starred/{owner}/{repo}"]
  8627. },
  8628. apps: {
  8629. addRepoToInstallation: [
  8630. "PUT /user/installations/{installation_id}/repositories/{repository_id}",
  8631. {},
  8632. { renamed: ["apps", "addRepoToInstallationForAuthenticatedUser"] }
  8633. ],
  8634. addRepoToInstallationForAuthenticatedUser: [
  8635. "PUT /user/installations/{installation_id}/repositories/{repository_id}"
  8636. ],
  8637. checkToken: ["POST /applications/{client_id}/token"],
  8638. createFromManifest: ["POST /app-manifests/{code}/conversions"],
  8639. createInstallationAccessToken: [
  8640. "POST /app/installations/{installation_id}/access_tokens"
  8641. ],
  8642. deleteAuthorization: ["DELETE /applications/{client_id}/grant"],
  8643. deleteInstallation: ["DELETE /app/installations/{installation_id}"],
  8644. deleteToken: ["DELETE /applications/{client_id}/token"],
  8645. getAuthenticated: ["GET /app"],
  8646. getBySlug: ["GET /apps/{app_slug}"],
  8647. getInstallation: ["GET /app/installations/{installation_id}"],
  8648. getOrgInstallation: ["GET /orgs/{org}/installation"],
  8649. getRepoInstallation: ["GET /repos/{owner}/{repo}/installation"],
  8650. getSubscriptionPlanForAccount: [
  8651. "GET /marketplace_listing/accounts/{account_id}"
  8652. ],
  8653. getSubscriptionPlanForAccountStubbed: [
  8654. "GET /marketplace_listing/stubbed/accounts/{account_id}"
  8655. ],
  8656. getUserInstallation: ["GET /users/{username}/installation"],
  8657. getWebhookConfigForApp: ["GET /app/hook/config"],
  8658. getWebhookDelivery: ["GET /app/hook/deliveries/{delivery_id}"],
  8659. listAccountsForPlan: ["GET /marketplace_listing/plans/{plan_id}/accounts"],
  8660. listAccountsForPlanStubbed: [
  8661. "GET /marketplace_listing/stubbed/plans/{plan_id}/accounts"
  8662. ],
  8663. listInstallationReposForAuthenticatedUser: [
  8664. "GET /user/installations/{installation_id}/repositories"
  8665. ],
  8666. listInstallationRequestsForAuthenticatedApp: [
  8667. "GET /app/installation-requests"
  8668. ],
  8669. listInstallations: ["GET /app/installations"],
  8670. listInstallationsForAuthenticatedUser: ["GET /user/installations"],
  8671. listPlans: ["GET /marketplace_listing/plans"],
  8672. listPlansStubbed: ["GET /marketplace_listing/stubbed/plans"],
  8673. listReposAccessibleToInstallation: ["GET /installation/repositories"],
  8674. listSubscriptionsForAuthenticatedUser: ["GET /user/marketplace_purchases"],
  8675. listSubscriptionsForAuthenticatedUserStubbed: [
  8676. "GET /user/marketplace_purchases/stubbed"
  8677. ],
  8678. listWebhookDeliveries: ["GET /app/hook/deliveries"],
  8679. redeliverWebhookDelivery: [
  8680. "POST /app/hook/deliveries/{delivery_id}/attempts"
  8681. ],
  8682. removeRepoFromInstallation: [
  8683. "DELETE /user/installations/{installation_id}/repositories/{repository_id}",
  8684. {},
  8685. { renamed: ["apps", "removeRepoFromInstallationForAuthenticatedUser"] }
  8686. ],
  8687. removeRepoFromInstallationForAuthenticatedUser: [
  8688. "DELETE /user/installations/{installation_id}/repositories/{repository_id}"
  8689. ],
  8690. resetToken: ["PATCH /applications/{client_id}/token"],
  8691. revokeInstallationAccessToken: ["DELETE /installation/token"],
  8692. scopeToken: ["POST /applications/{client_id}/token/scoped"],
  8693. suspendInstallation: ["PUT /app/installations/{installation_id}/suspended"],
  8694. unsuspendInstallation: [
  8695. "DELETE /app/installations/{installation_id}/suspended"
  8696. ],
  8697. updateWebhookConfigForApp: ["PATCH /app/hook/config"]
  8698. },
  8699. billing: {
  8700. getGithubActionsBillingOrg: ["GET /orgs/{org}/settings/billing/actions"],
  8701. getGithubActionsBillingUser: [
  8702. "GET /users/{username}/settings/billing/actions"
  8703. ],
  8704. getGithubPackagesBillingOrg: ["GET /orgs/{org}/settings/billing/packages"],
  8705. getGithubPackagesBillingUser: [
  8706. "GET /users/{username}/settings/billing/packages"
  8707. ],
  8708. getSharedStorageBillingOrg: [
  8709. "GET /orgs/{org}/settings/billing/shared-storage"
  8710. ],
  8711. getSharedStorageBillingUser: [
  8712. "GET /users/{username}/settings/billing/shared-storage"
  8713. ]
  8714. },
  8715. checks: {
  8716. create: ["POST /repos/{owner}/{repo}/check-runs"],
  8717. createSuite: ["POST /repos/{owner}/{repo}/check-suites"],
  8718. get: ["GET /repos/{owner}/{repo}/check-runs/{check_run_id}"],
  8719. getSuite: ["GET /repos/{owner}/{repo}/check-suites/{check_suite_id}"],
  8720. listAnnotations: [
  8721. "GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations"
  8722. ],
  8723. listForRef: ["GET /repos/{owner}/{repo}/commits/{ref}/check-runs"],
  8724. listForSuite: [
  8725. "GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs"
  8726. ],
  8727. listSuitesForRef: ["GET /repos/{owner}/{repo}/commits/{ref}/check-suites"],
  8728. rerequestRun: [
  8729. "POST /repos/{owner}/{repo}/check-runs/{check_run_id}/rerequest"
  8730. ],
  8731. rerequestSuite: [
  8732. "POST /repos/{owner}/{repo}/check-suites/{check_suite_id}/rerequest"
  8733. ],
  8734. setSuitesPreferences: [
  8735. "PATCH /repos/{owner}/{repo}/check-suites/preferences"
  8736. ],
  8737. update: ["PATCH /repos/{owner}/{repo}/check-runs/{check_run_id}"]
  8738. },
  8739. codeScanning: {
  8740. deleteAnalysis: [
  8741. "DELETE /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}{?confirm_delete}"
  8742. ],
  8743. getAlert: [
  8744. "GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}",
  8745. {},
  8746. { renamedParameters: { alert_id: "alert_number" } }
  8747. ],
  8748. getAnalysis: [
  8749. "GET /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}"
  8750. ],
  8751. getCodeqlDatabase: [
  8752. "GET /repos/{owner}/{repo}/code-scanning/codeql/databases/{language}"
  8753. ],
  8754. getDefaultSetup: ["GET /repos/{owner}/{repo}/code-scanning/default-setup"],
  8755. getSarif: ["GET /repos/{owner}/{repo}/code-scanning/sarifs/{sarif_id}"],
  8756. listAlertInstances: [
  8757. "GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances"
  8758. ],
  8759. listAlertsForOrg: ["GET /orgs/{org}/code-scanning/alerts"],
  8760. listAlertsForRepo: ["GET /repos/{owner}/{repo}/code-scanning/alerts"],
  8761. listAlertsInstances: [
  8762. "GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances",
  8763. {},
  8764. { renamed: ["codeScanning", "listAlertInstances"] }
  8765. ],
  8766. listCodeqlDatabases: [
  8767. "GET /repos/{owner}/{repo}/code-scanning/codeql/databases"
  8768. ],
  8769. listRecentAnalyses: ["GET /repos/{owner}/{repo}/code-scanning/analyses"],
  8770. updateAlert: [
  8771. "PATCH /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}"
  8772. ],
  8773. updateDefaultSetup: [
  8774. "PATCH /repos/{owner}/{repo}/code-scanning/default-setup"
  8775. ],
  8776. uploadSarif: ["POST /repos/{owner}/{repo}/code-scanning/sarifs"]
  8777. },
  8778. codesOfConduct: {
  8779. getAllCodesOfConduct: ["GET /codes_of_conduct"],
  8780. getConductCode: ["GET /codes_of_conduct/{key}"]
  8781. },
  8782. codespaces: {
  8783. addRepositoryForSecretForAuthenticatedUser: [
  8784. "PUT /user/codespaces/secrets/{secret_name}/repositories/{repository_id}"
  8785. ],
  8786. addSelectedRepoToOrgSecret: [
  8787. "PUT /orgs/{org}/codespaces/secrets/{secret_name}/repositories/{repository_id}"
  8788. ],
  8789. checkPermissionsForDevcontainer: [
  8790. "GET /repos/{owner}/{repo}/codespaces/permissions_check"
  8791. ],
  8792. codespaceMachinesForAuthenticatedUser: [
  8793. "GET /user/codespaces/{codespace_name}/machines"
  8794. ],
  8795. createForAuthenticatedUser: ["POST /user/codespaces"],
  8796. createOrUpdateOrgSecret: [
  8797. "PUT /orgs/{org}/codespaces/secrets/{secret_name}"
  8798. ],
  8799. createOrUpdateRepoSecret: [
  8800. "PUT /repos/{owner}/{repo}/codespaces/secrets/{secret_name}"
  8801. ],
  8802. createOrUpdateSecretForAuthenticatedUser: [
  8803. "PUT /user/codespaces/secrets/{secret_name}"
  8804. ],
  8805. createWithPrForAuthenticatedUser: [
  8806. "POST /repos/{owner}/{repo}/pulls/{pull_number}/codespaces"
  8807. ],
  8808. createWithRepoForAuthenticatedUser: [
  8809. "POST /repos/{owner}/{repo}/codespaces"
  8810. ],
  8811. deleteForAuthenticatedUser: ["DELETE /user/codespaces/{codespace_name}"],
  8812. deleteFromOrganization: [
  8813. "DELETE /orgs/{org}/members/{username}/codespaces/{codespace_name}"
  8814. ],
  8815. deleteOrgSecret: ["DELETE /orgs/{org}/codespaces/secrets/{secret_name}"],
  8816. deleteRepoSecret: [
  8817. "DELETE /repos/{owner}/{repo}/codespaces/secrets/{secret_name}"
  8818. ],
  8819. deleteSecretForAuthenticatedUser: [
  8820. "DELETE /user/codespaces/secrets/{secret_name}"
  8821. ],
  8822. exportForAuthenticatedUser: [
  8823. "POST /user/codespaces/{codespace_name}/exports"
  8824. ],
  8825. getCodespacesForUserInOrg: [
  8826. "GET /orgs/{org}/members/{username}/codespaces"
  8827. ],
  8828. getExportDetailsForAuthenticatedUser: [
  8829. "GET /user/codespaces/{codespace_name}/exports/{export_id}"
  8830. ],
  8831. getForAuthenticatedUser: ["GET /user/codespaces/{codespace_name}"],
  8832. getOrgPublicKey: ["GET /orgs/{org}/codespaces/secrets/public-key"],
  8833. getOrgSecret: ["GET /orgs/{org}/codespaces/secrets/{secret_name}"],
  8834. getPublicKeyForAuthenticatedUser: [
  8835. "GET /user/codespaces/secrets/public-key"
  8836. ],
  8837. getRepoPublicKey: [
  8838. "GET /repos/{owner}/{repo}/codespaces/secrets/public-key"
  8839. ],
  8840. getRepoSecret: [
  8841. "GET /repos/{owner}/{repo}/codespaces/secrets/{secret_name}"
  8842. ],
  8843. getSecretForAuthenticatedUser: [
  8844. "GET /user/codespaces/secrets/{secret_name}"
  8845. ],
  8846. listDevcontainersInRepositoryForAuthenticatedUser: [
  8847. "GET /repos/{owner}/{repo}/codespaces/devcontainers"
  8848. ],
  8849. listForAuthenticatedUser: ["GET /user/codespaces"],
  8850. listInOrganization: [
  8851. "GET /orgs/{org}/codespaces",
  8852. {},
  8853. { renamedParameters: { org_id: "org" } }
  8854. ],
  8855. listInRepositoryForAuthenticatedUser: [
  8856. "GET /repos/{owner}/{repo}/codespaces"
  8857. ],
  8858. listOrgSecrets: ["GET /orgs/{org}/codespaces/secrets"],
  8859. listRepoSecrets: ["GET /repos/{owner}/{repo}/codespaces/secrets"],
  8860. listRepositoriesForSecretForAuthenticatedUser: [
  8861. "GET /user/codespaces/secrets/{secret_name}/repositories"
  8862. ],
  8863. listSecretsForAuthenticatedUser: ["GET /user/codespaces/secrets"],
  8864. listSelectedReposForOrgSecret: [
  8865. "GET /orgs/{org}/codespaces/secrets/{secret_name}/repositories"
  8866. ],
  8867. preFlightWithRepoForAuthenticatedUser: [
  8868. "GET /repos/{owner}/{repo}/codespaces/new"
  8869. ],
  8870. publishForAuthenticatedUser: [
  8871. "POST /user/codespaces/{codespace_name}/publish"
  8872. ],
  8873. removeRepositoryForSecretForAuthenticatedUser: [
  8874. "DELETE /user/codespaces/secrets/{secret_name}/repositories/{repository_id}"
  8875. ],
  8876. removeSelectedRepoFromOrgSecret: [
  8877. "DELETE /orgs/{org}/codespaces/secrets/{secret_name}/repositories/{repository_id}"
  8878. ],
  8879. repoMachinesForAuthenticatedUser: [
  8880. "GET /repos/{owner}/{repo}/codespaces/machines"
  8881. ],
  8882. setRepositoriesForSecretForAuthenticatedUser: [
  8883. "PUT /user/codespaces/secrets/{secret_name}/repositories"
  8884. ],
  8885. setSelectedReposForOrgSecret: [
  8886. "PUT /orgs/{org}/codespaces/secrets/{secret_name}/repositories"
  8887. ],
  8888. startForAuthenticatedUser: ["POST /user/codespaces/{codespace_name}/start"],
  8889. stopForAuthenticatedUser: ["POST /user/codespaces/{codespace_name}/stop"],
  8890. stopInOrganization: [
  8891. "POST /orgs/{org}/members/{username}/codespaces/{codespace_name}/stop"
  8892. ],
  8893. updateForAuthenticatedUser: ["PATCH /user/codespaces/{codespace_name}"]
  8894. },
  8895. copilot: {
  8896. addCopilotSeatsForTeams: [
  8897. "POST /orgs/{org}/copilot/billing/selected_teams"
  8898. ],
  8899. addCopilotSeatsForUsers: [
  8900. "POST /orgs/{org}/copilot/billing/selected_users"
  8901. ],
  8902. cancelCopilotSeatAssignmentForTeams: [
  8903. "DELETE /orgs/{org}/copilot/billing/selected_teams"
  8904. ],
  8905. cancelCopilotSeatAssignmentForUsers: [
  8906. "DELETE /orgs/{org}/copilot/billing/selected_users"
  8907. ],
  8908. getCopilotOrganizationDetails: ["GET /orgs/{org}/copilot/billing"],
  8909. getCopilotSeatDetailsForUser: [
  8910. "GET /orgs/{org}/members/{username}/copilot"
  8911. ],
  8912. listCopilotSeats: ["GET /orgs/{org}/copilot/billing/seats"]
  8913. },
  8914. dependabot: {
  8915. addSelectedRepoToOrgSecret: [
  8916. "PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id}"
  8917. ],
  8918. createOrUpdateOrgSecret: [
  8919. "PUT /orgs/{org}/dependabot/secrets/{secret_name}"
  8920. ],
  8921. createOrUpdateRepoSecret: [
  8922. "PUT /repos/{owner}/{repo}/dependabot/secrets/{secret_name}"
  8923. ],
  8924. deleteOrgSecret: ["DELETE /orgs/{org}/dependabot/secrets/{secret_name}"],
  8925. deleteRepoSecret: [
  8926. "DELETE /repos/{owner}/{repo}/dependabot/secrets/{secret_name}"
  8927. ],
  8928. getAlert: ["GET /repos/{owner}/{repo}/dependabot/alerts/{alert_number}"],
  8929. getOrgPublicKey: ["GET /orgs/{org}/dependabot/secrets/public-key"],
  8930. getOrgSecret: ["GET /orgs/{org}/dependabot/secrets/{secret_name}"],
  8931. getRepoPublicKey: [
  8932. "GET /repos/{owner}/{repo}/dependabot/secrets/public-key"
  8933. ],
  8934. getRepoSecret: [
  8935. "GET /repos/{owner}/{repo}/dependabot/secrets/{secret_name}"
  8936. ],
  8937. listAlertsForEnterprise: [
  8938. "GET /enterprises/{enterprise}/dependabot/alerts"
  8939. ],
  8940. listAlertsForOrg: ["GET /orgs/{org}/dependabot/alerts"],
  8941. listAlertsForRepo: ["GET /repos/{owner}/{repo}/dependabot/alerts"],
  8942. listOrgSecrets: ["GET /orgs/{org}/dependabot/secrets"],
  8943. listRepoSecrets: ["GET /repos/{owner}/{repo}/dependabot/secrets"],
  8944. listSelectedReposForOrgSecret: [
  8945. "GET /orgs/{org}/dependabot/secrets/{secret_name}/repositories"
  8946. ],
  8947. removeSelectedRepoFromOrgSecret: [
  8948. "DELETE /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id}"
  8949. ],
  8950. setSelectedReposForOrgSecret: [
  8951. "PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories"
  8952. ],
  8953. updateAlert: [
  8954. "PATCH /repos/{owner}/{repo}/dependabot/alerts/{alert_number}"
  8955. ]
  8956. },
  8957. dependencyGraph: {
  8958. createRepositorySnapshot: [
  8959. "POST /repos/{owner}/{repo}/dependency-graph/snapshots"
  8960. ],
  8961. diffRange: [
  8962. "GET /repos/{owner}/{repo}/dependency-graph/compare/{basehead}"
  8963. ],
  8964. exportSbom: ["GET /repos/{owner}/{repo}/dependency-graph/sbom"]
  8965. },
  8966. emojis: { get: ["GET /emojis"] },
  8967. gists: {
  8968. checkIsStarred: ["GET /gists/{gist_id}/star"],
  8969. create: ["POST /gists"],
  8970. createComment: ["POST /gists/{gist_id}/comments"],
  8971. delete: ["DELETE /gists/{gist_id}"],
  8972. deleteComment: ["DELETE /gists/{gist_id}/comments/{comment_id}"],
  8973. fork: ["POST /gists/{gist_id}/forks"],
  8974. get: ["GET /gists/{gist_id}"],
  8975. getComment: ["GET /gists/{gist_id}/comments/{comment_id}"],
  8976. getRevision: ["GET /gists/{gist_id}/{sha}"],
  8977. list: ["GET /gists"],
  8978. listComments: ["GET /gists/{gist_id}/comments"],
  8979. listCommits: ["GET /gists/{gist_id}/commits"],
  8980. listForUser: ["GET /users/{username}/gists"],
  8981. listForks: ["GET /gists/{gist_id}/forks"],
  8982. listPublic: ["GET /gists/public"],
  8983. listStarred: ["GET /gists/starred"],
  8984. star: ["PUT /gists/{gist_id}/star"],
  8985. unstar: ["DELETE /gists/{gist_id}/star"],
  8986. update: ["PATCH /gists/{gist_id}"],
  8987. updateComment: ["PATCH /gists/{gist_id}/comments/{comment_id}"]
  8988. },
  8989. git: {
  8990. createBlob: ["POST /repos/{owner}/{repo}/git/blobs"],
  8991. createCommit: ["POST /repos/{owner}/{repo}/git/commits"],
  8992. createRef: ["POST /repos/{owner}/{repo}/git/refs"],
  8993. createTag: ["POST /repos/{owner}/{repo}/git/tags"],
  8994. createTree: ["POST /repos/{owner}/{repo}/git/trees"],
  8995. deleteRef: ["DELETE /repos/{owner}/{repo}/git/refs/{ref}"],
  8996. getBlob: ["GET /repos/{owner}/{repo}/git/blobs/{file_sha}"],
  8997. getCommit: ["GET /repos/{owner}/{repo}/git/commits/{commit_sha}"],
  8998. getRef: ["GET /repos/{owner}/{repo}/git/ref/{ref}"],
  8999. getTag: ["GET /repos/{owner}/{repo}/git/tags/{tag_sha}"],
  9000. getTree: ["GET /repos/{owner}/{repo}/git/trees/{tree_sha}"],
  9001. listMatchingRefs: ["GET /repos/{owner}/{repo}/git/matching-refs/{ref}"],
  9002. updateRef: ["PATCH /repos/{owner}/{repo}/git/refs/{ref}"]
  9003. },
  9004. gitignore: {
  9005. getAllTemplates: ["GET /gitignore/templates"],
  9006. getTemplate: ["GET /gitignore/templates/{name}"]
  9007. },
  9008. interactions: {
  9009. getRestrictionsForAuthenticatedUser: ["GET /user/interaction-limits"],
  9010. getRestrictionsForOrg: ["GET /orgs/{org}/interaction-limits"],
  9011. getRestrictionsForRepo: ["GET /repos/{owner}/{repo}/interaction-limits"],
  9012. getRestrictionsForYourPublicRepos: [
  9013. "GET /user/interaction-limits",
  9014. {},
  9015. { renamed: ["interactions", "getRestrictionsForAuthenticatedUser"] }
  9016. ],
  9017. removeRestrictionsForAuthenticatedUser: ["DELETE /user/interaction-limits"],
  9018. removeRestrictionsForOrg: ["DELETE /orgs/{org}/interaction-limits"],
  9019. removeRestrictionsForRepo: [
  9020. "DELETE /repos/{owner}/{repo}/interaction-limits"
  9021. ],
  9022. removeRestrictionsForYourPublicRepos: [
  9023. "DELETE /user/interaction-limits",
  9024. {},
  9025. { renamed: ["interactions", "removeRestrictionsForAuthenticatedUser"] }
  9026. ],
  9027. setRestrictionsForAuthenticatedUser: ["PUT /user/interaction-limits"],
  9028. setRestrictionsForOrg: ["PUT /orgs/{org}/interaction-limits"],
  9029. setRestrictionsForRepo: ["PUT /repos/{owner}/{repo}/interaction-limits"],
  9030. setRestrictionsForYourPublicRepos: [
  9031. "PUT /user/interaction-limits",
  9032. {},
  9033. { renamed: ["interactions", "setRestrictionsForAuthenticatedUser"] }
  9034. ]
  9035. },
  9036. issues: {
  9037. addAssignees: [
  9038. "POST /repos/{owner}/{repo}/issues/{issue_number}/assignees"
  9039. ],
  9040. addLabels: ["POST /repos/{owner}/{repo}/issues/{issue_number}/labels"],
  9041. checkUserCanBeAssigned: ["GET /repos/{owner}/{repo}/assignees/{assignee}"],
  9042. checkUserCanBeAssignedToIssue: [
  9043. "GET /repos/{owner}/{repo}/issues/{issue_number}/assignees/{assignee}"
  9044. ],
  9045. create: ["POST /repos/{owner}/{repo}/issues"],
  9046. createComment: [
  9047. "POST /repos/{owner}/{repo}/issues/{issue_number}/comments"
  9048. ],
  9049. createLabel: ["POST /repos/{owner}/{repo}/labels"],
  9050. createMilestone: ["POST /repos/{owner}/{repo}/milestones"],
  9051. deleteComment: [
  9052. "DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}"
  9053. ],
  9054. deleteLabel: ["DELETE /repos/{owner}/{repo}/labels/{name}"],
  9055. deleteMilestone: [
  9056. "DELETE /repos/{owner}/{repo}/milestones/{milestone_number}"
  9057. ],
  9058. get: ["GET /repos/{owner}/{repo}/issues/{issue_number}"],
  9059. getComment: ["GET /repos/{owner}/{repo}/issues/comments/{comment_id}"],
  9060. getEvent: ["GET /repos/{owner}/{repo}/issues/events/{event_id}"],
  9061. getLabel: ["GET /repos/{owner}/{repo}/labels/{name}"],
  9062. getMilestone: ["GET /repos/{owner}/{repo}/milestones/{milestone_number}"],
  9063. list: ["GET /issues"],
  9064. listAssignees: ["GET /repos/{owner}/{repo}/assignees"],
  9065. listComments: ["GET /repos/{owner}/{repo}/issues/{issue_number}/comments"],
  9066. listCommentsForRepo: ["GET /repos/{owner}/{repo}/issues/comments"],
  9067. listEvents: ["GET /repos/{owner}/{repo}/issues/{issue_number}/events"],
  9068. listEventsForRepo: ["GET /repos/{owner}/{repo}/issues/events"],
  9069. listEventsForTimeline: [
  9070. "GET /repos/{owner}/{repo}/issues/{issue_number}/timeline"
  9071. ],
  9072. listForAuthenticatedUser: ["GET /user/issues"],
  9073. listForOrg: ["GET /orgs/{org}/issues"],
  9074. listForRepo: ["GET /repos/{owner}/{repo}/issues"],
  9075. listLabelsForMilestone: [
  9076. "GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels"
  9077. ],
  9078. listLabelsForRepo: ["GET /repos/{owner}/{repo}/labels"],
  9079. listLabelsOnIssue: [
  9080. "GET /repos/{owner}/{repo}/issues/{issue_number}/labels"
  9081. ],
  9082. listMilestones: ["GET /repos/{owner}/{repo}/milestones"],
  9083. lock: ["PUT /repos/{owner}/{repo}/issues/{issue_number}/lock"],
  9084. removeAllLabels: [
  9085. "DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels"
  9086. ],
  9087. removeAssignees: [
  9088. "DELETE /repos/{owner}/{repo}/issues/{issue_number}/assignees"
  9089. ],
  9090. removeLabel: [
  9091. "DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels/{name}"
  9092. ],
  9093. setLabels: ["PUT /repos/{owner}/{repo}/issues/{issue_number}/labels"],
  9094. unlock: ["DELETE /repos/{owner}/{repo}/issues/{issue_number}/lock"],
  9095. update: ["PATCH /repos/{owner}/{repo}/issues/{issue_number}"],
  9096. updateComment: ["PATCH /repos/{owner}/{repo}/issues/comments/{comment_id}"],
  9097. updateLabel: ["PATCH /repos/{owner}/{repo}/labels/{name}"],
  9098. updateMilestone: [
  9099. "PATCH /repos/{owner}/{repo}/milestones/{milestone_number}"
  9100. ]
  9101. },
  9102. licenses: {
  9103. get: ["GET /licenses/{license}"],
  9104. getAllCommonlyUsed: ["GET /licenses"],
  9105. getForRepo: ["GET /repos/{owner}/{repo}/license"]
  9106. },
  9107. markdown: {
  9108. render: ["POST /markdown"],
  9109. renderRaw: [
  9110. "POST /markdown/raw",
  9111. { headers: { "content-type": "text/plain; charset=utf-8" } }
  9112. ]
  9113. },
  9114. meta: {
  9115. get: ["GET /meta"],
  9116. getAllVersions: ["GET /versions"],
  9117. getOctocat: ["GET /octocat"],
  9118. getZen: ["GET /zen"],
  9119. root: ["GET /"]
  9120. },
  9121. migrations: {
  9122. cancelImport: [
  9123. "DELETE /repos/{owner}/{repo}/import",
  9124. {},
  9125. {
  9126. deprecated: "octokit.rest.migrations.cancelImport() is deprecated, see https://docs.github.com/rest/migrations/source-imports#cancel-an-import"
  9127. }
  9128. ],
  9129. deleteArchiveForAuthenticatedUser: [
  9130. "DELETE /user/migrations/{migration_id}/archive"
  9131. ],
  9132. deleteArchiveForOrg: [
  9133. "DELETE /orgs/{org}/migrations/{migration_id}/archive"
  9134. ],
  9135. downloadArchiveForOrg: [
  9136. "GET /orgs/{org}/migrations/{migration_id}/archive"
  9137. ],
  9138. getArchiveForAuthenticatedUser: [
  9139. "GET /user/migrations/{migration_id}/archive"
  9140. ],
  9141. getCommitAuthors: [
  9142. "GET /repos/{owner}/{repo}/import/authors",
  9143. {},
  9144. {
  9145. deprecated: "octokit.rest.migrations.getCommitAuthors() is deprecated, see https://docs.github.com/rest/migrations/source-imports#get-commit-authors"
  9146. }
  9147. ],
  9148. getImportStatus: [
  9149. "GET /repos/{owner}/{repo}/import",
  9150. {},
  9151. {
  9152. deprecated: "octokit.rest.migrations.getImportStatus() is deprecated, see https://docs.github.com/rest/migrations/source-imports#get-an-import-status"
  9153. }
  9154. ],
  9155. getLargeFiles: [
  9156. "GET /repos/{owner}/{repo}/import/large_files",
  9157. {},
  9158. {
  9159. deprecated: "octokit.rest.migrations.getLargeFiles() is deprecated, see https://docs.github.com/rest/migrations/source-imports#get-large-files"
  9160. }
  9161. ],
  9162. getStatusForAuthenticatedUser: ["GET /user/migrations/{migration_id}"],
  9163. getStatusForOrg: ["GET /orgs/{org}/migrations/{migration_id}"],
  9164. listForAuthenticatedUser: ["GET /user/migrations"],
  9165. listForOrg: ["GET /orgs/{org}/migrations"],
  9166. listReposForAuthenticatedUser: [
  9167. "GET /user/migrations/{migration_id}/repositories"
  9168. ],
  9169. listReposForOrg: ["GET /orgs/{org}/migrations/{migration_id}/repositories"],
  9170. listReposForUser: [
  9171. "GET /user/migrations/{migration_id}/repositories",
  9172. {},
  9173. { renamed: ["migrations", "listReposForAuthenticatedUser"] }
  9174. ],
  9175. mapCommitAuthor: [
  9176. "PATCH /repos/{owner}/{repo}/import/authors/{author_id}",
  9177. {},
  9178. {
  9179. deprecated: "octokit.rest.migrations.mapCommitAuthor() is deprecated, see https://docs.github.com/rest/migrations/source-imports#map-a-commit-author"
  9180. }
  9181. ],
  9182. setLfsPreference: [
  9183. "PATCH /repos/{owner}/{repo}/import/lfs",
  9184. {},
  9185. {
  9186. deprecated: "octokit.rest.migrations.setLfsPreference() is deprecated, see https://docs.github.com/rest/migrations/source-imports#update-git-lfs-preference"
  9187. }
  9188. ],
  9189. startForAuthenticatedUser: ["POST /user/migrations"],
  9190. startForOrg: ["POST /orgs/{org}/migrations"],
  9191. startImport: [
  9192. "PUT /repos/{owner}/{repo}/import",
  9193. {},
  9194. {
  9195. deprecated: "octokit.rest.migrations.startImport() is deprecated, see https://docs.github.com/rest/migrations/source-imports#start-an-import"
  9196. }
  9197. ],
  9198. unlockRepoForAuthenticatedUser: [
  9199. "DELETE /user/migrations/{migration_id}/repos/{repo_name}/lock"
  9200. ],
  9201. unlockRepoForOrg: [
  9202. "DELETE /orgs/{org}/migrations/{migration_id}/repos/{repo_name}/lock"
  9203. ],
  9204. updateImport: [
  9205. "PATCH /repos/{owner}/{repo}/import",
  9206. {},
  9207. {
  9208. deprecated: "octokit.rest.migrations.updateImport() is deprecated, see https://docs.github.com/rest/migrations/source-imports#update-an-import"
  9209. }
  9210. ]
  9211. },
  9212. oidc: {
  9213. getOidcCustomSubTemplateForOrg: [
  9214. "GET /orgs/{org}/actions/oidc/customization/sub"
  9215. ],
  9216. updateOidcCustomSubTemplateForOrg: [
  9217. "PUT /orgs/{org}/actions/oidc/customization/sub"
  9218. ]
  9219. },
  9220. orgs: {
  9221. addSecurityManagerTeam: [
  9222. "PUT /orgs/{org}/security-managers/teams/{team_slug}"
  9223. ],
  9224. assignTeamToOrgRole: [
  9225. "PUT /orgs/{org}/organization-roles/teams/{team_slug}/{role_id}"
  9226. ],
  9227. assignUserToOrgRole: [
  9228. "PUT /orgs/{org}/organization-roles/users/{username}/{role_id}"
  9229. ],
  9230. blockUser: ["PUT /orgs/{org}/blocks/{username}"],
  9231. cancelInvitation: ["DELETE /orgs/{org}/invitations/{invitation_id}"],
  9232. checkBlockedUser: ["GET /orgs/{org}/blocks/{username}"],
  9233. checkMembershipForUser: ["GET /orgs/{org}/members/{username}"],
  9234. checkPublicMembershipForUser: ["GET /orgs/{org}/public_members/{username}"],
  9235. convertMemberToOutsideCollaborator: [
  9236. "PUT /orgs/{org}/outside_collaborators/{username}"
  9237. ],
  9238. createCustomOrganizationRole: ["POST /orgs/{org}/organization-roles"],
  9239. createInvitation: ["POST /orgs/{org}/invitations"],
  9240. createOrUpdateCustomProperties: ["PATCH /orgs/{org}/properties/schema"],
  9241. createOrUpdateCustomPropertiesValuesForRepos: [
  9242. "PATCH /orgs/{org}/properties/values"
  9243. ],
  9244. createOrUpdateCustomProperty: [
  9245. "PUT /orgs/{org}/properties/schema/{custom_property_name}"
  9246. ],
  9247. createWebhook: ["POST /orgs/{org}/hooks"],
  9248. delete: ["DELETE /orgs/{org}"],
  9249. deleteCustomOrganizationRole: [
  9250. "DELETE /orgs/{org}/organization-roles/{role_id}"
  9251. ],
  9252. deleteWebhook: ["DELETE /orgs/{org}/hooks/{hook_id}"],
  9253. enableOrDisableSecurityProductOnAllOrgRepos: [
  9254. "POST /orgs/{org}/{security_product}/{enablement}"
  9255. ],
  9256. get: ["GET /orgs/{org}"],
  9257. getAllCustomProperties: ["GET /orgs/{org}/properties/schema"],
  9258. getCustomProperty: [
  9259. "GET /orgs/{org}/properties/schema/{custom_property_name}"
  9260. ],
  9261. getMembershipForAuthenticatedUser: ["GET /user/memberships/orgs/{org}"],
  9262. getMembershipForUser: ["GET /orgs/{org}/memberships/{username}"],
  9263. getOrgRole: ["GET /orgs/{org}/organization-roles/{role_id}"],
  9264. getWebhook: ["GET /orgs/{org}/hooks/{hook_id}"],
  9265. getWebhookConfigForOrg: ["GET /orgs/{org}/hooks/{hook_id}/config"],
  9266. getWebhookDelivery: [
  9267. "GET /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}"
  9268. ],
  9269. list: ["GET /organizations"],
  9270. listAppInstallations: ["GET /orgs/{org}/installations"],
  9271. listBlockedUsers: ["GET /orgs/{org}/blocks"],
  9272. listCustomPropertiesValuesForRepos: ["GET /orgs/{org}/properties/values"],
  9273. listFailedInvitations: ["GET /orgs/{org}/failed_invitations"],
  9274. listForAuthenticatedUser: ["GET /user/orgs"],
  9275. listForUser: ["GET /users/{username}/orgs"],
  9276. listInvitationTeams: ["GET /orgs/{org}/invitations/{invitation_id}/teams"],
  9277. listMembers: ["GET /orgs/{org}/members"],
  9278. listMembershipsForAuthenticatedUser: ["GET /user/memberships/orgs"],
  9279. listOrgRoleTeams: ["GET /orgs/{org}/organization-roles/{role_id}/teams"],
  9280. listOrgRoleUsers: ["GET /orgs/{org}/organization-roles/{role_id}/users"],
  9281. listOrgRoles: ["GET /orgs/{org}/organization-roles"],
  9282. listOrganizationFineGrainedPermissions: [
  9283. "GET /orgs/{org}/organization-fine-grained-permissions"
  9284. ],
  9285. listOutsideCollaborators: ["GET /orgs/{org}/outside_collaborators"],
  9286. listPatGrantRepositories: [
  9287. "GET /orgs/{org}/personal-access-tokens/{pat_id}/repositories"
  9288. ],
  9289. listPatGrantRequestRepositories: [
  9290. "GET /orgs/{org}/personal-access-token-requests/{pat_request_id}/repositories"
  9291. ],
  9292. listPatGrantRequests: ["GET /orgs/{org}/personal-access-token-requests"],
  9293. listPatGrants: ["GET /orgs/{org}/personal-access-tokens"],
  9294. listPendingInvitations: ["GET /orgs/{org}/invitations"],
  9295. listPublicMembers: ["GET /orgs/{org}/public_members"],
  9296. listSecurityManagerTeams: ["GET /orgs/{org}/security-managers"],
  9297. listWebhookDeliveries: ["GET /orgs/{org}/hooks/{hook_id}/deliveries"],
  9298. listWebhooks: ["GET /orgs/{org}/hooks"],
  9299. patchCustomOrganizationRole: [
  9300. "PATCH /orgs/{org}/organization-roles/{role_id}"
  9301. ],
  9302. pingWebhook: ["POST /orgs/{org}/hooks/{hook_id}/pings"],
  9303. redeliverWebhookDelivery: [
  9304. "POST /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts"
  9305. ],
  9306. removeCustomProperty: [
  9307. "DELETE /orgs/{org}/properties/schema/{custom_property_name}"
  9308. ],
  9309. removeMember: ["DELETE /orgs/{org}/members/{username}"],
  9310. removeMembershipForUser: ["DELETE /orgs/{org}/memberships/{username}"],
  9311. removeOutsideCollaborator: [
  9312. "DELETE /orgs/{org}/outside_collaborators/{username}"
  9313. ],
  9314. removePublicMembershipForAuthenticatedUser: [
  9315. "DELETE /orgs/{org}/public_members/{username}"
  9316. ],
  9317. removeSecurityManagerTeam: [
  9318. "DELETE /orgs/{org}/security-managers/teams/{team_slug}"
  9319. ],
  9320. reviewPatGrantRequest: [
  9321. "POST /orgs/{org}/personal-access-token-requests/{pat_request_id}"
  9322. ],
  9323. reviewPatGrantRequestsInBulk: [
  9324. "POST /orgs/{org}/personal-access-token-requests"
  9325. ],
  9326. revokeAllOrgRolesTeam: [
  9327. "DELETE /orgs/{org}/organization-roles/teams/{team_slug}"
  9328. ],
  9329. revokeAllOrgRolesUser: [
  9330. "DELETE /orgs/{org}/organization-roles/users/{username}"
  9331. ],
  9332. revokeOrgRoleTeam: [
  9333. "DELETE /orgs/{org}/organization-roles/teams/{team_slug}/{role_id}"
  9334. ],
  9335. revokeOrgRoleUser: [
  9336. "DELETE /orgs/{org}/organization-roles/users/{username}/{role_id}"
  9337. ],
  9338. setMembershipForUser: ["PUT /orgs/{org}/memberships/{username}"],
  9339. setPublicMembershipForAuthenticatedUser: [
  9340. "PUT /orgs/{org}/public_members/{username}"
  9341. ],
  9342. unblockUser: ["DELETE /orgs/{org}/blocks/{username}"],
  9343. update: ["PATCH /orgs/{org}"],
  9344. updateMembershipForAuthenticatedUser: [
  9345. "PATCH /user/memberships/orgs/{org}"
  9346. ],
  9347. updatePatAccess: ["POST /orgs/{org}/personal-access-tokens/{pat_id}"],
  9348. updatePatAccesses: ["POST /orgs/{org}/personal-access-tokens"],
  9349. updateWebhook: ["PATCH /orgs/{org}/hooks/{hook_id}"],
  9350. updateWebhookConfigForOrg: ["PATCH /orgs/{org}/hooks/{hook_id}/config"]
  9351. },
  9352. packages: {
  9353. deletePackageForAuthenticatedUser: [
  9354. "DELETE /user/packages/{package_type}/{package_name}"
  9355. ],
  9356. deletePackageForOrg: [
  9357. "DELETE /orgs/{org}/packages/{package_type}/{package_name}"
  9358. ],
  9359. deletePackageForUser: [
  9360. "DELETE /users/{username}/packages/{package_type}/{package_name}"
  9361. ],
  9362. deletePackageVersionForAuthenticatedUser: [
  9363. "DELETE /user/packages/{package_type}/{package_name}/versions/{package_version_id}"
  9364. ],
  9365. deletePackageVersionForOrg: [
  9366. "DELETE /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}"
  9367. ],
  9368. deletePackageVersionForUser: [
  9369. "DELETE /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}"
  9370. ],
  9371. getAllPackageVersionsForAPackageOwnedByAnOrg: [
  9372. "GET /orgs/{org}/packages/{package_type}/{package_name}/versions",
  9373. {},
  9374. { renamed: ["packages", "getAllPackageVersionsForPackageOwnedByOrg"] }
  9375. ],
  9376. getAllPackageVersionsForAPackageOwnedByTheAuthenticatedUser: [
  9377. "GET /user/packages/{package_type}/{package_name}/versions",
  9378. {},
  9379. {
  9380. renamed: [
  9381. "packages",
  9382. "getAllPackageVersionsForPackageOwnedByAuthenticatedUser"
  9383. ]
  9384. }
  9385. ],
  9386. getAllPackageVersionsForPackageOwnedByAuthenticatedUser: [
  9387. "GET /user/packages/{package_type}/{package_name}/versions"
  9388. ],
  9389. getAllPackageVersionsForPackageOwnedByOrg: [
  9390. "GET /orgs/{org}/packages/{package_type}/{package_name}/versions"
  9391. ],
  9392. getAllPackageVersionsForPackageOwnedByUser: [
  9393. "GET /users/{username}/packages/{package_type}/{package_name}/versions"
  9394. ],
  9395. getPackageForAuthenticatedUser: [
  9396. "GET /user/packages/{package_type}/{package_name}"
  9397. ],
  9398. getPackageForOrganization: [
  9399. "GET /orgs/{org}/packages/{package_type}/{package_name}"
  9400. ],
  9401. getPackageForUser: [
  9402. "GET /users/{username}/packages/{package_type}/{package_name}"
  9403. ],
  9404. getPackageVersionForAuthenticatedUser: [
  9405. "GET /user/packages/{package_type}/{package_name}/versions/{package_version_id}"
  9406. ],
  9407. getPackageVersionForOrganization: [
  9408. "GET /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}"
  9409. ],
  9410. getPackageVersionForUser: [
  9411. "GET /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}"
  9412. ],
  9413. listDockerMigrationConflictingPackagesForAuthenticatedUser: [
  9414. "GET /user/docker/conflicts"
  9415. ],
  9416. listDockerMigrationConflictingPackagesForOrganization: [
  9417. "GET /orgs/{org}/docker/conflicts"
  9418. ],
  9419. listDockerMigrationConflictingPackagesForUser: [
  9420. "GET /users/{username}/docker/conflicts"
  9421. ],
  9422. listPackagesForAuthenticatedUser: ["GET /user/packages"],
  9423. listPackagesForOrganization: ["GET /orgs/{org}/packages"],
  9424. listPackagesForUser: ["GET /users/{username}/packages"],
  9425. restorePackageForAuthenticatedUser: [
  9426. "POST /user/packages/{package_type}/{package_name}/restore{?token}"
  9427. ],
  9428. restorePackageForOrg: [
  9429. "POST /orgs/{org}/packages/{package_type}/{package_name}/restore{?token}"
  9430. ],
  9431. restorePackageForUser: [
  9432. "POST /users/{username}/packages/{package_type}/{package_name}/restore{?token}"
  9433. ],
  9434. restorePackageVersionForAuthenticatedUser: [
  9435. "POST /user/packages/{package_type}/{package_name}/versions/{package_version_id}/restore"
  9436. ],
  9437. restorePackageVersionForOrg: [
  9438. "POST /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore"
  9439. ],
  9440. restorePackageVersionForUser: [
  9441. "POST /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore"
  9442. ]
  9443. },
  9444. projects: {
  9445. addCollaborator: ["PUT /projects/{project_id}/collaborators/{username}"],
  9446. createCard: ["POST /projects/columns/{column_id}/cards"],
  9447. createColumn: ["POST /projects/{project_id}/columns"],
  9448. createForAuthenticatedUser: ["POST /user/projects"],
  9449. createForOrg: ["POST /orgs/{org}/projects"],
  9450. createForRepo: ["POST /repos/{owner}/{repo}/projects"],
  9451. delete: ["DELETE /projects/{project_id}"],
  9452. deleteCard: ["DELETE /projects/columns/cards/{card_id}"],
  9453. deleteColumn: ["DELETE /projects/columns/{column_id}"],
  9454. get: ["GET /projects/{project_id}"],
  9455. getCard: ["GET /projects/columns/cards/{card_id}"],
  9456. getColumn: ["GET /projects/columns/{column_id}"],
  9457. getPermissionForUser: [
  9458. "GET /projects/{project_id}/collaborators/{username}/permission"
  9459. ],
  9460. listCards: ["GET /projects/columns/{column_id}/cards"],
  9461. listCollaborators: ["GET /projects/{project_id}/collaborators"],
  9462. listColumns: ["GET /projects/{project_id}/columns"],
  9463. listForOrg: ["GET /orgs/{org}/projects"],
  9464. listForRepo: ["GET /repos/{owner}/{repo}/projects"],
  9465. listForUser: ["GET /users/{username}/projects"],
  9466. moveCard: ["POST /projects/columns/cards/{card_id}/moves"],
  9467. moveColumn: ["POST /projects/columns/{column_id}/moves"],
  9468. removeCollaborator: [
  9469. "DELETE /projects/{project_id}/collaborators/{username}"
  9470. ],
  9471. update: ["PATCH /projects/{project_id}"],
  9472. updateCard: ["PATCH /projects/columns/cards/{card_id}"],
  9473. updateColumn: ["PATCH /projects/columns/{column_id}"]
  9474. },
  9475. pulls: {
  9476. checkIfMerged: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/merge"],
  9477. create: ["POST /repos/{owner}/{repo}/pulls"],
  9478. createReplyForReviewComment: [
  9479. "POST /repos/{owner}/{repo}/pulls/{pull_number}/comments/{comment_id}/replies"
  9480. ],
  9481. createReview: ["POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews"],
  9482. createReviewComment: [
  9483. "POST /repos/{owner}/{repo}/pulls/{pull_number}/comments"
  9484. ],
  9485. deletePendingReview: [
  9486. "DELETE /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}"
  9487. ],
  9488. deleteReviewComment: [
  9489. "DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}"
  9490. ],
  9491. dismissReview: [
  9492. "PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/dismissals"
  9493. ],
  9494. get: ["GET /repos/{owner}/{repo}/pulls/{pull_number}"],
  9495. getReview: [
  9496. "GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}"
  9497. ],
  9498. getReviewComment: ["GET /repos/{owner}/{repo}/pulls/comments/{comment_id}"],
  9499. list: ["GET /repos/{owner}/{repo}/pulls"],
  9500. listCommentsForReview: [
  9501. "GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments"
  9502. ],
  9503. listCommits: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/commits"],
  9504. listFiles: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/files"],
  9505. listRequestedReviewers: [
  9506. "GET /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers"
  9507. ],
  9508. listReviewComments: [
  9509. "GET /repos/{owner}/{repo}/pulls/{pull_number}/comments"
  9510. ],
  9511. listReviewCommentsForRepo: ["GET /repos/{owner}/{repo}/pulls/comments"],
  9512. listReviews: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews"],
  9513. merge: ["PUT /repos/{owner}/{repo}/pulls/{pull_number}/merge"],
  9514. removeRequestedReviewers: [
  9515. "DELETE /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers"
  9516. ],
  9517. requestReviewers: [
  9518. "POST /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers"
  9519. ],
  9520. submitReview: [
  9521. "POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/events"
  9522. ],
  9523. update: ["PATCH /repos/{owner}/{repo}/pulls/{pull_number}"],
  9524. updateBranch: [
  9525. "PUT /repos/{owner}/{repo}/pulls/{pull_number}/update-branch"
  9526. ],
  9527. updateReview: [
  9528. "PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}"
  9529. ],
  9530. updateReviewComment: [
  9531. "PATCH /repos/{owner}/{repo}/pulls/comments/{comment_id}"
  9532. ]
  9533. },
  9534. rateLimit: { get: ["GET /rate_limit"] },
  9535. reactions: {
  9536. createForCommitComment: [
  9537. "POST /repos/{owner}/{repo}/comments/{comment_id}/reactions"
  9538. ],
  9539. createForIssue: [
  9540. "POST /repos/{owner}/{repo}/issues/{issue_number}/reactions"
  9541. ],
  9542. createForIssueComment: [
  9543. "POST /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions"
  9544. ],
  9545. createForPullRequestReviewComment: [
  9546. "POST /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions"
  9547. ],
  9548. createForRelease: [
  9549. "POST /repos/{owner}/{repo}/releases/{release_id}/reactions"
  9550. ],
  9551. createForTeamDiscussionCommentInOrg: [
  9552. "POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions"
  9553. ],
  9554. createForTeamDiscussionInOrg: [
  9555. "POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions"
  9556. ],
  9557. deleteForCommitComment: [
  9558. "DELETE /repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id}"
  9559. ],
  9560. deleteForIssue: [
  9561. "DELETE /repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id}"
  9562. ],
  9563. deleteForIssueComment: [
  9564. "DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/{reaction_id}"
  9565. ],
  9566. deleteForPullRequestComment: [
  9567. "DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/{reaction_id}"
  9568. ],
  9569. deleteForRelease: [
  9570. "DELETE /repos/{owner}/{repo}/releases/{release_id}/reactions/{reaction_id}"
  9571. ],
  9572. deleteForTeamDiscussion: [
  9573. "DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/{reaction_id}"
  9574. ],
  9575. deleteForTeamDiscussionComment: [
  9576. "DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/{reaction_id}"
  9577. ],
  9578. listForCommitComment: [
  9579. "GET /repos/{owner}/{repo}/comments/{comment_id}/reactions"
  9580. ],
  9581. listForIssue: ["GET /repos/{owner}/{repo}/issues/{issue_number}/reactions"],
  9582. listForIssueComment: [
  9583. "GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions"
  9584. ],
  9585. listForPullRequestReviewComment: [
  9586. "GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions"
  9587. ],
  9588. listForRelease: [
  9589. "GET /repos/{owner}/{repo}/releases/{release_id}/reactions"
  9590. ],
  9591. listForTeamDiscussionCommentInOrg: [
  9592. "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions"
  9593. ],
  9594. listForTeamDiscussionInOrg: [
  9595. "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions"
  9596. ]
  9597. },
  9598. repos: {
  9599. acceptInvitation: [
  9600. "PATCH /user/repository_invitations/{invitation_id}",
  9601. {},
  9602. { renamed: ["repos", "acceptInvitationForAuthenticatedUser"] }
  9603. ],
  9604. acceptInvitationForAuthenticatedUser: [
  9605. "PATCH /user/repository_invitations/{invitation_id}"
  9606. ],
  9607. addAppAccessRestrictions: [
  9608. "POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps",
  9609. {},
  9610. { mapToData: "apps" }
  9611. ],
  9612. addCollaborator: ["PUT /repos/{owner}/{repo}/collaborators/{username}"],
  9613. addStatusCheckContexts: [
  9614. "POST /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts",
  9615. {},
  9616. { mapToData: "contexts" }
  9617. ],
  9618. addTeamAccessRestrictions: [
  9619. "POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams",
  9620. {},
  9621. { mapToData: "teams" }
  9622. ],
  9623. addUserAccessRestrictions: [
  9624. "POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users",
  9625. {},
  9626. { mapToData: "users" }
  9627. ],
  9628. cancelPagesDeployment: [
  9629. "POST /repos/{owner}/{repo}/pages/deployments/{pages_deployment_id}/cancel"
  9630. ],
  9631. checkAutomatedSecurityFixes: [
  9632. "GET /repos/{owner}/{repo}/automated-security-fixes"
  9633. ],
  9634. checkCollaborator: ["GET /repos/{owner}/{repo}/collaborators/{username}"],
  9635. checkVulnerabilityAlerts: [
  9636. "GET /repos/{owner}/{repo}/vulnerability-alerts"
  9637. ],
  9638. codeownersErrors: ["GET /repos/{owner}/{repo}/codeowners/errors"],
  9639. compareCommits: ["GET /repos/{owner}/{repo}/compare/{base}...{head}"],
  9640. compareCommitsWithBasehead: [
  9641. "GET /repos/{owner}/{repo}/compare/{basehead}"
  9642. ],
  9643. createAutolink: ["POST /repos/{owner}/{repo}/autolinks"],
  9644. createCommitComment: [
  9645. "POST /repos/{owner}/{repo}/commits/{commit_sha}/comments"
  9646. ],
  9647. createCommitSignatureProtection: [
  9648. "POST /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures"
  9649. ],
  9650. createCommitStatus: ["POST /repos/{owner}/{repo}/statuses/{sha}"],
  9651. createDeployKey: ["POST /repos/{owner}/{repo}/keys"],
  9652. createDeployment: ["POST /repos/{owner}/{repo}/deployments"],
  9653. createDeploymentBranchPolicy: [
  9654. "POST /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies"
  9655. ],
  9656. createDeploymentProtectionRule: [
  9657. "POST /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules"
  9658. ],
  9659. createDeploymentStatus: [
  9660. "POST /repos/{owner}/{repo}/deployments/{deployment_id}/statuses"
  9661. ],
  9662. createDispatchEvent: ["POST /repos/{owner}/{repo}/dispatches"],
  9663. createForAuthenticatedUser: ["POST /user/repos"],
  9664. createFork: ["POST /repos/{owner}/{repo}/forks"],
  9665. createInOrg: ["POST /orgs/{org}/repos"],
  9666. createOrUpdateCustomPropertiesValues: [
  9667. "PATCH /repos/{owner}/{repo}/properties/values"
  9668. ],
  9669. createOrUpdateEnvironment: [
  9670. "PUT /repos/{owner}/{repo}/environments/{environment_name}"
  9671. ],
  9672. createOrUpdateFileContents: ["PUT /repos/{owner}/{repo}/contents/{path}"],
  9673. createOrgRuleset: ["POST /orgs/{org}/rulesets"],
  9674. createPagesDeployment: ["POST /repos/{owner}/{repo}/pages/deployments"],
  9675. createPagesSite: ["POST /repos/{owner}/{repo}/pages"],
  9676. createRelease: ["POST /repos/{owner}/{repo}/releases"],
  9677. createRepoRuleset: ["POST /repos/{owner}/{repo}/rulesets"],
  9678. createTagProtection: ["POST /repos/{owner}/{repo}/tags/protection"],
  9679. createUsingTemplate: [
  9680. "POST /repos/{template_owner}/{template_repo}/generate"
  9681. ],
  9682. createWebhook: ["POST /repos/{owner}/{repo}/hooks"],
  9683. declineInvitation: [
  9684. "DELETE /user/repository_invitations/{invitation_id}",
  9685. {},
  9686. { renamed: ["repos", "declineInvitationForAuthenticatedUser"] }
  9687. ],
  9688. declineInvitationForAuthenticatedUser: [
  9689. "DELETE /user/repository_invitations/{invitation_id}"
  9690. ],
  9691. delete: ["DELETE /repos/{owner}/{repo}"],
  9692. deleteAccessRestrictions: [
  9693. "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions"
  9694. ],
  9695. deleteAdminBranchProtection: [
  9696. "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins"
  9697. ],
  9698. deleteAnEnvironment: [
  9699. "DELETE /repos/{owner}/{repo}/environments/{environment_name}"
  9700. ],
  9701. deleteAutolink: ["DELETE /repos/{owner}/{repo}/autolinks/{autolink_id}"],
  9702. deleteBranchProtection: [
  9703. "DELETE /repos/{owner}/{repo}/branches/{branch}/protection"
  9704. ],
  9705. deleteCommitComment: ["DELETE /repos/{owner}/{repo}/comments/{comment_id}"],
  9706. deleteCommitSignatureProtection: [
  9707. "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures"
  9708. ],
  9709. deleteDeployKey: ["DELETE /repos/{owner}/{repo}/keys/{key_id}"],
  9710. deleteDeployment: [
  9711. "DELETE /repos/{owner}/{repo}/deployments/{deployment_id}"
  9712. ],
  9713. deleteDeploymentBranchPolicy: [
  9714. "DELETE /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}"
  9715. ],
  9716. deleteFile: ["DELETE /repos/{owner}/{repo}/contents/{path}"],
  9717. deleteInvitation: [
  9718. "DELETE /repos/{owner}/{repo}/invitations/{invitation_id}"
  9719. ],
  9720. deleteOrgRuleset: ["DELETE /orgs/{org}/rulesets/{ruleset_id}"],
  9721. deletePagesSite: ["DELETE /repos/{owner}/{repo}/pages"],
  9722. deletePullRequestReviewProtection: [
  9723. "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews"
  9724. ],
  9725. deleteRelease: ["DELETE /repos/{owner}/{repo}/releases/{release_id}"],
  9726. deleteReleaseAsset: [
  9727. "DELETE /repos/{owner}/{repo}/releases/assets/{asset_id}"
  9728. ],
  9729. deleteRepoRuleset: ["DELETE /repos/{owner}/{repo}/rulesets/{ruleset_id}"],
  9730. deleteTagProtection: [
  9731. "DELETE /repos/{owner}/{repo}/tags/protection/{tag_protection_id}"
  9732. ],
  9733. deleteWebhook: ["DELETE /repos/{owner}/{repo}/hooks/{hook_id}"],
  9734. disableAutomatedSecurityFixes: [
  9735. "DELETE /repos/{owner}/{repo}/automated-security-fixes"
  9736. ],
  9737. disableDeploymentProtectionRule: [
  9738. "DELETE /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/{protection_rule_id}"
  9739. ],
  9740. disablePrivateVulnerabilityReporting: [
  9741. "DELETE /repos/{owner}/{repo}/private-vulnerability-reporting"
  9742. ],
  9743. disableVulnerabilityAlerts: [
  9744. "DELETE /repos/{owner}/{repo}/vulnerability-alerts"
  9745. ],
  9746. downloadArchive: [
  9747. "GET /repos/{owner}/{repo}/zipball/{ref}",
  9748. {},
  9749. { renamed: ["repos", "downloadZipballArchive"] }
  9750. ],
  9751. downloadTarballArchive: ["GET /repos/{owner}/{repo}/tarball/{ref}"],
  9752. downloadZipballArchive: ["GET /repos/{owner}/{repo}/zipball/{ref}"],
  9753. enableAutomatedSecurityFixes: [
  9754. "PUT /repos/{owner}/{repo}/automated-security-fixes"
  9755. ],
  9756. enablePrivateVulnerabilityReporting: [
  9757. "PUT /repos/{owner}/{repo}/private-vulnerability-reporting"
  9758. ],
  9759. enableVulnerabilityAlerts: [
  9760. "PUT /repos/{owner}/{repo}/vulnerability-alerts"
  9761. ],
  9762. generateReleaseNotes: [
  9763. "POST /repos/{owner}/{repo}/releases/generate-notes"
  9764. ],
  9765. get: ["GET /repos/{owner}/{repo}"],
  9766. getAccessRestrictions: [
  9767. "GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions"
  9768. ],
  9769. getAdminBranchProtection: [
  9770. "GET /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins"
  9771. ],
  9772. getAllDeploymentProtectionRules: [
  9773. "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules"
  9774. ],
  9775. getAllEnvironments: ["GET /repos/{owner}/{repo}/environments"],
  9776. getAllStatusCheckContexts: [
  9777. "GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts"
  9778. ],
  9779. getAllTopics: ["GET /repos/{owner}/{repo}/topics"],
  9780. getAppsWithAccessToProtectedBranch: [
  9781. "GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps"
  9782. ],
  9783. getAutolink: ["GET /repos/{owner}/{repo}/autolinks/{autolink_id}"],
  9784. getBranch: ["GET /repos/{owner}/{repo}/branches/{branch}"],
  9785. getBranchProtection: [
  9786. "GET /repos/{owner}/{repo}/branches/{branch}/protection"
  9787. ],
  9788. getBranchRules: ["GET /repos/{owner}/{repo}/rules/branches/{branch}"],
  9789. getClones: ["GET /repos/{owner}/{repo}/traffic/clones"],
  9790. getCodeFrequencyStats: ["GET /repos/{owner}/{repo}/stats/code_frequency"],
  9791. getCollaboratorPermissionLevel: [
  9792. "GET /repos/{owner}/{repo}/collaborators/{username}/permission"
  9793. ],
  9794. getCombinedStatusForRef: ["GET /repos/{owner}/{repo}/commits/{ref}/status"],
  9795. getCommit: ["GET /repos/{owner}/{repo}/commits/{ref}"],
  9796. getCommitActivityStats: ["GET /repos/{owner}/{repo}/stats/commit_activity"],
  9797. getCommitComment: ["GET /repos/{owner}/{repo}/comments/{comment_id}"],
  9798. getCommitSignatureProtection: [
  9799. "GET /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures"
  9800. ],
  9801. getCommunityProfileMetrics: ["GET /repos/{owner}/{repo}/community/profile"],
  9802. getContent: ["GET /repos/{owner}/{repo}/contents/{path}"],
  9803. getContributorsStats: ["GET /repos/{owner}/{repo}/stats/contributors"],
  9804. getCustomDeploymentProtectionRule: [
  9805. "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/{protection_rule_id}"
  9806. ],
  9807. getCustomPropertiesValues: ["GET /repos/{owner}/{repo}/properties/values"],
  9808. getDeployKey: ["GET /repos/{owner}/{repo}/keys/{key_id}"],
  9809. getDeployment: ["GET /repos/{owner}/{repo}/deployments/{deployment_id}"],
  9810. getDeploymentBranchPolicy: [
  9811. "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}"
  9812. ],
  9813. getDeploymentStatus: [
  9814. "GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses/{status_id}"
  9815. ],
  9816. getEnvironment: [
  9817. "GET /repos/{owner}/{repo}/environments/{environment_name}"
  9818. ],
  9819. getLatestPagesBuild: ["GET /repos/{owner}/{repo}/pages/builds/latest"],
  9820. getLatestRelease: ["GET /repos/{owner}/{repo}/releases/latest"],
  9821. getOrgRuleSuite: ["GET /orgs/{org}/rulesets/rule-suites/{rule_suite_id}"],
  9822. getOrgRuleSuites: ["GET /orgs/{org}/rulesets/rule-suites"],
  9823. getOrgRuleset: ["GET /orgs/{org}/rulesets/{ruleset_id}"],
  9824. getOrgRulesets: ["GET /orgs/{org}/rulesets"],
  9825. getPages: ["GET /repos/{owner}/{repo}/pages"],
  9826. getPagesBuild: ["GET /repos/{owner}/{repo}/pages/builds/{build_id}"],
  9827. getPagesDeployment: [
  9828. "GET /repos/{owner}/{repo}/pages/deployments/{pages_deployment_id}"
  9829. ],
  9830. getPagesHealthCheck: ["GET /repos/{owner}/{repo}/pages/health"],
  9831. getParticipationStats: ["GET /repos/{owner}/{repo}/stats/participation"],
  9832. getPullRequestReviewProtection: [
  9833. "GET /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews"
  9834. ],
  9835. getPunchCardStats: ["GET /repos/{owner}/{repo}/stats/punch_card"],
  9836. getReadme: ["GET /repos/{owner}/{repo}/readme"],
  9837. getReadmeInDirectory: ["GET /repos/{owner}/{repo}/readme/{dir}"],
  9838. getRelease: ["GET /repos/{owner}/{repo}/releases/{release_id}"],
  9839. getReleaseAsset: ["GET /repos/{owner}/{repo}/releases/assets/{asset_id}"],
  9840. getReleaseByTag: ["GET /repos/{owner}/{repo}/releases/tags/{tag}"],
  9841. getRepoRuleSuite: [
  9842. "GET /repos/{owner}/{repo}/rulesets/rule-suites/{rule_suite_id}"
  9843. ],
  9844. getRepoRuleSuites: ["GET /repos/{owner}/{repo}/rulesets/rule-suites"],
  9845. getRepoRuleset: ["GET /repos/{owner}/{repo}/rulesets/{ruleset_id}"],
  9846. getRepoRulesets: ["GET /repos/{owner}/{repo}/rulesets"],
  9847. getStatusChecksProtection: [
  9848. "GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks"
  9849. ],
  9850. getTeamsWithAccessToProtectedBranch: [
  9851. "GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams"
  9852. ],
  9853. getTopPaths: ["GET /repos/{owner}/{repo}/traffic/popular/paths"],
  9854. getTopReferrers: ["GET /repos/{owner}/{repo}/traffic/popular/referrers"],
  9855. getUsersWithAccessToProtectedBranch: [
  9856. "GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users"
  9857. ],
  9858. getViews: ["GET /repos/{owner}/{repo}/traffic/views"],
  9859. getWebhook: ["GET /repos/{owner}/{repo}/hooks/{hook_id}"],
  9860. getWebhookConfigForRepo: [
  9861. "GET /repos/{owner}/{repo}/hooks/{hook_id}/config"
  9862. ],
  9863. getWebhookDelivery: [
  9864. "GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}"
  9865. ],
  9866. listActivities: ["GET /repos/{owner}/{repo}/activity"],
  9867. listAutolinks: ["GET /repos/{owner}/{repo}/autolinks"],
  9868. listBranches: ["GET /repos/{owner}/{repo}/branches"],
  9869. listBranchesForHeadCommit: [
  9870. "GET /repos/{owner}/{repo}/commits/{commit_sha}/branches-where-head"
  9871. ],
  9872. listCollaborators: ["GET /repos/{owner}/{repo}/collaborators"],
  9873. listCommentsForCommit: [
  9874. "GET /repos/{owner}/{repo}/commits/{commit_sha}/comments"
  9875. ],
  9876. listCommitCommentsForRepo: ["GET /repos/{owner}/{repo}/comments"],
  9877. listCommitStatusesForRef: [
  9878. "GET /repos/{owner}/{repo}/commits/{ref}/statuses"
  9879. ],
  9880. listCommits: ["GET /repos/{owner}/{repo}/commits"],
  9881. listContributors: ["GET /repos/{owner}/{repo}/contributors"],
  9882. listCustomDeploymentRuleIntegrations: [
  9883. "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/apps"
  9884. ],
  9885. listDeployKeys: ["GET /repos/{owner}/{repo}/keys"],
  9886. listDeploymentBranchPolicies: [
  9887. "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies"
  9888. ],
  9889. listDeploymentStatuses: [
  9890. "GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses"
  9891. ],
  9892. listDeployments: ["GET /repos/{owner}/{repo}/deployments"],
  9893. listForAuthenticatedUser: ["GET /user/repos"],
  9894. listForOrg: ["GET /orgs/{org}/repos"],
  9895. listForUser: ["GET /users/{username}/repos"],
  9896. listForks: ["GET /repos/{owner}/{repo}/forks"],
  9897. listInvitations: ["GET /repos/{owner}/{repo}/invitations"],
  9898. listInvitationsForAuthenticatedUser: ["GET /user/repository_invitations"],
  9899. listLanguages: ["GET /repos/{owner}/{repo}/languages"],
  9900. listPagesBuilds: ["GET /repos/{owner}/{repo}/pages/builds"],
  9901. listPublic: ["GET /repositories"],
  9902. listPullRequestsAssociatedWithCommit: [
  9903. "GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls"
  9904. ],
  9905. listReleaseAssets: [
  9906. "GET /repos/{owner}/{repo}/releases/{release_id}/assets"
  9907. ],
  9908. listReleases: ["GET /repos/{owner}/{repo}/releases"],
  9909. listTagProtection: ["GET /repos/{owner}/{repo}/tags/protection"],
  9910. listTags: ["GET /repos/{owner}/{repo}/tags"],
  9911. listTeams: ["GET /repos/{owner}/{repo}/teams"],
  9912. listWebhookDeliveries: [
  9913. "GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries"
  9914. ],
  9915. listWebhooks: ["GET /repos/{owner}/{repo}/hooks"],
  9916. merge: ["POST /repos/{owner}/{repo}/merges"],
  9917. mergeUpstream: ["POST /repos/{owner}/{repo}/merge-upstream"],
  9918. pingWebhook: ["POST /repos/{owner}/{repo}/hooks/{hook_id}/pings"],
  9919. redeliverWebhookDelivery: [
  9920. "POST /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}/attempts"
  9921. ],
  9922. removeAppAccessRestrictions: [
  9923. "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps",
  9924. {},
  9925. { mapToData: "apps" }
  9926. ],
  9927. removeCollaborator: [
  9928. "DELETE /repos/{owner}/{repo}/collaborators/{username}"
  9929. ],
  9930. removeStatusCheckContexts: [
  9931. "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts",
  9932. {},
  9933. { mapToData: "contexts" }
  9934. ],
  9935. removeStatusCheckProtection: [
  9936. "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks"
  9937. ],
  9938. removeTeamAccessRestrictions: [
  9939. "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams",
  9940. {},
  9941. { mapToData: "teams" }
  9942. ],
  9943. removeUserAccessRestrictions: [
  9944. "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users",
  9945. {},
  9946. { mapToData: "users" }
  9947. ],
  9948. renameBranch: ["POST /repos/{owner}/{repo}/branches/{branch}/rename"],
  9949. replaceAllTopics: ["PUT /repos/{owner}/{repo}/topics"],
  9950. requestPagesBuild: ["POST /repos/{owner}/{repo}/pages/builds"],
  9951. setAdminBranchProtection: [
  9952. "POST /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins"
  9953. ],
  9954. setAppAccessRestrictions: [
  9955. "PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps",
  9956. {},
  9957. { mapToData: "apps" }
  9958. ],
  9959. setStatusCheckContexts: [
  9960. "PUT /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts",
  9961. {},
  9962. { mapToData: "contexts" }
  9963. ],
  9964. setTeamAccessRestrictions: [
  9965. "PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams",
  9966. {},
  9967. { mapToData: "teams" }
  9968. ],
  9969. setUserAccessRestrictions: [
  9970. "PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users",
  9971. {},
  9972. { mapToData: "users" }
  9973. ],
  9974. testPushWebhook: ["POST /repos/{owner}/{repo}/hooks/{hook_id}/tests"],
  9975. transfer: ["POST /repos/{owner}/{repo}/transfer"],
  9976. update: ["PATCH /repos/{owner}/{repo}"],
  9977. updateBranchProtection: [
  9978. "PUT /repos/{owner}/{repo}/branches/{branch}/protection"
  9979. ],
  9980. updateCommitComment: ["PATCH /repos/{owner}/{repo}/comments/{comment_id}"],
  9981. updateDeploymentBranchPolicy: [
  9982. "PUT /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}"
  9983. ],
  9984. updateInformationAboutPagesSite: ["PUT /repos/{owner}/{repo}/pages"],
  9985. updateInvitation: [
  9986. "PATCH /repos/{owner}/{repo}/invitations/{invitation_id}"
  9987. ],
  9988. updateOrgRuleset: ["PUT /orgs/{org}/rulesets/{ruleset_id}"],
  9989. updatePullRequestReviewProtection: [
  9990. "PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews"
  9991. ],
  9992. updateRelease: ["PATCH /repos/{owner}/{repo}/releases/{release_id}"],
  9993. updateReleaseAsset: [
  9994. "PATCH /repos/{owner}/{repo}/releases/assets/{asset_id}"
  9995. ],
  9996. updateRepoRuleset: ["PUT /repos/{owner}/{repo}/rulesets/{ruleset_id}"],
  9997. updateStatusCheckPotection: [
  9998. "PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks",
  9999. {},
  10000. { renamed: ["repos", "updateStatusCheckProtection"] }
  10001. ],
  10002. updateStatusCheckProtection: [
  10003. "PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks"
  10004. ],
  10005. updateWebhook: ["PATCH /repos/{owner}/{repo}/hooks/{hook_id}"],
  10006. updateWebhookConfigForRepo: [
  10007. "PATCH /repos/{owner}/{repo}/hooks/{hook_id}/config"
  10008. ],
  10009. uploadReleaseAsset: [
  10010. "POST /repos/{owner}/{repo}/releases/{release_id}/assets{?name,label}",
  10011. { baseUrl: "https://uploads.github.com" }
  10012. ]
  10013. },
  10014. search: {
  10015. code: ["GET /search/code"],
  10016. commits: ["GET /search/commits"],
  10017. issuesAndPullRequests: ["GET /search/issues"],
  10018. labels: ["GET /search/labels"],
  10019. repos: ["GET /search/repositories"],
  10020. topics: ["GET /search/topics"],
  10021. users: ["GET /search/users"]
  10022. },
  10023. secretScanning: {
  10024. getAlert: [
  10025. "GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}"
  10026. ],
  10027. listAlertsForEnterprise: [
  10028. "GET /enterprises/{enterprise}/secret-scanning/alerts"
  10029. ],
  10030. listAlertsForOrg: ["GET /orgs/{org}/secret-scanning/alerts"],
  10031. listAlertsForRepo: ["GET /repos/{owner}/{repo}/secret-scanning/alerts"],
  10032. listLocationsForAlert: [
  10033. "GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations"
  10034. ],
  10035. updateAlert: [
  10036. "PATCH /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}"
  10037. ]
  10038. },
  10039. securityAdvisories: {
  10040. createFork: [
  10041. "POST /repos/{owner}/{repo}/security-advisories/{ghsa_id}/forks"
  10042. ],
  10043. createPrivateVulnerabilityReport: [
  10044. "POST /repos/{owner}/{repo}/security-advisories/reports"
  10045. ],
  10046. createRepositoryAdvisory: [
  10047. "POST /repos/{owner}/{repo}/security-advisories"
  10048. ],
  10049. createRepositoryAdvisoryCveRequest: [
  10050. "POST /repos/{owner}/{repo}/security-advisories/{ghsa_id}/cve"
  10051. ],
  10052. getGlobalAdvisory: ["GET /advisories/{ghsa_id}"],
  10053. getRepositoryAdvisory: [
  10054. "GET /repos/{owner}/{repo}/security-advisories/{ghsa_id}"
  10055. ],
  10056. listGlobalAdvisories: ["GET /advisories"],
  10057. listOrgRepositoryAdvisories: ["GET /orgs/{org}/security-advisories"],
  10058. listRepositoryAdvisories: ["GET /repos/{owner}/{repo}/security-advisories"],
  10059. updateRepositoryAdvisory: [
  10060. "PATCH /repos/{owner}/{repo}/security-advisories/{ghsa_id}"
  10061. ]
  10062. },
  10063. teams: {
  10064. addOrUpdateMembershipForUserInOrg: [
  10065. "PUT /orgs/{org}/teams/{team_slug}/memberships/{username}"
  10066. ],
  10067. addOrUpdateProjectPermissionsInOrg: [
  10068. "PUT /orgs/{org}/teams/{team_slug}/projects/{project_id}"
  10069. ],
  10070. addOrUpdateRepoPermissionsInOrg: [
  10071. "PUT /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"
  10072. ],
  10073. checkPermissionsForProjectInOrg: [
  10074. "GET /orgs/{org}/teams/{team_slug}/projects/{project_id}"
  10075. ],
  10076. checkPermissionsForRepoInOrg: [
  10077. "GET /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"
  10078. ],
  10079. create: ["POST /orgs/{org}/teams"],
  10080. createDiscussionCommentInOrg: [
  10081. "POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments"
  10082. ],
  10083. createDiscussionInOrg: ["POST /orgs/{org}/teams/{team_slug}/discussions"],
  10084. deleteDiscussionCommentInOrg: [
  10085. "DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}"
  10086. ],
  10087. deleteDiscussionInOrg: [
  10088. "DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}"
  10089. ],
  10090. deleteInOrg: ["DELETE /orgs/{org}/teams/{team_slug}"],
  10091. getByName: ["GET /orgs/{org}/teams/{team_slug}"],
  10092. getDiscussionCommentInOrg: [
  10093. "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}"
  10094. ],
  10095. getDiscussionInOrg: [
  10096. "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}"
  10097. ],
  10098. getMembershipForUserInOrg: [
  10099. "GET /orgs/{org}/teams/{team_slug}/memberships/{username}"
  10100. ],
  10101. list: ["GET /orgs/{org}/teams"],
  10102. listChildInOrg: ["GET /orgs/{org}/teams/{team_slug}/teams"],
  10103. listDiscussionCommentsInOrg: [
  10104. "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments"
  10105. ],
  10106. listDiscussionsInOrg: ["GET /orgs/{org}/teams/{team_slug}/discussions"],
  10107. listForAuthenticatedUser: ["GET /user/teams"],
  10108. listMembersInOrg: ["GET /orgs/{org}/teams/{team_slug}/members"],
  10109. listPendingInvitationsInOrg: [
  10110. "GET /orgs/{org}/teams/{team_slug}/invitations"
  10111. ],
  10112. listProjectsInOrg: ["GET /orgs/{org}/teams/{team_slug}/projects"],
  10113. listReposInOrg: ["GET /orgs/{org}/teams/{team_slug}/repos"],
  10114. removeMembershipForUserInOrg: [
  10115. "DELETE /orgs/{org}/teams/{team_slug}/memberships/{username}"
  10116. ],
  10117. removeProjectInOrg: [
  10118. "DELETE /orgs/{org}/teams/{team_slug}/projects/{project_id}"
  10119. ],
  10120. removeRepoInOrg: [
  10121. "DELETE /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"
  10122. ],
  10123. updateDiscussionCommentInOrg: [
  10124. "PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}"
  10125. ],
  10126. updateDiscussionInOrg: [
  10127. "PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}"
  10128. ],
  10129. updateInOrg: ["PATCH /orgs/{org}/teams/{team_slug}"]
  10130. },
  10131. users: {
  10132. addEmailForAuthenticated: [
  10133. "POST /user/emails",
  10134. {},
  10135. { renamed: ["users", "addEmailForAuthenticatedUser"] }
  10136. ],
  10137. addEmailForAuthenticatedUser: ["POST /user/emails"],
  10138. addSocialAccountForAuthenticatedUser: ["POST /user/social_accounts"],
  10139. block: ["PUT /user/blocks/{username}"],
  10140. checkBlocked: ["GET /user/blocks/{username}"],
  10141. checkFollowingForUser: ["GET /users/{username}/following/{target_user}"],
  10142. checkPersonIsFollowedByAuthenticated: ["GET /user/following/{username}"],
  10143. createGpgKeyForAuthenticated: [
  10144. "POST /user/gpg_keys",
  10145. {},
  10146. { renamed: ["users", "createGpgKeyForAuthenticatedUser"] }
  10147. ],
  10148. createGpgKeyForAuthenticatedUser: ["POST /user/gpg_keys"],
  10149. createPublicSshKeyForAuthenticated: [
  10150. "POST /user/keys",
  10151. {},
  10152. { renamed: ["users", "createPublicSshKeyForAuthenticatedUser"] }
  10153. ],
  10154. createPublicSshKeyForAuthenticatedUser: ["POST /user/keys"],
  10155. createSshSigningKeyForAuthenticatedUser: ["POST /user/ssh_signing_keys"],
  10156. deleteEmailForAuthenticated: [
  10157. "DELETE /user/emails",
  10158. {},
  10159. { renamed: ["users", "deleteEmailForAuthenticatedUser"] }
  10160. ],
  10161. deleteEmailForAuthenticatedUser: ["DELETE /user/emails"],
  10162. deleteGpgKeyForAuthenticated: [
  10163. "DELETE /user/gpg_keys/{gpg_key_id}",
  10164. {},
  10165. { renamed: ["users", "deleteGpgKeyForAuthenticatedUser"] }
  10166. ],
  10167. deleteGpgKeyForAuthenticatedUser: ["DELETE /user/gpg_keys/{gpg_key_id}"],
  10168. deletePublicSshKeyForAuthenticated: [
  10169. "DELETE /user/keys/{key_id}",
  10170. {},
  10171. { renamed: ["users", "deletePublicSshKeyForAuthenticatedUser"] }
  10172. ],
  10173. deletePublicSshKeyForAuthenticatedUser: ["DELETE /user/keys/{key_id}"],
  10174. deleteSocialAccountForAuthenticatedUser: ["DELETE /user/social_accounts"],
  10175. deleteSshSigningKeyForAuthenticatedUser: [
  10176. "DELETE /user/ssh_signing_keys/{ssh_signing_key_id}"
  10177. ],
  10178. follow: ["PUT /user/following/{username}"],
  10179. getAuthenticated: ["GET /user"],
  10180. getByUsername: ["GET /users/{username}"],
  10181. getContextForUser: ["GET /users/{username}/hovercard"],
  10182. getGpgKeyForAuthenticated: [
  10183. "GET /user/gpg_keys/{gpg_key_id}",
  10184. {},
  10185. { renamed: ["users", "getGpgKeyForAuthenticatedUser"] }
  10186. ],
  10187. getGpgKeyForAuthenticatedUser: ["GET /user/gpg_keys/{gpg_key_id}"],
  10188. getPublicSshKeyForAuthenticated: [
  10189. "GET /user/keys/{key_id}",
  10190. {},
  10191. { renamed: ["users", "getPublicSshKeyForAuthenticatedUser"] }
  10192. ],
  10193. getPublicSshKeyForAuthenticatedUser: ["GET /user/keys/{key_id}"],
  10194. getSshSigningKeyForAuthenticatedUser: [
  10195. "GET /user/ssh_signing_keys/{ssh_signing_key_id}"
  10196. ],
  10197. list: ["GET /users"],
  10198. listBlockedByAuthenticated: [
  10199. "GET /user/blocks",
  10200. {},
  10201. { renamed: ["users", "listBlockedByAuthenticatedUser"] }
  10202. ],
  10203. listBlockedByAuthenticatedUser: ["GET /user/blocks"],
  10204. listEmailsForAuthenticated: [
  10205. "GET /user/emails",
  10206. {},
  10207. { renamed: ["users", "listEmailsForAuthenticatedUser"] }
  10208. ],
  10209. listEmailsForAuthenticatedUser: ["GET /user/emails"],
  10210. listFollowedByAuthenticated: [
  10211. "GET /user/following",
  10212. {},
  10213. { renamed: ["users", "listFollowedByAuthenticatedUser"] }
  10214. ],
  10215. listFollowedByAuthenticatedUser: ["GET /user/following"],
  10216. listFollowersForAuthenticatedUser: ["GET /user/followers"],
  10217. listFollowersForUser: ["GET /users/{username}/followers"],
  10218. listFollowingForUser: ["GET /users/{username}/following"],
  10219. listGpgKeysForAuthenticated: [
  10220. "GET /user/gpg_keys",
  10221. {},
  10222. { renamed: ["users", "listGpgKeysForAuthenticatedUser"] }
  10223. ],
  10224. listGpgKeysForAuthenticatedUser: ["GET /user/gpg_keys"],
  10225. listGpgKeysForUser: ["GET /users/{username}/gpg_keys"],
  10226. listPublicEmailsForAuthenticated: [
  10227. "GET /user/public_emails",
  10228. {},
  10229. { renamed: ["users", "listPublicEmailsForAuthenticatedUser"] }
  10230. ],
  10231. listPublicEmailsForAuthenticatedUser: ["GET /user/public_emails"],
  10232. listPublicKeysForUser: ["GET /users/{username}/keys"],
  10233. listPublicSshKeysForAuthenticated: [
  10234. "GET /user/keys",
  10235. {},
  10236. { renamed: ["users", "listPublicSshKeysForAuthenticatedUser"] }
  10237. ],
  10238. listPublicSshKeysForAuthenticatedUser: ["GET /user/keys"],
  10239. listSocialAccountsForAuthenticatedUser: ["GET /user/social_accounts"],
  10240. listSocialAccountsForUser: ["GET /users/{username}/social_accounts"],
  10241. listSshSigningKeysForAuthenticatedUser: ["GET /user/ssh_signing_keys"],
  10242. listSshSigningKeysForUser: ["GET /users/{username}/ssh_signing_keys"],
  10243. setPrimaryEmailVisibilityForAuthenticated: [
  10244. "PATCH /user/email/visibility",
  10245. {},
  10246. { renamed: ["users", "setPrimaryEmailVisibilityForAuthenticatedUser"] }
  10247. ],
  10248. setPrimaryEmailVisibilityForAuthenticatedUser: [
  10249. "PATCH /user/email/visibility"
  10250. ],
  10251. unblock: ["DELETE /user/blocks/{username}"],
  10252. unfollow: ["DELETE /user/following/{username}"],
  10253. updateAuthenticated: ["PATCH /user"]
  10254. }
  10255. };
  10256. var endpoints_default = Endpoints;
  10257. // pkg/dist-src/endpoints-to-methods.js
  10258. var endpointMethodsMap = /* @__PURE__ */ new Map();
  10259. for (const [scope, endpoints] of Object.entries(endpoints_default)) {
  10260. for (const [methodName, endpoint] of Object.entries(endpoints)) {
  10261. const [route, defaults, decorations] = endpoint;
  10262. const [method, url] = route.split(/ /);
  10263. const endpointDefaults = Object.assign(
  10264. {
  10265. method,
  10266. url
  10267. },
  10268. defaults
  10269. );
  10270. if (!endpointMethodsMap.has(scope)) {
  10271. endpointMethodsMap.set(scope, /* @__PURE__ */ new Map());
  10272. }
  10273. endpointMethodsMap.get(scope).set(methodName, {
  10274. scope,
  10275. methodName,
  10276. endpointDefaults,
  10277. decorations
  10278. });
  10279. }
  10280. }
  10281. var handler = {
  10282. has({ scope }, methodName) {
  10283. return endpointMethodsMap.get(scope).has(methodName);
  10284. },
  10285. getOwnPropertyDescriptor(target, methodName) {
  10286. return {
  10287. value: this.get(target, methodName),
  10288. // ensures method is in the cache
  10289. configurable: true,
  10290. writable: true,
  10291. enumerable: true
  10292. };
  10293. },
  10294. defineProperty(target, methodName, descriptor) {
  10295. Object.defineProperty(target.cache, methodName, descriptor);
  10296. return true;
  10297. },
  10298. deleteProperty(target, methodName) {
  10299. delete target.cache[methodName];
  10300. return true;
  10301. },
  10302. ownKeys({ scope }) {
  10303. return [...endpointMethodsMap.get(scope).keys()];
  10304. },
  10305. set(target, methodName, value) {
  10306. return target.cache[methodName] = value;
  10307. },
  10308. get({ octokit, scope, cache }, methodName) {
  10309. if (cache[methodName]) {
  10310. return cache[methodName];
  10311. }
  10312. const method = endpointMethodsMap.get(scope).get(methodName);
  10313. if (!method) {
  10314. return void 0;
  10315. }
  10316. const { endpointDefaults, decorations } = method;
  10317. if (decorations) {
  10318. cache[methodName] = decorate(
  10319. octokit,
  10320. scope,
  10321. methodName,
  10322. endpointDefaults,
  10323. decorations
  10324. );
  10325. } else {
  10326. cache[methodName] = octokit.request.defaults(endpointDefaults);
  10327. }
  10328. return cache[methodName];
  10329. }
  10330. };
  10331. function endpointsToMethods(octokit) {
  10332. const newMethods = {};
  10333. for (const scope of endpointMethodsMap.keys()) {
  10334. newMethods[scope] = new Proxy({ octokit, scope, cache: {} }, handler);
  10335. }
  10336. return newMethods;
  10337. }
  10338. function decorate(octokit, scope, methodName, defaults, decorations) {
  10339. const requestWithDefaults = octokit.request.defaults(defaults);
  10340. function withDecorations(...args) {
  10341. let options = requestWithDefaults.endpoint.merge(...args);
  10342. if (decorations.mapToData) {
  10343. options = Object.assign({}, options, {
  10344. data: options[decorations.mapToData],
  10345. [decorations.mapToData]: void 0
  10346. });
  10347. return requestWithDefaults(options);
  10348. }
  10349. if (decorations.renamed) {
  10350. const [newScope, newMethodName] = decorations.renamed;
  10351. octokit.log.warn(
  10352. `octokit.${scope}.${methodName}() has been renamed to octokit.${newScope}.${newMethodName}()`
  10353. );
  10354. }
  10355. if (decorations.deprecated) {
  10356. octokit.log.warn(decorations.deprecated);
  10357. }
  10358. if (decorations.renamedParameters) {
  10359. const options2 = requestWithDefaults.endpoint.merge(...args);
  10360. for (const [name, alias] of Object.entries(
  10361. decorations.renamedParameters
  10362. )) {
  10363. if (name in options2) {
  10364. octokit.log.warn(
  10365. `"${name}" parameter is deprecated for "octokit.${scope}.${methodName}()". Use "${alias}" instead`
  10366. );
  10367. if (!(alias in options2)) {
  10368. options2[alias] = options2[name];
  10369. }
  10370. delete options2[name];
  10371. }
  10372. }
  10373. return requestWithDefaults(options2);
  10374. }
  10375. return requestWithDefaults(...args);
  10376. }
  10377. return Object.assign(withDecorations, requestWithDefaults);
  10378. }
  10379. // pkg/dist-src/index.js
  10380. function restEndpointMethods(octokit) {
  10381. const api = endpointsToMethods(octokit);
  10382. return {
  10383. rest: api
  10384. };
  10385. }
  10386. restEndpointMethods.VERSION = VERSION;
  10387. function legacyRestEndpointMethods(octokit) {
  10388. const api = endpointsToMethods(octokit);
  10389. return {
  10390. ...api,
  10391. rest: api
  10392. };
  10393. }
  10394. legacyRestEndpointMethods.VERSION = VERSION;
  10395. // Annotate the CommonJS export names for ESM import in node:
  10396. 0 && (0);
  10397. /***/ }),
  10398. /***/ 537:
  10399. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  10400. "use strict";
  10401. var __create = Object.create;
  10402. var __defProp = Object.defineProperty;
  10403. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  10404. var __getOwnPropNames = Object.getOwnPropertyNames;
  10405. var __getProtoOf = Object.getPrototypeOf;
  10406. var __hasOwnProp = Object.prototype.hasOwnProperty;
  10407. var __export = (target, all) => {
  10408. for (var name in all)
  10409. __defProp(target, name, { get: all[name], enumerable: true });
  10410. };
  10411. var __copyProps = (to, from, except, desc) => {
  10412. if (from && typeof from === "object" || typeof from === "function") {
  10413. for (let key of __getOwnPropNames(from))
  10414. if (!__hasOwnProp.call(to, key) && key !== except)
  10415. __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  10416. }
  10417. return to;
  10418. };
  10419. var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
  10420. // If the importer is in node compatibility mode or this is not an ESM
  10421. // file that has been converted to a CommonJS file using a Babel-
  10422. // compatible transform (i.e. "__esModule" has not been set), then set
  10423. // "default" to the CommonJS "module.exports" for node compatibility.
  10424. isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
  10425. mod
  10426. ));
  10427. var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
  10428. // pkg/dist-src/index.js
  10429. var dist_src_exports = {};
  10430. __export(dist_src_exports, {
  10431. RequestError: () => RequestError
  10432. });
  10433. module.exports = __toCommonJS(dist_src_exports);
  10434. var import_deprecation = __nccwpck_require__(8932);
  10435. var import_once = __toESM(__nccwpck_require__(1223));
  10436. var logOnceCode = (0, import_once.default)((deprecation) => console.warn(deprecation));
  10437. var logOnceHeaders = (0, import_once.default)((deprecation) => console.warn(deprecation));
  10438. var RequestError = class extends Error {
  10439. constructor(message, statusCode, options) {
  10440. super(message);
  10441. if (Error.captureStackTrace) {
  10442. Error.captureStackTrace(this, this.constructor);
  10443. }
  10444. this.name = "HttpError";
  10445. this.status = statusCode;
  10446. let headers;
  10447. if ("headers" in options && typeof options.headers !== "undefined") {
  10448. headers = options.headers;
  10449. }
  10450. if ("response" in options) {
  10451. this.response = options.response;
  10452. headers = options.response.headers;
  10453. }
  10454. const requestCopy = Object.assign({}, options.request);
  10455. if (options.request.headers.authorization) {
  10456. requestCopy.headers = Object.assign({}, options.request.headers, {
  10457. authorization: options.request.headers.authorization.replace(
  10458. / .*$/,
  10459. " [REDACTED]"
  10460. )
  10461. });
  10462. }
  10463. requestCopy.url = requestCopy.url.replace(/\bclient_secret=\w+/g, "client_secret=[REDACTED]").replace(/\baccess_token=\w+/g, "access_token=[REDACTED]");
  10464. this.request = requestCopy;
  10465. Object.defineProperty(this, "code", {
  10466. get() {
  10467. logOnceCode(
  10468. new import_deprecation.Deprecation(
  10469. "[@octokit/request-error] `error.code` is deprecated, use `error.status`."
  10470. )
  10471. );
  10472. return statusCode;
  10473. }
  10474. });
  10475. Object.defineProperty(this, "headers", {
  10476. get() {
  10477. logOnceHeaders(
  10478. new import_deprecation.Deprecation(
  10479. "[@octokit/request-error] `error.headers` is deprecated, use `error.response.headers`."
  10480. )
  10481. );
  10482. return headers || {};
  10483. }
  10484. });
  10485. }
  10486. };
  10487. // Annotate the CommonJS export names for ESM import in node:
  10488. 0 && (0);
  10489. /***/ }),
  10490. /***/ 6234:
  10491. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  10492. "use strict";
  10493. var __defProp = Object.defineProperty;
  10494. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  10495. var __getOwnPropNames = Object.getOwnPropertyNames;
  10496. var __hasOwnProp = Object.prototype.hasOwnProperty;
  10497. var __export = (target, all) => {
  10498. for (var name in all)
  10499. __defProp(target, name, { get: all[name], enumerable: true });
  10500. };
  10501. var __copyProps = (to, from, except, desc) => {
  10502. if (from && typeof from === "object" || typeof from === "function") {
  10503. for (let key of __getOwnPropNames(from))
  10504. if (!__hasOwnProp.call(to, key) && key !== except)
  10505. __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  10506. }
  10507. return to;
  10508. };
  10509. var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
  10510. // pkg/dist-src/index.js
  10511. var dist_src_exports = {};
  10512. __export(dist_src_exports, {
  10513. request: () => request
  10514. });
  10515. module.exports = __toCommonJS(dist_src_exports);
  10516. var import_endpoint = __nccwpck_require__(9440);
  10517. var import_universal_user_agent = __nccwpck_require__(5030);
  10518. // pkg/dist-src/version.js
  10519. var VERSION = "8.4.0";
  10520. // pkg/dist-src/is-plain-object.js
  10521. function isPlainObject(value) {
  10522. if (typeof value !== "object" || value === null)
  10523. return false;
  10524. if (Object.prototype.toString.call(value) !== "[object Object]")
  10525. return false;
  10526. const proto = Object.getPrototypeOf(value);
  10527. if (proto === null)
  10528. return true;
  10529. const Ctor = Object.prototype.hasOwnProperty.call(proto, "constructor") && proto.constructor;
  10530. return typeof Ctor === "function" && Ctor instanceof Ctor && Function.prototype.call(Ctor) === Function.prototype.call(value);
  10531. }
  10532. // pkg/dist-src/fetch-wrapper.js
  10533. var import_request_error = __nccwpck_require__(537);
  10534. // pkg/dist-src/get-buffer-response.js
  10535. function getBufferResponse(response) {
  10536. return response.arrayBuffer();
  10537. }
  10538. // pkg/dist-src/fetch-wrapper.js
  10539. function fetchWrapper(requestOptions) {
  10540. var _a, _b, _c, _d;
  10541. const log = requestOptions.request && requestOptions.request.log ? requestOptions.request.log : console;
  10542. const parseSuccessResponseBody = ((_a = requestOptions.request) == null ? void 0 : _a.parseSuccessResponseBody) !== false;
  10543. if (isPlainObject(requestOptions.body) || Array.isArray(requestOptions.body)) {
  10544. requestOptions.body = JSON.stringify(requestOptions.body);
  10545. }
  10546. let headers = {};
  10547. let status;
  10548. let url;
  10549. let { fetch } = globalThis;
  10550. if ((_b = requestOptions.request) == null ? void 0 : _b.fetch) {
  10551. fetch = requestOptions.request.fetch;
  10552. }
  10553. if (!fetch) {
  10554. throw new Error(
  10555. "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"
  10556. );
  10557. }
  10558. return fetch(requestOptions.url, {
  10559. method: requestOptions.method,
  10560. body: requestOptions.body,
  10561. redirect: (_c = requestOptions.request) == null ? void 0 : _c.redirect,
  10562. headers: requestOptions.headers,
  10563. signal: (_d = requestOptions.request) == null ? void 0 : _d.signal,
  10564. // duplex must be set if request.body is ReadableStream or Async Iterables.
  10565. // See https://fetch.spec.whatwg.org/#dom-requestinit-duplex.
  10566. ...requestOptions.body && { duplex: "half" }
  10567. }).then(async (response) => {
  10568. url = response.url;
  10569. status = response.status;
  10570. for (const keyAndValue of response.headers) {
  10571. headers[keyAndValue[0]] = keyAndValue[1];
  10572. }
  10573. if ("deprecation" in headers) {
  10574. const matches = headers.link && headers.link.match(/<([^>]+)>; rel="deprecation"/);
  10575. const deprecationLink = matches && matches.pop();
  10576. log.warn(
  10577. `[@octokit/request] "${requestOptions.method} ${requestOptions.url}" is deprecated. It is scheduled to be removed on ${headers.sunset}${deprecationLink ? `. See ${deprecationLink}` : ""}`
  10578. );
  10579. }
  10580. if (status === 204 || status === 205) {
  10581. return;
  10582. }
  10583. if (requestOptions.method === "HEAD") {
  10584. if (status < 400) {
  10585. return;
  10586. }
  10587. throw new import_request_error.RequestError(response.statusText, status, {
  10588. response: {
  10589. url,
  10590. status,
  10591. headers,
  10592. data: void 0
  10593. },
  10594. request: requestOptions
  10595. });
  10596. }
  10597. if (status === 304) {
  10598. throw new import_request_error.RequestError("Not modified", status, {
  10599. response: {
  10600. url,
  10601. status,
  10602. headers,
  10603. data: await getResponseData(response)
  10604. },
  10605. request: requestOptions
  10606. });
  10607. }
  10608. if (status >= 400) {
  10609. const data = await getResponseData(response);
  10610. const error = new import_request_error.RequestError(toErrorMessage(data), status, {
  10611. response: {
  10612. url,
  10613. status,
  10614. headers,
  10615. data
  10616. },
  10617. request: requestOptions
  10618. });
  10619. throw error;
  10620. }
  10621. return parseSuccessResponseBody ? await getResponseData(response) : response.body;
  10622. }).then((data) => {
  10623. return {
  10624. status,
  10625. url,
  10626. headers,
  10627. data
  10628. };
  10629. }).catch((error) => {
  10630. if (error instanceof import_request_error.RequestError)
  10631. throw error;
  10632. else if (error.name === "AbortError")
  10633. throw error;
  10634. let message = error.message;
  10635. if (error.name === "TypeError" && "cause" in error) {
  10636. if (error.cause instanceof Error) {
  10637. message = error.cause.message;
  10638. } else if (typeof error.cause === "string") {
  10639. message = error.cause;
  10640. }
  10641. }
  10642. throw new import_request_error.RequestError(message, 500, {
  10643. request: requestOptions
  10644. });
  10645. });
  10646. }
  10647. async function getResponseData(response) {
  10648. const contentType = response.headers.get("content-type");
  10649. if (/application\/json/.test(contentType)) {
  10650. return response.json().catch(() => response.text()).catch(() => "");
  10651. }
  10652. if (!contentType || /^text\/|charset=utf-8$/.test(contentType)) {
  10653. return response.text();
  10654. }
  10655. return getBufferResponse(response);
  10656. }
  10657. function toErrorMessage(data) {
  10658. if (typeof data === "string")
  10659. return data;
  10660. let suffix;
  10661. if ("documentation_url" in data) {
  10662. suffix = ` - ${data.documentation_url}`;
  10663. } else {
  10664. suffix = "";
  10665. }
  10666. if ("message" in data) {
  10667. if (Array.isArray(data.errors)) {
  10668. return `${data.message}: ${data.errors.map(JSON.stringify).join(", ")}${suffix}`;
  10669. }
  10670. return `${data.message}${suffix}`;
  10671. }
  10672. return `Unknown error: ${JSON.stringify(data)}`;
  10673. }
  10674. // pkg/dist-src/with-defaults.js
  10675. function withDefaults(oldEndpoint, newDefaults) {
  10676. const endpoint2 = oldEndpoint.defaults(newDefaults);
  10677. const newApi = function(route, parameters) {
  10678. const endpointOptions = endpoint2.merge(route, parameters);
  10679. if (!endpointOptions.request || !endpointOptions.request.hook) {
  10680. return fetchWrapper(endpoint2.parse(endpointOptions));
  10681. }
  10682. const request2 = (route2, parameters2) => {
  10683. return fetchWrapper(
  10684. endpoint2.parse(endpoint2.merge(route2, parameters2))
  10685. );
  10686. };
  10687. Object.assign(request2, {
  10688. endpoint: endpoint2,
  10689. defaults: withDefaults.bind(null, endpoint2)
  10690. });
  10691. return endpointOptions.request.hook(request2, endpointOptions);
  10692. };
  10693. return Object.assign(newApi, {
  10694. endpoint: endpoint2,
  10695. defaults: withDefaults.bind(null, endpoint2)
  10696. });
  10697. }
  10698. // pkg/dist-src/index.js
  10699. var request = withDefaults(import_endpoint.endpoint, {
  10700. headers: {
  10701. "user-agent": `octokit-request.js/${VERSION} ${(0, import_universal_user_agent.getUserAgent)()}`
  10702. }
  10703. });
  10704. // Annotate the CommonJS export names for ESM import in node:
  10705. 0 && (0);
  10706. /***/ }),
  10707. /***/ 3682:
  10708. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  10709. var register = __nccwpck_require__(4670);
  10710. var addHook = __nccwpck_require__(5549);
  10711. var removeHook = __nccwpck_require__(6819);
  10712. // bind with array of arguments: https://stackoverflow.com/a/21792913
  10713. var bind = Function.bind;
  10714. var bindable = bind.bind(bind);
  10715. function bindApi(hook, state, name) {
  10716. var removeHookRef = bindable(removeHook, null).apply(
  10717. null,
  10718. name ? [state, name] : [state]
  10719. );
  10720. hook.api = { remove: removeHookRef };
  10721. hook.remove = removeHookRef;
  10722. ["before", "error", "after", "wrap"].forEach(function (kind) {
  10723. var args = name ? [state, kind, name] : [state, kind];
  10724. hook[kind] = hook.api[kind] = bindable(addHook, null).apply(null, args);
  10725. });
  10726. }
  10727. function HookSingular() {
  10728. var singularHookName = "h";
  10729. var singularHookState = {
  10730. registry: {},
  10731. };
  10732. var singularHook = register.bind(null, singularHookState, singularHookName);
  10733. bindApi(singularHook, singularHookState, singularHookName);
  10734. return singularHook;
  10735. }
  10736. function HookCollection() {
  10737. var state = {
  10738. registry: {},
  10739. };
  10740. var hook = register.bind(null, state);
  10741. bindApi(hook, state);
  10742. return hook;
  10743. }
  10744. var collectionHookDeprecationMessageDisplayed = false;
  10745. function Hook() {
  10746. if (!collectionHookDeprecationMessageDisplayed) {
  10747. console.warn(
  10748. '[before-after-hook]: "Hook()" repurposing warning, use "Hook.Collection()". Read more: https://git.io/upgrade-before-after-hook-to-1.4'
  10749. );
  10750. collectionHookDeprecationMessageDisplayed = true;
  10751. }
  10752. return HookCollection();
  10753. }
  10754. Hook.Singular = HookSingular.bind();
  10755. Hook.Collection = HookCollection.bind();
  10756. module.exports = Hook;
  10757. // expose constructors as a named property for TypeScript
  10758. module.exports.Hook = Hook;
  10759. module.exports.Singular = Hook.Singular;
  10760. module.exports.Collection = Hook.Collection;
  10761. /***/ }),
  10762. /***/ 5549:
  10763. /***/ ((module) => {
  10764. module.exports = addHook;
  10765. function addHook(state, kind, name, hook) {
  10766. var orig = hook;
  10767. if (!state.registry[name]) {
  10768. state.registry[name] = [];
  10769. }
  10770. if (kind === "before") {
  10771. hook = function (method, options) {
  10772. return Promise.resolve()
  10773. .then(orig.bind(null, options))
  10774. .then(method.bind(null, options));
  10775. };
  10776. }
  10777. if (kind === "after") {
  10778. hook = function (method, options) {
  10779. var result;
  10780. return Promise.resolve()
  10781. .then(method.bind(null, options))
  10782. .then(function (result_) {
  10783. result = result_;
  10784. return orig(result, options);
  10785. })
  10786. .then(function () {
  10787. return result;
  10788. });
  10789. };
  10790. }
  10791. if (kind === "error") {
  10792. hook = function (method, options) {
  10793. return Promise.resolve()
  10794. .then(method.bind(null, options))
  10795. .catch(function (error) {
  10796. return orig(error, options);
  10797. });
  10798. };
  10799. }
  10800. state.registry[name].push({
  10801. hook: hook,
  10802. orig: orig,
  10803. });
  10804. }
  10805. /***/ }),
  10806. /***/ 4670:
  10807. /***/ ((module) => {
  10808. module.exports = register;
  10809. function register(state, name, method, options) {
  10810. if (typeof method !== "function") {
  10811. throw new Error("method for before hook must be a function");
  10812. }
  10813. if (!options) {
  10814. options = {};
  10815. }
  10816. if (Array.isArray(name)) {
  10817. return name.reverse().reduce(function (callback, name) {
  10818. return register.bind(null, state, name, callback, options);
  10819. }, method)();
  10820. }
  10821. return Promise.resolve().then(function () {
  10822. if (!state.registry[name]) {
  10823. return method(options);
  10824. }
  10825. return state.registry[name].reduce(function (method, registered) {
  10826. return registered.hook.bind(null, method, options);
  10827. }, method)();
  10828. });
  10829. }
  10830. /***/ }),
  10831. /***/ 6819:
  10832. /***/ ((module) => {
  10833. module.exports = removeHook;
  10834. function removeHook(state, name, method) {
  10835. if (!state.registry[name]) {
  10836. return;
  10837. }
  10838. var index = state.registry[name]
  10839. .map(function (registered) {
  10840. return registered.orig;
  10841. })
  10842. .indexOf(method);
  10843. if (index === -1) {
  10844. return;
  10845. }
  10846. state.registry[name].splice(index, 1);
  10847. }
  10848. /***/ }),
  10849. /***/ 8932:
  10850. /***/ ((__unused_webpack_module, exports) => {
  10851. "use strict";
  10852. Object.defineProperty(exports, "__esModule", ({ value: true }));
  10853. class Deprecation extends Error {
  10854. constructor(message) {
  10855. super(message); // Maintains proper stack trace (only available on V8)
  10856. /* istanbul ignore next */
  10857. if (Error.captureStackTrace) {
  10858. Error.captureStackTrace(this, this.constructor);
  10859. }
  10860. this.name = 'Deprecation';
  10861. }
  10862. }
  10863. exports.Deprecation = Deprecation;
  10864. /***/ }),
  10865. /***/ 1223:
  10866. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  10867. var wrappy = __nccwpck_require__(2940)
  10868. module.exports = wrappy(once)
  10869. module.exports.strict = wrappy(onceStrict)
  10870. once.proto = once(function () {
  10871. Object.defineProperty(Function.prototype, 'once', {
  10872. value: function () {
  10873. return once(this)
  10874. },
  10875. configurable: true
  10876. })
  10877. Object.defineProperty(Function.prototype, 'onceStrict', {
  10878. value: function () {
  10879. return onceStrict(this)
  10880. },
  10881. configurable: true
  10882. })
  10883. })
  10884. function once (fn) {
  10885. var f = function () {
  10886. if (f.called) return f.value
  10887. f.called = true
  10888. return f.value = fn.apply(this, arguments)
  10889. }
  10890. f.called = false
  10891. return f
  10892. }
  10893. function onceStrict (fn) {
  10894. var f = function () {
  10895. if (f.called)
  10896. throw new Error(f.onceError)
  10897. f.called = true
  10898. return f.value = fn.apply(this, arguments)
  10899. }
  10900. var name = fn.name || 'Function wrapped with `once`'
  10901. f.onceError = name + " shouldn't be called more than once"
  10902. f.called = false
  10903. return f
  10904. }
  10905. /***/ }),
  10906. /***/ 5911:
  10907. /***/ ((module, exports) => {
  10908. exports = module.exports = SemVer
  10909. var debug
  10910. /* istanbul ignore next */
  10911. if (typeof process === 'object' &&
  10912. process.env &&
  10913. process.env.NODE_DEBUG &&
  10914. /\bsemver\b/i.test(process.env.NODE_DEBUG)) {
  10915. debug = function () {
  10916. var args = Array.prototype.slice.call(arguments, 0)
  10917. args.unshift('SEMVER')
  10918. console.log.apply(console, args)
  10919. }
  10920. } else {
  10921. debug = function () {}
  10922. }
  10923. // Note: this is the semver.org version of the spec that it implements
  10924. // Not necessarily the package version of this code.
  10925. exports.SEMVER_SPEC_VERSION = '2.0.0'
  10926. var MAX_LENGTH = 256
  10927. var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER ||
  10928. /* istanbul ignore next */ 9007199254740991
  10929. // Max safe segment length for coercion.
  10930. var MAX_SAFE_COMPONENT_LENGTH = 16
  10931. var MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6
  10932. // The actual regexps go on exports.re
  10933. var re = exports.re = []
  10934. var safeRe = exports.safeRe = []
  10935. var src = exports.src = []
  10936. var t = exports.tokens = {}
  10937. var R = 0
  10938. function tok (n) {
  10939. t[n] = R++
  10940. }
  10941. var LETTERDASHNUMBER = '[a-zA-Z0-9-]'
  10942. // Replace some greedy regex tokens to prevent regex dos issues. These regex are
  10943. // used internally via the safeRe object since all inputs in this library get
  10944. // normalized first to trim and collapse all extra whitespace. The original
  10945. // regexes are exported for userland consumption and lower level usage. A
  10946. // future breaking change could export the safer regex only with a note that
  10947. // all input should have extra whitespace removed.
  10948. var safeRegexReplacements = [
  10949. ['\\s', 1],
  10950. ['\\d', MAX_LENGTH],
  10951. [LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH],
  10952. ]
  10953. function makeSafeRe (value) {
  10954. for (var i = 0; i < safeRegexReplacements.length; i++) {
  10955. var token = safeRegexReplacements[i][0]
  10956. var max = safeRegexReplacements[i][1]
  10957. value = value
  10958. .split(token + '*').join(token + '{0,' + max + '}')
  10959. .split(token + '+').join(token + '{1,' + max + '}')
  10960. }
  10961. return value
  10962. }
  10963. // The following Regular Expressions can be used for tokenizing,
  10964. // validating, and parsing SemVer version strings.
  10965. // ## Numeric Identifier
  10966. // A single `0`, or a non-zero digit followed by zero or more digits.
  10967. tok('NUMERICIDENTIFIER')
  10968. src[t.NUMERICIDENTIFIER] = '0|[1-9]\\d*'
  10969. tok('NUMERICIDENTIFIERLOOSE')
  10970. src[t.NUMERICIDENTIFIERLOOSE] = '\\d+'
  10971. // ## Non-numeric Identifier
  10972. // Zero or more digits, followed by a letter or hyphen, and then zero or
  10973. // more letters, digits, or hyphens.
  10974. tok('NONNUMERICIDENTIFIER')
  10975. src[t.NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-]' + LETTERDASHNUMBER + '*'
  10976. // ## Main Version
  10977. // Three dot-separated numeric identifiers.
  10978. tok('MAINVERSION')
  10979. src[t.MAINVERSION] = '(' + src[t.NUMERICIDENTIFIER] + ')\\.' +
  10980. '(' + src[t.NUMERICIDENTIFIER] + ')\\.' +
  10981. '(' + src[t.NUMERICIDENTIFIER] + ')'
  10982. tok('MAINVERSIONLOOSE')
  10983. src[t.MAINVERSIONLOOSE] = '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')\\.' +
  10984. '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')\\.' +
  10985. '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')'
  10986. // ## Pre-release Version Identifier
  10987. // A numeric identifier, or a non-numeric identifier.
  10988. tok('PRERELEASEIDENTIFIER')
  10989. src[t.PRERELEASEIDENTIFIER] = '(?:' + src[t.NUMERICIDENTIFIER] +
  10990. '|' + src[t.NONNUMERICIDENTIFIER] + ')'
  10991. tok('PRERELEASEIDENTIFIERLOOSE')
  10992. src[t.PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[t.NUMERICIDENTIFIERLOOSE] +
  10993. '|' + src[t.NONNUMERICIDENTIFIER] + ')'
  10994. // ## Pre-release Version
  10995. // Hyphen, followed by one or more dot-separated pre-release version
  10996. // identifiers.
  10997. tok('PRERELEASE')
  10998. src[t.PRERELEASE] = '(?:-(' + src[t.PRERELEASEIDENTIFIER] +
  10999. '(?:\\.' + src[t.PRERELEASEIDENTIFIER] + ')*))'
  11000. tok('PRERELEASELOOSE')
  11001. src[t.PRERELEASELOOSE] = '(?:-?(' + src[t.PRERELEASEIDENTIFIERLOOSE] +
  11002. '(?:\\.' + src[t.PRERELEASEIDENTIFIERLOOSE] + ')*))'
  11003. // ## Build Metadata Identifier
  11004. // Any combination of digits, letters, or hyphens.
  11005. tok('BUILDIDENTIFIER')
  11006. src[t.BUILDIDENTIFIER] = LETTERDASHNUMBER + '+'
  11007. // ## Build Metadata
  11008. // Plus sign, followed by one or more period-separated build metadata
  11009. // identifiers.
  11010. tok('BUILD')
  11011. src[t.BUILD] = '(?:\\+(' + src[t.BUILDIDENTIFIER] +
  11012. '(?:\\.' + src[t.BUILDIDENTIFIER] + ')*))'
  11013. // ## Full Version String
  11014. // A main version, followed optionally by a pre-release version and
  11015. // build metadata.
  11016. // Note that the only major, minor, patch, and pre-release sections of
  11017. // the version string are capturing groups. The build metadata is not a
  11018. // capturing group, because it should not ever be used in version
  11019. // comparison.
  11020. tok('FULL')
  11021. tok('FULLPLAIN')
  11022. src[t.FULLPLAIN] = 'v?' + src[t.MAINVERSION] +
  11023. src[t.PRERELEASE] + '?' +
  11024. src[t.BUILD] + '?'
  11025. src[t.FULL] = '^' + src[t.FULLPLAIN] + '$'
  11026. // like full, but allows v1.2.3 and =1.2.3, which people do sometimes.
  11027. // also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty
  11028. // common in the npm registry.
  11029. tok('LOOSEPLAIN')
  11030. src[t.LOOSEPLAIN] = '[v=\\s]*' + src[t.MAINVERSIONLOOSE] +
  11031. src[t.PRERELEASELOOSE] + '?' +
  11032. src[t.BUILD] + '?'
  11033. tok('LOOSE')
  11034. src[t.LOOSE] = '^' + src[t.LOOSEPLAIN] + '$'
  11035. tok('GTLT')
  11036. src[t.GTLT] = '((?:<|>)?=?)'
  11037. // Something like "2.*" or "1.2.x".
  11038. // Note that "x.x" is a valid xRange identifer, meaning "any version"
  11039. // Only the first item is strictly required.
  11040. tok('XRANGEIDENTIFIERLOOSE')
  11041. src[t.XRANGEIDENTIFIERLOOSE] = src[t.NUMERICIDENTIFIERLOOSE] + '|x|X|\\*'
  11042. tok('XRANGEIDENTIFIER')
  11043. src[t.XRANGEIDENTIFIER] = src[t.NUMERICIDENTIFIER] + '|x|X|\\*'
  11044. tok('XRANGEPLAIN')
  11045. src[t.XRANGEPLAIN] = '[v=\\s]*(' + src[t.XRANGEIDENTIFIER] + ')' +
  11046. '(?:\\.(' + src[t.XRANGEIDENTIFIER] + ')' +
  11047. '(?:\\.(' + src[t.XRANGEIDENTIFIER] + ')' +
  11048. '(?:' + src[t.PRERELEASE] + ')?' +
  11049. src[t.BUILD] + '?' +
  11050. ')?)?'
  11051. tok('XRANGEPLAINLOOSE')
  11052. src[t.XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +
  11053. '(?:\\.(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +
  11054. '(?:\\.(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +
  11055. '(?:' + src[t.PRERELEASELOOSE] + ')?' +
  11056. src[t.BUILD] + '?' +
  11057. ')?)?'
  11058. tok('XRANGE')
  11059. src[t.XRANGE] = '^' + src[t.GTLT] + '\\s*' + src[t.XRANGEPLAIN] + '$'
  11060. tok('XRANGELOOSE')
  11061. src[t.XRANGELOOSE] = '^' + src[t.GTLT] + '\\s*' + src[t.XRANGEPLAINLOOSE] + '$'
  11062. // Coercion.
  11063. // Extract anything that could conceivably be a part of a valid semver
  11064. tok('COERCE')
  11065. src[t.COERCE] = '(^|[^\\d])' +
  11066. '(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '})' +
  11067. '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
  11068. '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
  11069. '(?:$|[^\\d])'
  11070. tok('COERCERTL')
  11071. re[t.COERCERTL] = new RegExp(src[t.COERCE], 'g')
  11072. safeRe[t.COERCERTL] = new RegExp(makeSafeRe(src[t.COERCE]), 'g')
  11073. // Tilde ranges.
  11074. // Meaning is "reasonably at or greater than"
  11075. tok('LONETILDE')
  11076. src[t.LONETILDE] = '(?:~>?)'
  11077. tok('TILDETRIM')
  11078. src[t.TILDETRIM] = '(\\s*)' + src[t.LONETILDE] + '\\s+'
  11079. re[t.TILDETRIM] = new RegExp(src[t.TILDETRIM], 'g')
  11080. safeRe[t.TILDETRIM] = new RegExp(makeSafeRe(src[t.TILDETRIM]), 'g')
  11081. var tildeTrimReplace = '$1~'
  11082. tok('TILDE')
  11083. src[t.TILDE] = '^' + src[t.LONETILDE] + src[t.XRANGEPLAIN] + '$'
  11084. tok('TILDELOOSE')
  11085. src[t.TILDELOOSE] = '^' + src[t.LONETILDE] + src[t.XRANGEPLAINLOOSE] + '$'
  11086. // Caret ranges.
  11087. // Meaning is "at least and backwards compatible with"
  11088. tok('LONECARET')
  11089. src[t.LONECARET] = '(?:\\^)'
  11090. tok('CARETTRIM')
  11091. src[t.CARETTRIM] = '(\\s*)' + src[t.LONECARET] + '\\s+'
  11092. re[t.CARETTRIM] = new RegExp(src[t.CARETTRIM], 'g')
  11093. safeRe[t.CARETTRIM] = new RegExp(makeSafeRe(src[t.CARETTRIM]), 'g')
  11094. var caretTrimReplace = '$1^'
  11095. tok('CARET')
  11096. src[t.CARET] = '^' + src[t.LONECARET] + src[t.XRANGEPLAIN] + '$'
  11097. tok('CARETLOOSE')
  11098. src[t.CARETLOOSE] = '^' + src[t.LONECARET] + src[t.XRANGEPLAINLOOSE] + '$'
  11099. // A simple gt/lt/eq thing, or just "" to indicate "any version"
  11100. tok('COMPARATORLOOSE')
  11101. src[t.COMPARATORLOOSE] = '^' + src[t.GTLT] + '\\s*(' + src[t.LOOSEPLAIN] + ')$|^$'
  11102. tok('COMPARATOR')
  11103. src[t.COMPARATOR] = '^' + src[t.GTLT] + '\\s*(' + src[t.FULLPLAIN] + ')$|^$'
  11104. // An expression to strip any whitespace between the gtlt and the thing
  11105. // it modifies, so that `> 1.2.3` ==> `>1.2.3`
  11106. tok('COMPARATORTRIM')
  11107. src[t.COMPARATORTRIM] = '(\\s*)' + src[t.GTLT] +
  11108. '\\s*(' + src[t.LOOSEPLAIN] + '|' + src[t.XRANGEPLAIN] + ')'
  11109. // this one has to use the /g flag
  11110. re[t.COMPARATORTRIM] = new RegExp(src[t.COMPARATORTRIM], 'g')
  11111. safeRe[t.COMPARATORTRIM] = new RegExp(makeSafeRe(src[t.COMPARATORTRIM]), 'g')
  11112. var comparatorTrimReplace = '$1$2$3'
  11113. // Something like `1.2.3 - 1.2.4`
  11114. // Note that these all use the loose form, because they'll be
  11115. // checked against either the strict or loose comparator form
  11116. // later.
  11117. tok('HYPHENRANGE')
  11118. src[t.HYPHENRANGE] = '^\\s*(' + src[t.XRANGEPLAIN] + ')' +
  11119. '\\s+-\\s+' +
  11120. '(' + src[t.XRANGEPLAIN] + ')' +
  11121. '\\s*$'
  11122. tok('HYPHENRANGELOOSE')
  11123. src[t.HYPHENRANGELOOSE] = '^\\s*(' + src[t.XRANGEPLAINLOOSE] + ')' +
  11124. '\\s+-\\s+' +
  11125. '(' + src[t.XRANGEPLAINLOOSE] + ')' +
  11126. '\\s*$'
  11127. // Star ranges basically just allow anything at all.
  11128. tok('STAR')
  11129. src[t.STAR] = '(<|>)?=?\\s*\\*'
  11130. // Compile to actual regexp objects.
  11131. // All are flag-free, unless they were created above with a flag.
  11132. for (var i = 0; i < R; i++) {
  11133. debug(i, src[i])
  11134. if (!re[i]) {
  11135. re[i] = new RegExp(src[i])
  11136. // Replace all greedy whitespace to prevent regex dos issues. These regex are
  11137. // used internally via the safeRe object since all inputs in this library get
  11138. // normalized first to trim and collapse all extra whitespace. The original
  11139. // regexes are exported for userland consumption and lower level usage. A
  11140. // future breaking change could export the safer regex only with a note that
  11141. // all input should have extra whitespace removed.
  11142. safeRe[i] = new RegExp(makeSafeRe(src[i]))
  11143. }
  11144. }
  11145. exports.parse = parse
  11146. function parse (version, options) {
  11147. if (!options || typeof options !== 'object') {
  11148. options = {
  11149. loose: !!options,
  11150. includePrerelease: false
  11151. }
  11152. }
  11153. if (version instanceof SemVer) {
  11154. return version
  11155. }
  11156. if (typeof version !== 'string') {
  11157. return null
  11158. }
  11159. if (version.length > MAX_LENGTH) {
  11160. return null
  11161. }
  11162. var r = options.loose ? safeRe[t.LOOSE] : safeRe[t.FULL]
  11163. if (!r.test(version)) {
  11164. return null
  11165. }
  11166. try {
  11167. return new SemVer(version, options)
  11168. } catch (er) {
  11169. return null
  11170. }
  11171. }
  11172. exports.valid = valid
  11173. function valid (version, options) {
  11174. var v = parse(version, options)
  11175. return v ? v.version : null
  11176. }
  11177. exports.clean = clean
  11178. function clean (version, options) {
  11179. var s = parse(version.trim().replace(/^[=v]+/, ''), options)
  11180. return s ? s.version : null
  11181. }
  11182. exports.SemVer = SemVer
  11183. function SemVer (version, options) {
  11184. if (!options || typeof options !== 'object') {
  11185. options = {
  11186. loose: !!options,
  11187. includePrerelease: false
  11188. }
  11189. }
  11190. if (version instanceof SemVer) {
  11191. if (version.loose === options.loose) {
  11192. return version
  11193. } else {
  11194. version = version.version
  11195. }
  11196. } else if (typeof version !== 'string') {
  11197. throw new TypeError('Invalid Version: ' + version)
  11198. }
  11199. if (version.length > MAX_LENGTH) {
  11200. throw new TypeError('version is longer than ' + MAX_LENGTH + ' characters')
  11201. }
  11202. if (!(this instanceof SemVer)) {
  11203. return new SemVer(version, options)
  11204. }
  11205. debug('SemVer', version, options)
  11206. this.options = options
  11207. this.loose = !!options.loose
  11208. var m = version.trim().match(options.loose ? safeRe[t.LOOSE] : safeRe[t.FULL])
  11209. if (!m) {
  11210. throw new TypeError('Invalid Version: ' + version)
  11211. }
  11212. this.raw = version
  11213. // these are actually numbers
  11214. this.major = +m[1]
  11215. this.minor = +m[2]
  11216. this.patch = +m[3]
  11217. if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
  11218. throw new TypeError('Invalid major version')
  11219. }
  11220. if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
  11221. throw new TypeError('Invalid minor version')
  11222. }
  11223. if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
  11224. throw new TypeError('Invalid patch version')
  11225. }
  11226. // numberify any prerelease numeric ids
  11227. if (!m[4]) {
  11228. this.prerelease = []
  11229. } else {
  11230. this.prerelease = m[4].split('.').map(function (id) {
  11231. if (/^[0-9]+$/.test(id)) {
  11232. var num = +id
  11233. if (num >= 0 && num < MAX_SAFE_INTEGER) {
  11234. return num
  11235. }
  11236. }
  11237. return id
  11238. })
  11239. }
  11240. this.build = m[5] ? m[5].split('.') : []
  11241. this.format()
  11242. }
  11243. SemVer.prototype.format = function () {
  11244. this.version = this.major + '.' + this.minor + '.' + this.patch
  11245. if (this.prerelease.length) {
  11246. this.version += '-' + this.prerelease.join('.')
  11247. }
  11248. return this.version
  11249. }
  11250. SemVer.prototype.toString = function () {
  11251. return this.version
  11252. }
  11253. SemVer.prototype.compare = function (other) {
  11254. debug('SemVer.compare', this.version, this.options, other)
  11255. if (!(other instanceof SemVer)) {
  11256. other = new SemVer(other, this.options)
  11257. }
  11258. return this.compareMain(other) || this.comparePre(other)
  11259. }
  11260. SemVer.prototype.compareMain = function (other) {
  11261. if (!(other instanceof SemVer)) {
  11262. other = new SemVer(other, this.options)
  11263. }
  11264. return compareIdentifiers(this.major, other.major) ||
  11265. compareIdentifiers(this.minor, other.minor) ||
  11266. compareIdentifiers(this.patch, other.patch)
  11267. }
  11268. SemVer.prototype.comparePre = function (other) {
  11269. if (!(other instanceof SemVer)) {
  11270. other = new SemVer(other, this.options)
  11271. }
  11272. // NOT having a prerelease is > having one
  11273. if (this.prerelease.length && !other.prerelease.length) {
  11274. return -1
  11275. } else if (!this.prerelease.length && other.prerelease.length) {
  11276. return 1
  11277. } else if (!this.prerelease.length && !other.prerelease.length) {
  11278. return 0
  11279. }
  11280. var i = 0
  11281. do {
  11282. var a = this.prerelease[i]
  11283. var b = other.prerelease[i]
  11284. debug('prerelease compare', i, a, b)
  11285. if (a === undefined && b === undefined) {
  11286. return 0
  11287. } else if (b === undefined) {
  11288. return 1
  11289. } else if (a === undefined) {
  11290. return -1
  11291. } else if (a === b) {
  11292. continue
  11293. } else {
  11294. return compareIdentifiers(a, b)
  11295. }
  11296. } while (++i)
  11297. }
  11298. SemVer.prototype.compareBuild = function (other) {
  11299. if (!(other instanceof SemVer)) {
  11300. other = new SemVer(other, this.options)
  11301. }
  11302. var i = 0
  11303. do {
  11304. var a = this.build[i]
  11305. var b = other.build[i]
  11306. debug('prerelease compare', i, a, b)
  11307. if (a === undefined && b === undefined) {
  11308. return 0
  11309. } else if (b === undefined) {
  11310. return 1
  11311. } else if (a === undefined) {
  11312. return -1
  11313. } else if (a === b) {
  11314. continue
  11315. } else {
  11316. return compareIdentifiers(a, b)
  11317. }
  11318. } while (++i)
  11319. }
  11320. // preminor will bump the version up to the next minor release, and immediately
  11321. // down to pre-release. premajor and prepatch work the same way.
  11322. SemVer.prototype.inc = function (release, identifier) {
  11323. switch (release) {
  11324. case 'premajor':
  11325. this.prerelease.length = 0
  11326. this.patch = 0
  11327. this.minor = 0
  11328. this.major++
  11329. this.inc('pre', identifier)
  11330. break
  11331. case 'preminor':
  11332. this.prerelease.length = 0
  11333. this.patch = 0
  11334. this.minor++
  11335. this.inc('pre', identifier)
  11336. break
  11337. case 'prepatch':
  11338. // If this is already a prerelease, it will bump to the next version
  11339. // drop any prereleases that might already exist, since they are not
  11340. // relevant at this point.
  11341. this.prerelease.length = 0
  11342. this.inc('patch', identifier)
  11343. this.inc('pre', identifier)
  11344. break
  11345. // If the input is a non-prerelease version, this acts the same as
  11346. // prepatch.
  11347. case 'prerelease':
  11348. if (this.prerelease.length === 0) {
  11349. this.inc('patch', identifier)
  11350. }
  11351. this.inc('pre', identifier)
  11352. break
  11353. case 'major':
  11354. // If this is a pre-major version, bump up to the same major version.
  11355. // Otherwise increment major.
  11356. // 1.0.0-5 bumps to 1.0.0
  11357. // 1.1.0 bumps to 2.0.0
  11358. if (this.minor !== 0 ||
  11359. this.patch !== 0 ||
  11360. this.prerelease.length === 0) {
  11361. this.major++
  11362. }
  11363. this.minor = 0
  11364. this.patch = 0
  11365. this.prerelease = []
  11366. break
  11367. case 'minor':
  11368. // If this is a pre-minor version, bump up to the same minor version.
  11369. // Otherwise increment minor.
  11370. // 1.2.0-5 bumps to 1.2.0
  11371. // 1.2.1 bumps to 1.3.0
  11372. if (this.patch !== 0 || this.prerelease.length === 0) {
  11373. this.minor++
  11374. }
  11375. this.patch = 0
  11376. this.prerelease = []
  11377. break
  11378. case 'patch':
  11379. // If this is not a pre-release version, it will increment the patch.
  11380. // If it is a pre-release it will bump up to the same patch version.
  11381. // 1.2.0-5 patches to 1.2.0
  11382. // 1.2.0 patches to 1.2.1
  11383. if (this.prerelease.length === 0) {
  11384. this.patch++
  11385. }
  11386. this.prerelease = []
  11387. break
  11388. // This probably shouldn't be used publicly.
  11389. // 1.0.0 "pre" would become 1.0.0-0 which is the wrong direction.
  11390. case 'pre':
  11391. if (this.prerelease.length === 0) {
  11392. this.prerelease = [0]
  11393. } else {
  11394. var i = this.prerelease.length
  11395. while (--i >= 0) {
  11396. if (typeof this.prerelease[i] === 'number') {
  11397. this.prerelease[i]++
  11398. i = -2
  11399. }
  11400. }
  11401. if (i === -1) {
  11402. // didn't increment anything
  11403. this.prerelease.push(0)
  11404. }
  11405. }
  11406. if (identifier) {
  11407. // 1.2.0-beta.1 bumps to 1.2.0-beta.2,
  11408. // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0
  11409. if (this.prerelease[0] === identifier) {
  11410. if (isNaN(this.prerelease[1])) {
  11411. this.prerelease = [identifier, 0]
  11412. }
  11413. } else {
  11414. this.prerelease = [identifier, 0]
  11415. }
  11416. }
  11417. break
  11418. default:
  11419. throw new Error('invalid increment argument: ' + release)
  11420. }
  11421. this.format()
  11422. this.raw = this.version
  11423. return this
  11424. }
  11425. exports.inc = inc
  11426. function inc (version, release, loose, identifier) {
  11427. if (typeof (loose) === 'string') {
  11428. identifier = loose
  11429. loose = undefined
  11430. }
  11431. try {
  11432. return new SemVer(version, loose).inc(release, identifier).version
  11433. } catch (er) {
  11434. return null
  11435. }
  11436. }
  11437. exports.diff = diff
  11438. function diff (version1, version2) {
  11439. if (eq(version1, version2)) {
  11440. return null
  11441. } else {
  11442. var v1 = parse(version1)
  11443. var v2 = parse(version2)
  11444. var prefix = ''
  11445. if (v1.prerelease.length || v2.prerelease.length) {
  11446. prefix = 'pre'
  11447. var defaultResult = 'prerelease'
  11448. }
  11449. for (var key in v1) {
  11450. if (key === 'major' || key === 'minor' || key === 'patch') {
  11451. if (v1[key] !== v2[key]) {
  11452. return prefix + key
  11453. }
  11454. }
  11455. }
  11456. return defaultResult // may be undefined
  11457. }
  11458. }
  11459. exports.compareIdentifiers = compareIdentifiers
  11460. var numeric = /^[0-9]+$/
  11461. function compareIdentifiers (a, b) {
  11462. var anum = numeric.test(a)
  11463. var bnum = numeric.test(b)
  11464. if (anum && bnum) {
  11465. a = +a
  11466. b = +b
  11467. }
  11468. return a === b ? 0
  11469. : (anum && !bnum) ? -1
  11470. : (bnum && !anum) ? 1
  11471. : a < b ? -1
  11472. : 1
  11473. }
  11474. exports.rcompareIdentifiers = rcompareIdentifiers
  11475. function rcompareIdentifiers (a, b) {
  11476. return compareIdentifiers(b, a)
  11477. }
  11478. exports.major = major
  11479. function major (a, loose) {
  11480. return new SemVer(a, loose).major
  11481. }
  11482. exports.minor = minor
  11483. function minor (a, loose) {
  11484. return new SemVer(a, loose).minor
  11485. }
  11486. exports.patch = patch
  11487. function patch (a, loose) {
  11488. return new SemVer(a, loose).patch
  11489. }
  11490. exports.compare = compare
  11491. function compare (a, b, loose) {
  11492. return new SemVer(a, loose).compare(new SemVer(b, loose))
  11493. }
  11494. exports.compareLoose = compareLoose
  11495. function compareLoose (a, b) {
  11496. return compare(a, b, true)
  11497. }
  11498. exports.compareBuild = compareBuild
  11499. function compareBuild (a, b, loose) {
  11500. var versionA = new SemVer(a, loose)
  11501. var versionB = new SemVer(b, loose)
  11502. return versionA.compare(versionB) || versionA.compareBuild(versionB)
  11503. }
  11504. exports.rcompare = rcompare
  11505. function rcompare (a, b, loose) {
  11506. return compare(b, a, loose)
  11507. }
  11508. exports.sort = sort
  11509. function sort (list, loose) {
  11510. return list.sort(function (a, b) {
  11511. return exports.compareBuild(a, b, loose)
  11512. })
  11513. }
  11514. exports.rsort = rsort
  11515. function rsort (list, loose) {
  11516. return list.sort(function (a, b) {
  11517. return exports.compareBuild(b, a, loose)
  11518. })
  11519. }
  11520. exports.gt = gt
  11521. function gt (a, b, loose) {
  11522. return compare(a, b, loose) > 0
  11523. }
  11524. exports.lt = lt
  11525. function lt (a, b, loose) {
  11526. return compare(a, b, loose) < 0
  11527. }
  11528. exports.eq = eq
  11529. function eq (a, b, loose) {
  11530. return compare(a, b, loose) === 0
  11531. }
  11532. exports.neq = neq
  11533. function neq (a, b, loose) {
  11534. return compare(a, b, loose) !== 0
  11535. }
  11536. exports.gte = gte
  11537. function gte (a, b, loose) {
  11538. return compare(a, b, loose) >= 0
  11539. }
  11540. exports.lte = lte
  11541. function lte (a, b, loose) {
  11542. return compare(a, b, loose) <= 0
  11543. }
  11544. exports.cmp = cmp
  11545. function cmp (a, op, b, loose) {
  11546. switch (op) {
  11547. case '===':
  11548. if (typeof a === 'object')
  11549. a = a.version
  11550. if (typeof b === 'object')
  11551. b = b.version
  11552. return a === b
  11553. case '!==':
  11554. if (typeof a === 'object')
  11555. a = a.version
  11556. if (typeof b === 'object')
  11557. b = b.version
  11558. return a !== b
  11559. case '':
  11560. case '=':
  11561. case '==':
  11562. return eq(a, b, loose)
  11563. case '!=':
  11564. return neq(a, b, loose)
  11565. case '>':
  11566. return gt(a, b, loose)
  11567. case '>=':
  11568. return gte(a, b, loose)
  11569. case '<':
  11570. return lt(a, b, loose)
  11571. case '<=':
  11572. return lte(a, b, loose)
  11573. default:
  11574. throw new TypeError('Invalid operator: ' + op)
  11575. }
  11576. }
  11577. exports.Comparator = Comparator
  11578. function Comparator (comp, options) {
  11579. if (!options || typeof options !== 'object') {
  11580. options = {
  11581. loose: !!options,
  11582. includePrerelease: false
  11583. }
  11584. }
  11585. if (comp instanceof Comparator) {
  11586. if (comp.loose === !!options.loose) {
  11587. return comp
  11588. } else {
  11589. comp = comp.value
  11590. }
  11591. }
  11592. if (!(this instanceof Comparator)) {
  11593. return new Comparator(comp, options)
  11594. }
  11595. comp = comp.trim().split(/\s+/).join(' ')
  11596. debug('comparator', comp, options)
  11597. this.options = options
  11598. this.loose = !!options.loose
  11599. this.parse(comp)
  11600. if (this.semver === ANY) {
  11601. this.value = ''
  11602. } else {
  11603. this.value = this.operator + this.semver.version
  11604. }
  11605. debug('comp', this)
  11606. }
  11607. var ANY = {}
  11608. Comparator.prototype.parse = function (comp) {
  11609. var r = this.options.loose ? safeRe[t.COMPARATORLOOSE] : safeRe[t.COMPARATOR]
  11610. var m = comp.match(r)
  11611. if (!m) {
  11612. throw new TypeError('Invalid comparator: ' + comp)
  11613. }
  11614. this.operator = m[1] !== undefined ? m[1] : ''
  11615. if (this.operator === '=') {
  11616. this.operator = ''
  11617. }
  11618. // if it literally is just '>' or '' then allow anything.
  11619. if (!m[2]) {
  11620. this.semver = ANY
  11621. } else {
  11622. this.semver = new SemVer(m[2], this.options.loose)
  11623. }
  11624. }
  11625. Comparator.prototype.toString = function () {
  11626. return this.value
  11627. }
  11628. Comparator.prototype.test = function (version) {
  11629. debug('Comparator.test', version, this.options.loose)
  11630. if (this.semver === ANY || version === ANY) {
  11631. return true
  11632. }
  11633. if (typeof version === 'string') {
  11634. try {
  11635. version = new SemVer(version, this.options)
  11636. } catch (er) {
  11637. return false
  11638. }
  11639. }
  11640. return cmp(version, this.operator, this.semver, this.options)
  11641. }
  11642. Comparator.prototype.intersects = function (comp, options) {
  11643. if (!(comp instanceof Comparator)) {
  11644. throw new TypeError('a Comparator is required')
  11645. }
  11646. if (!options || typeof options !== 'object') {
  11647. options = {
  11648. loose: !!options,
  11649. includePrerelease: false
  11650. }
  11651. }
  11652. var rangeTmp
  11653. if (this.operator === '') {
  11654. if (this.value === '') {
  11655. return true
  11656. }
  11657. rangeTmp = new Range(comp.value, options)
  11658. return satisfies(this.value, rangeTmp, options)
  11659. } else if (comp.operator === '') {
  11660. if (comp.value === '') {
  11661. return true
  11662. }
  11663. rangeTmp = new Range(this.value, options)
  11664. return satisfies(comp.semver, rangeTmp, options)
  11665. }
  11666. var sameDirectionIncreasing =
  11667. (this.operator === '>=' || this.operator === '>') &&
  11668. (comp.operator === '>=' || comp.operator === '>')
  11669. var sameDirectionDecreasing =
  11670. (this.operator === '<=' || this.operator === '<') &&
  11671. (comp.operator === '<=' || comp.operator === '<')
  11672. var sameSemVer = this.semver.version === comp.semver.version
  11673. var differentDirectionsInclusive =
  11674. (this.operator === '>=' || this.operator === '<=') &&
  11675. (comp.operator === '>=' || comp.operator === '<=')
  11676. var oppositeDirectionsLessThan =
  11677. cmp(this.semver, '<', comp.semver, options) &&
  11678. ((this.operator === '>=' || this.operator === '>') &&
  11679. (comp.operator === '<=' || comp.operator === '<'))
  11680. var oppositeDirectionsGreaterThan =
  11681. cmp(this.semver, '>', comp.semver, options) &&
  11682. ((this.operator === '<=' || this.operator === '<') &&
  11683. (comp.operator === '>=' || comp.operator === '>'))
  11684. return sameDirectionIncreasing || sameDirectionDecreasing ||
  11685. (sameSemVer && differentDirectionsInclusive) ||
  11686. oppositeDirectionsLessThan || oppositeDirectionsGreaterThan
  11687. }
  11688. exports.Range = Range
  11689. function Range (range, options) {
  11690. if (!options || typeof options !== 'object') {
  11691. options = {
  11692. loose: !!options,
  11693. includePrerelease: false
  11694. }
  11695. }
  11696. if (range instanceof Range) {
  11697. if (range.loose === !!options.loose &&
  11698. range.includePrerelease === !!options.includePrerelease) {
  11699. return range
  11700. } else {
  11701. return new Range(range.raw, options)
  11702. }
  11703. }
  11704. if (range instanceof Comparator) {
  11705. return new Range(range.value, options)
  11706. }
  11707. if (!(this instanceof Range)) {
  11708. return new Range(range, options)
  11709. }
  11710. this.options = options
  11711. this.loose = !!options.loose
  11712. this.includePrerelease = !!options.includePrerelease
  11713. // First reduce all whitespace as much as possible so we do not have to rely
  11714. // on potentially slow regexes like \s*. This is then stored and used for
  11715. // future error messages as well.
  11716. this.raw = range
  11717. .trim()
  11718. .split(/\s+/)
  11719. .join(' ')
  11720. // First, split based on boolean or ||
  11721. this.set = this.raw.split('||').map(function (range) {
  11722. return this.parseRange(range.trim())
  11723. }, this).filter(function (c) {
  11724. // throw out any that are not relevant for whatever reason
  11725. return c.length
  11726. })
  11727. if (!this.set.length) {
  11728. throw new TypeError('Invalid SemVer Range: ' + this.raw)
  11729. }
  11730. this.format()
  11731. }
  11732. Range.prototype.format = function () {
  11733. this.range = this.set.map(function (comps) {
  11734. return comps.join(' ').trim()
  11735. }).join('||').trim()
  11736. return this.range
  11737. }
  11738. Range.prototype.toString = function () {
  11739. return this.range
  11740. }
  11741. Range.prototype.parseRange = function (range) {
  11742. var loose = this.options.loose
  11743. // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`
  11744. var hr = loose ? safeRe[t.HYPHENRANGELOOSE] : safeRe[t.HYPHENRANGE]
  11745. range = range.replace(hr, hyphenReplace)
  11746. debug('hyphen replace', range)
  11747. // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`
  11748. range = range.replace(safeRe[t.COMPARATORTRIM], comparatorTrimReplace)
  11749. debug('comparator trim', range, safeRe[t.COMPARATORTRIM])
  11750. // `~ 1.2.3` => `~1.2.3`
  11751. range = range.replace(safeRe[t.TILDETRIM], tildeTrimReplace)
  11752. // `^ 1.2.3` => `^1.2.3`
  11753. range = range.replace(safeRe[t.CARETTRIM], caretTrimReplace)
  11754. // normalize spaces
  11755. range = range.split(/\s+/).join(' ')
  11756. // At this point, the range is completely trimmed and
  11757. // ready to be split into comparators.
  11758. var compRe = loose ? safeRe[t.COMPARATORLOOSE] : safeRe[t.COMPARATOR]
  11759. var set = range.split(' ').map(function (comp) {
  11760. return parseComparator(comp, this.options)
  11761. }, this).join(' ').split(/\s+/)
  11762. if (this.options.loose) {
  11763. // in loose mode, throw out any that are not valid comparators
  11764. set = set.filter(function (comp) {
  11765. return !!comp.match(compRe)
  11766. })
  11767. }
  11768. set = set.map(function (comp) {
  11769. return new Comparator(comp, this.options)
  11770. }, this)
  11771. return set
  11772. }
  11773. Range.prototype.intersects = function (range, options) {
  11774. if (!(range instanceof Range)) {
  11775. throw new TypeError('a Range is required')
  11776. }
  11777. return this.set.some(function (thisComparators) {
  11778. return (
  11779. isSatisfiable(thisComparators, options) &&
  11780. range.set.some(function (rangeComparators) {
  11781. return (
  11782. isSatisfiable(rangeComparators, options) &&
  11783. thisComparators.every(function (thisComparator) {
  11784. return rangeComparators.every(function (rangeComparator) {
  11785. return thisComparator.intersects(rangeComparator, options)
  11786. })
  11787. })
  11788. )
  11789. })
  11790. )
  11791. })
  11792. }
  11793. // take a set of comparators and determine whether there
  11794. // exists a version which can satisfy it
  11795. function isSatisfiable (comparators, options) {
  11796. var result = true
  11797. var remainingComparators = comparators.slice()
  11798. var testComparator = remainingComparators.pop()
  11799. while (result && remainingComparators.length) {
  11800. result = remainingComparators.every(function (otherComparator) {
  11801. return testComparator.intersects(otherComparator, options)
  11802. })
  11803. testComparator = remainingComparators.pop()
  11804. }
  11805. return result
  11806. }
  11807. // Mostly just for testing and legacy API reasons
  11808. exports.toComparators = toComparators
  11809. function toComparators (range, options) {
  11810. return new Range(range, options).set.map(function (comp) {
  11811. return comp.map(function (c) {
  11812. return c.value
  11813. }).join(' ').trim().split(' ')
  11814. })
  11815. }
  11816. // comprised of xranges, tildes, stars, and gtlt's at this point.
  11817. // already replaced the hyphen ranges
  11818. // turn into a set of JUST comparators.
  11819. function parseComparator (comp, options) {
  11820. debug('comp', comp, options)
  11821. comp = replaceCarets(comp, options)
  11822. debug('caret', comp)
  11823. comp = replaceTildes(comp, options)
  11824. debug('tildes', comp)
  11825. comp = replaceXRanges(comp, options)
  11826. debug('xrange', comp)
  11827. comp = replaceStars(comp, options)
  11828. debug('stars', comp)
  11829. return comp
  11830. }
  11831. function isX (id) {
  11832. return !id || id.toLowerCase() === 'x' || id === '*'
  11833. }
  11834. // ~, ~> --> * (any, kinda silly)
  11835. // ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0
  11836. // ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0
  11837. // ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0
  11838. // ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0
  11839. // ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0
  11840. function replaceTildes (comp, options) {
  11841. return comp.trim().split(/\s+/).map(function (comp) {
  11842. return replaceTilde(comp, options)
  11843. }).join(' ')
  11844. }
  11845. function replaceTilde (comp, options) {
  11846. var r = options.loose ? safeRe[t.TILDELOOSE] : safeRe[t.TILDE]
  11847. return comp.replace(r, function (_, M, m, p, pr) {
  11848. debug('tilde', comp, _, M, m, p, pr)
  11849. var ret
  11850. if (isX(M)) {
  11851. ret = ''
  11852. } else if (isX(m)) {
  11853. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  11854. } else if (isX(p)) {
  11855. // ~1.2 == >=1.2.0 <1.3.0
  11856. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  11857. } else if (pr) {
  11858. debug('replaceTilde pr', pr)
  11859. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  11860. ' <' + M + '.' + (+m + 1) + '.0'
  11861. } else {
  11862. // ~1.2.3 == >=1.2.3 <1.3.0
  11863. ret = '>=' + M + '.' + m + '.' + p +
  11864. ' <' + M + '.' + (+m + 1) + '.0'
  11865. }
  11866. debug('tilde return', ret)
  11867. return ret
  11868. })
  11869. }
  11870. // ^ --> * (any, kinda silly)
  11871. // ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0
  11872. // ^2.0, ^2.0.x --> >=2.0.0 <3.0.0
  11873. // ^1.2, ^1.2.x --> >=1.2.0 <2.0.0
  11874. // ^1.2.3 --> >=1.2.3 <2.0.0
  11875. // ^1.2.0 --> >=1.2.0 <2.0.0
  11876. function replaceCarets (comp, options) {
  11877. return comp.trim().split(/\s+/).map(function (comp) {
  11878. return replaceCaret(comp, options)
  11879. }).join(' ')
  11880. }
  11881. function replaceCaret (comp, options) {
  11882. debug('caret', comp, options)
  11883. var r = options.loose ? safeRe[t.CARETLOOSE] : safeRe[t.CARET]
  11884. return comp.replace(r, function (_, M, m, p, pr) {
  11885. debug('caret', comp, _, M, m, p, pr)
  11886. var ret
  11887. if (isX(M)) {
  11888. ret = ''
  11889. } else if (isX(m)) {
  11890. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  11891. } else if (isX(p)) {
  11892. if (M === '0') {
  11893. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  11894. } else {
  11895. ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0'
  11896. }
  11897. } else if (pr) {
  11898. debug('replaceCaret pr', pr)
  11899. if (M === '0') {
  11900. if (m === '0') {
  11901. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  11902. ' <' + M + '.' + m + '.' + (+p + 1)
  11903. } else {
  11904. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  11905. ' <' + M + '.' + (+m + 1) + '.0'
  11906. }
  11907. } else {
  11908. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  11909. ' <' + (+M + 1) + '.0.0'
  11910. }
  11911. } else {
  11912. debug('no pr')
  11913. if (M === '0') {
  11914. if (m === '0') {
  11915. ret = '>=' + M + '.' + m + '.' + p +
  11916. ' <' + M + '.' + m + '.' + (+p + 1)
  11917. } else {
  11918. ret = '>=' + M + '.' + m + '.' + p +
  11919. ' <' + M + '.' + (+m + 1) + '.0'
  11920. }
  11921. } else {
  11922. ret = '>=' + M + '.' + m + '.' + p +
  11923. ' <' + (+M + 1) + '.0.0'
  11924. }
  11925. }
  11926. debug('caret return', ret)
  11927. return ret
  11928. })
  11929. }
  11930. function replaceXRanges (comp, options) {
  11931. debug('replaceXRanges', comp, options)
  11932. return comp.split(/\s+/).map(function (comp) {
  11933. return replaceXRange(comp, options)
  11934. }).join(' ')
  11935. }
  11936. function replaceXRange (comp, options) {
  11937. comp = comp.trim()
  11938. var r = options.loose ? safeRe[t.XRANGELOOSE] : safeRe[t.XRANGE]
  11939. return comp.replace(r, function (ret, gtlt, M, m, p, pr) {
  11940. debug('xRange', comp, ret, gtlt, M, m, p, pr)
  11941. var xM = isX(M)
  11942. var xm = xM || isX(m)
  11943. var xp = xm || isX(p)
  11944. var anyX = xp
  11945. if (gtlt === '=' && anyX) {
  11946. gtlt = ''
  11947. }
  11948. // if we're including prereleases in the match, then we need
  11949. // to fix this to -0, the lowest possible prerelease value
  11950. pr = options.includePrerelease ? '-0' : ''
  11951. if (xM) {
  11952. if (gtlt === '>' || gtlt === '<') {
  11953. // nothing is allowed
  11954. ret = '<0.0.0-0'
  11955. } else {
  11956. // nothing is forbidden
  11957. ret = '*'
  11958. }
  11959. } else if (gtlt && anyX) {
  11960. // we know patch is an x, because we have any x at all.
  11961. // replace X with 0
  11962. if (xm) {
  11963. m = 0
  11964. }
  11965. p = 0
  11966. if (gtlt === '>') {
  11967. // >1 => >=2.0.0
  11968. // >1.2 => >=1.3.0
  11969. // >1.2.3 => >= 1.2.4
  11970. gtlt = '>='
  11971. if (xm) {
  11972. M = +M + 1
  11973. m = 0
  11974. p = 0
  11975. } else {
  11976. m = +m + 1
  11977. p = 0
  11978. }
  11979. } else if (gtlt === '<=') {
  11980. // <=0.7.x is actually <0.8.0, since any 0.7.x should
  11981. // pass. Similarly, <=7.x is actually <8.0.0, etc.
  11982. gtlt = '<'
  11983. if (xm) {
  11984. M = +M + 1
  11985. } else {
  11986. m = +m + 1
  11987. }
  11988. }
  11989. ret = gtlt + M + '.' + m + '.' + p + pr
  11990. } else if (xm) {
  11991. ret = '>=' + M + '.0.0' + pr + ' <' + (+M + 1) + '.0.0' + pr
  11992. } else if (xp) {
  11993. ret = '>=' + M + '.' + m + '.0' + pr +
  11994. ' <' + M + '.' + (+m + 1) + '.0' + pr
  11995. }
  11996. debug('xRange return', ret)
  11997. return ret
  11998. })
  11999. }
  12000. // Because * is AND-ed with everything else in the comparator,
  12001. // and '' means "any version", just remove the *s entirely.
  12002. function replaceStars (comp, options) {
  12003. debug('replaceStars', comp, options)
  12004. // Looseness is ignored here. star is always as loose as it gets!
  12005. return comp.trim().replace(safeRe[t.STAR], '')
  12006. }
  12007. // This function is passed to string.replace(re[t.HYPHENRANGE])
  12008. // M, m, patch, prerelease, build
  12009. // 1.2 - 3.4.5 => >=1.2.0 <=3.4.5
  12010. // 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do
  12011. // 1.2 - 3.4 => >=1.2.0 <3.5.0
  12012. function hyphenReplace ($0,
  12013. from, fM, fm, fp, fpr, fb,
  12014. to, tM, tm, tp, tpr, tb) {
  12015. if (isX(fM)) {
  12016. from = ''
  12017. } else if (isX(fm)) {
  12018. from = '>=' + fM + '.0.0'
  12019. } else if (isX(fp)) {
  12020. from = '>=' + fM + '.' + fm + '.0'
  12021. } else {
  12022. from = '>=' + from
  12023. }
  12024. if (isX(tM)) {
  12025. to = ''
  12026. } else if (isX(tm)) {
  12027. to = '<' + (+tM + 1) + '.0.0'
  12028. } else if (isX(tp)) {
  12029. to = '<' + tM + '.' + (+tm + 1) + '.0'
  12030. } else if (tpr) {
  12031. to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr
  12032. } else {
  12033. to = '<=' + to
  12034. }
  12035. return (from + ' ' + to).trim()
  12036. }
  12037. // if ANY of the sets match ALL of its comparators, then pass
  12038. Range.prototype.test = function (version) {
  12039. if (!version) {
  12040. return false
  12041. }
  12042. if (typeof version === 'string') {
  12043. try {
  12044. version = new SemVer(version, this.options)
  12045. } catch (er) {
  12046. return false
  12047. }
  12048. }
  12049. for (var i = 0; i < this.set.length; i++) {
  12050. if (testSet(this.set[i], version, this.options)) {
  12051. return true
  12052. }
  12053. }
  12054. return false
  12055. }
  12056. function testSet (set, version, options) {
  12057. for (var i = 0; i < set.length; i++) {
  12058. if (!set[i].test(version)) {
  12059. return false
  12060. }
  12061. }
  12062. if (version.prerelease.length && !options.includePrerelease) {
  12063. // Find the set of versions that are allowed to have prereleases
  12064. // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0
  12065. // That should allow `1.2.3-pr.2` to pass.
  12066. // However, `1.2.4-alpha.notready` should NOT be allowed,
  12067. // even though it's within the range set by the comparators.
  12068. for (i = 0; i < set.length; i++) {
  12069. debug(set[i].semver)
  12070. if (set[i].semver === ANY) {
  12071. continue
  12072. }
  12073. if (set[i].semver.prerelease.length > 0) {
  12074. var allowed = set[i].semver
  12075. if (allowed.major === version.major &&
  12076. allowed.minor === version.minor &&
  12077. allowed.patch === version.patch) {
  12078. return true
  12079. }
  12080. }
  12081. }
  12082. // Version has a -pre, but it's not one of the ones we like.
  12083. return false
  12084. }
  12085. return true
  12086. }
  12087. exports.satisfies = satisfies
  12088. function satisfies (version, range, options) {
  12089. try {
  12090. range = new Range(range, options)
  12091. } catch (er) {
  12092. return false
  12093. }
  12094. return range.test(version)
  12095. }
  12096. exports.maxSatisfying = maxSatisfying
  12097. function maxSatisfying (versions, range, options) {
  12098. var max = null
  12099. var maxSV = null
  12100. try {
  12101. var rangeObj = new Range(range, options)
  12102. } catch (er) {
  12103. return null
  12104. }
  12105. versions.forEach(function (v) {
  12106. if (rangeObj.test(v)) {
  12107. // satisfies(v, range, options)
  12108. if (!max || maxSV.compare(v) === -1) {
  12109. // compare(max, v, true)
  12110. max = v
  12111. maxSV = new SemVer(max, options)
  12112. }
  12113. }
  12114. })
  12115. return max
  12116. }
  12117. exports.minSatisfying = minSatisfying
  12118. function minSatisfying (versions, range, options) {
  12119. var min = null
  12120. var minSV = null
  12121. try {
  12122. var rangeObj = new Range(range, options)
  12123. } catch (er) {
  12124. return null
  12125. }
  12126. versions.forEach(function (v) {
  12127. if (rangeObj.test(v)) {
  12128. // satisfies(v, range, options)
  12129. if (!min || minSV.compare(v) === 1) {
  12130. // compare(min, v, true)
  12131. min = v
  12132. minSV = new SemVer(min, options)
  12133. }
  12134. }
  12135. })
  12136. return min
  12137. }
  12138. exports.minVersion = minVersion
  12139. function minVersion (range, loose) {
  12140. range = new Range(range, loose)
  12141. var minver = new SemVer('0.0.0')
  12142. if (range.test(minver)) {
  12143. return minver
  12144. }
  12145. minver = new SemVer('0.0.0-0')
  12146. if (range.test(minver)) {
  12147. return minver
  12148. }
  12149. minver = null
  12150. for (var i = 0; i < range.set.length; ++i) {
  12151. var comparators = range.set[i]
  12152. comparators.forEach(function (comparator) {
  12153. // Clone to avoid manipulating the comparator's semver object.
  12154. var compver = new SemVer(comparator.semver.version)
  12155. switch (comparator.operator) {
  12156. case '>':
  12157. if (compver.prerelease.length === 0) {
  12158. compver.patch++
  12159. } else {
  12160. compver.prerelease.push(0)
  12161. }
  12162. compver.raw = compver.format()
  12163. /* fallthrough */
  12164. case '':
  12165. case '>=':
  12166. if (!minver || gt(minver, compver)) {
  12167. minver = compver
  12168. }
  12169. break
  12170. case '<':
  12171. case '<=':
  12172. /* Ignore maximum versions */
  12173. break
  12174. /* istanbul ignore next */
  12175. default:
  12176. throw new Error('Unexpected operation: ' + comparator.operator)
  12177. }
  12178. })
  12179. }
  12180. if (minver && range.test(minver)) {
  12181. return minver
  12182. }
  12183. return null
  12184. }
  12185. exports.validRange = validRange
  12186. function validRange (range, options) {
  12187. try {
  12188. // Return '*' instead of '' so that truthiness works.
  12189. // This will throw if it's invalid anyway
  12190. return new Range(range, options).range || '*'
  12191. } catch (er) {
  12192. return null
  12193. }
  12194. }
  12195. // Determine if version is less than all the versions possible in the range
  12196. exports.ltr = ltr
  12197. function ltr (version, range, options) {
  12198. return outside(version, range, '<', options)
  12199. }
  12200. // Determine if version is greater than all the versions possible in the range.
  12201. exports.gtr = gtr
  12202. function gtr (version, range, options) {
  12203. return outside(version, range, '>', options)
  12204. }
  12205. exports.outside = outside
  12206. function outside (version, range, hilo, options) {
  12207. version = new SemVer(version, options)
  12208. range = new Range(range, options)
  12209. var gtfn, ltefn, ltfn, comp, ecomp
  12210. switch (hilo) {
  12211. case '>':
  12212. gtfn = gt
  12213. ltefn = lte
  12214. ltfn = lt
  12215. comp = '>'
  12216. ecomp = '>='
  12217. break
  12218. case '<':
  12219. gtfn = lt
  12220. ltefn = gte
  12221. ltfn = gt
  12222. comp = '<'
  12223. ecomp = '<='
  12224. break
  12225. default:
  12226. throw new TypeError('Must provide a hilo val of "<" or ">"')
  12227. }
  12228. // If it satisifes the range it is not outside
  12229. if (satisfies(version, range, options)) {
  12230. return false
  12231. }
  12232. // From now on, variable terms are as if we're in "gtr" mode.
  12233. // but note that everything is flipped for the "ltr" function.
  12234. for (var i = 0; i < range.set.length; ++i) {
  12235. var comparators = range.set[i]
  12236. var high = null
  12237. var low = null
  12238. comparators.forEach(function (comparator) {
  12239. if (comparator.semver === ANY) {
  12240. comparator = new Comparator('>=0.0.0')
  12241. }
  12242. high = high || comparator
  12243. low = low || comparator
  12244. if (gtfn(comparator.semver, high.semver, options)) {
  12245. high = comparator
  12246. } else if (ltfn(comparator.semver, low.semver, options)) {
  12247. low = comparator
  12248. }
  12249. })
  12250. // If the edge version comparator has a operator then our version
  12251. // isn't outside it
  12252. if (high.operator === comp || high.operator === ecomp) {
  12253. return false
  12254. }
  12255. // If the lowest version comparator has an operator and our version
  12256. // is less than it then it isn't higher than the range
  12257. if ((!low.operator || low.operator === comp) &&
  12258. ltefn(version, low.semver)) {
  12259. return false
  12260. } else if (low.operator === ecomp && ltfn(version, low.semver)) {
  12261. return false
  12262. }
  12263. }
  12264. return true
  12265. }
  12266. exports.prerelease = prerelease
  12267. function prerelease (version, options) {
  12268. var parsed = parse(version, options)
  12269. return (parsed && parsed.prerelease.length) ? parsed.prerelease : null
  12270. }
  12271. exports.intersects = intersects
  12272. function intersects (r1, r2, options) {
  12273. r1 = new Range(r1, options)
  12274. r2 = new Range(r2, options)
  12275. return r1.intersects(r2)
  12276. }
  12277. exports.coerce = coerce
  12278. function coerce (version, options) {
  12279. if (version instanceof SemVer) {
  12280. return version
  12281. }
  12282. if (typeof version === 'number') {
  12283. version = String(version)
  12284. }
  12285. if (typeof version !== 'string') {
  12286. return null
  12287. }
  12288. options = options || {}
  12289. var match = null
  12290. if (!options.rtl) {
  12291. match = version.match(safeRe[t.COERCE])
  12292. } else {
  12293. // Find the right-most coercible string that does not share
  12294. // a terminus with a more left-ward coercible string.
  12295. // Eg, '1.2.3.4' wants to coerce '2.3.4', not '3.4' or '4'
  12296. //
  12297. // Walk through the string checking with a /g regexp
  12298. // Manually set the index so as to pick up overlapping matches.
  12299. // Stop when we get a match that ends at the string end, since no
  12300. // coercible string can be more right-ward without the same terminus.
  12301. var next
  12302. while ((next = safeRe[t.COERCERTL].exec(version)) &&
  12303. (!match || match.index + match[0].length !== version.length)
  12304. ) {
  12305. if (!match ||
  12306. next.index + next[0].length !== match.index + match[0].length) {
  12307. match = next
  12308. }
  12309. safeRe[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length
  12310. }
  12311. // leave it in a clean state
  12312. safeRe[t.COERCERTL].lastIndex = -1
  12313. }
  12314. if (match === null) {
  12315. return null
  12316. }
  12317. return parse(match[2] +
  12318. '.' + (match[3] || '0') +
  12319. '.' + (match[4] || '0'), options)
  12320. }
  12321. /***/ }),
  12322. /***/ 4294:
  12323. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  12324. module.exports = __nccwpck_require__(4219);
  12325. /***/ }),
  12326. /***/ 4219:
  12327. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  12328. "use strict";
  12329. var net = __nccwpck_require__(1808);
  12330. var tls = __nccwpck_require__(4404);
  12331. var http = __nccwpck_require__(3685);
  12332. var https = __nccwpck_require__(5687);
  12333. var events = __nccwpck_require__(2361);
  12334. var assert = __nccwpck_require__(9491);
  12335. var util = __nccwpck_require__(3837);
  12336. exports.httpOverHttp = httpOverHttp;
  12337. exports.httpsOverHttp = httpsOverHttp;
  12338. exports.httpOverHttps = httpOverHttps;
  12339. exports.httpsOverHttps = httpsOverHttps;
  12340. function httpOverHttp(options) {
  12341. var agent = new TunnelingAgent(options);
  12342. agent.request = http.request;
  12343. return agent;
  12344. }
  12345. function httpsOverHttp(options) {
  12346. var agent = new TunnelingAgent(options);
  12347. agent.request = http.request;
  12348. agent.createSocket = createSecureSocket;
  12349. agent.defaultPort = 443;
  12350. return agent;
  12351. }
  12352. function httpOverHttps(options) {
  12353. var agent = new TunnelingAgent(options);
  12354. agent.request = https.request;
  12355. return agent;
  12356. }
  12357. function httpsOverHttps(options) {
  12358. var agent = new TunnelingAgent(options);
  12359. agent.request = https.request;
  12360. agent.createSocket = createSecureSocket;
  12361. agent.defaultPort = 443;
  12362. return agent;
  12363. }
  12364. function TunnelingAgent(options) {
  12365. var self = this;
  12366. self.options = options || {};
  12367. self.proxyOptions = self.options.proxy || {};
  12368. self.maxSockets = self.options.maxSockets || http.Agent.defaultMaxSockets;
  12369. self.requests = [];
  12370. self.sockets = [];
  12371. self.on('free', function onFree(socket, host, port, localAddress) {
  12372. var options = toOptions(host, port, localAddress);
  12373. for (var i = 0, len = self.requests.length; i < len; ++i) {
  12374. var pending = self.requests[i];
  12375. if (pending.host === options.host && pending.port === options.port) {
  12376. // Detect the request to connect same origin server,
  12377. // reuse the connection.
  12378. self.requests.splice(i, 1);
  12379. pending.request.onSocket(socket);
  12380. return;
  12381. }
  12382. }
  12383. socket.destroy();
  12384. self.removeSocket(socket);
  12385. });
  12386. }
  12387. util.inherits(TunnelingAgent, events.EventEmitter);
  12388. TunnelingAgent.prototype.addRequest = function addRequest(req, host, port, localAddress) {
  12389. var self = this;
  12390. var options = mergeOptions({request: req}, self.options, toOptions(host, port, localAddress));
  12391. if (self.sockets.length >= this.maxSockets) {
  12392. // We are over limit so we'll add it to the queue.
  12393. self.requests.push(options);
  12394. return;
  12395. }
  12396. // If we are under maxSockets create a new one.
  12397. self.createSocket(options, function(socket) {
  12398. socket.on('free', onFree);
  12399. socket.on('close', onCloseOrRemove);
  12400. socket.on('agentRemove', onCloseOrRemove);
  12401. req.onSocket(socket);
  12402. function onFree() {
  12403. self.emit('free', socket, options);
  12404. }
  12405. function onCloseOrRemove(err) {
  12406. self.removeSocket(socket);
  12407. socket.removeListener('free', onFree);
  12408. socket.removeListener('close', onCloseOrRemove);
  12409. socket.removeListener('agentRemove', onCloseOrRemove);
  12410. }
  12411. });
  12412. };
  12413. TunnelingAgent.prototype.createSocket = function createSocket(options, cb) {
  12414. var self = this;
  12415. var placeholder = {};
  12416. self.sockets.push(placeholder);
  12417. var connectOptions = mergeOptions({}, self.proxyOptions, {
  12418. method: 'CONNECT',
  12419. path: options.host + ':' + options.port,
  12420. agent: false,
  12421. headers: {
  12422. host: options.host + ':' + options.port
  12423. }
  12424. });
  12425. if (options.localAddress) {
  12426. connectOptions.localAddress = options.localAddress;
  12427. }
  12428. if (connectOptions.proxyAuth) {
  12429. connectOptions.headers = connectOptions.headers || {};
  12430. connectOptions.headers['Proxy-Authorization'] = 'Basic ' +
  12431. new Buffer(connectOptions.proxyAuth).toString('base64');
  12432. }
  12433. debug('making CONNECT request');
  12434. var connectReq = self.request(connectOptions);
  12435. connectReq.useChunkedEncodingByDefault = false; // for v0.6
  12436. connectReq.once('response', onResponse); // for v0.6
  12437. connectReq.once('upgrade', onUpgrade); // for v0.6
  12438. connectReq.once('connect', onConnect); // for v0.7 or later
  12439. connectReq.once('error', onError);
  12440. connectReq.end();
  12441. function onResponse(res) {
  12442. // Very hacky. This is necessary to avoid http-parser leaks.
  12443. res.upgrade = true;
  12444. }
  12445. function onUpgrade(res, socket, head) {
  12446. // Hacky.
  12447. process.nextTick(function() {
  12448. onConnect(res, socket, head);
  12449. });
  12450. }
  12451. function onConnect(res, socket, head) {
  12452. connectReq.removeAllListeners();
  12453. socket.removeAllListeners();
  12454. if (res.statusCode !== 200) {
  12455. debug('tunneling socket could not be established, statusCode=%d',
  12456. res.statusCode);
  12457. socket.destroy();
  12458. var error = new Error('tunneling socket could not be established, ' +
  12459. 'statusCode=' + res.statusCode);
  12460. error.code = 'ECONNRESET';
  12461. options.request.emit('error', error);
  12462. self.removeSocket(placeholder);
  12463. return;
  12464. }
  12465. if (head.length > 0) {
  12466. debug('got illegal response body from proxy');
  12467. socket.destroy();
  12468. var error = new Error('got illegal response body from proxy');
  12469. error.code = 'ECONNRESET';
  12470. options.request.emit('error', error);
  12471. self.removeSocket(placeholder);
  12472. return;
  12473. }
  12474. debug('tunneling connection has established');
  12475. self.sockets[self.sockets.indexOf(placeholder)] = socket;
  12476. return cb(socket);
  12477. }
  12478. function onError(cause) {
  12479. connectReq.removeAllListeners();
  12480. debug('tunneling socket could not be established, cause=%s\n',
  12481. cause.message, cause.stack);
  12482. var error = new Error('tunneling socket could not be established, ' +
  12483. 'cause=' + cause.message);
  12484. error.code = 'ECONNRESET';
  12485. options.request.emit('error', error);
  12486. self.removeSocket(placeholder);
  12487. }
  12488. };
  12489. TunnelingAgent.prototype.removeSocket = function removeSocket(socket) {
  12490. var pos = this.sockets.indexOf(socket)
  12491. if (pos === -1) {
  12492. return;
  12493. }
  12494. this.sockets.splice(pos, 1);
  12495. var pending = this.requests.shift();
  12496. if (pending) {
  12497. // If we have pending requests and a socket gets closed a new one
  12498. // needs to be created to take over in the pool for the one that closed.
  12499. this.createSocket(pending, function(socket) {
  12500. pending.request.onSocket(socket);
  12501. });
  12502. }
  12503. };
  12504. function createSecureSocket(options, cb) {
  12505. var self = this;
  12506. TunnelingAgent.prototype.createSocket.call(self, options, function(socket) {
  12507. var hostHeader = options.request.getHeader('host');
  12508. var tlsOptions = mergeOptions({}, self.options, {
  12509. socket: socket,
  12510. servername: hostHeader ? hostHeader.replace(/:.*$/, '') : options.host
  12511. });
  12512. // 0 is dummy port for v0.6
  12513. var secureSocket = tls.connect(0, tlsOptions);
  12514. self.sockets[self.sockets.indexOf(socket)] = secureSocket;
  12515. cb(secureSocket);
  12516. });
  12517. }
  12518. function toOptions(host, port, localAddress) {
  12519. if (typeof host === 'string') { // since v0.10
  12520. return {
  12521. host: host,
  12522. port: port,
  12523. localAddress: localAddress
  12524. };
  12525. }
  12526. return host; // for v0.11 or later
  12527. }
  12528. function mergeOptions(target) {
  12529. for (var i = 1, len = arguments.length; i < len; ++i) {
  12530. var overrides = arguments[i];
  12531. if (typeof overrides === 'object') {
  12532. var keys = Object.keys(overrides);
  12533. for (var j = 0, keyLen = keys.length; j < keyLen; ++j) {
  12534. var k = keys[j];
  12535. if (overrides[k] !== undefined) {
  12536. target[k] = overrides[k];
  12537. }
  12538. }
  12539. }
  12540. }
  12541. return target;
  12542. }
  12543. var debug;
  12544. if (process.env.NODE_DEBUG && /\btunnel\b/.test(process.env.NODE_DEBUG)) {
  12545. debug = function() {
  12546. var args = Array.prototype.slice.call(arguments);
  12547. if (typeof args[0] === 'string') {
  12548. args[0] = 'TUNNEL: ' + args[0];
  12549. } else {
  12550. args.unshift('TUNNEL:');
  12551. }
  12552. console.error.apply(console, args);
  12553. }
  12554. } else {
  12555. debug = function() {};
  12556. }
  12557. exports.debug = debug; // for test
  12558. /***/ }),
  12559. /***/ 1773:
  12560. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  12561. "use strict";
  12562. const Client = __nccwpck_require__(3598)
  12563. const Dispatcher = __nccwpck_require__(412)
  12564. const errors = __nccwpck_require__(8045)
  12565. const Pool = __nccwpck_require__(4634)
  12566. const BalancedPool = __nccwpck_require__(7931)
  12567. const Agent = __nccwpck_require__(7890)
  12568. const util = __nccwpck_require__(3983)
  12569. const { InvalidArgumentError } = errors
  12570. const api = __nccwpck_require__(4059)
  12571. const buildConnector = __nccwpck_require__(2067)
  12572. const MockClient = __nccwpck_require__(8687)
  12573. const MockAgent = __nccwpck_require__(6771)
  12574. const MockPool = __nccwpck_require__(6193)
  12575. const mockErrors = __nccwpck_require__(888)
  12576. const ProxyAgent = __nccwpck_require__(7858)
  12577. const RetryHandler = __nccwpck_require__(2286)
  12578. const { getGlobalDispatcher, setGlobalDispatcher } = __nccwpck_require__(1892)
  12579. const DecoratorHandler = __nccwpck_require__(6930)
  12580. const RedirectHandler = __nccwpck_require__(2860)
  12581. const createRedirectInterceptor = __nccwpck_require__(8861)
  12582. let hasCrypto
  12583. try {
  12584. __nccwpck_require__(6113)
  12585. hasCrypto = true
  12586. } catch {
  12587. hasCrypto = false
  12588. }
  12589. Object.assign(Dispatcher.prototype, api)
  12590. module.exports.Dispatcher = Dispatcher
  12591. module.exports.Client = Client
  12592. module.exports.Pool = Pool
  12593. module.exports.BalancedPool = BalancedPool
  12594. module.exports.Agent = Agent
  12595. module.exports.ProxyAgent = ProxyAgent
  12596. module.exports.RetryHandler = RetryHandler
  12597. module.exports.DecoratorHandler = DecoratorHandler
  12598. module.exports.RedirectHandler = RedirectHandler
  12599. module.exports.createRedirectInterceptor = createRedirectInterceptor
  12600. module.exports.buildConnector = buildConnector
  12601. module.exports.errors = errors
  12602. function makeDispatcher (fn) {
  12603. return (url, opts, handler) => {
  12604. if (typeof opts === 'function') {
  12605. handler = opts
  12606. opts = null
  12607. }
  12608. if (!url || (typeof url !== 'string' && typeof url !== 'object' && !(url instanceof URL))) {
  12609. throw new InvalidArgumentError('invalid url')
  12610. }
  12611. if (opts != null && typeof opts !== 'object') {
  12612. throw new InvalidArgumentError('invalid opts')
  12613. }
  12614. if (opts && opts.path != null) {
  12615. if (typeof opts.path !== 'string') {
  12616. throw new InvalidArgumentError('invalid opts.path')
  12617. }
  12618. let path = opts.path
  12619. if (!opts.path.startsWith('/')) {
  12620. path = `/${path}`
  12621. }
  12622. url = new URL(util.parseOrigin(url).origin + path)
  12623. } else {
  12624. if (!opts) {
  12625. opts = typeof url === 'object' ? url : {}
  12626. }
  12627. url = util.parseURL(url)
  12628. }
  12629. const { agent, dispatcher = getGlobalDispatcher() } = opts
  12630. if (agent) {
  12631. throw new InvalidArgumentError('unsupported opts.agent. Did you mean opts.client?')
  12632. }
  12633. return fn.call(dispatcher, {
  12634. ...opts,
  12635. origin: url.origin,
  12636. path: url.search ? `${url.pathname}${url.search}` : url.pathname,
  12637. method: opts.method || (opts.body ? 'PUT' : 'GET')
  12638. }, handler)
  12639. }
  12640. }
  12641. module.exports.setGlobalDispatcher = setGlobalDispatcher
  12642. module.exports.getGlobalDispatcher = getGlobalDispatcher
  12643. if (util.nodeMajor > 16 || (util.nodeMajor === 16 && util.nodeMinor >= 8)) {
  12644. let fetchImpl = null
  12645. module.exports.fetch = async function fetch (resource) {
  12646. if (!fetchImpl) {
  12647. fetchImpl = (__nccwpck_require__(4881).fetch)
  12648. }
  12649. try {
  12650. return await fetchImpl(...arguments)
  12651. } catch (err) {
  12652. if (typeof err === 'object') {
  12653. Error.captureStackTrace(err, this)
  12654. }
  12655. throw err
  12656. }
  12657. }
  12658. module.exports.Headers = __nccwpck_require__(554).Headers
  12659. module.exports.Response = __nccwpck_require__(7823).Response
  12660. module.exports.Request = __nccwpck_require__(8359).Request
  12661. module.exports.FormData = __nccwpck_require__(2015).FormData
  12662. module.exports.File = __nccwpck_require__(8511).File
  12663. module.exports.FileReader = __nccwpck_require__(1446).FileReader
  12664. const { setGlobalOrigin, getGlobalOrigin } = __nccwpck_require__(1246)
  12665. module.exports.setGlobalOrigin = setGlobalOrigin
  12666. module.exports.getGlobalOrigin = getGlobalOrigin
  12667. const { CacheStorage } = __nccwpck_require__(7907)
  12668. const { kConstruct } = __nccwpck_require__(9174)
  12669. // Cache & CacheStorage are tightly coupled with fetch. Even if it may run
  12670. // in an older version of Node, it doesn't have any use without fetch.
  12671. module.exports.caches = new CacheStorage(kConstruct)
  12672. }
  12673. if (util.nodeMajor >= 16) {
  12674. const { deleteCookie, getCookies, getSetCookies, setCookie } = __nccwpck_require__(1724)
  12675. module.exports.deleteCookie = deleteCookie
  12676. module.exports.getCookies = getCookies
  12677. module.exports.getSetCookies = getSetCookies
  12678. module.exports.setCookie = setCookie
  12679. const { parseMIMEType, serializeAMimeType } = __nccwpck_require__(685)
  12680. module.exports.parseMIMEType = parseMIMEType
  12681. module.exports.serializeAMimeType = serializeAMimeType
  12682. }
  12683. if (util.nodeMajor >= 18 && hasCrypto) {
  12684. const { WebSocket } = __nccwpck_require__(4284)
  12685. module.exports.WebSocket = WebSocket
  12686. }
  12687. module.exports.request = makeDispatcher(api.request)
  12688. module.exports.stream = makeDispatcher(api.stream)
  12689. module.exports.pipeline = makeDispatcher(api.pipeline)
  12690. module.exports.connect = makeDispatcher(api.connect)
  12691. module.exports.upgrade = makeDispatcher(api.upgrade)
  12692. module.exports.MockClient = MockClient
  12693. module.exports.MockPool = MockPool
  12694. module.exports.MockAgent = MockAgent
  12695. module.exports.mockErrors = mockErrors
  12696. /***/ }),
  12697. /***/ 7890:
  12698. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  12699. "use strict";
  12700. const { InvalidArgumentError } = __nccwpck_require__(8045)
  12701. const { kClients, kRunning, kClose, kDestroy, kDispatch, kInterceptors } = __nccwpck_require__(2785)
  12702. const DispatcherBase = __nccwpck_require__(4839)
  12703. const Pool = __nccwpck_require__(4634)
  12704. const Client = __nccwpck_require__(3598)
  12705. const util = __nccwpck_require__(3983)
  12706. const createRedirectInterceptor = __nccwpck_require__(8861)
  12707. const { WeakRef, FinalizationRegistry } = __nccwpck_require__(6436)()
  12708. const kOnConnect = Symbol('onConnect')
  12709. const kOnDisconnect = Symbol('onDisconnect')
  12710. const kOnConnectionError = Symbol('onConnectionError')
  12711. const kMaxRedirections = Symbol('maxRedirections')
  12712. const kOnDrain = Symbol('onDrain')
  12713. const kFactory = Symbol('factory')
  12714. const kFinalizer = Symbol('finalizer')
  12715. const kOptions = Symbol('options')
  12716. function defaultFactory (origin, opts) {
  12717. return opts && opts.connections === 1
  12718. ? new Client(origin, opts)
  12719. : new Pool(origin, opts)
  12720. }
  12721. class Agent extends DispatcherBase {
  12722. constructor ({ factory = defaultFactory, maxRedirections = 0, connect, ...options } = {}) {
  12723. super()
  12724. if (typeof factory !== 'function') {
  12725. throw new InvalidArgumentError('factory must be a function.')
  12726. }
  12727. if (connect != null && typeof connect !== 'function' && typeof connect !== 'object') {
  12728. throw new InvalidArgumentError('connect must be a function or an object')
  12729. }
  12730. if (!Number.isInteger(maxRedirections) || maxRedirections < 0) {
  12731. throw new InvalidArgumentError('maxRedirections must be a positive number')
  12732. }
  12733. if (connect && typeof connect !== 'function') {
  12734. connect = { ...connect }
  12735. }
  12736. this[kInterceptors] = options.interceptors && options.interceptors.Agent && Array.isArray(options.interceptors.Agent)
  12737. ? options.interceptors.Agent
  12738. : [createRedirectInterceptor({ maxRedirections })]
  12739. this[kOptions] = { ...util.deepClone(options), connect }
  12740. this[kOptions].interceptors = options.interceptors
  12741. ? { ...options.interceptors }
  12742. : undefined
  12743. this[kMaxRedirections] = maxRedirections
  12744. this[kFactory] = factory
  12745. this[kClients] = new Map()
  12746. this[kFinalizer] = new FinalizationRegistry(/* istanbul ignore next: gc is undeterministic */ key => {
  12747. const ref = this[kClients].get(key)
  12748. if (ref !== undefined && ref.deref() === undefined) {
  12749. this[kClients].delete(key)
  12750. }
  12751. })
  12752. const agent = this
  12753. this[kOnDrain] = (origin, targets) => {
  12754. agent.emit('drain', origin, [agent, ...targets])
  12755. }
  12756. this[kOnConnect] = (origin, targets) => {
  12757. agent.emit('connect', origin, [agent, ...targets])
  12758. }
  12759. this[kOnDisconnect] = (origin, targets, err) => {
  12760. agent.emit('disconnect', origin, [agent, ...targets], err)
  12761. }
  12762. this[kOnConnectionError] = (origin, targets, err) => {
  12763. agent.emit('connectionError', origin, [agent, ...targets], err)
  12764. }
  12765. }
  12766. get [kRunning] () {
  12767. let ret = 0
  12768. for (const ref of this[kClients].values()) {
  12769. const client = ref.deref()
  12770. /* istanbul ignore next: gc is undeterministic */
  12771. if (client) {
  12772. ret += client[kRunning]
  12773. }
  12774. }
  12775. return ret
  12776. }
  12777. [kDispatch] (opts, handler) {
  12778. let key
  12779. if (opts.origin && (typeof opts.origin === 'string' || opts.origin instanceof URL)) {
  12780. key = String(opts.origin)
  12781. } else {
  12782. throw new InvalidArgumentError('opts.origin must be a non-empty string or URL.')
  12783. }
  12784. const ref = this[kClients].get(key)
  12785. let dispatcher = ref ? ref.deref() : null
  12786. if (!dispatcher) {
  12787. dispatcher = this[kFactory](opts.origin, this[kOptions])
  12788. .on('drain', this[kOnDrain])
  12789. .on('connect', this[kOnConnect])
  12790. .on('disconnect', this[kOnDisconnect])
  12791. .on('connectionError', this[kOnConnectionError])
  12792. this[kClients].set(key, new WeakRef(dispatcher))
  12793. this[kFinalizer].register(dispatcher, key)
  12794. }
  12795. return dispatcher.dispatch(opts, handler)
  12796. }
  12797. async [kClose] () {
  12798. const closePromises = []
  12799. for (const ref of this[kClients].values()) {
  12800. const client = ref.deref()
  12801. /* istanbul ignore else: gc is undeterministic */
  12802. if (client) {
  12803. closePromises.push(client.close())
  12804. }
  12805. }
  12806. await Promise.all(closePromises)
  12807. }
  12808. async [kDestroy] (err) {
  12809. const destroyPromises = []
  12810. for (const ref of this[kClients].values()) {
  12811. const client = ref.deref()
  12812. /* istanbul ignore else: gc is undeterministic */
  12813. if (client) {
  12814. destroyPromises.push(client.destroy(err))
  12815. }
  12816. }
  12817. await Promise.all(destroyPromises)
  12818. }
  12819. }
  12820. module.exports = Agent
  12821. /***/ }),
  12822. /***/ 7032:
  12823. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  12824. const { addAbortListener } = __nccwpck_require__(3983)
  12825. const { RequestAbortedError } = __nccwpck_require__(8045)
  12826. const kListener = Symbol('kListener')
  12827. const kSignal = Symbol('kSignal')
  12828. function abort (self) {
  12829. if (self.abort) {
  12830. self.abort()
  12831. } else {
  12832. self.onError(new RequestAbortedError())
  12833. }
  12834. }
  12835. function addSignal (self, signal) {
  12836. self[kSignal] = null
  12837. self[kListener] = null
  12838. if (!signal) {
  12839. return
  12840. }
  12841. if (signal.aborted) {
  12842. abort(self)
  12843. return
  12844. }
  12845. self[kSignal] = signal
  12846. self[kListener] = () => {
  12847. abort(self)
  12848. }
  12849. addAbortListener(self[kSignal], self[kListener])
  12850. }
  12851. function removeSignal (self) {
  12852. if (!self[kSignal]) {
  12853. return
  12854. }
  12855. if ('removeEventListener' in self[kSignal]) {
  12856. self[kSignal].removeEventListener('abort', self[kListener])
  12857. } else {
  12858. self[kSignal].removeListener('abort', self[kListener])
  12859. }
  12860. self[kSignal] = null
  12861. self[kListener] = null
  12862. }
  12863. module.exports = {
  12864. addSignal,
  12865. removeSignal
  12866. }
  12867. /***/ }),
  12868. /***/ 9744:
  12869. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  12870. "use strict";
  12871. const { AsyncResource } = __nccwpck_require__(852)
  12872. const { InvalidArgumentError, RequestAbortedError, SocketError } = __nccwpck_require__(8045)
  12873. const util = __nccwpck_require__(3983)
  12874. const { addSignal, removeSignal } = __nccwpck_require__(7032)
  12875. class ConnectHandler extends AsyncResource {
  12876. constructor (opts, callback) {
  12877. if (!opts || typeof opts !== 'object') {
  12878. throw new InvalidArgumentError('invalid opts')
  12879. }
  12880. if (typeof callback !== 'function') {
  12881. throw new InvalidArgumentError('invalid callback')
  12882. }
  12883. const { signal, opaque, responseHeaders } = opts
  12884. if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') {
  12885. throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget')
  12886. }
  12887. super('UNDICI_CONNECT')
  12888. this.opaque = opaque || null
  12889. this.responseHeaders = responseHeaders || null
  12890. this.callback = callback
  12891. this.abort = null
  12892. addSignal(this, signal)
  12893. }
  12894. onConnect (abort, context) {
  12895. if (!this.callback) {
  12896. throw new RequestAbortedError()
  12897. }
  12898. this.abort = abort
  12899. this.context = context
  12900. }
  12901. onHeaders () {
  12902. throw new SocketError('bad connect', null)
  12903. }
  12904. onUpgrade (statusCode, rawHeaders, socket) {
  12905. const { callback, opaque, context } = this
  12906. removeSignal(this)
  12907. this.callback = null
  12908. let headers = rawHeaders
  12909. // Indicates is an HTTP2Session
  12910. if (headers != null) {
  12911. headers = this.responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)
  12912. }
  12913. this.runInAsyncScope(callback, null, null, {
  12914. statusCode,
  12915. headers,
  12916. socket,
  12917. opaque,
  12918. context
  12919. })
  12920. }
  12921. onError (err) {
  12922. const { callback, opaque } = this
  12923. removeSignal(this)
  12924. if (callback) {
  12925. this.callback = null
  12926. queueMicrotask(() => {
  12927. this.runInAsyncScope(callback, null, err, { opaque })
  12928. })
  12929. }
  12930. }
  12931. }
  12932. function connect (opts, callback) {
  12933. if (callback === undefined) {
  12934. return new Promise((resolve, reject) => {
  12935. connect.call(this, opts, (err, data) => {
  12936. return err ? reject(err) : resolve(data)
  12937. })
  12938. })
  12939. }
  12940. try {
  12941. const connectHandler = new ConnectHandler(opts, callback)
  12942. this.dispatch({ ...opts, method: 'CONNECT' }, connectHandler)
  12943. } catch (err) {
  12944. if (typeof callback !== 'function') {
  12945. throw err
  12946. }
  12947. const opaque = opts && opts.opaque
  12948. queueMicrotask(() => callback(err, { opaque }))
  12949. }
  12950. }
  12951. module.exports = connect
  12952. /***/ }),
  12953. /***/ 8752:
  12954. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  12955. "use strict";
  12956. const {
  12957. Readable,
  12958. Duplex,
  12959. PassThrough
  12960. } = __nccwpck_require__(2781)
  12961. const {
  12962. InvalidArgumentError,
  12963. InvalidReturnValueError,
  12964. RequestAbortedError
  12965. } = __nccwpck_require__(8045)
  12966. const util = __nccwpck_require__(3983)
  12967. const { AsyncResource } = __nccwpck_require__(852)
  12968. const { addSignal, removeSignal } = __nccwpck_require__(7032)
  12969. const assert = __nccwpck_require__(9491)
  12970. const kResume = Symbol('resume')
  12971. class PipelineRequest extends Readable {
  12972. constructor () {
  12973. super({ autoDestroy: true })
  12974. this[kResume] = null
  12975. }
  12976. _read () {
  12977. const { [kResume]: resume } = this
  12978. if (resume) {
  12979. this[kResume] = null
  12980. resume()
  12981. }
  12982. }
  12983. _destroy (err, callback) {
  12984. this._read()
  12985. callback(err)
  12986. }
  12987. }
  12988. class PipelineResponse extends Readable {
  12989. constructor (resume) {
  12990. super({ autoDestroy: true })
  12991. this[kResume] = resume
  12992. }
  12993. _read () {
  12994. this[kResume]()
  12995. }
  12996. _destroy (err, callback) {
  12997. if (!err && !this._readableState.endEmitted) {
  12998. err = new RequestAbortedError()
  12999. }
  13000. callback(err)
  13001. }
  13002. }
  13003. class PipelineHandler extends AsyncResource {
  13004. constructor (opts, handler) {
  13005. if (!opts || typeof opts !== 'object') {
  13006. throw new InvalidArgumentError('invalid opts')
  13007. }
  13008. if (typeof handler !== 'function') {
  13009. throw new InvalidArgumentError('invalid handler')
  13010. }
  13011. const { signal, method, opaque, onInfo, responseHeaders } = opts
  13012. if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') {
  13013. throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget')
  13014. }
  13015. if (method === 'CONNECT') {
  13016. throw new InvalidArgumentError('invalid method')
  13017. }
  13018. if (onInfo && typeof onInfo !== 'function') {
  13019. throw new InvalidArgumentError('invalid onInfo callback')
  13020. }
  13021. super('UNDICI_PIPELINE')
  13022. this.opaque = opaque || null
  13023. this.responseHeaders = responseHeaders || null
  13024. this.handler = handler
  13025. this.abort = null
  13026. this.context = null
  13027. this.onInfo = onInfo || null
  13028. this.req = new PipelineRequest().on('error', util.nop)
  13029. this.ret = new Duplex({
  13030. readableObjectMode: opts.objectMode,
  13031. autoDestroy: true,
  13032. read: () => {
  13033. const { body } = this
  13034. if (body && body.resume) {
  13035. body.resume()
  13036. }
  13037. },
  13038. write: (chunk, encoding, callback) => {
  13039. const { req } = this
  13040. if (req.push(chunk, encoding) || req._readableState.destroyed) {
  13041. callback()
  13042. } else {
  13043. req[kResume] = callback
  13044. }
  13045. },
  13046. destroy: (err, callback) => {
  13047. const { body, req, res, ret, abort } = this
  13048. if (!err && !ret._readableState.endEmitted) {
  13049. err = new RequestAbortedError()
  13050. }
  13051. if (abort && err) {
  13052. abort()
  13053. }
  13054. util.destroy(body, err)
  13055. util.destroy(req, err)
  13056. util.destroy(res, err)
  13057. removeSignal(this)
  13058. callback(err)
  13059. }
  13060. }).on('prefinish', () => {
  13061. const { req } = this
  13062. // Node < 15 does not call _final in same tick.
  13063. req.push(null)
  13064. })
  13065. this.res = null
  13066. addSignal(this, signal)
  13067. }
  13068. onConnect (abort, context) {
  13069. const { ret, res } = this
  13070. assert(!res, 'pipeline cannot be retried')
  13071. if (ret.destroyed) {
  13072. throw new RequestAbortedError()
  13073. }
  13074. this.abort = abort
  13075. this.context = context
  13076. }
  13077. onHeaders (statusCode, rawHeaders, resume) {
  13078. const { opaque, handler, context } = this
  13079. if (statusCode < 200) {
  13080. if (this.onInfo) {
  13081. const headers = this.responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)
  13082. this.onInfo({ statusCode, headers })
  13083. }
  13084. return
  13085. }
  13086. this.res = new PipelineResponse(resume)
  13087. let body
  13088. try {
  13089. this.handler = null
  13090. const headers = this.responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)
  13091. body = this.runInAsyncScope(handler, null, {
  13092. statusCode,
  13093. headers,
  13094. opaque,
  13095. body: this.res,
  13096. context
  13097. })
  13098. } catch (err) {
  13099. this.res.on('error', util.nop)
  13100. throw err
  13101. }
  13102. if (!body || typeof body.on !== 'function') {
  13103. throw new InvalidReturnValueError('expected Readable')
  13104. }
  13105. body
  13106. .on('data', (chunk) => {
  13107. const { ret, body } = this
  13108. if (!ret.push(chunk) && body.pause) {
  13109. body.pause()
  13110. }
  13111. })
  13112. .on('error', (err) => {
  13113. const { ret } = this
  13114. util.destroy(ret, err)
  13115. })
  13116. .on('end', () => {
  13117. const { ret } = this
  13118. ret.push(null)
  13119. })
  13120. .on('close', () => {
  13121. const { ret } = this
  13122. if (!ret._readableState.ended) {
  13123. util.destroy(ret, new RequestAbortedError())
  13124. }
  13125. })
  13126. this.body = body
  13127. }
  13128. onData (chunk) {
  13129. const { res } = this
  13130. return res.push(chunk)
  13131. }
  13132. onComplete (trailers) {
  13133. const { res } = this
  13134. res.push(null)
  13135. }
  13136. onError (err) {
  13137. const { ret } = this
  13138. this.handler = null
  13139. util.destroy(ret, err)
  13140. }
  13141. }
  13142. function pipeline (opts, handler) {
  13143. try {
  13144. const pipelineHandler = new PipelineHandler(opts, handler)
  13145. this.dispatch({ ...opts, body: pipelineHandler.req }, pipelineHandler)
  13146. return pipelineHandler.ret
  13147. } catch (err) {
  13148. return new PassThrough().destroy(err)
  13149. }
  13150. }
  13151. module.exports = pipeline
  13152. /***/ }),
  13153. /***/ 5448:
  13154. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  13155. "use strict";
  13156. const Readable = __nccwpck_require__(3858)
  13157. const {
  13158. InvalidArgumentError,
  13159. RequestAbortedError
  13160. } = __nccwpck_require__(8045)
  13161. const util = __nccwpck_require__(3983)
  13162. const { getResolveErrorBodyCallback } = __nccwpck_require__(7474)
  13163. const { AsyncResource } = __nccwpck_require__(852)
  13164. const { addSignal, removeSignal } = __nccwpck_require__(7032)
  13165. class RequestHandler extends AsyncResource {
  13166. constructor (opts, callback) {
  13167. if (!opts || typeof opts !== 'object') {
  13168. throw new InvalidArgumentError('invalid opts')
  13169. }
  13170. const { signal, method, opaque, body, onInfo, responseHeaders, throwOnError, highWaterMark } = opts
  13171. try {
  13172. if (typeof callback !== 'function') {
  13173. throw new InvalidArgumentError('invalid callback')
  13174. }
  13175. if (highWaterMark && (typeof highWaterMark !== 'number' || highWaterMark < 0)) {
  13176. throw new InvalidArgumentError('invalid highWaterMark')
  13177. }
  13178. if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') {
  13179. throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget')
  13180. }
  13181. if (method === 'CONNECT') {
  13182. throw new InvalidArgumentError('invalid method')
  13183. }
  13184. if (onInfo && typeof onInfo !== 'function') {
  13185. throw new InvalidArgumentError('invalid onInfo callback')
  13186. }
  13187. super('UNDICI_REQUEST')
  13188. } catch (err) {
  13189. if (util.isStream(body)) {
  13190. util.destroy(body.on('error', util.nop), err)
  13191. }
  13192. throw err
  13193. }
  13194. this.responseHeaders = responseHeaders || null
  13195. this.opaque = opaque || null
  13196. this.callback = callback
  13197. this.res = null
  13198. this.abort = null
  13199. this.body = body
  13200. this.trailers = {}
  13201. this.context = null
  13202. this.onInfo = onInfo || null
  13203. this.throwOnError = throwOnError
  13204. this.highWaterMark = highWaterMark
  13205. if (util.isStream(body)) {
  13206. body.on('error', (err) => {
  13207. this.onError(err)
  13208. })
  13209. }
  13210. addSignal(this, signal)
  13211. }
  13212. onConnect (abort, context) {
  13213. if (!this.callback) {
  13214. throw new RequestAbortedError()
  13215. }
  13216. this.abort = abort
  13217. this.context = context
  13218. }
  13219. onHeaders (statusCode, rawHeaders, resume, statusMessage) {
  13220. const { callback, opaque, abort, context, responseHeaders, highWaterMark } = this
  13221. const headers = responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)
  13222. if (statusCode < 200) {
  13223. if (this.onInfo) {
  13224. this.onInfo({ statusCode, headers })
  13225. }
  13226. return
  13227. }
  13228. const parsedHeaders = responseHeaders === 'raw' ? util.parseHeaders(rawHeaders) : headers
  13229. const contentType = parsedHeaders['content-type']
  13230. const body = new Readable({ resume, abort, contentType, highWaterMark })
  13231. this.callback = null
  13232. this.res = body
  13233. if (callback !== null) {
  13234. if (this.throwOnError && statusCode >= 400) {
  13235. this.runInAsyncScope(getResolveErrorBodyCallback, null,
  13236. { callback, body, contentType, statusCode, statusMessage, headers }
  13237. )
  13238. } else {
  13239. this.runInAsyncScope(callback, null, null, {
  13240. statusCode,
  13241. headers,
  13242. trailers: this.trailers,
  13243. opaque,
  13244. body,
  13245. context
  13246. })
  13247. }
  13248. }
  13249. }
  13250. onData (chunk) {
  13251. const { res } = this
  13252. return res.push(chunk)
  13253. }
  13254. onComplete (trailers) {
  13255. const { res } = this
  13256. removeSignal(this)
  13257. util.parseHeaders(trailers, this.trailers)
  13258. res.push(null)
  13259. }
  13260. onError (err) {
  13261. const { res, callback, body, opaque } = this
  13262. removeSignal(this)
  13263. if (callback) {
  13264. // TODO: Does this need queueMicrotask?
  13265. this.callback = null
  13266. queueMicrotask(() => {
  13267. this.runInAsyncScope(callback, null, err, { opaque })
  13268. })
  13269. }
  13270. if (res) {
  13271. this.res = null
  13272. // Ensure all queued handlers are invoked before destroying res.
  13273. queueMicrotask(() => {
  13274. util.destroy(res, err)
  13275. })
  13276. }
  13277. if (body) {
  13278. this.body = null
  13279. util.destroy(body, err)
  13280. }
  13281. }
  13282. }
  13283. function request (opts, callback) {
  13284. if (callback === undefined) {
  13285. return new Promise((resolve, reject) => {
  13286. request.call(this, opts, (err, data) => {
  13287. return err ? reject(err) : resolve(data)
  13288. })
  13289. })
  13290. }
  13291. try {
  13292. this.dispatch(opts, new RequestHandler(opts, callback))
  13293. } catch (err) {
  13294. if (typeof callback !== 'function') {
  13295. throw err
  13296. }
  13297. const opaque = opts && opts.opaque
  13298. queueMicrotask(() => callback(err, { opaque }))
  13299. }
  13300. }
  13301. module.exports = request
  13302. module.exports.RequestHandler = RequestHandler
  13303. /***/ }),
  13304. /***/ 5395:
  13305. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  13306. "use strict";
  13307. const { finished, PassThrough } = __nccwpck_require__(2781)
  13308. const {
  13309. InvalidArgumentError,
  13310. InvalidReturnValueError,
  13311. RequestAbortedError
  13312. } = __nccwpck_require__(8045)
  13313. const util = __nccwpck_require__(3983)
  13314. const { getResolveErrorBodyCallback } = __nccwpck_require__(7474)
  13315. const { AsyncResource } = __nccwpck_require__(852)
  13316. const { addSignal, removeSignal } = __nccwpck_require__(7032)
  13317. class StreamHandler extends AsyncResource {
  13318. constructor (opts, factory, callback) {
  13319. if (!opts || typeof opts !== 'object') {
  13320. throw new InvalidArgumentError('invalid opts')
  13321. }
  13322. const { signal, method, opaque, body, onInfo, responseHeaders, throwOnError } = opts
  13323. try {
  13324. if (typeof callback !== 'function') {
  13325. throw new InvalidArgumentError('invalid callback')
  13326. }
  13327. if (typeof factory !== 'function') {
  13328. throw new InvalidArgumentError('invalid factory')
  13329. }
  13330. if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') {
  13331. throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget')
  13332. }
  13333. if (method === 'CONNECT') {
  13334. throw new InvalidArgumentError('invalid method')
  13335. }
  13336. if (onInfo && typeof onInfo !== 'function') {
  13337. throw new InvalidArgumentError('invalid onInfo callback')
  13338. }
  13339. super('UNDICI_STREAM')
  13340. } catch (err) {
  13341. if (util.isStream(body)) {
  13342. util.destroy(body.on('error', util.nop), err)
  13343. }
  13344. throw err
  13345. }
  13346. this.responseHeaders = responseHeaders || null
  13347. this.opaque = opaque || null
  13348. this.factory = factory
  13349. this.callback = callback
  13350. this.res = null
  13351. this.abort = null
  13352. this.context = null
  13353. this.trailers = null
  13354. this.body = body
  13355. this.onInfo = onInfo || null
  13356. this.throwOnError = throwOnError || false
  13357. if (util.isStream(body)) {
  13358. body.on('error', (err) => {
  13359. this.onError(err)
  13360. })
  13361. }
  13362. addSignal(this, signal)
  13363. }
  13364. onConnect (abort, context) {
  13365. if (!this.callback) {
  13366. throw new RequestAbortedError()
  13367. }
  13368. this.abort = abort
  13369. this.context = context
  13370. }
  13371. onHeaders (statusCode, rawHeaders, resume, statusMessage) {
  13372. const { factory, opaque, context, callback, responseHeaders } = this
  13373. const headers = responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)
  13374. if (statusCode < 200) {
  13375. if (this.onInfo) {
  13376. this.onInfo({ statusCode, headers })
  13377. }
  13378. return
  13379. }
  13380. this.factory = null
  13381. let res
  13382. if (this.throwOnError && statusCode >= 400) {
  13383. const parsedHeaders = responseHeaders === 'raw' ? util.parseHeaders(rawHeaders) : headers
  13384. const contentType = parsedHeaders['content-type']
  13385. res = new PassThrough()
  13386. this.callback = null
  13387. this.runInAsyncScope(getResolveErrorBodyCallback, null,
  13388. { callback, body: res, contentType, statusCode, statusMessage, headers }
  13389. )
  13390. } else {
  13391. if (factory === null) {
  13392. return
  13393. }
  13394. res = this.runInAsyncScope(factory, null, {
  13395. statusCode,
  13396. headers,
  13397. opaque,
  13398. context
  13399. })
  13400. if (
  13401. !res ||
  13402. typeof res.write !== 'function' ||
  13403. typeof res.end !== 'function' ||
  13404. typeof res.on !== 'function'
  13405. ) {
  13406. throw new InvalidReturnValueError('expected Writable')
  13407. }
  13408. // TODO: Avoid finished. It registers an unnecessary amount of listeners.
  13409. finished(res, { readable: false }, (err) => {
  13410. const { callback, res, opaque, trailers, abort } = this
  13411. this.res = null
  13412. if (err || !res.readable) {
  13413. util.destroy(res, err)
  13414. }
  13415. this.callback = null
  13416. this.runInAsyncScope(callback, null, err || null, { opaque, trailers })
  13417. if (err) {
  13418. abort()
  13419. }
  13420. })
  13421. }
  13422. res.on('drain', resume)
  13423. this.res = res
  13424. const needDrain = res.writableNeedDrain !== undefined
  13425. ? res.writableNeedDrain
  13426. : res._writableState && res._writableState.needDrain
  13427. return needDrain !== true
  13428. }
  13429. onData (chunk) {
  13430. const { res } = this
  13431. return res ? res.write(chunk) : true
  13432. }
  13433. onComplete (trailers) {
  13434. const { res } = this
  13435. removeSignal(this)
  13436. if (!res) {
  13437. return
  13438. }
  13439. this.trailers = util.parseHeaders(trailers)
  13440. res.end()
  13441. }
  13442. onError (err) {
  13443. const { res, callback, opaque, body } = this
  13444. removeSignal(this)
  13445. this.factory = null
  13446. if (res) {
  13447. this.res = null
  13448. util.destroy(res, err)
  13449. } else if (callback) {
  13450. this.callback = null
  13451. queueMicrotask(() => {
  13452. this.runInAsyncScope(callback, null, err, { opaque })
  13453. })
  13454. }
  13455. if (body) {
  13456. this.body = null
  13457. util.destroy(body, err)
  13458. }
  13459. }
  13460. }
  13461. function stream (opts, factory, callback) {
  13462. if (callback === undefined) {
  13463. return new Promise((resolve, reject) => {
  13464. stream.call(this, opts, factory, (err, data) => {
  13465. return err ? reject(err) : resolve(data)
  13466. })
  13467. })
  13468. }
  13469. try {
  13470. this.dispatch(opts, new StreamHandler(opts, factory, callback))
  13471. } catch (err) {
  13472. if (typeof callback !== 'function') {
  13473. throw err
  13474. }
  13475. const opaque = opts && opts.opaque
  13476. queueMicrotask(() => callback(err, { opaque }))
  13477. }
  13478. }
  13479. module.exports = stream
  13480. /***/ }),
  13481. /***/ 6923:
  13482. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  13483. "use strict";
  13484. const { InvalidArgumentError, RequestAbortedError, SocketError } = __nccwpck_require__(8045)
  13485. const { AsyncResource } = __nccwpck_require__(852)
  13486. const util = __nccwpck_require__(3983)
  13487. const { addSignal, removeSignal } = __nccwpck_require__(7032)
  13488. const assert = __nccwpck_require__(9491)
  13489. class UpgradeHandler extends AsyncResource {
  13490. constructor (opts, callback) {
  13491. if (!opts || typeof opts !== 'object') {
  13492. throw new InvalidArgumentError('invalid opts')
  13493. }
  13494. if (typeof callback !== 'function') {
  13495. throw new InvalidArgumentError('invalid callback')
  13496. }
  13497. const { signal, opaque, responseHeaders } = opts
  13498. if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') {
  13499. throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget')
  13500. }
  13501. super('UNDICI_UPGRADE')
  13502. this.responseHeaders = responseHeaders || null
  13503. this.opaque = opaque || null
  13504. this.callback = callback
  13505. this.abort = null
  13506. this.context = null
  13507. addSignal(this, signal)
  13508. }
  13509. onConnect (abort, context) {
  13510. if (!this.callback) {
  13511. throw new RequestAbortedError()
  13512. }
  13513. this.abort = abort
  13514. this.context = null
  13515. }
  13516. onHeaders () {
  13517. throw new SocketError('bad upgrade', null)
  13518. }
  13519. onUpgrade (statusCode, rawHeaders, socket) {
  13520. const { callback, opaque, context } = this
  13521. assert.strictEqual(statusCode, 101)
  13522. removeSignal(this)
  13523. this.callback = null
  13524. const headers = this.responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)
  13525. this.runInAsyncScope(callback, null, null, {
  13526. headers,
  13527. socket,
  13528. opaque,
  13529. context
  13530. })
  13531. }
  13532. onError (err) {
  13533. const { callback, opaque } = this
  13534. removeSignal(this)
  13535. if (callback) {
  13536. this.callback = null
  13537. queueMicrotask(() => {
  13538. this.runInAsyncScope(callback, null, err, { opaque })
  13539. })
  13540. }
  13541. }
  13542. }
  13543. function upgrade (opts, callback) {
  13544. if (callback === undefined) {
  13545. return new Promise((resolve, reject) => {
  13546. upgrade.call(this, opts, (err, data) => {
  13547. return err ? reject(err) : resolve(data)
  13548. })
  13549. })
  13550. }
  13551. try {
  13552. const upgradeHandler = new UpgradeHandler(opts, callback)
  13553. this.dispatch({
  13554. ...opts,
  13555. method: opts.method || 'GET',
  13556. upgrade: opts.protocol || 'Websocket'
  13557. }, upgradeHandler)
  13558. } catch (err) {
  13559. if (typeof callback !== 'function') {
  13560. throw err
  13561. }
  13562. const opaque = opts && opts.opaque
  13563. queueMicrotask(() => callback(err, { opaque }))
  13564. }
  13565. }
  13566. module.exports = upgrade
  13567. /***/ }),
  13568. /***/ 4059:
  13569. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  13570. "use strict";
  13571. module.exports.request = __nccwpck_require__(5448)
  13572. module.exports.stream = __nccwpck_require__(5395)
  13573. module.exports.pipeline = __nccwpck_require__(8752)
  13574. module.exports.upgrade = __nccwpck_require__(6923)
  13575. module.exports.connect = __nccwpck_require__(9744)
  13576. /***/ }),
  13577. /***/ 3858:
  13578. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  13579. "use strict";
  13580. // Ported from https://github.com/nodejs/undici/pull/907
  13581. const assert = __nccwpck_require__(9491)
  13582. const { Readable } = __nccwpck_require__(2781)
  13583. const { RequestAbortedError, NotSupportedError, InvalidArgumentError } = __nccwpck_require__(8045)
  13584. const util = __nccwpck_require__(3983)
  13585. const { ReadableStreamFrom, toUSVString } = __nccwpck_require__(3983)
  13586. let Blob
  13587. const kConsume = Symbol('kConsume')
  13588. const kReading = Symbol('kReading')
  13589. const kBody = Symbol('kBody')
  13590. const kAbort = Symbol('abort')
  13591. const kContentType = Symbol('kContentType')
  13592. const noop = () => {}
  13593. module.exports = class BodyReadable extends Readable {
  13594. constructor ({
  13595. resume,
  13596. abort,
  13597. contentType = '',
  13598. highWaterMark = 64 * 1024 // Same as nodejs fs streams.
  13599. }) {
  13600. super({
  13601. autoDestroy: true,
  13602. read: resume,
  13603. highWaterMark
  13604. })
  13605. this._readableState.dataEmitted = false
  13606. this[kAbort] = abort
  13607. this[kConsume] = null
  13608. this[kBody] = null
  13609. this[kContentType] = contentType
  13610. // Is stream being consumed through Readable API?
  13611. // This is an optimization so that we avoid checking
  13612. // for 'data' and 'readable' listeners in the hot path
  13613. // inside push().
  13614. this[kReading] = false
  13615. }
  13616. destroy (err) {
  13617. if (this.destroyed) {
  13618. // Node < 16
  13619. return this
  13620. }
  13621. if (!err && !this._readableState.endEmitted) {
  13622. err = new RequestAbortedError()
  13623. }
  13624. if (err) {
  13625. this[kAbort]()
  13626. }
  13627. return super.destroy(err)
  13628. }
  13629. emit (ev, ...args) {
  13630. if (ev === 'data') {
  13631. // Node < 16.7
  13632. this._readableState.dataEmitted = true
  13633. } else if (ev === 'error') {
  13634. // Node < 16
  13635. this._readableState.errorEmitted = true
  13636. }
  13637. return super.emit(ev, ...args)
  13638. }
  13639. on (ev, ...args) {
  13640. if (ev === 'data' || ev === 'readable') {
  13641. this[kReading] = true
  13642. }
  13643. return super.on(ev, ...args)
  13644. }
  13645. addListener (ev, ...args) {
  13646. return this.on(ev, ...args)
  13647. }
  13648. off (ev, ...args) {
  13649. const ret = super.off(ev, ...args)
  13650. if (ev === 'data' || ev === 'readable') {
  13651. this[kReading] = (
  13652. this.listenerCount('data') > 0 ||
  13653. this.listenerCount('readable') > 0
  13654. )
  13655. }
  13656. return ret
  13657. }
  13658. removeListener (ev, ...args) {
  13659. return this.off(ev, ...args)
  13660. }
  13661. push (chunk) {
  13662. if (this[kConsume] && chunk !== null && this.readableLength === 0) {
  13663. consumePush(this[kConsume], chunk)
  13664. return this[kReading] ? super.push(chunk) : true
  13665. }
  13666. return super.push(chunk)
  13667. }
  13668. // https://fetch.spec.whatwg.org/#dom-body-text
  13669. async text () {
  13670. return consume(this, 'text')
  13671. }
  13672. // https://fetch.spec.whatwg.org/#dom-body-json
  13673. async json () {
  13674. return consume(this, 'json')
  13675. }
  13676. // https://fetch.spec.whatwg.org/#dom-body-blob
  13677. async blob () {
  13678. return consume(this, 'blob')
  13679. }
  13680. // https://fetch.spec.whatwg.org/#dom-body-arraybuffer
  13681. async arrayBuffer () {
  13682. return consume(this, 'arrayBuffer')
  13683. }
  13684. // https://fetch.spec.whatwg.org/#dom-body-formdata
  13685. async formData () {
  13686. // TODO: Implement.
  13687. throw new NotSupportedError()
  13688. }
  13689. // https://fetch.spec.whatwg.org/#dom-body-bodyused
  13690. get bodyUsed () {
  13691. return util.isDisturbed(this)
  13692. }
  13693. // https://fetch.spec.whatwg.org/#dom-body-body
  13694. get body () {
  13695. if (!this[kBody]) {
  13696. this[kBody] = ReadableStreamFrom(this)
  13697. if (this[kConsume]) {
  13698. // TODO: Is this the best way to force a lock?
  13699. this[kBody].getReader() // Ensure stream is locked.
  13700. assert(this[kBody].locked)
  13701. }
  13702. }
  13703. return this[kBody]
  13704. }
  13705. dump (opts) {
  13706. let limit = opts && Number.isFinite(opts.limit) ? opts.limit : 262144
  13707. const signal = opts && opts.signal
  13708. if (signal) {
  13709. try {
  13710. if (typeof signal !== 'object' || !('aborted' in signal)) {
  13711. throw new InvalidArgumentError('signal must be an AbortSignal')
  13712. }
  13713. util.throwIfAborted(signal)
  13714. } catch (err) {
  13715. return Promise.reject(err)
  13716. }
  13717. }
  13718. if (this.closed) {
  13719. return Promise.resolve(null)
  13720. }
  13721. return new Promise((resolve, reject) => {
  13722. const signalListenerCleanup = signal
  13723. ? util.addAbortListener(signal, () => {
  13724. this.destroy()
  13725. })
  13726. : noop
  13727. this
  13728. .on('close', function () {
  13729. signalListenerCleanup()
  13730. if (signal && signal.aborted) {
  13731. reject(signal.reason || Object.assign(new Error('The operation was aborted'), { name: 'AbortError' }))
  13732. } else {
  13733. resolve(null)
  13734. }
  13735. })
  13736. .on('error', noop)
  13737. .on('data', function (chunk) {
  13738. limit -= chunk.length
  13739. if (limit <= 0) {
  13740. this.destroy()
  13741. }
  13742. })
  13743. .resume()
  13744. })
  13745. }
  13746. }
  13747. // https://streams.spec.whatwg.org/#readablestream-locked
  13748. function isLocked (self) {
  13749. // Consume is an implicit lock.
  13750. return (self[kBody] && self[kBody].locked === true) || self[kConsume]
  13751. }
  13752. // https://fetch.spec.whatwg.org/#body-unusable
  13753. function isUnusable (self) {
  13754. return util.isDisturbed(self) || isLocked(self)
  13755. }
  13756. async function consume (stream, type) {
  13757. if (isUnusable(stream)) {
  13758. throw new TypeError('unusable')
  13759. }
  13760. assert(!stream[kConsume])
  13761. return new Promise((resolve, reject) => {
  13762. stream[kConsume] = {
  13763. type,
  13764. stream,
  13765. resolve,
  13766. reject,
  13767. length: 0,
  13768. body: []
  13769. }
  13770. stream
  13771. .on('error', function (err) {
  13772. consumeFinish(this[kConsume], err)
  13773. })
  13774. .on('close', function () {
  13775. if (this[kConsume].body !== null) {
  13776. consumeFinish(this[kConsume], new RequestAbortedError())
  13777. }
  13778. })
  13779. process.nextTick(consumeStart, stream[kConsume])
  13780. })
  13781. }
  13782. function consumeStart (consume) {
  13783. if (consume.body === null) {
  13784. return
  13785. }
  13786. const { _readableState: state } = consume.stream
  13787. for (const chunk of state.buffer) {
  13788. consumePush(consume, chunk)
  13789. }
  13790. if (state.endEmitted) {
  13791. consumeEnd(this[kConsume])
  13792. } else {
  13793. consume.stream.on('end', function () {
  13794. consumeEnd(this[kConsume])
  13795. })
  13796. }
  13797. consume.stream.resume()
  13798. while (consume.stream.read() != null) {
  13799. // Loop
  13800. }
  13801. }
  13802. function consumeEnd (consume) {
  13803. const { type, body, resolve, stream, length } = consume
  13804. try {
  13805. if (type === 'text') {
  13806. resolve(toUSVString(Buffer.concat(body)))
  13807. } else if (type === 'json') {
  13808. resolve(JSON.parse(Buffer.concat(body)))
  13809. } else if (type === 'arrayBuffer') {
  13810. const dst = new Uint8Array(length)
  13811. let pos = 0
  13812. for (const buf of body) {
  13813. dst.set(buf, pos)
  13814. pos += buf.byteLength
  13815. }
  13816. resolve(dst.buffer)
  13817. } else if (type === 'blob') {
  13818. if (!Blob) {
  13819. Blob = (__nccwpck_require__(4300).Blob)
  13820. }
  13821. resolve(new Blob(body, { type: stream[kContentType] }))
  13822. }
  13823. consumeFinish(consume)
  13824. } catch (err) {
  13825. stream.destroy(err)
  13826. }
  13827. }
  13828. function consumePush (consume, chunk) {
  13829. consume.length += chunk.length
  13830. consume.body.push(chunk)
  13831. }
  13832. function consumeFinish (consume, err) {
  13833. if (consume.body === null) {
  13834. return
  13835. }
  13836. if (err) {
  13837. consume.reject(err)
  13838. } else {
  13839. consume.resolve()
  13840. }
  13841. consume.type = null
  13842. consume.stream = null
  13843. consume.resolve = null
  13844. consume.reject = null
  13845. consume.length = 0
  13846. consume.body = null
  13847. }
  13848. /***/ }),
  13849. /***/ 7474:
  13850. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  13851. const assert = __nccwpck_require__(9491)
  13852. const {
  13853. ResponseStatusCodeError
  13854. } = __nccwpck_require__(8045)
  13855. const { toUSVString } = __nccwpck_require__(3983)
  13856. async function getResolveErrorBodyCallback ({ callback, body, contentType, statusCode, statusMessage, headers }) {
  13857. assert(body)
  13858. let chunks = []
  13859. let limit = 0
  13860. for await (const chunk of body) {
  13861. chunks.push(chunk)
  13862. limit += chunk.length
  13863. if (limit > 128 * 1024) {
  13864. chunks = null
  13865. break
  13866. }
  13867. }
  13868. if (statusCode === 204 || !contentType || !chunks) {
  13869. process.nextTick(callback, new ResponseStatusCodeError(`Response status code ${statusCode}${statusMessage ? `: ${statusMessage}` : ''}`, statusCode, headers))
  13870. return
  13871. }
  13872. try {
  13873. if (contentType.startsWith('application/json')) {
  13874. const payload = JSON.parse(toUSVString(Buffer.concat(chunks)))
  13875. process.nextTick(callback, new ResponseStatusCodeError(`Response status code ${statusCode}${statusMessage ? `: ${statusMessage}` : ''}`, statusCode, headers, payload))
  13876. return
  13877. }
  13878. if (contentType.startsWith('text/')) {
  13879. const payload = toUSVString(Buffer.concat(chunks))
  13880. process.nextTick(callback, new ResponseStatusCodeError(`Response status code ${statusCode}${statusMessage ? `: ${statusMessage}` : ''}`, statusCode, headers, payload))
  13881. return
  13882. }
  13883. } catch (err) {
  13884. // Process in a fallback if error
  13885. }
  13886. process.nextTick(callback, new ResponseStatusCodeError(`Response status code ${statusCode}${statusMessage ? `: ${statusMessage}` : ''}`, statusCode, headers))
  13887. }
  13888. module.exports = { getResolveErrorBodyCallback }
  13889. /***/ }),
  13890. /***/ 7931:
  13891. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  13892. "use strict";
  13893. const {
  13894. BalancedPoolMissingUpstreamError,
  13895. InvalidArgumentError
  13896. } = __nccwpck_require__(8045)
  13897. const {
  13898. PoolBase,
  13899. kClients,
  13900. kNeedDrain,
  13901. kAddClient,
  13902. kRemoveClient,
  13903. kGetDispatcher
  13904. } = __nccwpck_require__(3198)
  13905. const Pool = __nccwpck_require__(4634)
  13906. const { kUrl, kInterceptors } = __nccwpck_require__(2785)
  13907. const { parseOrigin } = __nccwpck_require__(3983)
  13908. const kFactory = Symbol('factory')
  13909. const kOptions = Symbol('options')
  13910. const kGreatestCommonDivisor = Symbol('kGreatestCommonDivisor')
  13911. const kCurrentWeight = Symbol('kCurrentWeight')
  13912. const kIndex = Symbol('kIndex')
  13913. const kWeight = Symbol('kWeight')
  13914. const kMaxWeightPerServer = Symbol('kMaxWeightPerServer')
  13915. const kErrorPenalty = Symbol('kErrorPenalty')
  13916. function getGreatestCommonDivisor (a, b) {
  13917. if (b === 0) return a
  13918. return getGreatestCommonDivisor(b, a % b)
  13919. }
  13920. function defaultFactory (origin, opts) {
  13921. return new Pool(origin, opts)
  13922. }
  13923. class BalancedPool extends PoolBase {
  13924. constructor (upstreams = [], { factory = defaultFactory, ...opts } = {}) {
  13925. super()
  13926. this[kOptions] = opts
  13927. this[kIndex] = -1
  13928. this[kCurrentWeight] = 0
  13929. this[kMaxWeightPerServer] = this[kOptions].maxWeightPerServer || 100
  13930. this[kErrorPenalty] = this[kOptions].errorPenalty || 15
  13931. if (!Array.isArray(upstreams)) {
  13932. upstreams = [upstreams]
  13933. }
  13934. if (typeof factory !== 'function') {
  13935. throw new InvalidArgumentError('factory must be a function.')
  13936. }
  13937. this[kInterceptors] = opts.interceptors && opts.interceptors.BalancedPool && Array.isArray(opts.interceptors.BalancedPool)
  13938. ? opts.interceptors.BalancedPool
  13939. : []
  13940. this[kFactory] = factory
  13941. for (const upstream of upstreams) {
  13942. this.addUpstream(upstream)
  13943. }
  13944. this._updateBalancedPoolStats()
  13945. }
  13946. addUpstream (upstream) {
  13947. const upstreamOrigin = parseOrigin(upstream).origin
  13948. if (this[kClients].find((pool) => (
  13949. pool[kUrl].origin === upstreamOrigin &&
  13950. pool.closed !== true &&
  13951. pool.destroyed !== true
  13952. ))) {
  13953. return this
  13954. }
  13955. const pool = this[kFactory](upstreamOrigin, Object.assign({}, this[kOptions]))
  13956. this[kAddClient](pool)
  13957. pool.on('connect', () => {
  13958. pool[kWeight] = Math.min(this[kMaxWeightPerServer], pool[kWeight] + this[kErrorPenalty])
  13959. })
  13960. pool.on('connectionError', () => {
  13961. pool[kWeight] = Math.max(1, pool[kWeight] - this[kErrorPenalty])
  13962. this._updateBalancedPoolStats()
  13963. })
  13964. pool.on('disconnect', (...args) => {
  13965. const err = args[2]
  13966. if (err && err.code === 'UND_ERR_SOCKET') {
  13967. // decrease the weight of the pool.
  13968. pool[kWeight] = Math.max(1, pool[kWeight] - this[kErrorPenalty])
  13969. this._updateBalancedPoolStats()
  13970. }
  13971. })
  13972. for (const client of this[kClients]) {
  13973. client[kWeight] = this[kMaxWeightPerServer]
  13974. }
  13975. this._updateBalancedPoolStats()
  13976. return this
  13977. }
  13978. _updateBalancedPoolStats () {
  13979. this[kGreatestCommonDivisor] = this[kClients].map(p => p[kWeight]).reduce(getGreatestCommonDivisor, 0)
  13980. }
  13981. removeUpstream (upstream) {
  13982. const upstreamOrigin = parseOrigin(upstream).origin
  13983. const pool = this[kClients].find((pool) => (
  13984. pool[kUrl].origin === upstreamOrigin &&
  13985. pool.closed !== true &&
  13986. pool.destroyed !== true
  13987. ))
  13988. if (pool) {
  13989. this[kRemoveClient](pool)
  13990. }
  13991. return this
  13992. }
  13993. get upstreams () {
  13994. return this[kClients]
  13995. .filter(dispatcher => dispatcher.closed !== true && dispatcher.destroyed !== true)
  13996. .map((p) => p[kUrl].origin)
  13997. }
  13998. [kGetDispatcher] () {
  13999. // We validate that pools is greater than 0,
  14000. // otherwise we would have to wait until an upstream
  14001. // is added, which might never happen.
  14002. if (this[kClients].length === 0) {
  14003. throw new BalancedPoolMissingUpstreamError()
  14004. }
  14005. const dispatcher = this[kClients].find(dispatcher => (
  14006. !dispatcher[kNeedDrain] &&
  14007. dispatcher.closed !== true &&
  14008. dispatcher.destroyed !== true
  14009. ))
  14010. if (!dispatcher) {
  14011. return
  14012. }
  14013. const allClientsBusy = this[kClients].map(pool => pool[kNeedDrain]).reduce((a, b) => a && b, true)
  14014. if (allClientsBusy) {
  14015. return
  14016. }
  14017. let counter = 0
  14018. let maxWeightIndex = this[kClients].findIndex(pool => !pool[kNeedDrain])
  14019. while (counter++ < this[kClients].length) {
  14020. this[kIndex] = (this[kIndex] + 1) % this[kClients].length
  14021. const pool = this[kClients][this[kIndex]]
  14022. // find pool index with the largest weight
  14023. if (pool[kWeight] > this[kClients][maxWeightIndex][kWeight] && !pool[kNeedDrain]) {
  14024. maxWeightIndex = this[kIndex]
  14025. }
  14026. // decrease the current weight every `this[kClients].length`.
  14027. if (this[kIndex] === 0) {
  14028. // Set the current weight to the next lower weight.
  14029. this[kCurrentWeight] = this[kCurrentWeight] - this[kGreatestCommonDivisor]
  14030. if (this[kCurrentWeight] <= 0) {
  14031. this[kCurrentWeight] = this[kMaxWeightPerServer]
  14032. }
  14033. }
  14034. if (pool[kWeight] >= this[kCurrentWeight] && (!pool[kNeedDrain])) {
  14035. return pool
  14036. }
  14037. }
  14038. this[kCurrentWeight] = this[kClients][maxWeightIndex][kWeight]
  14039. this[kIndex] = maxWeightIndex
  14040. return this[kClients][maxWeightIndex]
  14041. }
  14042. }
  14043. module.exports = BalancedPool
  14044. /***/ }),
  14045. /***/ 6101:
  14046. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  14047. "use strict";
  14048. const { kConstruct } = __nccwpck_require__(9174)
  14049. const { urlEquals, fieldValues: getFieldValues } = __nccwpck_require__(2396)
  14050. const { kEnumerableProperty, isDisturbed } = __nccwpck_require__(3983)
  14051. const { kHeadersList } = __nccwpck_require__(2785)
  14052. const { webidl } = __nccwpck_require__(1744)
  14053. const { Response, cloneResponse } = __nccwpck_require__(7823)
  14054. const { Request } = __nccwpck_require__(8359)
  14055. const { kState, kHeaders, kGuard, kRealm } = __nccwpck_require__(5861)
  14056. const { fetching } = __nccwpck_require__(4881)
  14057. const { urlIsHttpHttpsScheme, createDeferredPromise, readAllBytes } = __nccwpck_require__(2538)
  14058. const assert = __nccwpck_require__(9491)
  14059. const { getGlobalDispatcher } = __nccwpck_require__(1892)
  14060. /**
  14061. * @see https://w3c.github.io/ServiceWorker/#dfn-cache-batch-operation
  14062. * @typedef {Object} CacheBatchOperation
  14063. * @property {'delete' | 'put'} type
  14064. * @property {any} request
  14065. * @property {any} response
  14066. * @property {import('../../types/cache').CacheQueryOptions} options
  14067. */
  14068. /**
  14069. * @see https://w3c.github.io/ServiceWorker/#dfn-request-response-list
  14070. * @typedef {[any, any][]} requestResponseList
  14071. */
  14072. class Cache {
  14073. /**
  14074. * @see https://w3c.github.io/ServiceWorker/#dfn-relevant-request-response-list
  14075. * @type {requestResponseList}
  14076. */
  14077. #relevantRequestResponseList
  14078. constructor () {
  14079. if (arguments[0] !== kConstruct) {
  14080. webidl.illegalConstructor()
  14081. }
  14082. this.#relevantRequestResponseList = arguments[1]
  14083. }
  14084. async match (request, options = {}) {
  14085. webidl.brandCheck(this, Cache)
  14086. webidl.argumentLengthCheck(arguments, 1, { header: 'Cache.match' })
  14087. request = webidl.converters.RequestInfo(request)
  14088. options = webidl.converters.CacheQueryOptions(options)
  14089. const p = await this.matchAll(request, options)
  14090. if (p.length === 0) {
  14091. return
  14092. }
  14093. return p[0]
  14094. }
  14095. async matchAll (request = undefined, options = {}) {
  14096. webidl.brandCheck(this, Cache)
  14097. if (request !== undefined) request = webidl.converters.RequestInfo(request)
  14098. options = webidl.converters.CacheQueryOptions(options)
  14099. // 1.
  14100. let r = null
  14101. // 2.
  14102. if (request !== undefined) {
  14103. if (request instanceof Request) {
  14104. // 2.1.1
  14105. r = request[kState]
  14106. // 2.1.2
  14107. if (r.method !== 'GET' && !options.ignoreMethod) {
  14108. return []
  14109. }
  14110. } else if (typeof request === 'string') {
  14111. // 2.2.1
  14112. r = new Request(request)[kState]
  14113. }
  14114. }
  14115. // 5.
  14116. // 5.1
  14117. const responses = []
  14118. // 5.2
  14119. if (request === undefined) {
  14120. // 5.2.1
  14121. for (const requestResponse of this.#relevantRequestResponseList) {
  14122. responses.push(requestResponse[1])
  14123. }
  14124. } else { // 5.3
  14125. // 5.3.1
  14126. const requestResponses = this.#queryCache(r, options)
  14127. // 5.3.2
  14128. for (const requestResponse of requestResponses) {
  14129. responses.push(requestResponse[1])
  14130. }
  14131. }
  14132. // 5.4
  14133. // We don't implement CORs so we don't need to loop over the responses, yay!
  14134. // 5.5.1
  14135. const responseList = []
  14136. // 5.5.2
  14137. for (const response of responses) {
  14138. // 5.5.2.1
  14139. const responseObject = new Response(response.body?.source ?? null)
  14140. const body = responseObject[kState].body
  14141. responseObject[kState] = response
  14142. responseObject[kState].body = body
  14143. responseObject[kHeaders][kHeadersList] = response.headersList
  14144. responseObject[kHeaders][kGuard] = 'immutable'
  14145. responseList.push(responseObject)
  14146. }
  14147. // 6.
  14148. return Object.freeze(responseList)
  14149. }
  14150. async add (request) {
  14151. webidl.brandCheck(this, Cache)
  14152. webidl.argumentLengthCheck(arguments, 1, { header: 'Cache.add' })
  14153. request = webidl.converters.RequestInfo(request)
  14154. // 1.
  14155. const requests = [request]
  14156. // 2.
  14157. const responseArrayPromise = this.addAll(requests)
  14158. // 3.
  14159. return await responseArrayPromise
  14160. }
  14161. async addAll (requests) {
  14162. webidl.brandCheck(this, Cache)
  14163. webidl.argumentLengthCheck(arguments, 1, { header: 'Cache.addAll' })
  14164. requests = webidl.converters['sequence<RequestInfo>'](requests)
  14165. // 1.
  14166. const responsePromises = []
  14167. // 2.
  14168. const requestList = []
  14169. // 3.
  14170. for (const request of requests) {
  14171. if (typeof request === 'string') {
  14172. continue
  14173. }
  14174. // 3.1
  14175. const r = request[kState]
  14176. // 3.2
  14177. if (!urlIsHttpHttpsScheme(r.url) || r.method !== 'GET') {
  14178. throw webidl.errors.exception({
  14179. header: 'Cache.addAll',
  14180. message: 'Expected http/s scheme when method is not GET.'
  14181. })
  14182. }
  14183. }
  14184. // 4.
  14185. /** @type {ReturnType<typeof fetching>[]} */
  14186. const fetchControllers = []
  14187. // 5.
  14188. for (const request of requests) {
  14189. // 5.1
  14190. const r = new Request(request)[kState]
  14191. // 5.2
  14192. if (!urlIsHttpHttpsScheme(r.url)) {
  14193. throw webidl.errors.exception({
  14194. header: 'Cache.addAll',
  14195. message: 'Expected http/s scheme.'
  14196. })
  14197. }
  14198. // 5.4
  14199. r.initiator = 'fetch'
  14200. r.destination = 'subresource'
  14201. // 5.5
  14202. requestList.push(r)
  14203. // 5.6
  14204. const responsePromise = createDeferredPromise()
  14205. // 5.7
  14206. fetchControllers.push(fetching({
  14207. request: r,
  14208. dispatcher: getGlobalDispatcher(),
  14209. processResponse (response) {
  14210. // 1.
  14211. if (response.type === 'error' || response.status === 206 || response.status < 200 || response.status > 299) {
  14212. responsePromise.reject(webidl.errors.exception({
  14213. header: 'Cache.addAll',
  14214. message: 'Received an invalid status code or the request failed.'
  14215. }))
  14216. } else if (response.headersList.contains('vary')) { // 2.
  14217. // 2.1
  14218. const fieldValues = getFieldValues(response.headersList.get('vary'))
  14219. // 2.2
  14220. for (const fieldValue of fieldValues) {
  14221. // 2.2.1
  14222. if (fieldValue === '*') {
  14223. responsePromise.reject(webidl.errors.exception({
  14224. header: 'Cache.addAll',
  14225. message: 'invalid vary field value'
  14226. }))
  14227. for (const controller of fetchControllers) {
  14228. controller.abort()
  14229. }
  14230. return
  14231. }
  14232. }
  14233. }
  14234. },
  14235. processResponseEndOfBody (response) {
  14236. // 1.
  14237. if (response.aborted) {
  14238. responsePromise.reject(new DOMException('aborted', 'AbortError'))
  14239. return
  14240. }
  14241. // 2.
  14242. responsePromise.resolve(response)
  14243. }
  14244. }))
  14245. // 5.8
  14246. responsePromises.push(responsePromise.promise)
  14247. }
  14248. // 6.
  14249. const p = Promise.all(responsePromises)
  14250. // 7.
  14251. const responses = await p
  14252. // 7.1
  14253. const operations = []
  14254. // 7.2
  14255. let index = 0
  14256. // 7.3
  14257. for (const response of responses) {
  14258. // 7.3.1
  14259. /** @type {CacheBatchOperation} */
  14260. const operation = {
  14261. type: 'put', // 7.3.2
  14262. request: requestList[index], // 7.3.3
  14263. response // 7.3.4
  14264. }
  14265. operations.push(operation) // 7.3.5
  14266. index++ // 7.3.6
  14267. }
  14268. // 7.5
  14269. const cacheJobPromise = createDeferredPromise()
  14270. // 7.6.1
  14271. let errorData = null
  14272. // 7.6.2
  14273. try {
  14274. this.#batchCacheOperations(operations)
  14275. } catch (e) {
  14276. errorData = e
  14277. }
  14278. // 7.6.3
  14279. queueMicrotask(() => {
  14280. // 7.6.3.1
  14281. if (errorData === null) {
  14282. cacheJobPromise.resolve(undefined)
  14283. } else {
  14284. // 7.6.3.2
  14285. cacheJobPromise.reject(errorData)
  14286. }
  14287. })
  14288. // 7.7
  14289. return cacheJobPromise.promise
  14290. }
  14291. async put (request, response) {
  14292. webidl.brandCheck(this, Cache)
  14293. webidl.argumentLengthCheck(arguments, 2, { header: 'Cache.put' })
  14294. request = webidl.converters.RequestInfo(request)
  14295. response = webidl.converters.Response(response)
  14296. // 1.
  14297. let innerRequest = null
  14298. // 2.
  14299. if (request instanceof Request) {
  14300. innerRequest = request[kState]
  14301. } else { // 3.
  14302. innerRequest = new Request(request)[kState]
  14303. }
  14304. // 4.
  14305. if (!urlIsHttpHttpsScheme(innerRequest.url) || innerRequest.method !== 'GET') {
  14306. throw webidl.errors.exception({
  14307. header: 'Cache.put',
  14308. message: 'Expected an http/s scheme when method is not GET'
  14309. })
  14310. }
  14311. // 5.
  14312. const innerResponse = response[kState]
  14313. // 6.
  14314. if (innerResponse.status === 206) {
  14315. throw webidl.errors.exception({
  14316. header: 'Cache.put',
  14317. message: 'Got 206 status'
  14318. })
  14319. }
  14320. // 7.
  14321. if (innerResponse.headersList.contains('vary')) {
  14322. // 7.1.
  14323. const fieldValues = getFieldValues(innerResponse.headersList.get('vary'))
  14324. // 7.2.
  14325. for (const fieldValue of fieldValues) {
  14326. // 7.2.1
  14327. if (fieldValue === '*') {
  14328. throw webidl.errors.exception({
  14329. header: 'Cache.put',
  14330. message: 'Got * vary field value'
  14331. })
  14332. }
  14333. }
  14334. }
  14335. // 8.
  14336. if (innerResponse.body && (isDisturbed(innerResponse.body.stream) || innerResponse.body.stream.locked)) {
  14337. throw webidl.errors.exception({
  14338. header: 'Cache.put',
  14339. message: 'Response body is locked or disturbed'
  14340. })
  14341. }
  14342. // 9.
  14343. const clonedResponse = cloneResponse(innerResponse)
  14344. // 10.
  14345. const bodyReadPromise = createDeferredPromise()
  14346. // 11.
  14347. if (innerResponse.body != null) {
  14348. // 11.1
  14349. const stream = innerResponse.body.stream
  14350. // 11.2
  14351. const reader = stream.getReader()
  14352. // 11.3
  14353. readAllBytes(reader).then(bodyReadPromise.resolve, bodyReadPromise.reject)
  14354. } else {
  14355. bodyReadPromise.resolve(undefined)
  14356. }
  14357. // 12.
  14358. /** @type {CacheBatchOperation[]} */
  14359. const operations = []
  14360. // 13.
  14361. /** @type {CacheBatchOperation} */
  14362. const operation = {
  14363. type: 'put', // 14.
  14364. request: innerRequest, // 15.
  14365. response: clonedResponse // 16.
  14366. }
  14367. // 17.
  14368. operations.push(operation)
  14369. // 19.
  14370. const bytes = await bodyReadPromise.promise
  14371. if (clonedResponse.body != null) {
  14372. clonedResponse.body.source = bytes
  14373. }
  14374. // 19.1
  14375. const cacheJobPromise = createDeferredPromise()
  14376. // 19.2.1
  14377. let errorData = null
  14378. // 19.2.2
  14379. try {
  14380. this.#batchCacheOperations(operations)
  14381. } catch (e) {
  14382. errorData = e
  14383. }
  14384. // 19.2.3
  14385. queueMicrotask(() => {
  14386. // 19.2.3.1
  14387. if (errorData === null) {
  14388. cacheJobPromise.resolve()
  14389. } else { // 19.2.3.2
  14390. cacheJobPromise.reject(errorData)
  14391. }
  14392. })
  14393. return cacheJobPromise.promise
  14394. }
  14395. async delete (request, options = {}) {
  14396. webidl.brandCheck(this, Cache)
  14397. webidl.argumentLengthCheck(arguments, 1, { header: 'Cache.delete' })
  14398. request = webidl.converters.RequestInfo(request)
  14399. options = webidl.converters.CacheQueryOptions(options)
  14400. /**
  14401. * @type {Request}
  14402. */
  14403. let r = null
  14404. if (request instanceof Request) {
  14405. r = request[kState]
  14406. if (r.method !== 'GET' && !options.ignoreMethod) {
  14407. return false
  14408. }
  14409. } else {
  14410. assert(typeof request === 'string')
  14411. r = new Request(request)[kState]
  14412. }
  14413. /** @type {CacheBatchOperation[]} */
  14414. const operations = []
  14415. /** @type {CacheBatchOperation} */
  14416. const operation = {
  14417. type: 'delete',
  14418. request: r,
  14419. options
  14420. }
  14421. operations.push(operation)
  14422. const cacheJobPromise = createDeferredPromise()
  14423. let errorData = null
  14424. let requestResponses
  14425. try {
  14426. requestResponses = this.#batchCacheOperations(operations)
  14427. } catch (e) {
  14428. errorData = e
  14429. }
  14430. queueMicrotask(() => {
  14431. if (errorData === null) {
  14432. cacheJobPromise.resolve(!!requestResponses?.length)
  14433. } else {
  14434. cacheJobPromise.reject(errorData)
  14435. }
  14436. })
  14437. return cacheJobPromise.promise
  14438. }
  14439. /**
  14440. * @see https://w3c.github.io/ServiceWorker/#dom-cache-keys
  14441. * @param {any} request
  14442. * @param {import('../../types/cache').CacheQueryOptions} options
  14443. * @returns {readonly Request[]}
  14444. */
  14445. async keys (request = undefined, options = {}) {
  14446. webidl.brandCheck(this, Cache)
  14447. if (request !== undefined) request = webidl.converters.RequestInfo(request)
  14448. options = webidl.converters.CacheQueryOptions(options)
  14449. // 1.
  14450. let r = null
  14451. // 2.
  14452. if (request !== undefined) {
  14453. // 2.1
  14454. if (request instanceof Request) {
  14455. // 2.1.1
  14456. r = request[kState]
  14457. // 2.1.2
  14458. if (r.method !== 'GET' && !options.ignoreMethod) {
  14459. return []
  14460. }
  14461. } else if (typeof request === 'string') { // 2.2
  14462. r = new Request(request)[kState]
  14463. }
  14464. }
  14465. // 4.
  14466. const promise = createDeferredPromise()
  14467. // 5.
  14468. // 5.1
  14469. const requests = []
  14470. // 5.2
  14471. if (request === undefined) {
  14472. // 5.2.1
  14473. for (const requestResponse of this.#relevantRequestResponseList) {
  14474. // 5.2.1.1
  14475. requests.push(requestResponse[0])
  14476. }
  14477. } else { // 5.3
  14478. // 5.3.1
  14479. const requestResponses = this.#queryCache(r, options)
  14480. // 5.3.2
  14481. for (const requestResponse of requestResponses) {
  14482. // 5.3.2.1
  14483. requests.push(requestResponse[0])
  14484. }
  14485. }
  14486. // 5.4
  14487. queueMicrotask(() => {
  14488. // 5.4.1
  14489. const requestList = []
  14490. // 5.4.2
  14491. for (const request of requests) {
  14492. const requestObject = new Request('https://a')
  14493. requestObject[kState] = request
  14494. requestObject[kHeaders][kHeadersList] = request.headersList
  14495. requestObject[kHeaders][kGuard] = 'immutable'
  14496. requestObject[kRealm] = request.client
  14497. // 5.4.2.1
  14498. requestList.push(requestObject)
  14499. }
  14500. // 5.4.3
  14501. promise.resolve(Object.freeze(requestList))
  14502. })
  14503. return promise.promise
  14504. }
  14505. /**
  14506. * @see https://w3c.github.io/ServiceWorker/#batch-cache-operations-algorithm
  14507. * @param {CacheBatchOperation[]} operations
  14508. * @returns {requestResponseList}
  14509. */
  14510. #batchCacheOperations (operations) {
  14511. // 1.
  14512. const cache = this.#relevantRequestResponseList
  14513. // 2.
  14514. const backupCache = [...cache]
  14515. // 3.
  14516. const addedItems = []
  14517. // 4.1
  14518. const resultList = []
  14519. try {
  14520. // 4.2
  14521. for (const operation of operations) {
  14522. // 4.2.1
  14523. if (operation.type !== 'delete' && operation.type !== 'put') {
  14524. throw webidl.errors.exception({
  14525. header: 'Cache.#batchCacheOperations',
  14526. message: 'operation type does not match "delete" or "put"'
  14527. })
  14528. }
  14529. // 4.2.2
  14530. if (operation.type === 'delete' && operation.response != null) {
  14531. throw webidl.errors.exception({
  14532. header: 'Cache.#batchCacheOperations',
  14533. message: 'delete operation should not have an associated response'
  14534. })
  14535. }
  14536. // 4.2.3
  14537. if (this.#queryCache(operation.request, operation.options, addedItems).length) {
  14538. throw new DOMException('???', 'InvalidStateError')
  14539. }
  14540. // 4.2.4
  14541. let requestResponses
  14542. // 4.2.5
  14543. if (operation.type === 'delete') {
  14544. // 4.2.5.1
  14545. requestResponses = this.#queryCache(operation.request, operation.options)
  14546. // TODO: the spec is wrong, this is needed to pass WPTs
  14547. if (requestResponses.length === 0) {
  14548. return []
  14549. }
  14550. // 4.2.5.2
  14551. for (const requestResponse of requestResponses) {
  14552. const idx = cache.indexOf(requestResponse)
  14553. assert(idx !== -1)
  14554. // 4.2.5.2.1
  14555. cache.splice(idx, 1)
  14556. }
  14557. } else if (operation.type === 'put') { // 4.2.6
  14558. // 4.2.6.1
  14559. if (operation.response == null) {
  14560. throw webidl.errors.exception({
  14561. header: 'Cache.#batchCacheOperations',
  14562. message: 'put operation should have an associated response'
  14563. })
  14564. }
  14565. // 4.2.6.2
  14566. const r = operation.request
  14567. // 4.2.6.3
  14568. if (!urlIsHttpHttpsScheme(r.url)) {
  14569. throw webidl.errors.exception({
  14570. header: 'Cache.#batchCacheOperations',
  14571. message: 'expected http or https scheme'
  14572. })
  14573. }
  14574. // 4.2.6.4
  14575. if (r.method !== 'GET') {
  14576. throw webidl.errors.exception({
  14577. header: 'Cache.#batchCacheOperations',
  14578. message: 'not get method'
  14579. })
  14580. }
  14581. // 4.2.6.5
  14582. if (operation.options != null) {
  14583. throw webidl.errors.exception({
  14584. header: 'Cache.#batchCacheOperations',
  14585. message: 'options must not be defined'
  14586. })
  14587. }
  14588. // 4.2.6.6
  14589. requestResponses = this.#queryCache(operation.request)
  14590. // 4.2.6.7
  14591. for (const requestResponse of requestResponses) {
  14592. const idx = cache.indexOf(requestResponse)
  14593. assert(idx !== -1)
  14594. // 4.2.6.7.1
  14595. cache.splice(idx, 1)
  14596. }
  14597. // 4.2.6.8
  14598. cache.push([operation.request, operation.response])
  14599. // 4.2.6.10
  14600. addedItems.push([operation.request, operation.response])
  14601. }
  14602. // 4.2.7
  14603. resultList.push([operation.request, operation.response])
  14604. }
  14605. // 4.3
  14606. return resultList
  14607. } catch (e) { // 5.
  14608. // 5.1
  14609. this.#relevantRequestResponseList.length = 0
  14610. // 5.2
  14611. this.#relevantRequestResponseList = backupCache
  14612. // 5.3
  14613. throw e
  14614. }
  14615. }
  14616. /**
  14617. * @see https://w3c.github.io/ServiceWorker/#query-cache
  14618. * @param {any} requestQuery
  14619. * @param {import('../../types/cache').CacheQueryOptions} options
  14620. * @param {requestResponseList} targetStorage
  14621. * @returns {requestResponseList}
  14622. */
  14623. #queryCache (requestQuery, options, targetStorage) {
  14624. /** @type {requestResponseList} */
  14625. const resultList = []
  14626. const storage = targetStorage ?? this.#relevantRequestResponseList
  14627. for (const requestResponse of storage) {
  14628. const [cachedRequest, cachedResponse] = requestResponse
  14629. if (this.#requestMatchesCachedItem(requestQuery, cachedRequest, cachedResponse, options)) {
  14630. resultList.push(requestResponse)
  14631. }
  14632. }
  14633. return resultList
  14634. }
  14635. /**
  14636. * @see https://w3c.github.io/ServiceWorker/#request-matches-cached-item-algorithm
  14637. * @param {any} requestQuery
  14638. * @param {any} request
  14639. * @param {any | null} response
  14640. * @param {import('../../types/cache').CacheQueryOptions | undefined} options
  14641. * @returns {boolean}
  14642. */
  14643. #requestMatchesCachedItem (requestQuery, request, response = null, options) {
  14644. // if (options?.ignoreMethod === false && request.method === 'GET') {
  14645. // return false
  14646. // }
  14647. const queryURL = new URL(requestQuery.url)
  14648. const cachedURL = new URL(request.url)
  14649. if (options?.ignoreSearch) {
  14650. cachedURL.search = ''
  14651. queryURL.search = ''
  14652. }
  14653. if (!urlEquals(queryURL, cachedURL, true)) {
  14654. return false
  14655. }
  14656. if (
  14657. response == null ||
  14658. options?.ignoreVary ||
  14659. !response.headersList.contains('vary')
  14660. ) {
  14661. return true
  14662. }
  14663. const fieldValues = getFieldValues(response.headersList.get('vary'))
  14664. for (const fieldValue of fieldValues) {
  14665. if (fieldValue === '*') {
  14666. return false
  14667. }
  14668. const requestValue = request.headersList.get(fieldValue)
  14669. const queryValue = requestQuery.headersList.get(fieldValue)
  14670. // If one has the header and the other doesn't, or one has
  14671. // a different value than the other, return false
  14672. if (requestValue !== queryValue) {
  14673. return false
  14674. }
  14675. }
  14676. return true
  14677. }
  14678. }
  14679. Object.defineProperties(Cache.prototype, {
  14680. [Symbol.toStringTag]: {
  14681. value: 'Cache',
  14682. configurable: true
  14683. },
  14684. match: kEnumerableProperty,
  14685. matchAll: kEnumerableProperty,
  14686. add: kEnumerableProperty,
  14687. addAll: kEnumerableProperty,
  14688. put: kEnumerableProperty,
  14689. delete: kEnumerableProperty,
  14690. keys: kEnumerableProperty
  14691. })
  14692. const cacheQueryOptionConverters = [
  14693. {
  14694. key: 'ignoreSearch',
  14695. converter: webidl.converters.boolean,
  14696. defaultValue: false
  14697. },
  14698. {
  14699. key: 'ignoreMethod',
  14700. converter: webidl.converters.boolean,
  14701. defaultValue: false
  14702. },
  14703. {
  14704. key: 'ignoreVary',
  14705. converter: webidl.converters.boolean,
  14706. defaultValue: false
  14707. }
  14708. ]
  14709. webidl.converters.CacheQueryOptions = webidl.dictionaryConverter(cacheQueryOptionConverters)
  14710. webidl.converters.MultiCacheQueryOptions = webidl.dictionaryConverter([
  14711. ...cacheQueryOptionConverters,
  14712. {
  14713. key: 'cacheName',
  14714. converter: webidl.converters.DOMString
  14715. }
  14716. ])
  14717. webidl.converters.Response = webidl.interfaceConverter(Response)
  14718. webidl.converters['sequence<RequestInfo>'] = webidl.sequenceConverter(
  14719. webidl.converters.RequestInfo
  14720. )
  14721. module.exports = {
  14722. Cache
  14723. }
  14724. /***/ }),
  14725. /***/ 7907:
  14726. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  14727. "use strict";
  14728. const { kConstruct } = __nccwpck_require__(9174)
  14729. const { Cache } = __nccwpck_require__(6101)
  14730. const { webidl } = __nccwpck_require__(1744)
  14731. const { kEnumerableProperty } = __nccwpck_require__(3983)
  14732. class CacheStorage {
  14733. /**
  14734. * @see https://w3c.github.io/ServiceWorker/#dfn-relevant-name-to-cache-map
  14735. * @type {Map<string, import('./cache').requestResponseList}
  14736. */
  14737. #caches = new Map()
  14738. constructor () {
  14739. if (arguments[0] !== kConstruct) {
  14740. webidl.illegalConstructor()
  14741. }
  14742. }
  14743. async match (request, options = {}) {
  14744. webidl.brandCheck(this, CacheStorage)
  14745. webidl.argumentLengthCheck(arguments, 1, { header: 'CacheStorage.match' })
  14746. request = webidl.converters.RequestInfo(request)
  14747. options = webidl.converters.MultiCacheQueryOptions(options)
  14748. // 1.
  14749. if (options.cacheName != null) {
  14750. // 1.1.1.1
  14751. if (this.#caches.has(options.cacheName)) {
  14752. // 1.1.1.1.1
  14753. const cacheList = this.#caches.get(options.cacheName)
  14754. const cache = new Cache(kConstruct, cacheList)
  14755. return await cache.match(request, options)
  14756. }
  14757. } else { // 2.
  14758. // 2.2
  14759. for (const cacheList of this.#caches.values()) {
  14760. const cache = new Cache(kConstruct, cacheList)
  14761. // 2.2.1.2
  14762. const response = await cache.match(request, options)
  14763. if (response !== undefined) {
  14764. return response
  14765. }
  14766. }
  14767. }
  14768. }
  14769. /**
  14770. * @see https://w3c.github.io/ServiceWorker/#cache-storage-has
  14771. * @param {string} cacheName
  14772. * @returns {Promise<boolean>}
  14773. */
  14774. async has (cacheName) {
  14775. webidl.brandCheck(this, CacheStorage)
  14776. webidl.argumentLengthCheck(arguments, 1, { header: 'CacheStorage.has' })
  14777. cacheName = webidl.converters.DOMString(cacheName)
  14778. // 2.1.1
  14779. // 2.2
  14780. return this.#caches.has(cacheName)
  14781. }
  14782. /**
  14783. * @see https://w3c.github.io/ServiceWorker/#dom-cachestorage-open
  14784. * @param {string} cacheName
  14785. * @returns {Promise<Cache>}
  14786. */
  14787. async open (cacheName) {
  14788. webidl.brandCheck(this, CacheStorage)
  14789. webidl.argumentLengthCheck(arguments, 1, { header: 'CacheStorage.open' })
  14790. cacheName = webidl.converters.DOMString(cacheName)
  14791. // 2.1
  14792. if (this.#caches.has(cacheName)) {
  14793. // await caches.open('v1') !== await caches.open('v1')
  14794. // 2.1.1
  14795. const cache = this.#caches.get(cacheName)
  14796. // 2.1.1.1
  14797. return new Cache(kConstruct, cache)
  14798. }
  14799. // 2.2
  14800. const cache = []
  14801. // 2.3
  14802. this.#caches.set(cacheName, cache)
  14803. // 2.4
  14804. return new Cache(kConstruct, cache)
  14805. }
  14806. /**
  14807. * @see https://w3c.github.io/ServiceWorker/#cache-storage-delete
  14808. * @param {string} cacheName
  14809. * @returns {Promise<boolean>}
  14810. */
  14811. async delete (cacheName) {
  14812. webidl.brandCheck(this, CacheStorage)
  14813. webidl.argumentLengthCheck(arguments, 1, { header: 'CacheStorage.delete' })
  14814. cacheName = webidl.converters.DOMString(cacheName)
  14815. return this.#caches.delete(cacheName)
  14816. }
  14817. /**
  14818. * @see https://w3c.github.io/ServiceWorker/#cache-storage-keys
  14819. * @returns {string[]}
  14820. */
  14821. async keys () {
  14822. webidl.brandCheck(this, CacheStorage)
  14823. // 2.1
  14824. const keys = this.#caches.keys()
  14825. // 2.2
  14826. return [...keys]
  14827. }
  14828. }
  14829. Object.defineProperties(CacheStorage.prototype, {
  14830. [Symbol.toStringTag]: {
  14831. value: 'CacheStorage',
  14832. configurable: true
  14833. },
  14834. match: kEnumerableProperty,
  14835. has: kEnumerableProperty,
  14836. open: kEnumerableProperty,
  14837. delete: kEnumerableProperty,
  14838. keys: kEnumerableProperty
  14839. })
  14840. module.exports = {
  14841. CacheStorage
  14842. }
  14843. /***/ }),
  14844. /***/ 9174:
  14845. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  14846. "use strict";
  14847. module.exports = {
  14848. kConstruct: (__nccwpck_require__(2785).kConstruct)
  14849. }
  14850. /***/ }),
  14851. /***/ 2396:
  14852. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  14853. "use strict";
  14854. const assert = __nccwpck_require__(9491)
  14855. const { URLSerializer } = __nccwpck_require__(685)
  14856. const { isValidHeaderName } = __nccwpck_require__(2538)
  14857. /**
  14858. * @see https://url.spec.whatwg.org/#concept-url-equals
  14859. * @param {URL} A
  14860. * @param {URL} B
  14861. * @param {boolean | undefined} excludeFragment
  14862. * @returns {boolean}
  14863. */
  14864. function urlEquals (A, B, excludeFragment = false) {
  14865. const serializedA = URLSerializer(A, excludeFragment)
  14866. const serializedB = URLSerializer(B, excludeFragment)
  14867. return serializedA === serializedB
  14868. }
  14869. /**
  14870. * @see https://github.com/chromium/chromium/blob/694d20d134cb553d8d89e5500b9148012b1ba299/content/browser/cache_storage/cache_storage_cache.cc#L260-L262
  14871. * @param {string} header
  14872. */
  14873. function fieldValues (header) {
  14874. assert(header !== null)
  14875. const values = []
  14876. for (let value of header.split(',')) {
  14877. value = value.trim()
  14878. if (!value.length) {
  14879. continue
  14880. } else if (!isValidHeaderName(value)) {
  14881. continue
  14882. }
  14883. values.push(value)
  14884. }
  14885. return values
  14886. }
  14887. module.exports = {
  14888. urlEquals,
  14889. fieldValues
  14890. }
  14891. /***/ }),
  14892. /***/ 3598:
  14893. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  14894. "use strict";
  14895. // @ts-check
  14896. /* global WebAssembly */
  14897. const assert = __nccwpck_require__(9491)
  14898. const net = __nccwpck_require__(1808)
  14899. const http = __nccwpck_require__(3685)
  14900. const { pipeline } = __nccwpck_require__(2781)
  14901. const util = __nccwpck_require__(3983)
  14902. const timers = __nccwpck_require__(9459)
  14903. const Request = __nccwpck_require__(2905)
  14904. const DispatcherBase = __nccwpck_require__(4839)
  14905. const {
  14906. RequestContentLengthMismatchError,
  14907. ResponseContentLengthMismatchError,
  14908. InvalidArgumentError,
  14909. RequestAbortedError,
  14910. HeadersTimeoutError,
  14911. HeadersOverflowError,
  14912. SocketError,
  14913. InformationalError,
  14914. BodyTimeoutError,
  14915. HTTPParserError,
  14916. ResponseExceededMaxSizeError,
  14917. ClientDestroyedError
  14918. } = __nccwpck_require__(8045)
  14919. const buildConnector = __nccwpck_require__(2067)
  14920. const {
  14921. kUrl,
  14922. kReset,
  14923. kServerName,
  14924. kClient,
  14925. kBusy,
  14926. kParser,
  14927. kConnect,
  14928. kBlocking,
  14929. kResuming,
  14930. kRunning,
  14931. kPending,
  14932. kSize,
  14933. kWriting,
  14934. kQueue,
  14935. kConnected,
  14936. kConnecting,
  14937. kNeedDrain,
  14938. kNoRef,
  14939. kKeepAliveDefaultTimeout,
  14940. kHostHeader,
  14941. kPendingIdx,
  14942. kRunningIdx,
  14943. kError,
  14944. kPipelining,
  14945. kSocket,
  14946. kKeepAliveTimeoutValue,
  14947. kMaxHeadersSize,
  14948. kKeepAliveMaxTimeout,
  14949. kKeepAliveTimeoutThreshold,
  14950. kHeadersTimeout,
  14951. kBodyTimeout,
  14952. kStrictContentLength,
  14953. kConnector,
  14954. kMaxRedirections,
  14955. kMaxRequests,
  14956. kCounter,
  14957. kClose,
  14958. kDestroy,
  14959. kDispatch,
  14960. kInterceptors,
  14961. kLocalAddress,
  14962. kMaxResponseSize,
  14963. kHTTPConnVersion,
  14964. // HTTP2
  14965. kHost,
  14966. kHTTP2Session,
  14967. kHTTP2SessionState,
  14968. kHTTP2BuildRequest,
  14969. kHTTP2CopyHeaders,
  14970. kHTTP1BuildRequest
  14971. } = __nccwpck_require__(2785)
  14972. /** @type {import('http2')} */
  14973. let http2
  14974. try {
  14975. http2 = __nccwpck_require__(5158)
  14976. } catch {
  14977. // @ts-ignore
  14978. http2 = { constants: {} }
  14979. }
  14980. const {
  14981. constants: {
  14982. HTTP2_HEADER_AUTHORITY,
  14983. HTTP2_HEADER_METHOD,
  14984. HTTP2_HEADER_PATH,
  14985. HTTP2_HEADER_SCHEME,
  14986. HTTP2_HEADER_CONTENT_LENGTH,
  14987. HTTP2_HEADER_EXPECT,
  14988. HTTP2_HEADER_STATUS
  14989. }
  14990. } = http2
  14991. // Experimental
  14992. let h2ExperimentalWarned = false
  14993. const FastBuffer = Buffer[Symbol.species]
  14994. const kClosedResolve = Symbol('kClosedResolve')
  14995. const channels = {}
  14996. try {
  14997. const diagnosticsChannel = __nccwpck_require__(7643)
  14998. channels.sendHeaders = diagnosticsChannel.channel('undici:client:sendHeaders')
  14999. channels.beforeConnect = diagnosticsChannel.channel('undici:client:beforeConnect')
  15000. channels.connectError = diagnosticsChannel.channel('undici:client:connectError')
  15001. channels.connected = diagnosticsChannel.channel('undici:client:connected')
  15002. } catch {
  15003. channels.sendHeaders = { hasSubscribers: false }
  15004. channels.beforeConnect = { hasSubscribers: false }
  15005. channels.connectError = { hasSubscribers: false }
  15006. channels.connected = { hasSubscribers: false }
  15007. }
  15008. /**
  15009. * @type {import('../types/client').default}
  15010. */
  15011. class Client extends DispatcherBase {
  15012. /**
  15013. *
  15014. * @param {string|URL} url
  15015. * @param {import('../types/client').Client.Options} options
  15016. */
  15017. constructor (url, {
  15018. interceptors,
  15019. maxHeaderSize,
  15020. headersTimeout,
  15021. socketTimeout,
  15022. requestTimeout,
  15023. connectTimeout,
  15024. bodyTimeout,
  15025. idleTimeout,
  15026. keepAlive,
  15027. keepAliveTimeout,
  15028. maxKeepAliveTimeout,
  15029. keepAliveMaxTimeout,
  15030. keepAliveTimeoutThreshold,
  15031. socketPath,
  15032. pipelining,
  15033. tls,
  15034. strictContentLength,
  15035. maxCachedSessions,
  15036. maxRedirections,
  15037. connect,
  15038. maxRequestsPerClient,
  15039. localAddress,
  15040. maxResponseSize,
  15041. autoSelectFamily,
  15042. autoSelectFamilyAttemptTimeout,
  15043. // h2
  15044. allowH2,
  15045. maxConcurrentStreams
  15046. } = {}) {
  15047. super()
  15048. if (keepAlive !== undefined) {
  15049. throw new InvalidArgumentError('unsupported keepAlive, use pipelining=0 instead')
  15050. }
  15051. if (socketTimeout !== undefined) {
  15052. throw new InvalidArgumentError('unsupported socketTimeout, use headersTimeout & bodyTimeout instead')
  15053. }
  15054. if (requestTimeout !== undefined) {
  15055. throw new InvalidArgumentError('unsupported requestTimeout, use headersTimeout & bodyTimeout instead')
  15056. }
  15057. if (idleTimeout !== undefined) {
  15058. throw new InvalidArgumentError('unsupported idleTimeout, use keepAliveTimeout instead')
  15059. }
  15060. if (maxKeepAliveTimeout !== undefined) {
  15061. throw new InvalidArgumentError('unsupported maxKeepAliveTimeout, use keepAliveMaxTimeout instead')
  15062. }
  15063. if (maxHeaderSize != null && !Number.isFinite(maxHeaderSize)) {
  15064. throw new InvalidArgumentError('invalid maxHeaderSize')
  15065. }
  15066. if (socketPath != null && typeof socketPath !== 'string') {
  15067. throw new InvalidArgumentError('invalid socketPath')
  15068. }
  15069. if (connectTimeout != null && (!Number.isFinite(connectTimeout) || connectTimeout < 0)) {
  15070. throw new InvalidArgumentError('invalid connectTimeout')
  15071. }
  15072. if (keepAliveTimeout != null && (!Number.isFinite(keepAliveTimeout) || keepAliveTimeout <= 0)) {
  15073. throw new InvalidArgumentError('invalid keepAliveTimeout')
  15074. }
  15075. if (keepAliveMaxTimeout != null && (!Number.isFinite(keepAliveMaxTimeout) || keepAliveMaxTimeout <= 0)) {
  15076. throw new InvalidArgumentError('invalid keepAliveMaxTimeout')
  15077. }
  15078. if (keepAliveTimeoutThreshold != null && !Number.isFinite(keepAliveTimeoutThreshold)) {
  15079. throw new InvalidArgumentError('invalid keepAliveTimeoutThreshold')
  15080. }
  15081. if (headersTimeout != null && (!Number.isInteger(headersTimeout) || headersTimeout < 0)) {
  15082. throw new InvalidArgumentError('headersTimeout must be a positive integer or zero')
  15083. }
  15084. if (bodyTimeout != null && (!Number.isInteger(bodyTimeout) || bodyTimeout < 0)) {
  15085. throw new InvalidArgumentError('bodyTimeout must be a positive integer or zero')
  15086. }
  15087. if (connect != null && typeof connect !== 'function' && typeof connect !== 'object') {
  15088. throw new InvalidArgumentError('connect must be a function or an object')
  15089. }
  15090. if (maxRedirections != null && (!Number.isInteger(maxRedirections) || maxRedirections < 0)) {
  15091. throw new InvalidArgumentError('maxRedirections must be a positive number')
  15092. }
  15093. if (maxRequestsPerClient != null && (!Number.isInteger(maxRequestsPerClient) || maxRequestsPerClient < 0)) {
  15094. throw new InvalidArgumentError('maxRequestsPerClient must be a positive number')
  15095. }
  15096. if (localAddress != null && (typeof localAddress !== 'string' || net.isIP(localAddress) === 0)) {
  15097. throw new InvalidArgumentError('localAddress must be valid string IP address')
  15098. }
  15099. if (maxResponseSize != null && (!Number.isInteger(maxResponseSize) || maxResponseSize < -1)) {
  15100. throw new InvalidArgumentError('maxResponseSize must be a positive number')
  15101. }
  15102. if (
  15103. autoSelectFamilyAttemptTimeout != null &&
  15104. (!Number.isInteger(autoSelectFamilyAttemptTimeout) || autoSelectFamilyAttemptTimeout < -1)
  15105. ) {
  15106. throw new InvalidArgumentError('autoSelectFamilyAttemptTimeout must be a positive number')
  15107. }
  15108. // h2
  15109. if (allowH2 != null && typeof allowH2 !== 'boolean') {
  15110. throw new InvalidArgumentError('allowH2 must be a valid boolean value')
  15111. }
  15112. if (maxConcurrentStreams != null && (typeof maxConcurrentStreams !== 'number' || maxConcurrentStreams < 1)) {
  15113. throw new InvalidArgumentError('maxConcurrentStreams must be a possitive integer, greater than 0')
  15114. }
  15115. if (typeof connect !== 'function') {
  15116. connect = buildConnector({
  15117. ...tls,
  15118. maxCachedSessions,
  15119. allowH2,
  15120. socketPath,
  15121. timeout: connectTimeout,
  15122. ...(util.nodeHasAutoSelectFamily && autoSelectFamily ? { autoSelectFamily, autoSelectFamilyAttemptTimeout } : undefined),
  15123. ...connect
  15124. })
  15125. }
  15126. this[kInterceptors] = interceptors && interceptors.Client && Array.isArray(interceptors.Client)
  15127. ? interceptors.Client
  15128. : [createRedirectInterceptor({ maxRedirections })]
  15129. this[kUrl] = util.parseOrigin(url)
  15130. this[kConnector] = connect
  15131. this[kSocket] = null
  15132. this[kPipelining] = pipelining != null ? pipelining : 1
  15133. this[kMaxHeadersSize] = maxHeaderSize || http.maxHeaderSize
  15134. this[kKeepAliveDefaultTimeout] = keepAliveTimeout == null ? 4e3 : keepAliveTimeout
  15135. this[kKeepAliveMaxTimeout] = keepAliveMaxTimeout == null ? 600e3 : keepAliveMaxTimeout
  15136. this[kKeepAliveTimeoutThreshold] = keepAliveTimeoutThreshold == null ? 1e3 : keepAliveTimeoutThreshold
  15137. this[kKeepAliveTimeoutValue] = this[kKeepAliveDefaultTimeout]
  15138. this[kServerName] = null
  15139. this[kLocalAddress] = localAddress != null ? localAddress : null
  15140. this[kResuming] = 0 // 0, idle, 1, scheduled, 2 resuming
  15141. this[kNeedDrain] = 0 // 0, idle, 1, scheduled, 2 resuming
  15142. this[kHostHeader] = `host: ${this[kUrl].hostname}${this[kUrl].port ? `:${this[kUrl].port}` : ''}\r\n`
  15143. this[kBodyTimeout] = bodyTimeout != null ? bodyTimeout : 300e3
  15144. this[kHeadersTimeout] = headersTimeout != null ? headersTimeout : 300e3
  15145. this[kStrictContentLength] = strictContentLength == null ? true : strictContentLength
  15146. this[kMaxRedirections] = maxRedirections
  15147. this[kMaxRequests] = maxRequestsPerClient
  15148. this[kClosedResolve] = null
  15149. this[kMaxResponseSize] = maxResponseSize > -1 ? maxResponseSize : -1
  15150. this[kHTTPConnVersion] = 'h1'
  15151. // HTTP/2
  15152. this[kHTTP2Session] = null
  15153. this[kHTTP2SessionState] = !allowH2
  15154. ? null
  15155. : {
  15156. // streams: null, // Fixed queue of streams - For future support of `push`
  15157. openStreams: 0, // Keep track of them to decide wether or not unref the session
  15158. maxConcurrentStreams: maxConcurrentStreams != null ? maxConcurrentStreams : 100 // Max peerConcurrentStreams for a Node h2 server
  15159. }
  15160. this[kHost] = `${this[kUrl].hostname}${this[kUrl].port ? `:${this[kUrl].port}` : ''}`
  15161. // kQueue is built up of 3 sections separated by
  15162. // the kRunningIdx and kPendingIdx indices.
  15163. // | complete | running | pending |
  15164. // ^ kRunningIdx ^ kPendingIdx ^ kQueue.length
  15165. // kRunningIdx points to the first running element.
  15166. // kPendingIdx points to the first pending element.
  15167. // This implements a fast queue with an amortized
  15168. // time of O(1).
  15169. this[kQueue] = []
  15170. this[kRunningIdx] = 0
  15171. this[kPendingIdx] = 0
  15172. }
  15173. get pipelining () {
  15174. return this[kPipelining]
  15175. }
  15176. set pipelining (value) {
  15177. this[kPipelining] = value
  15178. resume(this, true)
  15179. }
  15180. get [kPending] () {
  15181. return this[kQueue].length - this[kPendingIdx]
  15182. }
  15183. get [kRunning] () {
  15184. return this[kPendingIdx] - this[kRunningIdx]
  15185. }
  15186. get [kSize] () {
  15187. return this[kQueue].length - this[kRunningIdx]
  15188. }
  15189. get [kConnected] () {
  15190. return !!this[kSocket] && !this[kConnecting] && !this[kSocket].destroyed
  15191. }
  15192. get [kBusy] () {
  15193. const socket = this[kSocket]
  15194. return (
  15195. (socket && (socket[kReset] || socket[kWriting] || socket[kBlocking])) ||
  15196. (this[kSize] >= (this[kPipelining] || 1)) ||
  15197. this[kPending] > 0
  15198. )
  15199. }
  15200. /* istanbul ignore: only used for test */
  15201. [kConnect] (cb) {
  15202. connect(this)
  15203. this.once('connect', cb)
  15204. }
  15205. [kDispatch] (opts, handler) {
  15206. const origin = opts.origin || this[kUrl].origin
  15207. const request = this[kHTTPConnVersion] === 'h2'
  15208. ? Request[kHTTP2BuildRequest](origin, opts, handler)
  15209. : Request[kHTTP1BuildRequest](origin, opts, handler)
  15210. this[kQueue].push(request)
  15211. if (this[kResuming]) {
  15212. // Do nothing.
  15213. } else if (util.bodyLength(request.body) == null && util.isIterable(request.body)) {
  15214. // Wait a tick in case stream/iterator is ended in the same tick.
  15215. this[kResuming] = 1
  15216. process.nextTick(resume, this)
  15217. } else {
  15218. resume(this, true)
  15219. }
  15220. if (this[kResuming] && this[kNeedDrain] !== 2 && this[kBusy]) {
  15221. this[kNeedDrain] = 2
  15222. }
  15223. return this[kNeedDrain] < 2
  15224. }
  15225. async [kClose] () {
  15226. // TODO: for H2 we need to gracefully flush the remaining enqueued
  15227. // request and close each stream.
  15228. return new Promise((resolve) => {
  15229. if (!this[kSize]) {
  15230. resolve(null)
  15231. } else {
  15232. this[kClosedResolve] = resolve
  15233. }
  15234. })
  15235. }
  15236. async [kDestroy] (err) {
  15237. return new Promise((resolve) => {
  15238. const requests = this[kQueue].splice(this[kPendingIdx])
  15239. for (let i = 0; i < requests.length; i++) {
  15240. const request = requests[i]
  15241. errorRequest(this, request, err)
  15242. }
  15243. const callback = () => {
  15244. if (this[kClosedResolve]) {
  15245. // TODO (fix): Should we error here with ClientDestroyedError?
  15246. this[kClosedResolve]()
  15247. this[kClosedResolve] = null
  15248. }
  15249. resolve()
  15250. }
  15251. if (this[kHTTP2Session] != null) {
  15252. util.destroy(this[kHTTP2Session], err)
  15253. this[kHTTP2Session] = null
  15254. this[kHTTP2SessionState] = null
  15255. }
  15256. if (!this[kSocket]) {
  15257. queueMicrotask(callback)
  15258. } else {
  15259. util.destroy(this[kSocket].on('close', callback), err)
  15260. }
  15261. resume(this)
  15262. })
  15263. }
  15264. }
  15265. function onHttp2SessionError (err) {
  15266. assert(err.code !== 'ERR_TLS_CERT_ALTNAME_INVALID')
  15267. this[kSocket][kError] = err
  15268. onError(this[kClient], err)
  15269. }
  15270. function onHttp2FrameError (type, code, id) {
  15271. const err = new InformationalError(`HTTP/2: "frameError" received - type ${type}, code ${code}`)
  15272. if (id === 0) {
  15273. this[kSocket][kError] = err
  15274. onError(this[kClient], err)
  15275. }
  15276. }
  15277. function onHttp2SessionEnd () {
  15278. util.destroy(this, new SocketError('other side closed'))
  15279. util.destroy(this[kSocket], new SocketError('other side closed'))
  15280. }
  15281. function onHTTP2GoAway (code) {
  15282. const client = this[kClient]
  15283. const err = new InformationalError(`HTTP/2: "GOAWAY" frame received with code ${code}`)
  15284. client[kSocket] = null
  15285. client[kHTTP2Session] = null
  15286. if (client.destroyed) {
  15287. assert(this[kPending] === 0)
  15288. // Fail entire queue.
  15289. const requests = client[kQueue].splice(client[kRunningIdx])
  15290. for (let i = 0; i < requests.length; i++) {
  15291. const request = requests[i]
  15292. errorRequest(this, request, err)
  15293. }
  15294. } else if (client[kRunning] > 0) {
  15295. // Fail head of pipeline.
  15296. const request = client[kQueue][client[kRunningIdx]]
  15297. client[kQueue][client[kRunningIdx]++] = null
  15298. errorRequest(client, request, err)
  15299. }
  15300. client[kPendingIdx] = client[kRunningIdx]
  15301. assert(client[kRunning] === 0)
  15302. client.emit('disconnect',
  15303. client[kUrl],
  15304. [client],
  15305. err
  15306. )
  15307. resume(client)
  15308. }
  15309. const constants = __nccwpck_require__(953)
  15310. const createRedirectInterceptor = __nccwpck_require__(8861)
  15311. const EMPTY_BUF = Buffer.alloc(0)
  15312. async function lazyllhttp () {
  15313. const llhttpWasmData = process.env.JEST_WORKER_ID ? __nccwpck_require__(1145) : undefined
  15314. let mod
  15315. try {
  15316. mod = await WebAssembly.compile(Buffer.from(__nccwpck_require__(5627), 'base64'))
  15317. } catch (e) {
  15318. /* istanbul ignore next */
  15319. // We could check if the error was caused by the simd option not
  15320. // being enabled, but the occurring of this other error
  15321. // * https://github.com/emscripten-core/emscripten/issues/11495
  15322. // got me to remove that check to avoid breaking Node 12.
  15323. mod = await WebAssembly.compile(Buffer.from(llhttpWasmData || __nccwpck_require__(1145), 'base64'))
  15324. }
  15325. return await WebAssembly.instantiate(mod, {
  15326. env: {
  15327. /* eslint-disable camelcase */
  15328. wasm_on_url: (p, at, len) => {
  15329. /* istanbul ignore next */
  15330. return 0
  15331. },
  15332. wasm_on_status: (p, at, len) => {
  15333. assert.strictEqual(currentParser.ptr, p)
  15334. const start = at - currentBufferPtr + currentBufferRef.byteOffset
  15335. return currentParser.onStatus(new FastBuffer(currentBufferRef.buffer, start, len)) || 0
  15336. },
  15337. wasm_on_message_begin: (p) => {
  15338. assert.strictEqual(currentParser.ptr, p)
  15339. return currentParser.onMessageBegin() || 0
  15340. },
  15341. wasm_on_header_field: (p, at, len) => {
  15342. assert.strictEqual(currentParser.ptr, p)
  15343. const start = at - currentBufferPtr + currentBufferRef.byteOffset
  15344. return currentParser.onHeaderField(new FastBuffer(currentBufferRef.buffer, start, len)) || 0
  15345. },
  15346. wasm_on_header_value: (p, at, len) => {
  15347. assert.strictEqual(currentParser.ptr, p)
  15348. const start = at - currentBufferPtr + currentBufferRef.byteOffset
  15349. return currentParser.onHeaderValue(new FastBuffer(currentBufferRef.buffer, start, len)) || 0
  15350. },
  15351. wasm_on_headers_complete: (p, statusCode, upgrade, shouldKeepAlive) => {
  15352. assert.strictEqual(currentParser.ptr, p)
  15353. return currentParser.onHeadersComplete(statusCode, Boolean(upgrade), Boolean(shouldKeepAlive)) || 0
  15354. },
  15355. wasm_on_body: (p, at, len) => {
  15356. assert.strictEqual(currentParser.ptr, p)
  15357. const start = at - currentBufferPtr + currentBufferRef.byteOffset
  15358. return currentParser.onBody(new FastBuffer(currentBufferRef.buffer, start, len)) || 0
  15359. },
  15360. wasm_on_message_complete: (p) => {
  15361. assert.strictEqual(currentParser.ptr, p)
  15362. return currentParser.onMessageComplete() || 0
  15363. }
  15364. /* eslint-enable camelcase */
  15365. }
  15366. })
  15367. }
  15368. let llhttpInstance = null
  15369. let llhttpPromise = lazyllhttp()
  15370. llhttpPromise.catch()
  15371. let currentParser = null
  15372. let currentBufferRef = null
  15373. let currentBufferSize = 0
  15374. let currentBufferPtr = null
  15375. const TIMEOUT_HEADERS = 1
  15376. const TIMEOUT_BODY = 2
  15377. const TIMEOUT_IDLE = 3
  15378. class Parser {
  15379. constructor (client, socket, { exports }) {
  15380. assert(Number.isFinite(client[kMaxHeadersSize]) && client[kMaxHeadersSize] > 0)
  15381. this.llhttp = exports
  15382. this.ptr = this.llhttp.llhttp_alloc(constants.TYPE.RESPONSE)
  15383. this.client = client
  15384. this.socket = socket
  15385. this.timeout = null
  15386. this.timeoutValue = null
  15387. this.timeoutType = null
  15388. this.statusCode = null
  15389. this.statusText = ''
  15390. this.upgrade = false
  15391. this.headers = []
  15392. this.headersSize = 0
  15393. this.headersMaxSize = client[kMaxHeadersSize]
  15394. this.shouldKeepAlive = false
  15395. this.paused = false
  15396. this.resume = this.resume.bind(this)
  15397. this.bytesRead = 0
  15398. this.keepAlive = ''
  15399. this.contentLength = ''
  15400. this.connection = ''
  15401. this.maxResponseSize = client[kMaxResponseSize]
  15402. }
  15403. setTimeout (value, type) {
  15404. this.timeoutType = type
  15405. if (value !== this.timeoutValue) {
  15406. timers.clearTimeout(this.timeout)
  15407. if (value) {
  15408. this.timeout = timers.setTimeout(onParserTimeout, value, this)
  15409. // istanbul ignore else: only for jest
  15410. if (this.timeout.unref) {
  15411. this.timeout.unref()
  15412. }
  15413. } else {
  15414. this.timeout = null
  15415. }
  15416. this.timeoutValue = value
  15417. } else if (this.timeout) {
  15418. // istanbul ignore else: only for jest
  15419. if (this.timeout.refresh) {
  15420. this.timeout.refresh()
  15421. }
  15422. }
  15423. }
  15424. resume () {
  15425. if (this.socket.destroyed || !this.paused) {
  15426. return
  15427. }
  15428. assert(this.ptr != null)
  15429. assert(currentParser == null)
  15430. this.llhttp.llhttp_resume(this.ptr)
  15431. assert(this.timeoutType === TIMEOUT_BODY)
  15432. if (this.timeout) {
  15433. // istanbul ignore else: only for jest
  15434. if (this.timeout.refresh) {
  15435. this.timeout.refresh()
  15436. }
  15437. }
  15438. this.paused = false
  15439. this.execute(this.socket.read() || EMPTY_BUF) // Flush parser.
  15440. this.readMore()
  15441. }
  15442. readMore () {
  15443. while (!this.paused && this.ptr) {
  15444. const chunk = this.socket.read()
  15445. if (chunk === null) {
  15446. break
  15447. }
  15448. this.execute(chunk)
  15449. }
  15450. }
  15451. execute (data) {
  15452. assert(this.ptr != null)
  15453. assert(currentParser == null)
  15454. assert(!this.paused)
  15455. const { socket, llhttp } = this
  15456. if (data.length > currentBufferSize) {
  15457. if (currentBufferPtr) {
  15458. llhttp.free(currentBufferPtr)
  15459. }
  15460. currentBufferSize = Math.ceil(data.length / 4096) * 4096
  15461. currentBufferPtr = llhttp.malloc(currentBufferSize)
  15462. }
  15463. new Uint8Array(llhttp.memory.buffer, currentBufferPtr, currentBufferSize).set(data)
  15464. // Call `execute` on the wasm parser.
  15465. // We pass the `llhttp_parser` pointer address, the pointer address of buffer view data,
  15466. // and finally the length of bytes to parse.
  15467. // The return value is an error code or `constants.ERROR.OK`.
  15468. try {
  15469. let ret
  15470. try {
  15471. currentBufferRef = data
  15472. currentParser = this
  15473. ret = llhttp.llhttp_execute(this.ptr, currentBufferPtr, data.length)
  15474. /* eslint-disable-next-line no-useless-catch */
  15475. } catch (err) {
  15476. /* istanbul ignore next: difficult to make a test case for */
  15477. throw err
  15478. } finally {
  15479. currentParser = null
  15480. currentBufferRef = null
  15481. }
  15482. const offset = llhttp.llhttp_get_error_pos(this.ptr) - currentBufferPtr
  15483. if (ret === constants.ERROR.PAUSED_UPGRADE) {
  15484. this.onUpgrade(data.slice(offset))
  15485. } else if (ret === constants.ERROR.PAUSED) {
  15486. this.paused = true
  15487. socket.unshift(data.slice(offset))
  15488. } else if (ret !== constants.ERROR.OK) {
  15489. const ptr = llhttp.llhttp_get_error_reason(this.ptr)
  15490. let message = ''
  15491. /* istanbul ignore else: difficult to make a test case for */
  15492. if (ptr) {
  15493. const len = new Uint8Array(llhttp.memory.buffer, ptr).indexOf(0)
  15494. message =
  15495. 'Response does not match the HTTP/1.1 protocol (' +
  15496. Buffer.from(llhttp.memory.buffer, ptr, len).toString() +
  15497. ')'
  15498. }
  15499. throw new HTTPParserError(message, constants.ERROR[ret], data.slice(offset))
  15500. }
  15501. } catch (err) {
  15502. util.destroy(socket, err)
  15503. }
  15504. }
  15505. destroy () {
  15506. assert(this.ptr != null)
  15507. assert(currentParser == null)
  15508. this.llhttp.llhttp_free(this.ptr)
  15509. this.ptr = null
  15510. timers.clearTimeout(this.timeout)
  15511. this.timeout = null
  15512. this.timeoutValue = null
  15513. this.timeoutType = null
  15514. this.paused = false
  15515. }
  15516. onStatus (buf) {
  15517. this.statusText = buf.toString()
  15518. }
  15519. onMessageBegin () {
  15520. const { socket, client } = this
  15521. /* istanbul ignore next: difficult to make a test case for */
  15522. if (socket.destroyed) {
  15523. return -1
  15524. }
  15525. const request = client[kQueue][client[kRunningIdx]]
  15526. if (!request) {
  15527. return -1
  15528. }
  15529. }
  15530. onHeaderField (buf) {
  15531. const len = this.headers.length
  15532. if ((len & 1) === 0) {
  15533. this.headers.push(buf)
  15534. } else {
  15535. this.headers[len - 1] = Buffer.concat([this.headers[len - 1], buf])
  15536. }
  15537. this.trackHeader(buf.length)
  15538. }
  15539. onHeaderValue (buf) {
  15540. let len = this.headers.length
  15541. if ((len & 1) === 1) {
  15542. this.headers.push(buf)
  15543. len += 1
  15544. } else {
  15545. this.headers[len - 1] = Buffer.concat([this.headers[len - 1], buf])
  15546. }
  15547. const key = this.headers[len - 2]
  15548. if (key.length === 10 && key.toString().toLowerCase() === 'keep-alive') {
  15549. this.keepAlive += buf.toString()
  15550. } else if (key.length === 10 && key.toString().toLowerCase() === 'connection') {
  15551. this.connection += buf.toString()
  15552. } else if (key.length === 14 && key.toString().toLowerCase() === 'content-length') {
  15553. this.contentLength += buf.toString()
  15554. }
  15555. this.trackHeader(buf.length)
  15556. }
  15557. trackHeader (len) {
  15558. this.headersSize += len
  15559. if (this.headersSize >= this.headersMaxSize) {
  15560. util.destroy(this.socket, new HeadersOverflowError())
  15561. }
  15562. }
  15563. onUpgrade (head) {
  15564. const { upgrade, client, socket, headers, statusCode } = this
  15565. assert(upgrade)
  15566. const request = client[kQueue][client[kRunningIdx]]
  15567. assert(request)
  15568. assert(!socket.destroyed)
  15569. assert(socket === client[kSocket])
  15570. assert(!this.paused)
  15571. assert(request.upgrade || request.method === 'CONNECT')
  15572. this.statusCode = null
  15573. this.statusText = ''
  15574. this.shouldKeepAlive = null
  15575. assert(this.headers.length % 2 === 0)
  15576. this.headers = []
  15577. this.headersSize = 0
  15578. socket.unshift(head)
  15579. socket[kParser].destroy()
  15580. socket[kParser] = null
  15581. socket[kClient] = null
  15582. socket[kError] = null
  15583. socket
  15584. .removeListener('error', onSocketError)
  15585. .removeListener('readable', onSocketReadable)
  15586. .removeListener('end', onSocketEnd)
  15587. .removeListener('close', onSocketClose)
  15588. client[kSocket] = null
  15589. client[kQueue][client[kRunningIdx]++] = null
  15590. client.emit('disconnect', client[kUrl], [client], new InformationalError('upgrade'))
  15591. try {
  15592. request.onUpgrade(statusCode, headers, socket)
  15593. } catch (err) {
  15594. util.destroy(socket, err)
  15595. }
  15596. resume(client)
  15597. }
  15598. onHeadersComplete (statusCode, upgrade, shouldKeepAlive) {
  15599. const { client, socket, headers, statusText } = this
  15600. /* istanbul ignore next: difficult to make a test case for */
  15601. if (socket.destroyed) {
  15602. return -1
  15603. }
  15604. const request = client[kQueue][client[kRunningIdx]]
  15605. /* istanbul ignore next: difficult to make a test case for */
  15606. if (!request) {
  15607. return -1
  15608. }
  15609. assert(!this.upgrade)
  15610. assert(this.statusCode < 200)
  15611. if (statusCode === 100) {
  15612. util.destroy(socket, new SocketError('bad response', util.getSocketInfo(socket)))
  15613. return -1
  15614. }
  15615. /* this can only happen if server is misbehaving */
  15616. if (upgrade && !request.upgrade) {
  15617. util.destroy(socket, new SocketError('bad upgrade', util.getSocketInfo(socket)))
  15618. return -1
  15619. }
  15620. assert.strictEqual(this.timeoutType, TIMEOUT_HEADERS)
  15621. this.statusCode = statusCode
  15622. this.shouldKeepAlive = (
  15623. shouldKeepAlive ||
  15624. // Override llhttp value which does not allow keepAlive for HEAD.
  15625. (request.method === 'HEAD' && !socket[kReset] && this.connection.toLowerCase() === 'keep-alive')
  15626. )
  15627. if (this.statusCode >= 200) {
  15628. const bodyTimeout = request.bodyTimeout != null
  15629. ? request.bodyTimeout
  15630. : client[kBodyTimeout]
  15631. this.setTimeout(bodyTimeout, TIMEOUT_BODY)
  15632. } else if (this.timeout) {
  15633. // istanbul ignore else: only for jest
  15634. if (this.timeout.refresh) {
  15635. this.timeout.refresh()
  15636. }
  15637. }
  15638. if (request.method === 'CONNECT') {
  15639. assert(client[kRunning] === 1)
  15640. this.upgrade = true
  15641. return 2
  15642. }
  15643. if (upgrade) {
  15644. assert(client[kRunning] === 1)
  15645. this.upgrade = true
  15646. return 2
  15647. }
  15648. assert(this.headers.length % 2 === 0)
  15649. this.headers = []
  15650. this.headersSize = 0
  15651. if (this.shouldKeepAlive && client[kPipelining]) {
  15652. const keepAliveTimeout = this.keepAlive ? util.parseKeepAliveTimeout(this.keepAlive) : null
  15653. if (keepAliveTimeout != null) {
  15654. const timeout = Math.min(
  15655. keepAliveTimeout - client[kKeepAliveTimeoutThreshold],
  15656. client[kKeepAliveMaxTimeout]
  15657. )
  15658. if (timeout <= 0) {
  15659. socket[kReset] = true
  15660. } else {
  15661. client[kKeepAliveTimeoutValue] = timeout
  15662. }
  15663. } else {
  15664. client[kKeepAliveTimeoutValue] = client[kKeepAliveDefaultTimeout]
  15665. }
  15666. } else {
  15667. // Stop more requests from being dispatched.
  15668. socket[kReset] = true
  15669. }
  15670. const pause = request.onHeaders(statusCode, headers, this.resume, statusText) === false
  15671. if (request.aborted) {
  15672. return -1
  15673. }
  15674. if (request.method === 'HEAD') {
  15675. return 1
  15676. }
  15677. if (statusCode < 200) {
  15678. return 1
  15679. }
  15680. if (socket[kBlocking]) {
  15681. socket[kBlocking] = false
  15682. resume(client)
  15683. }
  15684. return pause ? constants.ERROR.PAUSED : 0
  15685. }
  15686. onBody (buf) {
  15687. const { client, socket, statusCode, maxResponseSize } = this
  15688. if (socket.destroyed) {
  15689. return -1
  15690. }
  15691. const request = client[kQueue][client[kRunningIdx]]
  15692. assert(request)
  15693. assert.strictEqual(this.timeoutType, TIMEOUT_BODY)
  15694. if (this.timeout) {
  15695. // istanbul ignore else: only for jest
  15696. if (this.timeout.refresh) {
  15697. this.timeout.refresh()
  15698. }
  15699. }
  15700. assert(statusCode >= 200)
  15701. if (maxResponseSize > -1 && this.bytesRead + buf.length > maxResponseSize) {
  15702. util.destroy(socket, new ResponseExceededMaxSizeError())
  15703. return -1
  15704. }
  15705. this.bytesRead += buf.length
  15706. if (request.onData(buf) === false) {
  15707. return constants.ERROR.PAUSED
  15708. }
  15709. }
  15710. onMessageComplete () {
  15711. const { client, socket, statusCode, upgrade, headers, contentLength, bytesRead, shouldKeepAlive } = this
  15712. if (socket.destroyed && (!statusCode || shouldKeepAlive)) {
  15713. return -1
  15714. }
  15715. if (upgrade) {
  15716. return
  15717. }
  15718. const request = client[kQueue][client[kRunningIdx]]
  15719. assert(request)
  15720. assert(statusCode >= 100)
  15721. this.statusCode = null
  15722. this.statusText = ''
  15723. this.bytesRead = 0
  15724. this.contentLength = ''
  15725. this.keepAlive = ''
  15726. this.connection = ''
  15727. assert(this.headers.length % 2 === 0)
  15728. this.headers = []
  15729. this.headersSize = 0
  15730. if (statusCode < 200) {
  15731. return
  15732. }
  15733. /* istanbul ignore next: should be handled by llhttp? */
  15734. if (request.method !== 'HEAD' && contentLength && bytesRead !== parseInt(contentLength, 10)) {
  15735. util.destroy(socket, new ResponseContentLengthMismatchError())
  15736. return -1
  15737. }
  15738. request.onComplete(headers)
  15739. client[kQueue][client[kRunningIdx]++] = null
  15740. if (socket[kWriting]) {
  15741. assert.strictEqual(client[kRunning], 0)
  15742. // Response completed before request.
  15743. util.destroy(socket, new InformationalError('reset'))
  15744. return constants.ERROR.PAUSED
  15745. } else if (!shouldKeepAlive) {
  15746. util.destroy(socket, new InformationalError('reset'))
  15747. return constants.ERROR.PAUSED
  15748. } else if (socket[kReset] && client[kRunning] === 0) {
  15749. // Destroy socket once all requests have completed.
  15750. // The request at the tail of the pipeline is the one
  15751. // that requested reset and no further requests should
  15752. // have been queued since then.
  15753. util.destroy(socket, new InformationalError('reset'))
  15754. return constants.ERROR.PAUSED
  15755. } else if (client[kPipelining] === 1) {
  15756. // We must wait a full event loop cycle to reuse this socket to make sure
  15757. // that non-spec compliant servers are not closing the connection even if they
  15758. // said they won't.
  15759. setImmediate(resume, client)
  15760. } else {
  15761. resume(client)
  15762. }
  15763. }
  15764. }
  15765. function onParserTimeout (parser) {
  15766. const { socket, timeoutType, client } = parser
  15767. /* istanbul ignore else */
  15768. if (timeoutType === TIMEOUT_HEADERS) {
  15769. if (!socket[kWriting] || socket.writableNeedDrain || client[kRunning] > 1) {
  15770. assert(!parser.paused, 'cannot be paused while waiting for headers')
  15771. util.destroy(socket, new HeadersTimeoutError())
  15772. }
  15773. } else if (timeoutType === TIMEOUT_BODY) {
  15774. if (!parser.paused) {
  15775. util.destroy(socket, new BodyTimeoutError())
  15776. }
  15777. } else if (timeoutType === TIMEOUT_IDLE) {
  15778. assert(client[kRunning] === 0 && client[kKeepAliveTimeoutValue])
  15779. util.destroy(socket, new InformationalError('socket idle timeout'))
  15780. }
  15781. }
  15782. function onSocketReadable () {
  15783. const { [kParser]: parser } = this
  15784. if (parser) {
  15785. parser.readMore()
  15786. }
  15787. }
  15788. function onSocketError (err) {
  15789. const { [kClient]: client, [kParser]: parser } = this
  15790. assert(err.code !== 'ERR_TLS_CERT_ALTNAME_INVALID')
  15791. if (client[kHTTPConnVersion] !== 'h2') {
  15792. // On Mac OS, we get an ECONNRESET even if there is a full body to be forwarded
  15793. // to the user.
  15794. if (err.code === 'ECONNRESET' && parser.statusCode && !parser.shouldKeepAlive) {
  15795. // We treat all incoming data so for as a valid response.
  15796. parser.onMessageComplete()
  15797. return
  15798. }
  15799. }
  15800. this[kError] = err
  15801. onError(this[kClient], err)
  15802. }
  15803. function onError (client, err) {
  15804. if (
  15805. client[kRunning] === 0 &&
  15806. err.code !== 'UND_ERR_INFO' &&
  15807. err.code !== 'UND_ERR_SOCKET'
  15808. ) {
  15809. // Error is not caused by running request and not a recoverable
  15810. // socket error.
  15811. assert(client[kPendingIdx] === client[kRunningIdx])
  15812. const requests = client[kQueue].splice(client[kRunningIdx])
  15813. for (let i = 0; i < requests.length; i++) {
  15814. const request = requests[i]
  15815. errorRequest(client, request, err)
  15816. }
  15817. assert(client[kSize] === 0)
  15818. }
  15819. }
  15820. function onSocketEnd () {
  15821. const { [kParser]: parser, [kClient]: client } = this
  15822. if (client[kHTTPConnVersion] !== 'h2') {
  15823. if (parser.statusCode && !parser.shouldKeepAlive) {
  15824. // We treat all incoming data so far as a valid response.
  15825. parser.onMessageComplete()
  15826. return
  15827. }
  15828. }
  15829. util.destroy(this, new SocketError('other side closed', util.getSocketInfo(this)))
  15830. }
  15831. function onSocketClose () {
  15832. const { [kClient]: client, [kParser]: parser } = this
  15833. if (client[kHTTPConnVersion] === 'h1' && parser) {
  15834. if (!this[kError] && parser.statusCode && !parser.shouldKeepAlive) {
  15835. // We treat all incoming data so far as a valid response.
  15836. parser.onMessageComplete()
  15837. }
  15838. this[kParser].destroy()
  15839. this[kParser] = null
  15840. }
  15841. const err = this[kError] || new SocketError('closed', util.getSocketInfo(this))
  15842. client[kSocket] = null
  15843. if (client.destroyed) {
  15844. assert(client[kPending] === 0)
  15845. // Fail entire queue.
  15846. const requests = client[kQueue].splice(client[kRunningIdx])
  15847. for (let i = 0; i < requests.length; i++) {
  15848. const request = requests[i]
  15849. errorRequest(client, request, err)
  15850. }
  15851. } else if (client[kRunning] > 0 && err.code !== 'UND_ERR_INFO') {
  15852. // Fail head of pipeline.
  15853. const request = client[kQueue][client[kRunningIdx]]
  15854. client[kQueue][client[kRunningIdx]++] = null
  15855. errorRequest(client, request, err)
  15856. }
  15857. client[kPendingIdx] = client[kRunningIdx]
  15858. assert(client[kRunning] === 0)
  15859. client.emit('disconnect', client[kUrl], [client], err)
  15860. resume(client)
  15861. }
  15862. async function connect (client) {
  15863. assert(!client[kConnecting])
  15864. assert(!client[kSocket])
  15865. let { host, hostname, protocol, port } = client[kUrl]
  15866. // Resolve ipv6
  15867. if (hostname[0] === '[') {
  15868. const idx = hostname.indexOf(']')
  15869. assert(idx !== -1)
  15870. const ip = hostname.substring(1, idx)
  15871. assert(net.isIP(ip))
  15872. hostname = ip
  15873. }
  15874. client[kConnecting] = true
  15875. if (channels.beforeConnect.hasSubscribers) {
  15876. channels.beforeConnect.publish({
  15877. connectParams: {
  15878. host,
  15879. hostname,
  15880. protocol,
  15881. port,
  15882. servername: client[kServerName],
  15883. localAddress: client[kLocalAddress]
  15884. },
  15885. connector: client[kConnector]
  15886. })
  15887. }
  15888. try {
  15889. const socket = await new Promise((resolve, reject) => {
  15890. client[kConnector]({
  15891. host,
  15892. hostname,
  15893. protocol,
  15894. port,
  15895. servername: client[kServerName],
  15896. localAddress: client[kLocalAddress]
  15897. }, (err, socket) => {
  15898. if (err) {
  15899. reject(err)
  15900. } else {
  15901. resolve(socket)
  15902. }
  15903. })
  15904. })
  15905. if (client.destroyed) {
  15906. util.destroy(socket.on('error', () => {}), new ClientDestroyedError())
  15907. return
  15908. }
  15909. client[kConnecting] = false
  15910. assert(socket)
  15911. const isH2 = socket.alpnProtocol === 'h2'
  15912. if (isH2) {
  15913. if (!h2ExperimentalWarned) {
  15914. h2ExperimentalWarned = true
  15915. process.emitWarning('H2 support is experimental, expect them to change at any time.', {
  15916. code: 'UNDICI-H2'
  15917. })
  15918. }
  15919. const session = http2.connect(client[kUrl], {
  15920. createConnection: () => socket,
  15921. peerMaxConcurrentStreams: client[kHTTP2SessionState].maxConcurrentStreams
  15922. })
  15923. client[kHTTPConnVersion] = 'h2'
  15924. session[kClient] = client
  15925. session[kSocket] = socket
  15926. session.on('error', onHttp2SessionError)
  15927. session.on('frameError', onHttp2FrameError)
  15928. session.on('end', onHttp2SessionEnd)
  15929. session.on('goaway', onHTTP2GoAway)
  15930. session.on('close', onSocketClose)
  15931. session.unref()
  15932. client[kHTTP2Session] = session
  15933. socket[kHTTP2Session] = session
  15934. } else {
  15935. if (!llhttpInstance) {
  15936. llhttpInstance = await llhttpPromise
  15937. llhttpPromise = null
  15938. }
  15939. socket[kNoRef] = false
  15940. socket[kWriting] = false
  15941. socket[kReset] = false
  15942. socket[kBlocking] = false
  15943. socket[kParser] = new Parser(client, socket, llhttpInstance)
  15944. }
  15945. socket[kCounter] = 0
  15946. socket[kMaxRequests] = client[kMaxRequests]
  15947. socket[kClient] = client
  15948. socket[kError] = null
  15949. socket
  15950. .on('error', onSocketError)
  15951. .on('readable', onSocketReadable)
  15952. .on('end', onSocketEnd)
  15953. .on('close', onSocketClose)
  15954. client[kSocket] = socket
  15955. if (channels.connected.hasSubscribers) {
  15956. channels.connected.publish({
  15957. connectParams: {
  15958. host,
  15959. hostname,
  15960. protocol,
  15961. port,
  15962. servername: client[kServerName],
  15963. localAddress: client[kLocalAddress]
  15964. },
  15965. connector: client[kConnector],
  15966. socket
  15967. })
  15968. }
  15969. client.emit('connect', client[kUrl], [client])
  15970. } catch (err) {
  15971. if (client.destroyed) {
  15972. return
  15973. }
  15974. client[kConnecting] = false
  15975. if (channels.connectError.hasSubscribers) {
  15976. channels.connectError.publish({
  15977. connectParams: {
  15978. host,
  15979. hostname,
  15980. protocol,
  15981. port,
  15982. servername: client[kServerName],
  15983. localAddress: client[kLocalAddress]
  15984. },
  15985. connector: client[kConnector],
  15986. error: err
  15987. })
  15988. }
  15989. if (err.code === 'ERR_TLS_CERT_ALTNAME_INVALID') {
  15990. assert(client[kRunning] === 0)
  15991. while (client[kPending] > 0 && client[kQueue][client[kPendingIdx]].servername === client[kServerName]) {
  15992. const request = client[kQueue][client[kPendingIdx]++]
  15993. errorRequest(client, request, err)
  15994. }
  15995. } else {
  15996. onError(client, err)
  15997. }
  15998. client.emit('connectionError', client[kUrl], [client], err)
  15999. }
  16000. resume(client)
  16001. }
  16002. function emitDrain (client) {
  16003. client[kNeedDrain] = 0
  16004. client.emit('drain', client[kUrl], [client])
  16005. }
  16006. function resume (client, sync) {
  16007. if (client[kResuming] === 2) {
  16008. return
  16009. }
  16010. client[kResuming] = 2
  16011. _resume(client, sync)
  16012. client[kResuming] = 0
  16013. if (client[kRunningIdx] > 256) {
  16014. client[kQueue].splice(0, client[kRunningIdx])
  16015. client[kPendingIdx] -= client[kRunningIdx]
  16016. client[kRunningIdx] = 0
  16017. }
  16018. }
  16019. function _resume (client, sync) {
  16020. while (true) {
  16021. if (client.destroyed) {
  16022. assert(client[kPending] === 0)
  16023. return
  16024. }
  16025. if (client[kClosedResolve] && !client[kSize]) {
  16026. client[kClosedResolve]()
  16027. client[kClosedResolve] = null
  16028. return
  16029. }
  16030. const socket = client[kSocket]
  16031. if (socket && !socket.destroyed && socket.alpnProtocol !== 'h2') {
  16032. if (client[kSize] === 0) {
  16033. if (!socket[kNoRef] && socket.unref) {
  16034. socket.unref()
  16035. socket[kNoRef] = true
  16036. }
  16037. } else if (socket[kNoRef] && socket.ref) {
  16038. socket.ref()
  16039. socket[kNoRef] = false
  16040. }
  16041. if (client[kSize] === 0) {
  16042. if (socket[kParser].timeoutType !== TIMEOUT_IDLE) {
  16043. socket[kParser].setTimeout(client[kKeepAliveTimeoutValue], TIMEOUT_IDLE)
  16044. }
  16045. } else if (client[kRunning] > 0 && socket[kParser].statusCode < 200) {
  16046. if (socket[kParser].timeoutType !== TIMEOUT_HEADERS) {
  16047. const request = client[kQueue][client[kRunningIdx]]
  16048. const headersTimeout = request.headersTimeout != null
  16049. ? request.headersTimeout
  16050. : client[kHeadersTimeout]
  16051. socket[kParser].setTimeout(headersTimeout, TIMEOUT_HEADERS)
  16052. }
  16053. }
  16054. }
  16055. if (client[kBusy]) {
  16056. client[kNeedDrain] = 2
  16057. } else if (client[kNeedDrain] === 2) {
  16058. if (sync) {
  16059. client[kNeedDrain] = 1
  16060. process.nextTick(emitDrain, client)
  16061. } else {
  16062. emitDrain(client)
  16063. }
  16064. continue
  16065. }
  16066. if (client[kPending] === 0) {
  16067. return
  16068. }
  16069. if (client[kRunning] >= (client[kPipelining] || 1)) {
  16070. return
  16071. }
  16072. const request = client[kQueue][client[kPendingIdx]]
  16073. if (client[kUrl].protocol === 'https:' && client[kServerName] !== request.servername) {
  16074. if (client[kRunning] > 0) {
  16075. return
  16076. }
  16077. client[kServerName] = request.servername
  16078. if (socket && socket.servername !== request.servername) {
  16079. util.destroy(socket, new InformationalError('servername changed'))
  16080. return
  16081. }
  16082. }
  16083. if (client[kConnecting]) {
  16084. return
  16085. }
  16086. if (!socket && !client[kHTTP2Session]) {
  16087. connect(client)
  16088. return
  16089. }
  16090. if (socket.destroyed || socket[kWriting] || socket[kReset] || socket[kBlocking]) {
  16091. return
  16092. }
  16093. if (client[kRunning] > 0 && !request.idempotent) {
  16094. // Non-idempotent request cannot be retried.
  16095. // Ensure that no other requests are inflight and
  16096. // could cause failure.
  16097. return
  16098. }
  16099. if (client[kRunning] > 0 && (request.upgrade || request.method === 'CONNECT')) {
  16100. // Don't dispatch an upgrade until all preceding requests have completed.
  16101. // A misbehaving server might upgrade the connection before all pipelined
  16102. // request has completed.
  16103. return
  16104. }
  16105. if (client[kRunning] > 0 && util.bodyLength(request.body) !== 0 &&
  16106. (util.isStream(request.body) || util.isAsyncIterable(request.body))) {
  16107. // Request with stream or iterator body can error while other requests
  16108. // are inflight and indirectly error those as well.
  16109. // Ensure this doesn't happen by waiting for inflight
  16110. // to complete before dispatching.
  16111. // Request with stream or iterator body cannot be retried.
  16112. // Ensure that no other requests are inflight and
  16113. // could cause failure.
  16114. return
  16115. }
  16116. if (!request.aborted && write(client, request)) {
  16117. client[kPendingIdx]++
  16118. } else {
  16119. client[kQueue].splice(client[kPendingIdx], 1)
  16120. }
  16121. }
  16122. }
  16123. // https://www.rfc-editor.org/rfc/rfc7230#section-3.3.2
  16124. function shouldSendContentLength (method) {
  16125. return method !== 'GET' && method !== 'HEAD' && method !== 'OPTIONS' && method !== 'TRACE' && method !== 'CONNECT'
  16126. }
  16127. function write (client, request) {
  16128. if (client[kHTTPConnVersion] === 'h2') {
  16129. writeH2(client, client[kHTTP2Session], request)
  16130. return
  16131. }
  16132. const { body, method, path, host, upgrade, headers, blocking, reset } = request
  16133. // https://tools.ietf.org/html/rfc7231#section-4.3.1
  16134. // https://tools.ietf.org/html/rfc7231#section-4.3.2
  16135. // https://tools.ietf.org/html/rfc7231#section-4.3.5
  16136. // Sending a payload body on a request that does not
  16137. // expect it can cause undefined behavior on some
  16138. // servers and corrupt connection state. Do not
  16139. // re-use the connection for further requests.
  16140. const expectsPayload = (
  16141. method === 'PUT' ||
  16142. method === 'POST' ||
  16143. method === 'PATCH'
  16144. )
  16145. if (body && typeof body.read === 'function') {
  16146. // Try to read EOF in order to get length.
  16147. body.read(0)
  16148. }
  16149. const bodyLength = util.bodyLength(body)
  16150. let contentLength = bodyLength
  16151. if (contentLength === null) {
  16152. contentLength = request.contentLength
  16153. }
  16154. if (contentLength === 0 && !expectsPayload) {
  16155. // https://tools.ietf.org/html/rfc7230#section-3.3.2
  16156. // A user agent SHOULD NOT send a Content-Length header field when
  16157. // the request message does not contain a payload body and the method
  16158. // semantics do not anticipate such a body.
  16159. contentLength = null
  16160. }
  16161. // https://github.com/nodejs/undici/issues/2046
  16162. // A user agent may send a Content-Length header with 0 value, this should be allowed.
  16163. if (shouldSendContentLength(method) && contentLength > 0 && request.contentLength !== null && request.contentLength !== contentLength) {
  16164. if (client[kStrictContentLength]) {
  16165. errorRequest(client, request, new RequestContentLengthMismatchError())
  16166. return false
  16167. }
  16168. process.emitWarning(new RequestContentLengthMismatchError())
  16169. }
  16170. const socket = client[kSocket]
  16171. try {
  16172. request.onConnect((err) => {
  16173. if (request.aborted || request.completed) {
  16174. return
  16175. }
  16176. errorRequest(client, request, err || new RequestAbortedError())
  16177. util.destroy(socket, new InformationalError('aborted'))
  16178. })
  16179. } catch (err) {
  16180. errorRequest(client, request, err)
  16181. }
  16182. if (request.aborted) {
  16183. return false
  16184. }
  16185. if (method === 'HEAD') {
  16186. // https://github.com/mcollina/undici/issues/258
  16187. // Close after a HEAD request to interop with misbehaving servers
  16188. // that may send a body in the response.
  16189. socket[kReset] = true
  16190. }
  16191. if (upgrade || method === 'CONNECT') {
  16192. // On CONNECT or upgrade, block pipeline from dispatching further
  16193. // requests on this connection.
  16194. socket[kReset] = true
  16195. }
  16196. if (reset != null) {
  16197. socket[kReset] = reset
  16198. }
  16199. if (client[kMaxRequests] && socket[kCounter]++ >= client[kMaxRequests]) {
  16200. socket[kReset] = true
  16201. }
  16202. if (blocking) {
  16203. socket[kBlocking] = true
  16204. }
  16205. let header = `${method} ${path} HTTP/1.1\r\n`
  16206. if (typeof host === 'string') {
  16207. header += `host: ${host}\r\n`
  16208. } else {
  16209. header += client[kHostHeader]
  16210. }
  16211. if (upgrade) {
  16212. header += `connection: upgrade\r\nupgrade: ${upgrade}\r\n`
  16213. } else if (client[kPipelining] && !socket[kReset]) {
  16214. header += 'connection: keep-alive\r\n'
  16215. } else {
  16216. header += 'connection: close\r\n'
  16217. }
  16218. if (headers) {
  16219. header += headers
  16220. }
  16221. if (channels.sendHeaders.hasSubscribers) {
  16222. channels.sendHeaders.publish({ request, headers: header, socket })
  16223. }
  16224. /* istanbul ignore else: assertion */
  16225. if (!body || bodyLength === 0) {
  16226. if (contentLength === 0) {
  16227. socket.write(`${header}content-length: 0\r\n\r\n`, 'latin1')
  16228. } else {
  16229. assert(contentLength === null, 'no body must not have content length')
  16230. socket.write(`${header}\r\n`, 'latin1')
  16231. }
  16232. request.onRequestSent()
  16233. } else if (util.isBuffer(body)) {
  16234. assert(contentLength === body.byteLength, 'buffer body must have content length')
  16235. socket.cork()
  16236. socket.write(`${header}content-length: ${contentLength}\r\n\r\n`, 'latin1')
  16237. socket.write(body)
  16238. socket.uncork()
  16239. request.onBodySent(body)
  16240. request.onRequestSent()
  16241. if (!expectsPayload) {
  16242. socket[kReset] = true
  16243. }
  16244. } else if (util.isBlobLike(body)) {
  16245. if (typeof body.stream === 'function') {
  16246. writeIterable({ body: body.stream(), client, request, socket, contentLength, header, expectsPayload })
  16247. } else {
  16248. writeBlob({ body, client, request, socket, contentLength, header, expectsPayload })
  16249. }
  16250. } else if (util.isStream(body)) {
  16251. writeStream({ body, client, request, socket, contentLength, header, expectsPayload })
  16252. } else if (util.isIterable(body)) {
  16253. writeIterable({ body, client, request, socket, contentLength, header, expectsPayload })
  16254. } else {
  16255. assert(false)
  16256. }
  16257. return true
  16258. }
  16259. function writeH2 (client, session, request) {
  16260. const { body, method, path, host, upgrade, expectContinue, signal, headers: reqHeaders } = request
  16261. let headers
  16262. if (typeof reqHeaders === 'string') headers = Request[kHTTP2CopyHeaders](reqHeaders.trim())
  16263. else headers = reqHeaders
  16264. if (upgrade) {
  16265. errorRequest(client, request, new Error('Upgrade not supported for H2'))
  16266. return false
  16267. }
  16268. try {
  16269. // TODO(HTTP/2): Should we call onConnect immediately or on stream ready event?
  16270. request.onConnect((err) => {
  16271. if (request.aborted || request.completed) {
  16272. return
  16273. }
  16274. errorRequest(client, request, err || new RequestAbortedError())
  16275. })
  16276. } catch (err) {
  16277. errorRequest(client, request, err)
  16278. }
  16279. if (request.aborted) {
  16280. return false
  16281. }
  16282. /** @type {import('node:http2').ClientHttp2Stream} */
  16283. let stream
  16284. const h2State = client[kHTTP2SessionState]
  16285. headers[HTTP2_HEADER_AUTHORITY] = host || client[kHost]
  16286. headers[HTTP2_HEADER_METHOD] = method
  16287. if (method === 'CONNECT') {
  16288. session.ref()
  16289. // we are already connected, streams are pending, first request
  16290. // will create a new stream. We trigger a request to create the stream and wait until
  16291. // `ready` event is triggered
  16292. // We disabled endStream to allow the user to write to the stream
  16293. stream = session.request(headers, { endStream: false, signal })
  16294. if (stream.id && !stream.pending) {
  16295. request.onUpgrade(null, null, stream)
  16296. ++h2State.openStreams
  16297. } else {
  16298. stream.once('ready', () => {
  16299. request.onUpgrade(null, null, stream)
  16300. ++h2State.openStreams
  16301. })
  16302. }
  16303. stream.once('close', () => {
  16304. h2State.openStreams -= 1
  16305. // TODO(HTTP/2): unref only if current streams count is 0
  16306. if (h2State.openStreams === 0) session.unref()
  16307. })
  16308. return true
  16309. }
  16310. // https://tools.ietf.org/html/rfc7540#section-8.3
  16311. // :path and :scheme headers must be omited when sending CONNECT
  16312. headers[HTTP2_HEADER_PATH] = path
  16313. headers[HTTP2_HEADER_SCHEME] = 'https'
  16314. // https://tools.ietf.org/html/rfc7231#section-4.3.1
  16315. // https://tools.ietf.org/html/rfc7231#section-4.3.2
  16316. // https://tools.ietf.org/html/rfc7231#section-4.3.5
  16317. // Sending a payload body on a request that does not
  16318. // expect it can cause undefined behavior on some
  16319. // servers and corrupt connection state. Do not
  16320. // re-use the connection for further requests.
  16321. const expectsPayload = (
  16322. method === 'PUT' ||
  16323. method === 'POST' ||
  16324. method === 'PATCH'
  16325. )
  16326. if (body && typeof body.read === 'function') {
  16327. // Try to read EOF in order to get length.
  16328. body.read(0)
  16329. }
  16330. let contentLength = util.bodyLength(body)
  16331. if (contentLength == null) {
  16332. contentLength = request.contentLength
  16333. }
  16334. if (contentLength === 0 || !expectsPayload) {
  16335. // https://tools.ietf.org/html/rfc7230#section-3.3.2
  16336. // A user agent SHOULD NOT send a Content-Length header field when
  16337. // the request message does not contain a payload body and the method
  16338. // semantics do not anticipate such a body.
  16339. contentLength = null
  16340. }
  16341. // https://github.com/nodejs/undici/issues/2046
  16342. // A user agent may send a Content-Length header with 0 value, this should be allowed.
  16343. if (shouldSendContentLength(method) && contentLength > 0 && request.contentLength != null && request.contentLength !== contentLength) {
  16344. if (client[kStrictContentLength]) {
  16345. errorRequest(client, request, new RequestContentLengthMismatchError())
  16346. return false
  16347. }
  16348. process.emitWarning(new RequestContentLengthMismatchError())
  16349. }
  16350. if (contentLength != null) {
  16351. assert(body, 'no body must not have content length')
  16352. headers[HTTP2_HEADER_CONTENT_LENGTH] = `${contentLength}`
  16353. }
  16354. session.ref()
  16355. const shouldEndStream = method === 'GET' || method === 'HEAD'
  16356. if (expectContinue) {
  16357. headers[HTTP2_HEADER_EXPECT] = '100-continue'
  16358. stream = session.request(headers, { endStream: shouldEndStream, signal })
  16359. stream.once('continue', writeBodyH2)
  16360. } else {
  16361. stream = session.request(headers, {
  16362. endStream: shouldEndStream,
  16363. signal
  16364. })
  16365. writeBodyH2()
  16366. }
  16367. // Increment counter as we have new several streams open
  16368. ++h2State.openStreams
  16369. stream.once('response', headers => {
  16370. const { [HTTP2_HEADER_STATUS]: statusCode, ...realHeaders } = headers
  16371. if (request.onHeaders(Number(statusCode), realHeaders, stream.resume.bind(stream), '') === false) {
  16372. stream.pause()
  16373. }
  16374. })
  16375. stream.once('end', () => {
  16376. request.onComplete([])
  16377. })
  16378. stream.on('data', (chunk) => {
  16379. if (request.onData(chunk) === false) {
  16380. stream.pause()
  16381. }
  16382. })
  16383. stream.once('close', () => {
  16384. h2State.openStreams -= 1
  16385. // TODO(HTTP/2): unref only if current streams count is 0
  16386. if (h2State.openStreams === 0) {
  16387. session.unref()
  16388. }
  16389. })
  16390. stream.once('error', function (err) {
  16391. if (client[kHTTP2Session] && !client[kHTTP2Session].destroyed && !this.closed && !this.destroyed) {
  16392. h2State.streams -= 1
  16393. util.destroy(stream, err)
  16394. }
  16395. })
  16396. stream.once('frameError', (type, code) => {
  16397. const err = new InformationalError(`HTTP/2: "frameError" received - type ${type}, code ${code}`)
  16398. errorRequest(client, request, err)
  16399. if (client[kHTTP2Session] && !client[kHTTP2Session].destroyed && !this.closed && !this.destroyed) {
  16400. h2State.streams -= 1
  16401. util.destroy(stream, err)
  16402. }
  16403. })
  16404. // stream.on('aborted', () => {
  16405. // // TODO(HTTP/2): Support aborted
  16406. // })
  16407. // stream.on('timeout', () => {
  16408. // // TODO(HTTP/2): Support timeout
  16409. // })
  16410. // stream.on('push', headers => {
  16411. // // TODO(HTTP/2): Suppor push
  16412. // })
  16413. // stream.on('trailers', headers => {
  16414. // // TODO(HTTP/2): Support trailers
  16415. // })
  16416. return true
  16417. function writeBodyH2 () {
  16418. /* istanbul ignore else: assertion */
  16419. if (!body) {
  16420. request.onRequestSent()
  16421. } else if (util.isBuffer(body)) {
  16422. assert(contentLength === body.byteLength, 'buffer body must have content length')
  16423. stream.cork()
  16424. stream.write(body)
  16425. stream.uncork()
  16426. stream.end()
  16427. request.onBodySent(body)
  16428. request.onRequestSent()
  16429. } else if (util.isBlobLike(body)) {
  16430. if (typeof body.stream === 'function') {
  16431. writeIterable({
  16432. client,
  16433. request,
  16434. contentLength,
  16435. h2stream: stream,
  16436. expectsPayload,
  16437. body: body.stream(),
  16438. socket: client[kSocket],
  16439. header: ''
  16440. })
  16441. } else {
  16442. writeBlob({
  16443. body,
  16444. client,
  16445. request,
  16446. contentLength,
  16447. expectsPayload,
  16448. h2stream: stream,
  16449. header: '',
  16450. socket: client[kSocket]
  16451. })
  16452. }
  16453. } else if (util.isStream(body)) {
  16454. writeStream({
  16455. body,
  16456. client,
  16457. request,
  16458. contentLength,
  16459. expectsPayload,
  16460. socket: client[kSocket],
  16461. h2stream: stream,
  16462. header: ''
  16463. })
  16464. } else if (util.isIterable(body)) {
  16465. writeIterable({
  16466. body,
  16467. client,
  16468. request,
  16469. contentLength,
  16470. expectsPayload,
  16471. header: '',
  16472. h2stream: stream,
  16473. socket: client[kSocket]
  16474. })
  16475. } else {
  16476. assert(false)
  16477. }
  16478. }
  16479. }
  16480. function writeStream ({ h2stream, body, client, request, socket, contentLength, header, expectsPayload }) {
  16481. assert(contentLength !== 0 || client[kRunning] === 0, 'stream body cannot be pipelined')
  16482. if (client[kHTTPConnVersion] === 'h2') {
  16483. // For HTTP/2, is enough to pipe the stream
  16484. const pipe = pipeline(
  16485. body,
  16486. h2stream,
  16487. (err) => {
  16488. if (err) {
  16489. util.destroy(body, err)
  16490. util.destroy(h2stream, err)
  16491. } else {
  16492. request.onRequestSent()
  16493. }
  16494. }
  16495. )
  16496. pipe.on('data', onPipeData)
  16497. pipe.once('end', () => {
  16498. pipe.removeListener('data', onPipeData)
  16499. util.destroy(pipe)
  16500. })
  16501. function onPipeData (chunk) {
  16502. request.onBodySent(chunk)
  16503. }
  16504. return
  16505. }
  16506. let finished = false
  16507. const writer = new AsyncWriter({ socket, request, contentLength, client, expectsPayload, header })
  16508. const onData = function (chunk) {
  16509. if (finished) {
  16510. return
  16511. }
  16512. try {
  16513. if (!writer.write(chunk) && this.pause) {
  16514. this.pause()
  16515. }
  16516. } catch (err) {
  16517. util.destroy(this, err)
  16518. }
  16519. }
  16520. const onDrain = function () {
  16521. if (finished) {
  16522. return
  16523. }
  16524. if (body.resume) {
  16525. body.resume()
  16526. }
  16527. }
  16528. const onAbort = function () {
  16529. if (finished) {
  16530. return
  16531. }
  16532. const err = new RequestAbortedError()
  16533. queueMicrotask(() => onFinished(err))
  16534. }
  16535. const onFinished = function (err) {
  16536. if (finished) {
  16537. return
  16538. }
  16539. finished = true
  16540. assert(socket.destroyed || (socket[kWriting] && client[kRunning] <= 1))
  16541. socket
  16542. .off('drain', onDrain)
  16543. .off('error', onFinished)
  16544. body
  16545. .removeListener('data', onData)
  16546. .removeListener('end', onFinished)
  16547. .removeListener('error', onFinished)
  16548. .removeListener('close', onAbort)
  16549. if (!err) {
  16550. try {
  16551. writer.end()
  16552. } catch (er) {
  16553. err = er
  16554. }
  16555. }
  16556. writer.destroy(err)
  16557. if (err && (err.code !== 'UND_ERR_INFO' || err.message !== 'reset')) {
  16558. util.destroy(body, err)
  16559. } else {
  16560. util.destroy(body)
  16561. }
  16562. }
  16563. body
  16564. .on('data', onData)
  16565. .on('end', onFinished)
  16566. .on('error', onFinished)
  16567. .on('close', onAbort)
  16568. if (body.resume) {
  16569. body.resume()
  16570. }
  16571. socket
  16572. .on('drain', onDrain)
  16573. .on('error', onFinished)
  16574. }
  16575. async function writeBlob ({ h2stream, body, client, request, socket, contentLength, header, expectsPayload }) {
  16576. assert(contentLength === body.size, 'blob body must have content length')
  16577. const isH2 = client[kHTTPConnVersion] === 'h2'
  16578. try {
  16579. if (contentLength != null && contentLength !== body.size) {
  16580. throw new RequestContentLengthMismatchError()
  16581. }
  16582. const buffer = Buffer.from(await body.arrayBuffer())
  16583. if (isH2) {
  16584. h2stream.cork()
  16585. h2stream.write(buffer)
  16586. h2stream.uncork()
  16587. } else {
  16588. socket.cork()
  16589. socket.write(`${header}content-length: ${contentLength}\r\n\r\n`, 'latin1')
  16590. socket.write(buffer)
  16591. socket.uncork()
  16592. }
  16593. request.onBodySent(buffer)
  16594. request.onRequestSent()
  16595. if (!expectsPayload) {
  16596. socket[kReset] = true
  16597. }
  16598. resume(client)
  16599. } catch (err) {
  16600. util.destroy(isH2 ? h2stream : socket, err)
  16601. }
  16602. }
  16603. async function writeIterable ({ h2stream, body, client, request, socket, contentLength, header, expectsPayload }) {
  16604. assert(contentLength !== 0 || client[kRunning] === 0, 'iterator body cannot be pipelined')
  16605. let callback = null
  16606. function onDrain () {
  16607. if (callback) {
  16608. const cb = callback
  16609. callback = null
  16610. cb()
  16611. }
  16612. }
  16613. const waitForDrain = () => new Promise((resolve, reject) => {
  16614. assert(callback === null)
  16615. if (socket[kError]) {
  16616. reject(socket[kError])
  16617. } else {
  16618. callback = resolve
  16619. }
  16620. })
  16621. if (client[kHTTPConnVersion] === 'h2') {
  16622. h2stream
  16623. .on('close', onDrain)
  16624. .on('drain', onDrain)
  16625. try {
  16626. // It's up to the user to somehow abort the async iterable.
  16627. for await (const chunk of body) {
  16628. if (socket[kError]) {
  16629. throw socket[kError]
  16630. }
  16631. const res = h2stream.write(chunk)
  16632. request.onBodySent(chunk)
  16633. if (!res) {
  16634. await waitForDrain()
  16635. }
  16636. }
  16637. } catch (err) {
  16638. h2stream.destroy(err)
  16639. } finally {
  16640. request.onRequestSent()
  16641. h2stream.end()
  16642. h2stream
  16643. .off('close', onDrain)
  16644. .off('drain', onDrain)
  16645. }
  16646. return
  16647. }
  16648. socket
  16649. .on('close', onDrain)
  16650. .on('drain', onDrain)
  16651. const writer = new AsyncWriter({ socket, request, contentLength, client, expectsPayload, header })
  16652. try {
  16653. // It's up to the user to somehow abort the async iterable.
  16654. for await (const chunk of body) {
  16655. if (socket[kError]) {
  16656. throw socket[kError]
  16657. }
  16658. if (!writer.write(chunk)) {
  16659. await waitForDrain()
  16660. }
  16661. }
  16662. writer.end()
  16663. } catch (err) {
  16664. writer.destroy(err)
  16665. } finally {
  16666. socket
  16667. .off('close', onDrain)
  16668. .off('drain', onDrain)
  16669. }
  16670. }
  16671. class AsyncWriter {
  16672. constructor ({ socket, request, contentLength, client, expectsPayload, header }) {
  16673. this.socket = socket
  16674. this.request = request
  16675. this.contentLength = contentLength
  16676. this.client = client
  16677. this.bytesWritten = 0
  16678. this.expectsPayload = expectsPayload
  16679. this.header = header
  16680. socket[kWriting] = true
  16681. }
  16682. write (chunk) {
  16683. const { socket, request, contentLength, client, bytesWritten, expectsPayload, header } = this
  16684. if (socket[kError]) {
  16685. throw socket[kError]
  16686. }
  16687. if (socket.destroyed) {
  16688. return false
  16689. }
  16690. const len = Buffer.byteLength(chunk)
  16691. if (!len) {
  16692. return true
  16693. }
  16694. // We should defer writing chunks.
  16695. if (contentLength !== null && bytesWritten + len > contentLength) {
  16696. if (client[kStrictContentLength]) {
  16697. throw new RequestContentLengthMismatchError()
  16698. }
  16699. process.emitWarning(new RequestContentLengthMismatchError())
  16700. }
  16701. socket.cork()
  16702. if (bytesWritten === 0) {
  16703. if (!expectsPayload) {
  16704. socket[kReset] = true
  16705. }
  16706. if (contentLength === null) {
  16707. socket.write(`${header}transfer-encoding: chunked\r\n`, 'latin1')
  16708. } else {
  16709. socket.write(`${header}content-length: ${contentLength}\r\n\r\n`, 'latin1')
  16710. }
  16711. }
  16712. if (contentLength === null) {
  16713. socket.write(`\r\n${len.toString(16)}\r\n`, 'latin1')
  16714. }
  16715. this.bytesWritten += len
  16716. const ret = socket.write(chunk)
  16717. socket.uncork()
  16718. request.onBodySent(chunk)
  16719. if (!ret) {
  16720. if (socket[kParser].timeout && socket[kParser].timeoutType === TIMEOUT_HEADERS) {
  16721. // istanbul ignore else: only for jest
  16722. if (socket[kParser].timeout.refresh) {
  16723. socket[kParser].timeout.refresh()
  16724. }
  16725. }
  16726. }
  16727. return ret
  16728. }
  16729. end () {
  16730. const { socket, contentLength, client, bytesWritten, expectsPayload, header, request } = this
  16731. request.onRequestSent()
  16732. socket[kWriting] = false
  16733. if (socket[kError]) {
  16734. throw socket[kError]
  16735. }
  16736. if (socket.destroyed) {
  16737. return
  16738. }
  16739. if (bytesWritten === 0) {
  16740. if (expectsPayload) {
  16741. // https://tools.ietf.org/html/rfc7230#section-3.3.2
  16742. // A user agent SHOULD send a Content-Length in a request message when
  16743. // no Transfer-Encoding is sent and the request method defines a meaning
  16744. // for an enclosed payload body.
  16745. socket.write(`${header}content-length: 0\r\n\r\n`, 'latin1')
  16746. } else {
  16747. socket.write(`${header}\r\n`, 'latin1')
  16748. }
  16749. } else if (contentLength === null) {
  16750. socket.write('\r\n0\r\n\r\n', 'latin1')
  16751. }
  16752. if (contentLength !== null && bytesWritten !== contentLength) {
  16753. if (client[kStrictContentLength]) {
  16754. throw new RequestContentLengthMismatchError()
  16755. } else {
  16756. process.emitWarning(new RequestContentLengthMismatchError())
  16757. }
  16758. }
  16759. if (socket[kParser].timeout && socket[kParser].timeoutType === TIMEOUT_HEADERS) {
  16760. // istanbul ignore else: only for jest
  16761. if (socket[kParser].timeout.refresh) {
  16762. socket[kParser].timeout.refresh()
  16763. }
  16764. }
  16765. resume(client)
  16766. }
  16767. destroy (err) {
  16768. const { socket, client } = this
  16769. socket[kWriting] = false
  16770. if (err) {
  16771. assert(client[kRunning] <= 1, 'pipeline should only contain this request')
  16772. util.destroy(socket, err)
  16773. }
  16774. }
  16775. }
  16776. function errorRequest (client, request, err) {
  16777. try {
  16778. request.onError(err)
  16779. assert(request.aborted)
  16780. } catch (err) {
  16781. client.emit('error', err)
  16782. }
  16783. }
  16784. module.exports = Client
  16785. /***/ }),
  16786. /***/ 6436:
  16787. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  16788. "use strict";
  16789. /* istanbul ignore file: only for Node 12 */
  16790. const { kConnected, kSize } = __nccwpck_require__(2785)
  16791. class CompatWeakRef {
  16792. constructor (value) {
  16793. this.value = value
  16794. }
  16795. deref () {
  16796. return this.value[kConnected] === 0 && this.value[kSize] === 0
  16797. ? undefined
  16798. : this.value
  16799. }
  16800. }
  16801. class CompatFinalizer {
  16802. constructor (finalizer) {
  16803. this.finalizer = finalizer
  16804. }
  16805. register (dispatcher, key) {
  16806. if (dispatcher.on) {
  16807. dispatcher.on('disconnect', () => {
  16808. if (dispatcher[kConnected] === 0 && dispatcher[kSize] === 0) {
  16809. this.finalizer(key)
  16810. }
  16811. })
  16812. }
  16813. }
  16814. }
  16815. module.exports = function () {
  16816. // FIXME: remove workaround when the Node bug is fixed
  16817. // https://github.com/nodejs/node/issues/49344#issuecomment-1741776308
  16818. if (process.env.NODE_V8_COVERAGE) {
  16819. return {
  16820. WeakRef: CompatWeakRef,
  16821. FinalizationRegistry: CompatFinalizer
  16822. }
  16823. }
  16824. return {
  16825. WeakRef: global.WeakRef || CompatWeakRef,
  16826. FinalizationRegistry: global.FinalizationRegistry || CompatFinalizer
  16827. }
  16828. }
  16829. /***/ }),
  16830. /***/ 663:
  16831. /***/ ((module) => {
  16832. "use strict";
  16833. // https://wicg.github.io/cookie-store/#cookie-maximum-attribute-value-size
  16834. const maxAttributeValueSize = 1024
  16835. // https://wicg.github.io/cookie-store/#cookie-maximum-name-value-pair-size
  16836. const maxNameValuePairSize = 4096
  16837. module.exports = {
  16838. maxAttributeValueSize,
  16839. maxNameValuePairSize
  16840. }
  16841. /***/ }),
  16842. /***/ 1724:
  16843. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  16844. "use strict";
  16845. const { parseSetCookie } = __nccwpck_require__(4408)
  16846. const { stringify, getHeadersList } = __nccwpck_require__(3121)
  16847. const { webidl } = __nccwpck_require__(1744)
  16848. const { Headers } = __nccwpck_require__(554)
  16849. /**
  16850. * @typedef {Object} Cookie
  16851. * @property {string} name
  16852. * @property {string} value
  16853. * @property {Date|number|undefined} expires
  16854. * @property {number|undefined} maxAge
  16855. * @property {string|undefined} domain
  16856. * @property {string|undefined} path
  16857. * @property {boolean|undefined} secure
  16858. * @property {boolean|undefined} httpOnly
  16859. * @property {'Strict'|'Lax'|'None'} sameSite
  16860. * @property {string[]} unparsed
  16861. */
  16862. /**
  16863. * @param {Headers} headers
  16864. * @returns {Record<string, string>}
  16865. */
  16866. function getCookies (headers) {
  16867. webidl.argumentLengthCheck(arguments, 1, { header: 'getCookies' })
  16868. webidl.brandCheck(headers, Headers, { strict: false })
  16869. const cookie = headers.get('cookie')
  16870. const out = {}
  16871. if (!cookie) {
  16872. return out
  16873. }
  16874. for (const piece of cookie.split(';')) {
  16875. const [name, ...value] = piece.split('=')
  16876. out[name.trim()] = value.join('=')
  16877. }
  16878. return out
  16879. }
  16880. /**
  16881. * @param {Headers} headers
  16882. * @param {string} name
  16883. * @param {{ path?: string, domain?: string }|undefined} attributes
  16884. * @returns {void}
  16885. */
  16886. function deleteCookie (headers, name, attributes) {
  16887. webidl.argumentLengthCheck(arguments, 2, { header: 'deleteCookie' })
  16888. webidl.brandCheck(headers, Headers, { strict: false })
  16889. name = webidl.converters.DOMString(name)
  16890. attributes = webidl.converters.DeleteCookieAttributes(attributes)
  16891. // Matches behavior of
  16892. // https://github.com/denoland/deno_std/blob/63827b16330b82489a04614027c33b7904e08be5/http/cookie.ts#L278
  16893. setCookie(headers, {
  16894. name,
  16895. value: '',
  16896. expires: new Date(0),
  16897. ...attributes
  16898. })
  16899. }
  16900. /**
  16901. * @param {Headers} headers
  16902. * @returns {Cookie[]}
  16903. */
  16904. function getSetCookies (headers) {
  16905. webidl.argumentLengthCheck(arguments, 1, { header: 'getSetCookies' })
  16906. webidl.brandCheck(headers, Headers, { strict: false })
  16907. const cookies = getHeadersList(headers).cookies
  16908. if (!cookies) {
  16909. return []
  16910. }
  16911. // In older versions of undici, cookies is a list of name:value.
  16912. return cookies.map((pair) => parseSetCookie(Array.isArray(pair) ? pair[1] : pair))
  16913. }
  16914. /**
  16915. * @param {Headers} headers
  16916. * @param {Cookie} cookie
  16917. * @returns {void}
  16918. */
  16919. function setCookie (headers, cookie) {
  16920. webidl.argumentLengthCheck(arguments, 2, { header: 'setCookie' })
  16921. webidl.brandCheck(headers, Headers, { strict: false })
  16922. cookie = webidl.converters.Cookie(cookie)
  16923. const str = stringify(cookie)
  16924. if (str) {
  16925. headers.append('Set-Cookie', stringify(cookie))
  16926. }
  16927. }
  16928. webidl.converters.DeleteCookieAttributes = webidl.dictionaryConverter([
  16929. {
  16930. converter: webidl.nullableConverter(webidl.converters.DOMString),
  16931. key: 'path',
  16932. defaultValue: null
  16933. },
  16934. {
  16935. converter: webidl.nullableConverter(webidl.converters.DOMString),
  16936. key: 'domain',
  16937. defaultValue: null
  16938. }
  16939. ])
  16940. webidl.converters.Cookie = webidl.dictionaryConverter([
  16941. {
  16942. converter: webidl.converters.DOMString,
  16943. key: 'name'
  16944. },
  16945. {
  16946. converter: webidl.converters.DOMString,
  16947. key: 'value'
  16948. },
  16949. {
  16950. converter: webidl.nullableConverter((value) => {
  16951. if (typeof value === 'number') {
  16952. return webidl.converters['unsigned long long'](value)
  16953. }
  16954. return new Date(value)
  16955. }),
  16956. key: 'expires',
  16957. defaultValue: null
  16958. },
  16959. {
  16960. converter: webidl.nullableConverter(webidl.converters['long long']),
  16961. key: 'maxAge',
  16962. defaultValue: null
  16963. },
  16964. {
  16965. converter: webidl.nullableConverter(webidl.converters.DOMString),
  16966. key: 'domain',
  16967. defaultValue: null
  16968. },
  16969. {
  16970. converter: webidl.nullableConverter(webidl.converters.DOMString),
  16971. key: 'path',
  16972. defaultValue: null
  16973. },
  16974. {
  16975. converter: webidl.nullableConverter(webidl.converters.boolean),
  16976. key: 'secure',
  16977. defaultValue: null
  16978. },
  16979. {
  16980. converter: webidl.nullableConverter(webidl.converters.boolean),
  16981. key: 'httpOnly',
  16982. defaultValue: null
  16983. },
  16984. {
  16985. converter: webidl.converters.USVString,
  16986. key: 'sameSite',
  16987. allowedValues: ['Strict', 'Lax', 'None']
  16988. },
  16989. {
  16990. converter: webidl.sequenceConverter(webidl.converters.DOMString),
  16991. key: 'unparsed',
  16992. defaultValue: []
  16993. }
  16994. ])
  16995. module.exports = {
  16996. getCookies,
  16997. deleteCookie,
  16998. getSetCookies,
  16999. setCookie
  17000. }
  17001. /***/ }),
  17002. /***/ 4408:
  17003. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  17004. "use strict";
  17005. const { maxNameValuePairSize, maxAttributeValueSize } = __nccwpck_require__(663)
  17006. const { isCTLExcludingHtab } = __nccwpck_require__(3121)
  17007. const { collectASequenceOfCodePointsFast } = __nccwpck_require__(685)
  17008. const assert = __nccwpck_require__(9491)
  17009. /**
  17010. * @description Parses the field-value attributes of a set-cookie header string.
  17011. * @see https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4
  17012. * @param {string} header
  17013. * @returns if the header is invalid, null will be returned
  17014. */
  17015. function parseSetCookie (header) {
  17016. // 1. If the set-cookie-string contains a %x00-08 / %x0A-1F / %x7F
  17017. // character (CTL characters excluding HTAB): Abort these steps and
  17018. // ignore the set-cookie-string entirely.
  17019. if (isCTLExcludingHtab(header)) {
  17020. return null
  17021. }
  17022. let nameValuePair = ''
  17023. let unparsedAttributes = ''
  17024. let name = ''
  17025. let value = ''
  17026. // 2. If the set-cookie-string contains a %x3B (";") character:
  17027. if (header.includes(';')) {
  17028. // 1. The name-value-pair string consists of the characters up to,
  17029. // but not including, the first %x3B (";"), and the unparsed-
  17030. // attributes consist of the remainder of the set-cookie-string
  17031. // (including the %x3B (";") in question).
  17032. const position = { position: 0 }
  17033. nameValuePair = collectASequenceOfCodePointsFast(';', header, position)
  17034. unparsedAttributes = header.slice(position.position)
  17035. } else {
  17036. // Otherwise:
  17037. // 1. The name-value-pair string consists of all the characters
  17038. // contained in the set-cookie-string, and the unparsed-
  17039. // attributes is the empty string.
  17040. nameValuePair = header
  17041. }
  17042. // 3. If the name-value-pair string lacks a %x3D ("=") character, then
  17043. // the name string is empty, and the value string is the value of
  17044. // name-value-pair.
  17045. if (!nameValuePair.includes('=')) {
  17046. value = nameValuePair
  17047. } else {
  17048. // Otherwise, the name string consists of the characters up to, but
  17049. // not including, the first %x3D ("=") character, and the (possibly
  17050. // empty) value string consists of the characters after the first
  17051. // %x3D ("=") character.
  17052. const position = { position: 0 }
  17053. name = collectASequenceOfCodePointsFast(
  17054. '=',
  17055. nameValuePair,
  17056. position
  17057. )
  17058. value = nameValuePair.slice(position.position + 1)
  17059. }
  17060. // 4. Remove any leading or trailing WSP characters from the name
  17061. // string and the value string.
  17062. name = name.trim()
  17063. value = value.trim()
  17064. // 5. If the sum of the lengths of the name string and the value string
  17065. // is more than 4096 octets, abort these steps and ignore the set-
  17066. // cookie-string entirely.
  17067. if (name.length + value.length > maxNameValuePairSize) {
  17068. return null
  17069. }
  17070. // 6. The cookie-name is the name string, and the cookie-value is the
  17071. // value string.
  17072. return {
  17073. name, value, ...parseUnparsedAttributes(unparsedAttributes)
  17074. }
  17075. }
  17076. /**
  17077. * Parses the remaining attributes of a set-cookie header
  17078. * @see https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4
  17079. * @param {string} unparsedAttributes
  17080. * @param {[Object.<string, unknown>]={}} cookieAttributeList
  17081. */
  17082. function parseUnparsedAttributes (unparsedAttributes, cookieAttributeList = {}) {
  17083. // 1. If the unparsed-attributes string is empty, skip the rest of
  17084. // these steps.
  17085. if (unparsedAttributes.length === 0) {
  17086. return cookieAttributeList
  17087. }
  17088. // 2. Discard the first character of the unparsed-attributes (which
  17089. // will be a %x3B (";") character).
  17090. assert(unparsedAttributes[0] === ';')
  17091. unparsedAttributes = unparsedAttributes.slice(1)
  17092. let cookieAv = ''
  17093. // 3. If the remaining unparsed-attributes contains a %x3B (";")
  17094. // character:
  17095. if (unparsedAttributes.includes(';')) {
  17096. // 1. Consume the characters of the unparsed-attributes up to, but
  17097. // not including, the first %x3B (";") character.
  17098. cookieAv = collectASequenceOfCodePointsFast(
  17099. ';',
  17100. unparsedAttributes,
  17101. { position: 0 }
  17102. )
  17103. unparsedAttributes = unparsedAttributes.slice(cookieAv.length)
  17104. } else {
  17105. // Otherwise:
  17106. // 1. Consume the remainder of the unparsed-attributes.
  17107. cookieAv = unparsedAttributes
  17108. unparsedAttributes = ''
  17109. }
  17110. // Let the cookie-av string be the characters consumed in this step.
  17111. let attributeName = ''
  17112. let attributeValue = ''
  17113. // 4. If the cookie-av string contains a %x3D ("=") character:
  17114. if (cookieAv.includes('=')) {
  17115. // 1. The (possibly empty) attribute-name string consists of the
  17116. // characters up to, but not including, the first %x3D ("=")
  17117. // character, and the (possibly empty) attribute-value string
  17118. // consists of the characters after the first %x3D ("=")
  17119. // character.
  17120. const position = { position: 0 }
  17121. attributeName = collectASequenceOfCodePointsFast(
  17122. '=',
  17123. cookieAv,
  17124. position
  17125. )
  17126. attributeValue = cookieAv.slice(position.position + 1)
  17127. } else {
  17128. // Otherwise:
  17129. // 1. The attribute-name string consists of the entire cookie-av
  17130. // string, and the attribute-value string is empty.
  17131. attributeName = cookieAv
  17132. }
  17133. // 5. Remove any leading or trailing WSP characters from the attribute-
  17134. // name string and the attribute-value string.
  17135. attributeName = attributeName.trim()
  17136. attributeValue = attributeValue.trim()
  17137. // 6. If the attribute-value is longer than 1024 octets, ignore the
  17138. // cookie-av string and return to Step 1 of this algorithm.
  17139. if (attributeValue.length > maxAttributeValueSize) {
  17140. return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList)
  17141. }
  17142. // 7. Process the attribute-name and attribute-value according to the
  17143. // requirements in the following subsections. (Notice that
  17144. // attributes with unrecognized attribute-names are ignored.)
  17145. const attributeNameLowercase = attributeName.toLowerCase()
  17146. // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.1
  17147. // If the attribute-name case-insensitively matches the string
  17148. // "Expires", the user agent MUST process the cookie-av as follows.
  17149. if (attributeNameLowercase === 'expires') {
  17150. // 1. Let the expiry-time be the result of parsing the attribute-value
  17151. // as cookie-date (see Section 5.1.1).
  17152. const expiryTime = new Date(attributeValue)
  17153. // 2. If the attribute-value failed to parse as a cookie date, ignore
  17154. // the cookie-av.
  17155. cookieAttributeList.expires = expiryTime
  17156. } else if (attributeNameLowercase === 'max-age') {
  17157. // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.2
  17158. // If the attribute-name case-insensitively matches the string "Max-
  17159. // Age", the user agent MUST process the cookie-av as follows.
  17160. // 1. If the first character of the attribute-value is not a DIGIT or a
  17161. // "-" character, ignore the cookie-av.
  17162. const charCode = attributeValue.charCodeAt(0)
  17163. if ((charCode < 48 || charCode > 57) && attributeValue[0] !== '-') {
  17164. return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList)
  17165. }
  17166. // 2. If the remainder of attribute-value contains a non-DIGIT
  17167. // character, ignore the cookie-av.
  17168. if (!/^\d+$/.test(attributeValue)) {
  17169. return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList)
  17170. }
  17171. // 3. Let delta-seconds be the attribute-value converted to an integer.
  17172. const deltaSeconds = Number(attributeValue)
  17173. // 4. Let cookie-age-limit be the maximum age of the cookie (which
  17174. // SHOULD be 400 days or less, see Section 4.1.2.2).
  17175. // 5. Set delta-seconds to the smaller of its present value and cookie-
  17176. // age-limit.
  17177. // deltaSeconds = Math.min(deltaSeconds * 1000, maxExpiresMs)
  17178. // 6. If delta-seconds is less than or equal to zero (0), let expiry-
  17179. // time be the earliest representable date and time. Otherwise, let
  17180. // the expiry-time be the current date and time plus delta-seconds
  17181. // seconds.
  17182. // const expiryTime = deltaSeconds <= 0 ? Date.now() : Date.now() + deltaSeconds
  17183. // 7. Append an attribute to the cookie-attribute-list with an
  17184. // attribute-name of Max-Age and an attribute-value of expiry-time.
  17185. cookieAttributeList.maxAge = deltaSeconds
  17186. } else if (attributeNameLowercase === 'domain') {
  17187. // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.3
  17188. // If the attribute-name case-insensitively matches the string "Domain",
  17189. // the user agent MUST process the cookie-av as follows.
  17190. // 1. Let cookie-domain be the attribute-value.
  17191. let cookieDomain = attributeValue
  17192. // 2. If cookie-domain starts with %x2E ("."), let cookie-domain be
  17193. // cookie-domain without its leading %x2E (".").
  17194. if (cookieDomain[0] === '.') {
  17195. cookieDomain = cookieDomain.slice(1)
  17196. }
  17197. // 3. Convert the cookie-domain to lower case.
  17198. cookieDomain = cookieDomain.toLowerCase()
  17199. // 4. Append an attribute to the cookie-attribute-list with an
  17200. // attribute-name of Domain and an attribute-value of cookie-domain.
  17201. cookieAttributeList.domain = cookieDomain
  17202. } else if (attributeNameLowercase === 'path') {
  17203. // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.4
  17204. // If the attribute-name case-insensitively matches the string "Path",
  17205. // the user agent MUST process the cookie-av as follows.
  17206. // 1. If the attribute-value is empty or if the first character of the
  17207. // attribute-value is not %x2F ("/"):
  17208. let cookiePath = ''
  17209. if (attributeValue.length === 0 || attributeValue[0] !== '/') {
  17210. // 1. Let cookie-path be the default-path.
  17211. cookiePath = '/'
  17212. } else {
  17213. // Otherwise:
  17214. // 1. Let cookie-path be the attribute-value.
  17215. cookiePath = attributeValue
  17216. }
  17217. // 2. Append an attribute to the cookie-attribute-list with an
  17218. // attribute-name of Path and an attribute-value of cookie-path.
  17219. cookieAttributeList.path = cookiePath
  17220. } else if (attributeNameLowercase === 'secure') {
  17221. // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.5
  17222. // If the attribute-name case-insensitively matches the string "Secure",
  17223. // the user agent MUST append an attribute to the cookie-attribute-list
  17224. // with an attribute-name of Secure and an empty attribute-value.
  17225. cookieAttributeList.secure = true
  17226. } else if (attributeNameLowercase === 'httponly') {
  17227. // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.6
  17228. // If the attribute-name case-insensitively matches the string
  17229. // "HttpOnly", the user agent MUST append an attribute to the cookie-
  17230. // attribute-list with an attribute-name of HttpOnly and an empty
  17231. // attribute-value.
  17232. cookieAttributeList.httpOnly = true
  17233. } else if (attributeNameLowercase === 'samesite') {
  17234. // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.7
  17235. // If the attribute-name case-insensitively matches the string
  17236. // "SameSite", the user agent MUST process the cookie-av as follows:
  17237. // 1. Let enforcement be "Default".
  17238. let enforcement = 'Default'
  17239. const attributeValueLowercase = attributeValue.toLowerCase()
  17240. // 2. If cookie-av's attribute-value is a case-insensitive match for
  17241. // "None", set enforcement to "None".
  17242. if (attributeValueLowercase.includes('none')) {
  17243. enforcement = 'None'
  17244. }
  17245. // 3. If cookie-av's attribute-value is a case-insensitive match for
  17246. // "Strict", set enforcement to "Strict".
  17247. if (attributeValueLowercase.includes('strict')) {
  17248. enforcement = 'Strict'
  17249. }
  17250. // 4. If cookie-av's attribute-value is a case-insensitive match for
  17251. // "Lax", set enforcement to "Lax".
  17252. if (attributeValueLowercase.includes('lax')) {
  17253. enforcement = 'Lax'
  17254. }
  17255. // 5. Append an attribute to the cookie-attribute-list with an
  17256. // attribute-name of "SameSite" and an attribute-value of
  17257. // enforcement.
  17258. cookieAttributeList.sameSite = enforcement
  17259. } else {
  17260. cookieAttributeList.unparsed ??= []
  17261. cookieAttributeList.unparsed.push(`${attributeName}=${attributeValue}`)
  17262. }
  17263. // 8. Return to Step 1 of this algorithm.
  17264. return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList)
  17265. }
  17266. module.exports = {
  17267. parseSetCookie,
  17268. parseUnparsedAttributes
  17269. }
  17270. /***/ }),
  17271. /***/ 3121:
  17272. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  17273. "use strict";
  17274. const assert = __nccwpck_require__(9491)
  17275. const { kHeadersList } = __nccwpck_require__(2785)
  17276. function isCTLExcludingHtab (value) {
  17277. if (value.length === 0) {
  17278. return false
  17279. }
  17280. for (const char of value) {
  17281. const code = char.charCodeAt(0)
  17282. if (
  17283. (code >= 0x00 || code <= 0x08) ||
  17284. (code >= 0x0A || code <= 0x1F) ||
  17285. code === 0x7F
  17286. ) {
  17287. return false
  17288. }
  17289. }
  17290. }
  17291. /**
  17292. CHAR = <any US-ASCII character (octets 0 - 127)>
  17293. token = 1*<any CHAR except CTLs or separators>
  17294. separators = "(" | ")" | "<" | ">" | "@"
  17295. | "," | ";" | ":" | "\" | <">
  17296. | "/" | "[" | "]" | "?" | "="
  17297. | "{" | "}" | SP | HT
  17298. * @param {string} name
  17299. */
  17300. function validateCookieName (name) {
  17301. for (const char of name) {
  17302. const code = char.charCodeAt(0)
  17303. if (
  17304. (code <= 0x20 || code > 0x7F) ||
  17305. char === '(' ||
  17306. char === ')' ||
  17307. char === '>' ||
  17308. char === '<' ||
  17309. char === '@' ||
  17310. char === ',' ||
  17311. char === ';' ||
  17312. char === ':' ||
  17313. char === '\\' ||
  17314. char === '"' ||
  17315. char === '/' ||
  17316. char === '[' ||
  17317. char === ']' ||
  17318. char === '?' ||
  17319. char === '=' ||
  17320. char === '{' ||
  17321. char === '}'
  17322. ) {
  17323. throw new Error('Invalid cookie name')
  17324. }
  17325. }
  17326. }
  17327. /**
  17328. cookie-value = *cookie-octet / ( DQUOTE *cookie-octet DQUOTE )
  17329. cookie-octet = %x21 / %x23-2B / %x2D-3A / %x3C-5B / %x5D-7E
  17330. ; US-ASCII characters excluding CTLs,
  17331. ; whitespace DQUOTE, comma, semicolon,
  17332. ; and backslash
  17333. * @param {string} value
  17334. */
  17335. function validateCookieValue (value) {
  17336. for (const char of value) {
  17337. const code = char.charCodeAt(0)
  17338. if (
  17339. code < 0x21 || // exclude CTLs (0-31)
  17340. code === 0x22 ||
  17341. code === 0x2C ||
  17342. code === 0x3B ||
  17343. code === 0x5C ||
  17344. code > 0x7E // non-ascii
  17345. ) {
  17346. throw new Error('Invalid header value')
  17347. }
  17348. }
  17349. }
  17350. /**
  17351. * path-value = <any CHAR except CTLs or ";">
  17352. * @param {string} path
  17353. */
  17354. function validateCookiePath (path) {
  17355. for (const char of path) {
  17356. const code = char.charCodeAt(0)
  17357. if (code < 0x21 || char === ';') {
  17358. throw new Error('Invalid cookie path')
  17359. }
  17360. }
  17361. }
  17362. /**
  17363. * I have no idea why these values aren't allowed to be honest,
  17364. * but Deno tests these. - Khafra
  17365. * @param {string} domain
  17366. */
  17367. function validateCookieDomain (domain) {
  17368. if (
  17369. domain.startsWith('-') ||
  17370. domain.endsWith('.') ||
  17371. domain.endsWith('-')
  17372. ) {
  17373. throw new Error('Invalid cookie domain')
  17374. }
  17375. }
  17376. /**
  17377. * @see https://www.rfc-editor.org/rfc/rfc7231#section-7.1.1.1
  17378. * @param {number|Date} date
  17379. IMF-fixdate = day-name "," SP date1 SP time-of-day SP GMT
  17380. ; fixed length/zone/capitalization subset of the format
  17381. ; see Section 3.3 of [RFC5322]
  17382. day-name = %x4D.6F.6E ; "Mon", case-sensitive
  17383. / %x54.75.65 ; "Tue", case-sensitive
  17384. / %x57.65.64 ; "Wed", case-sensitive
  17385. / %x54.68.75 ; "Thu", case-sensitive
  17386. / %x46.72.69 ; "Fri", case-sensitive
  17387. / %x53.61.74 ; "Sat", case-sensitive
  17388. / %x53.75.6E ; "Sun", case-sensitive
  17389. date1 = day SP month SP year
  17390. ; e.g., 02 Jun 1982
  17391. day = 2DIGIT
  17392. month = %x4A.61.6E ; "Jan", case-sensitive
  17393. / %x46.65.62 ; "Feb", case-sensitive
  17394. / %x4D.61.72 ; "Mar", case-sensitive
  17395. / %x41.70.72 ; "Apr", case-sensitive
  17396. / %x4D.61.79 ; "May", case-sensitive
  17397. / %x4A.75.6E ; "Jun", case-sensitive
  17398. / %x4A.75.6C ; "Jul", case-sensitive
  17399. / %x41.75.67 ; "Aug", case-sensitive
  17400. / %x53.65.70 ; "Sep", case-sensitive
  17401. / %x4F.63.74 ; "Oct", case-sensitive
  17402. / %x4E.6F.76 ; "Nov", case-sensitive
  17403. / %x44.65.63 ; "Dec", case-sensitive
  17404. year = 4DIGIT
  17405. GMT = %x47.4D.54 ; "GMT", case-sensitive
  17406. time-of-day = hour ":" minute ":" second
  17407. ; 00:00:00 - 23:59:60 (leap second)
  17408. hour = 2DIGIT
  17409. minute = 2DIGIT
  17410. second = 2DIGIT
  17411. */
  17412. function toIMFDate (date) {
  17413. if (typeof date === 'number') {
  17414. date = new Date(date)
  17415. }
  17416. const days = [
  17417. 'Sun', 'Mon', 'Tue', 'Wed',
  17418. 'Thu', 'Fri', 'Sat'
  17419. ]
  17420. const months = [
  17421. 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
  17422. 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'
  17423. ]
  17424. const dayName = days[date.getUTCDay()]
  17425. const day = date.getUTCDate().toString().padStart(2, '0')
  17426. const month = months[date.getUTCMonth()]
  17427. const year = date.getUTCFullYear()
  17428. const hour = date.getUTCHours().toString().padStart(2, '0')
  17429. const minute = date.getUTCMinutes().toString().padStart(2, '0')
  17430. const second = date.getUTCSeconds().toString().padStart(2, '0')
  17431. return `${dayName}, ${day} ${month} ${year} ${hour}:${minute}:${second} GMT`
  17432. }
  17433. /**
  17434. max-age-av = "Max-Age=" non-zero-digit *DIGIT
  17435. ; In practice, both expires-av and max-age-av
  17436. ; are limited to dates representable by the
  17437. ; user agent.
  17438. * @param {number} maxAge
  17439. */
  17440. function validateCookieMaxAge (maxAge) {
  17441. if (maxAge < 0) {
  17442. throw new Error('Invalid cookie max-age')
  17443. }
  17444. }
  17445. /**
  17446. * @see https://www.rfc-editor.org/rfc/rfc6265#section-4.1.1
  17447. * @param {import('./index').Cookie} cookie
  17448. */
  17449. function stringify (cookie) {
  17450. if (cookie.name.length === 0) {
  17451. return null
  17452. }
  17453. validateCookieName(cookie.name)
  17454. validateCookieValue(cookie.value)
  17455. const out = [`${cookie.name}=${cookie.value}`]
  17456. // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-cookie-prefixes-00#section-3.1
  17457. // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-cookie-prefixes-00#section-3.2
  17458. if (cookie.name.startsWith('__Secure-')) {
  17459. cookie.secure = true
  17460. }
  17461. if (cookie.name.startsWith('__Host-')) {
  17462. cookie.secure = true
  17463. cookie.domain = null
  17464. cookie.path = '/'
  17465. }
  17466. if (cookie.secure) {
  17467. out.push('Secure')
  17468. }
  17469. if (cookie.httpOnly) {
  17470. out.push('HttpOnly')
  17471. }
  17472. if (typeof cookie.maxAge === 'number') {
  17473. validateCookieMaxAge(cookie.maxAge)
  17474. out.push(`Max-Age=${cookie.maxAge}`)
  17475. }
  17476. if (cookie.domain) {
  17477. validateCookieDomain(cookie.domain)
  17478. out.push(`Domain=${cookie.domain}`)
  17479. }
  17480. if (cookie.path) {
  17481. validateCookiePath(cookie.path)
  17482. out.push(`Path=${cookie.path}`)
  17483. }
  17484. if (cookie.expires && cookie.expires.toString() !== 'Invalid Date') {
  17485. out.push(`Expires=${toIMFDate(cookie.expires)}`)
  17486. }
  17487. if (cookie.sameSite) {
  17488. out.push(`SameSite=${cookie.sameSite}`)
  17489. }
  17490. for (const part of cookie.unparsed) {
  17491. if (!part.includes('=')) {
  17492. throw new Error('Invalid unparsed')
  17493. }
  17494. const [key, ...value] = part.split('=')
  17495. out.push(`${key.trim()}=${value.join('=')}`)
  17496. }
  17497. return out.join('; ')
  17498. }
  17499. let kHeadersListNode
  17500. function getHeadersList (headers) {
  17501. if (headers[kHeadersList]) {
  17502. return headers[kHeadersList]
  17503. }
  17504. if (!kHeadersListNode) {
  17505. kHeadersListNode = Object.getOwnPropertySymbols(headers).find(
  17506. (symbol) => symbol.description === 'headers list'
  17507. )
  17508. assert(kHeadersListNode, 'Headers cannot be parsed')
  17509. }
  17510. const headersList = headers[kHeadersListNode]
  17511. assert(headersList)
  17512. return headersList
  17513. }
  17514. module.exports = {
  17515. isCTLExcludingHtab,
  17516. stringify,
  17517. getHeadersList
  17518. }
  17519. /***/ }),
  17520. /***/ 2067:
  17521. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  17522. "use strict";
  17523. const net = __nccwpck_require__(1808)
  17524. const assert = __nccwpck_require__(9491)
  17525. const util = __nccwpck_require__(3983)
  17526. const { InvalidArgumentError, ConnectTimeoutError } = __nccwpck_require__(8045)
  17527. let tls // include tls conditionally since it is not always available
  17528. // TODO: session re-use does not wait for the first
  17529. // connection to resolve the session and might therefore
  17530. // resolve the same servername multiple times even when
  17531. // re-use is enabled.
  17532. let SessionCache
  17533. // FIXME: remove workaround when the Node bug is fixed
  17534. // https://github.com/nodejs/node/issues/49344#issuecomment-1741776308
  17535. if (global.FinalizationRegistry && !process.env.NODE_V8_COVERAGE) {
  17536. SessionCache = class WeakSessionCache {
  17537. constructor (maxCachedSessions) {
  17538. this._maxCachedSessions = maxCachedSessions
  17539. this._sessionCache = new Map()
  17540. this._sessionRegistry = new global.FinalizationRegistry((key) => {
  17541. if (this._sessionCache.size < this._maxCachedSessions) {
  17542. return
  17543. }
  17544. const ref = this._sessionCache.get(key)
  17545. if (ref !== undefined && ref.deref() === undefined) {
  17546. this._sessionCache.delete(key)
  17547. }
  17548. })
  17549. }
  17550. get (sessionKey) {
  17551. const ref = this._sessionCache.get(sessionKey)
  17552. return ref ? ref.deref() : null
  17553. }
  17554. set (sessionKey, session) {
  17555. if (this._maxCachedSessions === 0) {
  17556. return
  17557. }
  17558. this._sessionCache.set(sessionKey, new WeakRef(session))
  17559. this._sessionRegistry.register(session, sessionKey)
  17560. }
  17561. }
  17562. } else {
  17563. SessionCache = class SimpleSessionCache {
  17564. constructor (maxCachedSessions) {
  17565. this._maxCachedSessions = maxCachedSessions
  17566. this._sessionCache = new Map()
  17567. }
  17568. get (sessionKey) {
  17569. return this._sessionCache.get(sessionKey)
  17570. }
  17571. set (sessionKey, session) {
  17572. if (this._maxCachedSessions === 0) {
  17573. return
  17574. }
  17575. if (this._sessionCache.size >= this._maxCachedSessions) {
  17576. // remove the oldest session
  17577. const { value: oldestKey } = this._sessionCache.keys().next()
  17578. this._sessionCache.delete(oldestKey)
  17579. }
  17580. this._sessionCache.set(sessionKey, session)
  17581. }
  17582. }
  17583. }
  17584. function buildConnector ({ allowH2, maxCachedSessions, socketPath, timeout, ...opts }) {
  17585. if (maxCachedSessions != null && (!Number.isInteger(maxCachedSessions) || maxCachedSessions < 0)) {
  17586. throw new InvalidArgumentError('maxCachedSessions must be a positive integer or zero')
  17587. }
  17588. const options = { path: socketPath, ...opts }
  17589. const sessionCache = new SessionCache(maxCachedSessions == null ? 100 : maxCachedSessions)
  17590. timeout = timeout == null ? 10e3 : timeout
  17591. allowH2 = allowH2 != null ? allowH2 : false
  17592. return function connect ({ hostname, host, protocol, port, servername, localAddress, httpSocket }, callback) {
  17593. let socket
  17594. if (protocol === 'https:') {
  17595. if (!tls) {
  17596. tls = __nccwpck_require__(4404)
  17597. }
  17598. servername = servername || options.servername || util.getServerName(host) || null
  17599. const sessionKey = servername || hostname
  17600. const session = sessionCache.get(sessionKey) || null
  17601. assert(sessionKey)
  17602. socket = tls.connect({
  17603. highWaterMark: 16384, // TLS in node can't have bigger HWM anyway...
  17604. ...options,
  17605. servername,
  17606. session,
  17607. localAddress,
  17608. // TODO(HTTP/2): Add support for h2c
  17609. ALPNProtocols: allowH2 ? ['http/1.1', 'h2'] : ['http/1.1'],
  17610. socket: httpSocket, // upgrade socket connection
  17611. port: port || 443,
  17612. host: hostname
  17613. })
  17614. socket
  17615. .on('session', function (session) {
  17616. // TODO (fix): Can a session become invalid once established? Don't think so?
  17617. sessionCache.set(sessionKey, session)
  17618. })
  17619. } else {
  17620. assert(!httpSocket, 'httpSocket can only be sent on TLS update')
  17621. socket = net.connect({
  17622. highWaterMark: 64 * 1024, // Same as nodejs fs streams.
  17623. ...options,
  17624. localAddress,
  17625. port: port || 80,
  17626. host: hostname
  17627. })
  17628. }
  17629. // Set TCP keep alive options on the socket here instead of in connect() for the case of assigning the socket
  17630. if (options.keepAlive == null || options.keepAlive) {
  17631. const keepAliveInitialDelay = options.keepAliveInitialDelay === undefined ? 60e3 : options.keepAliveInitialDelay
  17632. socket.setKeepAlive(true, keepAliveInitialDelay)
  17633. }
  17634. const cancelTimeout = setupTimeout(() => onConnectTimeout(socket), timeout)
  17635. socket
  17636. .setNoDelay(true)
  17637. .once(protocol === 'https:' ? 'secureConnect' : 'connect', function () {
  17638. cancelTimeout()
  17639. if (callback) {
  17640. const cb = callback
  17641. callback = null
  17642. cb(null, this)
  17643. }
  17644. })
  17645. .on('error', function (err) {
  17646. cancelTimeout()
  17647. if (callback) {
  17648. const cb = callback
  17649. callback = null
  17650. cb(err)
  17651. }
  17652. })
  17653. return socket
  17654. }
  17655. }
  17656. function setupTimeout (onConnectTimeout, timeout) {
  17657. if (!timeout) {
  17658. return () => {}
  17659. }
  17660. let s1 = null
  17661. let s2 = null
  17662. const timeoutId = setTimeout(() => {
  17663. // setImmediate is added to make sure that we priotorise socket error events over timeouts
  17664. s1 = setImmediate(() => {
  17665. if (process.platform === 'win32') {
  17666. // Windows needs an extra setImmediate probably due to implementation differences in the socket logic
  17667. s2 = setImmediate(() => onConnectTimeout())
  17668. } else {
  17669. onConnectTimeout()
  17670. }
  17671. })
  17672. }, timeout)
  17673. return () => {
  17674. clearTimeout(timeoutId)
  17675. clearImmediate(s1)
  17676. clearImmediate(s2)
  17677. }
  17678. }
  17679. function onConnectTimeout (socket) {
  17680. util.destroy(socket, new ConnectTimeoutError())
  17681. }
  17682. module.exports = buildConnector
  17683. /***/ }),
  17684. /***/ 4462:
  17685. /***/ ((module) => {
  17686. "use strict";
  17687. /** @type {Record<string, string | undefined>} */
  17688. const headerNameLowerCasedRecord = {}
  17689. // https://developer.mozilla.org/docs/Web/HTTP/Headers
  17690. const wellknownHeaderNames = [
  17691. 'Accept',
  17692. 'Accept-Encoding',
  17693. 'Accept-Language',
  17694. 'Accept-Ranges',
  17695. 'Access-Control-Allow-Credentials',
  17696. 'Access-Control-Allow-Headers',
  17697. 'Access-Control-Allow-Methods',
  17698. 'Access-Control-Allow-Origin',
  17699. 'Access-Control-Expose-Headers',
  17700. 'Access-Control-Max-Age',
  17701. 'Access-Control-Request-Headers',
  17702. 'Access-Control-Request-Method',
  17703. 'Age',
  17704. 'Allow',
  17705. 'Alt-Svc',
  17706. 'Alt-Used',
  17707. 'Authorization',
  17708. 'Cache-Control',
  17709. 'Clear-Site-Data',
  17710. 'Connection',
  17711. 'Content-Disposition',
  17712. 'Content-Encoding',
  17713. 'Content-Language',
  17714. 'Content-Length',
  17715. 'Content-Location',
  17716. 'Content-Range',
  17717. 'Content-Security-Policy',
  17718. 'Content-Security-Policy-Report-Only',
  17719. 'Content-Type',
  17720. 'Cookie',
  17721. 'Cross-Origin-Embedder-Policy',
  17722. 'Cross-Origin-Opener-Policy',
  17723. 'Cross-Origin-Resource-Policy',
  17724. 'Date',
  17725. 'Device-Memory',
  17726. 'Downlink',
  17727. 'ECT',
  17728. 'ETag',
  17729. 'Expect',
  17730. 'Expect-CT',
  17731. 'Expires',
  17732. 'Forwarded',
  17733. 'From',
  17734. 'Host',
  17735. 'If-Match',
  17736. 'If-Modified-Since',
  17737. 'If-None-Match',
  17738. 'If-Range',
  17739. 'If-Unmodified-Since',
  17740. 'Keep-Alive',
  17741. 'Last-Modified',
  17742. 'Link',
  17743. 'Location',
  17744. 'Max-Forwards',
  17745. 'Origin',
  17746. 'Permissions-Policy',
  17747. 'Pragma',
  17748. 'Proxy-Authenticate',
  17749. 'Proxy-Authorization',
  17750. 'RTT',
  17751. 'Range',
  17752. 'Referer',
  17753. 'Referrer-Policy',
  17754. 'Refresh',
  17755. 'Retry-After',
  17756. 'Sec-WebSocket-Accept',
  17757. 'Sec-WebSocket-Extensions',
  17758. 'Sec-WebSocket-Key',
  17759. 'Sec-WebSocket-Protocol',
  17760. 'Sec-WebSocket-Version',
  17761. 'Server',
  17762. 'Server-Timing',
  17763. 'Service-Worker-Allowed',
  17764. 'Service-Worker-Navigation-Preload',
  17765. 'Set-Cookie',
  17766. 'SourceMap',
  17767. 'Strict-Transport-Security',
  17768. 'Supports-Loading-Mode',
  17769. 'TE',
  17770. 'Timing-Allow-Origin',
  17771. 'Trailer',
  17772. 'Transfer-Encoding',
  17773. 'Upgrade',
  17774. 'Upgrade-Insecure-Requests',
  17775. 'User-Agent',
  17776. 'Vary',
  17777. 'Via',
  17778. 'WWW-Authenticate',
  17779. 'X-Content-Type-Options',
  17780. 'X-DNS-Prefetch-Control',
  17781. 'X-Frame-Options',
  17782. 'X-Permitted-Cross-Domain-Policies',
  17783. 'X-Powered-By',
  17784. 'X-Requested-With',
  17785. 'X-XSS-Protection'
  17786. ]
  17787. for (let i = 0; i < wellknownHeaderNames.length; ++i) {
  17788. const key = wellknownHeaderNames[i]
  17789. const lowerCasedKey = key.toLowerCase()
  17790. headerNameLowerCasedRecord[key] = headerNameLowerCasedRecord[lowerCasedKey] =
  17791. lowerCasedKey
  17792. }
  17793. // Note: object prototypes should not be able to be referenced. e.g. `Object#hasOwnProperty`.
  17794. Object.setPrototypeOf(headerNameLowerCasedRecord, null)
  17795. module.exports = {
  17796. wellknownHeaderNames,
  17797. headerNameLowerCasedRecord
  17798. }
  17799. /***/ }),
  17800. /***/ 8045:
  17801. /***/ ((module) => {
  17802. "use strict";
  17803. class UndiciError extends Error {
  17804. constructor (message) {
  17805. super(message)
  17806. this.name = 'UndiciError'
  17807. this.code = 'UND_ERR'
  17808. }
  17809. }
  17810. class ConnectTimeoutError extends UndiciError {
  17811. constructor (message) {
  17812. super(message)
  17813. Error.captureStackTrace(this, ConnectTimeoutError)
  17814. this.name = 'ConnectTimeoutError'
  17815. this.message = message || 'Connect Timeout Error'
  17816. this.code = 'UND_ERR_CONNECT_TIMEOUT'
  17817. }
  17818. }
  17819. class HeadersTimeoutError extends UndiciError {
  17820. constructor (message) {
  17821. super(message)
  17822. Error.captureStackTrace(this, HeadersTimeoutError)
  17823. this.name = 'HeadersTimeoutError'
  17824. this.message = message || 'Headers Timeout Error'
  17825. this.code = 'UND_ERR_HEADERS_TIMEOUT'
  17826. }
  17827. }
  17828. class HeadersOverflowError extends UndiciError {
  17829. constructor (message) {
  17830. super(message)
  17831. Error.captureStackTrace(this, HeadersOverflowError)
  17832. this.name = 'HeadersOverflowError'
  17833. this.message = message || 'Headers Overflow Error'
  17834. this.code = 'UND_ERR_HEADERS_OVERFLOW'
  17835. }
  17836. }
  17837. class BodyTimeoutError extends UndiciError {
  17838. constructor (message) {
  17839. super(message)
  17840. Error.captureStackTrace(this, BodyTimeoutError)
  17841. this.name = 'BodyTimeoutError'
  17842. this.message = message || 'Body Timeout Error'
  17843. this.code = 'UND_ERR_BODY_TIMEOUT'
  17844. }
  17845. }
  17846. class ResponseStatusCodeError extends UndiciError {
  17847. constructor (message, statusCode, headers, body) {
  17848. super(message)
  17849. Error.captureStackTrace(this, ResponseStatusCodeError)
  17850. this.name = 'ResponseStatusCodeError'
  17851. this.message = message || 'Response Status Code Error'
  17852. this.code = 'UND_ERR_RESPONSE_STATUS_CODE'
  17853. this.body = body
  17854. this.status = statusCode
  17855. this.statusCode = statusCode
  17856. this.headers = headers
  17857. }
  17858. }
  17859. class InvalidArgumentError extends UndiciError {
  17860. constructor (message) {
  17861. super(message)
  17862. Error.captureStackTrace(this, InvalidArgumentError)
  17863. this.name = 'InvalidArgumentError'
  17864. this.message = message || 'Invalid Argument Error'
  17865. this.code = 'UND_ERR_INVALID_ARG'
  17866. }
  17867. }
  17868. class InvalidReturnValueError extends UndiciError {
  17869. constructor (message) {
  17870. super(message)
  17871. Error.captureStackTrace(this, InvalidReturnValueError)
  17872. this.name = 'InvalidReturnValueError'
  17873. this.message = message || 'Invalid Return Value Error'
  17874. this.code = 'UND_ERR_INVALID_RETURN_VALUE'
  17875. }
  17876. }
  17877. class RequestAbortedError extends UndiciError {
  17878. constructor (message) {
  17879. super(message)
  17880. Error.captureStackTrace(this, RequestAbortedError)
  17881. this.name = 'AbortError'
  17882. this.message = message || 'Request aborted'
  17883. this.code = 'UND_ERR_ABORTED'
  17884. }
  17885. }
  17886. class InformationalError extends UndiciError {
  17887. constructor (message) {
  17888. super(message)
  17889. Error.captureStackTrace(this, InformationalError)
  17890. this.name = 'InformationalError'
  17891. this.message = message || 'Request information'
  17892. this.code = 'UND_ERR_INFO'
  17893. }
  17894. }
  17895. class RequestContentLengthMismatchError extends UndiciError {
  17896. constructor (message) {
  17897. super(message)
  17898. Error.captureStackTrace(this, RequestContentLengthMismatchError)
  17899. this.name = 'RequestContentLengthMismatchError'
  17900. this.message = message || 'Request body length does not match content-length header'
  17901. this.code = 'UND_ERR_REQ_CONTENT_LENGTH_MISMATCH'
  17902. }
  17903. }
  17904. class ResponseContentLengthMismatchError extends UndiciError {
  17905. constructor (message) {
  17906. super(message)
  17907. Error.captureStackTrace(this, ResponseContentLengthMismatchError)
  17908. this.name = 'ResponseContentLengthMismatchError'
  17909. this.message = message || 'Response body length does not match content-length header'
  17910. this.code = 'UND_ERR_RES_CONTENT_LENGTH_MISMATCH'
  17911. }
  17912. }
  17913. class ClientDestroyedError extends UndiciError {
  17914. constructor (message) {
  17915. super(message)
  17916. Error.captureStackTrace(this, ClientDestroyedError)
  17917. this.name = 'ClientDestroyedError'
  17918. this.message = message || 'The client is destroyed'
  17919. this.code = 'UND_ERR_DESTROYED'
  17920. }
  17921. }
  17922. class ClientClosedError extends UndiciError {
  17923. constructor (message) {
  17924. super(message)
  17925. Error.captureStackTrace(this, ClientClosedError)
  17926. this.name = 'ClientClosedError'
  17927. this.message = message || 'The client is closed'
  17928. this.code = 'UND_ERR_CLOSED'
  17929. }
  17930. }
  17931. class SocketError extends UndiciError {
  17932. constructor (message, socket) {
  17933. super(message)
  17934. Error.captureStackTrace(this, SocketError)
  17935. this.name = 'SocketError'
  17936. this.message = message || 'Socket error'
  17937. this.code = 'UND_ERR_SOCKET'
  17938. this.socket = socket
  17939. }
  17940. }
  17941. class NotSupportedError extends UndiciError {
  17942. constructor (message) {
  17943. super(message)
  17944. Error.captureStackTrace(this, NotSupportedError)
  17945. this.name = 'NotSupportedError'
  17946. this.message = message || 'Not supported error'
  17947. this.code = 'UND_ERR_NOT_SUPPORTED'
  17948. }
  17949. }
  17950. class BalancedPoolMissingUpstreamError extends UndiciError {
  17951. constructor (message) {
  17952. super(message)
  17953. Error.captureStackTrace(this, NotSupportedError)
  17954. this.name = 'MissingUpstreamError'
  17955. this.message = message || 'No upstream has been added to the BalancedPool'
  17956. this.code = 'UND_ERR_BPL_MISSING_UPSTREAM'
  17957. }
  17958. }
  17959. class HTTPParserError extends Error {
  17960. constructor (message, code, data) {
  17961. super(message)
  17962. Error.captureStackTrace(this, HTTPParserError)
  17963. this.name = 'HTTPParserError'
  17964. this.code = code ? `HPE_${code}` : undefined
  17965. this.data = data ? data.toString() : undefined
  17966. }
  17967. }
  17968. class ResponseExceededMaxSizeError extends UndiciError {
  17969. constructor (message) {
  17970. super(message)
  17971. Error.captureStackTrace(this, ResponseExceededMaxSizeError)
  17972. this.name = 'ResponseExceededMaxSizeError'
  17973. this.message = message || 'Response content exceeded max size'
  17974. this.code = 'UND_ERR_RES_EXCEEDED_MAX_SIZE'
  17975. }
  17976. }
  17977. class RequestRetryError extends UndiciError {
  17978. constructor (message, code, { headers, data }) {
  17979. super(message)
  17980. Error.captureStackTrace(this, RequestRetryError)
  17981. this.name = 'RequestRetryError'
  17982. this.message = message || 'Request retry error'
  17983. this.code = 'UND_ERR_REQ_RETRY'
  17984. this.statusCode = code
  17985. this.data = data
  17986. this.headers = headers
  17987. }
  17988. }
  17989. module.exports = {
  17990. HTTPParserError,
  17991. UndiciError,
  17992. HeadersTimeoutError,
  17993. HeadersOverflowError,
  17994. BodyTimeoutError,
  17995. RequestContentLengthMismatchError,
  17996. ConnectTimeoutError,
  17997. ResponseStatusCodeError,
  17998. InvalidArgumentError,
  17999. InvalidReturnValueError,
  18000. RequestAbortedError,
  18001. ClientDestroyedError,
  18002. ClientClosedError,
  18003. InformationalError,
  18004. SocketError,
  18005. NotSupportedError,
  18006. ResponseContentLengthMismatchError,
  18007. BalancedPoolMissingUpstreamError,
  18008. ResponseExceededMaxSizeError,
  18009. RequestRetryError
  18010. }
  18011. /***/ }),
  18012. /***/ 2905:
  18013. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  18014. "use strict";
  18015. const {
  18016. InvalidArgumentError,
  18017. NotSupportedError
  18018. } = __nccwpck_require__(8045)
  18019. const assert = __nccwpck_require__(9491)
  18020. const { kHTTP2BuildRequest, kHTTP2CopyHeaders, kHTTP1BuildRequest } = __nccwpck_require__(2785)
  18021. const util = __nccwpck_require__(3983)
  18022. // tokenRegExp and headerCharRegex have been lifted from
  18023. // https://github.com/nodejs/node/blob/main/lib/_http_common.js
  18024. /**
  18025. * Verifies that the given val is a valid HTTP token
  18026. * per the rules defined in RFC 7230
  18027. * See https://tools.ietf.org/html/rfc7230#section-3.2.6
  18028. */
  18029. const tokenRegExp = /^[\^_`a-zA-Z\-0-9!#$%&'*+.|~]+$/
  18030. /**
  18031. * Matches if val contains an invalid field-vchar
  18032. * field-value = *( field-content / obs-fold )
  18033. * field-content = field-vchar [ 1*( SP / HTAB ) field-vchar ]
  18034. * field-vchar = VCHAR / obs-text
  18035. */
  18036. const headerCharRegex = /[^\t\x20-\x7e\x80-\xff]/
  18037. // Verifies that a given path is valid does not contain control chars \x00 to \x20
  18038. const invalidPathRegex = /[^\u0021-\u00ff]/
  18039. const kHandler = Symbol('handler')
  18040. const channels = {}
  18041. let extractBody
  18042. try {
  18043. const diagnosticsChannel = __nccwpck_require__(7643)
  18044. channels.create = diagnosticsChannel.channel('undici:request:create')
  18045. channels.bodySent = diagnosticsChannel.channel('undici:request:bodySent')
  18046. channels.headers = diagnosticsChannel.channel('undici:request:headers')
  18047. channels.trailers = diagnosticsChannel.channel('undici:request:trailers')
  18048. channels.error = diagnosticsChannel.channel('undici:request:error')
  18049. } catch {
  18050. channels.create = { hasSubscribers: false }
  18051. channels.bodySent = { hasSubscribers: false }
  18052. channels.headers = { hasSubscribers: false }
  18053. channels.trailers = { hasSubscribers: false }
  18054. channels.error = { hasSubscribers: false }
  18055. }
  18056. class Request {
  18057. constructor (origin, {
  18058. path,
  18059. method,
  18060. body,
  18061. headers,
  18062. query,
  18063. idempotent,
  18064. blocking,
  18065. upgrade,
  18066. headersTimeout,
  18067. bodyTimeout,
  18068. reset,
  18069. throwOnError,
  18070. expectContinue
  18071. }, handler) {
  18072. if (typeof path !== 'string') {
  18073. throw new InvalidArgumentError('path must be a string')
  18074. } else if (
  18075. path[0] !== '/' &&
  18076. !(path.startsWith('http://') || path.startsWith('https://')) &&
  18077. method !== 'CONNECT'
  18078. ) {
  18079. throw new InvalidArgumentError('path must be an absolute URL or start with a slash')
  18080. } else if (invalidPathRegex.exec(path) !== null) {
  18081. throw new InvalidArgumentError('invalid request path')
  18082. }
  18083. if (typeof method !== 'string') {
  18084. throw new InvalidArgumentError('method must be a string')
  18085. } else if (tokenRegExp.exec(method) === null) {
  18086. throw new InvalidArgumentError('invalid request method')
  18087. }
  18088. if (upgrade && typeof upgrade !== 'string') {
  18089. throw new InvalidArgumentError('upgrade must be a string')
  18090. }
  18091. if (headersTimeout != null && (!Number.isFinite(headersTimeout) || headersTimeout < 0)) {
  18092. throw new InvalidArgumentError('invalid headersTimeout')
  18093. }
  18094. if (bodyTimeout != null && (!Number.isFinite(bodyTimeout) || bodyTimeout < 0)) {
  18095. throw new InvalidArgumentError('invalid bodyTimeout')
  18096. }
  18097. if (reset != null && typeof reset !== 'boolean') {
  18098. throw new InvalidArgumentError('invalid reset')
  18099. }
  18100. if (expectContinue != null && typeof expectContinue !== 'boolean') {
  18101. throw new InvalidArgumentError('invalid expectContinue')
  18102. }
  18103. this.headersTimeout = headersTimeout
  18104. this.bodyTimeout = bodyTimeout
  18105. this.throwOnError = throwOnError === true
  18106. this.method = method
  18107. this.abort = null
  18108. if (body == null) {
  18109. this.body = null
  18110. } else if (util.isStream(body)) {
  18111. this.body = body
  18112. const rState = this.body._readableState
  18113. if (!rState || !rState.autoDestroy) {
  18114. this.endHandler = function autoDestroy () {
  18115. util.destroy(this)
  18116. }
  18117. this.body.on('end', this.endHandler)
  18118. }
  18119. this.errorHandler = err => {
  18120. if (this.abort) {
  18121. this.abort(err)
  18122. } else {
  18123. this.error = err
  18124. }
  18125. }
  18126. this.body.on('error', this.errorHandler)
  18127. } else if (util.isBuffer(body)) {
  18128. this.body = body.byteLength ? body : null
  18129. } else if (ArrayBuffer.isView(body)) {
  18130. this.body = body.buffer.byteLength ? Buffer.from(body.buffer, body.byteOffset, body.byteLength) : null
  18131. } else if (body instanceof ArrayBuffer) {
  18132. this.body = body.byteLength ? Buffer.from(body) : null
  18133. } else if (typeof body === 'string') {
  18134. this.body = body.length ? Buffer.from(body) : null
  18135. } else if (util.isFormDataLike(body) || util.isIterable(body) || util.isBlobLike(body)) {
  18136. this.body = body
  18137. } else {
  18138. throw new InvalidArgumentError('body must be a string, a Buffer, a Readable stream, an iterable, or an async iterable')
  18139. }
  18140. this.completed = false
  18141. this.aborted = false
  18142. this.upgrade = upgrade || null
  18143. this.path = query ? util.buildURL(path, query) : path
  18144. this.origin = origin
  18145. this.idempotent = idempotent == null
  18146. ? method === 'HEAD' || method === 'GET'
  18147. : idempotent
  18148. this.blocking = blocking == null ? false : blocking
  18149. this.reset = reset == null ? null : reset
  18150. this.host = null
  18151. this.contentLength = null
  18152. this.contentType = null
  18153. this.headers = ''
  18154. // Only for H2
  18155. this.expectContinue = expectContinue != null ? expectContinue : false
  18156. if (Array.isArray(headers)) {
  18157. if (headers.length % 2 !== 0) {
  18158. throw new InvalidArgumentError('headers array must be even')
  18159. }
  18160. for (let i = 0; i < headers.length; i += 2) {
  18161. processHeader(this, headers[i], headers[i + 1])
  18162. }
  18163. } else if (headers && typeof headers === 'object') {
  18164. const keys = Object.keys(headers)
  18165. for (let i = 0; i < keys.length; i++) {
  18166. const key = keys[i]
  18167. processHeader(this, key, headers[key])
  18168. }
  18169. } else if (headers != null) {
  18170. throw new InvalidArgumentError('headers must be an object or an array')
  18171. }
  18172. if (util.isFormDataLike(this.body)) {
  18173. if (util.nodeMajor < 16 || (util.nodeMajor === 16 && util.nodeMinor < 8)) {
  18174. throw new InvalidArgumentError('Form-Data bodies are only supported in node v16.8 and newer.')
  18175. }
  18176. if (!extractBody) {
  18177. extractBody = (__nccwpck_require__(9990).extractBody)
  18178. }
  18179. const [bodyStream, contentType] = extractBody(body)
  18180. if (this.contentType == null) {
  18181. this.contentType = contentType
  18182. this.headers += `content-type: ${contentType}\r\n`
  18183. }
  18184. this.body = bodyStream.stream
  18185. this.contentLength = bodyStream.length
  18186. } else if (util.isBlobLike(body) && this.contentType == null && body.type) {
  18187. this.contentType = body.type
  18188. this.headers += `content-type: ${body.type}\r\n`
  18189. }
  18190. util.validateHandler(handler, method, upgrade)
  18191. this.servername = util.getServerName(this.host)
  18192. this[kHandler] = handler
  18193. if (channels.create.hasSubscribers) {
  18194. channels.create.publish({ request: this })
  18195. }
  18196. }
  18197. onBodySent (chunk) {
  18198. if (this[kHandler].onBodySent) {
  18199. try {
  18200. return this[kHandler].onBodySent(chunk)
  18201. } catch (err) {
  18202. this.abort(err)
  18203. }
  18204. }
  18205. }
  18206. onRequestSent () {
  18207. if (channels.bodySent.hasSubscribers) {
  18208. channels.bodySent.publish({ request: this })
  18209. }
  18210. if (this[kHandler].onRequestSent) {
  18211. try {
  18212. return this[kHandler].onRequestSent()
  18213. } catch (err) {
  18214. this.abort(err)
  18215. }
  18216. }
  18217. }
  18218. onConnect (abort) {
  18219. assert(!this.aborted)
  18220. assert(!this.completed)
  18221. if (this.error) {
  18222. abort(this.error)
  18223. } else {
  18224. this.abort = abort
  18225. return this[kHandler].onConnect(abort)
  18226. }
  18227. }
  18228. onHeaders (statusCode, headers, resume, statusText) {
  18229. assert(!this.aborted)
  18230. assert(!this.completed)
  18231. if (channels.headers.hasSubscribers) {
  18232. channels.headers.publish({ request: this, response: { statusCode, headers, statusText } })
  18233. }
  18234. try {
  18235. return this[kHandler].onHeaders(statusCode, headers, resume, statusText)
  18236. } catch (err) {
  18237. this.abort(err)
  18238. }
  18239. }
  18240. onData (chunk) {
  18241. assert(!this.aborted)
  18242. assert(!this.completed)
  18243. try {
  18244. return this[kHandler].onData(chunk)
  18245. } catch (err) {
  18246. this.abort(err)
  18247. return false
  18248. }
  18249. }
  18250. onUpgrade (statusCode, headers, socket) {
  18251. assert(!this.aborted)
  18252. assert(!this.completed)
  18253. return this[kHandler].onUpgrade(statusCode, headers, socket)
  18254. }
  18255. onComplete (trailers) {
  18256. this.onFinally()
  18257. assert(!this.aborted)
  18258. this.completed = true
  18259. if (channels.trailers.hasSubscribers) {
  18260. channels.trailers.publish({ request: this, trailers })
  18261. }
  18262. try {
  18263. return this[kHandler].onComplete(trailers)
  18264. } catch (err) {
  18265. // TODO (fix): This might be a bad idea?
  18266. this.onError(err)
  18267. }
  18268. }
  18269. onError (error) {
  18270. this.onFinally()
  18271. if (channels.error.hasSubscribers) {
  18272. channels.error.publish({ request: this, error })
  18273. }
  18274. if (this.aborted) {
  18275. return
  18276. }
  18277. this.aborted = true
  18278. return this[kHandler].onError(error)
  18279. }
  18280. onFinally () {
  18281. if (this.errorHandler) {
  18282. this.body.off('error', this.errorHandler)
  18283. this.errorHandler = null
  18284. }
  18285. if (this.endHandler) {
  18286. this.body.off('end', this.endHandler)
  18287. this.endHandler = null
  18288. }
  18289. }
  18290. // TODO: adjust to support H2
  18291. addHeader (key, value) {
  18292. processHeader(this, key, value)
  18293. return this
  18294. }
  18295. static [kHTTP1BuildRequest] (origin, opts, handler) {
  18296. // TODO: Migrate header parsing here, to make Requests
  18297. // HTTP agnostic
  18298. return new Request(origin, opts, handler)
  18299. }
  18300. static [kHTTP2BuildRequest] (origin, opts, handler) {
  18301. const headers = opts.headers
  18302. opts = { ...opts, headers: null }
  18303. const request = new Request(origin, opts, handler)
  18304. request.headers = {}
  18305. if (Array.isArray(headers)) {
  18306. if (headers.length % 2 !== 0) {
  18307. throw new InvalidArgumentError('headers array must be even')
  18308. }
  18309. for (let i = 0; i < headers.length; i += 2) {
  18310. processHeader(request, headers[i], headers[i + 1], true)
  18311. }
  18312. } else if (headers && typeof headers === 'object') {
  18313. const keys = Object.keys(headers)
  18314. for (let i = 0; i < keys.length; i++) {
  18315. const key = keys[i]
  18316. processHeader(request, key, headers[key], true)
  18317. }
  18318. } else if (headers != null) {
  18319. throw new InvalidArgumentError('headers must be an object or an array')
  18320. }
  18321. return request
  18322. }
  18323. static [kHTTP2CopyHeaders] (raw) {
  18324. const rawHeaders = raw.split('\r\n')
  18325. const headers = {}
  18326. for (const header of rawHeaders) {
  18327. const [key, value] = header.split(': ')
  18328. if (value == null || value.length === 0) continue
  18329. if (headers[key]) headers[key] += `,${value}`
  18330. else headers[key] = value
  18331. }
  18332. return headers
  18333. }
  18334. }
  18335. function processHeaderValue (key, val, skipAppend) {
  18336. if (val && typeof val === 'object') {
  18337. throw new InvalidArgumentError(`invalid ${key} header`)
  18338. }
  18339. val = val != null ? `${val}` : ''
  18340. if (headerCharRegex.exec(val) !== null) {
  18341. throw new InvalidArgumentError(`invalid ${key} header`)
  18342. }
  18343. return skipAppend ? val : `${key}: ${val}\r\n`
  18344. }
  18345. function processHeader (request, key, val, skipAppend = false) {
  18346. if (val && (typeof val === 'object' && !Array.isArray(val))) {
  18347. throw new InvalidArgumentError(`invalid ${key} header`)
  18348. } else if (val === undefined) {
  18349. return
  18350. }
  18351. if (
  18352. request.host === null &&
  18353. key.length === 4 &&
  18354. key.toLowerCase() === 'host'
  18355. ) {
  18356. if (headerCharRegex.exec(val) !== null) {
  18357. throw new InvalidArgumentError(`invalid ${key} header`)
  18358. }
  18359. // Consumed by Client
  18360. request.host = val
  18361. } else if (
  18362. request.contentLength === null &&
  18363. key.length === 14 &&
  18364. key.toLowerCase() === 'content-length'
  18365. ) {
  18366. request.contentLength = parseInt(val, 10)
  18367. if (!Number.isFinite(request.contentLength)) {
  18368. throw new InvalidArgumentError('invalid content-length header')
  18369. }
  18370. } else if (
  18371. request.contentType === null &&
  18372. key.length === 12 &&
  18373. key.toLowerCase() === 'content-type'
  18374. ) {
  18375. request.contentType = val
  18376. if (skipAppend) request.headers[key] = processHeaderValue(key, val, skipAppend)
  18377. else request.headers += processHeaderValue(key, val)
  18378. } else if (
  18379. key.length === 17 &&
  18380. key.toLowerCase() === 'transfer-encoding'
  18381. ) {
  18382. throw new InvalidArgumentError('invalid transfer-encoding header')
  18383. } else if (
  18384. key.length === 10 &&
  18385. key.toLowerCase() === 'connection'
  18386. ) {
  18387. const value = typeof val === 'string' ? val.toLowerCase() : null
  18388. if (value !== 'close' && value !== 'keep-alive') {
  18389. throw new InvalidArgumentError('invalid connection header')
  18390. } else if (value === 'close') {
  18391. request.reset = true
  18392. }
  18393. } else if (
  18394. key.length === 10 &&
  18395. key.toLowerCase() === 'keep-alive'
  18396. ) {
  18397. throw new InvalidArgumentError('invalid keep-alive header')
  18398. } else if (
  18399. key.length === 7 &&
  18400. key.toLowerCase() === 'upgrade'
  18401. ) {
  18402. throw new InvalidArgumentError('invalid upgrade header')
  18403. } else if (
  18404. key.length === 6 &&
  18405. key.toLowerCase() === 'expect'
  18406. ) {
  18407. throw new NotSupportedError('expect header not supported')
  18408. } else if (tokenRegExp.exec(key) === null) {
  18409. throw new InvalidArgumentError('invalid header key')
  18410. } else {
  18411. if (Array.isArray(val)) {
  18412. for (let i = 0; i < val.length; i++) {
  18413. if (skipAppend) {
  18414. if (request.headers[key]) request.headers[key] += `,${processHeaderValue(key, val[i], skipAppend)}`
  18415. else request.headers[key] = processHeaderValue(key, val[i], skipAppend)
  18416. } else {
  18417. request.headers += processHeaderValue(key, val[i])
  18418. }
  18419. }
  18420. } else {
  18421. if (skipAppend) request.headers[key] = processHeaderValue(key, val, skipAppend)
  18422. else request.headers += processHeaderValue(key, val)
  18423. }
  18424. }
  18425. }
  18426. module.exports = Request
  18427. /***/ }),
  18428. /***/ 2785:
  18429. /***/ ((module) => {
  18430. module.exports = {
  18431. kClose: Symbol('close'),
  18432. kDestroy: Symbol('destroy'),
  18433. kDispatch: Symbol('dispatch'),
  18434. kUrl: Symbol('url'),
  18435. kWriting: Symbol('writing'),
  18436. kResuming: Symbol('resuming'),
  18437. kQueue: Symbol('queue'),
  18438. kConnect: Symbol('connect'),
  18439. kConnecting: Symbol('connecting'),
  18440. kHeadersList: Symbol('headers list'),
  18441. kKeepAliveDefaultTimeout: Symbol('default keep alive timeout'),
  18442. kKeepAliveMaxTimeout: Symbol('max keep alive timeout'),
  18443. kKeepAliveTimeoutThreshold: Symbol('keep alive timeout threshold'),
  18444. kKeepAliveTimeoutValue: Symbol('keep alive timeout'),
  18445. kKeepAlive: Symbol('keep alive'),
  18446. kHeadersTimeout: Symbol('headers timeout'),
  18447. kBodyTimeout: Symbol('body timeout'),
  18448. kServerName: Symbol('server name'),
  18449. kLocalAddress: Symbol('local address'),
  18450. kHost: Symbol('host'),
  18451. kNoRef: Symbol('no ref'),
  18452. kBodyUsed: Symbol('used'),
  18453. kRunning: Symbol('running'),
  18454. kBlocking: Symbol('blocking'),
  18455. kPending: Symbol('pending'),
  18456. kSize: Symbol('size'),
  18457. kBusy: Symbol('busy'),
  18458. kQueued: Symbol('queued'),
  18459. kFree: Symbol('free'),
  18460. kConnected: Symbol('connected'),
  18461. kClosed: Symbol('closed'),
  18462. kNeedDrain: Symbol('need drain'),
  18463. kReset: Symbol('reset'),
  18464. kDestroyed: Symbol.for('nodejs.stream.destroyed'),
  18465. kMaxHeadersSize: Symbol('max headers size'),
  18466. kRunningIdx: Symbol('running index'),
  18467. kPendingIdx: Symbol('pending index'),
  18468. kError: Symbol('error'),
  18469. kClients: Symbol('clients'),
  18470. kClient: Symbol('client'),
  18471. kParser: Symbol('parser'),
  18472. kOnDestroyed: Symbol('destroy callbacks'),
  18473. kPipelining: Symbol('pipelining'),
  18474. kSocket: Symbol('socket'),
  18475. kHostHeader: Symbol('host header'),
  18476. kConnector: Symbol('connector'),
  18477. kStrictContentLength: Symbol('strict content length'),
  18478. kMaxRedirections: Symbol('maxRedirections'),
  18479. kMaxRequests: Symbol('maxRequestsPerClient'),
  18480. kProxy: Symbol('proxy agent options'),
  18481. kCounter: Symbol('socket request counter'),
  18482. kInterceptors: Symbol('dispatch interceptors'),
  18483. kMaxResponseSize: Symbol('max response size'),
  18484. kHTTP2Session: Symbol('http2Session'),
  18485. kHTTP2SessionState: Symbol('http2Session state'),
  18486. kHTTP2BuildRequest: Symbol('http2 build request'),
  18487. kHTTP1BuildRequest: Symbol('http1 build request'),
  18488. kHTTP2CopyHeaders: Symbol('http2 copy headers'),
  18489. kHTTPConnVersion: Symbol('http connection version'),
  18490. kRetryHandlerDefaultRetry: Symbol('retry agent default retry'),
  18491. kConstruct: Symbol('constructable')
  18492. }
  18493. /***/ }),
  18494. /***/ 3983:
  18495. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  18496. "use strict";
  18497. const assert = __nccwpck_require__(9491)
  18498. const { kDestroyed, kBodyUsed } = __nccwpck_require__(2785)
  18499. const { IncomingMessage } = __nccwpck_require__(3685)
  18500. const stream = __nccwpck_require__(2781)
  18501. const net = __nccwpck_require__(1808)
  18502. const { InvalidArgumentError } = __nccwpck_require__(8045)
  18503. const { Blob } = __nccwpck_require__(4300)
  18504. const nodeUtil = __nccwpck_require__(3837)
  18505. const { stringify } = __nccwpck_require__(3477)
  18506. const { headerNameLowerCasedRecord } = __nccwpck_require__(4462)
  18507. const [nodeMajor, nodeMinor] = process.versions.node.split('.').map(v => Number(v))
  18508. function nop () {}
  18509. function isStream (obj) {
  18510. return obj && typeof obj === 'object' && typeof obj.pipe === 'function' && typeof obj.on === 'function'
  18511. }
  18512. // based on https://github.com/node-fetch/fetch-blob/blob/8ab587d34080de94140b54f07168451e7d0b655e/index.js#L229-L241 (MIT License)
  18513. function isBlobLike (object) {
  18514. return (Blob && object instanceof Blob) || (
  18515. object &&
  18516. typeof object === 'object' &&
  18517. (typeof object.stream === 'function' ||
  18518. typeof object.arrayBuffer === 'function') &&
  18519. /^(Blob|File)$/.test(object[Symbol.toStringTag])
  18520. )
  18521. }
  18522. function buildURL (url, queryParams) {
  18523. if (url.includes('?') || url.includes('#')) {
  18524. throw new Error('Query params cannot be passed when url already contains "?" or "#".')
  18525. }
  18526. const stringified = stringify(queryParams)
  18527. if (stringified) {
  18528. url += '?' + stringified
  18529. }
  18530. return url
  18531. }
  18532. function parseURL (url) {
  18533. if (typeof url === 'string') {
  18534. url = new URL(url)
  18535. if (!/^https?:/.test(url.origin || url.protocol)) {
  18536. throw new InvalidArgumentError('Invalid URL protocol: the URL must start with `http:` or `https:`.')
  18537. }
  18538. return url
  18539. }
  18540. if (!url || typeof url !== 'object') {
  18541. throw new InvalidArgumentError('Invalid URL: The URL argument must be a non-null object.')
  18542. }
  18543. if (!/^https?:/.test(url.origin || url.protocol)) {
  18544. throw new InvalidArgumentError('Invalid URL protocol: the URL must start with `http:` or `https:`.')
  18545. }
  18546. if (!(url instanceof URL)) {
  18547. if (url.port != null && url.port !== '' && !Number.isFinite(parseInt(url.port))) {
  18548. throw new InvalidArgumentError('Invalid URL: port must be a valid integer or a string representation of an integer.')
  18549. }
  18550. if (url.path != null && typeof url.path !== 'string') {
  18551. throw new InvalidArgumentError('Invalid URL path: the path must be a string or null/undefined.')
  18552. }
  18553. if (url.pathname != null && typeof url.pathname !== 'string') {
  18554. throw new InvalidArgumentError('Invalid URL pathname: the pathname must be a string or null/undefined.')
  18555. }
  18556. if (url.hostname != null && typeof url.hostname !== 'string') {
  18557. throw new InvalidArgumentError('Invalid URL hostname: the hostname must be a string or null/undefined.')
  18558. }
  18559. if (url.origin != null && typeof url.origin !== 'string') {
  18560. throw new InvalidArgumentError('Invalid URL origin: the origin must be a string or null/undefined.')
  18561. }
  18562. const port = url.port != null
  18563. ? url.port
  18564. : (url.protocol === 'https:' ? 443 : 80)
  18565. let origin = url.origin != null
  18566. ? url.origin
  18567. : `${url.protocol}//${url.hostname}:${port}`
  18568. let path = url.path != null
  18569. ? url.path
  18570. : `${url.pathname || ''}${url.search || ''}`
  18571. if (origin.endsWith('/')) {
  18572. origin = origin.substring(0, origin.length - 1)
  18573. }
  18574. if (path && !path.startsWith('/')) {
  18575. path = `/${path}`
  18576. }
  18577. // new URL(path, origin) is unsafe when `path` contains an absolute URL
  18578. // From https://developer.mozilla.org/en-US/docs/Web/API/URL/URL:
  18579. // If first parameter is a relative URL, second param is required, and will be used as the base URL.
  18580. // If first parameter is an absolute URL, a given second param will be ignored.
  18581. url = new URL(origin + path)
  18582. }
  18583. return url
  18584. }
  18585. function parseOrigin (url) {
  18586. url = parseURL(url)
  18587. if (url.pathname !== '/' || url.search || url.hash) {
  18588. throw new InvalidArgumentError('invalid url')
  18589. }
  18590. return url
  18591. }
  18592. function getHostname (host) {
  18593. if (host[0] === '[') {
  18594. const idx = host.indexOf(']')
  18595. assert(idx !== -1)
  18596. return host.substring(1, idx)
  18597. }
  18598. const idx = host.indexOf(':')
  18599. if (idx === -1) return host
  18600. return host.substring(0, idx)
  18601. }
  18602. // IP addresses are not valid server names per RFC6066
  18603. // > Currently, the only server names supported are DNS hostnames
  18604. function getServerName (host) {
  18605. if (!host) {
  18606. return null
  18607. }
  18608. assert.strictEqual(typeof host, 'string')
  18609. const servername = getHostname(host)
  18610. if (net.isIP(servername)) {
  18611. return ''
  18612. }
  18613. return servername
  18614. }
  18615. function deepClone (obj) {
  18616. return JSON.parse(JSON.stringify(obj))
  18617. }
  18618. function isAsyncIterable (obj) {
  18619. return !!(obj != null && typeof obj[Symbol.asyncIterator] === 'function')
  18620. }
  18621. function isIterable (obj) {
  18622. return !!(obj != null && (typeof obj[Symbol.iterator] === 'function' || typeof obj[Symbol.asyncIterator] === 'function'))
  18623. }
  18624. function bodyLength (body) {
  18625. if (body == null) {
  18626. return 0
  18627. } else if (isStream(body)) {
  18628. const state = body._readableState
  18629. return state && state.objectMode === false && state.ended === true && Number.isFinite(state.length)
  18630. ? state.length
  18631. : null
  18632. } else if (isBlobLike(body)) {
  18633. return body.size != null ? body.size : null
  18634. } else if (isBuffer(body)) {
  18635. return body.byteLength
  18636. }
  18637. return null
  18638. }
  18639. function isDestroyed (stream) {
  18640. return !stream || !!(stream.destroyed || stream[kDestroyed])
  18641. }
  18642. function isReadableAborted (stream) {
  18643. const state = stream && stream._readableState
  18644. return isDestroyed(stream) && state && !state.endEmitted
  18645. }
  18646. function destroy (stream, err) {
  18647. if (stream == null || !isStream(stream) || isDestroyed(stream)) {
  18648. return
  18649. }
  18650. if (typeof stream.destroy === 'function') {
  18651. if (Object.getPrototypeOf(stream).constructor === IncomingMessage) {
  18652. // See: https://github.com/nodejs/node/pull/38505/files
  18653. stream.socket = null
  18654. }
  18655. stream.destroy(err)
  18656. } else if (err) {
  18657. process.nextTick((stream, err) => {
  18658. stream.emit('error', err)
  18659. }, stream, err)
  18660. }
  18661. if (stream.destroyed !== true) {
  18662. stream[kDestroyed] = true
  18663. }
  18664. }
  18665. const KEEPALIVE_TIMEOUT_EXPR = /timeout=(\d+)/
  18666. function parseKeepAliveTimeout (val) {
  18667. const m = val.toString().match(KEEPALIVE_TIMEOUT_EXPR)
  18668. return m ? parseInt(m[1], 10) * 1000 : null
  18669. }
  18670. /**
  18671. * Retrieves a header name and returns its lowercase value.
  18672. * @param {string | Buffer} value Header name
  18673. * @returns {string}
  18674. */
  18675. function headerNameToString (value) {
  18676. return headerNameLowerCasedRecord[value] || value.toLowerCase()
  18677. }
  18678. function parseHeaders (headers, obj = {}) {
  18679. // For H2 support
  18680. if (!Array.isArray(headers)) return headers
  18681. for (let i = 0; i < headers.length; i += 2) {
  18682. const key = headers[i].toString().toLowerCase()
  18683. let val = obj[key]
  18684. if (!val) {
  18685. if (Array.isArray(headers[i + 1])) {
  18686. obj[key] = headers[i + 1].map(x => x.toString('utf8'))
  18687. } else {
  18688. obj[key] = headers[i + 1].toString('utf8')
  18689. }
  18690. } else {
  18691. if (!Array.isArray(val)) {
  18692. val = [val]
  18693. obj[key] = val
  18694. }
  18695. val.push(headers[i + 1].toString('utf8'))
  18696. }
  18697. }
  18698. // See https://github.com/nodejs/node/pull/46528
  18699. if ('content-length' in obj && 'content-disposition' in obj) {
  18700. obj['content-disposition'] = Buffer.from(obj['content-disposition']).toString('latin1')
  18701. }
  18702. return obj
  18703. }
  18704. function parseRawHeaders (headers) {
  18705. const ret = []
  18706. let hasContentLength = false
  18707. let contentDispositionIdx = -1
  18708. for (let n = 0; n < headers.length; n += 2) {
  18709. const key = headers[n + 0].toString()
  18710. const val = headers[n + 1].toString('utf8')
  18711. if (key.length === 14 && (key === 'content-length' || key.toLowerCase() === 'content-length')) {
  18712. ret.push(key, val)
  18713. hasContentLength = true
  18714. } else if (key.length === 19 && (key === 'content-disposition' || key.toLowerCase() === 'content-disposition')) {
  18715. contentDispositionIdx = ret.push(key, val) - 1
  18716. } else {
  18717. ret.push(key, val)
  18718. }
  18719. }
  18720. // See https://github.com/nodejs/node/pull/46528
  18721. if (hasContentLength && contentDispositionIdx !== -1) {
  18722. ret[contentDispositionIdx] = Buffer.from(ret[contentDispositionIdx]).toString('latin1')
  18723. }
  18724. return ret
  18725. }
  18726. function isBuffer (buffer) {
  18727. // See, https://github.com/mcollina/undici/pull/319
  18728. return buffer instanceof Uint8Array || Buffer.isBuffer(buffer)
  18729. }
  18730. function validateHandler (handler, method, upgrade) {
  18731. if (!handler || typeof handler !== 'object') {
  18732. throw new InvalidArgumentError('handler must be an object')
  18733. }
  18734. if (typeof handler.onConnect !== 'function') {
  18735. throw new InvalidArgumentError('invalid onConnect method')
  18736. }
  18737. if (typeof handler.onError !== 'function') {
  18738. throw new InvalidArgumentError('invalid onError method')
  18739. }
  18740. if (typeof handler.onBodySent !== 'function' && handler.onBodySent !== undefined) {
  18741. throw new InvalidArgumentError('invalid onBodySent method')
  18742. }
  18743. if (upgrade || method === 'CONNECT') {
  18744. if (typeof handler.onUpgrade !== 'function') {
  18745. throw new InvalidArgumentError('invalid onUpgrade method')
  18746. }
  18747. } else {
  18748. if (typeof handler.onHeaders !== 'function') {
  18749. throw new InvalidArgumentError('invalid onHeaders method')
  18750. }
  18751. if (typeof handler.onData !== 'function') {
  18752. throw new InvalidArgumentError('invalid onData method')
  18753. }
  18754. if (typeof handler.onComplete !== 'function') {
  18755. throw new InvalidArgumentError('invalid onComplete method')
  18756. }
  18757. }
  18758. }
  18759. // A body is disturbed if it has been read from and it cannot
  18760. // be re-used without losing state or data.
  18761. function isDisturbed (body) {
  18762. return !!(body && (
  18763. stream.isDisturbed
  18764. ? stream.isDisturbed(body) || body[kBodyUsed] // TODO (fix): Why is body[kBodyUsed] needed?
  18765. : body[kBodyUsed] ||
  18766. body.readableDidRead ||
  18767. (body._readableState && body._readableState.dataEmitted) ||
  18768. isReadableAborted(body)
  18769. ))
  18770. }
  18771. function isErrored (body) {
  18772. return !!(body && (
  18773. stream.isErrored
  18774. ? stream.isErrored(body)
  18775. : /state: 'errored'/.test(nodeUtil.inspect(body)
  18776. )))
  18777. }
  18778. function isReadable (body) {
  18779. return !!(body && (
  18780. stream.isReadable
  18781. ? stream.isReadable(body)
  18782. : /state: 'readable'/.test(nodeUtil.inspect(body)
  18783. )))
  18784. }
  18785. function getSocketInfo (socket) {
  18786. return {
  18787. localAddress: socket.localAddress,
  18788. localPort: socket.localPort,
  18789. remoteAddress: socket.remoteAddress,
  18790. remotePort: socket.remotePort,
  18791. remoteFamily: socket.remoteFamily,
  18792. timeout: socket.timeout,
  18793. bytesWritten: socket.bytesWritten,
  18794. bytesRead: socket.bytesRead
  18795. }
  18796. }
  18797. async function * convertIterableToBuffer (iterable) {
  18798. for await (const chunk of iterable) {
  18799. yield Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk)
  18800. }
  18801. }
  18802. let ReadableStream
  18803. function ReadableStreamFrom (iterable) {
  18804. if (!ReadableStream) {
  18805. ReadableStream = (__nccwpck_require__(5356).ReadableStream)
  18806. }
  18807. if (ReadableStream.from) {
  18808. return ReadableStream.from(convertIterableToBuffer(iterable))
  18809. }
  18810. let iterator
  18811. return new ReadableStream(
  18812. {
  18813. async start () {
  18814. iterator = iterable[Symbol.asyncIterator]()
  18815. },
  18816. async pull (controller) {
  18817. const { done, value } = await iterator.next()
  18818. if (done) {
  18819. queueMicrotask(() => {
  18820. controller.close()
  18821. })
  18822. } else {
  18823. const buf = Buffer.isBuffer(value) ? value : Buffer.from(value)
  18824. controller.enqueue(new Uint8Array(buf))
  18825. }
  18826. return controller.desiredSize > 0
  18827. },
  18828. async cancel (reason) {
  18829. await iterator.return()
  18830. }
  18831. },
  18832. 0
  18833. )
  18834. }
  18835. // The chunk should be a FormData instance and contains
  18836. // all the required methods.
  18837. function isFormDataLike (object) {
  18838. return (
  18839. object &&
  18840. typeof object === 'object' &&
  18841. typeof object.append === 'function' &&
  18842. typeof object.delete === 'function' &&
  18843. typeof object.get === 'function' &&
  18844. typeof object.getAll === 'function' &&
  18845. typeof object.has === 'function' &&
  18846. typeof object.set === 'function' &&
  18847. object[Symbol.toStringTag] === 'FormData'
  18848. )
  18849. }
  18850. function throwIfAborted (signal) {
  18851. if (!signal) { return }
  18852. if (typeof signal.throwIfAborted === 'function') {
  18853. signal.throwIfAborted()
  18854. } else {
  18855. if (signal.aborted) {
  18856. // DOMException not available < v17.0.0
  18857. const err = new Error('The operation was aborted')
  18858. err.name = 'AbortError'
  18859. throw err
  18860. }
  18861. }
  18862. }
  18863. function addAbortListener (signal, listener) {
  18864. if ('addEventListener' in signal) {
  18865. signal.addEventListener('abort', listener, { once: true })
  18866. return () => signal.removeEventListener('abort', listener)
  18867. }
  18868. signal.addListener('abort', listener)
  18869. return () => signal.removeListener('abort', listener)
  18870. }
  18871. const hasToWellFormed = !!String.prototype.toWellFormed
  18872. /**
  18873. * @param {string} val
  18874. */
  18875. function toUSVString (val) {
  18876. if (hasToWellFormed) {
  18877. return `${val}`.toWellFormed()
  18878. } else if (nodeUtil.toUSVString) {
  18879. return nodeUtil.toUSVString(val)
  18880. }
  18881. return `${val}`
  18882. }
  18883. // Parsed accordingly to RFC 9110
  18884. // https://www.rfc-editor.org/rfc/rfc9110#field.content-range
  18885. function parseRangeHeader (range) {
  18886. if (range == null || range === '') return { start: 0, end: null, size: null }
  18887. const m = range ? range.match(/^bytes (\d+)-(\d+)\/(\d+)?$/) : null
  18888. return m
  18889. ? {
  18890. start: parseInt(m[1]),
  18891. end: m[2] ? parseInt(m[2]) : null,
  18892. size: m[3] ? parseInt(m[3]) : null
  18893. }
  18894. : null
  18895. }
  18896. const kEnumerableProperty = Object.create(null)
  18897. kEnumerableProperty.enumerable = true
  18898. module.exports = {
  18899. kEnumerableProperty,
  18900. nop,
  18901. isDisturbed,
  18902. isErrored,
  18903. isReadable,
  18904. toUSVString,
  18905. isReadableAborted,
  18906. isBlobLike,
  18907. parseOrigin,
  18908. parseURL,
  18909. getServerName,
  18910. isStream,
  18911. isIterable,
  18912. isAsyncIterable,
  18913. isDestroyed,
  18914. headerNameToString,
  18915. parseRawHeaders,
  18916. parseHeaders,
  18917. parseKeepAliveTimeout,
  18918. destroy,
  18919. bodyLength,
  18920. deepClone,
  18921. ReadableStreamFrom,
  18922. isBuffer,
  18923. validateHandler,
  18924. getSocketInfo,
  18925. isFormDataLike,
  18926. buildURL,
  18927. throwIfAborted,
  18928. addAbortListener,
  18929. parseRangeHeader,
  18930. nodeMajor,
  18931. nodeMinor,
  18932. nodeHasAutoSelectFamily: nodeMajor > 18 || (nodeMajor === 18 && nodeMinor >= 13),
  18933. safeHTTPMethods: ['GET', 'HEAD', 'OPTIONS', 'TRACE']
  18934. }
  18935. /***/ }),
  18936. /***/ 4839:
  18937. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  18938. "use strict";
  18939. const Dispatcher = __nccwpck_require__(412)
  18940. const {
  18941. ClientDestroyedError,
  18942. ClientClosedError,
  18943. InvalidArgumentError
  18944. } = __nccwpck_require__(8045)
  18945. const { kDestroy, kClose, kDispatch, kInterceptors } = __nccwpck_require__(2785)
  18946. const kDestroyed = Symbol('destroyed')
  18947. const kClosed = Symbol('closed')
  18948. const kOnDestroyed = Symbol('onDestroyed')
  18949. const kOnClosed = Symbol('onClosed')
  18950. const kInterceptedDispatch = Symbol('Intercepted Dispatch')
  18951. class DispatcherBase extends Dispatcher {
  18952. constructor () {
  18953. super()
  18954. this[kDestroyed] = false
  18955. this[kOnDestroyed] = null
  18956. this[kClosed] = false
  18957. this[kOnClosed] = []
  18958. }
  18959. get destroyed () {
  18960. return this[kDestroyed]
  18961. }
  18962. get closed () {
  18963. return this[kClosed]
  18964. }
  18965. get interceptors () {
  18966. return this[kInterceptors]
  18967. }
  18968. set interceptors (newInterceptors) {
  18969. if (newInterceptors) {
  18970. for (let i = newInterceptors.length - 1; i >= 0; i--) {
  18971. const interceptor = this[kInterceptors][i]
  18972. if (typeof interceptor !== 'function') {
  18973. throw new InvalidArgumentError('interceptor must be an function')
  18974. }
  18975. }
  18976. }
  18977. this[kInterceptors] = newInterceptors
  18978. }
  18979. close (callback) {
  18980. if (callback === undefined) {
  18981. return new Promise((resolve, reject) => {
  18982. this.close((err, data) => {
  18983. return err ? reject(err) : resolve(data)
  18984. })
  18985. })
  18986. }
  18987. if (typeof callback !== 'function') {
  18988. throw new InvalidArgumentError('invalid callback')
  18989. }
  18990. if (this[kDestroyed]) {
  18991. queueMicrotask(() => callback(new ClientDestroyedError(), null))
  18992. return
  18993. }
  18994. if (this[kClosed]) {
  18995. if (this[kOnClosed]) {
  18996. this[kOnClosed].push(callback)
  18997. } else {
  18998. queueMicrotask(() => callback(null, null))
  18999. }
  19000. return
  19001. }
  19002. this[kClosed] = true
  19003. this[kOnClosed].push(callback)
  19004. const onClosed = () => {
  19005. const callbacks = this[kOnClosed]
  19006. this[kOnClosed] = null
  19007. for (let i = 0; i < callbacks.length; i++) {
  19008. callbacks[i](null, null)
  19009. }
  19010. }
  19011. // Should not error.
  19012. this[kClose]()
  19013. .then(() => this.destroy())
  19014. .then(() => {
  19015. queueMicrotask(onClosed)
  19016. })
  19017. }
  19018. destroy (err, callback) {
  19019. if (typeof err === 'function') {
  19020. callback = err
  19021. err = null
  19022. }
  19023. if (callback === undefined) {
  19024. return new Promise((resolve, reject) => {
  19025. this.destroy(err, (err, data) => {
  19026. return err ? /* istanbul ignore next: should never error */ reject(err) : resolve(data)
  19027. })
  19028. })
  19029. }
  19030. if (typeof callback !== 'function') {
  19031. throw new InvalidArgumentError('invalid callback')
  19032. }
  19033. if (this[kDestroyed]) {
  19034. if (this[kOnDestroyed]) {
  19035. this[kOnDestroyed].push(callback)
  19036. } else {
  19037. queueMicrotask(() => callback(null, null))
  19038. }
  19039. return
  19040. }
  19041. if (!err) {
  19042. err = new ClientDestroyedError()
  19043. }
  19044. this[kDestroyed] = true
  19045. this[kOnDestroyed] = this[kOnDestroyed] || []
  19046. this[kOnDestroyed].push(callback)
  19047. const onDestroyed = () => {
  19048. const callbacks = this[kOnDestroyed]
  19049. this[kOnDestroyed] = null
  19050. for (let i = 0; i < callbacks.length; i++) {
  19051. callbacks[i](null, null)
  19052. }
  19053. }
  19054. // Should not error.
  19055. this[kDestroy](err).then(() => {
  19056. queueMicrotask(onDestroyed)
  19057. })
  19058. }
  19059. [kInterceptedDispatch] (opts, handler) {
  19060. if (!this[kInterceptors] || this[kInterceptors].length === 0) {
  19061. this[kInterceptedDispatch] = this[kDispatch]
  19062. return this[kDispatch](opts, handler)
  19063. }
  19064. let dispatch = this[kDispatch].bind(this)
  19065. for (let i = this[kInterceptors].length - 1; i >= 0; i--) {
  19066. dispatch = this[kInterceptors][i](dispatch)
  19067. }
  19068. this[kInterceptedDispatch] = dispatch
  19069. return dispatch(opts, handler)
  19070. }
  19071. dispatch (opts, handler) {
  19072. if (!handler || typeof handler !== 'object') {
  19073. throw new InvalidArgumentError('handler must be an object')
  19074. }
  19075. try {
  19076. if (!opts || typeof opts !== 'object') {
  19077. throw new InvalidArgumentError('opts must be an object.')
  19078. }
  19079. if (this[kDestroyed] || this[kOnDestroyed]) {
  19080. throw new ClientDestroyedError()
  19081. }
  19082. if (this[kClosed]) {
  19083. throw new ClientClosedError()
  19084. }
  19085. return this[kInterceptedDispatch](opts, handler)
  19086. } catch (err) {
  19087. if (typeof handler.onError !== 'function') {
  19088. throw new InvalidArgumentError('invalid onError method')
  19089. }
  19090. handler.onError(err)
  19091. return false
  19092. }
  19093. }
  19094. }
  19095. module.exports = DispatcherBase
  19096. /***/ }),
  19097. /***/ 412:
  19098. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  19099. "use strict";
  19100. const EventEmitter = __nccwpck_require__(2361)
  19101. class Dispatcher extends EventEmitter {
  19102. dispatch () {
  19103. throw new Error('not implemented')
  19104. }
  19105. close () {
  19106. throw new Error('not implemented')
  19107. }
  19108. destroy () {
  19109. throw new Error('not implemented')
  19110. }
  19111. }
  19112. module.exports = Dispatcher
  19113. /***/ }),
  19114. /***/ 9990:
  19115. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  19116. "use strict";
  19117. const Busboy = __nccwpck_require__(727)
  19118. const util = __nccwpck_require__(3983)
  19119. const {
  19120. ReadableStreamFrom,
  19121. isBlobLike,
  19122. isReadableStreamLike,
  19123. readableStreamClose,
  19124. createDeferredPromise,
  19125. fullyReadBody
  19126. } = __nccwpck_require__(2538)
  19127. const { FormData } = __nccwpck_require__(2015)
  19128. const { kState } = __nccwpck_require__(5861)
  19129. const { webidl } = __nccwpck_require__(1744)
  19130. const { DOMException, structuredClone } = __nccwpck_require__(1037)
  19131. const { Blob, File: NativeFile } = __nccwpck_require__(4300)
  19132. const { kBodyUsed } = __nccwpck_require__(2785)
  19133. const assert = __nccwpck_require__(9491)
  19134. const { isErrored } = __nccwpck_require__(3983)
  19135. const { isUint8Array, isArrayBuffer } = __nccwpck_require__(9830)
  19136. const { File: UndiciFile } = __nccwpck_require__(8511)
  19137. const { parseMIMEType, serializeAMimeType } = __nccwpck_require__(685)
  19138. let ReadableStream = globalThis.ReadableStream
  19139. /** @type {globalThis['File']} */
  19140. const File = NativeFile ?? UndiciFile
  19141. const textEncoder = new TextEncoder()
  19142. const textDecoder = new TextDecoder()
  19143. // https://fetch.spec.whatwg.org/#concept-bodyinit-extract
  19144. function extractBody (object, keepalive = false) {
  19145. if (!ReadableStream) {
  19146. ReadableStream = (__nccwpck_require__(5356).ReadableStream)
  19147. }
  19148. // 1. Let stream be null.
  19149. let stream = null
  19150. // 2. If object is a ReadableStream object, then set stream to object.
  19151. if (object instanceof ReadableStream) {
  19152. stream = object
  19153. } else if (isBlobLike(object)) {
  19154. // 3. Otherwise, if object is a Blob object, set stream to the
  19155. // result of running object’s get stream.
  19156. stream = object.stream()
  19157. } else {
  19158. // 4. Otherwise, set stream to a new ReadableStream object, and set
  19159. // up stream.
  19160. stream = new ReadableStream({
  19161. async pull (controller) {
  19162. controller.enqueue(
  19163. typeof source === 'string' ? textEncoder.encode(source) : source
  19164. )
  19165. queueMicrotask(() => readableStreamClose(controller))
  19166. },
  19167. start () {},
  19168. type: undefined
  19169. })
  19170. }
  19171. // 5. Assert: stream is a ReadableStream object.
  19172. assert(isReadableStreamLike(stream))
  19173. // 6. Let action be null.
  19174. let action = null
  19175. // 7. Let source be null.
  19176. let source = null
  19177. // 8. Let length be null.
  19178. let length = null
  19179. // 9. Let type be null.
  19180. let type = null
  19181. // 10. Switch on object:
  19182. if (typeof object === 'string') {
  19183. // Set source to the UTF-8 encoding of object.
  19184. // Note: setting source to a Uint8Array here breaks some mocking assumptions.
  19185. source = object
  19186. // Set type to `text/plain;charset=UTF-8`.
  19187. type = 'text/plain;charset=UTF-8'
  19188. } else if (object instanceof URLSearchParams) {
  19189. // URLSearchParams
  19190. // spec says to run application/x-www-form-urlencoded on body.list
  19191. // this is implemented in Node.js as apart of an URLSearchParams instance toString method
  19192. // See: https://github.com/nodejs/node/blob/e46c680bf2b211bbd52cf959ca17ee98c7f657f5/lib/internal/url.js#L490
  19193. // and https://github.com/nodejs/node/blob/e46c680bf2b211bbd52cf959ca17ee98c7f657f5/lib/internal/url.js#L1100
  19194. // Set source to the result of running the application/x-www-form-urlencoded serializer with object’s list.
  19195. source = object.toString()
  19196. // Set type to `application/x-www-form-urlencoded;charset=UTF-8`.
  19197. type = 'application/x-www-form-urlencoded;charset=UTF-8'
  19198. } else if (isArrayBuffer(object)) {
  19199. // BufferSource/ArrayBuffer
  19200. // Set source to a copy of the bytes held by object.
  19201. source = new Uint8Array(object.slice())
  19202. } else if (ArrayBuffer.isView(object)) {
  19203. // BufferSource/ArrayBufferView
  19204. // Set source to a copy of the bytes held by object.
  19205. source = new Uint8Array(object.buffer.slice(object.byteOffset, object.byteOffset + object.byteLength))
  19206. } else if (util.isFormDataLike(object)) {
  19207. const boundary = `----formdata-undici-0${`${Math.floor(Math.random() * 1e11)}`.padStart(11, '0')}`
  19208. const prefix = `--${boundary}\r\nContent-Disposition: form-data`
  19209. /*! formdata-polyfill. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> */
  19210. const escape = (str) =>
  19211. str.replace(/\n/g, '%0A').replace(/\r/g, '%0D').replace(/"/g, '%22')
  19212. const normalizeLinefeeds = (value) => value.replace(/\r?\n|\r/g, '\r\n')
  19213. // Set action to this step: run the multipart/form-data
  19214. // encoding algorithm, with object’s entry list and UTF-8.
  19215. // - This ensures that the body is immutable and can't be changed afterwords
  19216. // - That the content-length is calculated in advance.
  19217. // - And that all parts are pre-encoded and ready to be sent.
  19218. const blobParts = []
  19219. const rn = new Uint8Array([13, 10]) // '\r\n'
  19220. length = 0
  19221. let hasUnknownSizeValue = false
  19222. for (const [name, value] of object) {
  19223. if (typeof value === 'string') {
  19224. const chunk = textEncoder.encode(prefix +
  19225. `; name="${escape(normalizeLinefeeds(name))}"` +
  19226. `\r\n\r\n${normalizeLinefeeds(value)}\r\n`)
  19227. blobParts.push(chunk)
  19228. length += chunk.byteLength
  19229. } else {
  19230. const chunk = textEncoder.encode(`${prefix}; name="${escape(normalizeLinefeeds(name))}"` +
  19231. (value.name ? `; filename="${escape(value.name)}"` : '') + '\r\n' +
  19232. `Content-Type: ${
  19233. value.type || 'application/octet-stream'
  19234. }\r\n\r\n`)
  19235. blobParts.push(chunk, value, rn)
  19236. if (typeof value.size === 'number') {
  19237. length += chunk.byteLength + value.size + rn.byteLength
  19238. } else {
  19239. hasUnknownSizeValue = true
  19240. }
  19241. }
  19242. }
  19243. const chunk = textEncoder.encode(`--${boundary}--`)
  19244. blobParts.push(chunk)
  19245. length += chunk.byteLength
  19246. if (hasUnknownSizeValue) {
  19247. length = null
  19248. }
  19249. // Set source to object.
  19250. source = object
  19251. action = async function * () {
  19252. for (const part of blobParts) {
  19253. if (part.stream) {
  19254. yield * part.stream()
  19255. } else {
  19256. yield part
  19257. }
  19258. }
  19259. }
  19260. // Set type to `multipart/form-data; boundary=`,
  19261. // followed by the multipart/form-data boundary string generated
  19262. // by the multipart/form-data encoding algorithm.
  19263. type = 'multipart/form-data; boundary=' + boundary
  19264. } else if (isBlobLike(object)) {
  19265. // Blob
  19266. // Set source to object.
  19267. source = object
  19268. // Set length to object’s size.
  19269. length = object.size
  19270. // If object’s type attribute is not the empty byte sequence, set
  19271. // type to its value.
  19272. if (object.type) {
  19273. type = object.type
  19274. }
  19275. } else if (typeof object[Symbol.asyncIterator] === 'function') {
  19276. // If keepalive is true, then throw a TypeError.
  19277. if (keepalive) {
  19278. throw new TypeError('keepalive')
  19279. }
  19280. // If object is disturbed or locked, then throw a TypeError.
  19281. if (util.isDisturbed(object) || object.locked) {
  19282. throw new TypeError(
  19283. 'Response body object should not be disturbed or locked'
  19284. )
  19285. }
  19286. stream =
  19287. object instanceof ReadableStream ? object : ReadableStreamFrom(object)
  19288. }
  19289. // 11. If source is a byte sequence, then set action to a
  19290. // step that returns source and length to source’s length.
  19291. if (typeof source === 'string' || util.isBuffer(source)) {
  19292. length = Buffer.byteLength(source)
  19293. }
  19294. // 12. If action is non-null, then run these steps in in parallel:
  19295. if (action != null) {
  19296. // Run action.
  19297. let iterator
  19298. stream = new ReadableStream({
  19299. async start () {
  19300. iterator = action(object)[Symbol.asyncIterator]()
  19301. },
  19302. async pull (controller) {
  19303. const { value, done } = await iterator.next()
  19304. if (done) {
  19305. // When running action is done, close stream.
  19306. queueMicrotask(() => {
  19307. controller.close()
  19308. })
  19309. } else {
  19310. // Whenever one or more bytes are available and stream is not errored,
  19311. // enqueue a Uint8Array wrapping an ArrayBuffer containing the available
  19312. // bytes into stream.
  19313. if (!isErrored(stream)) {
  19314. controller.enqueue(new Uint8Array(value))
  19315. }
  19316. }
  19317. return controller.desiredSize > 0
  19318. },
  19319. async cancel (reason) {
  19320. await iterator.return()
  19321. },
  19322. type: undefined
  19323. })
  19324. }
  19325. // 13. Let body be a body whose stream is stream, source is source,
  19326. // and length is length.
  19327. const body = { stream, source, length }
  19328. // 14. Return (body, type).
  19329. return [body, type]
  19330. }
  19331. // https://fetch.spec.whatwg.org/#bodyinit-safely-extract
  19332. function safelyExtractBody (object, keepalive = false) {
  19333. if (!ReadableStream) {
  19334. // istanbul ignore next
  19335. ReadableStream = (__nccwpck_require__(5356).ReadableStream)
  19336. }
  19337. // To safely extract a body and a `Content-Type` value from
  19338. // a byte sequence or BodyInit object object, run these steps:
  19339. // 1. If object is a ReadableStream object, then:
  19340. if (object instanceof ReadableStream) {
  19341. // Assert: object is neither disturbed nor locked.
  19342. // istanbul ignore next
  19343. assert(!util.isDisturbed(object), 'The body has already been consumed.')
  19344. // istanbul ignore next
  19345. assert(!object.locked, 'The stream is locked.')
  19346. }
  19347. // 2. Return the results of extracting object.
  19348. return extractBody(object, keepalive)
  19349. }
  19350. function cloneBody (body) {
  19351. // To clone a body body, run these steps:
  19352. // https://fetch.spec.whatwg.org/#concept-body-clone
  19353. // 1. Let « out1, out2 » be the result of teeing body’s stream.
  19354. const [out1, out2] = body.stream.tee()
  19355. const out2Clone = structuredClone(out2, { transfer: [out2] })
  19356. // This, for whatever reasons, unrefs out2Clone which allows
  19357. // the process to exit by itself.
  19358. const [, finalClone] = out2Clone.tee()
  19359. // 2. Set body’s stream to out1.
  19360. body.stream = out1
  19361. // 3. Return a body whose stream is out2 and other members are copied from body.
  19362. return {
  19363. stream: finalClone,
  19364. length: body.length,
  19365. source: body.source
  19366. }
  19367. }
  19368. async function * consumeBody (body) {
  19369. if (body) {
  19370. if (isUint8Array(body)) {
  19371. yield body
  19372. } else {
  19373. const stream = body.stream
  19374. if (util.isDisturbed(stream)) {
  19375. throw new TypeError('The body has already been consumed.')
  19376. }
  19377. if (stream.locked) {
  19378. throw new TypeError('The stream is locked.')
  19379. }
  19380. // Compat.
  19381. stream[kBodyUsed] = true
  19382. yield * stream
  19383. }
  19384. }
  19385. }
  19386. function throwIfAborted (state) {
  19387. if (state.aborted) {
  19388. throw new DOMException('The operation was aborted.', 'AbortError')
  19389. }
  19390. }
  19391. function bodyMixinMethods (instance) {
  19392. const methods = {
  19393. blob () {
  19394. // The blob() method steps are to return the result of
  19395. // running consume body with this and the following step
  19396. // given a byte sequence bytes: return a Blob whose
  19397. // contents are bytes and whose type attribute is this’s
  19398. // MIME type.
  19399. return specConsumeBody(this, (bytes) => {
  19400. let mimeType = bodyMimeType(this)
  19401. if (mimeType === 'failure') {
  19402. mimeType = ''
  19403. } else if (mimeType) {
  19404. mimeType = serializeAMimeType(mimeType)
  19405. }
  19406. // Return a Blob whose contents are bytes and type attribute
  19407. // is mimeType.
  19408. return new Blob([bytes], { type: mimeType })
  19409. }, instance)
  19410. },
  19411. arrayBuffer () {
  19412. // The arrayBuffer() method steps are to return the result
  19413. // of running consume body with this and the following step
  19414. // given a byte sequence bytes: return a new ArrayBuffer
  19415. // whose contents are bytes.
  19416. return specConsumeBody(this, (bytes) => {
  19417. return new Uint8Array(bytes).buffer
  19418. }, instance)
  19419. },
  19420. text () {
  19421. // The text() method steps are to return the result of running
  19422. // consume body with this and UTF-8 decode.
  19423. return specConsumeBody(this, utf8DecodeBytes, instance)
  19424. },
  19425. json () {
  19426. // The json() method steps are to return the result of running
  19427. // consume body with this and parse JSON from bytes.
  19428. return specConsumeBody(this, parseJSONFromBytes, instance)
  19429. },
  19430. async formData () {
  19431. webidl.brandCheck(this, instance)
  19432. throwIfAborted(this[kState])
  19433. const contentType = this.headers.get('Content-Type')
  19434. // If mimeType’s essence is "multipart/form-data", then:
  19435. if (/multipart\/form-data/.test(contentType)) {
  19436. const headers = {}
  19437. for (const [key, value] of this.headers) headers[key.toLowerCase()] = value
  19438. const responseFormData = new FormData()
  19439. let busboy
  19440. try {
  19441. busboy = new Busboy({
  19442. headers,
  19443. preservePath: true
  19444. })
  19445. } catch (err) {
  19446. throw new DOMException(`${err}`, 'AbortError')
  19447. }
  19448. busboy.on('field', (name, value) => {
  19449. responseFormData.append(name, value)
  19450. })
  19451. busboy.on('file', (name, value, filename, encoding, mimeType) => {
  19452. const chunks = []
  19453. if (encoding === 'base64' || encoding.toLowerCase() === 'base64') {
  19454. let base64chunk = ''
  19455. value.on('data', (chunk) => {
  19456. base64chunk += chunk.toString().replace(/[\r\n]/gm, '')
  19457. const end = base64chunk.length - base64chunk.length % 4
  19458. chunks.push(Buffer.from(base64chunk.slice(0, end), 'base64'))
  19459. base64chunk = base64chunk.slice(end)
  19460. })
  19461. value.on('end', () => {
  19462. chunks.push(Buffer.from(base64chunk, 'base64'))
  19463. responseFormData.append(name, new File(chunks, filename, { type: mimeType }))
  19464. })
  19465. } else {
  19466. value.on('data', (chunk) => {
  19467. chunks.push(chunk)
  19468. })
  19469. value.on('end', () => {
  19470. responseFormData.append(name, new File(chunks, filename, { type: mimeType }))
  19471. })
  19472. }
  19473. })
  19474. const busboyResolve = new Promise((resolve, reject) => {
  19475. busboy.on('finish', resolve)
  19476. busboy.on('error', (err) => reject(new TypeError(err)))
  19477. })
  19478. if (this.body !== null) for await (const chunk of consumeBody(this[kState].body)) busboy.write(chunk)
  19479. busboy.end()
  19480. await busboyResolve
  19481. return responseFormData
  19482. } else if (/application\/x-www-form-urlencoded/.test(contentType)) {
  19483. // Otherwise, if mimeType’s essence is "application/x-www-form-urlencoded", then:
  19484. // 1. Let entries be the result of parsing bytes.
  19485. let entries
  19486. try {
  19487. let text = ''
  19488. // application/x-www-form-urlencoded parser will keep the BOM.
  19489. // https://url.spec.whatwg.org/#concept-urlencoded-parser
  19490. // Note that streaming decoder is stateful and cannot be reused
  19491. const streamingDecoder = new TextDecoder('utf-8', { ignoreBOM: true })
  19492. for await (const chunk of consumeBody(this[kState].body)) {
  19493. if (!isUint8Array(chunk)) {
  19494. throw new TypeError('Expected Uint8Array chunk')
  19495. }
  19496. text += streamingDecoder.decode(chunk, { stream: true })
  19497. }
  19498. text += streamingDecoder.decode()
  19499. entries = new URLSearchParams(text)
  19500. } catch (err) {
  19501. // istanbul ignore next: Unclear when new URLSearchParams can fail on a string.
  19502. // 2. If entries is failure, then throw a TypeError.
  19503. throw Object.assign(new TypeError(), { cause: err })
  19504. }
  19505. // 3. Return a new FormData object whose entries are entries.
  19506. const formData = new FormData()
  19507. for (const [name, value] of entries) {
  19508. formData.append(name, value)
  19509. }
  19510. return formData
  19511. } else {
  19512. // Wait a tick before checking if the request has been aborted.
  19513. // Otherwise, a TypeError can be thrown when an AbortError should.
  19514. await Promise.resolve()
  19515. throwIfAborted(this[kState])
  19516. // Otherwise, throw a TypeError.
  19517. throw webidl.errors.exception({
  19518. header: `${instance.name}.formData`,
  19519. message: 'Could not parse content as FormData.'
  19520. })
  19521. }
  19522. }
  19523. }
  19524. return methods
  19525. }
  19526. function mixinBody (prototype) {
  19527. Object.assign(prototype.prototype, bodyMixinMethods(prototype))
  19528. }
  19529. /**
  19530. * @see https://fetch.spec.whatwg.org/#concept-body-consume-body
  19531. * @param {Response|Request} object
  19532. * @param {(value: unknown) => unknown} convertBytesToJSValue
  19533. * @param {Response|Request} instance
  19534. */
  19535. async function specConsumeBody (object, convertBytesToJSValue, instance) {
  19536. webidl.brandCheck(object, instance)
  19537. throwIfAborted(object[kState])
  19538. // 1. If object is unusable, then return a promise rejected
  19539. // with a TypeError.
  19540. if (bodyUnusable(object[kState].body)) {
  19541. throw new TypeError('Body is unusable')
  19542. }
  19543. // 2. Let promise be a new promise.
  19544. const promise = createDeferredPromise()
  19545. // 3. Let errorSteps given error be to reject promise with error.
  19546. const errorSteps = (error) => promise.reject(error)
  19547. // 4. Let successSteps given a byte sequence data be to resolve
  19548. // promise with the result of running convertBytesToJSValue
  19549. // with data. If that threw an exception, then run errorSteps
  19550. // with that exception.
  19551. const successSteps = (data) => {
  19552. try {
  19553. promise.resolve(convertBytesToJSValue(data))
  19554. } catch (e) {
  19555. errorSteps(e)
  19556. }
  19557. }
  19558. // 5. If object’s body is null, then run successSteps with an
  19559. // empty byte sequence.
  19560. if (object[kState].body == null) {
  19561. successSteps(new Uint8Array())
  19562. return promise.promise
  19563. }
  19564. // 6. Otherwise, fully read object’s body given successSteps,
  19565. // errorSteps, and object’s relevant global object.
  19566. await fullyReadBody(object[kState].body, successSteps, errorSteps)
  19567. // 7. Return promise.
  19568. return promise.promise
  19569. }
  19570. // https://fetch.spec.whatwg.org/#body-unusable
  19571. function bodyUnusable (body) {
  19572. // An object including the Body interface mixin is
  19573. // said to be unusable if its body is non-null and
  19574. // its body’s stream is disturbed or locked.
  19575. return body != null && (body.stream.locked || util.isDisturbed(body.stream))
  19576. }
  19577. /**
  19578. * @see https://encoding.spec.whatwg.org/#utf-8-decode
  19579. * @param {Buffer} buffer
  19580. */
  19581. function utf8DecodeBytes (buffer) {
  19582. if (buffer.length === 0) {
  19583. return ''
  19584. }
  19585. // 1. Let buffer be the result of peeking three bytes from
  19586. // ioQueue, converted to a byte sequence.
  19587. // 2. If buffer is 0xEF 0xBB 0xBF, then read three
  19588. // bytes from ioQueue. (Do nothing with those bytes.)
  19589. if (buffer[0] === 0xEF && buffer[1] === 0xBB && buffer[2] === 0xBF) {
  19590. buffer = buffer.subarray(3)
  19591. }
  19592. // 3. Process a queue with an instance of UTF-8’s
  19593. // decoder, ioQueue, output, and "replacement".
  19594. const output = textDecoder.decode(buffer)
  19595. // 4. Return output.
  19596. return output
  19597. }
  19598. /**
  19599. * @see https://infra.spec.whatwg.org/#parse-json-bytes-to-a-javascript-value
  19600. * @param {Uint8Array} bytes
  19601. */
  19602. function parseJSONFromBytes (bytes) {
  19603. return JSON.parse(utf8DecodeBytes(bytes))
  19604. }
  19605. /**
  19606. * @see https://fetch.spec.whatwg.org/#concept-body-mime-type
  19607. * @param {import('./response').Response|import('./request').Request} object
  19608. */
  19609. function bodyMimeType (object) {
  19610. const { headersList } = object[kState]
  19611. const contentType = headersList.get('content-type')
  19612. if (contentType === null) {
  19613. return 'failure'
  19614. }
  19615. return parseMIMEType(contentType)
  19616. }
  19617. module.exports = {
  19618. extractBody,
  19619. safelyExtractBody,
  19620. cloneBody,
  19621. mixinBody
  19622. }
  19623. /***/ }),
  19624. /***/ 1037:
  19625. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  19626. "use strict";
  19627. const { MessageChannel, receiveMessageOnPort } = __nccwpck_require__(1267)
  19628. const corsSafeListedMethods = ['GET', 'HEAD', 'POST']
  19629. const corsSafeListedMethodsSet = new Set(corsSafeListedMethods)
  19630. const nullBodyStatus = [101, 204, 205, 304]
  19631. const redirectStatus = [301, 302, 303, 307, 308]
  19632. const redirectStatusSet = new Set(redirectStatus)
  19633. // https://fetch.spec.whatwg.org/#block-bad-port
  19634. const badPorts = [
  19635. '1', '7', '9', '11', '13', '15', '17', '19', '20', '21', '22', '23', '25', '37', '42', '43', '53', '69', '77', '79',
  19636. '87', '95', '101', '102', '103', '104', '109', '110', '111', '113', '115', '117', '119', '123', '135', '137',
  19637. '139', '143', '161', '179', '389', '427', '465', '512', '513', '514', '515', '526', '530', '531', '532',
  19638. '540', '548', '554', '556', '563', '587', '601', '636', '989', '990', '993', '995', '1719', '1720', '1723',
  19639. '2049', '3659', '4045', '5060', '5061', '6000', '6566', '6665', '6666', '6667', '6668', '6669', '6697',
  19640. '10080'
  19641. ]
  19642. const badPortsSet = new Set(badPorts)
  19643. // https://w3c.github.io/webappsec-referrer-policy/#referrer-policies
  19644. const referrerPolicy = [
  19645. '',
  19646. 'no-referrer',
  19647. 'no-referrer-when-downgrade',
  19648. 'same-origin',
  19649. 'origin',
  19650. 'strict-origin',
  19651. 'origin-when-cross-origin',
  19652. 'strict-origin-when-cross-origin',
  19653. 'unsafe-url'
  19654. ]
  19655. const referrerPolicySet = new Set(referrerPolicy)
  19656. const requestRedirect = ['follow', 'manual', 'error']
  19657. const safeMethods = ['GET', 'HEAD', 'OPTIONS', 'TRACE']
  19658. const safeMethodsSet = new Set(safeMethods)
  19659. const requestMode = ['navigate', 'same-origin', 'no-cors', 'cors']
  19660. const requestCredentials = ['omit', 'same-origin', 'include']
  19661. const requestCache = [
  19662. 'default',
  19663. 'no-store',
  19664. 'reload',
  19665. 'no-cache',
  19666. 'force-cache',
  19667. 'only-if-cached'
  19668. ]
  19669. // https://fetch.spec.whatwg.org/#request-body-header-name
  19670. const requestBodyHeader = [
  19671. 'content-encoding',
  19672. 'content-language',
  19673. 'content-location',
  19674. 'content-type',
  19675. // See https://github.com/nodejs/undici/issues/2021
  19676. // 'Content-Length' is a forbidden header name, which is typically
  19677. // removed in the Headers implementation. However, undici doesn't
  19678. // filter out headers, so we add it here.
  19679. 'content-length'
  19680. ]
  19681. // https://fetch.spec.whatwg.org/#enumdef-requestduplex
  19682. const requestDuplex = [
  19683. 'half'
  19684. ]
  19685. // http://fetch.spec.whatwg.org/#forbidden-method
  19686. const forbiddenMethods = ['CONNECT', 'TRACE', 'TRACK']
  19687. const forbiddenMethodsSet = new Set(forbiddenMethods)
  19688. const subresource = [
  19689. 'audio',
  19690. 'audioworklet',
  19691. 'font',
  19692. 'image',
  19693. 'manifest',
  19694. 'paintworklet',
  19695. 'script',
  19696. 'style',
  19697. 'track',
  19698. 'video',
  19699. 'xslt',
  19700. ''
  19701. ]
  19702. const subresourceSet = new Set(subresource)
  19703. /** @type {globalThis['DOMException']} */
  19704. const DOMException = globalThis.DOMException ?? (() => {
  19705. // DOMException was only made a global in Node v17.0.0,
  19706. // but fetch supports >= v16.8.
  19707. try {
  19708. atob('~')
  19709. } catch (err) {
  19710. return Object.getPrototypeOf(err).constructor
  19711. }
  19712. })()
  19713. let channel
  19714. /** @type {globalThis['structuredClone']} */
  19715. const structuredClone =
  19716. globalThis.structuredClone ??
  19717. // https://github.com/nodejs/node/blob/b27ae24dcc4251bad726d9d84baf678d1f707fed/lib/internal/structured_clone.js
  19718. // structuredClone was added in v17.0.0, but fetch supports v16.8
  19719. function structuredClone (value, options = undefined) {
  19720. if (arguments.length === 0) {
  19721. throw new TypeError('missing argument')
  19722. }
  19723. if (!channel) {
  19724. channel = new MessageChannel()
  19725. }
  19726. channel.port1.unref()
  19727. channel.port2.unref()
  19728. channel.port1.postMessage(value, options?.transfer)
  19729. return receiveMessageOnPort(channel.port2).message
  19730. }
  19731. module.exports = {
  19732. DOMException,
  19733. structuredClone,
  19734. subresource,
  19735. forbiddenMethods,
  19736. requestBodyHeader,
  19737. referrerPolicy,
  19738. requestRedirect,
  19739. requestMode,
  19740. requestCredentials,
  19741. requestCache,
  19742. redirectStatus,
  19743. corsSafeListedMethods,
  19744. nullBodyStatus,
  19745. safeMethods,
  19746. badPorts,
  19747. requestDuplex,
  19748. subresourceSet,
  19749. badPortsSet,
  19750. redirectStatusSet,
  19751. corsSafeListedMethodsSet,
  19752. safeMethodsSet,
  19753. forbiddenMethodsSet,
  19754. referrerPolicySet
  19755. }
  19756. /***/ }),
  19757. /***/ 685:
  19758. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  19759. const assert = __nccwpck_require__(9491)
  19760. const { atob } = __nccwpck_require__(4300)
  19761. const { isomorphicDecode } = __nccwpck_require__(2538)
  19762. const encoder = new TextEncoder()
  19763. /**
  19764. * @see https://mimesniff.spec.whatwg.org/#http-token-code-point
  19765. */
  19766. const HTTP_TOKEN_CODEPOINTS = /^[!#$%&'*+-.^_|~A-Za-z0-9]+$/
  19767. const HTTP_WHITESPACE_REGEX = /(\u000A|\u000D|\u0009|\u0020)/ // eslint-disable-line
  19768. /**
  19769. * @see https://mimesniff.spec.whatwg.org/#http-quoted-string-token-code-point
  19770. */
  19771. const HTTP_QUOTED_STRING_TOKENS = /[\u0009|\u0020-\u007E|\u0080-\u00FF]/ // eslint-disable-line
  19772. // https://fetch.spec.whatwg.org/#data-url-processor
  19773. /** @param {URL} dataURL */
  19774. function dataURLProcessor (dataURL) {
  19775. // 1. Assert: dataURL’s scheme is "data".
  19776. assert(dataURL.protocol === 'data:')
  19777. // 2. Let input be the result of running the URL
  19778. // serializer on dataURL with exclude fragment
  19779. // set to true.
  19780. let input = URLSerializer(dataURL, true)
  19781. // 3. Remove the leading "data:" string from input.
  19782. input = input.slice(5)
  19783. // 4. Let position point at the start of input.
  19784. const position = { position: 0 }
  19785. // 5. Let mimeType be the result of collecting a
  19786. // sequence of code points that are not equal
  19787. // to U+002C (,), given position.
  19788. let mimeType = collectASequenceOfCodePointsFast(
  19789. ',',
  19790. input,
  19791. position
  19792. )
  19793. // 6. Strip leading and trailing ASCII whitespace
  19794. // from mimeType.
  19795. // Undici implementation note: we need to store the
  19796. // length because if the mimetype has spaces removed,
  19797. // the wrong amount will be sliced from the input in
  19798. // step #9
  19799. const mimeTypeLength = mimeType.length
  19800. mimeType = removeASCIIWhitespace(mimeType, true, true)
  19801. // 7. If position is past the end of input, then
  19802. // return failure
  19803. if (position.position >= input.length) {
  19804. return 'failure'
  19805. }
  19806. // 8. Advance position by 1.
  19807. position.position++
  19808. // 9. Let encodedBody be the remainder of input.
  19809. const encodedBody = input.slice(mimeTypeLength + 1)
  19810. // 10. Let body be the percent-decoding of encodedBody.
  19811. let body = stringPercentDecode(encodedBody)
  19812. // 11. If mimeType ends with U+003B (;), followed by
  19813. // zero or more U+0020 SPACE, followed by an ASCII
  19814. // case-insensitive match for "base64", then:
  19815. if (/;(\u0020){0,}base64$/i.test(mimeType)) {
  19816. // 1. Let stringBody be the isomorphic decode of body.
  19817. const stringBody = isomorphicDecode(body)
  19818. // 2. Set body to the forgiving-base64 decode of
  19819. // stringBody.
  19820. body = forgivingBase64(stringBody)
  19821. // 3. If body is failure, then return failure.
  19822. if (body === 'failure') {
  19823. return 'failure'
  19824. }
  19825. // 4. Remove the last 6 code points from mimeType.
  19826. mimeType = mimeType.slice(0, -6)
  19827. // 5. Remove trailing U+0020 SPACE code points from mimeType,
  19828. // if any.
  19829. mimeType = mimeType.replace(/(\u0020)+$/, '')
  19830. // 6. Remove the last U+003B (;) code point from mimeType.
  19831. mimeType = mimeType.slice(0, -1)
  19832. }
  19833. // 12. If mimeType starts with U+003B (;), then prepend
  19834. // "text/plain" to mimeType.
  19835. if (mimeType.startsWith(';')) {
  19836. mimeType = 'text/plain' + mimeType
  19837. }
  19838. // 13. Let mimeTypeRecord be the result of parsing
  19839. // mimeType.
  19840. let mimeTypeRecord = parseMIMEType(mimeType)
  19841. // 14. If mimeTypeRecord is failure, then set
  19842. // mimeTypeRecord to text/plain;charset=US-ASCII.
  19843. if (mimeTypeRecord === 'failure') {
  19844. mimeTypeRecord = parseMIMEType('text/plain;charset=US-ASCII')
  19845. }
  19846. // 15. Return a new data: URL struct whose MIME
  19847. // type is mimeTypeRecord and body is body.
  19848. // https://fetch.spec.whatwg.org/#data-url-struct
  19849. return { mimeType: mimeTypeRecord, body }
  19850. }
  19851. // https://url.spec.whatwg.org/#concept-url-serializer
  19852. /**
  19853. * @param {URL} url
  19854. * @param {boolean} excludeFragment
  19855. */
  19856. function URLSerializer (url, excludeFragment = false) {
  19857. if (!excludeFragment) {
  19858. return url.href
  19859. }
  19860. const href = url.href
  19861. const hashLength = url.hash.length
  19862. return hashLength === 0 ? href : href.substring(0, href.length - hashLength)
  19863. }
  19864. // https://infra.spec.whatwg.org/#collect-a-sequence-of-code-points
  19865. /**
  19866. * @param {(char: string) => boolean} condition
  19867. * @param {string} input
  19868. * @param {{ position: number }} position
  19869. */
  19870. function collectASequenceOfCodePoints (condition, input, position) {
  19871. // 1. Let result be the empty string.
  19872. let result = ''
  19873. // 2. While position doesn’t point past the end of input and the
  19874. // code point at position within input meets the condition condition:
  19875. while (position.position < input.length && condition(input[position.position])) {
  19876. // 1. Append that code point to the end of result.
  19877. result += input[position.position]
  19878. // 2. Advance position by 1.
  19879. position.position++
  19880. }
  19881. // 3. Return result.
  19882. return result
  19883. }
  19884. /**
  19885. * A faster collectASequenceOfCodePoints that only works when comparing a single character.
  19886. * @param {string} char
  19887. * @param {string} input
  19888. * @param {{ position: number }} position
  19889. */
  19890. function collectASequenceOfCodePointsFast (char, input, position) {
  19891. const idx = input.indexOf(char, position.position)
  19892. const start = position.position
  19893. if (idx === -1) {
  19894. position.position = input.length
  19895. return input.slice(start)
  19896. }
  19897. position.position = idx
  19898. return input.slice(start, position.position)
  19899. }
  19900. // https://url.spec.whatwg.org/#string-percent-decode
  19901. /** @param {string} input */
  19902. function stringPercentDecode (input) {
  19903. // 1. Let bytes be the UTF-8 encoding of input.
  19904. const bytes = encoder.encode(input)
  19905. // 2. Return the percent-decoding of bytes.
  19906. return percentDecode(bytes)
  19907. }
  19908. // https://url.spec.whatwg.org/#percent-decode
  19909. /** @param {Uint8Array} input */
  19910. function percentDecode (input) {
  19911. // 1. Let output be an empty byte sequence.
  19912. /** @type {number[]} */
  19913. const output = []
  19914. // 2. For each byte byte in input:
  19915. for (let i = 0; i < input.length; i++) {
  19916. const byte = input[i]
  19917. // 1. If byte is not 0x25 (%), then append byte to output.
  19918. if (byte !== 0x25) {
  19919. output.push(byte)
  19920. // 2. Otherwise, if byte is 0x25 (%) and the next two bytes
  19921. // after byte in input are not in the ranges
  19922. // 0x30 (0) to 0x39 (9), 0x41 (A) to 0x46 (F),
  19923. // and 0x61 (a) to 0x66 (f), all inclusive, append byte
  19924. // to output.
  19925. } else if (
  19926. byte === 0x25 &&
  19927. !/^[0-9A-Fa-f]{2}$/i.test(String.fromCharCode(input[i + 1], input[i + 2]))
  19928. ) {
  19929. output.push(0x25)
  19930. // 3. Otherwise:
  19931. } else {
  19932. // 1. Let bytePoint be the two bytes after byte in input,
  19933. // decoded, and then interpreted as hexadecimal number.
  19934. const nextTwoBytes = String.fromCharCode(input[i + 1], input[i + 2])
  19935. const bytePoint = Number.parseInt(nextTwoBytes, 16)
  19936. // 2. Append a byte whose value is bytePoint to output.
  19937. output.push(bytePoint)
  19938. // 3. Skip the next two bytes in input.
  19939. i += 2
  19940. }
  19941. }
  19942. // 3. Return output.
  19943. return Uint8Array.from(output)
  19944. }
  19945. // https://mimesniff.spec.whatwg.org/#parse-a-mime-type
  19946. /** @param {string} input */
  19947. function parseMIMEType (input) {
  19948. // 1. Remove any leading and trailing HTTP whitespace
  19949. // from input.
  19950. input = removeHTTPWhitespace(input, true, true)
  19951. // 2. Let position be a position variable for input,
  19952. // initially pointing at the start of input.
  19953. const position = { position: 0 }
  19954. // 3. Let type be the result of collecting a sequence
  19955. // of code points that are not U+002F (/) from
  19956. // input, given position.
  19957. const type = collectASequenceOfCodePointsFast(
  19958. '/',
  19959. input,
  19960. position
  19961. )
  19962. // 4. If type is the empty string or does not solely
  19963. // contain HTTP token code points, then return failure.
  19964. // https://mimesniff.spec.whatwg.org/#http-token-code-point
  19965. if (type.length === 0 || !HTTP_TOKEN_CODEPOINTS.test(type)) {
  19966. return 'failure'
  19967. }
  19968. // 5. If position is past the end of input, then return
  19969. // failure
  19970. if (position.position > input.length) {
  19971. return 'failure'
  19972. }
  19973. // 6. Advance position by 1. (This skips past U+002F (/).)
  19974. position.position++
  19975. // 7. Let subtype be the result of collecting a sequence of
  19976. // code points that are not U+003B (;) from input, given
  19977. // position.
  19978. let subtype = collectASequenceOfCodePointsFast(
  19979. ';',
  19980. input,
  19981. position
  19982. )
  19983. // 8. Remove any trailing HTTP whitespace from subtype.
  19984. subtype = removeHTTPWhitespace(subtype, false, true)
  19985. // 9. If subtype is the empty string or does not solely
  19986. // contain HTTP token code points, then return failure.
  19987. if (subtype.length === 0 || !HTTP_TOKEN_CODEPOINTS.test(subtype)) {
  19988. return 'failure'
  19989. }
  19990. const typeLowercase = type.toLowerCase()
  19991. const subtypeLowercase = subtype.toLowerCase()
  19992. // 10. Let mimeType be a new MIME type record whose type
  19993. // is type, in ASCII lowercase, and subtype is subtype,
  19994. // in ASCII lowercase.
  19995. // https://mimesniff.spec.whatwg.org/#mime-type
  19996. const mimeType = {
  19997. type: typeLowercase,
  19998. subtype: subtypeLowercase,
  19999. /** @type {Map<string, string>} */
  20000. parameters: new Map(),
  20001. // https://mimesniff.spec.whatwg.org/#mime-type-essence
  20002. essence: `${typeLowercase}/${subtypeLowercase}`
  20003. }
  20004. // 11. While position is not past the end of input:
  20005. while (position.position < input.length) {
  20006. // 1. Advance position by 1. (This skips past U+003B (;).)
  20007. position.position++
  20008. // 2. Collect a sequence of code points that are HTTP
  20009. // whitespace from input given position.
  20010. collectASequenceOfCodePoints(
  20011. // https://fetch.spec.whatwg.org/#http-whitespace
  20012. char => HTTP_WHITESPACE_REGEX.test(char),
  20013. input,
  20014. position
  20015. )
  20016. // 3. Let parameterName be the result of collecting a
  20017. // sequence of code points that are not U+003B (;)
  20018. // or U+003D (=) from input, given position.
  20019. let parameterName = collectASequenceOfCodePoints(
  20020. (char) => char !== ';' && char !== '=',
  20021. input,
  20022. position
  20023. )
  20024. // 4. Set parameterName to parameterName, in ASCII
  20025. // lowercase.
  20026. parameterName = parameterName.toLowerCase()
  20027. // 5. If position is not past the end of input, then:
  20028. if (position.position < input.length) {
  20029. // 1. If the code point at position within input is
  20030. // U+003B (;), then continue.
  20031. if (input[position.position] === ';') {
  20032. continue
  20033. }
  20034. // 2. Advance position by 1. (This skips past U+003D (=).)
  20035. position.position++
  20036. }
  20037. // 6. If position is past the end of input, then break.
  20038. if (position.position > input.length) {
  20039. break
  20040. }
  20041. // 7. Let parameterValue be null.
  20042. let parameterValue = null
  20043. // 8. If the code point at position within input is
  20044. // U+0022 ("), then:
  20045. if (input[position.position] === '"') {
  20046. // 1. Set parameterValue to the result of collecting
  20047. // an HTTP quoted string from input, given position
  20048. // and the extract-value flag.
  20049. parameterValue = collectAnHTTPQuotedString(input, position, true)
  20050. // 2. Collect a sequence of code points that are not
  20051. // U+003B (;) from input, given position.
  20052. collectASequenceOfCodePointsFast(
  20053. ';',
  20054. input,
  20055. position
  20056. )
  20057. // 9. Otherwise:
  20058. } else {
  20059. // 1. Set parameterValue to the result of collecting
  20060. // a sequence of code points that are not U+003B (;)
  20061. // from input, given position.
  20062. parameterValue = collectASequenceOfCodePointsFast(
  20063. ';',
  20064. input,
  20065. position
  20066. )
  20067. // 2. Remove any trailing HTTP whitespace from parameterValue.
  20068. parameterValue = removeHTTPWhitespace(parameterValue, false, true)
  20069. // 3. If parameterValue is the empty string, then continue.
  20070. if (parameterValue.length === 0) {
  20071. continue
  20072. }
  20073. }
  20074. // 10. If all of the following are true
  20075. // - parameterName is not the empty string
  20076. // - parameterName solely contains HTTP token code points
  20077. // - parameterValue solely contains HTTP quoted-string token code points
  20078. // - mimeType’s parameters[parameterName] does not exist
  20079. // then set mimeType’s parameters[parameterName] to parameterValue.
  20080. if (
  20081. parameterName.length !== 0 &&
  20082. HTTP_TOKEN_CODEPOINTS.test(parameterName) &&
  20083. (parameterValue.length === 0 || HTTP_QUOTED_STRING_TOKENS.test(parameterValue)) &&
  20084. !mimeType.parameters.has(parameterName)
  20085. ) {
  20086. mimeType.parameters.set(parameterName, parameterValue)
  20087. }
  20088. }
  20089. // 12. Return mimeType.
  20090. return mimeType
  20091. }
  20092. // https://infra.spec.whatwg.org/#forgiving-base64-decode
  20093. /** @param {string} data */
  20094. function forgivingBase64 (data) {
  20095. // 1. Remove all ASCII whitespace from data.
  20096. data = data.replace(/[\u0009\u000A\u000C\u000D\u0020]/g, '') // eslint-disable-line
  20097. // 2. If data’s code point length divides by 4 leaving
  20098. // no remainder, then:
  20099. if (data.length % 4 === 0) {
  20100. // 1. If data ends with one or two U+003D (=) code points,
  20101. // then remove them from data.
  20102. data = data.replace(/=?=$/, '')
  20103. }
  20104. // 3. If data’s code point length divides by 4 leaving
  20105. // a remainder of 1, then return failure.
  20106. if (data.length % 4 === 1) {
  20107. return 'failure'
  20108. }
  20109. // 4. If data contains a code point that is not one of
  20110. // U+002B (+)
  20111. // U+002F (/)
  20112. // ASCII alphanumeric
  20113. // then return failure.
  20114. if (/[^+/0-9A-Za-z]/.test(data)) {
  20115. return 'failure'
  20116. }
  20117. const binary = atob(data)
  20118. const bytes = new Uint8Array(binary.length)
  20119. for (let byte = 0; byte < binary.length; byte++) {
  20120. bytes[byte] = binary.charCodeAt(byte)
  20121. }
  20122. return bytes
  20123. }
  20124. // https://fetch.spec.whatwg.org/#collect-an-http-quoted-string
  20125. // tests: https://fetch.spec.whatwg.org/#example-http-quoted-string
  20126. /**
  20127. * @param {string} input
  20128. * @param {{ position: number }} position
  20129. * @param {boolean?} extractValue
  20130. */
  20131. function collectAnHTTPQuotedString (input, position, extractValue) {
  20132. // 1. Let positionStart be position.
  20133. const positionStart = position.position
  20134. // 2. Let value be the empty string.
  20135. let value = ''
  20136. // 3. Assert: the code point at position within input
  20137. // is U+0022 (").
  20138. assert(input[position.position] === '"')
  20139. // 4. Advance position by 1.
  20140. position.position++
  20141. // 5. While true:
  20142. while (true) {
  20143. // 1. Append the result of collecting a sequence of code points
  20144. // that are not U+0022 (") or U+005C (\) from input, given
  20145. // position, to value.
  20146. value += collectASequenceOfCodePoints(
  20147. (char) => char !== '"' && char !== '\\',
  20148. input,
  20149. position
  20150. )
  20151. // 2. If position is past the end of input, then break.
  20152. if (position.position >= input.length) {
  20153. break
  20154. }
  20155. // 3. Let quoteOrBackslash be the code point at position within
  20156. // input.
  20157. const quoteOrBackslash = input[position.position]
  20158. // 4. Advance position by 1.
  20159. position.position++
  20160. // 5. If quoteOrBackslash is U+005C (\), then:
  20161. if (quoteOrBackslash === '\\') {
  20162. // 1. If position is past the end of input, then append
  20163. // U+005C (\) to value and break.
  20164. if (position.position >= input.length) {
  20165. value += '\\'
  20166. break
  20167. }
  20168. // 2. Append the code point at position within input to value.
  20169. value += input[position.position]
  20170. // 3. Advance position by 1.
  20171. position.position++
  20172. // 6. Otherwise:
  20173. } else {
  20174. // 1. Assert: quoteOrBackslash is U+0022 (").
  20175. assert(quoteOrBackslash === '"')
  20176. // 2. Break.
  20177. break
  20178. }
  20179. }
  20180. // 6. If the extract-value flag is set, then return value.
  20181. if (extractValue) {
  20182. return value
  20183. }
  20184. // 7. Return the code points from positionStart to position,
  20185. // inclusive, within input.
  20186. return input.slice(positionStart, position.position)
  20187. }
  20188. /**
  20189. * @see https://mimesniff.spec.whatwg.org/#serialize-a-mime-type
  20190. */
  20191. function serializeAMimeType (mimeType) {
  20192. assert(mimeType !== 'failure')
  20193. const { parameters, essence } = mimeType
  20194. // 1. Let serialization be the concatenation of mimeType’s
  20195. // type, U+002F (/), and mimeType’s subtype.
  20196. let serialization = essence
  20197. // 2. For each name → value of mimeType’s parameters:
  20198. for (let [name, value] of parameters.entries()) {
  20199. // 1. Append U+003B (;) to serialization.
  20200. serialization += ';'
  20201. // 2. Append name to serialization.
  20202. serialization += name
  20203. // 3. Append U+003D (=) to serialization.
  20204. serialization += '='
  20205. // 4. If value does not solely contain HTTP token code
  20206. // points or value is the empty string, then:
  20207. if (!HTTP_TOKEN_CODEPOINTS.test(value)) {
  20208. // 1. Precede each occurence of U+0022 (") or
  20209. // U+005C (\) in value with U+005C (\).
  20210. value = value.replace(/(\\|")/g, '\\$1')
  20211. // 2. Prepend U+0022 (") to value.
  20212. value = '"' + value
  20213. // 3. Append U+0022 (") to value.
  20214. value += '"'
  20215. }
  20216. // 5. Append value to serialization.
  20217. serialization += value
  20218. }
  20219. // 3. Return serialization.
  20220. return serialization
  20221. }
  20222. /**
  20223. * @see https://fetch.spec.whatwg.org/#http-whitespace
  20224. * @param {string} char
  20225. */
  20226. function isHTTPWhiteSpace (char) {
  20227. return char === '\r' || char === '\n' || char === '\t' || char === ' '
  20228. }
  20229. /**
  20230. * @see https://fetch.spec.whatwg.org/#http-whitespace
  20231. * @param {string} str
  20232. */
  20233. function removeHTTPWhitespace (str, leading = true, trailing = true) {
  20234. let lead = 0
  20235. let trail = str.length - 1
  20236. if (leading) {
  20237. for (; lead < str.length && isHTTPWhiteSpace(str[lead]); lead++);
  20238. }
  20239. if (trailing) {
  20240. for (; trail > 0 && isHTTPWhiteSpace(str[trail]); trail--);
  20241. }
  20242. return str.slice(lead, trail + 1)
  20243. }
  20244. /**
  20245. * @see https://infra.spec.whatwg.org/#ascii-whitespace
  20246. * @param {string} char
  20247. */
  20248. function isASCIIWhitespace (char) {
  20249. return char === '\r' || char === '\n' || char === '\t' || char === '\f' || char === ' '
  20250. }
  20251. /**
  20252. * @see https://infra.spec.whatwg.org/#strip-leading-and-trailing-ascii-whitespace
  20253. */
  20254. function removeASCIIWhitespace (str, leading = true, trailing = true) {
  20255. let lead = 0
  20256. let trail = str.length - 1
  20257. if (leading) {
  20258. for (; lead < str.length && isASCIIWhitespace(str[lead]); lead++);
  20259. }
  20260. if (trailing) {
  20261. for (; trail > 0 && isASCIIWhitespace(str[trail]); trail--);
  20262. }
  20263. return str.slice(lead, trail + 1)
  20264. }
  20265. module.exports = {
  20266. dataURLProcessor,
  20267. URLSerializer,
  20268. collectASequenceOfCodePoints,
  20269. collectASequenceOfCodePointsFast,
  20270. stringPercentDecode,
  20271. parseMIMEType,
  20272. collectAnHTTPQuotedString,
  20273. serializeAMimeType
  20274. }
  20275. /***/ }),
  20276. /***/ 8511:
  20277. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  20278. "use strict";
  20279. const { Blob, File: NativeFile } = __nccwpck_require__(4300)
  20280. const { types } = __nccwpck_require__(3837)
  20281. const { kState } = __nccwpck_require__(5861)
  20282. const { isBlobLike } = __nccwpck_require__(2538)
  20283. const { webidl } = __nccwpck_require__(1744)
  20284. const { parseMIMEType, serializeAMimeType } = __nccwpck_require__(685)
  20285. const { kEnumerableProperty } = __nccwpck_require__(3983)
  20286. const encoder = new TextEncoder()
  20287. class File extends Blob {
  20288. constructor (fileBits, fileName, options = {}) {
  20289. // The File constructor is invoked with two or three parameters, depending
  20290. // on whether the optional dictionary parameter is used. When the File()
  20291. // constructor is invoked, user agents must run the following steps:
  20292. webidl.argumentLengthCheck(arguments, 2, { header: 'File constructor' })
  20293. fileBits = webidl.converters['sequence<BlobPart>'](fileBits)
  20294. fileName = webidl.converters.USVString(fileName)
  20295. options = webidl.converters.FilePropertyBag(options)
  20296. // 1. Let bytes be the result of processing blob parts given fileBits and
  20297. // options.
  20298. // Note: Blob handles this for us
  20299. // 2. Let n be the fileName argument to the constructor.
  20300. const n = fileName
  20301. // 3. Process FilePropertyBag dictionary argument by running the following
  20302. // substeps:
  20303. // 1. If the type member is provided and is not the empty string, let t
  20304. // be set to the type dictionary member. If t contains any characters
  20305. // outside the range U+0020 to U+007E, then set t to the empty string
  20306. // and return from these substeps.
  20307. // 2. Convert every character in t to ASCII lowercase.
  20308. let t = options.type
  20309. let d
  20310. // eslint-disable-next-line no-labels
  20311. substep: {
  20312. if (t) {
  20313. t = parseMIMEType(t)
  20314. if (t === 'failure') {
  20315. t = ''
  20316. // eslint-disable-next-line no-labels
  20317. break substep
  20318. }
  20319. t = serializeAMimeType(t).toLowerCase()
  20320. }
  20321. // 3. If the lastModified member is provided, let d be set to the
  20322. // lastModified dictionary member. If it is not provided, set d to the
  20323. // current date and time represented as the number of milliseconds since
  20324. // the Unix Epoch (which is the equivalent of Date.now() [ECMA-262]).
  20325. d = options.lastModified
  20326. }
  20327. // 4. Return a new File object F such that:
  20328. // F refers to the bytes byte sequence.
  20329. // F.size is set to the number of total bytes in bytes.
  20330. // F.name is set to n.
  20331. // F.type is set to t.
  20332. // F.lastModified is set to d.
  20333. super(processBlobParts(fileBits, options), { type: t })
  20334. this[kState] = {
  20335. name: n,
  20336. lastModified: d,
  20337. type: t
  20338. }
  20339. }
  20340. get name () {
  20341. webidl.brandCheck(this, File)
  20342. return this[kState].name
  20343. }
  20344. get lastModified () {
  20345. webidl.brandCheck(this, File)
  20346. return this[kState].lastModified
  20347. }
  20348. get type () {
  20349. webidl.brandCheck(this, File)
  20350. return this[kState].type
  20351. }
  20352. }
  20353. class FileLike {
  20354. constructor (blobLike, fileName, options = {}) {
  20355. // TODO: argument idl type check
  20356. // The File constructor is invoked with two or three parameters, depending
  20357. // on whether the optional dictionary parameter is used. When the File()
  20358. // constructor is invoked, user agents must run the following steps:
  20359. // 1. Let bytes be the result of processing blob parts given fileBits and
  20360. // options.
  20361. // 2. Let n be the fileName argument to the constructor.
  20362. const n = fileName
  20363. // 3. Process FilePropertyBag dictionary argument by running the following
  20364. // substeps:
  20365. // 1. If the type member is provided and is not the empty string, let t
  20366. // be set to the type dictionary member. If t contains any characters
  20367. // outside the range U+0020 to U+007E, then set t to the empty string
  20368. // and return from these substeps.
  20369. // TODO
  20370. const t = options.type
  20371. // 2. Convert every character in t to ASCII lowercase.
  20372. // TODO
  20373. // 3. If the lastModified member is provided, let d be set to the
  20374. // lastModified dictionary member. If it is not provided, set d to the
  20375. // current date and time represented as the number of milliseconds since
  20376. // the Unix Epoch (which is the equivalent of Date.now() [ECMA-262]).
  20377. const d = options.lastModified ?? Date.now()
  20378. // 4. Return a new File object F such that:
  20379. // F refers to the bytes byte sequence.
  20380. // F.size is set to the number of total bytes in bytes.
  20381. // F.name is set to n.
  20382. // F.type is set to t.
  20383. // F.lastModified is set to d.
  20384. this[kState] = {
  20385. blobLike,
  20386. name: n,
  20387. type: t,
  20388. lastModified: d
  20389. }
  20390. }
  20391. stream (...args) {
  20392. webidl.brandCheck(this, FileLike)
  20393. return this[kState].blobLike.stream(...args)
  20394. }
  20395. arrayBuffer (...args) {
  20396. webidl.brandCheck(this, FileLike)
  20397. return this[kState].blobLike.arrayBuffer(...args)
  20398. }
  20399. slice (...args) {
  20400. webidl.brandCheck(this, FileLike)
  20401. return this[kState].blobLike.slice(...args)
  20402. }
  20403. text (...args) {
  20404. webidl.brandCheck(this, FileLike)
  20405. return this[kState].blobLike.text(...args)
  20406. }
  20407. get size () {
  20408. webidl.brandCheck(this, FileLike)
  20409. return this[kState].blobLike.size
  20410. }
  20411. get type () {
  20412. webidl.brandCheck(this, FileLike)
  20413. return this[kState].blobLike.type
  20414. }
  20415. get name () {
  20416. webidl.brandCheck(this, FileLike)
  20417. return this[kState].name
  20418. }
  20419. get lastModified () {
  20420. webidl.brandCheck(this, FileLike)
  20421. return this[kState].lastModified
  20422. }
  20423. get [Symbol.toStringTag] () {
  20424. return 'File'
  20425. }
  20426. }
  20427. Object.defineProperties(File.prototype, {
  20428. [Symbol.toStringTag]: {
  20429. value: 'File',
  20430. configurable: true
  20431. },
  20432. name: kEnumerableProperty,
  20433. lastModified: kEnumerableProperty
  20434. })
  20435. webidl.converters.Blob = webidl.interfaceConverter(Blob)
  20436. webidl.converters.BlobPart = function (V, opts) {
  20437. if (webidl.util.Type(V) === 'Object') {
  20438. if (isBlobLike(V)) {
  20439. return webidl.converters.Blob(V, { strict: false })
  20440. }
  20441. if (
  20442. ArrayBuffer.isView(V) ||
  20443. types.isAnyArrayBuffer(V)
  20444. ) {
  20445. return webidl.converters.BufferSource(V, opts)
  20446. }
  20447. }
  20448. return webidl.converters.USVString(V, opts)
  20449. }
  20450. webidl.converters['sequence<BlobPart>'] = webidl.sequenceConverter(
  20451. webidl.converters.BlobPart
  20452. )
  20453. // https://www.w3.org/TR/FileAPI/#dfn-FilePropertyBag
  20454. webidl.converters.FilePropertyBag = webidl.dictionaryConverter([
  20455. {
  20456. key: 'lastModified',
  20457. converter: webidl.converters['long long'],
  20458. get defaultValue () {
  20459. return Date.now()
  20460. }
  20461. },
  20462. {
  20463. key: 'type',
  20464. converter: webidl.converters.DOMString,
  20465. defaultValue: ''
  20466. },
  20467. {
  20468. key: 'endings',
  20469. converter: (value) => {
  20470. value = webidl.converters.DOMString(value)
  20471. value = value.toLowerCase()
  20472. if (value !== 'native') {
  20473. value = 'transparent'
  20474. }
  20475. return value
  20476. },
  20477. defaultValue: 'transparent'
  20478. }
  20479. ])
  20480. /**
  20481. * @see https://www.w3.org/TR/FileAPI/#process-blob-parts
  20482. * @param {(NodeJS.TypedArray|Blob|string)[]} parts
  20483. * @param {{ type: string, endings: string }} options
  20484. */
  20485. function processBlobParts (parts, options) {
  20486. // 1. Let bytes be an empty sequence of bytes.
  20487. /** @type {NodeJS.TypedArray[]} */
  20488. const bytes = []
  20489. // 2. For each element in parts:
  20490. for (const element of parts) {
  20491. // 1. If element is a USVString, run the following substeps:
  20492. if (typeof element === 'string') {
  20493. // 1. Let s be element.
  20494. let s = element
  20495. // 2. If the endings member of options is "native", set s
  20496. // to the result of converting line endings to native
  20497. // of element.
  20498. if (options.endings === 'native') {
  20499. s = convertLineEndingsNative(s)
  20500. }
  20501. // 3. Append the result of UTF-8 encoding s to bytes.
  20502. bytes.push(encoder.encode(s))
  20503. } else if (
  20504. types.isAnyArrayBuffer(element) ||
  20505. types.isTypedArray(element)
  20506. ) {
  20507. // 2. If element is a BufferSource, get a copy of the
  20508. // bytes held by the buffer source, and append those
  20509. // bytes to bytes.
  20510. if (!element.buffer) { // ArrayBuffer
  20511. bytes.push(new Uint8Array(element))
  20512. } else {
  20513. bytes.push(
  20514. new Uint8Array(element.buffer, element.byteOffset, element.byteLength)
  20515. )
  20516. }
  20517. } else if (isBlobLike(element)) {
  20518. // 3. If element is a Blob, append the bytes it represents
  20519. // to bytes.
  20520. bytes.push(element)
  20521. }
  20522. }
  20523. // 3. Return bytes.
  20524. return bytes
  20525. }
  20526. /**
  20527. * @see https://www.w3.org/TR/FileAPI/#convert-line-endings-to-native
  20528. * @param {string} s
  20529. */
  20530. function convertLineEndingsNative (s) {
  20531. // 1. Let native line ending be be the code point U+000A LF.
  20532. let nativeLineEnding = '\n'
  20533. // 2. If the underlying platform’s conventions are to
  20534. // represent newlines as a carriage return and line feed
  20535. // sequence, set native line ending to the code point
  20536. // U+000D CR followed by the code point U+000A LF.
  20537. if (process.platform === 'win32') {
  20538. nativeLineEnding = '\r\n'
  20539. }
  20540. return s.replace(/\r?\n/g, nativeLineEnding)
  20541. }
  20542. // If this function is moved to ./util.js, some tools (such as
  20543. // rollup) will warn about circular dependencies. See:
  20544. // https://github.com/nodejs/undici/issues/1629
  20545. function isFileLike (object) {
  20546. return (
  20547. (NativeFile && object instanceof NativeFile) ||
  20548. object instanceof File || (
  20549. object &&
  20550. (typeof object.stream === 'function' ||
  20551. typeof object.arrayBuffer === 'function') &&
  20552. object[Symbol.toStringTag] === 'File'
  20553. )
  20554. )
  20555. }
  20556. module.exports = { File, FileLike, isFileLike }
  20557. /***/ }),
  20558. /***/ 2015:
  20559. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  20560. "use strict";
  20561. const { isBlobLike, toUSVString, makeIterator } = __nccwpck_require__(2538)
  20562. const { kState } = __nccwpck_require__(5861)
  20563. const { File: UndiciFile, FileLike, isFileLike } = __nccwpck_require__(8511)
  20564. const { webidl } = __nccwpck_require__(1744)
  20565. const { Blob, File: NativeFile } = __nccwpck_require__(4300)
  20566. /** @type {globalThis['File']} */
  20567. const File = NativeFile ?? UndiciFile
  20568. // https://xhr.spec.whatwg.org/#formdata
  20569. class FormData {
  20570. constructor (form) {
  20571. if (form !== undefined) {
  20572. throw webidl.errors.conversionFailed({
  20573. prefix: 'FormData constructor',
  20574. argument: 'Argument 1',
  20575. types: ['undefined']
  20576. })
  20577. }
  20578. this[kState] = []
  20579. }
  20580. append (name, value, filename = undefined) {
  20581. webidl.brandCheck(this, FormData)
  20582. webidl.argumentLengthCheck(arguments, 2, { header: 'FormData.append' })
  20583. if (arguments.length === 3 && !isBlobLike(value)) {
  20584. throw new TypeError(
  20585. "Failed to execute 'append' on 'FormData': parameter 2 is not of type 'Blob'"
  20586. )
  20587. }
  20588. // 1. Let value be value if given; otherwise blobValue.
  20589. name = webidl.converters.USVString(name)
  20590. value = isBlobLike(value)
  20591. ? webidl.converters.Blob(value, { strict: false })
  20592. : webidl.converters.USVString(value)
  20593. filename = arguments.length === 3
  20594. ? webidl.converters.USVString(filename)
  20595. : undefined
  20596. // 2. Let entry be the result of creating an entry with
  20597. // name, value, and filename if given.
  20598. const entry = makeEntry(name, value, filename)
  20599. // 3. Append entry to this’s entry list.
  20600. this[kState].push(entry)
  20601. }
  20602. delete (name) {
  20603. webidl.brandCheck(this, FormData)
  20604. webidl.argumentLengthCheck(arguments, 1, { header: 'FormData.delete' })
  20605. name = webidl.converters.USVString(name)
  20606. // The delete(name) method steps are to remove all entries whose name
  20607. // is name from this’s entry list.
  20608. this[kState] = this[kState].filter(entry => entry.name !== name)
  20609. }
  20610. get (name) {
  20611. webidl.brandCheck(this, FormData)
  20612. webidl.argumentLengthCheck(arguments, 1, { header: 'FormData.get' })
  20613. name = webidl.converters.USVString(name)
  20614. // 1. If there is no entry whose name is name in this’s entry list,
  20615. // then return null.
  20616. const idx = this[kState].findIndex((entry) => entry.name === name)
  20617. if (idx === -1) {
  20618. return null
  20619. }
  20620. // 2. Return the value of the first entry whose name is name from
  20621. // this’s entry list.
  20622. return this[kState][idx].value
  20623. }
  20624. getAll (name) {
  20625. webidl.brandCheck(this, FormData)
  20626. webidl.argumentLengthCheck(arguments, 1, { header: 'FormData.getAll' })
  20627. name = webidl.converters.USVString(name)
  20628. // 1. If there is no entry whose name is name in this’s entry list,
  20629. // then return the empty list.
  20630. // 2. Return the values of all entries whose name is name, in order,
  20631. // from this’s entry list.
  20632. return this[kState]
  20633. .filter((entry) => entry.name === name)
  20634. .map((entry) => entry.value)
  20635. }
  20636. has (name) {
  20637. webidl.brandCheck(this, FormData)
  20638. webidl.argumentLengthCheck(arguments, 1, { header: 'FormData.has' })
  20639. name = webidl.converters.USVString(name)
  20640. // The has(name) method steps are to return true if there is an entry
  20641. // whose name is name in this’s entry list; otherwise false.
  20642. return this[kState].findIndex((entry) => entry.name === name) !== -1
  20643. }
  20644. set (name, value, filename = undefined) {
  20645. webidl.brandCheck(this, FormData)
  20646. webidl.argumentLengthCheck(arguments, 2, { header: 'FormData.set' })
  20647. if (arguments.length === 3 && !isBlobLike(value)) {
  20648. throw new TypeError(
  20649. "Failed to execute 'set' on 'FormData': parameter 2 is not of type 'Blob'"
  20650. )
  20651. }
  20652. // The set(name, value) and set(name, blobValue, filename) method steps
  20653. // are:
  20654. // 1. Let value be value if given; otherwise blobValue.
  20655. name = webidl.converters.USVString(name)
  20656. value = isBlobLike(value)
  20657. ? webidl.converters.Blob(value, { strict: false })
  20658. : webidl.converters.USVString(value)
  20659. filename = arguments.length === 3
  20660. ? toUSVString(filename)
  20661. : undefined
  20662. // 2. Let entry be the result of creating an entry with name, value, and
  20663. // filename if given.
  20664. const entry = makeEntry(name, value, filename)
  20665. // 3. If there are entries in this’s entry list whose name is name, then
  20666. // replace the first such entry with entry and remove the others.
  20667. const idx = this[kState].findIndex((entry) => entry.name === name)
  20668. if (idx !== -1) {
  20669. this[kState] = [
  20670. ...this[kState].slice(0, idx),
  20671. entry,
  20672. ...this[kState].slice(idx + 1).filter((entry) => entry.name !== name)
  20673. ]
  20674. } else {
  20675. // 4. Otherwise, append entry to this’s entry list.
  20676. this[kState].push(entry)
  20677. }
  20678. }
  20679. entries () {
  20680. webidl.brandCheck(this, FormData)
  20681. return makeIterator(
  20682. () => this[kState].map(pair => [pair.name, pair.value]),
  20683. 'FormData',
  20684. 'key+value'
  20685. )
  20686. }
  20687. keys () {
  20688. webidl.brandCheck(this, FormData)
  20689. return makeIterator(
  20690. () => this[kState].map(pair => [pair.name, pair.value]),
  20691. 'FormData',
  20692. 'key'
  20693. )
  20694. }
  20695. values () {
  20696. webidl.brandCheck(this, FormData)
  20697. return makeIterator(
  20698. () => this[kState].map(pair => [pair.name, pair.value]),
  20699. 'FormData',
  20700. 'value'
  20701. )
  20702. }
  20703. /**
  20704. * @param {(value: string, key: string, self: FormData) => void} callbackFn
  20705. * @param {unknown} thisArg
  20706. */
  20707. forEach (callbackFn, thisArg = globalThis) {
  20708. webidl.brandCheck(this, FormData)
  20709. webidl.argumentLengthCheck(arguments, 1, { header: 'FormData.forEach' })
  20710. if (typeof callbackFn !== 'function') {
  20711. throw new TypeError(
  20712. "Failed to execute 'forEach' on 'FormData': parameter 1 is not of type 'Function'."
  20713. )
  20714. }
  20715. for (const [key, value] of this) {
  20716. callbackFn.apply(thisArg, [value, key, this])
  20717. }
  20718. }
  20719. }
  20720. FormData.prototype[Symbol.iterator] = FormData.prototype.entries
  20721. Object.defineProperties(FormData.prototype, {
  20722. [Symbol.toStringTag]: {
  20723. value: 'FormData',
  20724. configurable: true
  20725. }
  20726. })
  20727. /**
  20728. * @see https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#create-an-entry
  20729. * @param {string} name
  20730. * @param {string|Blob} value
  20731. * @param {?string} filename
  20732. * @returns
  20733. */
  20734. function makeEntry (name, value, filename) {
  20735. // 1. Set name to the result of converting name into a scalar value string.
  20736. // "To convert a string into a scalar value string, replace any surrogates
  20737. // with U+FFFD."
  20738. // see: https://nodejs.org/dist/latest-v18.x/docs/api/buffer.html#buftostringencoding-start-end
  20739. name = Buffer.from(name).toString('utf8')
  20740. // 2. If value is a string, then set value to the result of converting
  20741. // value into a scalar value string.
  20742. if (typeof value === 'string') {
  20743. value = Buffer.from(value).toString('utf8')
  20744. } else {
  20745. // 3. Otherwise:
  20746. // 1. If value is not a File object, then set value to a new File object,
  20747. // representing the same bytes, whose name attribute value is "blob"
  20748. if (!isFileLike(value)) {
  20749. value = value instanceof Blob
  20750. ? new File([value], 'blob', { type: value.type })
  20751. : new FileLike(value, 'blob', { type: value.type })
  20752. }
  20753. // 2. If filename is given, then set value to a new File object,
  20754. // representing the same bytes, whose name attribute is filename.
  20755. if (filename !== undefined) {
  20756. /** @type {FilePropertyBag} */
  20757. const options = {
  20758. type: value.type,
  20759. lastModified: value.lastModified
  20760. }
  20761. value = (NativeFile && value instanceof NativeFile) || value instanceof UndiciFile
  20762. ? new File([value], filename, options)
  20763. : new FileLike(value, filename, options)
  20764. }
  20765. }
  20766. // 4. Return an entry whose name is name and whose value is value.
  20767. return { name, value }
  20768. }
  20769. module.exports = { FormData }
  20770. /***/ }),
  20771. /***/ 1246:
  20772. /***/ ((module) => {
  20773. "use strict";
  20774. // In case of breaking changes, increase the version
  20775. // number to avoid conflicts.
  20776. const globalOrigin = Symbol.for('undici.globalOrigin.1')
  20777. function getGlobalOrigin () {
  20778. return globalThis[globalOrigin]
  20779. }
  20780. function setGlobalOrigin (newOrigin) {
  20781. if (newOrigin === undefined) {
  20782. Object.defineProperty(globalThis, globalOrigin, {
  20783. value: undefined,
  20784. writable: true,
  20785. enumerable: false,
  20786. configurable: false
  20787. })
  20788. return
  20789. }
  20790. const parsedURL = new URL(newOrigin)
  20791. if (parsedURL.protocol !== 'http:' && parsedURL.protocol !== 'https:') {
  20792. throw new TypeError(`Only http & https urls are allowed, received ${parsedURL.protocol}`)
  20793. }
  20794. Object.defineProperty(globalThis, globalOrigin, {
  20795. value: parsedURL,
  20796. writable: true,
  20797. enumerable: false,
  20798. configurable: false
  20799. })
  20800. }
  20801. module.exports = {
  20802. getGlobalOrigin,
  20803. setGlobalOrigin
  20804. }
  20805. /***/ }),
  20806. /***/ 554:
  20807. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  20808. "use strict";
  20809. // https://github.com/Ethan-Arrowood/undici-fetch
  20810. const { kHeadersList, kConstruct } = __nccwpck_require__(2785)
  20811. const { kGuard } = __nccwpck_require__(5861)
  20812. const { kEnumerableProperty } = __nccwpck_require__(3983)
  20813. const {
  20814. makeIterator,
  20815. isValidHeaderName,
  20816. isValidHeaderValue
  20817. } = __nccwpck_require__(2538)
  20818. const { webidl } = __nccwpck_require__(1744)
  20819. const assert = __nccwpck_require__(9491)
  20820. const kHeadersMap = Symbol('headers map')
  20821. const kHeadersSortedMap = Symbol('headers map sorted')
  20822. /**
  20823. * @param {number} code
  20824. */
  20825. function isHTTPWhiteSpaceCharCode (code) {
  20826. return code === 0x00a || code === 0x00d || code === 0x009 || code === 0x020
  20827. }
  20828. /**
  20829. * @see https://fetch.spec.whatwg.org/#concept-header-value-normalize
  20830. * @param {string} potentialValue
  20831. */
  20832. function headerValueNormalize (potentialValue) {
  20833. // To normalize a byte sequence potentialValue, remove
  20834. // any leading and trailing HTTP whitespace bytes from
  20835. // potentialValue.
  20836. let i = 0; let j = potentialValue.length
  20837. while (j > i && isHTTPWhiteSpaceCharCode(potentialValue.charCodeAt(j - 1))) --j
  20838. while (j > i && isHTTPWhiteSpaceCharCode(potentialValue.charCodeAt(i))) ++i
  20839. return i === 0 && j === potentialValue.length ? potentialValue : potentialValue.substring(i, j)
  20840. }
  20841. function fill (headers, object) {
  20842. // To fill a Headers object headers with a given object object, run these steps:
  20843. // 1. If object is a sequence, then for each header in object:
  20844. // Note: webidl conversion to array has already been done.
  20845. if (Array.isArray(object)) {
  20846. for (let i = 0; i < object.length; ++i) {
  20847. const header = object[i]
  20848. // 1. If header does not contain exactly two items, then throw a TypeError.
  20849. if (header.length !== 2) {
  20850. throw webidl.errors.exception({
  20851. header: 'Headers constructor',
  20852. message: `expected name/value pair to be length 2, found ${header.length}.`
  20853. })
  20854. }
  20855. // 2. Append (header’s first item, header’s second item) to headers.
  20856. appendHeader(headers, header[0], header[1])
  20857. }
  20858. } else if (typeof object === 'object' && object !== null) {
  20859. // Note: null should throw
  20860. // 2. Otherwise, object is a record, then for each key → value in object,
  20861. // append (key, value) to headers
  20862. const keys = Object.keys(object)
  20863. for (let i = 0; i < keys.length; ++i) {
  20864. appendHeader(headers, keys[i], object[keys[i]])
  20865. }
  20866. } else {
  20867. throw webidl.errors.conversionFailed({
  20868. prefix: 'Headers constructor',
  20869. argument: 'Argument 1',
  20870. types: ['sequence<sequence<ByteString>>', 'record<ByteString, ByteString>']
  20871. })
  20872. }
  20873. }
  20874. /**
  20875. * @see https://fetch.spec.whatwg.org/#concept-headers-append
  20876. */
  20877. function appendHeader (headers, name, value) {
  20878. // 1. Normalize value.
  20879. value = headerValueNormalize(value)
  20880. // 2. If name is not a header name or value is not a
  20881. // header value, then throw a TypeError.
  20882. if (!isValidHeaderName(name)) {
  20883. throw webidl.errors.invalidArgument({
  20884. prefix: 'Headers.append',
  20885. value: name,
  20886. type: 'header name'
  20887. })
  20888. } else if (!isValidHeaderValue(value)) {
  20889. throw webidl.errors.invalidArgument({
  20890. prefix: 'Headers.append',
  20891. value,
  20892. type: 'header value'
  20893. })
  20894. }
  20895. // 3. If headers’s guard is "immutable", then throw a TypeError.
  20896. // 4. Otherwise, if headers’s guard is "request" and name is a
  20897. // forbidden header name, return.
  20898. // Note: undici does not implement forbidden header names
  20899. if (headers[kGuard] === 'immutable') {
  20900. throw new TypeError('immutable')
  20901. } else if (headers[kGuard] === 'request-no-cors') {
  20902. // 5. Otherwise, if headers’s guard is "request-no-cors":
  20903. // TODO
  20904. }
  20905. // 6. Otherwise, if headers’s guard is "response" and name is a
  20906. // forbidden response-header name, return.
  20907. // 7. Append (name, value) to headers’s header list.
  20908. return headers[kHeadersList].append(name, value)
  20909. // 8. If headers’s guard is "request-no-cors", then remove
  20910. // privileged no-CORS request headers from headers
  20911. }
  20912. class HeadersList {
  20913. /** @type {[string, string][]|null} */
  20914. cookies = null
  20915. constructor (init) {
  20916. if (init instanceof HeadersList) {
  20917. this[kHeadersMap] = new Map(init[kHeadersMap])
  20918. this[kHeadersSortedMap] = init[kHeadersSortedMap]
  20919. this.cookies = init.cookies === null ? null : [...init.cookies]
  20920. } else {
  20921. this[kHeadersMap] = new Map(init)
  20922. this[kHeadersSortedMap] = null
  20923. }
  20924. }
  20925. // https://fetch.spec.whatwg.org/#header-list-contains
  20926. contains (name) {
  20927. // A header list list contains a header name name if list
  20928. // contains a header whose name is a byte-case-insensitive
  20929. // match for name.
  20930. name = name.toLowerCase()
  20931. return this[kHeadersMap].has(name)
  20932. }
  20933. clear () {
  20934. this[kHeadersMap].clear()
  20935. this[kHeadersSortedMap] = null
  20936. this.cookies = null
  20937. }
  20938. // https://fetch.spec.whatwg.org/#concept-header-list-append
  20939. append (name, value) {
  20940. this[kHeadersSortedMap] = null
  20941. // 1. If list contains name, then set name to the first such
  20942. // header’s name.
  20943. const lowercaseName = name.toLowerCase()
  20944. const exists = this[kHeadersMap].get(lowercaseName)
  20945. // 2. Append (name, value) to list.
  20946. if (exists) {
  20947. const delimiter = lowercaseName === 'cookie' ? '; ' : ', '
  20948. this[kHeadersMap].set(lowercaseName, {
  20949. name: exists.name,
  20950. value: `${exists.value}${delimiter}${value}`
  20951. })
  20952. } else {
  20953. this[kHeadersMap].set(lowercaseName, { name, value })
  20954. }
  20955. if (lowercaseName === 'set-cookie') {
  20956. this.cookies ??= []
  20957. this.cookies.push(value)
  20958. }
  20959. }
  20960. // https://fetch.spec.whatwg.org/#concept-header-list-set
  20961. set (name, value) {
  20962. this[kHeadersSortedMap] = null
  20963. const lowercaseName = name.toLowerCase()
  20964. if (lowercaseName === 'set-cookie') {
  20965. this.cookies = [value]
  20966. }
  20967. // 1. If list contains name, then set the value of
  20968. // the first such header to value and remove the
  20969. // others.
  20970. // 2. Otherwise, append header (name, value) to list.
  20971. this[kHeadersMap].set(lowercaseName, { name, value })
  20972. }
  20973. // https://fetch.spec.whatwg.org/#concept-header-list-delete
  20974. delete (name) {
  20975. this[kHeadersSortedMap] = null
  20976. name = name.toLowerCase()
  20977. if (name === 'set-cookie') {
  20978. this.cookies = null
  20979. }
  20980. this[kHeadersMap].delete(name)
  20981. }
  20982. // https://fetch.spec.whatwg.org/#concept-header-list-get
  20983. get (name) {
  20984. const value = this[kHeadersMap].get(name.toLowerCase())
  20985. // 1. If list does not contain name, then return null.
  20986. // 2. Return the values of all headers in list whose name
  20987. // is a byte-case-insensitive match for name,
  20988. // separated from each other by 0x2C 0x20, in order.
  20989. return value === undefined ? null : value.value
  20990. }
  20991. * [Symbol.iterator] () {
  20992. // use the lowercased name
  20993. for (const [name, { value }] of this[kHeadersMap]) {
  20994. yield [name, value]
  20995. }
  20996. }
  20997. get entries () {
  20998. const headers = {}
  20999. if (this[kHeadersMap].size) {
  21000. for (const { name, value } of this[kHeadersMap].values()) {
  21001. headers[name] = value
  21002. }
  21003. }
  21004. return headers
  21005. }
  21006. }
  21007. // https://fetch.spec.whatwg.org/#headers-class
  21008. class Headers {
  21009. constructor (init = undefined) {
  21010. if (init === kConstruct) {
  21011. return
  21012. }
  21013. this[kHeadersList] = new HeadersList()
  21014. // The new Headers(init) constructor steps are:
  21015. // 1. Set this’s guard to "none".
  21016. this[kGuard] = 'none'
  21017. // 2. If init is given, then fill this with init.
  21018. if (init !== undefined) {
  21019. init = webidl.converters.HeadersInit(init)
  21020. fill(this, init)
  21021. }
  21022. }
  21023. // https://fetch.spec.whatwg.org/#dom-headers-append
  21024. append (name, value) {
  21025. webidl.brandCheck(this, Headers)
  21026. webidl.argumentLengthCheck(arguments, 2, { header: 'Headers.append' })
  21027. name = webidl.converters.ByteString(name)
  21028. value = webidl.converters.ByteString(value)
  21029. return appendHeader(this, name, value)
  21030. }
  21031. // https://fetch.spec.whatwg.org/#dom-headers-delete
  21032. delete (name) {
  21033. webidl.brandCheck(this, Headers)
  21034. webidl.argumentLengthCheck(arguments, 1, { header: 'Headers.delete' })
  21035. name = webidl.converters.ByteString(name)
  21036. // 1. If name is not a header name, then throw a TypeError.
  21037. if (!isValidHeaderName(name)) {
  21038. throw webidl.errors.invalidArgument({
  21039. prefix: 'Headers.delete',
  21040. value: name,
  21041. type: 'header name'
  21042. })
  21043. }
  21044. // 2. If this’s guard is "immutable", then throw a TypeError.
  21045. // 3. Otherwise, if this’s guard is "request" and name is a
  21046. // forbidden header name, return.
  21047. // 4. Otherwise, if this’s guard is "request-no-cors", name
  21048. // is not a no-CORS-safelisted request-header name, and
  21049. // name is not a privileged no-CORS request-header name,
  21050. // return.
  21051. // 5. Otherwise, if this’s guard is "response" and name is
  21052. // a forbidden response-header name, return.
  21053. // Note: undici does not implement forbidden header names
  21054. if (this[kGuard] === 'immutable') {
  21055. throw new TypeError('immutable')
  21056. } else if (this[kGuard] === 'request-no-cors') {
  21057. // TODO
  21058. }
  21059. // 6. If this’s header list does not contain name, then
  21060. // return.
  21061. if (!this[kHeadersList].contains(name)) {
  21062. return
  21063. }
  21064. // 7. Delete name from this’s header list.
  21065. // 8. If this’s guard is "request-no-cors", then remove
  21066. // privileged no-CORS request headers from this.
  21067. this[kHeadersList].delete(name)
  21068. }
  21069. // https://fetch.spec.whatwg.org/#dom-headers-get
  21070. get (name) {
  21071. webidl.brandCheck(this, Headers)
  21072. webidl.argumentLengthCheck(arguments, 1, { header: 'Headers.get' })
  21073. name = webidl.converters.ByteString(name)
  21074. // 1. If name is not a header name, then throw a TypeError.
  21075. if (!isValidHeaderName(name)) {
  21076. throw webidl.errors.invalidArgument({
  21077. prefix: 'Headers.get',
  21078. value: name,
  21079. type: 'header name'
  21080. })
  21081. }
  21082. // 2. Return the result of getting name from this’s header
  21083. // list.
  21084. return this[kHeadersList].get(name)
  21085. }
  21086. // https://fetch.spec.whatwg.org/#dom-headers-has
  21087. has (name) {
  21088. webidl.brandCheck(this, Headers)
  21089. webidl.argumentLengthCheck(arguments, 1, { header: 'Headers.has' })
  21090. name = webidl.converters.ByteString(name)
  21091. // 1. If name is not a header name, then throw a TypeError.
  21092. if (!isValidHeaderName(name)) {
  21093. throw webidl.errors.invalidArgument({
  21094. prefix: 'Headers.has',
  21095. value: name,
  21096. type: 'header name'
  21097. })
  21098. }
  21099. // 2. Return true if this’s header list contains name;
  21100. // otherwise false.
  21101. return this[kHeadersList].contains(name)
  21102. }
  21103. // https://fetch.spec.whatwg.org/#dom-headers-set
  21104. set (name, value) {
  21105. webidl.brandCheck(this, Headers)
  21106. webidl.argumentLengthCheck(arguments, 2, { header: 'Headers.set' })
  21107. name = webidl.converters.ByteString(name)
  21108. value = webidl.converters.ByteString(value)
  21109. // 1. Normalize value.
  21110. value = headerValueNormalize(value)
  21111. // 2. If name is not a header name or value is not a
  21112. // header value, then throw a TypeError.
  21113. if (!isValidHeaderName(name)) {
  21114. throw webidl.errors.invalidArgument({
  21115. prefix: 'Headers.set',
  21116. value: name,
  21117. type: 'header name'
  21118. })
  21119. } else if (!isValidHeaderValue(value)) {
  21120. throw webidl.errors.invalidArgument({
  21121. prefix: 'Headers.set',
  21122. value,
  21123. type: 'header value'
  21124. })
  21125. }
  21126. // 3. If this’s guard is "immutable", then throw a TypeError.
  21127. // 4. Otherwise, if this’s guard is "request" and name is a
  21128. // forbidden header name, return.
  21129. // 5. Otherwise, if this’s guard is "request-no-cors" and
  21130. // name/value is not a no-CORS-safelisted request-header,
  21131. // return.
  21132. // 6. Otherwise, if this’s guard is "response" and name is a
  21133. // forbidden response-header name, return.
  21134. // Note: undici does not implement forbidden header names
  21135. if (this[kGuard] === 'immutable') {
  21136. throw new TypeError('immutable')
  21137. } else if (this[kGuard] === 'request-no-cors') {
  21138. // TODO
  21139. }
  21140. // 7. Set (name, value) in this’s header list.
  21141. // 8. If this’s guard is "request-no-cors", then remove
  21142. // privileged no-CORS request headers from this
  21143. this[kHeadersList].set(name, value)
  21144. }
  21145. // https://fetch.spec.whatwg.org/#dom-headers-getsetcookie
  21146. getSetCookie () {
  21147. webidl.brandCheck(this, Headers)
  21148. // 1. If this’s header list does not contain `Set-Cookie`, then return « ».
  21149. // 2. Return the values of all headers in this’s header list whose name is
  21150. // a byte-case-insensitive match for `Set-Cookie`, in order.
  21151. const list = this[kHeadersList].cookies
  21152. if (list) {
  21153. return [...list]
  21154. }
  21155. return []
  21156. }
  21157. // https://fetch.spec.whatwg.org/#concept-header-list-sort-and-combine
  21158. get [kHeadersSortedMap] () {
  21159. if (this[kHeadersList][kHeadersSortedMap]) {
  21160. return this[kHeadersList][kHeadersSortedMap]
  21161. }
  21162. // 1. Let headers be an empty list of headers with the key being the name
  21163. // and value the value.
  21164. const headers = []
  21165. // 2. Let names be the result of convert header names to a sorted-lowercase
  21166. // set with all the names of the headers in list.
  21167. const names = [...this[kHeadersList]].sort((a, b) => a[0] < b[0] ? -1 : 1)
  21168. const cookies = this[kHeadersList].cookies
  21169. // 3. For each name of names:
  21170. for (let i = 0; i < names.length; ++i) {
  21171. const [name, value] = names[i]
  21172. // 1. If name is `set-cookie`, then:
  21173. if (name === 'set-cookie') {
  21174. // 1. Let values be a list of all values of headers in list whose name
  21175. // is a byte-case-insensitive match for name, in order.
  21176. // 2. For each value of values:
  21177. // 1. Append (name, value) to headers.
  21178. for (let j = 0; j < cookies.length; ++j) {
  21179. headers.push([name, cookies[j]])
  21180. }
  21181. } else {
  21182. // 2. Otherwise:
  21183. // 1. Let value be the result of getting name from list.
  21184. // 2. Assert: value is non-null.
  21185. assert(value !== null)
  21186. // 3. Append (name, value) to headers.
  21187. headers.push([name, value])
  21188. }
  21189. }
  21190. this[kHeadersList][kHeadersSortedMap] = headers
  21191. // 4. Return headers.
  21192. return headers
  21193. }
  21194. keys () {
  21195. webidl.brandCheck(this, Headers)
  21196. if (this[kGuard] === 'immutable') {
  21197. const value = this[kHeadersSortedMap]
  21198. return makeIterator(() => value, 'Headers',
  21199. 'key')
  21200. }
  21201. return makeIterator(
  21202. () => [...this[kHeadersSortedMap].values()],
  21203. 'Headers',
  21204. 'key'
  21205. )
  21206. }
  21207. values () {
  21208. webidl.brandCheck(this, Headers)
  21209. if (this[kGuard] === 'immutable') {
  21210. const value = this[kHeadersSortedMap]
  21211. return makeIterator(() => value, 'Headers',
  21212. 'value')
  21213. }
  21214. return makeIterator(
  21215. () => [...this[kHeadersSortedMap].values()],
  21216. 'Headers',
  21217. 'value'
  21218. )
  21219. }
  21220. entries () {
  21221. webidl.brandCheck(this, Headers)
  21222. if (this[kGuard] === 'immutable') {
  21223. const value = this[kHeadersSortedMap]
  21224. return makeIterator(() => value, 'Headers',
  21225. 'key+value')
  21226. }
  21227. return makeIterator(
  21228. () => [...this[kHeadersSortedMap].values()],
  21229. 'Headers',
  21230. 'key+value'
  21231. )
  21232. }
  21233. /**
  21234. * @param {(value: string, key: string, self: Headers) => void} callbackFn
  21235. * @param {unknown} thisArg
  21236. */
  21237. forEach (callbackFn, thisArg = globalThis) {
  21238. webidl.brandCheck(this, Headers)
  21239. webidl.argumentLengthCheck(arguments, 1, { header: 'Headers.forEach' })
  21240. if (typeof callbackFn !== 'function') {
  21241. throw new TypeError(
  21242. "Failed to execute 'forEach' on 'Headers': parameter 1 is not of type 'Function'."
  21243. )
  21244. }
  21245. for (const [key, value] of this) {
  21246. callbackFn.apply(thisArg, [value, key, this])
  21247. }
  21248. }
  21249. [Symbol.for('nodejs.util.inspect.custom')] () {
  21250. webidl.brandCheck(this, Headers)
  21251. return this[kHeadersList]
  21252. }
  21253. }
  21254. Headers.prototype[Symbol.iterator] = Headers.prototype.entries
  21255. Object.defineProperties(Headers.prototype, {
  21256. append: kEnumerableProperty,
  21257. delete: kEnumerableProperty,
  21258. get: kEnumerableProperty,
  21259. has: kEnumerableProperty,
  21260. set: kEnumerableProperty,
  21261. getSetCookie: kEnumerableProperty,
  21262. keys: kEnumerableProperty,
  21263. values: kEnumerableProperty,
  21264. entries: kEnumerableProperty,
  21265. forEach: kEnumerableProperty,
  21266. [Symbol.iterator]: { enumerable: false },
  21267. [Symbol.toStringTag]: {
  21268. value: 'Headers',
  21269. configurable: true
  21270. }
  21271. })
  21272. webidl.converters.HeadersInit = function (V) {
  21273. if (webidl.util.Type(V) === 'Object') {
  21274. if (V[Symbol.iterator]) {
  21275. return webidl.converters['sequence<sequence<ByteString>>'](V)
  21276. }
  21277. return webidl.converters['record<ByteString, ByteString>'](V)
  21278. }
  21279. throw webidl.errors.conversionFailed({
  21280. prefix: 'Headers constructor',
  21281. argument: 'Argument 1',
  21282. types: ['sequence<sequence<ByteString>>', 'record<ByteString, ByteString>']
  21283. })
  21284. }
  21285. module.exports = {
  21286. fill,
  21287. Headers,
  21288. HeadersList
  21289. }
  21290. /***/ }),
  21291. /***/ 4881:
  21292. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  21293. "use strict";
  21294. // https://github.com/Ethan-Arrowood/undici-fetch
  21295. const {
  21296. Response,
  21297. makeNetworkError,
  21298. makeAppropriateNetworkError,
  21299. filterResponse,
  21300. makeResponse
  21301. } = __nccwpck_require__(7823)
  21302. const { Headers } = __nccwpck_require__(554)
  21303. const { Request, makeRequest } = __nccwpck_require__(8359)
  21304. const zlib = __nccwpck_require__(9796)
  21305. const {
  21306. bytesMatch,
  21307. makePolicyContainer,
  21308. clonePolicyContainer,
  21309. requestBadPort,
  21310. TAOCheck,
  21311. appendRequestOriginHeader,
  21312. responseLocationURL,
  21313. requestCurrentURL,
  21314. setRequestReferrerPolicyOnRedirect,
  21315. tryUpgradeRequestToAPotentiallyTrustworthyURL,
  21316. createOpaqueTimingInfo,
  21317. appendFetchMetadata,
  21318. corsCheck,
  21319. crossOriginResourcePolicyCheck,
  21320. determineRequestsReferrer,
  21321. coarsenedSharedCurrentTime,
  21322. createDeferredPromise,
  21323. isBlobLike,
  21324. sameOrigin,
  21325. isCancelled,
  21326. isAborted,
  21327. isErrorLike,
  21328. fullyReadBody,
  21329. readableStreamClose,
  21330. isomorphicEncode,
  21331. urlIsLocal,
  21332. urlIsHttpHttpsScheme,
  21333. urlHasHttpsScheme
  21334. } = __nccwpck_require__(2538)
  21335. const { kState, kHeaders, kGuard, kRealm } = __nccwpck_require__(5861)
  21336. const assert = __nccwpck_require__(9491)
  21337. const { safelyExtractBody } = __nccwpck_require__(9990)
  21338. const {
  21339. redirectStatusSet,
  21340. nullBodyStatus,
  21341. safeMethodsSet,
  21342. requestBodyHeader,
  21343. subresourceSet,
  21344. DOMException
  21345. } = __nccwpck_require__(1037)
  21346. const { kHeadersList } = __nccwpck_require__(2785)
  21347. const EE = __nccwpck_require__(2361)
  21348. const { Readable, pipeline } = __nccwpck_require__(2781)
  21349. const { addAbortListener, isErrored, isReadable, nodeMajor, nodeMinor } = __nccwpck_require__(3983)
  21350. const { dataURLProcessor, serializeAMimeType } = __nccwpck_require__(685)
  21351. const { TransformStream } = __nccwpck_require__(5356)
  21352. const { getGlobalDispatcher } = __nccwpck_require__(1892)
  21353. const { webidl } = __nccwpck_require__(1744)
  21354. const { STATUS_CODES } = __nccwpck_require__(3685)
  21355. const GET_OR_HEAD = ['GET', 'HEAD']
  21356. /** @type {import('buffer').resolveObjectURL} */
  21357. let resolveObjectURL
  21358. let ReadableStream = globalThis.ReadableStream
  21359. class Fetch extends EE {
  21360. constructor (dispatcher) {
  21361. super()
  21362. this.dispatcher = dispatcher
  21363. this.connection = null
  21364. this.dump = false
  21365. this.state = 'ongoing'
  21366. // 2 terminated listeners get added per request,
  21367. // but only 1 gets removed. If there are 20 redirects,
  21368. // 21 listeners will be added.
  21369. // See https://github.com/nodejs/undici/issues/1711
  21370. // TODO (fix): Find and fix root cause for leaked listener.
  21371. this.setMaxListeners(21)
  21372. }
  21373. terminate (reason) {
  21374. if (this.state !== 'ongoing') {
  21375. return
  21376. }
  21377. this.state = 'terminated'
  21378. this.connection?.destroy(reason)
  21379. this.emit('terminated', reason)
  21380. }
  21381. // https://fetch.spec.whatwg.org/#fetch-controller-abort
  21382. abort (error) {
  21383. if (this.state !== 'ongoing') {
  21384. return
  21385. }
  21386. // 1. Set controller’s state to "aborted".
  21387. this.state = 'aborted'
  21388. // 2. Let fallbackError be an "AbortError" DOMException.
  21389. // 3. Set error to fallbackError if it is not given.
  21390. if (!error) {
  21391. error = new DOMException('The operation was aborted.', 'AbortError')
  21392. }
  21393. // 4. Let serializedError be StructuredSerialize(error).
  21394. // If that threw an exception, catch it, and let
  21395. // serializedError be StructuredSerialize(fallbackError).
  21396. // 5. Set controller’s serialized abort reason to serializedError.
  21397. this.serializedAbortReason = error
  21398. this.connection?.destroy(error)
  21399. this.emit('terminated', error)
  21400. }
  21401. }
  21402. // https://fetch.spec.whatwg.org/#fetch-method
  21403. function fetch (input, init = {}) {
  21404. webidl.argumentLengthCheck(arguments, 1, { header: 'globalThis.fetch' })
  21405. // 1. Let p be a new promise.
  21406. const p = createDeferredPromise()
  21407. // 2. Let requestObject be the result of invoking the initial value of
  21408. // Request as constructor with input and init as arguments. If this throws
  21409. // an exception, reject p with it and return p.
  21410. let requestObject
  21411. try {
  21412. requestObject = new Request(input, init)
  21413. } catch (e) {
  21414. p.reject(e)
  21415. return p.promise
  21416. }
  21417. // 3. Let request be requestObject’s request.
  21418. const request = requestObject[kState]
  21419. // 4. If requestObject’s signal’s aborted flag is set, then:
  21420. if (requestObject.signal.aborted) {
  21421. // 1. Abort the fetch() call with p, request, null, and
  21422. // requestObject’s signal’s abort reason.
  21423. abortFetch(p, request, null, requestObject.signal.reason)
  21424. // 2. Return p.
  21425. return p.promise
  21426. }
  21427. // 5. Let globalObject be request’s client’s global object.
  21428. const globalObject = request.client.globalObject
  21429. // 6. If globalObject is a ServiceWorkerGlobalScope object, then set
  21430. // request’s service-workers mode to "none".
  21431. if (globalObject?.constructor?.name === 'ServiceWorkerGlobalScope') {
  21432. request.serviceWorkers = 'none'
  21433. }
  21434. // 7. Let responseObject be null.
  21435. let responseObject = null
  21436. // 8. Let relevantRealm be this’s relevant Realm.
  21437. const relevantRealm = null
  21438. // 9. Let locallyAborted be false.
  21439. let locallyAborted = false
  21440. // 10. Let controller be null.
  21441. let controller = null
  21442. // 11. Add the following abort steps to requestObject’s signal:
  21443. addAbortListener(
  21444. requestObject.signal,
  21445. () => {
  21446. // 1. Set locallyAborted to true.
  21447. locallyAborted = true
  21448. // 2. Assert: controller is non-null.
  21449. assert(controller != null)
  21450. // 3. Abort controller with requestObject’s signal’s abort reason.
  21451. controller.abort(requestObject.signal.reason)
  21452. // 4. Abort the fetch() call with p, request, responseObject,
  21453. // and requestObject’s signal’s abort reason.
  21454. abortFetch(p, request, responseObject, requestObject.signal.reason)
  21455. }
  21456. )
  21457. // 12. Let handleFetchDone given response response be to finalize and
  21458. // report timing with response, globalObject, and "fetch".
  21459. const handleFetchDone = (response) =>
  21460. finalizeAndReportTiming(response, 'fetch')
  21461. // 13. Set controller to the result of calling fetch given request,
  21462. // with processResponseEndOfBody set to handleFetchDone, and processResponse
  21463. // given response being these substeps:
  21464. const processResponse = (response) => {
  21465. // 1. If locallyAborted is true, terminate these substeps.
  21466. if (locallyAborted) {
  21467. return Promise.resolve()
  21468. }
  21469. // 2. If response’s aborted flag is set, then:
  21470. if (response.aborted) {
  21471. // 1. Let deserializedError be the result of deserialize a serialized
  21472. // abort reason given controller’s serialized abort reason and
  21473. // relevantRealm.
  21474. // 2. Abort the fetch() call with p, request, responseObject, and
  21475. // deserializedError.
  21476. abortFetch(p, request, responseObject, controller.serializedAbortReason)
  21477. return Promise.resolve()
  21478. }
  21479. // 3. If response is a network error, then reject p with a TypeError
  21480. // and terminate these substeps.
  21481. if (response.type === 'error') {
  21482. p.reject(
  21483. Object.assign(new TypeError('fetch failed'), { cause: response.error })
  21484. )
  21485. return Promise.resolve()
  21486. }
  21487. // 4. Set responseObject to the result of creating a Response object,
  21488. // given response, "immutable", and relevantRealm.
  21489. responseObject = new Response()
  21490. responseObject[kState] = response
  21491. responseObject[kRealm] = relevantRealm
  21492. responseObject[kHeaders][kHeadersList] = response.headersList
  21493. responseObject[kHeaders][kGuard] = 'immutable'
  21494. responseObject[kHeaders][kRealm] = relevantRealm
  21495. // 5. Resolve p with responseObject.
  21496. p.resolve(responseObject)
  21497. }
  21498. controller = fetching({
  21499. request,
  21500. processResponseEndOfBody: handleFetchDone,
  21501. processResponse,
  21502. dispatcher: init.dispatcher ?? getGlobalDispatcher() // undici
  21503. })
  21504. // 14. Return p.
  21505. return p.promise
  21506. }
  21507. // https://fetch.spec.whatwg.org/#finalize-and-report-timing
  21508. function finalizeAndReportTiming (response, initiatorType = 'other') {
  21509. // 1. If response is an aborted network error, then return.
  21510. if (response.type === 'error' && response.aborted) {
  21511. return
  21512. }
  21513. // 2. If response’s URL list is null or empty, then return.
  21514. if (!response.urlList?.length) {
  21515. return
  21516. }
  21517. // 3. Let originalURL be response’s URL list[0].
  21518. const originalURL = response.urlList[0]
  21519. // 4. Let timingInfo be response’s timing info.
  21520. let timingInfo = response.timingInfo
  21521. // 5. Let cacheState be response’s cache state.
  21522. let cacheState = response.cacheState
  21523. // 6. If originalURL’s scheme is not an HTTP(S) scheme, then return.
  21524. if (!urlIsHttpHttpsScheme(originalURL)) {
  21525. return
  21526. }
  21527. // 7. If timingInfo is null, then return.
  21528. if (timingInfo === null) {
  21529. return
  21530. }
  21531. // 8. If response’s timing allow passed flag is not set, then:
  21532. if (!response.timingAllowPassed) {
  21533. // 1. Set timingInfo to a the result of creating an opaque timing info for timingInfo.
  21534. timingInfo = createOpaqueTimingInfo({
  21535. startTime: timingInfo.startTime
  21536. })
  21537. // 2. Set cacheState to the empty string.
  21538. cacheState = ''
  21539. }
  21540. // 9. Set timingInfo’s end time to the coarsened shared current time
  21541. // given global’s relevant settings object’s cross-origin isolated
  21542. // capability.
  21543. // TODO: given global’s relevant settings object’s cross-origin isolated
  21544. // capability?
  21545. timingInfo.endTime = coarsenedSharedCurrentTime()
  21546. // 10. Set response’s timing info to timingInfo.
  21547. response.timingInfo = timingInfo
  21548. // 11. Mark resource timing for timingInfo, originalURL, initiatorType,
  21549. // global, and cacheState.
  21550. markResourceTiming(
  21551. timingInfo,
  21552. originalURL,
  21553. initiatorType,
  21554. globalThis,
  21555. cacheState
  21556. )
  21557. }
  21558. // https://w3c.github.io/resource-timing/#dfn-mark-resource-timing
  21559. function markResourceTiming (timingInfo, originalURL, initiatorType, globalThis, cacheState) {
  21560. if (nodeMajor > 18 || (nodeMajor === 18 && nodeMinor >= 2)) {
  21561. performance.markResourceTiming(timingInfo, originalURL.href, initiatorType, globalThis, cacheState)
  21562. }
  21563. }
  21564. // https://fetch.spec.whatwg.org/#abort-fetch
  21565. function abortFetch (p, request, responseObject, error) {
  21566. // Note: AbortSignal.reason was added in node v17.2.0
  21567. // which would give us an undefined error to reject with.
  21568. // Remove this once node v16 is no longer supported.
  21569. if (!error) {
  21570. error = new DOMException('The operation was aborted.', 'AbortError')
  21571. }
  21572. // 1. Reject promise with error.
  21573. p.reject(error)
  21574. // 2. If request’s body is not null and is readable, then cancel request’s
  21575. // body with error.
  21576. if (request.body != null && isReadable(request.body?.stream)) {
  21577. request.body.stream.cancel(error).catch((err) => {
  21578. if (err.code === 'ERR_INVALID_STATE') {
  21579. // Node bug?
  21580. return
  21581. }
  21582. throw err
  21583. })
  21584. }
  21585. // 3. If responseObject is null, then return.
  21586. if (responseObject == null) {
  21587. return
  21588. }
  21589. // 4. Let response be responseObject’s response.
  21590. const response = responseObject[kState]
  21591. // 5. If response’s body is not null and is readable, then error response’s
  21592. // body with error.
  21593. if (response.body != null && isReadable(response.body?.stream)) {
  21594. response.body.stream.cancel(error).catch((err) => {
  21595. if (err.code === 'ERR_INVALID_STATE') {
  21596. // Node bug?
  21597. return
  21598. }
  21599. throw err
  21600. })
  21601. }
  21602. }
  21603. // https://fetch.spec.whatwg.org/#fetching
  21604. function fetching ({
  21605. request,
  21606. processRequestBodyChunkLength,
  21607. processRequestEndOfBody,
  21608. processResponse,
  21609. processResponseEndOfBody,
  21610. processResponseConsumeBody,
  21611. useParallelQueue = false,
  21612. dispatcher // undici
  21613. }) {
  21614. // 1. Let taskDestination be null.
  21615. let taskDestination = null
  21616. // 2. Let crossOriginIsolatedCapability be false.
  21617. let crossOriginIsolatedCapability = false
  21618. // 3. If request’s client is non-null, then:
  21619. if (request.client != null) {
  21620. // 1. Set taskDestination to request’s client’s global object.
  21621. taskDestination = request.client.globalObject
  21622. // 2. Set crossOriginIsolatedCapability to request’s client’s cross-origin
  21623. // isolated capability.
  21624. crossOriginIsolatedCapability =
  21625. request.client.crossOriginIsolatedCapability
  21626. }
  21627. // 4. If useParallelQueue is true, then set taskDestination to the result of
  21628. // starting a new parallel queue.
  21629. // TODO
  21630. // 5. Let timingInfo be a new fetch timing info whose start time and
  21631. // post-redirect start time are the coarsened shared current time given
  21632. // crossOriginIsolatedCapability.
  21633. const currenTime = coarsenedSharedCurrentTime(crossOriginIsolatedCapability)
  21634. const timingInfo = createOpaqueTimingInfo({
  21635. startTime: currenTime
  21636. })
  21637. // 6. Let fetchParams be a new fetch params whose
  21638. // request is request,
  21639. // timing info is timingInfo,
  21640. // process request body chunk length is processRequestBodyChunkLength,
  21641. // process request end-of-body is processRequestEndOfBody,
  21642. // process response is processResponse,
  21643. // process response consume body is processResponseConsumeBody,
  21644. // process response end-of-body is processResponseEndOfBody,
  21645. // task destination is taskDestination,
  21646. // and cross-origin isolated capability is crossOriginIsolatedCapability.
  21647. const fetchParams = {
  21648. controller: new Fetch(dispatcher),
  21649. request,
  21650. timingInfo,
  21651. processRequestBodyChunkLength,
  21652. processRequestEndOfBody,
  21653. processResponse,
  21654. processResponseConsumeBody,
  21655. processResponseEndOfBody,
  21656. taskDestination,
  21657. crossOriginIsolatedCapability
  21658. }
  21659. // 7. If request’s body is a byte sequence, then set request’s body to
  21660. // request’s body as a body.
  21661. // NOTE: Since fetching is only called from fetch, body should already be
  21662. // extracted.
  21663. assert(!request.body || request.body.stream)
  21664. // 8. If request’s window is "client", then set request’s window to request’s
  21665. // client, if request’s client’s global object is a Window object; otherwise
  21666. // "no-window".
  21667. if (request.window === 'client') {
  21668. // TODO: What if request.client is null?
  21669. request.window =
  21670. request.client?.globalObject?.constructor?.name === 'Window'
  21671. ? request.client
  21672. : 'no-window'
  21673. }
  21674. // 9. If request’s origin is "client", then set request’s origin to request’s
  21675. // client’s origin.
  21676. if (request.origin === 'client') {
  21677. // TODO: What if request.client is null?
  21678. request.origin = request.client?.origin
  21679. }
  21680. // 10. If all of the following conditions are true:
  21681. // TODO
  21682. // 11. If request’s policy container is "client", then:
  21683. if (request.policyContainer === 'client') {
  21684. // 1. If request’s client is non-null, then set request’s policy
  21685. // container to a clone of request’s client’s policy container. [HTML]
  21686. if (request.client != null) {
  21687. request.policyContainer = clonePolicyContainer(
  21688. request.client.policyContainer
  21689. )
  21690. } else {
  21691. // 2. Otherwise, set request’s policy container to a new policy
  21692. // container.
  21693. request.policyContainer = makePolicyContainer()
  21694. }
  21695. }
  21696. // 12. If request’s header list does not contain `Accept`, then:
  21697. if (!request.headersList.contains('accept')) {
  21698. // 1. Let value be `*/*`.
  21699. const value = '*/*'
  21700. // 2. A user agent should set value to the first matching statement, if
  21701. // any, switching on request’s destination:
  21702. // "document"
  21703. // "frame"
  21704. // "iframe"
  21705. // `text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8`
  21706. // "image"
  21707. // `image/png,image/svg+xml,image/*;q=0.8,*/*;q=0.5`
  21708. // "style"
  21709. // `text/css,*/*;q=0.1`
  21710. // TODO
  21711. // 3. Append `Accept`/value to request’s header list.
  21712. request.headersList.append('accept', value)
  21713. }
  21714. // 13. If request’s header list does not contain `Accept-Language`, then
  21715. // user agents should append `Accept-Language`/an appropriate value to
  21716. // request’s header list.
  21717. if (!request.headersList.contains('accept-language')) {
  21718. request.headersList.append('accept-language', '*')
  21719. }
  21720. // 14. If request’s priority is null, then use request’s initiator and
  21721. // destination appropriately in setting request’s priority to a
  21722. // user-agent-defined object.
  21723. if (request.priority === null) {
  21724. // TODO
  21725. }
  21726. // 15. If request is a subresource request, then:
  21727. if (subresourceSet.has(request.destination)) {
  21728. // TODO
  21729. }
  21730. // 16. Run main fetch given fetchParams.
  21731. mainFetch(fetchParams)
  21732. .catch(err => {
  21733. fetchParams.controller.terminate(err)
  21734. })
  21735. // 17. Return fetchParam's controller
  21736. return fetchParams.controller
  21737. }
  21738. // https://fetch.spec.whatwg.org/#concept-main-fetch
  21739. async function mainFetch (fetchParams, recursive = false) {
  21740. // 1. Let request be fetchParams’s request.
  21741. const request = fetchParams.request
  21742. // 2. Let response be null.
  21743. let response = null
  21744. // 3. If request’s local-URLs-only flag is set and request’s current URL is
  21745. // not local, then set response to a network error.
  21746. if (request.localURLsOnly && !urlIsLocal(requestCurrentURL(request))) {
  21747. response = makeNetworkError('local URLs only')
  21748. }
  21749. // 4. Run report Content Security Policy violations for request.
  21750. // TODO
  21751. // 5. Upgrade request to a potentially trustworthy URL, if appropriate.
  21752. tryUpgradeRequestToAPotentiallyTrustworthyURL(request)
  21753. // 6. If should request be blocked due to a bad port, should fetching request
  21754. // be blocked as mixed content, or should request be blocked by Content
  21755. // Security Policy returns blocked, then set response to a network error.
  21756. if (requestBadPort(request) === 'blocked') {
  21757. response = makeNetworkError('bad port')
  21758. }
  21759. // TODO: should fetching request be blocked as mixed content?
  21760. // TODO: should request be blocked by Content Security Policy?
  21761. // 7. If request’s referrer policy is the empty string, then set request’s
  21762. // referrer policy to request’s policy container’s referrer policy.
  21763. if (request.referrerPolicy === '') {
  21764. request.referrerPolicy = request.policyContainer.referrerPolicy
  21765. }
  21766. // 8. If request’s referrer is not "no-referrer", then set request’s
  21767. // referrer to the result of invoking determine request’s referrer.
  21768. if (request.referrer !== 'no-referrer') {
  21769. request.referrer = determineRequestsReferrer(request)
  21770. }
  21771. // 9. Set request’s current URL’s scheme to "https" if all of the following
  21772. // conditions are true:
  21773. // - request’s current URL’s scheme is "http"
  21774. // - request’s current URL’s host is a domain
  21775. // - Matching request’s current URL’s host per Known HSTS Host Domain Name
  21776. // Matching results in either a superdomain match with an asserted
  21777. // includeSubDomains directive or a congruent match (with or without an
  21778. // asserted includeSubDomains directive). [HSTS]
  21779. // TODO
  21780. // 10. If recursive is false, then run the remaining steps in parallel.
  21781. // TODO
  21782. // 11. If response is null, then set response to the result of running
  21783. // the steps corresponding to the first matching statement:
  21784. if (response === null) {
  21785. response = await (async () => {
  21786. const currentURL = requestCurrentURL(request)
  21787. if (
  21788. // - request’s current URL’s origin is same origin with request’s origin,
  21789. // and request’s response tainting is "basic"
  21790. (sameOrigin(currentURL, request.url) && request.responseTainting === 'basic') ||
  21791. // request’s current URL’s scheme is "data"
  21792. (currentURL.protocol === 'data:') ||
  21793. // - request’s mode is "navigate" or "websocket"
  21794. (request.mode === 'navigate' || request.mode === 'websocket')
  21795. ) {
  21796. // 1. Set request’s response tainting to "basic".
  21797. request.responseTainting = 'basic'
  21798. // 2. Return the result of running scheme fetch given fetchParams.
  21799. return await schemeFetch(fetchParams)
  21800. }
  21801. // request’s mode is "same-origin"
  21802. if (request.mode === 'same-origin') {
  21803. // 1. Return a network error.
  21804. return makeNetworkError('request mode cannot be "same-origin"')
  21805. }
  21806. // request’s mode is "no-cors"
  21807. if (request.mode === 'no-cors') {
  21808. // 1. If request’s redirect mode is not "follow", then return a network
  21809. // error.
  21810. if (request.redirect !== 'follow') {
  21811. return makeNetworkError(
  21812. 'redirect mode cannot be "follow" for "no-cors" request'
  21813. )
  21814. }
  21815. // 2. Set request’s response tainting to "opaque".
  21816. request.responseTainting = 'opaque'
  21817. // 3. Return the result of running scheme fetch given fetchParams.
  21818. return await schemeFetch(fetchParams)
  21819. }
  21820. // request’s current URL’s scheme is not an HTTP(S) scheme
  21821. if (!urlIsHttpHttpsScheme(requestCurrentURL(request))) {
  21822. // Return a network error.
  21823. return makeNetworkError('URL scheme must be a HTTP(S) scheme')
  21824. }
  21825. // - request’s use-CORS-preflight flag is set
  21826. // - request’s unsafe-request flag is set and either request’s method is
  21827. // not a CORS-safelisted method or CORS-unsafe request-header names with
  21828. // request’s header list is not empty
  21829. // 1. Set request’s response tainting to "cors".
  21830. // 2. Let corsWithPreflightResponse be the result of running HTTP fetch
  21831. // given fetchParams and true.
  21832. // 3. If corsWithPreflightResponse is a network error, then clear cache
  21833. // entries using request.
  21834. // 4. Return corsWithPreflightResponse.
  21835. // TODO
  21836. // Otherwise
  21837. // 1. Set request’s response tainting to "cors".
  21838. request.responseTainting = 'cors'
  21839. // 2. Return the result of running HTTP fetch given fetchParams.
  21840. return await httpFetch(fetchParams)
  21841. })()
  21842. }
  21843. // 12. If recursive is true, then return response.
  21844. if (recursive) {
  21845. return response
  21846. }
  21847. // 13. If response is not a network error and response is not a filtered
  21848. // response, then:
  21849. if (response.status !== 0 && !response.internalResponse) {
  21850. // If request’s response tainting is "cors", then:
  21851. if (request.responseTainting === 'cors') {
  21852. // 1. Let headerNames be the result of extracting header list values
  21853. // given `Access-Control-Expose-Headers` and response’s header list.
  21854. // TODO
  21855. // 2. If request’s credentials mode is not "include" and headerNames
  21856. // contains `*`, then set response’s CORS-exposed header-name list to
  21857. // all unique header names in response’s header list.
  21858. // TODO
  21859. // 3. Otherwise, if headerNames is not null or failure, then set
  21860. // response’s CORS-exposed header-name list to headerNames.
  21861. // TODO
  21862. }
  21863. // Set response to the following filtered response with response as its
  21864. // internal response, depending on request’s response tainting:
  21865. if (request.responseTainting === 'basic') {
  21866. response = filterResponse(response, 'basic')
  21867. } else if (request.responseTainting === 'cors') {
  21868. response = filterResponse(response, 'cors')
  21869. } else if (request.responseTainting === 'opaque') {
  21870. response = filterResponse(response, 'opaque')
  21871. } else {
  21872. assert(false)
  21873. }
  21874. }
  21875. // 14. Let internalResponse be response, if response is a network error,
  21876. // and response’s internal response otherwise.
  21877. let internalResponse =
  21878. response.status === 0 ? response : response.internalResponse
  21879. // 15. If internalResponse’s URL list is empty, then set it to a clone of
  21880. // request’s URL list.
  21881. if (internalResponse.urlList.length === 0) {
  21882. internalResponse.urlList.push(...request.urlList)
  21883. }
  21884. // 16. If request’s timing allow failed flag is unset, then set
  21885. // internalResponse’s timing allow passed flag.
  21886. if (!request.timingAllowFailed) {
  21887. response.timingAllowPassed = true
  21888. }
  21889. // 17. If response is not a network error and any of the following returns
  21890. // blocked
  21891. // - should internalResponse to request be blocked as mixed content
  21892. // - should internalResponse to request be blocked by Content Security Policy
  21893. // - should internalResponse to request be blocked due to its MIME type
  21894. // - should internalResponse to request be blocked due to nosniff
  21895. // TODO
  21896. // 18. If response’s type is "opaque", internalResponse’s status is 206,
  21897. // internalResponse’s range-requested flag is set, and request’s header
  21898. // list does not contain `Range`, then set response and internalResponse
  21899. // to a network error.
  21900. if (
  21901. response.type === 'opaque' &&
  21902. internalResponse.status === 206 &&
  21903. internalResponse.rangeRequested &&
  21904. !request.headers.contains('range')
  21905. ) {
  21906. response = internalResponse = makeNetworkError()
  21907. }
  21908. // 19. If response is not a network error and either request’s method is
  21909. // `HEAD` or `CONNECT`, or internalResponse’s status is a null body status,
  21910. // set internalResponse’s body to null and disregard any enqueuing toward
  21911. // it (if any).
  21912. if (
  21913. response.status !== 0 &&
  21914. (request.method === 'HEAD' ||
  21915. request.method === 'CONNECT' ||
  21916. nullBodyStatus.includes(internalResponse.status))
  21917. ) {
  21918. internalResponse.body = null
  21919. fetchParams.controller.dump = true
  21920. }
  21921. // 20. If request’s integrity metadata is not the empty string, then:
  21922. if (request.integrity) {
  21923. // 1. Let processBodyError be this step: run fetch finale given fetchParams
  21924. // and a network error.
  21925. const processBodyError = (reason) =>
  21926. fetchFinale(fetchParams, makeNetworkError(reason))
  21927. // 2. If request’s response tainting is "opaque", or response’s body is null,
  21928. // then run processBodyError and abort these steps.
  21929. if (request.responseTainting === 'opaque' || response.body == null) {
  21930. processBodyError(response.error)
  21931. return
  21932. }
  21933. // 3. Let processBody given bytes be these steps:
  21934. const processBody = (bytes) => {
  21935. // 1. If bytes do not match request’s integrity metadata,
  21936. // then run processBodyError and abort these steps. [SRI]
  21937. if (!bytesMatch(bytes, request.integrity)) {
  21938. processBodyError('integrity mismatch')
  21939. return
  21940. }
  21941. // 2. Set response’s body to bytes as a body.
  21942. response.body = safelyExtractBody(bytes)[0]
  21943. // 3. Run fetch finale given fetchParams and response.
  21944. fetchFinale(fetchParams, response)
  21945. }
  21946. // 4. Fully read response’s body given processBody and processBodyError.
  21947. await fullyReadBody(response.body, processBody, processBodyError)
  21948. } else {
  21949. // 21. Otherwise, run fetch finale given fetchParams and response.
  21950. fetchFinale(fetchParams, response)
  21951. }
  21952. }
  21953. // https://fetch.spec.whatwg.org/#concept-scheme-fetch
  21954. // given a fetch params fetchParams
  21955. function schemeFetch (fetchParams) {
  21956. // Note: since the connection is destroyed on redirect, which sets fetchParams to a
  21957. // cancelled state, we do not want this condition to trigger *unless* there have been
  21958. // no redirects. See https://github.com/nodejs/undici/issues/1776
  21959. // 1. If fetchParams is canceled, then return the appropriate network error for fetchParams.
  21960. if (isCancelled(fetchParams) && fetchParams.request.redirectCount === 0) {
  21961. return Promise.resolve(makeAppropriateNetworkError(fetchParams))
  21962. }
  21963. // 2. Let request be fetchParams’s request.
  21964. const { request } = fetchParams
  21965. const { protocol: scheme } = requestCurrentURL(request)
  21966. // 3. Switch on request’s current URL’s scheme and run the associated steps:
  21967. switch (scheme) {
  21968. case 'about:': {
  21969. // If request’s current URL’s path is the string "blank", then return a new response
  21970. // whose status message is `OK`, header list is « (`Content-Type`, `text/html;charset=utf-8`) »,
  21971. // and body is the empty byte sequence as a body.
  21972. // Otherwise, return a network error.
  21973. return Promise.resolve(makeNetworkError('about scheme is not supported'))
  21974. }
  21975. case 'blob:': {
  21976. if (!resolveObjectURL) {
  21977. resolveObjectURL = (__nccwpck_require__(4300).resolveObjectURL)
  21978. }
  21979. // 1. Let blobURLEntry be request’s current URL’s blob URL entry.
  21980. const blobURLEntry = requestCurrentURL(request)
  21981. // https://github.com/web-platform-tests/wpt/blob/7b0ebaccc62b566a1965396e5be7bb2bc06f841f/FileAPI/url/resources/fetch-tests.js#L52-L56
  21982. // Buffer.resolveObjectURL does not ignore URL queries.
  21983. if (blobURLEntry.search.length !== 0) {
  21984. return Promise.resolve(makeNetworkError('NetworkError when attempting to fetch resource.'))
  21985. }
  21986. const blobURLEntryObject = resolveObjectURL(blobURLEntry.toString())
  21987. // 2. If request’s method is not `GET`, blobURLEntry is null, or blobURLEntry’s
  21988. // object is not a Blob object, then return a network error.
  21989. if (request.method !== 'GET' || !isBlobLike(blobURLEntryObject)) {
  21990. return Promise.resolve(makeNetworkError('invalid method'))
  21991. }
  21992. // 3. Let bodyWithType be the result of safely extracting blobURLEntry’s object.
  21993. const bodyWithType = safelyExtractBody(blobURLEntryObject)
  21994. // 4. Let body be bodyWithType’s body.
  21995. const body = bodyWithType[0]
  21996. // 5. Let length be body’s length, serialized and isomorphic encoded.
  21997. const length = isomorphicEncode(`${body.length}`)
  21998. // 6. Let type be bodyWithType’s type if it is non-null; otherwise the empty byte sequence.
  21999. const type = bodyWithType[1] ?? ''
  22000. // 7. Return a new response whose status message is `OK`, header list is
  22001. // « (`Content-Length`, length), (`Content-Type`, type) », and body is body.
  22002. const response = makeResponse({
  22003. statusText: 'OK',
  22004. headersList: [
  22005. ['content-length', { name: 'Content-Length', value: length }],
  22006. ['content-type', { name: 'Content-Type', value: type }]
  22007. ]
  22008. })
  22009. response.body = body
  22010. return Promise.resolve(response)
  22011. }
  22012. case 'data:': {
  22013. // 1. Let dataURLStruct be the result of running the
  22014. // data: URL processor on request’s current URL.
  22015. const currentURL = requestCurrentURL(request)
  22016. const dataURLStruct = dataURLProcessor(currentURL)
  22017. // 2. If dataURLStruct is failure, then return a
  22018. // network error.
  22019. if (dataURLStruct === 'failure') {
  22020. return Promise.resolve(makeNetworkError('failed to fetch the data URL'))
  22021. }
  22022. // 3. Let mimeType be dataURLStruct’s MIME type, serialized.
  22023. const mimeType = serializeAMimeType(dataURLStruct.mimeType)
  22024. // 4. Return a response whose status message is `OK`,
  22025. // header list is « (`Content-Type`, mimeType) »,
  22026. // and body is dataURLStruct’s body as a body.
  22027. return Promise.resolve(makeResponse({
  22028. statusText: 'OK',
  22029. headersList: [
  22030. ['content-type', { name: 'Content-Type', value: mimeType }]
  22031. ],
  22032. body: safelyExtractBody(dataURLStruct.body)[0]
  22033. }))
  22034. }
  22035. case 'file:': {
  22036. // For now, unfortunate as it is, file URLs are left as an exercise for the reader.
  22037. // When in doubt, return a network error.
  22038. return Promise.resolve(makeNetworkError('not implemented... yet...'))
  22039. }
  22040. case 'http:':
  22041. case 'https:': {
  22042. // Return the result of running HTTP fetch given fetchParams.
  22043. return httpFetch(fetchParams)
  22044. .catch((err) => makeNetworkError(err))
  22045. }
  22046. default: {
  22047. return Promise.resolve(makeNetworkError('unknown scheme'))
  22048. }
  22049. }
  22050. }
  22051. // https://fetch.spec.whatwg.org/#finalize-response
  22052. function finalizeResponse (fetchParams, response) {
  22053. // 1. Set fetchParams’s request’s done flag.
  22054. fetchParams.request.done = true
  22055. // 2, If fetchParams’s process response done is not null, then queue a fetch
  22056. // task to run fetchParams’s process response done given response, with
  22057. // fetchParams’s task destination.
  22058. if (fetchParams.processResponseDone != null) {
  22059. queueMicrotask(() => fetchParams.processResponseDone(response))
  22060. }
  22061. }
  22062. // https://fetch.spec.whatwg.org/#fetch-finale
  22063. function fetchFinale (fetchParams, response) {
  22064. // 1. If response is a network error, then:
  22065. if (response.type === 'error') {
  22066. // 1. Set response’s URL list to « fetchParams’s request’s URL list[0] ».
  22067. response.urlList = [fetchParams.request.urlList[0]]
  22068. // 2. Set response’s timing info to the result of creating an opaque timing
  22069. // info for fetchParams’s timing info.
  22070. response.timingInfo = createOpaqueTimingInfo({
  22071. startTime: fetchParams.timingInfo.startTime
  22072. })
  22073. }
  22074. // 2. Let processResponseEndOfBody be the following steps:
  22075. const processResponseEndOfBody = () => {
  22076. // 1. Set fetchParams’s request’s done flag.
  22077. fetchParams.request.done = true
  22078. // If fetchParams’s process response end-of-body is not null,
  22079. // then queue a fetch task to run fetchParams’s process response
  22080. // end-of-body given response with fetchParams’s task destination.
  22081. if (fetchParams.processResponseEndOfBody != null) {
  22082. queueMicrotask(() => fetchParams.processResponseEndOfBody(response))
  22083. }
  22084. }
  22085. // 3. If fetchParams’s process response is non-null, then queue a fetch task
  22086. // to run fetchParams’s process response given response, with fetchParams’s
  22087. // task destination.
  22088. if (fetchParams.processResponse != null) {
  22089. queueMicrotask(() => fetchParams.processResponse(response))
  22090. }
  22091. // 4. If response’s body is null, then run processResponseEndOfBody.
  22092. if (response.body == null) {
  22093. processResponseEndOfBody()
  22094. } else {
  22095. // 5. Otherwise:
  22096. // 1. Let transformStream be a new a TransformStream.
  22097. // 2. Let identityTransformAlgorithm be an algorithm which, given chunk,
  22098. // enqueues chunk in transformStream.
  22099. const identityTransformAlgorithm = (chunk, controller) => {
  22100. controller.enqueue(chunk)
  22101. }
  22102. // 3. Set up transformStream with transformAlgorithm set to identityTransformAlgorithm
  22103. // and flushAlgorithm set to processResponseEndOfBody.
  22104. const transformStream = new TransformStream({
  22105. start () {},
  22106. transform: identityTransformAlgorithm,
  22107. flush: processResponseEndOfBody
  22108. }, {
  22109. size () {
  22110. return 1
  22111. }
  22112. }, {
  22113. size () {
  22114. return 1
  22115. }
  22116. })
  22117. // 4. Set response’s body to the result of piping response’s body through transformStream.
  22118. response.body = { stream: response.body.stream.pipeThrough(transformStream) }
  22119. }
  22120. // 6. If fetchParams’s process response consume body is non-null, then:
  22121. if (fetchParams.processResponseConsumeBody != null) {
  22122. // 1. Let processBody given nullOrBytes be this step: run fetchParams’s
  22123. // process response consume body given response and nullOrBytes.
  22124. const processBody = (nullOrBytes) => fetchParams.processResponseConsumeBody(response, nullOrBytes)
  22125. // 2. Let processBodyError be this step: run fetchParams’s process
  22126. // response consume body given response and failure.
  22127. const processBodyError = (failure) => fetchParams.processResponseConsumeBody(response, failure)
  22128. // 3. If response’s body is null, then queue a fetch task to run processBody
  22129. // given null, with fetchParams’s task destination.
  22130. if (response.body == null) {
  22131. queueMicrotask(() => processBody(null))
  22132. } else {
  22133. // 4. Otherwise, fully read response’s body given processBody, processBodyError,
  22134. // and fetchParams’s task destination.
  22135. return fullyReadBody(response.body, processBody, processBodyError)
  22136. }
  22137. return Promise.resolve()
  22138. }
  22139. }
  22140. // https://fetch.spec.whatwg.org/#http-fetch
  22141. async function httpFetch (fetchParams) {
  22142. // 1. Let request be fetchParams’s request.
  22143. const request = fetchParams.request
  22144. // 2. Let response be null.
  22145. let response = null
  22146. // 3. Let actualResponse be null.
  22147. let actualResponse = null
  22148. // 4. Let timingInfo be fetchParams’s timing info.
  22149. const timingInfo = fetchParams.timingInfo
  22150. // 5. If request’s service-workers mode is "all", then:
  22151. if (request.serviceWorkers === 'all') {
  22152. // TODO
  22153. }
  22154. // 6. If response is null, then:
  22155. if (response === null) {
  22156. // 1. If makeCORSPreflight is true and one of these conditions is true:
  22157. // TODO
  22158. // 2. If request’s redirect mode is "follow", then set request’s
  22159. // service-workers mode to "none".
  22160. if (request.redirect === 'follow') {
  22161. request.serviceWorkers = 'none'
  22162. }
  22163. // 3. Set response and actualResponse to the result of running
  22164. // HTTP-network-or-cache fetch given fetchParams.
  22165. actualResponse = response = await httpNetworkOrCacheFetch(fetchParams)
  22166. // 4. If request’s response tainting is "cors" and a CORS check
  22167. // for request and response returns failure, then return a network error.
  22168. if (
  22169. request.responseTainting === 'cors' &&
  22170. corsCheck(request, response) === 'failure'
  22171. ) {
  22172. return makeNetworkError('cors failure')
  22173. }
  22174. // 5. If the TAO check for request and response returns failure, then set
  22175. // request’s timing allow failed flag.
  22176. if (TAOCheck(request, response) === 'failure') {
  22177. request.timingAllowFailed = true
  22178. }
  22179. }
  22180. // 7. If either request’s response tainting or response’s type
  22181. // is "opaque", and the cross-origin resource policy check with
  22182. // request’s origin, request’s client, request’s destination,
  22183. // and actualResponse returns blocked, then return a network error.
  22184. if (
  22185. (request.responseTainting === 'opaque' || response.type === 'opaque') &&
  22186. crossOriginResourcePolicyCheck(
  22187. request.origin,
  22188. request.client,
  22189. request.destination,
  22190. actualResponse
  22191. ) === 'blocked'
  22192. ) {
  22193. return makeNetworkError('blocked')
  22194. }
  22195. // 8. If actualResponse’s status is a redirect status, then:
  22196. if (redirectStatusSet.has(actualResponse.status)) {
  22197. // 1. If actualResponse’s status is not 303, request’s body is not null,
  22198. // and the connection uses HTTP/2, then user agents may, and are even
  22199. // encouraged to, transmit an RST_STREAM frame.
  22200. // See, https://github.com/whatwg/fetch/issues/1288
  22201. if (request.redirect !== 'manual') {
  22202. fetchParams.controller.connection.destroy()
  22203. }
  22204. // 2. Switch on request’s redirect mode:
  22205. if (request.redirect === 'error') {
  22206. // Set response to a network error.
  22207. response = makeNetworkError('unexpected redirect')
  22208. } else if (request.redirect === 'manual') {
  22209. // Set response to an opaque-redirect filtered response whose internal
  22210. // response is actualResponse.
  22211. // NOTE(spec): On the web this would return an `opaqueredirect` response,
  22212. // but that doesn't make sense server side.
  22213. // See https://github.com/nodejs/undici/issues/1193.
  22214. response = actualResponse
  22215. } else if (request.redirect === 'follow') {
  22216. // Set response to the result of running HTTP-redirect fetch given
  22217. // fetchParams and response.
  22218. response = await httpRedirectFetch(fetchParams, response)
  22219. } else {
  22220. assert(false)
  22221. }
  22222. }
  22223. // 9. Set response’s timing info to timingInfo.
  22224. response.timingInfo = timingInfo
  22225. // 10. Return response.
  22226. return response
  22227. }
  22228. // https://fetch.spec.whatwg.org/#http-redirect-fetch
  22229. function httpRedirectFetch (fetchParams, response) {
  22230. // 1. Let request be fetchParams’s request.
  22231. const request = fetchParams.request
  22232. // 2. Let actualResponse be response, if response is not a filtered response,
  22233. // and response’s internal response otherwise.
  22234. const actualResponse = response.internalResponse
  22235. ? response.internalResponse
  22236. : response
  22237. // 3. Let locationURL be actualResponse’s location URL given request’s current
  22238. // URL’s fragment.
  22239. let locationURL
  22240. try {
  22241. locationURL = responseLocationURL(
  22242. actualResponse,
  22243. requestCurrentURL(request).hash
  22244. )
  22245. // 4. If locationURL is null, then return response.
  22246. if (locationURL == null) {
  22247. return response
  22248. }
  22249. } catch (err) {
  22250. // 5. If locationURL is failure, then return a network error.
  22251. return Promise.resolve(makeNetworkError(err))
  22252. }
  22253. // 6. If locationURL’s scheme is not an HTTP(S) scheme, then return a network
  22254. // error.
  22255. if (!urlIsHttpHttpsScheme(locationURL)) {
  22256. return Promise.resolve(makeNetworkError('URL scheme must be a HTTP(S) scheme'))
  22257. }
  22258. // 7. If request’s redirect count is 20, then return a network error.
  22259. if (request.redirectCount === 20) {
  22260. return Promise.resolve(makeNetworkError('redirect count exceeded'))
  22261. }
  22262. // 8. Increase request’s redirect count by 1.
  22263. request.redirectCount += 1
  22264. // 9. If request’s mode is "cors", locationURL includes credentials, and
  22265. // request’s origin is not same origin with locationURL’s origin, then return
  22266. // a network error.
  22267. if (
  22268. request.mode === 'cors' &&
  22269. (locationURL.username || locationURL.password) &&
  22270. !sameOrigin(request, locationURL)
  22271. ) {
  22272. return Promise.resolve(makeNetworkError('cross origin not allowed for request mode "cors"'))
  22273. }
  22274. // 10. If request’s response tainting is "cors" and locationURL includes
  22275. // credentials, then return a network error.
  22276. if (
  22277. request.responseTainting === 'cors' &&
  22278. (locationURL.username || locationURL.password)
  22279. ) {
  22280. return Promise.resolve(makeNetworkError(
  22281. 'URL cannot contain credentials for request mode "cors"'
  22282. ))
  22283. }
  22284. // 11. If actualResponse’s status is not 303, request’s body is non-null,
  22285. // and request’s body’s source is null, then return a network error.
  22286. if (
  22287. actualResponse.status !== 303 &&
  22288. request.body != null &&
  22289. request.body.source == null
  22290. ) {
  22291. return Promise.resolve(makeNetworkError())
  22292. }
  22293. // 12. If one of the following is true
  22294. // - actualResponse’s status is 301 or 302 and request’s method is `POST`
  22295. // - actualResponse’s status is 303 and request’s method is not `GET` or `HEAD`
  22296. if (
  22297. ([301, 302].includes(actualResponse.status) && request.method === 'POST') ||
  22298. (actualResponse.status === 303 &&
  22299. !GET_OR_HEAD.includes(request.method))
  22300. ) {
  22301. // then:
  22302. // 1. Set request’s method to `GET` and request’s body to null.
  22303. request.method = 'GET'
  22304. request.body = null
  22305. // 2. For each headerName of request-body-header name, delete headerName from
  22306. // request’s header list.
  22307. for (const headerName of requestBodyHeader) {
  22308. request.headersList.delete(headerName)
  22309. }
  22310. }
  22311. // 13. If request’s current URL’s origin is not same origin with locationURL’s
  22312. // origin, then for each headerName of CORS non-wildcard request-header name,
  22313. // delete headerName from request’s header list.
  22314. if (!sameOrigin(requestCurrentURL(request), locationURL)) {
  22315. // https://fetch.spec.whatwg.org/#cors-non-wildcard-request-header-name
  22316. request.headersList.delete('authorization')
  22317. // https://fetch.spec.whatwg.org/#authentication-entries
  22318. request.headersList.delete('proxy-authorization', true)
  22319. // "Cookie" and "Host" are forbidden request-headers, which undici doesn't implement.
  22320. request.headersList.delete('cookie')
  22321. request.headersList.delete('host')
  22322. }
  22323. // 14. If request’s body is non-null, then set request’s body to the first return
  22324. // value of safely extracting request’s body’s source.
  22325. if (request.body != null) {
  22326. assert(request.body.source != null)
  22327. request.body = safelyExtractBody(request.body.source)[0]
  22328. }
  22329. // 15. Let timingInfo be fetchParams’s timing info.
  22330. const timingInfo = fetchParams.timingInfo
  22331. // 16. Set timingInfo’s redirect end time and post-redirect start time to the
  22332. // coarsened shared current time given fetchParams’s cross-origin isolated
  22333. // capability.
  22334. timingInfo.redirectEndTime = timingInfo.postRedirectStartTime =
  22335. coarsenedSharedCurrentTime(fetchParams.crossOriginIsolatedCapability)
  22336. // 17. If timingInfo’s redirect start time is 0, then set timingInfo’s
  22337. // redirect start time to timingInfo’s start time.
  22338. if (timingInfo.redirectStartTime === 0) {
  22339. timingInfo.redirectStartTime = timingInfo.startTime
  22340. }
  22341. // 18. Append locationURL to request’s URL list.
  22342. request.urlList.push(locationURL)
  22343. // 19. Invoke set request’s referrer policy on redirect on request and
  22344. // actualResponse.
  22345. setRequestReferrerPolicyOnRedirect(request, actualResponse)
  22346. // 20. Return the result of running main fetch given fetchParams and true.
  22347. return mainFetch(fetchParams, true)
  22348. }
  22349. // https://fetch.spec.whatwg.org/#http-network-or-cache-fetch
  22350. async function httpNetworkOrCacheFetch (
  22351. fetchParams,
  22352. isAuthenticationFetch = false,
  22353. isNewConnectionFetch = false
  22354. ) {
  22355. // 1. Let request be fetchParams’s request.
  22356. const request = fetchParams.request
  22357. // 2. Let httpFetchParams be null.
  22358. let httpFetchParams = null
  22359. // 3. Let httpRequest be null.
  22360. let httpRequest = null
  22361. // 4. Let response be null.
  22362. let response = null
  22363. // 5. Let storedResponse be null.
  22364. // TODO: cache
  22365. // 6. Let httpCache be null.
  22366. const httpCache = null
  22367. // 7. Let the revalidatingFlag be unset.
  22368. const revalidatingFlag = false
  22369. // 8. Run these steps, but abort when the ongoing fetch is terminated:
  22370. // 1. If request’s window is "no-window" and request’s redirect mode is
  22371. // "error", then set httpFetchParams to fetchParams and httpRequest to
  22372. // request.
  22373. if (request.window === 'no-window' && request.redirect === 'error') {
  22374. httpFetchParams = fetchParams
  22375. httpRequest = request
  22376. } else {
  22377. // Otherwise:
  22378. // 1. Set httpRequest to a clone of request.
  22379. httpRequest = makeRequest(request)
  22380. // 2. Set httpFetchParams to a copy of fetchParams.
  22381. httpFetchParams = { ...fetchParams }
  22382. // 3. Set httpFetchParams’s request to httpRequest.
  22383. httpFetchParams.request = httpRequest
  22384. }
  22385. // 3. Let includeCredentials be true if one of
  22386. const includeCredentials =
  22387. request.credentials === 'include' ||
  22388. (request.credentials === 'same-origin' &&
  22389. request.responseTainting === 'basic')
  22390. // 4. Let contentLength be httpRequest’s body’s length, if httpRequest’s
  22391. // body is non-null; otherwise null.
  22392. const contentLength = httpRequest.body ? httpRequest.body.length : null
  22393. // 5. Let contentLengthHeaderValue be null.
  22394. let contentLengthHeaderValue = null
  22395. // 6. If httpRequest’s body is null and httpRequest’s method is `POST` or
  22396. // `PUT`, then set contentLengthHeaderValue to `0`.
  22397. if (
  22398. httpRequest.body == null &&
  22399. ['POST', 'PUT'].includes(httpRequest.method)
  22400. ) {
  22401. contentLengthHeaderValue = '0'
  22402. }
  22403. // 7. If contentLength is non-null, then set contentLengthHeaderValue to
  22404. // contentLength, serialized and isomorphic encoded.
  22405. if (contentLength != null) {
  22406. contentLengthHeaderValue = isomorphicEncode(`${contentLength}`)
  22407. }
  22408. // 8. If contentLengthHeaderValue is non-null, then append
  22409. // `Content-Length`/contentLengthHeaderValue to httpRequest’s header
  22410. // list.
  22411. if (contentLengthHeaderValue != null) {
  22412. httpRequest.headersList.append('content-length', contentLengthHeaderValue)
  22413. }
  22414. // 9. If contentLengthHeaderValue is non-null, then append (`Content-Length`,
  22415. // contentLengthHeaderValue) to httpRequest’s header list.
  22416. // 10. If contentLength is non-null and httpRequest’s keepalive is true,
  22417. // then:
  22418. if (contentLength != null && httpRequest.keepalive) {
  22419. // NOTE: keepalive is a noop outside of browser context.
  22420. }
  22421. // 11. If httpRequest’s referrer is a URL, then append
  22422. // `Referer`/httpRequest’s referrer, serialized and isomorphic encoded,
  22423. // to httpRequest’s header list.
  22424. if (httpRequest.referrer instanceof URL) {
  22425. httpRequest.headersList.append('referer', isomorphicEncode(httpRequest.referrer.href))
  22426. }
  22427. // 12. Append a request `Origin` header for httpRequest.
  22428. appendRequestOriginHeader(httpRequest)
  22429. // 13. Append the Fetch metadata headers for httpRequest. [FETCH-METADATA]
  22430. appendFetchMetadata(httpRequest)
  22431. // 14. If httpRequest’s header list does not contain `User-Agent`, then
  22432. // user agents should append `User-Agent`/default `User-Agent` value to
  22433. // httpRequest’s header list.
  22434. if (!httpRequest.headersList.contains('user-agent')) {
  22435. httpRequest.headersList.append('user-agent', typeof esbuildDetection === 'undefined' ? 'undici' : 'node')
  22436. }
  22437. // 15. If httpRequest’s cache mode is "default" and httpRequest’s header
  22438. // list contains `If-Modified-Since`, `If-None-Match`,
  22439. // `If-Unmodified-Since`, `If-Match`, or `If-Range`, then set
  22440. // httpRequest’s cache mode to "no-store".
  22441. if (
  22442. httpRequest.cache === 'default' &&
  22443. (httpRequest.headersList.contains('if-modified-since') ||
  22444. httpRequest.headersList.contains('if-none-match') ||
  22445. httpRequest.headersList.contains('if-unmodified-since') ||
  22446. httpRequest.headersList.contains('if-match') ||
  22447. httpRequest.headersList.contains('if-range'))
  22448. ) {
  22449. httpRequest.cache = 'no-store'
  22450. }
  22451. // 16. If httpRequest’s cache mode is "no-cache", httpRequest’s prevent
  22452. // no-cache cache-control header modification flag is unset, and
  22453. // httpRequest’s header list does not contain `Cache-Control`, then append
  22454. // `Cache-Control`/`max-age=0` to httpRequest’s header list.
  22455. if (
  22456. httpRequest.cache === 'no-cache' &&
  22457. !httpRequest.preventNoCacheCacheControlHeaderModification &&
  22458. !httpRequest.headersList.contains('cache-control')
  22459. ) {
  22460. httpRequest.headersList.append('cache-control', 'max-age=0')
  22461. }
  22462. // 17. If httpRequest’s cache mode is "no-store" or "reload", then:
  22463. if (httpRequest.cache === 'no-store' || httpRequest.cache === 'reload') {
  22464. // 1. If httpRequest’s header list does not contain `Pragma`, then append
  22465. // `Pragma`/`no-cache` to httpRequest’s header list.
  22466. if (!httpRequest.headersList.contains('pragma')) {
  22467. httpRequest.headersList.append('pragma', 'no-cache')
  22468. }
  22469. // 2. If httpRequest’s header list does not contain `Cache-Control`,
  22470. // then append `Cache-Control`/`no-cache` to httpRequest’s header list.
  22471. if (!httpRequest.headersList.contains('cache-control')) {
  22472. httpRequest.headersList.append('cache-control', 'no-cache')
  22473. }
  22474. }
  22475. // 18. If httpRequest’s header list contains `Range`, then append
  22476. // `Accept-Encoding`/`identity` to httpRequest’s header list.
  22477. if (httpRequest.headersList.contains('range')) {
  22478. httpRequest.headersList.append('accept-encoding', 'identity')
  22479. }
  22480. // 19. Modify httpRequest’s header list per HTTP. Do not append a given
  22481. // header if httpRequest’s header list contains that header’s name.
  22482. // TODO: https://github.com/whatwg/fetch/issues/1285#issuecomment-896560129
  22483. if (!httpRequest.headersList.contains('accept-encoding')) {
  22484. if (urlHasHttpsScheme(requestCurrentURL(httpRequest))) {
  22485. httpRequest.headersList.append('accept-encoding', 'br, gzip, deflate')
  22486. } else {
  22487. httpRequest.headersList.append('accept-encoding', 'gzip, deflate')
  22488. }
  22489. }
  22490. httpRequest.headersList.delete('host')
  22491. // 20. If includeCredentials is true, then:
  22492. if (includeCredentials) {
  22493. // 1. If the user agent is not configured to block cookies for httpRequest
  22494. // (see section 7 of [COOKIES]), then:
  22495. // TODO: credentials
  22496. // 2. If httpRequest’s header list does not contain `Authorization`, then:
  22497. // TODO: credentials
  22498. }
  22499. // 21. If there’s a proxy-authentication entry, use it as appropriate.
  22500. // TODO: proxy-authentication
  22501. // 22. Set httpCache to the result of determining the HTTP cache
  22502. // partition, given httpRequest.
  22503. // TODO: cache
  22504. // 23. If httpCache is null, then set httpRequest’s cache mode to
  22505. // "no-store".
  22506. if (httpCache == null) {
  22507. httpRequest.cache = 'no-store'
  22508. }
  22509. // 24. If httpRequest’s cache mode is neither "no-store" nor "reload",
  22510. // then:
  22511. if (httpRequest.mode !== 'no-store' && httpRequest.mode !== 'reload') {
  22512. // TODO: cache
  22513. }
  22514. // 9. If aborted, then return the appropriate network error for fetchParams.
  22515. // TODO
  22516. // 10. If response is null, then:
  22517. if (response == null) {
  22518. // 1. If httpRequest’s cache mode is "only-if-cached", then return a
  22519. // network error.
  22520. if (httpRequest.mode === 'only-if-cached') {
  22521. return makeNetworkError('only if cached')
  22522. }
  22523. // 2. Let forwardResponse be the result of running HTTP-network fetch
  22524. // given httpFetchParams, includeCredentials, and isNewConnectionFetch.
  22525. const forwardResponse = await httpNetworkFetch(
  22526. httpFetchParams,
  22527. includeCredentials,
  22528. isNewConnectionFetch
  22529. )
  22530. // 3. If httpRequest’s method is unsafe and forwardResponse’s status is
  22531. // in the range 200 to 399, inclusive, invalidate appropriate stored
  22532. // responses in httpCache, as per the "Invalidation" chapter of HTTP
  22533. // Caching, and set storedResponse to null. [HTTP-CACHING]
  22534. if (
  22535. !safeMethodsSet.has(httpRequest.method) &&
  22536. forwardResponse.status >= 200 &&
  22537. forwardResponse.status <= 399
  22538. ) {
  22539. // TODO: cache
  22540. }
  22541. // 4. If the revalidatingFlag is set and forwardResponse’s status is 304,
  22542. // then:
  22543. if (revalidatingFlag && forwardResponse.status === 304) {
  22544. // TODO: cache
  22545. }
  22546. // 5. If response is null, then:
  22547. if (response == null) {
  22548. // 1. Set response to forwardResponse.
  22549. response = forwardResponse
  22550. // 2. Store httpRequest and forwardResponse in httpCache, as per the
  22551. // "Storing Responses in Caches" chapter of HTTP Caching. [HTTP-CACHING]
  22552. // TODO: cache
  22553. }
  22554. }
  22555. // 11. Set response’s URL list to a clone of httpRequest’s URL list.
  22556. response.urlList = [...httpRequest.urlList]
  22557. // 12. If httpRequest’s header list contains `Range`, then set response’s
  22558. // range-requested flag.
  22559. if (httpRequest.headersList.contains('range')) {
  22560. response.rangeRequested = true
  22561. }
  22562. // 13. Set response’s request-includes-credentials to includeCredentials.
  22563. response.requestIncludesCredentials = includeCredentials
  22564. // 14. If response’s status is 401, httpRequest’s response tainting is not
  22565. // "cors", includeCredentials is true, and request’s window is an environment
  22566. // settings object, then:
  22567. // TODO
  22568. // 15. If response’s status is 407, then:
  22569. if (response.status === 407) {
  22570. // 1. If request’s window is "no-window", then return a network error.
  22571. if (request.window === 'no-window') {
  22572. return makeNetworkError()
  22573. }
  22574. // 2. ???
  22575. // 3. If fetchParams is canceled, then return the appropriate network error for fetchParams.
  22576. if (isCancelled(fetchParams)) {
  22577. return makeAppropriateNetworkError(fetchParams)
  22578. }
  22579. // 4. Prompt the end user as appropriate in request’s window and store
  22580. // the result as a proxy-authentication entry. [HTTP-AUTH]
  22581. // TODO: Invoke some kind of callback?
  22582. // 5. Set response to the result of running HTTP-network-or-cache fetch given
  22583. // fetchParams.
  22584. // TODO
  22585. return makeNetworkError('proxy authentication required')
  22586. }
  22587. // 16. If all of the following are true
  22588. if (
  22589. // response’s status is 421
  22590. response.status === 421 &&
  22591. // isNewConnectionFetch is false
  22592. !isNewConnectionFetch &&
  22593. // request’s body is null, or request’s body is non-null and request’s body’s source is non-null
  22594. (request.body == null || request.body.source != null)
  22595. ) {
  22596. // then:
  22597. // 1. If fetchParams is canceled, then return the appropriate network error for fetchParams.
  22598. if (isCancelled(fetchParams)) {
  22599. return makeAppropriateNetworkError(fetchParams)
  22600. }
  22601. // 2. Set response to the result of running HTTP-network-or-cache
  22602. // fetch given fetchParams, isAuthenticationFetch, and true.
  22603. // TODO (spec): The spec doesn't specify this but we need to cancel
  22604. // the active response before we can start a new one.
  22605. // https://github.com/whatwg/fetch/issues/1293
  22606. fetchParams.controller.connection.destroy()
  22607. response = await httpNetworkOrCacheFetch(
  22608. fetchParams,
  22609. isAuthenticationFetch,
  22610. true
  22611. )
  22612. }
  22613. // 17. If isAuthenticationFetch is true, then create an authentication entry
  22614. if (isAuthenticationFetch) {
  22615. // TODO
  22616. }
  22617. // 18. Return response.
  22618. return response
  22619. }
  22620. // https://fetch.spec.whatwg.org/#http-network-fetch
  22621. async function httpNetworkFetch (
  22622. fetchParams,
  22623. includeCredentials = false,
  22624. forceNewConnection = false
  22625. ) {
  22626. assert(!fetchParams.controller.connection || fetchParams.controller.connection.destroyed)
  22627. fetchParams.controller.connection = {
  22628. abort: null,
  22629. destroyed: false,
  22630. destroy (err) {
  22631. if (!this.destroyed) {
  22632. this.destroyed = true
  22633. this.abort?.(err ?? new DOMException('The operation was aborted.', 'AbortError'))
  22634. }
  22635. }
  22636. }
  22637. // 1. Let request be fetchParams’s request.
  22638. const request = fetchParams.request
  22639. // 2. Let response be null.
  22640. let response = null
  22641. // 3. Let timingInfo be fetchParams’s timing info.
  22642. const timingInfo = fetchParams.timingInfo
  22643. // 4. Let httpCache be the result of determining the HTTP cache partition,
  22644. // given request.
  22645. // TODO: cache
  22646. const httpCache = null
  22647. // 5. If httpCache is null, then set request’s cache mode to "no-store".
  22648. if (httpCache == null) {
  22649. request.cache = 'no-store'
  22650. }
  22651. // 6. Let networkPartitionKey be the result of determining the network
  22652. // partition key given request.
  22653. // TODO
  22654. // 7. Let newConnection be "yes" if forceNewConnection is true; otherwise
  22655. // "no".
  22656. const newConnection = forceNewConnection ? 'yes' : 'no' // eslint-disable-line no-unused-vars
  22657. // 8. Switch on request’s mode:
  22658. if (request.mode === 'websocket') {
  22659. // Let connection be the result of obtaining a WebSocket connection,
  22660. // given request’s current URL.
  22661. // TODO
  22662. } else {
  22663. // Let connection be the result of obtaining a connection, given
  22664. // networkPartitionKey, request’s current URL’s origin,
  22665. // includeCredentials, and forceNewConnection.
  22666. // TODO
  22667. }
  22668. // 9. Run these steps, but abort when the ongoing fetch is terminated:
  22669. // 1. If connection is failure, then return a network error.
  22670. // 2. Set timingInfo’s final connection timing info to the result of
  22671. // calling clamp and coarsen connection timing info with connection’s
  22672. // timing info, timingInfo’s post-redirect start time, and fetchParams’s
  22673. // cross-origin isolated capability.
  22674. // 3. If connection is not an HTTP/2 connection, request’s body is non-null,
  22675. // and request’s body’s source is null, then append (`Transfer-Encoding`,
  22676. // `chunked`) to request’s header list.
  22677. // 4. Set timingInfo’s final network-request start time to the coarsened
  22678. // shared current time given fetchParams’s cross-origin isolated
  22679. // capability.
  22680. // 5. Set response to the result of making an HTTP request over connection
  22681. // using request with the following caveats:
  22682. // - Follow the relevant requirements from HTTP. [HTTP] [HTTP-SEMANTICS]
  22683. // [HTTP-COND] [HTTP-CACHING] [HTTP-AUTH]
  22684. // - If request’s body is non-null, and request’s body’s source is null,
  22685. // then the user agent may have a buffer of up to 64 kibibytes and store
  22686. // a part of request’s body in that buffer. If the user agent reads from
  22687. // request’s body beyond that buffer’s size and the user agent needs to
  22688. // resend request, then instead return a network error.
  22689. // - Set timingInfo’s final network-response start time to the coarsened
  22690. // shared current time given fetchParams’s cross-origin isolated capability,
  22691. // immediately after the user agent’s HTTP parser receives the first byte
  22692. // of the response (e.g., frame header bytes for HTTP/2 or response status
  22693. // line for HTTP/1.x).
  22694. // - Wait until all the headers are transmitted.
  22695. // - Any responses whose status is in the range 100 to 199, inclusive,
  22696. // and is not 101, are to be ignored, except for the purposes of setting
  22697. // timingInfo’s final network-response start time above.
  22698. // - If request’s header list contains `Transfer-Encoding`/`chunked` and
  22699. // response is transferred via HTTP/1.0 or older, then return a network
  22700. // error.
  22701. // - If the HTTP request results in a TLS client certificate dialog, then:
  22702. // 1. If request’s window is an environment settings object, make the
  22703. // dialog available in request’s window.
  22704. // 2. Otherwise, return a network error.
  22705. // To transmit request’s body body, run these steps:
  22706. let requestBody = null
  22707. // 1. If body is null and fetchParams’s process request end-of-body is
  22708. // non-null, then queue a fetch task given fetchParams’s process request
  22709. // end-of-body and fetchParams’s task destination.
  22710. if (request.body == null && fetchParams.processRequestEndOfBody) {
  22711. queueMicrotask(() => fetchParams.processRequestEndOfBody())
  22712. } else if (request.body != null) {
  22713. // 2. Otherwise, if body is non-null:
  22714. // 1. Let processBodyChunk given bytes be these steps:
  22715. const processBodyChunk = async function * (bytes) {
  22716. // 1. If the ongoing fetch is terminated, then abort these steps.
  22717. if (isCancelled(fetchParams)) {
  22718. return
  22719. }
  22720. // 2. Run this step in parallel: transmit bytes.
  22721. yield bytes
  22722. // 3. If fetchParams’s process request body is non-null, then run
  22723. // fetchParams’s process request body given bytes’s length.
  22724. fetchParams.processRequestBodyChunkLength?.(bytes.byteLength)
  22725. }
  22726. // 2. Let processEndOfBody be these steps:
  22727. const processEndOfBody = () => {
  22728. // 1. If fetchParams is canceled, then abort these steps.
  22729. if (isCancelled(fetchParams)) {
  22730. return
  22731. }
  22732. // 2. If fetchParams’s process request end-of-body is non-null,
  22733. // then run fetchParams’s process request end-of-body.
  22734. if (fetchParams.processRequestEndOfBody) {
  22735. fetchParams.processRequestEndOfBody()
  22736. }
  22737. }
  22738. // 3. Let processBodyError given e be these steps:
  22739. const processBodyError = (e) => {
  22740. // 1. If fetchParams is canceled, then abort these steps.
  22741. if (isCancelled(fetchParams)) {
  22742. return
  22743. }
  22744. // 2. If e is an "AbortError" DOMException, then abort fetchParams’s controller.
  22745. if (e.name === 'AbortError') {
  22746. fetchParams.controller.abort()
  22747. } else {
  22748. fetchParams.controller.terminate(e)
  22749. }
  22750. }
  22751. // 4. Incrementally read request’s body given processBodyChunk, processEndOfBody,
  22752. // processBodyError, and fetchParams’s task destination.
  22753. requestBody = (async function * () {
  22754. try {
  22755. for await (const bytes of request.body.stream) {
  22756. yield * processBodyChunk(bytes)
  22757. }
  22758. processEndOfBody()
  22759. } catch (err) {
  22760. processBodyError(err)
  22761. }
  22762. })()
  22763. }
  22764. try {
  22765. // socket is only provided for websockets
  22766. const { body, status, statusText, headersList, socket } = await dispatch({ body: requestBody })
  22767. if (socket) {
  22768. response = makeResponse({ status, statusText, headersList, socket })
  22769. } else {
  22770. const iterator = body[Symbol.asyncIterator]()
  22771. fetchParams.controller.next = () => iterator.next()
  22772. response = makeResponse({ status, statusText, headersList })
  22773. }
  22774. } catch (err) {
  22775. // 10. If aborted, then:
  22776. if (err.name === 'AbortError') {
  22777. // 1. If connection uses HTTP/2, then transmit an RST_STREAM frame.
  22778. fetchParams.controller.connection.destroy()
  22779. // 2. Return the appropriate network error for fetchParams.
  22780. return makeAppropriateNetworkError(fetchParams, err)
  22781. }
  22782. return makeNetworkError(err)
  22783. }
  22784. // 11. Let pullAlgorithm be an action that resumes the ongoing fetch
  22785. // if it is suspended.
  22786. const pullAlgorithm = () => {
  22787. fetchParams.controller.resume()
  22788. }
  22789. // 12. Let cancelAlgorithm be an algorithm that aborts fetchParams’s
  22790. // controller with reason, given reason.
  22791. const cancelAlgorithm = (reason) => {
  22792. fetchParams.controller.abort(reason)
  22793. }
  22794. // 13. Let highWaterMark be a non-negative, non-NaN number, chosen by
  22795. // the user agent.
  22796. // TODO
  22797. // 14. Let sizeAlgorithm be an algorithm that accepts a chunk object
  22798. // and returns a non-negative, non-NaN, non-infinite number, chosen by the user agent.
  22799. // TODO
  22800. // 15. Let stream be a new ReadableStream.
  22801. // 16. Set up stream with pullAlgorithm set to pullAlgorithm,
  22802. // cancelAlgorithm set to cancelAlgorithm, highWaterMark set to
  22803. // highWaterMark, and sizeAlgorithm set to sizeAlgorithm.
  22804. if (!ReadableStream) {
  22805. ReadableStream = (__nccwpck_require__(5356).ReadableStream)
  22806. }
  22807. const stream = new ReadableStream(
  22808. {
  22809. async start (controller) {
  22810. fetchParams.controller.controller = controller
  22811. },
  22812. async pull (controller) {
  22813. await pullAlgorithm(controller)
  22814. },
  22815. async cancel (reason) {
  22816. await cancelAlgorithm(reason)
  22817. }
  22818. },
  22819. {
  22820. highWaterMark: 0,
  22821. size () {
  22822. return 1
  22823. }
  22824. }
  22825. )
  22826. // 17. Run these steps, but abort when the ongoing fetch is terminated:
  22827. // 1. Set response’s body to a new body whose stream is stream.
  22828. response.body = { stream }
  22829. // 2. If response is not a network error and request’s cache mode is
  22830. // not "no-store", then update response in httpCache for request.
  22831. // TODO
  22832. // 3. If includeCredentials is true and the user agent is not configured
  22833. // to block cookies for request (see section 7 of [COOKIES]), then run the
  22834. // "set-cookie-string" parsing algorithm (see section 5.2 of [COOKIES]) on
  22835. // the value of each header whose name is a byte-case-insensitive match for
  22836. // `Set-Cookie` in response’s header list, if any, and request’s current URL.
  22837. // TODO
  22838. // 18. If aborted, then:
  22839. // TODO
  22840. // 19. Run these steps in parallel:
  22841. // 1. Run these steps, but abort when fetchParams is canceled:
  22842. fetchParams.controller.on('terminated', onAborted)
  22843. fetchParams.controller.resume = async () => {
  22844. // 1. While true
  22845. while (true) {
  22846. // 1-3. See onData...
  22847. // 4. Set bytes to the result of handling content codings given
  22848. // codings and bytes.
  22849. let bytes
  22850. let isFailure
  22851. try {
  22852. const { done, value } = await fetchParams.controller.next()
  22853. if (isAborted(fetchParams)) {
  22854. break
  22855. }
  22856. bytes = done ? undefined : value
  22857. } catch (err) {
  22858. if (fetchParams.controller.ended && !timingInfo.encodedBodySize) {
  22859. // zlib doesn't like empty streams.
  22860. bytes = undefined
  22861. } else {
  22862. bytes = err
  22863. // err may be propagated from the result of calling readablestream.cancel,
  22864. // which might not be an error. https://github.com/nodejs/undici/issues/2009
  22865. isFailure = true
  22866. }
  22867. }
  22868. if (bytes === undefined) {
  22869. // 2. Otherwise, if the bytes transmission for response’s message
  22870. // body is done normally and stream is readable, then close
  22871. // stream, finalize response for fetchParams and response, and
  22872. // abort these in-parallel steps.
  22873. readableStreamClose(fetchParams.controller.controller)
  22874. finalizeResponse(fetchParams, response)
  22875. return
  22876. }
  22877. // 5. Increase timingInfo’s decoded body size by bytes’s length.
  22878. timingInfo.decodedBodySize += bytes?.byteLength ?? 0
  22879. // 6. If bytes is failure, then terminate fetchParams’s controller.
  22880. if (isFailure) {
  22881. fetchParams.controller.terminate(bytes)
  22882. return
  22883. }
  22884. // 7. Enqueue a Uint8Array wrapping an ArrayBuffer containing bytes
  22885. // into stream.
  22886. fetchParams.controller.controller.enqueue(new Uint8Array(bytes))
  22887. // 8. If stream is errored, then terminate the ongoing fetch.
  22888. if (isErrored(stream)) {
  22889. fetchParams.controller.terminate()
  22890. return
  22891. }
  22892. // 9. If stream doesn’t need more data ask the user agent to suspend
  22893. // the ongoing fetch.
  22894. if (!fetchParams.controller.controller.desiredSize) {
  22895. return
  22896. }
  22897. }
  22898. }
  22899. // 2. If aborted, then:
  22900. function onAborted (reason) {
  22901. // 2. If fetchParams is aborted, then:
  22902. if (isAborted(fetchParams)) {
  22903. // 1. Set response’s aborted flag.
  22904. response.aborted = true
  22905. // 2. If stream is readable, then error stream with the result of
  22906. // deserialize a serialized abort reason given fetchParams’s
  22907. // controller’s serialized abort reason and an
  22908. // implementation-defined realm.
  22909. if (isReadable(stream)) {
  22910. fetchParams.controller.controller.error(
  22911. fetchParams.controller.serializedAbortReason
  22912. )
  22913. }
  22914. } else {
  22915. // 3. Otherwise, if stream is readable, error stream with a TypeError.
  22916. if (isReadable(stream)) {
  22917. fetchParams.controller.controller.error(new TypeError('terminated', {
  22918. cause: isErrorLike(reason) ? reason : undefined
  22919. }))
  22920. }
  22921. }
  22922. // 4. If connection uses HTTP/2, then transmit an RST_STREAM frame.
  22923. // 5. Otherwise, the user agent should close connection unless it would be bad for performance to do so.
  22924. fetchParams.controller.connection.destroy()
  22925. }
  22926. // 20. Return response.
  22927. return response
  22928. async function dispatch ({ body }) {
  22929. const url = requestCurrentURL(request)
  22930. /** @type {import('../..').Agent} */
  22931. const agent = fetchParams.controller.dispatcher
  22932. return new Promise((resolve, reject) => agent.dispatch(
  22933. {
  22934. path: url.pathname + url.search,
  22935. origin: url.origin,
  22936. method: request.method,
  22937. body: fetchParams.controller.dispatcher.isMockActive ? request.body && (request.body.source || request.body.stream) : body,
  22938. headers: request.headersList.entries,
  22939. maxRedirections: 0,
  22940. upgrade: request.mode === 'websocket' ? 'websocket' : undefined
  22941. },
  22942. {
  22943. body: null,
  22944. abort: null,
  22945. onConnect (abort) {
  22946. // TODO (fix): Do we need connection here?
  22947. const { connection } = fetchParams.controller
  22948. if (connection.destroyed) {
  22949. abort(new DOMException('The operation was aborted.', 'AbortError'))
  22950. } else {
  22951. fetchParams.controller.on('terminated', abort)
  22952. this.abort = connection.abort = abort
  22953. }
  22954. },
  22955. onHeaders (status, headersList, resume, statusText) {
  22956. if (status < 200) {
  22957. return
  22958. }
  22959. let codings = []
  22960. let location = ''
  22961. const headers = new Headers()
  22962. // For H2, the headers are a plain JS object
  22963. // We distinguish between them and iterate accordingly
  22964. if (Array.isArray(headersList)) {
  22965. for (let n = 0; n < headersList.length; n += 2) {
  22966. const key = headersList[n + 0].toString('latin1')
  22967. const val = headersList[n + 1].toString('latin1')
  22968. if (key.toLowerCase() === 'content-encoding') {
  22969. // https://www.rfc-editor.org/rfc/rfc7231#section-3.1.2.1
  22970. // "All content-coding values are case-insensitive..."
  22971. codings = val.toLowerCase().split(',').map((x) => x.trim())
  22972. } else if (key.toLowerCase() === 'location') {
  22973. location = val
  22974. }
  22975. headers[kHeadersList].append(key, val)
  22976. }
  22977. } else {
  22978. const keys = Object.keys(headersList)
  22979. for (const key of keys) {
  22980. const val = headersList[key]
  22981. if (key.toLowerCase() === 'content-encoding') {
  22982. // https://www.rfc-editor.org/rfc/rfc7231#section-3.1.2.1
  22983. // "All content-coding values are case-insensitive..."
  22984. codings = val.toLowerCase().split(',').map((x) => x.trim()).reverse()
  22985. } else if (key.toLowerCase() === 'location') {
  22986. location = val
  22987. }
  22988. headers[kHeadersList].append(key, val)
  22989. }
  22990. }
  22991. this.body = new Readable({ read: resume })
  22992. const decoders = []
  22993. const willFollow = request.redirect === 'follow' &&
  22994. location &&
  22995. redirectStatusSet.has(status)
  22996. // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Encoding
  22997. if (request.method !== 'HEAD' && request.method !== 'CONNECT' && !nullBodyStatus.includes(status) && !willFollow) {
  22998. for (const coding of codings) {
  22999. // https://www.rfc-editor.org/rfc/rfc9112.html#section-7.2
  23000. if (coding === 'x-gzip' || coding === 'gzip') {
  23001. decoders.push(zlib.createGunzip({
  23002. // Be less strict when decoding compressed responses, since sometimes
  23003. // servers send slightly invalid responses that are still accepted
  23004. // by common browsers.
  23005. // Always using Z_SYNC_FLUSH is what cURL does.
  23006. flush: zlib.constants.Z_SYNC_FLUSH,
  23007. finishFlush: zlib.constants.Z_SYNC_FLUSH
  23008. }))
  23009. } else if (coding === 'deflate') {
  23010. decoders.push(zlib.createInflate())
  23011. } else if (coding === 'br') {
  23012. decoders.push(zlib.createBrotliDecompress())
  23013. } else {
  23014. decoders.length = 0
  23015. break
  23016. }
  23017. }
  23018. }
  23019. resolve({
  23020. status,
  23021. statusText,
  23022. headersList: headers[kHeadersList],
  23023. body: decoders.length
  23024. ? pipeline(this.body, ...decoders, () => { })
  23025. : this.body.on('error', () => {})
  23026. })
  23027. return true
  23028. },
  23029. onData (chunk) {
  23030. if (fetchParams.controller.dump) {
  23031. return
  23032. }
  23033. // 1. If one or more bytes have been transmitted from response’s
  23034. // message body, then:
  23035. // 1. Let bytes be the transmitted bytes.
  23036. const bytes = chunk
  23037. // 2. Let codings be the result of extracting header list values
  23038. // given `Content-Encoding` and response’s header list.
  23039. // See pullAlgorithm.
  23040. // 3. Increase timingInfo’s encoded body size by bytes’s length.
  23041. timingInfo.encodedBodySize += bytes.byteLength
  23042. // 4. See pullAlgorithm...
  23043. return this.body.push(bytes)
  23044. },
  23045. onComplete () {
  23046. if (this.abort) {
  23047. fetchParams.controller.off('terminated', this.abort)
  23048. }
  23049. fetchParams.controller.ended = true
  23050. this.body.push(null)
  23051. },
  23052. onError (error) {
  23053. if (this.abort) {
  23054. fetchParams.controller.off('terminated', this.abort)
  23055. }
  23056. this.body?.destroy(error)
  23057. fetchParams.controller.terminate(error)
  23058. reject(error)
  23059. },
  23060. onUpgrade (status, headersList, socket) {
  23061. if (status !== 101) {
  23062. return
  23063. }
  23064. const headers = new Headers()
  23065. for (let n = 0; n < headersList.length; n += 2) {
  23066. const key = headersList[n + 0].toString('latin1')
  23067. const val = headersList[n + 1].toString('latin1')
  23068. headers[kHeadersList].append(key, val)
  23069. }
  23070. resolve({
  23071. status,
  23072. statusText: STATUS_CODES[status],
  23073. headersList: headers[kHeadersList],
  23074. socket
  23075. })
  23076. return true
  23077. }
  23078. }
  23079. ))
  23080. }
  23081. }
  23082. module.exports = {
  23083. fetch,
  23084. Fetch,
  23085. fetching,
  23086. finalizeAndReportTiming
  23087. }
  23088. /***/ }),
  23089. /***/ 8359:
  23090. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  23091. "use strict";
  23092. /* globals AbortController */
  23093. const { extractBody, mixinBody, cloneBody } = __nccwpck_require__(9990)
  23094. const { Headers, fill: fillHeaders, HeadersList } = __nccwpck_require__(554)
  23095. const { FinalizationRegistry } = __nccwpck_require__(6436)()
  23096. const util = __nccwpck_require__(3983)
  23097. const {
  23098. isValidHTTPToken,
  23099. sameOrigin,
  23100. normalizeMethod,
  23101. makePolicyContainer,
  23102. normalizeMethodRecord
  23103. } = __nccwpck_require__(2538)
  23104. const {
  23105. forbiddenMethodsSet,
  23106. corsSafeListedMethodsSet,
  23107. referrerPolicy,
  23108. requestRedirect,
  23109. requestMode,
  23110. requestCredentials,
  23111. requestCache,
  23112. requestDuplex
  23113. } = __nccwpck_require__(1037)
  23114. const { kEnumerableProperty } = util
  23115. const { kHeaders, kSignal, kState, kGuard, kRealm } = __nccwpck_require__(5861)
  23116. const { webidl } = __nccwpck_require__(1744)
  23117. const { getGlobalOrigin } = __nccwpck_require__(1246)
  23118. const { URLSerializer } = __nccwpck_require__(685)
  23119. const { kHeadersList, kConstruct } = __nccwpck_require__(2785)
  23120. const assert = __nccwpck_require__(9491)
  23121. const { getMaxListeners, setMaxListeners, getEventListeners, defaultMaxListeners } = __nccwpck_require__(2361)
  23122. let TransformStream = globalThis.TransformStream
  23123. const kAbortController = Symbol('abortController')
  23124. const requestFinalizer = new FinalizationRegistry(({ signal, abort }) => {
  23125. signal.removeEventListener('abort', abort)
  23126. })
  23127. // https://fetch.spec.whatwg.org/#request-class
  23128. class Request {
  23129. // https://fetch.spec.whatwg.org/#dom-request
  23130. constructor (input, init = {}) {
  23131. if (input === kConstruct) {
  23132. return
  23133. }
  23134. webidl.argumentLengthCheck(arguments, 1, { header: 'Request constructor' })
  23135. input = webidl.converters.RequestInfo(input)
  23136. init = webidl.converters.RequestInit(init)
  23137. // https://html.spec.whatwg.org/multipage/webappapis.html#environment-settings-object
  23138. this[kRealm] = {
  23139. settingsObject: {
  23140. baseUrl: getGlobalOrigin(),
  23141. get origin () {
  23142. return this.baseUrl?.origin
  23143. },
  23144. policyContainer: makePolicyContainer()
  23145. }
  23146. }
  23147. // 1. Let request be null.
  23148. let request = null
  23149. // 2. Let fallbackMode be null.
  23150. let fallbackMode = null
  23151. // 3. Let baseURL be this’s relevant settings object’s API base URL.
  23152. const baseUrl = this[kRealm].settingsObject.baseUrl
  23153. // 4. Let signal be null.
  23154. let signal = null
  23155. // 5. If input is a string, then:
  23156. if (typeof input === 'string') {
  23157. // 1. Let parsedURL be the result of parsing input with baseURL.
  23158. // 2. If parsedURL is failure, then throw a TypeError.
  23159. let parsedURL
  23160. try {
  23161. parsedURL = new URL(input, baseUrl)
  23162. } catch (err) {
  23163. throw new TypeError('Failed to parse URL from ' + input, { cause: err })
  23164. }
  23165. // 3. If parsedURL includes credentials, then throw a TypeError.
  23166. if (parsedURL.username || parsedURL.password) {
  23167. throw new TypeError(
  23168. 'Request cannot be constructed from a URL that includes credentials: ' +
  23169. input
  23170. )
  23171. }
  23172. // 4. Set request to a new request whose URL is parsedURL.
  23173. request = makeRequest({ urlList: [parsedURL] })
  23174. // 5. Set fallbackMode to "cors".
  23175. fallbackMode = 'cors'
  23176. } else {
  23177. // 6. Otherwise:
  23178. // 7. Assert: input is a Request object.
  23179. assert(input instanceof Request)
  23180. // 8. Set request to input’s request.
  23181. request = input[kState]
  23182. // 9. Set signal to input’s signal.
  23183. signal = input[kSignal]
  23184. }
  23185. // 7. Let origin be this’s relevant settings object’s origin.
  23186. const origin = this[kRealm].settingsObject.origin
  23187. // 8. Let window be "client".
  23188. let window = 'client'
  23189. // 9. If request’s window is an environment settings object and its origin
  23190. // is same origin with origin, then set window to request’s window.
  23191. if (
  23192. request.window?.constructor?.name === 'EnvironmentSettingsObject' &&
  23193. sameOrigin(request.window, origin)
  23194. ) {
  23195. window = request.window
  23196. }
  23197. // 10. If init["window"] exists and is non-null, then throw a TypeError.
  23198. if (init.window != null) {
  23199. throw new TypeError(`'window' option '${window}' must be null`)
  23200. }
  23201. // 11. If init["window"] exists, then set window to "no-window".
  23202. if ('window' in init) {
  23203. window = 'no-window'
  23204. }
  23205. // 12. Set request to a new request with the following properties:
  23206. request = makeRequest({
  23207. // URL request’s URL.
  23208. // undici implementation note: this is set as the first item in request's urlList in makeRequest
  23209. // method request’s method.
  23210. method: request.method,
  23211. // header list A copy of request’s header list.
  23212. // undici implementation note: headersList is cloned in makeRequest
  23213. headersList: request.headersList,
  23214. // unsafe-request flag Set.
  23215. unsafeRequest: request.unsafeRequest,
  23216. // client This’s relevant settings object.
  23217. client: this[kRealm].settingsObject,
  23218. // window window.
  23219. window,
  23220. // priority request’s priority.
  23221. priority: request.priority,
  23222. // origin request’s origin. The propagation of the origin is only significant for navigation requests
  23223. // being handled by a service worker. In this scenario a request can have an origin that is different
  23224. // from the current client.
  23225. origin: request.origin,
  23226. // referrer request’s referrer.
  23227. referrer: request.referrer,
  23228. // referrer policy request’s referrer policy.
  23229. referrerPolicy: request.referrerPolicy,
  23230. // mode request’s mode.
  23231. mode: request.mode,
  23232. // credentials mode request’s credentials mode.
  23233. credentials: request.credentials,
  23234. // cache mode request’s cache mode.
  23235. cache: request.cache,
  23236. // redirect mode request’s redirect mode.
  23237. redirect: request.redirect,
  23238. // integrity metadata request’s integrity metadata.
  23239. integrity: request.integrity,
  23240. // keepalive request’s keepalive.
  23241. keepalive: request.keepalive,
  23242. // reload-navigation flag request’s reload-navigation flag.
  23243. reloadNavigation: request.reloadNavigation,
  23244. // history-navigation flag request’s history-navigation flag.
  23245. historyNavigation: request.historyNavigation,
  23246. // URL list A clone of request’s URL list.
  23247. urlList: [...request.urlList]
  23248. })
  23249. const initHasKey = Object.keys(init).length !== 0
  23250. // 13. If init is not empty, then:
  23251. if (initHasKey) {
  23252. // 1. If request’s mode is "navigate", then set it to "same-origin".
  23253. if (request.mode === 'navigate') {
  23254. request.mode = 'same-origin'
  23255. }
  23256. // 2. Unset request’s reload-navigation flag.
  23257. request.reloadNavigation = false
  23258. // 3. Unset request’s history-navigation flag.
  23259. request.historyNavigation = false
  23260. // 4. Set request’s origin to "client".
  23261. request.origin = 'client'
  23262. // 5. Set request’s referrer to "client"
  23263. request.referrer = 'client'
  23264. // 6. Set request’s referrer policy to the empty string.
  23265. request.referrerPolicy = ''
  23266. // 7. Set request’s URL to request’s current URL.
  23267. request.url = request.urlList[request.urlList.length - 1]
  23268. // 8. Set request’s URL list to « request’s URL ».
  23269. request.urlList = [request.url]
  23270. }
  23271. // 14. If init["referrer"] exists, then:
  23272. if (init.referrer !== undefined) {
  23273. // 1. Let referrer be init["referrer"].
  23274. const referrer = init.referrer
  23275. // 2. If referrer is the empty string, then set request’s referrer to "no-referrer".
  23276. if (referrer === '') {
  23277. request.referrer = 'no-referrer'
  23278. } else {
  23279. // 1. Let parsedReferrer be the result of parsing referrer with
  23280. // baseURL.
  23281. // 2. If parsedReferrer is failure, then throw a TypeError.
  23282. let parsedReferrer
  23283. try {
  23284. parsedReferrer = new URL(referrer, baseUrl)
  23285. } catch (err) {
  23286. throw new TypeError(`Referrer "${referrer}" is not a valid URL.`, { cause: err })
  23287. }
  23288. // 3. If one of the following is true
  23289. // - parsedReferrer’s scheme is "about" and path is the string "client"
  23290. // - parsedReferrer’s origin is not same origin with origin
  23291. // then set request’s referrer to "client".
  23292. if (
  23293. (parsedReferrer.protocol === 'about:' && parsedReferrer.hostname === 'client') ||
  23294. (origin && !sameOrigin(parsedReferrer, this[kRealm].settingsObject.baseUrl))
  23295. ) {
  23296. request.referrer = 'client'
  23297. } else {
  23298. // 4. Otherwise, set request’s referrer to parsedReferrer.
  23299. request.referrer = parsedReferrer
  23300. }
  23301. }
  23302. }
  23303. // 15. If init["referrerPolicy"] exists, then set request’s referrer policy
  23304. // to it.
  23305. if (init.referrerPolicy !== undefined) {
  23306. request.referrerPolicy = init.referrerPolicy
  23307. }
  23308. // 16. Let mode be init["mode"] if it exists, and fallbackMode otherwise.
  23309. let mode
  23310. if (init.mode !== undefined) {
  23311. mode = init.mode
  23312. } else {
  23313. mode = fallbackMode
  23314. }
  23315. // 17. If mode is "navigate", then throw a TypeError.
  23316. if (mode === 'navigate') {
  23317. throw webidl.errors.exception({
  23318. header: 'Request constructor',
  23319. message: 'invalid request mode navigate.'
  23320. })
  23321. }
  23322. // 18. If mode is non-null, set request’s mode to mode.
  23323. if (mode != null) {
  23324. request.mode = mode
  23325. }
  23326. // 19. If init["credentials"] exists, then set request’s credentials mode
  23327. // to it.
  23328. if (init.credentials !== undefined) {
  23329. request.credentials = init.credentials
  23330. }
  23331. // 18. If init["cache"] exists, then set request’s cache mode to it.
  23332. if (init.cache !== undefined) {
  23333. request.cache = init.cache
  23334. }
  23335. // 21. If request’s cache mode is "only-if-cached" and request’s mode is
  23336. // not "same-origin", then throw a TypeError.
  23337. if (request.cache === 'only-if-cached' && request.mode !== 'same-origin') {
  23338. throw new TypeError(
  23339. "'only-if-cached' can be set only with 'same-origin' mode"
  23340. )
  23341. }
  23342. // 22. If init["redirect"] exists, then set request’s redirect mode to it.
  23343. if (init.redirect !== undefined) {
  23344. request.redirect = init.redirect
  23345. }
  23346. // 23. If init["integrity"] exists, then set request’s integrity metadata to it.
  23347. if (init.integrity != null) {
  23348. request.integrity = String(init.integrity)
  23349. }
  23350. // 24. If init["keepalive"] exists, then set request’s keepalive to it.
  23351. if (init.keepalive !== undefined) {
  23352. request.keepalive = Boolean(init.keepalive)
  23353. }
  23354. // 25. If init["method"] exists, then:
  23355. if (init.method !== undefined) {
  23356. // 1. Let method be init["method"].
  23357. let method = init.method
  23358. // 2. If method is not a method or method is a forbidden method, then
  23359. // throw a TypeError.
  23360. if (!isValidHTTPToken(method)) {
  23361. throw new TypeError(`'${method}' is not a valid HTTP method.`)
  23362. }
  23363. if (forbiddenMethodsSet.has(method.toUpperCase())) {
  23364. throw new TypeError(`'${method}' HTTP method is unsupported.`)
  23365. }
  23366. // 3. Normalize method.
  23367. method = normalizeMethodRecord[method] ?? normalizeMethod(method)
  23368. // 4. Set request’s method to method.
  23369. request.method = method
  23370. }
  23371. // 26. If init["signal"] exists, then set signal to it.
  23372. if (init.signal !== undefined) {
  23373. signal = init.signal
  23374. }
  23375. // 27. Set this’s request to request.
  23376. this[kState] = request
  23377. // 28. Set this’s signal to a new AbortSignal object with this’s relevant
  23378. // Realm.
  23379. // TODO: could this be simplified with AbortSignal.any
  23380. // (https://dom.spec.whatwg.org/#dom-abortsignal-any)
  23381. const ac = new AbortController()
  23382. this[kSignal] = ac.signal
  23383. this[kSignal][kRealm] = this[kRealm]
  23384. // 29. If signal is not null, then make this’s signal follow signal.
  23385. if (signal != null) {
  23386. if (
  23387. !signal ||
  23388. typeof signal.aborted !== 'boolean' ||
  23389. typeof signal.addEventListener !== 'function'
  23390. ) {
  23391. throw new TypeError(
  23392. "Failed to construct 'Request': member signal is not of type AbortSignal."
  23393. )
  23394. }
  23395. if (signal.aborted) {
  23396. ac.abort(signal.reason)
  23397. } else {
  23398. // Keep a strong ref to ac while request object
  23399. // is alive. This is needed to prevent AbortController
  23400. // from being prematurely garbage collected.
  23401. // See, https://github.com/nodejs/undici/issues/1926.
  23402. this[kAbortController] = ac
  23403. const acRef = new WeakRef(ac)
  23404. const abort = function () {
  23405. const ac = acRef.deref()
  23406. if (ac !== undefined) {
  23407. ac.abort(this.reason)
  23408. }
  23409. }
  23410. // Third-party AbortControllers may not work with these.
  23411. // See, https://github.com/nodejs/undici/pull/1910#issuecomment-1464495619.
  23412. try {
  23413. // If the max amount of listeners is equal to the default, increase it
  23414. // This is only available in node >= v19.9.0
  23415. if (typeof getMaxListeners === 'function' && getMaxListeners(signal) === defaultMaxListeners) {
  23416. setMaxListeners(100, signal)
  23417. } else if (getEventListeners(signal, 'abort').length >= defaultMaxListeners) {
  23418. setMaxListeners(100, signal)
  23419. }
  23420. } catch {}
  23421. util.addAbortListener(signal, abort)
  23422. requestFinalizer.register(ac, { signal, abort })
  23423. }
  23424. }
  23425. // 30. Set this’s headers to a new Headers object with this’s relevant
  23426. // Realm, whose header list is request’s header list and guard is
  23427. // "request".
  23428. this[kHeaders] = new Headers(kConstruct)
  23429. this[kHeaders][kHeadersList] = request.headersList
  23430. this[kHeaders][kGuard] = 'request'
  23431. this[kHeaders][kRealm] = this[kRealm]
  23432. // 31. If this’s request’s mode is "no-cors", then:
  23433. if (mode === 'no-cors') {
  23434. // 1. If this’s request’s method is not a CORS-safelisted method,
  23435. // then throw a TypeError.
  23436. if (!corsSafeListedMethodsSet.has(request.method)) {
  23437. throw new TypeError(
  23438. `'${request.method} is unsupported in no-cors mode.`
  23439. )
  23440. }
  23441. // 2. Set this’s headers’s guard to "request-no-cors".
  23442. this[kHeaders][kGuard] = 'request-no-cors'
  23443. }
  23444. // 32. If init is not empty, then:
  23445. if (initHasKey) {
  23446. /** @type {HeadersList} */
  23447. const headersList = this[kHeaders][kHeadersList]
  23448. // 1. Let headers be a copy of this’s headers and its associated header
  23449. // list.
  23450. // 2. If init["headers"] exists, then set headers to init["headers"].
  23451. const headers = init.headers !== undefined ? init.headers : new HeadersList(headersList)
  23452. // 3. Empty this’s headers’s header list.
  23453. headersList.clear()
  23454. // 4. If headers is a Headers object, then for each header in its header
  23455. // list, append header’s name/header’s value to this’s headers.
  23456. if (headers instanceof HeadersList) {
  23457. for (const [key, val] of headers) {
  23458. headersList.append(key, val)
  23459. }
  23460. // Note: Copy the `set-cookie` meta-data.
  23461. headersList.cookies = headers.cookies
  23462. } else {
  23463. // 5. Otherwise, fill this’s headers with headers.
  23464. fillHeaders(this[kHeaders], headers)
  23465. }
  23466. }
  23467. // 33. Let inputBody be input’s request’s body if input is a Request
  23468. // object; otherwise null.
  23469. const inputBody = input instanceof Request ? input[kState].body : null
  23470. // 34. If either init["body"] exists and is non-null or inputBody is
  23471. // non-null, and request’s method is `GET` or `HEAD`, then throw a
  23472. // TypeError.
  23473. if (
  23474. (init.body != null || inputBody != null) &&
  23475. (request.method === 'GET' || request.method === 'HEAD')
  23476. ) {
  23477. throw new TypeError('Request with GET/HEAD method cannot have body.')
  23478. }
  23479. // 35. Let initBody be null.
  23480. let initBody = null
  23481. // 36. If init["body"] exists and is non-null, then:
  23482. if (init.body != null) {
  23483. // 1. Let Content-Type be null.
  23484. // 2. Set initBody and Content-Type to the result of extracting
  23485. // init["body"], with keepalive set to request’s keepalive.
  23486. const [extractedBody, contentType] = extractBody(
  23487. init.body,
  23488. request.keepalive
  23489. )
  23490. initBody = extractedBody
  23491. // 3, If Content-Type is non-null and this’s headers’s header list does
  23492. // not contain `Content-Type`, then append `Content-Type`/Content-Type to
  23493. // this’s headers.
  23494. if (contentType && !this[kHeaders][kHeadersList].contains('content-type')) {
  23495. this[kHeaders].append('content-type', contentType)
  23496. }
  23497. }
  23498. // 37. Let inputOrInitBody be initBody if it is non-null; otherwise
  23499. // inputBody.
  23500. const inputOrInitBody = initBody ?? inputBody
  23501. // 38. If inputOrInitBody is non-null and inputOrInitBody’s source is
  23502. // null, then:
  23503. if (inputOrInitBody != null && inputOrInitBody.source == null) {
  23504. // 1. If initBody is non-null and init["duplex"] does not exist,
  23505. // then throw a TypeError.
  23506. if (initBody != null && init.duplex == null) {
  23507. throw new TypeError('RequestInit: duplex option is required when sending a body.')
  23508. }
  23509. // 2. If this’s request’s mode is neither "same-origin" nor "cors",
  23510. // then throw a TypeError.
  23511. if (request.mode !== 'same-origin' && request.mode !== 'cors') {
  23512. throw new TypeError(
  23513. 'If request is made from ReadableStream, mode should be "same-origin" or "cors"'
  23514. )
  23515. }
  23516. // 3. Set this’s request’s use-CORS-preflight flag.
  23517. request.useCORSPreflightFlag = true
  23518. }
  23519. // 39. Let finalBody be inputOrInitBody.
  23520. let finalBody = inputOrInitBody
  23521. // 40. If initBody is null and inputBody is non-null, then:
  23522. if (initBody == null && inputBody != null) {
  23523. // 1. If input is unusable, then throw a TypeError.
  23524. if (util.isDisturbed(inputBody.stream) || inputBody.stream.locked) {
  23525. throw new TypeError(
  23526. 'Cannot construct a Request with a Request object that has already been used.'
  23527. )
  23528. }
  23529. // 2. Set finalBody to the result of creating a proxy for inputBody.
  23530. if (!TransformStream) {
  23531. TransformStream = (__nccwpck_require__(5356).TransformStream)
  23532. }
  23533. // https://streams.spec.whatwg.org/#readablestream-create-a-proxy
  23534. const identityTransform = new TransformStream()
  23535. inputBody.stream.pipeThrough(identityTransform)
  23536. finalBody = {
  23537. source: inputBody.source,
  23538. length: inputBody.length,
  23539. stream: identityTransform.readable
  23540. }
  23541. }
  23542. // 41. Set this’s request’s body to finalBody.
  23543. this[kState].body = finalBody
  23544. }
  23545. // Returns request’s HTTP method, which is "GET" by default.
  23546. get method () {
  23547. webidl.brandCheck(this, Request)
  23548. // The method getter steps are to return this’s request’s method.
  23549. return this[kState].method
  23550. }
  23551. // Returns the URL of request as a string.
  23552. get url () {
  23553. webidl.brandCheck(this, Request)
  23554. // The url getter steps are to return this’s request’s URL, serialized.
  23555. return URLSerializer(this[kState].url)
  23556. }
  23557. // Returns a Headers object consisting of the headers associated with request.
  23558. // Note that headers added in the network layer by the user agent will not
  23559. // be accounted for in this object, e.g., the "Host" header.
  23560. get headers () {
  23561. webidl.brandCheck(this, Request)
  23562. // The headers getter steps are to return this’s headers.
  23563. return this[kHeaders]
  23564. }
  23565. // Returns the kind of resource requested by request, e.g., "document"
  23566. // or "script".
  23567. get destination () {
  23568. webidl.brandCheck(this, Request)
  23569. // The destination getter are to return this’s request’s destination.
  23570. return this[kState].destination
  23571. }
  23572. // Returns the referrer of request. Its value can be a same-origin URL if
  23573. // explicitly set in init, the empty string to indicate no referrer, and
  23574. // "about:client" when defaulting to the global’s default. This is used
  23575. // during fetching to determine the value of the `Referer` header of the
  23576. // request being made.
  23577. get referrer () {
  23578. webidl.brandCheck(this, Request)
  23579. // 1. If this’s request’s referrer is "no-referrer", then return the
  23580. // empty string.
  23581. if (this[kState].referrer === 'no-referrer') {
  23582. return ''
  23583. }
  23584. // 2. If this’s request’s referrer is "client", then return
  23585. // "about:client".
  23586. if (this[kState].referrer === 'client') {
  23587. return 'about:client'
  23588. }
  23589. // Return this’s request’s referrer, serialized.
  23590. return this[kState].referrer.toString()
  23591. }
  23592. // Returns the referrer policy associated with request.
  23593. // This is used during fetching to compute the value of the request’s
  23594. // referrer.
  23595. get referrerPolicy () {
  23596. webidl.brandCheck(this, Request)
  23597. // The referrerPolicy getter steps are to return this’s request’s referrer policy.
  23598. return this[kState].referrerPolicy
  23599. }
  23600. // Returns the mode associated with request, which is a string indicating
  23601. // whether the request will use CORS, or will be restricted to same-origin
  23602. // URLs.
  23603. get mode () {
  23604. webidl.brandCheck(this, Request)
  23605. // The mode getter steps are to return this’s request’s mode.
  23606. return this[kState].mode
  23607. }
  23608. // Returns the credentials mode associated with request,
  23609. // which is a string indicating whether credentials will be sent with the
  23610. // request always, never, or only when sent to a same-origin URL.
  23611. get credentials () {
  23612. // The credentials getter steps are to return this’s request’s credentials mode.
  23613. return this[kState].credentials
  23614. }
  23615. // Returns the cache mode associated with request,
  23616. // which is a string indicating how the request will
  23617. // interact with the browser’s cache when fetching.
  23618. get cache () {
  23619. webidl.brandCheck(this, Request)
  23620. // The cache getter steps are to return this’s request’s cache mode.
  23621. return this[kState].cache
  23622. }
  23623. // Returns the redirect mode associated with request,
  23624. // which is a string indicating how redirects for the
  23625. // request will be handled during fetching. A request
  23626. // will follow redirects by default.
  23627. get redirect () {
  23628. webidl.brandCheck(this, Request)
  23629. // The redirect getter steps are to return this’s request’s redirect mode.
  23630. return this[kState].redirect
  23631. }
  23632. // Returns request’s subresource integrity metadata, which is a
  23633. // cryptographic hash of the resource being fetched. Its value
  23634. // consists of multiple hashes separated by whitespace. [SRI]
  23635. get integrity () {
  23636. webidl.brandCheck(this, Request)
  23637. // The integrity getter steps are to return this’s request’s integrity
  23638. // metadata.
  23639. return this[kState].integrity
  23640. }
  23641. // Returns a boolean indicating whether or not request can outlive the
  23642. // global in which it was created.
  23643. get keepalive () {
  23644. webidl.brandCheck(this, Request)
  23645. // The keepalive getter steps are to return this’s request’s keepalive.
  23646. return this[kState].keepalive
  23647. }
  23648. // Returns a boolean indicating whether or not request is for a reload
  23649. // navigation.
  23650. get isReloadNavigation () {
  23651. webidl.brandCheck(this, Request)
  23652. // The isReloadNavigation getter steps are to return true if this’s
  23653. // request’s reload-navigation flag is set; otherwise false.
  23654. return this[kState].reloadNavigation
  23655. }
  23656. // Returns a boolean indicating whether or not request is for a history
  23657. // navigation (a.k.a. back-foward navigation).
  23658. get isHistoryNavigation () {
  23659. webidl.brandCheck(this, Request)
  23660. // The isHistoryNavigation getter steps are to return true if this’s request’s
  23661. // history-navigation flag is set; otherwise false.
  23662. return this[kState].historyNavigation
  23663. }
  23664. // Returns the signal associated with request, which is an AbortSignal
  23665. // object indicating whether or not request has been aborted, and its
  23666. // abort event handler.
  23667. get signal () {
  23668. webidl.brandCheck(this, Request)
  23669. // The signal getter steps are to return this’s signal.
  23670. return this[kSignal]
  23671. }
  23672. get body () {
  23673. webidl.brandCheck(this, Request)
  23674. return this[kState].body ? this[kState].body.stream : null
  23675. }
  23676. get bodyUsed () {
  23677. webidl.brandCheck(this, Request)
  23678. return !!this[kState].body && util.isDisturbed(this[kState].body.stream)
  23679. }
  23680. get duplex () {
  23681. webidl.brandCheck(this, Request)
  23682. return 'half'
  23683. }
  23684. // Returns a clone of request.
  23685. clone () {
  23686. webidl.brandCheck(this, Request)
  23687. // 1. If this is unusable, then throw a TypeError.
  23688. if (this.bodyUsed || this.body?.locked) {
  23689. throw new TypeError('unusable')
  23690. }
  23691. // 2. Let clonedRequest be the result of cloning this’s request.
  23692. const clonedRequest = cloneRequest(this[kState])
  23693. // 3. Let clonedRequestObject be the result of creating a Request object,
  23694. // given clonedRequest, this’s headers’s guard, and this’s relevant Realm.
  23695. const clonedRequestObject = new Request(kConstruct)
  23696. clonedRequestObject[kState] = clonedRequest
  23697. clonedRequestObject[kRealm] = this[kRealm]
  23698. clonedRequestObject[kHeaders] = new Headers(kConstruct)
  23699. clonedRequestObject[kHeaders][kHeadersList] = clonedRequest.headersList
  23700. clonedRequestObject[kHeaders][kGuard] = this[kHeaders][kGuard]
  23701. clonedRequestObject[kHeaders][kRealm] = this[kHeaders][kRealm]
  23702. // 4. Make clonedRequestObject’s signal follow this’s signal.
  23703. const ac = new AbortController()
  23704. if (this.signal.aborted) {
  23705. ac.abort(this.signal.reason)
  23706. } else {
  23707. util.addAbortListener(
  23708. this.signal,
  23709. () => {
  23710. ac.abort(this.signal.reason)
  23711. }
  23712. )
  23713. }
  23714. clonedRequestObject[kSignal] = ac.signal
  23715. // 4. Return clonedRequestObject.
  23716. return clonedRequestObject
  23717. }
  23718. }
  23719. mixinBody(Request)
  23720. function makeRequest (init) {
  23721. // https://fetch.spec.whatwg.org/#requests
  23722. const request = {
  23723. method: 'GET',
  23724. localURLsOnly: false,
  23725. unsafeRequest: false,
  23726. body: null,
  23727. client: null,
  23728. reservedClient: null,
  23729. replacesClientId: '',
  23730. window: 'client',
  23731. keepalive: false,
  23732. serviceWorkers: 'all',
  23733. initiator: '',
  23734. destination: '',
  23735. priority: null,
  23736. origin: 'client',
  23737. policyContainer: 'client',
  23738. referrer: 'client',
  23739. referrerPolicy: '',
  23740. mode: 'no-cors',
  23741. useCORSPreflightFlag: false,
  23742. credentials: 'same-origin',
  23743. useCredentials: false,
  23744. cache: 'default',
  23745. redirect: 'follow',
  23746. integrity: '',
  23747. cryptoGraphicsNonceMetadata: '',
  23748. parserMetadata: '',
  23749. reloadNavigation: false,
  23750. historyNavigation: false,
  23751. userActivation: false,
  23752. taintedOrigin: false,
  23753. redirectCount: 0,
  23754. responseTainting: 'basic',
  23755. preventNoCacheCacheControlHeaderModification: false,
  23756. done: false,
  23757. timingAllowFailed: false,
  23758. ...init,
  23759. headersList: init.headersList
  23760. ? new HeadersList(init.headersList)
  23761. : new HeadersList()
  23762. }
  23763. request.url = request.urlList[0]
  23764. return request
  23765. }
  23766. // https://fetch.spec.whatwg.org/#concept-request-clone
  23767. function cloneRequest (request) {
  23768. // To clone a request request, run these steps:
  23769. // 1. Let newRequest be a copy of request, except for its body.
  23770. const newRequest = makeRequest({ ...request, body: null })
  23771. // 2. If request’s body is non-null, set newRequest’s body to the
  23772. // result of cloning request’s body.
  23773. if (request.body != null) {
  23774. newRequest.body = cloneBody(request.body)
  23775. }
  23776. // 3. Return newRequest.
  23777. return newRequest
  23778. }
  23779. Object.defineProperties(Request.prototype, {
  23780. method: kEnumerableProperty,
  23781. url: kEnumerableProperty,
  23782. headers: kEnumerableProperty,
  23783. redirect: kEnumerableProperty,
  23784. clone: kEnumerableProperty,
  23785. signal: kEnumerableProperty,
  23786. duplex: kEnumerableProperty,
  23787. destination: kEnumerableProperty,
  23788. body: kEnumerableProperty,
  23789. bodyUsed: kEnumerableProperty,
  23790. isHistoryNavigation: kEnumerableProperty,
  23791. isReloadNavigation: kEnumerableProperty,
  23792. keepalive: kEnumerableProperty,
  23793. integrity: kEnumerableProperty,
  23794. cache: kEnumerableProperty,
  23795. credentials: kEnumerableProperty,
  23796. attribute: kEnumerableProperty,
  23797. referrerPolicy: kEnumerableProperty,
  23798. referrer: kEnumerableProperty,
  23799. mode: kEnumerableProperty,
  23800. [Symbol.toStringTag]: {
  23801. value: 'Request',
  23802. configurable: true
  23803. }
  23804. })
  23805. webidl.converters.Request = webidl.interfaceConverter(
  23806. Request
  23807. )
  23808. // https://fetch.spec.whatwg.org/#requestinfo
  23809. webidl.converters.RequestInfo = function (V) {
  23810. if (typeof V === 'string') {
  23811. return webidl.converters.USVString(V)
  23812. }
  23813. if (V instanceof Request) {
  23814. return webidl.converters.Request(V)
  23815. }
  23816. return webidl.converters.USVString(V)
  23817. }
  23818. webidl.converters.AbortSignal = webidl.interfaceConverter(
  23819. AbortSignal
  23820. )
  23821. // https://fetch.spec.whatwg.org/#requestinit
  23822. webidl.converters.RequestInit = webidl.dictionaryConverter([
  23823. {
  23824. key: 'method',
  23825. converter: webidl.converters.ByteString
  23826. },
  23827. {
  23828. key: 'headers',
  23829. converter: webidl.converters.HeadersInit
  23830. },
  23831. {
  23832. key: 'body',
  23833. converter: webidl.nullableConverter(
  23834. webidl.converters.BodyInit
  23835. )
  23836. },
  23837. {
  23838. key: 'referrer',
  23839. converter: webidl.converters.USVString
  23840. },
  23841. {
  23842. key: 'referrerPolicy',
  23843. converter: webidl.converters.DOMString,
  23844. // https://w3c.github.io/webappsec-referrer-policy/#referrer-policy
  23845. allowedValues: referrerPolicy
  23846. },
  23847. {
  23848. key: 'mode',
  23849. converter: webidl.converters.DOMString,
  23850. // https://fetch.spec.whatwg.org/#concept-request-mode
  23851. allowedValues: requestMode
  23852. },
  23853. {
  23854. key: 'credentials',
  23855. converter: webidl.converters.DOMString,
  23856. // https://fetch.spec.whatwg.org/#requestcredentials
  23857. allowedValues: requestCredentials
  23858. },
  23859. {
  23860. key: 'cache',
  23861. converter: webidl.converters.DOMString,
  23862. // https://fetch.spec.whatwg.org/#requestcache
  23863. allowedValues: requestCache
  23864. },
  23865. {
  23866. key: 'redirect',
  23867. converter: webidl.converters.DOMString,
  23868. // https://fetch.spec.whatwg.org/#requestredirect
  23869. allowedValues: requestRedirect
  23870. },
  23871. {
  23872. key: 'integrity',
  23873. converter: webidl.converters.DOMString
  23874. },
  23875. {
  23876. key: 'keepalive',
  23877. converter: webidl.converters.boolean
  23878. },
  23879. {
  23880. key: 'signal',
  23881. converter: webidl.nullableConverter(
  23882. (signal) => webidl.converters.AbortSignal(
  23883. signal,
  23884. { strict: false }
  23885. )
  23886. )
  23887. },
  23888. {
  23889. key: 'window',
  23890. converter: webidl.converters.any
  23891. },
  23892. {
  23893. key: 'duplex',
  23894. converter: webidl.converters.DOMString,
  23895. allowedValues: requestDuplex
  23896. }
  23897. ])
  23898. module.exports = { Request, makeRequest }
  23899. /***/ }),
  23900. /***/ 7823:
  23901. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  23902. "use strict";
  23903. const { Headers, HeadersList, fill } = __nccwpck_require__(554)
  23904. const { extractBody, cloneBody, mixinBody } = __nccwpck_require__(9990)
  23905. const util = __nccwpck_require__(3983)
  23906. const { kEnumerableProperty } = util
  23907. const {
  23908. isValidReasonPhrase,
  23909. isCancelled,
  23910. isAborted,
  23911. isBlobLike,
  23912. serializeJavascriptValueToJSONString,
  23913. isErrorLike,
  23914. isomorphicEncode
  23915. } = __nccwpck_require__(2538)
  23916. const {
  23917. redirectStatusSet,
  23918. nullBodyStatus,
  23919. DOMException
  23920. } = __nccwpck_require__(1037)
  23921. const { kState, kHeaders, kGuard, kRealm } = __nccwpck_require__(5861)
  23922. const { webidl } = __nccwpck_require__(1744)
  23923. const { FormData } = __nccwpck_require__(2015)
  23924. const { getGlobalOrigin } = __nccwpck_require__(1246)
  23925. const { URLSerializer } = __nccwpck_require__(685)
  23926. const { kHeadersList, kConstruct } = __nccwpck_require__(2785)
  23927. const assert = __nccwpck_require__(9491)
  23928. const { types } = __nccwpck_require__(3837)
  23929. const ReadableStream = globalThis.ReadableStream || (__nccwpck_require__(5356).ReadableStream)
  23930. const textEncoder = new TextEncoder('utf-8')
  23931. // https://fetch.spec.whatwg.org/#response-class
  23932. class Response {
  23933. // Creates network error Response.
  23934. static error () {
  23935. // TODO
  23936. const relevantRealm = { settingsObject: {} }
  23937. // The static error() method steps are to return the result of creating a
  23938. // Response object, given a new network error, "immutable", and this’s
  23939. // relevant Realm.
  23940. const responseObject = new Response()
  23941. responseObject[kState] = makeNetworkError()
  23942. responseObject[kRealm] = relevantRealm
  23943. responseObject[kHeaders][kHeadersList] = responseObject[kState].headersList
  23944. responseObject[kHeaders][kGuard] = 'immutable'
  23945. responseObject[kHeaders][kRealm] = relevantRealm
  23946. return responseObject
  23947. }
  23948. // https://fetch.spec.whatwg.org/#dom-response-json
  23949. static json (data, init = {}) {
  23950. webidl.argumentLengthCheck(arguments, 1, { header: 'Response.json' })
  23951. if (init !== null) {
  23952. init = webidl.converters.ResponseInit(init)
  23953. }
  23954. // 1. Let bytes the result of running serialize a JavaScript value to JSON bytes on data.
  23955. const bytes = textEncoder.encode(
  23956. serializeJavascriptValueToJSONString(data)
  23957. )
  23958. // 2. Let body be the result of extracting bytes.
  23959. const body = extractBody(bytes)
  23960. // 3. Let responseObject be the result of creating a Response object, given a new response,
  23961. // "response", and this’s relevant Realm.
  23962. const relevantRealm = { settingsObject: {} }
  23963. const responseObject = new Response()
  23964. responseObject[kRealm] = relevantRealm
  23965. responseObject[kHeaders][kGuard] = 'response'
  23966. responseObject[kHeaders][kRealm] = relevantRealm
  23967. // 4. Perform initialize a response given responseObject, init, and (body, "application/json").
  23968. initializeResponse(responseObject, init, { body: body[0], type: 'application/json' })
  23969. // 5. Return responseObject.
  23970. return responseObject
  23971. }
  23972. // Creates a redirect Response that redirects to url with status status.
  23973. static redirect (url, status = 302) {
  23974. const relevantRealm = { settingsObject: {} }
  23975. webidl.argumentLengthCheck(arguments, 1, { header: 'Response.redirect' })
  23976. url = webidl.converters.USVString(url)
  23977. status = webidl.converters['unsigned short'](status)
  23978. // 1. Let parsedURL be the result of parsing url with current settings
  23979. // object’s API base URL.
  23980. // 2. If parsedURL is failure, then throw a TypeError.
  23981. // TODO: base-URL?
  23982. let parsedURL
  23983. try {
  23984. parsedURL = new URL(url, getGlobalOrigin())
  23985. } catch (err) {
  23986. throw Object.assign(new TypeError('Failed to parse URL from ' + url), {
  23987. cause: err
  23988. })
  23989. }
  23990. // 3. If status is not a redirect status, then throw a RangeError.
  23991. if (!redirectStatusSet.has(status)) {
  23992. throw new RangeError('Invalid status code ' + status)
  23993. }
  23994. // 4. Let responseObject be the result of creating a Response object,
  23995. // given a new response, "immutable", and this’s relevant Realm.
  23996. const responseObject = new Response()
  23997. responseObject[kRealm] = relevantRealm
  23998. responseObject[kHeaders][kGuard] = 'immutable'
  23999. responseObject[kHeaders][kRealm] = relevantRealm
  24000. // 5. Set responseObject’s response’s status to status.
  24001. responseObject[kState].status = status
  24002. // 6. Let value be parsedURL, serialized and isomorphic encoded.
  24003. const value = isomorphicEncode(URLSerializer(parsedURL))
  24004. // 7. Append `Location`/value to responseObject’s response’s header list.
  24005. responseObject[kState].headersList.append('location', value)
  24006. // 8. Return responseObject.
  24007. return responseObject
  24008. }
  24009. // https://fetch.spec.whatwg.org/#dom-response
  24010. constructor (body = null, init = {}) {
  24011. if (body !== null) {
  24012. body = webidl.converters.BodyInit(body)
  24013. }
  24014. init = webidl.converters.ResponseInit(init)
  24015. // TODO
  24016. this[kRealm] = { settingsObject: {} }
  24017. // 1. Set this’s response to a new response.
  24018. this[kState] = makeResponse({})
  24019. // 2. Set this’s headers to a new Headers object with this’s relevant
  24020. // Realm, whose header list is this’s response’s header list and guard
  24021. // is "response".
  24022. this[kHeaders] = new Headers(kConstruct)
  24023. this[kHeaders][kGuard] = 'response'
  24024. this[kHeaders][kHeadersList] = this[kState].headersList
  24025. this[kHeaders][kRealm] = this[kRealm]
  24026. // 3. Let bodyWithType be null.
  24027. let bodyWithType = null
  24028. // 4. If body is non-null, then set bodyWithType to the result of extracting body.
  24029. if (body != null) {
  24030. const [extractedBody, type] = extractBody(body)
  24031. bodyWithType = { body: extractedBody, type }
  24032. }
  24033. // 5. Perform initialize a response given this, init, and bodyWithType.
  24034. initializeResponse(this, init, bodyWithType)
  24035. }
  24036. // Returns response’s type, e.g., "cors".
  24037. get type () {
  24038. webidl.brandCheck(this, Response)
  24039. // The type getter steps are to return this’s response’s type.
  24040. return this[kState].type
  24041. }
  24042. // Returns response’s URL, if it has one; otherwise the empty string.
  24043. get url () {
  24044. webidl.brandCheck(this, Response)
  24045. const urlList = this[kState].urlList
  24046. // The url getter steps are to return the empty string if this’s
  24047. // response’s URL is null; otherwise this’s response’s URL,
  24048. // serialized with exclude fragment set to true.
  24049. const url = urlList[urlList.length - 1] ?? null
  24050. if (url === null) {
  24051. return ''
  24052. }
  24053. return URLSerializer(url, true)
  24054. }
  24055. // Returns whether response was obtained through a redirect.
  24056. get redirected () {
  24057. webidl.brandCheck(this, Response)
  24058. // The redirected getter steps are to return true if this’s response’s URL
  24059. // list has more than one item; otherwise false.
  24060. return this[kState].urlList.length > 1
  24061. }
  24062. // Returns response’s status.
  24063. get status () {
  24064. webidl.brandCheck(this, Response)
  24065. // The status getter steps are to return this’s response’s status.
  24066. return this[kState].status
  24067. }
  24068. // Returns whether response’s status is an ok status.
  24069. get ok () {
  24070. webidl.brandCheck(this, Response)
  24071. // The ok getter steps are to return true if this’s response’s status is an
  24072. // ok status; otherwise false.
  24073. return this[kState].status >= 200 && this[kState].status <= 299
  24074. }
  24075. // Returns response’s status message.
  24076. get statusText () {
  24077. webidl.brandCheck(this, Response)
  24078. // The statusText getter steps are to return this’s response’s status
  24079. // message.
  24080. return this[kState].statusText
  24081. }
  24082. // Returns response’s headers as Headers.
  24083. get headers () {
  24084. webidl.brandCheck(this, Response)
  24085. // The headers getter steps are to return this’s headers.
  24086. return this[kHeaders]
  24087. }
  24088. get body () {
  24089. webidl.brandCheck(this, Response)
  24090. return this[kState].body ? this[kState].body.stream : null
  24091. }
  24092. get bodyUsed () {
  24093. webidl.brandCheck(this, Response)
  24094. return !!this[kState].body && util.isDisturbed(this[kState].body.stream)
  24095. }
  24096. // Returns a clone of response.
  24097. clone () {
  24098. webidl.brandCheck(this, Response)
  24099. // 1. If this is unusable, then throw a TypeError.
  24100. if (this.bodyUsed || (this.body && this.body.locked)) {
  24101. throw webidl.errors.exception({
  24102. header: 'Response.clone',
  24103. message: 'Body has already been consumed.'
  24104. })
  24105. }
  24106. // 2. Let clonedResponse be the result of cloning this’s response.
  24107. const clonedResponse = cloneResponse(this[kState])
  24108. // 3. Return the result of creating a Response object, given
  24109. // clonedResponse, this’s headers’s guard, and this’s relevant Realm.
  24110. const clonedResponseObject = new Response()
  24111. clonedResponseObject[kState] = clonedResponse
  24112. clonedResponseObject[kRealm] = this[kRealm]
  24113. clonedResponseObject[kHeaders][kHeadersList] = clonedResponse.headersList
  24114. clonedResponseObject[kHeaders][kGuard] = this[kHeaders][kGuard]
  24115. clonedResponseObject[kHeaders][kRealm] = this[kHeaders][kRealm]
  24116. return clonedResponseObject
  24117. }
  24118. }
  24119. mixinBody(Response)
  24120. Object.defineProperties(Response.prototype, {
  24121. type: kEnumerableProperty,
  24122. url: kEnumerableProperty,
  24123. status: kEnumerableProperty,
  24124. ok: kEnumerableProperty,
  24125. redirected: kEnumerableProperty,
  24126. statusText: kEnumerableProperty,
  24127. headers: kEnumerableProperty,
  24128. clone: kEnumerableProperty,
  24129. body: kEnumerableProperty,
  24130. bodyUsed: kEnumerableProperty,
  24131. [Symbol.toStringTag]: {
  24132. value: 'Response',
  24133. configurable: true
  24134. }
  24135. })
  24136. Object.defineProperties(Response, {
  24137. json: kEnumerableProperty,
  24138. redirect: kEnumerableProperty,
  24139. error: kEnumerableProperty
  24140. })
  24141. // https://fetch.spec.whatwg.org/#concept-response-clone
  24142. function cloneResponse (response) {
  24143. // To clone a response response, run these steps:
  24144. // 1. If response is a filtered response, then return a new identical
  24145. // filtered response whose internal response is a clone of response’s
  24146. // internal response.
  24147. if (response.internalResponse) {
  24148. return filterResponse(
  24149. cloneResponse(response.internalResponse),
  24150. response.type
  24151. )
  24152. }
  24153. // 2. Let newResponse be a copy of response, except for its body.
  24154. const newResponse = makeResponse({ ...response, body: null })
  24155. // 3. If response’s body is non-null, then set newResponse’s body to the
  24156. // result of cloning response’s body.
  24157. if (response.body != null) {
  24158. newResponse.body = cloneBody(response.body)
  24159. }
  24160. // 4. Return newResponse.
  24161. return newResponse
  24162. }
  24163. function makeResponse (init) {
  24164. return {
  24165. aborted: false,
  24166. rangeRequested: false,
  24167. timingAllowPassed: false,
  24168. requestIncludesCredentials: false,
  24169. type: 'default',
  24170. status: 200,
  24171. timingInfo: null,
  24172. cacheState: '',
  24173. statusText: '',
  24174. ...init,
  24175. headersList: init.headersList
  24176. ? new HeadersList(init.headersList)
  24177. : new HeadersList(),
  24178. urlList: init.urlList ? [...init.urlList] : []
  24179. }
  24180. }
  24181. function makeNetworkError (reason) {
  24182. const isError = isErrorLike(reason)
  24183. return makeResponse({
  24184. type: 'error',
  24185. status: 0,
  24186. error: isError
  24187. ? reason
  24188. : new Error(reason ? String(reason) : reason),
  24189. aborted: reason && reason.name === 'AbortError'
  24190. })
  24191. }
  24192. function makeFilteredResponse (response, state) {
  24193. state = {
  24194. internalResponse: response,
  24195. ...state
  24196. }
  24197. return new Proxy(response, {
  24198. get (target, p) {
  24199. return p in state ? state[p] : target[p]
  24200. },
  24201. set (target, p, value) {
  24202. assert(!(p in state))
  24203. target[p] = value
  24204. return true
  24205. }
  24206. })
  24207. }
  24208. // https://fetch.spec.whatwg.org/#concept-filtered-response
  24209. function filterResponse (response, type) {
  24210. // Set response to the following filtered response with response as its
  24211. // internal response, depending on request’s response tainting:
  24212. if (type === 'basic') {
  24213. // A basic filtered response is a filtered response whose type is "basic"
  24214. // and header list excludes any headers in internal response’s header list
  24215. // whose name is a forbidden response-header name.
  24216. // Note: undici does not implement forbidden response-header names
  24217. return makeFilteredResponse(response, {
  24218. type: 'basic',
  24219. headersList: response.headersList
  24220. })
  24221. } else if (type === 'cors') {
  24222. // A CORS filtered response is a filtered response whose type is "cors"
  24223. // and header list excludes any headers in internal response’s header
  24224. // list whose name is not a CORS-safelisted response-header name, given
  24225. // internal response’s CORS-exposed header-name list.
  24226. // Note: undici does not implement CORS-safelisted response-header names
  24227. return makeFilteredResponse(response, {
  24228. type: 'cors',
  24229. headersList: response.headersList
  24230. })
  24231. } else if (type === 'opaque') {
  24232. // An opaque filtered response is a filtered response whose type is
  24233. // "opaque", URL list is the empty list, status is 0, status message
  24234. // is the empty byte sequence, header list is empty, and body is null.
  24235. return makeFilteredResponse(response, {
  24236. type: 'opaque',
  24237. urlList: Object.freeze([]),
  24238. status: 0,
  24239. statusText: '',
  24240. body: null
  24241. })
  24242. } else if (type === 'opaqueredirect') {
  24243. // An opaque-redirect filtered response is a filtered response whose type
  24244. // is "opaqueredirect", status is 0, status message is the empty byte
  24245. // sequence, header list is empty, and body is null.
  24246. return makeFilteredResponse(response, {
  24247. type: 'opaqueredirect',
  24248. status: 0,
  24249. statusText: '',
  24250. headersList: [],
  24251. body: null
  24252. })
  24253. } else {
  24254. assert(false)
  24255. }
  24256. }
  24257. // https://fetch.spec.whatwg.org/#appropriate-network-error
  24258. function makeAppropriateNetworkError (fetchParams, err = null) {
  24259. // 1. Assert: fetchParams is canceled.
  24260. assert(isCancelled(fetchParams))
  24261. // 2. Return an aborted network error if fetchParams is aborted;
  24262. // otherwise return a network error.
  24263. return isAborted(fetchParams)
  24264. ? makeNetworkError(Object.assign(new DOMException('The operation was aborted.', 'AbortError'), { cause: err }))
  24265. : makeNetworkError(Object.assign(new DOMException('Request was cancelled.'), { cause: err }))
  24266. }
  24267. // https://whatpr.org/fetch/1392.html#initialize-a-response
  24268. function initializeResponse (response, init, body) {
  24269. // 1. If init["status"] is not in the range 200 to 599, inclusive, then
  24270. // throw a RangeError.
  24271. if (init.status !== null && (init.status < 200 || init.status > 599)) {
  24272. throw new RangeError('init["status"] must be in the range of 200 to 599, inclusive.')
  24273. }
  24274. // 2. If init["statusText"] does not match the reason-phrase token production,
  24275. // then throw a TypeError.
  24276. if ('statusText' in init && init.statusText != null) {
  24277. // See, https://datatracker.ietf.org/doc/html/rfc7230#section-3.1.2:
  24278. // reason-phrase = *( HTAB / SP / VCHAR / obs-text )
  24279. if (!isValidReasonPhrase(String(init.statusText))) {
  24280. throw new TypeError('Invalid statusText')
  24281. }
  24282. }
  24283. // 3. Set response’s response’s status to init["status"].
  24284. if ('status' in init && init.status != null) {
  24285. response[kState].status = init.status
  24286. }
  24287. // 4. Set response’s response’s status message to init["statusText"].
  24288. if ('statusText' in init && init.statusText != null) {
  24289. response[kState].statusText = init.statusText
  24290. }
  24291. // 5. If init["headers"] exists, then fill response’s headers with init["headers"].
  24292. if ('headers' in init && init.headers != null) {
  24293. fill(response[kHeaders], init.headers)
  24294. }
  24295. // 6. If body was given, then:
  24296. if (body) {
  24297. // 1. If response's status is a null body status, then throw a TypeError.
  24298. if (nullBodyStatus.includes(response.status)) {
  24299. throw webidl.errors.exception({
  24300. header: 'Response constructor',
  24301. message: 'Invalid response status code ' + response.status
  24302. })
  24303. }
  24304. // 2. Set response's body to body's body.
  24305. response[kState].body = body.body
  24306. // 3. If body's type is non-null and response's header list does not contain
  24307. // `Content-Type`, then append (`Content-Type`, body's type) to response's header list.
  24308. if (body.type != null && !response[kState].headersList.contains('Content-Type')) {
  24309. response[kState].headersList.append('content-type', body.type)
  24310. }
  24311. }
  24312. }
  24313. webidl.converters.ReadableStream = webidl.interfaceConverter(
  24314. ReadableStream
  24315. )
  24316. webidl.converters.FormData = webidl.interfaceConverter(
  24317. FormData
  24318. )
  24319. webidl.converters.URLSearchParams = webidl.interfaceConverter(
  24320. URLSearchParams
  24321. )
  24322. // https://fetch.spec.whatwg.org/#typedefdef-xmlhttprequestbodyinit
  24323. webidl.converters.XMLHttpRequestBodyInit = function (V) {
  24324. if (typeof V === 'string') {
  24325. return webidl.converters.USVString(V)
  24326. }
  24327. if (isBlobLike(V)) {
  24328. return webidl.converters.Blob(V, { strict: false })
  24329. }
  24330. if (types.isArrayBuffer(V) || types.isTypedArray(V) || types.isDataView(V)) {
  24331. return webidl.converters.BufferSource(V)
  24332. }
  24333. if (util.isFormDataLike(V)) {
  24334. return webidl.converters.FormData(V, { strict: false })
  24335. }
  24336. if (V instanceof URLSearchParams) {
  24337. return webidl.converters.URLSearchParams(V)
  24338. }
  24339. return webidl.converters.DOMString(V)
  24340. }
  24341. // https://fetch.spec.whatwg.org/#bodyinit
  24342. webidl.converters.BodyInit = function (V) {
  24343. if (V instanceof ReadableStream) {
  24344. return webidl.converters.ReadableStream(V)
  24345. }
  24346. // Note: the spec doesn't include async iterables,
  24347. // this is an undici extension.
  24348. if (V?.[Symbol.asyncIterator]) {
  24349. return V
  24350. }
  24351. return webidl.converters.XMLHttpRequestBodyInit(V)
  24352. }
  24353. webidl.converters.ResponseInit = webidl.dictionaryConverter([
  24354. {
  24355. key: 'status',
  24356. converter: webidl.converters['unsigned short'],
  24357. defaultValue: 200
  24358. },
  24359. {
  24360. key: 'statusText',
  24361. converter: webidl.converters.ByteString,
  24362. defaultValue: ''
  24363. },
  24364. {
  24365. key: 'headers',
  24366. converter: webidl.converters.HeadersInit
  24367. }
  24368. ])
  24369. module.exports = {
  24370. makeNetworkError,
  24371. makeResponse,
  24372. makeAppropriateNetworkError,
  24373. filterResponse,
  24374. Response,
  24375. cloneResponse
  24376. }
  24377. /***/ }),
  24378. /***/ 5861:
  24379. /***/ ((module) => {
  24380. "use strict";
  24381. module.exports = {
  24382. kUrl: Symbol('url'),
  24383. kHeaders: Symbol('headers'),
  24384. kSignal: Symbol('signal'),
  24385. kState: Symbol('state'),
  24386. kGuard: Symbol('guard'),
  24387. kRealm: Symbol('realm')
  24388. }
  24389. /***/ }),
  24390. /***/ 2538:
  24391. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  24392. "use strict";
  24393. const { redirectStatusSet, referrerPolicySet: referrerPolicyTokens, badPortsSet } = __nccwpck_require__(1037)
  24394. const { getGlobalOrigin } = __nccwpck_require__(1246)
  24395. const { performance } = __nccwpck_require__(4074)
  24396. const { isBlobLike, toUSVString, ReadableStreamFrom } = __nccwpck_require__(3983)
  24397. const assert = __nccwpck_require__(9491)
  24398. const { isUint8Array } = __nccwpck_require__(9830)
  24399. let supportedHashes = []
  24400. // https://nodejs.org/api/crypto.html#determining-if-crypto-support-is-unavailable
  24401. /** @type {import('crypto')|undefined} */
  24402. let crypto
  24403. try {
  24404. crypto = __nccwpck_require__(6113)
  24405. const possibleRelevantHashes = ['sha256', 'sha384', 'sha512']
  24406. supportedHashes = crypto.getHashes().filter((hash) => possibleRelevantHashes.includes(hash))
  24407. /* c8 ignore next 3 */
  24408. } catch {
  24409. }
  24410. function responseURL (response) {
  24411. // https://fetch.spec.whatwg.org/#responses
  24412. // A response has an associated URL. It is a pointer to the last URL
  24413. // in response’s URL list and null if response’s URL list is empty.
  24414. const urlList = response.urlList
  24415. const length = urlList.length
  24416. return length === 0 ? null : urlList[length - 1].toString()
  24417. }
  24418. // https://fetch.spec.whatwg.org/#concept-response-location-url
  24419. function responseLocationURL (response, requestFragment) {
  24420. // 1. If response’s status is not a redirect status, then return null.
  24421. if (!redirectStatusSet.has(response.status)) {
  24422. return null
  24423. }
  24424. // 2. Let location be the result of extracting header list values given
  24425. // `Location` and response’s header list.
  24426. let location = response.headersList.get('location')
  24427. // 3. If location is a header value, then set location to the result of
  24428. // parsing location with response’s URL.
  24429. if (location !== null && isValidHeaderValue(location)) {
  24430. location = new URL(location, responseURL(response))
  24431. }
  24432. // 4. If location is a URL whose fragment is null, then set location’s
  24433. // fragment to requestFragment.
  24434. if (location && !location.hash) {
  24435. location.hash = requestFragment
  24436. }
  24437. // 5. Return location.
  24438. return location
  24439. }
  24440. /** @returns {URL} */
  24441. function requestCurrentURL (request) {
  24442. return request.urlList[request.urlList.length - 1]
  24443. }
  24444. function requestBadPort (request) {
  24445. // 1. Let url be request’s current URL.
  24446. const url = requestCurrentURL(request)
  24447. // 2. If url’s scheme is an HTTP(S) scheme and url’s port is a bad port,
  24448. // then return blocked.
  24449. if (urlIsHttpHttpsScheme(url) && badPortsSet.has(url.port)) {
  24450. return 'blocked'
  24451. }
  24452. // 3. Return allowed.
  24453. return 'allowed'
  24454. }
  24455. function isErrorLike (object) {
  24456. return object instanceof Error || (
  24457. object?.constructor?.name === 'Error' ||
  24458. object?.constructor?.name === 'DOMException'
  24459. )
  24460. }
  24461. // Check whether |statusText| is a ByteString and
  24462. // matches the Reason-Phrase token production.
  24463. // RFC 2616: https://tools.ietf.org/html/rfc2616
  24464. // RFC 7230: https://tools.ietf.org/html/rfc7230
  24465. // "reason-phrase = *( HTAB / SP / VCHAR / obs-text )"
  24466. // https://github.com/chromium/chromium/blob/94.0.4604.1/third_party/blink/renderer/core/fetch/response.cc#L116
  24467. function isValidReasonPhrase (statusText) {
  24468. for (let i = 0; i < statusText.length; ++i) {
  24469. const c = statusText.charCodeAt(i)
  24470. if (
  24471. !(
  24472. (
  24473. c === 0x09 || // HTAB
  24474. (c >= 0x20 && c <= 0x7e) || // SP / VCHAR
  24475. (c >= 0x80 && c <= 0xff)
  24476. ) // obs-text
  24477. )
  24478. ) {
  24479. return false
  24480. }
  24481. }
  24482. return true
  24483. }
  24484. /**
  24485. * @see https://tools.ietf.org/html/rfc7230#section-3.2.6
  24486. * @param {number} c
  24487. */
  24488. function isTokenCharCode (c) {
  24489. switch (c) {
  24490. case 0x22:
  24491. case 0x28:
  24492. case 0x29:
  24493. case 0x2c:
  24494. case 0x2f:
  24495. case 0x3a:
  24496. case 0x3b:
  24497. case 0x3c:
  24498. case 0x3d:
  24499. case 0x3e:
  24500. case 0x3f:
  24501. case 0x40:
  24502. case 0x5b:
  24503. case 0x5c:
  24504. case 0x5d:
  24505. case 0x7b:
  24506. case 0x7d:
  24507. // DQUOTE and "(),/:;<=>?@[\]{}"
  24508. return false
  24509. default:
  24510. // VCHAR %x21-7E
  24511. return c >= 0x21 && c <= 0x7e
  24512. }
  24513. }
  24514. /**
  24515. * @param {string} characters
  24516. */
  24517. function isValidHTTPToken (characters) {
  24518. if (characters.length === 0) {
  24519. return false
  24520. }
  24521. for (let i = 0; i < characters.length; ++i) {
  24522. if (!isTokenCharCode(characters.charCodeAt(i))) {
  24523. return false
  24524. }
  24525. }
  24526. return true
  24527. }
  24528. /**
  24529. * @see https://fetch.spec.whatwg.org/#header-name
  24530. * @param {string} potentialValue
  24531. */
  24532. function isValidHeaderName (potentialValue) {
  24533. return isValidHTTPToken(potentialValue)
  24534. }
  24535. /**
  24536. * @see https://fetch.spec.whatwg.org/#header-value
  24537. * @param {string} potentialValue
  24538. */
  24539. function isValidHeaderValue (potentialValue) {
  24540. // - Has no leading or trailing HTTP tab or space bytes.
  24541. // - Contains no 0x00 (NUL) or HTTP newline bytes.
  24542. if (
  24543. potentialValue.startsWith('\t') ||
  24544. potentialValue.startsWith(' ') ||
  24545. potentialValue.endsWith('\t') ||
  24546. potentialValue.endsWith(' ')
  24547. ) {
  24548. return false
  24549. }
  24550. if (
  24551. potentialValue.includes('\0') ||
  24552. potentialValue.includes('\r') ||
  24553. potentialValue.includes('\n')
  24554. ) {
  24555. return false
  24556. }
  24557. return true
  24558. }
  24559. // https://w3c.github.io/webappsec-referrer-policy/#set-requests-referrer-policy-on-redirect
  24560. function setRequestReferrerPolicyOnRedirect (request, actualResponse) {
  24561. // Given a request request and a response actualResponse, this algorithm
  24562. // updates request’s referrer policy according to the Referrer-Policy
  24563. // header (if any) in actualResponse.
  24564. // 1. Let policy be the result of executing § 8.1 Parse a referrer policy
  24565. // from a Referrer-Policy header on actualResponse.
  24566. // 8.1 Parse a referrer policy from a Referrer-Policy header
  24567. // 1. Let policy-tokens be the result of extracting header list values given `Referrer-Policy` and response’s header list.
  24568. const { headersList } = actualResponse
  24569. // 2. Let policy be the empty string.
  24570. // 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.
  24571. // 4. Return policy.
  24572. const policyHeader = (headersList.get('referrer-policy') ?? '').split(',')
  24573. // Note: As the referrer-policy can contain multiple policies
  24574. // separated by comma, we need to loop through all of them
  24575. // and pick the first valid one.
  24576. // Ref: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Referrer-Policy#specify_a_fallback_policy
  24577. let policy = ''
  24578. if (policyHeader.length > 0) {
  24579. // The right-most policy takes precedence.
  24580. // The left-most policy is the fallback.
  24581. for (let i = policyHeader.length; i !== 0; i--) {
  24582. const token = policyHeader[i - 1].trim()
  24583. if (referrerPolicyTokens.has(token)) {
  24584. policy = token
  24585. break
  24586. }
  24587. }
  24588. }
  24589. // 2. If policy is not the empty string, then set request’s referrer policy to policy.
  24590. if (policy !== '') {
  24591. request.referrerPolicy = policy
  24592. }
  24593. }
  24594. // https://fetch.spec.whatwg.org/#cross-origin-resource-policy-check
  24595. function crossOriginResourcePolicyCheck () {
  24596. // TODO
  24597. return 'allowed'
  24598. }
  24599. // https://fetch.spec.whatwg.org/#concept-cors-check
  24600. function corsCheck () {
  24601. // TODO
  24602. return 'success'
  24603. }
  24604. // https://fetch.spec.whatwg.org/#concept-tao-check
  24605. function TAOCheck () {
  24606. // TODO
  24607. return 'success'
  24608. }
  24609. function appendFetchMetadata (httpRequest) {
  24610. // https://w3c.github.io/webappsec-fetch-metadata/#sec-fetch-dest-header
  24611. // TODO
  24612. // https://w3c.github.io/webappsec-fetch-metadata/#sec-fetch-mode-header
  24613. // 1. Assert: r’s url is a potentially trustworthy URL.
  24614. // TODO
  24615. // 2. Let header be a Structured Header whose value is a token.
  24616. let header = null
  24617. // 3. Set header’s value to r’s mode.
  24618. header = httpRequest.mode
  24619. // 4. Set a structured field value `Sec-Fetch-Mode`/header in r’s header list.
  24620. httpRequest.headersList.set('sec-fetch-mode', header)
  24621. // https://w3c.github.io/webappsec-fetch-metadata/#sec-fetch-site-header
  24622. // TODO
  24623. // https://w3c.github.io/webappsec-fetch-metadata/#sec-fetch-user-header
  24624. // TODO
  24625. }
  24626. // https://fetch.spec.whatwg.org/#append-a-request-origin-header
  24627. function appendRequestOriginHeader (request) {
  24628. // 1. Let serializedOrigin be the result of byte-serializing a request origin with request.
  24629. let serializedOrigin = request.origin
  24630. // 2. If request’s response tainting is "cors" or request’s mode is "websocket", then append (`Origin`, serializedOrigin) to request’s header list.
  24631. if (request.responseTainting === 'cors' || request.mode === 'websocket') {
  24632. if (serializedOrigin) {
  24633. request.headersList.append('origin', serializedOrigin)
  24634. }
  24635. // 3. Otherwise, if request’s method is neither `GET` nor `HEAD`, then:
  24636. } else if (request.method !== 'GET' && request.method !== 'HEAD') {
  24637. // 1. Switch on request’s referrer policy:
  24638. switch (request.referrerPolicy) {
  24639. case 'no-referrer':
  24640. // Set serializedOrigin to `null`.
  24641. serializedOrigin = null
  24642. break
  24643. case 'no-referrer-when-downgrade':
  24644. case 'strict-origin':
  24645. case 'strict-origin-when-cross-origin':
  24646. // 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`.
  24647. if (request.origin && urlHasHttpsScheme(request.origin) && !urlHasHttpsScheme(requestCurrentURL(request))) {
  24648. serializedOrigin = null
  24649. }
  24650. break
  24651. case 'same-origin':
  24652. // If request’s origin is not same origin with request’s current URL’s origin, then set serializedOrigin to `null`.
  24653. if (!sameOrigin(request, requestCurrentURL(request))) {
  24654. serializedOrigin = null
  24655. }
  24656. break
  24657. default:
  24658. // Do nothing.
  24659. }
  24660. if (serializedOrigin) {
  24661. // 2. Append (`Origin`, serializedOrigin) to request’s header list.
  24662. request.headersList.append('origin', serializedOrigin)
  24663. }
  24664. }
  24665. }
  24666. function coarsenedSharedCurrentTime (crossOriginIsolatedCapability) {
  24667. // TODO
  24668. return performance.now()
  24669. }
  24670. // https://fetch.spec.whatwg.org/#create-an-opaque-timing-info
  24671. function createOpaqueTimingInfo (timingInfo) {
  24672. return {
  24673. startTime: timingInfo.startTime ?? 0,
  24674. redirectStartTime: 0,
  24675. redirectEndTime: 0,
  24676. postRedirectStartTime: timingInfo.startTime ?? 0,
  24677. finalServiceWorkerStartTime: 0,
  24678. finalNetworkResponseStartTime: 0,
  24679. finalNetworkRequestStartTime: 0,
  24680. endTime: 0,
  24681. encodedBodySize: 0,
  24682. decodedBodySize: 0,
  24683. finalConnectionTimingInfo: null
  24684. }
  24685. }
  24686. // https://html.spec.whatwg.org/multipage/origin.html#policy-container
  24687. function makePolicyContainer () {
  24688. // Note: the fetch spec doesn't make use of embedder policy or CSP list
  24689. return {
  24690. referrerPolicy: 'strict-origin-when-cross-origin'
  24691. }
  24692. }
  24693. // https://html.spec.whatwg.org/multipage/origin.html#clone-a-policy-container
  24694. function clonePolicyContainer (policyContainer) {
  24695. return {
  24696. referrerPolicy: policyContainer.referrerPolicy
  24697. }
  24698. }
  24699. // https://w3c.github.io/webappsec-referrer-policy/#determine-requests-referrer
  24700. function determineRequestsReferrer (request) {
  24701. // 1. Let policy be request's referrer policy.
  24702. const policy = request.referrerPolicy
  24703. // Note: policy cannot (shouldn't) be null or an empty string.
  24704. assert(policy)
  24705. // 2. Let environment be request’s client.
  24706. let referrerSource = null
  24707. // 3. Switch on request’s referrer:
  24708. if (request.referrer === 'client') {
  24709. // Note: node isn't a browser and doesn't implement document/iframes,
  24710. // so we bypass this step and replace it with our own.
  24711. const globalOrigin = getGlobalOrigin()
  24712. if (!globalOrigin || globalOrigin.origin === 'null') {
  24713. return 'no-referrer'
  24714. }
  24715. // note: we need to clone it as it's mutated
  24716. referrerSource = new URL(globalOrigin)
  24717. } else if (request.referrer instanceof URL) {
  24718. // Let referrerSource be request’s referrer.
  24719. referrerSource = request.referrer
  24720. }
  24721. // 4. Let request’s referrerURL be the result of stripping referrerSource for
  24722. // use as a referrer.
  24723. let referrerURL = stripURLForReferrer(referrerSource)
  24724. // 5. Let referrerOrigin be the result of stripping referrerSource for use as
  24725. // a referrer, with the origin-only flag set to true.
  24726. const referrerOrigin = stripURLForReferrer(referrerSource, true)
  24727. // 6. If the result of serializing referrerURL is a string whose length is
  24728. // greater than 4096, set referrerURL to referrerOrigin.
  24729. if (referrerURL.toString().length > 4096) {
  24730. referrerURL = referrerOrigin
  24731. }
  24732. const areSameOrigin = sameOrigin(request, referrerURL)
  24733. const isNonPotentiallyTrustWorthy = isURLPotentiallyTrustworthy(referrerURL) &&
  24734. !isURLPotentiallyTrustworthy(request.url)
  24735. // 8. Execute the switch statements corresponding to the value of policy:
  24736. switch (policy) {
  24737. case 'origin': return referrerOrigin != null ? referrerOrigin : stripURLForReferrer(referrerSource, true)
  24738. case 'unsafe-url': return referrerURL
  24739. case 'same-origin':
  24740. return areSameOrigin ? referrerOrigin : 'no-referrer'
  24741. case 'origin-when-cross-origin':
  24742. return areSameOrigin ? referrerURL : referrerOrigin
  24743. case 'strict-origin-when-cross-origin': {
  24744. const currentURL = requestCurrentURL(request)
  24745. // 1. If the origin of referrerURL and the origin of request’s current
  24746. // URL are the same, then return referrerURL.
  24747. if (sameOrigin(referrerURL, currentURL)) {
  24748. return referrerURL
  24749. }
  24750. // 2. If referrerURL is a potentially trustworthy URL and request’s
  24751. // current URL is not a potentially trustworthy URL, then return no
  24752. // referrer.
  24753. if (isURLPotentiallyTrustworthy(referrerURL) && !isURLPotentiallyTrustworthy(currentURL)) {
  24754. return 'no-referrer'
  24755. }
  24756. // 3. Return referrerOrigin.
  24757. return referrerOrigin
  24758. }
  24759. case 'strict-origin': // eslint-disable-line
  24760. /**
  24761. * 1. If referrerURL is a potentially trustworthy URL and
  24762. * request’s current URL is not a potentially trustworthy URL,
  24763. * then return no referrer.
  24764. * 2. Return referrerOrigin
  24765. */
  24766. case 'no-referrer-when-downgrade': // eslint-disable-line
  24767. /**
  24768. * 1. If referrerURL is a potentially trustworthy URL and
  24769. * request’s current URL is not a potentially trustworthy URL,
  24770. * then return no referrer.
  24771. * 2. Return referrerOrigin
  24772. */
  24773. default: // eslint-disable-line
  24774. return isNonPotentiallyTrustWorthy ? 'no-referrer' : referrerOrigin
  24775. }
  24776. }
  24777. /**
  24778. * @see https://w3c.github.io/webappsec-referrer-policy/#strip-url
  24779. * @param {URL} url
  24780. * @param {boolean|undefined} originOnly
  24781. */
  24782. function stripURLForReferrer (url, originOnly) {
  24783. // 1. Assert: url is a URL.
  24784. assert(url instanceof URL)
  24785. // 2. If url’s scheme is a local scheme, then return no referrer.
  24786. if (url.protocol === 'file:' || url.protocol === 'about:' || url.protocol === 'blank:') {
  24787. return 'no-referrer'
  24788. }
  24789. // 3. Set url’s username to the empty string.
  24790. url.username = ''
  24791. // 4. Set url’s password to the empty string.
  24792. url.password = ''
  24793. // 5. Set url’s fragment to null.
  24794. url.hash = ''
  24795. // 6. If the origin-only flag is true, then:
  24796. if (originOnly) {
  24797. // 1. Set url’s path to « the empty string ».
  24798. url.pathname = ''
  24799. // 2. Set url’s query to null.
  24800. url.search = ''
  24801. }
  24802. // 7. Return url.
  24803. return url
  24804. }
  24805. function isURLPotentiallyTrustworthy (url) {
  24806. if (!(url instanceof URL)) {
  24807. return false
  24808. }
  24809. // If child of about, return true
  24810. if (url.href === 'about:blank' || url.href === 'about:srcdoc') {
  24811. return true
  24812. }
  24813. // If scheme is data, return true
  24814. if (url.protocol === 'data:') return true
  24815. // If file, return true
  24816. if (url.protocol === 'file:') return true
  24817. return isOriginPotentiallyTrustworthy(url.origin)
  24818. function isOriginPotentiallyTrustworthy (origin) {
  24819. // If origin is explicitly null, return false
  24820. if (origin == null || origin === 'null') return false
  24821. const originAsURL = new URL(origin)
  24822. // If secure, return true
  24823. if (originAsURL.protocol === 'https:' || originAsURL.protocol === 'wss:') {
  24824. return true
  24825. }
  24826. // If localhost or variants, return true
  24827. if (/^127(?:\.[0-9]+){0,2}\.[0-9]+$|^\[(?:0*:)*?:?0*1\]$/.test(originAsURL.hostname) ||
  24828. (originAsURL.hostname === 'localhost' || originAsURL.hostname.includes('localhost.')) ||
  24829. (originAsURL.hostname.endsWith('.localhost'))) {
  24830. return true
  24831. }
  24832. // If any other, return false
  24833. return false
  24834. }
  24835. }
  24836. /**
  24837. * @see https://w3c.github.io/webappsec-subresource-integrity/#does-response-match-metadatalist
  24838. * @param {Uint8Array} bytes
  24839. * @param {string} metadataList
  24840. */
  24841. function bytesMatch (bytes, metadataList) {
  24842. // If node is not built with OpenSSL support, we cannot check
  24843. // a request's integrity, so allow it by default (the spec will
  24844. // allow requests if an invalid hash is given, as precedence).
  24845. /* istanbul ignore if: only if node is built with --without-ssl */
  24846. if (crypto === undefined) {
  24847. return true
  24848. }
  24849. // 1. Let parsedMetadata be the result of parsing metadataList.
  24850. const parsedMetadata = parseMetadata(metadataList)
  24851. // 2. If parsedMetadata is no metadata, return true.
  24852. if (parsedMetadata === 'no metadata') {
  24853. return true
  24854. }
  24855. // 3. If response is not eligible for integrity validation, return false.
  24856. // TODO
  24857. // 4. If parsedMetadata is the empty set, return true.
  24858. if (parsedMetadata.length === 0) {
  24859. return true
  24860. }
  24861. // 5. Let metadata be the result of getting the strongest
  24862. // metadata from parsedMetadata.
  24863. const strongest = getStrongestMetadata(parsedMetadata)
  24864. const metadata = filterMetadataListByAlgorithm(parsedMetadata, strongest)
  24865. // 6. For each item in metadata:
  24866. for (const item of metadata) {
  24867. // 1. Let algorithm be the alg component of item.
  24868. const algorithm = item.algo
  24869. // 2. Let expectedValue be the val component of item.
  24870. const expectedValue = item.hash
  24871. // See https://github.com/web-platform-tests/wpt/commit/e4c5cc7a5e48093220528dfdd1c4012dc3837a0e
  24872. // "be liberal with padding". This is annoying, and it's not even in the spec.
  24873. // 3. Let actualValue be the result of applying algorithm to bytes.
  24874. let actualValue = crypto.createHash(algorithm).update(bytes).digest('base64')
  24875. if (actualValue[actualValue.length - 1] === '=') {
  24876. if (actualValue[actualValue.length - 2] === '=') {
  24877. actualValue = actualValue.slice(0, -2)
  24878. } else {
  24879. actualValue = actualValue.slice(0, -1)
  24880. }
  24881. }
  24882. // 4. If actualValue is a case-sensitive match for expectedValue,
  24883. // return true.
  24884. if (compareBase64Mixed(actualValue, expectedValue)) {
  24885. return true
  24886. }
  24887. }
  24888. // 7. Return false.
  24889. return false
  24890. }
  24891. // https://w3c.github.io/webappsec-subresource-integrity/#grammardef-hash-with-options
  24892. // https://www.w3.org/TR/CSP2/#source-list-syntax
  24893. // https://www.rfc-editor.org/rfc/rfc5234#appendix-B.1
  24894. const parseHashWithOptions = /(?<algo>sha256|sha384|sha512)-((?<hash>[A-Za-z0-9+/]+|[A-Za-z0-9_-]+)={0,2}(?:\s|$)( +[!-~]*)?)?/i
  24895. /**
  24896. * @see https://w3c.github.io/webappsec-subresource-integrity/#parse-metadata
  24897. * @param {string} metadata
  24898. */
  24899. function parseMetadata (metadata) {
  24900. // 1. Let result be the empty set.
  24901. /** @type {{ algo: string, hash: string }[]} */
  24902. const result = []
  24903. // 2. Let empty be equal to true.
  24904. let empty = true
  24905. // 3. For each token returned by splitting metadata on spaces:
  24906. for (const token of metadata.split(' ')) {
  24907. // 1. Set empty to false.
  24908. empty = false
  24909. // 2. Parse token as a hash-with-options.
  24910. const parsedToken = parseHashWithOptions.exec(token)
  24911. // 3. If token does not parse, continue to the next token.
  24912. if (
  24913. parsedToken === null ||
  24914. parsedToken.groups === undefined ||
  24915. parsedToken.groups.algo === undefined
  24916. ) {
  24917. // Note: Chromium blocks the request at this point, but Firefox
  24918. // gives a warning that an invalid integrity was given. The
  24919. // correct behavior is to ignore these, and subsequently not
  24920. // check the integrity of the resource.
  24921. continue
  24922. }
  24923. // 4. Let algorithm be the hash-algo component of token.
  24924. const algorithm = parsedToken.groups.algo.toLowerCase()
  24925. // 5. If algorithm is a hash function recognized by the user
  24926. // agent, add the parsed token to result.
  24927. if (supportedHashes.includes(algorithm)) {
  24928. result.push(parsedToken.groups)
  24929. }
  24930. }
  24931. // 4. Return no metadata if empty is true, otherwise return result.
  24932. if (empty === true) {
  24933. return 'no metadata'
  24934. }
  24935. return result
  24936. }
  24937. /**
  24938. * @param {{ algo: 'sha256' | 'sha384' | 'sha512' }[]} metadataList
  24939. */
  24940. function getStrongestMetadata (metadataList) {
  24941. // Let algorithm be the algo component of the first item in metadataList.
  24942. // Can be sha256
  24943. let algorithm = metadataList[0].algo
  24944. // If the algorithm is sha512, then it is the strongest
  24945. // and we can return immediately
  24946. if (algorithm[3] === '5') {
  24947. return algorithm
  24948. }
  24949. for (let i = 1; i < metadataList.length; ++i) {
  24950. const metadata = metadataList[i]
  24951. // If the algorithm is sha512, then it is the strongest
  24952. // and we can break the loop immediately
  24953. if (metadata.algo[3] === '5') {
  24954. algorithm = 'sha512'
  24955. break
  24956. // If the algorithm is sha384, then a potential sha256 or sha384 is ignored
  24957. } else if (algorithm[3] === '3') {
  24958. continue
  24959. // algorithm is sha256, check if algorithm is sha384 and if so, set it as
  24960. // the strongest
  24961. } else if (metadata.algo[3] === '3') {
  24962. algorithm = 'sha384'
  24963. }
  24964. }
  24965. return algorithm
  24966. }
  24967. function filterMetadataListByAlgorithm (metadataList, algorithm) {
  24968. if (metadataList.length === 1) {
  24969. return metadataList
  24970. }
  24971. let pos = 0
  24972. for (let i = 0; i < metadataList.length; ++i) {
  24973. if (metadataList[i].algo === algorithm) {
  24974. metadataList[pos++] = metadataList[i]
  24975. }
  24976. }
  24977. metadataList.length = pos
  24978. return metadataList
  24979. }
  24980. /**
  24981. * Compares two base64 strings, allowing for base64url
  24982. * in the second string.
  24983. *
  24984. * @param {string} actualValue always base64
  24985. * @param {string} expectedValue base64 or base64url
  24986. * @returns {boolean}
  24987. */
  24988. function compareBase64Mixed (actualValue, expectedValue) {
  24989. if (actualValue.length !== expectedValue.length) {
  24990. return false
  24991. }
  24992. for (let i = 0; i < actualValue.length; ++i) {
  24993. if (actualValue[i] !== expectedValue[i]) {
  24994. if (
  24995. (actualValue[i] === '+' && expectedValue[i] === '-') ||
  24996. (actualValue[i] === '/' && expectedValue[i] === '_')
  24997. ) {
  24998. continue
  24999. }
  25000. return false
  25001. }
  25002. }
  25003. return true
  25004. }
  25005. // https://w3c.github.io/webappsec-upgrade-insecure-requests/#upgrade-request
  25006. function tryUpgradeRequestToAPotentiallyTrustworthyURL (request) {
  25007. // TODO
  25008. }
  25009. /**
  25010. * @link {https://html.spec.whatwg.org/multipage/origin.html#same-origin}
  25011. * @param {URL} A
  25012. * @param {URL} B
  25013. */
  25014. function sameOrigin (A, B) {
  25015. // 1. If A and B are the same opaque origin, then return true.
  25016. if (A.origin === B.origin && A.origin === 'null') {
  25017. return true
  25018. }
  25019. // 2. If A and B are both tuple origins and their schemes,
  25020. // hosts, and port are identical, then return true.
  25021. if (A.protocol === B.protocol && A.hostname === B.hostname && A.port === B.port) {
  25022. return true
  25023. }
  25024. // 3. Return false.
  25025. return false
  25026. }
  25027. function createDeferredPromise () {
  25028. let res
  25029. let rej
  25030. const promise = new Promise((resolve, reject) => {
  25031. res = resolve
  25032. rej = reject
  25033. })
  25034. return { promise, resolve: res, reject: rej }
  25035. }
  25036. function isAborted (fetchParams) {
  25037. return fetchParams.controller.state === 'aborted'
  25038. }
  25039. function isCancelled (fetchParams) {
  25040. return fetchParams.controller.state === 'aborted' ||
  25041. fetchParams.controller.state === 'terminated'
  25042. }
  25043. const normalizeMethodRecord = {
  25044. delete: 'DELETE',
  25045. DELETE: 'DELETE',
  25046. get: 'GET',
  25047. GET: 'GET',
  25048. head: 'HEAD',
  25049. HEAD: 'HEAD',
  25050. options: 'OPTIONS',
  25051. OPTIONS: 'OPTIONS',
  25052. post: 'POST',
  25053. POST: 'POST',
  25054. put: 'PUT',
  25055. PUT: 'PUT'
  25056. }
  25057. // Note: object prototypes should not be able to be referenced. e.g. `Object#hasOwnProperty`.
  25058. Object.setPrototypeOf(normalizeMethodRecord, null)
  25059. /**
  25060. * @see https://fetch.spec.whatwg.org/#concept-method-normalize
  25061. * @param {string} method
  25062. */
  25063. function normalizeMethod (method) {
  25064. return normalizeMethodRecord[method.toLowerCase()] ?? method
  25065. }
  25066. // https://infra.spec.whatwg.org/#serialize-a-javascript-value-to-a-json-string
  25067. function serializeJavascriptValueToJSONString (value) {
  25068. // 1. Let result be ? Call(%JSON.stringify%, undefined, « value »).
  25069. const result = JSON.stringify(value)
  25070. // 2. If result is undefined, then throw a TypeError.
  25071. if (result === undefined) {
  25072. throw new TypeError('Value is not JSON serializable')
  25073. }
  25074. // 3. Assert: result is a string.
  25075. assert(typeof result === 'string')
  25076. // 4. Return result.
  25077. return result
  25078. }
  25079. // https://tc39.es/ecma262/#sec-%25iteratorprototype%25-object
  25080. const esIteratorPrototype = Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]()))
  25081. /**
  25082. * @see https://webidl.spec.whatwg.org/#dfn-iterator-prototype-object
  25083. * @param {() => unknown[]} iterator
  25084. * @param {string} name name of the instance
  25085. * @param {'key'|'value'|'key+value'} kind
  25086. */
  25087. function makeIterator (iterator, name, kind) {
  25088. const object = {
  25089. index: 0,
  25090. kind,
  25091. target: iterator
  25092. }
  25093. const i = {
  25094. next () {
  25095. // 1. Let interface be the interface for which the iterator prototype object exists.
  25096. // 2. Let thisValue be the this value.
  25097. // 3. Let object be ? ToObject(thisValue).
  25098. // 4. If object is a platform object, then perform a security
  25099. // check, passing:
  25100. // 5. If object is not a default iterator object for interface,
  25101. // then throw a TypeError.
  25102. if (Object.getPrototypeOf(this) !== i) {
  25103. throw new TypeError(
  25104. `'next' called on an object that does not implement interface ${name} Iterator.`
  25105. )
  25106. }
  25107. // 6. Let index be object’s index.
  25108. // 7. Let kind be object’s kind.
  25109. // 8. Let values be object’s target's value pairs to iterate over.
  25110. const { index, kind, target } = object
  25111. const values = target()
  25112. // 9. Let len be the length of values.
  25113. const len = values.length
  25114. // 10. If index is greater than or equal to len, then return
  25115. // CreateIterResultObject(undefined, true).
  25116. if (index >= len) {
  25117. return { value: undefined, done: true }
  25118. }
  25119. // 11. Let pair be the entry in values at index index.
  25120. const pair = values[index]
  25121. // 12. Set object’s index to index + 1.
  25122. object.index = index + 1
  25123. // 13. Return the iterator result for pair and kind.
  25124. return iteratorResult(pair, kind)
  25125. },
  25126. // The class string of an iterator prototype object for a given interface is the
  25127. // result of concatenating the identifier of the interface and the string " Iterator".
  25128. [Symbol.toStringTag]: `${name} Iterator`
  25129. }
  25130. // The [[Prototype]] internal slot of an iterator prototype object must be %IteratorPrototype%.
  25131. Object.setPrototypeOf(i, esIteratorPrototype)
  25132. // esIteratorPrototype needs to be the prototype of i
  25133. // which is the prototype of an empty object. Yes, it's confusing.
  25134. return Object.setPrototypeOf({}, i)
  25135. }
  25136. // https://webidl.spec.whatwg.org/#iterator-result
  25137. function iteratorResult (pair, kind) {
  25138. let result
  25139. // 1. Let result be a value determined by the value of kind:
  25140. switch (kind) {
  25141. case 'key': {
  25142. // 1. Let idlKey be pair’s key.
  25143. // 2. Let key be the result of converting idlKey to an
  25144. // ECMAScript value.
  25145. // 3. result is key.
  25146. result = pair[0]
  25147. break
  25148. }
  25149. case 'value': {
  25150. // 1. Let idlValue be pair’s value.
  25151. // 2. Let value be the result of converting idlValue to
  25152. // an ECMAScript value.
  25153. // 3. result is value.
  25154. result = pair[1]
  25155. break
  25156. }
  25157. case 'key+value': {
  25158. // 1. Let idlKey be pair’s key.
  25159. // 2. Let idlValue be pair’s value.
  25160. // 3. Let key be the result of converting idlKey to an
  25161. // ECMAScript value.
  25162. // 4. Let value be the result of converting idlValue to
  25163. // an ECMAScript value.
  25164. // 5. Let array be ! ArrayCreate(2).
  25165. // 6. Call ! CreateDataProperty(array, "0", key).
  25166. // 7. Call ! CreateDataProperty(array, "1", value).
  25167. // 8. result is array.
  25168. result = pair
  25169. break
  25170. }
  25171. }
  25172. // 2. Return CreateIterResultObject(result, false).
  25173. return { value: result, done: false }
  25174. }
  25175. /**
  25176. * @see https://fetch.spec.whatwg.org/#body-fully-read
  25177. */
  25178. async function fullyReadBody (body, processBody, processBodyError) {
  25179. // 1. If taskDestination is null, then set taskDestination to
  25180. // the result of starting a new parallel queue.
  25181. // 2. Let successSteps given a byte sequence bytes be to queue a
  25182. // fetch task to run processBody given bytes, with taskDestination.
  25183. const successSteps = processBody
  25184. // 3. Let errorSteps be to queue a fetch task to run processBodyError,
  25185. // with taskDestination.
  25186. const errorSteps = processBodyError
  25187. // 4. Let reader be the result of getting a reader for body’s stream.
  25188. // If that threw an exception, then run errorSteps with that
  25189. // exception and return.
  25190. let reader
  25191. try {
  25192. reader = body.stream.getReader()
  25193. } catch (e) {
  25194. errorSteps(e)
  25195. return
  25196. }
  25197. // 5. Read all bytes from reader, given successSteps and errorSteps.
  25198. try {
  25199. const result = await readAllBytes(reader)
  25200. successSteps(result)
  25201. } catch (e) {
  25202. errorSteps(e)
  25203. }
  25204. }
  25205. /** @type {ReadableStream} */
  25206. let ReadableStream = globalThis.ReadableStream
  25207. function isReadableStreamLike (stream) {
  25208. if (!ReadableStream) {
  25209. ReadableStream = (__nccwpck_require__(5356).ReadableStream)
  25210. }
  25211. return stream instanceof ReadableStream || (
  25212. stream[Symbol.toStringTag] === 'ReadableStream' &&
  25213. typeof stream.tee === 'function'
  25214. )
  25215. }
  25216. const MAXIMUM_ARGUMENT_LENGTH = 65535
  25217. /**
  25218. * @see https://infra.spec.whatwg.org/#isomorphic-decode
  25219. * @param {number[]|Uint8Array} input
  25220. */
  25221. function isomorphicDecode (input) {
  25222. // 1. To isomorphic decode a byte sequence input, return a string whose code point
  25223. // length is equal to input’s length and whose code points have the same values
  25224. // as the values of input’s bytes, in the same order.
  25225. if (input.length < MAXIMUM_ARGUMENT_LENGTH) {
  25226. return String.fromCharCode(...input)
  25227. }
  25228. return input.reduce((previous, current) => previous + String.fromCharCode(current), '')
  25229. }
  25230. /**
  25231. * @param {ReadableStreamController<Uint8Array>} controller
  25232. */
  25233. function readableStreamClose (controller) {
  25234. try {
  25235. controller.close()
  25236. } catch (err) {
  25237. // TODO: add comment explaining why this error occurs.
  25238. if (!err.message.includes('Controller is already closed')) {
  25239. throw err
  25240. }
  25241. }
  25242. }
  25243. /**
  25244. * @see https://infra.spec.whatwg.org/#isomorphic-encode
  25245. * @param {string} input
  25246. */
  25247. function isomorphicEncode (input) {
  25248. // 1. Assert: input contains no code points greater than U+00FF.
  25249. for (let i = 0; i < input.length; i++) {
  25250. assert(input.charCodeAt(i) <= 0xFF)
  25251. }
  25252. // 2. Return a byte sequence whose length is equal to input’s code
  25253. // point length and whose bytes have the same values as the
  25254. // values of input’s code points, in the same order
  25255. return input
  25256. }
  25257. /**
  25258. * @see https://streams.spec.whatwg.org/#readablestreamdefaultreader-read-all-bytes
  25259. * @see https://streams.spec.whatwg.org/#read-loop
  25260. * @param {ReadableStreamDefaultReader} reader
  25261. */
  25262. async function readAllBytes (reader) {
  25263. const bytes = []
  25264. let byteLength = 0
  25265. while (true) {
  25266. const { done, value: chunk } = await reader.read()
  25267. if (done) {
  25268. // 1. Call successSteps with bytes.
  25269. return Buffer.concat(bytes, byteLength)
  25270. }
  25271. // 1. If chunk is not a Uint8Array object, call failureSteps
  25272. // with a TypeError and abort these steps.
  25273. if (!isUint8Array(chunk)) {
  25274. throw new TypeError('Received non-Uint8Array chunk')
  25275. }
  25276. // 2. Append the bytes represented by chunk to bytes.
  25277. bytes.push(chunk)
  25278. byteLength += chunk.length
  25279. // 3. Read-loop given reader, bytes, successSteps, and failureSteps.
  25280. }
  25281. }
  25282. /**
  25283. * @see https://fetch.spec.whatwg.org/#is-local
  25284. * @param {URL} url
  25285. */
  25286. function urlIsLocal (url) {
  25287. assert('protocol' in url) // ensure it's a url object
  25288. const protocol = url.protocol
  25289. return protocol === 'about:' || protocol === 'blob:' || protocol === 'data:'
  25290. }
  25291. /**
  25292. * @param {string|URL} url
  25293. */
  25294. function urlHasHttpsScheme (url) {
  25295. if (typeof url === 'string') {
  25296. return url.startsWith('https:')
  25297. }
  25298. return url.protocol === 'https:'
  25299. }
  25300. /**
  25301. * @see https://fetch.spec.whatwg.org/#http-scheme
  25302. * @param {URL} url
  25303. */
  25304. function urlIsHttpHttpsScheme (url) {
  25305. assert('protocol' in url) // ensure it's a url object
  25306. const protocol = url.protocol
  25307. return protocol === 'http:' || protocol === 'https:'
  25308. }
  25309. /**
  25310. * Fetch supports node >= 16.8.0, but Object.hasOwn was added in v16.9.0.
  25311. */
  25312. const hasOwn = Object.hasOwn || ((dict, key) => Object.prototype.hasOwnProperty.call(dict, key))
  25313. module.exports = {
  25314. isAborted,
  25315. isCancelled,
  25316. createDeferredPromise,
  25317. ReadableStreamFrom,
  25318. toUSVString,
  25319. tryUpgradeRequestToAPotentiallyTrustworthyURL,
  25320. coarsenedSharedCurrentTime,
  25321. determineRequestsReferrer,
  25322. makePolicyContainer,
  25323. clonePolicyContainer,
  25324. appendFetchMetadata,
  25325. appendRequestOriginHeader,
  25326. TAOCheck,
  25327. corsCheck,
  25328. crossOriginResourcePolicyCheck,
  25329. createOpaqueTimingInfo,
  25330. setRequestReferrerPolicyOnRedirect,
  25331. isValidHTTPToken,
  25332. requestBadPort,
  25333. requestCurrentURL,
  25334. responseURL,
  25335. responseLocationURL,
  25336. isBlobLike,
  25337. isURLPotentiallyTrustworthy,
  25338. isValidReasonPhrase,
  25339. sameOrigin,
  25340. normalizeMethod,
  25341. serializeJavascriptValueToJSONString,
  25342. makeIterator,
  25343. isValidHeaderName,
  25344. isValidHeaderValue,
  25345. hasOwn,
  25346. isErrorLike,
  25347. fullyReadBody,
  25348. bytesMatch,
  25349. isReadableStreamLike,
  25350. readableStreamClose,
  25351. isomorphicEncode,
  25352. isomorphicDecode,
  25353. urlIsLocal,
  25354. urlHasHttpsScheme,
  25355. urlIsHttpHttpsScheme,
  25356. readAllBytes,
  25357. normalizeMethodRecord,
  25358. parseMetadata
  25359. }
  25360. /***/ }),
  25361. /***/ 1744:
  25362. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  25363. "use strict";
  25364. const { types } = __nccwpck_require__(3837)
  25365. const { hasOwn, toUSVString } = __nccwpck_require__(2538)
  25366. /** @type {import('../../types/webidl').Webidl} */
  25367. const webidl = {}
  25368. webidl.converters = {}
  25369. webidl.util = {}
  25370. webidl.errors = {}
  25371. webidl.errors.exception = function (message) {
  25372. return new TypeError(`${message.header}: ${message.message}`)
  25373. }
  25374. webidl.errors.conversionFailed = function (context) {
  25375. const plural = context.types.length === 1 ? '' : ' one of'
  25376. const message =
  25377. `${context.argument} could not be converted to` +
  25378. `${plural}: ${context.types.join(', ')}.`
  25379. return webidl.errors.exception({
  25380. header: context.prefix,
  25381. message
  25382. })
  25383. }
  25384. webidl.errors.invalidArgument = function (context) {
  25385. return webidl.errors.exception({
  25386. header: context.prefix,
  25387. message: `"${context.value}" is an invalid ${context.type}.`
  25388. })
  25389. }
  25390. // https://webidl.spec.whatwg.org/#implements
  25391. webidl.brandCheck = function (V, I, opts = undefined) {
  25392. if (opts?.strict !== false && !(V instanceof I)) {
  25393. throw new TypeError('Illegal invocation')
  25394. } else {
  25395. return V?.[Symbol.toStringTag] === I.prototype[Symbol.toStringTag]
  25396. }
  25397. }
  25398. webidl.argumentLengthCheck = function ({ length }, min, ctx) {
  25399. if (length < min) {
  25400. throw webidl.errors.exception({
  25401. message: `${min} argument${min !== 1 ? 's' : ''} required, ` +
  25402. `but${length ? ' only' : ''} ${length} found.`,
  25403. ...ctx
  25404. })
  25405. }
  25406. }
  25407. webidl.illegalConstructor = function () {
  25408. throw webidl.errors.exception({
  25409. header: 'TypeError',
  25410. message: 'Illegal constructor'
  25411. })
  25412. }
  25413. // https://tc39.es/ecma262/#sec-ecmascript-data-types-and-values
  25414. webidl.util.Type = function (V) {
  25415. switch (typeof V) {
  25416. case 'undefined': return 'Undefined'
  25417. case 'boolean': return 'Boolean'
  25418. case 'string': return 'String'
  25419. case 'symbol': return 'Symbol'
  25420. case 'number': return 'Number'
  25421. case 'bigint': return 'BigInt'
  25422. case 'function':
  25423. case 'object': {
  25424. if (V === null) {
  25425. return 'Null'
  25426. }
  25427. return 'Object'
  25428. }
  25429. }
  25430. }
  25431. // https://webidl.spec.whatwg.org/#abstract-opdef-converttoint
  25432. webidl.util.ConvertToInt = function (V, bitLength, signedness, opts = {}) {
  25433. let upperBound
  25434. let lowerBound
  25435. // 1. If bitLength is 64, then:
  25436. if (bitLength === 64) {
  25437. // 1. Let upperBound be 2^53 − 1.
  25438. upperBound = Math.pow(2, 53) - 1
  25439. // 2. If signedness is "unsigned", then let lowerBound be 0.
  25440. if (signedness === 'unsigned') {
  25441. lowerBound = 0
  25442. } else {
  25443. // 3. Otherwise let lowerBound be −2^53 + 1.
  25444. lowerBound = Math.pow(-2, 53) + 1
  25445. }
  25446. } else if (signedness === 'unsigned') {
  25447. // 2. Otherwise, if signedness is "unsigned", then:
  25448. // 1. Let lowerBound be 0.
  25449. lowerBound = 0
  25450. // 2. Let upperBound be 2^bitLength − 1.
  25451. upperBound = Math.pow(2, bitLength) - 1
  25452. } else {
  25453. // 3. Otherwise:
  25454. // 1. Let lowerBound be -2^bitLength − 1.
  25455. lowerBound = Math.pow(-2, bitLength) - 1
  25456. // 2. Let upperBound be 2^bitLength − 1 − 1.
  25457. upperBound = Math.pow(2, bitLength - 1) - 1
  25458. }
  25459. // 4. Let x be ? ToNumber(V).
  25460. let x = Number(V)
  25461. // 5. If x is −0, then set x to +0.
  25462. if (x === 0) {
  25463. x = 0
  25464. }
  25465. // 6. If the conversion is to an IDL type associated
  25466. // with the [EnforceRange] extended attribute, then:
  25467. if (opts.enforceRange === true) {
  25468. // 1. If x is NaN, +∞, or −∞, then throw a TypeError.
  25469. if (
  25470. Number.isNaN(x) ||
  25471. x === Number.POSITIVE_INFINITY ||
  25472. x === Number.NEGATIVE_INFINITY
  25473. ) {
  25474. throw webidl.errors.exception({
  25475. header: 'Integer conversion',
  25476. message: `Could not convert ${V} to an integer.`
  25477. })
  25478. }
  25479. // 2. Set x to IntegerPart(x).
  25480. x = webidl.util.IntegerPart(x)
  25481. // 3. If x < lowerBound or x > upperBound, then
  25482. // throw a TypeError.
  25483. if (x < lowerBound || x > upperBound) {
  25484. throw webidl.errors.exception({
  25485. header: 'Integer conversion',
  25486. message: `Value must be between ${lowerBound}-${upperBound}, got ${x}.`
  25487. })
  25488. }
  25489. // 4. Return x.
  25490. return x
  25491. }
  25492. // 7. If x is not NaN and the conversion is to an IDL
  25493. // type associated with the [Clamp] extended
  25494. // attribute, then:
  25495. if (!Number.isNaN(x) && opts.clamp === true) {
  25496. // 1. Set x to min(max(x, lowerBound), upperBound).
  25497. x = Math.min(Math.max(x, lowerBound), upperBound)
  25498. // 2. Round x to the nearest integer, choosing the
  25499. // even integer if it lies halfway between two,
  25500. // and choosing +0 rather than −0.
  25501. if (Math.floor(x) % 2 === 0) {
  25502. x = Math.floor(x)
  25503. } else {
  25504. x = Math.ceil(x)
  25505. }
  25506. // 3. Return x.
  25507. return x
  25508. }
  25509. // 8. If x is NaN, +0, +∞, or −∞, then return +0.
  25510. if (
  25511. Number.isNaN(x) ||
  25512. (x === 0 && Object.is(0, x)) ||
  25513. x === Number.POSITIVE_INFINITY ||
  25514. x === Number.NEGATIVE_INFINITY
  25515. ) {
  25516. return 0
  25517. }
  25518. // 9. Set x to IntegerPart(x).
  25519. x = webidl.util.IntegerPart(x)
  25520. // 10. Set x to x modulo 2^bitLength.
  25521. x = x % Math.pow(2, bitLength)
  25522. // 11. If signedness is "signed" and x ≥ 2^bitLength − 1,
  25523. // then return x − 2^bitLength.
  25524. if (signedness === 'signed' && x >= Math.pow(2, bitLength) - 1) {
  25525. return x - Math.pow(2, bitLength)
  25526. }
  25527. // 12. Otherwise, return x.
  25528. return x
  25529. }
  25530. // https://webidl.spec.whatwg.org/#abstract-opdef-integerpart
  25531. webidl.util.IntegerPart = function (n) {
  25532. // 1. Let r be floor(abs(n)).
  25533. const r = Math.floor(Math.abs(n))
  25534. // 2. If n < 0, then return -1 × r.
  25535. if (n < 0) {
  25536. return -1 * r
  25537. }
  25538. // 3. Otherwise, return r.
  25539. return r
  25540. }
  25541. // https://webidl.spec.whatwg.org/#es-sequence
  25542. webidl.sequenceConverter = function (converter) {
  25543. return (V) => {
  25544. // 1. If Type(V) is not Object, throw a TypeError.
  25545. if (webidl.util.Type(V) !== 'Object') {
  25546. throw webidl.errors.exception({
  25547. header: 'Sequence',
  25548. message: `Value of type ${webidl.util.Type(V)} is not an Object.`
  25549. })
  25550. }
  25551. // 2. Let method be ? GetMethod(V, @@iterator).
  25552. /** @type {Generator} */
  25553. const method = V?.[Symbol.iterator]?.()
  25554. const seq = []
  25555. // 3. If method is undefined, throw a TypeError.
  25556. if (
  25557. method === undefined ||
  25558. typeof method.next !== 'function'
  25559. ) {
  25560. throw webidl.errors.exception({
  25561. header: 'Sequence',
  25562. message: 'Object is not an iterator.'
  25563. })
  25564. }
  25565. // https://webidl.spec.whatwg.org/#create-sequence-from-iterable
  25566. while (true) {
  25567. const { done, value } = method.next()
  25568. if (done) {
  25569. break
  25570. }
  25571. seq.push(converter(value))
  25572. }
  25573. return seq
  25574. }
  25575. }
  25576. // https://webidl.spec.whatwg.org/#es-to-record
  25577. webidl.recordConverter = function (keyConverter, valueConverter) {
  25578. return (O) => {
  25579. // 1. If Type(O) is not Object, throw a TypeError.
  25580. if (webidl.util.Type(O) !== 'Object') {
  25581. throw webidl.errors.exception({
  25582. header: 'Record',
  25583. message: `Value of type ${webidl.util.Type(O)} is not an Object.`
  25584. })
  25585. }
  25586. // 2. Let result be a new empty instance of record<K, V>.
  25587. const result = {}
  25588. if (!types.isProxy(O)) {
  25589. // Object.keys only returns enumerable properties
  25590. const keys = Object.keys(O)
  25591. for (const key of keys) {
  25592. // 1. Let typedKey be key converted to an IDL value of type K.
  25593. const typedKey = keyConverter(key)
  25594. // 2. Let value be ? Get(O, key).
  25595. // 3. Let typedValue be value converted to an IDL value of type V.
  25596. const typedValue = valueConverter(O[key])
  25597. // 4. Set result[typedKey] to typedValue.
  25598. result[typedKey] = typedValue
  25599. }
  25600. // 5. Return result.
  25601. return result
  25602. }
  25603. // 3. Let keys be ? O.[[OwnPropertyKeys]]().
  25604. const keys = Reflect.ownKeys(O)
  25605. // 4. For each key of keys.
  25606. for (const key of keys) {
  25607. // 1. Let desc be ? O.[[GetOwnProperty]](key).
  25608. const desc = Reflect.getOwnPropertyDescriptor(O, key)
  25609. // 2. If desc is not undefined and desc.[[Enumerable]] is true:
  25610. if (desc?.enumerable) {
  25611. // 1. Let typedKey be key converted to an IDL value of type K.
  25612. const typedKey = keyConverter(key)
  25613. // 2. Let value be ? Get(O, key).
  25614. // 3. Let typedValue be value converted to an IDL value of type V.
  25615. const typedValue = valueConverter(O[key])
  25616. // 4. Set result[typedKey] to typedValue.
  25617. result[typedKey] = typedValue
  25618. }
  25619. }
  25620. // 5. Return result.
  25621. return result
  25622. }
  25623. }
  25624. webidl.interfaceConverter = function (i) {
  25625. return (V, opts = {}) => {
  25626. if (opts.strict !== false && !(V instanceof i)) {
  25627. throw webidl.errors.exception({
  25628. header: i.name,
  25629. message: `Expected ${V} to be an instance of ${i.name}.`
  25630. })
  25631. }
  25632. return V
  25633. }
  25634. }
  25635. webidl.dictionaryConverter = function (converters) {
  25636. return (dictionary) => {
  25637. const type = webidl.util.Type(dictionary)
  25638. const dict = {}
  25639. if (type === 'Null' || type === 'Undefined') {
  25640. return dict
  25641. } else if (type !== 'Object') {
  25642. throw webidl.errors.exception({
  25643. header: 'Dictionary',
  25644. message: `Expected ${dictionary} to be one of: Null, Undefined, Object.`
  25645. })
  25646. }
  25647. for (const options of converters) {
  25648. const { key, defaultValue, required, converter } = options
  25649. if (required === true) {
  25650. if (!hasOwn(dictionary, key)) {
  25651. throw webidl.errors.exception({
  25652. header: 'Dictionary',
  25653. message: `Missing required key "${key}".`
  25654. })
  25655. }
  25656. }
  25657. let value = dictionary[key]
  25658. const hasDefault = hasOwn(options, 'defaultValue')
  25659. // Only use defaultValue if value is undefined and
  25660. // a defaultValue options was provided.
  25661. if (hasDefault && value !== null) {
  25662. value = value ?? defaultValue
  25663. }
  25664. // A key can be optional and have no default value.
  25665. // When this happens, do not perform a conversion,
  25666. // and do not assign the key a value.
  25667. if (required || hasDefault || value !== undefined) {
  25668. value = converter(value)
  25669. if (
  25670. options.allowedValues &&
  25671. !options.allowedValues.includes(value)
  25672. ) {
  25673. throw webidl.errors.exception({
  25674. header: 'Dictionary',
  25675. message: `${value} is not an accepted type. Expected one of ${options.allowedValues.join(', ')}.`
  25676. })
  25677. }
  25678. dict[key] = value
  25679. }
  25680. }
  25681. return dict
  25682. }
  25683. }
  25684. webidl.nullableConverter = function (converter) {
  25685. return (V) => {
  25686. if (V === null) {
  25687. return V
  25688. }
  25689. return converter(V)
  25690. }
  25691. }
  25692. // https://webidl.spec.whatwg.org/#es-DOMString
  25693. webidl.converters.DOMString = function (V, opts = {}) {
  25694. // 1. If V is null and the conversion is to an IDL type
  25695. // associated with the [LegacyNullToEmptyString]
  25696. // extended attribute, then return the DOMString value
  25697. // that represents the empty string.
  25698. if (V === null && opts.legacyNullToEmptyString) {
  25699. return ''
  25700. }
  25701. // 2. Let x be ? ToString(V).
  25702. if (typeof V === 'symbol') {
  25703. throw new TypeError('Could not convert argument of type symbol to string.')
  25704. }
  25705. // 3. Return the IDL DOMString value that represents the
  25706. // same sequence of code units as the one the
  25707. // ECMAScript String value x represents.
  25708. return String(V)
  25709. }
  25710. // https://webidl.spec.whatwg.org/#es-ByteString
  25711. webidl.converters.ByteString = function (V) {
  25712. // 1. Let x be ? ToString(V).
  25713. // Note: DOMString converter perform ? ToString(V)
  25714. const x = webidl.converters.DOMString(V)
  25715. // 2. If the value of any element of x is greater than
  25716. // 255, then throw a TypeError.
  25717. for (let index = 0; index < x.length; index++) {
  25718. if (x.charCodeAt(index) > 255) {
  25719. throw new TypeError(
  25720. 'Cannot convert argument to a ByteString because the character at ' +
  25721. `index ${index} has a value of ${x.charCodeAt(index)} which is greater than 255.`
  25722. )
  25723. }
  25724. }
  25725. // 3. Return an IDL ByteString value whose length is the
  25726. // length of x, and where the value of each element is
  25727. // the value of the corresponding element of x.
  25728. return x
  25729. }
  25730. // https://webidl.spec.whatwg.org/#es-USVString
  25731. webidl.converters.USVString = toUSVString
  25732. // https://webidl.spec.whatwg.org/#es-boolean
  25733. webidl.converters.boolean = function (V) {
  25734. // 1. Let x be the result of computing ToBoolean(V).
  25735. const x = Boolean(V)
  25736. // 2. Return the IDL boolean value that is the one that represents
  25737. // the same truth value as the ECMAScript Boolean value x.
  25738. return x
  25739. }
  25740. // https://webidl.spec.whatwg.org/#es-any
  25741. webidl.converters.any = function (V) {
  25742. return V
  25743. }
  25744. // https://webidl.spec.whatwg.org/#es-long-long
  25745. webidl.converters['long long'] = function (V) {
  25746. // 1. Let x be ? ConvertToInt(V, 64, "signed").
  25747. const x = webidl.util.ConvertToInt(V, 64, 'signed')
  25748. // 2. Return the IDL long long value that represents
  25749. // the same numeric value as x.
  25750. return x
  25751. }
  25752. // https://webidl.spec.whatwg.org/#es-unsigned-long-long
  25753. webidl.converters['unsigned long long'] = function (V) {
  25754. // 1. Let x be ? ConvertToInt(V, 64, "unsigned").
  25755. const x = webidl.util.ConvertToInt(V, 64, 'unsigned')
  25756. // 2. Return the IDL unsigned long long value that
  25757. // represents the same numeric value as x.
  25758. return x
  25759. }
  25760. // https://webidl.spec.whatwg.org/#es-unsigned-long
  25761. webidl.converters['unsigned long'] = function (V) {
  25762. // 1. Let x be ? ConvertToInt(V, 32, "unsigned").
  25763. const x = webidl.util.ConvertToInt(V, 32, 'unsigned')
  25764. // 2. Return the IDL unsigned long value that
  25765. // represents the same numeric value as x.
  25766. return x
  25767. }
  25768. // https://webidl.spec.whatwg.org/#es-unsigned-short
  25769. webidl.converters['unsigned short'] = function (V, opts) {
  25770. // 1. Let x be ? ConvertToInt(V, 16, "unsigned").
  25771. const x = webidl.util.ConvertToInt(V, 16, 'unsigned', opts)
  25772. // 2. Return the IDL unsigned short value that represents
  25773. // the same numeric value as x.
  25774. return x
  25775. }
  25776. // https://webidl.spec.whatwg.org/#idl-ArrayBuffer
  25777. webidl.converters.ArrayBuffer = function (V, opts = {}) {
  25778. // 1. If Type(V) is not Object, or V does not have an
  25779. // [[ArrayBufferData]] internal slot, then throw a
  25780. // TypeError.
  25781. // see: https://tc39.es/ecma262/#sec-properties-of-the-arraybuffer-instances
  25782. // see: https://tc39.es/ecma262/#sec-properties-of-the-sharedarraybuffer-instances
  25783. if (
  25784. webidl.util.Type(V) !== 'Object' ||
  25785. !types.isAnyArrayBuffer(V)
  25786. ) {
  25787. throw webidl.errors.conversionFailed({
  25788. prefix: `${V}`,
  25789. argument: `${V}`,
  25790. types: ['ArrayBuffer']
  25791. })
  25792. }
  25793. // 2. If the conversion is not to an IDL type associated
  25794. // with the [AllowShared] extended attribute, and
  25795. // IsSharedArrayBuffer(V) is true, then throw a
  25796. // TypeError.
  25797. if (opts.allowShared === false && types.isSharedArrayBuffer(V)) {
  25798. throw webidl.errors.exception({
  25799. header: 'ArrayBuffer',
  25800. message: 'SharedArrayBuffer is not allowed.'
  25801. })
  25802. }
  25803. // 3. If the conversion is not to an IDL type associated
  25804. // with the [AllowResizable] extended attribute, and
  25805. // IsResizableArrayBuffer(V) is true, then throw a
  25806. // TypeError.
  25807. // Note: resizable ArrayBuffers are currently a proposal.
  25808. // 4. Return the IDL ArrayBuffer value that is a
  25809. // reference to the same object as V.
  25810. return V
  25811. }
  25812. webidl.converters.TypedArray = function (V, T, opts = {}) {
  25813. // 1. Let T be the IDL type V is being converted to.
  25814. // 2. If Type(V) is not Object, or V does not have a
  25815. // [[TypedArrayName]] internal slot with a value
  25816. // equal to T’s name, then throw a TypeError.
  25817. if (
  25818. webidl.util.Type(V) !== 'Object' ||
  25819. !types.isTypedArray(V) ||
  25820. V.constructor.name !== T.name
  25821. ) {
  25822. throw webidl.errors.conversionFailed({
  25823. prefix: `${T.name}`,
  25824. argument: `${V}`,
  25825. types: [T.name]
  25826. })
  25827. }
  25828. // 3. If the conversion is not to an IDL type associated
  25829. // with the [AllowShared] extended attribute, and
  25830. // IsSharedArrayBuffer(V.[[ViewedArrayBuffer]]) is
  25831. // true, then throw a TypeError.
  25832. if (opts.allowShared === false && types.isSharedArrayBuffer(V.buffer)) {
  25833. throw webidl.errors.exception({
  25834. header: 'ArrayBuffer',
  25835. message: 'SharedArrayBuffer is not allowed.'
  25836. })
  25837. }
  25838. // 4. If the conversion is not to an IDL type associated
  25839. // with the [AllowResizable] extended attribute, and
  25840. // IsResizableArrayBuffer(V.[[ViewedArrayBuffer]]) is
  25841. // true, then throw a TypeError.
  25842. // Note: resizable array buffers are currently a proposal
  25843. // 5. Return the IDL value of type T that is a reference
  25844. // to the same object as V.
  25845. return V
  25846. }
  25847. webidl.converters.DataView = function (V, opts = {}) {
  25848. // 1. If Type(V) is not Object, or V does not have a
  25849. // [[DataView]] internal slot, then throw a TypeError.
  25850. if (webidl.util.Type(V) !== 'Object' || !types.isDataView(V)) {
  25851. throw webidl.errors.exception({
  25852. header: 'DataView',
  25853. message: 'Object is not a DataView.'
  25854. })
  25855. }
  25856. // 2. If the conversion is not to an IDL type associated
  25857. // with the [AllowShared] extended attribute, and
  25858. // IsSharedArrayBuffer(V.[[ViewedArrayBuffer]]) is true,
  25859. // then throw a TypeError.
  25860. if (opts.allowShared === false && types.isSharedArrayBuffer(V.buffer)) {
  25861. throw webidl.errors.exception({
  25862. header: 'ArrayBuffer',
  25863. message: 'SharedArrayBuffer is not allowed.'
  25864. })
  25865. }
  25866. // 3. If the conversion is not to an IDL type associated
  25867. // with the [AllowResizable] extended attribute, and
  25868. // IsResizableArrayBuffer(V.[[ViewedArrayBuffer]]) is
  25869. // true, then throw a TypeError.
  25870. // Note: resizable ArrayBuffers are currently a proposal
  25871. // 4. Return the IDL DataView value that is a reference
  25872. // to the same object as V.
  25873. return V
  25874. }
  25875. // https://webidl.spec.whatwg.org/#BufferSource
  25876. webidl.converters.BufferSource = function (V, opts = {}) {
  25877. if (types.isAnyArrayBuffer(V)) {
  25878. return webidl.converters.ArrayBuffer(V, opts)
  25879. }
  25880. if (types.isTypedArray(V)) {
  25881. return webidl.converters.TypedArray(V, V.constructor)
  25882. }
  25883. if (types.isDataView(V)) {
  25884. return webidl.converters.DataView(V, opts)
  25885. }
  25886. throw new TypeError(`Could not convert ${V} to a BufferSource.`)
  25887. }
  25888. webidl.converters['sequence<ByteString>'] = webidl.sequenceConverter(
  25889. webidl.converters.ByteString
  25890. )
  25891. webidl.converters['sequence<sequence<ByteString>>'] = webidl.sequenceConverter(
  25892. webidl.converters['sequence<ByteString>']
  25893. )
  25894. webidl.converters['record<ByteString, ByteString>'] = webidl.recordConverter(
  25895. webidl.converters.ByteString,
  25896. webidl.converters.ByteString
  25897. )
  25898. module.exports = {
  25899. webidl
  25900. }
  25901. /***/ }),
  25902. /***/ 4854:
  25903. /***/ ((module) => {
  25904. "use strict";
  25905. /**
  25906. * @see https://encoding.spec.whatwg.org/#concept-encoding-get
  25907. * @param {string|undefined} label
  25908. */
  25909. function getEncoding (label) {
  25910. if (!label) {
  25911. return 'failure'
  25912. }
  25913. // 1. Remove any leading and trailing ASCII whitespace from label.
  25914. // 2. If label is an ASCII case-insensitive match for any of the
  25915. // labels listed in the table below, then return the
  25916. // corresponding encoding; otherwise return failure.
  25917. switch (label.trim().toLowerCase()) {
  25918. case 'unicode-1-1-utf-8':
  25919. case 'unicode11utf8':
  25920. case 'unicode20utf8':
  25921. case 'utf-8':
  25922. case 'utf8':
  25923. case 'x-unicode20utf8':
  25924. return 'UTF-8'
  25925. case '866':
  25926. case 'cp866':
  25927. case 'csibm866':
  25928. case 'ibm866':
  25929. return 'IBM866'
  25930. case 'csisolatin2':
  25931. case 'iso-8859-2':
  25932. case 'iso-ir-101':
  25933. case 'iso8859-2':
  25934. case 'iso88592':
  25935. case 'iso_8859-2':
  25936. case 'iso_8859-2:1987':
  25937. case 'l2':
  25938. case 'latin2':
  25939. return 'ISO-8859-2'
  25940. case 'csisolatin3':
  25941. case 'iso-8859-3':
  25942. case 'iso-ir-109':
  25943. case 'iso8859-3':
  25944. case 'iso88593':
  25945. case 'iso_8859-3':
  25946. case 'iso_8859-3:1988':
  25947. case 'l3':
  25948. case 'latin3':
  25949. return 'ISO-8859-3'
  25950. case 'csisolatin4':
  25951. case 'iso-8859-4':
  25952. case 'iso-ir-110':
  25953. case 'iso8859-4':
  25954. case 'iso88594':
  25955. case 'iso_8859-4':
  25956. case 'iso_8859-4:1988':
  25957. case 'l4':
  25958. case 'latin4':
  25959. return 'ISO-8859-4'
  25960. case 'csisolatincyrillic':
  25961. case 'cyrillic':
  25962. case 'iso-8859-5':
  25963. case 'iso-ir-144':
  25964. case 'iso8859-5':
  25965. case 'iso88595':
  25966. case 'iso_8859-5':
  25967. case 'iso_8859-5:1988':
  25968. return 'ISO-8859-5'
  25969. case 'arabic':
  25970. case 'asmo-708':
  25971. case 'csiso88596e':
  25972. case 'csiso88596i':
  25973. case 'csisolatinarabic':
  25974. case 'ecma-114':
  25975. case 'iso-8859-6':
  25976. case 'iso-8859-6-e':
  25977. case 'iso-8859-6-i':
  25978. case 'iso-ir-127':
  25979. case 'iso8859-6':
  25980. case 'iso88596':
  25981. case 'iso_8859-6':
  25982. case 'iso_8859-6:1987':
  25983. return 'ISO-8859-6'
  25984. case 'csisolatingreek':
  25985. case 'ecma-118':
  25986. case 'elot_928':
  25987. case 'greek':
  25988. case 'greek8':
  25989. case 'iso-8859-7':
  25990. case 'iso-ir-126':
  25991. case 'iso8859-7':
  25992. case 'iso88597':
  25993. case 'iso_8859-7':
  25994. case 'iso_8859-7:1987':
  25995. case 'sun_eu_greek':
  25996. return 'ISO-8859-7'
  25997. case 'csiso88598e':
  25998. case 'csisolatinhebrew':
  25999. case 'hebrew':
  26000. case 'iso-8859-8':
  26001. case 'iso-8859-8-e':
  26002. case 'iso-ir-138':
  26003. case 'iso8859-8':
  26004. case 'iso88598':
  26005. case 'iso_8859-8':
  26006. case 'iso_8859-8:1988':
  26007. case 'visual':
  26008. return 'ISO-8859-8'
  26009. case 'csiso88598i':
  26010. case 'iso-8859-8-i':
  26011. case 'logical':
  26012. return 'ISO-8859-8-I'
  26013. case 'csisolatin6':
  26014. case 'iso-8859-10':
  26015. case 'iso-ir-157':
  26016. case 'iso8859-10':
  26017. case 'iso885910':
  26018. case 'l6':
  26019. case 'latin6':
  26020. return 'ISO-8859-10'
  26021. case 'iso-8859-13':
  26022. case 'iso8859-13':
  26023. case 'iso885913':
  26024. return 'ISO-8859-13'
  26025. case 'iso-8859-14':
  26026. case 'iso8859-14':
  26027. case 'iso885914':
  26028. return 'ISO-8859-14'
  26029. case 'csisolatin9':
  26030. case 'iso-8859-15':
  26031. case 'iso8859-15':
  26032. case 'iso885915':
  26033. case 'iso_8859-15':
  26034. case 'l9':
  26035. return 'ISO-8859-15'
  26036. case 'iso-8859-16':
  26037. return 'ISO-8859-16'
  26038. case 'cskoi8r':
  26039. case 'koi':
  26040. case 'koi8':
  26041. case 'koi8-r':
  26042. case 'koi8_r':
  26043. return 'KOI8-R'
  26044. case 'koi8-ru':
  26045. case 'koi8-u':
  26046. return 'KOI8-U'
  26047. case 'csmacintosh':
  26048. case 'mac':
  26049. case 'macintosh':
  26050. case 'x-mac-roman':
  26051. return 'macintosh'
  26052. case 'iso-8859-11':
  26053. case 'iso8859-11':
  26054. case 'iso885911':
  26055. case 'tis-620':
  26056. case 'windows-874':
  26057. return 'windows-874'
  26058. case 'cp1250':
  26059. case 'windows-1250':
  26060. case 'x-cp1250':
  26061. return 'windows-1250'
  26062. case 'cp1251':
  26063. case 'windows-1251':
  26064. case 'x-cp1251':
  26065. return 'windows-1251'
  26066. case 'ansi_x3.4-1968':
  26067. case 'ascii':
  26068. case 'cp1252':
  26069. case 'cp819':
  26070. case 'csisolatin1':
  26071. case 'ibm819':
  26072. case 'iso-8859-1':
  26073. case 'iso-ir-100':
  26074. case 'iso8859-1':
  26075. case 'iso88591':
  26076. case 'iso_8859-1':
  26077. case 'iso_8859-1:1987':
  26078. case 'l1':
  26079. case 'latin1':
  26080. case 'us-ascii':
  26081. case 'windows-1252':
  26082. case 'x-cp1252':
  26083. return 'windows-1252'
  26084. case 'cp1253':
  26085. case 'windows-1253':
  26086. case 'x-cp1253':
  26087. return 'windows-1253'
  26088. case 'cp1254':
  26089. case 'csisolatin5':
  26090. case 'iso-8859-9':
  26091. case 'iso-ir-148':
  26092. case 'iso8859-9':
  26093. case 'iso88599':
  26094. case 'iso_8859-9':
  26095. case 'iso_8859-9:1989':
  26096. case 'l5':
  26097. case 'latin5':
  26098. case 'windows-1254':
  26099. case 'x-cp1254':
  26100. return 'windows-1254'
  26101. case 'cp1255':
  26102. case 'windows-1255':
  26103. case 'x-cp1255':
  26104. return 'windows-1255'
  26105. case 'cp1256':
  26106. case 'windows-1256':
  26107. case 'x-cp1256':
  26108. return 'windows-1256'
  26109. case 'cp1257':
  26110. case 'windows-1257':
  26111. case 'x-cp1257':
  26112. return 'windows-1257'
  26113. case 'cp1258':
  26114. case 'windows-1258':
  26115. case 'x-cp1258':
  26116. return 'windows-1258'
  26117. case 'x-mac-cyrillic':
  26118. case 'x-mac-ukrainian':
  26119. return 'x-mac-cyrillic'
  26120. case 'chinese':
  26121. case 'csgb2312':
  26122. case 'csiso58gb231280':
  26123. case 'gb2312':
  26124. case 'gb_2312':
  26125. case 'gb_2312-80':
  26126. case 'gbk':
  26127. case 'iso-ir-58':
  26128. case 'x-gbk':
  26129. return 'GBK'
  26130. case 'gb18030':
  26131. return 'gb18030'
  26132. case 'big5':
  26133. case 'big5-hkscs':
  26134. case 'cn-big5':
  26135. case 'csbig5':
  26136. case 'x-x-big5':
  26137. return 'Big5'
  26138. case 'cseucpkdfmtjapanese':
  26139. case 'euc-jp':
  26140. case 'x-euc-jp':
  26141. return 'EUC-JP'
  26142. case 'csiso2022jp':
  26143. case 'iso-2022-jp':
  26144. return 'ISO-2022-JP'
  26145. case 'csshiftjis':
  26146. case 'ms932':
  26147. case 'ms_kanji':
  26148. case 'shift-jis':
  26149. case 'shift_jis':
  26150. case 'sjis':
  26151. case 'windows-31j':
  26152. case 'x-sjis':
  26153. return 'Shift_JIS'
  26154. case 'cseuckr':
  26155. case 'csksc56011987':
  26156. case 'euc-kr':
  26157. case 'iso-ir-149':
  26158. case 'korean':
  26159. case 'ks_c_5601-1987':
  26160. case 'ks_c_5601-1989':
  26161. case 'ksc5601':
  26162. case 'ksc_5601':
  26163. case 'windows-949':
  26164. return 'EUC-KR'
  26165. case 'csiso2022kr':
  26166. case 'hz-gb-2312':
  26167. case 'iso-2022-cn':
  26168. case 'iso-2022-cn-ext':
  26169. case 'iso-2022-kr':
  26170. case 'replacement':
  26171. return 'replacement'
  26172. case 'unicodefffe':
  26173. case 'utf-16be':
  26174. return 'UTF-16BE'
  26175. case 'csunicode':
  26176. case 'iso-10646-ucs-2':
  26177. case 'ucs-2':
  26178. case 'unicode':
  26179. case 'unicodefeff':
  26180. case 'utf-16':
  26181. case 'utf-16le':
  26182. return 'UTF-16LE'
  26183. case 'x-user-defined':
  26184. return 'x-user-defined'
  26185. default: return 'failure'
  26186. }
  26187. }
  26188. module.exports = {
  26189. getEncoding
  26190. }
  26191. /***/ }),
  26192. /***/ 1446:
  26193. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  26194. "use strict";
  26195. const {
  26196. staticPropertyDescriptors,
  26197. readOperation,
  26198. fireAProgressEvent
  26199. } = __nccwpck_require__(7530)
  26200. const {
  26201. kState,
  26202. kError,
  26203. kResult,
  26204. kEvents,
  26205. kAborted
  26206. } = __nccwpck_require__(9054)
  26207. const { webidl } = __nccwpck_require__(1744)
  26208. const { kEnumerableProperty } = __nccwpck_require__(3983)
  26209. class FileReader extends EventTarget {
  26210. constructor () {
  26211. super()
  26212. this[kState] = 'empty'
  26213. this[kResult] = null
  26214. this[kError] = null
  26215. this[kEvents] = {
  26216. loadend: null,
  26217. error: null,
  26218. abort: null,
  26219. load: null,
  26220. progress: null,
  26221. loadstart: null
  26222. }
  26223. }
  26224. /**
  26225. * @see https://w3c.github.io/FileAPI/#dfn-readAsArrayBuffer
  26226. * @param {import('buffer').Blob} blob
  26227. */
  26228. readAsArrayBuffer (blob) {
  26229. webidl.brandCheck(this, FileReader)
  26230. webidl.argumentLengthCheck(arguments, 1, { header: 'FileReader.readAsArrayBuffer' })
  26231. blob = webidl.converters.Blob(blob, { strict: false })
  26232. // The readAsArrayBuffer(blob) method, when invoked,
  26233. // must initiate a read operation for blob with ArrayBuffer.
  26234. readOperation(this, blob, 'ArrayBuffer')
  26235. }
  26236. /**
  26237. * @see https://w3c.github.io/FileAPI/#readAsBinaryString
  26238. * @param {import('buffer').Blob} blob
  26239. */
  26240. readAsBinaryString (blob) {
  26241. webidl.brandCheck(this, FileReader)
  26242. webidl.argumentLengthCheck(arguments, 1, { header: 'FileReader.readAsBinaryString' })
  26243. blob = webidl.converters.Blob(blob, { strict: false })
  26244. // The readAsBinaryString(blob) method, when invoked,
  26245. // must initiate a read operation for blob with BinaryString.
  26246. readOperation(this, blob, 'BinaryString')
  26247. }
  26248. /**
  26249. * @see https://w3c.github.io/FileAPI/#readAsDataText
  26250. * @param {import('buffer').Blob} blob
  26251. * @param {string?} encoding
  26252. */
  26253. readAsText (blob, encoding = undefined) {
  26254. webidl.brandCheck(this, FileReader)
  26255. webidl.argumentLengthCheck(arguments, 1, { header: 'FileReader.readAsText' })
  26256. blob = webidl.converters.Blob(blob, { strict: false })
  26257. if (encoding !== undefined) {
  26258. encoding = webidl.converters.DOMString(encoding)
  26259. }
  26260. // The readAsText(blob, encoding) method, when invoked,
  26261. // must initiate a read operation for blob with Text and encoding.
  26262. readOperation(this, blob, 'Text', encoding)
  26263. }
  26264. /**
  26265. * @see https://w3c.github.io/FileAPI/#dfn-readAsDataURL
  26266. * @param {import('buffer').Blob} blob
  26267. */
  26268. readAsDataURL (blob) {
  26269. webidl.brandCheck(this, FileReader)
  26270. webidl.argumentLengthCheck(arguments, 1, { header: 'FileReader.readAsDataURL' })
  26271. blob = webidl.converters.Blob(blob, { strict: false })
  26272. // The readAsDataURL(blob) method, when invoked, must
  26273. // initiate a read operation for blob with DataURL.
  26274. readOperation(this, blob, 'DataURL')
  26275. }
  26276. /**
  26277. * @see https://w3c.github.io/FileAPI/#dfn-abort
  26278. */
  26279. abort () {
  26280. // 1. If this's state is "empty" or if this's state is
  26281. // "done" set this's result to null and terminate
  26282. // this algorithm.
  26283. if (this[kState] === 'empty' || this[kState] === 'done') {
  26284. this[kResult] = null
  26285. return
  26286. }
  26287. // 2. If this's state is "loading" set this's state to
  26288. // "done" and set this's result to null.
  26289. if (this[kState] === 'loading') {
  26290. this[kState] = 'done'
  26291. this[kResult] = null
  26292. }
  26293. // 3. If there are any tasks from this on the file reading
  26294. // task source in an affiliated task queue, then remove
  26295. // those tasks from that task queue.
  26296. this[kAborted] = true
  26297. // 4. Terminate the algorithm for the read method being processed.
  26298. // TODO
  26299. // 5. Fire a progress event called abort at this.
  26300. fireAProgressEvent('abort', this)
  26301. // 6. If this's state is not "loading", fire a progress
  26302. // event called loadend at this.
  26303. if (this[kState] !== 'loading') {
  26304. fireAProgressEvent('loadend', this)
  26305. }
  26306. }
  26307. /**
  26308. * @see https://w3c.github.io/FileAPI/#dom-filereader-readystate
  26309. */
  26310. get readyState () {
  26311. webidl.brandCheck(this, FileReader)
  26312. switch (this[kState]) {
  26313. case 'empty': return this.EMPTY
  26314. case 'loading': return this.LOADING
  26315. case 'done': return this.DONE
  26316. }
  26317. }
  26318. /**
  26319. * @see https://w3c.github.io/FileAPI/#dom-filereader-result
  26320. */
  26321. get result () {
  26322. webidl.brandCheck(this, FileReader)
  26323. // The result attribute’s getter, when invoked, must return
  26324. // this's result.
  26325. return this[kResult]
  26326. }
  26327. /**
  26328. * @see https://w3c.github.io/FileAPI/#dom-filereader-error
  26329. */
  26330. get error () {
  26331. webidl.brandCheck(this, FileReader)
  26332. // The error attribute’s getter, when invoked, must return
  26333. // this's error.
  26334. return this[kError]
  26335. }
  26336. get onloadend () {
  26337. webidl.brandCheck(this, FileReader)
  26338. return this[kEvents].loadend
  26339. }
  26340. set onloadend (fn) {
  26341. webidl.brandCheck(this, FileReader)
  26342. if (this[kEvents].loadend) {
  26343. this.removeEventListener('loadend', this[kEvents].loadend)
  26344. }
  26345. if (typeof fn === 'function') {
  26346. this[kEvents].loadend = fn
  26347. this.addEventListener('loadend', fn)
  26348. } else {
  26349. this[kEvents].loadend = null
  26350. }
  26351. }
  26352. get onerror () {
  26353. webidl.brandCheck(this, FileReader)
  26354. return this[kEvents].error
  26355. }
  26356. set onerror (fn) {
  26357. webidl.brandCheck(this, FileReader)
  26358. if (this[kEvents].error) {
  26359. this.removeEventListener('error', this[kEvents].error)
  26360. }
  26361. if (typeof fn === 'function') {
  26362. this[kEvents].error = fn
  26363. this.addEventListener('error', fn)
  26364. } else {
  26365. this[kEvents].error = null
  26366. }
  26367. }
  26368. get onloadstart () {
  26369. webidl.brandCheck(this, FileReader)
  26370. return this[kEvents].loadstart
  26371. }
  26372. set onloadstart (fn) {
  26373. webidl.brandCheck(this, FileReader)
  26374. if (this[kEvents].loadstart) {
  26375. this.removeEventListener('loadstart', this[kEvents].loadstart)
  26376. }
  26377. if (typeof fn === 'function') {
  26378. this[kEvents].loadstart = fn
  26379. this.addEventListener('loadstart', fn)
  26380. } else {
  26381. this[kEvents].loadstart = null
  26382. }
  26383. }
  26384. get onprogress () {
  26385. webidl.brandCheck(this, FileReader)
  26386. return this[kEvents].progress
  26387. }
  26388. set onprogress (fn) {
  26389. webidl.brandCheck(this, FileReader)
  26390. if (this[kEvents].progress) {
  26391. this.removeEventListener('progress', this[kEvents].progress)
  26392. }
  26393. if (typeof fn === 'function') {
  26394. this[kEvents].progress = fn
  26395. this.addEventListener('progress', fn)
  26396. } else {
  26397. this[kEvents].progress = null
  26398. }
  26399. }
  26400. get onload () {
  26401. webidl.brandCheck(this, FileReader)
  26402. return this[kEvents].load
  26403. }
  26404. set onload (fn) {
  26405. webidl.brandCheck(this, FileReader)
  26406. if (this[kEvents].load) {
  26407. this.removeEventListener('load', this[kEvents].load)
  26408. }
  26409. if (typeof fn === 'function') {
  26410. this[kEvents].load = fn
  26411. this.addEventListener('load', fn)
  26412. } else {
  26413. this[kEvents].load = null
  26414. }
  26415. }
  26416. get onabort () {
  26417. webidl.brandCheck(this, FileReader)
  26418. return this[kEvents].abort
  26419. }
  26420. set onabort (fn) {
  26421. webidl.brandCheck(this, FileReader)
  26422. if (this[kEvents].abort) {
  26423. this.removeEventListener('abort', this[kEvents].abort)
  26424. }
  26425. if (typeof fn === 'function') {
  26426. this[kEvents].abort = fn
  26427. this.addEventListener('abort', fn)
  26428. } else {
  26429. this[kEvents].abort = null
  26430. }
  26431. }
  26432. }
  26433. // https://w3c.github.io/FileAPI/#dom-filereader-empty
  26434. FileReader.EMPTY = FileReader.prototype.EMPTY = 0
  26435. // https://w3c.github.io/FileAPI/#dom-filereader-loading
  26436. FileReader.LOADING = FileReader.prototype.LOADING = 1
  26437. // https://w3c.github.io/FileAPI/#dom-filereader-done
  26438. FileReader.DONE = FileReader.prototype.DONE = 2
  26439. Object.defineProperties(FileReader.prototype, {
  26440. EMPTY: staticPropertyDescriptors,
  26441. LOADING: staticPropertyDescriptors,
  26442. DONE: staticPropertyDescriptors,
  26443. readAsArrayBuffer: kEnumerableProperty,
  26444. readAsBinaryString: kEnumerableProperty,
  26445. readAsText: kEnumerableProperty,
  26446. readAsDataURL: kEnumerableProperty,
  26447. abort: kEnumerableProperty,
  26448. readyState: kEnumerableProperty,
  26449. result: kEnumerableProperty,
  26450. error: kEnumerableProperty,
  26451. onloadstart: kEnumerableProperty,
  26452. onprogress: kEnumerableProperty,
  26453. onload: kEnumerableProperty,
  26454. onabort: kEnumerableProperty,
  26455. onerror: kEnumerableProperty,
  26456. onloadend: kEnumerableProperty,
  26457. [Symbol.toStringTag]: {
  26458. value: 'FileReader',
  26459. writable: false,
  26460. enumerable: false,
  26461. configurable: true
  26462. }
  26463. })
  26464. Object.defineProperties(FileReader, {
  26465. EMPTY: staticPropertyDescriptors,
  26466. LOADING: staticPropertyDescriptors,
  26467. DONE: staticPropertyDescriptors
  26468. })
  26469. module.exports = {
  26470. FileReader
  26471. }
  26472. /***/ }),
  26473. /***/ 5504:
  26474. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  26475. "use strict";
  26476. const { webidl } = __nccwpck_require__(1744)
  26477. const kState = Symbol('ProgressEvent state')
  26478. /**
  26479. * @see https://xhr.spec.whatwg.org/#progressevent
  26480. */
  26481. class ProgressEvent extends Event {
  26482. constructor (type, eventInitDict = {}) {
  26483. type = webidl.converters.DOMString(type)
  26484. eventInitDict = webidl.converters.ProgressEventInit(eventInitDict ?? {})
  26485. super(type, eventInitDict)
  26486. this[kState] = {
  26487. lengthComputable: eventInitDict.lengthComputable,
  26488. loaded: eventInitDict.loaded,
  26489. total: eventInitDict.total
  26490. }
  26491. }
  26492. get lengthComputable () {
  26493. webidl.brandCheck(this, ProgressEvent)
  26494. return this[kState].lengthComputable
  26495. }
  26496. get loaded () {
  26497. webidl.brandCheck(this, ProgressEvent)
  26498. return this[kState].loaded
  26499. }
  26500. get total () {
  26501. webidl.brandCheck(this, ProgressEvent)
  26502. return this[kState].total
  26503. }
  26504. }
  26505. webidl.converters.ProgressEventInit = webidl.dictionaryConverter([
  26506. {
  26507. key: 'lengthComputable',
  26508. converter: webidl.converters.boolean,
  26509. defaultValue: false
  26510. },
  26511. {
  26512. key: 'loaded',
  26513. converter: webidl.converters['unsigned long long'],
  26514. defaultValue: 0
  26515. },
  26516. {
  26517. key: 'total',
  26518. converter: webidl.converters['unsigned long long'],
  26519. defaultValue: 0
  26520. },
  26521. {
  26522. key: 'bubbles',
  26523. converter: webidl.converters.boolean,
  26524. defaultValue: false
  26525. },
  26526. {
  26527. key: 'cancelable',
  26528. converter: webidl.converters.boolean,
  26529. defaultValue: false
  26530. },
  26531. {
  26532. key: 'composed',
  26533. converter: webidl.converters.boolean,
  26534. defaultValue: false
  26535. }
  26536. ])
  26537. module.exports = {
  26538. ProgressEvent
  26539. }
  26540. /***/ }),
  26541. /***/ 9054:
  26542. /***/ ((module) => {
  26543. "use strict";
  26544. module.exports = {
  26545. kState: Symbol('FileReader state'),
  26546. kResult: Symbol('FileReader result'),
  26547. kError: Symbol('FileReader error'),
  26548. kLastProgressEventFired: Symbol('FileReader last progress event fired timestamp'),
  26549. kEvents: Symbol('FileReader events'),
  26550. kAborted: Symbol('FileReader aborted')
  26551. }
  26552. /***/ }),
  26553. /***/ 7530:
  26554. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  26555. "use strict";
  26556. const {
  26557. kState,
  26558. kError,
  26559. kResult,
  26560. kAborted,
  26561. kLastProgressEventFired
  26562. } = __nccwpck_require__(9054)
  26563. const { ProgressEvent } = __nccwpck_require__(5504)
  26564. const { getEncoding } = __nccwpck_require__(4854)
  26565. const { DOMException } = __nccwpck_require__(1037)
  26566. const { serializeAMimeType, parseMIMEType } = __nccwpck_require__(685)
  26567. const { types } = __nccwpck_require__(3837)
  26568. const { StringDecoder } = __nccwpck_require__(1576)
  26569. const { btoa } = __nccwpck_require__(4300)
  26570. /** @type {PropertyDescriptor} */
  26571. const staticPropertyDescriptors = {
  26572. enumerable: true,
  26573. writable: false,
  26574. configurable: false
  26575. }
  26576. /**
  26577. * @see https://w3c.github.io/FileAPI/#readOperation
  26578. * @param {import('./filereader').FileReader} fr
  26579. * @param {import('buffer').Blob} blob
  26580. * @param {string} type
  26581. * @param {string?} encodingName
  26582. */
  26583. function readOperation (fr, blob, type, encodingName) {
  26584. // 1. If fr’s state is "loading", throw an InvalidStateError
  26585. // DOMException.
  26586. if (fr[kState] === 'loading') {
  26587. throw new DOMException('Invalid state', 'InvalidStateError')
  26588. }
  26589. // 2. Set fr’s state to "loading".
  26590. fr[kState] = 'loading'
  26591. // 3. Set fr’s result to null.
  26592. fr[kResult] = null
  26593. // 4. Set fr’s error to null.
  26594. fr[kError] = null
  26595. // 5. Let stream be the result of calling get stream on blob.
  26596. /** @type {import('stream/web').ReadableStream} */
  26597. const stream = blob.stream()
  26598. // 6. Let reader be the result of getting a reader from stream.
  26599. const reader = stream.getReader()
  26600. // 7. Let bytes be an empty byte sequence.
  26601. /** @type {Uint8Array[]} */
  26602. const bytes = []
  26603. // 8. Let chunkPromise be the result of reading a chunk from
  26604. // stream with reader.
  26605. let chunkPromise = reader.read()
  26606. // 9. Let isFirstChunk be true.
  26607. let isFirstChunk = true
  26608. // 10. In parallel, while true:
  26609. // Note: "In parallel" just means non-blocking
  26610. // Note 2: readOperation itself cannot be async as double
  26611. // reading the body would then reject the promise, instead
  26612. // of throwing an error.
  26613. ;(async () => {
  26614. while (!fr[kAborted]) {
  26615. // 1. Wait for chunkPromise to be fulfilled or rejected.
  26616. try {
  26617. const { done, value } = await chunkPromise
  26618. // 2. If chunkPromise is fulfilled, and isFirstChunk is
  26619. // true, queue a task to fire a progress event called
  26620. // loadstart at fr.
  26621. if (isFirstChunk && !fr[kAborted]) {
  26622. queueMicrotask(() => {
  26623. fireAProgressEvent('loadstart', fr)
  26624. })
  26625. }
  26626. // 3. Set isFirstChunk to false.
  26627. isFirstChunk = false
  26628. // 4. If chunkPromise is fulfilled with an object whose
  26629. // done property is false and whose value property is
  26630. // a Uint8Array object, run these steps:
  26631. if (!done && types.isUint8Array(value)) {
  26632. // 1. Let bs be the byte sequence represented by the
  26633. // Uint8Array object.
  26634. // 2. Append bs to bytes.
  26635. bytes.push(value)
  26636. // 3. If roughly 50ms have passed since these steps
  26637. // were last invoked, queue a task to fire a
  26638. // progress event called progress at fr.
  26639. if (
  26640. (
  26641. fr[kLastProgressEventFired] === undefined ||
  26642. Date.now() - fr[kLastProgressEventFired] >= 50
  26643. ) &&
  26644. !fr[kAborted]
  26645. ) {
  26646. fr[kLastProgressEventFired] = Date.now()
  26647. queueMicrotask(() => {
  26648. fireAProgressEvent('progress', fr)
  26649. })
  26650. }
  26651. // 4. Set chunkPromise to the result of reading a
  26652. // chunk from stream with reader.
  26653. chunkPromise = reader.read()
  26654. } else if (done) {
  26655. // 5. Otherwise, if chunkPromise is fulfilled with an
  26656. // object whose done property is true, queue a task
  26657. // to run the following steps and abort this algorithm:
  26658. queueMicrotask(() => {
  26659. // 1. Set fr’s state to "done".
  26660. fr[kState] = 'done'
  26661. // 2. Let result be the result of package data given
  26662. // bytes, type, blob’s type, and encodingName.
  26663. try {
  26664. const result = packageData(bytes, type, blob.type, encodingName)
  26665. // 4. Else:
  26666. if (fr[kAborted]) {
  26667. return
  26668. }
  26669. // 1. Set fr’s result to result.
  26670. fr[kResult] = result
  26671. // 2. Fire a progress event called load at the fr.
  26672. fireAProgressEvent('load', fr)
  26673. } catch (error) {
  26674. // 3. If package data threw an exception error:
  26675. // 1. Set fr’s error to error.
  26676. fr[kError] = error
  26677. // 2. Fire a progress event called error at fr.
  26678. fireAProgressEvent('error', fr)
  26679. }
  26680. // 5. If fr’s state is not "loading", fire a progress
  26681. // event called loadend at the fr.
  26682. if (fr[kState] !== 'loading') {
  26683. fireAProgressEvent('loadend', fr)
  26684. }
  26685. })
  26686. break
  26687. }
  26688. } catch (error) {
  26689. if (fr[kAborted]) {
  26690. return
  26691. }
  26692. // 6. Otherwise, if chunkPromise is rejected with an
  26693. // error error, queue a task to run the following
  26694. // steps and abort this algorithm:
  26695. queueMicrotask(() => {
  26696. // 1. Set fr’s state to "done".
  26697. fr[kState] = 'done'
  26698. // 2. Set fr’s error to error.
  26699. fr[kError] = error
  26700. // 3. Fire a progress event called error at fr.
  26701. fireAProgressEvent('error', fr)
  26702. // 4. If fr’s state is not "loading", fire a progress
  26703. // event called loadend at fr.
  26704. if (fr[kState] !== 'loading') {
  26705. fireAProgressEvent('loadend', fr)
  26706. }
  26707. })
  26708. break
  26709. }
  26710. }
  26711. })()
  26712. }
  26713. /**
  26714. * @see https://w3c.github.io/FileAPI/#fire-a-progress-event
  26715. * @see https://dom.spec.whatwg.org/#concept-event-fire
  26716. * @param {string} e The name of the event
  26717. * @param {import('./filereader').FileReader} reader
  26718. */
  26719. function fireAProgressEvent (e, reader) {
  26720. // The progress event e does not bubble. e.bubbles must be false
  26721. // The progress event e is NOT cancelable. e.cancelable must be false
  26722. const event = new ProgressEvent(e, {
  26723. bubbles: false,
  26724. cancelable: false
  26725. })
  26726. reader.dispatchEvent(event)
  26727. }
  26728. /**
  26729. * @see https://w3c.github.io/FileAPI/#blob-package-data
  26730. * @param {Uint8Array[]} bytes
  26731. * @param {string} type
  26732. * @param {string?} mimeType
  26733. * @param {string?} encodingName
  26734. */
  26735. function packageData (bytes, type, mimeType, encodingName) {
  26736. // 1. A Blob has an associated package data algorithm, given
  26737. // bytes, a type, a optional mimeType, and a optional
  26738. // encodingName, which switches on type and runs the
  26739. // associated steps:
  26740. switch (type) {
  26741. case 'DataURL': {
  26742. // 1. Return bytes as a DataURL [RFC2397] subject to
  26743. // the considerations below:
  26744. // * Use mimeType as part of the Data URL if it is
  26745. // available in keeping with the Data URL
  26746. // specification [RFC2397].
  26747. // * If mimeType is not available return a Data URL
  26748. // without a media-type. [RFC2397].
  26749. // https://datatracker.ietf.org/doc/html/rfc2397#section-3
  26750. // dataurl := "data:" [ mediatype ] [ ";base64" ] "," data
  26751. // mediatype := [ type "/" subtype ] *( ";" parameter )
  26752. // data := *urlchar
  26753. // parameter := attribute "=" value
  26754. let dataURL = 'data:'
  26755. const parsed = parseMIMEType(mimeType || 'application/octet-stream')
  26756. if (parsed !== 'failure') {
  26757. dataURL += serializeAMimeType(parsed)
  26758. }
  26759. dataURL += ';base64,'
  26760. const decoder = new StringDecoder('latin1')
  26761. for (const chunk of bytes) {
  26762. dataURL += btoa(decoder.write(chunk))
  26763. }
  26764. dataURL += btoa(decoder.end())
  26765. return dataURL
  26766. }
  26767. case 'Text': {
  26768. // 1. Let encoding be failure
  26769. let encoding = 'failure'
  26770. // 2. If the encodingName is present, set encoding to the
  26771. // result of getting an encoding from encodingName.
  26772. if (encodingName) {
  26773. encoding = getEncoding(encodingName)
  26774. }
  26775. // 3. If encoding is failure, and mimeType is present:
  26776. if (encoding === 'failure' && mimeType) {
  26777. // 1. Let type be the result of parse a MIME type
  26778. // given mimeType.
  26779. const type = parseMIMEType(mimeType)
  26780. // 2. If type is not failure, set encoding to the result
  26781. // of getting an encoding from type’s parameters["charset"].
  26782. if (type !== 'failure') {
  26783. encoding = getEncoding(type.parameters.get('charset'))
  26784. }
  26785. }
  26786. // 4. If encoding is failure, then set encoding to UTF-8.
  26787. if (encoding === 'failure') {
  26788. encoding = 'UTF-8'
  26789. }
  26790. // 5. Decode bytes using fallback encoding encoding, and
  26791. // return the result.
  26792. return decode(bytes, encoding)
  26793. }
  26794. case 'ArrayBuffer': {
  26795. // Return a new ArrayBuffer whose contents are bytes.
  26796. const sequence = combineByteSequences(bytes)
  26797. return sequence.buffer
  26798. }
  26799. case 'BinaryString': {
  26800. // Return bytes as a binary string, in which every byte
  26801. // is represented by a code unit of equal value [0..255].
  26802. let binaryString = ''
  26803. const decoder = new StringDecoder('latin1')
  26804. for (const chunk of bytes) {
  26805. binaryString += decoder.write(chunk)
  26806. }
  26807. binaryString += decoder.end()
  26808. return binaryString
  26809. }
  26810. }
  26811. }
  26812. /**
  26813. * @see https://encoding.spec.whatwg.org/#decode
  26814. * @param {Uint8Array[]} ioQueue
  26815. * @param {string} encoding
  26816. */
  26817. function decode (ioQueue, encoding) {
  26818. const bytes = combineByteSequences(ioQueue)
  26819. // 1. Let BOMEncoding be the result of BOM sniffing ioQueue.
  26820. const BOMEncoding = BOMSniffing(bytes)
  26821. let slice = 0
  26822. // 2. If BOMEncoding is non-null:
  26823. if (BOMEncoding !== null) {
  26824. // 1. Set encoding to BOMEncoding.
  26825. encoding = BOMEncoding
  26826. // 2. Read three bytes from ioQueue, if BOMEncoding is
  26827. // UTF-8; otherwise read two bytes.
  26828. // (Do nothing with those bytes.)
  26829. slice = BOMEncoding === 'UTF-8' ? 3 : 2
  26830. }
  26831. // 3. Process a queue with an instance of encoding’s
  26832. // decoder, ioQueue, output, and "replacement".
  26833. // 4. Return output.
  26834. const sliced = bytes.slice(slice)
  26835. return new TextDecoder(encoding).decode(sliced)
  26836. }
  26837. /**
  26838. * @see https://encoding.spec.whatwg.org/#bom-sniff
  26839. * @param {Uint8Array} ioQueue
  26840. */
  26841. function BOMSniffing (ioQueue) {
  26842. // 1. Let BOM be the result of peeking 3 bytes from ioQueue,
  26843. // converted to a byte sequence.
  26844. const [a, b, c] = ioQueue
  26845. // 2. For each of the rows in the table below, starting with
  26846. // the first one and going down, if BOM starts with the
  26847. // bytes given in the first column, then return the
  26848. // encoding given in the cell in the second column of that
  26849. // row. Otherwise, return null.
  26850. if (a === 0xEF && b === 0xBB && c === 0xBF) {
  26851. return 'UTF-8'
  26852. } else if (a === 0xFE && b === 0xFF) {
  26853. return 'UTF-16BE'
  26854. } else if (a === 0xFF && b === 0xFE) {
  26855. return 'UTF-16LE'
  26856. }
  26857. return null
  26858. }
  26859. /**
  26860. * @param {Uint8Array[]} sequences
  26861. */
  26862. function combineByteSequences (sequences) {
  26863. const size = sequences.reduce((a, b) => {
  26864. return a + b.byteLength
  26865. }, 0)
  26866. let offset = 0
  26867. return sequences.reduce((a, b) => {
  26868. a.set(b, offset)
  26869. offset += b.byteLength
  26870. return a
  26871. }, new Uint8Array(size))
  26872. }
  26873. module.exports = {
  26874. staticPropertyDescriptors,
  26875. readOperation,
  26876. fireAProgressEvent
  26877. }
  26878. /***/ }),
  26879. /***/ 1892:
  26880. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  26881. "use strict";
  26882. // We include a version number for the Dispatcher API. In case of breaking changes,
  26883. // this version number must be increased to avoid conflicts.
  26884. const globalDispatcher = Symbol.for('undici.globalDispatcher.1')
  26885. const { InvalidArgumentError } = __nccwpck_require__(8045)
  26886. const Agent = __nccwpck_require__(7890)
  26887. if (getGlobalDispatcher() === undefined) {
  26888. setGlobalDispatcher(new Agent())
  26889. }
  26890. function setGlobalDispatcher (agent) {
  26891. if (!agent || typeof agent.dispatch !== 'function') {
  26892. throw new InvalidArgumentError('Argument agent must implement Agent')
  26893. }
  26894. Object.defineProperty(globalThis, globalDispatcher, {
  26895. value: agent,
  26896. writable: true,
  26897. enumerable: false,
  26898. configurable: false
  26899. })
  26900. }
  26901. function getGlobalDispatcher () {
  26902. return globalThis[globalDispatcher]
  26903. }
  26904. module.exports = {
  26905. setGlobalDispatcher,
  26906. getGlobalDispatcher
  26907. }
  26908. /***/ }),
  26909. /***/ 6930:
  26910. /***/ ((module) => {
  26911. "use strict";
  26912. module.exports = class DecoratorHandler {
  26913. constructor (handler) {
  26914. this.handler = handler
  26915. }
  26916. onConnect (...args) {
  26917. return this.handler.onConnect(...args)
  26918. }
  26919. onError (...args) {
  26920. return this.handler.onError(...args)
  26921. }
  26922. onUpgrade (...args) {
  26923. return this.handler.onUpgrade(...args)
  26924. }
  26925. onHeaders (...args) {
  26926. return this.handler.onHeaders(...args)
  26927. }
  26928. onData (...args) {
  26929. return this.handler.onData(...args)
  26930. }
  26931. onComplete (...args) {
  26932. return this.handler.onComplete(...args)
  26933. }
  26934. onBodySent (...args) {
  26935. return this.handler.onBodySent(...args)
  26936. }
  26937. }
  26938. /***/ }),
  26939. /***/ 2860:
  26940. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  26941. "use strict";
  26942. const util = __nccwpck_require__(3983)
  26943. const { kBodyUsed } = __nccwpck_require__(2785)
  26944. const assert = __nccwpck_require__(9491)
  26945. const { InvalidArgumentError } = __nccwpck_require__(8045)
  26946. const EE = __nccwpck_require__(2361)
  26947. const redirectableStatusCodes = [300, 301, 302, 303, 307, 308]
  26948. const kBody = Symbol('body')
  26949. class BodyAsyncIterable {
  26950. constructor (body) {
  26951. this[kBody] = body
  26952. this[kBodyUsed] = false
  26953. }
  26954. async * [Symbol.asyncIterator] () {
  26955. assert(!this[kBodyUsed], 'disturbed')
  26956. this[kBodyUsed] = true
  26957. yield * this[kBody]
  26958. }
  26959. }
  26960. class RedirectHandler {
  26961. constructor (dispatch, maxRedirections, opts, handler) {
  26962. if (maxRedirections != null && (!Number.isInteger(maxRedirections) || maxRedirections < 0)) {
  26963. throw new InvalidArgumentError('maxRedirections must be a positive number')
  26964. }
  26965. util.validateHandler(handler, opts.method, opts.upgrade)
  26966. this.dispatch = dispatch
  26967. this.location = null
  26968. this.abort = null
  26969. this.opts = { ...opts, maxRedirections: 0 } // opts must be a copy
  26970. this.maxRedirections = maxRedirections
  26971. this.handler = handler
  26972. this.history = []
  26973. if (util.isStream(this.opts.body)) {
  26974. // TODO (fix): Provide some way for the user to cache the file to e.g. /tmp
  26975. // so that it can be dispatched again?
  26976. // TODO (fix): Do we need 100-expect support to provide a way to do this properly?
  26977. if (util.bodyLength(this.opts.body) === 0) {
  26978. this.opts.body
  26979. .on('data', function () {
  26980. assert(false)
  26981. })
  26982. }
  26983. if (typeof this.opts.body.readableDidRead !== 'boolean') {
  26984. this.opts.body[kBodyUsed] = false
  26985. EE.prototype.on.call(this.opts.body, 'data', function () {
  26986. this[kBodyUsed] = true
  26987. })
  26988. }
  26989. } else if (this.opts.body && typeof this.opts.body.pipeTo === 'function') {
  26990. // TODO (fix): We can't access ReadableStream internal state
  26991. // to determine whether or not it has been disturbed. This is just
  26992. // a workaround.
  26993. this.opts.body = new BodyAsyncIterable(this.opts.body)
  26994. } else if (
  26995. this.opts.body &&
  26996. typeof this.opts.body !== 'string' &&
  26997. !ArrayBuffer.isView(this.opts.body) &&
  26998. util.isIterable(this.opts.body)
  26999. ) {
  27000. // TODO: Should we allow re-using iterable if !this.opts.idempotent
  27001. // or through some other flag?
  27002. this.opts.body = new BodyAsyncIterable(this.opts.body)
  27003. }
  27004. }
  27005. onConnect (abort) {
  27006. this.abort = abort
  27007. this.handler.onConnect(abort, { history: this.history })
  27008. }
  27009. onUpgrade (statusCode, headers, socket) {
  27010. this.handler.onUpgrade(statusCode, headers, socket)
  27011. }
  27012. onError (error) {
  27013. this.handler.onError(error)
  27014. }
  27015. onHeaders (statusCode, headers, resume, statusText) {
  27016. this.location = this.history.length >= this.maxRedirections || util.isDisturbed(this.opts.body)
  27017. ? null
  27018. : parseLocation(statusCode, headers)
  27019. if (this.opts.origin) {
  27020. this.history.push(new URL(this.opts.path, this.opts.origin))
  27021. }
  27022. if (!this.location) {
  27023. return this.handler.onHeaders(statusCode, headers, resume, statusText)
  27024. }
  27025. const { origin, pathname, search } = util.parseURL(new URL(this.location, this.opts.origin && new URL(this.opts.path, this.opts.origin)))
  27026. const path = search ? `${pathname}${search}` : pathname
  27027. // Remove headers referring to the original URL.
  27028. // By default it is Host only, unless it's a 303 (see below), which removes also all Content-* headers.
  27029. // https://tools.ietf.org/html/rfc7231#section-6.4
  27030. this.opts.headers = cleanRequestHeaders(this.opts.headers, statusCode === 303, this.opts.origin !== origin)
  27031. this.opts.path = path
  27032. this.opts.origin = origin
  27033. this.opts.maxRedirections = 0
  27034. this.opts.query = null
  27035. // https://tools.ietf.org/html/rfc7231#section-6.4.4
  27036. // In case of HTTP 303, always replace method to be either HEAD or GET
  27037. if (statusCode === 303 && this.opts.method !== 'HEAD') {
  27038. this.opts.method = 'GET'
  27039. this.opts.body = null
  27040. }
  27041. }
  27042. onData (chunk) {
  27043. if (this.location) {
  27044. /*
  27045. https://tools.ietf.org/html/rfc7231#section-6.4
  27046. TLDR: undici always ignores 3xx response bodies.
  27047. Redirection is used to serve the requested resource from another URL, so it is assumes that
  27048. no body is generated (and thus can be ignored). Even though generating a body is not prohibited.
  27049. For status 301, 302, 303, 307 and 308 (the latter from RFC 7238), the specs mention that the body usually
  27050. (which means it's optional and not mandated) contain just an hyperlink to the value of
  27051. the Location response header, so the body can be ignored safely.
  27052. For status 300, which is "Multiple Choices", the spec mentions both generating a Location
  27053. response header AND a response body with the other possible location to follow.
  27054. Since the spec explicitily chooses not to specify a format for such body and leave it to
  27055. servers and browsers implementors, we ignore the body as there is no specified way to eventually parse it.
  27056. */
  27057. } else {
  27058. return this.handler.onData(chunk)
  27059. }
  27060. }
  27061. onComplete (trailers) {
  27062. if (this.location) {
  27063. /*
  27064. https://tools.ietf.org/html/rfc7231#section-6.4
  27065. TLDR: undici always ignores 3xx response trailers as they are not expected in case of redirections
  27066. and neither are useful if present.
  27067. See comment on onData method above for more detailed informations.
  27068. */
  27069. this.location = null
  27070. this.abort = null
  27071. this.dispatch(this.opts, this)
  27072. } else {
  27073. this.handler.onComplete(trailers)
  27074. }
  27075. }
  27076. onBodySent (chunk) {
  27077. if (this.handler.onBodySent) {
  27078. this.handler.onBodySent(chunk)
  27079. }
  27080. }
  27081. }
  27082. function parseLocation (statusCode, headers) {
  27083. if (redirectableStatusCodes.indexOf(statusCode) === -1) {
  27084. return null
  27085. }
  27086. for (let i = 0; i < headers.length; i += 2) {
  27087. if (headers[i].toString().toLowerCase() === 'location') {
  27088. return headers[i + 1]
  27089. }
  27090. }
  27091. }
  27092. // https://tools.ietf.org/html/rfc7231#section-6.4.4
  27093. function shouldRemoveHeader (header, removeContent, unknownOrigin) {
  27094. if (header.length === 4) {
  27095. return util.headerNameToString(header) === 'host'
  27096. }
  27097. if (removeContent && util.headerNameToString(header).startsWith('content-')) {
  27098. return true
  27099. }
  27100. if (unknownOrigin && (header.length === 13 || header.length === 6 || header.length === 19)) {
  27101. const name = util.headerNameToString(header)
  27102. return name === 'authorization' || name === 'cookie' || name === 'proxy-authorization'
  27103. }
  27104. return false
  27105. }
  27106. // https://tools.ietf.org/html/rfc7231#section-6.4
  27107. function cleanRequestHeaders (headers, removeContent, unknownOrigin) {
  27108. const ret = []
  27109. if (Array.isArray(headers)) {
  27110. for (let i = 0; i < headers.length; i += 2) {
  27111. if (!shouldRemoveHeader(headers[i], removeContent, unknownOrigin)) {
  27112. ret.push(headers[i], headers[i + 1])
  27113. }
  27114. }
  27115. } else if (headers && typeof headers === 'object') {
  27116. for (const key of Object.keys(headers)) {
  27117. if (!shouldRemoveHeader(key, removeContent, unknownOrigin)) {
  27118. ret.push(key, headers[key])
  27119. }
  27120. }
  27121. } else {
  27122. assert(headers == null, 'headers must be an object or an array')
  27123. }
  27124. return ret
  27125. }
  27126. module.exports = RedirectHandler
  27127. /***/ }),
  27128. /***/ 2286:
  27129. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  27130. const assert = __nccwpck_require__(9491)
  27131. const { kRetryHandlerDefaultRetry } = __nccwpck_require__(2785)
  27132. const { RequestRetryError } = __nccwpck_require__(8045)
  27133. const { isDisturbed, parseHeaders, parseRangeHeader } = __nccwpck_require__(3983)
  27134. function calculateRetryAfterHeader (retryAfter) {
  27135. const current = Date.now()
  27136. const diff = new Date(retryAfter).getTime() - current
  27137. return diff
  27138. }
  27139. class RetryHandler {
  27140. constructor (opts, handlers) {
  27141. const { retryOptions, ...dispatchOpts } = opts
  27142. const {
  27143. // Retry scoped
  27144. retry: retryFn,
  27145. maxRetries,
  27146. maxTimeout,
  27147. minTimeout,
  27148. timeoutFactor,
  27149. // Response scoped
  27150. methods,
  27151. errorCodes,
  27152. retryAfter,
  27153. statusCodes
  27154. } = retryOptions ?? {}
  27155. this.dispatch = handlers.dispatch
  27156. this.handler = handlers.handler
  27157. this.opts = dispatchOpts
  27158. this.abort = null
  27159. this.aborted = false
  27160. this.retryOpts = {
  27161. retry: retryFn ?? RetryHandler[kRetryHandlerDefaultRetry],
  27162. retryAfter: retryAfter ?? true,
  27163. maxTimeout: maxTimeout ?? 30 * 1000, // 30s,
  27164. timeout: minTimeout ?? 500, // .5s
  27165. timeoutFactor: timeoutFactor ?? 2,
  27166. maxRetries: maxRetries ?? 5,
  27167. // What errors we should retry
  27168. methods: methods ?? ['GET', 'HEAD', 'OPTIONS', 'PUT', 'DELETE', 'TRACE'],
  27169. // Indicates which errors to retry
  27170. statusCodes: statusCodes ?? [500, 502, 503, 504, 429],
  27171. // List of errors to retry
  27172. errorCodes: errorCodes ?? [
  27173. 'ECONNRESET',
  27174. 'ECONNREFUSED',
  27175. 'ENOTFOUND',
  27176. 'ENETDOWN',
  27177. 'ENETUNREACH',
  27178. 'EHOSTDOWN',
  27179. 'EHOSTUNREACH',
  27180. 'EPIPE'
  27181. ]
  27182. }
  27183. this.retryCount = 0
  27184. this.start = 0
  27185. this.end = null
  27186. this.etag = null
  27187. this.resume = null
  27188. // Handle possible onConnect duplication
  27189. this.handler.onConnect(reason => {
  27190. this.aborted = true
  27191. if (this.abort) {
  27192. this.abort(reason)
  27193. } else {
  27194. this.reason = reason
  27195. }
  27196. })
  27197. }
  27198. onRequestSent () {
  27199. if (this.handler.onRequestSent) {
  27200. this.handler.onRequestSent()
  27201. }
  27202. }
  27203. onUpgrade (statusCode, headers, socket) {
  27204. if (this.handler.onUpgrade) {
  27205. this.handler.onUpgrade(statusCode, headers, socket)
  27206. }
  27207. }
  27208. onConnect (abort) {
  27209. if (this.aborted) {
  27210. abort(this.reason)
  27211. } else {
  27212. this.abort = abort
  27213. }
  27214. }
  27215. onBodySent (chunk) {
  27216. if (this.handler.onBodySent) return this.handler.onBodySent(chunk)
  27217. }
  27218. static [kRetryHandlerDefaultRetry] (err, { state, opts }, cb) {
  27219. const { statusCode, code, headers } = err
  27220. const { method, retryOptions } = opts
  27221. const {
  27222. maxRetries,
  27223. timeout,
  27224. maxTimeout,
  27225. timeoutFactor,
  27226. statusCodes,
  27227. errorCodes,
  27228. methods
  27229. } = retryOptions
  27230. let { counter, currentTimeout } = state
  27231. currentTimeout =
  27232. currentTimeout != null && currentTimeout > 0 ? currentTimeout : timeout
  27233. // Any code that is not a Undici's originated and allowed to retry
  27234. if (
  27235. code &&
  27236. code !== 'UND_ERR_REQ_RETRY' &&
  27237. code !== 'UND_ERR_SOCKET' &&
  27238. !errorCodes.includes(code)
  27239. ) {
  27240. cb(err)
  27241. return
  27242. }
  27243. // If a set of method are provided and the current method is not in the list
  27244. if (Array.isArray(methods) && !methods.includes(method)) {
  27245. cb(err)
  27246. return
  27247. }
  27248. // If a set of status code are provided and the current status code is not in the list
  27249. if (
  27250. statusCode != null &&
  27251. Array.isArray(statusCodes) &&
  27252. !statusCodes.includes(statusCode)
  27253. ) {
  27254. cb(err)
  27255. return
  27256. }
  27257. // If we reached the max number of retries
  27258. if (counter > maxRetries) {
  27259. cb(err)
  27260. return
  27261. }
  27262. let retryAfterHeader = headers != null && headers['retry-after']
  27263. if (retryAfterHeader) {
  27264. retryAfterHeader = Number(retryAfterHeader)
  27265. retryAfterHeader = isNaN(retryAfterHeader)
  27266. ? calculateRetryAfterHeader(retryAfterHeader)
  27267. : retryAfterHeader * 1e3 // Retry-After is in seconds
  27268. }
  27269. const retryTimeout =
  27270. retryAfterHeader > 0
  27271. ? Math.min(retryAfterHeader, maxTimeout)
  27272. : Math.min(currentTimeout * timeoutFactor ** counter, maxTimeout)
  27273. state.currentTimeout = retryTimeout
  27274. setTimeout(() => cb(null), retryTimeout)
  27275. }
  27276. onHeaders (statusCode, rawHeaders, resume, statusMessage) {
  27277. const headers = parseHeaders(rawHeaders)
  27278. this.retryCount += 1
  27279. if (statusCode >= 300) {
  27280. this.abort(
  27281. new RequestRetryError('Request failed', statusCode, {
  27282. headers,
  27283. count: this.retryCount
  27284. })
  27285. )
  27286. return false
  27287. }
  27288. // Checkpoint for resume from where we left it
  27289. if (this.resume != null) {
  27290. this.resume = null
  27291. if (statusCode !== 206) {
  27292. return true
  27293. }
  27294. const contentRange = parseRangeHeader(headers['content-range'])
  27295. // If no content range
  27296. if (!contentRange) {
  27297. this.abort(
  27298. new RequestRetryError('Content-Range mismatch', statusCode, {
  27299. headers,
  27300. count: this.retryCount
  27301. })
  27302. )
  27303. return false
  27304. }
  27305. // Let's start with a weak etag check
  27306. if (this.etag != null && this.etag !== headers.etag) {
  27307. this.abort(
  27308. new RequestRetryError('ETag mismatch', statusCode, {
  27309. headers,
  27310. count: this.retryCount
  27311. })
  27312. )
  27313. return false
  27314. }
  27315. const { start, size, end = size } = contentRange
  27316. assert(this.start === start, 'content-range mismatch')
  27317. assert(this.end == null || this.end === end, 'content-range mismatch')
  27318. this.resume = resume
  27319. return true
  27320. }
  27321. if (this.end == null) {
  27322. if (statusCode === 206) {
  27323. // First time we receive 206
  27324. const range = parseRangeHeader(headers['content-range'])
  27325. if (range == null) {
  27326. return this.handler.onHeaders(
  27327. statusCode,
  27328. rawHeaders,
  27329. resume,
  27330. statusMessage
  27331. )
  27332. }
  27333. const { start, size, end = size } = range
  27334. assert(
  27335. start != null && Number.isFinite(start) && this.start !== start,
  27336. 'content-range mismatch'
  27337. )
  27338. assert(Number.isFinite(start))
  27339. assert(
  27340. end != null && Number.isFinite(end) && this.end !== end,
  27341. 'invalid content-length'
  27342. )
  27343. this.start = start
  27344. this.end = end
  27345. }
  27346. // We make our best to checkpoint the body for further range headers
  27347. if (this.end == null) {
  27348. const contentLength = headers['content-length']
  27349. this.end = contentLength != null ? Number(contentLength) : null
  27350. }
  27351. assert(Number.isFinite(this.start))
  27352. assert(
  27353. this.end == null || Number.isFinite(this.end),
  27354. 'invalid content-length'
  27355. )
  27356. this.resume = resume
  27357. this.etag = headers.etag != null ? headers.etag : null
  27358. return this.handler.onHeaders(
  27359. statusCode,
  27360. rawHeaders,
  27361. resume,
  27362. statusMessage
  27363. )
  27364. }
  27365. const err = new RequestRetryError('Request failed', statusCode, {
  27366. headers,
  27367. count: this.retryCount
  27368. })
  27369. this.abort(err)
  27370. return false
  27371. }
  27372. onData (chunk) {
  27373. this.start += chunk.length
  27374. return this.handler.onData(chunk)
  27375. }
  27376. onComplete (rawTrailers) {
  27377. this.retryCount = 0
  27378. return this.handler.onComplete(rawTrailers)
  27379. }
  27380. onError (err) {
  27381. if (this.aborted || isDisturbed(this.opts.body)) {
  27382. return this.handler.onError(err)
  27383. }
  27384. this.retryOpts.retry(
  27385. err,
  27386. {
  27387. state: { counter: this.retryCount++, currentTimeout: this.retryAfter },
  27388. opts: { retryOptions: this.retryOpts, ...this.opts }
  27389. },
  27390. onRetry.bind(this)
  27391. )
  27392. function onRetry (err) {
  27393. if (err != null || this.aborted || isDisturbed(this.opts.body)) {
  27394. return this.handler.onError(err)
  27395. }
  27396. if (this.start !== 0) {
  27397. this.opts = {
  27398. ...this.opts,
  27399. headers: {
  27400. ...this.opts.headers,
  27401. range: `bytes=${this.start}-${this.end ?? ''}`
  27402. }
  27403. }
  27404. }
  27405. try {
  27406. this.dispatch(this.opts, this)
  27407. } catch (err) {
  27408. this.handler.onError(err)
  27409. }
  27410. }
  27411. }
  27412. }
  27413. module.exports = RetryHandler
  27414. /***/ }),
  27415. /***/ 8861:
  27416. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  27417. "use strict";
  27418. const RedirectHandler = __nccwpck_require__(2860)
  27419. function createRedirectInterceptor ({ maxRedirections: defaultMaxRedirections }) {
  27420. return (dispatch) => {
  27421. return function Intercept (opts, handler) {
  27422. const { maxRedirections = defaultMaxRedirections } = opts
  27423. if (!maxRedirections) {
  27424. return dispatch(opts, handler)
  27425. }
  27426. const redirectHandler = new RedirectHandler(dispatch, maxRedirections, opts, handler)
  27427. opts = { ...opts, maxRedirections: 0 } // Stop sub dispatcher from also redirecting.
  27428. return dispatch(opts, redirectHandler)
  27429. }
  27430. }
  27431. }
  27432. module.exports = createRedirectInterceptor
  27433. /***/ }),
  27434. /***/ 953:
  27435. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  27436. "use strict";
  27437. Object.defineProperty(exports, "__esModule", ({ value: true }));
  27438. 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;
  27439. const utils_1 = __nccwpck_require__(1891);
  27440. // C headers
  27441. var ERROR;
  27442. (function (ERROR) {
  27443. ERROR[ERROR["OK"] = 0] = "OK";
  27444. ERROR[ERROR["INTERNAL"] = 1] = "INTERNAL";
  27445. ERROR[ERROR["STRICT"] = 2] = "STRICT";
  27446. ERROR[ERROR["LF_EXPECTED"] = 3] = "LF_EXPECTED";
  27447. ERROR[ERROR["UNEXPECTED_CONTENT_LENGTH"] = 4] = "UNEXPECTED_CONTENT_LENGTH";
  27448. ERROR[ERROR["CLOSED_CONNECTION"] = 5] = "CLOSED_CONNECTION";
  27449. ERROR[ERROR["INVALID_METHOD"] = 6] = "INVALID_METHOD";
  27450. ERROR[ERROR["INVALID_URL"] = 7] = "INVALID_URL";
  27451. ERROR[ERROR["INVALID_CONSTANT"] = 8] = "INVALID_CONSTANT";
  27452. ERROR[ERROR["INVALID_VERSION"] = 9] = "INVALID_VERSION";
  27453. ERROR[ERROR["INVALID_HEADER_TOKEN"] = 10] = "INVALID_HEADER_TOKEN";
  27454. ERROR[ERROR["INVALID_CONTENT_LENGTH"] = 11] = "INVALID_CONTENT_LENGTH";
  27455. ERROR[ERROR["INVALID_CHUNK_SIZE"] = 12] = "INVALID_CHUNK_SIZE";
  27456. ERROR[ERROR["INVALID_STATUS"] = 13] = "INVALID_STATUS";
  27457. ERROR[ERROR["INVALID_EOF_STATE"] = 14] = "INVALID_EOF_STATE";
  27458. ERROR[ERROR["INVALID_TRANSFER_ENCODING"] = 15] = "INVALID_TRANSFER_ENCODING";
  27459. ERROR[ERROR["CB_MESSAGE_BEGIN"] = 16] = "CB_MESSAGE_BEGIN";
  27460. ERROR[ERROR["CB_HEADERS_COMPLETE"] = 17] = "CB_HEADERS_COMPLETE";
  27461. ERROR[ERROR["CB_MESSAGE_COMPLETE"] = 18] = "CB_MESSAGE_COMPLETE";
  27462. ERROR[ERROR["CB_CHUNK_HEADER"] = 19] = "CB_CHUNK_HEADER";
  27463. ERROR[ERROR["CB_CHUNK_COMPLETE"] = 20] = "CB_CHUNK_COMPLETE";
  27464. ERROR[ERROR["PAUSED"] = 21] = "PAUSED";
  27465. ERROR[ERROR["PAUSED_UPGRADE"] = 22] = "PAUSED_UPGRADE";
  27466. ERROR[ERROR["PAUSED_H2_UPGRADE"] = 23] = "PAUSED_H2_UPGRADE";
  27467. ERROR[ERROR["USER"] = 24] = "USER";
  27468. })(ERROR = exports.ERROR || (exports.ERROR = {}));
  27469. var TYPE;
  27470. (function (TYPE) {
  27471. TYPE[TYPE["BOTH"] = 0] = "BOTH";
  27472. TYPE[TYPE["REQUEST"] = 1] = "REQUEST";
  27473. TYPE[TYPE["RESPONSE"] = 2] = "RESPONSE";
  27474. })(TYPE = exports.TYPE || (exports.TYPE = {}));
  27475. var FLAGS;
  27476. (function (FLAGS) {
  27477. FLAGS[FLAGS["CONNECTION_KEEP_ALIVE"] = 1] = "CONNECTION_KEEP_ALIVE";
  27478. FLAGS[FLAGS["CONNECTION_CLOSE"] = 2] = "CONNECTION_CLOSE";
  27479. FLAGS[FLAGS["CONNECTION_UPGRADE"] = 4] = "CONNECTION_UPGRADE";
  27480. FLAGS[FLAGS["CHUNKED"] = 8] = "CHUNKED";
  27481. FLAGS[FLAGS["UPGRADE"] = 16] = "UPGRADE";
  27482. FLAGS[FLAGS["CONTENT_LENGTH"] = 32] = "CONTENT_LENGTH";
  27483. FLAGS[FLAGS["SKIPBODY"] = 64] = "SKIPBODY";
  27484. FLAGS[FLAGS["TRAILING"] = 128] = "TRAILING";
  27485. // 1 << 8 is unused
  27486. FLAGS[FLAGS["TRANSFER_ENCODING"] = 512] = "TRANSFER_ENCODING";
  27487. })(FLAGS = exports.FLAGS || (exports.FLAGS = {}));
  27488. var LENIENT_FLAGS;
  27489. (function (LENIENT_FLAGS) {
  27490. LENIENT_FLAGS[LENIENT_FLAGS["HEADERS"] = 1] = "HEADERS";
  27491. LENIENT_FLAGS[LENIENT_FLAGS["CHUNKED_LENGTH"] = 2] = "CHUNKED_LENGTH";
  27492. LENIENT_FLAGS[LENIENT_FLAGS["KEEP_ALIVE"] = 4] = "KEEP_ALIVE";
  27493. })(LENIENT_FLAGS = exports.LENIENT_FLAGS || (exports.LENIENT_FLAGS = {}));
  27494. var METHODS;
  27495. (function (METHODS) {
  27496. METHODS[METHODS["DELETE"] = 0] = "DELETE";
  27497. METHODS[METHODS["GET"] = 1] = "GET";
  27498. METHODS[METHODS["HEAD"] = 2] = "HEAD";
  27499. METHODS[METHODS["POST"] = 3] = "POST";
  27500. METHODS[METHODS["PUT"] = 4] = "PUT";
  27501. /* pathological */
  27502. METHODS[METHODS["CONNECT"] = 5] = "CONNECT";
  27503. METHODS[METHODS["OPTIONS"] = 6] = "OPTIONS";
  27504. METHODS[METHODS["TRACE"] = 7] = "TRACE";
  27505. /* WebDAV */
  27506. METHODS[METHODS["COPY"] = 8] = "COPY";
  27507. METHODS[METHODS["LOCK"] = 9] = "LOCK";
  27508. METHODS[METHODS["MKCOL"] = 10] = "MKCOL";
  27509. METHODS[METHODS["MOVE"] = 11] = "MOVE";
  27510. METHODS[METHODS["PROPFIND"] = 12] = "PROPFIND";
  27511. METHODS[METHODS["PROPPATCH"] = 13] = "PROPPATCH";
  27512. METHODS[METHODS["SEARCH"] = 14] = "SEARCH";
  27513. METHODS[METHODS["UNLOCK"] = 15] = "UNLOCK";
  27514. METHODS[METHODS["BIND"] = 16] = "BIND";
  27515. METHODS[METHODS["REBIND"] = 17] = "REBIND";
  27516. METHODS[METHODS["UNBIND"] = 18] = "UNBIND";
  27517. METHODS[METHODS["ACL"] = 19] = "ACL";
  27518. /* subversion */
  27519. METHODS[METHODS["REPORT"] = 20] = "REPORT";
  27520. METHODS[METHODS["MKACTIVITY"] = 21] = "MKACTIVITY";
  27521. METHODS[METHODS["CHECKOUT"] = 22] = "CHECKOUT";
  27522. METHODS[METHODS["MERGE"] = 23] = "MERGE";
  27523. /* upnp */
  27524. METHODS[METHODS["M-SEARCH"] = 24] = "M-SEARCH";
  27525. METHODS[METHODS["NOTIFY"] = 25] = "NOTIFY";
  27526. METHODS[METHODS["SUBSCRIBE"] = 26] = "SUBSCRIBE";
  27527. METHODS[METHODS["UNSUBSCRIBE"] = 27] = "UNSUBSCRIBE";
  27528. /* RFC-5789 */
  27529. METHODS[METHODS["PATCH"] = 28] = "PATCH";
  27530. METHODS[METHODS["PURGE"] = 29] = "PURGE";
  27531. /* CalDAV */
  27532. METHODS[METHODS["MKCALENDAR"] = 30] = "MKCALENDAR";
  27533. /* RFC-2068, section 19.6.1.2 */
  27534. METHODS[METHODS["LINK"] = 31] = "LINK";
  27535. METHODS[METHODS["UNLINK"] = 32] = "UNLINK";
  27536. /* icecast */
  27537. METHODS[METHODS["SOURCE"] = 33] = "SOURCE";
  27538. /* RFC-7540, section 11.6 */
  27539. METHODS[METHODS["PRI"] = 34] = "PRI";
  27540. /* RFC-2326 RTSP */
  27541. METHODS[METHODS["DESCRIBE"] = 35] = "DESCRIBE";
  27542. METHODS[METHODS["ANNOUNCE"] = 36] = "ANNOUNCE";
  27543. METHODS[METHODS["SETUP"] = 37] = "SETUP";
  27544. METHODS[METHODS["PLAY"] = 38] = "PLAY";
  27545. METHODS[METHODS["PAUSE"] = 39] = "PAUSE";
  27546. METHODS[METHODS["TEARDOWN"] = 40] = "TEARDOWN";
  27547. METHODS[METHODS["GET_PARAMETER"] = 41] = "GET_PARAMETER";
  27548. METHODS[METHODS["SET_PARAMETER"] = 42] = "SET_PARAMETER";
  27549. METHODS[METHODS["REDIRECT"] = 43] = "REDIRECT";
  27550. METHODS[METHODS["RECORD"] = 44] = "RECORD";
  27551. /* RAOP */
  27552. METHODS[METHODS["FLUSH"] = 45] = "FLUSH";
  27553. })(METHODS = exports.METHODS || (exports.METHODS = {}));
  27554. exports.METHODS_HTTP = [
  27555. METHODS.DELETE,
  27556. METHODS.GET,
  27557. METHODS.HEAD,
  27558. METHODS.POST,
  27559. METHODS.PUT,
  27560. METHODS.CONNECT,
  27561. METHODS.OPTIONS,
  27562. METHODS.TRACE,
  27563. METHODS.COPY,
  27564. METHODS.LOCK,
  27565. METHODS.MKCOL,
  27566. METHODS.MOVE,
  27567. METHODS.PROPFIND,
  27568. METHODS.PROPPATCH,
  27569. METHODS.SEARCH,
  27570. METHODS.UNLOCK,
  27571. METHODS.BIND,
  27572. METHODS.REBIND,
  27573. METHODS.UNBIND,
  27574. METHODS.ACL,
  27575. METHODS.REPORT,
  27576. METHODS.MKACTIVITY,
  27577. METHODS.CHECKOUT,
  27578. METHODS.MERGE,
  27579. METHODS['M-SEARCH'],
  27580. METHODS.NOTIFY,
  27581. METHODS.SUBSCRIBE,
  27582. METHODS.UNSUBSCRIBE,
  27583. METHODS.PATCH,
  27584. METHODS.PURGE,
  27585. METHODS.MKCALENDAR,
  27586. METHODS.LINK,
  27587. METHODS.UNLINK,
  27588. METHODS.PRI,
  27589. // TODO(indutny): should we allow it with HTTP?
  27590. METHODS.SOURCE,
  27591. ];
  27592. exports.METHODS_ICE = [
  27593. METHODS.SOURCE,
  27594. ];
  27595. exports.METHODS_RTSP = [
  27596. METHODS.OPTIONS,
  27597. METHODS.DESCRIBE,
  27598. METHODS.ANNOUNCE,
  27599. METHODS.SETUP,
  27600. METHODS.PLAY,
  27601. METHODS.PAUSE,
  27602. METHODS.TEARDOWN,
  27603. METHODS.GET_PARAMETER,
  27604. METHODS.SET_PARAMETER,
  27605. METHODS.REDIRECT,
  27606. METHODS.RECORD,
  27607. METHODS.FLUSH,
  27608. // For AirPlay
  27609. METHODS.GET,
  27610. METHODS.POST,
  27611. ];
  27612. exports.METHOD_MAP = utils_1.enumToMap(METHODS);
  27613. exports.H_METHOD_MAP = {};
  27614. Object.keys(exports.METHOD_MAP).forEach((key) => {
  27615. if (/^H/.test(key)) {
  27616. exports.H_METHOD_MAP[key] = exports.METHOD_MAP[key];
  27617. }
  27618. });
  27619. var FINISH;
  27620. (function (FINISH) {
  27621. FINISH[FINISH["SAFE"] = 0] = "SAFE";
  27622. FINISH[FINISH["SAFE_WITH_CB"] = 1] = "SAFE_WITH_CB";
  27623. FINISH[FINISH["UNSAFE"] = 2] = "UNSAFE";
  27624. })(FINISH = exports.FINISH || (exports.FINISH = {}));
  27625. exports.ALPHA = [];
  27626. for (let i = 'A'.charCodeAt(0); i <= 'Z'.charCodeAt(0); i++) {
  27627. // Upper case
  27628. exports.ALPHA.push(String.fromCharCode(i));
  27629. // Lower case
  27630. exports.ALPHA.push(String.fromCharCode(i + 0x20));
  27631. }
  27632. exports.NUM_MAP = {
  27633. 0: 0, 1: 1, 2: 2, 3: 3, 4: 4,
  27634. 5: 5, 6: 6, 7: 7, 8: 8, 9: 9,
  27635. };
  27636. exports.HEX_MAP = {
  27637. 0: 0, 1: 1, 2: 2, 3: 3, 4: 4,
  27638. 5: 5, 6: 6, 7: 7, 8: 8, 9: 9,
  27639. A: 0XA, B: 0XB, C: 0XC, D: 0XD, E: 0XE, F: 0XF,
  27640. a: 0xa, b: 0xb, c: 0xc, d: 0xd, e: 0xe, f: 0xf,
  27641. };
  27642. exports.NUM = [
  27643. '0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
  27644. ];
  27645. exports.ALPHANUM = exports.ALPHA.concat(exports.NUM);
  27646. exports.MARK = ['-', '_', '.', '!', '~', '*', '\'', '(', ')'];
  27647. exports.USERINFO_CHARS = exports.ALPHANUM
  27648. .concat(exports.MARK)
  27649. .concat(['%', ';', ':', '&', '=', '+', '$', ',']);
  27650. // TODO(indutny): use RFC
  27651. exports.STRICT_URL_CHAR = [
  27652. '!', '"', '$', '%', '&', '\'',
  27653. '(', ')', '*', '+', ',', '-', '.', '/',
  27654. ':', ';', '<', '=', '>',
  27655. '@', '[', '\\', ']', '^', '_',
  27656. '`',
  27657. '{', '|', '}', '~',
  27658. ].concat(exports.ALPHANUM);
  27659. exports.URL_CHAR = exports.STRICT_URL_CHAR
  27660. .concat(['\t', '\f']);
  27661. // All characters with 0x80 bit set to 1
  27662. for (let i = 0x80; i <= 0xff; i++) {
  27663. exports.URL_CHAR.push(i);
  27664. }
  27665. exports.HEX = exports.NUM.concat(['a', 'b', 'c', 'd', 'e', 'f', 'A', 'B', 'C', 'D', 'E', 'F']);
  27666. /* Tokens as defined by rfc 2616. Also lowercases them.
  27667. * token = 1*<any CHAR except CTLs or separators>
  27668. * separators = "(" | ")" | "<" | ">" | "@"
  27669. * | "," | ";" | ":" | "\" | <">
  27670. * | "/" | "[" | "]" | "?" | "="
  27671. * | "{" | "}" | SP | HT
  27672. */
  27673. exports.STRICT_TOKEN = [
  27674. '!', '#', '$', '%', '&', '\'',
  27675. '*', '+', '-', '.',
  27676. '^', '_', '`',
  27677. '|', '~',
  27678. ].concat(exports.ALPHANUM);
  27679. exports.TOKEN = exports.STRICT_TOKEN.concat([' ']);
  27680. /*
  27681. * Verify that a char is a valid visible (printable) US-ASCII
  27682. * character or %x80-FF
  27683. */
  27684. exports.HEADER_CHARS = ['\t'];
  27685. for (let i = 32; i <= 255; i++) {
  27686. if (i !== 127) {
  27687. exports.HEADER_CHARS.push(i);
  27688. }
  27689. }
  27690. // ',' = \x44
  27691. exports.CONNECTION_TOKEN_CHARS = exports.HEADER_CHARS.filter((c) => c !== 44);
  27692. exports.MAJOR = exports.NUM_MAP;
  27693. exports.MINOR = exports.MAJOR;
  27694. var HEADER_STATE;
  27695. (function (HEADER_STATE) {
  27696. HEADER_STATE[HEADER_STATE["GENERAL"] = 0] = "GENERAL";
  27697. HEADER_STATE[HEADER_STATE["CONNECTION"] = 1] = "CONNECTION";
  27698. HEADER_STATE[HEADER_STATE["CONTENT_LENGTH"] = 2] = "CONTENT_LENGTH";
  27699. HEADER_STATE[HEADER_STATE["TRANSFER_ENCODING"] = 3] = "TRANSFER_ENCODING";
  27700. HEADER_STATE[HEADER_STATE["UPGRADE"] = 4] = "UPGRADE";
  27701. HEADER_STATE[HEADER_STATE["CONNECTION_KEEP_ALIVE"] = 5] = "CONNECTION_KEEP_ALIVE";
  27702. HEADER_STATE[HEADER_STATE["CONNECTION_CLOSE"] = 6] = "CONNECTION_CLOSE";
  27703. HEADER_STATE[HEADER_STATE["CONNECTION_UPGRADE"] = 7] = "CONNECTION_UPGRADE";
  27704. HEADER_STATE[HEADER_STATE["TRANSFER_ENCODING_CHUNKED"] = 8] = "TRANSFER_ENCODING_CHUNKED";
  27705. })(HEADER_STATE = exports.HEADER_STATE || (exports.HEADER_STATE = {}));
  27706. exports.SPECIAL_HEADERS = {
  27707. 'connection': HEADER_STATE.CONNECTION,
  27708. 'content-length': HEADER_STATE.CONTENT_LENGTH,
  27709. 'proxy-connection': HEADER_STATE.CONNECTION,
  27710. 'transfer-encoding': HEADER_STATE.TRANSFER_ENCODING,
  27711. 'upgrade': HEADER_STATE.UPGRADE,
  27712. };
  27713. //# sourceMappingURL=constants.js.map
  27714. /***/ }),
  27715. /***/ 1145:
  27716. /***/ ((module) => {
  27717. module.exports = 'AGFzbQEAAAABMAhgAX8Bf2ADf39/AX9gBH9/f38Bf2AAAGADf39/AGABfwBgAn9/AGAGf39/f39/AALLAQgDZW52GHdhc21fb25faGVhZGVyc19jb21wbGV0ZQACA2VudhV3YXNtX29uX21lc3NhZ2VfYmVnaW4AAANlbnYLd2FzbV9vbl91cmwAAQNlbnYOd2FzbV9vbl9zdGF0dXMAAQNlbnYUd2FzbV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IAAtACpFDQAgAC0AK0UNAEEAIQMgAC8BMCIEQQJxRQ0BDAILQQAhAyAALwEwIgRBAXFFDQELQQEhAyAALQAoQQFGDQAgAC8BMkH//wNxIgVBnH9qQeQASQ0AIAVBzAFGDQAgBUGwAkYNACAEQcAAcQ0AQQAhAyAEQYgEcUGABEYNACAEQShxQQBHIQMLIABBADsBMCAAQQA6AC8gAwuZAQECfwJAAkACQCAALQAqRQ0AIAAtACtFDQBBACEBIAAvATAiAkECcUUNAQwCC0EAIQEgAC8BMCICQQFxRQ0BC0EBIQEgAC0AKEEBRg0AIAAvATJB//8DcSIAQZx/akHkAEkNACAAQcwBRg0AIABBsAJGDQAgAkHAAHENAEEAIQEgAkGIBHFBgARGDQAgAkEocUEARyEBCyABC1kAIABBGGpCADcDACAAQgA3AwAgAEE4akIANwMAIABBMGpCADcDACAAQShqQgA3AwAgAEEgakIANwMAIABBEGpCADcDACAAQQhqQgA3AwAgAEHdATYCHEEAC3sBAX8CQCAAKAIMIgMNAAJAIAAoAgRFDQAgACABNgIECwJAIAAgASACEMSAgIAAIgMNACAAKAIMDwsgACADNgIcQQAhAyAAKAIEIgFFDQAgACABIAIgACgCCBGBgICAAAAiAUUNACAAIAI2AhQgACABNgIMIAEhAwsgAwvk8wEDDn8DfgR/I4CAgIAAQRBrIgMkgICAgAAgASEEIAEhBSABIQYgASEHIAEhCCABIQkgASEKIAEhCyABIQwgASENIAEhDiABIQ8CQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAA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ACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCAQDscBAAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxweHyAhIyUoP0BBREVGR0hJSktMTU9QUVJT3gNXWVtcXWBiZWZnaGlqa2xtb3BxcnN0dXZ3eHl6e3x9foABggGFAYYBhwGJAYsBjAGNAY4BjwGQAZEBlAGVAZYBlwGYAZkBmgGbAZwBnQGeAZ8BoAGhAaIBowGkAaUBpgGnAagBqQGqAasBrAGtAa4BrwGwAbEBsgGzAbQBtQG2AbcBuAG5AboBu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gAEEANgIEAkAgACAQIAEQp4CAgAAiEA0AIAEhAQxNCyAAQdMANgIcIAAgATYCFCAAIBA2AgxBACEQDLEBCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQp4CAgAAiEA0AIAEhAQxRCyAAQeUANgIcIAAgATYCFCAAIBA2AgxBACEQDLABCyAAQQA2AhwgACABNgIUIABBxoqAgAA2AhAgAEEHNgIMQQAhEAyvAQsgACgCBCEQIABBADYCBAJAIAAgECABEKeAgIAAIhANACABIQEMSQsgAEHSADYCHCAAIAE2AhQgACAQNgIMQQAhEAyuAQsgACgCBCEQIABBADYCBAJAIAAgECABEKeAgIAAIhANACABIQEMSQsgAEHTADYCHCAAIAE2AhQgACAQNgIMQQAhEAytAQsgACgCBCEQIABBADYCBAJAIAAgECABEKeAgIAAIhANACABIQEMTQsgAEHlADYCHCAAIAE2AhQgACAQNgIMQQAhEAysAQsgAEEANgIcIAAgATYCFCAAQdyIgIAANgIQIABBBzYCDEEAIRAMqwELIBBBP0cNASABQQFqIQELQQUhEAyQAQtBACEQIABBADYCHCAAIAE2AhQgAEH9koCAADYCECAAQQc2AgwMqAELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDEILIABB0gA2AhwgACABNgIUIAAgEDYCDEEAIRAMpwELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDEILIABB0wA2AhwgACABNgIUIAAgEDYCDEEAIRAMpgELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDEYLIABB5QA2AhwgACABNgIUIAAgEDYCDEEAIRAMpQELIAAoAgQhASAAQQA2AgQCQCAAIAEgFBCngICAACIBDQAgFCEBDD8LIABB0gA2AhwgACAUNgIUIAAgATYCDEEAIRAMpAELIAAoAgQhASAAQQA2AgQCQCAAIAEgFBCngICAACIBDQAgFCEBDD8LIABB0wA2AhwgACAUNgIUIAAgATYCDEEAIRAMowELIAAoAgQhASAAQQA2AgQCQCAAIAEgFBCngICA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BgARGDQAgAkEocUEARyEBCyABC0kBAXsgAEEQav0MAAAAAAAAAAAAAAAAAAAAACIB/QsDACAAIAH9CwMAIABBMGogAf0LAwAgAEEgaiAB/QsDACAAQd0BNgIcQQALewEBfwJAIAAoAgwiAw0AAkAgACgCBEUNACAAIAE2AgQLAkAgACABIAIQxICAgAAiAw0AIAAoAgwPCyAAIAM2AhxBACEDIAAoAgQiAUUNACAAIAEgAiAAKAIIEYGAgIAAACIBRQ0AIAAgAjYCFCAAIAE2AgwgASEDCyADC+TzAQMOfwN+BH8jgICAgABBEGsiAySAgICAACABIQQgASEFIAEhBiABIQcgASEIIAEhCSABIQogASELIAEhDCABIQ0gASEOIAEhDwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCAAKAIcIhBBf2oO3QHaAQHZAQIDBAUGBwgJCgsMDQ7YAQ8Q1wEREtYBExQVFhcYGRob4AHfARwdHtUBHyAhIiMkJdQBJicoKSorLNMB0gEtLtEB0AEvMDEyMzQ1Njc4OTo7PD0+P0BBQkNERUbb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aC0GrASEQDBkLQawBIRAMGAtBrQEhEAwXC0GuASEQDBYLQQEhEAwVC0GvASEQDBQLQbABIRAMEwtBsQEhEAwSC0GzASEQDBELQbIBIRAMEAtBtAEhEAwPC0G1ASEQDA4LQbYBIRAMDQtBtwEhEAwMC0G4ASEQDAsLQbkBIRAMCgtBugEhEAwJC0G7ASEQDAgLQcYBIRAMBwtBvAEhEAwGC0G9ASEQDAULQb4BIRAMBAtBvwEhEAwDC0HAASEQDAILQcIBIRAMAQtBwQEhEAsDQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQA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cNSkE/IRAM9QMLIAEiASACRw1IQTwhEAz0AwsgASIBIAJHDUFBMSEQDPMDCyAALQAuQQFGDesDDIcCCyAAIAEiASACEMCAgIAAQQFHDeYBIABCADcDIAznAQsgACABIgEgAhC0gICAACIQDecBIAEhAQz1AgsCQCABIgEgAkcNAEEGIRAM8AMLIAAgAUEBaiIBIAIQu4CAgAAiEA3oASABIQEMMQsgAEIANwMgQRIhEAzVAwsgASIQIAJHDStBHSEQDO0DCwJAIAEiASACRg0AIAFBAWohAUEQIRAM1AMLQQchEAzsAwsgAEIAIAApAyAiESACIAEiEGutIhJ9IhMgEyARVhs3AyAgESASViIURQ3lAUEIIRAM6wMLAkAgASIBIAJGDQAgAEGJgICAADYCCCAAIAE2AgQgASEBQRQhEAzSAwtBCSEQDOoDCyABIQEgACkDIFAN5AEgASEBDPICCwJAIAEiASACRw0AQQshEAzpAwsgACABQQFqIgEgAhC2gICAACIQDeUBIAEhAQzyAgsgACABIgEgAhC4gICAACIQDeUBIAEhAQzyAgsgACABIgEgAhC4gICAACIQDeYBIAEhAQwNCyAAIAEiASACELqAgIAAIhAN5wEgASEBDPACCwJAIAEiASACRw0AQQ8hEAzlAwsgAS0AACIQQTtGDQggEEENRw3oASABQQFqIQEM7wILIAAgASIBIAIQuoCAgAAiEA3oASABIQEM8gILA0ACQCABLQAAQfC1gIAAai0AACIQQQFGDQAgEEECRw3rASAAKAIEIRAgAEEANgIEIAAgECABQQFqIgEQuYCAgAAiEA3qASABIQEM9AILIAFBAWoiASACRw0AC0ESIRAM4gMLIAAgASIBIAIQuoCAgAAiEA3pASABIQEMCgsgASIBIAJHDQZBGyEQDOADCwJAIAEiASACRw0AQRYhEAzgAwsgAEGKgICAADYCCCAAIAE2AgQgACABIAIQuICAgAAiEA3qASABIQFBICEQDMYDCwJAIAEiASACRg0AA0ACQCABLQAAQfC3gIAAai0AACIQQQJGDQACQCAQQX9qDgTlAewBAOsB7AELIAFBAWohAUEIIRAMyAMLIAFBAWoiASACRw0A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UEjTw0AIAEhAQxZCyAAQQA2AhwgACABNgIUIABB04mAgAA2AhAgAEEINgIMQQAhEAy5AQsgAEEANgIAC0EAIRAgAEEANgIcIAAgATYCFCAAQZCzgIAANgIQIABBCDYCDAy3AQsgAEEANgIAIBdBAWohAQJAIAAtAClBIUcNACABIQEMVgsgAEEANgIcIAAgATYCFCAAQZuKgIAANgIQIABBCDYCDEEAIRAMtgELIABBADYCACAXQQFqIQECQCAALQApIhBBXWpBC08NACABIQEMVQsCQCAQQQZLDQBBASAQdEHKAHFFDQAgASEBDFULQQAhECAAQQA2AhwgACABNgIUIABB94mAgAA2AhAgAEEINgIMDLUBCyAQQRVGDXEgAEEANgIcIAAgATYCFCAAQbmNgIAANgIQIABBGjYCDEEAIRAMtAELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDFQLIABB5QA2AhwgACABNgIUIAAgEDYCDEEAIRAMswELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDE0LIABB0gA2AhwgACABNgIUIAAgEDYCDEEAIRAMsgELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDE0LIABB0wA2AhwgACABNgIUIAAgEDYCDEEAIRAMsQELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDFELIABB5QA2AhwgACABNgIUIAAgEDYCDEEAIRAMsAELIABBADYCHCAAIAE2AhQgAEHGioCAADYCECAAQQc2AgxBACEQDK8BCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQp4CAgAAiEA0AIAEhAQxJCyAAQdIANgIcIAAgATYCFCAAIBA2AgxBACEQDK4BCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQp4CAgAAiEA0AIAEhAQxJCyAAQdMANgIcIAAgATYCFCAAIBA2AgxBACEQDK0BCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQp4CAgAAiEA0AIAEhAQxNCyAAQeUANgIcIAAgATYCFCAAIBA2AgxBACEQDKw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***/ 1891:
  27724. /***/ ((__unused_webpack_module, exports) => {
  27725. "use strict";
  27726. Object.defineProperty(exports, "__esModule", ({ value: true }));
  27727. exports.enumToMap = void 0;
  27728. function enumToMap(obj) {
  27729. const res = {};
  27730. Object.keys(obj).forEach((key) => {
  27731. const value = obj[key];
  27732. if (typeof value === 'number') {
  27733. res[key] = value;
  27734. }
  27735. });
  27736. return res;
  27737. }
  27738. exports.enumToMap = enumToMap;
  27739. //# sourceMappingURL=utils.js.map
  27740. /***/ }),
  27741. /***/ 6771:
  27742. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  27743. "use strict";
  27744. const { kClients } = __nccwpck_require__(2785)
  27745. const Agent = __nccwpck_require__(7890)
  27746. const {
  27747. kAgent,
  27748. kMockAgentSet,
  27749. kMockAgentGet,
  27750. kDispatches,
  27751. kIsMockActive,
  27752. kNetConnect,
  27753. kGetNetConnect,
  27754. kOptions,
  27755. kFactory
  27756. } = __nccwpck_require__(4347)
  27757. const MockClient = __nccwpck_require__(8687)
  27758. const MockPool = __nccwpck_require__(6193)
  27759. const { matchValue, buildMockOptions } = __nccwpck_require__(9323)
  27760. const { InvalidArgumentError, UndiciError } = __nccwpck_require__(8045)
  27761. const Dispatcher = __nccwpck_require__(412)
  27762. const Pluralizer = __nccwpck_require__(8891)
  27763. const PendingInterceptorsFormatter = __nccwpck_require__(6823)
  27764. class FakeWeakRef {
  27765. constructor (value) {
  27766. this.value = value
  27767. }
  27768. deref () {
  27769. return this.value
  27770. }
  27771. }
  27772. class MockAgent extends Dispatcher {
  27773. constructor (opts) {
  27774. super(opts)
  27775. this[kNetConnect] = true
  27776. this[kIsMockActive] = true
  27777. // Instantiate Agent and encapsulate
  27778. if ((opts && opts.agent && typeof opts.agent.dispatch !== 'function')) {
  27779. throw new InvalidArgumentError('Argument opts.agent must implement Agent')
  27780. }
  27781. const agent = opts && opts.agent ? opts.agent : new Agent(opts)
  27782. this[kAgent] = agent
  27783. this[kClients] = agent[kClients]
  27784. this[kOptions] = buildMockOptions(opts)
  27785. }
  27786. get (origin) {
  27787. let dispatcher = this[kMockAgentGet](origin)
  27788. if (!dispatcher) {
  27789. dispatcher = this[kFactory](origin)
  27790. this[kMockAgentSet](origin, dispatcher)
  27791. }
  27792. return dispatcher
  27793. }
  27794. dispatch (opts, handler) {
  27795. // Call MockAgent.get to perform additional setup before dispatching as normal
  27796. this.get(opts.origin)
  27797. return this[kAgent].dispatch(opts, handler)
  27798. }
  27799. async close () {
  27800. await this[kAgent].close()
  27801. this[kClients].clear()
  27802. }
  27803. deactivate () {
  27804. this[kIsMockActive] = false
  27805. }
  27806. activate () {
  27807. this[kIsMockActive] = true
  27808. }
  27809. enableNetConnect (matcher) {
  27810. if (typeof matcher === 'string' || typeof matcher === 'function' || matcher instanceof RegExp) {
  27811. if (Array.isArray(this[kNetConnect])) {
  27812. this[kNetConnect].push(matcher)
  27813. } else {
  27814. this[kNetConnect] = [matcher]
  27815. }
  27816. } else if (typeof matcher === 'undefined') {
  27817. this[kNetConnect] = true
  27818. } else {
  27819. throw new InvalidArgumentError('Unsupported matcher. Must be one of String|Function|RegExp.')
  27820. }
  27821. }
  27822. disableNetConnect () {
  27823. this[kNetConnect] = false
  27824. }
  27825. // This is required to bypass issues caused by using global symbols - see:
  27826. // https://github.com/nodejs/undici/issues/1447
  27827. get isMockActive () {
  27828. return this[kIsMockActive]
  27829. }
  27830. [kMockAgentSet] (origin, dispatcher) {
  27831. this[kClients].set(origin, new FakeWeakRef(dispatcher))
  27832. }
  27833. [kFactory] (origin) {
  27834. const mockOptions = Object.assign({ agent: this }, this[kOptions])
  27835. return this[kOptions] && this[kOptions].connections === 1
  27836. ? new MockClient(origin, mockOptions)
  27837. : new MockPool(origin, mockOptions)
  27838. }
  27839. [kMockAgentGet] (origin) {
  27840. // First check if we can immediately find it
  27841. const ref = this[kClients].get(origin)
  27842. if (ref) {
  27843. return ref.deref()
  27844. }
  27845. // If the origin is not a string create a dummy parent pool and return to user
  27846. if (typeof origin !== 'string') {
  27847. const dispatcher = this[kFactory]('http://localhost:9999')
  27848. this[kMockAgentSet](origin, dispatcher)
  27849. return dispatcher
  27850. }
  27851. // If we match, create a pool and assign the same dispatches
  27852. for (const [keyMatcher, nonExplicitRef] of Array.from(this[kClients])) {
  27853. const nonExplicitDispatcher = nonExplicitRef.deref()
  27854. if (nonExplicitDispatcher && typeof keyMatcher !== 'string' && matchValue(keyMatcher, origin)) {
  27855. const dispatcher = this[kFactory](origin)
  27856. this[kMockAgentSet](origin, dispatcher)
  27857. dispatcher[kDispatches] = nonExplicitDispatcher[kDispatches]
  27858. return dispatcher
  27859. }
  27860. }
  27861. }
  27862. [kGetNetConnect] () {
  27863. return this[kNetConnect]
  27864. }
  27865. pendingInterceptors () {
  27866. const mockAgentClients = this[kClients]
  27867. return Array.from(mockAgentClients.entries())
  27868. .flatMap(([origin, scope]) => scope.deref()[kDispatches].map(dispatch => ({ ...dispatch, origin })))
  27869. .filter(({ pending }) => pending)
  27870. }
  27871. assertNoPendingInterceptors ({ pendingInterceptorsFormatter = new PendingInterceptorsFormatter() } = {}) {
  27872. const pending = this.pendingInterceptors()
  27873. if (pending.length === 0) {
  27874. return
  27875. }
  27876. const pluralizer = new Pluralizer('interceptor', 'interceptors').pluralize(pending.length)
  27877. throw new UndiciError(`
  27878. ${pluralizer.count} ${pluralizer.noun} ${pluralizer.is} pending:
  27879. ${pendingInterceptorsFormatter.format(pending)}
  27880. `.trim())
  27881. }
  27882. }
  27883. module.exports = MockAgent
  27884. /***/ }),
  27885. /***/ 8687:
  27886. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  27887. "use strict";
  27888. const { promisify } = __nccwpck_require__(3837)
  27889. const Client = __nccwpck_require__(3598)
  27890. const { buildMockDispatch } = __nccwpck_require__(9323)
  27891. const {
  27892. kDispatches,
  27893. kMockAgent,
  27894. kClose,
  27895. kOriginalClose,
  27896. kOrigin,
  27897. kOriginalDispatch,
  27898. kConnected
  27899. } = __nccwpck_require__(4347)
  27900. const { MockInterceptor } = __nccwpck_require__(410)
  27901. const Symbols = __nccwpck_require__(2785)
  27902. const { InvalidArgumentError } = __nccwpck_require__(8045)
  27903. /**
  27904. * MockClient provides an API that extends the Client to influence the mockDispatches.
  27905. */
  27906. class MockClient extends Client {
  27907. constructor (origin, opts) {
  27908. super(origin, opts)
  27909. if (!opts || !opts.agent || typeof opts.agent.dispatch !== 'function') {
  27910. throw new InvalidArgumentError('Argument opts.agent must implement Agent')
  27911. }
  27912. this[kMockAgent] = opts.agent
  27913. this[kOrigin] = origin
  27914. this[kDispatches] = []
  27915. this[kConnected] = 1
  27916. this[kOriginalDispatch] = this.dispatch
  27917. this[kOriginalClose] = this.close.bind(this)
  27918. this.dispatch = buildMockDispatch.call(this)
  27919. this.close = this[kClose]
  27920. }
  27921. get [Symbols.kConnected] () {
  27922. return this[kConnected]
  27923. }
  27924. /**
  27925. * Sets up the base interceptor for mocking replies from undici.
  27926. */
  27927. intercept (opts) {
  27928. return new MockInterceptor(opts, this[kDispatches])
  27929. }
  27930. async [kClose] () {
  27931. await promisify(this[kOriginalClose])()
  27932. this[kConnected] = 0
  27933. this[kMockAgent][Symbols.kClients].delete(this[kOrigin])
  27934. }
  27935. }
  27936. module.exports = MockClient
  27937. /***/ }),
  27938. /***/ 888:
  27939. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  27940. "use strict";
  27941. const { UndiciError } = __nccwpck_require__(8045)
  27942. class MockNotMatchedError extends UndiciError {
  27943. constructor (message) {
  27944. super(message)
  27945. Error.captureStackTrace(this, MockNotMatchedError)
  27946. this.name = 'MockNotMatchedError'
  27947. this.message = message || 'The request does not match any registered mock dispatches'
  27948. this.code = 'UND_MOCK_ERR_MOCK_NOT_MATCHED'
  27949. }
  27950. }
  27951. module.exports = {
  27952. MockNotMatchedError
  27953. }
  27954. /***/ }),
  27955. /***/ 410:
  27956. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  27957. "use strict";
  27958. const { getResponseData, buildKey, addMockDispatch } = __nccwpck_require__(9323)
  27959. const {
  27960. kDispatches,
  27961. kDispatchKey,
  27962. kDefaultHeaders,
  27963. kDefaultTrailers,
  27964. kContentLength,
  27965. kMockDispatch
  27966. } = __nccwpck_require__(4347)
  27967. const { InvalidArgumentError } = __nccwpck_require__(8045)
  27968. const { buildURL } = __nccwpck_require__(3983)
  27969. /**
  27970. * Defines the scope API for an interceptor reply
  27971. */
  27972. class MockScope {
  27973. constructor (mockDispatch) {
  27974. this[kMockDispatch] = mockDispatch
  27975. }
  27976. /**
  27977. * Delay a reply by a set amount in ms.
  27978. */
  27979. delay (waitInMs) {
  27980. if (typeof waitInMs !== 'number' || !Number.isInteger(waitInMs) || waitInMs <= 0) {
  27981. throw new InvalidArgumentError('waitInMs must be a valid integer > 0')
  27982. }
  27983. this[kMockDispatch].delay = waitInMs
  27984. return this
  27985. }
  27986. /**
  27987. * For a defined reply, never mark as consumed.
  27988. */
  27989. persist () {
  27990. this[kMockDispatch].persist = true
  27991. return this
  27992. }
  27993. /**
  27994. * Allow one to define a reply for a set amount of matching requests.
  27995. */
  27996. times (repeatTimes) {
  27997. if (typeof repeatTimes !== 'number' || !Number.isInteger(repeatTimes) || repeatTimes <= 0) {
  27998. throw new InvalidArgumentError('repeatTimes must be a valid integer > 0')
  27999. }
  28000. this[kMockDispatch].times = repeatTimes
  28001. return this
  28002. }
  28003. }
  28004. /**
  28005. * Defines an interceptor for a Mock
  28006. */
  28007. class MockInterceptor {
  28008. constructor (opts, mockDispatches) {
  28009. if (typeof opts !== 'object') {
  28010. throw new InvalidArgumentError('opts must be an object')
  28011. }
  28012. if (typeof opts.path === 'undefined') {
  28013. throw new InvalidArgumentError('opts.path must be defined')
  28014. }
  28015. if (typeof opts.method === 'undefined') {
  28016. opts.method = 'GET'
  28017. }
  28018. // See https://github.com/nodejs/undici/issues/1245
  28019. // As per RFC 3986, clients are not supposed to send URI
  28020. // fragments to servers when they retrieve a document,
  28021. if (typeof opts.path === 'string') {
  28022. if (opts.query) {
  28023. opts.path = buildURL(opts.path, opts.query)
  28024. } else {
  28025. // Matches https://github.com/nodejs/undici/blob/main/lib/fetch/index.js#L1811
  28026. const parsedURL = new URL(opts.path, 'data://')
  28027. opts.path = parsedURL.pathname + parsedURL.search
  28028. }
  28029. }
  28030. if (typeof opts.method === 'string') {
  28031. opts.method = opts.method.toUpperCase()
  28032. }
  28033. this[kDispatchKey] = buildKey(opts)
  28034. this[kDispatches] = mockDispatches
  28035. this[kDefaultHeaders] = {}
  28036. this[kDefaultTrailers] = {}
  28037. this[kContentLength] = false
  28038. }
  28039. createMockScopeDispatchData (statusCode, data, responseOptions = {}) {
  28040. const responseData = getResponseData(data)
  28041. const contentLength = this[kContentLength] ? { 'content-length': responseData.length } : {}
  28042. const headers = { ...this[kDefaultHeaders], ...contentLength, ...responseOptions.headers }
  28043. const trailers = { ...this[kDefaultTrailers], ...responseOptions.trailers }
  28044. return { statusCode, data, headers, trailers }
  28045. }
  28046. validateReplyParameters (statusCode, data, responseOptions) {
  28047. if (typeof statusCode === 'undefined') {
  28048. throw new InvalidArgumentError('statusCode must be defined')
  28049. }
  28050. if (typeof data === 'undefined') {
  28051. throw new InvalidArgumentError('data must be defined')
  28052. }
  28053. if (typeof responseOptions !== 'object') {
  28054. throw new InvalidArgumentError('responseOptions must be an object')
  28055. }
  28056. }
  28057. /**
  28058. * Mock an undici request with a defined reply.
  28059. */
  28060. reply (replyData) {
  28061. // Values of reply aren't available right now as they
  28062. // can only be available when the reply callback is invoked.
  28063. if (typeof replyData === 'function') {
  28064. // We'll first wrap the provided callback in another function,
  28065. // this function will properly resolve the data from the callback
  28066. // when invoked.
  28067. const wrappedDefaultsCallback = (opts) => {
  28068. // Our reply options callback contains the parameter for statusCode, data and options.
  28069. const resolvedData = replyData(opts)
  28070. // Check if it is in the right format
  28071. if (typeof resolvedData !== 'object') {
  28072. throw new InvalidArgumentError('reply options callback must return an object')
  28073. }
  28074. const { statusCode, data = '', responseOptions = {} } = resolvedData
  28075. this.validateReplyParameters(statusCode, data, responseOptions)
  28076. // Since the values can be obtained immediately we return them
  28077. // from this higher order function that will be resolved later.
  28078. return {
  28079. ...this.createMockScopeDispatchData(statusCode, data, responseOptions)
  28080. }
  28081. }
  28082. // Add usual dispatch data, but this time set the data parameter to function that will eventually provide data.
  28083. const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], wrappedDefaultsCallback)
  28084. return new MockScope(newMockDispatch)
  28085. }
  28086. // We can have either one or three parameters, if we get here,
  28087. // we should have 1-3 parameters. So we spread the arguments of
  28088. // this function to obtain the parameters, since replyData will always
  28089. // just be the statusCode.
  28090. const [statusCode, data = '', responseOptions = {}] = [...arguments]
  28091. this.validateReplyParameters(statusCode, data, responseOptions)
  28092. // Send in-already provided data like usual
  28093. const dispatchData = this.createMockScopeDispatchData(statusCode, data, responseOptions)
  28094. const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], dispatchData)
  28095. return new MockScope(newMockDispatch)
  28096. }
  28097. /**
  28098. * Mock an undici request with a defined error.
  28099. */
  28100. replyWithError (error) {
  28101. if (typeof error === 'undefined') {
  28102. throw new InvalidArgumentError('error must be defined')
  28103. }
  28104. const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], { error })
  28105. return new MockScope(newMockDispatch)
  28106. }
  28107. /**
  28108. * Set default reply headers on the interceptor for subsequent replies
  28109. */
  28110. defaultReplyHeaders (headers) {
  28111. if (typeof headers === 'undefined') {
  28112. throw new InvalidArgumentError('headers must be defined')
  28113. }
  28114. this[kDefaultHeaders] = headers
  28115. return this
  28116. }
  28117. /**
  28118. * Set default reply trailers on the interceptor for subsequent replies
  28119. */
  28120. defaultReplyTrailers (trailers) {
  28121. if (typeof trailers === 'undefined') {
  28122. throw new InvalidArgumentError('trailers must be defined')
  28123. }
  28124. this[kDefaultTrailers] = trailers
  28125. return this
  28126. }
  28127. /**
  28128. * Set reply content length header for replies on the interceptor
  28129. */
  28130. replyContentLength () {
  28131. this[kContentLength] = true
  28132. return this
  28133. }
  28134. }
  28135. module.exports.MockInterceptor = MockInterceptor
  28136. module.exports.MockScope = MockScope
  28137. /***/ }),
  28138. /***/ 6193:
  28139. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  28140. "use strict";
  28141. const { promisify } = __nccwpck_require__(3837)
  28142. const Pool = __nccwpck_require__(4634)
  28143. const { buildMockDispatch } = __nccwpck_require__(9323)
  28144. const {
  28145. kDispatches,
  28146. kMockAgent,
  28147. kClose,
  28148. kOriginalClose,
  28149. kOrigin,
  28150. kOriginalDispatch,
  28151. kConnected
  28152. } = __nccwpck_require__(4347)
  28153. const { MockInterceptor } = __nccwpck_require__(410)
  28154. const Symbols = __nccwpck_require__(2785)
  28155. const { InvalidArgumentError } = __nccwpck_require__(8045)
  28156. /**
  28157. * MockPool provides an API that extends the Pool to influence the mockDispatches.
  28158. */
  28159. class MockPool extends Pool {
  28160. constructor (origin, opts) {
  28161. super(origin, opts)
  28162. if (!opts || !opts.agent || typeof opts.agent.dispatch !== 'function') {
  28163. throw new InvalidArgumentError('Argument opts.agent must implement Agent')
  28164. }
  28165. this[kMockAgent] = opts.agent
  28166. this[kOrigin] = origin
  28167. this[kDispatches] = []
  28168. this[kConnected] = 1
  28169. this[kOriginalDispatch] = this.dispatch
  28170. this[kOriginalClose] = this.close.bind(this)
  28171. this.dispatch = buildMockDispatch.call(this)
  28172. this.close = this[kClose]
  28173. }
  28174. get [Symbols.kConnected] () {
  28175. return this[kConnected]
  28176. }
  28177. /**
  28178. * Sets up the base interceptor for mocking replies from undici.
  28179. */
  28180. intercept (opts) {
  28181. return new MockInterceptor(opts, this[kDispatches])
  28182. }
  28183. async [kClose] () {
  28184. await promisify(this[kOriginalClose])()
  28185. this[kConnected] = 0
  28186. this[kMockAgent][Symbols.kClients].delete(this[kOrigin])
  28187. }
  28188. }
  28189. module.exports = MockPool
  28190. /***/ }),
  28191. /***/ 4347:
  28192. /***/ ((module) => {
  28193. "use strict";
  28194. module.exports = {
  28195. kAgent: Symbol('agent'),
  28196. kOptions: Symbol('options'),
  28197. kFactory: Symbol('factory'),
  28198. kDispatches: Symbol('dispatches'),
  28199. kDispatchKey: Symbol('dispatch key'),
  28200. kDefaultHeaders: Symbol('default headers'),
  28201. kDefaultTrailers: Symbol('default trailers'),
  28202. kContentLength: Symbol('content length'),
  28203. kMockAgent: Symbol('mock agent'),
  28204. kMockAgentSet: Symbol('mock agent set'),
  28205. kMockAgentGet: Symbol('mock agent get'),
  28206. kMockDispatch: Symbol('mock dispatch'),
  28207. kClose: Symbol('close'),
  28208. kOriginalClose: Symbol('original agent close'),
  28209. kOrigin: Symbol('origin'),
  28210. kIsMockActive: Symbol('is mock active'),
  28211. kNetConnect: Symbol('net connect'),
  28212. kGetNetConnect: Symbol('get net connect'),
  28213. kConnected: Symbol('connected')
  28214. }
  28215. /***/ }),
  28216. /***/ 9323:
  28217. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  28218. "use strict";
  28219. const { MockNotMatchedError } = __nccwpck_require__(888)
  28220. const {
  28221. kDispatches,
  28222. kMockAgent,
  28223. kOriginalDispatch,
  28224. kOrigin,
  28225. kGetNetConnect
  28226. } = __nccwpck_require__(4347)
  28227. const { buildURL, nop } = __nccwpck_require__(3983)
  28228. const { STATUS_CODES } = __nccwpck_require__(3685)
  28229. const {
  28230. types: {
  28231. isPromise
  28232. }
  28233. } = __nccwpck_require__(3837)
  28234. function matchValue (match, value) {
  28235. if (typeof match === 'string') {
  28236. return match === value
  28237. }
  28238. if (match instanceof RegExp) {
  28239. return match.test(value)
  28240. }
  28241. if (typeof match === 'function') {
  28242. return match(value) === true
  28243. }
  28244. return false
  28245. }
  28246. function lowerCaseEntries (headers) {
  28247. return Object.fromEntries(
  28248. Object.entries(headers).map(([headerName, headerValue]) => {
  28249. return [headerName.toLocaleLowerCase(), headerValue]
  28250. })
  28251. )
  28252. }
  28253. /**
  28254. * @param {import('../../index').Headers|string[]|Record<string, string>} headers
  28255. * @param {string} key
  28256. */
  28257. function getHeaderByName (headers, key) {
  28258. if (Array.isArray(headers)) {
  28259. for (let i = 0; i < headers.length; i += 2) {
  28260. if (headers[i].toLocaleLowerCase() === key.toLocaleLowerCase()) {
  28261. return headers[i + 1]
  28262. }
  28263. }
  28264. return undefined
  28265. } else if (typeof headers.get === 'function') {
  28266. return headers.get(key)
  28267. } else {
  28268. return lowerCaseEntries(headers)[key.toLocaleLowerCase()]
  28269. }
  28270. }
  28271. /** @param {string[]} headers */
  28272. function buildHeadersFromArray (headers) { // fetch HeadersList
  28273. const clone = headers.slice()
  28274. const entries = []
  28275. for (let index = 0; index < clone.length; index += 2) {
  28276. entries.push([clone[index], clone[index + 1]])
  28277. }
  28278. return Object.fromEntries(entries)
  28279. }
  28280. function matchHeaders (mockDispatch, headers) {
  28281. if (typeof mockDispatch.headers === 'function') {
  28282. if (Array.isArray(headers)) { // fetch HeadersList
  28283. headers = buildHeadersFromArray(headers)
  28284. }
  28285. return mockDispatch.headers(headers ? lowerCaseEntries(headers) : {})
  28286. }
  28287. if (typeof mockDispatch.headers === 'undefined') {
  28288. return true
  28289. }
  28290. if (typeof headers !== 'object' || typeof mockDispatch.headers !== 'object') {
  28291. return false
  28292. }
  28293. for (const [matchHeaderName, matchHeaderValue] of Object.entries(mockDispatch.headers)) {
  28294. const headerValue = getHeaderByName(headers, matchHeaderName)
  28295. if (!matchValue(matchHeaderValue, headerValue)) {
  28296. return false
  28297. }
  28298. }
  28299. return true
  28300. }
  28301. function safeUrl (path) {
  28302. if (typeof path !== 'string') {
  28303. return path
  28304. }
  28305. const pathSegments = path.split('?')
  28306. if (pathSegments.length !== 2) {
  28307. return path
  28308. }
  28309. const qp = new URLSearchParams(pathSegments.pop())
  28310. qp.sort()
  28311. return [...pathSegments, qp.toString()].join('?')
  28312. }
  28313. function matchKey (mockDispatch, { path, method, body, headers }) {
  28314. const pathMatch = matchValue(mockDispatch.path, path)
  28315. const methodMatch = matchValue(mockDispatch.method, method)
  28316. const bodyMatch = typeof mockDispatch.body !== 'undefined' ? matchValue(mockDispatch.body, body) : true
  28317. const headersMatch = matchHeaders(mockDispatch, headers)
  28318. return pathMatch && methodMatch && bodyMatch && headersMatch
  28319. }
  28320. function getResponseData (data) {
  28321. if (Buffer.isBuffer(data)) {
  28322. return data
  28323. } else if (typeof data === 'object') {
  28324. return JSON.stringify(data)
  28325. } else {
  28326. return data.toString()
  28327. }
  28328. }
  28329. function getMockDispatch (mockDispatches, key) {
  28330. const basePath = key.query ? buildURL(key.path, key.query) : key.path
  28331. const resolvedPath = typeof basePath === 'string' ? safeUrl(basePath) : basePath
  28332. // Match path
  28333. let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path }) => matchValue(safeUrl(path), resolvedPath))
  28334. if (matchedMockDispatches.length === 0) {
  28335. throw new MockNotMatchedError(`Mock dispatch not matched for path '${resolvedPath}'`)
  28336. }
  28337. // Match method
  28338. matchedMockDispatches = matchedMockDispatches.filter(({ method }) => matchValue(method, key.method))
  28339. if (matchedMockDispatches.length === 0) {
  28340. throw new MockNotMatchedError(`Mock dispatch not matched for method '${key.method}'`)
  28341. }
  28342. // Match body
  28343. matchedMockDispatches = matchedMockDispatches.filter(({ body }) => typeof body !== 'undefined' ? matchValue(body, key.body) : true)
  28344. if (matchedMockDispatches.length === 0) {
  28345. throw new MockNotMatchedError(`Mock dispatch not matched for body '${key.body}'`)
  28346. }
  28347. // Match headers
  28348. matchedMockDispatches = matchedMockDispatches.filter((mockDispatch) => matchHeaders(mockDispatch, key.headers))
  28349. if (matchedMockDispatches.length === 0) {
  28350. throw new MockNotMatchedError(`Mock dispatch not matched for headers '${typeof key.headers === 'object' ? JSON.stringify(key.headers) : key.headers}'`)
  28351. }
  28352. return matchedMockDispatches[0]
  28353. }
  28354. function addMockDispatch (mockDispatches, key, data) {
  28355. const baseData = { timesInvoked: 0, times: 1, persist: false, consumed: false }
  28356. const replyData = typeof data === 'function' ? { callback: data } : { ...data }
  28357. const newMockDispatch = { ...baseData, ...key, pending: true, data: { error: null, ...replyData } }
  28358. mockDispatches.push(newMockDispatch)
  28359. return newMockDispatch
  28360. }
  28361. function deleteMockDispatch (mockDispatches, key) {
  28362. const index = mockDispatches.findIndex(dispatch => {
  28363. if (!dispatch.consumed) {
  28364. return false
  28365. }
  28366. return matchKey(dispatch, key)
  28367. })
  28368. if (index !== -1) {
  28369. mockDispatches.splice(index, 1)
  28370. }
  28371. }
  28372. function buildKey (opts) {
  28373. const { path, method, body, headers, query } = opts
  28374. return {
  28375. path,
  28376. method,
  28377. body,
  28378. headers,
  28379. query
  28380. }
  28381. }
  28382. function generateKeyValues (data) {
  28383. return Object.entries(data).reduce((keyValuePairs, [key, value]) => [
  28384. ...keyValuePairs,
  28385. Buffer.from(`${key}`),
  28386. Array.isArray(value) ? value.map(x => Buffer.from(`${x}`)) : Buffer.from(`${value}`)
  28387. ], [])
  28388. }
  28389. /**
  28390. * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Status
  28391. * @param {number} statusCode
  28392. */
  28393. function getStatusText (statusCode) {
  28394. return STATUS_CODES[statusCode] || 'unknown'
  28395. }
  28396. async function getResponse (body) {
  28397. const buffers = []
  28398. for await (const data of body) {
  28399. buffers.push(data)
  28400. }
  28401. return Buffer.concat(buffers).toString('utf8')
  28402. }
  28403. /**
  28404. * Mock dispatch function used to simulate undici dispatches
  28405. */
  28406. function mockDispatch (opts, handler) {
  28407. // Get mock dispatch from built key
  28408. const key = buildKey(opts)
  28409. const mockDispatch = getMockDispatch(this[kDispatches], key)
  28410. mockDispatch.timesInvoked++
  28411. // Here's where we resolve a callback if a callback is present for the dispatch data.
  28412. if (mockDispatch.data.callback) {
  28413. mockDispatch.data = { ...mockDispatch.data, ...mockDispatch.data.callback(opts) }
  28414. }
  28415. // Parse mockDispatch data
  28416. const { data: { statusCode, data, headers, trailers, error }, delay, persist } = mockDispatch
  28417. const { timesInvoked, times } = mockDispatch
  28418. // If it's used up and not persistent, mark as consumed
  28419. mockDispatch.consumed = !persist && timesInvoked >= times
  28420. mockDispatch.pending = timesInvoked < times
  28421. // If specified, trigger dispatch error
  28422. if (error !== null) {
  28423. deleteMockDispatch(this[kDispatches], key)
  28424. handler.onError(error)
  28425. return true
  28426. }
  28427. // Handle the request with a delay if necessary
  28428. if (typeof delay === 'number' && delay > 0) {
  28429. setTimeout(() => {
  28430. handleReply(this[kDispatches])
  28431. }, delay)
  28432. } else {
  28433. handleReply(this[kDispatches])
  28434. }
  28435. function handleReply (mockDispatches, _data = data) {
  28436. // fetch's HeadersList is a 1D string array
  28437. const optsHeaders = Array.isArray(opts.headers)
  28438. ? buildHeadersFromArray(opts.headers)
  28439. : opts.headers
  28440. const body = typeof _data === 'function'
  28441. ? _data({ ...opts, headers: optsHeaders })
  28442. : _data
  28443. // util.types.isPromise is likely needed for jest.
  28444. if (isPromise(body)) {
  28445. // If handleReply is asynchronous, throwing an error
  28446. // in the callback will reject the promise, rather than
  28447. // synchronously throw the error, which breaks some tests.
  28448. // Rather, we wait for the callback to resolve if it is a
  28449. // promise, and then re-run handleReply with the new body.
  28450. body.then((newData) => handleReply(mockDispatches, newData))
  28451. return
  28452. }
  28453. const responseData = getResponseData(body)
  28454. const responseHeaders = generateKeyValues(headers)
  28455. const responseTrailers = generateKeyValues(trailers)
  28456. handler.abort = nop
  28457. handler.onHeaders(statusCode, responseHeaders, resume, getStatusText(statusCode))
  28458. handler.onData(Buffer.from(responseData))
  28459. handler.onComplete(responseTrailers)
  28460. deleteMockDispatch(mockDispatches, key)
  28461. }
  28462. function resume () {}
  28463. return true
  28464. }
  28465. function buildMockDispatch () {
  28466. const agent = this[kMockAgent]
  28467. const origin = this[kOrigin]
  28468. const originalDispatch = this[kOriginalDispatch]
  28469. return function dispatch (opts, handler) {
  28470. if (agent.isMockActive) {
  28471. try {
  28472. mockDispatch.call(this, opts, handler)
  28473. } catch (error) {
  28474. if (error instanceof MockNotMatchedError) {
  28475. const netConnect = agent[kGetNetConnect]()
  28476. if (netConnect === false) {
  28477. throw new MockNotMatchedError(`${error.message}: subsequent request to origin ${origin} was not allowed (net.connect disabled)`)
  28478. }
  28479. if (checkNetConnect(netConnect, origin)) {
  28480. originalDispatch.call(this, opts, handler)
  28481. } else {
  28482. throw new MockNotMatchedError(`${error.message}: subsequent request to origin ${origin} was not allowed (net.connect is not enabled for this origin)`)
  28483. }
  28484. } else {
  28485. throw error
  28486. }
  28487. }
  28488. } else {
  28489. originalDispatch.call(this, opts, handler)
  28490. }
  28491. }
  28492. }
  28493. function checkNetConnect (netConnect, origin) {
  28494. const url = new URL(origin)
  28495. if (netConnect === true) {
  28496. return true
  28497. } else if (Array.isArray(netConnect) && netConnect.some((matcher) => matchValue(matcher, url.host))) {
  28498. return true
  28499. }
  28500. return false
  28501. }
  28502. function buildMockOptions (opts) {
  28503. if (opts) {
  28504. const { agent, ...mockOptions } = opts
  28505. return mockOptions
  28506. }
  28507. }
  28508. module.exports = {
  28509. getResponseData,
  28510. getMockDispatch,
  28511. addMockDispatch,
  28512. deleteMockDispatch,
  28513. buildKey,
  28514. generateKeyValues,
  28515. matchValue,
  28516. getResponse,
  28517. getStatusText,
  28518. mockDispatch,
  28519. buildMockDispatch,
  28520. checkNetConnect,
  28521. buildMockOptions,
  28522. getHeaderByName
  28523. }
  28524. /***/ }),
  28525. /***/ 6823:
  28526. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  28527. "use strict";
  28528. const { Transform } = __nccwpck_require__(2781)
  28529. const { Console } = __nccwpck_require__(6206)
  28530. /**
  28531. * Gets the output of `console.table(…)` as a string.
  28532. */
  28533. module.exports = class PendingInterceptorsFormatter {
  28534. constructor ({ disableColors } = {}) {
  28535. this.transform = new Transform({
  28536. transform (chunk, _enc, cb) {
  28537. cb(null, chunk)
  28538. }
  28539. })
  28540. this.logger = new Console({
  28541. stdout: this.transform,
  28542. inspectOptions: {
  28543. colors: !disableColors && !process.env.CI
  28544. }
  28545. })
  28546. }
  28547. format (pendingInterceptors) {
  28548. const withPrettyHeaders = pendingInterceptors.map(
  28549. ({ method, path, data: { statusCode }, persist, times, timesInvoked, origin }) => ({
  28550. Method: method,
  28551. Origin: origin,
  28552. Path: path,
  28553. 'Status code': statusCode,
  28554. Persistent: persist ? '✅' : '❌',
  28555. Invocations: timesInvoked,
  28556. Remaining: persist ? Infinity : times - timesInvoked
  28557. }))
  28558. this.logger.table(withPrettyHeaders)
  28559. return this.transform.read().toString()
  28560. }
  28561. }
  28562. /***/ }),
  28563. /***/ 8891:
  28564. /***/ ((module) => {
  28565. "use strict";
  28566. const singulars = {
  28567. pronoun: 'it',
  28568. is: 'is',
  28569. was: 'was',
  28570. this: 'this'
  28571. }
  28572. const plurals = {
  28573. pronoun: 'they',
  28574. is: 'are',
  28575. was: 'were',
  28576. this: 'these'
  28577. }
  28578. module.exports = class Pluralizer {
  28579. constructor (singular, plural) {
  28580. this.singular = singular
  28581. this.plural = plural
  28582. }
  28583. pluralize (count) {
  28584. const one = count === 1
  28585. const keys = one ? singulars : plurals
  28586. const noun = one ? this.singular : this.plural
  28587. return { ...keys, count, noun }
  28588. }
  28589. }
  28590. /***/ }),
  28591. /***/ 8266:
  28592. /***/ ((module) => {
  28593. "use strict";
  28594. /* eslint-disable */
  28595. // Extracted from node/lib/internal/fixed_queue.js
  28596. // Currently optimal queue size, tested on V8 6.0 - 6.6. Must be power of two.
  28597. const kSize = 2048;
  28598. const kMask = kSize - 1;
  28599. // The FixedQueue is implemented as a singly-linked list of fixed-size
  28600. // circular buffers. It looks something like this:
  28601. //
  28602. // head tail
  28603. // | |
  28604. // v v
  28605. // +-----------+ <-----\ +-----------+ <------\ +-----------+
  28606. // | [null] | \----- | next | \------- | next |
  28607. // +-----------+ +-----------+ +-----------+
  28608. // | item | <-- bottom | item | <-- bottom | [empty] |
  28609. // | item | | item | | [empty] |
  28610. // | item | | item | | [empty] |
  28611. // | item | | item | | [empty] |
  28612. // | item | | item | bottom --> | item |
  28613. // | item | | item | | item |
  28614. // | ... | | ... | | ... |
  28615. // | item | | item | | item |
  28616. // | item | | item | | item |
  28617. // | [empty] | <-- top | item | | item |
  28618. // | [empty] | | item | | item |
  28619. // | [empty] | | [empty] | <-- top top --> | [empty] |
  28620. // +-----------+ +-----------+ +-----------+
  28621. //
  28622. // Or, if there is only one circular buffer, it looks something
  28623. // like either of these:
  28624. //
  28625. // head tail head tail
  28626. // | | | |
  28627. // v v v v
  28628. // +-----------+ +-----------+
  28629. // | [null] | | [null] |
  28630. // +-----------+ +-----------+
  28631. // | [empty] | | item |
  28632. // | [empty] | | item |
  28633. // | item | <-- bottom top --> | [empty] |
  28634. // | item | | [empty] |
  28635. // | [empty] | <-- top bottom --> | item |
  28636. // | [empty] | | item |
  28637. // +-----------+ +-----------+
  28638. //
  28639. // Adding a value means moving `top` forward by one, removing means
  28640. // moving `bottom` forward by one. After reaching the end, the queue
  28641. // wraps around.
  28642. //
  28643. // When `top === bottom` the current queue is empty and when
  28644. // `top + 1 === bottom` it's full. This wastes a single space of storage
  28645. // but allows much quicker checks.
  28646. class FixedCircularBuffer {
  28647. constructor() {
  28648. this.bottom = 0;
  28649. this.top = 0;
  28650. this.list = new Array(kSize);
  28651. this.next = null;
  28652. }
  28653. isEmpty() {
  28654. return this.top === this.bottom;
  28655. }
  28656. isFull() {
  28657. return ((this.top + 1) & kMask) === this.bottom;
  28658. }
  28659. push(data) {
  28660. this.list[this.top] = data;
  28661. this.top = (this.top + 1) & kMask;
  28662. }
  28663. shift() {
  28664. const nextItem = this.list[this.bottom];
  28665. if (nextItem === undefined)
  28666. return null;
  28667. this.list[this.bottom] = undefined;
  28668. this.bottom = (this.bottom + 1) & kMask;
  28669. return nextItem;
  28670. }
  28671. }
  28672. module.exports = class FixedQueue {
  28673. constructor() {
  28674. this.head = this.tail = new FixedCircularBuffer();
  28675. }
  28676. isEmpty() {
  28677. return this.head.isEmpty();
  28678. }
  28679. push(data) {
  28680. if (this.head.isFull()) {
  28681. // Head is full: Creates a new queue, sets the old queue's `.next` to it,
  28682. // and sets it as the new main queue.
  28683. this.head = this.head.next = new FixedCircularBuffer();
  28684. }
  28685. this.head.push(data);
  28686. }
  28687. shift() {
  28688. const tail = this.tail;
  28689. const next = tail.shift();
  28690. if (tail.isEmpty() && tail.next !== null) {
  28691. // If there is another queue, it forms the new tail.
  28692. this.tail = tail.next;
  28693. }
  28694. return next;
  28695. }
  28696. };
  28697. /***/ }),
  28698. /***/ 3198:
  28699. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  28700. "use strict";
  28701. const DispatcherBase = __nccwpck_require__(4839)
  28702. const FixedQueue = __nccwpck_require__(8266)
  28703. const { kConnected, kSize, kRunning, kPending, kQueued, kBusy, kFree, kUrl, kClose, kDestroy, kDispatch } = __nccwpck_require__(2785)
  28704. const PoolStats = __nccwpck_require__(9689)
  28705. const kClients = Symbol('clients')
  28706. const kNeedDrain = Symbol('needDrain')
  28707. const kQueue = Symbol('queue')
  28708. const kClosedResolve = Symbol('closed resolve')
  28709. const kOnDrain = Symbol('onDrain')
  28710. const kOnConnect = Symbol('onConnect')
  28711. const kOnDisconnect = Symbol('onDisconnect')
  28712. const kOnConnectionError = Symbol('onConnectionError')
  28713. const kGetDispatcher = Symbol('get dispatcher')
  28714. const kAddClient = Symbol('add client')
  28715. const kRemoveClient = Symbol('remove client')
  28716. const kStats = Symbol('stats')
  28717. class PoolBase extends DispatcherBase {
  28718. constructor () {
  28719. super()
  28720. this[kQueue] = new FixedQueue()
  28721. this[kClients] = []
  28722. this[kQueued] = 0
  28723. const pool = this
  28724. this[kOnDrain] = function onDrain (origin, targets) {
  28725. const queue = pool[kQueue]
  28726. let needDrain = false
  28727. while (!needDrain) {
  28728. const item = queue.shift()
  28729. if (!item) {
  28730. break
  28731. }
  28732. pool[kQueued]--
  28733. needDrain = !this.dispatch(item.opts, item.handler)
  28734. }
  28735. this[kNeedDrain] = needDrain
  28736. if (!this[kNeedDrain] && pool[kNeedDrain]) {
  28737. pool[kNeedDrain] = false
  28738. pool.emit('drain', origin, [pool, ...targets])
  28739. }
  28740. if (pool[kClosedResolve] && queue.isEmpty()) {
  28741. Promise
  28742. .all(pool[kClients].map(c => c.close()))
  28743. .then(pool[kClosedResolve])
  28744. }
  28745. }
  28746. this[kOnConnect] = (origin, targets) => {
  28747. pool.emit('connect', origin, [pool, ...targets])
  28748. }
  28749. this[kOnDisconnect] = (origin, targets, err) => {
  28750. pool.emit('disconnect', origin, [pool, ...targets], err)
  28751. }
  28752. this[kOnConnectionError] = (origin, targets, err) => {
  28753. pool.emit('connectionError', origin, [pool, ...targets], err)
  28754. }
  28755. this[kStats] = new PoolStats(this)
  28756. }
  28757. get [kBusy] () {
  28758. return this[kNeedDrain]
  28759. }
  28760. get [kConnected] () {
  28761. return this[kClients].filter(client => client[kConnected]).length
  28762. }
  28763. get [kFree] () {
  28764. return this[kClients].filter(client => client[kConnected] && !client[kNeedDrain]).length
  28765. }
  28766. get [kPending] () {
  28767. let ret = this[kQueued]
  28768. for (const { [kPending]: pending } of this[kClients]) {
  28769. ret += pending
  28770. }
  28771. return ret
  28772. }
  28773. get [kRunning] () {
  28774. let ret = 0
  28775. for (const { [kRunning]: running } of this[kClients]) {
  28776. ret += running
  28777. }
  28778. return ret
  28779. }
  28780. get [kSize] () {
  28781. let ret = this[kQueued]
  28782. for (const { [kSize]: size } of this[kClients]) {
  28783. ret += size
  28784. }
  28785. return ret
  28786. }
  28787. get stats () {
  28788. return this[kStats]
  28789. }
  28790. async [kClose] () {
  28791. if (this[kQueue].isEmpty()) {
  28792. return Promise.all(this[kClients].map(c => c.close()))
  28793. } else {
  28794. return new Promise((resolve) => {
  28795. this[kClosedResolve] = resolve
  28796. })
  28797. }
  28798. }
  28799. async [kDestroy] (err) {
  28800. while (true) {
  28801. const item = this[kQueue].shift()
  28802. if (!item) {
  28803. break
  28804. }
  28805. item.handler.onError(err)
  28806. }
  28807. return Promise.all(this[kClients].map(c => c.destroy(err)))
  28808. }
  28809. [kDispatch] (opts, handler) {
  28810. const dispatcher = this[kGetDispatcher]()
  28811. if (!dispatcher) {
  28812. this[kNeedDrain] = true
  28813. this[kQueue].push({ opts, handler })
  28814. this[kQueued]++
  28815. } else if (!dispatcher.dispatch(opts, handler)) {
  28816. dispatcher[kNeedDrain] = true
  28817. this[kNeedDrain] = !this[kGetDispatcher]()
  28818. }
  28819. return !this[kNeedDrain]
  28820. }
  28821. [kAddClient] (client) {
  28822. client
  28823. .on('drain', this[kOnDrain])
  28824. .on('connect', this[kOnConnect])
  28825. .on('disconnect', this[kOnDisconnect])
  28826. .on('connectionError', this[kOnConnectionError])
  28827. this[kClients].push(client)
  28828. if (this[kNeedDrain]) {
  28829. process.nextTick(() => {
  28830. if (this[kNeedDrain]) {
  28831. this[kOnDrain](client[kUrl], [this, client])
  28832. }
  28833. })
  28834. }
  28835. return this
  28836. }
  28837. [kRemoveClient] (client) {
  28838. client.close(() => {
  28839. const idx = this[kClients].indexOf(client)
  28840. if (idx !== -1) {
  28841. this[kClients].splice(idx, 1)
  28842. }
  28843. })
  28844. this[kNeedDrain] = this[kClients].some(dispatcher => (
  28845. !dispatcher[kNeedDrain] &&
  28846. dispatcher.closed !== true &&
  28847. dispatcher.destroyed !== true
  28848. ))
  28849. }
  28850. }
  28851. module.exports = {
  28852. PoolBase,
  28853. kClients,
  28854. kNeedDrain,
  28855. kAddClient,
  28856. kRemoveClient,
  28857. kGetDispatcher
  28858. }
  28859. /***/ }),
  28860. /***/ 9689:
  28861. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  28862. const { kFree, kConnected, kPending, kQueued, kRunning, kSize } = __nccwpck_require__(2785)
  28863. const kPool = Symbol('pool')
  28864. class PoolStats {
  28865. constructor (pool) {
  28866. this[kPool] = pool
  28867. }
  28868. get connected () {
  28869. return this[kPool][kConnected]
  28870. }
  28871. get free () {
  28872. return this[kPool][kFree]
  28873. }
  28874. get pending () {
  28875. return this[kPool][kPending]
  28876. }
  28877. get queued () {
  28878. return this[kPool][kQueued]
  28879. }
  28880. get running () {
  28881. return this[kPool][kRunning]
  28882. }
  28883. get size () {
  28884. return this[kPool][kSize]
  28885. }
  28886. }
  28887. module.exports = PoolStats
  28888. /***/ }),
  28889. /***/ 4634:
  28890. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  28891. "use strict";
  28892. const {
  28893. PoolBase,
  28894. kClients,
  28895. kNeedDrain,
  28896. kAddClient,
  28897. kGetDispatcher
  28898. } = __nccwpck_require__(3198)
  28899. const Client = __nccwpck_require__(3598)
  28900. const {
  28901. InvalidArgumentError
  28902. } = __nccwpck_require__(8045)
  28903. const util = __nccwpck_require__(3983)
  28904. const { kUrl, kInterceptors } = __nccwpck_require__(2785)
  28905. const buildConnector = __nccwpck_require__(2067)
  28906. const kOptions = Symbol('options')
  28907. const kConnections = Symbol('connections')
  28908. const kFactory = Symbol('factory')
  28909. function defaultFactory (origin, opts) {
  28910. return new Client(origin, opts)
  28911. }
  28912. class Pool extends PoolBase {
  28913. constructor (origin, {
  28914. connections,
  28915. factory = defaultFactory,
  28916. connect,
  28917. connectTimeout,
  28918. tls,
  28919. maxCachedSessions,
  28920. socketPath,
  28921. autoSelectFamily,
  28922. autoSelectFamilyAttemptTimeout,
  28923. allowH2,
  28924. ...options
  28925. } = {}) {
  28926. super()
  28927. if (connections != null && (!Number.isFinite(connections) || connections < 0)) {
  28928. throw new InvalidArgumentError('invalid connections')
  28929. }
  28930. if (typeof factory !== 'function') {
  28931. throw new InvalidArgumentError('factory must be a function.')
  28932. }
  28933. if (connect != null && typeof connect !== 'function' && typeof connect !== 'object') {
  28934. throw new InvalidArgumentError('connect must be a function or an object')
  28935. }
  28936. if (typeof connect !== 'function') {
  28937. connect = buildConnector({
  28938. ...tls,
  28939. maxCachedSessions,
  28940. allowH2,
  28941. socketPath,
  28942. timeout: connectTimeout,
  28943. ...(util.nodeHasAutoSelectFamily && autoSelectFamily ? { autoSelectFamily, autoSelectFamilyAttemptTimeout } : undefined),
  28944. ...connect
  28945. })
  28946. }
  28947. this[kInterceptors] = options.interceptors && options.interceptors.Pool && Array.isArray(options.interceptors.Pool)
  28948. ? options.interceptors.Pool
  28949. : []
  28950. this[kConnections] = connections || null
  28951. this[kUrl] = util.parseOrigin(origin)
  28952. this[kOptions] = { ...util.deepClone(options), connect, allowH2 }
  28953. this[kOptions].interceptors = options.interceptors
  28954. ? { ...options.interceptors }
  28955. : undefined
  28956. this[kFactory] = factory
  28957. }
  28958. [kGetDispatcher] () {
  28959. let dispatcher = this[kClients].find(dispatcher => !dispatcher[kNeedDrain])
  28960. if (dispatcher) {
  28961. return dispatcher
  28962. }
  28963. if (!this[kConnections] || this[kClients].length < this[kConnections]) {
  28964. dispatcher = this[kFactory](this[kUrl], this[kOptions])
  28965. this[kAddClient](dispatcher)
  28966. }
  28967. return dispatcher
  28968. }
  28969. }
  28970. module.exports = Pool
  28971. /***/ }),
  28972. /***/ 7858:
  28973. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  28974. "use strict";
  28975. const { kProxy, kClose, kDestroy, kInterceptors } = __nccwpck_require__(2785)
  28976. const { URL } = __nccwpck_require__(7310)
  28977. const Agent = __nccwpck_require__(7890)
  28978. const Pool = __nccwpck_require__(4634)
  28979. const DispatcherBase = __nccwpck_require__(4839)
  28980. const { InvalidArgumentError, RequestAbortedError } = __nccwpck_require__(8045)
  28981. const buildConnector = __nccwpck_require__(2067)
  28982. const kAgent = Symbol('proxy agent')
  28983. const kClient = Symbol('proxy client')
  28984. const kProxyHeaders = Symbol('proxy headers')
  28985. const kRequestTls = Symbol('request tls settings')
  28986. const kProxyTls = Symbol('proxy tls settings')
  28987. const kConnectEndpoint = Symbol('connect endpoint function')
  28988. function defaultProtocolPort (protocol) {
  28989. return protocol === 'https:' ? 443 : 80
  28990. }
  28991. function buildProxyOptions (opts) {
  28992. if (typeof opts === 'string') {
  28993. opts = { uri: opts }
  28994. }
  28995. if (!opts || !opts.uri) {
  28996. throw new InvalidArgumentError('Proxy opts.uri is mandatory')
  28997. }
  28998. return {
  28999. uri: opts.uri,
  29000. protocol: opts.protocol || 'https'
  29001. }
  29002. }
  29003. function defaultFactory (origin, opts) {
  29004. return new Pool(origin, opts)
  29005. }
  29006. class ProxyAgent extends DispatcherBase {
  29007. constructor (opts) {
  29008. super(opts)
  29009. this[kProxy] = buildProxyOptions(opts)
  29010. this[kAgent] = new Agent(opts)
  29011. this[kInterceptors] = opts.interceptors && opts.interceptors.ProxyAgent && Array.isArray(opts.interceptors.ProxyAgent)
  29012. ? opts.interceptors.ProxyAgent
  29013. : []
  29014. if (typeof opts === 'string') {
  29015. opts = { uri: opts }
  29016. }
  29017. if (!opts || !opts.uri) {
  29018. throw new InvalidArgumentError('Proxy opts.uri is mandatory')
  29019. }
  29020. const { clientFactory = defaultFactory } = opts
  29021. if (typeof clientFactory !== 'function') {
  29022. throw new InvalidArgumentError('Proxy opts.clientFactory must be a function.')
  29023. }
  29024. this[kRequestTls] = opts.requestTls
  29025. this[kProxyTls] = opts.proxyTls
  29026. this[kProxyHeaders] = opts.headers || {}
  29027. const resolvedUrl = new URL(opts.uri)
  29028. const { origin, port, host, username, password } = resolvedUrl
  29029. if (opts.auth && opts.token) {
  29030. throw new InvalidArgumentError('opts.auth cannot be used in combination with opts.token')
  29031. } else if (opts.auth) {
  29032. /* @deprecated in favour of opts.token */
  29033. this[kProxyHeaders]['proxy-authorization'] = `Basic ${opts.auth}`
  29034. } else if (opts.token) {
  29035. this[kProxyHeaders]['proxy-authorization'] = opts.token
  29036. } else if (username && password) {
  29037. this[kProxyHeaders]['proxy-authorization'] = `Basic ${Buffer.from(`${decodeURIComponent(username)}:${decodeURIComponent(password)}`).toString('base64')}`
  29038. }
  29039. const connect = buildConnector({ ...opts.proxyTls })
  29040. this[kConnectEndpoint] = buildConnector({ ...opts.requestTls })
  29041. this[kClient] = clientFactory(resolvedUrl, { connect })
  29042. this[kAgent] = new Agent({
  29043. ...opts,
  29044. connect: async (opts, callback) => {
  29045. let requestedHost = opts.host
  29046. if (!opts.port) {
  29047. requestedHost += `:${defaultProtocolPort(opts.protocol)}`
  29048. }
  29049. try {
  29050. const { socket, statusCode } = await this[kClient].connect({
  29051. origin,
  29052. port,
  29053. path: requestedHost,
  29054. signal: opts.signal,
  29055. headers: {
  29056. ...this[kProxyHeaders],
  29057. host
  29058. }
  29059. })
  29060. if (statusCode !== 200) {
  29061. socket.on('error', () => {}).destroy()
  29062. callback(new RequestAbortedError(`Proxy response (${statusCode}) !== 200 when HTTP Tunneling`))
  29063. }
  29064. if (opts.protocol !== 'https:') {
  29065. callback(null, socket)
  29066. return
  29067. }
  29068. let servername
  29069. if (this[kRequestTls]) {
  29070. servername = this[kRequestTls].servername
  29071. } else {
  29072. servername = opts.servername
  29073. }
  29074. this[kConnectEndpoint]({ ...opts, servername, httpSocket: socket }, callback)
  29075. } catch (err) {
  29076. callback(err)
  29077. }
  29078. }
  29079. })
  29080. }
  29081. dispatch (opts, handler) {
  29082. const { host } = new URL(opts.origin)
  29083. const headers = buildHeaders(opts.headers)
  29084. throwIfProxyAuthIsSent(headers)
  29085. return this[kAgent].dispatch(
  29086. {
  29087. ...opts,
  29088. headers: {
  29089. ...headers,
  29090. host
  29091. }
  29092. },
  29093. handler
  29094. )
  29095. }
  29096. async [kClose] () {
  29097. await this[kAgent].close()
  29098. await this[kClient].close()
  29099. }
  29100. async [kDestroy] () {
  29101. await this[kAgent].destroy()
  29102. await this[kClient].destroy()
  29103. }
  29104. }
  29105. /**
  29106. * @param {string[] | Record<string, string>} headers
  29107. * @returns {Record<string, string>}
  29108. */
  29109. function buildHeaders (headers) {
  29110. // When using undici.fetch, the headers list is stored
  29111. // as an array.
  29112. if (Array.isArray(headers)) {
  29113. /** @type {Record<string, string>} */
  29114. const headersPair = {}
  29115. for (let i = 0; i < headers.length; i += 2) {
  29116. headersPair[headers[i]] = headers[i + 1]
  29117. }
  29118. return headersPair
  29119. }
  29120. return headers
  29121. }
  29122. /**
  29123. * @param {Record<string, string>} headers
  29124. *
  29125. * Previous versions of ProxyAgent suggests the Proxy-Authorization in request headers
  29126. * Nevertheless, it was changed and to avoid a security vulnerability by end users
  29127. * this check was created.
  29128. * It should be removed in the next major version for performance reasons
  29129. */
  29130. function throwIfProxyAuthIsSent (headers) {
  29131. const existProxyAuth = headers && Object.keys(headers)
  29132. .find((key) => key.toLowerCase() === 'proxy-authorization')
  29133. if (existProxyAuth) {
  29134. throw new InvalidArgumentError('Proxy-Authorization should be sent in ProxyAgent constructor')
  29135. }
  29136. }
  29137. module.exports = ProxyAgent
  29138. /***/ }),
  29139. /***/ 9459:
  29140. /***/ ((module) => {
  29141. "use strict";
  29142. let fastNow = Date.now()
  29143. let fastNowTimeout
  29144. const fastTimers = []
  29145. function onTimeout () {
  29146. fastNow = Date.now()
  29147. let len = fastTimers.length
  29148. let idx = 0
  29149. while (idx < len) {
  29150. const timer = fastTimers[idx]
  29151. if (timer.state === 0) {
  29152. timer.state = fastNow + timer.delay
  29153. } else if (timer.state > 0 && fastNow >= timer.state) {
  29154. timer.state = -1
  29155. timer.callback(timer.opaque)
  29156. }
  29157. if (timer.state === -1) {
  29158. timer.state = -2
  29159. if (idx !== len - 1) {
  29160. fastTimers[idx] = fastTimers.pop()
  29161. } else {
  29162. fastTimers.pop()
  29163. }
  29164. len -= 1
  29165. } else {
  29166. idx += 1
  29167. }
  29168. }
  29169. if (fastTimers.length > 0) {
  29170. refreshTimeout()
  29171. }
  29172. }
  29173. function refreshTimeout () {
  29174. if (fastNowTimeout && fastNowTimeout.refresh) {
  29175. fastNowTimeout.refresh()
  29176. } else {
  29177. clearTimeout(fastNowTimeout)
  29178. fastNowTimeout = setTimeout(onTimeout, 1e3)
  29179. if (fastNowTimeout.unref) {
  29180. fastNowTimeout.unref()
  29181. }
  29182. }
  29183. }
  29184. class Timeout {
  29185. constructor (callback, delay, opaque) {
  29186. this.callback = callback
  29187. this.delay = delay
  29188. this.opaque = opaque
  29189. // -2 not in timer list
  29190. // -1 in timer list but inactive
  29191. // 0 in timer list waiting for time
  29192. // > 0 in timer list waiting for time to expire
  29193. this.state = -2
  29194. this.refresh()
  29195. }
  29196. refresh () {
  29197. if (this.state === -2) {
  29198. fastTimers.push(this)
  29199. if (!fastNowTimeout || fastTimers.length === 1) {
  29200. refreshTimeout()
  29201. }
  29202. }
  29203. this.state = 0
  29204. }
  29205. clear () {
  29206. this.state = -1
  29207. }
  29208. }
  29209. module.exports = {
  29210. setTimeout (callback, delay, opaque) {
  29211. return delay < 1e3
  29212. ? setTimeout(callback, delay, opaque)
  29213. : new Timeout(callback, delay, opaque)
  29214. },
  29215. clearTimeout (timeout) {
  29216. if (timeout instanceof Timeout) {
  29217. timeout.clear()
  29218. } else {
  29219. clearTimeout(timeout)
  29220. }
  29221. }
  29222. }
  29223. /***/ }),
  29224. /***/ 5354:
  29225. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  29226. "use strict";
  29227. const diagnosticsChannel = __nccwpck_require__(7643)
  29228. const { uid, states } = __nccwpck_require__(9188)
  29229. const {
  29230. kReadyState,
  29231. kSentClose,
  29232. kByteParser,
  29233. kReceivedClose
  29234. } = __nccwpck_require__(7578)
  29235. const { fireEvent, failWebsocketConnection } = __nccwpck_require__(5515)
  29236. const { CloseEvent } = __nccwpck_require__(2611)
  29237. const { makeRequest } = __nccwpck_require__(8359)
  29238. const { fetching } = __nccwpck_require__(4881)
  29239. const { Headers } = __nccwpck_require__(554)
  29240. const { getGlobalDispatcher } = __nccwpck_require__(1892)
  29241. const { kHeadersList } = __nccwpck_require__(2785)
  29242. const channels = {}
  29243. channels.open = diagnosticsChannel.channel('undici:websocket:open')
  29244. channels.close = diagnosticsChannel.channel('undici:websocket:close')
  29245. channels.socketError = diagnosticsChannel.channel('undici:websocket:socket_error')
  29246. /** @type {import('crypto')} */
  29247. let crypto
  29248. try {
  29249. crypto = __nccwpck_require__(6113)
  29250. } catch {
  29251. }
  29252. /**
  29253. * @see https://websockets.spec.whatwg.org/#concept-websocket-establish
  29254. * @param {URL} url
  29255. * @param {string|string[]} protocols
  29256. * @param {import('./websocket').WebSocket} ws
  29257. * @param {(response: any) => void} onEstablish
  29258. * @param {Partial<import('../../types/websocket').WebSocketInit>} options
  29259. */
  29260. function establishWebSocketConnection (url, protocols, ws, onEstablish, options) {
  29261. // 1. Let requestURL be a copy of url, with its scheme set to "http", if url’s
  29262. // scheme is "ws", and to "https" otherwise.
  29263. const requestURL = url
  29264. requestURL.protocol = url.protocol === 'ws:' ? 'http:' : 'https:'
  29265. // 2. Let request be a new request, whose URL is requestURL, client is client,
  29266. // service-workers mode is "none", referrer is "no-referrer", mode is
  29267. // "websocket", credentials mode is "include", cache mode is "no-store" ,
  29268. // and redirect mode is "error".
  29269. const request = makeRequest({
  29270. urlList: [requestURL],
  29271. serviceWorkers: 'none',
  29272. referrer: 'no-referrer',
  29273. mode: 'websocket',
  29274. credentials: 'include',
  29275. cache: 'no-store',
  29276. redirect: 'error'
  29277. })
  29278. // Note: undici extension, allow setting custom headers.
  29279. if (options.headers) {
  29280. const headersList = new Headers(options.headers)[kHeadersList]
  29281. request.headersList = headersList
  29282. }
  29283. // 3. Append (`Upgrade`, `websocket`) to request’s header list.
  29284. // 4. Append (`Connection`, `Upgrade`) to request’s header list.
  29285. // Note: both of these are handled by undici currently.
  29286. // https://github.com/nodejs/undici/blob/68c269c4144c446f3f1220951338daef4a6b5ec4/lib/client.js#L1397
  29287. // 5. Let keyValue be a nonce consisting of a randomly selected
  29288. // 16-byte value that has been forgiving-base64-encoded and
  29289. // isomorphic encoded.
  29290. const keyValue = crypto.randomBytes(16).toString('base64')
  29291. // 6. Append (`Sec-WebSocket-Key`, keyValue) to request’s
  29292. // header list.
  29293. request.headersList.append('sec-websocket-key', keyValue)
  29294. // 7. Append (`Sec-WebSocket-Version`, `13`) to request’s
  29295. // header list.
  29296. request.headersList.append('sec-websocket-version', '13')
  29297. // 8. For each protocol in protocols, combine
  29298. // (`Sec-WebSocket-Protocol`, protocol) in request’s header
  29299. // list.
  29300. for (const protocol of protocols) {
  29301. request.headersList.append('sec-websocket-protocol', protocol)
  29302. }
  29303. // 9. Let permessageDeflate be a user-agent defined
  29304. // "permessage-deflate" extension header value.
  29305. // https://github.com/mozilla/gecko-dev/blob/ce78234f5e653a5d3916813ff990f053510227bc/netwerk/protocol/websocket/WebSocketChannel.cpp#L2673
  29306. // TODO: enable once permessage-deflate is supported
  29307. const permessageDeflate = '' // 'permessage-deflate; 15'
  29308. // 10. Append (`Sec-WebSocket-Extensions`, permessageDeflate) to
  29309. // request’s header list.
  29310. // request.headersList.append('sec-websocket-extensions', permessageDeflate)
  29311. // 11. Fetch request with useParallelQueue set to true, and
  29312. // processResponse given response being these steps:
  29313. const controller = fetching({
  29314. request,
  29315. useParallelQueue: true,
  29316. dispatcher: options.dispatcher ?? getGlobalDispatcher(),
  29317. processResponse (response) {
  29318. // 1. If response is a network error or its status is not 101,
  29319. // fail the WebSocket connection.
  29320. if (response.type === 'error' || response.status !== 101) {
  29321. failWebsocketConnection(ws, 'Received network error or non-101 status code.')
  29322. return
  29323. }
  29324. // 2. If protocols is not the empty list and extracting header
  29325. // list values given `Sec-WebSocket-Protocol` and response’s
  29326. // header list results in null, failure, or the empty byte
  29327. // sequence, then fail the WebSocket connection.
  29328. if (protocols.length !== 0 && !response.headersList.get('Sec-WebSocket-Protocol')) {
  29329. failWebsocketConnection(ws, 'Server did not respond with sent protocols.')
  29330. return
  29331. }
  29332. // 3. Follow the requirements stated step 2 to step 6, inclusive,
  29333. // of the last set of steps in section 4.1 of The WebSocket
  29334. // Protocol to validate response. This either results in fail
  29335. // the WebSocket connection or the WebSocket connection is
  29336. // established.
  29337. // 2. If the response lacks an |Upgrade| header field or the |Upgrade|
  29338. // header field contains a value that is not an ASCII case-
  29339. // insensitive match for the value "websocket", the client MUST
  29340. // _Fail the WebSocket Connection_.
  29341. if (response.headersList.get('Upgrade')?.toLowerCase() !== 'websocket') {
  29342. failWebsocketConnection(ws, 'Server did not set Upgrade header to "websocket".')
  29343. return
  29344. }
  29345. // 3. If the response lacks a |Connection| header field or the
  29346. // |Connection| header field doesn't contain a token that is an
  29347. // ASCII case-insensitive match for the value "Upgrade", the client
  29348. // MUST _Fail the WebSocket Connection_.
  29349. if (response.headersList.get('Connection')?.toLowerCase() !== 'upgrade') {
  29350. failWebsocketConnection(ws, 'Server did not set Connection header to "upgrade".')
  29351. return
  29352. }
  29353. // 4. If the response lacks a |Sec-WebSocket-Accept| header field or
  29354. // the |Sec-WebSocket-Accept| contains a value other than the
  29355. // base64-encoded SHA-1 of the concatenation of the |Sec-WebSocket-
  29356. // Key| (as a string, not base64-decoded) with the string "258EAFA5-
  29357. // E914-47DA-95CA-C5AB0DC85B11" but ignoring any leading and
  29358. // trailing whitespace, the client MUST _Fail the WebSocket
  29359. // Connection_.
  29360. const secWSAccept = response.headersList.get('Sec-WebSocket-Accept')
  29361. const digest = crypto.createHash('sha1').update(keyValue + uid).digest('base64')
  29362. if (secWSAccept !== digest) {
  29363. failWebsocketConnection(ws, 'Incorrect hash received in Sec-WebSocket-Accept header.')
  29364. return
  29365. }
  29366. // 5. If the response includes a |Sec-WebSocket-Extensions| header
  29367. // field and this header field indicates the use of an extension
  29368. // that was not present in the client's handshake (the server has
  29369. // indicated an extension not requested by the client), the client
  29370. // MUST _Fail the WebSocket Connection_. (The parsing of this
  29371. // header field to determine which extensions are requested is
  29372. // discussed in Section 9.1.)
  29373. const secExtension = response.headersList.get('Sec-WebSocket-Extensions')
  29374. if (secExtension !== null && secExtension !== permessageDeflate) {
  29375. failWebsocketConnection(ws, 'Received different permessage-deflate than the one set.')
  29376. return
  29377. }
  29378. // 6. If the response includes a |Sec-WebSocket-Protocol| header field
  29379. // and this header field indicates the use of a subprotocol that was
  29380. // not present in the client's handshake (the server has indicated a
  29381. // subprotocol not requested by the client), the client MUST _Fail
  29382. // the WebSocket Connection_.
  29383. const secProtocol = response.headersList.get('Sec-WebSocket-Protocol')
  29384. if (secProtocol !== null && secProtocol !== request.headersList.get('Sec-WebSocket-Protocol')) {
  29385. failWebsocketConnection(ws, 'Protocol was not set in the opening handshake.')
  29386. return
  29387. }
  29388. response.socket.on('data', onSocketData)
  29389. response.socket.on('close', onSocketClose)
  29390. response.socket.on('error', onSocketError)
  29391. if (channels.open.hasSubscribers) {
  29392. channels.open.publish({
  29393. address: response.socket.address(),
  29394. protocol: secProtocol,
  29395. extensions: secExtension
  29396. })
  29397. }
  29398. onEstablish(response)
  29399. }
  29400. })
  29401. return controller
  29402. }
  29403. /**
  29404. * @param {Buffer} chunk
  29405. */
  29406. function onSocketData (chunk) {
  29407. if (!this.ws[kByteParser].write(chunk)) {
  29408. this.pause()
  29409. }
  29410. }
  29411. /**
  29412. * @see https://websockets.spec.whatwg.org/#feedback-from-the-protocol
  29413. * @see https://datatracker.ietf.org/doc/html/rfc6455#section-7.1.4
  29414. */
  29415. function onSocketClose () {
  29416. const { ws } = this
  29417. // If the TCP connection was closed after the
  29418. // WebSocket closing handshake was completed, the WebSocket connection
  29419. // is said to have been closed _cleanly_.
  29420. const wasClean = ws[kSentClose] && ws[kReceivedClose]
  29421. let code = 1005
  29422. let reason = ''
  29423. const result = ws[kByteParser].closingInfo
  29424. if (result) {
  29425. code = result.code ?? 1005
  29426. reason = result.reason
  29427. } else if (!ws[kSentClose]) {
  29428. // If _The WebSocket
  29429. // Connection is Closed_ and no Close control frame was received by the
  29430. // endpoint (such as could occur if the underlying transport connection
  29431. // is lost), _The WebSocket Connection Close Code_ is considered to be
  29432. // 1006.
  29433. code = 1006
  29434. }
  29435. // 1. Change the ready state to CLOSED (3).
  29436. ws[kReadyState] = states.CLOSED
  29437. // 2. If the user agent was required to fail the WebSocket
  29438. // connection, or if the WebSocket connection was closed
  29439. // after being flagged as full, fire an event named error
  29440. // at the WebSocket object.
  29441. // TODO
  29442. // 3. Fire an event named close at the WebSocket object,
  29443. // using CloseEvent, with the wasClean attribute
  29444. // initialized to true if the connection closed cleanly
  29445. // and false otherwise, the code attribute initialized to
  29446. // the WebSocket connection close code, and the reason
  29447. // attribute initialized to the result of applying UTF-8
  29448. // decode without BOM to the WebSocket connection close
  29449. // reason.
  29450. fireEvent('close', ws, CloseEvent, {
  29451. wasClean, code, reason
  29452. })
  29453. if (channels.close.hasSubscribers) {
  29454. channels.close.publish({
  29455. websocket: ws,
  29456. code,
  29457. reason
  29458. })
  29459. }
  29460. }
  29461. function onSocketError (error) {
  29462. const { ws } = this
  29463. ws[kReadyState] = states.CLOSING
  29464. if (channels.socketError.hasSubscribers) {
  29465. channels.socketError.publish(error)
  29466. }
  29467. this.destroy()
  29468. }
  29469. module.exports = {
  29470. establishWebSocketConnection
  29471. }
  29472. /***/ }),
  29473. /***/ 9188:
  29474. /***/ ((module) => {
  29475. "use strict";
  29476. // This is a Globally Unique Identifier unique used
  29477. // to validate that the endpoint accepts websocket
  29478. // connections.
  29479. // See https://www.rfc-editor.org/rfc/rfc6455.html#section-1.3
  29480. const uid = '258EAFA5-E914-47DA-95CA-C5AB0DC85B11'
  29481. /** @type {PropertyDescriptor} */
  29482. const staticPropertyDescriptors = {
  29483. enumerable: true,
  29484. writable: false,
  29485. configurable: false
  29486. }
  29487. const states = {
  29488. CONNECTING: 0,
  29489. OPEN: 1,
  29490. CLOSING: 2,
  29491. CLOSED: 3
  29492. }
  29493. const opcodes = {
  29494. CONTINUATION: 0x0,
  29495. TEXT: 0x1,
  29496. BINARY: 0x2,
  29497. CLOSE: 0x8,
  29498. PING: 0x9,
  29499. PONG: 0xA
  29500. }
  29501. const maxUnsigned16Bit = 2 ** 16 - 1 // 65535
  29502. const parserStates = {
  29503. INFO: 0,
  29504. PAYLOADLENGTH_16: 2,
  29505. PAYLOADLENGTH_64: 3,
  29506. READ_DATA: 4
  29507. }
  29508. const emptyBuffer = Buffer.allocUnsafe(0)
  29509. module.exports = {
  29510. uid,
  29511. staticPropertyDescriptors,
  29512. states,
  29513. opcodes,
  29514. maxUnsigned16Bit,
  29515. parserStates,
  29516. emptyBuffer
  29517. }
  29518. /***/ }),
  29519. /***/ 2611:
  29520. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  29521. "use strict";
  29522. const { webidl } = __nccwpck_require__(1744)
  29523. const { kEnumerableProperty } = __nccwpck_require__(3983)
  29524. const { MessagePort } = __nccwpck_require__(1267)
  29525. /**
  29526. * @see https://html.spec.whatwg.org/multipage/comms.html#messageevent
  29527. */
  29528. class MessageEvent extends Event {
  29529. #eventInit
  29530. constructor (type, eventInitDict = {}) {
  29531. webidl.argumentLengthCheck(arguments, 1, { header: 'MessageEvent constructor' })
  29532. type = webidl.converters.DOMString(type)
  29533. eventInitDict = webidl.converters.MessageEventInit(eventInitDict)
  29534. super(type, eventInitDict)
  29535. this.#eventInit = eventInitDict
  29536. }
  29537. get data () {
  29538. webidl.brandCheck(this, MessageEvent)
  29539. return this.#eventInit.data
  29540. }
  29541. get origin () {
  29542. webidl.brandCheck(this, MessageEvent)
  29543. return this.#eventInit.origin
  29544. }
  29545. get lastEventId () {
  29546. webidl.brandCheck(this, MessageEvent)
  29547. return this.#eventInit.lastEventId
  29548. }
  29549. get source () {
  29550. webidl.brandCheck(this, MessageEvent)
  29551. return this.#eventInit.source
  29552. }
  29553. get ports () {
  29554. webidl.brandCheck(this, MessageEvent)
  29555. if (!Object.isFrozen(this.#eventInit.ports)) {
  29556. Object.freeze(this.#eventInit.ports)
  29557. }
  29558. return this.#eventInit.ports
  29559. }
  29560. initMessageEvent (
  29561. type,
  29562. bubbles = false,
  29563. cancelable = false,
  29564. data = null,
  29565. origin = '',
  29566. lastEventId = '',
  29567. source = null,
  29568. ports = []
  29569. ) {
  29570. webidl.brandCheck(this, MessageEvent)
  29571. webidl.argumentLengthCheck(arguments, 1, { header: 'MessageEvent.initMessageEvent' })
  29572. return new MessageEvent(type, {
  29573. bubbles, cancelable, data, origin, lastEventId, source, ports
  29574. })
  29575. }
  29576. }
  29577. /**
  29578. * @see https://websockets.spec.whatwg.org/#the-closeevent-interface
  29579. */
  29580. class CloseEvent extends Event {
  29581. #eventInit
  29582. constructor (type, eventInitDict = {}) {
  29583. webidl.argumentLengthCheck(arguments, 1, { header: 'CloseEvent constructor' })
  29584. type = webidl.converters.DOMString(type)
  29585. eventInitDict = webidl.converters.CloseEventInit(eventInitDict)
  29586. super(type, eventInitDict)
  29587. this.#eventInit = eventInitDict
  29588. }
  29589. get wasClean () {
  29590. webidl.brandCheck(this, CloseEvent)
  29591. return this.#eventInit.wasClean
  29592. }
  29593. get code () {
  29594. webidl.brandCheck(this, CloseEvent)
  29595. return this.#eventInit.code
  29596. }
  29597. get reason () {
  29598. webidl.brandCheck(this, CloseEvent)
  29599. return this.#eventInit.reason
  29600. }
  29601. }
  29602. // https://html.spec.whatwg.org/multipage/webappapis.html#the-errorevent-interface
  29603. class ErrorEvent extends Event {
  29604. #eventInit
  29605. constructor (type, eventInitDict) {
  29606. webidl.argumentLengthCheck(arguments, 1, { header: 'ErrorEvent constructor' })
  29607. super(type, eventInitDict)
  29608. type = webidl.converters.DOMString(type)
  29609. eventInitDict = webidl.converters.ErrorEventInit(eventInitDict ?? {})
  29610. this.#eventInit = eventInitDict
  29611. }
  29612. get message () {
  29613. webidl.brandCheck(this, ErrorEvent)
  29614. return this.#eventInit.message
  29615. }
  29616. get filename () {
  29617. webidl.brandCheck(this, ErrorEvent)
  29618. return this.#eventInit.filename
  29619. }
  29620. get lineno () {
  29621. webidl.brandCheck(this, ErrorEvent)
  29622. return this.#eventInit.lineno
  29623. }
  29624. get colno () {
  29625. webidl.brandCheck(this, ErrorEvent)
  29626. return this.#eventInit.colno
  29627. }
  29628. get error () {
  29629. webidl.brandCheck(this, ErrorEvent)
  29630. return this.#eventInit.error
  29631. }
  29632. }
  29633. Object.defineProperties(MessageEvent.prototype, {
  29634. [Symbol.toStringTag]: {
  29635. value: 'MessageEvent',
  29636. configurable: true
  29637. },
  29638. data: kEnumerableProperty,
  29639. origin: kEnumerableProperty,
  29640. lastEventId: kEnumerableProperty,
  29641. source: kEnumerableProperty,
  29642. ports: kEnumerableProperty,
  29643. initMessageEvent: kEnumerableProperty
  29644. })
  29645. Object.defineProperties(CloseEvent.prototype, {
  29646. [Symbol.toStringTag]: {
  29647. value: 'CloseEvent',
  29648. configurable: true
  29649. },
  29650. reason: kEnumerableProperty,
  29651. code: kEnumerableProperty,
  29652. wasClean: kEnumerableProperty
  29653. })
  29654. Object.defineProperties(ErrorEvent.prototype, {
  29655. [Symbol.toStringTag]: {
  29656. value: 'ErrorEvent',
  29657. configurable: true
  29658. },
  29659. message: kEnumerableProperty,
  29660. filename: kEnumerableProperty,
  29661. lineno: kEnumerableProperty,
  29662. colno: kEnumerableProperty,
  29663. error: kEnumerableProperty
  29664. })
  29665. webidl.converters.MessagePort = webidl.interfaceConverter(MessagePort)
  29666. webidl.converters['sequence<MessagePort>'] = webidl.sequenceConverter(
  29667. webidl.converters.MessagePort
  29668. )
  29669. const eventInit = [
  29670. {
  29671. key: 'bubbles',
  29672. converter: webidl.converters.boolean,
  29673. defaultValue: false
  29674. },
  29675. {
  29676. key: 'cancelable',
  29677. converter: webidl.converters.boolean,
  29678. defaultValue: false
  29679. },
  29680. {
  29681. key: 'composed',
  29682. converter: webidl.converters.boolean,
  29683. defaultValue: false
  29684. }
  29685. ]
  29686. webidl.converters.MessageEventInit = webidl.dictionaryConverter([
  29687. ...eventInit,
  29688. {
  29689. key: 'data',
  29690. converter: webidl.converters.any,
  29691. defaultValue: null
  29692. },
  29693. {
  29694. key: 'origin',
  29695. converter: webidl.converters.USVString,
  29696. defaultValue: ''
  29697. },
  29698. {
  29699. key: 'lastEventId',
  29700. converter: webidl.converters.DOMString,
  29701. defaultValue: ''
  29702. },
  29703. {
  29704. key: 'source',
  29705. // Node doesn't implement WindowProxy or ServiceWorker, so the only
  29706. // valid value for source is a MessagePort.
  29707. converter: webidl.nullableConverter(webidl.converters.MessagePort),
  29708. defaultValue: null
  29709. },
  29710. {
  29711. key: 'ports',
  29712. converter: webidl.converters['sequence<MessagePort>'],
  29713. get defaultValue () {
  29714. return []
  29715. }
  29716. }
  29717. ])
  29718. webidl.converters.CloseEventInit = webidl.dictionaryConverter([
  29719. ...eventInit,
  29720. {
  29721. key: 'wasClean',
  29722. converter: webidl.converters.boolean,
  29723. defaultValue: false
  29724. },
  29725. {
  29726. key: 'code',
  29727. converter: webidl.converters['unsigned short'],
  29728. defaultValue: 0
  29729. },
  29730. {
  29731. key: 'reason',
  29732. converter: webidl.converters.USVString,
  29733. defaultValue: ''
  29734. }
  29735. ])
  29736. webidl.converters.ErrorEventInit = webidl.dictionaryConverter([
  29737. ...eventInit,
  29738. {
  29739. key: 'message',
  29740. converter: webidl.converters.DOMString,
  29741. defaultValue: ''
  29742. },
  29743. {
  29744. key: 'filename',
  29745. converter: webidl.converters.USVString,
  29746. defaultValue: ''
  29747. },
  29748. {
  29749. key: 'lineno',
  29750. converter: webidl.converters['unsigned long'],
  29751. defaultValue: 0
  29752. },
  29753. {
  29754. key: 'colno',
  29755. converter: webidl.converters['unsigned long'],
  29756. defaultValue: 0
  29757. },
  29758. {
  29759. key: 'error',
  29760. converter: webidl.converters.any
  29761. }
  29762. ])
  29763. module.exports = {
  29764. MessageEvent,
  29765. CloseEvent,
  29766. ErrorEvent
  29767. }
  29768. /***/ }),
  29769. /***/ 5444:
  29770. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  29771. "use strict";
  29772. const { maxUnsigned16Bit } = __nccwpck_require__(9188)
  29773. /** @type {import('crypto')} */
  29774. let crypto
  29775. try {
  29776. crypto = __nccwpck_require__(6113)
  29777. } catch {
  29778. }
  29779. class WebsocketFrameSend {
  29780. /**
  29781. * @param {Buffer|undefined} data
  29782. */
  29783. constructor (data) {
  29784. this.frameData = data
  29785. this.maskKey = crypto.randomBytes(4)
  29786. }
  29787. createFrame (opcode) {
  29788. const bodyLength = this.frameData?.byteLength ?? 0
  29789. /** @type {number} */
  29790. let payloadLength = bodyLength // 0-125
  29791. let offset = 6
  29792. if (bodyLength > maxUnsigned16Bit) {
  29793. offset += 8 // payload length is next 8 bytes
  29794. payloadLength = 127
  29795. } else if (bodyLength > 125) {
  29796. offset += 2 // payload length is next 2 bytes
  29797. payloadLength = 126
  29798. }
  29799. const buffer = Buffer.allocUnsafe(bodyLength + offset)
  29800. // Clear first 2 bytes, everything else is overwritten
  29801. buffer[0] = buffer[1] = 0
  29802. buffer[0] |= 0x80 // FIN
  29803. buffer[0] = (buffer[0] & 0xF0) + opcode // opcode
  29804. /*! ws. MIT License. Einar Otto Stangvik <einaros@gmail.com> */
  29805. buffer[offset - 4] = this.maskKey[0]
  29806. buffer[offset - 3] = this.maskKey[1]
  29807. buffer[offset - 2] = this.maskKey[2]
  29808. buffer[offset - 1] = this.maskKey[3]
  29809. buffer[1] = payloadLength
  29810. if (payloadLength === 126) {
  29811. buffer.writeUInt16BE(bodyLength, 2)
  29812. } else if (payloadLength === 127) {
  29813. // Clear extended payload length
  29814. buffer[2] = buffer[3] = 0
  29815. buffer.writeUIntBE(bodyLength, 4, 6)
  29816. }
  29817. buffer[1] |= 0x80 // MASK
  29818. // mask body
  29819. for (let i = 0; i < bodyLength; i++) {
  29820. buffer[offset + i] = this.frameData[i] ^ this.maskKey[i % 4]
  29821. }
  29822. return buffer
  29823. }
  29824. }
  29825. module.exports = {
  29826. WebsocketFrameSend
  29827. }
  29828. /***/ }),
  29829. /***/ 1688:
  29830. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  29831. "use strict";
  29832. const { Writable } = __nccwpck_require__(2781)
  29833. const diagnosticsChannel = __nccwpck_require__(7643)
  29834. const { parserStates, opcodes, states, emptyBuffer } = __nccwpck_require__(9188)
  29835. const { kReadyState, kSentClose, kResponse, kReceivedClose } = __nccwpck_require__(7578)
  29836. const { isValidStatusCode, failWebsocketConnection, websocketMessageReceived } = __nccwpck_require__(5515)
  29837. const { WebsocketFrameSend } = __nccwpck_require__(5444)
  29838. // This code was influenced by ws released under the MIT license.
  29839. // Copyright (c) 2011 Einar Otto Stangvik <einaros@gmail.com>
  29840. // Copyright (c) 2013 Arnout Kazemier and contributors
  29841. // Copyright (c) 2016 Luigi Pinca and contributors
  29842. const channels = {}
  29843. channels.ping = diagnosticsChannel.channel('undici:websocket:ping')
  29844. channels.pong = diagnosticsChannel.channel('undici:websocket:pong')
  29845. class ByteParser extends Writable {
  29846. #buffers = []
  29847. #byteOffset = 0
  29848. #state = parserStates.INFO
  29849. #info = {}
  29850. #fragments = []
  29851. constructor (ws) {
  29852. super()
  29853. this.ws = ws
  29854. }
  29855. /**
  29856. * @param {Buffer} chunk
  29857. * @param {() => void} callback
  29858. */
  29859. _write (chunk, _, callback) {
  29860. this.#buffers.push(chunk)
  29861. this.#byteOffset += chunk.length
  29862. this.run(callback)
  29863. }
  29864. /**
  29865. * Runs whenever a new chunk is received.
  29866. * Callback is called whenever there are no more chunks buffering,
  29867. * or not enough bytes are buffered to parse.
  29868. */
  29869. run (callback) {
  29870. while (true) {
  29871. if (this.#state === parserStates.INFO) {
  29872. // If there aren't enough bytes to parse the payload length, etc.
  29873. if (this.#byteOffset < 2) {
  29874. return callback()
  29875. }
  29876. const buffer = this.consume(2)
  29877. this.#info.fin = (buffer[0] & 0x80) !== 0
  29878. this.#info.opcode = buffer[0] & 0x0F
  29879. // If we receive a fragmented message, we use the type of the first
  29880. // frame to parse the full message as binary/text, when it's terminated
  29881. this.#info.originalOpcode ??= this.#info.opcode
  29882. this.#info.fragmented = !this.#info.fin && this.#info.opcode !== opcodes.CONTINUATION
  29883. if (this.#info.fragmented && this.#info.opcode !== opcodes.BINARY && this.#info.opcode !== opcodes.TEXT) {
  29884. // Only text and binary frames can be fragmented
  29885. failWebsocketConnection(this.ws, 'Invalid frame type was fragmented.')
  29886. return
  29887. }
  29888. const payloadLength = buffer[1] & 0x7F
  29889. if (payloadLength <= 125) {
  29890. this.#info.payloadLength = payloadLength
  29891. this.#state = parserStates.READ_DATA
  29892. } else if (payloadLength === 126) {
  29893. this.#state = parserStates.PAYLOADLENGTH_16
  29894. } else if (payloadLength === 127) {
  29895. this.#state = parserStates.PAYLOADLENGTH_64
  29896. }
  29897. if (this.#info.fragmented && payloadLength > 125) {
  29898. // A fragmented frame can't be fragmented itself
  29899. failWebsocketConnection(this.ws, 'Fragmented frame exceeded 125 bytes.')
  29900. return
  29901. } else if (
  29902. (this.#info.opcode === opcodes.PING ||
  29903. this.#info.opcode === opcodes.PONG ||
  29904. this.#info.opcode === opcodes.CLOSE) &&
  29905. payloadLength > 125
  29906. ) {
  29907. // Control frames can have a payload length of 125 bytes MAX
  29908. failWebsocketConnection(this.ws, 'Payload length for control frame exceeded 125 bytes.')
  29909. return
  29910. } else if (this.#info.opcode === opcodes.CLOSE) {
  29911. if (payloadLength === 1) {
  29912. failWebsocketConnection(this.ws, 'Received close frame with a 1-byte body.')
  29913. return
  29914. }
  29915. const body = this.consume(payloadLength)
  29916. this.#info.closeInfo = this.parseCloseBody(false, body)
  29917. if (!this.ws[kSentClose]) {
  29918. // If an endpoint receives a Close frame and did not previously send a
  29919. // Close frame, the endpoint MUST send a Close frame in response. (When
  29920. // sending a Close frame in response, the endpoint typically echos the
  29921. // status code it received.)
  29922. const body = Buffer.allocUnsafe(2)
  29923. body.writeUInt16BE(this.#info.closeInfo.code, 0)
  29924. const closeFrame = new WebsocketFrameSend(body)
  29925. this.ws[kResponse].socket.write(
  29926. closeFrame.createFrame(opcodes.CLOSE),
  29927. (err) => {
  29928. if (!err) {
  29929. this.ws[kSentClose] = true
  29930. }
  29931. }
  29932. )
  29933. }
  29934. // Upon either sending or receiving a Close control frame, it is said
  29935. // that _The WebSocket Closing Handshake is Started_ and that the
  29936. // WebSocket connection is in the CLOSING state.
  29937. this.ws[kReadyState] = states.CLOSING
  29938. this.ws[kReceivedClose] = true
  29939. this.end()
  29940. return
  29941. } else if (this.#info.opcode === opcodes.PING) {
  29942. // Upon receipt of a Ping frame, an endpoint MUST send a Pong frame in
  29943. // response, unless it already received a Close frame.
  29944. // A Pong frame sent in response to a Ping frame must have identical
  29945. // "Application data"
  29946. const body = this.consume(payloadLength)
  29947. if (!this.ws[kReceivedClose]) {
  29948. const frame = new WebsocketFrameSend(body)
  29949. this.ws[kResponse].socket.write(frame.createFrame(opcodes.PONG))
  29950. if (channels.ping.hasSubscribers) {
  29951. channels.ping.publish({
  29952. payload: body
  29953. })
  29954. }
  29955. }
  29956. this.#state = parserStates.INFO
  29957. if (this.#byteOffset > 0) {
  29958. continue
  29959. } else {
  29960. callback()
  29961. return
  29962. }
  29963. } else if (this.#info.opcode === opcodes.PONG) {
  29964. // A Pong frame MAY be sent unsolicited. This serves as a
  29965. // unidirectional heartbeat. A response to an unsolicited Pong frame is
  29966. // not expected.
  29967. const body = this.consume(payloadLength)
  29968. if (channels.pong.hasSubscribers) {
  29969. channels.pong.publish({
  29970. payload: body
  29971. })
  29972. }
  29973. if (this.#byteOffset > 0) {
  29974. continue
  29975. } else {
  29976. callback()
  29977. return
  29978. }
  29979. }
  29980. } else if (this.#state === parserStates.PAYLOADLENGTH_16) {
  29981. if (this.#byteOffset < 2) {
  29982. return callback()
  29983. }
  29984. const buffer = this.consume(2)
  29985. this.#info.payloadLength = buffer.readUInt16BE(0)
  29986. this.#state = parserStates.READ_DATA
  29987. } else if (this.#state === parserStates.PAYLOADLENGTH_64) {
  29988. if (this.#byteOffset < 8) {
  29989. return callback()
  29990. }
  29991. const buffer = this.consume(8)
  29992. const upper = buffer.readUInt32BE(0)
  29993. // 2^31 is the maxinimum bytes an arraybuffer can contain
  29994. // on 32-bit systems. Although, on 64-bit systems, this is
  29995. // 2^53-1 bytes.
  29996. // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Invalid_array_length
  29997. // https://source.chromium.org/chromium/chromium/src/+/main:v8/src/common/globals.h;drc=1946212ac0100668f14eb9e2843bdd846e510a1e;bpv=1;bpt=1;l=1275
  29998. // https://source.chromium.org/chromium/chromium/src/+/main:v8/src/objects/js-array-buffer.h;l=34;drc=1946212ac0100668f14eb9e2843bdd846e510a1e
  29999. if (upper > 2 ** 31 - 1) {
  30000. failWebsocketConnection(this.ws, 'Received payload length > 2^31 bytes.')
  30001. return
  30002. }
  30003. const lower = buffer.readUInt32BE(4)
  30004. this.#info.payloadLength = (upper << 8) + lower
  30005. this.#state = parserStates.READ_DATA
  30006. } else if (this.#state === parserStates.READ_DATA) {
  30007. if (this.#byteOffset < this.#info.payloadLength) {
  30008. // If there is still more data in this chunk that needs to be read
  30009. return callback()
  30010. } else if (this.#byteOffset >= this.#info.payloadLength) {
  30011. // If the server sent multiple frames in a single chunk
  30012. const body = this.consume(this.#info.payloadLength)
  30013. this.#fragments.push(body)
  30014. // If the frame is unfragmented, or a fragmented frame was terminated,
  30015. // a message was received
  30016. if (!this.#info.fragmented || (this.#info.fin && this.#info.opcode === opcodes.CONTINUATION)) {
  30017. const fullMessage = Buffer.concat(this.#fragments)
  30018. websocketMessageReceived(this.ws, this.#info.originalOpcode, fullMessage)
  30019. this.#info = {}
  30020. this.#fragments.length = 0
  30021. }
  30022. this.#state = parserStates.INFO
  30023. }
  30024. }
  30025. if (this.#byteOffset > 0) {
  30026. continue
  30027. } else {
  30028. callback()
  30029. break
  30030. }
  30031. }
  30032. }
  30033. /**
  30034. * Take n bytes from the buffered Buffers
  30035. * @param {number} n
  30036. * @returns {Buffer|null}
  30037. */
  30038. consume (n) {
  30039. if (n > this.#byteOffset) {
  30040. return null
  30041. } else if (n === 0) {
  30042. return emptyBuffer
  30043. }
  30044. if (this.#buffers[0].length === n) {
  30045. this.#byteOffset -= this.#buffers[0].length
  30046. return this.#buffers.shift()
  30047. }
  30048. const buffer = Buffer.allocUnsafe(n)
  30049. let offset = 0
  30050. while (offset !== n) {
  30051. const next = this.#buffers[0]
  30052. const { length } = next
  30053. if (length + offset === n) {
  30054. buffer.set(this.#buffers.shift(), offset)
  30055. break
  30056. } else if (length + offset > n) {
  30057. buffer.set(next.subarray(0, n - offset), offset)
  30058. this.#buffers[0] = next.subarray(n - offset)
  30059. break
  30060. } else {
  30061. buffer.set(this.#buffers.shift(), offset)
  30062. offset += next.length
  30063. }
  30064. }
  30065. this.#byteOffset -= n
  30066. return buffer
  30067. }
  30068. parseCloseBody (onlyCode, data) {
  30069. // https://datatracker.ietf.org/doc/html/rfc6455#section-7.1.5
  30070. /** @type {number|undefined} */
  30071. let code
  30072. if (data.length >= 2) {
  30073. // _The WebSocket Connection Close Code_ is
  30074. // defined as the status code (Section 7.4) contained in the first Close
  30075. // control frame received by the application
  30076. code = data.readUInt16BE(0)
  30077. }
  30078. if (onlyCode) {
  30079. if (!isValidStatusCode(code)) {
  30080. return null
  30081. }
  30082. return { code }
  30083. }
  30084. // https://datatracker.ietf.org/doc/html/rfc6455#section-7.1.6
  30085. /** @type {Buffer} */
  30086. let reason = data.subarray(2)
  30087. // Remove BOM
  30088. if (reason[0] === 0xEF && reason[1] === 0xBB && reason[2] === 0xBF) {
  30089. reason = reason.subarray(3)
  30090. }
  30091. if (code !== undefined && !isValidStatusCode(code)) {
  30092. return null
  30093. }
  30094. try {
  30095. // TODO: optimize this
  30096. reason = new TextDecoder('utf-8', { fatal: true }).decode(reason)
  30097. } catch {
  30098. return null
  30099. }
  30100. return { code, reason }
  30101. }
  30102. get closingInfo () {
  30103. return this.#info.closeInfo
  30104. }
  30105. }
  30106. module.exports = {
  30107. ByteParser
  30108. }
  30109. /***/ }),
  30110. /***/ 7578:
  30111. /***/ ((module) => {
  30112. "use strict";
  30113. module.exports = {
  30114. kWebSocketURL: Symbol('url'),
  30115. kReadyState: Symbol('ready state'),
  30116. kController: Symbol('controller'),
  30117. kResponse: Symbol('response'),
  30118. kBinaryType: Symbol('binary type'),
  30119. kSentClose: Symbol('sent close'),
  30120. kReceivedClose: Symbol('received close'),
  30121. kByteParser: Symbol('byte parser')
  30122. }
  30123. /***/ }),
  30124. /***/ 5515:
  30125. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  30126. "use strict";
  30127. const { kReadyState, kController, kResponse, kBinaryType, kWebSocketURL } = __nccwpck_require__(7578)
  30128. const { states, opcodes } = __nccwpck_require__(9188)
  30129. const { MessageEvent, ErrorEvent } = __nccwpck_require__(2611)
  30130. /* globals Blob */
  30131. /**
  30132. * @param {import('./websocket').WebSocket} ws
  30133. */
  30134. function isEstablished (ws) {
  30135. // If the server's response is validated as provided for above, it is
  30136. // said that _The WebSocket Connection is Established_ and that the
  30137. // WebSocket Connection is in the OPEN state.
  30138. return ws[kReadyState] === states.OPEN
  30139. }
  30140. /**
  30141. * @param {import('./websocket').WebSocket} ws
  30142. */
  30143. function isClosing (ws) {
  30144. // Upon either sending or receiving a Close control frame, it is said
  30145. // that _The WebSocket Closing Handshake is Started_ and that the
  30146. // WebSocket connection is in the CLOSING state.
  30147. return ws[kReadyState] === states.CLOSING
  30148. }
  30149. /**
  30150. * @param {import('./websocket').WebSocket} ws
  30151. */
  30152. function isClosed (ws) {
  30153. return ws[kReadyState] === states.CLOSED
  30154. }
  30155. /**
  30156. * @see https://dom.spec.whatwg.org/#concept-event-fire
  30157. * @param {string} e
  30158. * @param {EventTarget} target
  30159. * @param {EventInit | undefined} eventInitDict
  30160. */
  30161. function fireEvent (e, target, eventConstructor = Event, eventInitDict) {
  30162. // 1. If eventConstructor is not given, then let eventConstructor be Event.
  30163. // 2. Let event be the result of creating an event given eventConstructor,
  30164. // in the relevant realm of target.
  30165. // 3. Initialize event’s type attribute to e.
  30166. const event = new eventConstructor(e, eventInitDict) // eslint-disable-line new-cap
  30167. // 4. Initialize any other IDL attributes of event as described in the
  30168. // invocation of this algorithm.
  30169. // 5. Return the result of dispatching event at target, with legacy target
  30170. // override flag set if set.
  30171. target.dispatchEvent(event)
  30172. }
  30173. /**
  30174. * @see https://websockets.spec.whatwg.org/#feedback-from-the-protocol
  30175. * @param {import('./websocket').WebSocket} ws
  30176. * @param {number} type Opcode
  30177. * @param {Buffer} data application data
  30178. */
  30179. function websocketMessageReceived (ws, type, data) {
  30180. // 1. If ready state is not OPEN (1), then return.
  30181. if (ws[kReadyState] !== states.OPEN) {
  30182. return
  30183. }
  30184. // 2. Let dataForEvent be determined by switching on type and binary type:
  30185. let dataForEvent
  30186. if (type === opcodes.TEXT) {
  30187. // -> type indicates that the data is Text
  30188. // a new DOMString containing data
  30189. try {
  30190. dataForEvent = new TextDecoder('utf-8', { fatal: true }).decode(data)
  30191. } catch {
  30192. failWebsocketConnection(ws, 'Received invalid UTF-8 in text frame.')
  30193. return
  30194. }
  30195. } else if (type === opcodes.BINARY) {
  30196. if (ws[kBinaryType] === 'blob') {
  30197. // -> type indicates that the data is Binary and binary type is "blob"
  30198. // a new Blob object, created in the relevant Realm of the WebSocket
  30199. // object, that represents data as its raw data
  30200. dataForEvent = new Blob([data])
  30201. } else {
  30202. // -> type indicates that the data is Binary and binary type is "arraybuffer"
  30203. // a new ArrayBuffer object, created in the relevant Realm of the
  30204. // WebSocket object, whose contents are data
  30205. dataForEvent = new Uint8Array(data).buffer
  30206. }
  30207. }
  30208. // 3. Fire an event named message at the WebSocket object, using MessageEvent,
  30209. // with the origin attribute initialized to the serialization of the WebSocket
  30210. // object’s url's origin, and the data attribute initialized to dataForEvent.
  30211. fireEvent('message', ws, MessageEvent, {
  30212. origin: ws[kWebSocketURL].origin,
  30213. data: dataForEvent
  30214. })
  30215. }
  30216. /**
  30217. * @see https://datatracker.ietf.org/doc/html/rfc6455
  30218. * @see https://datatracker.ietf.org/doc/html/rfc2616
  30219. * @see https://bugs.chromium.org/p/chromium/issues/detail?id=398407
  30220. * @param {string} protocol
  30221. */
  30222. function isValidSubprotocol (protocol) {
  30223. // If present, this value indicates one
  30224. // or more comma-separated subprotocol the client wishes to speak,
  30225. // ordered by preference. The elements that comprise this value
  30226. // MUST be non-empty strings with characters in the range U+0021 to
  30227. // U+007E not including separator characters as defined in
  30228. // [RFC2616] and MUST all be unique strings.
  30229. if (protocol.length === 0) {
  30230. return false
  30231. }
  30232. for (const char of protocol) {
  30233. const code = char.charCodeAt(0)
  30234. if (
  30235. code < 0x21 ||
  30236. code > 0x7E ||
  30237. char === '(' ||
  30238. char === ')' ||
  30239. char === '<' ||
  30240. char === '>' ||
  30241. char === '@' ||
  30242. char === ',' ||
  30243. char === ';' ||
  30244. char === ':' ||
  30245. char === '\\' ||
  30246. char === '"' ||
  30247. char === '/' ||
  30248. char === '[' ||
  30249. char === ']' ||
  30250. char === '?' ||
  30251. char === '=' ||
  30252. char === '{' ||
  30253. char === '}' ||
  30254. code === 32 || // SP
  30255. code === 9 // HT
  30256. ) {
  30257. return false
  30258. }
  30259. }
  30260. return true
  30261. }
  30262. /**
  30263. * @see https://datatracker.ietf.org/doc/html/rfc6455#section-7-4
  30264. * @param {number} code
  30265. */
  30266. function isValidStatusCode (code) {
  30267. if (code >= 1000 && code < 1015) {
  30268. return (
  30269. code !== 1004 && // reserved
  30270. code !== 1005 && // "MUST NOT be set as a status code"
  30271. code !== 1006 // "MUST NOT be set as a status code"
  30272. )
  30273. }
  30274. return code >= 3000 && code <= 4999
  30275. }
  30276. /**
  30277. * @param {import('./websocket').WebSocket} ws
  30278. * @param {string|undefined} reason
  30279. */
  30280. function failWebsocketConnection (ws, reason) {
  30281. const { [kController]: controller, [kResponse]: response } = ws
  30282. controller.abort()
  30283. if (response?.socket && !response.socket.destroyed) {
  30284. response.socket.destroy()
  30285. }
  30286. if (reason) {
  30287. fireEvent('error', ws, ErrorEvent, {
  30288. error: new Error(reason)
  30289. })
  30290. }
  30291. }
  30292. module.exports = {
  30293. isEstablished,
  30294. isClosing,
  30295. isClosed,
  30296. fireEvent,
  30297. isValidSubprotocol,
  30298. isValidStatusCode,
  30299. failWebsocketConnection,
  30300. websocketMessageReceived
  30301. }
  30302. /***/ }),
  30303. /***/ 4284:
  30304. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  30305. "use strict";
  30306. const { webidl } = __nccwpck_require__(1744)
  30307. const { DOMException } = __nccwpck_require__(1037)
  30308. const { URLSerializer } = __nccwpck_require__(685)
  30309. const { getGlobalOrigin } = __nccwpck_require__(1246)
  30310. const { staticPropertyDescriptors, states, opcodes, emptyBuffer } = __nccwpck_require__(9188)
  30311. const {
  30312. kWebSocketURL,
  30313. kReadyState,
  30314. kController,
  30315. kBinaryType,
  30316. kResponse,
  30317. kSentClose,
  30318. kByteParser
  30319. } = __nccwpck_require__(7578)
  30320. const { isEstablished, isClosing, isValidSubprotocol, failWebsocketConnection, fireEvent } = __nccwpck_require__(5515)
  30321. const { establishWebSocketConnection } = __nccwpck_require__(5354)
  30322. const { WebsocketFrameSend } = __nccwpck_require__(5444)
  30323. const { ByteParser } = __nccwpck_require__(1688)
  30324. const { kEnumerableProperty, isBlobLike } = __nccwpck_require__(3983)
  30325. const { getGlobalDispatcher } = __nccwpck_require__(1892)
  30326. const { types } = __nccwpck_require__(3837)
  30327. let experimentalWarned = false
  30328. // https://websockets.spec.whatwg.org/#interface-definition
  30329. class WebSocket extends EventTarget {
  30330. #events = {
  30331. open: null,
  30332. error: null,
  30333. close: null,
  30334. message: null
  30335. }
  30336. #bufferedAmount = 0
  30337. #protocol = ''
  30338. #extensions = ''
  30339. /**
  30340. * @param {string} url
  30341. * @param {string|string[]} protocols
  30342. */
  30343. constructor (url, protocols = []) {
  30344. super()
  30345. webidl.argumentLengthCheck(arguments, 1, { header: 'WebSocket constructor' })
  30346. if (!experimentalWarned) {
  30347. experimentalWarned = true
  30348. process.emitWarning('WebSockets are experimental, expect them to change at any time.', {
  30349. code: 'UNDICI-WS'
  30350. })
  30351. }
  30352. const options = webidl.converters['DOMString or sequence<DOMString> or WebSocketInit'](protocols)
  30353. url = webidl.converters.USVString(url)
  30354. protocols = options.protocols
  30355. // 1. Let baseURL be this's relevant settings object's API base URL.
  30356. const baseURL = getGlobalOrigin()
  30357. // 1. Let urlRecord be the result of applying the URL parser to url with baseURL.
  30358. let urlRecord
  30359. try {
  30360. urlRecord = new URL(url, baseURL)
  30361. } catch (e) {
  30362. // 3. If urlRecord is failure, then throw a "SyntaxError" DOMException.
  30363. throw new DOMException(e, 'SyntaxError')
  30364. }
  30365. // 4. If urlRecord’s scheme is "http", then set urlRecord’s scheme to "ws".
  30366. if (urlRecord.protocol === 'http:') {
  30367. urlRecord.protocol = 'ws:'
  30368. } else if (urlRecord.protocol === 'https:') {
  30369. // 5. Otherwise, if urlRecord’s scheme is "https", set urlRecord’s scheme to "wss".
  30370. urlRecord.protocol = 'wss:'
  30371. }
  30372. // 6. If urlRecord’s scheme is not "ws" or "wss", then throw a "SyntaxError" DOMException.
  30373. if (urlRecord.protocol !== 'ws:' && urlRecord.protocol !== 'wss:') {
  30374. throw new DOMException(
  30375. `Expected a ws: or wss: protocol, got ${urlRecord.protocol}`,
  30376. 'SyntaxError'
  30377. )
  30378. }
  30379. // 7. If urlRecord’s fragment is non-null, then throw a "SyntaxError"
  30380. // DOMException.
  30381. if (urlRecord.hash || urlRecord.href.endsWith('#')) {
  30382. throw new DOMException('Got fragment', 'SyntaxError')
  30383. }
  30384. // 8. If protocols is a string, set protocols to a sequence consisting
  30385. // of just that string.
  30386. if (typeof protocols === 'string') {
  30387. protocols = [protocols]
  30388. }
  30389. // 9. If any of the values in protocols occur more than once or otherwise
  30390. // fail to match the requirements for elements that comprise the value
  30391. // of `Sec-WebSocket-Protocol` fields as defined by The WebSocket
  30392. // protocol, then throw a "SyntaxError" DOMException.
  30393. if (protocols.length !== new Set(protocols.map(p => p.toLowerCase())).size) {
  30394. throw new DOMException('Invalid Sec-WebSocket-Protocol value', 'SyntaxError')
  30395. }
  30396. if (protocols.length > 0 && !protocols.every(p => isValidSubprotocol(p))) {
  30397. throw new DOMException('Invalid Sec-WebSocket-Protocol value', 'SyntaxError')
  30398. }
  30399. // 10. Set this's url to urlRecord.
  30400. this[kWebSocketURL] = new URL(urlRecord.href)
  30401. // 11. Let client be this's relevant settings object.
  30402. // 12. Run this step in parallel:
  30403. // 1. Establish a WebSocket connection given urlRecord, protocols,
  30404. // and client.
  30405. this[kController] = establishWebSocketConnection(
  30406. urlRecord,
  30407. protocols,
  30408. this,
  30409. (response) => this.#onConnectionEstablished(response),
  30410. options
  30411. )
  30412. // Each WebSocket object has an associated ready state, which is a
  30413. // number representing the state of the connection. Initially it must
  30414. // be CONNECTING (0).
  30415. this[kReadyState] = WebSocket.CONNECTING
  30416. // The extensions attribute must initially return the empty string.
  30417. // The protocol attribute must initially return the empty string.
  30418. // Each WebSocket object has an associated binary type, which is a
  30419. // BinaryType. Initially it must be "blob".
  30420. this[kBinaryType] = 'blob'
  30421. }
  30422. /**
  30423. * @see https://websockets.spec.whatwg.org/#dom-websocket-close
  30424. * @param {number|undefined} code
  30425. * @param {string|undefined} reason
  30426. */
  30427. close (code = undefined, reason = undefined) {
  30428. webidl.brandCheck(this, WebSocket)
  30429. if (code !== undefined) {
  30430. code = webidl.converters['unsigned short'](code, { clamp: true })
  30431. }
  30432. if (reason !== undefined) {
  30433. reason = webidl.converters.USVString(reason)
  30434. }
  30435. // 1. If code is present, but is neither an integer equal to 1000 nor an
  30436. // integer in the range 3000 to 4999, inclusive, throw an
  30437. // "InvalidAccessError" DOMException.
  30438. if (code !== undefined) {
  30439. if (code !== 1000 && (code < 3000 || code > 4999)) {
  30440. throw new DOMException('invalid code', 'InvalidAccessError')
  30441. }
  30442. }
  30443. let reasonByteLength = 0
  30444. // 2. If reason is present, then run these substeps:
  30445. if (reason !== undefined) {
  30446. // 1. Let reasonBytes be the result of encoding reason.
  30447. // 2. If reasonBytes is longer than 123 bytes, then throw a
  30448. // "SyntaxError" DOMException.
  30449. reasonByteLength = Buffer.byteLength(reason)
  30450. if (reasonByteLength > 123) {
  30451. throw new DOMException(
  30452. `Reason must be less than 123 bytes; received ${reasonByteLength}`,
  30453. 'SyntaxError'
  30454. )
  30455. }
  30456. }
  30457. // 3. Run the first matching steps from the following list:
  30458. if (this[kReadyState] === WebSocket.CLOSING || this[kReadyState] === WebSocket.CLOSED) {
  30459. // If this's ready state is CLOSING (2) or CLOSED (3)
  30460. // Do nothing.
  30461. } else if (!isEstablished(this)) {
  30462. // If the WebSocket connection is not yet established
  30463. // Fail the WebSocket connection and set this's ready state
  30464. // to CLOSING (2).
  30465. failWebsocketConnection(this, 'Connection was closed before it was established.')
  30466. this[kReadyState] = WebSocket.CLOSING
  30467. } else if (!isClosing(this)) {
  30468. // If the WebSocket closing handshake has not yet been started
  30469. // Start the WebSocket closing handshake and set this's ready
  30470. // state to CLOSING (2).
  30471. // - If neither code nor reason is present, the WebSocket Close
  30472. // message must not have a body.
  30473. // - If code is present, then the status code to use in the
  30474. // WebSocket Close message must be the integer given by code.
  30475. // - If reason is also present, then reasonBytes must be
  30476. // provided in the Close message after the status code.
  30477. const frame = new WebsocketFrameSend()
  30478. // If neither code nor reason is present, the WebSocket Close
  30479. // message must not have a body.
  30480. // If code is present, then the status code to use in the
  30481. // WebSocket Close message must be the integer given by code.
  30482. if (code !== undefined && reason === undefined) {
  30483. frame.frameData = Buffer.allocUnsafe(2)
  30484. frame.frameData.writeUInt16BE(code, 0)
  30485. } else if (code !== undefined && reason !== undefined) {
  30486. // If reason is also present, then reasonBytes must be
  30487. // provided in the Close message after the status code.
  30488. frame.frameData = Buffer.allocUnsafe(2 + reasonByteLength)
  30489. frame.frameData.writeUInt16BE(code, 0)
  30490. // the body MAY contain UTF-8-encoded data with value /reason/
  30491. frame.frameData.write(reason, 2, 'utf-8')
  30492. } else {
  30493. frame.frameData = emptyBuffer
  30494. }
  30495. /** @type {import('stream').Duplex} */
  30496. const socket = this[kResponse].socket
  30497. socket.write(frame.createFrame(opcodes.CLOSE), (err) => {
  30498. if (!err) {
  30499. this[kSentClose] = true
  30500. }
  30501. })
  30502. // Upon either sending or receiving a Close control frame, it is said
  30503. // that _The WebSocket Closing Handshake is Started_ and that the
  30504. // WebSocket connection is in the CLOSING state.
  30505. this[kReadyState] = states.CLOSING
  30506. } else {
  30507. // Otherwise
  30508. // Set this's ready state to CLOSING (2).
  30509. this[kReadyState] = WebSocket.CLOSING
  30510. }
  30511. }
  30512. /**
  30513. * @see https://websockets.spec.whatwg.org/#dom-websocket-send
  30514. * @param {NodeJS.TypedArray|ArrayBuffer|Blob|string} data
  30515. */
  30516. send (data) {
  30517. webidl.brandCheck(this, WebSocket)
  30518. webidl.argumentLengthCheck(arguments, 1, { header: 'WebSocket.send' })
  30519. data = webidl.converters.WebSocketSendData(data)
  30520. // 1. If this's ready state is CONNECTING, then throw an
  30521. // "InvalidStateError" DOMException.
  30522. if (this[kReadyState] === WebSocket.CONNECTING) {
  30523. throw new DOMException('Sent before connected.', 'InvalidStateError')
  30524. }
  30525. // 2. Run the appropriate set of steps from the following list:
  30526. // https://datatracker.ietf.org/doc/html/rfc6455#section-6.1
  30527. // https://datatracker.ietf.org/doc/html/rfc6455#section-5.2
  30528. if (!isEstablished(this) || isClosing(this)) {
  30529. return
  30530. }
  30531. /** @type {import('stream').Duplex} */
  30532. const socket = this[kResponse].socket
  30533. // If data is a string
  30534. if (typeof data === 'string') {
  30535. // If the WebSocket connection is established and the WebSocket
  30536. // closing handshake has not yet started, then the user agent
  30537. // must send a WebSocket Message comprised of the data argument
  30538. // using a text frame opcode; if the data cannot be sent, e.g.
  30539. // because it would need to be buffered but the buffer is full,
  30540. // the user agent must flag the WebSocket as full and then close
  30541. // the WebSocket connection. Any invocation of this method with a
  30542. // string argument that does not throw an exception must increase
  30543. // the bufferedAmount attribute by the number of bytes needed to
  30544. // express the argument as UTF-8.
  30545. const value = Buffer.from(data)
  30546. const frame = new WebsocketFrameSend(value)
  30547. const buffer = frame.createFrame(opcodes.TEXT)
  30548. this.#bufferedAmount += value.byteLength
  30549. socket.write(buffer, () => {
  30550. this.#bufferedAmount -= value.byteLength
  30551. })
  30552. } else if (types.isArrayBuffer(data)) {
  30553. // If the WebSocket connection is established, and the WebSocket
  30554. // closing handshake has not yet started, then the user agent must
  30555. // send a WebSocket Message comprised of data using a binary frame
  30556. // opcode; if the data cannot be sent, e.g. because it would need
  30557. // to be buffered but the buffer is full, the user agent must flag
  30558. // the WebSocket as full and then close the WebSocket connection.
  30559. // The data to be sent is the data stored in the buffer described
  30560. // by the ArrayBuffer object. Any invocation of this method with an
  30561. // ArrayBuffer argument that does not throw an exception must
  30562. // increase the bufferedAmount attribute by the length of the
  30563. // ArrayBuffer in bytes.
  30564. const value = Buffer.from(data)
  30565. const frame = new WebsocketFrameSend(value)
  30566. const buffer = frame.createFrame(opcodes.BINARY)
  30567. this.#bufferedAmount += value.byteLength
  30568. socket.write(buffer, () => {
  30569. this.#bufferedAmount -= value.byteLength
  30570. })
  30571. } else if (ArrayBuffer.isView(data)) {
  30572. // If the WebSocket connection is established, and the WebSocket
  30573. // closing handshake has not yet started, then the user agent must
  30574. // send a WebSocket Message comprised of data using a binary frame
  30575. // opcode; if the data cannot be sent, e.g. because it would need to
  30576. // be buffered but the buffer is full, the user agent must flag the
  30577. // WebSocket as full and then close the WebSocket connection. The
  30578. // data to be sent is the data stored in the section of the buffer
  30579. // described by the ArrayBuffer object that data references. Any
  30580. // invocation of this method with this kind of argument that does
  30581. // not throw an exception must increase the bufferedAmount attribute
  30582. // by the length of data’s buffer in bytes.
  30583. const ab = Buffer.from(data, data.byteOffset, data.byteLength)
  30584. const frame = new WebsocketFrameSend(ab)
  30585. const buffer = frame.createFrame(opcodes.BINARY)
  30586. this.#bufferedAmount += ab.byteLength
  30587. socket.write(buffer, () => {
  30588. this.#bufferedAmount -= ab.byteLength
  30589. })
  30590. } else if (isBlobLike(data)) {
  30591. // If the WebSocket connection is established, and the WebSocket
  30592. // closing handshake has not yet started, then the user agent must
  30593. // send a WebSocket Message comprised of data using a binary frame
  30594. // opcode; if the data cannot be sent, e.g. because it would need to
  30595. // be buffered but the buffer is full, the user agent must flag the
  30596. // WebSocket as full and then close the WebSocket connection. The data
  30597. // to be sent is the raw data represented by the Blob object. Any
  30598. // invocation of this method with a Blob argument that does not throw
  30599. // an exception must increase the bufferedAmount attribute by the size
  30600. // of the Blob object’s raw data, in bytes.
  30601. const frame = new WebsocketFrameSend()
  30602. data.arrayBuffer().then((ab) => {
  30603. const value = Buffer.from(ab)
  30604. frame.frameData = value
  30605. const buffer = frame.createFrame(opcodes.BINARY)
  30606. this.#bufferedAmount += value.byteLength
  30607. socket.write(buffer, () => {
  30608. this.#bufferedAmount -= value.byteLength
  30609. })
  30610. })
  30611. }
  30612. }
  30613. get readyState () {
  30614. webidl.brandCheck(this, WebSocket)
  30615. // The readyState getter steps are to return this's ready state.
  30616. return this[kReadyState]
  30617. }
  30618. get bufferedAmount () {
  30619. webidl.brandCheck(this, WebSocket)
  30620. return this.#bufferedAmount
  30621. }
  30622. get url () {
  30623. webidl.brandCheck(this, WebSocket)
  30624. // The url getter steps are to return this's url, serialized.
  30625. return URLSerializer(this[kWebSocketURL])
  30626. }
  30627. get extensions () {
  30628. webidl.brandCheck(this, WebSocket)
  30629. return this.#extensions
  30630. }
  30631. get protocol () {
  30632. webidl.brandCheck(this, WebSocket)
  30633. return this.#protocol
  30634. }
  30635. get onopen () {
  30636. webidl.brandCheck(this, WebSocket)
  30637. return this.#events.open
  30638. }
  30639. set onopen (fn) {
  30640. webidl.brandCheck(this, WebSocket)
  30641. if (this.#events.open) {
  30642. this.removeEventListener('open', this.#events.open)
  30643. }
  30644. if (typeof fn === 'function') {
  30645. this.#events.open = fn
  30646. this.addEventListener('open', fn)
  30647. } else {
  30648. this.#events.open = null
  30649. }
  30650. }
  30651. get onerror () {
  30652. webidl.brandCheck(this, WebSocket)
  30653. return this.#events.error
  30654. }
  30655. set onerror (fn) {
  30656. webidl.brandCheck(this, WebSocket)
  30657. if (this.#events.error) {
  30658. this.removeEventListener('error', this.#events.error)
  30659. }
  30660. if (typeof fn === 'function') {
  30661. this.#events.error = fn
  30662. this.addEventListener('error', fn)
  30663. } else {
  30664. this.#events.error = null
  30665. }
  30666. }
  30667. get onclose () {
  30668. webidl.brandCheck(this, WebSocket)
  30669. return this.#events.close
  30670. }
  30671. set onclose (fn) {
  30672. webidl.brandCheck(this, WebSocket)
  30673. if (this.#events.close) {
  30674. this.removeEventListener('close', this.#events.close)
  30675. }
  30676. if (typeof fn === 'function') {
  30677. this.#events.close = fn
  30678. this.addEventListener('close', fn)
  30679. } else {
  30680. this.#events.close = null
  30681. }
  30682. }
  30683. get onmessage () {
  30684. webidl.brandCheck(this, WebSocket)
  30685. return this.#events.message
  30686. }
  30687. set onmessage (fn) {
  30688. webidl.brandCheck(this, WebSocket)
  30689. if (this.#events.message) {
  30690. this.removeEventListener('message', this.#events.message)
  30691. }
  30692. if (typeof fn === 'function') {
  30693. this.#events.message = fn
  30694. this.addEventListener('message', fn)
  30695. } else {
  30696. this.#events.message = null
  30697. }
  30698. }
  30699. get binaryType () {
  30700. webidl.brandCheck(this, WebSocket)
  30701. return this[kBinaryType]
  30702. }
  30703. set binaryType (type) {
  30704. webidl.brandCheck(this, WebSocket)
  30705. if (type !== 'blob' && type !== 'arraybuffer') {
  30706. this[kBinaryType] = 'blob'
  30707. } else {
  30708. this[kBinaryType] = type
  30709. }
  30710. }
  30711. /**
  30712. * @see https://websockets.spec.whatwg.org/#feedback-from-the-protocol
  30713. */
  30714. #onConnectionEstablished (response) {
  30715. // processResponse is called when the "response’s header list has been received and initialized."
  30716. // once this happens, the connection is open
  30717. this[kResponse] = response
  30718. const parser = new ByteParser(this)
  30719. parser.on('drain', function onParserDrain () {
  30720. this.ws[kResponse].socket.resume()
  30721. })
  30722. response.socket.ws = this
  30723. this[kByteParser] = parser
  30724. // 1. Change the ready state to OPEN (1).
  30725. this[kReadyState] = states.OPEN
  30726. // 2. Change the extensions attribute’s value to the extensions in use, if
  30727. // it is not the null value.
  30728. // https://datatracker.ietf.org/doc/html/rfc6455#section-9.1
  30729. const extensions = response.headersList.get('sec-websocket-extensions')
  30730. if (extensions !== null) {
  30731. this.#extensions = extensions
  30732. }
  30733. // 3. Change the protocol attribute’s value to the subprotocol in use, if
  30734. // it is not the null value.
  30735. // https://datatracker.ietf.org/doc/html/rfc6455#section-1.9
  30736. const protocol = response.headersList.get('sec-websocket-protocol')
  30737. if (protocol !== null) {
  30738. this.#protocol = protocol
  30739. }
  30740. // 4. Fire an event named open at the WebSocket object.
  30741. fireEvent('open', this)
  30742. }
  30743. }
  30744. // https://websockets.spec.whatwg.org/#dom-websocket-connecting
  30745. WebSocket.CONNECTING = WebSocket.prototype.CONNECTING = states.CONNECTING
  30746. // https://websockets.spec.whatwg.org/#dom-websocket-open
  30747. WebSocket.OPEN = WebSocket.prototype.OPEN = states.OPEN
  30748. // https://websockets.spec.whatwg.org/#dom-websocket-closing
  30749. WebSocket.CLOSING = WebSocket.prototype.CLOSING = states.CLOSING
  30750. // https://websockets.spec.whatwg.org/#dom-websocket-closed
  30751. WebSocket.CLOSED = WebSocket.prototype.CLOSED = states.CLOSED
  30752. Object.defineProperties(WebSocket.prototype, {
  30753. CONNECTING: staticPropertyDescriptors,
  30754. OPEN: staticPropertyDescriptors,
  30755. CLOSING: staticPropertyDescriptors,
  30756. CLOSED: staticPropertyDescriptors,
  30757. url: kEnumerableProperty,
  30758. readyState: kEnumerableProperty,
  30759. bufferedAmount: kEnumerableProperty,
  30760. onopen: kEnumerableProperty,
  30761. onerror: kEnumerableProperty,
  30762. onclose: kEnumerableProperty,
  30763. close: kEnumerableProperty,
  30764. onmessage: kEnumerableProperty,
  30765. binaryType: kEnumerableProperty,
  30766. send: kEnumerableProperty,
  30767. extensions: kEnumerableProperty,
  30768. protocol: kEnumerableProperty,
  30769. [Symbol.toStringTag]: {
  30770. value: 'WebSocket',
  30771. writable: false,
  30772. enumerable: false,
  30773. configurable: true
  30774. }
  30775. })
  30776. Object.defineProperties(WebSocket, {
  30777. CONNECTING: staticPropertyDescriptors,
  30778. OPEN: staticPropertyDescriptors,
  30779. CLOSING: staticPropertyDescriptors,
  30780. CLOSED: staticPropertyDescriptors
  30781. })
  30782. webidl.converters['sequence<DOMString>'] = webidl.sequenceConverter(
  30783. webidl.converters.DOMString
  30784. )
  30785. webidl.converters['DOMString or sequence<DOMString>'] = function (V) {
  30786. if (webidl.util.Type(V) === 'Object' && Symbol.iterator in V) {
  30787. return webidl.converters['sequence<DOMString>'](V)
  30788. }
  30789. return webidl.converters.DOMString(V)
  30790. }
  30791. // This implements the propsal made in https://github.com/whatwg/websockets/issues/42
  30792. webidl.converters.WebSocketInit = webidl.dictionaryConverter([
  30793. {
  30794. key: 'protocols',
  30795. converter: webidl.converters['DOMString or sequence<DOMString>'],
  30796. get defaultValue () {
  30797. return []
  30798. }
  30799. },
  30800. {
  30801. key: 'dispatcher',
  30802. converter: (V) => V,
  30803. get defaultValue () {
  30804. return getGlobalDispatcher()
  30805. }
  30806. },
  30807. {
  30808. key: 'headers',
  30809. converter: webidl.nullableConverter(webidl.converters.HeadersInit)
  30810. }
  30811. ])
  30812. webidl.converters['DOMString or sequence<DOMString> or WebSocketInit'] = function (V) {
  30813. if (webidl.util.Type(V) === 'Object' && !(Symbol.iterator in V)) {
  30814. return webidl.converters.WebSocketInit(V)
  30815. }
  30816. return { protocols: webidl.converters['DOMString or sequence<DOMString>'](V) }
  30817. }
  30818. webidl.converters.WebSocketSendData = function (V) {
  30819. if (webidl.util.Type(V) === 'Object') {
  30820. if (isBlobLike(V)) {
  30821. return webidl.converters.Blob(V, { strict: false })
  30822. }
  30823. if (ArrayBuffer.isView(V) || types.isAnyArrayBuffer(V)) {
  30824. return webidl.converters.BufferSource(V)
  30825. }
  30826. }
  30827. return webidl.converters.USVString(V)
  30828. }
  30829. module.exports = {
  30830. WebSocket
  30831. }
  30832. /***/ }),
  30833. /***/ 5030:
  30834. /***/ ((__unused_webpack_module, exports) => {
  30835. "use strict";
  30836. Object.defineProperty(exports, "__esModule", ({ value: true }));
  30837. function getUserAgent() {
  30838. if (typeof navigator === "object" && "userAgent" in navigator) {
  30839. return navigator.userAgent;
  30840. }
  30841. if (typeof process === "object" && process.version !== undefined) {
  30842. return `Node.js/${process.version.substr(1)} (${process.platform}; ${process.arch})`;
  30843. }
  30844. return "<environment undetectable>";
  30845. }
  30846. exports.getUserAgent = getUserAgent;
  30847. //# sourceMappingURL=index.js.map
  30848. /***/ }),
  30849. /***/ 5840:
  30850. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  30851. "use strict";
  30852. Object.defineProperty(exports, "__esModule", ({
  30853. value: true
  30854. }));
  30855. Object.defineProperty(exports, "NIL", ({
  30856. enumerable: true,
  30857. get: function () {
  30858. return _nil.default;
  30859. }
  30860. }));
  30861. Object.defineProperty(exports, "parse", ({
  30862. enumerable: true,
  30863. get: function () {
  30864. return _parse.default;
  30865. }
  30866. }));
  30867. Object.defineProperty(exports, "stringify", ({
  30868. enumerable: true,
  30869. get: function () {
  30870. return _stringify.default;
  30871. }
  30872. }));
  30873. Object.defineProperty(exports, "v1", ({
  30874. enumerable: true,
  30875. get: function () {
  30876. return _v.default;
  30877. }
  30878. }));
  30879. Object.defineProperty(exports, "v3", ({
  30880. enumerable: true,
  30881. get: function () {
  30882. return _v2.default;
  30883. }
  30884. }));
  30885. Object.defineProperty(exports, "v4", ({
  30886. enumerable: true,
  30887. get: function () {
  30888. return _v3.default;
  30889. }
  30890. }));
  30891. Object.defineProperty(exports, "v5", ({
  30892. enumerable: true,
  30893. get: function () {
  30894. return _v4.default;
  30895. }
  30896. }));
  30897. Object.defineProperty(exports, "validate", ({
  30898. enumerable: true,
  30899. get: function () {
  30900. return _validate.default;
  30901. }
  30902. }));
  30903. Object.defineProperty(exports, "version", ({
  30904. enumerable: true,
  30905. get: function () {
  30906. return _version.default;
  30907. }
  30908. }));
  30909. var _v = _interopRequireDefault(__nccwpck_require__(8628));
  30910. var _v2 = _interopRequireDefault(__nccwpck_require__(6409));
  30911. var _v3 = _interopRequireDefault(__nccwpck_require__(5122));
  30912. var _v4 = _interopRequireDefault(__nccwpck_require__(9120));
  30913. var _nil = _interopRequireDefault(__nccwpck_require__(5332));
  30914. var _version = _interopRequireDefault(__nccwpck_require__(2414));
  30915. var _validate = _interopRequireDefault(__nccwpck_require__(6900));
  30916. var _stringify = _interopRequireDefault(__nccwpck_require__(8950));
  30917. var _parse = _interopRequireDefault(__nccwpck_require__(2746));
  30918. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  30919. /***/ }),
  30920. /***/ 4569:
  30921. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  30922. "use strict";
  30923. Object.defineProperty(exports, "__esModule", ({
  30924. value: true
  30925. }));
  30926. exports["default"] = void 0;
  30927. var _crypto = _interopRequireDefault(__nccwpck_require__(6113));
  30928. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  30929. function md5(bytes) {
  30930. if (Array.isArray(bytes)) {
  30931. bytes = Buffer.from(bytes);
  30932. } else if (typeof bytes === 'string') {
  30933. bytes = Buffer.from(bytes, 'utf8');
  30934. }
  30935. return _crypto.default.createHash('md5').update(bytes).digest();
  30936. }
  30937. var _default = md5;
  30938. exports["default"] = _default;
  30939. /***/ }),
  30940. /***/ 2054:
  30941. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  30942. "use strict";
  30943. Object.defineProperty(exports, "__esModule", ({
  30944. value: true
  30945. }));
  30946. exports["default"] = void 0;
  30947. var _crypto = _interopRequireDefault(__nccwpck_require__(6113));
  30948. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  30949. var _default = {
  30950. randomUUID: _crypto.default.randomUUID
  30951. };
  30952. exports["default"] = _default;
  30953. /***/ }),
  30954. /***/ 5332:
  30955. /***/ ((__unused_webpack_module, exports) => {
  30956. "use strict";
  30957. Object.defineProperty(exports, "__esModule", ({
  30958. value: true
  30959. }));
  30960. exports["default"] = void 0;
  30961. var _default = '00000000-0000-0000-0000-000000000000';
  30962. exports["default"] = _default;
  30963. /***/ }),
  30964. /***/ 2746:
  30965. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  30966. "use strict";
  30967. Object.defineProperty(exports, "__esModule", ({
  30968. value: true
  30969. }));
  30970. exports["default"] = void 0;
  30971. var _validate = _interopRequireDefault(__nccwpck_require__(6900));
  30972. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  30973. function parse(uuid) {
  30974. if (!(0, _validate.default)(uuid)) {
  30975. throw TypeError('Invalid UUID');
  30976. }
  30977. let v;
  30978. const arr = new Uint8Array(16); // Parse ########-....-....-....-............
  30979. arr[0] = (v = parseInt(uuid.slice(0, 8), 16)) >>> 24;
  30980. arr[1] = v >>> 16 & 0xff;
  30981. arr[2] = v >>> 8 & 0xff;
  30982. arr[3] = v & 0xff; // Parse ........-####-....-....-............
  30983. arr[4] = (v = parseInt(uuid.slice(9, 13), 16)) >>> 8;
  30984. arr[5] = v & 0xff; // Parse ........-....-####-....-............
  30985. arr[6] = (v = parseInt(uuid.slice(14, 18), 16)) >>> 8;
  30986. arr[7] = v & 0xff; // Parse ........-....-....-####-............
  30987. arr[8] = (v = parseInt(uuid.slice(19, 23), 16)) >>> 8;
  30988. arr[9] = v & 0xff; // Parse ........-....-....-....-############
  30989. // (Use "/" to avoid 32-bit truncation when bit-shifting high-order bytes)
  30990. arr[10] = (v = parseInt(uuid.slice(24, 36), 16)) / 0x10000000000 & 0xff;
  30991. arr[11] = v / 0x100000000 & 0xff;
  30992. arr[12] = v >>> 24 & 0xff;
  30993. arr[13] = v >>> 16 & 0xff;
  30994. arr[14] = v >>> 8 & 0xff;
  30995. arr[15] = v & 0xff;
  30996. return arr;
  30997. }
  30998. var _default = parse;
  30999. exports["default"] = _default;
  31000. /***/ }),
  31001. /***/ 814:
  31002. /***/ ((__unused_webpack_module, exports) => {
  31003. "use strict";
  31004. Object.defineProperty(exports, "__esModule", ({
  31005. value: true
  31006. }));
  31007. exports["default"] = void 0;
  31008. 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;
  31009. exports["default"] = _default;
  31010. /***/ }),
  31011. /***/ 807:
  31012. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31013. "use strict";
  31014. Object.defineProperty(exports, "__esModule", ({
  31015. value: true
  31016. }));
  31017. exports["default"] = rng;
  31018. var _crypto = _interopRequireDefault(__nccwpck_require__(6113));
  31019. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31020. const rnds8Pool = new Uint8Array(256); // # of random values to pre-allocate
  31021. let poolPtr = rnds8Pool.length;
  31022. function rng() {
  31023. if (poolPtr > rnds8Pool.length - 16) {
  31024. _crypto.default.randomFillSync(rnds8Pool);
  31025. poolPtr = 0;
  31026. }
  31027. return rnds8Pool.slice(poolPtr, poolPtr += 16);
  31028. }
  31029. /***/ }),
  31030. /***/ 5274:
  31031. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31032. "use strict";
  31033. Object.defineProperty(exports, "__esModule", ({
  31034. value: true
  31035. }));
  31036. exports["default"] = void 0;
  31037. var _crypto = _interopRequireDefault(__nccwpck_require__(6113));
  31038. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31039. function sha1(bytes) {
  31040. if (Array.isArray(bytes)) {
  31041. bytes = Buffer.from(bytes);
  31042. } else if (typeof bytes === 'string') {
  31043. bytes = Buffer.from(bytes, 'utf8');
  31044. }
  31045. return _crypto.default.createHash('sha1').update(bytes).digest();
  31046. }
  31047. var _default = sha1;
  31048. exports["default"] = _default;
  31049. /***/ }),
  31050. /***/ 8950:
  31051. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31052. "use strict";
  31053. Object.defineProperty(exports, "__esModule", ({
  31054. value: true
  31055. }));
  31056. exports["default"] = void 0;
  31057. exports.unsafeStringify = unsafeStringify;
  31058. var _validate = _interopRequireDefault(__nccwpck_require__(6900));
  31059. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31060. /**
  31061. * Convert array of 16 byte values to UUID string format of the form:
  31062. * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
  31063. */
  31064. const byteToHex = [];
  31065. for (let i = 0; i < 256; ++i) {
  31066. byteToHex.push((i + 0x100).toString(16).slice(1));
  31067. }
  31068. function unsafeStringify(arr, offset = 0) {
  31069. // Note: Be careful editing this code! It's been tuned for performance
  31070. // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
  31071. 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]];
  31072. }
  31073. function stringify(arr, offset = 0) {
  31074. const uuid = unsafeStringify(arr, offset); // Consistency check for valid UUID. If this throws, it's likely due to one
  31075. // of the following:
  31076. // - One or more input array values don't map to a hex octet (leading to
  31077. // "undefined" in the uuid)
  31078. // - Invalid input values for the RFC `version` or `variant` fields
  31079. if (!(0, _validate.default)(uuid)) {
  31080. throw TypeError('Stringified UUID is invalid');
  31081. }
  31082. return uuid;
  31083. }
  31084. var _default = stringify;
  31085. exports["default"] = _default;
  31086. /***/ }),
  31087. /***/ 8628:
  31088. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31089. "use strict";
  31090. Object.defineProperty(exports, "__esModule", ({
  31091. value: true
  31092. }));
  31093. exports["default"] = void 0;
  31094. var _rng = _interopRequireDefault(__nccwpck_require__(807));
  31095. var _stringify = __nccwpck_require__(8950);
  31096. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31097. // **`v1()` - Generate time-based UUID**
  31098. //
  31099. // Inspired by https://github.com/LiosK/UUID.js
  31100. // and http://docs.python.org/library/uuid.html
  31101. let _nodeId;
  31102. let _clockseq; // Previous uuid creation time
  31103. let _lastMSecs = 0;
  31104. let _lastNSecs = 0; // See https://github.com/uuidjs/uuid for API details
  31105. function v1(options, buf, offset) {
  31106. let i = buf && offset || 0;
  31107. const b = buf || new Array(16);
  31108. options = options || {};
  31109. let node = options.node || _nodeId;
  31110. let clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq; // node and clockseq need to be initialized to random values if they're not
  31111. // specified. We do this lazily to minimize issues related to insufficient
  31112. // system entropy. See #189
  31113. if (node == null || clockseq == null) {
  31114. const seedBytes = options.random || (options.rng || _rng.default)();
  31115. if (node == null) {
  31116. // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1)
  31117. node = _nodeId = [seedBytes[0] | 0x01, seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]];
  31118. }
  31119. if (clockseq == null) {
  31120. // Per 4.2.2, randomize (14 bit) clockseq
  31121. clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff;
  31122. }
  31123. } // UUID timestamps are 100 nano-second units since the Gregorian epoch,
  31124. // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so
  31125. // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs'
  31126. // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00.
  31127. let msecs = options.msecs !== undefined ? options.msecs : Date.now(); // Per 4.2.1.2, use count of uuid's generated during the current clock
  31128. // cycle to simulate higher resolution clock
  31129. let nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1; // Time since last uuid creation (in msecs)
  31130. const dt = msecs - _lastMSecs + (nsecs - _lastNSecs) / 10000; // Per 4.2.1.2, Bump clockseq on clock regression
  31131. if (dt < 0 && options.clockseq === undefined) {
  31132. clockseq = clockseq + 1 & 0x3fff;
  31133. } // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new
  31134. // time interval
  31135. if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) {
  31136. nsecs = 0;
  31137. } // Per 4.2.1.2 Throw error if too many uuids are requested
  31138. if (nsecs >= 10000) {
  31139. throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");
  31140. }
  31141. _lastMSecs = msecs;
  31142. _lastNSecs = nsecs;
  31143. _clockseq = clockseq; // Per 4.1.4 - Convert from unix epoch to Gregorian epoch
  31144. msecs += 12219292800000; // `time_low`
  31145. const tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000;
  31146. b[i++] = tl >>> 24 & 0xff;
  31147. b[i++] = tl >>> 16 & 0xff;
  31148. b[i++] = tl >>> 8 & 0xff;
  31149. b[i++] = tl & 0xff; // `time_mid`
  31150. const tmh = msecs / 0x100000000 * 10000 & 0xfffffff;
  31151. b[i++] = tmh >>> 8 & 0xff;
  31152. b[i++] = tmh & 0xff; // `time_high_and_version`
  31153. b[i++] = tmh >>> 24 & 0xf | 0x10; // include version
  31154. b[i++] = tmh >>> 16 & 0xff; // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant)
  31155. b[i++] = clockseq >>> 8 | 0x80; // `clock_seq_low`
  31156. b[i++] = clockseq & 0xff; // `node`
  31157. for (let n = 0; n < 6; ++n) {
  31158. b[i + n] = node[n];
  31159. }
  31160. return buf || (0, _stringify.unsafeStringify)(b);
  31161. }
  31162. var _default = v1;
  31163. exports["default"] = _default;
  31164. /***/ }),
  31165. /***/ 6409:
  31166. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31167. "use strict";
  31168. Object.defineProperty(exports, "__esModule", ({
  31169. value: true
  31170. }));
  31171. exports["default"] = void 0;
  31172. var _v = _interopRequireDefault(__nccwpck_require__(5998));
  31173. var _md = _interopRequireDefault(__nccwpck_require__(4569));
  31174. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31175. const v3 = (0, _v.default)('v3', 0x30, _md.default);
  31176. var _default = v3;
  31177. exports["default"] = _default;
  31178. /***/ }),
  31179. /***/ 5998:
  31180. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31181. "use strict";
  31182. Object.defineProperty(exports, "__esModule", ({
  31183. value: true
  31184. }));
  31185. exports.URL = exports.DNS = void 0;
  31186. exports["default"] = v35;
  31187. var _stringify = __nccwpck_require__(8950);
  31188. var _parse = _interopRequireDefault(__nccwpck_require__(2746));
  31189. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31190. function stringToBytes(str) {
  31191. str = unescape(encodeURIComponent(str)); // UTF8 escape
  31192. const bytes = [];
  31193. for (let i = 0; i < str.length; ++i) {
  31194. bytes.push(str.charCodeAt(i));
  31195. }
  31196. return bytes;
  31197. }
  31198. const DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8';
  31199. exports.DNS = DNS;
  31200. const URL = '6ba7b811-9dad-11d1-80b4-00c04fd430c8';
  31201. exports.URL = URL;
  31202. function v35(name, version, hashfunc) {
  31203. function generateUUID(value, namespace, buf, offset) {
  31204. var _namespace;
  31205. if (typeof value === 'string') {
  31206. value = stringToBytes(value);
  31207. }
  31208. if (typeof namespace === 'string') {
  31209. namespace = (0, _parse.default)(namespace);
  31210. }
  31211. if (((_namespace = namespace) === null || _namespace === void 0 ? void 0 : _namespace.length) !== 16) {
  31212. throw TypeError('Namespace must be array-like (16 iterable integer values, 0-255)');
  31213. } // Compute hash of namespace and value, Per 4.3
  31214. // Future: Use spread syntax when supported on all platforms, e.g. `bytes =
  31215. // hashfunc([...namespace, ... value])`
  31216. let bytes = new Uint8Array(16 + value.length);
  31217. bytes.set(namespace);
  31218. bytes.set(value, namespace.length);
  31219. bytes = hashfunc(bytes);
  31220. bytes[6] = bytes[6] & 0x0f | version;
  31221. bytes[8] = bytes[8] & 0x3f | 0x80;
  31222. if (buf) {
  31223. offset = offset || 0;
  31224. for (let i = 0; i < 16; ++i) {
  31225. buf[offset + i] = bytes[i];
  31226. }
  31227. return buf;
  31228. }
  31229. return (0, _stringify.unsafeStringify)(bytes);
  31230. } // Function#name is not settable on some platforms (#270)
  31231. try {
  31232. generateUUID.name = name; // eslint-disable-next-line no-empty
  31233. } catch (err) {} // For CommonJS default export support
  31234. generateUUID.DNS = DNS;
  31235. generateUUID.URL = URL;
  31236. return generateUUID;
  31237. }
  31238. /***/ }),
  31239. /***/ 5122:
  31240. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31241. "use strict";
  31242. Object.defineProperty(exports, "__esModule", ({
  31243. value: true
  31244. }));
  31245. exports["default"] = void 0;
  31246. var _native = _interopRequireDefault(__nccwpck_require__(2054));
  31247. var _rng = _interopRequireDefault(__nccwpck_require__(807));
  31248. var _stringify = __nccwpck_require__(8950);
  31249. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31250. function v4(options, buf, offset) {
  31251. if (_native.default.randomUUID && !buf && !options) {
  31252. return _native.default.randomUUID();
  31253. }
  31254. options = options || {};
  31255. const rnds = options.random || (options.rng || _rng.default)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
  31256. rnds[6] = rnds[6] & 0x0f | 0x40;
  31257. rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided
  31258. if (buf) {
  31259. offset = offset || 0;
  31260. for (let i = 0; i < 16; ++i) {
  31261. buf[offset + i] = rnds[i];
  31262. }
  31263. return buf;
  31264. }
  31265. return (0, _stringify.unsafeStringify)(rnds);
  31266. }
  31267. var _default = v4;
  31268. exports["default"] = _default;
  31269. /***/ }),
  31270. /***/ 9120:
  31271. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31272. "use strict";
  31273. Object.defineProperty(exports, "__esModule", ({
  31274. value: true
  31275. }));
  31276. exports["default"] = void 0;
  31277. var _v = _interopRequireDefault(__nccwpck_require__(5998));
  31278. var _sha = _interopRequireDefault(__nccwpck_require__(5274));
  31279. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31280. const v5 = (0, _v.default)('v5', 0x50, _sha.default);
  31281. var _default = v5;
  31282. exports["default"] = _default;
  31283. /***/ }),
  31284. /***/ 6900:
  31285. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31286. "use strict";
  31287. Object.defineProperty(exports, "__esModule", ({
  31288. value: true
  31289. }));
  31290. exports["default"] = void 0;
  31291. var _regex = _interopRequireDefault(__nccwpck_require__(814));
  31292. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31293. function validate(uuid) {
  31294. return typeof uuid === 'string' && _regex.default.test(uuid);
  31295. }
  31296. var _default = validate;
  31297. exports["default"] = _default;
  31298. /***/ }),
  31299. /***/ 2414:
  31300. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31301. "use strict";
  31302. Object.defineProperty(exports, "__esModule", ({
  31303. value: true
  31304. }));
  31305. exports["default"] = void 0;
  31306. var _validate = _interopRequireDefault(__nccwpck_require__(6900));
  31307. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31308. function version(uuid) {
  31309. if (!(0, _validate.default)(uuid)) {
  31310. throw TypeError('Invalid UUID');
  31311. }
  31312. return parseInt(uuid.slice(14, 15), 16);
  31313. }
  31314. var _default = version;
  31315. exports["default"] = _default;
  31316. /***/ }),
  31317. /***/ 2940:
  31318. /***/ ((module) => {
  31319. // Returns a wrapper function that returns a wrapped callback
  31320. // The wrapper function should do some stuff, and return a
  31321. // presumably different callback function.
  31322. // This makes sure that own properties are retained, so that
  31323. // decorations and such are not lost along the way.
  31324. module.exports = wrappy
  31325. function wrappy (fn, cb) {
  31326. if (fn && cb) return wrappy(fn)(cb)
  31327. if (typeof fn !== 'function')
  31328. throw new TypeError('need wrapper function')
  31329. Object.keys(fn).forEach(function (k) {
  31330. wrapper[k] = fn[k]
  31331. })
  31332. return wrapper
  31333. function wrapper() {
  31334. var args = new Array(arguments.length)
  31335. for (var i = 0; i < args.length; i++) {
  31336. args[i] = arguments[i]
  31337. }
  31338. var ret = fn.apply(this, args)
  31339. var cb = args[args.length-1]
  31340. if (typeof ret === 'function' && ret !== cb) {
  31341. Object.keys(cb).forEach(function (k) {
  31342. ret[k] = cb[k]
  31343. })
  31344. }
  31345. return ret
  31346. }
  31347. }
  31348. /***/ }),
  31349. /***/ 9491:
  31350. /***/ ((module) => {
  31351. "use strict";
  31352. module.exports = require("assert");
  31353. /***/ }),
  31354. /***/ 852:
  31355. /***/ ((module) => {
  31356. "use strict";
  31357. module.exports = require("async_hooks");
  31358. /***/ }),
  31359. /***/ 4300:
  31360. /***/ ((module) => {
  31361. "use strict";
  31362. module.exports = require("buffer");
  31363. /***/ }),
  31364. /***/ 2081:
  31365. /***/ ((module) => {
  31366. "use strict";
  31367. module.exports = require("child_process");
  31368. /***/ }),
  31369. /***/ 6206:
  31370. /***/ ((module) => {
  31371. "use strict";
  31372. module.exports = require("console");
  31373. /***/ }),
  31374. /***/ 6113:
  31375. /***/ ((module) => {
  31376. "use strict";
  31377. module.exports = require("crypto");
  31378. /***/ }),
  31379. /***/ 7643:
  31380. /***/ ((module) => {
  31381. "use strict";
  31382. module.exports = require("diagnostics_channel");
  31383. /***/ }),
  31384. /***/ 2361:
  31385. /***/ ((module) => {
  31386. "use strict";
  31387. module.exports = require("events");
  31388. /***/ }),
  31389. /***/ 7147:
  31390. /***/ ((module) => {
  31391. "use strict";
  31392. module.exports = require("fs");
  31393. /***/ }),
  31394. /***/ 3685:
  31395. /***/ ((module) => {
  31396. "use strict";
  31397. module.exports = require("http");
  31398. /***/ }),
  31399. /***/ 5158:
  31400. /***/ ((module) => {
  31401. "use strict";
  31402. module.exports = require("http2");
  31403. /***/ }),
  31404. /***/ 5687:
  31405. /***/ ((module) => {
  31406. "use strict";
  31407. module.exports = require("https");
  31408. /***/ }),
  31409. /***/ 1808:
  31410. /***/ ((module) => {
  31411. "use strict";
  31412. module.exports = require("net");
  31413. /***/ }),
  31414. /***/ 5673:
  31415. /***/ ((module) => {
  31416. "use strict";
  31417. module.exports = require("node:events");
  31418. /***/ }),
  31419. /***/ 4492:
  31420. /***/ ((module) => {
  31421. "use strict";
  31422. module.exports = require("node:stream");
  31423. /***/ }),
  31424. /***/ 7261:
  31425. /***/ ((module) => {
  31426. "use strict";
  31427. module.exports = require("node:util");
  31428. /***/ }),
  31429. /***/ 2037:
  31430. /***/ ((module) => {
  31431. "use strict";
  31432. module.exports = require("os");
  31433. /***/ }),
  31434. /***/ 1017:
  31435. /***/ ((module) => {
  31436. "use strict";
  31437. module.exports = require("path");
  31438. /***/ }),
  31439. /***/ 4074:
  31440. /***/ ((module) => {
  31441. "use strict";
  31442. module.exports = require("perf_hooks");
  31443. /***/ }),
  31444. /***/ 3477:
  31445. /***/ ((module) => {
  31446. "use strict";
  31447. module.exports = require("querystring");
  31448. /***/ }),
  31449. /***/ 2781:
  31450. /***/ ((module) => {
  31451. "use strict";
  31452. module.exports = require("stream");
  31453. /***/ }),
  31454. /***/ 5356:
  31455. /***/ ((module) => {
  31456. "use strict";
  31457. module.exports = require("stream/web");
  31458. /***/ }),
  31459. /***/ 1576:
  31460. /***/ ((module) => {
  31461. "use strict";
  31462. module.exports = require("string_decoder");
  31463. /***/ }),
  31464. /***/ 9512:
  31465. /***/ ((module) => {
  31466. "use strict";
  31467. module.exports = require("timers");
  31468. /***/ }),
  31469. /***/ 4404:
  31470. /***/ ((module) => {
  31471. "use strict";
  31472. module.exports = require("tls");
  31473. /***/ }),
  31474. /***/ 7310:
  31475. /***/ ((module) => {
  31476. "use strict";
  31477. module.exports = require("url");
  31478. /***/ }),
  31479. /***/ 3837:
  31480. /***/ ((module) => {
  31481. "use strict";
  31482. module.exports = require("util");
  31483. /***/ }),
  31484. /***/ 9830:
  31485. /***/ ((module) => {
  31486. "use strict";
  31487. module.exports = require("util/types");
  31488. /***/ }),
  31489. /***/ 1267:
  31490. /***/ ((module) => {
  31491. "use strict";
  31492. module.exports = require("worker_threads");
  31493. /***/ }),
  31494. /***/ 9796:
  31495. /***/ ((module) => {
  31496. "use strict";
  31497. module.exports = require("zlib");
  31498. /***/ }),
  31499. /***/ 2960:
  31500. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  31501. "use strict";
  31502. const WritableStream = (__nccwpck_require__(4492).Writable)
  31503. const inherits = (__nccwpck_require__(7261).inherits)
  31504. const StreamSearch = __nccwpck_require__(1142)
  31505. const PartStream = __nccwpck_require__(1620)
  31506. const HeaderParser = __nccwpck_require__(2032)
  31507. const DASH = 45
  31508. const B_ONEDASH = Buffer.from('-')
  31509. const B_CRLF = Buffer.from('\r\n')
  31510. const EMPTY_FN = function () {}
  31511. function Dicer (cfg) {
  31512. if (!(this instanceof Dicer)) { return new Dicer(cfg) }
  31513. WritableStream.call(this, cfg)
  31514. if (!cfg || (!cfg.headerFirst && typeof cfg.boundary !== 'string')) { throw new TypeError('Boundary required') }
  31515. if (typeof cfg.boundary === 'string') { this.setBoundary(cfg.boundary) } else { this._bparser = undefined }
  31516. this._headerFirst = cfg.headerFirst
  31517. this._dashes = 0
  31518. this._parts = 0
  31519. this._finished = false
  31520. this._realFinish = false
  31521. this._isPreamble = true
  31522. this._justMatched = false
  31523. this._firstWrite = true
  31524. this._inHeader = true
  31525. this._part = undefined
  31526. this._cb = undefined
  31527. this._ignoreData = false
  31528. this._partOpts = { highWaterMark: cfg.partHwm }
  31529. this._pause = false
  31530. const self = this
  31531. this._hparser = new HeaderParser(cfg)
  31532. this._hparser.on('header', function (header) {
  31533. self._inHeader = false
  31534. self._part.emit('header', header)
  31535. })
  31536. }
  31537. inherits(Dicer, WritableStream)
  31538. Dicer.prototype.emit = function (ev) {
  31539. if (ev === 'finish' && !this._realFinish) {
  31540. if (!this._finished) {
  31541. const self = this
  31542. process.nextTick(function () {
  31543. self.emit('error', new Error('Unexpected end of multipart data'))
  31544. if (self._part && !self._ignoreData) {
  31545. const type = (self._isPreamble ? 'Preamble' : 'Part')
  31546. self._part.emit('error', new Error(type + ' terminated early due to unexpected end of multipart data'))
  31547. self._part.push(null)
  31548. process.nextTick(function () {
  31549. self._realFinish = true
  31550. self.emit('finish')
  31551. self._realFinish = false
  31552. })
  31553. return
  31554. }
  31555. self._realFinish = true
  31556. self.emit('finish')
  31557. self._realFinish = false
  31558. })
  31559. }
  31560. } else { WritableStream.prototype.emit.apply(this, arguments) }
  31561. }
  31562. Dicer.prototype._write = function (data, encoding, cb) {
  31563. // ignore unexpected data (e.g. extra trailer data after finished)
  31564. if (!this._hparser && !this._bparser) { return cb() }
  31565. if (this._headerFirst && this._isPreamble) {
  31566. if (!this._part) {
  31567. this._part = new PartStream(this._partOpts)
  31568. if (this.listenerCount('preamble') !== 0) { this.emit('preamble', this._part) } else { this._ignore() }
  31569. }
  31570. const r = this._hparser.push(data)
  31571. if (!this._inHeader && r !== undefined && r < data.length) { data = data.slice(r) } else { return cb() }
  31572. }
  31573. // allows for "easier" testing
  31574. if (this._firstWrite) {
  31575. this._bparser.push(B_CRLF)
  31576. this._firstWrite = false
  31577. }
  31578. this._bparser.push(data)
  31579. if (this._pause) { this._cb = cb } else { cb() }
  31580. }
  31581. Dicer.prototype.reset = function () {
  31582. this._part = undefined
  31583. this._bparser = undefined
  31584. this._hparser = undefined
  31585. }
  31586. Dicer.prototype.setBoundary = function (boundary) {
  31587. const self = this
  31588. this._bparser = new StreamSearch('\r\n--' + boundary)
  31589. this._bparser.on('info', function (isMatch, data, start, end) {
  31590. self._oninfo(isMatch, data, start, end)
  31591. })
  31592. }
  31593. Dicer.prototype._ignore = function () {
  31594. if (this._part && !this._ignoreData) {
  31595. this._ignoreData = true
  31596. this._part.on('error', EMPTY_FN)
  31597. // we must perform some kind of read on the stream even though we are
  31598. // ignoring the data, otherwise node's Readable stream will not emit 'end'
  31599. // after pushing null to the stream
  31600. this._part.resume()
  31601. }
  31602. }
  31603. Dicer.prototype._oninfo = function (isMatch, data, start, end) {
  31604. let buf; const self = this; let i = 0; let r; let shouldWriteMore = true
  31605. if (!this._part && this._justMatched && data) {
  31606. while (this._dashes < 2 && (start + i) < end) {
  31607. if (data[start + i] === DASH) {
  31608. ++i
  31609. ++this._dashes
  31610. } else {
  31611. if (this._dashes) { buf = B_ONEDASH }
  31612. this._dashes = 0
  31613. break
  31614. }
  31615. }
  31616. if (this._dashes === 2) {
  31617. if ((start + i) < end && this.listenerCount('trailer') !== 0) { this.emit('trailer', data.slice(start + i, end)) }
  31618. this.reset()
  31619. this._finished = true
  31620. // no more parts will be added
  31621. if (self._parts === 0) {
  31622. self._realFinish = true
  31623. self.emit('finish')
  31624. self._realFinish = false
  31625. }
  31626. }
  31627. if (this._dashes) { return }
  31628. }
  31629. if (this._justMatched) { this._justMatched = false }
  31630. if (!this._part) {
  31631. this._part = new PartStream(this._partOpts)
  31632. this._part._read = function (n) {
  31633. self._unpause()
  31634. }
  31635. if (this._isPreamble && this.listenerCount('preamble') !== 0) {
  31636. this.emit('preamble', this._part)
  31637. } else if (this._isPreamble !== true && this.listenerCount('part') !== 0) {
  31638. this.emit('part', this._part)
  31639. } else {
  31640. this._ignore()
  31641. }
  31642. if (!this._isPreamble) { this._inHeader = true }
  31643. }
  31644. if (data && start < end && !this._ignoreData) {
  31645. if (this._isPreamble || !this._inHeader) {
  31646. if (buf) { shouldWriteMore = this._part.push(buf) }
  31647. shouldWriteMore = this._part.push(data.slice(start, end))
  31648. if (!shouldWriteMore) { this._pause = true }
  31649. } else if (!this._isPreamble && this._inHeader) {
  31650. if (buf) { this._hparser.push(buf) }
  31651. r = this._hparser.push(data.slice(start, end))
  31652. if (!this._inHeader && r !== undefined && r < end) { this._oninfo(false, data, start + r, end) }
  31653. }
  31654. }
  31655. if (isMatch) {
  31656. this._hparser.reset()
  31657. if (this._isPreamble) { this._isPreamble = false } else {
  31658. if (start !== end) {
  31659. ++this._parts
  31660. this._part.on('end', function () {
  31661. if (--self._parts === 0) {
  31662. if (self._finished) {
  31663. self._realFinish = true
  31664. self.emit('finish')
  31665. self._realFinish = false
  31666. } else {
  31667. self._unpause()
  31668. }
  31669. }
  31670. })
  31671. }
  31672. }
  31673. this._part.push(null)
  31674. this._part = undefined
  31675. this._ignoreData = false
  31676. this._justMatched = true
  31677. this._dashes = 0
  31678. }
  31679. }
  31680. Dicer.prototype._unpause = function () {
  31681. if (!this._pause) { return }
  31682. this._pause = false
  31683. if (this._cb) {
  31684. const cb = this._cb
  31685. this._cb = undefined
  31686. cb()
  31687. }
  31688. }
  31689. module.exports = Dicer
  31690. /***/ }),
  31691. /***/ 2032:
  31692. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  31693. "use strict";
  31694. const EventEmitter = (__nccwpck_require__(5673).EventEmitter)
  31695. const inherits = (__nccwpck_require__(7261).inherits)
  31696. const getLimit = __nccwpck_require__(1467)
  31697. const StreamSearch = __nccwpck_require__(1142)
  31698. const B_DCRLF = Buffer.from('\r\n\r\n')
  31699. const RE_CRLF = /\r\n/g
  31700. const RE_HDR = /^([^:]+):[ \t]?([\x00-\xFF]+)?$/ // eslint-disable-line no-control-regex
  31701. function HeaderParser (cfg) {
  31702. EventEmitter.call(this)
  31703. cfg = cfg || {}
  31704. const self = this
  31705. this.nread = 0
  31706. this.maxed = false
  31707. this.npairs = 0
  31708. this.maxHeaderPairs = getLimit(cfg, 'maxHeaderPairs', 2000)
  31709. this.maxHeaderSize = getLimit(cfg, 'maxHeaderSize', 80 * 1024)
  31710. this.buffer = ''
  31711. this.header = {}
  31712. this.finished = false
  31713. this.ss = new StreamSearch(B_DCRLF)
  31714. this.ss.on('info', function (isMatch, data, start, end) {
  31715. if (data && !self.maxed) {
  31716. if (self.nread + end - start >= self.maxHeaderSize) {
  31717. end = self.maxHeaderSize - self.nread + start
  31718. self.nread = self.maxHeaderSize
  31719. self.maxed = true
  31720. } else { self.nread += (end - start) }
  31721. self.buffer += data.toString('binary', start, end)
  31722. }
  31723. if (isMatch) { self._finish() }
  31724. })
  31725. }
  31726. inherits(HeaderParser, EventEmitter)
  31727. HeaderParser.prototype.push = function (data) {
  31728. const r = this.ss.push(data)
  31729. if (this.finished) { return r }
  31730. }
  31731. HeaderParser.prototype.reset = function () {
  31732. this.finished = false
  31733. this.buffer = ''
  31734. this.header = {}
  31735. this.ss.reset()
  31736. }
  31737. HeaderParser.prototype._finish = function () {
  31738. if (this.buffer) { this._parseHeader() }
  31739. this.ss.matches = this.ss.maxMatches
  31740. const header = this.header
  31741. this.header = {}
  31742. this.buffer = ''
  31743. this.finished = true
  31744. this.nread = this.npairs = 0
  31745. this.maxed = false
  31746. this.emit('header', header)
  31747. }
  31748. HeaderParser.prototype._parseHeader = function () {
  31749. if (this.npairs === this.maxHeaderPairs) { return }
  31750. const lines = this.buffer.split(RE_CRLF)
  31751. const len = lines.length
  31752. let m, h
  31753. for (var i = 0; i < len; ++i) { // eslint-disable-line no-var
  31754. if (lines[i].length === 0) { continue }
  31755. if (lines[i][0] === '\t' || lines[i][0] === ' ') {
  31756. // folded header content
  31757. // RFC2822 says to just remove the CRLF and not the whitespace following
  31758. // it, so we follow the RFC and include the leading whitespace ...
  31759. if (h) {
  31760. this.header[h][this.header[h].length - 1] += lines[i]
  31761. continue
  31762. }
  31763. }
  31764. const posColon = lines[i].indexOf(':')
  31765. if (
  31766. posColon === -1 ||
  31767. posColon === 0
  31768. ) {
  31769. return
  31770. }
  31771. m = RE_HDR.exec(lines[i])
  31772. h = m[1].toLowerCase()
  31773. this.header[h] = this.header[h] || []
  31774. this.header[h].push((m[2] || ''))
  31775. if (++this.npairs === this.maxHeaderPairs) { break }
  31776. }
  31777. }
  31778. module.exports = HeaderParser
  31779. /***/ }),
  31780. /***/ 1620:
  31781. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  31782. "use strict";
  31783. const inherits = (__nccwpck_require__(7261).inherits)
  31784. const ReadableStream = (__nccwpck_require__(4492).Readable)
  31785. function PartStream (opts) {
  31786. ReadableStream.call(this, opts)
  31787. }
  31788. inherits(PartStream, ReadableStream)
  31789. PartStream.prototype._read = function (n) {}
  31790. module.exports = PartStream
  31791. /***/ }),
  31792. /***/ 1142:
  31793. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  31794. "use strict";
  31795. /**
  31796. * Copyright Brian White. All rights reserved.
  31797. *
  31798. * @see https://github.com/mscdex/streamsearch
  31799. *
  31800. * Permission is hereby granted, free of charge, to any person obtaining a copy
  31801. * of this software and associated documentation files (the "Software"), to
  31802. * deal in the Software without restriction, including without limitation the
  31803. * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
  31804. * sell copies of the Software, and to permit persons to whom the Software is
  31805. * furnished to do so, subject to the following conditions:
  31806. *
  31807. * The above copyright notice and this permission notice shall be included in
  31808. * all copies or substantial portions of the Software.
  31809. *
  31810. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  31811. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  31812. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  31813. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  31814. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  31815. * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
  31816. * IN THE SOFTWARE.
  31817. *
  31818. * Based heavily on the Streaming Boyer-Moore-Horspool C++ implementation
  31819. * by Hongli Lai at: https://github.com/FooBarWidget/boyer-moore-horspool
  31820. */
  31821. const EventEmitter = (__nccwpck_require__(5673).EventEmitter)
  31822. const inherits = (__nccwpck_require__(7261).inherits)
  31823. function SBMH (needle) {
  31824. if (typeof needle === 'string') {
  31825. needle = Buffer.from(needle)
  31826. }
  31827. if (!Buffer.isBuffer(needle)) {
  31828. throw new TypeError('The needle has to be a String or a Buffer.')
  31829. }
  31830. const needleLength = needle.length
  31831. if (needleLength === 0) {
  31832. throw new Error('The needle cannot be an empty String/Buffer.')
  31833. }
  31834. if (needleLength > 256) {
  31835. throw new Error('The needle cannot have a length bigger than 256.')
  31836. }
  31837. this.maxMatches = Infinity
  31838. this.matches = 0
  31839. this._occ = new Array(256)
  31840. .fill(needleLength) // Initialize occurrence table.
  31841. this._lookbehind_size = 0
  31842. this._needle = needle
  31843. this._bufpos = 0
  31844. this._lookbehind = Buffer.alloc(needleLength)
  31845. // Populate occurrence table with analysis of the needle,
  31846. // ignoring last letter.
  31847. for (var i = 0; i < needleLength - 1; ++i) { // eslint-disable-line no-var
  31848. this._occ[needle[i]] = needleLength - 1 - i
  31849. }
  31850. }
  31851. inherits(SBMH, EventEmitter)
  31852. SBMH.prototype.reset = function () {
  31853. this._lookbehind_size = 0
  31854. this.matches = 0
  31855. this._bufpos = 0
  31856. }
  31857. SBMH.prototype.push = function (chunk, pos) {
  31858. if (!Buffer.isBuffer(chunk)) {
  31859. chunk = Buffer.from(chunk, 'binary')
  31860. }
  31861. const chlen = chunk.length
  31862. this._bufpos = pos || 0
  31863. let r
  31864. while (r !== chlen && this.matches < this.maxMatches) { r = this._sbmh_feed(chunk) }
  31865. return r
  31866. }
  31867. SBMH.prototype._sbmh_feed = function (data) {
  31868. const len = data.length
  31869. const needle = this._needle
  31870. const needleLength = needle.length
  31871. const lastNeedleChar = needle[needleLength - 1]
  31872. // Positive: points to a position in `data`
  31873. // pos == 3 points to data[3]
  31874. // Negative: points to a position in the lookbehind buffer
  31875. // pos == -2 points to lookbehind[lookbehind_size - 2]
  31876. let pos = -this._lookbehind_size
  31877. let ch
  31878. if (pos < 0) {
  31879. // Lookbehind buffer is not empty. Perform Boyer-Moore-Horspool
  31880. // search with character lookup code that considers both the
  31881. // lookbehind buffer and the current round's haystack data.
  31882. //
  31883. // Loop until
  31884. // there is a match.
  31885. // or until
  31886. // we've moved past the position that requires the
  31887. // lookbehind buffer. In this case we switch to the
  31888. // optimized loop.
  31889. // or until
  31890. // the character to look at lies outside the haystack.
  31891. while (pos < 0 && pos <= len - needleLength) {
  31892. ch = this._sbmh_lookup_char(data, pos + needleLength - 1)
  31893. if (
  31894. ch === lastNeedleChar &&
  31895. this._sbmh_memcmp(data, pos, needleLength - 1)
  31896. ) {
  31897. this._lookbehind_size = 0
  31898. ++this.matches
  31899. this.emit('info', true)
  31900. return (this._bufpos = pos + needleLength)
  31901. }
  31902. pos += this._occ[ch]
  31903. }
  31904. // No match.
  31905. if (pos < 0) {
  31906. // There's too few data for Boyer-Moore-Horspool to run,
  31907. // so let's use a different algorithm to skip as much as
  31908. // we can.
  31909. // Forward pos until
  31910. // the trailing part of lookbehind + data
  31911. // looks like the beginning of the needle
  31912. // or until
  31913. // pos == 0
  31914. while (pos < 0 && !this._sbmh_memcmp(data, pos, len - pos)) { ++pos }
  31915. }
  31916. if (pos >= 0) {
  31917. // Discard lookbehind buffer.
  31918. this.emit('info', false, this._lookbehind, 0, this._lookbehind_size)
  31919. this._lookbehind_size = 0
  31920. } else {
  31921. // Cut off part of the lookbehind buffer that has
  31922. // been processed and append the entire haystack
  31923. // into it.
  31924. const bytesToCutOff = this._lookbehind_size + pos
  31925. if (bytesToCutOff > 0) {
  31926. // The cut off data is guaranteed not to contain the needle.
  31927. this.emit('info', false, this._lookbehind, 0, bytesToCutOff)
  31928. }
  31929. this._lookbehind.copy(this._lookbehind, 0, bytesToCutOff,
  31930. this._lookbehind_size - bytesToCutOff)
  31931. this._lookbehind_size -= bytesToCutOff
  31932. data.copy(this._lookbehind, this._lookbehind_size)
  31933. this._lookbehind_size += len
  31934. this._bufpos = len
  31935. return len
  31936. }
  31937. }
  31938. pos += (pos >= 0) * this._bufpos
  31939. // Lookbehind buffer is now empty. We only need to check if the
  31940. // needle is in the haystack.
  31941. if (data.indexOf(needle, pos) !== -1) {
  31942. pos = data.indexOf(needle, pos)
  31943. ++this.matches
  31944. if (pos > 0) { this.emit('info', true, data, this._bufpos, pos) } else { this.emit('info', true) }
  31945. return (this._bufpos = pos + needleLength)
  31946. } else {
  31947. pos = len - needleLength
  31948. }
  31949. // There was no match. If there's trailing haystack data that we cannot
  31950. // match yet using the Boyer-Moore-Horspool algorithm (because the trailing
  31951. // data is less than the needle size) then match using a modified
  31952. // algorithm that starts matching from the beginning instead of the end.
  31953. // Whatever trailing data is left after running this algorithm is added to
  31954. // the lookbehind buffer.
  31955. while (
  31956. pos < len &&
  31957. (
  31958. data[pos] !== needle[0] ||
  31959. (
  31960. (Buffer.compare(
  31961. data.subarray(pos, pos + len - pos),
  31962. needle.subarray(0, len - pos)
  31963. ) !== 0)
  31964. )
  31965. )
  31966. ) {
  31967. ++pos
  31968. }
  31969. if (pos < len) {
  31970. data.copy(this._lookbehind, 0, pos, pos + (len - pos))
  31971. this._lookbehind_size = len - pos
  31972. }
  31973. // Everything until pos is guaranteed not to contain needle data.
  31974. if (pos > 0) { this.emit('info', false, data, this._bufpos, pos < len ? pos : len) }
  31975. this._bufpos = len
  31976. return len
  31977. }
  31978. SBMH.prototype._sbmh_lookup_char = function (data, pos) {
  31979. return (pos < 0)
  31980. ? this._lookbehind[this._lookbehind_size + pos]
  31981. : data[pos]
  31982. }
  31983. SBMH.prototype._sbmh_memcmp = function (data, pos, len) {
  31984. for (var i = 0; i < len; ++i) { // eslint-disable-line no-var
  31985. if (this._sbmh_lookup_char(data, pos + i) !== this._needle[i]) { return false }
  31986. }
  31987. return true
  31988. }
  31989. module.exports = SBMH
  31990. /***/ }),
  31991. /***/ 727:
  31992. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  31993. "use strict";
  31994. const WritableStream = (__nccwpck_require__(4492).Writable)
  31995. const { inherits } = __nccwpck_require__(7261)
  31996. const Dicer = __nccwpck_require__(2960)
  31997. const MultipartParser = __nccwpck_require__(2183)
  31998. const UrlencodedParser = __nccwpck_require__(8306)
  31999. const parseParams = __nccwpck_require__(1854)
  32000. function Busboy (opts) {
  32001. if (!(this instanceof Busboy)) { return new Busboy(opts) }
  32002. if (typeof opts !== 'object') {
  32003. throw new TypeError('Busboy expected an options-Object.')
  32004. }
  32005. if (typeof opts.headers !== 'object') {
  32006. throw new TypeError('Busboy expected an options-Object with headers-attribute.')
  32007. }
  32008. if (typeof opts.headers['content-type'] !== 'string') {
  32009. throw new TypeError('Missing Content-Type-header.')
  32010. }
  32011. const {
  32012. headers,
  32013. ...streamOptions
  32014. } = opts
  32015. this.opts = {
  32016. autoDestroy: false,
  32017. ...streamOptions
  32018. }
  32019. WritableStream.call(this, this.opts)
  32020. this._done = false
  32021. this._parser = this.getParserByHeaders(headers)
  32022. this._finished = false
  32023. }
  32024. inherits(Busboy, WritableStream)
  32025. Busboy.prototype.emit = function (ev) {
  32026. if (ev === 'finish') {
  32027. if (!this._done) {
  32028. this._parser?.end()
  32029. return
  32030. } else if (this._finished) {
  32031. return
  32032. }
  32033. this._finished = true
  32034. }
  32035. WritableStream.prototype.emit.apply(this, arguments)
  32036. }
  32037. Busboy.prototype.getParserByHeaders = function (headers) {
  32038. const parsed = parseParams(headers['content-type'])
  32039. const cfg = {
  32040. defCharset: this.opts.defCharset,
  32041. fileHwm: this.opts.fileHwm,
  32042. headers,
  32043. highWaterMark: this.opts.highWaterMark,
  32044. isPartAFile: this.opts.isPartAFile,
  32045. limits: this.opts.limits,
  32046. parsedConType: parsed,
  32047. preservePath: this.opts.preservePath
  32048. }
  32049. if (MultipartParser.detect.test(parsed[0])) {
  32050. return new MultipartParser(this, cfg)
  32051. }
  32052. if (UrlencodedParser.detect.test(parsed[0])) {
  32053. return new UrlencodedParser(this, cfg)
  32054. }
  32055. throw new Error('Unsupported Content-Type.')
  32056. }
  32057. Busboy.prototype._write = function (chunk, encoding, cb) {
  32058. this._parser.write(chunk, cb)
  32059. }
  32060. module.exports = Busboy
  32061. module.exports["default"] = Busboy
  32062. module.exports.Busboy = Busboy
  32063. module.exports.Dicer = Dicer
  32064. /***/ }),
  32065. /***/ 2183:
  32066. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  32067. "use strict";
  32068. // TODO:
  32069. // * support 1 nested multipart level
  32070. // (see second multipart example here:
  32071. // http://www.w3.org/TR/html401/interact/forms.html#didx-multipartform-data)
  32072. // * support limits.fieldNameSize
  32073. // -- this will require modifications to utils.parseParams
  32074. const { Readable } = __nccwpck_require__(4492)
  32075. const { inherits } = __nccwpck_require__(7261)
  32076. const Dicer = __nccwpck_require__(2960)
  32077. const parseParams = __nccwpck_require__(1854)
  32078. const decodeText = __nccwpck_require__(4619)
  32079. const basename = __nccwpck_require__(8647)
  32080. const getLimit = __nccwpck_require__(1467)
  32081. const RE_BOUNDARY = /^boundary$/i
  32082. const RE_FIELD = /^form-data$/i
  32083. const RE_CHARSET = /^charset$/i
  32084. const RE_FILENAME = /^filename$/i
  32085. const RE_NAME = /^name$/i
  32086. Multipart.detect = /^multipart\/form-data/i
  32087. function Multipart (boy, cfg) {
  32088. let i
  32089. let len
  32090. const self = this
  32091. let boundary
  32092. const limits = cfg.limits
  32093. const isPartAFile = cfg.isPartAFile || ((fieldName, contentType, fileName) => (contentType === 'application/octet-stream' || fileName !== undefined))
  32094. const parsedConType = cfg.parsedConType || []
  32095. const defCharset = cfg.defCharset || 'utf8'
  32096. const preservePath = cfg.preservePath
  32097. const fileOpts = { highWaterMark: cfg.fileHwm }
  32098. for (i = 0, len = parsedConType.length; i < len; ++i) {
  32099. if (Array.isArray(parsedConType[i]) &&
  32100. RE_BOUNDARY.test(parsedConType[i][0])) {
  32101. boundary = parsedConType[i][1]
  32102. break
  32103. }
  32104. }
  32105. function checkFinished () {
  32106. if (nends === 0 && finished && !boy._done) {
  32107. finished = false
  32108. self.end()
  32109. }
  32110. }
  32111. if (typeof boundary !== 'string') { throw new Error('Multipart: Boundary not found') }
  32112. const fieldSizeLimit = getLimit(limits, 'fieldSize', 1 * 1024 * 1024)
  32113. const fileSizeLimit = getLimit(limits, 'fileSize', Infinity)
  32114. const filesLimit = getLimit(limits, 'files', Infinity)
  32115. const fieldsLimit = getLimit(limits, 'fields', Infinity)
  32116. const partsLimit = getLimit(limits, 'parts', Infinity)
  32117. const headerPairsLimit = getLimit(limits, 'headerPairs', 2000)
  32118. const headerSizeLimit = getLimit(limits, 'headerSize', 80 * 1024)
  32119. let nfiles = 0
  32120. let nfields = 0
  32121. let nends = 0
  32122. let curFile
  32123. let curField
  32124. let finished = false
  32125. this._needDrain = false
  32126. this._pause = false
  32127. this._cb = undefined
  32128. this._nparts = 0
  32129. this._boy = boy
  32130. const parserCfg = {
  32131. boundary,
  32132. maxHeaderPairs: headerPairsLimit,
  32133. maxHeaderSize: headerSizeLimit,
  32134. partHwm: fileOpts.highWaterMark,
  32135. highWaterMark: cfg.highWaterMark
  32136. }
  32137. this.parser = new Dicer(parserCfg)
  32138. this.parser.on('drain', function () {
  32139. self._needDrain = false
  32140. if (self._cb && !self._pause) {
  32141. const cb = self._cb
  32142. self._cb = undefined
  32143. cb()
  32144. }
  32145. }).on('part', function onPart (part) {
  32146. if (++self._nparts > partsLimit) {
  32147. self.parser.removeListener('part', onPart)
  32148. self.parser.on('part', skipPart)
  32149. boy.hitPartsLimit = true
  32150. boy.emit('partsLimit')
  32151. return skipPart(part)
  32152. }
  32153. // hack because streams2 _always_ doesn't emit 'end' until nextTick, so let
  32154. // us emit 'end' early since we know the part has ended if we are already
  32155. // seeing the next part
  32156. if (curField) {
  32157. const field = curField
  32158. field.emit('end')
  32159. field.removeAllListeners('end')
  32160. }
  32161. part.on('header', function (header) {
  32162. let contype
  32163. let fieldname
  32164. let parsed
  32165. let charset
  32166. let encoding
  32167. let filename
  32168. let nsize = 0
  32169. if (header['content-type']) {
  32170. parsed = parseParams(header['content-type'][0])
  32171. if (parsed[0]) {
  32172. contype = parsed[0].toLowerCase()
  32173. for (i = 0, len = parsed.length; i < len; ++i) {
  32174. if (RE_CHARSET.test(parsed[i][0])) {
  32175. charset = parsed[i][1].toLowerCase()
  32176. break
  32177. }
  32178. }
  32179. }
  32180. }
  32181. if (contype === undefined) { contype = 'text/plain' }
  32182. if (charset === undefined) { charset = defCharset }
  32183. if (header['content-disposition']) {
  32184. parsed = parseParams(header['content-disposition'][0])
  32185. if (!RE_FIELD.test(parsed[0])) { return skipPart(part) }
  32186. for (i = 0, len = parsed.length; i < len; ++i) {
  32187. if (RE_NAME.test(parsed[i][0])) {
  32188. fieldname = parsed[i][1]
  32189. } else if (RE_FILENAME.test(parsed[i][0])) {
  32190. filename = parsed[i][1]
  32191. if (!preservePath) { filename = basename(filename) }
  32192. }
  32193. }
  32194. } else { return skipPart(part) }
  32195. if (header['content-transfer-encoding']) { encoding = header['content-transfer-encoding'][0].toLowerCase() } else { encoding = '7bit' }
  32196. let onData,
  32197. onEnd
  32198. if (isPartAFile(fieldname, contype, filename)) {
  32199. // file/binary field
  32200. if (nfiles === filesLimit) {
  32201. if (!boy.hitFilesLimit) {
  32202. boy.hitFilesLimit = true
  32203. boy.emit('filesLimit')
  32204. }
  32205. return skipPart(part)
  32206. }
  32207. ++nfiles
  32208. if (boy.listenerCount('file') === 0) {
  32209. self.parser._ignore()
  32210. return
  32211. }
  32212. ++nends
  32213. const file = new FileStream(fileOpts)
  32214. curFile = file
  32215. file.on('end', function () {
  32216. --nends
  32217. self._pause = false
  32218. checkFinished()
  32219. if (self._cb && !self._needDrain) {
  32220. const cb = self._cb
  32221. self._cb = undefined
  32222. cb()
  32223. }
  32224. })
  32225. file._read = function (n) {
  32226. if (!self._pause) { return }
  32227. self._pause = false
  32228. if (self._cb && !self._needDrain) {
  32229. const cb = self._cb
  32230. self._cb = undefined
  32231. cb()
  32232. }
  32233. }
  32234. boy.emit('file', fieldname, file, filename, encoding, contype)
  32235. onData = function (data) {
  32236. if ((nsize += data.length) > fileSizeLimit) {
  32237. const extralen = fileSizeLimit - nsize + data.length
  32238. if (extralen > 0) { file.push(data.slice(0, extralen)) }
  32239. file.truncated = true
  32240. file.bytesRead = fileSizeLimit
  32241. part.removeAllListeners('data')
  32242. file.emit('limit')
  32243. return
  32244. } else if (!file.push(data)) { self._pause = true }
  32245. file.bytesRead = nsize
  32246. }
  32247. onEnd = function () {
  32248. curFile = undefined
  32249. file.push(null)
  32250. }
  32251. } else {
  32252. // non-file field
  32253. if (nfields === fieldsLimit) {
  32254. if (!boy.hitFieldsLimit) {
  32255. boy.hitFieldsLimit = true
  32256. boy.emit('fieldsLimit')
  32257. }
  32258. return skipPart(part)
  32259. }
  32260. ++nfields
  32261. ++nends
  32262. let buffer = ''
  32263. let truncated = false
  32264. curField = part
  32265. onData = function (data) {
  32266. if ((nsize += data.length) > fieldSizeLimit) {
  32267. const extralen = (fieldSizeLimit - (nsize - data.length))
  32268. buffer += data.toString('binary', 0, extralen)
  32269. truncated = true
  32270. part.removeAllListeners('data')
  32271. } else { buffer += data.toString('binary') }
  32272. }
  32273. onEnd = function () {
  32274. curField = undefined
  32275. if (buffer.length) { buffer = decodeText(buffer, 'binary', charset) }
  32276. boy.emit('field', fieldname, buffer, false, truncated, encoding, contype)
  32277. --nends
  32278. checkFinished()
  32279. }
  32280. }
  32281. /* As of node@2efe4ab761666 (v0.10.29+/v0.11.14+), busboy had become
  32282. broken. Streams2/streams3 is a huge black box of confusion, but
  32283. somehow overriding the sync state seems to fix things again (and still
  32284. seems to work for previous node versions).
  32285. */
  32286. part._readableState.sync = false
  32287. part.on('data', onData)
  32288. part.on('end', onEnd)
  32289. }).on('error', function (err) {
  32290. if (curFile) { curFile.emit('error', err) }
  32291. })
  32292. }).on('error', function (err) {
  32293. boy.emit('error', err)
  32294. }).on('finish', function () {
  32295. finished = true
  32296. checkFinished()
  32297. })
  32298. }
  32299. Multipart.prototype.write = function (chunk, cb) {
  32300. const r = this.parser.write(chunk)
  32301. if (r && !this._pause) {
  32302. cb()
  32303. } else {
  32304. this._needDrain = !r
  32305. this._cb = cb
  32306. }
  32307. }
  32308. Multipart.prototype.end = function () {
  32309. const self = this
  32310. if (self.parser.writable) {
  32311. self.parser.end()
  32312. } else if (!self._boy._done) {
  32313. process.nextTick(function () {
  32314. self._boy._done = true
  32315. self._boy.emit('finish')
  32316. })
  32317. }
  32318. }
  32319. function skipPart (part) {
  32320. part.resume()
  32321. }
  32322. function FileStream (opts) {
  32323. Readable.call(this, opts)
  32324. this.bytesRead = 0
  32325. this.truncated = false
  32326. }
  32327. inherits(FileStream, Readable)
  32328. FileStream.prototype._read = function (n) {}
  32329. module.exports = Multipart
  32330. /***/ }),
  32331. /***/ 8306:
  32332. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  32333. "use strict";
  32334. const Decoder = __nccwpck_require__(7100)
  32335. const decodeText = __nccwpck_require__(4619)
  32336. const getLimit = __nccwpck_require__(1467)
  32337. const RE_CHARSET = /^charset$/i
  32338. UrlEncoded.detect = /^application\/x-www-form-urlencoded/i
  32339. function UrlEncoded (boy, cfg) {
  32340. const limits = cfg.limits
  32341. const parsedConType = cfg.parsedConType
  32342. this.boy = boy
  32343. this.fieldSizeLimit = getLimit(limits, 'fieldSize', 1 * 1024 * 1024)
  32344. this.fieldNameSizeLimit = getLimit(limits, 'fieldNameSize', 100)
  32345. this.fieldsLimit = getLimit(limits, 'fields', Infinity)
  32346. let charset
  32347. for (var i = 0, len = parsedConType.length; i < len; ++i) { // eslint-disable-line no-var
  32348. if (Array.isArray(parsedConType[i]) &&
  32349. RE_CHARSET.test(parsedConType[i][0])) {
  32350. charset = parsedConType[i][1].toLowerCase()
  32351. break
  32352. }
  32353. }
  32354. if (charset === undefined) { charset = cfg.defCharset || 'utf8' }
  32355. this.decoder = new Decoder()
  32356. this.charset = charset
  32357. this._fields = 0
  32358. this._state = 'key'
  32359. this._checkingBytes = true
  32360. this._bytesKey = 0
  32361. this._bytesVal = 0
  32362. this._key = ''
  32363. this._val = ''
  32364. this._keyTrunc = false
  32365. this._valTrunc = false
  32366. this._hitLimit = false
  32367. }
  32368. UrlEncoded.prototype.write = function (data, cb) {
  32369. if (this._fields === this.fieldsLimit) {
  32370. if (!this.boy.hitFieldsLimit) {
  32371. this.boy.hitFieldsLimit = true
  32372. this.boy.emit('fieldsLimit')
  32373. }
  32374. return cb()
  32375. }
  32376. let idxeq; let idxamp; let i; let p = 0; const len = data.length
  32377. while (p < len) {
  32378. if (this._state === 'key') {
  32379. idxeq = idxamp = undefined
  32380. for (i = p; i < len; ++i) {
  32381. if (!this._checkingBytes) { ++p }
  32382. if (data[i] === 0x3D/* = */) {
  32383. idxeq = i
  32384. break
  32385. } else if (data[i] === 0x26/* & */) {
  32386. idxamp = i
  32387. break
  32388. }
  32389. if (this._checkingBytes && this._bytesKey === this.fieldNameSizeLimit) {
  32390. this._hitLimit = true
  32391. break
  32392. } else if (this._checkingBytes) { ++this._bytesKey }
  32393. }
  32394. if (idxeq !== undefined) {
  32395. // key with assignment
  32396. if (idxeq > p) { this._key += this.decoder.write(data.toString('binary', p, idxeq)) }
  32397. this._state = 'val'
  32398. this._hitLimit = false
  32399. this._checkingBytes = true
  32400. this._val = ''
  32401. this._bytesVal = 0
  32402. this._valTrunc = false
  32403. this.decoder.reset()
  32404. p = idxeq + 1
  32405. } else if (idxamp !== undefined) {
  32406. // key with no assignment
  32407. ++this._fields
  32408. let key; const keyTrunc = this._keyTrunc
  32409. if (idxamp > p) { key = (this._key += this.decoder.write(data.toString('binary', p, idxamp))) } else { key = this._key }
  32410. this._hitLimit = false
  32411. this._checkingBytes = true
  32412. this._key = ''
  32413. this._bytesKey = 0
  32414. this._keyTrunc = false
  32415. this.decoder.reset()
  32416. if (key.length) {
  32417. this.boy.emit('field', decodeText(key, 'binary', this.charset),
  32418. '',
  32419. keyTrunc,
  32420. false)
  32421. }
  32422. p = idxamp + 1
  32423. if (this._fields === this.fieldsLimit) { return cb() }
  32424. } else if (this._hitLimit) {
  32425. // we may not have hit the actual limit if there are encoded bytes...
  32426. if (i > p) { this._key += this.decoder.write(data.toString('binary', p, i)) }
  32427. p = i
  32428. if ((this._bytesKey = this._key.length) === this.fieldNameSizeLimit) {
  32429. // yep, we actually did hit the limit
  32430. this._checkingBytes = false
  32431. this._keyTrunc = true
  32432. }
  32433. } else {
  32434. if (p < len) { this._key += this.decoder.write(data.toString('binary', p)) }
  32435. p = len
  32436. }
  32437. } else {
  32438. idxamp = undefined
  32439. for (i = p; i < len; ++i) {
  32440. if (!this._checkingBytes) { ++p }
  32441. if (data[i] === 0x26/* & */) {
  32442. idxamp = i
  32443. break
  32444. }
  32445. if (this._checkingBytes && this._bytesVal === this.fieldSizeLimit) {
  32446. this._hitLimit = true
  32447. break
  32448. } else if (this._checkingBytes) { ++this._bytesVal }
  32449. }
  32450. if (idxamp !== undefined) {
  32451. ++this._fields
  32452. if (idxamp > p) { this._val += this.decoder.write(data.toString('binary', p, idxamp)) }
  32453. this.boy.emit('field', decodeText(this._key, 'binary', this.charset),
  32454. decodeText(this._val, 'binary', this.charset),
  32455. this._keyTrunc,
  32456. this._valTrunc)
  32457. this._state = 'key'
  32458. this._hitLimit = false
  32459. this._checkingBytes = true
  32460. this._key = ''
  32461. this._bytesKey = 0
  32462. this._keyTrunc = false
  32463. this.decoder.reset()
  32464. p = idxamp + 1
  32465. if (this._fields === this.fieldsLimit) { return cb() }
  32466. } else if (this._hitLimit) {
  32467. // we may not have hit the actual limit if there are encoded bytes...
  32468. if (i > p) { this._val += this.decoder.write(data.toString('binary', p, i)) }
  32469. p = i
  32470. if ((this._val === '' && this.fieldSizeLimit === 0) ||
  32471. (this._bytesVal = this._val.length) === this.fieldSizeLimit) {
  32472. // yep, we actually did hit the limit
  32473. this._checkingBytes = false
  32474. this._valTrunc = true
  32475. }
  32476. } else {
  32477. if (p < len) { this._val += this.decoder.write(data.toString('binary', p)) }
  32478. p = len
  32479. }
  32480. }
  32481. }
  32482. cb()
  32483. }
  32484. UrlEncoded.prototype.end = function () {
  32485. if (this.boy._done) { return }
  32486. if (this._state === 'key' && this._key.length > 0) {
  32487. this.boy.emit('field', decodeText(this._key, 'binary', this.charset),
  32488. '',
  32489. this._keyTrunc,
  32490. false)
  32491. } else if (this._state === 'val') {
  32492. this.boy.emit('field', decodeText(this._key, 'binary', this.charset),
  32493. decodeText(this._val, 'binary', this.charset),
  32494. this._keyTrunc,
  32495. this._valTrunc)
  32496. }
  32497. this.boy._done = true
  32498. this.boy.emit('finish')
  32499. }
  32500. module.exports = UrlEncoded
  32501. /***/ }),
  32502. /***/ 7100:
  32503. /***/ ((module) => {
  32504. "use strict";
  32505. const RE_PLUS = /\+/g
  32506. const HEX = [
  32507. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  32508. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  32509. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  32510. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0,
  32511. 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  32512. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  32513. 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  32514. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
  32515. ]
  32516. function Decoder () {
  32517. this.buffer = undefined
  32518. }
  32519. Decoder.prototype.write = function (str) {
  32520. // Replace '+' with ' ' before decoding
  32521. str = str.replace(RE_PLUS, ' ')
  32522. let res = ''
  32523. let i = 0; let p = 0; const len = str.length
  32524. for (; i < len; ++i) {
  32525. if (this.buffer !== undefined) {
  32526. if (!HEX[str.charCodeAt(i)]) {
  32527. res += '%' + this.buffer
  32528. this.buffer = undefined
  32529. --i // retry character
  32530. } else {
  32531. this.buffer += str[i]
  32532. ++p
  32533. if (this.buffer.length === 2) {
  32534. res += String.fromCharCode(parseInt(this.buffer, 16))
  32535. this.buffer = undefined
  32536. }
  32537. }
  32538. } else if (str[i] === '%') {
  32539. if (i > p) {
  32540. res += str.substring(p, i)
  32541. p = i
  32542. }
  32543. this.buffer = ''
  32544. ++p
  32545. }
  32546. }
  32547. if (p < len && this.buffer === undefined) { res += str.substring(p) }
  32548. return res
  32549. }
  32550. Decoder.prototype.reset = function () {
  32551. this.buffer = undefined
  32552. }
  32553. module.exports = Decoder
  32554. /***/ }),
  32555. /***/ 8647:
  32556. /***/ ((module) => {
  32557. "use strict";
  32558. module.exports = function basename (path) {
  32559. if (typeof path !== 'string') { return '' }
  32560. for (var i = path.length - 1; i >= 0; --i) { // eslint-disable-line no-var
  32561. switch (path.charCodeAt(i)) {
  32562. case 0x2F: // '/'
  32563. case 0x5C: // '\'
  32564. path = path.slice(i + 1)
  32565. return (path === '..' || path === '.' ? '' : path)
  32566. }
  32567. }
  32568. return (path === '..' || path === '.' ? '' : path)
  32569. }
  32570. /***/ }),
  32571. /***/ 4619:
  32572. /***/ (function(module) {
  32573. "use strict";
  32574. // Node has always utf-8
  32575. const utf8Decoder = new TextDecoder('utf-8')
  32576. const textDecoders = new Map([
  32577. ['utf-8', utf8Decoder],
  32578. ['utf8', utf8Decoder]
  32579. ])
  32580. function getDecoder (charset) {
  32581. let lc
  32582. while (true) {
  32583. switch (charset) {
  32584. case 'utf-8':
  32585. case 'utf8':
  32586. return decoders.utf8
  32587. case 'latin1':
  32588. case 'ascii': // TODO: Make these a separate, strict decoder?
  32589. case 'us-ascii':
  32590. case 'iso-8859-1':
  32591. case 'iso8859-1':
  32592. case 'iso88591':
  32593. case 'iso_8859-1':
  32594. case 'windows-1252':
  32595. case 'iso_8859-1:1987':
  32596. case 'cp1252':
  32597. case 'x-cp1252':
  32598. return decoders.latin1
  32599. case 'utf16le':
  32600. case 'utf-16le':
  32601. case 'ucs2':
  32602. case 'ucs-2':
  32603. return decoders.utf16le
  32604. case 'base64':
  32605. return decoders.base64
  32606. default:
  32607. if (lc === undefined) {
  32608. lc = true
  32609. charset = charset.toLowerCase()
  32610. continue
  32611. }
  32612. return decoders.other.bind(charset)
  32613. }
  32614. }
  32615. }
  32616. const decoders = {
  32617. utf8: (data, sourceEncoding) => {
  32618. if (data.length === 0) {
  32619. return ''
  32620. }
  32621. if (typeof data === 'string') {
  32622. data = Buffer.from(data, sourceEncoding)
  32623. }
  32624. return data.utf8Slice(0, data.length)
  32625. },
  32626. latin1: (data, sourceEncoding) => {
  32627. if (data.length === 0) {
  32628. return ''
  32629. }
  32630. if (typeof data === 'string') {
  32631. return data
  32632. }
  32633. return data.latin1Slice(0, data.length)
  32634. },
  32635. utf16le: (data, sourceEncoding) => {
  32636. if (data.length === 0) {
  32637. return ''
  32638. }
  32639. if (typeof data === 'string') {
  32640. data = Buffer.from(data, sourceEncoding)
  32641. }
  32642. return data.ucs2Slice(0, data.length)
  32643. },
  32644. base64: (data, sourceEncoding) => {
  32645. if (data.length === 0) {
  32646. return ''
  32647. }
  32648. if (typeof data === 'string') {
  32649. data = Buffer.from(data, sourceEncoding)
  32650. }
  32651. return data.base64Slice(0, data.length)
  32652. },
  32653. other: (data, sourceEncoding) => {
  32654. if (data.length === 0) {
  32655. return ''
  32656. }
  32657. if (typeof data === 'string') {
  32658. data = Buffer.from(data, sourceEncoding)
  32659. }
  32660. if (textDecoders.has(this.toString())) {
  32661. try {
  32662. return textDecoders.get(this).decode(data)
  32663. } catch {}
  32664. }
  32665. return typeof data === 'string'
  32666. ? data
  32667. : data.toString()
  32668. }
  32669. }
  32670. function decodeText (text, sourceEncoding, destEncoding) {
  32671. if (text) {
  32672. return getDecoder(destEncoding)(text, sourceEncoding)
  32673. }
  32674. return text
  32675. }
  32676. module.exports = decodeText
  32677. /***/ }),
  32678. /***/ 1467:
  32679. /***/ ((module) => {
  32680. "use strict";
  32681. module.exports = function getLimit (limits, name, defaultLimit) {
  32682. if (
  32683. !limits ||
  32684. limits[name] === undefined ||
  32685. limits[name] === null
  32686. ) { return defaultLimit }
  32687. if (
  32688. typeof limits[name] !== 'number' ||
  32689. isNaN(limits[name])
  32690. ) { throw new TypeError('Limit ' + name + ' is not a valid number') }
  32691. return limits[name]
  32692. }
  32693. /***/ }),
  32694. /***/ 1854:
  32695. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  32696. "use strict";
  32697. /* eslint-disable object-property-newline */
  32698. const decodeText = __nccwpck_require__(4619)
  32699. const RE_ENCODED = /%[a-fA-F0-9][a-fA-F0-9]/g
  32700. const EncodedLookup = {
  32701. '%00': '\x00', '%01': '\x01', '%02': '\x02', '%03': '\x03', '%04': '\x04',
  32702. '%05': '\x05', '%06': '\x06', '%07': '\x07', '%08': '\x08', '%09': '\x09',
  32703. '%0a': '\x0a', '%0A': '\x0a', '%0b': '\x0b', '%0B': '\x0b', '%0c': '\x0c',
  32704. '%0C': '\x0c', '%0d': '\x0d', '%0D': '\x0d', '%0e': '\x0e', '%0E': '\x0e',
  32705. '%0f': '\x0f', '%0F': '\x0f', '%10': '\x10', '%11': '\x11', '%12': '\x12',
  32706. '%13': '\x13', '%14': '\x14', '%15': '\x15', '%16': '\x16', '%17': '\x17',
  32707. '%18': '\x18', '%19': '\x19', '%1a': '\x1a', '%1A': '\x1a', '%1b': '\x1b',
  32708. '%1B': '\x1b', '%1c': '\x1c', '%1C': '\x1c', '%1d': '\x1d', '%1D': '\x1d',
  32709. '%1e': '\x1e', '%1E': '\x1e', '%1f': '\x1f', '%1F': '\x1f', '%20': '\x20',
  32710. '%21': '\x21', '%22': '\x22', '%23': '\x23', '%24': '\x24', '%25': '\x25',
  32711. '%26': '\x26', '%27': '\x27', '%28': '\x28', '%29': '\x29', '%2a': '\x2a',
  32712. '%2A': '\x2a', '%2b': '\x2b', '%2B': '\x2b', '%2c': '\x2c', '%2C': '\x2c',
  32713. '%2d': '\x2d', '%2D': '\x2d', '%2e': '\x2e', '%2E': '\x2e', '%2f': '\x2f',
  32714. '%2F': '\x2f', '%30': '\x30', '%31': '\x31', '%32': '\x32', '%33': '\x33',
  32715. '%34': '\x34', '%35': '\x35', '%36': '\x36', '%37': '\x37', '%38': '\x38',
  32716. '%39': '\x39', '%3a': '\x3a', '%3A': '\x3a', '%3b': '\x3b', '%3B': '\x3b',
  32717. '%3c': '\x3c', '%3C': '\x3c', '%3d': '\x3d', '%3D': '\x3d', '%3e': '\x3e',
  32718. '%3E': '\x3e', '%3f': '\x3f', '%3F': '\x3f', '%40': '\x40', '%41': '\x41',
  32719. '%42': '\x42', '%43': '\x43', '%44': '\x44', '%45': '\x45', '%46': '\x46',
  32720. '%47': '\x47', '%48': '\x48', '%49': '\x49', '%4a': '\x4a', '%4A': '\x4a',
  32721. '%4b': '\x4b', '%4B': '\x4b', '%4c': '\x4c', '%4C': '\x4c', '%4d': '\x4d',
  32722. '%4D': '\x4d', '%4e': '\x4e', '%4E': '\x4e', '%4f': '\x4f', '%4F': '\x4f',
  32723. '%50': '\x50', '%51': '\x51', '%52': '\x52', '%53': '\x53', '%54': '\x54',
  32724. '%55': '\x55', '%56': '\x56', '%57': '\x57', '%58': '\x58', '%59': '\x59',
  32725. '%5a': '\x5a', '%5A': '\x5a', '%5b': '\x5b', '%5B': '\x5b', '%5c': '\x5c',
  32726. '%5C': '\x5c', '%5d': '\x5d', '%5D': '\x5d', '%5e': '\x5e', '%5E': '\x5e',
  32727. '%5f': '\x5f', '%5F': '\x5f', '%60': '\x60', '%61': '\x61', '%62': '\x62',
  32728. '%63': '\x63', '%64': '\x64', '%65': '\x65', '%66': '\x66', '%67': '\x67',
  32729. '%68': '\x68', '%69': '\x69', '%6a': '\x6a', '%6A': '\x6a', '%6b': '\x6b',
  32730. '%6B': '\x6b', '%6c': '\x6c', '%6C': '\x6c', '%6d': '\x6d', '%6D': '\x6d',
  32731. '%6e': '\x6e', '%6E': '\x6e', '%6f': '\x6f', '%6F': '\x6f', '%70': '\x70',
  32732. '%71': '\x71', '%72': '\x72', '%73': '\x73', '%74': '\x74', '%75': '\x75',
  32733. '%76': '\x76', '%77': '\x77', '%78': '\x78', '%79': '\x79', '%7a': '\x7a',
  32734. '%7A': '\x7a', '%7b': '\x7b', '%7B': '\x7b', '%7c': '\x7c', '%7C': '\x7c',
  32735. '%7d': '\x7d', '%7D': '\x7d', '%7e': '\x7e', '%7E': '\x7e', '%7f': '\x7f',
  32736. '%7F': '\x7f', '%80': '\x80', '%81': '\x81', '%82': '\x82', '%83': '\x83',
  32737. '%84': '\x84', '%85': '\x85', '%86': '\x86', '%87': '\x87', '%88': '\x88',
  32738. '%89': '\x89', '%8a': '\x8a', '%8A': '\x8a', '%8b': '\x8b', '%8B': '\x8b',
  32739. '%8c': '\x8c', '%8C': '\x8c', '%8d': '\x8d', '%8D': '\x8d', '%8e': '\x8e',
  32740. '%8E': '\x8e', '%8f': '\x8f', '%8F': '\x8f', '%90': '\x90', '%91': '\x91',
  32741. '%92': '\x92', '%93': '\x93', '%94': '\x94', '%95': '\x95', '%96': '\x96',
  32742. '%97': '\x97', '%98': '\x98', '%99': '\x99', '%9a': '\x9a', '%9A': '\x9a',
  32743. '%9b': '\x9b', '%9B': '\x9b', '%9c': '\x9c', '%9C': '\x9c', '%9d': '\x9d',
  32744. '%9D': '\x9d', '%9e': '\x9e', '%9E': '\x9e', '%9f': '\x9f', '%9F': '\x9f',
  32745. '%a0': '\xa0', '%A0': '\xa0', '%a1': '\xa1', '%A1': '\xa1', '%a2': '\xa2',
  32746. '%A2': '\xa2', '%a3': '\xa3', '%A3': '\xa3', '%a4': '\xa4', '%A4': '\xa4',
  32747. '%a5': '\xa5', '%A5': '\xa5', '%a6': '\xa6', '%A6': '\xa6', '%a7': '\xa7',
  32748. '%A7': '\xa7', '%a8': '\xa8', '%A8': '\xa8', '%a9': '\xa9', '%A9': '\xa9',
  32749. '%aa': '\xaa', '%Aa': '\xaa', '%aA': '\xaa', '%AA': '\xaa', '%ab': '\xab',
  32750. '%Ab': '\xab', '%aB': '\xab', '%AB': '\xab', '%ac': '\xac', '%Ac': '\xac',
  32751. '%aC': '\xac', '%AC': '\xac', '%ad': '\xad', '%Ad': '\xad', '%aD': '\xad',
  32752. '%AD': '\xad', '%ae': '\xae', '%Ae': '\xae', '%aE': '\xae', '%AE': '\xae',
  32753. '%af': '\xaf', '%Af': '\xaf', '%aF': '\xaf', '%AF': '\xaf', '%b0': '\xb0',
  32754. '%B0': '\xb0', '%b1': '\xb1', '%B1': '\xb1', '%b2': '\xb2', '%B2': '\xb2',
  32755. '%b3': '\xb3', '%B3': '\xb3', '%b4': '\xb4', '%B4': '\xb4', '%b5': '\xb5',
  32756. '%B5': '\xb5', '%b6': '\xb6', '%B6': '\xb6', '%b7': '\xb7', '%B7': '\xb7',
  32757. '%b8': '\xb8', '%B8': '\xb8', '%b9': '\xb9', '%B9': '\xb9', '%ba': '\xba',
  32758. '%Ba': '\xba', '%bA': '\xba', '%BA': '\xba', '%bb': '\xbb', '%Bb': '\xbb',
  32759. '%bB': '\xbb', '%BB': '\xbb', '%bc': '\xbc', '%Bc': '\xbc', '%bC': '\xbc',
  32760. '%BC': '\xbc', '%bd': '\xbd', '%Bd': '\xbd', '%bD': '\xbd', '%BD': '\xbd',
  32761. '%be': '\xbe', '%Be': '\xbe', '%bE': '\xbe', '%BE': '\xbe', '%bf': '\xbf',
  32762. '%Bf': '\xbf', '%bF': '\xbf', '%BF': '\xbf', '%c0': '\xc0', '%C0': '\xc0',
  32763. '%c1': '\xc1', '%C1': '\xc1', '%c2': '\xc2', '%C2': '\xc2', '%c3': '\xc3',
  32764. '%C3': '\xc3', '%c4': '\xc4', '%C4': '\xc4', '%c5': '\xc5', '%C5': '\xc5',
  32765. '%c6': '\xc6', '%C6': '\xc6', '%c7': '\xc7', '%C7': '\xc7', '%c8': '\xc8',
  32766. '%C8': '\xc8', '%c9': '\xc9', '%C9': '\xc9', '%ca': '\xca', '%Ca': '\xca',
  32767. '%cA': '\xca', '%CA': '\xca', '%cb': '\xcb', '%Cb': '\xcb', '%cB': '\xcb',
  32768. '%CB': '\xcb', '%cc': '\xcc', '%Cc': '\xcc', '%cC': '\xcc', '%CC': '\xcc',
  32769. '%cd': '\xcd', '%Cd': '\xcd', '%cD': '\xcd', '%CD': '\xcd', '%ce': '\xce',
  32770. '%Ce': '\xce', '%cE': '\xce', '%CE': '\xce', '%cf': '\xcf', '%Cf': '\xcf',
  32771. '%cF': '\xcf', '%CF': '\xcf', '%d0': '\xd0', '%D0': '\xd0', '%d1': '\xd1',
  32772. '%D1': '\xd1', '%d2': '\xd2', '%D2': '\xd2', '%d3': '\xd3', '%D3': '\xd3',
  32773. '%d4': '\xd4', '%D4': '\xd4', '%d5': '\xd5', '%D5': '\xd5', '%d6': '\xd6',
  32774. '%D6': '\xd6', '%d7': '\xd7', '%D7': '\xd7', '%d8': '\xd8', '%D8': '\xd8',
  32775. '%d9': '\xd9', '%D9': '\xd9', '%da': '\xda', '%Da': '\xda', '%dA': '\xda',
  32776. '%DA': '\xda', '%db': '\xdb', '%Db': '\xdb', '%dB': '\xdb', '%DB': '\xdb',
  32777. '%dc': '\xdc', '%Dc': '\xdc', '%dC': '\xdc', '%DC': '\xdc', '%dd': '\xdd',
  32778. '%Dd': '\xdd', '%dD': '\xdd', '%DD': '\xdd', '%de': '\xde', '%De': '\xde',
  32779. '%dE': '\xde', '%DE': '\xde', '%df': '\xdf', '%Df': '\xdf', '%dF': '\xdf',
  32780. '%DF': '\xdf', '%e0': '\xe0', '%E0': '\xe0', '%e1': '\xe1', '%E1': '\xe1',
  32781. '%e2': '\xe2', '%E2': '\xe2', '%e3': '\xe3', '%E3': '\xe3', '%e4': '\xe4',
  32782. '%E4': '\xe4', '%e5': '\xe5', '%E5': '\xe5', '%e6': '\xe6', '%E6': '\xe6',
  32783. '%e7': '\xe7', '%E7': '\xe7', '%e8': '\xe8', '%E8': '\xe8', '%e9': '\xe9',
  32784. '%E9': '\xe9', '%ea': '\xea', '%Ea': '\xea', '%eA': '\xea', '%EA': '\xea',
  32785. '%eb': '\xeb', '%Eb': '\xeb', '%eB': '\xeb', '%EB': '\xeb', '%ec': '\xec',
  32786. '%Ec': '\xec', '%eC': '\xec', '%EC': '\xec', '%ed': '\xed', '%Ed': '\xed',
  32787. '%eD': '\xed', '%ED': '\xed', '%ee': '\xee', '%Ee': '\xee', '%eE': '\xee',
  32788. '%EE': '\xee', '%ef': '\xef', '%Ef': '\xef', '%eF': '\xef', '%EF': '\xef',
  32789. '%f0': '\xf0', '%F0': '\xf0', '%f1': '\xf1', '%F1': '\xf1', '%f2': '\xf2',
  32790. '%F2': '\xf2', '%f3': '\xf3', '%F3': '\xf3', '%f4': '\xf4', '%F4': '\xf4',
  32791. '%f5': '\xf5', '%F5': '\xf5', '%f6': '\xf6', '%F6': '\xf6', '%f7': '\xf7',
  32792. '%F7': '\xf7', '%f8': '\xf8', '%F8': '\xf8', '%f9': '\xf9', '%F9': '\xf9',
  32793. '%fa': '\xfa', '%Fa': '\xfa', '%fA': '\xfa', '%FA': '\xfa', '%fb': '\xfb',
  32794. '%Fb': '\xfb', '%fB': '\xfb', '%FB': '\xfb', '%fc': '\xfc', '%Fc': '\xfc',
  32795. '%fC': '\xfc', '%FC': '\xfc', '%fd': '\xfd', '%Fd': '\xfd', '%fD': '\xfd',
  32796. '%FD': '\xfd', '%fe': '\xfe', '%Fe': '\xfe', '%fE': '\xfe', '%FE': '\xfe',
  32797. '%ff': '\xff', '%Ff': '\xff', '%fF': '\xff', '%FF': '\xff'
  32798. }
  32799. function encodedReplacer (match) {
  32800. return EncodedLookup[match]
  32801. }
  32802. const STATE_KEY = 0
  32803. const STATE_VALUE = 1
  32804. const STATE_CHARSET = 2
  32805. const STATE_LANG = 3
  32806. function parseParams (str) {
  32807. const res = []
  32808. let state = STATE_KEY
  32809. let charset = ''
  32810. let inquote = false
  32811. let escaping = false
  32812. let p = 0
  32813. let tmp = ''
  32814. const len = str.length
  32815. for (var i = 0; i < len; ++i) { // eslint-disable-line no-var
  32816. const char = str[i]
  32817. if (char === '\\' && inquote) {
  32818. if (escaping) { escaping = false } else {
  32819. escaping = true
  32820. continue
  32821. }
  32822. } else if (char === '"') {
  32823. if (!escaping) {
  32824. if (inquote) {
  32825. inquote = false
  32826. state = STATE_KEY
  32827. } else { inquote = true }
  32828. continue
  32829. } else { escaping = false }
  32830. } else {
  32831. if (escaping && inquote) { tmp += '\\' }
  32832. escaping = false
  32833. if ((state === STATE_CHARSET || state === STATE_LANG) && char === "'") {
  32834. if (state === STATE_CHARSET) {
  32835. state = STATE_LANG
  32836. charset = tmp.substring(1)
  32837. } else { state = STATE_VALUE }
  32838. tmp = ''
  32839. continue
  32840. } else if (state === STATE_KEY &&
  32841. (char === '*' || char === '=') &&
  32842. res.length) {
  32843. state = char === '*'
  32844. ? STATE_CHARSET
  32845. : STATE_VALUE
  32846. res[p] = [tmp, undefined]
  32847. tmp = ''
  32848. continue
  32849. } else if (!inquote && char === ';') {
  32850. state = STATE_KEY
  32851. if (charset) {
  32852. if (tmp.length) {
  32853. tmp = decodeText(tmp.replace(RE_ENCODED, encodedReplacer),
  32854. 'binary',
  32855. charset)
  32856. }
  32857. charset = ''
  32858. } else if (tmp.length) {
  32859. tmp = decodeText(tmp, 'binary', 'utf8')
  32860. }
  32861. if (res[p] === undefined) { res[p] = tmp } else { res[p][1] = tmp }
  32862. tmp = ''
  32863. ++p
  32864. continue
  32865. } else if (!inquote && (char === ' ' || char === '\t')) { continue }
  32866. }
  32867. tmp += char
  32868. }
  32869. if (charset && tmp.length) {
  32870. tmp = decodeText(tmp.replace(RE_ENCODED, encodedReplacer),
  32871. 'binary',
  32872. charset)
  32873. } else if (tmp) {
  32874. tmp = decodeText(tmp, 'binary', 'utf8')
  32875. }
  32876. if (res[p] === undefined) {
  32877. if (tmp) { res[p] = tmp }
  32878. } else { res[p][1] = tmp }
  32879. return res
  32880. }
  32881. module.exports = parseParams
  32882. /***/ })
  32883. /******/ });
  32884. /************************************************************************/
  32885. /******/ // The module cache
  32886. /******/ var __webpack_module_cache__ = {};
  32887. /******/
  32888. /******/ // The require function
  32889. /******/ function __nccwpck_require__(moduleId) {
  32890. /******/ // Check if module is in cache
  32891. /******/ var cachedModule = __webpack_module_cache__[moduleId];
  32892. /******/ if (cachedModule !== undefined) {
  32893. /******/ return cachedModule.exports;
  32894. /******/ }
  32895. /******/ // Create a new module (and put it into the cache)
  32896. /******/ var module = __webpack_module_cache__[moduleId] = {
  32897. /******/ // no module.id needed
  32898. /******/ // no module.loaded needed
  32899. /******/ exports: {}
  32900. /******/ };
  32901. /******/
  32902. /******/ // Execute the module function
  32903. /******/ var threw = true;
  32904. /******/ try {
  32905. /******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __nccwpck_require__);
  32906. /******/ threw = false;
  32907. /******/ } finally {
  32908. /******/ if(threw) delete __webpack_module_cache__[moduleId];
  32909. /******/ }
  32910. /******/
  32911. /******/ // Return the exports of the module
  32912. /******/ return module.exports;
  32913. /******/ }
  32914. /******/
  32915. /************************************************************************/
  32916. /******/ /* webpack/runtime/compat */
  32917. /******/
  32918. /******/ if (typeof __nccwpck_require__ !== 'undefined') __nccwpck_require__.ab = __dirname + "/";
  32919. /******/
  32920. /************************************************************************/
  32921. /******/
  32922. /******/ // startup
  32923. /******/ // Load entry module and return exports
  32924. /******/ // This entry module is referenced by other modules so it can't be inlined
  32925. /******/ var __webpack_exports__ = __nccwpck_require__(3109);
  32926. /******/ module.exports = __webpack_exports__;
  32927. /******/
  32928. /******/ })()
  32929. ;